@capgo/cli 4.26.4 → 4.26.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var ZL=Object.create;var rl=Object.defineProperty;var QL=Object.getOwnPropertyDescriptor;var eB=Object.getOwnPropertyNames;var tB=Object.getPrototypeOf,rB=Object.prototype.hasOwnProperty;var ut=(t,e)=>()=>(t&&(e=t(t=0)),e);var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mn=(t,e)=>{for(var r in e)rl(t,r,{get:e[r],enumerable:!0})},uw=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of eB(e))!rB.call(t,i)&&i!==r&&rl(t,i,{get:()=>e[i],enumerable:!(n=QL(e,i))||n.enumerable});return t};var ce=(t,e,r)=>(r=t!=null?ZL(tB(t)):{},uw(e||!t||!t.__esModule?rl(r,"default",{value:t,enumerable:!0}):r,t)),ke=t=>uw(rl({},"__esModule",{value:!0}),t);var ja=D(_p=>{var nl=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},wp=class extends nl{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};_p.CommanderError=nl;_p.InvalidArgumentError=wp});var il=D(Cp=>{var{InvalidArgumentError:nB}=ja(),Ep=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new nB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function iB(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Cp.Argument=Ep;Cp.humanReadableArgName=iB});var xp=D(cw=>{var{humanReadableArgName:oB}=il(),Sp=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>oB(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,r.subcommandTerm(i).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,r.argumentTerm(i).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth||80,o=2,s=2;function a(p,v){if(v){let g=`${p.padEnd(n+s)}${v}`;return r.wrap(g,i-o,n+s)}return p}function u(p){return p.join(`
2
+ "use strict";var QL=Object.create;var rl=Object.defineProperty;var eB=Object.getOwnPropertyDescriptor;var tB=Object.getOwnPropertyNames;var rB=Object.getPrototypeOf,nB=Object.prototype.hasOwnProperty;var ut=(t,e)=>()=>(t&&(e=t(t=0)),e);var D=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mn=(t,e)=>{for(var r in e)rl(t,r,{get:e[r],enumerable:!0})},uw=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tB(e))!nB.call(t,i)&&i!==r&&rl(t,i,{get:()=>e[i],enumerable:!(n=eB(e,i))||n.enumerable});return t};var ce=(t,e,r)=>(r=t!=null?QL(rB(t)):{},uw(e||!t||!t.__esModule?rl(r,"default",{value:t,enumerable:!0}):r,t)),ke=t=>uw(rl({},"__esModule",{value:!0}),t);var ja=D(_p=>{var nl=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},wp=class extends nl{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};_p.CommanderError=nl;_p.InvalidArgumentError=wp});var il=D(Cp=>{var{InvalidArgumentError:iB}=ja(),Ep=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new iB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function oB(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Cp.Argument=Ep;Cp.humanReadableArgName=oB});var xp=D(cw=>{var{humanReadableArgName:sB}=il(),Sp=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(e,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),o=n.long&&e._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(e.createOption(n.long,n.description)):n.short&&!i&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>sB(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,i)=>Math.max(n,r.subcommandTerm(i).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,r.optionTerm(i).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,i)=>Math.max(n,r.argumentTerm(i).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),i=r.helpWidth||80,o=2,s=2;function a(p,v){if(v){let g=`${p.padEnd(n+s)}${v}`;return r.wrap(g,i-o,n+s)}return p}function u(p){return p.join(`
3
3
  `).replace(/^/gm," ".repeat(o))}let c=[`Usage: ${r.commandUsage(e)}`,""],l=r.commandDescription(e);l.length>0&&(c=c.concat([r.wrap(l,i,0),""]));let f=r.visibleArguments(e).map(p=>a(r.argumentTerm(p),r.argumentDescription(p)));f.length>0&&(c=c.concat(["Arguments:",u(f),""]));let h=r.visibleOptions(e).map(p=>a(r.optionTerm(p),r.optionDescription(p)));if(h.length>0&&(c=c.concat(["Options:",u(h),""])),this.showGlobalOptions){let p=r.visibleGlobalOptions(e).map(v=>a(r.optionTerm(v),r.optionDescription(v)));p.length>0&&(c=c.concat(["Global Options:",u(p),""]))}let d=r.visibleCommands(e).map(p=>a(r.subcommandTerm(p),r.subcommandDescription(p)));return d.length>0&&(c=c.concat(["Commands:",u(d),""])),c.join(`
4
4
  `)}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}wrap(e,r,n,i=40){let o=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${o}]+`);if(e.match(s))return e;let a=r-n;if(a<i)return e;let u=e.slice(0,n),c=e.slice(n).replace(`\r
5
5
  `,`
6
6
  `),l=" ".repeat(n),h="\\s\u200B",d=new RegExp(`
7
7
  |.{1,${a-1}}([${h}]|$)|[^${h}]+?([${h}]|$)`,"g"),p=c.match(d)||[];return u+p.map((v,g)=>v===`
8
8
  `?"":(g>0?l:"")+v.trimEnd()).join(`
9
- `)}};cw.Help=Sp});var kp=D(Ap=>{var{InvalidArgumentError:sB}=ja(),Fp=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=uB(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new sB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return aB(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Op=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function aB(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function uB(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Ap.Option=Fp;Ap.DualOptions=Op});var fw=D(lw=>{function cB(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function lB(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=cB(t,s),u=Math.max(t.length,s.length);(u-a)/u>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
9
+ `)}};cw.Help=Sp});var kp=D(Ap=>{var{InvalidArgumentError:aB}=ja(),Fp=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=cB(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new aB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return uB(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Op=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===e)}};function uB(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function cB(t){let e,r,n=t.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(e=n.shift()),r=n.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}Ap.Option=Fp;Ap.DualOptions=Op});var fw=D(lw=>{function lB(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let i=1;i<=t.length;i++){let o=1;t[i-1]===e[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&t[i-1]===e[n-2]&&t[i-2]===e[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[t.length][e.length]}function fB(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let n=[],i=3,o=.4;return e.forEach(s=>{if(s.length<=1)return;let a=lB(t,s),u=Math.max(t.length,s.length);(u-a)/u>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
10
10
  (Did you mean one of ${n.join(", ")}?)`:n.length===1?`
11
- (Did you mean ${n[0]}?)`:""}lw.suggestSimilar=lB});var gw=D(mw=>{var fB=require("node:events").EventEmitter,Tp=require("node:child_process"),gn=require("node:path"),Pp=require("node:fs"),We=require("node:process"),{Argument:dB,humanReadableArgName:hB}=il(),{CommanderError:Rp}=ja(),{Help:pB}=xp(),{Option:dw,DualOptions:mB}=kp(),{suggestSimilar:hw}=fw(),$p=class t extends fB{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>We.stdout.write(r),writeErr:r=>We.stderr.write(r),getOutHelpWidth:()=>We.stdout.isTTY?We.stdout.columns:void 0,getErrHelpWidth:()=>We.stderr.isTTY?We.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new pB,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
12
- - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new dB(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),o=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),o&&s.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
11
+ (Did you mean ${n[0]}?)`:""}lw.suggestSimilar=fB});var gw=D(mw=>{var dB=require("node:events").EventEmitter,Tp=require("node:child_process"),gn=require("node:path"),Pp=require("node:fs"),We=require("node:process"),{Argument:hB,humanReadableArgName:pB}=il(),{CommanderError:Rp}=ja(),{Help:mB}=xp(),{Option:dw,DualOptions:gB}=kp(),{suggestSimilar:hw}=fw(),$p=class t extends dB{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>We.stdout.write(r),writeErr:r=>We.stderr.write(r),getOutHelpWidth:()=>We.stdout.isTTY?We.stdout.columns:void 0,getErrHelpWidth:()=>We.stderr.isTTY?We.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new mB,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
12
+ - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new hB(e,r)}argument(e,r,n,i){let o=this.createArgument(e,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,i]=e.match(/([^ ]+) *(.*)/),o=r??"display help for command",s=this.createCommand(n);return s.helpOption(!1),i&&s.arguments(i),o&&s.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=s,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
13
13
  Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new Rp(e,r,n)),We.exit(e)}action(e){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),e.apply(this,o)};return this._actionHandler=r,this}createOption(e,r){return new dw(e,r)}_callParseArg(e,r,n,i){try{return e.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
14
14
  - already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=i=>[i.name()].concat(i.aliases()),n=r(e).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(e).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let o=e.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let i=(o,s,a)=>{o==null&&e.presetArg!==void 0&&(o=e.presetArg);let u=this.getOptionValue(n);o!==null&&e.parseArg?o=this._callParseArg(e,o,u,s):o!==null&&e.variadic&&(o=e._concatValue(o,u)),o==null&&(e.negate?o=!1:e.isBoolean()||e.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(e,r,n,i,o){if(typeof r=="object"&&r instanceof dw)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!e.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(e,r,n,i){return this._optionEx({},e,r,n,i)}requiredOption(e,r,n,i){return this._optionEx({mandatory:!0},e,r,n,i)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){We.versions?.electron&&(r.from="electron");let i=We.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}e===void 0&&(e=We.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":We.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,r){let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){let n=this._prepareUserArgs(e,r);return await this._parseCommand([],n),this}_executeSubCommand(e,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,f){let h=gn.resolve(l,f);if(Pp.existsSync(h))return h;if(i.includes(gn.extname(f)))return;let d=i.find(p=>Pp.existsSync(`${h}${p}`));if(d)return`${h}${d}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Pp.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=gn.resolve(gn.dirname(l),a)}if(a){let l=o(a,s);if(!l&&!e._executableFile&&this._scriptPath){let f=gn.basename(this._scriptPath,gn.extname(this._scriptPath));f!==this._name&&(l=o(a,`${f}-${e._name}`))}s=l||s}n=i.includes(gn.extname(s));let u;We.platform!=="win32"?n?(r.unshift(s),r=pw(We.execArgv).concat(r),u=Tp.spawn(We.argv[0],r,{stdio:"inherit"})):u=Tp.spawn(s,r,{stdio:"inherit"}):(r.unshift(s),r=pw(We.execArgv).concat(r),u=Tp.spawn(We.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{We.on(f,()=>{u.killed===!1&&u.exitCode===null&&u.kill(f)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new Rp(l,"commander.executeSubCommandAsync","(close)")):We.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT"){let f=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",h=`'${s}' does not exist
15
15
  - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -17,73 +17,73 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
17
17
  - ${f}`;throw new Error(h)}else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!c)We.exit(1);else{let f=new Rp(1,"commander.executeSubCommandAsync","(error)");f.nestedError=l,c(f)}}),this.runningCommand=u}_dispatchSubcommand(e,r,n){let i=this._findCommand(e);i||this.help({error:!0});let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?i<this.args.length?(o=this.args.slice(i),n.parseArg&&(o=o.reduce((s,a)=>e(n,a,s),n.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],n.parseArg&&(o=e(n,o,n.defaultValue))),r[i]=o}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let i=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=e.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],i=r,o=e.slice();function s(u){return u.length>1&&u[0]==="-"}let a=null;for(;o.length;){let u=o.shift();if(u==="--"){i===n&&i.push(u),i.push(...o);break}if(a&&!s(u)){this.emit(`option:${a.name()}`,u);continue}if(a=null,s(u)){let c=this._findOption(u);if(c){if(c.required){let l=o.shift();l===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,l)}else if(c.optional){let l=null;o.length>0&&!s(o[0])&&(l=o.shift()),this.emit(`option:${c.name()}`,l)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let c=this._findOption(`-${u[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,u.slice(2)):(this.emit(`option:${c.name()}`),o.unshift(`-${u.slice(2)}`));continue}}if(/^--[^=]+=/.test(u)){let c=u.indexOf("="),l=this._findOption(u.slice(0,c));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,u.slice(c+1));continue}}if(s(u)&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),o.length>0&&n.push(...o);break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u),o.length>0&&r.push(...o);break}else if(this._defaultCommandName){n.push(u),o.length>0&&n.push(...o);break}}if(this._passThroughOptions){i.push(u),o.length>0&&i.push(...o);break}i.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let i=this.options[n].attributeName();e[i]=i===this._versionOptionName?this._version:this[i]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
18
18
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
19
19
  `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
20
- `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in We.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,We.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new mB(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(f=>f.negate&&a===f.attributeName()),l=this.options.find(f=>!f.negate&&a===f.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=hw(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=hw(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
21
- `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>hB(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=gn.basename(e,gn.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=We.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
20
+ `),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in We.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,We.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new gB(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(f=>f.negate&&a===f.attributeName()),l=this.options.find(f=>!f.negate&&a===f.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(e)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=hw(e,i)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=hw(e,i)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
21
+ `),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>pB(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=gn.basename(e,gn.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},n;return r.error?n=i=>this._outputConfiguration.writeErr(i):n=i=>this._outputConfiguration.writeOut(i),r.write=e.write||n,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let i=this.helpInformation(n);if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",n))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=We.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
22
22
  Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
23
- `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function pw(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}mw.Command=$p});var bw=D(dr=>{var{Argument:yw}=il(),{Command:Ip}=gw(),{CommanderError:gB,InvalidArgumentError:Dw}=ja(),{Help:yB}=xp(),{Option:vw}=kp();dr.program=new Ip;dr.createCommand=t=>new Ip(t);dr.createOption=(t,e)=>new vw(t,e);dr.createArgument=(t,e)=>new yw(t,e);dr.Command=Ip;dr.Option=vw;dr.Argument=yw;dr.Help=yB;dr.CommanderError=gB;dr.InvalidArgumentError=Dw;dr.InvalidOptionArgumentError=Dw});var Te=D((Cce,_w)=>{"use strict";var jp="\x1B",qe=`${jp}[`,vB="\x07",Np={to(t,e){return e?`${qe}${e+1};${t+1}H`:`${qe}${t+1}G`},move(t,e){let r="";return t<0?r+=`${qe}${-t}D`:t>0&&(r+=`${qe}${t}C`),e<0?r+=`${qe}${-e}A`:e>0&&(r+=`${qe}${e}B`),r},up:(t=1)=>`${qe}${t}A`,down:(t=1)=>`${qe}${t}B`,forward:(t=1)=>`${qe}${t}C`,backward:(t=1)=>`${qe}${t}D`,nextLine:(t=1)=>`${qe}E`.repeat(t),prevLine:(t=1)=>`${qe}F`.repeat(t),left:`${qe}G`,hide:`${qe}?25l`,show:`${qe}?25h`,save:`${jp}7`,restore:`${jp}8`},bB={up:(t=1)=>`${qe}S`.repeat(t),down:(t=1)=>`${qe}T`.repeat(t)},wB={screen:`${qe}2J`,up:(t=1)=>`${qe}1J`.repeat(t),down:(t=1)=>`${qe}J`.repeat(t),line:`${qe}2K`,lineEnd:`${qe}K`,lineStart:`${qe}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Np.up():"");return t&&(e+=Np.left),e}};_w.exports={cursor:Np,scroll:bB,erase:wB,beep:vB}});var Bp=D((Sce,Lp)=>{var sl=process||{},Ew=sl.argv||[],ol=sl.env||{},_B=!(ol.NO_COLOR||Ew.includes("--no-color"))&&(!!ol.FORCE_COLOR||Ew.includes("--color")||sl.platform==="win32"||(sl.stdout||{}).isTTY&&ol.TERM!=="dumb"||!!ol.CI),EB=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+CB(i,e,r,o)+e:t+i+e},CB=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},Cw=(t=_B)=>{let e=t?EB:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Lp.exports=Cw();Lp.exports.createColors=Cw});var hl=D(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.isNXMonorepo=qt.isMonorepo=qt.findPackageRelativePathInMonorepo=qt.findPackagePath=qt.findNXMonorepoRoot=qt.findMonorepoRoot=void 0;var Ba=require("node:fs"),Wn=require("node:path");function dl(t){let e=(0,Wn.join)(t,"package.json"),r=(0,Wn.join)(t,"pnpm-workspace.yaml");if((0,Ba.existsSync)(r)||(0,Ba.existsSync)(e)&&JSON.parse((0,Ba.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Wn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return dl(n)}qt.findMonorepoRoot=dl;function Zp(t){let e=(0,Wn.join)(t,"nx.json");if((0,Ba.existsSync)(e))return t;let r=(0,Wn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Zp(r)}qt.findNXMonorepoRoot=Zp;function Qp(t,e,r){let n=(0,Wn.join)(e,"node_modules",t);if((0,Ba.existsSync)(n))return n;if(e===r)return null;let i=(0,Wn.dirname)(e);return Qp(t,i,r)}qt.findPackagePath=Qp;function nq(t,e){let r=dl(e),n=Qp(t,e,r);return n?(0,Wn.relative)(e,n):null}qt.findPackageRelativePathInMonorepo=nq;function iq(t){try{return dl(t),!0}catch{return!1}}qt.isMonorepo=iq;function oq(t){try{return Zp(t),!0}catch{return!1}}qt.isNXMonorepo=oq});var xi={};mn(xi,{default:()=>sq});var sq,Fi=ut(()=>{sq={}});var zw=D(jr=>{"use strict";var aq=jr&&jr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uq=jr&&jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cq=jr&&jr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&aq(e,t,r);return uq(e,t),e};Object.defineProperty(jr,"__esModule",{value:!0});jr.resolveFetch=void 0;var lq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>cq((Fi(),ke(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};jr.resolveFetch=lq});var nm=D(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.FunctionRegion=nr.FunctionsHttpError=nr.FunctionsRelayError=nr.FunctionsFetchError=nr.FunctionsError=void 0;var Mo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};nr.FunctionsError=Mo;var em=class extends Mo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};nr.FunctionsFetchError=em;var tm=class extends Mo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};nr.FunctionsRelayError=tm;var rm=class extends Mo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};nr.FunctionsHttpError=rm;var fq;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(fq=nr.FunctionRegion||(nr.FunctionRegion={}))});var Gw=D(Uo=>{"use strict";var dq=Uo&&Uo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.FunctionsClient=void 0;var hq=zw(),ml=nm(),im=class{constructor(e,{headers:r={},customFetch:n,region:i=ml.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,hq.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return dq(this,void 0,void 0,function*(){try{let{headers:i,method:o,body:s}=r,a={},{region:u}=r;u||(u=this.region),u&&u!=="any"&&(a["x-region"]=u);let c;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",c=s):typeof s=="string"?(a["Content-Type"]="text/plain",c=s):typeof FormData<"u"&&s instanceof FormData?c=s:(a["Content-Type"]="application/json",c=JSON.stringify(s)));let l=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:c}).catch(p=>{throw new ml.FunctionsFetchError(p)}),f=l.headers.get("x-relay-error");if(f&&f==="true")throw new ml.FunctionsRelayError(l);if(!l.ok)throw new ml.FunctionsHttpError(l);let h=((n=l.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield l.json():h==="application/octet-stream"?d=yield l.blob():h==="text/event-stream"?d=l:h==="multipart/form-data"?d=yield l.formData():d=yield l.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};Uo.FunctionsClient=im});var om=D(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.FunctionRegion=Mt.FunctionsRelayError=Mt.FunctionsHttpError=Mt.FunctionsFetchError=Mt.FunctionsError=Mt.FunctionsClient=void 0;var pq=Gw();Object.defineProperty(Mt,"FunctionsClient",{enumerable:!0,get:function(){return pq.FunctionsClient}});var Ma=nm();Object.defineProperty(Mt,"FunctionsError",{enumerable:!0,get:function(){return Ma.FunctionsError}});Object.defineProperty(Mt,"FunctionsFetchError",{enumerable:!0,get:function(){return Ma.FunctionsFetchError}});Object.defineProperty(Mt,"FunctionsHttpError",{enumerable:!0,get:function(){return Ma.FunctionsHttpError}});Object.defineProperty(Mt,"FunctionsRelayError",{enumerable:!0,get:function(){return Ma.FunctionsRelayError}});Object.defineProperty(Mt,"FunctionRegion",{enumerable:!0,get:function(){return Ma.FunctionRegion}})});var um=D(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var sm=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};am.default=sm});var lm=D(Ua=>{"use strict";var Ww=Ua&&Ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ua,"__esModule",{value:!0});var mq=Ww((Fi(),ke(xi))),gq=Ww(um()),cm=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=mq.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var s,a,u;let c=null,l=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let w=await o.text();w===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?l=w:l=JSON.parse(w))}let v=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),g=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");v&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(l)&&(l.length>1?(c={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,f=null,h=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{let v=await o.text();try{c=JSON.parse(v),Array.isArray(c)&&o.status===404&&(l=[],c=null,h=200,d="OK")}catch{o.status===404&&v===""?(h=204,d="No Content"):c={message:v}}if(c&&this.isMaybeSingle&&(!((u=c?.details)===null||u===void 0)&&u.includes("0 rows"))&&(c=null,h=200,d="OK"),c&&this.shouldThrowOnError)throw new gq.default(c)}return{error:c,data:l,count:f,status:h,statusText:d}});return this.shouldThrowOnError||(i=i.catch(o=>{var s,a,u;return{error:{message:`${(s=o?.name)!==null&&s!==void 0?s:"FetchError"}: ${o?.message}`,details:`${(a=o?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=o?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}};Ua.default=cm});var dm=D(Va=>{"use strict";var yq=Va&&Va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0});var Dq=yq(lm()),fm=class extends Dq.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){let s=o?`${o}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let o=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:s="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`,s==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Va.default=fm});var gl=D(Ha=>{"use strict";var vq=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});var bq=vq(dm()),hm=class extends bq.default{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}in(e,r){let n=Array.from(new Set(r)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:n,type:i}={}){let o="";i==="plain"?o="pl":i==="phrase"?o="ph":i==="websearch"&&(o="w");let s=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${o}fts${s}.${r}`),this}match(e){return Object.entries(e).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(e,r,n){return this.url.searchParams.append(e,`not.${r}.${n}`),this}or(e,{foreignTable:r,referencedTable:n=r}={}){let i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};Ha.default=hm});var mm=D(Ga=>{"use strict";var wq=Ga&&Ga.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ga,"__esModule",{value:!0});var za=wq(gl()),pm=class{constructor(e,{headers:r={},schema:n,fetch:i}){this.url=e,this.headers=r,this.schema=n,this.fetch=i}select(e,{head:r=!1,count:n}={}){let i=r?"HEAD":"GET",o=!1,s=(e??"*").split("").map(a=>/\s/.test(a)&&!o?"":(a==='"'&&(o=!o),a)).join("");return this.url.searchParams.set("select",s),n&&(this.headers.Prefer=`count=${n}`),new za.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:r,defaultToNull:n=!0}={}){let i="POST",o=[];if(this.headers.Prefer&&o.push(this.headers.Prefer),r&&o.push(`count=${r}`),n||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){let s=e.reduce((a,u)=>a.concat(Object.keys(u)),[]);if(s.length>0){let a=[...new Set(s)].map(u=>`"${u}"`);this.url.searchParams.set("columns",a.join(","))}}return new za.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){let s="POST",a=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),o||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let u=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(u.length>0){let c=[...new Set(u)].map(l=>`"${l}"`);this.url.searchParams.set("columns",c.join(","))}}return new za.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:r}={}){let n="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),r&&i.push(`count=${r}`),this.headers.Prefer=i.join(","),new za.default({method:n,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let r="DELETE",n=[];return e&&n.push(`count=${e}`),this.headers.Prefer&&n.unshift(this.headers.Prefer),this.headers.Prefer=n.join(","),new za.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ga.default=pm});var Kw=D(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.version=void 0;yl.version="0.0.0-automated"});var Yw=D(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.DEFAULT_HEADERS=void 0;var _q=Kw();Dl.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${_q.version}`}});var Xw=D(Wa=>{"use strict";var Jw=Wa&&Wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wa,"__esModule",{value:!0});var Eq=Jw(mm()),Cq=Jw(gl()),Sq=Yw(),gm=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},Sq.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new Eq.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:o}={}){let s,a=new URL(`${this.url}/rpc/${e}`),u;n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([l,f])=>f!==void 0).map(([l,f])=>[l,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([l,f])=>{a.searchParams.append(l,f)})):(s="POST",u=r);let c=Object.assign({},this.headers);return o&&(c.Prefer=`count=${o}`),new Cq.default({method:s,url:a,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};Wa.default=gm});var i_=D(Dt=>{"use strict";var Vo=Dt&&Dt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.PostgrestError=Dt.PostgrestBuilder=Dt.PostgrestTransformBuilder=Dt.PostgrestFilterBuilder=Dt.PostgrestQueryBuilder=Dt.PostgrestClient=void 0;var Zw=Vo(Xw());Dt.PostgrestClient=Zw.default;var Qw=Vo(mm());Dt.PostgrestQueryBuilder=Qw.default;var e_=Vo(gl());Dt.PostgrestFilterBuilder=e_.default;var t_=Vo(dm());Dt.PostgrestTransformBuilder=t_.default;var r_=Vo(lm());Dt.PostgrestBuilder=r_.default;var n_=Vo(um());Dt.PostgrestError=n_.default;Dt.default={PostgrestClient:Zw.default,PostgrestQueryBuilder:Qw.default,PostgrestFilterBuilder:e_.default,PostgrestTransformBuilder:t_.default,PostgrestBuilder:r_.default,PostgrestError:n_.default}});var Dm={};mn(Dm,{RealtimeClient:()=>ym});var ym,vm=ut(()=>{ym=class{constructor(){}connect(){}disconnect(){}}});var Ya=D(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.StorageUnknownError=Nr.StorageApiError=Nr.isStorageError=Nr.StorageError=void 0;var Ka=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Nr.StorageError=Ka;function xq(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Nr.isStorageError=xq;var bm=class extends Ka{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Nr.StorageApiError=bm;var wm=class extends Ka{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Nr.StorageUnknownError=wm});var vl=D(ct=>{"use strict";var Fq=ct&&ct.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Oq=ct&&ct.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o_=ct&&ct.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Fq(e,t,r);return Oq(e,t),e},Aq=ct&&ct.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ct,"__esModule",{value:!0});ct.recursiveToCamel=ct.resolveResponse=ct.resolveFetch=void 0;var kq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>o_((Fi(),ke(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ct.resolveFetch=kq;var Tq=()=>Aq(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>o_((Fi(),ke(xi))))).Response:Response});ct.resolveResponse=Tq;var Pq=t=>{if(Array.isArray(t))return t.map(r=>(0,ct.recursiveToCamel)(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let i=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[i]=(0,ct.recursiveToCamel)(n)}),e};ct.recursiveToCamel=Pq});var Cm=D(Ut=>{"use strict";var Oi=Ut&&Ut.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.remove=Ut.head=Ut.put=Ut.post=Ut.get=void 0;var _m=Ya(),Rq=vl(),Em=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),$q=(t,e,r)=>Oi(void 0,void 0,void 0,function*(){let n=yield(0,Rq.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new _m.StorageApiError(Em(i),t.status||500))}).catch(i=>{e(new _m.StorageUnknownError(Em(i),i))}):e(new _m.StorageUnknownError(Em(t),t))}),Iq=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},e?.headers),n&&(i.body=JSON.stringify(n)),Object.assign(Object.assign({},i),r))};function Ja(t,e,r,n,i,o){return Oi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,Iq(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>$q(u,a,n))})})}function jq(t,e,r,n){return Oi(this,void 0,void 0,function*(){return Ja(t,"GET",e,r,n)})}Ut.get=jq;function Nq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"POST",e,n,i,r)})}Ut.post=Nq;function Lq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"PUT",e,n,i,r)})}Ut.put=Lq;function Bq(t,e,r,n){return Oi(this,void 0,void 0,function*(){return Ja(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Ut.head=Bq;function qq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"DELETE",e,n,i,r)})}Ut.remove=qq});var u_=D(Xa=>{"use strict";var Vt=Xa&&Xa.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Xa,"__esModule",{value:!0});var Ht=Ya(),Lr=Cm(),s_=vl(),Mq={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},a_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Sm=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,s_.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Vt(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},a_),i),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u))):(o=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,u&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i?.headers&&(a=Object.assign(Object.assign({},a),i.headers));let c=this._removeEmptyFolders(r),l=this._getFinalPath(c),f=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:c,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(o){if((0,Ht.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return Vt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Vt(this,void 0,void 0,function*(){let o=this._removeEmptyFolders(e),s=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${s}`);a.searchParams.set("token",r);try{let u,c=Object.assign({upsert:a_.upsert},i),l=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,l["cache-control"]=`max-age=${c.cacheControl}`,l["content-type"]=c.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:l}),h=yield f.json();return f.ok?{data:{path:o,fullPath:h.Key},error:null}:{data:null,error:h}}catch(u){if((0,Ht.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Vt(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let o=yield(0,Lr.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+o.url),a=s.searchParams.get("token");if(!a)throw new Ht.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return Vt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Vt(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Vt(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Lr.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${s}`)},{data:o,error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${o}`):null})),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return Vt(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(r?.transform||{}),s=o?`?${o}`:"";try{let a=this._getFinalPath(e);return{data:yield(yield(0,Lr.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,Ht.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return Vt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Lr.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,s_.recursiveToCamel)(n),error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Vt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Lr.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,Ht.isStorageError)(n)&&n instanceof Ht.StorageUnknownError){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],o=r?.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&i.push(o);let a=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&i.push(u);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${c}`)}}}remove(e){return Vt(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,Ht.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},Mq),r),{prefix:e||""});return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}};Xa.default=Sm});var c_=D(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.version=void 0;bl.version="2.7.1"});var l_=D(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.DEFAULT_HEADERS=void 0;var Uq=c_();wl.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${Uq.version}`}});var f_=D(Za=>{"use strict";var Ho=Za&&Za.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Za,"__esModule",{value:!0});var Vq=l_(),zo=Ya(),Go=Cm(),Hq=vl(),xm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},Vq.DEFAULT_HEADERS),r),this.fetch=(0,Hq.resolveFetch)(n)}listBuckets(){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,zo.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,zo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.post)(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,zo.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.put)(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,zo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,zo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,zo.isStorageError)(r))return{data:null,error:r};throw r}})}};Za.default=xm});var h_=D(Wo=>{"use strict";var d_=Wo&&Wo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.StorageClient=void 0;var zq=d_(u_()),Gq=d_(f_()),Fm=class extends Gq.default{constructor(e,r={},n){super(e,r,n)}from(e){return new zq.default(this.url,this.headers,e,this.fetch)}};Wo.StorageClient=Fm});var m_=D(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0})});var y_=D(Br=>{"use strict";var Wq=Br&&Br.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),g_=Br&&Br.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wq(e,t,r)};Object.defineProperty(Br,"__esModule",{value:!0});Br.StorageClient=void 0;var Kq=h_();Object.defineProperty(Br,"StorageClient",{enumerable:!0,get:function(){return Kq.StorageClient}});g_(m_(),Br);g_(Ya(),Br)});var D_=D(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.version=void 0;_l.version="2.46.0"});var v_=D(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_REALTIME_OPTIONS=ir.DEFAULT_AUTH_OPTIONS=ir.DEFAULT_DB_OPTIONS=ir.DEFAULT_GLOBAL_OPTIONS=ir.DEFAULT_HEADERS=void 0;var Yq=D_(),Qa="";typeof Deno<"u"?Qa="deno":typeof document<"u"?Qa="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Qa="react-native":Qa="node";ir.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${Qa}/${Yq.version}`};ir.DEFAULT_GLOBAL_OPTIONS={headers:ir.DEFAULT_HEADERS};ir.DEFAULT_DB_OPTIONS={schema:"public"};ir.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};ir.DEFAULT_REALTIME_OPTIONS={}});var w_=D(lt=>{"use strict";var Jq=lt&&lt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Xq=lt&&lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Zq=lt&&lt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Jq(e,t,r);return Xq(e,t),e},Qq=lt&&lt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.fetchWithAuth=lt.resolveHeadersConstructor=lt.resolveFetch=void 0;var b_=Zq((Fi(),ke(xi))),eM=t=>{let e;return t?e=t:typeof fetch>"u"?e=b_.default:e=fetch,(...r)=>e(...r)};lt.resolveFetch=eM;var tM=()=>typeof Headers>"u"?b_.Headers:Headers;lt.resolveHeadersConstructor=tM;var rM=(t,e,r)=>{let n=(0,lt.resolveFetch)(r),i=(0,lt.resolveHeadersConstructor)();return(o,s)=>Qq(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,c=new i(s?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:c}))})};lt.fetchWithAuth=rM});var __=D(mr=>{"use strict";var nM=mr&&mr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(mr,"__esModule",{value:!0});mr.applySettingDefaults=mr.isBrowser=mr.stripTrailingSlash=mr.uuid=void 0;function iM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}mr.uuid=iM;function oM(t){return t.replace(/\/$/,"")}mr.stripTrailingSlash=oM;var sM=()=>typeof window<"u";mr.isBrowser=sM;function aM(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:c}=e,l={db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},c),o),accessToken:()=>nM(this,void 0,void 0,function*(){return""})};return t.accessToken?l.accessToken=t.accessToken:delete l.accessToken,l}mr.applySettingDefaults=aM});var Om=D(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.version=void 0;El.version="2.65.1"});var Cl=D(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.API_VERSIONS=ft.API_VERSION_HEADER_NAME=ft.NETWORK_FAILURE=ft.EXPIRY_MARGIN=ft.DEFAULT_HEADERS=ft.AUDIENCE=ft.STORAGE_KEY=ft.GOTRUE_URL=void 0;var uM=Om();ft.GOTRUE_URL="http://localhost:9999";ft.STORAGE_KEY="supabase.auth.token";ft.AUDIENCE="";ft.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${uM.version}`};ft.EXPIRY_MARGIN=10;ft.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};ft.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";ft.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Ko=D(te=>{"use strict";var cM=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),lM=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),fM=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&cM(e,t,r);return lM(e,t),e};Object.defineProperty(te,"__esModule",{value:!0});te.parseResponseAPIVersion=te.getCodeChallengeAndMethod=te.generatePKCEChallenge=te.generatePKCEVerifier=te.retryable=te.sleep=te.decodeJWTPayload=te.Deferred=te.decodeBase64URL=te.removeItemAsync=te.getItemAsync=te.setItemAsync=te.looksLikeFetchResponse=te.resolveFetch=te.parseParametersFromURL=te.supportsLocalStorage=te.isBrowser=te.uuid=te.expiresAt=void 0;var dM=Cl();function hM(t){return Math.round(Date.now()/1e3)+t}te.expiresAt=hM;function pM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}te.uuid=pM;var mM=()=>typeof document<"u";te.isBrowser=mM;var Ai={tested:!1,writable:!1},gM=()=>{if(!(0,te.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ai.tested)return Ai.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Ai.tested=!0,Ai.writable=!0}catch{Ai.tested=!0,Ai.writable=!1}return Ai.writable};te.supportsLocalStorage=gM;function yM(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}te.parseParametersFromURL=yM;var DM=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>fM((Fi(),ke(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};te.resolveFetch=DM;var vM=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";te.looksLikeFetchResponse=vM;var bM=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};te.setItemAsync=bM;var wM=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};te.getItemAsync=wM;var _M=async(t,e)=>{await t.removeItem(e)};te.removeItemAsync=_M;function E_(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,c,l=0;for(t=t.replace("-","+").replace("_","/");l<t.length;)s=e.indexOf(t.charAt(l++)),a=e.indexOf(t.charAt(l++)),u=e.indexOf(t.charAt(l++)),c=e.indexOf(t.charAt(l++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|c,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),c!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}te.decodeBase64URL=E_;var Sl=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};te.Deferred=Sl;Sl.promiseConstructor=Promise;function EM(t){let e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=t.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");let n=r[1];return JSON.parse(E_(n))}te.decodeJWTPayload=EM;async function CM(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}te.sleep=CM;function SM(t,e){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){n(s);return}}catch(s){if(!e(o,s)){i(s);return}}})()})}te.retryable=SM;function xM(t){return("0"+t.toString(16)).substr(-2)}function C_(){let e=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length,i="";for(let o=0;o<56;o++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,xM).join("")}te.generatePKCEVerifier=C_;async function FM(t){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(o=>String.fromCharCode(o)).join("")}function OM(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function S_(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;let r=await FM(t);return OM(r)}te.generatePKCEChallenge=S_;async function AM(t,e,r=!1){let n=C_(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,te.setItemAsync)(t,`${e}-code-verifier`,i);let o=await S_(n);return[o,n===o?"plain":"s256"]}te.getCodeChallengeAndMethod=AM;var kM=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function TM(t){let e=t.headers.get(dM.API_VERSION_HEADER_NAME);if(!e||!e.match(kM))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}te.parseResponseAPIVersion=TM});var tu=D(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.isAuthWeakPasswordError=he.AuthWeakPasswordError=he.isAuthRetryableFetchError=he.AuthRetryableFetchError=he.AuthPKCEGrantCodeExchangeError=he.AuthImplicitGrantRedirectError=he.AuthInvalidCredentialsError=he.AuthInvalidTokenResponseError=he.isAuthSessionMissingError=he.AuthSessionMissingError=he.CustomAuthError=he.AuthUnknownError=he.isAuthApiError=he.AuthApiError=he.isAuthError=he.AuthError=void 0;var Yo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};he.AuthError=Yo;function eu(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}he.isAuthError=eu;var Am=class extends Yo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};he.AuthApiError=Am;function PM(t){return eu(t)&&t.name==="AuthApiError"}he.isAuthApiError=PM;var km=class extends Yo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};he.AuthUnknownError=km;var qr=class extends Yo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};he.CustomAuthError=qr;var Tm=class extends qr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};he.AuthSessionMissingError=Tm;function RM(t){return eu(t)&&t.name==="AuthSessionMissingError"}he.isAuthSessionMissingError=RM;var Pm=class extends qr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};he.AuthInvalidTokenResponseError=Pm;var Rm=class extends qr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};he.AuthInvalidCredentialsError=Rm;var $m=class extends qr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthImplicitGrantRedirectError=$m;var Im=class extends qr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthPKCEGrantCodeExchangeError=Im;var jm=class extends qr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};he.AuthRetryableFetchError=jm;function $M(t){return eu(t)&&t.name==="AuthRetryableFetchError"}he.isAuthRetryableFetchError=$M;var Nm=class extends qr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};he.AuthWeakPasswordError=Nm;function IM(t){return eu(t)&&t.name==="AuthWeakPasswordError"}he.isAuthWeakPasswordError=IM});var qm=D(rt=>{"use strict";var jM=rt&&rt.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(rt,"__esModule",{value:!0});rt._noResolveJsonResponse=rt._generateLinkResponse=rt._ssoResponse=rt._userResponse=rt._sessionResponsePassword=rt._sessionResponse=rt._request=rt.handleError=void 0;var xl=Cl(),Lm=Ko(),Kn=tu(),ki=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),NM=[502,503,504];async function Bm(t){var e;if(!(0,Lm.looksLikeFetchResponse)(t))throw new Kn.AuthRetryableFetchError(ki(t),0);if(NM.includes(t.status))throw new Kn.AuthRetryableFetchError(ki(t),t.status);let r;try{r=await t.json()}catch(o){throw new Kn.AuthUnknownError(ki(o),o)}let n,i=(0,Lm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=xl.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Kn.AuthWeakPasswordError(ki(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Kn.AuthSessionMissingError}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new Kn.AuthWeakPasswordError(ki(r),t.status,r.weak_password.reasons);throw new Kn.AuthApiError(ki(r),t.status||500,n)}rt.handleError=Bm;var LM=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function BM(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[xl.API_VERSION_HEADER_NAME]||(o[xl.API_VERSION_HEADER_NAME]=xl.API_VERSIONS["2024-01-01"].name),n?.jwt&&(o.Authorization=`Bearer ${n.jwt}`);let s=(i=n?.query)!==null&&i!==void 0?i:{};n?.redirectTo&&(s.redirect_to=n.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",u=await qM(t,e,r+a,{headers:o,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(u):{data:Object.assign({},u),error:null}}rt._request=BM;async function qM(t,e,r,n,i,o){let s=LM(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new Kn.AuthRetryableFetchError(ki(u),0)}if(a.ok||await Bm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await Bm(u)}}function x_(t){var e;let r=null;GM(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,Lm.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}rt._sessionResponse=x_;function MM(t){let e=x_(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}rt._sessionResponsePassword=MM;function UM(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}rt._userResponse=UM;function VM(t){return{data:t,error:null}}rt._ssoResponse=VM;function HM(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=jM(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o},u=Object.assign({},s);return{data:{properties:a,user:u},error:null}}rt._generateLinkResponse=HM;function zM(t){return t}rt._noResolveJsonResponse=zM;function GM(t){return t.access_token&&t.refresh_token&&t.expires_in}});var Fl=D(ru=>{"use strict";var WM=ru&&ru.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(ru,"__esModule",{value:!0});var vt=qm(),KM=Ko(),Mr=tu(),Mm=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,KM.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Mr.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=WM(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:vt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Mr.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let c={nextPage:null,lastPage:0,total:0},l=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(i=e?.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:vt._noResolveJsonResponse});if(l.error)throw l.error;let f=await l.json(),h=(s=l.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=l.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(p=>{let v=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(p.split(";")[1].split("=")[1]);c[`${g}Page`]=v}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if((0,Mr.isAuthError)(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,vt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}};ru.default=Mm});var F_=D(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.memoryLocalStorageAdapter=Jo.localStorageAdapter=void 0;var Um=Ko();Jo.localStorageAdapter={getItem:t=>(0,Um.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,Um.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,Um.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function YM(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Jo.memoryLocalStorageAdapter=YM});var O_=D(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.polyfillGlobalThis=void 0;function JM(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}Ol.polyfillGlobalThis=JM});var Vm=D(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.navigatorLock=Et.NavigatorLockAcquireTimeoutError=Et.LockAcquireTimeoutError=Et.internals=void 0;var XM=Ko();Et.internals={debug:!!(globalThis&&(0,XM.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Al=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};Et.LockAcquireTimeoutError=Al;var kl=class extends Al{};Et.NavigatorLockAcquireTimeoutError=kl;async function ZM(t,e,r){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new kl(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Et.internals.debug)try{let o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}})}Et.navigatorLock=ZM});var zm=D(ou=>{"use strict";var QM=ou&&ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ou,"__esModule",{value:!0});var e4=QM(Fl()),iu=Cl(),Z=tu(),ae=qm(),fe=Ko(),Hm=F_(),t4=O_(),r4=Om(),A_=Vm();(0,t4.polyfillGlobalThis)();var n4={url:iu.GOTRUE_URL,storageKey:iu.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:iu.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},nu=30*1e3,k_=3;async function T_(t,e,r){return await r()}var Tl=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,fe.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},n4),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new e4.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,fe.resolveFetch)(i.fetch),this.lock=i.lock||T_,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,fe.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=A_.navigatorLock:this.lock=T_,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:(0,fe.supportsLocalStorage)()?this.storage=Hm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,Hm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,Hm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,fe.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${r4.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{let e=(0,fe.isBrowser)()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:r,error:n}=await this._getSessionFromURL(e);if(n)return this._debug("#_initialize()","error detecting session from URL",n),n?.code==="identity_already_exists"?{error:n}:(await this._removeSession(),{error:n});let{session:i,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return(0,Z.isAuthError)(e)?{error:e}:{error:new Z.AuthUnknownError("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:ae._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var r,n,i;try{let o;if("email"in e){let{email:l,password:f,options:h}=e,d=null,p=null;this.flowType==="pkce"&&([d,p]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:l,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:p},xform:ae._sessionResponse})}else if("phone"in e){let{phone:l,password:f,options:h}=e;o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:f,data:(n=h?.data)!==null&&n!==void 0?n:{},channel:(i=h?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:ae._sessionResponse})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:o,error:s}=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:ae._sessionResponse});if(await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Z.AuthInvalidTokenResponseError}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:o,nonce:s}=e,a=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:ae._sessionResponse}),{data:u,error:c}=a;return c?{data:{user:null,session:null},error:c}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,o,s;try{if("email"in e){let{email:a,options:u}=e,c=null,l=null;this.flowType==="pkce"&&([c,l]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:c,error:l}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(o=u?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(s=u?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:l}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,Z.isAuthError)(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var r,n;try{let i,o;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:ae._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,c=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(i){if((0,Z.isAuthError)(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let o=null,s=null;return this.flowType==="pkce"&&([o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,ae._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:s}),headers:this.headers,xform:ae._ssoResponse})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Z.AuthSessionMissingError;let{error:i}=await(0,ae._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if((0,Z.isAuthError)(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:o}=e,{error:s}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in e){let{phone:n,type:i,options:o}=e,{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:a}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;e=new Proxy(e,{get:(u,c,l)=>(!s&&c==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,c,l))})}return{data:{session:e},error:null}}let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:ae._userResponse}):await this._useSession(async r=>{var n,i,o;let{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Z.AuthSessionMissingError}:await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:ae._userResponse})})}catch(r){if((0,Z.isAuthError)(r))return(0,Z.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new Z.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:c,error:l}=await(0,ae._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:s.access_token,xform:ae._userResponse});if(l)throw l;return s.user=c.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,Z.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,fe.decodeJWTPayload)(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Z.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,fe.decodeJWTPayload)(e.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){let{session:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(n=s.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new Z.AuthSessionMissingError;let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e){try{if(!(0,fe.isBrowser)())throw new Z.AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Z.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Z.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");let r=(0,fe.parseParametersFromURL)(window.location.href);if(e){if(!r.code)throw new Z.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:x,error:y}=await this._exchangeCodeForSession(r.code);if(y)throw y;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:x.session,redirectType:null},error:null}}if(r.error||r.error_description||r.error_code)throw new Z.AuthImplicitGrantRedirectError(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:c}=r;if(!o||!a||!s||!c)throw new Z.AuthImplicitGrantRedirectError("No session defined in URL");let l=Math.round(Date.now()/1e3),f=parseInt(a),h=l+f;u&&(h=parseInt(u));let d=h-l;d*1e3<=nu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let p=h-f;l-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,h,l):l-p<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",p,h,l);let{data:v,error:g}=await this._getUser(o);if(g)throw g;let w={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:c,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:w,redirectType:r.type},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href);return!!((0,fe.isBrowser)()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href),r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{error:o};let s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){let{error:a}=await this.admin.signOut(s,e);if(a&&!((0,Z.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,fe.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,ae._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async o=>{var s,a,u,c,l;let{data:f,error:h}=o;if(h)throw h;let d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,ae._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(l=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(i)throw i;return(0,fe.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if((0,Z.isAuthError)(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)throw s;return await(0,ae._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,fe.retryable)(async i=>(i>0&&await(0,fe.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ae._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,Z.isAuthRetryableFetchError)(o)&&Date.now()+s-n<nu})}catch(n){if(this._debug(r,"error",n),(0,Z.isAuthError)(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,fe.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=Math.round(Date.now()/1e3),o=((e=n.expires_at)!==null&&e!==void 0?e:1/0)<i+iu.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${iu.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,Z.isAuthRetryableFetchError)(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Z.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new fe.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new Z.AuthSessionMissingError;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);let a={session:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),(0,Z.isAuthError)(o)){let s={session:null,error:o};return(0,Z.isAuthRetryableFetchError)(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){o.push(u)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await(0,fe.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,fe.removeItemAsync)(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,fe.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),nu);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async r=>{let{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let i=Math.floor((n.expires_at*1e3-e)/nu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${nu}ms, refresh threshold is ${k_} ticks`),i<=k_&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof A_.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,fe.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n?.queryParams){let o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)return{data:null,error:s};let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:u,error:c}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{data:null,error:o};let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:a})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(s=>s.factor_type==="totp"&&s.status==="verified"),o=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let s=this._decodeJWT(i.access_token),a=null;s.aal&&(a=s.aal);let u=a;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");let l=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:l},error:null}}))}};ou.default=Tl;Tl.nextInstanceID=0});var P_=D(su=>{"use strict";var i4=su&&su.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(su,"__esModule",{value:!0});var o4=i4(Fl()),s4=o4.default;su.default=s4});var R_=D(au=>{"use strict";var a4=au&&au.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(au,"__esModule",{value:!0});var u4=a4(zm()),c4=u4.default;au.default=c4});var I_=D($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0})});var Wm=D(je=>{"use strict";var l4=je&&je.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),j_=je&&je.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&l4(e,t,r)},Pl=je&&je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(je,"__esModule",{value:!0});je.lockInternals=je.NavigatorLockAcquireTimeoutError=je.navigatorLock=je.AuthClient=je.AuthAdminApi=je.GoTrueClient=je.GoTrueAdminApi=void 0;var f4=Pl(Fl());je.GoTrueAdminApi=f4.default;var d4=Pl(zm());je.GoTrueClient=d4.default;var h4=Pl(P_());je.AuthAdminApi=h4.default;var p4=Pl(R_());je.AuthClient=p4.default;j_(I_(),je);j_(tu(),je);var Gm=Vm();Object.defineProperty(je,"navigatorLock",{enumerable:!0,get:function(){return Gm.navigatorLock}});Object.defineProperty(je,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Gm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(je,"lockInternals",{enumerable:!0,get:function(){return Gm.internals}})});var N_=D(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.SupabaseAuthClient=void 0;var m4=Wm(),Km=class extends m4.AuthClient{constructor(e){super(e)}};Rl.SupabaseAuthClient=Km});var Jm=D(uu=>{"use strict";var g4=uu&&uu.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(uu,"__esModule",{value:!0});var y4=om(),D4=i_(),v4=(vm(),ke(Dm)),b4=y_(),$l=v_(),w4=w_(),L_=__(),_4=N_(),Ym=class{constructor(e,r,n){var i,o,s;if(this.supabaseUrl=e,this.supabaseKey=r,!e)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");let a=(0,L_.stripTrailingSlash)(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;let u=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,c={db:$l.DEFAULT_DB_OPTIONS,realtime:$l.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},$l.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:$l.DEFAULT_GLOBAL_OPTIONS},l=(0,L_.applySettingDefaults)(n??{},c);this.storageKey=(i=l.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=l.auth)!==null&&s!==void 0?s:{},this.headers,l.global.fetch),this.fetch=(0,w4.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new D4.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new y4.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new b4.StorageClient(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,r;return g4(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:o,flowType:s,lock:a,debug:u},c,l){var f;let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new _4.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},h),c),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:l,hasCustomAuthorizationHeader:(f="Authorization"in this.headers)!==null&&f!==void 0?f:!1})}_initRealtimeClient(e){return new v4.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.realtime.setAuth(n??null),this.changedAccessToken=n):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};uu.default=Ym});var M_=D(Ne=>{"use strict";var E4=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),B_=Ne&&Ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&E4(e,t,r)},q_=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.createClient=Ne.SupabaseClient=Ne.FunctionRegion=Ne.FunctionsError=Ne.FunctionsRelayError=Ne.FunctionsFetchError=Ne.FunctionsHttpError=void 0;var C4=q_(Jm());B_(Wm(),Ne);var cu=om();Object.defineProperty(Ne,"FunctionsHttpError",{enumerable:!0,get:function(){return cu.FunctionsHttpError}});Object.defineProperty(Ne,"FunctionsFetchError",{enumerable:!0,get:function(){return cu.FunctionsFetchError}});Object.defineProperty(Ne,"FunctionsRelayError",{enumerable:!0,get:function(){return cu.FunctionsRelayError}});Object.defineProperty(Ne,"FunctionsError",{enumerable:!0,get:function(){return cu.FunctionsError}});Object.defineProperty(Ne,"FunctionRegion",{enumerable:!0,get:function(){return cu.FunctionRegion}});B_((vm(),ke(Dm)),Ne);var S4=Jm();Object.defineProperty(Ne,"SupabaseClient",{enumerable:!0,get:function(){return q_(S4).default}});var x4=(t,e,r)=>new C4.default(t,e,r);Ne.createClient=x4});var Xm=D((Ile,U_)=>{U_.exports=require("stream")});var K_=D((jle,W_)=>{"use strict";function V_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function H_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?V_(Object(r),!0).forEach(function(n){F4(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function F4(t,e,r){return e=G_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function O4(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,G_(n.key),n)}}function A4(t,e,r){return e&&z_(t.prototype,e),r&&z_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function G_(t){var e=k4(t,"string");return typeof e=="symbol"?e:String(e)}function k4(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var T4=require("buffer"),Il=T4.Buffer,P4=require("util"),Zm=P4.inspect,R4=Zm&&Zm.custom||"inspect";function $4(t,e,r){Il.prototype.copy.call(t,e,r)}W_.exports=function(){function t(){O4(this,t),this.head=null,this.tail=null,this.length=0}return A4(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return Il.alloc(0);for(var n=Il.allocUnsafe(r>>>0),i=this.head,o=0;i;)$4(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=Il.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:R4,value:function(r,n){return Zm(this,H_(H_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var eg=D((Nle,J_)=>{"use strict";function I4(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Qm,this,t)):process.nextTick(Qm,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(jl,r):(r._writableState.errorEmitted=!0,process.nextTick(Y_,r,o)):process.nextTick(Y_,r,o):e?(process.nextTick(jl,r),e(o)):process.nextTick(jl,r)}),this)}function Y_(t,e){Qm(t,e),jl(t)}function jl(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function j4(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Qm(t,e){t.emit("error",e)}function N4(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}J_.exports={destroy:I4,undestroy:j4,errorOrDestroy:N4}});var Yn=D((Lle,Q_)=>{"use strict";var Z_={};function gr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}class i extends r{constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,Z_[t]=i}function X_(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function L4(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function B4(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function q4(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}gr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);gr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&L4(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(B4(t," argument"))i=`The ${t} ${n} ${X_(e,"type")}`;else{let o=q4(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${X_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);gr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");gr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});gr("ERR_STREAM_PREMATURE_CLOSE","Premature close");gr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});gr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");gr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");gr("ERR_STREAM_WRITE_AFTER_END","write after end");gr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);gr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);gr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Q_.exports.codes=Z_});var tg=D((Ble,eE)=>{"use strict";var M4=Yn().codes.ERR_INVALID_OPT_VALUE;function U4(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function V4(t,e,r,n){var i=U4(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new M4(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}eE.exports={getHighWaterMark:V4}});var tE=D((qle,rg)=>{typeof Object.create=="function"?rg.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:rg.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Xo=D((Mle,ig)=>{try{if(ng=require("util"),typeof ng.inherits!="function")throw"";ig.exports=ng.inherits}catch{ig.exports=tE()}var ng});var nE=D((Ule,rE)=>{rE.exports=require("util").deprecate});var ag=D((Vle,cE)=>{"use strict";cE.exports=Ye;function oE(t){var e=this;this.next=null,this.entry=null,this.finish=function(){g5(e,t)}}var Zo;Ye.WritableState=fu;var H4={deprecate:nE()},sE=Xm(),Ll=require("buffer").Buffer,z4=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function G4(t){return Ll.from(t)}function W4(t){return Ll.isBuffer(t)||t instanceof z4}var sg=eg(),K4=tg(),Y4=K4.getHighWaterMark,Jn=Yn().codes,J4=Jn.ERR_INVALID_ARG_TYPE,X4=Jn.ERR_METHOD_NOT_IMPLEMENTED,Z4=Jn.ERR_MULTIPLE_CALLBACK,Q4=Jn.ERR_STREAM_CANNOT_PIPE,e5=Jn.ERR_STREAM_DESTROYED,t5=Jn.ERR_STREAM_NULL_VALUES,r5=Jn.ERR_STREAM_WRITE_AFTER_END,n5=Jn.ERR_UNKNOWN_ENCODING,Qo=sg.errorOrDestroy;Xo()(Ye,sE);function i5(){}function fu(t,e,r){Zo=Zo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Zo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Y4(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){f5(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new oE(this)}fu.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(fu.prototype,"buffer",{get:H4.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Nl;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Nl=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ye,Symbol.hasInstance,{value:function(e){return Nl.call(this,e)?!0:this!==Ye?!1:e&&e._writableState instanceof fu}})):Nl=function(e){return e instanceof this};function Ye(t){Zo=Zo||Ti();var e=this instanceof Zo;if(!e&&!Nl.call(Ye,this))return new Ye(t);this._writableState=new fu(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),sE.call(this)}Ye.prototype.pipe=function(){Qo(this,new Q4)};function o5(t,e){var r=new r5;Qo(t,r),process.nextTick(e,r)}function s5(t,e,r,n){var i;return r===null?i=new t5:typeof r!="string"&&!e.objectMode&&(i=new J4("chunk",["string","Buffer"],r)),i?(Qo(t,i),process.nextTick(n,i),!1):!0}Ye.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&W4(t);return o&&!Ll.isBuffer(t)&&(t=G4(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=i5),n.ending?o5(this,r):(o||s5(this,n,t,r))&&(n.pendingcb++,i=u5(this,n,o,t,e,r)),i};Ye.prototype.cork=function(){this._writableState.corked++};Ye.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&aE(this,t))};Ye.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new n5(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Ye.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function a5(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Ll.from(e,r)),e}Object.defineProperty(Ye.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function u5(t,e,r,n,i,o){if(!r){var s=a5(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else og(t,e,!1,a,n,i,o);return u}function og(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new e5("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function c5(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(lu,t,e),t._writableState.errorEmitted=!0,Qo(t,n)):(i(n),t._writableState.errorEmitted=!0,Qo(t,n),lu(t,e))}function l5(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function f5(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Z4;if(l5(r),e)c5(t,r,n,e,i);else{var o=uE(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&aE(t,r),n?process.nextTick(iE,t,r,o,i):iE(t,r,o,i)}}function iE(t,e,r,n){r||d5(t,e),e.pendingcb--,n(),lu(t,e)}function d5(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function aE(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,og(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new oE(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=e.objectMode?1:u.length;if(og(t,e,!1,f,u,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Ye.prototype._write=function(t,e,r){r(new X4("_write()"))};Ye.prototype._writev=null;Ye.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||m5(this,n,r),this};Object.defineProperty(Ye.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function uE(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function h5(t,e){t._final(function(r){e.pendingcb--,r&&Qo(t,r),e.prefinished=!0,t.emit("prefinish"),lu(t,e)})}function p5(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(h5,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function lu(t,e){var r=uE(e);if(r&&(p5(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function m5(t,e,r){e.ending=!0,lu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function g5(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Ye.prototype.destroy=sg.destroy;Ye.prototype._undestroy=sg.undestroy;Ye.prototype._destroy=function(t,e){e(t)}});var Ti=D((Hle,fE)=>{"use strict";var y5=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};fE.exports=Ur;var lE=lg(),cg=ag();Xo()(Ur,lE);for(ug=y5(cg.prototype),Bl=0;Bl<ug.length;Bl++)ql=ug[Bl],Ur.prototype[ql]||(Ur.prototype[ql]=cg.prototype[ql]);var ug,ql,Bl;function Ur(t){if(!(this instanceof Ur))return new Ur(t);lE.call(this,t),cg.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",D5)))}Object.defineProperty(Ur.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ur.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ur.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function D5(){this._writableState.ended||process.nextTick(v5,this)}function v5(t){t.end()}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var pE=D((fg,hE)=>{var Ml=require("buffer"),Vr=Ml.Buffer;function dE(t,e){for(var r in t)e[r]=t[r]}Vr.from&&Vr.alloc&&Vr.allocUnsafe&&Vr.allocUnsafeSlow?hE.exports=Ml:(dE(Ml,fg),fg.Buffer=Pi);function Pi(t,e,r){return Vr(t,e,r)}Pi.prototype=Object.create(Vr.prototype);dE(Vr,Pi);Pi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Vr(t,e,r)};Pi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Vr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Pi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Vr(t)};Pi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ml.SlowBuffer(t)}});var pg=D(gE=>{"use strict";var hg=pE().Buffer,mE=hg.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function b5(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function w5(t){var e=b5(t);if(typeof e!="string"&&(hg.isEncoding===mE||!mE(t)))throw new Error("Unknown encoding: "+t);return e||t}gE.StringDecoder=du;function du(t){this.encoding=w5(t);var e;switch(this.encoding){case"utf16le":this.text=F5,this.end=O5,e=4;break;case"utf8":this.fillLast=C5,e=4;break;case"base64":this.text=A5,this.end=k5,e=3;break;default:this.write=T5,this.end=P5;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=hg.allocUnsafe(e)}du.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};du.prototype.end=x5;du.prototype.text=S5;du.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function dg(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function _5(t,e,r){var n=e.length-1;if(n<r)return 0;var i=dg(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=dg(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=dg(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function E5(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function C5(t){var e=this.lastTotal-this.lastNeed,r=E5(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function S5(t,e){var r=_5(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function x5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function F5(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function O5(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function A5(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function k5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function T5(t){return t.toString(this.encoding)}function P5(t){return t&&t.length?this.write(t):""}});var Ul=D((Gle,vE)=>{"use strict";var yE=Yn().codes.ERR_STREAM_PREMATURE_CLOSE;function R5(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function $5(){}function I5(t){return t.setHeader&&typeof t.abort=="function"}function DE(t,e,r){if(typeof e=="function")return DE(t,null,e);e||(e={}),r=R5(r||$5);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(t)},l=function(p){r.call(t,p)},f=function(){var p;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(p=new yE),r.call(t,p);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(p=new yE),r.call(t,p)},h=function(){t.req.on("finish",a)};return I5(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",l),t.removeListener("close",f)}}vE.exports=DE});var wE=D((Wle,bE)=>{"use strict";var Vl;function Xn(t,e,r){return e=j5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j5(t){var e=N5(t,"string");return typeof e=="symbol"?e:String(e)}function N5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var L5=Ul(),Zn=Symbol("lastResolve"),Ri=Symbol("lastReject"),hu=Symbol("error"),Hl=Symbol("ended"),$i=Symbol("lastPromise"),mg=Symbol("handlePromise"),Ii=Symbol("stream");function Qn(t,e){return{value:t,done:e}}function B5(t){var e=t[Zn];if(e!==null){var r=t[Ii].read();r!==null&&(t[$i]=null,t[Zn]=null,t[Ri]=null,e(Qn(r,!1)))}}function q5(t){process.nextTick(B5,t)}function M5(t,e){return function(r,n){t.then(function(){if(e[Hl]){r(Qn(void 0,!0));return}e[mg](r,n)},n)}}var U5=Object.getPrototypeOf(function(){}),V5=Object.setPrototypeOf((Vl={get stream(){return this[Ii]},next:function(){var e=this,r=this[hu];if(r!==null)return Promise.reject(r);if(this[Hl])return Promise.resolve(Qn(void 0,!0));if(this[Ii].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[hu]?a(e[hu]):s(Qn(void 0,!0))})});var n=this[$i],i;if(n)i=new Promise(M5(n,this));else{var o=this[Ii].read();if(o!==null)return Promise.resolve(Qn(o,!1));i=new Promise(this[mg])}return this[$i]=i,i}},Xn(Vl,Symbol.asyncIterator,function(){return this}),Xn(Vl,"return",function(){var e=this;return new Promise(function(r,n){e[Ii].destroy(null,function(i){if(i){n(i);return}r(Qn(void 0,!0))})})}),Vl),U5),H5=function(e){var r,n=Object.create(V5,(r={},Xn(r,Ii,{value:e,writable:!0}),Xn(r,Zn,{value:null,writable:!0}),Xn(r,Ri,{value:null,writable:!0}),Xn(r,hu,{value:null,writable:!0}),Xn(r,Hl,{value:e._readableState.endEmitted,writable:!0}),Xn(r,mg,{value:function(o,s){var a=n[Ii].read();a?(n[$i]=null,n[Zn]=null,n[Ri]=null,o(Qn(a,!1))):(n[Zn]=o,n[Ri]=s)},writable:!0}),r));return n[$i]=null,L5(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Ri];o!==null&&(n[$i]=null,n[Zn]=null,n[Ri]=null,o(i)),n[hu]=i;return}var s=n[Zn];s!==null&&(n[$i]=null,n[Zn]=null,n[Ri]=null,s(Qn(void 0,!0))),n[Hl]=!0}),e.on("readable",q5.bind(null,n)),n};bE.exports=H5});var SE=D((Kle,CE)=>{"use strict";function _E(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function z5(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){_E(o,n,i,s,a,"next",u)}function a(u){_E(o,n,i,s,a,"throw",u)}s(void 0)})}}function EE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function G5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?EE(Object(r),!0).forEach(function(n){W5(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):EE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function W5(t,e,r){return e=K5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K5(t){var e=Y5(t,"string");return typeof e=="symbol"?e:String(e)}function Y5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var J5=Yn().codes.ERR_INVALID_ARG_TYPE;function X5(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new J5("iterable",["Iterable"],e);var i=new t(G5({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=z5(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}CE.exports=X5});var lg=D((Jle,IE)=>{"use strict";IE.exports=ye;var es;ye.ReadableState=AE;var Yle=require("events").EventEmitter,OE=function(e,r){return e.listeners(r).length},mu=Xm(),zl=require("buffer").Buffer,Z5=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Q5(t){return zl.from(t)}function eU(t){return zl.isBuffer(t)||t instanceof Z5}var gg=require("util"),ue;gg&&gg.debuglog?ue=gg.debuglog("stream"):ue=function(){};var tU=K_(),Eg=eg(),rU=tg(),nU=rU.getHighWaterMark,Gl=Yn().codes,iU=Gl.ERR_INVALID_ARG_TYPE,oU=Gl.ERR_STREAM_PUSH_AFTER_EOF,sU=Gl.ERR_METHOD_NOT_IMPLEMENTED,aU=Gl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ts,yg,Dg;Xo()(ye,mu);var pu=Eg.errorOrDestroy,vg=["error","close","destroy","pause","resume"];function uU(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function AE(t,e,r){es=es||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof es),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=nU(this,t,"readableHighWaterMark",r),this.buffer=new tU,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(ts||(ts=pg().StringDecoder),this.decoder=new ts(t.encoding),this.encoding=t.encoding)}function ye(t){if(es=es||Ti(),!(this instanceof ye))return new ye(t);var e=this instanceof es;this._readableState=new AE(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),mu.call(this)}Object.defineProperty(ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ye.prototype.destroy=Eg.destroy;ye.prototype._undestroy=Eg.undestroy;ye.prototype._destroy=function(t,e){e(t)};ye.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=zl.from(t,e),e=""),n=!0),kE(this,t,e,!1,n)};ye.prototype.unshift=function(t){return kE(this,t,null,!0,!1)};function kE(t,e,r,n,i){ue("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,fU(t,o);else{var s;if(i||(s=cU(o,e)),s)pu(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==zl.prototype&&(e=Q5(e)),n)o.endEmitted?pu(t,new aU):bg(t,o,e,!0);else if(o.ended)pu(t,new oU);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?bg(t,o,e,!1):_g(t,o)):bg(t,o,e,!1)}else n||(o.reading=!1,_g(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function bg(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Wl(t)),_g(t,e)}function cU(t,e){var r;return!eU(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new iU("chunk",["string","Buffer","Uint8Array"],e)),r}ye.prototype.isPaused=function(){return this._readableState.flowing===!1};ye.prototype.setEncoding=function(t){ts||(ts=pg().StringDecoder);var e=new ts(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var xE=1073741824;function lU(t){return t>=xE?t=xE:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function FE(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=lU(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ye.prototype.read=function(t){ue("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ue("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?wg(this):Wl(this),null;if(t=FE(t,e),t===0&&e.ended)return e.length===0&&wg(this),null;var n=e.needReadable;ue("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ue("length less than watermark",n)),e.ended||e.reading?(n=!1,ue("reading or ended",n)):n&&(ue("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=FE(r,e)));var i;return t>0?i=RE(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&wg(this)),i!==null&&this.emit("data",i),i};function fU(t,e){if(ue("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Wl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,TE(t)))}}function Wl(t){var e=t._readableState;ue("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ue("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(TE,t))}function TE(t){var e=t._readableState;ue("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Cg(t)}function _g(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(dU,t,e))}function dU(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ue("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ye.prototype._read=function(t){pu(this,new sU("_read()"))};ye.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,ue("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:v;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(g,w){ue("onunpipe"),g===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,l())}function a(){ue("onend"),t.end()}var u=hU(r);t.on("drain",u);var c=!1;function l(){ue("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",v),r.removeListener("data",f),c=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(g){ue("ondata");var w=t.write(g);ue("dest.write",w),w===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&$E(n.pipes,t)!==-1)&&!c&&(ue("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){ue("onerror",g),v(),t.removeListener("error",h),OE(t,"error")===0&&pu(t,g)}uU(t,"error",h);function d(){t.removeListener("finish",p),v()}t.once("close",d);function p(){ue("onfinish"),t.removeListener("close",d),v()}t.once("finish",p);function v(){ue("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ue("pipe resume"),r.resume()),t};function hU(t){return function(){var r=t._readableState;ue("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&OE(t,"data")&&(r.flowing=!0,Cg(t))}}ye.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=$E(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ye.prototype.on=function(t,e){var r=mu.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ue("on readable",n.length,n.reading),n.length?Wl(this):n.reading||process.nextTick(pU,this)),r};ye.prototype.addListener=ye.prototype.on;ye.prototype.removeListener=function(t,e){var r=mu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(PE,this),r};ye.prototype.removeAllListeners=function(t){var e=mu.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(PE,this),e};function PE(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function pU(t){ue("readable nexttick read 0"),t.read(0)}ye.prototype.resume=function(){var t=this._readableState;return t.flowing||(ue("resume"),t.flowing=!t.readableListening,mU(this,t)),t.paused=!1,this};function mU(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(gU,t,e))}function gU(t,e){ue("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Cg(t),e.flowing&&!e.reading&&t.read(0)}ye.prototype.pause=function(){return ue("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ue("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Cg(t){var e=t._readableState;for(ue("flow",e.flowing);e.flowing&&t.read()!==null;);}ye.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ue("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ue("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<vg.length;o++)t.on(vg[o],this.emit.bind(this,vg[o]));return this._read=function(s){ue("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ye.prototype[Symbol.asyncIterator]=function(){return yg===void 0&&(yg=wE()),yg(this)});Object.defineProperty(ye.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ye.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ye.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ye._fromList=RE;Object.defineProperty(ye.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function RE(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function wg(t){var e=t._readableState;ue("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(yU,e,t))}function yU(t,e){if(ue("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(ye.from=function(t,e){return Dg===void 0&&(Dg=SE()),Dg(ye,t,e)});function $E(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var Sg=D((Xle,NE)=>{"use strict";NE.exports=Dn;var Kl=Yn().codes,DU=Kl.ERR_METHOD_NOT_IMPLEMENTED,vU=Kl.ERR_MULTIPLE_CALLBACK,bU=Kl.ERR_TRANSFORM_ALREADY_TRANSFORMING,wU=Kl.ERR_TRANSFORM_WITH_LENGTH_0,Yl=Ti();Xo()(Dn,Yl);function _U(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new vU);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Dn(t){if(!(this instanceof Dn))return new Dn(t);Yl.call(this,t),this._transformState={afterTransform:_U.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",EU)}function EU(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){jE(t,e,r)}):jE(this,null,null)}Dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Yl.prototype.push.call(this,t,e)};Dn.prototype._transform=function(t,e,r){r(new DU("_transform()"))};Dn.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Dn.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Dn.prototype._destroy=function(t,e){Yl.prototype._destroy.call(this,t,function(r){e(r)})};function jE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new wU;if(t._transformState.transforming)throw new bU;return t.push(null)}});var qE=D((Zle,BE)=>{"use strict";BE.exports=gu;var LE=Sg();Xo()(gu,LE);function gu(t){if(!(this instanceof gu))return new gu(t);LE.call(this,t)}gu.prototype._transform=function(t,e,r){r(null,t)}});var zE=D((Qle,HE)=>{"use strict";var xg;function CU(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var VE=Yn().codes,SU=VE.ERR_MISSING_ARGS,xU=VE.ERR_STREAM_DESTROYED;function ME(t){if(t)throw t}function FU(t){return t.setHeader&&typeof t.abort=="function"}function OU(t,e,r,n){n=CU(n);var i=!1;t.on("close",function(){i=!0}),xg===void 0&&(xg=Ul()),xg(t,{readable:e,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,FU(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new xU("pipe"))}}}function UE(t){t()}function AU(t,e){return t.pipe(e)}function kU(t){return!t.length||typeof t[t.length-1]!="function"?ME:t.pop()}function TU(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=kU(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new SU("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return OU(s,u,c,function(l){i||(i=l),l&&o.forEach(UE),!u&&(o.forEach(UE),n(i))})});return e.reduce(AU)}HE.exports=TU});var GE=D((yr,Du)=>{var yu=require("stream");process.env.READABLE_STREAM==="disable"&&yu?(Du.exports=yu.Readable,Object.assign(Du.exports,yu),Du.exports.Stream=yu):(yr=Du.exports=lg(),yr.Stream=yu||yr,yr.Readable=yr,yr.Writable=ag(),yr.Duplex=Ti(),yr.Transform=Sg(),yr.PassThrough=qE(),yr.finished=Ul(),yr.pipeline=zE())});var Og=D(Fg=>{var WE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof Fg=="object"?t(Fg):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(WE={}):t(WE={})})(function(t){t.version="1.2.2";function e(){for(var F=0,L=new Array(256),S=0;S!=256;++S)F=S,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,L[S]=F;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(F){var L=0,S=0,I=0,R=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)R[I]=F[I];for(I=0;I!=256;++I)for(S=F[I],L=256+I;L<4096;L+=256)S=R[L]=S>>>8^F[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?R.subarray(I*256,I*256+256):R.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],c=i[4],l=i[5],f=i[6],h=i[7],d=i[8],p=i[9],v=i[10],g=i[11],w=i[12],x=i[13],y=i[14];function C(F,L){for(var S=L^-1,I=0,R=F.length;I<R;)S=S>>>8^r[(S^F.charCodeAt(I++))&255];return~S}function k(F,L){for(var S=L^-1,I=F.length-15,R=0;R<I;)S=y[F[R++]^S&255]^x[F[R++]^S>>8&255]^w[F[R++]^S>>16&255]^g[F[R++]^S>>>24]^v[F[R++]]^p[F[R++]]^d[F[R++]]^h[F[R++]]^f[F[R++]]^l[F[R++]]^c[F[R++]]^u[F[R++]]^a[F[R++]]^s[F[R++]]^o[F[R++]]^r[F[R++]];for(I+=15;R<I;)S=S>>>8^r[(S^F[R++])&255];return~S}function $(F,L){for(var S=L^-1,I=0,R=F.length,B=0,q=0;I<R;)B=F.charCodeAt(I++),B<128?S=S>>>8^r[(S^B)&255]:B<2048?(S=S>>>8^r[(S^(192|B>>6&31))&255],S=S>>>8^r[(S^(128|B&63))&255]):B>=55296&&B<57344?(B=(B&1023)+64,q=F.charCodeAt(I++)&1023,S=S>>>8^r[(S^(240|B>>8&7))&255],S=S>>>8^r[(S^(128|B>>2&63))&255],S=S>>>8^r[(S^(128|q>>6&15|(B&3)<<4))&255],S=S>>>8^r[(S^(128|q&63))&255]):(S=S>>>8^r[(S^(224|B>>12&15))&255],S=S>>>8^r[(S^(128|B>>6&63))&255],S=S>>>8^r[(S^(128|B&63))&255]);return~S}t.table=r,t.bstr=C,t.buf=k,t.str=$})});var YE=D((tfe,KE)=>{"use strict";var{Transform:PU}=GE(),RU=Og(),Ag=class extends PU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=RU.buf(e,this.checksum)>>>0,this.rawSize+=e.length),n(null,e)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};KE.exports=Ag});var XE=D((rfe,JE)=>{"use strict";var{DeflateRaw:$U}=require("zlib"),IU=Og(),kg=class extends $U{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(e,r){return e&&(this.compressedSize+=e.length),super.push(e,r)}_transform(e,r,n){e&&(this.checksum=IU.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,r,n)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(e=!1){return e?this.compressedSize:this.rawSize}};JE.exports=kg});var QE=D((nfe,ZE)=>{"use strict";ZE.exports={CRC32Stream:YE(),DeflateCRC32Stream:XE()}});var vu=D(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.checksum=rs.checksumFile=void 0;var jU=require("fs"),NU=require("crypto"),tC=require("stream"),LU=require("util"),{CRC32Stream:BU}=QE(),eC=(0,LU.promisify)(tC.pipeline),qU=(t,e,r)=>rC(jU.createReadStream(t),e,r);rs.checksumFile=qU;async function rC(t,e,r="hex"){let n=UU(t);if(e==="crc32"){let o=new BU,s=eC(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,NU.createHash)(e);return await eC(n,i),i.end(),i.digest(r)}rs.checksum=rC;function MU(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var UU=t=>MU(t)?t:new tC.Readable({read(){this.push(t),this.push(null)}})});var Tg=D((ofe,nC)=>{nC.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Jl=D(oC=>{var iC={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function VU(t){return function(...e){return e.length&&(t=t.replace(/\{(\d)\}/g,(r,n)=>e[n]||"")),new Error("ADM-ZIP: "+t)}}for(let t of Object.keys(iC))oC[t]=VU(iC[t])});var lC=D((afe,cC)=>{var HU=require("fs"),at=require("path"),sC=Tg(),zU=Jl(),GU=typeof process=="object"&&process.platform==="win32",aC=t=>typeof t=="object"&&t!==null,uC=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Je(t){this.sep=at.sep,this.fs=HU,aC(t)&&aC(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}cC.exports=Je;Je.prototype.makeDir=function(t){let e=this;function r(n){let i=n.split(e.sep)[0];n.split(e.sep).forEach(function(o){if(!(!o||o.substr(-1,1)===":")){i+=e.sep+o;var s;try{s=e.fs.statSync(i)}catch{e.fs.mkdirSync(i)}if(s&&s.isFile())throw zU.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Je.prototype.writeFileTo=function(t,e,r,n){let i=this;if(i.fs.existsSync(t)){if(!r)return!1;var o=i.fs.statSync(t);if(o.isDirectory())return!1}var s=at.dirname(t);i.fs.existsSync(s)||i.makeDir(s);var a;try{a=i.fs.openSync(t,"w",438)}catch{i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0};Je.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let o=this;o.fs.exists(t,function(s){if(s&&!r)return i(!1);o.fs.stat(t,function(a,u){if(s&&u.isDirectory())return i(!1);var c=at.dirname(t);o.fs.exists(c,function(l){l||o.makeDir(c),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,p){o.fs.write(p,e,0,e.length,0,function(){o.fs.close(p,function(){o.fs.chmod(t,n||438,function(){i(!0)})})})})}):h?o.fs.write(h,e,0,e.length,0,function(){o.fs.close(h,function(){o.fs.chmod(t,n||438,function(){i(!0)})})}):o.fs.chmod(t,n||438,function(){i(!0)})})})})})};Je.prototype.findFiles=function(t){let e=this;function r(n,i,o){typeof i=="boolean"&&(o=i,i=void 0);let s=[];return e.fs.readdirSync(n).forEach(function(a){let u=at.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&s.push(at.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Je.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(i,o){if(i)return e(i);let s=o.length;if(!s)return e(null,n);o.forEach(function(a){a=at.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(at.normalize(a)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(a,function(l,f){if(l)return e(l);n=n.concat(f),--s||e(null,n)}):--s||e(null,n))})})})};Je.prototype.getAttributes=function(){};Je.prototype.setAttributes=function(){};Je.crc32update=function(t,e){return uC[(t^e)&255]^t>>>8};Je.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Je.crc32update(r,t[n++]);return~r>>>0};Je.methodToString=function(t){switch(t){case sC.STORED:return"STORED ("+t+")";case sC.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Je.canonical=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.join(".",e)};Je.zipnamefix=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.posix.join(".",e)};Je.findLast=function(t,e){if(!Array.isArray(t))throw new TypeError("arr is not array");let r=t.length>>>0;for(let n=r-1;n>=0;n--)if(e(t[n],n,t))return t[n]};Je.sanitize=function(t,e){t=at.resolve(at.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=at.normalize(at.join(t,r.slice(n,i).join(at.sep)));if(o.indexOf(t)===0)return o}return at.normalize(at.join(t,at.basename(e)))};Je.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Je.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Je.fromDOS2Date=function(t){return new Date((t>>25&127)+1980,Math.max((t>>21&15)-1,0),Math.max(t>>16&31,1),t>>11&31,t>>5&63,(t&31)<<1)};Je.fromDate2DOS=function(t){let e=0,r=0;return t.getFullYear()>1979&&(e=(t.getFullYear()-1980&127)<<9|t.getMonth()+1<<5|t.getDate(),r=t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1),e<<16|r};Je.isWin=GU;Je.crcTable=uC});var dC=D((ufe,fC)=>{var WU=require("path");fC.exports=function(t,{fs:e}){var r=t||"",n=o(),i=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(i=e.statSync(r),n.directory=i.isDirectory(),n.mtime=i.mtime,n.atime=i.atime,n.executable=(73&i.mode)!==0,n.readonly=(128&i.mode)===0,n.hidden=WU.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:r,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var pC=D((cfe,hC)=>{hC.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var is=D((lfe,ns)=>{ns.exports=lC();ns.exports.Constants=Tg();ns.exports.Errors=Jl();ns.exports.FileAttr=dC();ns.exports.decoder=pC()});var gC=D((ffe,mC)=>{var ei=is(),V=ei.Constants;mC.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;t|=ei.isWin?2560:768,r|=V.FLG_EFS;let v={extraLen:0},g=y=>Math.max(0,y)>>>0,w=y=>Math.max(0,y)&65535,x=y=>Math.max(0,y)&255;return i=ei.fromDate2DOS(new Date),{get made(){return t},set made(y){t=y},get version(){return e},set version(y){e=y},get flags(){return r},set flags(y){r=y},get flags_efs(){return(r&V.FLG_EFS)>0},set flags_efs(y){y?r|=V.FLG_EFS:r&=~V.FLG_EFS},get flags_desc(){return(r&V.FLG_DESC)>0},set flags_desc(y){y?r|=V.FLG_DESC:r&=~V.FLG_DESC},get method(){return n},set method(y){switch(y){case V.STORED:this.version=10;case V.DEFLATED:default:this.version=20}n=y},get time(){return ei.fromDOS2Date(this.timeval)},set time(y){this.timeval=ei.fromDate2DOS(y)},get timeval(){return i},set timeval(y){i=g(y)},get timeHighByte(){return x(i>>>8)},get crc(){return o},set crc(y){o=g(y)},get compressedSize(){return s},set compressedSize(y){s=g(y)},get size(){return a},set size(y){a=g(y)},get fileNameLength(){return u},set fileNameLength(y){u=y},get extraLength(){return c},set extraLength(y){c=y},get extraLocalLength(){return v.extraLen},set extraLocalLength(y){v.extraLen=y},get commentLength(){return l},set commentLength(y){l=y},get diskNumStart(){return f},set diskNumStart(y){f=g(y)},get inAttr(){return h},set inAttr(y){h=g(y)},get attr(){return d},set attr(y){d=g(y)},get fileAttr(){return(d||0)>>16&4095},get offset(){return p},set offset(y){p=g(y)},get encrypted(){return(r&V.FLG_ENC)===V.FLG_ENC},get centralHeaderSize(){return V.CENHDR+u+c+l},get realDataOffset(){return p+V.LOCHDR+v.fnameLen+v.extraLen},get localHeader(){return v},loadLocalHeaderFromBinary:function(y){var C=y.slice(p,p+V.LOCHDR);if(C.readUInt32LE(0)!==V.LOCSIG)throw ei.Errors.INVALID_LOC();v.version=C.readUInt16LE(V.LOCVER),v.flags=C.readUInt16LE(V.LOCFLG),v.method=C.readUInt16LE(V.LOCHOW),v.time=C.readUInt32LE(V.LOCTIM),v.crc=C.readUInt32LE(V.LOCCRC),v.compressedSize=C.readUInt32LE(V.LOCSIZ),v.size=C.readUInt32LE(V.LOCLEN),v.fnameLen=C.readUInt16LE(V.LOCNAM),v.extraLen=C.readUInt16LE(V.LOCEXT);let k=p+V.LOCHDR+v.fnameLen,$=k+v.extraLen;return y.slice(k,$)},loadFromBinary:function(y){if(y.length!==V.CENHDR||y.readUInt32LE(0)!==V.CENSIG)throw ei.Errors.INVALID_CEN();t=y.readUInt16LE(V.CENVEM),e=y.readUInt16LE(V.CENVER),r=y.readUInt16LE(V.CENFLG),n=y.readUInt16LE(V.CENHOW),i=y.readUInt32LE(V.CENTIM),o=y.readUInt32LE(V.CENCRC),s=y.readUInt32LE(V.CENSIZ),a=y.readUInt32LE(V.CENLEN),u=y.readUInt16LE(V.CENNAM),c=y.readUInt16LE(V.CENEXT),l=y.readUInt16LE(V.CENCOM),f=y.readUInt16LE(V.CENDSK),h=y.readUInt16LE(V.CENATT),d=y.readUInt32LE(V.CENATX),p=y.readUInt32LE(V.CENOFF)},localHeaderToBinary:function(){var y=Buffer.alloc(V.LOCHDR);return y.writeUInt32LE(V.LOCSIG,0),y.writeUInt16LE(e,V.LOCVER),y.writeUInt16LE(r,V.LOCFLG),y.writeUInt16LE(n,V.LOCHOW),y.writeUInt32LE(i,V.LOCTIM),y.writeUInt32LE(o,V.LOCCRC),y.writeUInt32LE(s,V.LOCSIZ),y.writeUInt32LE(a,V.LOCLEN),y.writeUInt16LE(u,V.LOCNAM),y.writeUInt16LE(v.extraLen,V.LOCEXT),y},centralHeaderToBinary:function(){var y=Buffer.alloc(V.CENHDR+u+c+l);return y.writeUInt32LE(V.CENSIG,0),y.writeUInt16LE(t,V.CENVEM),y.writeUInt16LE(e,V.CENVER),y.writeUInt16LE(r,V.CENFLG),y.writeUInt16LE(n,V.CENHOW),y.writeUInt32LE(i,V.CENTIM),y.writeUInt32LE(o,V.CENCRC),y.writeUInt32LE(s,V.CENSIZ),y.writeUInt32LE(a,V.CENLEN),y.writeUInt16LE(u,V.CENNAM),y.writeUInt16LE(c,V.CENEXT),y.writeUInt16LE(l,V.CENCOM),y.writeUInt16LE(f,V.CENDSK),y.writeUInt16LE(h,V.CENATT),y.writeUInt32LE(d,V.CENATX),y.writeUInt32LE(p,V.CENOFF),y},toJSON:function(){let y=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:ei.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:y(s),size:y(a),fileNameLength:y(u),extraLength:y(c),commentLength:y(l),diskNumStart:f,inAttr:h,attr:d,offset:p,centralHeaderSize:y(V.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var DC=D((dfe,yC)=>{var os=is(),Me=os.Constants;yC.exports=function(){var t=0,e=0,r=0,n=0,i=0;return{get diskEntries(){return t},set diskEntries(o){t=e=o},get totalEntries(){return e},set totalEntries(o){e=t=o},get size(){return r},set size(o){r=o},get offset(){return n},set offset(o){n=o},get commentLength(){return i},set commentLength(o){i=o},get mainHeaderSize(){return Me.ENDHDR+i},loadFromBinary:function(o){if((o.length!==Me.ENDHDR||o.readUInt32LE(0)!==Me.ENDSIG)&&(o.length<Me.ZIP64HDR||o.readUInt32LE(0)!==Me.ZIP64SIG))throw os.Errors.INVALID_END();o.readUInt32LE(0)===Me.ENDSIG?(t=o.readUInt16LE(Me.ENDSUB),e=o.readUInt16LE(Me.ENDTOT),r=o.readUInt32LE(Me.ENDSIZ),n=o.readUInt32LE(Me.ENDOFF),i=o.readUInt16LE(Me.ENDCOM)):(t=os.readBigUInt64LE(o,Me.ZIP64SUB),e=os.readBigUInt64LE(o,Me.ZIP64TOT),r=os.readBigUInt64LE(o,Me.ZIP64SIZE),n=os.readBigUInt64LE(o,Me.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(Me.ENDHDR+i);return o.writeUInt32LE(Me.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,Me.ENDSUB),o.writeUInt16LE(e,Me.ENDTOT),o.writeUInt32LE(r,Me.ENDSIZ),o.writeUInt32LE(n,Me.ENDOFF),o.writeUInt16LE(i,Me.ENDCOM),o.fill(" ",Me.ENDHDR),o},toJSON:function(){let o=function(s,a){let u=s.toString(16).toUpperCase();for(;u.length<a;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:o(n,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Rg=D(Pg=>{Pg.EntryHeader=gC();Pg.MainHeader=DC()});var bC=D((pfe,vC)=>{vC.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),o=[],s=0;i.on("data",function(a){o.push(a),s+=a.length}),i.on("end",function(){var a=Buffer.alloc(s),u=0;a.fill(0);for(var c=0;c<o.length;c++){var l=o[c];l.copy(a,u),u+=l.length}n&&n(a)}),i.end(t)}}}});var _C=D((mfe,wC)=>{var KU=+(process.versions?process.versions.node:"").split(".")[0]||0;wC.exports=function(t,e){var r=require("zlib");let n=KU>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var o=r.createInflateRaw(n),s=[],a=0;o.on("data",function(u){s.push(u),a+=u.length}),o.on("end",function(){var u=Buffer.alloc(a),c=0;u.fill(0);for(var l=0;l<s.length;l++){var f=s[l];f.copy(u,c),c+=f.length}i&&i(u)}),o.end(t)}}}});var FC=D((gfe,xC)=>{"use strict";var{randomFillSync:EC}=require("crypto"),YU=Jl(),JU=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=e>>>1^3988292384:e>>>=1;return e>>>0}),SC=(t,e)=>Math.imul(t,e)>>>0,CC=(t,e)=>JU[(t^e)&255]^t>>>8,bu=()=>typeof EC=="function"?EC(Buffer.alloc(12)):bu.node();bu.node=()=>{let t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=Math.random()*256&255;return t};var Xl={genSalt:bu};function Zl(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<e.length;r++)this.updateKeys(e[r])}Zl.prototype.updateKeys=function(t){let e=this.keys;return e[0]=CC(e[0],t),e[1]+=e[0]&255,e[1]=SC(e[1],134775813)+1,e[2]=CC(e[2],e[1]>>>24),t};Zl.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return SC(t,t^1)>>8&255};function XU(t){let e=new Zl(t);return function(r){let n=Buffer.alloc(r.length),i=0;for(let o of r)n[i++]=e.updateKeys(o^e.next());return n}}function ZU(t){let e=new Zl(t);return function(r,n,i=0){n||(n=Buffer.alloc(r.length));for(let o of r){let s=e.next();n[i++]=o^s,e.updateKeys(o)}return n}}function QU(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=XU(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw YU.WRONG_PASSWORD();return n(t.slice(12))}function e9(t){Buffer.isBuffer(t)&&t.length>=12?Xl.genSalt=function(){return t.slice(0,12)}:t==="node"?Xl.genSalt=bu.node:Xl.genSalt=bu}function t9(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=ZU(r),o=Xl.genSalt();o[11]=e.crc>>>24&255,n&&(o[10]=e.crc>>>16&255);let s=Buffer.alloc(t.length+12);return i(o,s),i(t,s,12)}xC.exports={decrypt:QU,encrypt:t9,_salter:e9}});var OC=D(Ql=>{Ql.Deflater=bC();Ql.Inflater=_C();Ql.ZipCrypto=FC()});var Ig=D((Dfe,AC)=>{var we=is(),r9=Rg(),Xe=we.Constants,$g=OC();AC.exports=function(t,e){var r=new r9.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,f=typeof l.decoder=="object"?l.decoder:we.decoder;c=f.hasOwnProperty("efs")?f.efs:!1;function h(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function d(y){if(r.flags_desc){let C={},k=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(k)==Xe.LOCSIG||e.readUInt32LE(k)==Xe.CENSIG)throw we.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(k)==Xe.EXTSIG)C.crc=e.readUInt32LE(k+Xe.EXTCRC),C.compressedSize=e.readUInt32LE(k+Xe.EXTSIZ),C.size=e.readUInt32LE(k+Xe.EXTLEN);else if(e.readUInt16LE(k+12)===19280)C.crc=e.readUInt32LE(k+Xe.EXTCRC-4),C.compressedSize=e.readUInt32LE(k+Xe.EXTSIZ-4),C.size=e.readUInt32LE(k+Xe.EXTLEN-4);else throw we.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw we.Errors.DESCRIPTOR_FAULTY();if(we.crc32(y)!==C.crc)return!1}else if(we.crc32(y)!==r.localHeader.crc)return!1;return!0}function p(y,C,k){if(typeof C>"u"&&typeof y=="string"&&(k=y,y=void 0),o)return y&&C&&C(Buffer.alloc(0),we.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=h();if($.length===0)return y&&C&&C($),$;if(r.encrypted){if(typeof k!="string"&&!Buffer.isBuffer(k))throw we.Errors.INVALID_PASS_PARAM();$=$g.ZipCrypto.decrypt($,r,k)}var F=Buffer.alloc(r.size);switch(r.method){case we.Constants.STORED:if($.copy(F),d(F))return y&&C&&C(F),F;throw y&&C&&C(F,we.Errors.BAD_CRC()),we.Errors.BAD_CRC();case we.Constants.DEFLATED:var L=new $g.Inflater($,r.size);if(y)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,we.Errors.BAD_CRC()))});else{if(L.inflate(F).copy(F,0),!d(F))throw we.Errors.BAD_CRC(`"${f.decode(n)}"`);return F}break;default:throw y&&C&&C(Buffer.alloc(0),we.Errors.UNKNOWN_METHOD()),we.Errors.UNKNOWN_METHOD()}}function v(y,C){if((!s||!s.length)&&Buffer.isBuffer(e))return y&&C&&C(h()),h();if(s.length&&!o){var k;switch(r.method){case we.Constants.STORED:return r.compressedSize=r.size,k=Buffer.alloc(s.length),s.copy(k),y&&C&&C(k),k;default:case we.Constants.DEFLATED:var $=new $g.Deflater(s);if(y)$.deflateAsync(function(L){k=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(k),C&&C(k)});else{var F=$.deflate();return r.compressedSize=F.length,F}$=null;break}}else if(y&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function g(y,C){return(y.readUInt32LE(C+4)<<4)+y.readUInt32LE(C)}function w(y){try{for(var C=0,k,$,F;C+4<y.length;)k=y.readUInt16LE(C),C+=2,$=y.readUInt16LE(C),C+=2,F=y.slice(C,C+$),C+=$,Xe.ID_ZIP64===k&&x(F)}catch{throw we.Errors.EXTRA_FIELD_PARSE_ERROR()}}function x(y){var C,k,$,F;y.length>=Xe.EF_ZIP64_SCOMP&&(C=g(y,Xe.EF_ZIP64_SUNCOMP),r.size===Xe.EF_ZIP64_OR_32&&(r.size=C)),y.length>=Xe.EF_ZIP64_RHO&&(k=g(y,Xe.EF_ZIP64_SCOMP),r.compressedSize===Xe.EF_ZIP64_OR_32&&(r.compressedSize=k)),y.length>=Xe.EF_ZIP64_DSN&&($=g(y,Xe.EF_ZIP64_RHO),r.offset===Xe.EF_ZIP64_OR_32&&(r.offset=$)),y.length>=Xe.EF_ZIP64_DSN+4&&(F=y.readUInt32LE(Xe.EF_ZIP64_DSN),r.diskNumStart===Xe.EF_ZIP64_OR_16&&(r.diskNumStart=F))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(y){n=we.toBuffer(y,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return a},set extra(y){a=y,r.extraLength=y.length,w(y)},get comment(){return f.decode(i)},set comment(y){if(i=we.toBuffer(y,f.encode),r.commentLength=i.length,i.length>65535)throw we.Errors.COMMENT_TOO_LONG()},get name(){var y=f.decode(n);return o?y.substr(y.length-1).split("/").pop():y.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return v(!1,null)},getCompressedDataAsync:function(y){v(!0,y)},setData:function(y){s=we.toBuffer(y,we.decoder.encode),!o&&s.length?(r.size=s.length,r.method=we.Constants.DEFLATED,r.crc=we.crc32(y),r.changed=!0):r.method=we.Constants.STORED},getData:function(y){return r.changed?s:p(!1,null,y)},getDataAsync:function(y,C){r.changed?y(s):p(!0,y,C)},set attr(y){r.attr=y},get attr(){return r.attr},set header(y){r.loadFromBinary(y)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var y=r.centralHeaderToBinary(),C=we.Constants.CENHDR;return n.copy(y,C),C+=n.length,a.copy(y,C),C+=r.extraLength,i.copy(y,C),y},packLocalHeader:function(){let y=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),k=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(k,y),y+=C.length,n.copy(k,y),y+=n.length,u.copy(k,y),y+=u.length,k},toJSON:function(){let y=function(C){return"<"+(C&&C.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:y(e),data:y(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var PC=D((vfe,TC)=>{var kC=Ig(),n9=Rg(),bt=is();TC.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new n9.MainHeader,s=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?p(c.readEntries):s=!0;function h(){let g=new Set;for(let w of Object.keys(n)){let x=w.split("/");if(x.pop(),!!x.length)for(let y=0;y<x.length;y++){let C=x.slice(0,y+1).join("/")+"/";g.add(C)}}for(let w of g)if(!(w in n)){let x=new kC(c);x.entryName=w,x.attr=16,x.temporary=!0,r.push(x),n[x.entryName]=x,u.add(x)}}function d(){if(s=!0,n={},o.diskEntries>(t.length-o.offset)/bt.Constants.CENHDR)throw bt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(o.diskEntries);for(var g=o.offset,w=0;w<r.length;w++){var x=g,y=new kC(c,t);y.header=t.slice(x,x+=bt.Constants.CENHDR),y.entryName=t.slice(x,x+=y.header.fileNameLength),y.header.extraLength&&(y.extra=t.slice(x,x+=y.header.extraLength)),y.header.commentLength&&(y.comment=t.slice(x,x+y.header.commentLength)),g+=y.header.centralHeaderSize,r[w]=y,n[y.entryName]=y}u.clear(),h()}function p(g){var w=t.length-bt.Constants.ENDHDR,x=Math.max(0,w-65535),y=x,C=t.length,k=-1,$=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(x=0),w;w>=y;w--)if(t[w]===80){if(t.readUInt32LE(w)===bt.Constants.ENDSIG){k=w,$=w,C=w+bt.Constants.ENDHDR,y=w-bt.Constants.END64HDR;continue}if(t.readUInt32LE(w)===bt.Constants.END64SIG){y=x;continue}if(t.readUInt32LE(w)===bt.Constants.ZIP64SIG){k=w,C=w+bt.readBigUInt64LE(t,w+bt.Constants.ZIP64SIZE)+bt.Constants.ZIP64LEAD;break}}if(k==-1)throw bt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(k,C)),o.commentLength&&(i=t.slice($+bt.Constants.ENDHDR)),g&&d()}function v(){r.length>1&&!l&&r.sort((g,w)=>g.entryName.toLowerCase().localeCompare(w.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(g=>!u.has(g))},get comment(){return f.decode(i)},set comment(g){i=bt.toBuffer(g,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(g){this.entries.forEach(g)},getEntry:function(g){return s||d(),n[g]||null},setEntry:function(g){s||d(),r.push(g),n[g.entryName]=g,o.totalEntries=r.length},deleteFile:function(g,w=!0){s||d();let x=n[g];this.getEntryChildren(x,w).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(g){s||d();let w=n[g],x=r.indexOf(w);x>=0&&(r.splice(x,1),delete n[g],o.totalEntries=r.length)},getEntryChildren:function(g,w=!0){if(s||d(),typeof g=="object")if(g.isDirectory&&w){let x=[],y=g.entryName;for(let C of r)C.entryName.startsWith(y)&&x.push(C);return x}else return[g];return[]},getChildCount:function(g){if(g&&g.isDirectory){let w=this.getEntryChildren(g);return w.includes(g)?w.length-1:w.length}return 0},compressToBuffer:function(){s||d(),v();let g=[],w=[],x=0,y=0;o.size=0,o.offset=0;let C=0;for(let F of this.entries){let L=F.getCompressedData();F.header.offset=y;let S=F.packLocalHeader(),I=S.length+L.length;y+=I,g.push(S),g.push(L);let R=F.packCentralHeader();w.push(R),o.size+=R.length,x+=I+R.length,C++}x+=o.mainHeaderSize,o.offset=y,o.totalEntries=C,y=0;let k=Buffer.alloc(x);for(let F of g)F.copy(k,y),y+=F.length;for(let F of w)F.copy(k,y),y+=F.length;let $=o.toBinary();return i&&i.copy($,bt.Constants.ENDHDR),$.copy(k,y),t=k,s=!1,k},toAsyncBuffer:function(g,w,x,y){try{s||d(),v();let C=[],k=[],$=0,F=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let R=I.shift(),B=R.entryName+R.extra.toString();x&&x(B),R.getCompressedDataAsync(function(q){y&&y(B),R.header.offset=F;let K=R.packLocalHeader(),M=K.length+q.length;F+=M,C.push(K),C.push(q);let E=R.packCentralHeader();k.push(E),o.size+=E.length,$+=M+E.length,L++,S(I)})}else{$+=o.mainHeaderSize,o.offset=F,o.totalEntries=L,F=0;let R=Buffer.alloc($);C.forEach(function(q){q.copy(R,F),F+=q.length}),k.forEach(function(q){q.copy(R,F),F+=q.length});let B=o.toBinary();i&&i.copy(B,bt.Constants.ENDHDR),B.copy(R,F),t=R,s=!1,g(R)}};S(Array.from(this.entries))}catch(C){w(C)}}}}});var IC=D((bfe,$C)=>{var Ue=is(),Ze=require("path"),i9=Ig(),o9=PC(),ji=(...t)=>Ue.findLast(t,e=>typeof e=="boolean"),RC=(...t)=>Ue.findLast(t,e=>typeof e=="string"),s9=(...t)=>Ue.findLast(t,e=>typeof e=="function"),a9={noSort:!1,readEntries:!1,method:Ue.Constants.NONE,fs:null};$C.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),a9);t&&typeof t=="object"&&(t instanceof Uint8Array||(Object.assign(n,t),t=n.input?n.input:void 0,n.input&&delete n.input),Buffer.isBuffer(t)&&(r=t,n.method=Ue.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new Ue(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=Ue.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=Ue.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw Ue.Errors.INVALID_FILENAME();let o=new o9(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ue;function c(d){if(d&&o){var p;if(typeof d=="string"&&(p=o.getEntry(Ze.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(p=o.getEntry(d.entryName)),p)return p}return null}function l(d){let{join:p,normalize:v,sep:g}=Ze.posix;return p(".",v(g+d.split("\\").join(g)+g))}function f(d){return d instanceof RegExp?function(p){return function(v){return p.test(v)}}(d):typeof d!="function"?()=>!0:d}let h=(d,p)=>{let v=p.slice(-1);return v=v===i.sep?i.sep:"",Ze.relative(d,p)+v};return{readFile:function(d,p){var v=c(d);return v&&v.getData(p)||null},childCount:function(d){let p=c(d);if(p)return o.getChildCount(p)},readFileAsync:function(d,p){var v=c(d);v?v.getDataAsync(p):p(null,"getEntry failed for:"+d)},readAsText:function(d,p){var v=c(d);if(v){var g=v.getData();if(g&&g.length)return g.toString(p||"utf8")}return""},readAsTextAsync:function(d,p,v){var g=c(d);g?g.getDataAsync(function(w,x){if(x){p(w,x);return}w&&w.length?p(w.toString(v||"utf8")):p("")}):p("")},deleteFile:function(d,p=!0){var v=c(d);v&&o.deleteFile(v.entryName,p)},deleteEntry:function(d){var p=c(d);p&&o.deleteEntry(p.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,p){var v=c(d);v&&(v.comment=p)},getZipEntryComment:function(d){var p=c(d);return p&&p.comment||""},updateFile:function(d,p){var v=c(d);v&&v.setData(p)},addLocalFile:function(d,p,v,g){if(i.fs.existsSync(d)){p=p?l(p):"";let w=Ze.win32.basename(Ze.win32.normalize(d));p+=v||w;let x=i.fs.statSync(d),y=x.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);x.isDirectory()&&(p+=i.sep),this.addFile(p,y,g,x)}else throw Ue.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,p){d=typeof d=="object"?d:{localPath:d};let v=Ze.resolve(d.localPath),{comment:g}=d,{zipPath:w,zipName:x}=d,y=this;i.fs.stat(v,function(C,k){if(C)return p(C,!1);w=w?l(w):"";let $=Ze.win32.basename(Ze.win32.normalize(v));if(w+=x||$,k.isFile())i.fs.readFile(v,function(F,L){return F?p(F,!1):(y.addFile(w,L,g,k),setImmediate(p,void 0,!0))});else if(k.isDirectory())return w+=i.sep,y.addFile(w,Buffer.alloc(0),g,k),setImmediate(p,void 0,!0)})},addLocalFolder:function(d,p,v){if(v=f(v),p=p?l(p):"",d=Ze.normalize(d),i.fs.existsSync(d)){let g=i.findFiles(d),w=this;if(g.length)for(let x of g){let y=Ze.join(p,h(d,x));v(y)&&w.addLocalFile(x,Ze.dirname(y))}}else throw Ue.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,p,v,g){g=f(g),v=v?l(v):"",d=Ze.normalize(d);var w=this;i.fs.open(d,"r",function(x){if(x&&x.code==="ENOENT")p(void 0,Ue.Errors.FILE_NOT_FOUND(d));else if(x)p(void 0,x);else{var y=i.findFiles(d),C=-1,k=function(){if(C+=1,C<y.length){var $=y[C],F=h(d,$).split("\\").join("/");F=F.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),g(F)?i.fs.stat($,function(L,S){L&&p(void 0,L),S.isFile()?i.fs.readFile($,function(I,R){I?p(void 0,I):(w.addFile(v+F,R,"",S),k())}):(w.addFile(v+F+"/",Buffer.alloc(0),"",S),k())}):process.nextTick(()=>{k()})}else p(!0,void 0)};k()}})},addLocalFolderAsync2:function(d,p){let v=this;d=typeof d=="object"?d:{localPath:d},localPath=Ze.resolve(l(d.localPath));let{zipPath:g,filter:w,namefix:x}=d;w instanceof RegExp?w=function(k){return function($){return k.test($)}}(w):typeof w!="function"&&(w=function(){return!0}),g=g?l(g):"",x=="latin1"&&(x=k=>k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof x!="function"&&(x=k=>k);let y=k=>Ze.join(g,x(h(localPath,k))),C=k=>Ze.win32.basename(Ze.win32.normalize(x(k)));i.fs.open(localPath,"r",function(k){k&&k.code==="ENOENT"?p(void 0,Ue.Errors.FILE_NOT_FOUND(localPath)):k?p(void 0,k):i.findFilesAsync(localPath,function($,F){if($)return p($);F=F.filter(L=>w(y(L))),F.length||p(void 0,!1),setImmediate(F.reverse().reduce(function(L,S){return function(I,R){if(I||R===!1)return setImmediate(L,I,!1);v.addLocalFileAsync({localPath:S,zipPath:Ze.dirname(y(S)),zipName:C(S)},L)}},p))})})},addLocalFolderPromise:function(d,p){return new Promise((v,g)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},p),(w,x)=>{w&&g(w),x&&v(this)})})},addFile:function(d,p,v,g){d=u(d);let w=c(d),x=w!=null;x||(w=new i9(n),w.entryName=d),w.comment=v||"";let y=typeof g=="object"&&g instanceof i.fs.Stats;y&&(w.header.time=g.mtime);var C=w.isDirectory?16:0;let k=w.isDirectory?16384:32768;return y?k|=4095&g.mode:typeof g=="number"?k|=4095&g:k|=w.isDirectory?493:420,C=(C|k<<16)>>>0,w.attr=C,w.setData(p),x||o.setEntry(w),w},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return c(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,p,v,g,w,x){g=ji(!1,g),w=ji(!1,w),v=ji(!0,v),x=RC(w,x);var y=c(d);if(!y)throw Ue.Errors.NO_ENTRY();var C=s(y.entryName),k=a(p,x&&!y.isDirectory?x:v?C:Ze.basename(C));if(y.isDirectory){var $=o.getEntryChildren(y);return $.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ue.Errors.CANT_EXTRACT_FILE();var R=s(S.entryName),B=a(p,v?R:Ze.basename(R));let q=w?S.header.fileAttr:void 0;i.writeFileTo(B,I,g,q)}),!0}var F=y.getData(o.password);if(!F)throw Ue.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(k)&&!g)throw Ue.Errors.CANT_OVERRIDE();let L=w?d.header.fileAttr:void 0;return i.writeFileTo(k,F,g,L),!0},test:function(d){if(!o)return!1;for(var p in o.entries)try{if(p.isDirectory)continue;var v=o.entries[p].getData(d);if(!v)return!1}catch{return!1}return!0},extractAllTo:function(d,p,v,g){if(v=ji(!1,v),g=RC(v,g),p=ji(!1,p),!o)throw Ue.Errors.NO_ZIP();o.entries.forEach(function(w){var x=a(d,s(w.entryName));if(w.isDirectory){i.makeDir(x);return}var y=w.getData(g);if(!y)throw Ue.Errors.CANT_EXTRACT_FILE();let C=v?w.header.fileAttr:void 0;i.writeFileTo(x,y,p,C);try{i.fs.utimesSync(x,w.header.time,w.header.time)}catch{throw Ue.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,p,v,g){if(g=s9(p,v,g),v=ji(!1,v),p=ji(!1,p),!g)return new Promise((k,$)=>{this.extractAllToAsync(d,p,v,function(F){F?$(F):k(this)})});if(!o){g(Ue.Errors.NO_ZIP());return}d=Ze.resolve(d);let w=k=>a(d,Ze.normalize(s(k.entryName))),x=(k,$)=>new Error(k+': "'+$+'"'),y=[],C=[];o.entries.forEach(k=>{k.isDirectory?y.push(k):C.push(k)});for(let k of y){let $=w(k),F=v?k.header.fileAttr:void 0;try{i.makeDir($),F&&i.fs.chmodSync($,F),i.fs.utimesSync($,k.header.time,k.header.time)}catch{g(x("Unable to create folder",$))}}C.reverse().reduce(function(k,$){return function(F){if(F)k(F);else{let L=Ze.normalize(s($.entryName)),S=a(d,L);$.getDataAsync(function(I,R){if(R)k(R);else if(!I)k(Ue.Errors.CANT_EXTRACT_FILE());else{let B=v?$.header.fileAttr:void 0;i.writeFileToAsync(S,I,p,B,function(q){q||k(x("Unable to write file",S)),i.fs.utimes(S,$.header.time,$.header.time,function(K){K?k(x("Unable to set times",S)):k()})})}})}}},g)()},writeZip:function(d,p){if(arguments.length===1&&typeof d=="function"&&(p=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var v=o.compressToBuffer();if(v){var g=i.writeFileTo(d,v,!0);typeof p=="function"&&p(g?null:new Error("failed"),"")}}},writeZipPromise:function(d,p){let{overwrite:v,perm:g}=Object.assign({overwrite:!0},p);return new Promise((w,x)=>{!d&&n.filename&&(d=n.filename),d||x("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(y=>{let C=k=>k?w(k):x("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,y,v,g,C)},x)})},toBufferPromise:function(){return new Promise((d,p)=>{o.toAsyncBuffer(d,p)})},toBuffer:function(d,p,v,g){return typeof d=="function"?(o.toAsyncBuffer(d,p,v,g),null):o.compressToBuffer()}}}});var JC=D((Kfe,YC)=>{var KC={};YC.exports=KC;var WC={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],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],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(WC).forEach(function(t){var e=WC[t],r=KC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var ZC=D((Yfe,XC)=>{"use strict";XC.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var eS=D((Jfe,QC)=>{"use strict";var h9=require("os"),Ar=ZC(),Tt=process.env,us=void 0;Ar("no-color")||Ar("no-colors")||Ar("color=false")?us=!1:(Ar("color")||Ar("colors")||Ar("color=true")||Ar("color=always"))&&(us=!0);"FORCE_COLOR"in Tt&&(us=Tt.FORCE_COLOR.length===0||parseInt(Tt.FORCE_COLOR,10)!==0);function p9(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function m9(t){if(us===!1)return 0;if(Ar("color=16m")||Ar("color=full")||Ar("color=truecolor"))return 3;if(Ar("color=256"))return 2;if(t&&!t.isTTY&&us!==!0)return 0;var e=us?1:0;if(process.platform==="win32"){var r=h9.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Tt})||Tt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Tt){var n=parseInt((Tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Tt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Tt.TERM)||"COLORTERM"in Tt?1:(Tt.TERM==="dumb",e)}function Ug(t){var e=m9(t);return p9(e)}QC.exports={supportsColor:Ug,stdout:Ug(process.stdout),stderr:Ug(process.stderr)}});var rS=D((Xfe,tS)=>{tS.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][a]:n+=o}),n}});var iS=D((Zfe,nS)=>{nS.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var c=Math.floor(Math.random()*u);return c}function s(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",f,h;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(l=l+u[h],f={up:0,down:0,mid:0},c.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var d=["up","mid","down"];for(var p in d)for(var v=d[p],g=0;g<=f[v];g++)c[v]&&(l=l+n[v][o(n[v].length)])}return l}return a(e,r)}});var sS=D((Qfe,oS)=>{oS.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var uS=D((ede,aS)=>{aS.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var lS=D((tde,cS)=>{cS.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var dS=D((rde,fS)=>{fS.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var DS=D((ide,yS)=>{var le={};yS.exports=le;le.themes={};var g9=require("util"),Ni=le.styles=JC(),pS=Object.defineProperties,y9=new RegExp(/[\r\n]+/g);le.supportsColor=eS().supportsColor;typeof le.enabled>"u"&&(le.enabled=le.supportsColor()!==!1);le.enable=function(){le.enabled=!0};le.disable=function(){le.enabled=!1};le.stripColors=le.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var nde=le.stylize=function(e,r){if(!le.enabled)return e+"";var n=Ni[r];return!n&&r in le?le[r](e):n.open+e+n.close},D9=/[|\\{}()[\]^$+*?.]/g,v9=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(D9,"\\$&")};function mS(t){var e=function r(){return w9.apply(r,arguments)};return e._styles=t,e.__proto__=b9,e}var gS=function(){var t={};return Ni.grey=Ni.gray,Object.keys(Ni).forEach(function(e){Ni[e].closeRe=new RegExp(v9(Ni[e].close),"g"),t[e]={get:function(){return mS(this._styles.concat(e))}}}),t}(),b9=pS(function(){},gS);function w9(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:g9.inspect(s)}).join(" ");if(!le.enabled||!e)return e;for(var r=e.indexOf(`
24
- `)!=-1,n=this._styles,i=n.length;i--;){var o=Ni[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(y9,function(s){return o.close+s+o.open}))}return e}le.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){le[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=le[t[r][o]](i);return i}return le[t[r]](n)}})(e)};function _9(){var t={};return Object.keys(gS).forEach(function(e){t[e]={get:function(){return mS([e])}}}),t}var E9=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};le.trap=rS();le.zalgo=iS();le.maps={};le.maps.america=sS()(le);le.maps.zebra=uS()(le);le.maps.rainbow=lS()(le);le.maps.random=dS()(le);for(hS in le.maps)(function(t){le[t]=function(e){return E9(le.maps[t],e)}})(hS);var hS;pS(le,_9())});var bS=D((ode,vS)=>{var C9=DS();vS.exports=C9});var wS=D(Vg=>{"use strict";Vg.indent=function(e){return new Array(e+1).join(" ")};Vg.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach(function(r){t[r]!==void 0&&(e=Math.max(e,r.length))}),e}});var _S=D((ade,S9)=>{S9.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var ES=D(Eu=>{"use strict";var zr=bS(),ri=wS(),x9=/[^\w\s\n\r\v\t\.,]/i;Eu.version=_S().version;var Hg=function(t,e){return t!==void 0||e.renderUndefined},of=function(t,e,r){return!!(typeof t=="boolean"||typeof t=="number"||typeof t=="function"||t===null||t===void 0||t instanceof Date||typeof t=="string"&&t.indexOf(`
25
- `)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&of(t[0],!0,r))},F9=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?zr[e.stringColor](t):t;var r=t+"";return t===!0?zr.green(r):t===!1?zr.red(r):t==null?zr.grey(r):typeof t=="number"?t>=0?zr[e.positiveNumberColor](r):zr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},zg=function(t,e){return t.multilineStringColor===null||t.noColor?e:zr[t.multilineStringColor](e)},O9=function(t,e,r){var n=t.split(`
23
+ `)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function pw(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",i="9229",o;return(o=e.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:e})}mw.Command=$p});var bw=D(dr=>{var{Argument:yw}=il(),{Command:Ip}=gw(),{CommanderError:yB,InvalidArgumentError:Dw}=ja(),{Help:DB}=xp(),{Option:vw}=kp();dr.program=new Ip;dr.createCommand=t=>new Ip(t);dr.createOption=(t,e)=>new vw(t,e);dr.createArgument=(t,e)=>new yw(t,e);dr.Command=Ip;dr.Option=vw;dr.Argument=yw;dr.Help=DB;dr.CommanderError=yB;dr.InvalidArgumentError=Dw;dr.InvalidOptionArgumentError=Dw});var Te=D((Sce,_w)=>{"use strict";var jp="\x1B",qe=`${jp}[`,bB="\x07",Np={to(t,e){return e?`${qe}${e+1};${t+1}H`:`${qe}${t+1}G`},move(t,e){let r="";return t<0?r+=`${qe}${-t}D`:t>0&&(r+=`${qe}${t}C`),e<0?r+=`${qe}${-e}A`:e>0&&(r+=`${qe}${e}B`),r},up:(t=1)=>`${qe}${t}A`,down:(t=1)=>`${qe}${t}B`,forward:(t=1)=>`${qe}${t}C`,backward:(t=1)=>`${qe}${t}D`,nextLine:(t=1)=>`${qe}E`.repeat(t),prevLine:(t=1)=>`${qe}F`.repeat(t),left:`${qe}G`,hide:`${qe}?25l`,show:`${qe}?25h`,save:`${jp}7`,restore:`${jp}8`},wB={up:(t=1)=>`${qe}S`.repeat(t),down:(t=1)=>`${qe}T`.repeat(t)},_B={screen:`${qe}2J`,up:(t=1)=>`${qe}1J`.repeat(t),down:(t=1)=>`${qe}J`.repeat(t),line:`${qe}2K`,lineEnd:`${qe}K`,lineStart:`${qe}1K`,lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Np.up():"");return t&&(e+=Np.left),e}};_w.exports={cursor:Np,scroll:wB,erase:_B,beep:bB}});var Bp=D((xce,Lp)=>{var sl=process||{},Ew=sl.argv||[],ol=sl.env||{},EB=!(ol.NO_COLOR||Ew.includes("--no-color"))&&(!!ol.FORCE_COLOR||Ew.includes("--color")||sl.platform==="win32"||(sl.stdout||{}).isTTY&&ol.TERM!=="dumb"||!!ol.CI),CB=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+SB(i,e,r,o)+e:t+i+e},SB=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},Cw=(t=EB)=>{let e=t?CB:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Lp.exports=Cw();Lp.exports.createColors=Cw});var hl=D(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.isNXMonorepo=qt.isMonorepo=qt.findPackageRelativePathInMonorepo=qt.findPackagePath=qt.findNXMonorepoRoot=qt.findMonorepoRoot=void 0;var Ba=require("node:fs"),Wn=require("node:path");function dl(t){let e=(0,Wn.join)(t,"package.json"),r=(0,Wn.join)(t,"pnpm-workspace.yaml");if((0,Ba.existsSync)(r)||(0,Ba.existsSync)(e)&&JSON.parse((0,Ba.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,Wn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return dl(n)}qt.findMonorepoRoot=dl;function Zp(t){let e=(0,Wn.join)(t,"nx.json");if((0,Ba.existsSync)(e))return t;let r=(0,Wn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Zp(r)}qt.findNXMonorepoRoot=Zp;function Qp(t,e,r){let n=(0,Wn.join)(e,"node_modules",t);if((0,Ba.existsSync)(n))return n;if(e===r)return null;let i=(0,Wn.dirname)(e);return Qp(t,i,r)}qt.findPackagePath=Qp;function iq(t,e){let r=dl(e),n=Qp(t,e,r);return n?(0,Wn.relative)(e,n):null}qt.findPackageRelativePathInMonorepo=iq;function oq(t){try{return dl(t),!0}catch{return!1}}qt.isMonorepo=oq;function sq(t){try{return Zp(t),!0}catch{return!1}}qt.isNXMonorepo=sq});var xi={};mn(xi,{default:()=>aq});var aq,Fi=ut(()=>{aq={}});var zw=D(jr=>{"use strict";var uq=jr&&jr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),cq=jr&&jr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lq=jr&&jr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&uq(e,t,r);return cq(e,t),e};Object.defineProperty(jr,"__esModule",{value:!0});jr.resolveFetch=void 0;var fq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>lq((Fi(),ke(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};jr.resolveFetch=fq});var nm=D(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.FunctionRegion=nr.FunctionsHttpError=nr.FunctionsRelayError=nr.FunctionsFetchError=nr.FunctionsError=void 0;var Mo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};nr.FunctionsError=Mo;var em=class extends Mo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};nr.FunctionsFetchError=em;var tm=class extends Mo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};nr.FunctionsRelayError=tm;var rm=class extends Mo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};nr.FunctionsHttpError=rm;var dq;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(dq=nr.FunctionRegion||(nr.FunctionRegion={}))});var Gw=D(Uo=>{"use strict";var hq=Uo&&Uo.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.FunctionsClient=void 0;var pq=zw(),ml=nm(),im=class{constructor(e,{headers:r={},customFetch:n,region:i=ml.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=i,this.fetch=(0,pq.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var n;return hq(this,void 0,void 0,function*(){try{let{headers:i,method:o,body:s}=r,a={},{region:u}=r;u||(u=this.region),u&&u!=="any"&&(a["x-region"]=u);let c;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",c=s):typeof s=="string"?(a["Content-Type"]="text/plain",c=s):typeof FormData<"u"&&s instanceof FormData?c=s:(a["Content-Type"]="application/json",c=JSON.stringify(s)));let l=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:c}).catch(p=>{throw new ml.FunctionsFetchError(p)}),f=l.headers.get("x-relay-error");if(f&&f==="true")throw new ml.FunctionsRelayError(l);if(!l.ok)throw new ml.FunctionsHttpError(l);let h=((n=l.headers.get("Content-Type"))!==null&&n!==void 0?n:"text/plain").split(";")[0].trim(),d;return h==="application/json"?d=yield l.json():h==="application/octet-stream"?d=yield l.blob():h==="text/event-stream"?d=l:h==="multipart/form-data"?d=yield l.formData():d=yield l.text(),{data:d,error:null}}catch(i){return{data:null,error:i}}})}};Uo.FunctionsClient=im});var om=D(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.FunctionRegion=Mt.FunctionsRelayError=Mt.FunctionsHttpError=Mt.FunctionsFetchError=Mt.FunctionsError=Mt.FunctionsClient=void 0;var mq=Gw();Object.defineProperty(Mt,"FunctionsClient",{enumerable:!0,get:function(){return mq.FunctionsClient}});var Ma=nm();Object.defineProperty(Mt,"FunctionsError",{enumerable:!0,get:function(){return Ma.FunctionsError}});Object.defineProperty(Mt,"FunctionsFetchError",{enumerable:!0,get:function(){return Ma.FunctionsFetchError}});Object.defineProperty(Mt,"FunctionsHttpError",{enumerable:!0,get:function(){return Ma.FunctionsHttpError}});Object.defineProperty(Mt,"FunctionsRelayError",{enumerable:!0,get:function(){return Ma.FunctionsRelayError}});Object.defineProperty(Mt,"FunctionRegion",{enumerable:!0,get:function(){return Ma.FunctionRegion}})});var um=D(am=>{"use strict";Object.defineProperty(am,"__esModule",{value:!0});var sm=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};am.default=sm});var lm=D(Ua=>{"use strict";var Ww=Ua&&Ua.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ua,"__esModule",{value:!0});var gq=Ww((Fi(),ke(xi))),yq=Ww(um()),cm=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=gq.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=Object.assign({},this.headers),this.headers[e]=r,this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");let n=this.fetch,i=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var s,a,u;let c=null,l=null,f=null,h=o.status,d=o.statusText;if(o.ok){if(this.method!=="HEAD"){let w=await o.text();w===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?l=w:l=JSON.parse(w))}let v=(s=this.headers.Prefer)===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),g=(a=o.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");v&&g&&g.length>1&&(f=parseInt(g[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(l)&&(l.length>1?(c={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,f=null,h=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{let v=await o.text();try{c=JSON.parse(v),Array.isArray(c)&&o.status===404&&(l=[],c=null,h=200,d="OK")}catch{o.status===404&&v===""?(h=204,d="No Content"):c={message:v}}if(c&&this.isMaybeSingle&&(!((u=c?.details)===null||u===void 0)&&u.includes("0 rows"))&&(c=null,h=200,d="OK"),c&&this.shouldThrowOnError)throw new yq.default(c)}return{error:c,data:l,count:f,status:h,statusText:d}});return this.shouldThrowOnError||(i=i.catch(o=>{var s,a,u;return{error:{message:`${(s=o?.name)!==null&&s!==void 0?s:"FetchError"}: ${o?.message}`,details:`${(a=o?.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(u=o?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),i.then(e,r)}};Ua.default=cm});var dm=D(Va=>{"use strict";var Dq=Va&&Va.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Va,"__esModule",{value:!0});var vq=Dq(lm()),fm=class extends vq.default{select(e){let r=!1,n=(e??"*").split("").map(i=>/\s/.test(i)&&!r?"":(i==='"'&&(r=!r),i)).join("");return this.url.searchParams.set("select",n),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:i,referencedTable:o=i}={}){let s=o?`${o}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(i,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:i=n}={}){let o=typeof i>"u"?"offset":`${i}.offset`,s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(s,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:i=!1,wal:o=!1,format:s="text"}={}){var a;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,i?"buffers":null,o?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`,s==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Va.default=fm});var gl=D(Ha=>{"use strict";var bq=Ha&&Ha.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ha,"__esModule",{value:!0});var wq=bq(dm()),hm=class extends wq.default{eq(e,r){return this.url.searchParams.append(e,`eq.${r}`),this}neq(e,r){return this.url.searchParams.append(e,`neq.${r}`),this}gt(e,r){return this.url.searchParams.append(e,`gt.${r}`),this}gte(e,r){return this.url.searchParams.append(e,`gte.${r}`),this}lt(e,r){return this.url.searchParams.append(e,`lt.${r}`),this}lte(e,r){return this.url.searchParams.append(e,`lte.${r}`),this}like(e,r){return this.url.searchParams.append(e,`like.${r}`),this}likeAllOf(e,r){return this.url.searchParams.append(e,`like(all).{${r.join(",")}}`),this}likeAnyOf(e,r){return this.url.searchParams.append(e,`like(any).{${r.join(",")}}`),this}ilike(e,r){return this.url.searchParams.append(e,`ilike.${r}`),this}ilikeAllOf(e,r){return this.url.searchParams.append(e,`ilike(all).{${r.join(",")}}`),this}ilikeAnyOf(e,r){return this.url.searchParams.append(e,`ilike(any).{${r.join(",")}}`),this}is(e,r){return this.url.searchParams.append(e,`is.${r}`),this}in(e,r){let n=Array.from(new Set(r)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}contains(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cs.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cs.{${r.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(r)}`),this}containedBy(e,r){return typeof r=="string"?this.url.searchParams.append(e,`cd.${r}`):Array.isArray(r)?this.url.searchParams.append(e,`cd.{${r.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(r)}`),this}rangeGt(e,r){return this.url.searchParams.append(e,`sr.${r}`),this}rangeGte(e,r){return this.url.searchParams.append(e,`nxl.${r}`),this}rangeLt(e,r){return this.url.searchParams.append(e,`sl.${r}`),this}rangeLte(e,r){return this.url.searchParams.append(e,`nxr.${r}`),this}rangeAdjacent(e,r){return this.url.searchParams.append(e,`adj.${r}`),this}overlaps(e,r){return typeof r=="string"?this.url.searchParams.append(e,`ov.${r}`):this.url.searchParams.append(e,`ov.{${r.join(",")}}`),this}textSearch(e,r,{config:n,type:i}={}){let o="";i==="plain"?o="pl":i==="phrase"?o="ph":i==="websearch"&&(o="w");let s=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${o}fts${s}.${r}`),this}match(e){return Object.entries(e).forEach(([r,n])=>{this.url.searchParams.append(r,`eq.${n}`)}),this}not(e,r,n){return this.url.searchParams.append(e,`not.${r}.${n}`),this}or(e,{foreignTable:r,referencedTable:n=r}={}){let i=n?`${n}.or`:"or";return this.url.searchParams.append(i,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};Ha.default=hm});var mm=D(Ga=>{"use strict";var _q=Ga&&Ga.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ga,"__esModule",{value:!0});var za=_q(gl()),pm=class{constructor(e,{headers:r={},schema:n,fetch:i}){this.url=e,this.headers=r,this.schema=n,this.fetch=i}select(e,{head:r=!1,count:n}={}){let i=r?"HEAD":"GET",o=!1,s=(e??"*").split("").map(a=>/\s/.test(a)&&!o?"":(a==='"'&&(o=!o),a)).join("");return this.url.searchParams.set("select",s),n&&(this.headers.Prefer=`count=${n}`),new za.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:r,defaultToNull:n=!0}={}){let i="POST",o=[];if(this.headers.Prefer&&o.push(this.headers.Prefer),r&&o.push(`count=${r}`),n||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){let s=e.reduce((a,u)=>a.concat(Object.keys(u)),[]);if(s.length>0){let a=[...new Set(s)].map(u=>`"${u}"`);this.url.searchParams.set("columns",a.join(","))}}return new za.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:i,defaultToNull:o=!0}={}){let s="POST",a=[`resolution=${n?"ignore":"merge"}-duplicates`];if(r!==void 0&&this.url.searchParams.set("on_conflict",r),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),o||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){let u=e.reduce((c,l)=>c.concat(Object.keys(l)),[]);if(u.length>0){let c=[...new Set(u)].map(l=>`"${l}"`);this.url.searchParams.set("columns",c.join(","))}}return new za.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:r}={}){let n="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),r&&i.push(`count=${r}`),this.headers.Prefer=i.join(","),new za.default({method:n,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let r="DELETE",n=[];return e&&n.push(`count=${e}`),this.headers.Prefer&&n.unshift(this.headers.Prefer),this.headers.Prefer=n.join(","),new za.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Ga.default=pm});var Kw=D(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.version=void 0;yl.version="0.0.0-automated"});var Yw=D(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});Dl.DEFAULT_HEADERS=void 0;var Eq=Kw();Dl.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${Eq.version}`}});var Xw=D(Wa=>{"use strict";var Jw=Wa&&Wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wa,"__esModule",{value:!0});var Cq=Jw(mm()),Sq=Jw(gl()),xq=Yw(),gm=class t{constructor(e,{headers:r={},schema:n,fetch:i}={}){this.url=e,this.headers=Object.assign(Object.assign({},xq.DEFAULT_HEADERS),r),this.schemaName=n,this.fetch=i}from(e){let r=new URL(`${this.url}/${e}`);return new Cq.default(r,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new t(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,r={},{head:n=!1,get:i=!1,count:o}={}){let s,a=new URL(`${this.url}/rpc/${e}`),u;n||i?(s=n?"HEAD":"GET",Object.entries(r).filter(([l,f])=>f!==void 0).map(([l,f])=>[l,Array.isArray(f)?`{${f.join(",")}}`:`${f}`]).forEach(([l,f])=>{a.searchParams.append(l,f)})):(s="POST",u=r);let c=Object.assign({},this.headers);return o&&(c.Prefer=`count=${o}`),new Sq.default({method:s,url:a,headers:c,schema:this.schemaName,body:u,fetch:this.fetch,allowEmpty:!1})}};Wa.default=gm});var i_=D(Dt=>{"use strict";var Vo=Dt&&Dt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.PostgrestError=Dt.PostgrestBuilder=Dt.PostgrestTransformBuilder=Dt.PostgrestFilterBuilder=Dt.PostgrestQueryBuilder=Dt.PostgrestClient=void 0;var Zw=Vo(Xw());Dt.PostgrestClient=Zw.default;var Qw=Vo(mm());Dt.PostgrestQueryBuilder=Qw.default;var e_=Vo(gl());Dt.PostgrestFilterBuilder=e_.default;var t_=Vo(dm());Dt.PostgrestTransformBuilder=t_.default;var r_=Vo(lm());Dt.PostgrestBuilder=r_.default;var n_=Vo(um());Dt.PostgrestError=n_.default;Dt.default={PostgrestClient:Zw.default,PostgrestQueryBuilder:Qw.default,PostgrestFilterBuilder:e_.default,PostgrestTransformBuilder:t_.default,PostgrestBuilder:r_.default,PostgrestError:n_.default}});var Dm={};mn(Dm,{RealtimeClient:()=>ym});var ym,vm=ut(()=>{ym=class{constructor(){}connect(){}disconnect(){}}});var Ya=D(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.StorageUnknownError=Nr.StorageApiError=Nr.isStorageError=Nr.StorageError=void 0;var Ka=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};Nr.StorageError=Ka;function Fq(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}Nr.isStorageError=Fq;var bm=class extends Ka{constructor(e,r){super(e),this.name="StorageApiError",this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}};Nr.StorageApiError=bm;var wm=class extends Ka{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};Nr.StorageUnknownError=wm});var vl=D(ct=>{"use strict";var Oq=ct&&ct.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Aq=ct&&ct.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o_=ct&&ct.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Oq(e,t,r);return Aq(e,t),e},kq=ct&&ct.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(ct,"__esModule",{value:!0});ct.recursiveToCamel=ct.resolveResponse=ct.resolveFetch=void 0;var Tq=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>o_((Fi(),ke(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};ct.resolveFetch=Tq;var Pq=()=>kq(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Promise.resolve().then(()=>o_((Fi(),ke(xi))))).Response:Response});ct.resolveResponse=Pq;var Rq=t=>{if(Array.isArray(t))return t.map(r=>(0,ct.recursiveToCamel)(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let i=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[i]=(0,ct.recursiveToCamel)(n)}),e};ct.recursiveToCamel=Rq});var Cm=D(Ut=>{"use strict";var Oi=Ut&&Ut.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.remove=Ut.head=Ut.put=Ut.post=Ut.get=void 0;var _m=Ya(),$q=vl(),Em=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),Iq=(t,e,r)=>Oi(void 0,void 0,void 0,function*(){let n=yield(0,$q.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(i=>{e(new _m.StorageApiError(Em(i),t.status||500))}).catch(i=>{e(new _m.StorageUnknownError(Em(i),i))}):e(new _m.StorageUnknownError(Em(t),t))}),jq=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},e?.headers),n&&(i.body=JSON.stringify(n)),Object.assign(Object.assign({},i),r))};function Ja(t,e,r,n,i,o){return Oi(this,void 0,void 0,function*(){return new Promise((s,a)=>{t(r,jq(e,n,i,o)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>s(u)).catch(u=>Iq(u,a,n))})})}function Nq(t,e,r,n){return Oi(this,void 0,void 0,function*(){return Ja(t,"GET",e,r,n)})}Ut.get=Nq;function Lq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"POST",e,n,i,r)})}Ut.post=Lq;function Bq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"PUT",e,n,i,r)})}Ut.put=Bq;function qq(t,e,r,n){return Oi(this,void 0,void 0,function*(){return Ja(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}Ut.head=qq;function Mq(t,e,r,n,i){return Oi(this,void 0,void 0,function*(){return Ja(t,"DELETE",e,n,i,r)})}Ut.remove=Mq});var u_=D(Xa=>{"use strict";var Vt=Xa&&Xa.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Xa,"__esModule",{value:!0});var Ht=Ya(),Lr=Cm(),s_=vl(),Uq={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},a_={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Sm=class{constructor(e,r={},n,i){this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,s_.resolveFetch)(i)}uploadOrUpdate(e,r,n,i){return Vt(this,void 0,void 0,function*(){try{let o,s=Object.assign(Object.assign({},a_),i),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(s.upsert)}),u=s.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.append("cacheControl",s.cacheControl),u&&o.append("metadata",this.encodeMetadata(u))):(o=n,a["cache-control"]=`max-age=${s.cacheControl}`,a["content-type"]=s.contentType,u&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(u)))),i?.headers&&(a=Object.assign(Object.assign({},a),i.headers));let c=this._removeEmptyFolders(r),l=this._getFinalPath(c),f=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:o,headers:a},s?.duplex?{duplex:s.duplex}:{})),h=yield f.json();return f.ok?{data:{path:c,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(o){if((0,Ht.isStorageError)(o))return{data:null,error:o};throw o}})}upload(e,r,n){return Vt(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,i){return Vt(this,void 0,void 0,function*(){let o=this._removeEmptyFolders(e),s=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${s}`);a.searchParams.set("token",r);try{let u,c=Object.assign({upsert:a_.upsert},i),l=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",c.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",c.cacheControl)):(u=n,l["cache-control"]=`max-age=${c.cacheControl}`,l["content-type"]=c.contentType);let f=yield this.fetch(a.toString(),{method:"PUT",body:u,headers:l}),h=yield f.json();return f.ok?{data:{path:o,fullPath:h.Key},error:null}:{data:null,error:h}}catch(u){if((0,Ht.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Vt(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=Object.assign({},this.headers);r?.upsert&&(i["x-upsert"]="true");let o=yield(0,Lr.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:i}),s=new URL(this.url+o.url),a=s.searchParams.get("token");if(!a)throw new Ht.StorageError("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:a},error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return Vt(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Vt(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}copy(e,r,n){return Vt(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Lr.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrl(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e),o=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),s=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${s}`)},{data:o,error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}createSignedUrls(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=yield(0,Lr.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:i.map(s=>Object.assign(Object.assign({},s),{signedUrl:s.signedURL?encodeURI(`${this.url}${s.signedURL}${o}`):null})),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}download(e,r){return Vt(this,void 0,void 0,function*(){let i=typeof r?.transform<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString(r?.transform||{}),s=o?`?${o}`:"";try{let a=this._getFinalPath(e);return{data:yield(yield(0,Lr.get)(this.fetch,`${this.url}/${i}/${a}${s}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if((0,Ht.isStorageError)(a))return{data:null,error:a};throw a}})}info(e){return Vt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Lr.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,s_.recursiveToCamel)(n),error:null}}catch(n){if((0,Ht.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return Vt(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Lr.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if((0,Ht.isStorageError)(n)&&n instanceof Ht.StorageUnknownError){let i=n.originalError;if([400,404].includes(i?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),i=[],o=r?.download?`download=${r.download===!0?"":r.download}`:"";o!==""&&i.push(o);let a=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&i.push(u);let c=i.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${c}`)}}}remove(e){return Vt(this,void 0,void 0,function*(){try{return{data:yield(0,Lr.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if((0,Ht.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return Vt(this,void 0,void 0,function*(){try{let i=Object.assign(Object.assign(Object.assign({},Uq),r),{prefix:e||""});return{data:yield(0,Lr.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},n),error:null}}catch(i){if((0,Ht.isStorageError)(i))return{data:null,error:i};throw i}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}};Xa.default=Sm});var c_=D(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.version=void 0;bl.version="2.7.1"});var l_=D(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.DEFAULT_HEADERS=void 0;var Vq=c_();wl.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${Vq.version}`}});var f_=D(Za=>{"use strict";var Ho=Za&&Za.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(Za,"__esModule",{value:!0});var Hq=l_(),zo=Ya(),Go=Cm(),zq=vl(),xm=class{constructor(e,r={},n){this.url=e,this.headers=Object.assign(Object.assign({},Hq.DEFAULT_HEADERS),r),this.fetch=(0,zq.resolveFetch)(n)}listBuckets(){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.get)(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if((0,zo.isStorageError)(e))return{data:null,error:e};throw e}})}getBucket(e){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if((0,zo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.post)(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,zo.isStorageError)(n))return{data:null,error:n};throw n}})}updateBucket(e,r){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.put)(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if((0,zo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if((0,zo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Ho(this,void 0,void 0,function*(){try{return{data:yield(0,Go.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if((0,zo.isStorageError)(r))return{data:null,error:r};throw r}})}};Za.default=xm});var h_=D(Wo=>{"use strict";var d_=Wo&&Wo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.StorageClient=void 0;var Gq=d_(u_()),Wq=d_(f_()),Fm=class extends Wq.default{constructor(e,r={},n){super(e,r,n)}from(e){return new Gq.default(this.url,this.headers,e,this.fetch)}};Wo.StorageClient=Fm});var m_=D(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0})});var y_=D(Br=>{"use strict";var Kq=Br&&Br.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),g_=Br&&Br.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kq(e,t,r)};Object.defineProperty(Br,"__esModule",{value:!0});Br.StorageClient=void 0;var Yq=h_();Object.defineProperty(Br,"StorageClient",{enumerable:!0,get:function(){return Yq.StorageClient}});g_(m_(),Br);g_(Ya(),Br)});var D_=D(_l=>{"use strict";Object.defineProperty(_l,"__esModule",{value:!0});_l.version=void 0;_l.version="2.46.0"});var v_=D(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.DEFAULT_REALTIME_OPTIONS=ir.DEFAULT_AUTH_OPTIONS=ir.DEFAULT_DB_OPTIONS=ir.DEFAULT_GLOBAL_OPTIONS=ir.DEFAULT_HEADERS=void 0;var Jq=D_(),Qa="";typeof Deno<"u"?Qa="deno":typeof document<"u"?Qa="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Qa="react-native":Qa="node";ir.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${Qa}/${Jq.version}`};ir.DEFAULT_GLOBAL_OPTIONS={headers:ir.DEFAULT_HEADERS};ir.DEFAULT_DB_OPTIONS={schema:"public"};ir.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};ir.DEFAULT_REALTIME_OPTIONS={}});var w_=D(lt=>{"use strict";var Xq=lt&&lt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Zq=lt&&lt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Qq=lt&&lt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Xq(e,t,r);return Zq(e,t),e},eM=lt&&lt.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(lt,"__esModule",{value:!0});lt.fetchWithAuth=lt.resolveHeadersConstructor=lt.resolveFetch=void 0;var b_=Qq((Fi(),ke(xi))),tM=t=>{let e;return t?e=t:typeof fetch>"u"?e=b_.default:e=fetch,(...r)=>e(...r)};lt.resolveFetch=tM;var rM=()=>typeof Headers>"u"?b_.Headers:Headers;lt.resolveHeadersConstructor=rM;var nM=(t,e,r)=>{let n=(0,lt.resolveFetch)(r),i=(0,lt.resolveHeadersConstructor)();return(o,s)=>eM(void 0,void 0,void 0,function*(){var a;let u=(a=yield e())!==null&&a!==void 0?a:t,c=new i(s?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(o,Object.assign(Object.assign({},s),{headers:c}))})};lt.fetchWithAuth=nM});var __=D(mr=>{"use strict";var iM=mr&&mr.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(mr,"__esModule",{value:!0});mr.applySettingDefaults=mr.isBrowser=mr.stripTrailingSlash=mr.uuid=void 0;function oM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t=="x"?e:e&3|8;return r.toString(16)})}mr.uuid=oM;function sM(t){return t.replace(/\/$/,"")}mr.stripTrailingSlash=sM;var aM=()=>typeof window<"u";mr.isBrowser=aM;function uM(t,e){let{db:r,auth:n,realtime:i,global:o}=t,{db:s,auth:a,realtime:u,global:c}=e,l={db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},u),i),global:Object.assign(Object.assign({},c),o),accessToken:()=>iM(this,void 0,void 0,function*(){return""})};return t.accessToken?l.accessToken=t.accessToken:delete l.accessToken,l}mr.applySettingDefaults=uM});var Om=D(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.version=void 0;El.version="2.65.1"});var Cl=D(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.API_VERSIONS=ft.API_VERSION_HEADER_NAME=ft.NETWORK_FAILURE=ft.EXPIRY_MARGIN=ft.DEFAULT_HEADERS=ft.AUDIENCE=ft.STORAGE_KEY=ft.GOTRUE_URL=void 0;var cM=Om();ft.GOTRUE_URL="http://localhost:9999";ft.STORAGE_KEY="supabase.auth.token";ft.AUDIENCE="";ft.DEFAULT_HEADERS={"X-Client-Info":`gotrue-js/${cM.version}`};ft.EXPIRY_MARGIN=10;ft.NETWORK_FAILURE={MAX_RETRIES:10,RETRY_INTERVAL:2};ft.API_VERSION_HEADER_NAME="X-Supabase-Api-Version";ft.API_VERSIONS={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}}});var Ko=D(te=>{"use strict";var lM=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fM=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dM=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&lM(e,t,r);return fM(e,t),e};Object.defineProperty(te,"__esModule",{value:!0});te.parseResponseAPIVersion=te.getCodeChallengeAndMethod=te.generatePKCEChallenge=te.generatePKCEVerifier=te.retryable=te.sleep=te.decodeJWTPayload=te.Deferred=te.decodeBase64URL=te.removeItemAsync=te.getItemAsync=te.setItemAsync=te.looksLikeFetchResponse=te.resolveFetch=te.parseParametersFromURL=te.supportsLocalStorage=te.isBrowser=te.uuid=te.expiresAt=void 0;var hM=Cl();function pM(t){return Math.round(Date.now()/1e3)+t}te.expiresAt=pM;function mM(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}te.uuid=mM;var gM=()=>typeof document<"u";te.isBrowser=gM;var Ai={tested:!1,writable:!1},yM=()=>{if(!(0,te.isBrowser)())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ai.tested)return Ai.writable;let t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Ai.tested=!0,Ai.writable=!0}catch{Ai.tested=!0,Ai.writable=!1}return Ai.writable};te.supportsLocalStorage=yM;function DM(t){let e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((i,o)=>{e[o]=i})}catch{}return r.searchParams.forEach((n,i)=>{e[i]=n}),e}te.parseParametersFromURL=DM;var vM=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Promise.resolve().then(()=>dM((Fi(),ke(xi)))).then(({default:n})=>n(...r)):e=fetch,(...r)=>e(...r)};te.resolveFetch=vM;var bM=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function";te.looksLikeFetchResponse=bM;var wM=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))};te.setItemAsync=wM;var _M=async(t,e)=>{let r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}};te.getItemAsync=_M;var EM=async(t,e)=>{await t.removeItem(e)};te.removeItemAsync=EM;function E_(t){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="",n,i,o,s,a,u,c,l=0;for(t=t.replace("-","+").replace("_","/");l<t.length;)s=e.indexOf(t.charAt(l++)),a=e.indexOf(t.charAt(l++)),u=e.indexOf(t.charAt(l++)),c=e.indexOf(t.charAt(l++)),n=s<<2|a>>4,i=(a&15)<<4|u>>2,o=(u&3)<<6|c,r=r+String.fromCharCode(n),u!=64&&i!=0&&(r=r+String.fromCharCode(i)),c!=64&&o!=0&&(r=r+String.fromCharCode(o));return r}te.decodeBase64URL=E_;var Sl=class t{constructor(){this.promise=new t.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}};te.Deferred=Sl;Sl.promiseConstructor=Promise;function CM(t){let e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,r=t.split(".");if(r.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(r[1]))throw new Error("JWT is not valid: payload is not in base64url format");let n=r[1];return JSON.parse(E_(n))}te.decodeJWTPayload=CM;async function SM(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}te.sleep=SM;function xM(t,e){return new Promise((n,i)=>{(async()=>{for(let o=0;o<1/0;o++)try{let s=await t(o);if(!e(o,null,s)){n(s);return}}catch(s){if(!e(o,s)){i(s);return}}})()})}te.retryable=xM;function FM(t){return("0"+t.toString(16)).substr(-2)}function C_(){let e=new Uint32Array(56);if(typeof crypto>"u"){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length,i="";for(let o=0;o<56;o++)i+=r.charAt(Math.floor(Math.random()*n));return i}return crypto.getRandomValues(e),Array.from(e,FM).join("")}te.generatePKCEVerifier=C_;async function OM(t){let r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(o=>String.fromCharCode(o)).join("")}function AM(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function S_(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;let r=await OM(t);return AM(r)}te.generatePKCEChallenge=S_;async function kM(t,e,r=!1){let n=C_(),i=n;r&&(i+="/PASSWORD_RECOVERY"),await(0,te.setItemAsync)(t,`${e}-code-verifier`,i);let o=await S_(n);return[o,n===o?"plain":"s256"]}te.getCodeChallengeAndMethod=kM;var TM=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function PM(t){let e=t.headers.get(hM.API_VERSION_HEADER_NAME);if(!e||!e.match(TM))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}te.parseResponseAPIVersion=PM});var tu=D(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.isAuthWeakPasswordError=he.AuthWeakPasswordError=he.isAuthRetryableFetchError=he.AuthRetryableFetchError=he.AuthPKCEGrantCodeExchangeError=he.AuthImplicitGrantRedirectError=he.AuthInvalidCredentialsError=he.AuthInvalidTokenResponseError=he.isAuthSessionMissingError=he.AuthSessionMissingError=he.CustomAuthError=he.AuthUnknownError=he.isAuthApiError=he.AuthApiError=he.isAuthError=he.AuthError=void 0;var Yo=class extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}};he.AuthError=Yo;function eu(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}he.isAuthError=eu;var Am=class extends Yo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}};he.AuthApiError=Am;function RM(t){return eu(t)&&t.name==="AuthApiError"}he.isAuthApiError=RM;var km=class extends Yo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}};he.AuthUnknownError=km;var qr=class extends Yo{constructor(e,r,n,i){super(e,n,i),this.name=r,this.status=n}};he.CustomAuthError=qr;var Tm=class extends qr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}};he.AuthSessionMissingError=Tm;function $M(t){return eu(t)&&t.name==="AuthSessionMissingError"}he.isAuthSessionMissingError=$M;var Pm=class extends qr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}};he.AuthInvalidTokenResponseError=Pm;var Rm=class extends qr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}};he.AuthInvalidCredentialsError=Rm;var $m=class extends qr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthImplicitGrantRedirectError=$m;var Im=class extends qr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}};he.AuthPKCEGrantCodeExchangeError=Im;var jm=class extends qr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}};he.AuthRetryableFetchError=jm;function IM(t){return eu(t)&&t.name==="AuthRetryableFetchError"}he.isAuthRetryableFetchError=IM;var Nm=class extends qr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}};he.AuthWeakPasswordError=Nm;function jM(t){return eu(t)&&t.name==="AuthWeakPasswordError"}he.isAuthWeakPasswordError=jM});var qm=D(rt=>{"use strict";var NM=rt&&rt.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(rt,"__esModule",{value:!0});rt._noResolveJsonResponse=rt._generateLinkResponse=rt._ssoResponse=rt._userResponse=rt._sessionResponsePassword=rt._sessionResponse=rt._request=rt.handleError=void 0;var xl=Cl(),Lm=Ko(),Kn=tu(),ki=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),LM=[502,503,504];async function Bm(t){var e;if(!(0,Lm.looksLikeFetchResponse)(t))throw new Kn.AuthRetryableFetchError(ki(t),0);if(LM.includes(t.status))throw new Kn.AuthRetryableFetchError(ki(t),t.status);let r;try{r=await t.json()}catch(o){throw new Kn.AuthUnknownError(ki(o),o)}let n,i=(0,Lm.parseResponseAPIVersion)(t);if(i&&i.getTime()>=xl.API_VERSIONS["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new Kn.AuthWeakPasswordError(ki(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Kn.AuthSessionMissingError}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,s)=>o&&typeof s=="string",!0))throw new Kn.AuthWeakPasswordError(ki(r),t.status,r.weak_password.reasons);throw new Kn.AuthApiError(ki(r),t.status||500,n)}rt.handleError=Bm;var BM=(t,e,r,n)=>{let i={method:t,headers:e?.headers||{}};return t==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function qM(t,e,r,n){var i;let o=Object.assign({},n?.headers);o[xl.API_VERSION_HEADER_NAME]||(o[xl.API_VERSION_HEADER_NAME]=xl.API_VERSIONS["2024-01-01"].name),n?.jwt&&(o.Authorization=`Bearer ${n.jwt}`);let s=(i=n?.query)!==null&&i!==void 0?i:{};n?.redirectTo&&(s.redirect_to=n.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",u=await MM(t,e,r+a,{headers:o,noResolveJson:n?.noResolveJson},{},n?.body);return n?.xform?n?.xform(u):{data:Object.assign({},u),error:null}}rt._request=qM;async function MM(t,e,r,n,i,o){let s=BM(e,n,i,o),a;try{a=await t(r,Object.assign({},s))}catch(u){throw console.error(u),new Kn.AuthRetryableFetchError(ki(u),0)}if(a.ok||await Bm(a),n?.noResolveJson)return a;try{return await a.json()}catch(u){await Bm(u)}}function x_(t){var e;let r=null;WM(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=(0,Lm.expiresAt)(t.expires_in)));let n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}rt._sessionResponse=x_;function UM(t){let e=x_(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}rt._sessionResponsePassword=UM;function VM(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}rt._userResponse=VM;function HM(t){return{data:t,error:null}}rt._ssoResponse=HM;function zM(t){let{action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=t,s=NM(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o},u=Object.assign({},s);return{data:{properties:a,user:u},error:null}}rt._generateLinkResponse=zM;function GM(t){return t}rt._noResolveJsonResponse=GM;function WM(t){return t.access_token&&t.refresh_token&&t.expires_in}});var Fl=D(ru=>{"use strict";var KM=ru&&ru.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};Object.defineProperty(ru,"__esModule",{value:!0});var vt=qm(),YM=Ko(),Mr=tu(),Mm=class{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=(0,YM.resolveFetch)(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r="global"){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if((0,Mr.isAuthError)(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{let{options:r}=e,n=KM(e,["options"]),i=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(i.new_email=n?.newEmail,delete i.newEmail),await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:vt._generateLinkResponse,redirectTo:r?.redirectTo})}catch(r){if((0,Mr.isAuthError)(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await(0,vt._request)(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,i,o,s,a,u;try{let c={nextPage:null,lastPage:0,total:0},l=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e?.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(i=e?.perPage)===null||i===void 0?void 0:i.toString())!==null&&o!==void 0?o:""},xform:vt._noResolveJsonResponse});if(l.error)throw l.error;let f=await l.json(),h=(s=l.headers.get("x-total-count"))!==null&&s!==void 0?s:0,d=(u=(a=l.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&u!==void 0?u:[];return d.length>0&&(d.forEach(p=>{let v=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(p.split(";")[1].split("=")[1]);c[`${g}Page`]=v}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if((0,Mr.isAuthError)(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:vt._userResponse})}catch(r){if((0,Mr.isAuthError)(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){try{return await(0,vt._request)(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){try{return await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:vt._userResponse})}catch(n){if((0,Mr.isAuthError)(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){try{let{data:r,error:n}=await(0,vt._request)(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:r,error:n}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}async _deleteFactor(e){try{return{data:await(0,vt._request)(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if((0,Mr.isAuthError)(r))return{data:null,error:r};throw r}}};ru.default=Mm});var F_=D(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.memoryLocalStorageAdapter=Jo.localStorageAdapter=void 0;var Um=Ko();Jo.localStorageAdapter={getItem:t=>(0,Um.supportsLocalStorage)()?globalThis.localStorage.getItem(t):null,setItem:(t,e)=>{(0,Um.supportsLocalStorage)()&&globalThis.localStorage.setItem(t,e)},removeItem:t=>{(0,Um.supportsLocalStorage)()&&globalThis.localStorage.removeItem(t)}};function JM(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}Jo.memoryLocalStorageAdapter=JM});var O_=D(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.polyfillGlobalThis=void 0;function XM(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}Ol.polyfillGlobalThis=XM});var Vm=D(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.navigatorLock=Et.NavigatorLockAcquireTimeoutError=Et.LockAcquireTimeoutError=Et.internals=void 0;var ZM=Ko();Et.internals={debug:!!(globalThis&&(0,ZM.supportsLocalStorage)()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};var Al=class extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}};Et.LockAcquireTimeoutError=Al;var kl=class extends Al{};Et.NavigatorLockAcquireTimeoutError=kl;async function QM(t,e,r){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);let n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Et.internals.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new kl(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Et.internals.debug)try{let o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}})}Et.navigatorLock=QM});var zm=D(ou=>{"use strict";var e4=ou&&ou.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ou,"__esModule",{value:!0});var t4=e4(Fl()),iu=Cl(),Z=tu(),ae=qm(),fe=Ko(),Hm=F_(),r4=O_(),n4=Om(),A_=Vm();(0,r4.polyfillGlobalThis)();var i4={url:iu.GOTRUE_URL,storageKey:iu.STORAGE_KEY,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:iu.DEFAULT_HEADERS,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},nu=30*1e3,k_=3;async function T_(t,e,r){return await r()}var Tl=class t{constructor(e){var r,n;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=t.nextInstanceID,t.nextInstanceID+=1,this.instanceID>0&&(0,fe.isBrowser)()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let i=Object.assign(Object.assign({},i4),e);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new t4.default({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=(0,fe.resolveFetch)(i.fetch),this.lock=i.lock||T_,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:(0,fe.isBrowser)()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=A_.navigatorLock:this.lock=T_,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:(0,fe.supportsLocalStorage)()?this.storage=Hm.localStorageAdapter:(this.memoryStorage={},this.storage=(0,Hm.memoryLocalStorageAdapter)(this.memoryStorage)):(this.memoryStorage={},this.storage=(0,Hm.memoryLocalStorageAdapter)(this.memoryStorage)),(0,fe.isBrowser)()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${n4.version}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{let e=(0,fe.isBrowser)()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:r,error:n}=await this._getSessionFromURL(e);if(n)return this._debug("#_initialize()","error detecting session from URL",n),n?.code==="identity_already_exists"?{error:n}:(await this._removeSession(),{error:n});let{session:i,redirectType:o}=r;return this._debug("#_initialize()","detected session in URL",i,"redirect type",o),await this._saveSession(i),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return(0,Z.isAuthError)(e)?{error:e}:{error:new Z.AuthUnknownError("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,i;try{let o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e?.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(i=e?.options)===null||i===void 0?void 0:i.captchaToken}},xform:ae._sessionResponse}),{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var r,n,i;try{let o;if("email"in e){let{email:l,password:f,options:h}=e,d=null,p=null;this.flowType==="pkce"&&([d,p]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h?.emailRedirectTo,body:{email:l,password:f,data:(r=h?.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h?.captchaToken},code_challenge:d,code_challenge_method:p},xform:ae._sessionResponse})}else if("phone"in e){let{phone:l,password:f,options:h}=e;o=await(0,ae._request)(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:f,data:(n=h?.data)!==null&&n!==void 0?n:{},channel:(i=h?.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h?.captchaToken}},xform:ae._sessionResponse})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:s,error:a}=o;if(a||!s)return{data:{user:null,session:null},error:a};let u=s.session,c=s.user;return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let r;if("email"in e){let{email:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else if("phone"in e){let{phone:o,password:s,options:a}=e;r=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:s,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:ae._sessionResponsePassword})}else throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a password");let{data:n,error:i}=r;return i?{data:{user:null,session:null},error:i}:!n||!n.session||!n.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),{data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:i})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,n,i,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(i=e.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`),[n,i]=(r??"").split("/");try{let{data:o,error:s}=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:ae._sessionResponse});if(await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`),s)throw s;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Z.AuthInvalidTokenResponseError}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:i??null}),error:s})}catch(o){if((0,Z.isAuthError)(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(e){try{let{options:r,provider:n,token:i,access_token:o,nonce:s}=e,a=await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:i,access_token:o,nonce:s,gotrue_meta_security:{captcha_token:r?.captchaToken}},xform:ae._sessionResponse}),{data:u,error:c}=a;return c?{data:{user:null,session:null},error:c}:!u||!u.session||!u.user?{data:{user:null,session:null},error:new Z.AuthInvalidTokenResponseError}:(u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),{data:u,error:c})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,n,i,o,s;try{if("email"in e){let{email:a,options:u}=e,c=null,l=null;this.flowType==="pkce"&&([c,l]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{error:f}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=u?.data)!==null&&r!==void 0?r:{},create_user:(n=u?.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},code_challenge:c,code_challenge_method:l},redirectTo:u?.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in e){let{phone:a,options:u}=e,{data:c,error:l}=await(0,ae._request)(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=u?.data)!==null&&i!==void 0?i:{},create_user:(o=u?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:u?.captchaToken},channel:(s=u?.channel)!==null&&s!==void 0?s:"sms"}});return{data:{user:null,session:null,messageId:c?.message_id},error:l}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number.")}catch(a){if((0,Z.isAuthError)(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var r,n;try{let i,o;"options"in e&&(i=(r=e.options)===null||r===void 0?void 0:r.redirectTo,o=(n=e.options)===null||n===void 0?void 0:n.captchaToken);let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:i,xform:ae._sessionResponse});if(a)throw a;if(!s)throw new Error("An error occurred on token verification.");let u=s.session,c=s.user;return u?.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),{data:{user:c,session:u},error:null}}catch(i){if((0,Z.isAuthError)(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(e){var r,n,i;try{let o=null,s=null;return this.flowType==="pkce"&&([o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey)),await(0,ae._request)(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((i=e?.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:s}),headers:this.headers,xform:ae._ssoResponse})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Z.AuthSessionMissingError;let{error:i}=await(0,ae._request)(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:i}})}catch(e){if((0,Z.isAuthError)(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{let r=`${this.url}/resend`;if("email"in e){let{email:n,type:i,options:o}=e,{error:s}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return{data:{user:null,session:null},error:s}}else if("phone"in e){let{phone:n,type:i,options:o}=e,{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:i,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return{data:{user:null,session:null,messageId:s?.message_id},error:a}}throw new Z.AuthInvalidCredentialsError("You must provide either an email or phone number and a type")}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){let i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null,r=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};let n=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.storage.isServer){let s=this.suppressGetSessionWarning;e=new Proxy(e,{get:(u,c,l)=>(!s&&c==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),s=!0,this.suppressGetSessionWarning=!0),Reflect.get(u,c,l))})}return{data:{session:e},error:null}}let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:ae._userResponse}):await this._useSession(async r=>{var n,i,o;let{data:s,error:a}=r;if(a)throw a;return!(!((n=s.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Z.AuthSessionMissingError}:await(0,ae._request)(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(i=s.session)===null||i===void 0?void 0:i.access_token)!==null&&o!==void 0?o:void 0,xform:ae._userResponse})})}catch(r){if((0,Z.isAuthError)(r))return(0,Z.isAuthSessionMissingError)(r)&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{let{data:i,error:o}=n;if(o)throw o;if(!i.session)throw new Z.AuthSessionMissingError;let s=i.session,a=null,u=null;this.flowType==="pkce"&&e.email!=null&&([a,u]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey));let{data:c,error:l}=await(0,ae._request)(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:u}),jwt:s.access_token,xform:ae._userResponse});if(l)throw l;return s.user=c.user,await this._saveSession(s),await this._notifyAllSubscribers("USER_UPDATED",s),{data:{user:s.user},error:null}})}catch(n){if((0,Z.isAuthError)(n))return{data:{user:null},error:n};throw n}}_decodeJWT(e){return(0,fe.decodeJWTPayload)(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Z.AuthSessionMissingError;let r=Date.now()/1e3,n=r,i=!0,o=null,s=(0,fe.decodeJWTPayload)(e.access_token);if(s.exp&&(n=s.exp,i=n<=r),i){let{session:a,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return{data:{user:null,session:null},error:u};if(!a)return{data:{user:null,session:null},error:null};o=a}else{let{data:a,error:u}=await this._getUser(e.access_token);if(u)throw u;o={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){let{data:s,error:a}=r;if(a)throw a;e=(n=s.session)!==null&&n!==void 0?n:void 0}if(!e?.refresh_token)throw new Z.AuthSessionMissingError;let{session:i,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if((0,Z.isAuthError)(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e){try{if(!(0,fe.isBrowser)())throw new Z.AuthImplicitGrantRedirectError("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Z.AuthImplicitGrantRedirectError("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Z.AuthPKCEGrantCodeExchangeError("Not a valid PKCE flow url.");let r=(0,fe.parseParametersFromURL)(window.location.href);if(e){if(!r.code)throw new Z.AuthPKCEGrantCodeExchangeError("No code detected.");let{data:x,error:y}=await this._exchangeCodeForSession(r.code);if(y)throw y;let C=new URL(window.location.href);return C.searchParams.delete("code"),window.history.replaceState(window.history.state,"",C.toString()),{data:{session:x.session,redirectType:null},error:null}}if(r.error||r.error_description||r.error_code)throw new Z.AuthImplicitGrantRedirectError(r.error_description||"Error in URL with unspecified error_description",{error:r.error||"unspecified_error",code:r.error_code||"unspecified_code"});let{provider_token:n,provider_refresh_token:i,access_token:o,refresh_token:s,expires_in:a,expires_at:u,token_type:c}=r;if(!o||!a||!s||!c)throw new Z.AuthImplicitGrantRedirectError("No session defined in URL");let l=Math.round(Date.now()/1e3),f=parseInt(a),h=l+f;u&&(h=parseInt(u));let d=h-l;d*1e3<=nu&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${f}s`);let p=h-f;l-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,h,l):l-p<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",p,h,l);let{data:v,error:g}=await this._getUser(o);if(g)throw g;let w={provider_token:n,provider_refresh_token:i,access_token:o,expires_in:f,expires_at:h,refresh_token:s,token_type:c,user:v.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:w,redirectType:r.type},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href);return!!((0,fe.isBrowser)()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=(0,fe.parseParametersFromURL)(window.location.href),r=await(0,fe.getItemAsync)(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{error:o};let s=(n=i.session)===null||n===void 0?void 0:n.access_token;if(s){let{error:a}=await this.admin.signOut(s,e);if(a&&!((0,Z.isAuthApiError)(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await(0,fe.removeItemAsync)(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){let r=(0,fe.uuid)(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,i;try{let{data:{session:o},error:s}=r;if(s)throw s;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,r={}){let n=null,i=null;this.flowType==="pkce"&&([n,i]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey,!0));try{return await(0,ae._request)(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:i,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if((0,Z.isAuthError)(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{let{data:r,error:n}=await this.getUser();if(n)throw n;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{let{data:n,error:i}=await this._useSession(async o=>{var s,a,u,c,l;let{data:f,error:h}=o;if(h)throw h;let d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(s=e.options)===null||s===void 0?void 0:s.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await(0,ae._request)(this.fetch,"GET",d,{headers:this.headers,jwt:(l=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&l!==void 0?l:void 0})});if(i)throw i;return(0,fe.isBrowser)()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n?.url),{data:{provider:e.provider,url:n?.url},error:null}}catch(n){if((0,Z.isAuthError)(n))return{data:{provider:e.provider,url:null},error:n};throw n}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)throw s;return await(0,ae._request)(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(i=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&i!==void 0?i:void 0})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){let r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{let n=Date.now();return await(0,fe.retryable)(async i=>(i>0&&await(0,fe.sleep)(200*Math.pow(2,i-1)),this._debug(r,"refreshing attempt",i),await(0,ae._request)(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ae._sessionResponse})),(i,o)=>{let s=200*Math.pow(2,i);return o&&(0,Z.isAuthRetryableFetchError)(o)&&Date.now()+s-n<nu})}catch(n){if(this._debug(r,"error",n),(0,Z.isAuthError)(n))return{data:{session:null,user:null},error:n};throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){let n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),(0,fe.isBrowser)()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e;let r="#_recoverAndRefresh()";this._debug(r,"begin");try{let n=await(0,fe.getItemAsync)(this.storage,this.storageKey);if(this._debug(r,"session from storage",n),!this._isValidSession(n)){this._debug(r,"session is not valid"),n!==null&&await this._removeSession();return}let i=Math.round(Date.now()/1e3),o=((e=n.expires_at)!==null&&e!==void 0?e:1/0)<i+iu.EXPIRY_MARGIN;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${iu.EXPIRY_MARGIN}s`),o){if(this.autoRefreshToken&&n.refresh_token){let{error:s}=await this._callRefreshToken(n.refresh_token);s&&(console.error(s),(0,Z.isAuthRetryableFetchError)(s)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",s),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",n)}catch(n){this._debug(r,"error",n),console.error(n);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Z.AuthSessionMissingError;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let i=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new fe.Deferred;let{data:o,error:s}=await this._refreshAccessToken(e);if(s)throw s;if(!o.session)throw new Z.AuthSessionMissingError;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);let a={session:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(i,"error",o),(0,Z.isAuthError)(o)){let s={session:null,error:o};return(0,Z.isAuthRetryableFetchError)(o)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(s),s}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(e,r,n=!0){let i=`#_notifyAllSubscribers(${e})`;this._debug(i,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});let o=[],s=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(u){o.push(u)}});if(await Promise.all(s),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(i,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await(0,fe.setItemAsync)(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await(0,fe.removeItemAsync)(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&(0,fe.isBrowser)()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),nu);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async r=>{let{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let i=Math.floor((n.expires_at*1e3-e)/nu);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${nu}ms, refresh threshold is ${k_} ticks`),i<=k_&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof A_.LockAcquireTimeoutError)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!(0,fe.isBrowser)()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){let i=[`provider=${encodeURIComponent(r)}`];if(n?.redirectTo&&i.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n?.scopes&&i.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){let[o,s]=await(0,fe.getCodeChallengeAndMethod)(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(s)}`});i.push(a.toString())}if(n?.queryParams){let o=new URLSearchParams(n.queryParams);i.push(o.toString())}return n?.skipBrowserRedirect&&i.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${i.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,i;let{data:o,error:s}=r;if(s)return{data:null,error:s};let a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:u,error:c}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o?.session)===null||n===void 0?void 0:n.access_token});return c?{data:null,error:c}:(e.factorType==="totp"&&(!((i=u?.totp)===null||i===void 0)&&i.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),{data:u,error:null})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;if(o)return{data:null,error:o};let{data:s,error:a}=await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+s.expires_in},s)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",s),{data:s,error:a})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;let{data:i,error:o}=r;return o?{data:null,error:o}:await(0,ae._request)(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(n=i?.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if((0,Z.isAuthError)(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){let{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?{data:null,error:n}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){let{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};let n=e?.factors||[],i=n.filter(s=>s.factor_type==="totp"&&s.status==="verified"),o=n.filter(s=>s.factor_type==="phone"&&s.status==="verified");return{data:{all:n,totp:i,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,n;let{data:{session:i},error:o}=e;if(o)return{data:null,error:o};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let s=this._decodeJWT(i.access_token),a=null;s.aal&&(a=s.aal);let u=a;((n=(r=i.user.factors)===null||r===void 0?void 0:r.filter(f=>f.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(u="aal2");let l=s.amr||[];return{data:{currentLevel:a,nextLevel:u,currentAuthenticationMethods:l},error:null}}))}};ou.default=Tl;Tl.nextInstanceID=0});var P_=D(su=>{"use strict";var o4=su&&su.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(su,"__esModule",{value:!0});var s4=o4(Fl()),a4=s4.default;su.default=a4});var R_=D(au=>{"use strict";var u4=au&&au.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(au,"__esModule",{value:!0});var c4=u4(zm()),l4=c4.default;au.default=l4});var I_=D($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0})});var Wm=D(je=>{"use strict";var f4=je&&je.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),j_=je&&je.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&f4(e,t,r)},Pl=je&&je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(je,"__esModule",{value:!0});je.lockInternals=je.NavigatorLockAcquireTimeoutError=je.navigatorLock=je.AuthClient=je.AuthAdminApi=je.GoTrueClient=je.GoTrueAdminApi=void 0;var d4=Pl(Fl());je.GoTrueAdminApi=d4.default;var h4=Pl(zm());je.GoTrueClient=h4.default;var p4=Pl(P_());je.AuthAdminApi=p4.default;var m4=Pl(R_());je.AuthClient=m4.default;j_(I_(),je);j_(tu(),je);var Gm=Vm();Object.defineProperty(je,"navigatorLock",{enumerable:!0,get:function(){return Gm.navigatorLock}});Object.defineProperty(je,"NavigatorLockAcquireTimeoutError",{enumerable:!0,get:function(){return Gm.NavigatorLockAcquireTimeoutError}});Object.defineProperty(je,"lockInternals",{enumerable:!0,get:function(){return Gm.internals}})});var N_=D(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.SupabaseAuthClient=void 0;var g4=Wm(),Km=class extends g4.AuthClient{constructor(e){super(e)}};Rl.SupabaseAuthClient=Km});var Jm=D(uu=>{"use strict";var y4=uu&&uu.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(uu,"__esModule",{value:!0});var D4=om(),v4=i_(),b4=(vm(),ke(Dm)),w4=y_(),$l=v_(),_4=w_(),L_=__(),E4=N_(),Ym=class{constructor(e,r,n){var i,o,s;if(this.supabaseUrl=e,this.supabaseKey=r,!e)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");let a=(0,L_.stripTrailingSlash)(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;let u=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,c={db:$l.DEFAULT_DB_OPTIONS,realtime:$l.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},$l.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:$l.DEFAULT_GLOBAL_OPTIONS},l=(0,L_.applySettingDefaults)(n??{},c);this.storageKey=(i=l.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(o=l.global.headers)!==null&&o!==void 0?o:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((s=l.auth)!==null&&s!==void 0?s:{},this.headers,l.global.fetch),this.fetch=(0,_4.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new v4.PostgrestClient(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new D4.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new w4.StorageClient(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,r;return y4(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();let{data:n}=yield this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,storageKey:o,flowType:s,lock:a,debug:u},c,l){var f;let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new E4.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},h),c),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:i,flowType:s,lock:a,debug:u,fetch:l,hasCustomAuthorizationHeader:(f="Authorization"in this.headers)!==null&&f!==void 0?f:!1})}_initRealtimeClient(e){return new b4.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n?.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.realtime.setAuth(n??null),this.changedAccessToken=n):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};uu.default=Ym});var M_=D(Ne=>{"use strict";var C4=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),B_=Ne&&Ne.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&C4(e,t,r)},q_=Ne&&Ne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.createClient=Ne.SupabaseClient=Ne.FunctionRegion=Ne.FunctionsError=Ne.FunctionsRelayError=Ne.FunctionsFetchError=Ne.FunctionsHttpError=void 0;var S4=q_(Jm());B_(Wm(),Ne);var cu=om();Object.defineProperty(Ne,"FunctionsHttpError",{enumerable:!0,get:function(){return cu.FunctionsHttpError}});Object.defineProperty(Ne,"FunctionsFetchError",{enumerable:!0,get:function(){return cu.FunctionsFetchError}});Object.defineProperty(Ne,"FunctionsRelayError",{enumerable:!0,get:function(){return cu.FunctionsRelayError}});Object.defineProperty(Ne,"FunctionsError",{enumerable:!0,get:function(){return cu.FunctionsError}});Object.defineProperty(Ne,"FunctionRegion",{enumerable:!0,get:function(){return cu.FunctionRegion}});B_((vm(),ke(Dm)),Ne);var x4=Jm();Object.defineProperty(Ne,"SupabaseClient",{enumerable:!0,get:function(){return q_(x4).default}});var F4=(t,e,r)=>new S4.default(t,e,r);Ne.createClient=F4});var Xm=D((jle,U_)=>{U_.exports=require("stream")});var K_=D((Nle,W_)=>{"use strict";function V_(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function H_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?V_(Object(r),!0).forEach(function(n){O4(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V_(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function O4(t,e,r){return e=G_(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function A4(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z_(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,G_(n.key),n)}}function k4(t,e,r){return e&&z_(t.prototype,e),r&&z_(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function G_(t){var e=T4(t,"string");return typeof e=="symbol"?e:String(e)}function T4(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var P4=require("buffer"),Il=P4.Buffer,R4=require("util"),Zm=R4.inspect,$4=Zm&&Zm.custom||"inspect";function I4(t,e,r){Il.prototype.copy.call(t,e,r)}W_.exports=function(){function t(){A4(this,t),this.head=null,this.tail=null,this.length=0}return k4(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return Il.alloc(0);for(var n=Il.allocUnsafe(r>>>0),i=this.head,o=0;i;)I4(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=Il.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:$4,value:function(r,n){return Zm(this,H_(H_({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var eg=D((Lle,J_)=>{"use strict";function j4(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Qm,this,t)):process.nextTick(Qm,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(jl,r):(r._writableState.errorEmitted=!0,process.nextTick(Y_,r,o)):process.nextTick(Y_,r,o):e?(process.nextTick(jl,r),e(o)):process.nextTick(jl,r)}),this)}function Y_(t,e){Qm(t,e),jl(t)}function jl(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function N4(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Qm(t,e){t.emit("error",e)}function L4(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}J_.exports={destroy:j4,undestroy:N4,errorOrDestroy:L4}});var Yn=D((Ble,Q_)=>{"use strict";var Z_={};function gr(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}class i extends r{constructor(s,a,u){super(n(s,a,u))}}i.prototype.name=r.name,i.prototype.code=t,Z_[t]=i}function X_(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(n=>String(n)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function B4(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function q4(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function M4(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}gr("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);gr("ERR_INVALID_ARG_TYPE",function(t,e,r){let n;typeof e=="string"&&B4(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";let i;if(q4(t," argument"))i=`The ${t} ${n} ${X_(e,"type")}`;else{let o=M4(t,".")?"property":"argument";i=`The "${t}" ${o} ${n} ${X_(e,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);gr("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");gr("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});gr("ERR_STREAM_PREMATURE_CLOSE","Premature close");gr("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});gr("ERR_MULTIPLE_CALLBACK","Callback called multiple times");gr("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");gr("ERR_STREAM_WRITE_AFTER_END","write after end");gr("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);gr("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);gr("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Q_.exports.codes=Z_});var tg=D((qle,eE)=>{"use strict";var U4=Yn().codes.ERR_INVALID_OPT_VALUE;function V4(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function H4(t,e,r,n){var i=V4(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new U4(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}eE.exports={getHighWaterMark:H4}});var tE=D((Mle,rg)=>{typeof Object.create=="function"?rg.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:rg.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var Xo=D((Ule,ig)=>{try{if(ng=require("util"),typeof ng.inherits!="function")throw"";ig.exports=ng.inherits}catch{ig.exports=tE()}var ng});var nE=D((Vle,rE)=>{rE.exports=require("util").deprecate});var ag=D((Hle,cE)=>{"use strict";cE.exports=Ye;function oE(t){var e=this;this.next=null,this.entry=null,this.finish=function(){y5(e,t)}}var Zo;Ye.WritableState=fu;var z4={deprecate:nE()},sE=Xm(),Ll=require("buffer").Buffer,G4=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function W4(t){return Ll.from(t)}function K4(t){return Ll.isBuffer(t)||t instanceof G4}var sg=eg(),Y4=tg(),J4=Y4.getHighWaterMark,Jn=Yn().codes,X4=Jn.ERR_INVALID_ARG_TYPE,Z4=Jn.ERR_METHOD_NOT_IMPLEMENTED,Q4=Jn.ERR_MULTIPLE_CALLBACK,e5=Jn.ERR_STREAM_CANNOT_PIPE,t5=Jn.ERR_STREAM_DESTROYED,r5=Jn.ERR_STREAM_NULL_VALUES,n5=Jn.ERR_STREAM_WRITE_AFTER_END,i5=Jn.ERR_UNKNOWN_ENCODING,Qo=sg.errorOrDestroy;Xo()(Ye,sE);function o5(){}function fu(t,e,r){Zo=Zo||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof Zo),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=J4(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){d5(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new oE(this)}fu.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(fu.prototype,"buffer",{get:z4.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Nl;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Nl=Function.prototype[Symbol.hasInstance],Object.defineProperty(Ye,Symbol.hasInstance,{value:function(e){return Nl.call(this,e)?!0:this!==Ye?!1:e&&e._writableState instanceof fu}})):Nl=function(e){return e instanceof this};function Ye(t){Zo=Zo||Ti();var e=this instanceof Zo;if(!e&&!Nl.call(Ye,this))return new Ye(t);this._writableState=new fu(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),sE.call(this)}Ye.prototype.pipe=function(){Qo(this,new e5)};function s5(t,e){var r=new n5;Qo(t,r),process.nextTick(e,r)}function a5(t,e,r,n){var i;return r===null?i=new r5:typeof r!="string"&&!e.objectMode&&(i=new X4("chunk",["string","Buffer"],r)),i?(Qo(t,i),process.nextTick(n,i),!1):!0}Ye.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&K4(t);return o&&!Ll.isBuffer(t)&&(t=W4(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=o5),n.ending?s5(this,r):(o||a5(this,n,t,r))&&(n.pendingcb++,i=c5(this,n,o,t,e,r)),i};Ye.prototype.cork=function(){this._writableState.corked++};Ye.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&aE(this,t))};Ye.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new i5(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Ye.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function u5(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Ll.from(e,r)),e}Object.defineProperty(Ye.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function c5(t,e,r,n,i,o){if(!r){var s=u5(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else og(t,e,!1,a,n,i,o);return u}function og(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new t5("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function l5(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(lu,t,e),t._writableState.errorEmitted=!0,Qo(t,n)):(i(n),t._writableState.errorEmitted=!0,Qo(t,n),lu(t,e))}function f5(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function d5(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Q4;if(f5(r),e)l5(t,r,n,e,i);else{var o=uE(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&aE(t,r),n?process.nextTick(iE,t,r,o,i):iE(t,r,o,i)}}function iE(t,e,r,n){r||h5(t,e),e.pendingcb--,n(),lu(t,e)}function h5(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function aE(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,og(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new oE(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=e.objectMode?1:u.length;if(og(t,e,!1,f,u,c,l),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}Ye.prototype._write=function(t,e,r){r(new Z4("_write()"))};Ye.prototype._writev=null;Ye.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||g5(this,n,r),this};Object.defineProperty(Ye.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function uE(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function p5(t,e){t._final(function(r){e.pendingcb--,r&&Qo(t,r),e.prefinished=!0,t.emit("prefinish"),lu(t,e)})}function m5(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(p5,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function lu(t,e){var r=uE(e);if(r&&(m5(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function g5(t,e,r){e.ending=!0,lu(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function y5(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(Ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});Ye.prototype.destroy=sg.destroy;Ye.prototype._undestroy=sg.undestroy;Ye.prototype._destroy=function(t,e){e(t)}});var Ti=D((zle,fE)=>{"use strict";var D5=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};fE.exports=Ur;var lE=lg(),cg=ag();Xo()(Ur,lE);for(ug=D5(cg.prototype),Bl=0;Bl<ug.length;Bl++)ql=ug[Bl],Ur.prototype[ql]||(Ur.prototype[ql]=cg.prototype[ql]);var ug,ql,Bl;function Ur(t){if(!(this instanceof Ur))return new Ur(t);lE.call(this,t),cg.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",v5)))}Object.defineProperty(Ur.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ur.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ur.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function v5(){this._writableState.ended||process.nextTick(b5,this)}function b5(t){t.end()}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var pE=D((fg,hE)=>{var Ml=require("buffer"),Vr=Ml.Buffer;function dE(t,e){for(var r in t)e[r]=t[r]}Vr.from&&Vr.alloc&&Vr.allocUnsafe&&Vr.allocUnsafeSlow?hE.exports=Ml:(dE(Ml,fg),fg.Buffer=Pi);function Pi(t,e,r){return Vr(t,e,r)}Pi.prototype=Object.create(Vr.prototype);dE(Vr,Pi);Pi.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Vr(t,e,r)};Pi.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Vr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Pi.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Vr(t)};Pi.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Ml.SlowBuffer(t)}});var pg=D(gE=>{"use strict";var hg=pE().Buffer,mE=hg.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function w5(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function _5(t){var e=w5(t);if(typeof e!="string"&&(hg.isEncoding===mE||!mE(t)))throw new Error("Unknown encoding: "+t);return e||t}gE.StringDecoder=du;function du(t){this.encoding=_5(t);var e;switch(this.encoding){case"utf16le":this.text=O5,this.end=A5,e=4;break;case"utf8":this.fillLast=S5,e=4;break;case"base64":this.text=k5,this.end=T5,e=3;break;default:this.write=P5,this.end=R5;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=hg.allocUnsafe(e)}du.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};du.prototype.end=F5;du.prototype.text=x5;du.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function dg(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function E5(t,e,r){var n=e.length-1;if(n<r)return 0;var i=dg(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=dg(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=dg(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function C5(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function S5(t){var e=this.lastTotal-this.lastNeed,r=C5(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function x5(t,e){var r=E5(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function F5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function O5(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function A5(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function k5(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function T5(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function P5(t){return t.toString(this.encoding)}function R5(t){return t&&t.length?this.write(t):""}});var Ul=D((Wle,vE)=>{"use strict";var yE=Yn().codes.ERR_STREAM_PREMATURE_CLOSE;function $5(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function I5(){}function j5(t){return t.setHeader&&typeof t.abort=="function"}function DE(t,e,r){if(typeof e=="function")return DE(t,null,e);e||(e={}),r=$5(r||I5);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},u=t._readableState&&t._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(t)},l=function(p){r.call(t,p)},f=function(){var p;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(p=new yE),r.call(t,p);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(p=new yE),r.call(t,p)},h=function(){t.req.on("finish",a)};return j5(t)?(t.on("complete",a),t.on("abort",f),t.req?h():t.on("request",h)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",a),e.error!==!1&&t.on("error",l),t.on("close",f),function(){t.removeListener("complete",a),t.removeListener("abort",f),t.removeListener("request",h),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",c),t.removeListener("error",l),t.removeListener("close",f)}}vE.exports=DE});var wE=D((Kle,bE)=>{"use strict";var Vl;function Xn(t,e,r){return e=N5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N5(t){var e=L5(t,"string");return typeof e=="symbol"?e:String(e)}function L5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var B5=Ul(),Zn=Symbol("lastResolve"),Ri=Symbol("lastReject"),hu=Symbol("error"),Hl=Symbol("ended"),$i=Symbol("lastPromise"),mg=Symbol("handlePromise"),Ii=Symbol("stream");function Qn(t,e){return{value:t,done:e}}function q5(t){var e=t[Zn];if(e!==null){var r=t[Ii].read();r!==null&&(t[$i]=null,t[Zn]=null,t[Ri]=null,e(Qn(r,!1)))}}function M5(t){process.nextTick(q5,t)}function U5(t,e){return function(r,n){t.then(function(){if(e[Hl]){r(Qn(void 0,!0));return}e[mg](r,n)},n)}}var V5=Object.getPrototypeOf(function(){}),H5=Object.setPrototypeOf((Vl={get stream(){return this[Ii]},next:function(){var e=this,r=this[hu];if(r!==null)return Promise.reject(r);if(this[Hl])return Promise.resolve(Qn(void 0,!0));if(this[Ii].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[hu]?a(e[hu]):s(Qn(void 0,!0))})});var n=this[$i],i;if(n)i=new Promise(U5(n,this));else{var o=this[Ii].read();if(o!==null)return Promise.resolve(Qn(o,!1));i=new Promise(this[mg])}return this[$i]=i,i}},Xn(Vl,Symbol.asyncIterator,function(){return this}),Xn(Vl,"return",function(){var e=this;return new Promise(function(r,n){e[Ii].destroy(null,function(i){if(i){n(i);return}r(Qn(void 0,!0))})})}),Vl),V5),z5=function(e){var r,n=Object.create(H5,(r={},Xn(r,Ii,{value:e,writable:!0}),Xn(r,Zn,{value:null,writable:!0}),Xn(r,Ri,{value:null,writable:!0}),Xn(r,hu,{value:null,writable:!0}),Xn(r,Hl,{value:e._readableState.endEmitted,writable:!0}),Xn(r,mg,{value:function(o,s){var a=n[Ii].read();a?(n[$i]=null,n[Zn]=null,n[Ri]=null,o(Qn(a,!1))):(n[Zn]=o,n[Ri]=s)},writable:!0}),r));return n[$i]=null,B5(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Ri];o!==null&&(n[$i]=null,n[Zn]=null,n[Ri]=null,o(i)),n[hu]=i;return}var s=n[Zn];s!==null&&(n[$i]=null,n[Zn]=null,n[Ri]=null,s(Qn(void 0,!0))),n[Hl]=!0}),e.on("readable",M5.bind(null,n)),n};bE.exports=z5});var SE=D((Yle,CE)=>{"use strict";function _E(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function G5(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){_E(o,n,i,s,a,"next",u)}function a(u){_E(o,n,i,s,a,"throw",u)}s(void 0)})}}function EE(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function W5(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?EE(Object(r),!0).forEach(function(n){K5(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):EE(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function K5(t,e,r){return e=Y5(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y5(t){var e=J5(t,"string");return typeof e=="symbol"?e:String(e)}function J5(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var X5=Yn().codes.ERR_INVALID_ARG_TYPE;function Z5(t,e,r){var n;if(e&&typeof e.next=="function")n=e;else if(e&&e[Symbol.asyncIterator])n=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])n=e[Symbol.iterator]();else throw new X5("iterable",["Iterable"],e);var i=new t(W5({objectMode:!0},r)),o=!1;i._read=function(){o||(o=!0,s())};function s(){return a.apply(this,arguments)}function a(){return a=G5(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?s():o=!1}catch(f){i.destroy(f)}}),a.apply(this,arguments)}return i}CE.exports=Z5});var lg=D((Xle,IE)=>{"use strict";IE.exports=ye;var es;ye.ReadableState=AE;var Jle=require("events").EventEmitter,OE=function(e,r){return e.listeners(r).length},mu=Xm(),zl=require("buffer").Buffer,Q5=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function eU(t){return zl.from(t)}function tU(t){return zl.isBuffer(t)||t instanceof Q5}var gg=require("util"),ue;gg&&gg.debuglog?ue=gg.debuglog("stream"):ue=function(){};var rU=K_(),Eg=eg(),nU=tg(),iU=nU.getHighWaterMark,Gl=Yn().codes,oU=Gl.ERR_INVALID_ARG_TYPE,sU=Gl.ERR_STREAM_PUSH_AFTER_EOF,aU=Gl.ERR_METHOD_NOT_IMPLEMENTED,uU=Gl.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ts,yg,Dg;Xo()(ye,mu);var pu=Eg.errorOrDestroy,vg=["error","close","destroy","pause","resume"];function cU(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function AE(t,e,r){es=es||Ti(),t=t||{},typeof r!="boolean"&&(r=e instanceof es),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=iU(this,t,"readableHighWaterMark",r),this.buffer=new rU,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(ts||(ts=pg().StringDecoder),this.decoder=new ts(t.encoding),this.encoding=t.encoding)}function ye(t){if(es=es||Ti(),!(this instanceof ye))return new ye(t);var e=this instanceof es;this._readableState=new AE(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),mu.call(this)}Object.defineProperty(ye.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});ye.prototype.destroy=Eg.destroy;ye.prototype._undestroy=Eg.undestroy;ye.prototype._destroy=function(t,e){e(t)};ye.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=zl.from(t,e),e=""),n=!0),kE(this,t,e,!1,n)};ye.prototype.unshift=function(t){return kE(this,t,null,!0,!1)};function kE(t,e,r,n,i){ue("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,dU(t,o);else{var s;if(i||(s=lU(o,e)),s)pu(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==zl.prototype&&(e=eU(e)),n)o.endEmitted?pu(t,new uU):bg(t,o,e,!0);else if(o.ended)pu(t,new sU);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?bg(t,o,e,!1):_g(t,o)):bg(t,o,e,!1)}else n||(o.reading=!1,_g(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function bg(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Wl(t)),_g(t,e)}function lU(t,e){var r;return!tU(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new oU("chunk",["string","Buffer","Uint8Array"],e)),r}ye.prototype.isPaused=function(){return this._readableState.flowing===!1};ye.prototype.setEncoding=function(t){ts||(ts=pg().StringDecoder);var e=new ts(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var xE=1073741824;function fU(t){return t>=xE?t=xE:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function FE(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=fU(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}ye.prototype.read=function(t){ue("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return ue("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?wg(this):Wl(this),null;if(t=FE(t,e),t===0&&e.ended)return e.length===0&&wg(this),null;var n=e.needReadable;ue("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,ue("length less than watermark",n)),e.ended||e.reading?(n=!1,ue("reading or ended",n)):n&&(ue("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=FE(r,e)));var i;return t>0?i=RE(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&wg(this)),i!==null&&this.emit("data",i),i};function dU(t,e){if(ue("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Wl(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,TE(t)))}}function Wl(t){var e=t._readableState;ue("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(ue("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(TE,t))}function TE(t){var e=t._readableState;ue("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Cg(t)}function _g(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(hU,t,e))}function hU(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(ue("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}ye.prototype._read=function(t){pu(this,new aU("_read()"))};ye.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,ue("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:v;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(g,w){ue("onunpipe"),g===r&&w&&w.hasUnpiped===!1&&(w.hasUnpiped=!0,l())}function a(){ue("onend"),t.end()}var u=pU(r);t.on("drain",u);var c=!1;function l(){ue("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",h),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",v),r.removeListener("data",f),c=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",f);function f(g){ue("ondata");var w=t.write(g);ue("dest.write",w),w===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&$E(n.pipes,t)!==-1)&&!c&&(ue("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(g){ue("onerror",g),v(),t.removeListener("error",h),OE(t,"error")===0&&pu(t,g)}cU(t,"error",h);function d(){t.removeListener("finish",p),v()}t.once("close",d);function p(){ue("onfinish"),t.removeListener("close",d),v()}t.once("finish",p);function v(){ue("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(ue("pipe resume"),r.resume()),t};function pU(t){return function(){var r=t._readableState;ue("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&OE(t,"data")&&(r.flowing=!0,Cg(t))}}ye.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=$E(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ye.prototype.on=function(t,e){var r=mu.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,ue("on readable",n.length,n.reading),n.length?Wl(this):n.reading||process.nextTick(mU,this)),r};ye.prototype.addListener=ye.prototype.on;ye.prototype.removeListener=function(t,e){var r=mu.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(PE,this),r};ye.prototype.removeAllListeners=function(t){var e=mu.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(PE,this),e};function PE(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function mU(t){ue("readable nexttick read 0"),t.read(0)}ye.prototype.resume=function(){var t=this._readableState;return t.flowing||(ue("resume"),t.flowing=!t.readableListening,gU(this,t)),t.paused=!1,this};function gU(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(yU,t,e))}function yU(t,e){ue("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Cg(t),e.flowing&&!e.reading&&t.read(0)}ye.prototype.pause=function(){return ue("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(ue("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Cg(t){var e=t._readableState;for(ue("flow",e.flowing);e.flowing&&t.read()!==null;);}ye.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(ue("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(ue("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<vg.length;o++)t.on(vg[o],this.emit.bind(this,vg[o]));return this._read=function(s){ue("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(ye.prototype[Symbol.asyncIterator]=function(){return yg===void 0&&(yg=wE()),yg(this)});Object.defineProperty(ye.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(ye.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(ye.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});ye._fromList=RE;Object.defineProperty(ye.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function RE(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function wg(t){var e=t._readableState;ue("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(DU,e,t))}function DU(t,e){if(ue("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(ye.from=function(t,e){return Dg===void 0&&(Dg=SE()),Dg(ye,t,e)});function $E(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var Sg=D((Zle,NE)=>{"use strict";NE.exports=Dn;var Kl=Yn().codes,vU=Kl.ERR_METHOD_NOT_IMPLEMENTED,bU=Kl.ERR_MULTIPLE_CALLBACK,wU=Kl.ERR_TRANSFORM_ALREADY_TRANSFORMING,_U=Kl.ERR_TRANSFORM_WITH_LENGTH_0,Yl=Ti();Xo()(Dn,Yl);function EU(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new bU);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Dn(t){if(!(this instanceof Dn))return new Dn(t);Yl.call(this,t),this._transformState={afterTransform:EU.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",CU)}function CU(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){jE(t,e,r)}):jE(this,null,null)}Dn.prototype.push=function(t,e){return this._transformState.needTransform=!1,Yl.prototype.push.call(this,t,e)};Dn.prototype._transform=function(t,e,r){r(new vU("_transform()"))};Dn.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Dn.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Dn.prototype._destroy=function(t,e){Yl.prototype._destroy.call(this,t,function(r){e(r)})};function jE(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new _U;if(t._transformState.transforming)throw new wU;return t.push(null)}});var qE=D((Qle,BE)=>{"use strict";BE.exports=gu;var LE=Sg();Xo()(gu,LE);function gu(t){if(!(this instanceof gu))return new gu(t);LE.call(this,t)}gu.prototype._transform=function(t,e,r){r(null,t)}});var zE=D((efe,HE)=>{"use strict";var xg;function SU(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var VE=Yn().codes,xU=VE.ERR_MISSING_ARGS,FU=VE.ERR_STREAM_DESTROYED;function ME(t){if(t)throw t}function OU(t){return t.setHeader&&typeof t.abort=="function"}function AU(t,e,r,n){n=SU(n);var i=!1;t.on("close",function(){i=!0}),xg===void 0&&(xg=Ul()),xg(t,{readable:e,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,OU(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new FU("pipe"))}}}function UE(t){t()}function kU(t,e){return t.pipe(e)}function TU(t){return!t.length||typeof t[t.length-1]!="function"?ME:t.pop()}function PU(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=TU(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new xU("streams");var i,o=e.map(function(s,a){var u=a<e.length-1,c=a>0;return AU(s,u,c,function(l){i||(i=l),l&&o.forEach(UE),!u&&(o.forEach(UE),n(i))})});return e.reduce(kU)}HE.exports=PU});var GE=D((yr,Du)=>{var yu=require("stream");process.env.READABLE_STREAM==="disable"&&yu?(Du.exports=yu.Readable,Object.assign(Du.exports,yu),Du.exports.Stream=yu):(yr=Du.exports=lg(),yr.Stream=yu||yr,yr.Readable=yr,yr.Writable=ag(),yr.Duplex=Ti(),yr.Transform=Sg(),yr.PassThrough=qE(),yr.finished=Ul(),yr.pipeline=zE())});var Og=D(Fg=>{var WE;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof Fg=="object"?t(Fg):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(WE={}):t(WE={})})(function(t){t.version="1.2.2";function e(){for(var F=0,L=new Array(256),S=0;S!=256;++S)F=S,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,L[S]=F;return typeof Int32Array<"u"?new Int32Array(L):L}var r=e();function n(F){var L=0,S=0,I=0,R=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)R[I]=F[I];for(I=0;I!=256;++I)for(S=F[I],L=256+I;L<4096;L+=256)S=R[L]=S>>>8^F[S&255];var B=[];for(I=1;I!=16;++I)B[I-1]=typeof Int32Array<"u"?R.subarray(I*256,I*256+256):R.slice(I*256,I*256+256);return B}var i=n(r),o=i[0],s=i[1],a=i[2],u=i[3],c=i[4],l=i[5],f=i[6],h=i[7],d=i[8],p=i[9],v=i[10],g=i[11],w=i[12],x=i[13],y=i[14];function C(F,L){for(var S=L^-1,I=0,R=F.length;I<R;)S=S>>>8^r[(S^F.charCodeAt(I++))&255];return~S}function k(F,L){for(var S=L^-1,I=F.length-15,R=0;R<I;)S=y[F[R++]^S&255]^x[F[R++]^S>>8&255]^w[F[R++]^S>>16&255]^g[F[R++]^S>>>24]^v[F[R++]]^p[F[R++]]^d[F[R++]]^h[F[R++]]^f[F[R++]]^l[F[R++]]^c[F[R++]]^u[F[R++]]^a[F[R++]]^s[F[R++]]^o[F[R++]]^r[F[R++]];for(I+=15;R<I;)S=S>>>8^r[(S^F[R++])&255];return~S}function $(F,L){for(var S=L^-1,I=0,R=F.length,B=0,q=0;I<R;)B=F.charCodeAt(I++),B<128?S=S>>>8^r[(S^B)&255]:B<2048?(S=S>>>8^r[(S^(192|B>>6&31))&255],S=S>>>8^r[(S^(128|B&63))&255]):B>=55296&&B<57344?(B=(B&1023)+64,q=F.charCodeAt(I++)&1023,S=S>>>8^r[(S^(240|B>>8&7))&255],S=S>>>8^r[(S^(128|B>>2&63))&255],S=S>>>8^r[(S^(128|q>>6&15|(B&3)<<4))&255],S=S>>>8^r[(S^(128|q&63))&255]):(S=S>>>8^r[(S^(224|B>>12&15))&255],S=S>>>8^r[(S^(128|B>>6&63))&255],S=S>>>8^r[(S^(128|B&63))&255]);return~S}t.table=r,t.bstr=C,t.buf=k,t.str=$})});var YE=D((rfe,KE)=>{"use strict";var{Transform:RU}=GE(),$U=Og(),Ag=class extends RU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(e,r,n){e&&(this.checksum=$U.buf(e,this.checksum)>>>0,this.rawSize+=e.length),n(null,e)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};KE.exports=Ag});var XE=D((nfe,JE)=>{"use strict";var{DeflateRaw:IU}=require("zlib"),jU=Og(),kg=class extends IU{constructor(e){super(e),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(e,r){return e&&(this.compressedSize+=e.length),super.push(e,r)}_transform(e,r,n){e&&(this.checksum=jU.buf(e,this.checksum)>>>0,this.rawSize+=e.length),super._transform(e,r,n)}digest(e){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),e?r.toString(e):r}hex(){return this.digest("hex").toUpperCase()}size(e=!1){return e?this.compressedSize:this.rawSize}};JE.exports=kg});var QE=D((ife,ZE)=>{"use strict";ZE.exports={CRC32Stream:YE(),DeflateCRC32Stream:XE()}});var vu=D(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.checksum=rs.checksumFile=void 0;var NU=require("fs"),LU=require("crypto"),tC=require("stream"),BU=require("util"),{CRC32Stream:qU}=QE(),eC=(0,BU.promisify)(tC.pipeline),MU=(t,e,r)=>rC(NU.createReadStream(t),e,r);rs.checksumFile=MU;async function rC(t,e,r="hex"){let n=VU(t);if(e==="crc32"){let o=new qU,s=eC(n,o);return o.resume(),await s,o.end(),Buffer.from(o.digest()).toString(r)}let i=(0,LU.createHash)(e);return await eC(n,i),i.end(),i.digest(r)}rs.checksum=rC;function UU(t){return t!=null&&typeof t=="object"&&typeof t.read=="function"&&typeof t.pipe=="function"}var VU=t=>UU(t)?t:new tC.Readable({read(){this.push(t),this.push(null)}})});var Tg=D((sfe,nC)=>{nC.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}});var Jl=D(oC=>{var iC={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function HU(t){return function(...e){return e.length&&(t=t.replace(/\{(\d)\}/g,(r,n)=>e[n]||"")),new Error("ADM-ZIP: "+t)}}for(let t of Object.keys(iC))oC[t]=HU(iC[t])});var lC=D((ufe,cC)=>{var zU=require("fs"),at=require("path"),sC=Tg(),GU=Jl(),WU=typeof process=="object"&&process.platform==="win32",aC=t=>typeof t=="object"&&t!==null,uC=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e>>>=1;return e>>>0});function Je(t){this.sep=at.sep,this.fs=zU,aC(t)&&aC(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}cC.exports=Je;Je.prototype.makeDir=function(t){let e=this;function r(n){let i=n.split(e.sep)[0];n.split(e.sep).forEach(function(o){if(!(!o||o.substr(-1,1)===":")){i+=e.sep+o;var s;try{s=e.fs.statSync(i)}catch{e.fs.mkdirSync(i)}if(s&&s.isFile())throw GU.FILE_IN_THE_WAY(`"${i}"`)}})}r(t)};Je.prototype.writeFileTo=function(t,e,r,n){let i=this;if(i.fs.existsSync(t)){if(!r)return!1;var o=i.fs.statSync(t);if(o.isDirectory())return!1}var s=at.dirname(t);i.fs.existsSync(s)||i.makeDir(s);var a;try{a=i.fs.openSync(t,"w",438)}catch{i.fs.chmodSync(t,438),a=i.fs.openSync(t,"w",438)}if(a)try{i.fs.writeSync(a,e,0,e.length,0)}finally{i.fs.closeSync(a)}return i.fs.chmodSync(t,n||438),!0};Je.prototype.writeFileToAsync=function(t,e,r,n,i){typeof n=="function"&&(i=n,n=void 0);let o=this;o.fs.exists(t,function(s){if(s&&!r)return i(!1);o.fs.stat(t,function(a,u){if(s&&u.isDirectory())return i(!1);var c=at.dirname(t);o.fs.exists(c,function(l){l||o.makeDir(c),o.fs.open(t,"w",438,function(f,h){f?o.fs.chmod(t,438,function(){o.fs.open(t,"w",438,function(d,p){o.fs.write(p,e,0,e.length,0,function(){o.fs.close(p,function(){o.fs.chmod(t,n||438,function(){i(!0)})})})})}):h?o.fs.write(h,e,0,e.length,0,function(){o.fs.close(h,function(){o.fs.chmod(t,n||438,function(){i(!0)})})}):o.fs.chmod(t,n||438,function(){i(!0)})})})})})};Je.prototype.findFiles=function(t){let e=this;function r(n,i,o){typeof i=="boolean"&&(o=i,i=void 0);let s=[];return e.fs.readdirSync(n).forEach(function(a){let u=at.join(n,a),c=e.fs.statSync(u);(!i||i.test(u))&&s.push(at.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&o&&(s=s.concat(r(u,i,o)))}),s}return r(t,void 0,!0)};Je.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(i,o){if(i)return e(i);let s=o.length;if(!s)return e(null,n);o.forEach(function(a){a=at.join(t,a),r.fs.stat(a,function(u,c){if(u)return e(u);c&&(n.push(at.normalize(a)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(a,function(l,f){if(l)return e(l);n=n.concat(f),--s||e(null,n)}):--s||e(null,n))})})})};Je.prototype.getAttributes=function(){};Je.prototype.setAttributes=function(){};Je.crc32update=function(t,e){return uC[(t^e)&255]^t>>>8};Je.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=Je.crc32update(r,t[n++]);return~r>>>0};Je.methodToString=function(t){switch(t){case sC.STORED:return"STORED ("+t+")";case sC.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};Je.canonical=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.join(".",e)};Je.zipnamefix=function(t){if(!t)return"";let e=at.posix.normalize("/"+t.split("\\").join("/"));return at.posix.join(".",e)};Je.findLast=function(t,e){if(!Array.isArray(t))throw new TypeError("arr is not array");let r=t.length>>>0;for(let n=r-1;n>=0;n--)if(e(t[n],n,t))return t[n]};Je.sanitize=function(t,e){t=at.resolve(at.normalize(t));for(var r=e.split("/"),n=0,i=r.length;n<i;n++){var o=at.normalize(at.join(t,r.slice(n,i).join(at.sep)));if(o.indexOf(t)===0)return o}return at.normalize(at.join(t,at.basename(e)))};Je.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};Je.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};Je.fromDOS2Date=function(t){return new Date((t>>25&127)+1980,Math.max((t>>21&15)-1,0),Math.max(t>>16&31,1),t>>11&31,t>>5&63,(t&31)<<1)};Je.fromDate2DOS=function(t){let e=0,r=0;return t.getFullYear()>1979&&(e=(t.getFullYear()-1980&127)<<9|t.getMonth()+1<<5|t.getDate(),r=t.getHours()<<11|t.getMinutes()<<5|t.getSeconds()>>1),e<<16|r};Je.isWin=WU;Je.crcTable=uC});var dC=D((cfe,fC)=>{var KU=require("path");fC.exports=function(t,{fs:e}){var r=t||"",n=o(),i=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(i=e.statSync(r),n.directory=i.isDirectory(),n.mtime=i.mtime,n.atime=i.atime,n.executable=(73&i.mode)!==0,n.readonly=(128&i.mode)===0,n.hidden=KU.basename(r)[0]==="."):console.warn("Invalid path: "+r),{get directory(){return n.directory},get readOnly(){return n.readonly},get hidden(){return n.hidden},get mtime(){return n.mtime},get atime(){return n.atime},get executable(){return n.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:r,isDirectory:n.directory,isReadOnly:n.readonly,isHidden:n.hidden,isExecutable:n.executable,mTime:n.mtime,aTime:n.atime}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var pC=D((lfe,hC)=>{hC.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var is=D((ffe,ns)=>{ns.exports=lC();ns.exports.Constants=Tg();ns.exports.Errors=Jl();ns.exports.FileAttr=dC();ns.exports.decoder=pC()});var gC=D((dfe,mC)=>{var ei=is(),V=ei.Constants;mC.exports=function(){var t=20,e=10,r=0,n=0,i=0,o=0,s=0,a=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;t|=ei.isWin?2560:768,r|=V.FLG_EFS;let v={extraLen:0},g=y=>Math.max(0,y)>>>0,w=y=>Math.max(0,y)&65535,x=y=>Math.max(0,y)&255;return i=ei.fromDate2DOS(new Date),{get made(){return t},set made(y){t=y},get version(){return e},set version(y){e=y},get flags(){return r},set flags(y){r=y},get flags_efs(){return(r&V.FLG_EFS)>0},set flags_efs(y){y?r|=V.FLG_EFS:r&=~V.FLG_EFS},get flags_desc(){return(r&V.FLG_DESC)>0},set flags_desc(y){y?r|=V.FLG_DESC:r&=~V.FLG_DESC},get method(){return n},set method(y){switch(y){case V.STORED:this.version=10;case V.DEFLATED:default:this.version=20}n=y},get time(){return ei.fromDOS2Date(this.timeval)},set time(y){this.timeval=ei.fromDate2DOS(y)},get timeval(){return i},set timeval(y){i=g(y)},get timeHighByte(){return x(i>>>8)},get crc(){return o},set crc(y){o=g(y)},get compressedSize(){return s},set compressedSize(y){s=g(y)},get size(){return a},set size(y){a=g(y)},get fileNameLength(){return u},set fileNameLength(y){u=y},get extraLength(){return c},set extraLength(y){c=y},get extraLocalLength(){return v.extraLen},set extraLocalLength(y){v.extraLen=y},get commentLength(){return l},set commentLength(y){l=y},get diskNumStart(){return f},set diskNumStart(y){f=g(y)},get inAttr(){return h},set inAttr(y){h=g(y)},get attr(){return d},set attr(y){d=g(y)},get fileAttr(){return(d||0)>>16&4095},get offset(){return p},set offset(y){p=g(y)},get encrypted(){return(r&V.FLG_ENC)===V.FLG_ENC},get centralHeaderSize(){return V.CENHDR+u+c+l},get realDataOffset(){return p+V.LOCHDR+v.fnameLen+v.extraLen},get localHeader(){return v},loadLocalHeaderFromBinary:function(y){var C=y.slice(p,p+V.LOCHDR);if(C.readUInt32LE(0)!==V.LOCSIG)throw ei.Errors.INVALID_LOC();v.version=C.readUInt16LE(V.LOCVER),v.flags=C.readUInt16LE(V.LOCFLG),v.method=C.readUInt16LE(V.LOCHOW),v.time=C.readUInt32LE(V.LOCTIM),v.crc=C.readUInt32LE(V.LOCCRC),v.compressedSize=C.readUInt32LE(V.LOCSIZ),v.size=C.readUInt32LE(V.LOCLEN),v.fnameLen=C.readUInt16LE(V.LOCNAM),v.extraLen=C.readUInt16LE(V.LOCEXT);let k=p+V.LOCHDR+v.fnameLen,$=k+v.extraLen;return y.slice(k,$)},loadFromBinary:function(y){if(y.length!==V.CENHDR||y.readUInt32LE(0)!==V.CENSIG)throw ei.Errors.INVALID_CEN();t=y.readUInt16LE(V.CENVEM),e=y.readUInt16LE(V.CENVER),r=y.readUInt16LE(V.CENFLG),n=y.readUInt16LE(V.CENHOW),i=y.readUInt32LE(V.CENTIM),o=y.readUInt32LE(V.CENCRC),s=y.readUInt32LE(V.CENSIZ),a=y.readUInt32LE(V.CENLEN),u=y.readUInt16LE(V.CENNAM),c=y.readUInt16LE(V.CENEXT),l=y.readUInt16LE(V.CENCOM),f=y.readUInt16LE(V.CENDSK),h=y.readUInt16LE(V.CENATT),d=y.readUInt32LE(V.CENATX),p=y.readUInt32LE(V.CENOFF)},localHeaderToBinary:function(){var y=Buffer.alloc(V.LOCHDR);return y.writeUInt32LE(V.LOCSIG,0),y.writeUInt16LE(e,V.LOCVER),y.writeUInt16LE(r,V.LOCFLG),y.writeUInt16LE(n,V.LOCHOW),y.writeUInt32LE(i,V.LOCTIM),y.writeUInt32LE(o,V.LOCCRC),y.writeUInt32LE(s,V.LOCSIZ),y.writeUInt32LE(a,V.LOCLEN),y.writeUInt16LE(u,V.LOCNAM),y.writeUInt16LE(v.extraLen,V.LOCEXT),y},centralHeaderToBinary:function(){var y=Buffer.alloc(V.CENHDR+u+c+l);return y.writeUInt32LE(V.CENSIG,0),y.writeUInt16LE(t,V.CENVEM),y.writeUInt16LE(e,V.CENVER),y.writeUInt16LE(r,V.CENFLG),y.writeUInt16LE(n,V.CENHOW),y.writeUInt32LE(i,V.CENTIM),y.writeUInt32LE(o,V.CENCRC),y.writeUInt32LE(s,V.CENSIZ),y.writeUInt32LE(a,V.CENLEN),y.writeUInt16LE(u,V.CENNAM),y.writeUInt16LE(c,V.CENEXT),y.writeUInt16LE(l,V.CENCOM),y.writeUInt16LE(f,V.CENDSK),y.writeUInt16LE(h,V.CENATT),y.writeUInt32LE(d,V.CENATX),y.writeUInt32LE(p,V.CENOFF),y},toJSON:function(){let y=function(C){return C+" bytes"};return{made:t,version:e,flags:r,method:ei.methodToString(n),time:this.time,crc:"0x"+o.toString(16).toUpperCase(),compressedSize:y(s),size:y(a),fileNameLength:y(u),extraLength:y(c),commentLength:y(l),diskNumStart:f,inAttr:h,attr:d,offset:p,centralHeaderSize:y(V.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var DC=D((hfe,yC)=>{var os=is(),Me=os.Constants;yC.exports=function(){var t=0,e=0,r=0,n=0,i=0;return{get diskEntries(){return t},set diskEntries(o){t=e=o},get totalEntries(){return e},set totalEntries(o){e=t=o},get size(){return r},set size(o){r=o},get offset(){return n},set offset(o){n=o},get commentLength(){return i},set commentLength(o){i=o},get mainHeaderSize(){return Me.ENDHDR+i},loadFromBinary:function(o){if((o.length!==Me.ENDHDR||o.readUInt32LE(0)!==Me.ENDSIG)&&(o.length<Me.ZIP64HDR||o.readUInt32LE(0)!==Me.ZIP64SIG))throw os.Errors.INVALID_END();o.readUInt32LE(0)===Me.ENDSIG?(t=o.readUInt16LE(Me.ENDSUB),e=o.readUInt16LE(Me.ENDTOT),r=o.readUInt32LE(Me.ENDSIZ),n=o.readUInt32LE(Me.ENDOFF),i=o.readUInt16LE(Me.ENDCOM)):(t=os.readBigUInt64LE(o,Me.ZIP64SUB),e=os.readBigUInt64LE(o,Me.ZIP64TOT),r=os.readBigUInt64LE(o,Me.ZIP64SIZE),n=os.readBigUInt64LE(o,Me.ZIP64OFF),i=0)},toBinary:function(){var o=Buffer.alloc(Me.ENDHDR+i);return o.writeUInt32LE(Me.ENDSIG,0),o.writeUInt32LE(0,4),o.writeUInt16LE(t,Me.ENDSUB),o.writeUInt16LE(e,Me.ENDTOT),o.writeUInt32LE(r,Me.ENDSIZ),o.writeUInt32LE(n,Me.ENDOFF),o.writeUInt16LE(i,Me.ENDCOM),o.fill(" ",Me.ENDHDR),o},toJSON:function(){let o=function(s,a){let u=s.toString(16).toUpperCase();for(;u.length<a;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:o(n,4),commentLength:i}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var Rg=D(Pg=>{Pg.EntryHeader=gC();Pg.MainHeader=DC()});var bC=D((mfe,vC)=>{vC.exports=function(t){var e=require("zlib"),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return e.deflateRawSync(t,r)},deflateAsync:function(n){var i=e.createDeflateRaw(r),o=[],s=0;i.on("data",function(a){o.push(a),s+=a.length}),i.on("end",function(){var a=Buffer.alloc(s),u=0;a.fill(0);for(var c=0;c<o.length;c++){var l=o[c];l.copy(a,u),u+=l.length}n&&n(a)}),i.end(t)}}}});var _C=D((gfe,wC)=>{var YU=+(process.versions?process.versions.node:"").split(".")[0]||0;wC.exports=function(t,e){var r=require("zlib");let n=YU>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(i){var o=r.createInflateRaw(n),s=[],a=0;o.on("data",function(u){s.push(u),a+=u.length}),o.on("end",function(){var u=Buffer.alloc(a),c=0;u.fill(0);for(var l=0;l<s.length;l++){var f=s[l];f.copy(u,c),c+=f.length}i&&i(u)}),o.end(t)}}}});var FC=D((yfe,xC)=>{"use strict";var{randomFillSync:EC}=require("crypto"),JU=Jl(),XU=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)e&1?e=e>>>1^3988292384:e>>>=1;return e>>>0}),SC=(t,e)=>Math.imul(t,e)>>>0,CC=(t,e)=>XU[(t^e)&255]^t>>>8,bu=()=>typeof EC=="function"?EC(Buffer.alloc(12)):bu.node();bu.node=()=>{let t=Buffer.alloc(12),e=t.length;for(let r=0;r<e;r++)t[r]=Math.random()*256&255;return t};var Xl={genSalt:bu};function Zl(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let r=0;r<e.length;r++)this.updateKeys(e[r])}Zl.prototype.updateKeys=function(t){let e=this.keys;return e[0]=CC(e[0],t),e[1]+=e[0]&255,e[1]=SC(e[1],134775813)+1,e[2]=CC(e[2],e[1]>>>24),t};Zl.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return SC(t,t^1)>>8&255};function ZU(t){let e=new Zl(t);return function(r){let n=Buffer.alloc(r.length),i=0;for(let o of r)n[i++]=e.updateKeys(o^e.next());return n}}function QU(t){let e=new Zl(t);return function(r,n,i=0){n||(n=Buffer.alloc(r.length));for(let o of r){let s=e.next();n[i++]=o^s,e.updateKeys(o)}return n}}function e9(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=ZU(r),i=n(t.slice(0,12)),o=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(i[11]!==o)throw JU.WRONG_PASSWORD();return n(t.slice(12))}function t9(t){Buffer.isBuffer(t)&&t.length>=12?Xl.genSalt=function(){return t.slice(0,12)}:t==="node"?Xl.genSalt=bu.node:Xl.genSalt=bu}function r9(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let i=QU(r),o=Xl.genSalt();o[11]=e.crc>>>24&255,n&&(o[10]=e.crc>>>16&255);let s=Buffer.alloc(t.length+12);return i(o,s),i(t,s,12)}xC.exports={decrypt:e9,encrypt:r9,_salter:t9}});var OC=D(Ql=>{Ql.Deflater=bC();Ql.Inflater=_C();Ql.ZipCrypto=FC()});var Ig=D((vfe,AC)=>{var we=is(),n9=Rg(),Xe=we.Constants,$g=OC();AC.exports=function(t,e){var r=new n9.EntryHeader,n=Buffer.alloc(0),i=Buffer.alloc(0),o=!1,s=null,a=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,f=typeof l.decoder=="object"?l.decoder:we.decoder;c=f.hasOwnProperty("efs")?f.efs:!1;function h(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function d(y){if(r.flags_desc){let C={},k=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(k)==Xe.LOCSIG||e.readUInt32LE(k)==Xe.CENSIG)throw we.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(k)==Xe.EXTSIG)C.crc=e.readUInt32LE(k+Xe.EXTCRC),C.compressedSize=e.readUInt32LE(k+Xe.EXTSIZ),C.size=e.readUInt32LE(k+Xe.EXTLEN);else if(e.readUInt16LE(k+12)===19280)C.crc=e.readUInt32LE(k+Xe.EXTCRC-4),C.compressedSize=e.readUInt32LE(k+Xe.EXTSIZ-4),C.size=e.readUInt32LE(k+Xe.EXTLEN-4);else throw we.Errors.DESCRIPTOR_UNKNOWN();if(C.compressedSize!==r.compressedSize||C.size!==r.size||C.crc!==r.crc)throw we.Errors.DESCRIPTOR_FAULTY();if(we.crc32(y)!==C.crc)return!1}else if(we.crc32(y)!==r.localHeader.crc)return!1;return!0}function p(y,C,k){if(typeof C>"u"&&typeof y=="string"&&(k=y,y=void 0),o)return y&&C&&C(Buffer.alloc(0),we.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var $=h();if($.length===0)return y&&C&&C($),$;if(r.encrypted){if(typeof k!="string"&&!Buffer.isBuffer(k))throw we.Errors.INVALID_PASS_PARAM();$=$g.ZipCrypto.decrypt($,r,k)}var F=Buffer.alloc(r.size);switch(r.method){case we.Constants.STORED:if($.copy(F),d(F))return y&&C&&C(F),F;throw y&&C&&C(F,we.Errors.BAD_CRC()),we.Errors.BAD_CRC();case we.Constants.DEFLATED:var L=new $g.Inflater($,r.size);if(y)L.inflateAsync(function(S){S.copy(S,0),C&&(d(S)?C(S):C(S,we.Errors.BAD_CRC()))});else{if(L.inflate(F).copy(F,0),!d(F))throw we.Errors.BAD_CRC(`"${f.decode(n)}"`);return F}break;default:throw y&&C&&C(Buffer.alloc(0),we.Errors.UNKNOWN_METHOD()),we.Errors.UNKNOWN_METHOD()}}function v(y,C){if((!s||!s.length)&&Buffer.isBuffer(e))return y&&C&&C(h()),h();if(s.length&&!o){var k;switch(r.method){case we.Constants.STORED:return r.compressedSize=r.size,k=Buffer.alloc(s.length),s.copy(k),y&&C&&C(k),k;default:case we.Constants.DEFLATED:var $=new $g.Deflater(s);if(y)$.deflateAsync(function(L){k=Buffer.alloc(L.length),r.compressedSize=L.length,L.copy(k),C&&C(k)});else{var F=$.deflate();return r.compressedSize=F.length,F}$=null;break}}else if(y&&C)C(Buffer.alloc(0));else return Buffer.alloc(0)}function g(y,C){return(y.readUInt32LE(C+4)<<4)+y.readUInt32LE(C)}function w(y){try{for(var C=0,k,$,F;C+4<y.length;)k=y.readUInt16LE(C),C+=2,$=y.readUInt16LE(C),C+=2,F=y.slice(C,C+$),C+=$,Xe.ID_ZIP64===k&&x(F)}catch{throw we.Errors.EXTRA_FIELD_PARSE_ERROR()}}function x(y){var C,k,$,F;y.length>=Xe.EF_ZIP64_SCOMP&&(C=g(y,Xe.EF_ZIP64_SUNCOMP),r.size===Xe.EF_ZIP64_OR_32&&(r.size=C)),y.length>=Xe.EF_ZIP64_RHO&&(k=g(y,Xe.EF_ZIP64_SCOMP),r.compressedSize===Xe.EF_ZIP64_OR_32&&(r.compressedSize=k)),y.length>=Xe.EF_ZIP64_DSN&&($=g(y,Xe.EF_ZIP64_RHO),r.offset===Xe.EF_ZIP64_OR_32&&(r.offset=$)),y.length>=Xe.EF_ZIP64_DSN+4&&(F=y.readUInt32LE(Xe.EF_ZIP64_DSN),r.diskNumStart===Xe.EF_ZIP64_OR_16&&(r.diskNumStart=F))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(y){n=we.toBuffer(y,f.encode);var C=n[n.length-1];o=C===47||C===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return a},set extra(y){a=y,r.extraLength=y.length,w(y)},get comment(){return f.decode(i)},set comment(y){if(i=we.toBuffer(y,f.encode),r.commentLength=i.length,i.length>65535)throw we.Errors.COMMENT_TOO_LONG()},get name(){var y=f.decode(n);return o?y.substr(y.length-1).split("/").pop():y.split("/").pop()},get isDirectory(){return o},getCompressedData:function(){return v(!1,null)},getCompressedDataAsync:function(y){v(!0,y)},setData:function(y){s=we.toBuffer(y,we.decoder.encode),!o&&s.length?(r.size=s.length,r.method=we.Constants.DEFLATED,r.crc=we.crc32(y),r.changed=!0):r.method=we.Constants.STORED},getData:function(y){return r.changed?s:p(!1,null,y)},getDataAsync:function(y,C){r.changed?y(s):p(!0,y,C)},set attr(y){r.attr=y},get attr(){return r.attr},set header(y){r.loadFromBinary(y)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=a.length;var y=r.centralHeaderToBinary(),C=we.Constants.CENHDR;return n.copy(y,C),C+=n.length,a.copy(y,C),C+=r.extraLength,i.copy(y,C),y},packLocalHeader:function(){let y=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let C=r.localHeaderToBinary(),k=Buffer.alloc(C.length+n.length+r.extraLocalLength);return C.copy(k,y),y+=C.length,n.copy(k,y),y+=n.length,u.copy(k,y),y+=u.length,k},toJSON:function(){let y=function(C){return"<"+(C&&C.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:y(e),data:y(s)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var PC=D((bfe,TC)=>{var kC=Ig(),i9=Rg(),bt=is();TC.exports=function(t,e){var r=[],n={},i=Buffer.alloc(0),o=new i9.MainHeader,s=!1,a=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?p(c.readEntries):s=!0;function h(){let g=new Set;for(let w of Object.keys(n)){let x=w.split("/");if(x.pop(),!!x.length)for(let y=0;y<x.length;y++){let C=x.slice(0,y+1).join("/")+"/";g.add(C)}}for(let w of g)if(!(w in n)){let x=new kC(c);x.entryName=w,x.attr=16,x.temporary=!0,r.push(x),n[x.entryName]=x,u.add(x)}}function d(){if(s=!0,n={},o.diskEntries>(t.length-o.offset)/bt.Constants.CENHDR)throw bt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(o.diskEntries);for(var g=o.offset,w=0;w<r.length;w++){var x=g,y=new kC(c,t);y.header=t.slice(x,x+=bt.Constants.CENHDR),y.entryName=t.slice(x,x+=y.header.fileNameLength),y.header.extraLength&&(y.extra=t.slice(x,x+=y.header.extraLength)),y.header.commentLength&&(y.comment=t.slice(x,x+y.header.commentLength)),g+=y.header.centralHeaderSize,r[w]=y,n[y.entryName]=y}u.clear(),h()}function p(g){var w=t.length-bt.Constants.ENDHDR,x=Math.max(0,w-65535),y=x,C=t.length,k=-1,$=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(x=0),w;w>=y;w--)if(t[w]===80){if(t.readUInt32LE(w)===bt.Constants.ENDSIG){k=w,$=w,C=w+bt.Constants.ENDHDR,y=w-bt.Constants.END64HDR;continue}if(t.readUInt32LE(w)===bt.Constants.END64SIG){y=x;continue}if(t.readUInt32LE(w)===bt.Constants.ZIP64SIG){k=w,C=w+bt.readBigUInt64LE(t,w+bt.Constants.ZIP64SIZE)+bt.Constants.ZIP64LEAD;break}}if(k==-1)throw bt.Errors.INVALID_FORMAT();o.loadFromBinary(t.slice(k,C)),o.commentLength&&(i=t.slice($+bt.Constants.ENDHDR)),g&&d()}function v(){r.length>1&&!l&&r.sort((g,w)=>g.entryName.toLowerCase().localeCompare(w.entryName.toLowerCase()))}return{get entries(){return s||d(),r.filter(g=>!u.has(g))},get comment(){return f.decode(i)},set comment(g){i=bt.toBuffer(g,f.encode),o.commentLength=i.length},getEntryCount:function(){return s?r.length:o.diskEntries},forEach:function(g){this.entries.forEach(g)},getEntry:function(g){return s||d(),n[g]||null},setEntry:function(g){s||d(),r.push(g),n[g.entryName]=g,o.totalEntries=r.length},deleteFile:function(g,w=!0){s||d();let x=n[g];this.getEntryChildren(x,w).map(C=>C.entryName).forEach(this.deleteEntry)},deleteEntry:function(g){s||d();let w=n[g],x=r.indexOf(w);x>=0&&(r.splice(x,1),delete n[g],o.totalEntries=r.length)},getEntryChildren:function(g,w=!0){if(s||d(),typeof g=="object")if(g.isDirectory&&w){let x=[],y=g.entryName;for(let C of r)C.entryName.startsWith(y)&&x.push(C);return x}else return[g];return[]},getChildCount:function(g){if(g&&g.isDirectory){let w=this.getEntryChildren(g);return w.includes(g)?w.length-1:w.length}return 0},compressToBuffer:function(){s||d(),v();let g=[],w=[],x=0,y=0;o.size=0,o.offset=0;let C=0;for(let F of this.entries){let L=F.getCompressedData();F.header.offset=y;let S=F.packLocalHeader(),I=S.length+L.length;y+=I,g.push(S),g.push(L);let R=F.packCentralHeader();w.push(R),o.size+=R.length,x+=I+R.length,C++}x+=o.mainHeaderSize,o.offset=y,o.totalEntries=C,y=0;let k=Buffer.alloc(x);for(let F of g)F.copy(k,y),y+=F.length;for(let F of w)F.copy(k,y),y+=F.length;let $=o.toBinary();return i&&i.copy($,bt.Constants.ENDHDR),$.copy(k,y),t=k,s=!1,k},toAsyncBuffer:function(g,w,x,y){try{s||d(),v();let C=[],k=[],$=0,F=0,L=0;o.size=0,o.offset=0;let S=function(I){if(I.length>0){let R=I.shift(),B=R.entryName+R.extra.toString();x&&x(B),R.getCompressedDataAsync(function(q){y&&y(B),R.header.offset=F;let K=R.packLocalHeader(),M=K.length+q.length;F+=M,C.push(K),C.push(q);let E=R.packCentralHeader();k.push(E),o.size+=E.length,$+=M+E.length,L++,S(I)})}else{$+=o.mainHeaderSize,o.offset=F,o.totalEntries=L,F=0;let R=Buffer.alloc($);C.forEach(function(q){q.copy(R,F),F+=q.length}),k.forEach(function(q){q.copy(R,F),F+=q.length});let B=o.toBinary();i&&i.copy(B,bt.Constants.ENDHDR),B.copy(R,F),t=R,s=!1,g(R)}};S(Array.from(this.entries))}catch(C){w(C)}}}}});var IC=D((wfe,$C)=>{var Ue=is(),Ze=require("path"),o9=Ig(),s9=PC(),ji=(...t)=>Ue.findLast(t,e=>typeof e=="boolean"),RC=(...t)=>Ue.findLast(t,e=>typeof e=="string"),a9=(...t)=>Ue.findLast(t,e=>typeof e=="function"),u9={noSort:!1,readEntries:!1,method:Ue.Constants.NONE,fs:null};$C.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),u9);t&&typeof t=="object"&&(t instanceof Uint8Array||(Object.assign(n,t),t=n.input?n.input:void 0,n.input&&delete n.input),Buffer.isBuffer(t)&&(r=t,n.method=Ue.Constants.BUFFER,t=void 0)),Object.assign(n,e);let i=new Ue(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=Ue.decoder),t&&typeof t=="string")if(i.fs.existsSync(t))n.method=Ue.Constants.FILE,n.filename=t,r=i.fs.readFileSync(t);else throw Ue.Errors.INVALID_FILENAME();let o=new s9(r,n),{canonical:s,sanitize:a,zipnamefix:u}=Ue;function c(d){if(d&&o){var p;if(typeof d=="string"&&(p=o.getEntry(Ze.posix.normalize(d))),typeof d=="object"&&typeof d.entryName<"u"&&typeof d.header<"u"&&(p=o.getEntry(d.entryName)),p)return p}return null}function l(d){let{join:p,normalize:v,sep:g}=Ze.posix;return p(".",v(g+d.split("\\").join(g)+g))}function f(d){return d instanceof RegExp?function(p){return function(v){return p.test(v)}}(d):typeof d!="function"?()=>!0:d}let h=(d,p)=>{let v=p.slice(-1);return v=v===i.sep?i.sep:"",Ze.relative(d,p)+v};return{readFile:function(d,p){var v=c(d);return v&&v.getData(p)||null},childCount:function(d){let p=c(d);if(p)return o.getChildCount(p)},readFileAsync:function(d,p){var v=c(d);v?v.getDataAsync(p):p(null,"getEntry failed for:"+d)},readAsText:function(d,p){var v=c(d);if(v){var g=v.getData();if(g&&g.length)return g.toString(p||"utf8")}return""},readAsTextAsync:function(d,p,v){var g=c(d);g?g.getDataAsync(function(w,x){if(x){p(w,x);return}w&&w.length?p(w.toString(v||"utf8")):p("")}):p("")},deleteFile:function(d,p=!0){var v=c(d);v&&o.deleteFile(v.entryName,p)},deleteEntry:function(d){var p=c(d);p&&o.deleteEntry(p.entryName)},addZipComment:function(d){o.comment=d},getZipComment:function(){return o.comment||""},addZipEntryComment:function(d,p){var v=c(d);v&&(v.comment=p)},getZipEntryComment:function(d){var p=c(d);return p&&p.comment||""},updateFile:function(d,p){var v=c(d);v&&v.setData(p)},addLocalFile:function(d,p,v,g){if(i.fs.existsSync(d)){p=p?l(p):"";let w=Ze.win32.basename(Ze.win32.normalize(d));p+=v||w;let x=i.fs.statSync(d),y=x.isFile()?i.fs.readFileSync(d):Buffer.alloc(0);x.isDirectory()&&(p+=i.sep),this.addFile(p,y,g,x)}else throw Ue.Errors.FILE_NOT_FOUND(d)},addLocalFileAsync:function(d,p){d=typeof d=="object"?d:{localPath:d};let v=Ze.resolve(d.localPath),{comment:g}=d,{zipPath:w,zipName:x}=d,y=this;i.fs.stat(v,function(C,k){if(C)return p(C,!1);w=w?l(w):"";let $=Ze.win32.basename(Ze.win32.normalize(v));if(w+=x||$,k.isFile())i.fs.readFile(v,function(F,L){return F?p(F,!1):(y.addFile(w,L,g,k),setImmediate(p,void 0,!0))});else if(k.isDirectory())return w+=i.sep,y.addFile(w,Buffer.alloc(0),g,k),setImmediate(p,void 0,!0)})},addLocalFolder:function(d,p,v){if(v=f(v),p=p?l(p):"",d=Ze.normalize(d),i.fs.existsSync(d)){let g=i.findFiles(d),w=this;if(g.length)for(let x of g){let y=Ze.join(p,h(d,x));v(y)&&w.addLocalFile(x,Ze.dirname(y))}}else throw Ue.Errors.FILE_NOT_FOUND(d)},addLocalFolderAsync:function(d,p,v,g){g=f(g),v=v?l(v):"",d=Ze.normalize(d);var w=this;i.fs.open(d,"r",function(x){if(x&&x.code==="ENOENT")p(void 0,Ue.Errors.FILE_NOT_FOUND(d));else if(x)p(void 0,x);else{var y=i.findFiles(d),C=-1,k=function(){if(C+=1,C<y.length){var $=y[C],F=h(d,$).split("\\").join("/");F=F.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),g(F)?i.fs.stat($,function(L,S){L&&p(void 0,L),S.isFile()?i.fs.readFile($,function(I,R){I?p(void 0,I):(w.addFile(v+F,R,"",S),k())}):(w.addFile(v+F+"/",Buffer.alloc(0),"",S),k())}):process.nextTick(()=>{k()})}else p(!0,void 0)};k()}})},addLocalFolderAsync2:function(d,p){let v=this;d=typeof d=="object"?d:{localPath:d},localPath=Ze.resolve(l(d.localPath));let{zipPath:g,filter:w,namefix:x}=d;w instanceof RegExp?w=function(k){return function($){return k.test($)}}(w):typeof w!="function"&&(w=function(){return!0}),g=g?l(g):"",x=="latin1"&&(x=k=>k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof x!="function"&&(x=k=>k);let y=k=>Ze.join(g,x(h(localPath,k))),C=k=>Ze.win32.basename(Ze.win32.normalize(x(k)));i.fs.open(localPath,"r",function(k){k&&k.code==="ENOENT"?p(void 0,Ue.Errors.FILE_NOT_FOUND(localPath)):k?p(void 0,k):i.findFilesAsync(localPath,function($,F){if($)return p($);F=F.filter(L=>w(y(L))),F.length||p(void 0,!1),setImmediate(F.reverse().reduce(function(L,S){return function(I,R){if(I||R===!1)return setImmediate(L,I,!1);v.addLocalFileAsync({localPath:S,zipPath:Ze.dirname(y(S)),zipName:C(S)},L)}},p))})})},addLocalFolderPromise:function(d,p){return new Promise((v,g)=>{this.addLocalFolderAsync2(Object.assign({localPath:d},p),(w,x)=>{w&&g(w),x&&v(this)})})},addFile:function(d,p,v,g){d=u(d);let w=c(d),x=w!=null;x||(w=new o9(n),w.entryName=d),w.comment=v||"";let y=typeof g=="object"&&g instanceof i.fs.Stats;y&&(w.header.time=g.mtime);var C=w.isDirectory?16:0;let k=w.isDirectory?16384:32768;return y?k|=4095&g.mode:typeof g=="number"?k|=4095&g:k|=w.isDirectory?493:420,C=(C|k<<16)>>>0,w.attr=C,w.setData(p),x||o.setEntry(w),w},getEntries:function(d){return o.password=d,o?o.entries:[]},getEntry:function(d){return c(d)},getEntryCount:function(){return o.getEntryCount()},forEach:function(d){return o.forEach(d)},extractEntryTo:function(d,p,v,g,w,x){g=ji(!1,g),w=ji(!1,w),v=ji(!0,v),x=RC(w,x);var y=c(d);if(!y)throw Ue.Errors.NO_ENTRY();var C=s(y.entryName),k=a(p,x&&!y.isDirectory?x:v?C:Ze.basename(C));if(y.isDirectory){var $=o.getEntryChildren(y);return $.forEach(function(S){if(S.isDirectory)return;var I=S.getData();if(!I)throw Ue.Errors.CANT_EXTRACT_FILE();var R=s(S.entryName),B=a(p,v?R:Ze.basename(R));let q=w?S.header.fileAttr:void 0;i.writeFileTo(B,I,g,q)}),!0}var F=y.getData(o.password);if(!F)throw Ue.Errors.CANT_EXTRACT_FILE();if(i.fs.existsSync(k)&&!g)throw Ue.Errors.CANT_OVERRIDE();let L=w?d.header.fileAttr:void 0;return i.writeFileTo(k,F,g,L),!0},test:function(d){if(!o)return!1;for(var p in o.entries)try{if(p.isDirectory)continue;var v=o.entries[p].getData(d);if(!v)return!1}catch{return!1}return!0},extractAllTo:function(d,p,v,g){if(v=ji(!1,v),g=RC(v,g),p=ji(!1,p),!o)throw Ue.Errors.NO_ZIP();o.entries.forEach(function(w){var x=a(d,s(w.entryName));if(w.isDirectory){i.makeDir(x);return}var y=w.getData(g);if(!y)throw Ue.Errors.CANT_EXTRACT_FILE();let C=v?w.header.fileAttr:void 0;i.writeFileTo(x,y,p,C);try{i.fs.utimesSync(x,w.header.time,w.header.time)}catch{throw Ue.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(d,p,v,g){if(g=a9(p,v,g),v=ji(!1,v),p=ji(!1,p),!g)return new Promise((k,$)=>{this.extractAllToAsync(d,p,v,function(F){F?$(F):k(this)})});if(!o){g(Ue.Errors.NO_ZIP());return}d=Ze.resolve(d);let w=k=>a(d,Ze.normalize(s(k.entryName))),x=(k,$)=>new Error(k+': "'+$+'"'),y=[],C=[];o.entries.forEach(k=>{k.isDirectory?y.push(k):C.push(k)});for(let k of y){let $=w(k),F=v?k.header.fileAttr:void 0;try{i.makeDir($),F&&i.fs.chmodSync($,F),i.fs.utimesSync($,k.header.time,k.header.time)}catch{g(x("Unable to create folder",$))}}C.reverse().reduce(function(k,$){return function(F){if(F)k(F);else{let L=Ze.normalize(s($.entryName)),S=a(d,L);$.getDataAsync(function(I,R){if(R)k(R);else if(!I)k(Ue.Errors.CANT_EXTRACT_FILE());else{let B=v?$.header.fileAttr:void 0;i.writeFileToAsync(S,I,p,B,function(q){q||k(x("Unable to write file",S)),i.fs.utimes(S,$.header.time,$.header.time,function(K){K?k(x("Unable to set times",S)):k()})})}})}}},g)()},writeZip:function(d,p){if(arguments.length===1&&typeof d=="function"&&(p=d,d=""),!d&&n.filename&&(d=n.filename),!!d){var v=o.compressToBuffer();if(v){var g=i.writeFileTo(d,v,!0);typeof p=="function"&&p(g?null:new Error("failed"),"")}}},writeZipPromise:function(d,p){let{overwrite:v,perm:g}=Object.assign({overwrite:!0},p);return new Promise((w,x)=>{!d&&n.filename&&(d=n.filename),d||x("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(y=>{let C=k=>k?w(k):x("ADM-ZIP: Wasn't able to write zip file");i.writeFileToAsync(d,y,v,g,C)},x)})},toBufferPromise:function(){return new Promise((d,p)=>{o.toAsyncBuffer(d,p)})},toBuffer:function(d,p,v,g){return typeof d=="function"?(o.toAsyncBuffer(d,p,v,g),null):o.compressToBuffer()}}}});var JC=D((Yfe,YC)=>{var KC={};YC.exports=KC;var WC={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],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],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(WC).forEach(function(t){var e=WC[t],r=KC[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var ZC=D((Jfe,XC)=>{"use strict";XC.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",i=e.indexOf(n+t);return i!==-1&&(r===-1?!0:i<r)}});var eS=D((Xfe,QC)=>{"use strict";var p9=require("os"),Ar=ZC(),Tt=process.env,us=void 0;Ar("no-color")||Ar("no-colors")||Ar("color=false")?us=!1:(Ar("color")||Ar("colors")||Ar("color=true")||Ar("color=always"))&&(us=!0);"FORCE_COLOR"in Tt&&(us=Tt.FORCE_COLOR.length===0||parseInt(Tt.FORCE_COLOR,10)!==0);function m9(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function g9(t){if(us===!1)return 0;if(Ar("color=16m")||Ar("color=full")||Ar("color=truecolor"))return 3;if(Ar("color=256"))return 2;if(t&&!t.isTTY&&us!==!0)return 0;var e=us?1:0;if(process.platform==="win32"){var r=p9.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Tt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Tt})||Tt.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Tt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Tt.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Tt){var n=parseInt((Tt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Tt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Tt.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Tt.TERM)||"COLORTERM"in Tt?1:(Tt.TERM==="dumb",e)}function Ug(t){var e=g9(t);return m9(e)}QC.exports={supportsColor:Ug,stdout:Ug(process.stdout),stderr:Ug(process.stderr)}});var rS=D((Zfe,tS)=>{tS.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=i[o]||[" "],a=Math.floor(Math.random()*s.length);typeof i[o]<"u"?n+=i[o][a]:n+=o}),n}});var iS=D((Qfe,nS)=>{nS.exports=function(e,r){e=e||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function o(u){var c=Math.floor(Math.random()*u);return c}function s(u){var c=!1;return i.filter(function(l){c=l===u}),c}function a(u,c){var l="",f,h;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",u=u.split("");for(h in u)if(!s(h)){switch(l=l+u[h],f={up:0,down:0,mid:0},c.size){case"mini":f.up=o(8),f.mid=o(2),f.down=o(8);break;case"maxi":f.up=o(16)+3,f.mid=o(4)+1,f.down=o(64)+3;break;default:f.up=o(8)+1,f.mid=o(6)/2,f.down=o(8)+1;break}var d=["up","mid","down"];for(var p in d)for(var v=d[p],g=0;g<=f[v];g++)c[v]&&(l=l+n[v][o(n[v].length)])}return l}return a(e,r)}});var sS=D((ede,oS)=>{oS.exports=function(t){return function(e,r,n){if(e===" ")return e;switch(r%3){case 0:return t.red(e);case 1:return t.white(e);case 2:return t.blue(e)}}}});var uS=D((tde,aS)=>{aS.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var lS=D((rde,cS)=>{cS.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,i){return r===" "?r:t[e[n++%e.length]](r)}}});var dS=D((nde,fS)=>{fS.exports=function(t){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,i){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var DS=D((ode,yS)=>{var le={};yS.exports=le;le.themes={};var y9=require("util"),Ni=le.styles=JC(),pS=Object.defineProperties,D9=new RegExp(/[\r\n]+/g);le.supportsColor=eS().supportsColor;typeof le.enabled>"u"&&(le.enabled=le.supportsColor()!==!1);le.enable=function(){le.enabled=!0};le.disable=function(){le.enabled=!1};le.stripColors=le.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var ide=le.stylize=function(e,r){if(!le.enabled)return e+"";var n=Ni[r];return!n&&r in le?le[r](e):n.open+e+n.close},v9=/[|\\{}()[\]^$+*?.]/g,b9=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(v9,"\\$&")};function mS(t){var e=function r(){return _9.apply(r,arguments)};return e._styles=t,e.__proto__=w9,e}var gS=function(){var t={};return Ni.grey=Ni.gray,Object.keys(Ni).forEach(function(e){Ni[e].closeRe=new RegExp(b9(Ni[e].close),"g"),t[e]={get:function(){return mS(this._styles.concat(e))}}}),t}(),w9=pS(function(){},gS);function _9(){var t=Array.prototype.slice.call(arguments),e=t.map(function(s){return s!=null&&s.constructor===String?s:y9.inspect(s)}).join(" ");if(!le.enabled||!e)return e;for(var r=e.indexOf(`
24
+ `)!=-1,n=this._styles,i=n.length;i--;){var o=Ni[n[i]];e=o.open+e.replace(o.closeRe,o.open)+o.close,r&&(e=e.replace(D9,function(s){return o.close+s+o.open}))}return e}le.setTheme=function(t){if(typeof t=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in t)(function(r){le[r]=function(n){if(typeof t[r]=="object"){var i=n;for(var o in t[r])i=le[t[r][o]](i);return i}return le[t[r]](n)}})(e)};function E9(){var t={};return Object.keys(gS).forEach(function(e){t[e]={get:function(){return mS([e])}}}),t}var C9=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};le.trap=rS();le.zalgo=iS();le.maps={};le.maps.america=sS()(le);le.maps.zebra=uS()(le);le.maps.rainbow=lS()(le);le.maps.random=dS()(le);for(hS in le.maps)(function(t){le[t]=function(e){return C9(le.maps[t],e)}})(hS);var hS;pS(le,E9())});var bS=D((sde,vS)=>{var S9=DS();vS.exports=S9});var wS=D(Vg=>{"use strict";Vg.indent=function(e){return new Array(e+1).join(" ")};Vg.getMaxIndexLength=function(t){var e=0;return Object.getOwnPropertyNames(t).forEach(function(r){t[r]!==void 0&&(e=Math.max(e,r.length))}),e}});var _S=D((ude,x9)=>{x9.exports={author:"Rafael de Oleza <rafeca@gmail.com> (https://github.com/rafeca)",name:"prettyjson",description:"Package for formatting JSON data in a coloured YAML-style, perfect for CLI output",version:"1.2.5",homepage:"http://rafeca.com/prettyjson",keywords:["json","cli","formatting","colors"],repository:{type:"git",url:"https://github.com/rafeca/prettyjson.git"},bugs:{url:"https://github.com/rafeca/prettyjson/issues"},main:"./lib/prettyjson",files:["bin/prettyjson","lib/*.js"],license:"MIT",scripts:{test:"npm run jshint && mocha --reporter spec",testwin:"node ./node_modules/mocha/bin/mocha --reporter spec",jshint:"jshint lib/*.js test/*.js",coverage:"istanbul cover _mocha --report lcovonly -- -R spec",coveralls:"npm run coverage && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage",changelog:"git log $(git describe --tags --abbrev=0)..HEAD --pretty='* %s' --first-parent"},bin:{prettyjson:"./bin/prettyjson"},dependencies:{colors:"1.4.0",minimist:"^1.2.0"},devDependencies:{coveralls:"^2.11.15",istanbul:"^0.4.5",jshint:"^2.9.4",mocha:"^3.1.2","mocha-lcov-reporter":"^1.2.0",should:"^11.1.1"}}});var ES=D(Eu=>{"use strict";var zr=bS(),ri=wS(),F9=/[^\w\s\n\r\v\t\.,]/i;Eu.version=_S().version;var Hg=function(t,e){return t!==void 0||e.renderUndefined},of=function(t,e,r){return!!(typeof t=="boolean"||typeof t=="number"||typeof t=="function"||t===null||t===void 0||t instanceof Date||typeof t=="string"&&t.indexOf(`
25
+ `)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&of(t[0],!0,r))},O9=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?zr[e.stringColor](t):t;var r=t+"";return t===!0?zr.green(r):t===!1?zr.red(r):t==null?zr.grey(r):typeof t=="number"?t>=0?zr[e.positiveNumberColor](r):zr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},zg=function(t,e){return t.multilineStringColor===null||t.noColor?e:zr[t.multilineStringColor](e)},A9=function(t,e,r){var n=t.split(`
26
26
  `);return n=n.map(function(i){return ri.indent(e)+zg(r,i)}),n.join(`
27
- `)},cs=function(t,e,r){if(typeof t=="string"&&t.match(x9)&&e.escape&&(t=JSON.stringify(t)),!Hg(t,e))return[];if(of(t,!1,e))return[ri.indent(r)+F9(t,e)];if(typeof t=="string")return[ri.indent(r)+zg(e,'"""'),O9(t,r+e.defaultIndentation,e),ri.indent(r)+zg(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[ri.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(Hg(a,e)){var u="- ";e.noColor||(u=zr[e.dashColor](u)),u=ri.indent(r)+u,of(a,!1,e)?(u+=cs(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,cs(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return cs({message:t.message,stack:t.stack.split(`
27
+ `)},cs=function(t,e,r){if(typeof t=="string"&&t.match(F9)&&e.escape&&(t=JSON.stringify(t)),!Hg(t,e))return[];if(of(t,!1,e))return[ri.indent(r)+O9(t,e)];if(typeof t=="string")return[ri.indent(r)+zg(e,'"""'),A9(t,r+e.defaultIndentation,e),ri.indent(r)+zg(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[ri.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(a){if(Hg(a,e)){var u="- ";e.noColor||(u=zr[e.dashColor](u)),u=ri.indent(r)+u,of(a,!1,e)?(u+=cs(a,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,cs(a,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return cs({message:t.message,stack:t.stack.split(`
28
28
  `)},e,r);var i=e.noAlign?0:ri.getMaxIndexLength(t),o,s=[];return Object.getOwnPropertyNames(t).forEach(function(a){if(Hg(t[a],e))if(o=a+": ",e.noColor||(o=zr[e.keysColor](o)),o=ri.indent(r)+o,of(t[a],!1,e)){var u=e.noAlign?0:i-a.length;o+=cs(t[a],e,u)[0],s.push(o)}else s.push(o),s.push.apply(s,cs(t[a],e,r+e.defaultIndentation))}),s};Eu.render=function(e,r,n){return n=n||0,r=r||{},r.emptyArrayMsg=r.emptyArrayMsg||"(empty array)",r.keysColor=r.keysColor||"green",r.dashColor=r.dashColor||"green",r.numberColor=r.numberColor||"blue",r.positiveNumberColor=r.positiveNumberColor||r.numberColor,r.negativeNumberColor=r.negativeNumberColor||r.numberColor,r.defaultIndentation=r.defaultIndentation||2,r.noColor=!!r.noColor,r.noAlign=!!r.noAlign,r.escape=!!r.escape,r.renderUndefined=!!r.renderUndefined,r.stringColor=r.stringColor||null,r.multilineStringColor=r.multilineStringColor||null,cs(e,r,n).join(`
29
29
  `)};Eu.renderString=function(e,r,n){var i="",o;if(typeof e!="string"||e==="")return"";if(e[0]!=="{"&&e[0]!=="["){var s;e.indexOf("{")===-1?s=e.indexOf("["):e.indexOf("[")===-1||e.indexOf("{")<e.indexOf("[")?s=e.indexOf("{"):s=e.indexOf("["),i+=e.substr(0,s)+`
30
- `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return zr.red("Error:")+" Not valid JSON!"}return i+=Eu.render(o,r,n),i}});var Kg=D(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;function ls(t){"@babel/helpers - typeof";return ls=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ls(t)}function CS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,k9(n.key),n)}}function A9(t,e,r){return e&&CS(t.prototype,e),r&&CS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function k9(t){var e=T9(t,"string");return ls(e)=="symbol"?e:e+""}function T9(t,e){if(ls(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ls(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function P9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R9(t,e,r){return e=Su(e),$9(t,Wg()?Reflect.construct(e,r||[],Su(t).constructor):e.apply(t,r))}function $9(t,e){if(e&&(ls(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return I9(t)}function I9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cu(t,e)}function Gg(t){var e=typeof Map=="function"?new Map:void 0;return Gg=function(n){if(n===null||!L9(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return N9(n,arguments,Su(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Cu(i,n)},Gg(t)}function N9(t,e,r){if(Wg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Cu(i,r.prototype),i}function Wg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wg=function(){return!!t})()}function L9(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Cu(t,e){return Cu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Cu(t,e)}function Su(t){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Su(t)}var B9=function(t){function e(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(P9(this,e),n=R9(this,e,[r]),n.originalRequest=o,n.originalResponse=s,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),o!=null){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),c=o.getURL(),l=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return j9(e,t),A9(e)}(Gg(Error)),cde=sf.default=B9});var Yg=D(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.enableDebugLog=q9;af.log=M9;var SS=!1;function q9(){SS=!0}function M9(t){SS&&console.log(t)}});var FS=D(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.default=void 0;function xu(t){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xu(t)}function U9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,H9(n.key),n)}}function V9(t,e,r){return e&&xS(t.prototype,e),r&&xS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function H9(t){var e=z9(t,"string");return xu(e)=="symbol"?e:e+""}function z9(t,e){if(xu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var dde=uf.default=function(){function t(){U9(this,t)}return V9(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}()});var OS=D((Jg,Xg)=>{(function(t,e){typeof Jg=="object"&&typeof Xg<"u"?Xg.exports=e():typeof define=="function"&&define.amd?define(e):function(){var r=t.Base64,n=e();n.noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n}()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Jg,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(o),a=function(T){var N={};return T.forEach(function(oe,se){return N[oe]=se}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),l=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(T){return new Uint8Array(Array.prototype.slice.call(T,0))},f=function(T){return T.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(T){return T.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(T){for(var N,oe,se,ve,pn="",bp=T.length%3,tl=0;tl<T.length;){if((oe=T.charCodeAt(tl++))>255||(se=T.charCodeAt(tl++))>255||(ve=T.charCodeAt(tl++))>255)throw new TypeError("invalid character found");N=oe<<16|se<<8|ve,pn+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return bp?pn.slice(0,bp-3)+"===".substring(bp):pn},p=typeof btoa=="function"?function(T){return btoa(T)}:r?function(T){return Buffer.from(T,"binary").toString("base64")}:d,v=r?function(T){return Buffer.from(T).toString("base64")}:function(T){for(var N=4096,oe=[],se=0,ve=T.length;se<ve;se+=N)oe.push(c.apply(null,T.subarray(se,se+N)));return p(oe.join(""))},g=function(T,N){return N===void 0&&(N=!1),N?f(v(T)):v(T)},w=function(T){if(T.length<2){var N=T.charCodeAt(0);return N<128?T:N<2048?c(192|N>>>6)+c(128|N&63):c(224|N>>>12&15)+c(128|N>>>6&63)+c(128|N&63)}else{var N=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return c(240|N>>>18&7)+c(128|N>>>12&63)+c(128|N>>>6&63)+c(128|N&63)}},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,y=function(T){return T.replace(x,w)},C=r?function(T){return Buffer.from(T,"utf8").toString("base64")}:i?function(T){return v(i.encode(T))}:function(T){return p(y(T))},k=function(T,N){return N===void 0&&(N=!1),N?f(C(T)):C(T)},$=function(T){return k(T,!0)},F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(T){switch(T.length){case 4:var N=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),oe=N-65536;return c((oe>>>10)+55296)+c((oe&1023)+56320);case 3:return c((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return c((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},S=function(T){return T.replace(F,L)},I=function(T){if(T=T.replace(/\s+/g,""),!u.test(T))throw new TypeError("malformed base64.");T+="==".slice(2-(T.length&3));for(var N,oe="",se,ve,pn=0;pn<T.length;)N=a[T.charAt(pn++)]<<18|a[T.charAt(pn++)]<<12|(se=a[T.charAt(pn++)])<<6|(ve=a[T.charAt(pn++)]),oe+=se===64?c(N>>16&255):ve===64?c(N>>16&255,N>>8&255):c(N>>16&255,N>>8&255,N&255);return oe},R=typeof atob=="function"?function(T){return atob(h(T))}:r?function(T){return Buffer.from(T,"base64").toString("binary")}:I,B=r?function(T){return l(Buffer.from(T,"base64"))}:function(T){return l(R(T).split("").map(function(N){return N.charCodeAt(0)}))},q=function(T){return B(M(T))},K=r?function(T){return Buffer.from(T,"base64").toString("utf8")}:n?function(T){return n.decode(B(T))}:function(T){return S(R(T))},M=function(T){return h(T.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(T){return K(M(T))},b=function(T){if(typeof T!="string")return!1;var N=T.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},_=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}},O=function(){var T=function(N,oe){return Object.defineProperty(String.prototype,N,_(oe))};T("fromBase64",function(){return E(this)}),T("toBase64",function(N){return k(this,N)}),T("toBase64URI",function(){return k(this,!0)}),T("toBase64URL",function(){return k(this,!0)}),T("toUint8Array",function(){return q(this)})},j=function(){var T=function(N,oe){return Object.defineProperty(Uint8Array.prototype,N,_(oe))};T("toBase64",function(N){return g(this,N)}),T("toBase64URI",function(){return g(this,!0)}),T("toBase64URL",function(){return g(this,!0)})},P=function(){O(),j()},U={version:t,VERSION:e,atob:R,atobPolyfill:I,btoa:p,btoaPolyfill:d,fromBase64:E,toBase64:k,encode:k,encodeURI:$,encodeURL:$,utob:y,btou:S,decode:E,isValid:b,fromUint8Array:g,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:P};return U.Base64={},Object.keys(U).forEach(function(T){return U.Base64[T]=U[T]}),U})});var kS=D((pde,AS)=>{"use strict";AS.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var RS=D(Zg=>{"use strict";var G9=Object.prototype.hasOwnProperty,W9;function TS(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function PS(t){try{return encodeURIComponent(t)}catch{return null}}function K9(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=TS(n[1]),o=TS(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function Y9(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(G9.call(t,i)){if(n=t[i],!n&&(n===null||n===W9||isNaN(n))&&(n=""),i=PS(i),n=PS(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Zg.stringify=Y9;Zg.parse=K9});var MS=D((gde,qS)=>{"use strict";var IS=kS(),cf=RS(),J9=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,jS=/[\n\r\t]/g,X9=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,NS=/:\d+$/,Z9=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,Q9=/^[a-zA-Z]:/;function ey(t){return(t||"").toString().replace(J9,"")}var Qg=[["#","hash"],["?","query"],function(e,r){return Gr(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],$S={hash:1,query:1};function LS(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,o;if(t.protocol==="blob:")n=new Wr(unescape(t.pathname),{});else if(i==="string"){n=new Wr(t,{});for(o in $S)delete n[o]}else if(i==="object"){for(o in t)o in $S||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=X9.test(t.href))}return n}function Gr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function BS(t,e){t=ey(t),t=t.replace(jS,""),e=e||{};var r=Z9.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],o=!!r[3],s=0,a;return i?o?(a=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(a=r[2]+r[4],s=r[2].length):o?(a=r[3]+r[4],s=r[3].length):a=r[4],n==="file:"?s>=2&&(a=a.slice(2)):Gr(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Gr(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Gr(n),slashesCount:s,rest:a}}function e7(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Wr(t,e,r){if(t=ey(t),t=t.replace(jS,""),!(this instanceof Wr))return new Wr(t,e,r);var n,i,o,s,a,u,c=Qg.slice(),l=typeof e,f=this,h=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=cf.parse),e=LS(e),i=BS(t||"",e),n=!i.protocol&&!i.slashes,f.slashes=i.slashes||n&&e.slashes,f.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||Q9.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Gr(f.protocol)))&&(c[3]=[/(.*)/,"pathname"]);h<c.length;h++){if(s=c[h],typeof s=="function"){t=s(t,f);continue}o=s[0],u=s[1],o!==o?f[u]=t:typeof o=="string"?(a=o==="@"?t.lastIndexOf(o):t.indexOf(o),~a&&(typeof s[2]=="number"?(f[u]=t.slice(0,a),t=t.slice(a+s[2])):(f[u]=t.slice(a),t=t.slice(0,a)))):(a=o.exec(t))&&(f[u]=a[1],t=t.slice(0,a.index)),f[u]=f[u]||n&&s[3]&&e[u]||"",s[4]&&(f[u]=f[u].toLowerCase())}r&&(f.query=r(f.query)),n&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=e7(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Gr(f.protocol)&&(f.pathname="/"+f.pathname),IS(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(a=f.auth.indexOf(":"),~a?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Gr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function t7(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||cf.parse)(e)),n[t]=e;break;case"port":n[t]=e,IS(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,NS.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==i?i+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var o=e.indexOf(":");~o?(n.username=e.slice(0,o),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(o+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var s=0;s<Qg.length;s++){var a=Qg[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Gr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function r7(t){(!t||typeof t!="function")&&(t=cf.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var o=i+(r.protocol&&r.slashes||Gr(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Gr(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||NS.test(r.hostname)&&!r.port)&&(n+=":"),o+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(o+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(o+=r.hash),o}Wr.prototype={set:t7,toString:r7};Wr.extractProtocol=BS;Wr.location=LS;Wr.trimLeft=ey;Wr.qs=cf;qS.exports=Wr});var US=D(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.default=n7;function n7(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}});var n1=D(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.default=void 0;var i7=OS(),o7=oy(MS()),lf=oy(Kg()),Li=Yg(),s7=oy(US());function oy(t){return t&&t.__esModule?t:{default:t}}function ry(){"use strict";ry=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function y(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=y.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Bi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Bi(E)+" is not iterable")}return x.prototype=y,i(F,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:x,configurable:!0}),x.displayName=c(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,y):(E.__proto__=y,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function VS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function a7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){VS(o,n,i,s,a,"next",u)}function a(u){VS(o,n,i,s,a,"throw",u)}s(void 0)})}}function ZS(t,e){return l7(t)||c7(t,e)||QS(t,e)||u7()}function u7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c7(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function l7(t){if(Array.isArray(t))return t}function Bi(t){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(t)}function f7(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=QS(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function QS(t,e){if(t){if(typeof t=="string")return HS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return HS(t,e)}}function HS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function zS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function fs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zS(Object(r),!0).forEach(function(n){d7(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function d7(t,e,r){return e=e1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,e1(n.key),n)}}function p7(t,e,r){return e&&GS(t.prototype,e),r&&GS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function e1(t){var e=m7(t,"string");return Bi(e)=="symbol"?e:e+""}function m7(t,e){if(Bi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ny="tus-v1",ff="ietf-draft-03",g7={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:r1,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:ny},t1=function(){function t(e,r){h7(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return p7(t,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![ny,ff].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var o=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];o<s.length;o++){var a=s[o];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,Li.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Li.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,o=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:D7(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(l,f){l.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(l,f){var h=0;return n._source.slice(l.start,l.end).then(function(d){var p=d.value;return new Promise(function(v,g){var w=fs(fs({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:fs(fs({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:v,onError:g,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=x.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),x=new t(p,w);x.start(),n._parallelUploads.push(x)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=WS(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!ds(l.getStatus(),200)){n._emitHttpError(c,l,"tus: unexpected response while creating upload");return}var f=l.getHeader("Location");if(f==null){n._emitHttpError(c,l,"tus: invalid or missing Location header");return}n.url=XS(n.options.endpoint,f),(0,Li.log)("Created upload at ".concat(n.url)),n._emitSuccess(l)}).catch(function(l){n._emitError(l)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Li.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Li.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Li.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=f7(this._parallelUploads),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.abort(r)}}catch(a){i.e(a)}finally{i.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,i,o){this._emitError(new lf.default(i,o,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),JS(r,this._retryAttempt,this.options)){var o=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},o);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,i){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,i)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var i=WS(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var o;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,o=this._addChunkToRequest(n)):(this.options.protocol===ff&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!ds(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while creating upload");return}var a=s.getHeader("Location");if(a==null){r._emitHttpError(n,s,"tus: invalid or missing Location header");return}if(r.url=XS(r.options.endpoint,a),(0,Li.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(o){var s=o.getStatus();if(!ds(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(ds(s,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,o,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var a=Number.parseInt(o.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){r._emitHttpError(n,o,"tus: invalid or missing offset value");return}var u=Number.parseInt(o.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===ny){r._emitHttpError(n,o,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(a===u){r._emitProgress(u,u),r._emitSuccess(o);return}r._offset=a,r._performUpload()})}).catch(function(o){r._emitHttpError(n,null,"tus: failed to resume upload",o)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var i=this._addChunkToRequest(n);i.then(function(o){if(!ds(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,o)}).catch(function(o){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),o)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,o=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(i+s,n._size)}),r.setHeader("Content-Type","application/offset+octet-stream"),(o===Number.POSITIVE_INFINITY||o>this._size)&&!this.options.uploadLengthDeferred&&(o=this._size),this._source.slice(i,o).then(function(s){var a=s.value,u=s.done,c=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+c,r.setHeader("Upload-Length","".concat(n._size)));var l=n._offset+c;return!n.options.uploadLengthDeferred&&u&&l!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(l," bytes"))):a===null?n._sendRequest(r):(n.options.protocol===ff&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=KS(r,n,this.options);return this._req=i,i}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(i){r._urlStorageKey=i})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return YS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=KS("DELETE",r,n);return YS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new lf.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof lf.default||(o=new lf.default("tus: failed to terminate upload",o,i,null)),!JS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=fs(fs({},n),{},{retryDelays:a});return new Promise(function(c){return setTimeout(c,s)}).then(function(){return t.terminate(r,u)})})}}])}();function WS(t){return Object.entries(t).map(function(e){var r=ZS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(i7.Base64.encode(String(i)))}).join(",")}function ds(t,e){return t>=e&&t<e+100}function KS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===ff?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=ZS(s[o],2),u=a[0],c=a[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,s7.default)();n.setHeader("X-Request-ID",l)}return n}function YS(t,e,r){return iy.apply(this,arguments)}function iy(){return iy=a7(ry().mark(function t(e,r,n){var i;return ry().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(typeof n.onBeforeRequest!="function"){s.next=3;break}return s.next=3,n.onBeforeRequest(e);case 3:return s.next=5,e.send(r);case 5:if(i=s.sent,typeof n.onAfterResponse!="function"){s.next=9;break}return s.next=9,n.onAfterResponse(e,i);case 9:return s.abrupt("return",i);case 10:case"end":return s.stop()}},t)})),iy.apply(this,arguments)}function y7(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function JS(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):r1(t)}function r1(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!ds(e,400)||e===409||e===423)&&y7()}function XS(t,e){return new o7.default(e,t).toString()}function D7(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}t1.defaultOptions=g7;var Dde=df.default=t1});var o1=D((bde,i1)=>{"use strict";var Kr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Kr.writable=t=>Kr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Kr.readable=t=>Kr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Kr.duplex=t=>Kr.writable(t)&&Kr.readable(t);Kr.transform=t=>Kr.duplex(t)&&typeof t._transform=="function";i1.exports=Kr});var a1=D(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.default=void 0;function Fu(t){"@babel/helpers - typeof";return Fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(t)}function v7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,w7(n.key),n)}}function b7(t,e,r){return e&&s1(t.prototype,e),r&&s1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function w7(t){var e=_7(t,"string");return Fu(e)=="symbol"?e:e+""}function _7(t,e){if(Fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var wde=hf.default=function(){function t(e){v7(this,t),this._buffer=e,this.size=e.length}return b7(t,[{key:"slice",value:function(r,n){var i=this._buffer.slice(r,n);i.size=i.length;var o=n>=this.size;return Promise.resolve({value:i,done:o})}},{key:"close",value:function(){}}])}()});var f1=D(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});uy.default=O7;var l1=require("fs");function qi(t){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qi(t)}function sy(){"use strict";sy=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function y(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=y.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&qi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(qi(E)+" is not iterable")}return x.prototype=y,i(F,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:x,configurable:!0}),x.displayName=c(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,y):(E.__proto__=y,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function E7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,S7(n.key),n)}}function C7(t,e,r){return e&&u1(t.prototype,e),r&&u1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function S7(t){var e=x7(t,"string");return qi(e)=="symbol"?e:e+""}function x7(t,e){if(qi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function c1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function F7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){c1(o,n,i,s,a,"next",u)}function a(u){c1(o,n,i,s,a,"throw",u)}s(void 0)})}}function O7(t){return ay.apply(this,arguments)}function ay(){return ay=F7(sy().mark(function t(e){var r,n,i,o,s,a,u;return sy().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,l1.promises.stat(n);case 3:return i=l.sent,o=i.size,s=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:o,u=a-s,l.abrupt("return",new A7(e,n,u));case 9:case"end":return l.stop()}},t)})),ay.apply(this,arguments)}var A7=function(){function t(e,r,n){E7(this,t),this._stream=e,this._path=r,this.size=n}return C7(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,l1.createReadStream)(this._path,{start:o+r,end:o+n-1,autoClose:!0});s.size=Math.min(n-r,this.size);var a=s.size>=this.size;return Promise.resolve({value:s,done:a})}},{key:"close",value:function(){this._stream.destroy()}}])}()});var ly=D(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.default=void 0;function Mi(t){"@babel/helpers - typeof";return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(t)}function Ou(){"use strict";Ou=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function y(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=y.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Mi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Mi(E)+" is not iterable")}return x.prototype=y,i(F,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:x,configurable:!0}),x.displayName=c(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,y):(E.__proto__=y,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function k7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,P7(n.key),n)}}function T7(t,e,r){return e&&d1(t.prototype,e),r&&d1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function P7(t){var e=R7(t,"string");return Mi(e)=="symbol"?e:e+""}function R7(t,e){if(Mi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function h1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function p1(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){h1(o,n,i,s,a,"next",u)}function a(u){h1(o,n,i,s,a,"throw",u)}s(void 0)})}}function $7(t,e){return cy.apply(this,arguments)}function cy(){return cy=p1(Ou().mark(function t(e,r){return Ou().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(l){e.off("readable",u),s(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",a),e.off("readable",c),o(l))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),cy.apply(this,arguments)}var Cde=pf.default=function(){function t(e){var r=this;k7(this,t),this._stream=e,this.size=null,this._buf=Buffer.alloc(0),this._bufPos=0,this._ended=!1,this._error=null,e.pause(),e.on("end",function(){r._ended=!0}),e.on("error",function(n){r._error=n})}return T7(t,[{key:"slice",value:function(){var e=p1(Ou().mark(function n(i,o){var s,a,u,c,l;return Ou().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i<this._bufPos)){h.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){h.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){h.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,o-this._bufPos),s=this._buf.slice(a,u)):s=Buffer.alloc(0),!this._ended){h.next=10;break}return s.size=s.length,h.abrupt("return",{value:s,done:!0});case 10:if(c=o-i,!(c>s.length)){h.next=16;break}return h.next=14,$7(this._stream,c-s.length);case 14:l=h.sent,s=Buffer.concat([s,l]);case 16:return this._buf=s,this._bufPos=i,s.size=s.length,h.abrupt("return",{value:s,done:this._ended});case 20:case"end":return h.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var g1=D(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.default=void 0;var I7=require("fs"),j7=mf(o1()),N7=mf(a1()),L7=mf(f1()),B7=mf(ly());function mf(t){return t&&t.__esModule?t:{default:t}}function Au(t){"@babel/helpers - typeof";return Au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Au(t)}function q7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,U7(n.key),n)}}function M7(t,e,r){return e&&m1(t.prototype,e),r&&m1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function U7(t){var e=V7(t,"string");return Au(e)=="symbol"?e:e+""}function V7(t,e){if(Au(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Au(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var xde=gf.default=function(){function t(){q7(this,t)}return M7(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new N7.default(r)):r instanceof I7.ReadStream&&r.path!=null?(0,L7.default)(r):j7.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new B7.default(r)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"))):Promise.reject(new Error("source object may only be an instance of Buffer or Readable in this environment"))}}])}()});var b1=D(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.default=G7;var H7=require("crypto"),y1=v1(require("fs")),z7=v1(require("path"));function D1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(D1=function(n){return n?r:e})(t)}function v1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=D1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function G7(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,H7.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof y1.ReadStream&&t.path!=null?new Promise(function(s,a){var u=z7.resolve(t.path);y1.stat(t.path,function(c,l){if(c){a(c);return}var f=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var S1=D((Ade,C1)=>{var E1="Expected a function",w1=NaN,W7="[object Symbol]",K7=/^\s+|\s+$/g,Y7=/^[-+]0x[0-9a-f]+$/i,J7=/^0b[01]+$/i,X7=/^0o[0-7]+$/i,Z7=parseInt,Q7=typeof global=="object"&&global&&global.Object===Object&&global,eV=typeof self=="object"&&self&&self.Object===Object&&self,tV=Q7||eV||Function("return this")(),rV=Object.prototype,nV=rV.toString,iV=Math.max,oV=Math.min,dy=function(){return tV.Date.now()};function sV(t,e,r){var n,i,o,s,a,u,c=0,l=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(E1);e=_1(e)||0,yf(r)&&(l=!!r.leading,f="maxWait"in r,o=f?iV(_1(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d($){var F=n,L=i;return n=i=void 0,c=$,s=t.apply(L,F),s}function p($){return c=$,a=setTimeout(w,e),l?d($):s}function v($){var F=$-u,L=$-c,S=e-F;return f?oV(S,o-L):S}function g($){var F=$-u,L=$-c;return u===void 0||F>=e||F<0||f&&L>=o}function w(){var $=dy();if(g($))return x($);a=setTimeout(w,v($))}function x($){return a=void 0,h&&n?d($):(n=i=void 0,s)}function y(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function C(){return a===void 0?s:x(dy())}function k(){var $=dy(),F=g($);if(n=arguments,i=this,u=$,F){if(a===void 0)return p(u);if(f)return a=setTimeout(w,e),d(u)}return a===void 0&&(a=setTimeout(w,e)),s}return k.cancel=y,k.flush=C,k}function aV(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(E1);return yf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),sV(t,e,{leading:n,maxWait:e,trailing:i})}function yf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function uV(t){return!!t&&typeof t=="object"}function cV(t){return typeof t=="symbol"||uV(t)&&nV.call(t)==W7}function _1(t){if(typeof t=="number")return t;if(cV(t))return w1;if(yf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=yf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(K7,"");var r=J7.test(t);return r||X7.test(t)?Z7(t.slice(2),r?2:8):Y7.test(t)?w1:+t}C1.exports=aV});var $1=D(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.default=void 0;var lV=T1(require("http")),fV=T1(require("https")),O1=require("stream"),dV=require("url"),A1=hV(S1());function hV(t){return t&&t.__esModule?t:{default:t}}function k1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(k1=function(n){return n?r:e})(t)}function T1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=k1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function pV(t,e,r){return e=Df(e),mV(t,P1()?Reflect.construct(e,r||[],Df(t).constructor):e.apply(t,r))}function mV(t,e){if(e&&(hs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gV(t)}function gV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P1=function(){return!!t})()}function Df(t){return Df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Df(t)}function yV(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hy(t,e)}function hy(t,e){return hy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hy(t,e)}function x1(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ku(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?x1(Object(r),!0).forEach(function(n){DV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x1(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function DV(t,e,r){return e=R1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hs(t){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hs(t)}function vf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R1(n.key),n)}}function bf(t,e,r){return e&&F1(t.prototype,e),r&&F1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R1(t){var e=vV(t,"string");return hs(e)=="symbol"?e:e+""}function vV(t,e){if(hs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(hs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var kde=wf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vf(this,t),this._requestOptions=e}return bf(t,[{key:"createRequest",value:function(r,n){return new bV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),bV=function(){function t(e,r,n){vf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return bf(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){this._progressHandler=r}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(i,o){var s=ku(ku(ku({},(0,dV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:ku(ku({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?fV:lV;r._request=a.request(s);var u=r._request;u.on("response",function(c){var l=[];c.on("data",function(f){l.push(f)}),c.on("end",function(){var f=Buffer.concat(l).toString("utf8");i(new wV(c,f))})}),u.on("error",function(c){o(c)}),n instanceof O1.Readable?n.pipe(new _V(r._progressHandler)).pipe(u):n instanceof Uint8Array?EV(u,n,r._progressHandler):u.end(n)})}},{key:"abort",value:function(){return this._request!==null&&this._request.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._request}}])}(),wV=function(){function t(e,r){vf(this,t),this._response=e,this._body=r}return bf(t,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(r){return this._response.headers[r.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])}(),_V=function(t){function e(r){var n;return vf(this,e),n=pV(this,e),n._onprogress=(0,A1.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return yV(e,t),bf(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(O1.Transform),EV=function(e,r,n){n=(0,A1.default)(n,100,{leading:!0,trailing:!1});var i=0;function o(){var s=Math.min(e.writableHighWaterMark,r.length-i),a=r.subarray(i,i+s);i+=a.length;var u=e.write(a);u?i<r.length?o():e.end():(e.once("drain",o),n(i))}o()}});var I1=D(py=>{"use strict";py.expectReceive=function(t,e,r){var n;r.root(t,e,r),n=this.message,t.hasOwnProperty("expected")&&(n+=" Expected "+t.expected+"."),t.hasOwnProperty("received")&&(n+=" Received: "+t.received+"."),this.message=n};py.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
30
+ `,e=e.substr(s)}try{o=JSON.parse(e)}catch{return zr.red("Error:")+" Not valid JSON!"}return i+=Eu.render(o,r,n),i}});var Kg=D(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.default=void 0;function ls(t){"@babel/helpers - typeof";return ls=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ls(t)}function CS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,T9(n.key),n)}}function k9(t,e,r){return e&&CS(t.prototype,e),r&&CS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function T9(t){var e=P9(t,"string");return ls(e)=="symbol"?e:e+""}function P9(t,e){if(ls(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ls(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function R9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $9(t,e,r){return e=Su(e),I9(t,Wg()?Reflect.construct(e,r||[],Su(t).constructor):e.apply(t,r))}function I9(t,e){if(e&&(ls(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j9(t)}function j9(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function N9(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Cu(t,e)}function Gg(t){var e=typeof Map=="function"?new Map:void 0;return Gg=function(n){if(n===null||!B9(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return L9(n,arguments,Su(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Cu(i,n)},Gg(t)}function L9(t,e,r){if(Wg())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Cu(i,r.prototype),i}function Wg(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Wg=function(){return!!t})()}function B9(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Cu(t,e){return Cu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Cu(t,e)}function Su(t){return Su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Su(t)}var q9=function(t){function e(r){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(R9(this,e),n=$9(this,e,[r]),n.originalRequest=o,n.originalResponse=s,n.causingError=i,i!=null&&(r+=", caused by ".concat(i.toString())),o!=null){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),c=o.getURL(),l=s?s.getStatus():"n/a",f=s?s.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(f,", request id: ").concat(a,")")}return n.message=r,n}return N9(e,t),k9(e)}(Gg(Error)),lde=sf.default=q9});var Yg=D(af=>{"use strict";Object.defineProperty(af,"__esModule",{value:!0});af.enableDebugLog=M9;af.log=U9;var SS=!1;function M9(){SS=!0}function U9(t){SS&&console.log(t)}});var FS=D(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});uf.default=void 0;function xu(t){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xu(t)}function V9(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,z9(n.key),n)}}function H9(t,e,r){return e&&xS(t.prototype,e),r&&xS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function z9(t){var e=G9(t,"string");return xu(e)=="symbol"?e:e+""}function G9(t,e){if(xu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(xu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var hde=uf.default=function(){function t(){V9(this,t)}return H9(t,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}()});var OS=D((Jg,Xg)=>{(function(t,e){typeof Jg=="object"&&typeof Xg<"u"?Xg.exports=e():typeof define=="function"&&define.amd?define(e):function(){var r=t.Base64,n=e();n.noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n}()})(typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Jg,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,i=typeof TextEncoder=="function"?new TextEncoder:void 0,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(o),a=function(T){var N={};return T.forEach(function(oe,se){return N[oe]=se}),N}(s),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),l=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(T){return new Uint8Array(Array.prototype.slice.call(T,0))},f=function(T){return T.replace(/=/g,"").replace(/[+\/]/g,function(N){return N=="+"?"-":"_"})},h=function(T){return T.replace(/[^A-Za-z0-9\+\/]/g,"")},d=function(T){for(var N,oe,se,ve,pn="",bp=T.length%3,tl=0;tl<T.length;){if((oe=T.charCodeAt(tl++))>255||(se=T.charCodeAt(tl++))>255||(ve=T.charCodeAt(tl++))>255)throw new TypeError("invalid character found");N=oe<<16|se<<8|ve,pn+=s[N>>18&63]+s[N>>12&63]+s[N>>6&63]+s[N&63]}return bp?pn.slice(0,bp-3)+"===".substring(bp):pn},p=typeof btoa=="function"?function(T){return btoa(T)}:r?function(T){return Buffer.from(T,"binary").toString("base64")}:d,v=r?function(T){return Buffer.from(T).toString("base64")}:function(T){for(var N=4096,oe=[],se=0,ve=T.length;se<ve;se+=N)oe.push(c.apply(null,T.subarray(se,se+N)));return p(oe.join(""))},g=function(T,N){return N===void 0&&(N=!1),N?f(v(T)):v(T)},w=function(T){if(T.length<2){var N=T.charCodeAt(0);return N<128?T:N<2048?c(192|N>>>6)+c(128|N&63):c(224|N>>>12&15)+c(128|N>>>6&63)+c(128|N&63)}else{var N=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return c(240|N>>>18&7)+c(128|N>>>12&63)+c(128|N>>>6&63)+c(128|N&63)}},x=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,y=function(T){return T.replace(x,w)},C=r?function(T){return Buffer.from(T,"utf8").toString("base64")}:i?function(T){return v(i.encode(T))}:function(T){return p(y(T))},k=function(T,N){return N===void 0&&(N=!1),N?f(C(T)):C(T)},$=function(T){return k(T,!0)},F=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=function(T){switch(T.length){case 4:var N=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),oe=N-65536;return c((oe>>>10)+55296)+c((oe&1023)+56320);case 3:return c((15&T.charCodeAt(0))<<12|(63&T.charCodeAt(1))<<6|63&T.charCodeAt(2));default:return c((31&T.charCodeAt(0))<<6|63&T.charCodeAt(1))}},S=function(T){return T.replace(F,L)},I=function(T){if(T=T.replace(/\s+/g,""),!u.test(T))throw new TypeError("malformed base64.");T+="==".slice(2-(T.length&3));for(var N,oe="",se,ve,pn=0;pn<T.length;)N=a[T.charAt(pn++)]<<18|a[T.charAt(pn++)]<<12|(se=a[T.charAt(pn++)])<<6|(ve=a[T.charAt(pn++)]),oe+=se===64?c(N>>16&255):ve===64?c(N>>16&255,N>>8&255):c(N>>16&255,N>>8&255,N&255);return oe},R=typeof atob=="function"?function(T){return atob(h(T))}:r?function(T){return Buffer.from(T,"base64").toString("binary")}:I,B=r?function(T){return l(Buffer.from(T,"base64"))}:function(T){return l(R(T).split("").map(function(N){return N.charCodeAt(0)}))},q=function(T){return B(M(T))},K=r?function(T){return Buffer.from(T,"base64").toString("utf8")}:n?function(T){return n.decode(B(T))}:function(T){return S(R(T))},M=function(T){return h(T.replace(/[-_]/g,function(N){return N=="-"?"+":"/"}))},E=function(T){return K(M(T))},b=function(T){if(typeof T!="string")return!1;var N=T.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(N)||!/[^\s0-9a-zA-Z\-_]/.test(N)},_=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}},O=function(){var T=function(N,oe){return Object.defineProperty(String.prototype,N,_(oe))};T("fromBase64",function(){return E(this)}),T("toBase64",function(N){return k(this,N)}),T("toBase64URI",function(){return k(this,!0)}),T("toBase64URL",function(){return k(this,!0)}),T("toUint8Array",function(){return q(this)})},j=function(){var T=function(N,oe){return Object.defineProperty(Uint8Array.prototype,N,_(oe))};T("toBase64",function(N){return g(this,N)}),T("toBase64URI",function(){return g(this,!0)}),T("toBase64URL",function(){return g(this,!0)})},P=function(){O(),j()},U={version:t,VERSION:e,atob:R,atobPolyfill:I,btoa:p,btoaPolyfill:d,fromBase64:E,toBase64:k,encode:k,encodeURI:$,encodeURL:$,utob:y,btou:S,decode:E,isValid:b,fromUint8Array:g,toUint8Array:q,extendString:O,extendUint8Array:j,extendBuiltins:P};return U.Base64={},Object.keys(U).forEach(function(T){return U.Base64[T]=U[T]}),U})});var kS=D((mde,AS)=>{"use strict";AS.exports=function(e,r){if(r=r.split(":")[0],e=+e,!e)return!1;switch(r){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var RS=D(Zg=>{"use strict";var W9=Object.prototype.hasOwnProperty,K9;function TS(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function PS(t){try{return encodeURIComponent(t)}catch{return null}}function Y9(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var i=TS(n[1]),o=TS(n[2]);i===null||o===null||i in r||(r[i]=o)}return r}function J9(t,e){e=e||"";var r=[],n,i;typeof e!="string"&&(e="?");for(i in t)if(W9.call(t,i)){if(n=t[i],!n&&(n===null||n===K9||isNaN(n))&&(n=""),i=PS(i),n=PS(n),i===null||n===null)continue;r.push(i+"="+n)}return r.length?e+r.join("&"):""}Zg.stringify=J9;Zg.parse=Y9});var MS=D((yde,qS)=>{"use strict";var IS=kS(),cf=RS(),X9=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,jS=/[\n\r\t]/g,Z9=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,NS=/:\d+$/,Q9=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,e7=/^[a-zA-Z]:/;function ey(t){return(t||"").toString().replace(X9,"")}var Qg=[["#","hash"],["?","query"],function(e,r){return Gr(r.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],$S={hash:1,query:1};function LS(t){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var r=e.location||{};t=t||r;var n={},i=typeof t,o;if(t.protocol==="blob:")n=new Wr(unescape(t.pathname),{});else if(i==="string"){n=new Wr(t,{});for(o in $S)delete n[o]}else if(i==="object"){for(o in t)o in $S||(n[o]=t[o]);n.slashes===void 0&&(n.slashes=Z9.test(t.href))}return n}function Gr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function BS(t,e){t=ey(t),t=t.replace(jS,""),e=e||{};var r=Q9.exec(t),n=r[1]?r[1].toLowerCase():"",i=!!r[2],o=!!r[3],s=0,a;return i?o?(a=r[2]+r[3]+r[4],s=r[2].length+r[3].length):(a=r[2]+r[4],s=r[2].length):o?(a=r[3]+r[4],s=r[3].length):a=r[4],n==="file:"?s>=2&&(a=a.slice(2)):Gr(n)?a=r[4]:n?i&&(a=a.slice(2)):s>=2&&Gr(e.protocol)&&(a=r[4]),{protocol:n,slashes:i||Gr(n),slashesCount:s,rest:a}}function t7(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,i=r[n-1],o=!1,s=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),s++):s&&(n===0&&(o=!0),r.splice(n,1),s--);return o&&r.unshift(""),(i==="."||i==="..")&&r.push(""),r.join("/")}function Wr(t,e,r){if(t=ey(t),t=t.replace(jS,""),!(this instanceof Wr))return new Wr(t,e,r);var n,i,o,s,a,u,c=Qg.slice(),l=typeof e,f=this,h=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=cf.parse),e=LS(e),i=BS(t||"",e),n=!i.protocol&&!i.slashes,f.slashes=i.slashes||n&&e.slashes,f.protocol=i.protocol||e.protocol||"",t=i.rest,(i.protocol==="file:"&&(i.slashesCount!==2||e7.test(t))||!i.slashes&&(i.protocol||i.slashesCount<2||!Gr(f.protocol)))&&(c[3]=[/(.*)/,"pathname"]);h<c.length;h++){if(s=c[h],typeof s=="function"){t=s(t,f);continue}o=s[0],u=s[1],o!==o?f[u]=t:typeof o=="string"?(a=o==="@"?t.lastIndexOf(o):t.indexOf(o),~a&&(typeof s[2]=="number"?(f[u]=t.slice(0,a),t=t.slice(a+s[2])):(f[u]=t.slice(a),t=t.slice(0,a)))):(a=o.exec(t))&&(f[u]=a[1],t=t.slice(0,a.index)),f[u]=f[u]||n&&s[3]&&e[u]||"",s[4]&&(f[u]=f[u].toLowerCase())}r&&(f.query=r(f.query)),n&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=t7(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Gr(f.protocol)&&(f.pathname="/"+f.pathname),IS(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(a=f.auth.indexOf(":"),~a?(f.username=f.auth.slice(0,a),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(a+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Gr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function r7(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||cf.parse)(e)),n[t]=e;break;case"port":n[t]=e,IS(e,n.protocol)?e&&(n.host=n.hostname+":"+e):(n.host=n.hostname,n[t]="");break;case"hostname":n[t]=e,n.port&&(e+=":"+n.port),n.host=e;break;case"host":n[t]=e,NS.test(e)?(e=e.split(":"),n.port=e.pop(),n.hostname=e.join(":")):(n.hostname=e,n.port="");break;case"protocol":n.protocol=e.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(e){var i=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==i?i+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var o=e.indexOf(":");~o?(n.username=e.slice(0,o),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(o+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var s=0;s<Qg.length;s++){var a=Qg[s];a[4]&&(n[a[1]]=n[a[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Gr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function n7(t){(!t||typeof t!="function")&&(t=cf.stringify);var e,r=this,n=r.host,i=r.protocol;i&&i.charAt(i.length-1)!==":"&&(i+=":");var o=i+(r.protocol&&r.slashes||Gr(r.protocol)?"//":"");return r.username?(o+=r.username,r.password&&(o+=":"+r.password),o+="@"):r.password?(o+=":"+r.password,o+="@"):r.protocol!=="file:"&&Gr(r.protocol)&&!n&&r.pathname!=="/"&&(o+="@"),(n[n.length-1]===":"||NS.test(r.hostname)&&!r.port)&&(n+=":"),o+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(o+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(o+=r.hash),o}Wr.prototype={set:r7,toString:n7};Wr.extractProtocol=BS;Wr.location=LS;Wr.trimLeft=ey;Wr.qs=cf;qS.exports=Wr});var US=D(ty=>{"use strict";Object.defineProperty(ty,"__esModule",{value:!0});ty.default=i7;function i7(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=Math.random()*16|0,r=t==="x"?e:e&3|8;return r.toString(16)})}});var n1=D(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.default=void 0;var o7=OS(),s7=oy(MS()),lf=oy(Kg()),Li=Yg(),a7=oy(US());function oy(t){return t&&t.__esModule?t:{default:t}}function ry(){"use strict";ry=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function y(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=y.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Bi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Bi(E)+" is not iterable")}return x.prototype=y,i(F,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:x,configurable:!0}),x.displayName=c(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,y):(E.__proto__=y,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function VS(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function u7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){VS(o,n,i,s,a,"next",u)}function a(u){VS(o,n,i,s,a,"throw",u)}s(void 0)})}}function ZS(t,e){return f7(t)||l7(t,e)||QS(t,e)||c7()}function c7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
31
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l7(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,o,s,a=[],u=!0,c=!1;try{if(o=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);u=!0);}catch(l){c=!0,i=l}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}function f7(t){if(Array.isArray(t))return t}function Bi(t){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bi(t)}function d7(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=QS(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function QS(t,e){if(t){if(typeof t=="string")return HS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return HS(t,e)}}function HS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function zS(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function fs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zS(Object(r),!0).forEach(function(n){h7(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zS(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function h7(t,e,r){return e=e1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function GS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,e1(n.key),n)}}function m7(t,e,r){return e&&GS(t.prototype,e),r&&GS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function e1(t){var e=g7(t,"string");return Bi(e)=="symbol"?e:e+""}function g7(t,e){if(Bi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ny="tus-v1",ff="ietf-draft-03",y7={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:r1,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:ny},t1=function(){function t(e,r){p7(this,t),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return m7(t,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![ny,ff].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var i=this.options.retryDelays;if(i!=null&&Object.prototype.toString.call(i)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var o=0,s=["uploadUrl","uploadSize","uploadLengthDeferred"];o<s.length;o++){var a=s[o];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(u){return u==null?(0,Li.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Li.log)("Calculated fingerprint: ".concat(u)),r._fingerprint=u,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(u){if(r._source=u,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload()}).catch(function(u){r._emitError(u)})}},{key:"_startParallelUpload",value:function(){var r,n=this,i=this._size,o=0;this._parallelUploads=[];var s=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:v7(this._source.size,s);this._parallelUploadUrls&&a.forEach(function(l,f){l.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(a.length);var u=a.map(function(l,f){var h=0;return n._source.slice(l.start,l.end).then(function(d){var p=d.value;return new Promise(function(v,g){var w=fs(fs({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:fs(fs({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:v,onError:g,onProgress:function(C){o=o-h+C,h=C,n._emitProgress(o,i)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=x.url,n._parallelUploadUrls.filter(function(C){return!!C}).length===a.length&&n._saveUploadInUrlStorage()}}),x=new t(p,w);x.start(),n._parallelUploads.push(x)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=WS(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!ds(l.getStatus(),200)){n._emitHttpError(c,l,"tus: unexpected response while creating upload");return}var f=l.getHeader("Location");if(f==null){n._emitHttpError(c,l,"tus: invalid or missing Location header");return}n.url=XS(n.options.endpoint,f),(0,Li.log)("Created upload at ".concat(n.url)),n._emitSuccess(l)}).catch(function(l){n._emitError(l)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){(0,Li.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Li.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Li.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var i=d7(this._parallelUploads),o;try{for(i.s();!(o=i.n()).done;){var s=o.value;s.abort(r)}}catch(a){i.e(a)}finally{i.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():t.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,i,o){this._emitError(new lf.default(i,o,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var i=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(i&&(this._retryAttempt=0),JS(r,this._retryAttempt,this.options)){var o=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},o);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r})}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n)}},{key:"_emitChunkComplete",value:function(r,n,i){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,i)}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var i=WS(this.options.metadata);i!==""&&n.setHeader("Upload-Metadata",i);var o;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,o=this._addChunkToRequest(n)):(this.options.protocol===ff&&n.setHeader("Upload-Complete","?0"),o=this._sendRequest(n,null)),o.then(function(s){if(!ds(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while creating upload");return}var a=s.getHeader("Location");if(a==null){r._emitHttpError(n,s,"tus: invalid or missing Location header");return}if(r.url=XS(r.options.endpoint,a),(0,Li.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(s),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,s):(r._offset=0,r._performUpload())})}).catch(function(s){r._emitHttpError(n,null,"tus: failed to create upload",s)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),i=this._sendRequest(n,null);i.then(function(o){var s=o.getStatus();if(!ds(s,200)){if(s===423){r._emitHttpError(n,o,"tus: upload is currently locked; retry later");return}if(ds(s,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,o,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var a=Number.parseInt(o.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){r._emitHttpError(n,o,"tus: invalid or missing offset value");return}var u=Number.parseInt(o.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===ny){r._emitHttpError(n,o,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(a===u){r._emitProgress(u,u),r._emitSuccess(o);return}r._offset=a,r._performUpload()})}).catch(function(o){r._emitHttpError(n,null,"tus: failed to resume upload",o)})}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var i=this._addChunkToRequest(n);i.then(function(o){if(!ds(o.getStatus(),200)){r._emitHttpError(n,o,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,o)}).catch(function(o){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),o)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,i=this._offset,o=this._offset+this.options.chunkSize;return r.setProgressHandler(function(s){n._emitProgress(i+s,n._size)}),r.setHeader("Content-Type","application/offset+octet-stream"),(o===Number.POSITIVE_INFINITY||o>this._size)&&!this.options.uploadLengthDeferred&&(o=this._size),this._source.slice(i,o).then(function(s){var a=s.value,u=s.done,c=a!=null&&a.size?a.size:0;n.options.uploadLengthDeferred&&u&&(n._size=n._offset+c,r.setHeader("Upload-Length","".concat(n._size)));var l=n._offset+c;return!n.options.uploadLengthDeferred&&u&&l!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(l," bytes"))):a===null?n._sendRequest(r):(n.options.protocol===ff&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,a))})}},{key:"_handleUploadResponse",value:function(r,n){var i=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(i)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(i,this._size),this._emitChunkComplete(i-this._offset,i,this._size),this._offset=i,i===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var i=KS(r,n,this.options);return this._req=i,i}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(i){r._urlStorageKey=i})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return YS(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=KS("DELETE",r,n);return YS(i,null,n).then(function(o){if(o.getStatus()!==204)throw new lf.default("tus: unexpected response while terminating upload",null,i,o)}).catch(function(o){if(o instanceof lf.default||(o=new lf.default("tus: failed to terminate upload",o,i,null)),!JS(o,0,n))throw o;var s=n.retryDelays[0],a=n.retryDelays.slice(1),u=fs(fs({},n),{},{retryDelays:a});return new Promise(function(c){return setTimeout(c,s)}).then(function(){return t.terminate(r,u)})})}}])}();function WS(t){return Object.entries(t).map(function(e){var r=ZS(e,2),n=r[0],i=r[1];return"".concat(n," ").concat(o7.Base64.encode(String(i)))}).join(",")}function ds(t,e){return t>=e&&t<e+100}function KS(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===ff?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");for(var i=r.headers||{},o=0,s=Object.entries(i);o<s.length;o++){var a=ZS(s[o],2),u=a[0],c=a[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,a7.default)();n.setHeader("X-Request-ID",l)}return n}function YS(t,e,r){return iy.apply(this,arguments)}function iy(){return iy=u7(ry().mark(function t(e,r,n){var i;return ry().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(typeof n.onBeforeRequest!="function"){s.next=3;break}return s.next=3,n.onBeforeRequest(e);case 3:return s.next=5,e.send(r);case 5:if(i=s.sent,typeof n.onAfterResponse!="function"){s.next=9;break}return s.next=9,n.onAfterResponse(e,i);case 9:return s.abrupt("return",i);case 10:case"end":return s.stop()}},t)})),iy.apply(this,arguments)}function D7(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function JS(t,e,r){return r.retryDelays==null||e>=r.retryDelays.length||t.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(t,e,r):r1(t)}function r1(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!ds(e,400)||e===409||e===423)&&D7()}function XS(t,e){return new s7.default(e,t).toString()}function v7(t,e){for(var r=Math.floor(t/e),n=[],i=0;i<e;i++)n.push({start:r*i,end:r*(i+1)});return n[e-1].end=t,n}t1.defaultOptions=y7;var vde=df.default=t1});var o1=D((wde,i1)=>{"use strict";var Kr=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Kr.writable=t=>Kr(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Kr.readable=t=>Kr(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Kr.duplex=t=>Kr.writable(t)&&Kr.readable(t);Kr.transform=t=>Kr.duplex(t)&&typeof t._transform=="function";i1.exports=Kr});var a1=D(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.default=void 0;function Fu(t){"@babel/helpers - typeof";return Fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fu(t)}function b7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_7(n.key),n)}}function w7(t,e,r){return e&&s1(t.prototype,e),r&&s1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _7(t){var e=E7(t,"string");return Fu(e)=="symbol"?e:e+""}function E7(t,e){if(Fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var _de=hf.default=function(){function t(e){b7(this,t),this._buffer=e,this.size=e.length}return w7(t,[{key:"slice",value:function(r,n){var i=this._buffer.slice(r,n);i.size=i.length;var o=n>=this.size;return Promise.resolve({value:i,done:o})}},{key:"close",value:function(){}}])}()});var f1=D(uy=>{"use strict";Object.defineProperty(uy,"__esModule",{value:!0});uy.default=A7;var l1=require("fs");function qi(t){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qi(t)}function sy(){"use strict";sy=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function y(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=y.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&qi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(qi(E)+" is not iterable")}return x.prototype=y,i(F,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:x,configurable:!0}),x.displayName=c(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,y):(E.__proto__=y,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function C7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,x7(n.key),n)}}function S7(t,e,r){return e&&u1(t.prototype,e),r&&u1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function x7(t){var e=F7(t,"string");return qi(e)=="symbol"?e:e+""}function F7(t,e){if(qi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function c1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function O7(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){c1(o,n,i,s,a,"next",u)}function a(u){c1(o,n,i,s,a,"throw",u)}s(void 0)})}}function A7(t){return ay.apply(this,arguments)}function ay(){return ay=O7(sy().mark(function t(e){var r,n,i,o,s,a,u;return sy().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,l1.promises.stat(n);case 3:return i=l.sent,o=i.size,s=(r=e.start)!==null&&r!==void 0?r:0,a=Number.isFinite(e.end)?e.end+1:o,u=a-s,l.abrupt("return",new k7(e,n,u));case 9:case"end":return l.stop()}},t)})),ay.apply(this,arguments)}var k7=function(){function t(e,r,n){C7(this,t),this._stream=e,this._path=r,this.size=n}return S7(t,[{key:"slice",value:function(r,n){var i,o=(i=this._stream.start)!==null&&i!==void 0?i:0,s=(0,l1.createReadStream)(this._path,{start:o+r,end:o+n-1,autoClose:!0});s.size=Math.min(n-r,this.size);var a=s.size>=this.size;return Promise.resolve({value:s,done:a})}},{key:"close",value:function(){this._stream.destroy()}}])}()});var ly=D(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});pf.default=void 0;function Mi(t){"@babel/helpers - typeof";return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mi(t)}function Ou(){"use strict";Ou=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(E,b,_){E[b]=_.value},o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(E,b,_){return Object.defineProperty(E,b,{value:_,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(_,O,j){return _[O]=j}}function l(E,b,_,O){var j=b&&b.prototype instanceof w?b:w,P=Object.create(j.prototype),U=new K(O||[]);return i(P,"_invoke",{value:I(E,_,U)}),P}function f(E,b,_){try{return{type:"normal",arg:E.call(b,_)}}catch(O){return{type:"throw",arg:O}}}e.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",g={};function w(){}function x(){}function y(){}var C={};c(C,s,function(){return this});var k=Object.getPrototypeOf,$=k&&k(k(M([])));$&&$!==r&&n.call($,s)&&(C=$);var F=y.prototype=w.prototype=Object.create(C);function L(E){["next","throw","return"].forEach(function(b){c(E,b,function(_){return this._invoke(b,_)})})}function S(E,b){function _(j,P,U,T){var N=f(E[j],E,P);if(N.type!=="throw"){var oe=N.arg,se=oe.value;return se&&Mi(se)=="object"&&n.call(se,"__await")?b.resolve(se.__await).then(function(ve){_("next",ve,U,T)},function(ve){_("throw",ve,U,T)}):b.resolve(se).then(function(ve){oe.value=ve,U(oe)},function(ve){return _("throw",ve,U,T)})}T(N.arg)}var O;i(this,"_invoke",{value:function(P,U){function T(){return new b(function(N,oe){_(P,U,N,oe)})}return O=O?O.then(T,T):T()}})}function I(E,b,_){var O=h;return function(j,P){if(O===p)throw Error("Generator is already running");if(O===v){if(j==="throw")throw P;return{value:t,done:!0}}for(_.method=j,_.arg=P;;){var U=_.delegate;if(U){var T=R(U,_);if(T){if(T===g)continue;return T}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(O===h)throw O=v,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);O=p;var N=f(E,b,_);if(N.type==="normal"){if(O=_.done?v:d,N.arg===g)continue;return{value:N.arg,done:_.done}}N.type==="throw"&&(O=v,_.method="throw",_.arg=N.arg)}}}function R(E,b){var _=b.method,O=E.iterator[_];if(O===t)return b.delegate=null,_==="throw"&&E.iterator.return&&(b.method="return",b.arg=t,R(E,b),b.method==="throw")||_!=="return"&&(b.method="throw",b.arg=new TypeError("The iterator does not provide a '"+_+"' method")),g;var j=f(O,E.iterator,b.arg);if(j.type==="throw")return b.method="throw",b.arg=j.arg,b.delegate=null,g;var P=j.arg;return P?P.done?(b[E.resultName]=P.value,b.next=E.nextLoc,b.method!=="return"&&(b.method="next",b.arg=t),b.delegate=null,g):P:(b.method="throw",b.arg=new TypeError("iterator result is not an object"),b.delegate=null,g)}function B(E){var b={tryLoc:E[0]};1 in E&&(b.catchLoc=E[1]),2 in E&&(b.finallyLoc=E[2],b.afterLoc=E[3]),this.tryEntries.push(b)}function q(E){var b=E.completion||{};b.type="normal",delete b.arg,E.completion=b}function K(E){this.tryEntries=[{tryLoc:"root"}],E.forEach(B,this),this.reset(!0)}function M(E){if(E||E===""){var b=E[s];if(b)return b.call(E);if(typeof E.next=="function")return E;if(!isNaN(E.length)){var _=-1,O=function j(){for(;++_<E.length;)if(n.call(E,_))return j.value=E[_],j.done=!1,j;return j.value=t,j.done=!0,j};return O.next=O}}throw new TypeError(Mi(E)+" is not iterable")}return x.prototype=y,i(F,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:x,configurable:!0}),x.displayName=c(y,u,"GeneratorFunction"),e.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return!!b&&(b===x||(b.displayName||b.name)==="GeneratorFunction")},e.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,y):(E.__proto__=y,c(E,u,"GeneratorFunction")),E.prototype=Object.create(F),E},e.awrap=function(E){return{__await:E}},L(S.prototype),c(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(E,b,_,O,j){j===void 0&&(j=Promise);var P=new S(l(E,b,_,O),j);return e.isGeneratorFunction(b)?P:P.next().then(function(U){return U.done?U.value:P.next()})},L(F),c(F,u,"Generator"),c(F,s,function(){return this}),c(F,"toString",function(){return"[object Generator]"}),e.keys=function(E){var b=Object(E),_=[];for(var O in b)_.push(O);return _.reverse(),function j(){for(;_.length;){var P=_.pop();if(P in b)return j.value=P,j.done=!1,j}return j.done=!0,j}},e.values=M,K.prototype={constructor:K,reset:function(b){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(q),!b)for(var _ in this)_.charAt(0)==="t"&&n.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=t)},stop:function(){this.done=!0;var b=this.tryEntries[0].completion;if(b.type==="throw")throw b.arg;return this.rval},dispatchException:function(b){if(this.done)throw b;var _=this;function O(oe,se){return U.type="throw",U.arg=b,_.next=oe,se&&(_.method="next",_.arg=t),!!se}for(var j=this.tryEntries.length-1;j>=0;--j){var P=this.tryEntries[j],U=P.completion;if(P.tryLoc==="root")return O("end");if(P.tryLoc<=this.prev){var T=n.call(P,"catchLoc"),N=n.call(P,"finallyLoc");if(T&&N){if(this.prev<P.catchLoc)return O(P.catchLoc,!0);if(this.prev<P.finallyLoc)return O(P.finallyLoc)}else if(T){if(this.prev<P.catchLoc)return O(P.catchLoc,!0)}else{if(!N)throw Error("try statement without catch or finally");if(this.prev<P.finallyLoc)return O(P.finallyLoc)}}}},abrupt:function(b,_){for(var O=this.tryEntries.length-1;O>=0;--O){var j=this.tryEntries[O];if(j.tryLoc<=this.prev&&n.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var P=j;break}}P&&(b==="break"||b==="continue")&&P.tryLoc<=_&&_<=P.finallyLoc&&(P=null);var U=P?P.completion:{};return U.type=b,U.arg=_,P?(this.method="next",this.next=P.finallyLoc,g):this.complete(U)},complete:function(b,_){if(b.type==="throw")throw b.arg;return b.type==="break"||b.type==="continue"?this.next=b.arg:b.type==="return"?(this.rval=this.arg=b.arg,this.method="return",this.next="end"):b.type==="normal"&&_&&(this.next=_),g},finish:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.finallyLoc===b)return this.complete(O.completion,O.afterLoc),q(O),g}},catch:function(b){for(var _=this.tryEntries.length-1;_>=0;--_){var O=this.tryEntries[_];if(O.tryLoc===b){var j=O.completion;if(j.type==="throw"){var P=j.arg;q(O)}return P}}throw Error("illegal catch attempt")},delegateYield:function(b,_,O){return this.delegate={iterator:M(b),resultName:_,nextLoc:O},this.method==="next"&&(this.arg=t),g}},e}function T7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R7(n.key),n)}}function P7(t,e,r){return e&&d1(t.prototype,e),r&&d1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R7(t){var e=$7(t,"string");return Mi(e)=="symbol"?e:e+""}function $7(t,e){if(Mi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function h1(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function p1(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){h1(o,n,i,s,a,"next",u)}function a(u){h1(o,n,i,s,a,"throw",u)}s(void 0)})}}function I7(t,e){return cy.apply(this,arguments)}function cy(){return cy=p1(Ou().mark(function t(e,r){return Ou().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",new Promise(function(o,s){var a=function(l){e.off("readable",u),s(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",a),e.off("readable",c),o(l))};e.once("error",a),e.on("readable",u)}));case 1:case"end":return i.stop()}},t)})),cy.apply(this,arguments)}var Sde=pf.default=function(){function t(e){var r=this;T7(this,t),this._stream=e,this.size=null,this._buf=Buffer.alloc(0),this._bufPos=0,this._ended=!1,this._error=null,e.pause(),e.on("end",function(){r._ended=!0}),e.on("error",function(n){r._error=n})}return P7(t,[{key:"slice",value:function(){var e=p1(Ou().mark(function n(i,o){var s,a,u,c,l;return Ou().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(i<this._bufPos)){h.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(i>this._bufPos+this._buf.length)){h.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){h.next=6;break}throw this._error;case 6:if(i<this._bufPos+this._buf.length?(a=i-this._bufPos,u=Math.min(this._buf.length,o-this._bufPos),s=this._buf.slice(a,u)):s=Buffer.alloc(0),!this._ended){h.next=10;break}return s.size=s.length,h.abrupt("return",{value:s,done:!0});case 10:if(c=o-i,!(c>s.length)){h.next=16;break}return h.next=14,I7(this._stream,c-s.length);case 14:l=h.sent,s=Buffer.concat([s,l]);case 16:return this._buf=s,this._bufPos=i,s.size=s.length,h.abrupt("return",{value:s,done:this._ended});case 20:case"end":return h.stop()}},n,this)}));function r(n,i){return e.apply(this,arguments)}return r}()},{key:"close",value:function(){this._stream.destroy()}}])}()});var g1=D(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.default=void 0;var j7=require("fs"),N7=mf(o1()),L7=mf(a1()),B7=mf(f1()),q7=mf(ly());function mf(t){return t&&t.__esModule?t:{default:t}}function Au(t){"@babel/helpers - typeof";return Au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Au(t)}function M7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,V7(n.key),n)}}function U7(t,e,r){return e&&m1(t.prototype,e),r&&m1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function V7(t){var e=H7(t,"string");return Au(e)=="symbol"?e:e+""}function H7(t,e){if(Au(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Au(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Fde=gf.default=function(){function t(){M7(this,t)}return U7(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new L7.default(r)):r instanceof j7.ReadStream&&r.path!=null?(0,B7.default)(r):N7.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new q7.default(r)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option; specify a chunkSize to control the memory consumption"))):Promise.reject(new Error("source object may only be an instance of Buffer or Readable in this environment"))}}])}()});var b1=D(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.default=W7;var z7=require("crypto"),y1=v1(require("fs")),G7=v1(require("path"));function D1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(D1=function(n){return n?r:e})(t)}function v1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=D1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function W7(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),i=(0,z7.createHash)("md5").update(n).digest("hex"),o=["node-buffer",i,t.length,e.endpoint].join("-");return Promise.resolve(o)}return t instanceof y1.ReadStream&&t.path!=null?new Promise(function(s,a){var u=G7.resolve(t.path);y1.stat(t.path,function(c,l){if(c){a(c);return}var f=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");s(f)})}):Promise.resolve(null)}});var S1=D((kde,C1)=>{var E1="Expected a function",w1=NaN,K7="[object Symbol]",Y7=/^\s+|\s+$/g,J7=/^[-+]0x[0-9a-f]+$/i,X7=/^0b[01]+$/i,Z7=/^0o[0-7]+$/i,Q7=parseInt,eV=typeof global=="object"&&global&&global.Object===Object&&global,tV=typeof self=="object"&&self&&self.Object===Object&&self,rV=eV||tV||Function("return this")(),nV=Object.prototype,iV=nV.toString,oV=Math.max,sV=Math.min,dy=function(){return rV.Date.now()};function aV(t,e,r){var n,i,o,s,a,u,c=0,l=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(E1);e=_1(e)||0,yf(r)&&(l=!!r.leading,f="maxWait"in r,o=f?oV(_1(r.maxWait)||0,e):o,h="trailing"in r?!!r.trailing:h);function d($){var F=n,L=i;return n=i=void 0,c=$,s=t.apply(L,F),s}function p($){return c=$,a=setTimeout(w,e),l?d($):s}function v($){var F=$-u,L=$-c,S=e-F;return f?sV(S,o-L):S}function g($){var F=$-u,L=$-c;return u===void 0||F>=e||F<0||f&&L>=o}function w(){var $=dy();if(g($))return x($);a=setTimeout(w,v($))}function x($){return a=void 0,h&&n?d($):(n=i=void 0,s)}function y(){a!==void 0&&clearTimeout(a),c=0,n=u=i=a=void 0}function C(){return a===void 0?s:x(dy())}function k(){var $=dy(),F=g($);if(n=arguments,i=this,u=$,F){if(a===void 0)return p(u);if(f)return a=setTimeout(w,e),d(u)}return a===void 0&&(a=setTimeout(w,e)),s}return k.cancel=y,k.flush=C,k}function uV(t,e,r){var n=!0,i=!0;if(typeof t!="function")throw new TypeError(E1);return yf(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),aV(t,e,{leading:n,maxWait:e,trailing:i})}function yf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function cV(t){return!!t&&typeof t=="object"}function lV(t){return typeof t=="symbol"||cV(t)&&iV.call(t)==K7}function _1(t){if(typeof t=="number")return t;if(lV(t))return w1;if(yf(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=yf(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(Y7,"");var r=X7.test(t);return r||Z7.test(t)?Q7(t.slice(2),r?2:8):J7.test(t)?w1:+t}C1.exports=uV});var $1=D(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.default=void 0;var fV=T1(require("http")),dV=T1(require("https")),O1=require("stream"),hV=require("url"),A1=pV(S1());function pV(t){return t&&t.__esModule?t:{default:t}}function k1(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(k1=function(n){return n?r:e})(t)}function T1(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=k1(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function mV(t,e,r){return e=Df(e),gV(t,P1()?Reflect.construct(e,r||[],Df(t).constructor):e.apply(t,r))}function gV(t,e){if(e&&(hs(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yV(t)}function yV(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function P1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P1=function(){return!!t})()}function Df(t){return Df=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Df(t)}function DV(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hy(t,e)}function hy(t,e){return hy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},hy(t,e)}function x1(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ku(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?x1(Object(r),!0).forEach(function(n){vV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x1(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vV(t,e,r){return e=R1(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function hs(t){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hs(t)}function vf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F1(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,R1(n.key),n)}}function bf(t,e,r){return e&&F1(t.prototype,e),r&&F1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function R1(t){var e=bV(t,"string");return hs(e)=="symbol"?e:e+""}function bV(t,e){if(hs(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(hs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Tde=wf.default=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vf(this,t),this._requestOptions=e}return bf(t,[{key:"createRequest",value:function(r,n){return new wV(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])}(),wV=function(){function t(e,r,n){vf(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return bf(t,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._headers[r]=n}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){this._progressHandler=r}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(i,o){var s=ku(ku(ku({},(0,hV.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:ku(ku({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(s.headers["Content-Length"]=n.size);var a=s.protocol==="https:"?dV:fV;r._request=a.request(s);var u=r._request;u.on("response",function(c){var l=[];c.on("data",function(f){l.push(f)}),c.on("end",function(){var f=Buffer.concat(l).toString("utf8");i(new _V(c,f))})}),u.on("error",function(c){o(c)}),n instanceof O1.Readable?n.pipe(new EV(r._progressHandler)).pipe(u):n instanceof Uint8Array?CV(u,n,r._progressHandler):u.end(n)})}},{key:"abort",value:function(){return this._request!==null&&this._request.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._request}}])}(),_V=function(){function t(e,r){vf(this,t),this._response=e,this._body=r}return bf(t,[{key:"getStatus",value:function(){return this._response.statusCode}},{key:"getHeader",value:function(r){return this._response.headers[r.toLowerCase()]}},{key:"getBody",value:function(){return this._body}},{key:"getUnderlyingObject",value:function(){return this._response}}])}(),EV=function(t){function e(r){var n;return vf(this,e),n=mV(this,e),n._onprogress=(0,A1.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return DV(e,t),bf(e,[{key:"_transform",value:function(n,i,o){this._position+=n.length,this._onprogress(this._position),o(null,n)}}])}(O1.Transform),CV=function(e,r,n){n=(0,A1.default)(n,100,{leading:!0,trailing:!1});var i=0;function o(){var s=Math.min(e.writableHighWaterMark,r.length-i),a=r.subarray(i,i+s);i+=a.length;var u=e.write(a);u?i<r.length?o():e.end():(e.once("drain",o),n(i))}o()}});var I1=D(py=>{"use strict";py.expectReceive=function(t,e,r){var n;r.root(t,e,r),n=this.message,t.hasOwnProperty("expected")&&(n+=" Expected "+t.expected+"."),t.hasOwnProperty("received")&&(n+=" Received: "+t.received+"."),this.message=n};py.root=function(t,e,r){var n=this,i,o={stackLength:Error.stackTraceLimit,rootOnly:!0},s="",a=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
33
33
  `)}(!e||typeof e!="object")&&(e={}),e.hasOwnProperty("stackLength")&&typeof e.stackLength=="number"&&!isNaN(e.stackLength)&&e.stackLength>=0&&(o.stackLength=e.stackLength),e.hasOwnProperty("rootOnly")||(o.rootOnly=e.rootOnly),(!o.rootOnly||this.CustomError.parent===Error)&&(Object.keys(t).forEach(function(l){switch(l){case"code":i=t.code||void 0;break;case"message":s=t.message||"";break;default:n[l]=t[l]}}),Error.stackTraceLimit=o.stackLength+2,u=new Error().stack.split(`
34
34
  `),u.splice(0,3),u.unshift(""),Error.stackTraceLimit=a,this.stack=u.join(`
35
- `),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(l){i=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(l){s=l,c()}}),c())}});var L1=D((Rde,N1)=>{"use strict";N1.exports=Ui;Ui.factory=I1();var yy=Ui("CustomError");yy.order=Ui(yy,{message:"Arguments out of order.",code:"EOARG"});function Ui(t,e,r,n){var i,o;return e=_f(arguments,1,Error,j1,[my,Ef]),r=_f(arguments,2,{},my,[Ef]),n=_f(arguments,3,gy,Ef,[]),t=_f(arguments,0,e===Error?"Error":e.prototype.CustomError.name,CV,[j1,my,Ef]),o=e===Error,o&&n===gy&&(n=Ui.factory.root),i=function(s,a){var u,c,l,f,h,d;if(!(this instanceof i))return new i(s,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof s=="string"&&(s={message:s}),s||(s={}),c=this.CustomError.chain.slice(0).reverse().map(function(p){return p.properties}),c.push(s),c.unshift({}),d=Object.assign.apply(Object,c),u=this,l={},Object.keys(Ui.factory).forEach(function(p){l[p]=function(v,g){Ui.factory[p].call(u,v,g,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==gy&&h.factory.call(this,d,a,l)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:o?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var s=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(s+=" "+this.code),this.message&&(s+=": "+this.message),s},i}function _f(t,e,r,n,i){var o=-1,s=-1,a,u,c=e<t.length?e:t.length,l;for(a=0;a<=c;a++){if(l=t[a],o===-1)for(u=0;u<i.length;u++)i[u](l)&&(o=a);s===-1&&n(l)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new yy.order;return s!==-1?t[s]:r}function Ef(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function CV(t){return typeof t=="string"}function j1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function my(t){return t&&typeof t=="object"}function gy(){}});var q1=D(($de,B1)=>{B1.exports=L1()});var z1=D((Vi,ps)=>{var SV=1/0,xV="[object Symbol]",Tu={function:!0,object:!0},FV=Tu[typeof Vi]&&Vi&&!Vi.nodeType?Vi:void 0,OV=Tu[typeof ps]&&ps&&!ps.nodeType?ps:void 0,AV=Cf(FV&&OV&&typeof global=="object"&&global),kV=Cf(Tu[typeof self]&&self),M1=Cf(Tu[typeof window]&&window),Dy=Cf(Tu[typeof Vi]&&Vi),TV=AV||M1!==(Dy&&Dy.window)&&M1||kV||Dy||Function("return this")();function Cf(t){return t&&t.Object===Object?t:null}var PV=Object.prototype,RV=PV.toString,U1=TV.Symbol,V1=U1?U1.prototype:void 0,H1=V1?V1.toString:void 0;function $V(t){if(typeof t=="string")return t;if(jV(t))return H1?H1.call(t):"";var e=t+"";return e=="0"&&1/t==-SV?"-0":e}function IV(t){return!!t&&typeof t=="object"}function jV(t){return typeof t=="symbol"||IV(t)&&RV.call(t)==xV}ps.exports=$V});var Z1=D((Hi,ms)=>{var NV=z1(),LV="Expected a function",W1="__lodash_hash_undefined__",BV="[object Function]",qV="[object GeneratorFunction]",MV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,UV=/[\\^$.*+?()[\]{}|]/g,VV=/\\(\\)?/g,HV=/^\[object .+?Constructor\]$/,Ru={function:!0,object:!0},zV=Ru[typeof Hi]&&Hi&&!Hi.nodeType?Hi:void 0,GV=Ru[typeof ms]&&ms&&!ms.nodeType?ms:void 0,WV=Sf(zV&&GV&&typeof global=="object"&&global),KV=Sf(Ru[typeof self]&&self),G1=Sf(Ru[typeof window]&&window),vy=Sf(Ru[typeof Hi]&&Hi),YV=WV||G1!==(vy&&vy.window)&&G1||KV||vy||Function("return this")();function Sf(t){return t&&t.Object===Object?t:null}function JV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var XV=Array.prototype,K1=Object.prototype,Y1=Function.prototype.toString,by=K1.hasOwnProperty,ZV=K1.toString,QV=RegExp("^"+Y1.call(by).replace(UV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eH=XV.splice,tH=J1(YV,"Map"),Pu=J1(Object,"create");function zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function rH(){this.__data__=Pu?Pu(null):{}}function nH(t){return this.has(t)&&delete this.__data__[t]}function iH(t){var e=this.__data__;if(Pu){var r=e[t];return r===W1?void 0:r}return by.call(e,t)?e[t]:void 0}function oH(t){var e=this.__data__;return Pu?e[t]!==void 0:by.call(e,t)}function sH(t,e){var r=this.__data__;return r[t]=Pu&&e===void 0?W1:e,this}zi.prototype.clear=rH;zi.prototype.delete=nH;zi.prototype.get=iH;zi.prototype.has=oH;zi.prototype.set=sH;function gs(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function aH(){this.__data__=[]}function uH(t){var e=this.__data__,r=xf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():eH.call(e,r,1),!0}function cH(t){var e=this.__data__,r=xf(e,t);return r<0?void 0:e[r][1]}function lH(t){return xf(this.__data__,t)>-1}function fH(t,e){var r=this.__data__,n=xf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}gs.prototype.clear=aH;gs.prototype.delete=uH;gs.prototype.get=cH;gs.prototype.has=lH;gs.prototype.set=fH;function Gi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function dH(){this.__data__={hash:new zi,map:new(tH||gs),string:new zi}}function hH(t){return Ff(this,t).delete(t)}function pH(t){return Ff(this,t).get(t)}function mH(t){return Ff(this,t).has(t)}function gH(t,e){return Ff(this,t).set(t,e),this}Gi.prototype.clear=dH;Gi.prototype.delete=hH;Gi.prototype.get=pH;Gi.prototype.has=mH;Gi.prototype.set=gH;function xf(t,e){for(var r=t.length;r--;)if(bH(t[r][0],e))return r;return-1}function Ff(t,e){var r=t.__data__;return yH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function J1(t,e){var r=t[e];return _H(r)?r:void 0}function yH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var DH=wy(function(t){var e=[];return EH(t).replace(MV,function(r,n,i,o){e.push(i?o.replace(VV,"$1"):n||r)}),e});function vH(t){if(t!=null){try{return Y1.call(t)}catch{}try{return t+""}catch{}}return""}function wy(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(LV);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(wy.Cache||Gi),r}wy.Cache=Gi;function bH(t,e){return t===e||t!==t&&e!==e}function wH(t){var e=X1(t)?ZV.call(t):"";return e==BV||e==qV}function X1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function _H(t){if(!X1(t))return!1;var e=wH(t)||JV(t)?QV:HV;return e.test(vH(t))}function EH(t){return t==null?"":NV(t)}ms.exports=DH});var Ox=D((Wi,Ds)=>{var CH=Z1(),SH=200,Py="__lodash_hash_undefined__",Pf=1,vs=2,xH=1/0,ix=9007199254740991,Of="[object Arguments]",Cy="[object Array]",ox="[object Boolean]",sx="[object Date]",ax="[object Error]",ux="[object Function]",FH="[object GeneratorFunction]",$u="[object Map]",cx="[object Number]",ys="[object Object]",Q1="[object Promise]",lx="[object RegExp]",Iu="[object Set]",Ry="[object String]",fx="[object Symbol]",Sy="[object WeakMap]",dx="[object ArrayBuffer]",Af="[object DataView]",OH="[object Float32Array]",AH="[object Float64Array]",kH="[object Int8Array]",TH="[object Int16Array]",PH="[object Int32Array]",RH="[object Uint8Array]",$H="[object Uint8ClampedArray]",IH="[object Uint16Array]",jH="[object Uint32Array]",NH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,LH=/^\w*$/,BH=/[\\^$.*+?()[\]{}|]/g,qH=/^\[object .+?Constructor\]$/,MH=/^(?:0|[1-9]\d*)$/,Re={};Re[OH]=Re[AH]=Re[kH]=Re[TH]=Re[PH]=Re[RH]=Re[$H]=Re[IH]=Re[jH]=!0;Re[Of]=Re[Cy]=Re[dx]=Re[ox]=Re[Af]=Re[sx]=Re[ax]=Re[ux]=Re[$u]=Re[cx]=Re[ys]=Re[lx]=Re[Iu]=Re[Ry]=Re[Sy]=!1;var Nu={function:!0,object:!0},UH=Nu[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,VH=Nu[typeof Ds]&&Ds&&!Ds.nodeType?Ds:void 0,HH=Rf(UH&&VH&&typeof global=="object"&&global),zH=Rf(Nu[typeof self]&&self),ex=Rf(Nu[typeof window]&&window),_y=Rf(Nu[typeof Wi]&&Wi),Ji=HH||ex!==(_y&&_y.window)&&ex||zH||_y||Function("return this")();function GH(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function WH(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function KH(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function YH(t,e){return GH(e,function(r){return[r,t[r]]})}function Rf(t){return t&&t.Object===Object?t:null}function xy(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function hx(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function JH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function XH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var ZH=Array.prototype,$f=Object.prototype,px=Function.prototype.toString,Ki=$f.hasOwnProperty,Xi=$f.toString,QH=RegExp("^"+px.call(Ki).replace(BH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tx=Ji.Symbol,rx=Ji.Uint8Array,ez=$f.propertyIsEnumerable,tz=ZH.splice,rz=Object.getPrototypeOf,nz=Object.keys,Fy=bs(Ji,"DataView"),kf=bs(Ji,"Map"),Oy=bs(Ji,"Promise"),Ay=bs(Ji,"Set"),ky=bs(Ji,"WeakMap"),ju=bs(Object,"create"),iz=Qi(Fy),oz=Qi(kf),sz=Qi(Oy),az=Qi(Ay),uz=Qi(ky),nx=tx?tx.prototype:void 0,Ey=nx?nx.valueOf:void 0;function Yi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function cz(){this.__data__=ju?ju(null):{}}function lz(t){return this.has(t)&&delete this.__data__[t]}function fz(t){var e=this.__data__;if(ju){var r=e[t];return r===Py?void 0:r}return Ki.call(e,t)?e[t]:void 0}function dz(t){var e=this.__data__;return ju?e[t]!==void 0:Ki.call(e,t)}function hz(t,e){var r=this.__data__;return r[t]=ju&&e===void 0?Py:e,this}Yi.prototype.clear=cz;Yi.prototype.delete=lz;Yi.prototype.get=fz;Yi.prototype.has=dz;Yi.prototype.set=hz;function wn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function pz(){this.__data__=[]}function mz(t){var e=this.__data__,r=If(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():tz.call(e,r,1),!0}function gz(t){var e=this.__data__,r=If(e,t);return r<0?void 0:e[r][1]}function yz(t){return If(this.__data__,t)>-1}function Dz(t,e){var r=this.__data__,n=If(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}wn.prototype.clear=pz;wn.prototype.delete=mz;wn.prototype.get=gz;wn.prototype.has=yz;wn.prototype.set=Dz;function Zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function vz(){this.__data__={hash:new Yi,map:new(kf||wn),string:new Yi}}function bz(t){return jf(this,t).delete(t)}function wz(t){return jf(this,t).get(t)}function _z(t){return jf(this,t).has(t)}function Ez(t,e){return jf(this,t).set(t,e),this}Zi.prototype.clear=vz;Zi.prototype.delete=bz;Zi.prototype.get=wz;Zi.prototype.has=_z;Zi.prototype.set=Ez;function Tf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Zi;++e<r;)this.add(t[e])}function Cz(t){return this.__data__.set(t,Py),this}function Sz(t){return this.__data__.has(t)}Tf.prototype.add=Tf.prototype.push=Cz;Tf.prototype.has=Sz;function bn(t){this.__data__=new wn(t)}function xz(){this.__data__=new wn}function Fz(t){return this.__data__.delete(t)}function Oz(t){return this.__data__.get(t)}function Az(t){return this.__data__.has(t)}function kz(t,e){var r=this.__data__;return r instanceof wn&&r.__data__.length==SH&&(r=this.__data__=new Zi(r.__data__)),r.set(t,e),this}bn.prototype.clear=xz;bn.prototype.delete=Fz;bn.prototype.get=Oz;bn.prototype.has=Az;bn.prototype.set=kz;function If(t,e){for(var r=t.length;r--;)if(Yz(t[r][0],e))return r;return-1}function mx(t,e){e=Nf(e,t)?[e]:Dx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Lf(e[r++])];return r&&r==n?t:void 0}function gx(t,e){return Ki.call(t,e)||typeof t=="object"&&e in t&&Hz(t)===null}function Tz(t,e){return e in Object(t)}function $y(t,e,r,n,i){return t===e?!0:t==null||e==null||!qf(t)&&!Lu(e)?t!==t&&e!==e:Pz(t,e,$y,r,n,i)}function Pz(t,e,r,n,i,o){var s=ni(t),a=ni(e),u=Cy,c=Cy;s||(u=vn(t),u=u==Of?ys:u),a||(c=vn(e),c=c==Of?ys:c);var l=u==ys&&!xy(t),f=c==ys&&!xy(e),h=u==c;if(h&&!l)return o||(o=new bn),s||Zz(t)?vx(t,e,r,n,i,o):qz(t,e,u,r,n,i,o);if(!(i&vs)){var d=l&&Ki.call(t,"__wrapped__"),p=f&&Ki.call(e,"__wrapped__");if(d||p){var v=d?t.value():t,g=p?e.value():e;return o||(o=new bn),r(v,g,n,i,o)}}return h?(o||(o=new bn),Mz(t,e,r,n,i,o)):!1}function Rz(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],c=t[u],l=a[1];if(s&&a[2]){if(c===void 0&&!(u in t))return!1}else{var f=new bn;if(n)var h=n(c,l,u,t,e,f);if(!(h===void 0?$y(l,c,n,Pf|vs,f):h))return!1}}return!0}function $z(t){return typeof t=="function"?t:t==null?rG:typeof t=="object"?ni(t)?Nz(t[0],t[1]):jz(t):nG(t)}function Iz(t){return nz(Object(t))}function jz(t){var e=Vz(t);return e.length==1&&e[0][2]?_x(e[0][0],e[0][1]):function(r){return r===t||Rz(r,t,e)}}function Nz(t,e){return Nf(t)&&wx(e)?_x(Lf(t),e):function(r){var n=Qz(r,t);return n===void 0&&n===e?eG(r,t):$y(e,n,void 0,Pf|vs)}}function yx(t){return function(e){return e?.[t]}}function Lz(t){return function(e){return mx(e,t)}}function Dx(t){return ni(t)?t:CH(t)}function Bz(t){return function(e){var r=vn(e);return r==$u?hx(e):r==Iu?XH(e):YH(e,t(e))}}function vx(t,e,r,n,i,o){var s=i&vs,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=o.get(t);if(c)return c==e;var l=-1,f=!0,h=i&Pf?new Tf:void 0;for(o.set(t,e);++l<a;){var d=t[l],p=e[l];if(n)var v=s?n(p,d,l,e,t,o):n(d,p,l,t,e,o);if(v!==void 0){if(v)continue;f=!1;break}if(h){if(!WH(e,function(g,w){if(!h.has(w)&&(d===g||r(d,g,n,i,o)))return h.add(w)})){f=!1;break}}else if(!(d===p||r(d,p,n,i,o))){f=!1;break}}return o.delete(t),f}function qz(t,e,r,n,i,o,s){switch(r){case Af:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case dx:return!(t.byteLength!=e.byteLength||!n(new rx(t),new rx(e)));case ox:case sx:return+t==+e;case ax:return t.name==e.name&&t.message==e.message;case cx:return t!=+t?e!=+e:t==+e;case lx:case Ry:return t==e+"";case $u:var a=hx;case Iu:var u=o&vs;if(a||(a=JH),t.size!=e.size&&!u)return!1;var c=s.get(t);return c?c==e:(o|=Pf,s.set(t,e),vx(a(t),a(e),n,i,o,s));case fx:if(Ey)return Ey.call(t)==Ey.call(e)}return!1}function Mz(t,e,r,n,i,o){var s=i&vs,a=Ty(t),u=a.length,c=Ty(e),l=c.length;if(u!=l&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:gx(e,h)))return!1}var d=o.get(t);if(d)return d==e;var p=!0;o.set(t,e);for(var v=s;++f<u;){h=a[f];var g=t[h],w=e[h];if(n)var x=s?n(w,g,h,e,t,o):n(g,w,h,t,e,o);if(!(x===void 0?g===w||r(g,w,n,i,o):x)){p=!1;break}v||(v=h=="constructor")}if(p&&!v){var y=t.constructor,C=e.constructor;y!=C&&"constructor"in t&&"constructor"in e&&!(typeof y=="function"&&y instanceof y&&typeof C=="function"&&C instanceof C)&&(p=!1)}return o.delete(t),p}var Uz=yx("length");function jf(t,e){var r=t.__data__;return Wz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Vz(t){for(var e=tG(t),r=e.length;r--;)e[r][2]=wx(e[r][1]);return e}function bs(t,e){var r=t[e];return Xz(r)?r:void 0}function Hz(t){return rz(Object(t))}function vn(t){return Xi.call(t)}(Fy&&vn(new Fy(new ArrayBuffer(1)))!=Af||kf&&vn(new kf)!=$u||Oy&&vn(Oy.resolve())!=Q1||Ay&&vn(new Ay)!=Iu||ky&&vn(new ky)!=Sy)&&(vn=function(t){var e=Xi.call(t),r=e==ys?t.constructor:void 0,n=r?Qi(r):void 0;if(n)switch(n){case iz:return Af;case oz:return $u;case sz:return Q1;case az:return Iu;case uz:return Sy}return e});function zz(t,e,r){e=Nf(e,t)?[e]:Dx(e);for(var n,i=-1,s=e.length;++i<s;){var o=Lf(e[i]);if(!(n=t!=null&&r(t,o)))break;t=t[o]}if(n)return n;var s=t?t.length:0;return!!s&&Bf(s)&&bx(o,s)&&(ni(t)||xx(t)||Ex(t))}function Gz(t){var e=t?t.length:void 0;return Bf(e)&&(ni(t)||xx(t)||Ex(t))?KH(e,String):null}function bx(t,e){return e=e??ix,!!e&&(typeof t=="number"||MH.test(t))&&t>-1&&t%1==0&&t<e}function Nf(t,e){if(ni(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Fx(t)?!0:LH.test(t)||!NH.test(t)||e!=null&&t in Object(e)}function Wz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Kz(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||$f;return t===r}function wx(t){return t===t&&!qf(t)}function _x(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Lf(t){if(typeof t=="string"||Fx(t))return t;var e=t+"";return e=="0"&&1/t==-xH?"-0":e}function Qi(t){if(t!=null){try{return px.call(t)}catch{}try{return t+""}catch{}}return""}function Yz(t,e){return t===e||t!==t&&e!==e}function Ex(t){return Jz(t)&&Ki.call(t,"callee")&&(!ez.call(t,"callee")||Xi.call(t)==Of)}var ni=Array.isArray;function Cx(t){return t!=null&&Bf(Uz(t))&&!Sx(t)}function Jz(t){return Lu(t)&&Cx(t)}function Sx(t){var e=qf(t)?Xi.call(t):"";return e==ux||e==FH}function Bf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ix}function qf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Lu(t){return!!t&&typeof t=="object"}function Xz(t){if(!qf(t))return!1;var e=Sx(t)||xy(t)?QH:qH;return e.test(Qi(t))}function xx(t){return typeof t=="string"||!ni(t)&&Lu(t)&&Xi.call(t)==Ry}function Fx(t){return typeof t=="symbol"||Lu(t)&&Xi.call(t)==fx}function Zz(t){return Lu(t)&&Bf(t.length)&&!!Re[Xi.call(t)]}function Qz(t,e,r){var n=t==null?void 0:mx(t,e);return n===void 0?r:n}function eG(t,e){return t!=null&&zz(t,e,Tz)}function Ty(t){var e=Kz(t);if(!(e||Cx(t)))return Iz(t);var r=Gz(t),n=!!r,i=r||[],o=i.length;for(var s in t)gx(t,s)&&!(n&&(s=="length"||bx(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var tG=Bz(Ty);function rG(t){return t}function nG(t){return Nf(t)?yx(Lf(t)):Lz(t)}Ds.exports=$z});var Rx=D((eo,ws)=>{var iG=1/0,oG="[object Function]",sG="[object GeneratorFunction]",aG=/[\\^$.*+?()[\]{}|]/g,uG=/^\[object .+?Constructor\]$/,Bu={function:!0,object:!0},cG=Bu[typeof eo]&&eo&&!eo.nodeType?eo:void 0,lG=Bu[typeof ws]&&ws&&!ws.nodeType?ws:void 0,fG=Mf(cG&&lG&&typeof global=="object"&&global),dG=Mf(Bu[typeof self]&&self),Ax=Mf(Bu[typeof window]&&window),Iy=Mf(Bu[typeof eo]&&eo),hG=fG||Ax!==(Iy&&Iy.window)&&Ax||dG||Iy||Function("return this")();function Mf(t){return t&&t.Object===Object?t:null}function pG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function mG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var kx=Object.prototype,Tx=Function.prototype.toString,gG=kx.hasOwnProperty,yG=kx.toString,DG=RegExp("^"+Tx.call(gG).replace(aG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jy=bG(hG,"Set"),vG=jy&&1/mG(new jy([,-0]))[1]==iG?function(t){return new jy(t)}:CG;function bG(t,e){var r=t[e];return EG(r)?r:void 0}function wG(t){if(t!=null){try{return Tx.call(t)}catch{}try{return t+""}catch{}}return""}function _G(t){var e=Px(t)?yG.call(t):"";return e==oG||e==sG}function Px(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function EG(t){if(!Px(t))return!1;var e=_G(t)||pG(t)?DG:uG;return e.test(wG(t))}function CG(){}ws.exports=vG});var Ix=D((to,_s)=>{var qu={function:!0,object:!0},SG=qu[typeof to]&&to&&!to.nodeType?to:void 0,xG=qu[typeof _s]&&_s&&!_s.nodeType?_s:void 0,FG=Uf(SG&&xG&&typeof global=="object"&&global),OG=Uf(qu[typeof self]&&self),$x=Uf(qu[typeof window]&&window),Ny=Uf(qu[typeof to]&&to),AG=FG||$x!==(Ny&&Ny.window)&&$x||OG||Ny||Function("return this")();function Uf(t){return t&&t.Object===Object?t:null}_s.exports=AG});var Mx=D((Ide,qx)=>{var kG=Rx(),TG=Ix(),PG=200,Ly="__lodash_hash_undefined__",RG="[object Function]",$G="[object GeneratorFunction]",IG=/[\\^$.*+?()[\]{}|]/g,jG=/^\[object .+?Constructor\]$/;function NG(t,e){return!!t.length&&BG(t,e,0)>-1}function LG(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function BG(t,e,r){if(e!==e)return MG(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function qG(t,e){return t.has(e)}function MG(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i<n;){var o=t[i];if(o!==o)return i}return-1}function UG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function VG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var HG=Array.prototype,jx=Object.prototype,Nx=Function.prototype.toString,By=jx.hasOwnProperty,zG=jx.toString,GG=RegExp("^"+Nx.call(By).replace(IG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),WG=HG.splice,KG=Lx(TG,"Map"),Mu=Lx(Object,"create");function ro(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function YG(){this.__data__=Mu?Mu(null):{}}function JG(t){return this.has(t)&&delete this.__data__[t]}function XG(t){var e=this.__data__;if(Mu){var r=e[t];return r===Ly?void 0:r}return By.call(e,t)?e[t]:void 0}function ZG(t){var e=this.__data__;return Mu?e[t]!==void 0:By.call(e,t)}function QG(t,e){var r=this.__data__;return r[t]=Mu&&e===void 0?Ly:e,this}ro.prototype.clear=YG;ro.prototype.delete=JG;ro.prototype.get=XG;ro.prototype.has=ZG;ro.prototype.set=QG;function Es(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function eW(){this.__data__=[]}function tW(t){var e=this.__data__,r=Hf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():WG.call(e,r,1),!0}function rW(t){var e=this.__data__,r=Hf(e,t);return r<0?void 0:e[r][1]}function nW(t){return Hf(this.__data__,t)>-1}function iW(t,e){var r=this.__data__,n=Hf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Es.prototype.clear=eW;Es.prototype.delete=tW;Es.prototype.get=rW;Es.prototype.has=nW;Es.prototype.set=iW;function Cs(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function oW(){this.__data__={hash:new ro,map:new(KG||Es),string:new ro}}function sW(t){return zf(this,t).delete(t)}function aW(t){return zf(this,t).get(t)}function uW(t){return zf(this,t).has(t)}function cW(t,e){return zf(this,t).set(t,e),this}Cs.prototype.clear=oW;Cs.prototype.delete=sW;Cs.prototype.get=aW;Cs.prototype.has=uW;Cs.prototype.set=cW;function Vf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Cs;++e<r;)this.add(t[e])}function lW(t){return this.__data__.set(t,Ly),this}function fW(t){return this.__data__.has(t)}Vf.prototype.add=Vf.prototype.push=lW;Vf.prototype.has=fW;function Hf(t,e){for(var r=t.length;r--;)if(mW(t[r][0],e))return r;return-1}function dW(t,e,r){var n=-1,i=NG,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=LG;else if(o>=PG){var c=e?null:kG(t);if(c)return VG(c);s=!1,i=qG,u=new Vf}else u=e?[]:a;e:for(;++n<o;){var l=t[n],f=e?e(l):l;if(l=r||l!==0?l:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function zf(t,e){var r=t.__data__;return hW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Lx(t,e){var r=t[e];return yW(r)?r:void 0}function hW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function pW(t){if(t!=null){try{return Nx.call(t)}catch{}try{return t+""}catch{}}return""}function mW(t,e){return t===e||t!==t&&e!==e}function gW(t){var e=Bx(t)?zG.call(t):"";return e==RG||e==$G}function Bx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function yW(t){if(!Bx(t))return!1;var e=gW(t)||UG(t)?GG:jG;return e.test(pW(t))}qx.exports=dW});var Vx=D((jde,Ux)=>{var DW=Ox(),vW=Mx();function bW(t,e){return t&&t.length?vW(t,DW(e)):[]}Ux.exports=bW});var zx=D((Nde,Hx)=>{"use strict";var wW=q1(),_W=Vx(),EW=wW("MultiError");Hx.exports=qy;function qy(t){if(!(this instanceof qy))return new qy(t);if(t=Array.isArray(t)?t:[t],t=_W(t,function(r){return r.stack}),t.length===1)return t[0];var e=new EW({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
35
+ `),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return i},set:function(l){i=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return s},set:function(l){s=l,c()}}),c())}});var L1=D(($de,N1)=>{"use strict";N1.exports=Ui;Ui.factory=I1();var yy=Ui("CustomError");yy.order=Ui(yy,{message:"Arguments out of order.",code:"EOARG"});function Ui(t,e,r,n){var i,o;return e=_f(arguments,1,Error,j1,[my,Ef]),r=_f(arguments,2,{},my,[Ef]),n=_f(arguments,3,gy,Ef,[]),t=_f(arguments,0,e===Error?"Error":e.prototype.CustomError.name,SV,[j1,my,Ef]),o=e===Error,o&&n===gy&&(n=Ui.factory.root),i=function(s,a){var u,c,l,f,h,d;if(!(this instanceof i))return new i(s,a);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof s=="string"&&(s={message:s}),s||(s={}),c=this.CustomError.chain.slice(0).reverse().map(function(p){return p.properties}),c.push(s),c.unshift({}),d=Object.assign.apply(Object,c),u=this,l={},Object.keys(Ui.factory).forEach(function(p){l[p]=function(v,g){Ui.factory[p].call(u,v,g,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)h=this.CustomError.chain[f],h.factory!==gy&&h.factory.call(this,d,a,l)},i.prototype=Object.create(e.prototype),i.prototype.constructor=i,i.prototype.name=t,i.prototype.CustomError={chain:o?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},i.prototype.CustomError.chain.unshift(i.prototype.CustomError),i.prototype.toString=function(){var s=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(s+=" "+this.code),this.message&&(s+=": "+this.message),s},i}function _f(t,e,r,n,i){var o=-1,s=-1,a,u,c=e<t.length?e:t.length,l;for(a=0;a<=c;a++){if(l=t[a],o===-1)for(u=0;u<i.length;u++)i[u](l)&&(o=a);s===-1&&n(l)&&(s=a)}if(s!==-1&&o!==-1&&o<s)throw new yy.order;return s!==-1?t[s]:r}function Ef(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function SV(t){return typeof t=="string"}function j1(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function my(t){return t&&typeof t=="object"}function gy(){}});var q1=D((Ide,B1)=>{B1.exports=L1()});var z1=D((Vi,ps)=>{var xV=1/0,FV="[object Symbol]",Tu={function:!0,object:!0},OV=Tu[typeof Vi]&&Vi&&!Vi.nodeType?Vi:void 0,AV=Tu[typeof ps]&&ps&&!ps.nodeType?ps:void 0,kV=Cf(OV&&AV&&typeof global=="object"&&global),TV=Cf(Tu[typeof self]&&self),M1=Cf(Tu[typeof window]&&window),Dy=Cf(Tu[typeof Vi]&&Vi),PV=kV||M1!==(Dy&&Dy.window)&&M1||TV||Dy||Function("return this")();function Cf(t){return t&&t.Object===Object?t:null}var RV=Object.prototype,$V=RV.toString,U1=PV.Symbol,V1=U1?U1.prototype:void 0,H1=V1?V1.toString:void 0;function IV(t){if(typeof t=="string")return t;if(NV(t))return H1?H1.call(t):"";var e=t+"";return e=="0"&&1/t==-xV?"-0":e}function jV(t){return!!t&&typeof t=="object"}function NV(t){return typeof t=="symbol"||jV(t)&&$V.call(t)==FV}ps.exports=IV});var Z1=D((Hi,ms)=>{var LV=z1(),BV="Expected a function",W1="__lodash_hash_undefined__",qV="[object Function]",MV="[object GeneratorFunction]",UV=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,VV=/[\\^$.*+?()[\]{}|]/g,HV=/\\(\\)?/g,zV=/^\[object .+?Constructor\]$/,Ru={function:!0,object:!0},GV=Ru[typeof Hi]&&Hi&&!Hi.nodeType?Hi:void 0,WV=Ru[typeof ms]&&ms&&!ms.nodeType?ms:void 0,KV=Sf(GV&&WV&&typeof global=="object"&&global),YV=Sf(Ru[typeof self]&&self),G1=Sf(Ru[typeof window]&&window),vy=Sf(Ru[typeof Hi]&&Hi),JV=KV||G1!==(vy&&vy.window)&&G1||YV||vy||Function("return this")();function Sf(t){return t&&t.Object===Object?t:null}function XV(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var ZV=Array.prototype,K1=Object.prototype,Y1=Function.prototype.toString,by=K1.hasOwnProperty,QV=K1.toString,eH=RegExp("^"+Y1.call(by).replace(VV,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tH=ZV.splice,rH=J1(JV,"Map"),Pu=J1(Object,"create");function zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function nH(){this.__data__=Pu?Pu(null):{}}function iH(t){return this.has(t)&&delete this.__data__[t]}function oH(t){var e=this.__data__;if(Pu){var r=e[t];return r===W1?void 0:r}return by.call(e,t)?e[t]:void 0}function sH(t){var e=this.__data__;return Pu?e[t]!==void 0:by.call(e,t)}function aH(t,e){var r=this.__data__;return r[t]=Pu&&e===void 0?W1:e,this}zi.prototype.clear=nH;zi.prototype.delete=iH;zi.prototype.get=oH;zi.prototype.has=sH;zi.prototype.set=aH;function gs(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function uH(){this.__data__=[]}function cH(t){var e=this.__data__,r=xf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():tH.call(e,r,1),!0}function lH(t){var e=this.__data__,r=xf(e,t);return r<0?void 0:e[r][1]}function fH(t){return xf(this.__data__,t)>-1}function dH(t,e){var r=this.__data__,n=xf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}gs.prototype.clear=uH;gs.prototype.delete=cH;gs.prototype.get=lH;gs.prototype.has=fH;gs.prototype.set=dH;function Gi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function hH(){this.__data__={hash:new zi,map:new(rH||gs),string:new zi}}function pH(t){return Ff(this,t).delete(t)}function mH(t){return Ff(this,t).get(t)}function gH(t){return Ff(this,t).has(t)}function yH(t,e){return Ff(this,t).set(t,e),this}Gi.prototype.clear=hH;Gi.prototype.delete=pH;Gi.prototype.get=mH;Gi.prototype.has=gH;Gi.prototype.set=yH;function xf(t,e){for(var r=t.length;r--;)if(wH(t[r][0],e))return r;return-1}function Ff(t,e){var r=t.__data__;return DH(e)?r[typeof e=="string"?"string":"hash"]:r.map}function J1(t,e){var r=t[e];return EH(r)?r:void 0}function DH(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var vH=wy(function(t){var e=[];return CH(t).replace(UV,function(r,n,i,o){e.push(i?o.replace(HV,"$1"):n||r)}),e});function bH(t){if(t!=null){try{return Y1.call(t)}catch{}try{return t+""}catch{}}return""}function wy(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(BV);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(wy.Cache||Gi),r}wy.Cache=Gi;function wH(t,e){return t===e||t!==t&&e!==e}function _H(t){var e=X1(t)?QV.call(t):"";return e==qV||e==MV}function X1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function EH(t){if(!X1(t))return!1;var e=_H(t)||XV(t)?eH:zV;return e.test(bH(t))}function CH(t){return t==null?"":LV(t)}ms.exports=vH});var Ox=D((Wi,Ds)=>{var SH=Z1(),xH=200,Py="__lodash_hash_undefined__",Pf=1,vs=2,FH=1/0,ix=9007199254740991,Of="[object Arguments]",Cy="[object Array]",ox="[object Boolean]",sx="[object Date]",ax="[object Error]",ux="[object Function]",OH="[object GeneratorFunction]",$u="[object Map]",cx="[object Number]",ys="[object Object]",Q1="[object Promise]",lx="[object RegExp]",Iu="[object Set]",Ry="[object String]",fx="[object Symbol]",Sy="[object WeakMap]",dx="[object ArrayBuffer]",Af="[object DataView]",AH="[object Float32Array]",kH="[object Float64Array]",TH="[object Int8Array]",PH="[object Int16Array]",RH="[object Int32Array]",$H="[object Uint8Array]",IH="[object Uint8ClampedArray]",jH="[object Uint16Array]",NH="[object Uint32Array]",LH=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,BH=/^\w*$/,qH=/[\\^$.*+?()[\]{}|]/g,MH=/^\[object .+?Constructor\]$/,UH=/^(?:0|[1-9]\d*)$/,Re={};Re[AH]=Re[kH]=Re[TH]=Re[PH]=Re[RH]=Re[$H]=Re[IH]=Re[jH]=Re[NH]=!0;Re[Of]=Re[Cy]=Re[dx]=Re[ox]=Re[Af]=Re[sx]=Re[ax]=Re[ux]=Re[$u]=Re[cx]=Re[ys]=Re[lx]=Re[Iu]=Re[Ry]=Re[Sy]=!1;var Nu={function:!0,object:!0},VH=Nu[typeof Wi]&&Wi&&!Wi.nodeType?Wi:void 0,HH=Nu[typeof Ds]&&Ds&&!Ds.nodeType?Ds:void 0,zH=Rf(VH&&HH&&typeof global=="object"&&global),GH=Rf(Nu[typeof self]&&self),ex=Rf(Nu[typeof window]&&window),_y=Rf(Nu[typeof Wi]&&Wi),Ji=zH||ex!==(_y&&_y.window)&&ex||GH||_y||Function("return this")();function WH(t,e){for(var r=-1,n=t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function KH(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function YH(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function JH(t,e){return WH(e,function(r){return[r,t[r]]})}function Rf(t){return t&&t.Object===Object?t:null}function xy(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function hx(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function XH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function ZH(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var QH=Array.prototype,$f=Object.prototype,px=Function.prototype.toString,Ki=$f.hasOwnProperty,Xi=$f.toString,ez=RegExp("^"+px.call(Ki).replace(qH,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tx=Ji.Symbol,rx=Ji.Uint8Array,tz=$f.propertyIsEnumerable,rz=QH.splice,nz=Object.getPrototypeOf,iz=Object.keys,Fy=bs(Ji,"DataView"),kf=bs(Ji,"Map"),Oy=bs(Ji,"Promise"),Ay=bs(Ji,"Set"),ky=bs(Ji,"WeakMap"),ju=bs(Object,"create"),oz=Qi(Fy),sz=Qi(kf),az=Qi(Oy),uz=Qi(Ay),cz=Qi(ky),nx=tx?tx.prototype:void 0,Ey=nx?nx.valueOf:void 0;function Yi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function lz(){this.__data__=ju?ju(null):{}}function fz(t){return this.has(t)&&delete this.__data__[t]}function dz(t){var e=this.__data__;if(ju){var r=e[t];return r===Py?void 0:r}return Ki.call(e,t)?e[t]:void 0}function hz(t){var e=this.__data__;return ju?e[t]!==void 0:Ki.call(e,t)}function pz(t,e){var r=this.__data__;return r[t]=ju&&e===void 0?Py:e,this}Yi.prototype.clear=lz;Yi.prototype.delete=fz;Yi.prototype.get=dz;Yi.prototype.has=hz;Yi.prototype.set=pz;function wn(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function mz(){this.__data__=[]}function gz(t){var e=this.__data__,r=If(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():rz.call(e,r,1),!0}function yz(t){var e=this.__data__,r=If(e,t);return r<0?void 0:e[r][1]}function Dz(t){return If(this.__data__,t)>-1}function vz(t,e){var r=this.__data__,n=If(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}wn.prototype.clear=mz;wn.prototype.delete=gz;wn.prototype.get=yz;wn.prototype.has=Dz;wn.prototype.set=vz;function Zi(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function bz(){this.__data__={hash:new Yi,map:new(kf||wn),string:new Yi}}function wz(t){return jf(this,t).delete(t)}function _z(t){return jf(this,t).get(t)}function Ez(t){return jf(this,t).has(t)}function Cz(t,e){return jf(this,t).set(t,e),this}Zi.prototype.clear=bz;Zi.prototype.delete=wz;Zi.prototype.get=_z;Zi.prototype.has=Ez;Zi.prototype.set=Cz;function Tf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Zi;++e<r;)this.add(t[e])}function Sz(t){return this.__data__.set(t,Py),this}function xz(t){return this.__data__.has(t)}Tf.prototype.add=Tf.prototype.push=Sz;Tf.prototype.has=xz;function bn(t){this.__data__=new wn(t)}function Fz(){this.__data__=new wn}function Oz(t){return this.__data__.delete(t)}function Az(t){return this.__data__.get(t)}function kz(t){return this.__data__.has(t)}function Tz(t,e){var r=this.__data__;return r instanceof wn&&r.__data__.length==xH&&(r=this.__data__=new Zi(r.__data__)),r.set(t,e),this}bn.prototype.clear=Fz;bn.prototype.delete=Oz;bn.prototype.get=Az;bn.prototype.has=kz;bn.prototype.set=Tz;function If(t,e){for(var r=t.length;r--;)if(Jz(t[r][0],e))return r;return-1}function mx(t,e){e=Nf(e,t)?[e]:Dx(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Lf(e[r++])];return r&&r==n?t:void 0}function gx(t,e){return Ki.call(t,e)||typeof t=="object"&&e in t&&zz(t)===null}function Pz(t,e){return e in Object(t)}function $y(t,e,r,n,i){return t===e?!0:t==null||e==null||!qf(t)&&!Lu(e)?t!==t&&e!==e:Rz(t,e,$y,r,n,i)}function Rz(t,e,r,n,i,o){var s=ni(t),a=ni(e),u=Cy,c=Cy;s||(u=vn(t),u=u==Of?ys:u),a||(c=vn(e),c=c==Of?ys:c);var l=u==ys&&!xy(t),f=c==ys&&!xy(e),h=u==c;if(h&&!l)return o||(o=new bn),s||Qz(t)?vx(t,e,r,n,i,o):Mz(t,e,u,r,n,i,o);if(!(i&vs)){var d=l&&Ki.call(t,"__wrapped__"),p=f&&Ki.call(e,"__wrapped__");if(d||p){var v=d?t.value():t,g=p?e.value():e;return o||(o=new bn),r(v,g,n,i,o)}}return h?(o||(o=new bn),Uz(t,e,r,n,i,o)):!1}function $z(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],c=t[u],l=a[1];if(s&&a[2]){if(c===void 0&&!(u in t))return!1}else{var f=new bn;if(n)var h=n(c,l,u,t,e,f);if(!(h===void 0?$y(l,c,n,Pf|vs,f):h))return!1}}return!0}function Iz(t){return typeof t=="function"?t:t==null?nG:typeof t=="object"?ni(t)?Lz(t[0],t[1]):Nz(t):iG(t)}function jz(t){return iz(Object(t))}function Nz(t){var e=Hz(t);return e.length==1&&e[0][2]?_x(e[0][0],e[0][1]):function(r){return r===t||$z(r,t,e)}}function Lz(t,e){return Nf(t)&&wx(e)?_x(Lf(t),e):function(r){var n=eG(r,t);return n===void 0&&n===e?tG(r,t):$y(e,n,void 0,Pf|vs)}}function yx(t){return function(e){return e?.[t]}}function Bz(t){return function(e){return mx(e,t)}}function Dx(t){return ni(t)?t:SH(t)}function qz(t){return function(e){var r=vn(e);return r==$u?hx(e):r==Iu?ZH(e):JH(e,t(e))}}function vx(t,e,r,n,i,o){var s=i&vs,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var c=o.get(t);if(c)return c==e;var l=-1,f=!0,h=i&Pf?new Tf:void 0;for(o.set(t,e);++l<a;){var d=t[l],p=e[l];if(n)var v=s?n(p,d,l,e,t,o):n(d,p,l,t,e,o);if(v!==void 0){if(v)continue;f=!1;break}if(h){if(!KH(e,function(g,w){if(!h.has(w)&&(d===g||r(d,g,n,i,o)))return h.add(w)})){f=!1;break}}else if(!(d===p||r(d,p,n,i,o))){f=!1;break}}return o.delete(t),f}function Mz(t,e,r,n,i,o,s){switch(r){case Af:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case dx:return!(t.byteLength!=e.byteLength||!n(new rx(t),new rx(e)));case ox:case sx:return+t==+e;case ax:return t.name==e.name&&t.message==e.message;case cx:return t!=+t?e!=+e:t==+e;case lx:case Ry:return t==e+"";case $u:var a=hx;case Iu:var u=o&vs;if(a||(a=XH),t.size!=e.size&&!u)return!1;var c=s.get(t);return c?c==e:(o|=Pf,s.set(t,e),vx(a(t),a(e),n,i,o,s));case fx:if(Ey)return Ey.call(t)==Ey.call(e)}return!1}function Uz(t,e,r,n,i,o){var s=i&vs,a=Ty(t),u=a.length,c=Ty(e),l=c.length;if(u!=l&&!s)return!1;for(var f=u;f--;){var h=a[f];if(!(s?h in e:gx(e,h)))return!1}var d=o.get(t);if(d)return d==e;var p=!0;o.set(t,e);for(var v=s;++f<u;){h=a[f];var g=t[h],w=e[h];if(n)var x=s?n(w,g,h,e,t,o):n(g,w,h,t,e,o);if(!(x===void 0?g===w||r(g,w,n,i,o):x)){p=!1;break}v||(v=h=="constructor")}if(p&&!v){var y=t.constructor,C=e.constructor;y!=C&&"constructor"in t&&"constructor"in e&&!(typeof y=="function"&&y instanceof y&&typeof C=="function"&&C instanceof C)&&(p=!1)}return o.delete(t),p}var Vz=yx("length");function jf(t,e){var r=t.__data__;return Kz(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Hz(t){for(var e=rG(t),r=e.length;r--;)e[r][2]=wx(e[r][1]);return e}function bs(t,e){var r=t[e];return Zz(r)?r:void 0}function zz(t){return nz(Object(t))}function vn(t){return Xi.call(t)}(Fy&&vn(new Fy(new ArrayBuffer(1)))!=Af||kf&&vn(new kf)!=$u||Oy&&vn(Oy.resolve())!=Q1||Ay&&vn(new Ay)!=Iu||ky&&vn(new ky)!=Sy)&&(vn=function(t){var e=Xi.call(t),r=e==ys?t.constructor:void 0,n=r?Qi(r):void 0;if(n)switch(n){case oz:return Af;case sz:return $u;case az:return Q1;case uz:return Iu;case cz:return Sy}return e});function Gz(t,e,r){e=Nf(e,t)?[e]:Dx(e);for(var n,i=-1,s=e.length;++i<s;){var o=Lf(e[i]);if(!(n=t!=null&&r(t,o)))break;t=t[o]}if(n)return n;var s=t?t.length:0;return!!s&&Bf(s)&&bx(o,s)&&(ni(t)||xx(t)||Ex(t))}function Wz(t){var e=t?t.length:void 0;return Bf(e)&&(ni(t)||xx(t)||Ex(t))?YH(e,String):null}function bx(t,e){return e=e??ix,!!e&&(typeof t=="number"||UH.test(t))&&t>-1&&t%1==0&&t<e}function Nf(t,e){if(ni(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Fx(t)?!0:BH.test(t)||!LH.test(t)||e!=null&&t in Object(e)}function Kz(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Yz(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||$f;return t===r}function wx(t){return t===t&&!qf(t)}function _x(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Lf(t){if(typeof t=="string"||Fx(t))return t;var e=t+"";return e=="0"&&1/t==-FH?"-0":e}function Qi(t){if(t!=null){try{return px.call(t)}catch{}try{return t+""}catch{}}return""}function Jz(t,e){return t===e||t!==t&&e!==e}function Ex(t){return Xz(t)&&Ki.call(t,"callee")&&(!tz.call(t,"callee")||Xi.call(t)==Of)}var ni=Array.isArray;function Cx(t){return t!=null&&Bf(Vz(t))&&!Sx(t)}function Xz(t){return Lu(t)&&Cx(t)}function Sx(t){var e=qf(t)?Xi.call(t):"";return e==ux||e==OH}function Bf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ix}function qf(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Lu(t){return!!t&&typeof t=="object"}function Zz(t){if(!qf(t))return!1;var e=Sx(t)||xy(t)?ez:MH;return e.test(Qi(t))}function xx(t){return typeof t=="string"||!ni(t)&&Lu(t)&&Xi.call(t)==Ry}function Fx(t){return typeof t=="symbol"||Lu(t)&&Xi.call(t)==fx}function Qz(t){return Lu(t)&&Bf(t.length)&&!!Re[Xi.call(t)]}function eG(t,e,r){var n=t==null?void 0:mx(t,e);return n===void 0?r:n}function tG(t,e){return t!=null&&Gz(t,e,Pz)}function Ty(t){var e=Yz(t);if(!(e||Cx(t)))return jz(t);var r=Wz(t),n=!!r,i=r||[],o=i.length;for(var s in t)gx(t,s)&&!(n&&(s=="length"||bx(s,o)))&&!(e&&s=="constructor")&&i.push(s);return i}var rG=qz(Ty);function nG(t){return t}function iG(t){return Nf(t)?yx(Lf(t)):Bz(t)}Ds.exports=Iz});var Rx=D((eo,ws)=>{var oG=1/0,sG="[object Function]",aG="[object GeneratorFunction]",uG=/[\\^$.*+?()[\]{}|]/g,cG=/^\[object .+?Constructor\]$/,Bu={function:!0,object:!0},lG=Bu[typeof eo]&&eo&&!eo.nodeType?eo:void 0,fG=Bu[typeof ws]&&ws&&!ws.nodeType?ws:void 0,dG=Mf(lG&&fG&&typeof global=="object"&&global),hG=Mf(Bu[typeof self]&&self),Ax=Mf(Bu[typeof window]&&window),Iy=Mf(Bu[typeof eo]&&eo),pG=dG||Ax!==(Iy&&Iy.window)&&Ax||hG||Iy||Function("return this")();function Mf(t){return t&&t.Object===Object?t:null}function mG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function gG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var kx=Object.prototype,Tx=Function.prototype.toString,yG=kx.hasOwnProperty,DG=kx.toString,vG=RegExp("^"+Tx.call(yG).replace(uG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jy=wG(pG,"Set"),bG=jy&&1/gG(new jy([,-0]))[1]==oG?function(t){return new jy(t)}:SG;function wG(t,e){var r=t[e];return CG(r)?r:void 0}function _G(t){if(t!=null){try{return Tx.call(t)}catch{}try{return t+""}catch{}}return""}function EG(t){var e=Px(t)?DG.call(t):"";return e==sG||e==aG}function Px(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function CG(t){if(!Px(t))return!1;var e=EG(t)||mG(t)?vG:cG;return e.test(_G(t))}function SG(){}ws.exports=bG});var Ix=D((to,_s)=>{var qu={function:!0,object:!0},xG=qu[typeof to]&&to&&!to.nodeType?to:void 0,FG=qu[typeof _s]&&_s&&!_s.nodeType?_s:void 0,OG=Uf(xG&&FG&&typeof global=="object"&&global),AG=Uf(qu[typeof self]&&self),$x=Uf(qu[typeof window]&&window),Ny=Uf(qu[typeof to]&&to),kG=OG||$x!==(Ny&&Ny.window)&&$x||AG||Ny||Function("return this")();function Uf(t){return t&&t.Object===Object?t:null}_s.exports=kG});var Mx=D((jde,qx)=>{var TG=Rx(),PG=Ix(),RG=200,Ly="__lodash_hash_undefined__",$G="[object Function]",IG="[object GeneratorFunction]",jG=/[\\^$.*+?()[\]{}|]/g,NG=/^\[object .+?Constructor\]$/;function LG(t,e){return!!t.length&&qG(t,e,0)>-1}function BG(t,e,r){for(var n=-1,i=t.length;++n<i;)if(r(e,t[n]))return!0;return!1}function qG(t,e,r){if(e!==e)return UG(t,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function MG(t,e){return t.has(e)}function UG(t,e,r){for(var n=t.length,i=e+(r?0:-1);r?i--:++i<n;){var o=t[i];if(o!==o)return i}return-1}function VG(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function HG(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var zG=Array.prototype,jx=Object.prototype,Nx=Function.prototype.toString,By=jx.hasOwnProperty,GG=jx.toString,WG=RegExp("^"+Nx.call(By).replace(jG,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),KG=zG.splice,YG=Lx(PG,"Map"),Mu=Lx(Object,"create");function ro(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function JG(){this.__data__=Mu?Mu(null):{}}function XG(t){return this.has(t)&&delete this.__data__[t]}function ZG(t){var e=this.__data__;if(Mu){var r=e[t];return r===Ly?void 0:r}return By.call(e,t)?e[t]:void 0}function QG(t){var e=this.__data__;return Mu?e[t]!==void 0:By.call(e,t)}function eW(t,e){var r=this.__data__;return r[t]=Mu&&e===void 0?Ly:e,this}ro.prototype.clear=JG;ro.prototype.delete=XG;ro.prototype.get=ZG;ro.prototype.has=QG;ro.prototype.set=eW;function Es(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function tW(){this.__data__=[]}function rW(t){var e=this.__data__,r=Hf(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():KG.call(e,r,1),!0}function nW(t){var e=this.__data__,r=Hf(e,t);return r<0?void 0:e[r][1]}function iW(t){return Hf(this.__data__,t)>-1}function oW(t,e){var r=this.__data__,n=Hf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Es.prototype.clear=tW;Es.prototype.delete=rW;Es.prototype.get=nW;Es.prototype.has=iW;Es.prototype.set=oW;function Cs(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function sW(){this.__data__={hash:new ro,map:new(YG||Es),string:new ro}}function aW(t){return zf(this,t).delete(t)}function uW(t){return zf(this,t).get(t)}function cW(t){return zf(this,t).has(t)}function lW(t,e){return zf(this,t).set(t,e),this}Cs.prototype.clear=sW;Cs.prototype.delete=aW;Cs.prototype.get=uW;Cs.prototype.has=cW;Cs.prototype.set=lW;function Vf(t){var e=-1,r=t?t.length:0;for(this.__data__=new Cs;++e<r;)this.add(t[e])}function fW(t){return this.__data__.set(t,Ly),this}function dW(t){return this.__data__.has(t)}Vf.prototype.add=Vf.prototype.push=fW;Vf.prototype.has=dW;function Hf(t,e){for(var r=t.length;r--;)if(gW(t[r][0],e))return r;return-1}function hW(t,e,r){var n=-1,i=LG,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=BG;else if(o>=RG){var c=e?null:TG(t);if(c)return HG(c);s=!1,i=MG,u=new Vf}else u=e?[]:a;e:for(;++n<o;){var l=t[n],f=e?e(l):l;if(l=r||l!==0?l:0,s&&f===f){for(var h=u.length;h--;)if(u[h]===f)continue e;e&&u.push(f),a.push(l)}else i(u,f,r)||(u!==a&&u.push(f),a.push(l))}return a}function zf(t,e){var r=t.__data__;return pW(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Lx(t,e){var r=t[e];return DW(r)?r:void 0}function pW(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function mW(t){if(t!=null){try{return Nx.call(t)}catch{}try{return t+""}catch{}}return""}function gW(t,e){return t===e||t!==t&&e!==e}function yW(t){var e=Bx(t)?GG.call(t):"";return e==$G||e==IG}function Bx(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function DW(t){if(!Bx(t))return!1;var e=yW(t)||VG(t)?WG:NG;return e.test(mW(t))}qx.exports=hW});var Vx=D((Nde,Ux)=>{var vW=Ox(),bW=Mx();function wW(t,e){return t&&t.length?bW(t,vW(e)):[]}Ux.exports=wW});var zx=D((Lde,Hx)=>{"use strict";var _W=q1(),EW=Vx(),CW=_W("MultiError");Hx.exports=qy;function qy(t){if(!(this instanceof qy))return new qy(t);if(t=Array.isArray(t)?t:[t],t=EW(t,function(r){return r.stack}),t.length===1)return t[0];var e=new CW({message:t.map(function(r){return r.message}).join("; "),errors:t.reduce(function(r,n){return r.concat(n.errors||n)},[])});return e.__defineGetter__("stack",function(){return t.map(function(r){return r.stack}).join(`
36
36
 
37
37
  `)}),e.__defineSetter__("stack",function(r){return[r].concat(e.stack).join(`
38
38
 
39
- `)}),e}});var Wx=D((Lde,Gx)=>{var ii=require("constants"),CW=process.cwd,Gf=null,SW=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Gf||(Gf=CW.call(process)),Gf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(My=process.chdir,process.chdir=function(t){Gf=null,My.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,My));var My;Gx.exports=xW;function xW(t){ii.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),SW==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var v=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){t.stat(d,function(y,C){y&&y.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,v,g,w){var x;if(w&&typeof w=="function"){var y=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&y<10)return y++,l.call(t,h,d,p,v,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,v,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,v){for(var g=0;;)try{return l.call(t,f,h,d,p,v)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,ii.O_WRONLY|ii.O_SYMLINK,h,function(p,v){if(p){d&&d(p);return}l.fchmod(v,h,function(g){l.close(v,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,ii.O_WRONLY|ii.O_SYMLINK,h),p=!0,v;try{v=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return v}}function r(l){ii.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,ii.O_SYMLINK,function(v,g){if(v){p&&p(v);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,ii.O_SYMLINK),v,g=!0;try{v=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return v}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(v){c(v)&&(v=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(v,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Jx=D((Bde,Yx)=>{var Kx=require("stream").Stream;Yx.exports=FW;function FW(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Kx.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Kx.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Zx=D((qde,Xx)=>{"use strict";Xx.exports=AW;var OW=Object.getPrototypeOf||function(t){return t.__proto__};function AW(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:OW(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var dt=D((Mde,Hy)=>{var Ve=require("fs"),kW=Wx(),TW=Jx(),PW=Zx(),Wf=require("util"),wt,Yf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(wt=Symbol.for("graceful-fs.queue"),Yf=Symbol.for("graceful-fs.previous")):(wt="___graceful-fs.queue",Yf="___graceful-fs.previous");function RW(){}function tF(t,e){Object.defineProperty(t,wt,{get:function(){return e}})}var no=RW;Wf.debuglog?no=Wf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(no=function(){var t=Wf.format.apply(Wf,arguments);t="GFS4: "+t.split(/\n/).join(`
40
- GFS4: `),console.error(t)});Ve[wt]||(Qx=global[wt]||[],tF(Ve,Qx),Ve.close=function(t){function e(r,n){return t.call(Ve,r,function(i){i||eF(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Yf,{value:t}),e}(Ve.close),Ve.closeSync=function(t){function e(r){t.apply(Ve,arguments),eF()}return Object.defineProperty(e,Yf,{value:t}),e}(Ve.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){no(Ve[wt]),require("assert").equal(Ve[wt].length,0)}));var Qx;global[wt]||tF(global,Ve[wt]);Hy.exports=Uy(PW(Ve));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ve.__patched&&(Hy.exports=Uy(Ve),Ve.__patched=!0);function Uy(t){kW(t),t.gracefulify=Uy,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(b){b&&(b.code==="EMFILE"||b.code==="ENFILE")?Ss([B,[q,K,M],b,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Ss([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Ss([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,b,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Ss([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,b,_){return c(M,q(M,E,b,_))}:function(M,E,b,_){return c(M,E,q(M,E,b,_))};return B(S,I,R);function q(K,M,E,b){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?Ss([B,[K,M,E],_,b||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=TW(t);w=h.ReadStream,y=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(y.prototype=Object.create(p.prototype),y.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return y},set:function(S){y=S},enumerable:!0,configurable:!0});var v=w;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(S){v=S},enumerable:!0,configurable:!0});var g=y;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function y(S,I){return this instanceof y?(p.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Ss([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}return t}function Ss(t){no("ENQUEUE",t[0].name,t[1]),Ve[wt].push(t),Vy()}var Kf;function eF(){for(var t=Date.now(),e=0;e<Ve[wt].length;++e)Ve[wt][e].length>2&&(Ve[wt][e][3]=t,Ve[wt][e][4]=t);Vy()}function Vy(){if(clearTimeout(Kf),Kf=void 0,Ve[wt].length!==0){var t=Ve[wt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)no("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){no("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(no("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ve[wt].push(t)}Kf===void 0&&(Kf=setTimeout(Vy,0))}}});var nF=D((Ude,rF)=>{function Dr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}rF.exports=Dr;Dr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Dr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Dr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};Dr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Dr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Dr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Dr.prototype.start=Dr.prototype.try;Dr.prototype.errors=function(){return this._errors};Dr.prototype.attempts=function(){return this._attempts};Dr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var iF=D(io=>{var $W=nF();io.operation=function(t){var e=io.timeouts(t);return new $W(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};io.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};io.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};io.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=function(u){var c=io.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(h){c.retry(h)||(h&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,s),t[o].options=e}}});var sF=D((Hde,oF)=>{oF.exports=iF()});var aF=D((zde,Jf)=>{Jf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Jf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Jf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Wy=D((Gde,Os)=>{var Le=global.process,oo=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};oo(Le)?(uF=require("assert"),xs=aF(),cF=/^win/i.test(Le.platform),Uu=require("events"),typeof Uu!="function"&&(Uu=Uu.EventEmitter),Le.__signal_exit_emitter__?ht=Le.__signal_exit_emitter__:(ht=Le.__signal_exit_emitter__=new Uu,ht.count=0,ht.emitted={}),ht.infinite||(ht.setMaxListeners(1/0),ht.infinite=!0),Os.exports=function(t,e){if(!oo(global.process))return function(){};uF.equal(typeof t,"function","a callback must be provided for exit handler"),Fs===!1&&zy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){ht.removeListener(r,t),ht.listeners("exit").length===0&&ht.listeners("afterexit").length===0&&Xf()};return ht.on(r,t),n},Xf=function(){!Fs||!oo(global.process)||(Fs=!1,xs.forEach(function(e){try{Le.removeListener(e,Zf[e])}catch{}}),Le.emit=Qf,Le.reallyExit=Gy,ht.count-=1)},Os.exports.unload=Xf,so=function(e,r,n){ht.emitted[e]||(ht.emitted[e]=!0,ht.emit(e,r,n))},Zf={},xs.forEach(function(t){Zf[t]=function(){if(oo(global.process)){var r=Le.listeners(t);r.length===ht.count&&(Xf(),so("exit",null,t),so("afterexit",null,t),cF&&t==="SIGHUP"&&(t="SIGINT"),Le.kill(Le.pid,t))}}}),Os.exports.signals=function(){return xs},Fs=!1,zy=function(){Fs||!oo(global.process)||(Fs=!0,ht.count+=1,xs=xs.filter(function(e){try{return Le.on(e,Zf[e]),!0}catch{return!1}}),Le.emit=fF,Le.reallyExit=lF)},Os.exports.load=zy,Gy=Le.reallyExit,lF=function(e){oo(global.process)&&(Le.exitCode=e||0,so("exit",Le.exitCode,null),so("afterexit",Le.exitCode,null),Gy.call(Le,Le.exitCode))},Qf=Le.emit,fF=function(e,r){if(e==="exit"&&oo(global.process)){r!==void 0&&(Le.exitCode=r);var n=Qf.apply(this,arguments);return so("exit",Le.exitCode,null),so("afterexit",Le.exitCode,null),n}else return Qf.apply(this,arguments)}):Os.exports=function(){return function(){}};var uF,xs,cF,Uu,ht,Xf,so,Zf,Fs,zy,Gy,lF,Qf,fF});var hF=D((Wde,Ky)=>{"use strict";var dF=Symbol();function IW(t,e,r){let n=e[dF];if(n)return e.stat(t,(o,s)=>{if(o)return r(o);r(null,s.mtime,n)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,o=>{if(o)return r(o);e.stat(t,(s,a)=>{if(s)return r(s);let u=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,dF,{value:u}),r(null,a.mtime,u)})})}function jW(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Ky.exports.probe=IW;Ky.exports.getMtime=jW});var DF=D((Kde,Hu)=>{"use strict";var NW=require("path"),Xy=dt(),LW=sF(),BW=Wy(),pF=hF(),_n={};function Vu(t,e){return e.lockfilePath||`${t}.lock`}function Zy(t,e,r){if(!e.realpath)return r(null,NW.resolve(t));e.fs.realpath(t,r)}function Jy(t,e,r){let n=Vu(t,e);e.fs.mkdir(n,i=>{if(!i)return pF.probe(n,e.fs,(o,s,a)=>{if(o)return e.fs.rmdir(n,()=>{}),r(o);r(null,s,a)});if(i.code!=="EEXIST")return r(i);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(o,s)=>{if(o)return o.code==="ENOENT"?Jy(t,{...e,stale:0},r):r(o);if(!mF(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));gF(t,e,a=>{if(a)return r(a);Jy(t,{...e,stale:0},r)})})})}function mF(t,e){return t.mtime.getTime()<Date.now()-e.stale}function gF(t,e,r){e.fs.rmdir(Vu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function ed(t,e){let r=_n[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let o=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||o?Yy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,ed(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Yy(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=pF.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?Yy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,ed(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,ed(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Yy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),_n[t]===e&&delete _n[t],e.options.onCompromised(r)}function qW(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Xy,onCompromised:n=>{throw n},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),Zy(t,e,(n,i)=>{if(n)return r(n);let o=LW.operation(e.retries);o.attempt(()=>{Jy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let c=_n[i]={lockfilePath:Vu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};ed(i,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));yF(i,{...e,realpath:!1},l)})})})})}function yF(t,e,r){e={fs:Xy,realpath:!0,...e},Zy(t,e,(n,i)=>{if(n)return r(n);let o=_n[i];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete _n[i],gF(i,e,r)})}function MW(t,e,r){e={stale:1e4,realpath:!0,fs:Xy,...e},e.stale=Math.max(e.stale||0,2e3),Zy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Vu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!mF(s,e)))})}function UW(){return _n}BW(()=>{for(let t in _n){let e=_n[t].options;try{e.fs.rmdirSync(Vu(t,e))}catch{}}});Hu.exports.lock=qW;Hu.exports.unlock=yF;Hu.exports.check=MW;Hu.exports.getLocks=UW});var bF=D((Yde,vF)=>{"use strict";var VW=dt();function HW(t){let e=["mkdir","realpath","stat","rmdir","utimes"],r={...t};return e.forEach(n=>{r[n]=(...i)=>{let o=i.pop(),s;try{s=t[`${n}Sync`](...i)}catch(a){return o(a)}o(null,s)}}),r}function zW(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function GW(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function WW(t){if(t={...t},t.fs=HW(t.fs||VW),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}vF.exports={toPromise:zW,toSync:GW,toSyncOptions:WW}});var _F=D((Jde,oi)=>{"use strict";var As=DF(),{toPromise:td,toSync:rd,toSyncOptions:Qy}=bF();async function wF(t,e){let r=await td(As.lock)(t,e);return td(r)}function KW(t,e){let r=rd(As.lock)(t,Qy(e));return rd(r)}function YW(t,e){return td(As.unlock)(t,e)}function JW(t,e){return rd(As.unlock)(t,Qy(e))}function XW(t,e){return td(As.check)(t,e)}function ZW(t,e){return rd(As.check)(t,Qy(e))}oi.exports=wF;oi.exports.lock=wF;oi.exports.unlock=YW;oi.exports.lockSync=KW;oi.exports.unlockSync=JW;oi.exports.check=XW;oi.exports.checkSync=ZW});var FF=D(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.canStoreURLs=ks.FileUrlStorage=void 0;var EF=require("fs"),QW=tK(zx()),CF=eK(_F());function xF(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(xF=function(n){return n?r:e})(t)}function eK(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=xF(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function tK(t){return t&&t.__esModule?t:{default:t}}function zu(t){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zu(t)}function rK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function SF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iK(n.key),n)}}function nK(t,e,r){return e&&SF(t.prototype,e),r&&SF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function iK(t){var e=oK(t,"string");return zu(e)=="symbol"?e:e+""}function oK(t,e){if(zu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(zu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Xde=ks.canStoreURLs=!0,Zde=ks.FileUrlStorage=function(){function t(e){rK(this,t),this.path=e}return nK(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(o,s){o?i(o):n(s)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,o){n._getItems("tus::".concat(r),function(s,a){s?o(s):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,o){n._removeItem(r,function(s){s?o(s):i()})})}},{key:"addUpload",value:function(r,n){var i=this,o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return new Promise(function(a,u){i._setItem(s,n,function(c){c?u(c):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;CF.lock(this.path,this._lockfileOptions()).then(function(s){i=o._releaseAndCb(s,i),o._getData(function(a,u){if(a){i(a);return}u[r]=n,o._writeData(u,function(c){return i(c)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,o){if(i){n(i);return}var s=Object.keys(o).filter(function(a){return a.startsWith(r)}).map(function(a){var u=o[a];return u.urlStorageKey=a,u});n(null,s)})}},{key:"_removeItem",value:function(r,n){var i=this;CF.lock(this.path,this._lockfileOptions()).then(function(o){n=i._releaseAndCb(o,n),i._getData(function(s,a){if(s){n(s);return}delete a[r],i._writeData(a,function(u){return n(u)})})}).catch(n)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(r,n){return function(i){if(i){r().then(function(){return n(i)}).catch(function(o){return n((0,QW.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,EF.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,EF.readFile)(this.path,"utf8",function(n,i){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{i=i.trim().length?JSON.parse(i):{}}catch(o){r(o);return}r(null,i)})}}])}()});var rD=D(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});Object.defineProperty(zt,"DefaultHttpStack",{enumerable:!0,get:function(){return TF.default}});Object.defineProperty(zt,"DetailedError",{enumerable:!0,get:function(){return sK.default}});Object.defineProperty(zt,"FileUrlStorage",{enumerable:!0,get:function(){return PF.FileUrlStorage}});Object.defineProperty(zt,"StreamSource",{enumerable:!0,get:function(){return fK.default}});zt.Upload=void 0;Object.defineProperty(zt,"canStoreURLs",{enumerable:!0,get:function(){return PF.canStoreURLs}});zt.defaultOptions=void 0;Object.defineProperty(zt,"enableDebugLog",{enumerable:!0,get:function(){return aK.enableDebugLog}});zt.isSupported=void 0;var sK=ao(Kg()),aK=Yg(),uK=ao(FS()),eD=ao(n1()),cK=ao(g1()),lK=ao(b1()),TF=ao($1()),fK=ao(ly()),PF=FF();function ao(t){return t&&t.__esModule?t:{default:t}}function Ps(t){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ps(t)}function dK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$F(n.key),n)}}function hK(t,e,r){return e&&OF(t.prototype,e),r&&OF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function pK(t,e,r){return e=nd(e),mK(t,RF()?Reflect.construct(e,r||[],nd(t).constructor):e.apply(t,r))}function mK(t,e){if(e&&(Ps(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gK(t)}function gK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function RF(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RF=function(){return!!t})()}function nd(t){return nd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nd(t)}function yK(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tD(t,e)}function tD(t,e){return tD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},tD(t,e)}function AF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ts(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?AF(Object(r),!0).forEach(function(n){DK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):AF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function DK(t,e,r){return e=$F(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $F(t){var e=vK(t,"string");return Ps(e)=="symbol"?e:e+""}function vK(t,e){if(Ps(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ps(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var kF=zt.defaultOptions=Ts(Ts({},eD.default.defaultOptions),{},{httpStack:new TF.default,fileReader:new cK.default,urlStorage:new uK.default,fingerprint:lK.default}),ehe=zt.Upload=function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return dK(this,e),n=Ts(Ts({},kF),n),pK(this,e,[r,n])}return yK(e,t),hK(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=Ts(Ts({},kF),i),eD.default.terminate(n,i)}}])}(eD.default),the=zt.isSupported=!0});var En={};mn(En,{__addDisposableResource:()=>t2,__assign:()=>id,__asyncDelegator:()=>WF,__asyncGenerator:()=>GF,__asyncValues:()=>KF,__await:()=>Rs,__awaiter:()=>qF,__classPrivateFieldGet:()=>ZF,__classPrivateFieldIn:()=>e2,__classPrivateFieldSet:()=>QF,__createBinding:()=>sd,__decorate:()=>NF,__disposeResources:()=>r2,__esDecorate:()=>bK,__exportStar:()=>UF,__extends:()=>IF,__generator:()=>MF,__importDefault:()=>XF,__importStar:()=>JF,__makeTemplateObject:()=>YF,__metadata:()=>BF,__param:()=>LF,__propKey:()=>_K,__read:()=>iD,__rest:()=>jF,__runInitializers:()=>wK,__setFunctionName:()=>EK,__spread:()=>VF,__spreadArray:()=>zF,__spreadArrays:()=>HF,__values:()=>od,default:()=>xK});function IF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");nD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function jF(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function NF(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function LF(t,e){return function(r,n){e(r,n,t)}}function bK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function wK(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function _K(t){return typeof t=="symbol"?t:"".concat(t)}function EK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function BF(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function qF(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function MF(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function UF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sd(e,t,r)}function od(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function iD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function VF(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(iD(arguments[e]));return t}function HF(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function zF(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Rs(t){return this instanceof Rs?(this.v=t,this):new Rs(t)}function GF(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(d){return function(p){return Promise.resolve(p).then(d,f)}}function a(d,p){n[d]&&(i[d]=function(v){return new Promise(function(g,w){o.push([d,v,g,w])>1||u(d,v)})},p&&(i[d]=p(i[d])))}function u(d,p){try{c(n[d](p))}catch(v){h(o[0][3],v)}}function c(d){d.value instanceof Rs?Promise.resolve(d.value.v).then(l,f):h(o[0][2],d)}function l(d){u("next",d)}function f(d){u("throw",d)}function h(d,p){d(p),o.shift(),o.length&&u(o[0][0],o[0][1])}}function WF(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Rs(t[i](s)),done:!1}:o?o(s):s}:o}}function KF(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof od=="function"?od(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function YF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function JF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&sd(e,t,r);return CK(e,t),e}function XF(t){return t&&t.__esModule?t:{default:t}}function ZF(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function QF(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function e2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function t2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function r2(t){function e(o){t.error=t.hasError?new SK(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}var nD,id,sd,CK,SK,xK,Cn=ut(()=>{nD=function(t,e){return nD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},nD(t,e)};id=function(){return id=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},id.apply(this,arguments)};sd=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};CK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};SK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};xK={__extends:IF,__assign:id,__rest:jF,__decorate:NF,__param:LF,__metadata:BF,__awaiter:qF,__generator:MF,__createBinding:sd,__exportStar:UF,__values:od,__read:iD,__spread:VF,__spreadArrays:HF,__spreadArray:zF,__await:Rs,__asyncGenerator:GF,__asyncDelegator:WF,__asyncValues:KF,__makeTemplateObject:YF,__importStar:JF,__importDefault:XF,__classPrivateFieldGet:ZF,__classPrivateFieldSet:QF,__classPrivateFieldIn:e2,__addDisposableResource:t2,__disposeResources:r2}});var S2={};mn(S2,{__addDisposableResource:()=>E2,__assign:()=>ad,__asyncDelegator:()=>m2,__asyncGenerator:()=>p2,__asyncValues:()=>g2,__await:()=>$s,__awaiter:()=>u2,__classPrivateFieldGet:()=>b2,__classPrivateFieldIn:()=>_2,__classPrivateFieldSet:()=>w2,__createBinding:()=>cd,__decorate:()=>o2,__disposeResources:()=>C2,__esDecorate:()=>FK,__exportStar:()=>l2,__extends:()=>n2,__generator:()=>c2,__importDefault:()=>v2,__importStar:()=>D2,__makeTemplateObject:()=>y2,__metadata:()=>a2,__param:()=>s2,__propKey:()=>AK,__read:()=>sD,__rest:()=>i2,__runInitializers:()=>OK,__setFunctionName:()=>kK,__spread:()=>f2,__spreadArray:()=>h2,__spreadArrays:()=>d2,__values:()=>ud,default:()=>RK});function n2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");oD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function i2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function o2(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function s2(t,e){return function(r,n){e(r,n,t)}}function FK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function OK(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function AK(t){return typeof t=="symbol"?t:"".concat(t)}function kK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function a2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function u2(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function c2(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function l2(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cd(e,t,r)}function ud(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function sD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function f2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(sD(arguments[e]));return t}function d2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function h2(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function $s(t){return this instanceof $s?(this.v=t,this):new $s(t)}function p2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,v){o.push([h,d,p,v])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof $s?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function m2(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:$s(t[i](s)),done:!1}:o?o(s):s}:o}}function g2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ud=="function"?ud(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function y2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function D2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&cd(e,t,r);return TK(e,t),e}function v2(t){return t&&t.__esModule?t:{default:t}}function b2(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function w2(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function _2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function E2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function C2(t){function e(n){t.error=t.hasError?new PK(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var oD,ad,cd,TK,PK,RK,x2=ut(()=>{oD=function(t,e){return oD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},oD(t,e)};ad=function(){return ad=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ad.apply(this,arguments)};cd=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};TK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};PK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};RK={__extends:n2,__assign:ad,__rest:i2,__decorate:o2,__param:s2,__metadata:a2,__awaiter:u2,__generator:c2,__createBinding:cd,__exportStar:l2,__values:ud,__read:sD,__spread:f2,__spreadArrays:d2,__spreadArray:h2,__await:$s,__asyncGenerator:p2,__asyncDelegator:m2,__asyncValues:g2,__makeTemplateObject:y2,__importStar:D2,__importDefault:v2,__classPrivateFieldGet:b2,__classPrivateFieldSet:w2,__classPrivateFieldIn:_2,__addDisposableResource:E2,__disposeResources:C2}});var Gt=D(aD=>{"use strict";aD.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((i,o)=>i!=null?n(i):r(o)),t.apply(this,e)})},"name",{value:t.name})};aD.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var Gu=D(si=>{"use strict";var F2=Gt().fromCallback,Pt=dt(),$K=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Pt[t]=="function");Object.keys(Pt).forEach(t=>{t!=="promises"&&(si[t]=Pt[t])});$K.forEach(t=>{si[t]=F2(Pt[t])});si.exists=function(t,e){return typeof e=="function"?Pt.exists(t,e):new Promise(r=>Pt.exists(t,r))};si.read=function(t,e,r,n,i,o){return typeof o=="function"?Pt.read(t,e,r,n,i,o):new Promise((s,a)=>{Pt.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);s({bytesRead:c,buffer:l})})})};si.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.write(t,e,...r):new Promise((n,i)=>{Pt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};typeof Pt.writev=="function"&&(si.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.writev(t,e,...r):new Promise((n,i)=>{Pt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})});typeof Pt.realpath.native=="function"&&(si.realpath.native=F2(Pt.realpath.native))});var uD=D((ohe,O2)=>{O2.exports=t=>{let e=process.versions.node.split(".").map(r=>parseInt(r,10));return t=t.split(".").map(r=>parseInt(r,10)),e[0]>t[0]||e[0]===t[0]&&(e[1]>t[1]||e[1]===t[1]&&e[2]>=t[2])}});var R2=D((she,cD)=>{"use strict";var Is=Gu(),Sn=require("path"),IK=uD(),A2=IK("10.12.0"),k2=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Sn.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}},T2=t=>{let e={mode:511};return typeof t=="number"&&(t={mode:t}),{...e,...t}},P2=t=>{let e=new Error(`operation not permitted, mkdir '${t}'`);return e.code="EPERM",e.errno=-4048,e.path=t,e.syscall="mkdir",e};cD.exports.makeDir=async(t,e)=>{if(k2(t),e=T2(e),A2){let n=Sn.resolve(t);return Is.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await Is.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return await r(Sn.dirname(n)),r(n)}try{if(!(await Is.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))};cD.exports.makeDirSync=(t,e)=>{if(k2(t),e=T2(e),A2){let n=Sn.resolve(t);return Is.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{Is.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return r(Sn.dirname(n)),r(n)}try{if(!Is.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))}});var kr=D((ahe,$2)=>{"use strict";var jK=Gt().fromPromise,{makeDir:NK,makeDirSync:lD}=R2(),fD=jK(NK);$2.exports={mkdirs:fD,mkdirsSync:lD,mkdirp:fD,mkdirpSync:lD,ensureDir:fD,ensureDirSync:lD}});var dD=D((uhe,I2)=>{"use strict";var js=dt();function LK(t,e,r,n){js.open(t,"r+",(i,o)=>{if(i)return n(i);js.futimes(o,e,r,s=>{js.close(o,a=>{n&&n(s||a)})})})}function BK(t,e,r){let n=js.openSync(t,"r+");return js.futimesSync(n,e,r),js.closeSync(n)}I2.exports={utimesMillis:LK,utimesMillisSync:BK}});var Wu=D((che,B2)=>{"use strict";var Ns=Gu(),Wt=require("path"),qK=require("util"),MK=uD(),ld=MK("10.5.0"),j2=t=>ld?Ns.stat(t,{bigint:!0}):Ns.stat(t),hD=t=>ld?Ns.statSync(t,{bigint:!0}):Ns.statSync(t);function UK(t,e){return Promise.all([j2(t),j2(e).catch(r=>{if(r.code==="ENOENT")return null;throw r})]).then(([r,n])=>({srcStat:r,destStat:n}))}function VK(t,e){let r,n=hD(t);try{r=hD(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function HK(t,e,r,n){qK.callbackify(UK)(t,e,(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;return a&&fd(s,a)?n(new Error("Source and destination must not be the same.")):s.isDirectory()&&pD(t,e)?n(new Error(dd(t,e,r))):n(null,{srcStat:s,destStat:a})})}function zK(t,e,r){let{srcStat:n,destStat:i}=VK(t,e);if(i&&fd(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&pD(t,e))throw new Error(dd(t,e,r));return{srcStat:n,destStat:i}}function N2(t,e,r,n,i){let o=Wt.resolve(Wt.dirname(t)),s=Wt.resolve(Wt.dirname(r));if(s===o||s===Wt.parse(s).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):fd(e,c)?i(new Error(dd(t,r,n))):N2(t,e,s,n,i);ld?Ns.stat(s,{bigint:!0},a):Ns.stat(s,a)}function L2(t,e,r,n){let i=Wt.resolve(Wt.dirname(t)),o=Wt.resolve(Wt.dirname(r));if(o===i||o===Wt.parse(o).root)return;let s;try{s=hD(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(fd(e,s))throw new Error(dd(t,r,n));return L2(t,e,o,n)}function fd(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(ld||e.ino<Number.MAX_SAFE_INTEGER||e.size===t.size&&e.mode===t.mode&&e.nlink===t.nlink&&e.atimeMs===t.atimeMs&&e.mtimeMs===t.mtimeMs&&e.ctimeMs===t.ctimeMs&&e.birthtimeMs===t.birthtimeMs))}function pD(t,e){let r=Wt.resolve(t).split(Wt.sep).filter(i=>i),n=Wt.resolve(e).split(Wt.sep).filter(i=>i);return r.reduce((i,o,s)=>i&&n[s]===o,!0)}function dd(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}B2.exports={checkPaths:HK,checkPathsSync:zK,checkParentPaths:N2,checkParentPathsSync:L2,isSrcSubdir:pD}});var H2=D((lhe,V2)=>{"use strict";var Ct=dt(),Ku=require("path"),GK=kr().mkdirsSync,WK=dD().utimesMillisSync,Yu=Wu();function KK(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
39
+ `)}),e}});var Wx=D((Bde,Gx)=>{var ii=require("constants"),SW=process.cwd,Gf=null,xW=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Gf||(Gf=SW.call(process)),Gf};try{process.cwd()}catch{}typeof process.chdir=="function"&&(My=process.chdir,process.chdir=function(t){Gf=null,My.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,My));var My;Gx.exports=FW;function FW(t){ii.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),xW==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var v=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM"||x.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){t.stat(d,function(y,C){y&&y.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,v,g,w){var x;if(w&&typeof w=="function"){var y=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&y<10)return y++,l.call(t,h,d,p,v,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,v,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,v){for(var g=0;;)try{return l.call(t,f,h,d,p,v)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,ii.O_WRONLY|ii.O_SYMLINK,h,function(p,v){if(p){d&&d(p);return}l.fchmod(v,h,function(g){l.close(v,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,ii.O_WRONLY|ii.O_SYMLINK,h),p=!0,v;try{v=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return v}}function r(l){ii.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,ii.O_SYMLINK,function(v,g){if(v){p&&p(v);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,ii.O_SYMLINK),v,g=!0;try{v=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return v}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(v){c(v)&&(v=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(v,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Jx=D((qde,Yx)=>{var Kx=require("stream").Stream;Yx.exports=OW;function OW(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Kx.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Kx.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Zx=D((Mde,Xx)=>{"use strict";Xx.exports=kW;var AW=Object.getPrototypeOf||function(t){return t.__proto__};function kW(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:AW(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var dt=D((Ude,Hy)=>{var Ve=require("fs"),TW=Wx(),PW=Jx(),RW=Zx(),Wf=require("util"),wt,Yf;typeof Symbol=="function"&&typeof Symbol.for=="function"?(wt=Symbol.for("graceful-fs.queue"),Yf=Symbol.for("graceful-fs.previous")):(wt="___graceful-fs.queue",Yf="___graceful-fs.previous");function $W(){}function tF(t,e){Object.defineProperty(t,wt,{get:function(){return e}})}var no=$W;Wf.debuglog?no=Wf.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(no=function(){var t=Wf.format.apply(Wf,arguments);t="GFS4: "+t.split(/\n/).join(`
40
+ GFS4: `),console.error(t)});Ve[wt]||(Qx=global[wt]||[],tF(Ve,Qx),Ve.close=function(t){function e(r,n){return t.call(Ve,r,function(i){i||eF(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Yf,{value:t}),e}(Ve.close),Ve.closeSync=function(t){function e(r){t.apply(Ve,arguments),eF()}return Object.defineProperty(e,Yf,{value:t}),e}(Ve.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){no(Ve[wt]),require("assert").equal(Ve[wt].length,0)}));var Qx;global[wt]||tF(global,Ve[wt]);Hy.exports=Uy(RW(Ve));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ve.__patched&&(Hy.exports=Uy(Ve),Ve.__patched=!0);function Uy(t){TW(t),t.gracefulify=Uy,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(b){b&&(b.code==="EMFILE"||b.code==="ENFILE")?Ss([B,[q,K,M],b,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Ss([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Ss([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,b,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Ss([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,b,_){return c(M,q(M,E,b,_))}:function(M,E,b,_){return c(M,E,q(M,E,b,_))};return B(S,I,R);function q(K,M,E,b){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?Ss([B,[K,M,E],_,b||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=PW(t);w=h.ReadStream,y=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(y.prototype=Object.create(p.prototype),y.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return y},set:function(S){y=S},enumerable:!0,configurable:!0});var v=w;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(S){v=S},enumerable:!0,configurable:!0});var g=y;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function y(S,I){return this instanceof y?(p.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?Ss([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}return t}function Ss(t){no("ENQUEUE",t[0].name,t[1]),Ve[wt].push(t),Vy()}var Kf;function eF(){for(var t=Date.now(),e=0;e<Ve[wt].length;++e)Ve[wt][e].length>2&&(Ve[wt][e][3]=t,Ve[wt][e][4]=t);Vy()}function Vy(){if(clearTimeout(Kf),Kf=void 0,Ve[wt].length!==0){var t=Ve[wt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)no("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){no("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(no("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ve[wt].push(t)}Kf===void 0&&(Kf=setTimeout(Vy,0))}}});var nF=D((Vde,rF)=>{function Dr(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}rF.exports=Dr;Dr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Dr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};Dr.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),r=this._timeouts.shift();else return!1;var n=this,i=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r);return this._options.unref&&i.unref(),!0};Dr.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Dr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Dr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Dr.prototype.start=Dr.prototype.try;Dr.prototype.errors=function(){return this._errors};Dr.prototype.attempts=function(){return this._attempts};Dr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,s=(t[o]||0)+1;t[o]=s,s>=r&&(e=i,r=s)}return e}});var iF=D(io=>{var IW=nF();io.operation=function(t){var e=io.timeouts(t);return new IW(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};io.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(o,s){return o-s}),n};io.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*e.minTimeout*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};io.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],s=t[o];t[o]=function(u){var c=io.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(h){c.retry(h)||(h&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,s),t[o].options=e}}});var sF=D((zde,oF)=>{oF.exports=iF()});var aF=D((Gde,Jf)=>{Jf.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Jf.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Jf.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Wy=D((Wde,Os)=>{var Le=global.process,oo=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};oo(Le)?(uF=require("assert"),xs=aF(),cF=/^win/i.test(Le.platform),Uu=require("events"),typeof Uu!="function"&&(Uu=Uu.EventEmitter),Le.__signal_exit_emitter__?ht=Le.__signal_exit_emitter__:(ht=Le.__signal_exit_emitter__=new Uu,ht.count=0,ht.emitted={}),ht.infinite||(ht.setMaxListeners(1/0),ht.infinite=!0),Os.exports=function(t,e){if(!oo(global.process))return function(){};uF.equal(typeof t,"function","a callback must be provided for exit handler"),Fs===!1&&zy();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){ht.removeListener(r,t),ht.listeners("exit").length===0&&ht.listeners("afterexit").length===0&&Xf()};return ht.on(r,t),n},Xf=function(){!Fs||!oo(global.process)||(Fs=!1,xs.forEach(function(e){try{Le.removeListener(e,Zf[e])}catch{}}),Le.emit=Qf,Le.reallyExit=Gy,ht.count-=1)},Os.exports.unload=Xf,so=function(e,r,n){ht.emitted[e]||(ht.emitted[e]=!0,ht.emit(e,r,n))},Zf={},xs.forEach(function(t){Zf[t]=function(){if(oo(global.process)){var r=Le.listeners(t);r.length===ht.count&&(Xf(),so("exit",null,t),so("afterexit",null,t),cF&&t==="SIGHUP"&&(t="SIGINT"),Le.kill(Le.pid,t))}}}),Os.exports.signals=function(){return xs},Fs=!1,zy=function(){Fs||!oo(global.process)||(Fs=!0,ht.count+=1,xs=xs.filter(function(e){try{return Le.on(e,Zf[e]),!0}catch{return!1}}),Le.emit=fF,Le.reallyExit=lF)},Os.exports.load=zy,Gy=Le.reallyExit,lF=function(e){oo(global.process)&&(Le.exitCode=e||0,so("exit",Le.exitCode,null),so("afterexit",Le.exitCode,null),Gy.call(Le,Le.exitCode))},Qf=Le.emit,fF=function(e,r){if(e==="exit"&&oo(global.process)){r!==void 0&&(Le.exitCode=r);var n=Qf.apply(this,arguments);return so("exit",Le.exitCode,null),so("afterexit",Le.exitCode,null),n}else return Qf.apply(this,arguments)}):Os.exports=function(){return function(){}};var uF,xs,cF,Uu,ht,Xf,so,Zf,Fs,zy,Gy,lF,Qf,fF});var hF=D((Kde,Ky)=>{"use strict";var dF=Symbol();function jW(t,e,r){let n=e[dF];if(n)return e.stat(t,(o,s)=>{if(o)return r(o);r(null,s.mtime,n)});let i=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,i,i,o=>{if(o)return r(o);e.stat(t,(s,a)=>{if(s)return r(s);let u=a.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,dF,{value:u}),r(null,a.mtime,u)})})}function NW(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Ky.exports.probe=jW;Ky.exports.getMtime=NW});var DF=D((Yde,Hu)=>{"use strict";var LW=require("path"),Xy=dt(),BW=sF(),qW=Wy(),pF=hF(),_n={};function Vu(t,e){return e.lockfilePath||`${t}.lock`}function Zy(t,e,r){if(!e.realpath)return r(null,LW.resolve(t));e.fs.realpath(t,r)}function Jy(t,e,r){let n=Vu(t,e);e.fs.mkdir(n,i=>{if(!i)return pF.probe(n,e.fs,(o,s,a)=>{if(o)return e.fs.rmdir(n,()=>{}),r(o);r(null,s,a)});if(i.code!=="EEXIST")return r(i);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(o,s)=>{if(o)return o.code==="ENOENT"?Jy(t,{...e,stale:0},r):r(o);if(!mF(s,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));gF(t,e,a=>{if(a)return r(a);Jy(t,{...e,stale:0},r)})})})}function mF(t,e){return t.mtime.getTime()<Date.now()-e.stale}function gF(t,e,r){e.fs.rmdir(Vu(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function ed(t,e){let r=_n[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,i)=>{let o=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||o?Yy(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,ed(t,e));if(!(r.mtime.getTime()===i.mtime.getTime()))return Yy(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let a=pF.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,a,a,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?Yy(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,ed(t,e));r.mtime=a,r.lastUpdate=Date.now(),r.updateDelay=null,ed(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Yy(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),_n[t]===e&&delete _n[t],e.options.onCompromised(r)}function MW(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Xy,onCompromised:n=>{throw n},...e},e.retries=e.retries||0,e.retries=typeof e.retries=="number"?{retries:e.retries}:e.retries,e.stale=Math.max(e.stale||0,2e3),e.update=e.update==null?e.stale/2:e.update||0,e.update=Math.max(Math.min(e.update,e.stale/2),1e3),Zy(t,e,(n,i)=>{if(n)return r(n);let o=BW.operation(e.retries);o.attempt(()=>{Jy(i,e,(s,a,u)=>{if(o.retry(s))return;if(s)return r(o.mainError());let c=_n[i]={lockfilePath:Vu(i,e),mtime:a,mtimePrecision:u,options:e,lastUpdate:Date.now()};ed(i,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));yF(i,{...e,realpath:!1},l)})})})})}function yF(t,e,r){e={fs:Xy,realpath:!0,...e},Zy(t,e,(n,i)=>{if(n)return r(n);let o=_n[i];if(!o)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));o.updateTimeout&&clearTimeout(o.updateTimeout),o.released=!0,delete _n[i],gF(i,e,r)})}function UW(t,e,r){e={stale:1e4,realpath:!0,fs:Xy,...e},e.stale=Math.max(e.stale||0,2e3),Zy(t,e,(n,i)=>{if(n)return r(n);e.fs.stat(Vu(i,e),(o,s)=>o?o.code==="ENOENT"?r(null,!1):r(o):r(null,!mF(s,e)))})}function VW(){return _n}qW(()=>{for(let t in _n){let e=_n[t].options;try{e.fs.rmdirSync(Vu(t,e))}catch{}}});Hu.exports.lock=MW;Hu.exports.unlock=yF;Hu.exports.check=UW;Hu.exports.getLocks=VW});var bF=D((Jde,vF)=>{"use strict";var HW=dt();function zW(t){let e=["mkdir","realpath","stat","rmdir","utimes"],r={...t};return e.forEach(n=>{r[n]=(...i)=>{let o=i.pop(),s;try{s=t[`${n}Sync`](...i)}catch(a){return o(a)}o(null,s)}}),r}function GW(t){return(...e)=>new Promise((r,n)=>{e.push((i,o)=>{i?n(i):r(o)}),t(...e)})}function WW(t){return(...e)=>{let r,n;if(e.push((i,o)=>{r=i,n=o}),t(...e),r)throw r;return n}}function KW(t){if(t={...t},t.fs=zW(t.fs||HW),typeof t.retries=="number"&&t.retries>0||t.retries&&typeof t.retries.retries=="number"&&t.retries.retries>0)throw Object.assign(new Error("Cannot use retries with the sync api"),{code:"ESYNC"});return t}vF.exports={toPromise:GW,toSync:WW,toSyncOptions:KW}});var _F=D((Xde,oi)=>{"use strict";var As=DF(),{toPromise:td,toSync:rd,toSyncOptions:Qy}=bF();async function wF(t,e){let r=await td(As.lock)(t,e);return td(r)}function YW(t,e){let r=rd(As.lock)(t,Qy(e));return rd(r)}function JW(t,e){return td(As.unlock)(t,e)}function XW(t,e){return rd(As.unlock)(t,Qy(e))}function ZW(t,e){return td(As.check)(t,e)}function QW(t,e){return rd(As.check)(t,Qy(e))}oi.exports=wF;oi.exports.lock=wF;oi.exports.unlock=JW;oi.exports.lockSync=YW;oi.exports.unlockSync=XW;oi.exports.check=ZW;oi.exports.checkSync=QW});var FF=D(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});ks.canStoreURLs=ks.FileUrlStorage=void 0;var EF=require("fs"),eK=rK(zx()),CF=tK(_F());function xF(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(xF=function(n){return n?r:e})(t)}function tK(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=xF(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(o!=="default"&&{}.hasOwnProperty.call(t,o)){var s=i?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=t[o]}return n.default=t,r&&r.set(t,n),n}function rK(t){return t&&t.__esModule?t:{default:t}}function zu(t){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zu(t)}function nK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function SF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oK(n.key),n)}}function iK(t,e,r){return e&&SF(t.prototype,e),r&&SF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function oK(t){var e=sK(t,"string");return zu(e)=="symbol"?e:e+""}function sK(t,e){if(zu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(zu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Zde=ks.canStoreURLs=!0,Qde=ks.FileUrlStorage=function(){function t(e){nK(this,t),this.path=e}return iK(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,i){r._getItems("tus::",function(o,s){o?i(o):n(s)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(i,o){n._getItems("tus::".concat(r),function(s,a){s?o(s):i(a)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(i,o){n._removeItem(r,function(s){s?o(s):i()})})}},{key:"addUpload",value:function(r,n){var i=this,o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return new Promise(function(a,u){i._setItem(s,n,function(c){c?u(c):a(s)})})}},{key:"_setItem",value:function(r,n,i){var o=this;CF.lock(this.path,this._lockfileOptions()).then(function(s){i=o._releaseAndCb(s,i),o._getData(function(a,u){if(a){i(a);return}u[r]=n,o._writeData(u,function(c){return i(c)})})}).catch(i)}},{key:"_getItems",value:function(r,n){this._getData(function(i,o){if(i){n(i);return}var s=Object.keys(o).filter(function(a){return a.startsWith(r)}).map(function(a){var u=o[a];return u.urlStorageKey=a,u});n(null,s)})}},{key:"_removeItem",value:function(r,n){var i=this;CF.lock(this.path,this._lockfileOptions()).then(function(o){n=i._releaseAndCb(o,n),i._getData(function(s,a){if(s){n(s);return}delete a[r],i._writeData(a,function(u){return n(u)})})}).catch(n)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(r,n){return function(i){if(i){r().then(function(){return n(i)}).catch(function(o){return n((0,eK.default)([i,o]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var i={encoding:"utf8",mode:432,flag:"w"};(0,EF.writeFile)(this.path,JSON.stringify(r),i,function(o){return n(o)})}},{key:"_getData",value:function(r){(0,EF.readFile)(this.path,"utf8",function(n,i){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{i=i.trim().length?JSON.parse(i):{}}catch(o){r(o);return}r(null,i)})}}])}()});var rD=D(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});Object.defineProperty(zt,"DefaultHttpStack",{enumerable:!0,get:function(){return TF.default}});Object.defineProperty(zt,"DetailedError",{enumerable:!0,get:function(){return aK.default}});Object.defineProperty(zt,"FileUrlStorage",{enumerable:!0,get:function(){return PF.FileUrlStorage}});Object.defineProperty(zt,"StreamSource",{enumerable:!0,get:function(){return dK.default}});zt.Upload=void 0;Object.defineProperty(zt,"canStoreURLs",{enumerable:!0,get:function(){return PF.canStoreURLs}});zt.defaultOptions=void 0;Object.defineProperty(zt,"enableDebugLog",{enumerable:!0,get:function(){return uK.enableDebugLog}});zt.isSupported=void 0;var aK=ao(Kg()),uK=Yg(),cK=ao(FS()),eD=ao(n1()),lK=ao(g1()),fK=ao(b1()),TF=ao($1()),dK=ao(ly()),PF=FF();function ao(t){return t&&t.__esModule?t:{default:t}}function Ps(t){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ps(t)}function hK(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OF(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,$F(n.key),n)}}function pK(t,e,r){return e&&OF(t.prototype,e),r&&OF(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function mK(t,e,r){return e=nd(e),gK(t,RF()?Reflect.construct(e,r||[],nd(t).constructor):e.apply(t,r))}function gK(t,e){if(e&&(Ps(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yK(t)}function yK(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function RF(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RF=function(){return!!t})()}function nd(t){return nd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nd(t)}function DK(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tD(t,e)}function tD(t,e){return tD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},tD(t,e)}function AF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ts(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?AF(Object(r),!0).forEach(function(n){vK(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):AF(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vK(t,e,r){return e=$F(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $F(t){var e=bK(t,"string");return Ps(e)=="symbol"?e:e+""}function bK(t,e){if(Ps(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ps(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var kF=zt.defaultOptions=Ts(Ts({},eD.default.defaultOptions),{},{httpStack:new TF.default,fileReader:new lK.default,urlStorage:new cK.default,fingerprint:fK.default}),the=zt.Upload=function(t){function e(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return hK(this,e),n=Ts(Ts({},kF),n),mK(this,e,[r,n])}return DK(e,t),pK(e,null,[{key:"terminate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=Ts(Ts({},kF),i),eD.default.terminate(n,i)}}])}(eD.default),rhe=zt.isSupported=!0});var En={};mn(En,{__addDisposableResource:()=>t2,__assign:()=>id,__asyncDelegator:()=>WF,__asyncGenerator:()=>GF,__asyncValues:()=>KF,__await:()=>Rs,__awaiter:()=>qF,__classPrivateFieldGet:()=>ZF,__classPrivateFieldIn:()=>e2,__classPrivateFieldSet:()=>QF,__createBinding:()=>sd,__decorate:()=>NF,__disposeResources:()=>r2,__esDecorate:()=>wK,__exportStar:()=>UF,__extends:()=>IF,__generator:()=>MF,__importDefault:()=>XF,__importStar:()=>JF,__makeTemplateObject:()=>YF,__metadata:()=>BF,__param:()=>LF,__propKey:()=>EK,__read:()=>iD,__rest:()=>jF,__runInitializers:()=>_K,__setFunctionName:()=>CK,__spread:()=>VF,__spreadArray:()=>zF,__spreadArrays:()=>HF,__values:()=>od,default:()=>FK});function IF(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");nD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function jF(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function NF(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function LF(t,e){return function(r,n){e(r,n,t)}}function wK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function _K(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function EK(t){return typeof t=="symbol"?t:"".concat(t)}function CK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function BF(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function qF(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function MF(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function UF(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sd(e,t,r)}function od(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function iD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function VF(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(iD(arguments[e]));return t}function HF(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function zF(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Rs(t){return this instanceof Rs?(this.v=t,this):new Rs(t)}function GF(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(d){return function(p){return Promise.resolve(p).then(d,f)}}function a(d,p){n[d]&&(i[d]=function(v){return new Promise(function(g,w){o.push([d,v,g,w])>1||u(d,v)})},p&&(i[d]=p(i[d])))}function u(d,p){try{c(n[d](p))}catch(v){h(o[0][3],v)}}function c(d){d.value instanceof Rs?Promise.resolve(d.value.v).then(l,f):h(o[0][2],d)}function l(d){u("next",d)}function f(d){u("throw",d)}function h(d,p){d(p),o.shift(),o.length&&u(o[0][0],o[0][1])}}function WF(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Rs(t[i](s)),done:!1}:o?o(s):s}:o}}function KF(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof od=="function"?od(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function YF(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function JF(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&sd(e,t,r);return SK(e,t),e}function XF(t){return t&&t.__esModule?t:{default:t}}function ZF(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function QF(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function e2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function t2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function r2(t){function e(o){t.error=t.hasError?new xK(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}var nD,id,sd,SK,xK,FK,Cn=ut(()=>{nD=function(t,e){return nD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},nD(t,e)};id=function(){return id=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},id.apply(this,arguments)};sd=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};SK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};xK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};FK={__extends:IF,__assign:id,__rest:jF,__decorate:NF,__param:LF,__metadata:BF,__awaiter:qF,__generator:MF,__createBinding:sd,__exportStar:UF,__values:od,__read:iD,__spread:VF,__spreadArrays:HF,__spreadArray:zF,__await:Rs,__asyncGenerator:GF,__asyncDelegator:WF,__asyncValues:KF,__makeTemplateObject:YF,__importStar:JF,__importDefault:XF,__classPrivateFieldGet:ZF,__classPrivateFieldSet:QF,__classPrivateFieldIn:e2,__addDisposableResource:t2,__disposeResources:r2}});var S2={};mn(S2,{__addDisposableResource:()=>E2,__assign:()=>ad,__asyncDelegator:()=>m2,__asyncGenerator:()=>p2,__asyncValues:()=>g2,__await:()=>$s,__awaiter:()=>u2,__classPrivateFieldGet:()=>b2,__classPrivateFieldIn:()=>_2,__classPrivateFieldSet:()=>w2,__createBinding:()=>cd,__decorate:()=>o2,__disposeResources:()=>C2,__esDecorate:()=>OK,__exportStar:()=>l2,__extends:()=>n2,__generator:()=>c2,__importDefault:()=>v2,__importStar:()=>D2,__makeTemplateObject:()=>y2,__metadata:()=>a2,__param:()=>s2,__propKey:()=>kK,__read:()=>sD,__rest:()=>i2,__runInitializers:()=>AK,__setFunctionName:()=>TK,__spread:()=>f2,__spreadArray:()=>h2,__spreadArrays:()=>d2,__values:()=>ud,default:()=>$K});function n2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");oD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function i2(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function o2(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function s2(t,e){return function(r,n){e(r,n,t)}}function OK(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function AK(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function kK(t){return typeof t=="symbol"?t:"".concat(t)}function TK(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function a2(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function u2(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function c2(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function l2(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cd(e,t,r)}function ud(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function sD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function f2(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(sD(arguments[e]));return t}function d2(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function h2(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function $s(t){return this instanceof $s?(this.v=t,this):new $s(t)}function p2(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,v){o.push([h,d,p,v])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof $s?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function m2(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:$s(t[i](s)),done:!1}:o?o(s):s}:o}}function g2(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ud=="function"?ud(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function y2(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function D2(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&cd(e,t,r);return PK(e,t),e}function v2(t){return t&&t.__esModule?t:{default:t}}function b2(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function w2(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function _2(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function E2(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function C2(t){function e(n){t.error=t.hasError?new RK(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var oD,ad,cd,PK,RK,$K,x2=ut(()=>{oD=function(t,e){return oD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},oD(t,e)};ad=function(){return ad=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},ad.apply(this,arguments)};cd=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};PK=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};RK=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};$K={__extends:n2,__assign:ad,__rest:i2,__decorate:o2,__param:s2,__metadata:a2,__awaiter:u2,__generator:c2,__createBinding:cd,__exportStar:l2,__values:ud,__read:sD,__spread:f2,__spreadArrays:d2,__spreadArray:h2,__await:$s,__asyncGenerator:p2,__asyncDelegator:m2,__asyncValues:g2,__makeTemplateObject:y2,__importStar:D2,__importDefault:v2,__classPrivateFieldGet:b2,__classPrivateFieldSet:w2,__classPrivateFieldIn:_2,__addDisposableResource:E2,__disposeResources:C2}});var Gt=D(aD=>{"use strict";aD.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((i,o)=>i!=null?n(i):r(o)),t.apply(this,e)})},"name",{value:t.name})};aD.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r)},"name",{value:t.name})}});var Gu=D(si=>{"use strict";var F2=Gt().fromCallback,Pt=dt(),IK=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof Pt[t]=="function");Object.keys(Pt).forEach(t=>{t!=="promises"&&(si[t]=Pt[t])});IK.forEach(t=>{si[t]=F2(Pt[t])});si.exists=function(t,e){return typeof e=="function"?Pt.exists(t,e):new Promise(r=>Pt.exists(t,r))};si.read=function(t,e,r,n,i,o){return typeof o=="function"?Pt.read(t,e,r,n,i,o):new Promise((s,a)=>{Pt.read(t,e,r,n,i,(u,c,l)=>{if(u)return a(u);s({bytesRead:c,buffer:l})})})};si.write=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.write(t,e,...r):new Promise((n,i)=>{Pt.write(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffer:a})})})};typeof Pt.writev=="function"&&(si.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?Pt.writev(t,e,...r):new Promise((n,i)=>{Pt.writev(t,e,...r,(o,s,a)=>{if(o)return i(o);n({bytesWritten:s,buffers:a})})})});typeof Pt.realpath.native=="function"&&(si.realpath.native=F2(Pt.realpath.native))});var uD=D((she,O2)=>{O2.exports=t=>{let e=process.versions.node.split(".").map(r=>parseInt(r,10));return t=t.split(".").map(r=>parseInt(r,10)),e[0]>t[0]||e[0]===t[0]&&(e[1]>t[1]||e[1]===t[1]&&e[2]>=t[2])}});var R2=D((ahe,cD)=>{"use strict";var Is=Gu(),Sn=require("path"),jK=uD(),A2=jK("10.12.0"),k2=t=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(t.replace(Sn.parse(t).root,""))){let r=new Error(`Path contains invalid characters: ${t}`);throw r.code="EINVAL",r}},T2=t=>{let e={mode:511};return typeof t=="number"&&(t={mode:t}),{...e,...t}},P2=t=>{let e=new Error(`operation not permitted, mkdir '${t}'`);return e.code="EPERM",e.errno=-4048,e.path=t,e.syscall="mkdir",e};cD.exports.makeDir=async(t,e)=>{if(k2(t),e=T2(e),A2){let n=Sn.resolve(t);return Is.mkdir(n,{mode:e.mode,recursive:!0})}let r=async n=>{try{await Is.mkdir(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return await r(Sn.dirname(n)),r(n)}try{if(!(await Is.stat(n)).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))};cD.exports.makeDirSync=(t,e)=>{if(k2(t),e=T2(e),A2){let n=Sn.resolve(t);return Is.mkdirSync(n,{mode:e.mode,recursive:!0})}let r=n=>{try{Is.mkdirSync(n,e.mode)}catch(i){if(i.code==="EPERM")throw i;if(i.code==="ENOENT"){if(Sn.dirname(n)===n)throw P2(n);if(i.message.includes("null bytes"))throw i;return r(Sn.dirname(n)),r(n)}try{if(!Is.statSync(n).isDirectory())throw new Error("The path is not a directory")}catch{throw i}}};return r(Sn.resolve(t))}});var kr=D((uhe,$2)=>{"use strict";var NK=Gt().fromPromise,{makeDir:LK,makeDirSync:lD}=R2(),fD=NK(LK);$2.exports={mkdirs:fD,mkdirsSync:lD,mkdirp:fD,mkdirpSync:lD,ensureDir:fD,ensureDirSync:lD}});var dD=D((che,I2)=>{"use strict";var js=dt();function BK(t,e,r,n){js.open(t,"r+",(i,o)=>{if(i)return n(i);js.futimes(o,e,r,s=>{js.close(o,a=>{n&&n(s||a)})})})}function qK(t,e,r){let n=js.openSync(t,"r+");return js.futimesSync(n,e,r),js.closeSync(n)}I2.exports={utimesMillis:BK,utimesMillisSync:qK}});var Wu=D((lhe,B2)=>{"use strict";var Ns=Gu(),Wt=require("path"),MK=require("util"),UK=uD(),ld=UK("10.5.0"),j2=t=>ld?Ns.stat(t,{bigint:!0}):Ns.stat(t),hD=t=>ld?Ns.statSync(t,{bigint:!0}):Ns.statSync(t);function VK(t,e){return Promise.all([j2(t),j2(e).catch(r=>{if(r.code==="ENOENT")return null;throw r})]).then(([r,n])=>({srcStat:r,destStat:n}))}function HK(t,e){let r,n=hD(t);try{r=hD(e)}catch(i){if(i.code==="ENOENT")return{srcStat:n,destStat:null};throw i}return{srcStat:n,destStat:r}}function zK(t,e,r,n){MK.callbackify(VK)(t,e,(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;return a&&fd(s,a)?n(new Error("Source and destination must not be the same.")):s.isDirectory()&&pD(t,e)?n(new Error(dd(t,e,r))):n(null,{srcStat:s,destStat:a})})}function GK(t,e,r){let{srcStat:n,destStat:i}=HK(t,e);if(i&&fd(n,i))throw new Error("Source and destination must not be the same.");if(n.isDirectory()&&pD(t,e))throw new Error(dd(t,e,r));return{srcStat:n,destStat:i}}function N2(t,e,r,n,i){let o=Wt.resolve(Wt.dirname(t)),s=Wt.resolve(Wt.dirname(r));if(s===o||s===Wt.parse(s).root)return i();let a=(u,c)=>u?u.code==="ENOENT"?i():i(u):fd(e,c)?i(new Error(dd(t,r,n))):N2(t,e,s,n,i);ld?Ns.stat(s,{bigint:!0},a):Ns.stat(s,a)}function L2(t,e,r,n){let i=Wt.resolve(Wt.dirname(t)),o=Wt.resolve(Wt.dirname(r));if(o===i||o===Wt.parse(o).root)return;let s;try{s=hD(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(fd(e,s))throw new Error(dd(t,r,n));return L2(t,e,o,n)}function fd(t,e){return!!(e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev&&(ld||e.ino<Number.MAX_SAFE_INTEGER||e.size===t.size&&e.mode===t.mode&&e.nlink===t.nlink&&e.atimeMs===t.atimeMs&&e.mtimeMs===t.mtimeMs&&e.ctimeMs===t.ctimeMs&&e.birthtimeMs===t.birthtimeMs))}function pD(t,e){let r=Wt.resolve(t).split(Wt.sep).filter(i=>i),n=Wt.resolve(e).split(Wt.sep).filter(i=>i);return r.reduce((i,o,s)=>i&&n[s]===o,!0)}function dd(t,e,r){return`Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}B2.exports={checkPaths:zK,checkPathsSync:GK,checkParentPaths:N2,checkParentPathsSync:L2,isSrcSubdir:pD}});var H2=D((fhe,V2)=>{"use strict";var Ct=dt(),Ku=require("path"),WK=kr().mkdirsSync,KK=dD().utimesMillisSync,Yu=Wu();function YK(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
41
41
 
42
- see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Yu.checkPathsSync(t,e,"copy");return Yu.checkParentPathsSync(t,n,e,"copy"),YK(i,t,e,r)}function YK(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Ku.dirname(r);return Ct.existsSync(i)||GK(i),q2(t,e,r,n)}function q2(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return JK(t,e,r,n)}function JK(t,e,r,n){let o=(n.dereference?Ct.statSync:Ct.lstatSync)(e);if(o.isDirectory())return nY(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return XK(o,t,e,r,n);if(o.isSymbolicLink())return sY(t,e,r,n)}function XK(t,e,r,n,i){return e?ZK(t,r,n,i):M2(t,r,n,i)}function ZK(t,e,r,n){if(n.overwrite)return Ct.unlinkSync(r),M2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function M2(t,e,r,n){return Ct.copyFileSync(e,r),n.preserveTimestamps&&QK(t.mode,e,r),mD(r,t.mode)}function QK(t,e,r){return eY(t)&&tY(r,t),rY(e,r)}function eY(t){return(t&128)===0}function tY(t,e){return mD(t,e|128)}function mD(t,e){return Ct.chmodSync(t,e)}function rY(t,e){let r=Ct.statSync(t);return WK(e,r.atime,r.mtime)}function nY(t,e,r,n,i){if(!e)return iY(t.mode,r,n,i);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`);return U2(r,n,i)}function iY(t,e,r,n){return Ct.mkdirSync(r),U2(e,r,n),mD(r,t)}function U2(t,e,r){Ct.readdirSync(t).forEach(n=>oY(n,t,e,r))}function oY(t,e,r,n){let i=Ku.join(e,t),o=Ku.join(r,t),{destStat:s}=Yu.checkPathsSync(i,o,"copy");return q2(s,i,o,n)}function sY(t,e,r,n){let i=Ct.readlinkSync(e);if(n.dereference&&(i=Ku.resolve(process.cwd(),i)),t){let o;try{o=Ct.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Ct.symlinkSync(i,r);throw s}if(n.dereference&&(o=Ku.resolve(process.cwd(),o)),Yu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Ct.statSync(r).isDirectory()&&Yu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return aY(i,r)}else return Ct.symlinkSync(i,r)}function aY(t,e){return Ct.unlinkSync(e),Ct.symlinkSync(t,e)}V2.exports=KK});var gD=D((fhe,z2)=>{"use strict";z2.exports={copySync:H2()}});var ai=D((dhe,W2)=>{"use strict";var uY=Gt().fromPromise,G2=Gu();function cY(t){return G2.access(t).then(()=>!0).catch(()=>!1)}W2.exports={pathExists:uY(cY),pathExistsSync:G2.existsSync}});var rO=D((hhe,tO)=>{"use strict";var Kt=dt(),Ju=require("path"),lY=kr().mkdirs,fY=ai().pathExists,dY=dD().utimesMillis,Xu=Wu();function hY(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
42
+ see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Yu.checkPathsSync(t,e,"copy");return Yu.checkParentPathsSync(t,n,e,"copy"),JK(i,t,e,r)}function JK(t,e,r,n){if(n.filter&&!n.filter(e,r))return;let i=Ku.dirname(r);return Ct.existsSync(i)||WK(i),q2(t,e,r,n)}function q2(t,e,r,n){if(!(n.filter&&!n.filter(e,r)))return XK(t,e,r,n)}function XK(t,e,r,n){let o=(n.dereference?Ct.statSync:Ct.lstatSync)(e);if(o.isDirectory())return iY(o,t,e,r,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return ZK(o,t,e,r,n);if(o.isSymbolicLink())return aY(t,e,r,n)}function ZK(t,e,r,n,i){return e?QK(t,r,n,i):M2(t,r,n,i)}function QK(t,e,r,n){if(n.overwrite)return Ct.unlinkSync(r),M2(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function M2(t,e,r,n){return Ct.copyFileSync(e,r),n.preserveTimestamps&&eY(t.mode,e,r),mD(r,t.mode)}function eY(t,e,r){return tY(t)&&rY(r,t),nY(e,r)}function tY(t){return(t&128)===0}function rY(t,e){return mD(t,e|128)}function mD(t,e){return Ct.chmodSync(t,e)}function nY(t,e){let r=Ct.statSync(t);return KK(e,r.atime,r.mtime)}function iY(t,e,r,n,i){if(!e)return oY(t.mode,r,n,i);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`);return U2(r,n,i)}function oY(t,e,r,n){return Ct.mkdirSync(r),U2(e,r,n),mD(r,t)}function U2(t,e,r){Ct.readdirSync(t).forEach(n=>sY(n,t,e,r))}function sY(t,e,r,n){let i=Ku.join(e,t),o=Ku.join(r,t),{destStat:s}=Yu.checkPathsSync(i,o,"copy");return q2(s,i,o,n)}function aY(t,e,r,n){let i=Ct.readlinkSync(e);if(n.dereference&&(i=Ku.resolve(process.cwd(),i)),t){let o;try{o=Ct.readlinkSync(r)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Ct.symlinkSync(i,r);throw s}if(n.dereference&&(o=Ku.resolve(process.cwd(),o)),Yu.isSrcSubdir(i,o))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${o}'.`);if(Ct.statSync(r).isDirectory()&&Yu.isSrcSubdir(o,i))throw new Error(`Cannot overwrite '${o}' with '${i}'.`);return uY(i,r)}else return Ct.symlinkSync(i,r)}function uY(t,e){return Ct.unlinkSync(e),Ct.symlinkSync(t,e)}V2.exports=YK});var gD=D((dhe,z2)=>{"use strict";z2.exports={copySync:H2()}});var ai=D((hhe,W2)=>{"use strict";var cY=Gt().fromPromise,G2=Gu();function lY(t){return G2.access(t).then(()=>!0).catch(()=>!1)}W2.exports={pathExists:cY(lY),pathExistsSync:G2.existsSync}});var rO=D((phe,tO)=>{"use strict";var Kt=dt(),Ju=require("path"),fY=kr().mkdirs,dY=ai().pathExists,hY=dD().utimesMillis,Xu=Wu();function pY(t,e,r,n){typeof r=="function"&&!n?(n=r,r={}):typeof r=="function"&&(r={filter:r}),n=n||function(){},r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
43
43
 
44
- see https://github.com/jprichardson/node-fs-extra/issues/269`),Xu.checkPaths(t,e,"copy",(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;Xu.checkParentPaths(t,s,e,"copy",u=>u?n(u):r.filter?X2(K2,a,t,e,r,n):K2(a,t,e,r,n))})}function K2(t,e,r,n,i){let o=Ju.dirname(r);fY(o,(s,a)=>{if(s)return i(s);if(a)return yD(t,e,r,n,i);lY(o,u=>u?i(u):yD(t,e,r,n,i))})}function X2(t,e,r,n,i,o){Promise.resolve(i.filter(r,n)).then(s=>s?t(e,r,n,i,o):o(),s=>o(s))}function yD(t,e,r,n,i){return n.filter?X2(Y2,t,e,r,n,i):Y2(t,e,r,n,i)}function Y2(t,e,r,n,i){(n.dereference?Kt.stat:Kt.lstat)(e,(s,a)=>{if(s)return i(s);if(a.isDirectory())return bY(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return pY(a,t,e,r,n,i);if(a.isSymbolicLink())return EY(t,e,r,n,i)})}function pY(t,e,r,n,i,o){return e?mY(t,r,n,i,o):Z2(t,r,n,i,o)}function mY(t,e,r,n,i){if(n.overwrite)Kt.unlink(r,o=>o?i(o):Z2(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function Z2(t,e,r,n,i){Kt.copyFile(e,r,o=>o?i(o):n.preserveTimestamps?gY(t.mode,e,r,i):hd(r,t.mode,i))}function gY(t,e,r,n){return yY(t)?DY(r,t,i=>i?n(i):J2(t,e,r,n)):J2(t,e,r,n)}function yY(t){return(t&128)===0}function DY(t,e,r){return hd(t,e|128,r)}function J2(t,e,r,n){vY(e,r,i=>i?n(i):hd(r,t,n))}function hd(t,e,r){return Kt.chmod(t,e,r)}function vY(t,e,r){Kt.stat(t,(n,i)=>n?r(n):dY(e,i.atime,i.mtime,r))}function bY(t,e,r,n,i,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)):Q2(r,n,i,o):wY(t.mode,r,n,i,o)}function wY(t,e,r,n,i){Kt.mkdir(r,o=>{if(o)return i(o);Q2(e,r,n,s=>s?i(s):hd(r,t,i))})}function Q2(t,e,r,n){Kt.readdir(t,(i,o)=>i?n(i):eO(o,t,e,r,n))}function eO(t,e,r,n,i){let o=t.pop();return o?_Y(t,o,e,r,n,i):i()}function _Y(t,e,r,n,i,o){let s=Ju.join(r,e),a=Ju.join(n,e);Xu.checkPaths(s,a,"copy",(u,c)=>{if(u)return o(u);let{destStat:l}=c;yD(l,s,a,i,f=>f?o(f):eO(t,r,n,i,o))})}function EY(t,e,r,n,i){Kt.readlink(e,(o,s)=>{if(o)return i(o);if(n.dereference&&(s=Ju.resolve(process.cwd(),s)),t)Kt.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Kt.symlink(s,r,i):i(a):(n.dereference&&(u=Ju.resolve(process.cwd(),u)),Xu.isSrcSubdir(s,u)?i(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&Xu.isSrcSubdir(u,s)?i(new Error(`Cannot overwrite '${u}' with '${s}'.`)):CY(s,r,i)));else return Kt.symlink(s,r,i)})}function CY(t,e,r){Kt.unlink(e,n=>n?r(n):Kt.symlink(t,e,r))}tO.exports=hY});var DD=D((phe,nO)=>{"use strict";var SY=Gt().fromCallback;nO.exports={copy:SY(rO())}});var dO=D((mhe,fO)=>{"use strict";var iO=dt(),uO=require("path"),xe=require("assert"),Zu=process.platform==="win32";function cO(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||iO[r],r=r+"Sync",t[r]=t[r]||iO[r]}),t.maxBusyTries=t.maxBusyTries||3}function vD(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe.strictEqual(typeof r,"function","rimraf: callback function required"),xe(e,"rimraf: invalid options argument provided"),xe.strictEqual(typeof e,"object","rimraf: options should be object"),cO(e),oO(t,e,function i(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&n<e.maxBusyTries){n++;let s=n*100;return setTimeout(()=>oO(t,e,i),s)}o.code==="ENOENT"&&(o=null)}r(o)})}function oO(t,e,r){xe(t),xe(e),xe(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Zu)return sO(t,e,n,r);if(i&&i.isDirectory())return pd(t,e,n,r);e.unlink(t,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return Zu?sO(t,e,o,r):pd(t,e,o,r);if(o.code==="EISDIR")return pd(t,e,o,r)}return r(o)})})}function sO(t,e,r,n){xe(t),xe(e),xe(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(o,s)=>{o?n(o.code==="ENOENT"?null:r):s.isDirectory()?pd(t,e,r,n):e.unlink(t,n)})})}function aO(t,e,r){let n;xe(t),xe(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?md(t,e,r):e.unlinkSync(t)}function pd(t,e,r,n){xe(t),xe(e),xe(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?xY(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function xY(t,e,r){xe(t),xe(e),xe(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let o=i.length,s;if(o===0)return e.rmdir(t,r);i.forEach(a=>{vD(uO.join(t,a),e,u=>{if(!s){if(u)return r(s=u);--o===0&&e.rmdir(t,r)}})})})}function lO(t,e){let r;e=e||{},cO(e),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe(e,"rimraf: missing options"),xe.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Zu&&aO(t,e,n)}try{r&&r.isDirectory()?md(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Zu?aO(t,e,n):md(t,e,n);if(n.code!=="EISDIR")throw n;md(t,e,n)}}function md(t,e,r){xe(t),xe(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")FY(t,e);else if(n.code!=="ENOENT")throw n}}function FY(t,e){if(xe(t),xe(e),e.readdirSync(t).forEach(r=>lO(uO.join(t,r),e)),Zu){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}fO.exports=vD;vD.sync=lO});var Qu=D((ghe,pO)=>{"use strict";var OY=Gt().fromCallback,hO=dO();pO.exports={remove:OY(hO),removeSync:hO.sync}});var _O=D((yhe,wO)=>{"use strict";var AY=Gt().fromCallback,yO=dt(),DO=require("path"),vO=kr(),bO=Qu(),mO=AY(function(e,r){r=r||function(){},yO.readdir(e,(n,i)=>{if(n)return vO.mkdirs(e,r);i=i.map(s=>DO.join(e,s)),o();function o(){let s=i.pop();if(!s)return r();bO.remove(s,a=>{if(a)return r(a);o()})}})});function gO(t){let e;try{e=yO.readdirSync(t)}catch{return vO.mkdirsSync(t)}e.forEach(r=>{r=DO.join(t,r),bO.removeSync(r)})}wO.exports={emptyDirSync:gO,emptydirSync:gO,emptyDir:mO,emptydir:mO}});var xO=D((Dhe,SO)=>{"use strict";var kY=Gt().fromCallback,EO=require("path"),ui=dt(),CO=kr();function TY(t,e){function r(){ui.writeFile(t,"",n=>{if(n)return e(n);e()})}ui.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let o=EO.dirname(t);ui.stat(o,(s,a)=>{if(s)return s.code==="ENOENT"?CO.mkdirs(o,u=>{if(u)return e(u);r()}):e(s);a.isDirectory()?r():ui.readdir(o,u=>{if(u)return e(u)})})})}function PY(t){let e;try{e=ui.statSync(t)}catch{}if(e&&e.isFile())return;let r=EO.dirname(t);try{ui.statSync(r).isDirectory()||ui.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")CO.mkdirsSync(r);else throw n}ui.writeFileSync(t,"")}SO.exports={createFile:kY(TY),createFileSync:PY}});var TO=D((vhe,kO)=>{"use strict";var RY=Gt().fromCallback,OO=require("path"),uo=dt(),AO=kr(),FO=ai().pathExists;function $Y(t,e,r){function n(i,o){uo.link(i,o,s=>{if(s)return r(s);r(null)})}FO(e,(i,o)=>{if(i)return r(i);if(o)return r(null);uo.lstat(t,s=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),r(s);let a=OO.dirname(e);FO(a,(u,c)=>{if(u)return r(u);if(c)return n(t,e);AO.mkdirs(a,l=>{if(l)return r(l);n(t,e)})})})})}function IY(t,e){if(uo.existsSync(e))return;try{uo.lstatSync(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=OO.dirname(e);return uo.existsSync(n)||AO.mkdirsSync(n),uo.linkSync(t,e)}kO.exports={createLink:RY($Y),createLinkSync:IY}});var RO=D((bhe,PO)=>{"use strict";var ci=require("path"),ec=dt(),jY=ai().pathExists;function NY(t,e,r){if(ci.isAbsolute(t))return ec.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=ci.dirname(e),i=ci.join(n,t);return jY(i,(o,s)=>o?r(o):s?r(null,{toCwd:i,toDst:t}):ec.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:ci.relative(n,t)})))}}function LY(t,e){let r;if(ci.isAbsolute(t)){if(r=ec.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=ci.dirname(e),i=ci.join(n,t);if(r=ec.existsSync(i),r)return{toCwd:i,toDst:t};if(r=ec.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ci.relative(n,t)}}}PO.exports={symlinkPaths:NY,symlinkPathsSync:LY}});var jO=D((whe,IO)=>{"use strict";var $O=dt();function BY(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);$O.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function qY(t,e){let r;if(e)return e;try{r=$O.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}IO.exports={symlinkType:BY,symlinkTypeSync:qY}});var VO=D((_he,UO)=>{"use strict";var MY=Gt().fromCallback,LO=require("path"),Ls=dt(),BO=kr(),UY=BO.mkdirs,VY=BO.mkdirsSync,qO=RO(),HY=qO.symlinkPaths,zY=qO.symlinkPathsSync,MO=jO(),GY=MO.symlinkType,WY=MO.symlinkTypeSync,NO=ai().pathExists;function KY(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,NO(e,(i,o)=>{if(i)return n(i);if(o)return n(null);HY(t,e,(s,a)=>{if(s)return n(s);t=a.toDst,GY(a.toCwd,r,(u,c)=>{if(u)return n(u);let l=LO.dirname(e);NO(l,(f,h)=>{if(f)return n(f);if(h)return Ls.symlink(t,e,c,n);UY(l,d=>{if(d)return n(d);Ls.symlink(t,e,c,n)})})})})})}function YY(t,e,r){if(Ls.existsSync(e))return;let i=zY(t,e);t=i.toDst,r=WY(i.toCwd,r);let o=LO.dirname(e);return Ls.existsSync(o)||VY(o),Ls.symlinkSync(t,e,r)}UO.exports={createSymlink:MY(KY),createSymlinkSync:YY}});var zO=D((Ehe,HO)=>{"use strict";var gd=xO(),yd=TO(),Dd=VO();HO.exports={createFile:gd.createFile,createFileSync:gd.createFileSync,ensureFile:gd.createFile,ensureFileSync:gd.createFileSync,createLink:yd.createLink,createLinkSync:yd.createLinkSync,ensureLink:yd.createLink,ensureLinkSync:yd.createLinkSync,createSymlink:Dd.createSymlink,createSymlinkSync:Dd.createSymlinkSync,ensureSymlink:Dd.createSymlink,ensureSymlinkSync:Dd.createSymlinkSync}});var vd=D((Che,GO)=>{function JY(t,{EOL:e=`
45
- `,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function XY(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}GO.exports={stringify:JY,stripBom:XY}});var JO=D((She,YO)=>{var Bs;try{Bs=dt()}catch{Bs=require("fs")}var bd=Gt(),{stringify:WO,stripBom:KO}=vd();async function ZY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Bs,n="throws"in e?e.throws:!0,i=await bd.fromCallback(r.readFile)(t,e);i=KO(i);let o;try{o=JSON.parse(i,e?e.reviver:null)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}return o}var QY=bd.fromPromise(ZY);function eJ(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Bs,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=KO(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function tJ(t,e,r={}){let n=r.fs||Bs,i=WO(e,r);await bd.fromCallback(n.writeFile)(t,i,r)}var rJ=bd.fromPromise(tJ);function nJ(t,e,r={}){let n=r.fs||Bs,i=WO(e,r);return n.writeFileSync(t,i,r)}var iJ={readFile:QY,readFileSync:eJ,writeFile:rJ,writeFileSync:nJ};YO.exports=iJ});var ZO=D((xhe,XO)=>{"use strict";var wd=JO();XO.exports={readJson:wd.readFile,readJsonSync:wd.readFileSync,writeJson:wd.writeFile,writeJsonSync:wd.writeFileSync}});var _d=D((Fhe,tA)=>{"use strict";var oJ=Gt().fromCallback,tc=dt(),QO=require("path"),eA=kr(),sJ=ai().pathExists;function aJ(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=QO.dirname(t);sJ(i,(o,s)=>{if(o)return n(o);if(s)return tc.writeFile(t,e,r,n);eA.mkdirs(i,a=>{if(a)return n(a);tc.writeFile(t,e,r,n)})})}function uJ(t,...e){let r=QO.dirname(t);if(tc.existsSync(r))return tc.writeFileSync(t,...e);eA.mkdirsSync(r),tc.writeFileSync(t,...e)}tA.exports={outputFile:oJ(aJ),outputFileSync:uJ}});var nA=D((Ohe,rA)=>{"use strict";var{stringify:cJ}=vd(),{outputFile:lJ}=_d();async function fJ(t,e,r={}){let n=cJ(e,r);await lJ(t,n,r)}rA.exports=fJ});var oA=D((Ahe,iA)=>{"use strict";var{stringify:dJ}=vd(),{outputFileSync:hJ}=_d();function pJ(t,e,r){let n=dJ(e,r);hJ(t,n,r)}iA.exports=pJ});var aA=D((khe,sA)=>{"use strict";var mJ=Gt().fromPromise,Rt=ZO();Rt.outputJson=mJ(nA());Rt.outputJsonSync=oA();Rt.outputJSON=Rt.outputJson;Rt.outputJSONSync=Rt.outputJsonSync;Rt.writeJSON=Rt.writeJson;Rt.writeJSONSync=Rt.writeJsonSync;Rt.readJSON=Rt.readJson;Rt.readJSONSync=Rt.readJsonSync;sA.exports=Rt});var hA=D((The,dA)=>{"use strict";var lA=dt(),gJ=require("path"),yJ=gD().copySync,fA=Qu().removeSync,DJ=kr().mkdirpSync,uA=Wu();function vJ(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i}=uA.checkPathsSync(t,e,"move");return uA.checkParentPathsSync(t,i,e,"move"),DJ(gJ.dirname(e)),bJ(t,e,n)}function bJ(t,e,r){if(r)return fA(e),cA(t,e,r);if(lA.existsSync(e))throw new Error("dest already exists.");return cA(t,e,r)}function cA(t,e,r){try{lA.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return wJ(t,e,r)}}function wJ(t,e,r){return yJ(t,e,{overwrite:r,errorOnExist:!0}),fA(t)}dA.exports=vJ});var mA=D((Phe,pA)=>{"use strict";pA.exports={moveSync:hA()}});var bA=D((Rhe,vA)=>{"use strict";var _J=dt(),EJ=require("path"),CJ=DD().copy,DA=Qu().remove,SJ=kr().mkdirp,xJ=ai().pathExists,gA=Wu();function FJ(t,e,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;gA.checkPaths(t,e,"move",(o,s)=>{if(o)return n(o);let{srcStat:a}=s;gA.checkParentPaths(t,a,e,"move",u=>{if(u)return n(u);SJ(EJ.dirname(e),c=>c?n(c):OJ(t,e,i,n))})})}function OJ(t,e,r,n){if(r)return DA(e,i=>i?n(i):yA(t,e,r,n));xJ(e,(i,o)=>i?n(i):o?n(new Error("dest already exists.")):yA(t,e,r,n))}function yA(t,e,r,n){_J.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):AJ(t,e,r,n):n())}function AJ(t,e,r,n){CJ(t,e,{overwrite:r,errorOnExist:!0},o=>o?n(o):DA(t,n))}vA.exports=FJ});var _A=D(($he,wA)=>{"use strict";var kJ=Gt().fromCallback;wA.exports={move:kJ(bA())}});var Ed=D((Ihe,bD)=>{"use strict";bD.exports={...Gu(),...gD(),...DD(),..._O(),...zO(),...aA(),...kr(),...mA(),..._A(),..._d(),...ai(),...Qu()};var EA=require("fs");Object.getOwnPropertyDescriptor(EA,"promises")&&Object.defineProperty(bD.exports,"promises",{get(){return EA.promises}})});var wD=D(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.readdir=qs.stat=void 0;var CA=Ed();async function TJ(t){try{return await CA.stat(t)}catch{}}qs.stat=TJ;async function PJ(t){try{return await CA.readdir(t)}catch{return[]}}qs.readdir=PJ});var Ms=D(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.walk=re.Walker=re.compilePaths=re.tmpfilepath=re.findBaseDirectory=re.isExecutableFile=re.pathExecutable=re.pathWritable=re.pathReadable=re.pathExists=re.pathAccessible=re.writeStreamToFile=re.cacheFileChecksum=re.getFileChecksums=re.getFileChecksum=re.fileToString=re.getFileTree=re.readdirp=re.readdirSafe=re.statSafe=void 0;var RJ=(x2(),ke(S2)),vr=Ed(),$J=require("os"),xn=require("path"),SA=require("stream"),xA=wD();RJ.__exportStar(Ed(),re);var FA=wD();Object.defineProperty(re,"statSafe",{enumerable:!0,get:function(){return FA.stat}});Object.defineProperty(re,"readdirSafe",{enumerable:!0,get:function(){return FA.readdir}});async function IJ(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,o)=>{let s=[],a=ED(t,n);e&&(a=a.pipe(new SA.Transform({objectMode:!0,transform(u,c,l){(!e||e(u))&&this.push(u),l()}}))),a.on("error",u=>r?r(u):o(u)).on("data",u=>s.push(u.path)).on("end",()=>i(s))})}re.readdirp=IJ;async function jJ(t,{onError:e,onFileNode:r=o=>o,onDirectoryNode:n=o=>o,walkerOptions:i}={}){let o=new Map([]),s=u=>{let c=xn.dirname(u.path),l=o.get(c);return l&&l.type==="directory"?l:n({path:c,type:"directory",children:[]})},a=(u,c)=>{let l={path:u.path,parent:c};return u.stats.isDirectory()?n({...l,type:"directory",children:[]}):r({...l,type:"file"})};return new Promise((u,c)=>{t=xn.resolve(t),ED(t,i).on("error",f=>e?e(f):c(f)).on("data",f=>{let h=s(f),d=a(f,h);h.children.push(d),o.set(f.path,d),o.set(h.path,h)}).on("end",()=>{let f=o.get(t);if(!f)return c(new Error("No root node found after walking directory structure."));delete f.parent,u(f)})})}re.getFileTree=jJ;async function NJ(t){try{return await vr.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}re.fileToString=NJ;async function _D(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),o=vr.createReadStream(t);o.on("error",s=>{n(s)}),i.once("readable",()=>{let s=i.read().toString("hex");r(s)}),o.pipe(i)})}re.getFileChecksum=_D;async function LJ(t){return Promise.all([_D(t),(async()=>{try{return(await vr.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}re.getFileChecksums=LJ;async function BJ(t,e){let r=await _D(t);await vr.writeFile(`${t}.md5`,r,{encoding:"utf8"})}re.cacheFileChecksum=BJ;function qJ(t,e){return new Promise((r,n)=>{let i=vr.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}re.writeStreamToFile=qJ;async function rc(t,e){try{await vr.access(t,e)}catch{return!1}return!0}re.pathAccessible=rc;async function MJ(t){return rc(t,vr.constants.F_OK)}re.pathExists=MJ;async function UJ(t){return rc(t,vr.constants.R_OK)}re.pathReadable=UJ;async function VJ(t){return rc(t,vr.constants.W_OK)}re.pathWritable=VJ;async function OA(t){return rc(t,vr.constants.X_OK)}re.pathExecutable=OA;async function HJ(t){let[e,r]=await Promise.all([xA.stat(t),OA(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}re.isExecutableFile=HJ;async function zJ(t,e){if(!(!t||!e)){for(let r of AA(t))if((await xA.readdir(r)).includes(e))return r}}re.findBaseDirectory=zJ;function GJ(t){let e=Math.random().toString(16).substring(2,8);return xn.resolve($J.tmpdir(),t?`${t}-${e}`:e)}re.tmpfilepath=GJ;function AA(t){if(t=xn.normalize(t),!xn.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=xn.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(xn.sep).map((r,n,i)=>e.root+xn.join(...i.slice(0,i.length-n))).concat(e.root)}re.compilePaths=AA;var Cd=class extends SA.Readable{constructor(e,r={}){super({objectMode:!0}),this.p=e,this.options=r,this.paths=[this.p]}_read(){let e=this.paths.shift(),{pathFilter:r}=this.options;if(!e){this.push(null);return}vr.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let o={path:e,stats:i};i.isDirectory()?vr.readdir(e,(s,a)=>{if(s){this.emit("error",s);return}let u=a.map(c=>xn.join(e,c));r&&(u=u.filter(c=>r(c.substring(this.p.length+1)))),this.paths.push(...u),this.push(o)}):this.push(o)})}};re.Walker=Cd;function ED(t,e={}){return new Cd(t,e)}re.walk=ED});var CD=D((Lhe,kA)=>{var Us=1e3,Vs=Us*60,Hs=Vs*60,co=Hs*24,WJ=co*7,KJ=co*365.25;kA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return YJ(t);if(r==="number"&&isFinite(t))return e.long?XJ(t):JJ(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function YJ(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*KJ;case"weeks":case"week":case"w":return r*WJ;case"days":case"day":case"d":return r*co;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Hs;case"minutes":case"minute":case"mins":case"min":case"m":return r*Vs;case"seconds":case"second":case"secs":case"sec":case"s":return r*Us;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function JJ(t){var e=Math.abs(t);return e>=co?Math.round(t/co)+"d":e>=Hs?Math.round(t/Hs)+"h":e>=Vs?Math.round(t/Vs)+"m":e>=Us?Math.round(t/Us)+"s":t+"ms"}function XJ(t){var e=Math.abs(t);return e>=co?Sd(t,e,co,"day"):e>=Hs?Sd(t,e,Hs,"hour"):e>=Vs?Sd(t,e,Vs,"minute"):e>=Us?Sd(t,e,Us,"second"):t+" ms"}function Sd(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var SD=D((Bhe,TA)=>{function ZJ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=CD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function v(...g){if(!v.enabled)return;let w=v,x=Number(new Date),y=x-(f||x);w.diff=y,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return v.namespace=l,v.useColors=r.useColors(),v.color=r.selectColor(l),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(v),v}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}TA.exports=ZJ});var PA=D((or,xd)=>{or.formatArgs=eX;or.save=tX;or.load=rX;or.useColors=QJ;or.storage=nX();or.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();or.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function QJ(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function eX(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+xd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}or.log=console.debug||console.log||(()=>{});function tX(t){try{t?or.storage.setItem("debug",t):or.storage.removeItem("debug")}catch{}}function rX(){let t;try{t=or.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function nX(){try{return localStorage}catch{}}xd.exports=SD()(or);var{formatters:iX}=xd.exports;iX.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var $A=D((qhe,RA)=>{"use strict";RA.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var OD=D((Mhe,jA)=>{"use strict";var oX=require("os"),IA=require("tty"),br=$A(),{env:pt}=process,li;br("no-color")||br("no-colors")||br("color=false")||br("color=never")?li=0:(br("color")||br("colors")||br("color=true")||br("color=always"))&&(li=1);"FORCE_COLOR"in pt&&(pt.FORCE_COLOR==="true"?li=1:pt.FORCE_COLOR==="false"?li=0:li=pt.FORCE_COLOR.length===0?1:Math.min(parseInt(pt.FORCE_COLOR,10),3));function xD(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function FD(t,e){if(li===0)return 0;if(br("color=16m")||br("color=full")||br("color=truecolor"))return 3;if(br("color=256"))return 2;if(t&&!e&&li===void 0)return 0;let r=li||0;if(pt.TERM==="dumb")return r;if(process.platform==="win32"){let n=oX.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in pt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in pt)||pt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in pt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(pt.TEAMCITY_VERSION)?1:0;if(pt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in pt){let n=parseInt((pt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(pt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(pt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(pt.TERM)||"COLORTERM"in pt?1:r}function sX(t){let e=FD(t,t&&t.isTTY);return xD(e)}jA.exports={supportsColor:sX,stdout:xD(FD(!0,IA.isatty(1))),stderr:xD(FD(!0,IA.isatty(2)))}});var LA=D((mt,Od)=>{var aX=require("tty"),Fd=require("util");mt.init=pX;mt.log=fX;mt.formatArgs=cX;mt.save=dX;mt.load=hX;mt.useColors=uX;mt.destroy=Fd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");mt.colors=[6,2,3,4,5,1];try{let t=OD();t&&(t.stderr||t).level>=2&&(mt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}mt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function uX(){return"colors"in mt.inspectOpts?!!mt.inspectOpts.colors:aX.isatty(process.stderr.fd)}function cX(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
44
+ see https://github.com/jprichardson/node-fs-extra/issues/269`),Xu.checkPaths(t,e,"copy",(i,o)=>{if(i)return n(i);let{srcStat:s,destStat:a}=o;Xu.checkParentPaths(t,s,e,"copy",u=>u?n(u):r.filter?X2(K2,a,t,e,r,n):K2(a,t,e,r,n))})}function K2(t,e,r,n,i){let o=Ju.dirname(r);dY(o,(s,a)=>{if(s)return i(s);if(a)return yD(t,e,r,n,i);fY(o,u=>u?i(u):yD(t,e,r,n,i))})}function X2(t,e,r,n,i,o){Promise.resolve(i.filter(r,n)).then(s=>s?t(e,r,n,i,o):o(),s=>o(s))}function yD(t,e,r,n,i){return n.filter?X2(Y2,t,e,r,n,i):Y2(t,e,r,n,i)}function Y2(t,e,r,n,i){(n.dereference?Kt.stat:Kt.lstat)(e,(s,a)=>{if(s)return i(s);if(a.isDirectory())return wY(a,t,e,r,n,i);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return mY(a,t,e,r,n,i);if(a.isSymbolicLink())return CY(t,e,r,n,i)})}function mY(t,e,r,n,i,o){return e?gY(t,r,n,i,o):Z2(t,r,n,i,o)}function gY(t,e,r,n,i){if(n.overwrite)Kt.unlink(r,o=>o?i(o):Z2(t,e,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function Z2(t,e,r,n,i){Kt.copyFile(e,r,o=>o?i(o):n.preserveTimestamps?yY(t.mode,e,r,i):hd(r,t.mode,i))}function yY(t,e,r,n){return DY(t)?vY(r,t,i=>i?n(i):J2(t,e,r,n)):J2(t,e,r,n)}function DY(t){return(t&128)===0}function vY(t,e,r){return hd(t,e|128,r)}function J2(t,e,r,n){bY(e,r,i=>i?n(i):hd(r,t,n))}function hd(t,e,r){return Kt.chmod(t,e,r)}function bY(t,e,r){Kt.stat(t,(n,i)=>n?r(n):hY(e,i.atime,i.mtime,r))}function wY(t,e,r,n,i,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${n}' with directory '${r}'.`)):Q2(r,n,i,o):_Y(t.mode,r,n,i,o)}function _Y(t,e,r,n,i){Kt.mkdir(r,o=>{if(o)return i(o);Q2(e,r,n,s=>s?i(s):hd(r,t,i))})}function Q2(t,e,r,n){Kt.readdir(t,(i,o)=>i?n(i):eO(o,t,e,r,n))}function eO(t,e,r,n,i){let o=t.pop();return o?EY(t,o,e,r,n,i):i()}function EY(t,e,r,n,i,o){let s=Ju.join(r,e),a=Ju.join(n,e);Xu.checkPaths(s,a,"copy",(u,c)=>{if(u)return o(u);let{destStat:l}=c;yD(l,s,a,i,f=>f?o(f):eO(t,r,n,i,o))})}function CY(t,e,r,n,i){Kt.readlink(e,(o,s)=>{if(o)return i(o);if(n.dereference&&(s=Ju.resolve(process.cwd(),s)),t)Kt.readlink(r,(a,u)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Kt.symlink(s,r,i):i(a):(n.dereference&&(u=Ju.resolve(process.cwd(),u)),Xu.isSrcSubdir(s,u)?i(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${u}'.`)):t.isDirectory()&&Xu.isSrcSubdir(u,s)?i(new Error(`Cannot overwrite '${u}' with '${s}'.`)):SY(s,r,i)));else return Kt.symlink(s,r,i)})}function SY(t,e,r){Kt.unlink(e,n=>n?r(n):Kt.symlink(t,e,r))}tO.exports=pY});var DD=D((mhe,nO)=>{"use strict";var xY=Gt().fromCallback;nO.exports={copy:xY(rO())}});var dO=D((ghe,fO)=>{"use strict";var iO=dt(),uO=require("path"),xe=require("assert"),Zu=process.platform==="win32";function cO(t){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{t[r]=t[r]||iO[r],r=r+"Sync",t[r]=t[r]||iO[r]}),t.maxBusyTries=t.maxBusyTries||3}function vD(t,e,r){let n=0;typeof e=="function"&&(r=e,e={}),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe.strictEqual(typeof r,"function","rimraf: callback function required"),xe(e,"rimraf: invalid options argument provided"),xe.strictEqual(typeof e,"object","rimraf: options should be object"),cO(e),oO(t,e,function i(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&n<e.maxBusyTries){n++;let s=n*100;return setTimeout(()=>oO(t,e,i),s)}o.code==="ENOENT"&&(o=null)}r(o)})}function oO(t,e,r){xe(t),xe(e),xe(typeof r=="function"),e.lstat(t,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&Zu)return sO(t,e,n,r);if(i&&i.isDirectory())return pd(t,e,n,r);e.unlink(t,o=>{if(o){if(o.code==="ENOENT")return r(null);if(o.code==="EPERM")return Zu?sO(t,e,o,r):pd(t,e,o,r);if(o.code==="EISDIR")return pd(t,e,o,r)}return r(o)})})}function sO(t,e,r,n){xe(t),xe(e),xe(typeof n=="function"),e.chmod(t,438,i=>{i?n(i.code==="ENOENT"?null:r):e.stat(t,(o,s)=>{o?n(o.code==="ENOENT"?null:r):s.isDirectory()?pd(t,e,r,n):e.unlink(t,n)})})}function aO(t,e,r){let n;xe(t),xe(e);try{e.chmodSync(t,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=e.statSync(t)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?md(t,e,r):e.unlinkSync(t)}function pd(t,e,r,n){xe(t),xe(e),xe(typeof n=="function"),e.rmdir(t,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?FY(t,e,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function FY(t,e,r){xe(t),xe(e),xe(typeof r=="function"),e.readdir(t,(n,i)=>{if(n)return r(n);let o=i.length,s;if(o===0)return e.rmdir(t,r);i.forEach(a=>{vD(uO.join(t,a),e,u=>{if(!s){if(u)return r(s=u);--o===0&&e.rmdir(t,r)}})})})}function lO(t,e){let r;e=e||{},cO(e),xe(t,"rimraf: missing path"),xe.strictEqual(typeof t,"string","rimraf: path should be a string"),xe(e,"rimraf: missing options"),xe.strictEqual(typeof e,"object","rimraf: options should be object");try{r=e.lstatSync(t)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&Zu&&aO(t,e,n)}try{r&&r.isDirectory()?md(t,e,null):e.unlinkSync(t)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return Zu?aO(t,e,n):md(t,e,n);if(n.code!=="EISDIR")throw n;md(t,e,n)}}function md(t,e,r){xe(t),xe(e);try{e.rmdirSync(t)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")OY(t,e);else if(n.code!=="ENOENT")throw n}}function OY(t,e){if(xe(t),xe(e),e.readdirSync(t).forEach(r=>lO(uO.join(t,r),e)),Zu){let r=Date.now();do try{return e.rmdirSync(t,e)}catch{}while(Date.now()-r<500)}else return e.rmdirSync(t,e)}fO.exports=vD;vD.sync=lO});var Qu=D((yhe,pO)=>{"use strict";var AY=Gt().fromCallback,hO=dO();pO.exports={remove:AY(hO),removeSync:hO.sync}});var _O=D((Dhe,wO)=>{"use strict";var kY=Gt().fromCallback,yO=dt(),DO=require("path"),vO=kr(),bO=Qu(),mO=kY(function(e,r){r=r||function(){},yO.readdir(e,(n,i)=>{if(n)return vO.mkdirs(e,r);i=i.map(s=>DO.join(e,s)),o();function o(){let s=i.pop();if(!s)return r();bO.remove(s,a=>{if(a)return r(a);o()})}})});function gO(t){let e;try{e=yO.readdirSync(t)}catch{return vO.mkdirsSync(t)}e.forEach(r=>{r=DO.join(t,r),bO.removeSync(r)})}wO.exports={emptyDirSync:gO,emptydirSync:gO,emptyDir:mO,emptydir:mO}});var xO=D((vhe,SO)=>{"use strict";var TY=Gt().fromCallback,EO=require("path"),ui=dt(),CO=kr();function PY(t,e){function r(){ui.writeFile(t,"",n=>{if(n)return e(n);e()})}ui.stat(t,(n,i)=>{if(!n&&i.isFile())return e();let o=EO.dirname(t);ui.stat(o,(s,a)=>{if(s)return s.code==="ENOENT"?CO.mkdirs(o,u=>{if(u)return e(u);r()}):e(s);a.isDirectory()?r():ui.readdir(o,u=>{if(u)return e(u)})})})}function RY(t){let e;try{e=ui.statSync(t)}catch{}if(e&&e.isFile())return;let r=EO.dirname(t);try{ui.statSync(r).isDirectory()||ui.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")CO.mkdirsSync(r);else throw n}ui.writeFileSync(t,"")}SO.exports={createFile:TY(PY),createFileSync:RY}});var TO=D((bhe,kO)=>{"use strict";var $Y=Gt().fromCallback,OO=require("path"),uo=dt(),AO=kr(),FO=ai().pathExists;function IY(t,e,r){function n(i,o){uo.link(i,o,s=>{if(s)return r(s);r(null)})}FO(e,(i,o)=>{if(i)return r(i);if(o)return r(null);uo.lstat(t,s=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),r(s);let a=OO.dirname(e);FO(a,(u,c)=>{if(u)return r(u);if(c)return n(t,e);AO.mkdirs(a,l=>{if(l)return r(l);n(t,e)})})})})}function jY(t,e){if(uo.existsSync(e))return;try{uo.lstatSync(t)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let n=OO.dirname(e);return uo.existsSync(n)||AO.mkdirsSync(n),uo.linkSync(t,e)}kO.exports={createLink:$Y(IY),createLinkSync:jY}});var RO=D((whe,PO)=>{"use strict";var ci=require("path"),ec=dt(),NY=ai().pathExists;function LY(t,e,r){if(ci.isAbsolute(t))return ec.lstat(t,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:t,toDst:t}));{let n=ci.dirname(e),i=ci.join(n,t);return NY(i,(o,s)=>o?r(o):s?r(null,{toCwd:i,toDst:t}):ec.lstat(t,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),r(a)):r(null,{toCwd:t,toDst:ci.relative(n,t)})))}}function BY(t,e){let r;if(ci.isAbsolute(t)){if(r=ec.existsSync(t),!r)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}else{let n=ci.dirname(e),i=ci.join(n,t);if(r=ec.existsSync(i),r)return{toCwd:i,toDst:t};if(r=ec.existsSync(t),!r)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:ci.relative(n,t)}}}PO.exports={symlinkPaths:LY,symlinkPathsSync:BY}});var jO=D((_he,IO)=>{"use strict";var $O=dt();function qY(t,e,r){if(r=typeof e=="function"?e:r,e=typeof e=="function"?!1:e,e)return r(null,e);$O.lstat(t,(n,i)=>{if(n)return r(null,"file");e=i&&i.isDirectory()?"dir":"file",r(null,e)})}function MY(t,e){let r;if(e)return e;try{r=$O.lstatSync(t)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}IO.exports={symlinkType:qY,symlinkTypeSync:MY}});var VO=D((Ehe,UO)=>{"use strict";var UY=Gt().fromCallback,LO=require("path"),Ls=dt(),BO=kr(),VY=BO.mkdirs,HY=BO.mkdirsSync,qO=RO(),zY=qO.symlinkPaths,GY=qO.symlinkPathsSync,MO=jO(),WY=MO.symlinkType,KY=MO.symlinkTypeSync,NO=ai().pathExists;function YY(t,e,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,NO(e,(i,o)=>{if(i)return n(i);if(o)return n(null);zY(t,e,(s,a)=>{if(s)return n(s);t=a.toDst,WY(a.toCwd,r,(u,c)=>{if(u)return n(u);let l=LO.dirname(e);NO(l,(f,h)=>{if(f)return n(f);if(h)return Ls.symlink(t,e,c,n);VY(l,d=>{if(d)return n(d);Ls.symlink(t,e,c,n)})})})})})}function JY(t,e,r){if(Ls.existsSync(e))return;let i=GY(t,e);t=i.toDst,r=KY(i.toCwd,r);let o=LO.dirname(e);return Ls.existsSync(o)||HY(o),Ls.symlinkSync(t,e,r)}UO.exports={createSymlink:UY(YY),createSymlinkSync:JY}});var zO=D((Che,HO)=>{"use strict";var gd=xO(),yd=TO(),Dd=VO();HO.exports={createFile:gd.createFile,createFileSync:gd.createFileSync,ensureFile:gd.createFile,ensureFileSync:gd.createFileSync,createLink:yd.createLink,createLinkSync:yd.createLinkSync,ensureLink:yd.createLink,ensureLinkSync:yd.createLinkSync,createSymlink:Dd.createSymlink,createSymlinkSync:Dd.createSymlinkSync,ensureSymlink:Dd.createSymlink,ensureSymlinkSync:Dd.createSymlinkSync}});var vd=D((She,GO)=>{function XY(t,{EOL:e=`
45
+ `,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let o=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+o}function ZY(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}GO.exports={stringify:XY,stripBom:ZY}});var JO=D((xhe,YO)=>{var Bs;try{Bs=dt()}catch{Bs=require("fs")}var bd=Gt(),{stringify:WO,stripBom:KO}=vd();async function QY(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Bs,n="throws"in e?e.throws:!0,i=await bd.fromCallback(r.readFile)(t,e);i=KO(i);let o;try{o=JSON.parse(i,e?e.reviver:null)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}return o}var eJ=bd.fromPromise(QY);function tJ(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Bs,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=KO(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function rJ(t,e,r={}){let n=r.fs||Bs,i=WO(e,r);await bd.fromCallback(n.writeFile)(t,i,r)}var nJ=bd.fromPromise(rJ);function iJ(t,e,r={}){let n=r.fs||Bs,i=WO(e,r);return n.writeFileSync(t,i,r)}var oJ={readFile:eJ,readFileSync:tJ,writeFile:nJ,writeFileSync:iJ};YO.exports=oJ});var ZO=D((Fhe,XO)=>{"use strict";var wd=JO();XO.exports={readJson:wd.readFile,readJsonSync:wd.readFileSync,writeJson:wd.writeFile,writeJsonSync:wd.writeFileSync}});var _d=D((Ohe,tA)=>{"use strict";var sJ=Gt().fromCallback,tc=dt(),QO=require("path"),eA=kr(),aJ=ai().pathExists;function uJ(t,e,r,n){typeof r=="function"&&(n=r,r="utf8");let i=QO.dirname(t);aJ(i,(o,s)=>{if(o)return n(o);if(s)return tc.writeFile(t,e,r,n);eA.mkdirs(i,a=>{if(a)return n(a);tc.writeFile(t,e,r,n)})})}function cJ(t,...e){let r=QO.dirname(t);if(tc.existsSync(r))return tc.writeFileSync(t,...e);eA.mkdirsSync(r),tc.writeFileSync(t,...e)}tA.exports={outputFile:sJ(uJ),outputFileSync:cJ}});var nA=D((Ahe,rA)=>{"use strict";var{stringify:lJ}=vd(),{outputFile:fJ}=_d();async function dJ(t,e,r={}){let n=lJ(e,r);await fJ(t,n,r)}rA.exports=dJ});var oA=D((khe,iA)=>{"use strict";var{stringify:hJ}=vd(),{outputFileSync:pJ}=_d();function mJ(t,e,r){let n=hJ(e,r);pJ(t,n,r)}iA.exports=mJ});var aA=D((The,sA)=>{"use strict";var gJ=Gt().fromPromise,Rt=ZO();Rt.outputJson=gJ(nA());Rt.outputJsonSync=oA();Rt.outputJSON=Rt.outputJson;Rt.outputJSONSync=Rt.outputJsonSync;Rt.writeJSON=Rt.writeJson;Rt.writeJSONSync=Rt.writeJsonSync;Rt.readJSON=Rt.readJson;Rt.readJSONSync=Rt.readJsonSync;sA.exports=Rt});var hA=D((Phe,dA)=>{"use strict";var lA=dt(),yJ=require("path"),DJ=gD().copySync,fA=Qu().removeSync,vJ=kr().mkdirpSync,uA=Wu();function bJ(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i}=uA.checkPathsSync(t,e,"move");return uA.checkParentPathsSync(t,i,e,"move"),vJ(yJ.dirname(e)),wJ(t,e,n)}function wJ(t,e,r){if(r)return fA(e),cA(t,e,r);if(lA.existsSync(e))throw new Error("dest already exists.");return cA(t,e,r)}function cA(t,e,r){try{lA.renameSync(t,e)}catch(n){if(n.code!=="EXDEV")throw n;return _J(t,e,r)}}function _J(t,e,r){return DJ(t,e,{overwrite:r,errorOnExist:!0}),fA(t)}dA.exports=bJ});var mA=D((Rhe,pA)=>{"use strict";pA.exports={moveSync:hA()}});var bA=D(($he,vA)=>{"use strict";var EJ=dt(),CJ=require("path"),SJ=DD().copy,DA=Qu().remove,xJ=kr().mkdirp,FJ=ai().pathExists,gA=Wu();function OJ(t,e,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;gA.checkPaths(t,e,"move",(o,s)=>{if(o)return n(o);let{srcStat:a}=s;gA.checkParentPaths(t,a,e,"move",u=>{if(u)return n(u);xJ(CJ.dirname(e),c=>c?n(c):AJ(t,e,i,n))})})}function AJ(t,e,r,n){if(r)return DA(e,i=>i?n(i):yA(t,e,r,n));FJ(e,(i,o)=>i?n(i):o?n(new Error("dest already exists.")):yA(t,e,r,n))}function yA(t,e,r,n){EJ.rename(t,e,i=>i?i.code!=="EXDEV"?n(i):kJ(t,e,r,n):n())}function kJ(t,e,r,n){SJ(t,e,{overwrite:r,errorOnExist:!0},o=>o?n(o):DA(t,n))}vA.exports=OJ});var _A=D((Ihe,wA)=>{"use strict";var TJ=Gt().fromCallback;wA.exports={move:TJ(bA())}});var Ed=D((jhe,bD)=>{"use strict";bD.exports={...Gu(),...gD(),...DD(),..._O(),...zO(),...aA(),...kr(),...mA(),..._A(),..._d(),...ai(),...Qu()};var EA=require("fs");Object.getOwnPropertyDescriptor(EA,"promises")&&Object.defineProperty(bD.exports,"promises",{get(){return EA.promises}})});var wD=D(qs=>{"use strict";Object.defineProperty(qs,"__esModule",{value:!0});qs.readdir=qs.stat=void 0;var CA=Ed();async function PJ(t){try{return await CA.stat(t)}catch{}}qs.stat=PJ;async function RJ(t){try{return await CA.readdir(t)}catch{return[]}}qs.readdir=RJ});var Ms=D(re=>{"use strict";Object.defineProperty(re,"__esModule",{value:!0});re.walk=re.Walker=re.compilePaths=re.tmpfilepath=re.findBaseDirectory=re.isExecutableFile=re.pathExecutable=re.pathWritable=re.pathReadable=re.pathExists=re.pathAccessible=re.writeStreamToFile=re.cacheFileChecksum=re.getFileChecksums=re.getFileChecksum=re.fileToString=re.getFileTree=re.readdirp=re.readdirSafe=re.statSafe=void 0;var $J=(x2(),ke(S2)),vr=Ed(),IJ=require("os"),xn=require("path"),SA=require("stream"),xA=wD();$J.__exportStar(Ed(),re);var FA=wD();Object.defineProperty(re,"statSafe",{enumerable:!0,get:function(){return FA.stat}});Object.defineProperty(re,"readdirSafe",{enumerable:!0,get:function(){return FA.readdir}});async function jJ(t,{filter:e,onError:r,walkerOptions:n}={}){return new Promise((i,o)=>{let s=[],a=ED(t,n);e&&(a=a.pipe(new SA.Transform({objectMode:!0,transform(u,c,l){(!e||e(u))&&this.push(u),l()}}))),a.on("error",u=>r?r(u):o(u)).on("data",u=>s.push(u.path)).on("end",()=>i(s))})}re.readdirp=jJ;async function NJ(t,{onError:e,onFileNode:r=o=>o,onDirectoryNode:n=o=>o,walkerOptions:i}={}){let o=new Map([]),s=u=>{let c=xn.dirname(u.path),l=o.get(c);return l&&l.type==="directory"?l:n({path:c,type:"directory",children:[]})},a=(u,c)=>{let l={path:u.path,parent:c};return u.stats.isDirectory()?n({...l,type:"directory",children:[]}):r({...l,type:"file"})};return new Promise((u,c)=>{t=xn.resolve(t),ED(t,i).on("error",f=>e?e(f):c(f)).on("data",f=>{let h=s(f),d=a(f,h);h.children.push(d),o.set(f.path,d),o.set(h.path,h)}).on("end",()=>{let f=o.get(t);if(!f)return c(new Error("No root node found after walking directory structure."));delete f.parent,u(f)})})}re.getFileTree=NJ;async function LJ(t){try{return await vr.readFile(t,{encoding:"utf8"})}catch(e){if(e.code==="ENOENT"||e.code==="ENOTDIR")return"";throw e}}re.fileToString=LJ;async function _D(t){let e=await Promise.resolve().then(()=>require("crypto"));return new Promise((r,n)=>{let i=e.createHash("md5"),o=vr.createReadStream(t);o.on("error",s=>{n(s)}),i.once("readable",()=>{let s=i.read().toString("hex");r(s)}),o.pipe(i)})}re.getFileChecksum=_D;async function BJ(t){return Promise.all([_D(t),(async()=>{try{return(await vr.readFile(`${t}.md5`,{encoding:"utf8"})).trim()}catch(e){if(e.code!=="ENOENT")throw e}})()])}re.getFileChecksums=BJ;async function qJ(t,e){let r=await _D(t);await vr.writeFile(`${t}.md5`,r,{encoding:"utf8"})}re.cacheFileChecksum=qJ;function MJ(t,e){return new Promise((r,n)=>{let i=vr.createWriteStream(e);t.pipe(i),i.on("error",n),i.on("finish",r)})}re.writeStreamToFile=MJ;async function rc(t,e){try{await vr.access(t,e)}catch{return!1}return!0}re.pathAccessible=rc;async function UJ(t){return rc(t,vr.constants.F_OK)}re.pathExists=UJ;async function VJ(t){return rc(t,vr.constants.R_OK)}re.pathReadable=VJ;async function HJ(t){return rc(t,vr.constants.W_OK)}re.pathWritable=HJ;async function OA(t){return rc(t,vr.constants.X_OK)}re.pathExecutable=OA;async function zJ(t){let[e,r]=await Promise.all([xA.stat(t),OA(t)]);return!!e&&(e.isFile()||e.isSymbolicLink())&&r}re.isExecutableFile=zJ;async function GJ(t,e){if(!(!t||!e)){for(let r of AA(t))if((await xA.readdir(r)).includes(e))return r}}re.findBaseDirectory=GJ;function WJ(t){let e=Math.random().toString(16).substring(2,8);return xn.resolve(IJ.tmpdir(),t?`${t}-${e}`:e)}re.tmpfilepath=WJ;function AA(t){if(t=xn.normalize(t),!xn.isAbsolute(t))throw new Error(`${t} is not an absolute path`);let e=xn.parse(t);return t===e.root?[t]:t.slice(e.root.length).split(xn.sep).map((r,n,i)=>e.root+xn.join(...i.slice(0,i.length-n))).concat(e.root)}re.compilePaths=AA;var Cd=class extends SA.Readable{constructor(e,r={}){super({objectMode:!0}),this.p=e,this.options=r,this.paths=[this.p]}_read(){let e=this.paths.shift(),{pathFilter:r}=this.options;if(!e){this.push(null);return}vr.lstat(e,(n,i)=>{if(n){this.emit("error",n);return}let o={path:e,stats:i};i.isDirectory()?vr.readdir(e,(s,a)=>{if(s){this.emit("error",s);return}let u=a.map(c=>xn.join(e,c));r&&(u=u.filter(c=>r(c.substring(this.p.length+1)))),this.paths.push(...u),this.push(o)}):this.push(o)})}};re.Walker=Cd;function ED(t,e={}){return new Cd(t,e)}re.walk=ED});var CD=D((Bhe,kA)=>{var Us=1e3,Vs=Us*60,Hs=Vs*60,co=Hs*24,KJ=co*7,YJ=co*365.25;kA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return JJ(t);if(r==="number"&&isFinite(t))return e.long?ZJ(t):XJ(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function JJ(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*YJ;case"weeks":case"week":case"w":return r*KJ;case"days":case"day":case"d":return r*co;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Hs;case"minutes":case"minute":case"mins":case"min":case"m":return r*Vs;case"seconds":case"second":case"secs":case"sec":case"s":return r*Us;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function XJ(t){var e=Math.abs(t);return e>=co?Math.round(t/co)+"d":e>=Hs?Math.round(t/Hs)+"h":e>=Vs?Math.round(t/Vs)+"m":e>=Us?Math.round(t/Us)+"s":t+"ms"}function ZJ(t){var e=Math.abs(t);return e>=co?Sd(t,e,co,"day"):e>=Hs?Sd(t,e,Hs,"hour"):e>=Vs?Sd(t,e,Vs,"minute"):e>=Us?Sd(t,e,Us,"second"):t+" ms"}function Sd(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var SD=D((qhe,TA)=>{function QJ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=CD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function v(...g){if(!v.enabled)return;let w=v,x=Number(new Date),y=x-(f||x);w.diff=y,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return v.namespace=l,v.useColors=r.useColors(),v.color=r.selectColor(l),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(v),v}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}TA.exports=QJ});var PA=D((or,xd)=>{or.formatArgs=tX;or.save=rX;or.load=nX;or.useColors=eX;or.storage=iX();or.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();or.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function eX(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function tX(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+xd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}or.log=console.debug||console.log||(()=>{});function rX(t){try{t?or.storage.setItem("debug",t):or.storage.removeItem("debug")}catch{}}function nX(){let t;try{t=or.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function iX(){try{return localStorage}catch{}}xd.exports=SD()(or);var{formatters:oX}=xd.exports;oX.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var $A=D((Mhe,RA)=>{"use strict";RA.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var OD=D((Uhe,jA)=>{"use strict";var sX=require("os"),IA=require("tty"),br=$A(),{env:pt}=process,li;br("no-color")||br("no-colors")||br("color=false")||br("color=never")?li=0:(br("color")||br("colors")||br("color=true")||br("color=always"))&&(li=1);"FORCE_COLOR"in pt&&(pt.FORCE_COLOR==="true"?li=1:pt.FORCE_COLOR==="false"?li=0:li=pt.FORCE_COLOR.length===0?1:Math.min(parseInt(pt.FORCE_COLOR,10),3));function xD(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function FD(t,e){if(li===0)return 0;if(br("color=16m")||br("color=full")||br("color=truecolor"))return 3;if(br("color=256"))return 2;if(t&&!e&&li===void 0)return 0;let r=li||0;if(pt.TERM==="dumb")return r;if(process.platform==="win32"){let n=sX.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in pt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in pt)||pt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in pt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(pt.TEAMCITY_VERSION)?1:0;if(pt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in pt){let n=parseInt((pt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(pt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(pt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(pt.TERM)||"COLORTERM"in pt?1:r}function aX(t){let e=FD(t,t&&t.isTTY);return xD(e)}jA.exports={supportsColor:aX,stdout:xD(FD(!0,IA.isatty(1))),stderr:xD(FD(!0,IA.isatty(2)))}});var LA=D((mt,Od)=>{var uX=require("tty"),Fd=require("util");mt.init=mX;mt.log=dX;mt.formatArgs=lX;mt.save=hX;mt.load=pX;mt.useColors=cX;mt.destroy=Fd.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");mt.colors=[6,2,3,4,5,1];try{let t=OD();t&&(t.stderr||t).level>=2&&(mt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}mt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function cX(){return"colors"in mt.inspectOpts?!!mt.inspectOpts.colors:uX.isatty(process.stderr.fd)}function lX(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
46
46
  `).join(`
47
- `+o),t.push(i+"m+"+Od.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=lX()+e+" "+t[0]}function lX(){return mt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function fX(...t){return process.stderr.write(Fd.formatWithOptions(mt.inspectOpts,...t)+`
48
- `)}function dX(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function hX(){return process.env.DEBUG}function pX(t){t.inspectOpts={};let e=Object.keys(mt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=mt.inspectOpts[e[r]]}Od.exports=SD()(mt);var{formatters:NA}=Od.exports;NA.o=function(t){return this.inspectOpts.colors=this.useColors,Fd.inspect(t,this.inspectOpts).split(`
49
- `).map(e=>e.trim()).join(" ")};NA.O=function(t){return this.inspectOpts.colors=this.useColors,Fd.inspect(t,this.inspectOpts)}});var BA=D((Uhe,AD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?AD.exports=PA():AD.exports=LA()});var GA=D((Vhe,zA)=>{"use strict";var kD,MA,UA,VA,HA=!0;typeof process<"u"&&({FORCE_COLOR:kD,NODE_DISABLE_COLORS:MA,NO_COLOR:UA,TERM:VA}=process.env||{},HA=process.stdout&&process.stdout.isTTY);var _e={enabled:!MA&&UA==null&&VA!=="dumb"&&(kD!=null&&kD!=="0"||HA),reset:Oe(0,0),bold:Oe(1,22),dim:Oe(2,22),italic:Oe(3,23),underline:Oe(4,24),inverse:Oe(7,27),hidden:Oe(8,28),strikethrough:Oe(9,29),black:Oe(30,39),red:Oe(31,39),green:Oe(32,39),yellow:Oe(33,39),blue:Oe(34,39),magenta:Oe(35,39),cyan:Oe(36,39),white:Oe(37,39),gray:Oe(90,39),grey:Oe(90,39),bgBlack:Oe(40,49),bgRed:Oe(41,49),bgGreen:Oe(42,49),bgYellow:Oe(43,49),bgBlue:Oe(44,49),bgMagenta:Oe(45,49),bgCyan:Oe(46,49),bgWhite:Oe(47,49)};function qA(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function mX(t,e){let r={has:t,keys:e};return r.reset=_e.reset.bind(r),r.bold=_e.bold.bind(r),r.dim=_e.dim.bind(r),r.italic=_e.italic.bind(r),r.underline=_e.underline.bind(r),r.inverse=_e.inverse.bind(r),r.hidden=_e.hidden.bind(r),r.strikethrough=_e.strikethrough.bind(r),r.black=_e.black.bind(r),r.red=_e.red.bind(r),r.green=_e.green.bind(r),r.yellow=_e.yellow.bind(r),r.blue=_e.blue.bind(r),r.magenta=_e.magenta.bind(r),r.cyan=_e.cyan.bind(r),r.white=_e.white.bind(r),r.gray=_e.gray.bind(r),r.grey=_e.grey.bind(r),r.bgBlack=_e.bgBlack.bind(r),r.bgRed=_e.bgRed.bind(r),r.bgGreen=_e.bgGreen.bind(r),r.bgYellow=_e.bgYellow.bind(r),r.bgBlue=_e.bgBlue.bind(r),r.bgMagenta=_e.bgMagenta.bind(r),r.bgCyan=_e.bgCyan.bind(r),r.bgWhite=_e.bgWhite.bind(r),r}function Oe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:_e.enabled?qA(this.keys,n+""):n+""):n===void 0?mX([t],[r]):_e.enabled?qA([r],n+""):n+""}}zA.exports=_e});var zs=D(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.ancillary=et.failure=et.success=et.input=et.weak=et.strong=void 0;var gX=(Cn(),ke(En)),Yr=gX.__importDefault(GA());et.strong=Yr.default.bold;et.weak=Yr.default.dim;et.input=Yr.default.cyan;et.success=Yr.default.green;et.failure=Yr.default.red;et.ancillary=Yr.default.cyan;var yX={strong:et.strong,weak:et.weak,input:et.input,success:et.success,failure:et.failure,ancillary:et.ancillary,log:{DEBUG:Yr.default.magenta,INFO:Yr.default.cyan,WARN:Yr.default.yellow,ERROR:Yr.default.red}};et.default=yX});var nc={};mn(nc,{__addDisposableResource:()=>hk,__assign:()=>Ad,__asyncDelegator:()=>ok,__asyncGenerator:()=>ik,__asyncValues:()=>sk,__await:()=>Gs,__awaiter:()=>ZA,__classPrivateFieldGet:()=>lk,__classPrivateFieldIn:()=>dk,__classPrivateFieldSet:()=>fk,__createBinding:()=>Td,__decorate:()=>YA,__disposeResources:()=>pk,__esDecorate:()=>DX,__exportStar:()=>ek,__extends:()=>WA,__generator:()=>QA,__importDefault:()=>ck,__importStar:()=>uk,__makeTemplateObject:()=>ak,__metadata:()=>XA,__param:()=>JA,__propKey:()=>bX,__read:()=>PD,__rest:()=>KA,__runInitializers:()=>vX,__setFunctionName:()=>wX,__spread:()=>tk,__spreadArray:()=>nk,__spreadArrays:()=>rk,__values:()=>kd,default:()=>CX});function WA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");TD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function KA(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function YA(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function JA(t,e){return function(r,n){e(r,n,t)}}function DX(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function vX(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function bX(t){return typeof t=="symbol"?t:"".concat(t)}function wX(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function XA(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ZA(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function QA(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ek(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Td(e,t,r)}function kd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function PD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function tk(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(PD(arguments[e]));return t}function rk(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function nk(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Gs(t){return this instanceof Gs?(this.v=t,this):new Gs(t)}function ik(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,v){o.push([h,d,p,v])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof Gs?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function ok(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Gs(t[i](s)),done:!1}:o?o(s):s}:o}}function sk(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof kd=="function"?kd(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function ak(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function uk(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Td(e,t,r);return _X(e,t),e}function ck(t){return t&&t.__esModule?t:{default:t}}function lk(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function fk(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function dk(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function hk(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function pk(t){function e(n){t.error=t.hasError?new EX(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var TD,Ad,Td,_X,EX,CX,ic=ut(()=>{TD=function(t,e){return TD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},TD(t,e)};Ad=function(){return Ad=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Ad.apply(this,arguments)};Td=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};_X=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};EX=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};CX={__extends:WA,__assign:Ad,__rest:KA,__decorate:YA,__param:JA,__metadata:XA,__awaiter:ZA,__generator:QA,__createBinding:Td,__exportStar:ek,__values:kd,__read:PD,__spread:tk,__spreadArrays:rk,__spreadArray:nk,__await:Gs,__asyncGenerator:ik,__asyncDelegator:ok,__asyncValues:sk,__makeTemplateObject:ak,__importStar:uk,__importDefault:ck,__classPrivateFieldGet:lk,__classPrivateFieldSet:fk,__classPrivateFieldIn:dk,__addDisposableResource:hk,__disposeResources:pk}});var RD=D(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.EscapeCode=void 0;var Tr="\x1B[",gt=class{};Pd.EscapeCode=gt;gt.cursorLeft=()=>`${Tr}G`;gt.cursorUp=(t=1)=>`${Tr}${t}A`;gt.cursorDown=(t=1)=>`${Tr}${t}B`;gt.cursorForward=(t=1)=>`${Tr}${t}C`;gt.cursorBackward=(t=1)=>`${Tr}${t}D`;gt.cursorHide=()=>`${Tr}?25l`;gt.cursorShow=()=>`${Tr}?25h`;gt.eraseLine=()=>`${Tr}2K`;gt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=gt.eraseLine(),r<t-1&&(e+=gt.cursorUp());return`${e}${gt.cursorLeft()}`};gt.eraseUp=()=>`${Tr}1J`;gt.eraseDown=()=>`${Tr}J`;gt.eraseScreen=()=>`${Tr}2J`});var gk=D(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.Cursor=void 0;var SX=(ic(),ke(nc)),xX=SX.__importDefault(Wy()),mk=RD(),Ws=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(mk.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,xX.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(mk.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Rd.Cursor=Ws;Ws.stream=process.stderr;Ws._isVisible=!0;Ws._listenerAttached=!1});var ID=D((Whe,$D)=>{"use strict";var yk=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);$D.exports=yk;$D.exports.default=yk});var bk=D((Khe,vk)=>{"use strict";var Dk="[\uD800-\uDBFF][\uDC00-\uDFFF]",FX=t=>t&&t.exact?new RegExp(`^${Dk}$`):new RegExp(Dk,"g");vk.exports=FX});var _k=D((Yhe,wk)=>{"use strict";wk.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]}});var jD=D((Jhe,Ck)=>{var oc=_k(),Ek={};for(let t of Object.keys(oc))Ek[oc[t]]=t;var J={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"]}};Ck.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:r})}J.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,u;o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+o)/2;return o===i?u=0:c<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,c*100]};J.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),f=function(h){return(c-h)/6/l+1/2};return l===0?(i=0,o=0):(o=l/c,e=f(s),r=f(a),n=f(u),s===c?i=n-r:a===c?i=1/3+e-n:u===c&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,c*100]};J.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=J.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};J.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function OX(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=Ek[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(oc)){let o=oc[i],s=OX(t,o);s<r&&(r=s,n=i)}return n};J.keyword.rgb=function(t){return oc[t]};J.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};J.rgb.lab=function(t){let e=J.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};J.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,u[c]=s*255;return u};J.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[e,a*100,s*100]};J.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}};J.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};J.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,s&1&&(o=1-o);let u=r+o*(a-r),c,l,f;switch(s){default:case 6:case 0:c=a,l=u,f=r;break;case 1:c=u,l=a,f=r;break;case 2:c=r,l=a,f=u;break;case 3:c=r,l=u,f=a;break;case 4:c=u,l=r,f=a;break;case 5:c=a,l=r,f=u;break}return[c*255,l*255,f*255]};J.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(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]};J.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*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),[i*255,o*255,s*255]};J.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};J.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,u=i**3,c=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=c>.008856?c:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};J.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};J.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};J.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?J.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};J.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};J.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};J.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};J.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};J.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,u;return s<1?a=o/(1-s):a=0,s<=0?u=0:i===e?u=(r-n)/s%6:i===r?u=2+(n-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,a*100]};J.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};J.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};J.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,u=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}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};J.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};J.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};J.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};J.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var xk=D((Xhe,Sk)=>{var $d=jD();function AX(){let t={},e=Object.keys($d);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function kX(t){let e=AX(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys($d[n]);for(let o=i.length,s=0;s<o;s++){let a=i[s],u=e[a];u.distance===-1&&(u.distance=e[n].distance+1,u.parent=n,r.unshift(a))}}return e}function TX(t,e){return function(r){return e(t(r))}}function PX(t,e){let r=[e[t].parent,t],n=$d[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=TX($d[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}Sk.exports=function(t){let e=kX(t),r={},n=Object.keys(e);for(let i=n.length,o=0;o<i;o++){let s=n[o];e[s].parent!==null&&(r[s]=PX(s,e))}return r}});var Ok=D((Zhe,Fk)=>{var ND=jD(),RX=xk(),Ks={},$X=Object.keys(ND);function IX(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function jX(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(r);if(typeof i=="object")for(let o=i.length,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}$X.forEach(t=>{Ks[t]={},Object.defineProperty(Ks[t],"channels",{value:ND[t].channels}),Object.defineProperty(Ks[t],"labels",{value:ND[t].labels});let e=RX(t);Object.keys(e).forEach(n=>{let i=e[n];Ks[t][n]=jX(i),Ks[t][n].raw=IX(i)})});Fk.exports=Ks});var BD=D((Qhe,Rk)=>{"use strict";var Ak=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,kk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},Tk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},Id=t=>t,Pk=(t,e,r)=>[t,e,r],Ys=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},LD,Js=(t,e,r,n)=>{LD===void 0&&(LD=Ok());let i=n?10:0,o={};for(let[s,a]of Object.entries(LD)){let u=s==="ansi16"?"ansi":s;s===e?o[u]=t(r,i):typeof a=="object"&&(o[u]=t(a[e],i))}return o};function NX(){let t=new Map,e={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],blackBright:[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]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[i,o]of Object.entries(n))e[i]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[i]=e[i],t.set(o[0],o[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Ys(e.color,"ansi",()=>Js(Ak,"ansi16",Id,!1)),Ys(e.color,"ansi256",()=>Js(kk,"ansi256",Id,!1)),Ys(e.color,"ansi16m",()=>Js(Tk,"rgb",Pk,!1)),Ys(e.bgColor,"ansi",()=>Js(Ak,"ansi16",Id,!0)),Ys(e.bgColor,"ansi256",()=>Js(kk,"ansi256",Id,!0)),Ys(e.bgColor,"ansi16m",()=>Js(Tk,"rgb",Pk,!0)),e}Object.defineProperty(Rk,"exports",{enumerable:!0,get:NX})});var Lk=D((epe,Nk)=>{"use strict";var LX=ID(),BX=bk(),$k=BD(),jk=["\x1B","\x9B"],jd=t=>`${jk[0]}[${t}m`,Ik=(t,e,r)=>{let n=[];t=[...t];for(let i of t){let o=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");let s=$k.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push(jd(e?s:o)):t.splice(a,1)}else if(e){n.push(jd(0));break}else n.push(jd(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=jd($k.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};Nk.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,c="";for(let[l,f]of n.entries()){let h=!1;if(jk.includes(f)){let d=/\d[^m]*/.exec(t.slice(l,l+18));a=d&&d.length>0?d[0]:void 0,u<o&&(s=!0,a!==void 0&&i.push(a))}else s&&f==="m"&&(s=!1,h=!0);if(!s&&!h&&u++,!BX({exact:!0}).test(f)&&LX(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)c+=f;else if(u===e&&!s&&a!==void 0)c=Ik(i);else if(u>=o){c+=Ik(i,!0,a);break}}return c}});var qk=D((tpe,Bk)=>{"use strict";Bk.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var Nd=D((rpe,Mk)=>{"use strict";var qX=qk();Mk.exports=t=>typeof t=="string"?t.replace(qX(),""):t});var Vk=D((npe,Uk)=>{"use strict";Uk.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var MD=D((ipe,qD)=>{"use strict";var MX=Nd(),UX=ID(),VX=Vk(),Hk=t=>{if(typeof t!="string"||t.length===0||(t=MX(t),t.length===0))return 0;t=t.replace(VX()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=UX(n)?2:1)}return e};qD.exports=Hk;qD.exports.default=Hk});var Jk=D((ope,Yk)=>{"use strict";var sc=MD(),HX=Nd(),zX=BD(),Ld=new Set(["\x1B","\x9B"]),GX=39,VD="\x07",Wk="[",WX="]",Kk="m",HD=`${WX}8;;`,zk=t=>`${Ld.values().next().value}${Wk}${t}${Kk}`,Gk=t=>`${Ld.values().next().value}${HD}${t}${VD}`,KX=t=>t.split(" ").map(e=>sc(e)),UD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=sc(HX(t[t.length-1]));for(let[a,u]of n.entries()){let c=sc(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),Ld.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(HD)),i){o?u===VD&&(i=!1,o=!1):u===Kk&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},YX=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(sc(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},JX=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=KX(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=sc(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),UD(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){UD(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){UD(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(YX));let u=[...a.join(`
50
- `)];for(let[c,l]of u.entries()){if(n+=l,Ld.has(l)){let{groups:h}=new RegExp(`(?:\\${Wk}(?<code>\\d+)m|\\${HD}(?<uri>.*)${VD})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===GX?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=zX.codes.get(Number(i));u[c+1]===`
47
+ `+o),t.push(i+"m+"+Od.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=fX()+e+" "+t[0]}function fX(){return mt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function dX(...t){return process.stderr.write(Fd.formatWithOptions(mt.inspectOpts,...t)+`
48
+ `)}function hX(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function pX(){return process.env.DEBUG}function mX(t){t.inspectOpts={};let e=Object.keys(mt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=mt.inspectOpts[e[r]]}Od.exports=SD()(mt);var{formatters:NA}=Od.exports;NA.o=function(t){return this.inspectOpts.colors=this.useColors,Fd.inspect(t,this.inspectOpts).split(`
49
+ `).map(e=>e.trim()).join(" ")};NA.O=function(t){return this.inspectOpts.colors=this.useColors,Fd.inspect(t,this.inspectOpts)}});var BA=D((Vhe,AD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?AD.exports=PA():AD.exports=LA()});var GA=D((Hhe,zA)=>{"use strict";var kD,MA,UA,VA,HA=!0;typeof process<"u"&&({FORCE_COLOR:kD,NODE_DISABLE_COLORS:MA,NO_COLOR:UA,TERM:VA}=process.env||{},HA=process.stdout&&process.stdout.isTTY);var _e={enabled:!MA&&UA==null&&VA!=="dumb"&&(kD!=null&&kD!=="0"||HA),reset:Oe(0,0),bold:Oe(1,22),dim:Oe(2,22),italic:Oe(3,23),underline:Oe(4,24),inverse:Oe(7,27),hidden:Oe(8,28),strikethrough:Oe(9,29),black:Oe(30,39),red:Oe(31,39),green:Oe(32,39),yellow:Oe(33,39),blue:Oe(34,39),magenta:Oe(35,39),cyan:Oe(36,39),white:Oe(37,39),gray:Oe(90,39),grey:Oe(90,39),bgBlack:Oe(40,49),bgRed:Oe(41,49),bgGreen:Oe(42,49),bgYellow:Oe(43,49),bgBlue:Oe(44,49),bgMagenta:Oe(45,49),bgCyan:Oe(46,49),bgWhite:Oe(47,49)};function qA(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,~e.indexOf(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function gX(t,e){let r={has:t,keys:e};return r.reset=_e.reset.bind(r),r.bold=_e.bold.bind(r),r.dim=_e.dim.bind(r),r.italic=_e.italic.bind(r),r.underline=_e.underline.bind(r),r.inverse=_e.inverse.bind(r),r.hidden=_e.hidden.bind(r),r.strikethrough=_e.strikethrough.bind(r),r.black=_e.black.bind(r),r.red=_e.red.bind(r),r.green=_e.green.bind(r),r.yellow=_e.yellow.bind(r),r.blue=_e.blue.bind(r),r.magenta=_e.magenta.bind(r),r.cyan=_e.cyan.bind(r),r.white=_e.white.bind(r),r.gray=_e.gray.bind(r),r.grey=_e.grey.bind(r),r.bgBlack=_e.bgBlack.bind(r),r.bgRed=_e.bgRed.bind(r),r.bgGreen=_e.bgGreen.bind(r),r.bgYellow=_e.bgYellow.bind(r),r.bgBlue=_e.bgBlue.bind(r),r.bgMagenta=_e.bgMagenta.bind(r),r.bgCyan=_e.bgCyan.bind(r),r.bgWhite=_e.bgWhite.bind(r),r}function Oe(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:_e.enabled?qA(this.keys,n+""):n+""):n===void 0?gX([t],[r]):_e.enabled?qA([r],n+""):n+""}}zA.exports=_e});var zs=D(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.ancillary=et.failure=et.success=et.input=et.weak=et.strong=void 0;var yX=(Cn(),ke(En)),Yr=yX.__importDefault(GA());et.strong=Yr.default.bold;et.weak=Yr.default.dim;et.input=Yr.default.cyan;et.success=Yr.default.green;et.failure=Yr.default.red;et.ancillary=Yr.default.cyan;var DX={strong:et.strong,weak:et.weak,input:et.input,success:et.success,failure:et.failure,ancillary:et.ancillary,log:{DEBUG:Yr.default.magenta,INFO:Yr.default.cyan,WARN:Yr.default.yellow,ERROR:Yr.default.red}};et.default=DX});var nc={};mn(nc,{__addDisposableResource:()=>hk,__assign:()=>Ad,__asyncDelegator:()=>ok,__asyncGenerator:()=>ik,__asyncValues:()=>sk,__await:()=>Gs,__awaiter:()=>ZA,__classPrivateFieldGet:()=>lk,__classPrivateFieldIn:()=>dk,__classPrivateFieldSet:()=>fk,__createBinding:()=>Td,__decorate:()=>YA,__disposeResources:()=>pk,__esDecorate:()=>vX,__exportStar:()=>ek,__extends:()=>WA,__generator:()=>QA,__importDefault:()=>ck,__importStar:()=>uk,__makeTemplateObject:()=>ak,__metadata:()=>XA,__param:()=>JA,__propKey:()=>wX,__read:()=>PD,__rest:()=>KA,__runInitializers:()=>bX,__setFunctionName:()=>_X,__spread:()=>tk,__spreadArray:()=>nk,__spreadArrays:()=>rk,__values:()=>kd,default:()=>SX});function WA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");TD(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function KA(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function YA(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function JA(t,e){return function(r,n){e(r,n,t)}}function vX(t,e,r,n,i,o){function s(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=n.kind,u=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,h=!1,d=r.length-1;d>=0;d--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(w){if(h)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(w||null))};var g=(0,r[d])(a==="accessor"?{get:l.get,set:l.set}:l[u],p);if(a==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(f=s(g.get))&&(l.get=f),(f=s(g.set))&&(l.set=f),(f=s(g.init))&&i.unshift(f)}else(f=s(g))&&(a==="field"?i.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),h=!0}function bX(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function wX(t){return typeof t=="symbol"?t:"".concat(t)}function _X(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function XA(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ZA(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function QA(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ek(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Td(e,t,r)}function kd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function PD(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function tk(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(PD(arguments[e]));return t}function rk(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function nk(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function Gs(t){return this instanceof Gs?(this.v=t,this):new Gs(t)}function ik(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(h){n[h]&&(i[h]=function(d){return new Promise(function(p,v){o.push([h,d,p,v])>1||a(h,d)})})}function a(h,d){try{u(n[h](d))}catch(p){f(o[0][3],p)}}function u(h){h.value instanceof Gs?Promise.resolve(h.value.v).then(c,l):f(o[0][2],h)}function c(h){a("next",h)}function l(h){a("throw",h)}function f(h,d){h(d),o.shift(),o.length&&a(o[0][0],o[0][1])}}function ok(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:Gs(t[i](s)),done:!1}:o?o(s):s}:o}}function sk(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof kd=="function"?kd(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,u){s=t[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(c){o({value:c,done:a})},s)}}function ak(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function uk(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Td(e,t,r);return EX(e,t),e}function ck(t){return t&&t.__esModule?t:{default:t}}function lk(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function fk(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function dk(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function hk(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function pk(t){function e(n){t.error=t.hasError?new CX(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(o){return e(o),r()})}catch(o){e(o)}}if(t.hasError)throw t.error}return r()}var TD,Ad,Td,EX,CX,SX,ic=ut(()=>{TD=function(t,e){return TD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},TD(t,e)};Ad=function(){return Ad=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},Ad.apply(this,arguments)};Td=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};EX=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};CX=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};SX={__extends:WA,__assign:Ad,__rest:KA,__decorate:YA,__param:JA,__metadata:XA,__awaiter:ZA,__generator:QA,__createBinding:Td,__exportStar:ek,__values:kd,__read:PD,__spread:tk,__spreadArrays:rk,__spreadArray:nk,__await:Gs,__asyncGenerator:ik,__asyncDelegator:ok,__asyncValues:sk,__makeTemplateObject:ak,__importStar:uk,__importDefault:ck,__classPrivateFieldGet:lk,__classPrivateFieldSet:fk,__classPrivateFieldIn:dk,__addDisposableResource:hk,__disposeResources:pk}});var RD=D(Pd=>{"use strict";Object.defineProperty(Pd,"__esModule",{value:!0});Pd.EscapeCode=void 0;var Tr="\x1B[",gt=class{};Pd.EscapeCode=gt;gt.cursorLeft=()=>`${Tr}G`;gt.cursorUp=(t=1)=>`${Tr}${t}A`;gt.cursorDown=(t=1)=>`${Tr}${t}B`;gt.cursorForward=(t=1)=>`${Tr}${t}C`;gt.cursorBackward=(t=1)=>`${Tr}${t}D`;gt.cursorHide=()=>`${Tr}?25l`;gt.cursorShow=()=>`${Tr}?25h`;gt.eraseLine=()=>`${Tr}2K`;gt.eraseLines=t=>{let e="";for(let r=0;r<t;r++)e+=gt.eraseLine(),r<t-1&&(e+=gt.cursorUp());return`${e}${gt.cursorLeft()}`};gt.eraseUp=()=>`${Tr}1J`;gt.eraseDown=()=>`${Tr}J`;gt.eraseScreen=()=>`${Tr}2J`});var gk=D(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});Rd.Cursor=void 0;var xX=(ic(),ke(nc)),FX=xX.__importDefault(Wy()),mk=RD(),Ws=class t{static show(){t.stream.isTTY&&(t._isVisible=!0,t.stream.write(mk.EscapeCode.cursorShow()))}static hide(){t.stream.isTTY&&(t._listenerAttached||((0,FX.default)(()=>{t.show()}),t._listenerAttached=!0),t._isVisible=!1,t.stream.write(mk.EscapeCode.cursorHide()))}static toggle(){t._isVisible?t.hide():t.show()}};Rd.Cursor=Ws;Ws.stream=process.stderr;Ws._isVisible=!0;Ws._listenerAttached=!1});var ID=D((Khe,$D)=>{"use strict";var yk=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);$D.exports=yk;$D.exports.default=yk});var bk=D((Yhe,vk)=>{"use strict";var Dk="[\uD800-\uDBFF][\uDC00-\uDFFF]",OX=t=>t&&t.exact?new RegExp(`^${Dk}$`):new RegExp(Dk,"g");vk.exports=OX});var _k=D((Jhe,wk)=>{"use strict";wk.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]}});var jD=D((Xhe,Ck)=>{var oc=_k(),Ek={};for(let t of Object.keys(oc))Ek[oc[t]]=t;var J={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"]}};Ck.exports=J;for(let t of Object.keys(J)){if(!("channels"in J[t]))throw new Error("missing channels property: "+t);if(!("labels"in J[t]))throw new Error("missing channel labels property: "+t);if(J[t].labels.length!==J[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=J[t];delete J[t].channels,delete J[t].labels,Object.defineProperty(J[t],"channels",{value:e}),Object.defineProperty(J[t],"labels",{value:r})}J.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(e,r,n),o=Math.max(e,r,n),s=o-i,a,u;o===i?a=0:e===o?a=(r-n)/s:r===o?a=2+(n-e)/s:n===o&&(a=4+(e-r)/s),a=Math.min(a*60,360),a<0&&(a+=360);let c=(i+o)/2;return o===i?u=0:c<=.5?u=s/(o+i):u=s/(2-o-i),[a,u*100,c*100]};J.rgb.hsv=function(t){let e,r,n,i,o,s=t[0]/255,a=t[1]/255,u=t[2]/255,c=Math.max(s,a,u),l=c-Math.min(s,a,u),f=function(h){return(c-h)/6/l+1/2};return l===0?(i=0,o=0):(o=l/c,e=f(s),r=f(a),n=f(u),s===c?i=n-r:a===c?i=1/3+e-n:u===c&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[i*360,o*100,c*100]};J.rgb.hwb=function(t){let e=t[0],r=t[1],n=t[2],i=J.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(r,n));return n=1-1/255*Math.max(e,Math.max(r,n)),[i,o*100,n*100]};J.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.min(1-e,1-r,1-n),o=(1-e-i)/(1-i)||0,s=(1-r-i)/(1-i)||0,a=(1-n-i)/(1-i)||0;return[o*100,s*100,a*100,i*100]};function AX(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}J.rgb.keyword=function(t){let e=Ek[t];if(e)return e;let r=1/0,n;for(let i of Object.keys(oc)){let o=oc[i],s=AX(t,o);s<r&&(r=s,n=i)}return n};J.keyword.rgb=function(t){return oc[t]};J.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let i=e*.4124+r*.3576+n*.1805,o=e*.2126+r*.7152+n*.0722,s=e*.0193+r*.1192+n*.9505;return[i*100,o*100,s*100]};J.rgb.lab=function(t){let e=J.rgb.xyz(t),r=e[0],n=e[1],i=e[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let o=116*n-16,s=500*(r-n),a=200*(n-i);return[o,s,a]};J.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?i=n*(1+r):i=n+r-n*r;let a=2*n-i,u=[0,0,0];for(let c=0;c<3;c++)o=e+1/3*-(c-1),o<0&&o++,o>1&&o--,6*o<1?s=a+(i-a)*6*o:2*o<1?s=i:3*o<2?s=a+(i-a)*(2/3-o)*6:s=a,u[c]=s*255;return u};J.hsl.hsv=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=o<=1?o:2-o;let s=(n+r)/2,a=n===0?2*i/(o+i):2*r/(n+r);return[e,a*100,s*100]};J.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-r),a=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,s];case 1:return[a,n,s];case 2:return[s,n,u];case 3:return[s,a,n];case 4:return[u,s,n];case 5:return[n,s,a]}};J.hsv.hsl=function(t){let e=t[0],r=t[1]/100,n=t[2]/100,i=Math.max(n,.01),o,s;s=(2-r)*n;let a=(2-r)*i;return o=r*i,o/=a<=1?a:2-a,o=o||0,s/=2,[e,o*100,s*100]};J.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100,i=r+n,o;i>1&&(r/=i,n/=i);let s=Math.floor(6*e),a=1-n;o=6*e-s,s&1&&(o=1-o);let u=r+o*(a-r),c,l,f;switch(s){default:case 6:case 0:c=a,l=u,f=r;break;case 1:c=u,l=a,f=r;break;case 2:c=r,l=a,f=u;break;case 3:c=r,l=u,f=a;break;case 4:c=u,l=r,f=a;break;case 5:c=a,l=r,f=u;break}return[c*255,l*255,f*255]};J.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100,o=1-Math.min(1,e*(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]};J.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,n=t[2]/100,i,o,s;return i=e*3.2406+r*-1.5372+n*-.4986,o=e*-.9689+r*1.8758+n*.0415,s=e*.0557+r*-.204+n*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*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),[i*255,o*255,s*255]};J.xyz.lab=function(t){let e=t[0],r=t[1],n=t[2];e/=95.047,r/=100,n/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let i=116*r-16,o=500*(e-r),s=200*(r-n);return[i,o,s]};J.lab.xyz=function(t){let e=t[0],r=t[1],n=t[2],i,o,s;o=(e+16)/116,i=r/500+o,s=o-n/200;let a=o**3,u=i**3,c=s**3;return o=a>.008856?a:(o-16/116)/7.787,i=u>.008856?u:(i-16/116)/7.787,s=c>.008856?c:(s-16/116)/7.787,i*=95.047,o*=100,s*=108.883,[i,o,s]};J.lab.lch=function(t){let e=t[0],r=t[1],n=t[2],i;i=Math.atan2(n,r)*360/2/Math.PI,i<0&&(i+=360);let s=Math.sqrt(r*r+n*n);return[e,s,i]};J.lch.lab=function(t){let e=t[0],r=t[1],i=t[2]/360*2*Math.PI,o=r*Math.cos(i),s=r*Math.sin(i);return[e,o,s]};J.rgb.ansi16=function(t,e=null){let[r,n,i]=t,o=e===null?J.rgb.hsv(t)[2]:e;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};J.hsv.ansi16=function(t){return J.rgb.ansi16(J.hsv.rgb(t),t[2])};J.rgb.ansi256=function(t){let e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};J.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,n=(e&1)*r*255,i=(e>>1&1)*r*255,o=(e>>2&1)*r*255;return[n,i,o]};J.ansi256.rgb=function(t){if(t>=232){let o=(t-232)*10+8;return[o,o,o]}t-=16;let e,r=Math.floor(t/36)/5*255,n=Math.floor((e=t%36)/6)/5*255,i=e%6/5*255;return[r,n,i]};J.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};J.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(a=>a+a).join(""));let n=parseInt(r,16),i=n>>16&255,o=n>>8&255,s=n&255;return[i,o,s]};J.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,n=t[2]/255,i=Math.max(Math.max(e,r),n),o=Math.min(Math.min(e,r),n),s=i-o,a,u;return s<1?a=o/(1-s):a=0,s<=0?u=0:i===e?u=(r-n)/s%6:i===r?u=2+(n-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,a*100]};J.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=r<.5?2*e*r:2*e*(1-r),i=0;return n<1&&(i=(r-.5*n)/(1-n)),[t[0],n*100,i*100]};J.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],n*100,i*100]};J.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,n=t[2]/100;if(r===0)return[n*255,n*255,n*255];let i=[0,0,0],o=e%1*6,s=o%1,a=1-s,u=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}return u=(1-r)*n,[(r*i[0]+u)*255,(r*i[1]+u)*255,(r*i[2]+u)*255]};J.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e),i=0;return n>0&&(i=e/n),[t[0],i*100,n*100]};J.hcg.hsl=function(t){let e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],i*100,n*100]};J.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,n=e+r*(1-e);return[t[0],(n-e)*100,(1-n)*100]};J.hwb.hcg=function(t){let e=t[1]/100,n=1-t[2]/100,i=n-e,o=0;return i<1&&(o=(n-i)/(1-i)),[t[0],i*100,o*100]};J.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};J.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};J.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};J.gray.hsl=function(t){return[0,0,t[0]]};J.gray.hsv=J.gray.hsl;J.gray.hwb=function(t){return[0,100,t[0]]};J.gray.cmyk=function(t){return[0,0,0,t[0]]};J.gray.lab=function(t){return[t[0],0,0]};J.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n};J.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var xk=D((Zhe,Sk)=>{var $d=jD();function kX(){let t={},e=Object.keys($d);for(let r=e.length,n=0;n<r;n++)t[e[n]]={distance:-1,parent:null};return t}function TX(t){let e=kX(),r=[t];for(e[t].distance=0;r.length;){let n=r.pop(),i=Object.keys($d[n]);for(let o=i.length,s=0;s<o;s++){let a=i[s],u=e[a];u.distance===-1&&(u.distance=e[n].distance+1,u.parent=n,r.unshift(a))}}return e}function PX(t,e){return function(r){return e(t(r))}}function RX(t,e){let r=[e[t].parent,t],n=$d[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)r.unshift(e[i].parent),n=PX($d[e[i].parent][i],n),i=e[i].parent;return n.conversion=r,n}Sk.exports=function(t){let e=TX(t),r={},n=Object.keys(e);for(let i=n.length,o=0;o<i;o++){let s=n[o];e[s].parent!==null&&(r[s]=RX(s,e))}return r}});var Ok=D((Qhe,Fk)=>{var ND=jD(),$X=xk(),Ks={},IX=Object.keys(ND);function jX(t){let e=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function NX(t){let e=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let i=t(r);if(typeof i=="object")for(let o=i.length,s=0;s<o;s++)i[s]=Math.round(i[s]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}IX.forEach(t=>{Ks[t]={},Object.defineProperty(Ks[t],"channels",{value:ND[t].channels}),Object.defineProperty(Ks[t],"labels",{value:ND[t].labels});let e=$X(t);Object.keys(e).forEach(n=>{let i=e[n];Ks[t][n]=NX(i),Ks[t][n].raw=jX(i)})});Fk.exports=Ks});var BD=D((epe,Rk)=>{"use strict";var Ak=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,kk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};5;${n}m`},Tk=(t,e)=>(...r)=>{let n=t(...r);return`\x1B[${38+e};2;${n[0]};${n[1]};${n[2]}m`},Id=t=>t,Pk=(t,e,r)=>[t,e,r],Ys=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let n=r();return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},LD,Js=(t,e,r,n)=>{LD===void 0&&(LD=Ok());let i=n?10:0,o={};for(let[s,a]of Object.entries(LD)){let u=s==="ansi16"?"ansi":s;s===e?o[u]=t(r,i):typeof a=="object"&&(o[u]=t(a[e],i))}return o};function LX(){let t=new Map,e={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],blackBright:[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]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[i,o]of Object.entries(n))e[i]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},n[i]=e[i],t.set(o[0],o[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Ys(e.color,"ansi",()=>Js(Ak,"ansi16",Id,!1)),Ys(e.color,"ansi256",()=>Js(kk,"ansi256",Id,!1)),Ys(e.color,"ansi16m",()=>Js(Tk,"rgb",Pk,!1)),Ys(e.bgColor,"ansi",()=>Js(Ak,"ansi16",Id,!0)),Ys(e.bgColor,"ansi256",()=>Js(kk,"ansi256",Id,!0)),Ys(e.bgColor,"ansi16m",()=>Js(Tk,"rgb",Pk,!0)),e}Object.defineProperty(Rk,"exports",{enumerable:!0,get:LX})});var Lk=D((tpe,Nk)=>{"use strict";var BX=ID(),qX=bk(),$k=BD(),jk=["\x1B","\x9B"],jd=t=>`${jk[0]}[${t}m`,Ik=(t,e,r)=>{let n=[];t=[...t];for(let i of t){let o=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");let s=$k.codes.get(Number.parseInt(i,10));if(s){let a=t.indexOf(s.toString());a===-1?n.push(jd(e?s:o)):t.splice(a,1)}else if(e){n.push(jd(0));break}else n.push(jd(o))}if(e&&(n=n.filter((i,o)=>n.indexOf(i)===o),r!==void 0)){let i=jd($k.codes.get(Number.parseInt(r,10)));n=n.reduce((o,s)=>s===i?[s,...o]:[...o,s],[])}return n.join("")};Nk.exports=(t,e,r)=>{let n=[...t],i=[],o=typeof r=="number"?r:n.length,s=!1,a,u=0,c="";for(let[l,f]of n.entries()){let h=!1;if(jk.includes(f)){let d=/\d[^m]*/.exec(t.slice(l,l+18));a=d&&d.length>0?d[0]:void 0,u<o&&(s=!0,a!==void 0&&i.push(a))}else s&&f==="m"&&(s=!1,h=!0);if(!s&&!h&&u++,!qX({exact:!0}).test(f)&&BX(f.codePointAt())&&(u++,typeof r!="number"&&o++),u>e&&u<=o)c+=f;else if(u===e&&!s&&a!==void 0)c=Ik(i);else if(u>=o){c+=Ik(i,!0,a);break}}return c}});var qk=D((rpe,Bk)=>{"use strict";Bk.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var Nd=D((npe,Mk)=>{"use strict";var MX=qk();Mk.exports=t=>typeof t=="string"?t.replace(MX(),""):t});var Vk=D((ipe,Uk)=>{"use strict";Uk.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var MD=D((ope,qD)=>{"use strict";var UX=Nd(),VX=ID(),HX=Vk(),Hk=t=>{if(typeof t!="string"||t.length===0||(t=UX(t),t.length===0))return 0;t=t.replace(HX()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=VX(n)?2:1)}return e};qD.exports=Hk;qD.exports.default=Hk});var Jk=D((spe,Yk)=>{"use strict";var sc=MD(),zX=Nd(),GX=BD(),Ld=new Set(["\x1B","\x9B"]),WX=39,VD="\x07",Wk="[",KX="]",Kk="m",HD=`${KX}8;;`,zk=t=>`${Ld.values().next().value}${Wk}${t}${Kk}`,Gk=t=>`${Ld.values().next().value}${HD}${t}${VD}`,YX=t=>t.split(" ").map(e=>sc(e)),UD=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=sc(zX(t[t.length-1]));for(let[a,u]of n.entries()){let c=sc(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),Ld.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(HD)),i){o?u===VD&&(i=!1,o=!1):u===Kk&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},JX=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(sc(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},XX=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=YX(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=sc(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),UD(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){UD(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){UD(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(JX));let u=[...a.join(`
50
+ `)];for(let[c,l]of u.entries()){if(n+=l,Ld.has(l)){let{groups:h}=new RegExp(`(?:\\${Wk}(?<code>\\d+)m|\\${HD}(?<uri>.*)${VD})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===WX?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=GX.codes.get(Number(i));u[c+1]===`
51
51
  `?(o&&(n+=Gk("")),i&&f&&(n+=zk(f))):l===`
52
52
  `&&(i&&f&&(n+=zk(i)),o&&(n+=Gk(o)))}return n};Yk.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
53
53
  `).split(`
54
- `).map(n=>JX(n,e,r)).join(`
55
- `)});var Qk=D((spe,Zk)=>{"use strict";var XX=require("os"),Xk=XX.homedir();Zk.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return Xk?t.replace(/^~(?=$|\/|\\)/,Xk):t}});var o3=D(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.columnar=He.generateFillSpaceStringList=He.expandPath=He.prettyPath=He.wordWrap=He.indent=He.TTY_WIDTH=He.stripAnsi=He.stringWidth=He.sliceAnsi=void 0;var e3=(ic(),ke(nc)),ZX=e3.__importStar(require("os")),Fn=e3.__importStar(require("path")),t3=Lk();He.sliceAnsi=t3;var Bd=MD();He.stringWidth=Bd;var QX=Nd();He.stripAnsi=QX;var eZ=Jk(),tZ=Qk(),rZ=80,nZ=120;He.TTY_WIDTH=process.stdout.columns?Math.max(rZ,Math.min(process.stdout.columns,nZ)):1/0;function r3(t=4){return" ".repeat(t)}He.indent=r3;function iZ(t,{width:e=He.TTY_WIDTH,indentation:r=0,append:n=""}){return eZ(t,e-r-n.length,{trim:!0}).split(`
54
+ `).map(n=>XX(n,e,r)).join(`
55
+ `)});var Qk=D((ape,Zk)=>{"use strict";var ZX=require("os"),Xk=ZX.homedir();Zk.exports=t=>{if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return Xk?t.replace(/^~(?=$|\/|\\)/,Xk):t}});var o3=D(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.columnar=He.generateFillSpaceStringList=He.expandPath=He.prettyPath=He.wordWrap=He.indent=He.TTY_WIDTH=He.stripAnsi=He.stringWidth=He.sliceAnsi=void 0;var e3=(ic(),ke(nc)),QX=e3.__importStar(require("os")),Fn=e3.__importStar(require("path")),t3=Lk();He.sliceAnsi=t3;var Bd=MD();He.stringWidth=Bd;var eZ=Nd();He.stripAnsi=eZ;var tZ=Jk(),rZ=Qk(),nZ=80,iZ=120;He.TTY_WIDTH=process.stdout.columns?Math.max(nZ,Math.min(process.stdout.columns,iZ)):1/0;function r3(t=4){return" ".repeat(t)}He.indent=r3;function oZ(t,{width:e=He.TTY_WIDTH,indentation:r=0,append:n=""}){return tZ(t,e-r-n.length,{trim:!0}).split(`
56
56
  `).join(`${n}
57
- ${r3(r)}`)}He.wordWrap=iZ;function oZ(t){t=n3(t);let e=process.cwd(),r=Fn.dirname(t),n=ZX.homedir(),i=Math.abs(r.split(Fn.sep).length-e.split(Fn.sep).length);if(e===r)return"."+Fn.sep+Fn.basename(t);if(r.startsWith(e))return"."+Fn.sep+t.substring(e.length+1);if(i<=2){let o=Fn.relative(e,t);return o||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+Fn.sep+t.substring(n.length+1)}return t}He.prettyPath=oZ;function n3(t){return Fn.resolve(tZ(t))}He.expandPath=n3;function i3(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(s=>Bd(s))),i=n>e?n+1:e,o=r.repeat(i);return t.map(s=>t3(o,0,i-Bd(s)))}He.generateFillSpaceStringList=i3;function sZ(t,{hsep:e="-",vsep:r="|",headers:n}){let i=!!n;if(!t[0])return"";let o=n?n.length:t[0].length,s=n?n.map(l=>[l]):t[0].map(()=>[]);for(let l of t){let f=0,h=l.map(d=>{let p=d.split(`
57
+ ${r3(r)}`)}He.wordWrap=oZ;function sZ(t){t=n3(t);let e=process.cwd(),r=Fn.dirname(t),n=QX.homedir(),i=Math.abs(r.split(Fn.sep).length-e.split(Fn.sep).length);if(e===r)return"."+Fn.sep+Fn.basename(t);if(r.startsWith(e))return"."+Fn.sep+t.substring(e.length+1);if(i<=2){let o=Fn.relative(e,t);return o||"."}else{if(t===n)return"~";if(t.indexOf(n)===0)return"~"+Fn.sep+t.substring(n.length+1)}return t}He.prettyPath=sZ;function n3(t){return Fn.resolve(rZ(t))}He.expandPath=n3;function i3(t,e=1,r=" "){e<2&&(e=2);let n=Math.max(...t.map(s=>Bd(s))),i=n>e?n+1:e,o=r.repeat(i);return t.map(s=>t3(o,0,i-Bd(s)))}He.generateFillSpaceStringList=i3;function aZ(t,{hsep:e="-",vsep:r="|",headers:n}){let i=!!n;if(!t[0])return"";let o=n?n.length:t[0].length,s=n?n.map(l=>[l]):t[0].map(()=>[]);for(let l of t){let f=0,h=l.map(d=>{let p=d.split(`
58
58
  `);return f=Math.max(f,p.length),p});for(let d in l)s[d]&&s[d].push(...h[d],...Array(f-h[d].length).fill(""))}let a=s.map((l,f)=>{if(f<o-1){let h=i3(l);return l.map((d,p)=>`${d}${h[p]}${r===""?"":`${r} `}`)}else return l}),u=0,c=a.reduce((l,f)=>l.map((h,d)=>{let p=l[d]+f[d];return u=Math.max(u,Bd(p)),p}));return i&&e!==""&&c.splice(1,0,e.repeat(u)),c.join(`
59
- `)}He.columnar=sZ});var zD=D((upe,s3)=>{function aZ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=CD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function v(...g){if(!v.enabled)return;let w=v,x=Number(new Date),y=x-(f||x);w.diff=y,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return v.namespace=l,v.useColors=r.useColors(),v.color=r.selectColor(l),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(v),v}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}s3.exports=aZ});var a3=D((sr,qd)=>{sr.formatArgs=cZ;sr.save=lZ;sr.load=fZ;sr.useColors=uZ;sr.storage=dZ();sr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();sr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function uZ(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function cZ(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+qd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}sr.log=console.debug||console.log||(()=>{});function lZ(t){try{t?sr.storage.setItem("debug",t):sr.storage.removeItem("debug")}catch{}}function fZ(){let t;try{t=sr.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function dZ(){try{return localStorage}catch{}}qd.exports=zD()(sr);var{formatters:hZ}=qd.exports;hZ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var c3=D((yt,Ud)=>{var pZ=require("tty"),Md=require("util");yt.init=wZ;yt.log=DZ;yt.formatArgs=gZ;yt.save=vZ;yt.load=bZ;yt.useColors=mZ;yt.destroy=Md.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");yt.colors=[6,2,3,4,5,1];try{let t=OD();t&&(t.stderr||t).level>=2&&(yt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}yt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function mZ(){return"colors"in yt.inspectOpts?!!yt.inspectOpts.colors:pZ.isatty(process.stderr.fd)}function gZ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
59
+ `)}He.columnar=aZ});var zD=D((cpe,s3)=>{function uZ(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=s,r.humanize=CD(),r.destroy=c,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h<l.length;h++)f=(f<<5)-f+l.charCodeAt(h),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,h=null,d,p;function v(...g){if(!v.enabled)return;let w=v,x=Number(new Date),y=x-(f||x);w.diff=y,w.prev=f,w.curr=x,f=x,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let C=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,($,F)=>{if($==="%%")return"%";C++;let L=r.formatters[F];if(typeof L=="function"){let S=g[C];$=L.call(w,S),g.splice(C,1),C--}return $}),r.formatArgs.call(w,g),(w.log||r.log).apply(w,g)}return v.namespace=l,v.useColors=r.useColors(),v.color=r.selectColor(l),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==r.namespaces&&(d=r.namespaces,p=r.enabled(l)),p),set:g=>{h=g}}),typeof r.init=="function"&&r.init(v),v}function n(l,f){let h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f,h=(typeof l=="string"?l:"").split(/[\s,]+/),d=h.length;for(f=0;f<d;f++)h[f]&&(l=h[f].replace(/\*/g,".*?"),l[0]==="-"?r.skips.push(new RegExp("^"+l.slice(1)+"$")):r.names.push(new RegExp("^"+l+"$")))}function o(){let l=[...r.names.map(a),...r.skips.map(a).map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f<h;f++)if(r.skips[f].test(l))return!1;for(f=0,h=r.names.length;f<h;f++)if(r.names[f].test(l))return!0;return!1}function a(l){return l.toString().substring(2,l.toString().length-2).replace(/\.\*\?$/,"*")}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}s3.exports=uZ});var a3=D((sr,qd)=>{sr.formatArgs=lZ;sr.save=fZ;sr.load=dZ;sr.useColors=cZ;sr.storage=hZ();sr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();sr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function cZ(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function lZ(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+qd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}sr.log=console.debug||console.log||(()=>{});function fZ(t){try{t?sr.storage.setItem("debug",t):sr.storage.removeItem("debug")}catch{}}function dZ(){let t;try{t=sr.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function hZ(){try{return localStorage}catch{}}qd.exports=zD()(sr);var{formatters:pZ}=qd.exports;pZ.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var c3=D((yt,Ud)=>{var mZ=require("tty"),Md=require("util");yt.init=_Z;yt.log=vZ;yt.formatArgs=yZ;yt.save=bZ;yt.load=wZ;yt.useColors=gZ;yt.destroy=Md.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");yt.colors=[6,2,3,4,5,1];try{let t=OD();t&&(t.stderr||t).level>=2&&(yt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}yt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,o)=>o.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function gZ(){return"colors"in yt.inspectOpts?!!yt.inspectOpts.colors:mZ.isatty(process.stderr.fd)}function yZ(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${i};1m${e} \x1B[0m`;t[0]=o+t[0].split(`
60
60
  `).join(`
61
- `+o),t.push(i+"m+"+Ud.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=yZ()+e+" "+t[0]}function yZ(){return yt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function DZ(...t){return process.stderr.write(Md.formatWithOptions(yt.inspectOpts,...t)+`
62
- `)}function vZ(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function bZ(){return process.env.DEBUG}function wZ(t){t.inspectOpts={};let e=Object.keys(yt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=yt.inspectOpts[e[r]]}Ud.exports=zD()(yt);var{formatters:u3}=Ud.exports;u3.o=function(t){return this.inspectOpts.colors=this.useColors,Md.inspect(t,this.inspectOpts).split(`
63
- `).map(e=>e.trim()).join(" ")};u3.O=function(t){return this.inspectOpts.colors=this.useColors,Md.inspect(t,this.inspectOpts)}});var l3=D((cpe,GD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?GD.exports=a3():GD.exports=c3()});var f3=D(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.TERMINAL_INFO=wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES=void 0;var _Z=(ic(),ke(nc)),EZ=l3(),CZ=_Z.__importStar(require("os")),SZ=(0,EZ.debug)("ionic:utils-terminal:info");wr.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function xZ(){let{shell:t}=CZ.userInfo();return t||(process.env.SHELL?process.env.SHELL:process.platform==="darwin"?"/bin/bash":process.platform==="win32"?process.env.COMSPEC?process.env.COMSPEC:"cmd.exe":"/bin/sh")}wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&SZ(`Environment variables for CI detected: ${wr.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);wr.TERMINAL_INFO=Object.freeze({ci:wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:xZ(),tty:!!(process.stdin.isTTY&&process.stdout.isTTY&&process.stderr.isTTY),windows:process.platform==="win32"||!!(process.env.OSTYPE&&/^(msys|cygwin)$/.test(process.env.OSTYPE)||process.env.MSYSTEM&&/^MINGW(32|64)$/.test(process.env.MSYSTEM))})});var WD=D(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});var Vd=(ic(),ke(nc));Vd.__exportStar(RD(),Xs);Vd.__exportStar(gk(),Xs);Vd.__exportStar(o3(),Xs);Vd.__exportStar(f3(),Xs)});var zd=D(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isFatal=Jr.fatal=Jr.FatalException=Jr.BaseException=void 0;var Hd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Jr.BaseException=Hd;var ac=class extends Hd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Jr.FatalException=ac;function FZ(t){throw new ac(t)}Jr.fatal=FZ;function OZ(t){return t&&t instanceof ac}Jr.isFatal=OZ});var JD={};mn(JD,{LOGGER_LEVELS:()=>jZ,Logger:()=>YD,NO_COLORS:()=>d3,StreamOutputStrategy:()=>Gd,TTYOutputStrategy:()=>KD,TTY_WIDTH:()=>AZ,createDefaultLogger:()=>IZ,indent:()=>kZ,sliceAnsi:()=>TZ,stringWidth:()=>PZ,stripAnsi:()=>RZ,wordWrap:()=>$Z});var AZ,kZ,TZ,PZ,RZ,$Z,IZ,d3,Gd,KD,YD,jZ,XD=ut(()=>{AZ=80,kZ=t=>t,TZ=t=>t,PZ=t=>t.length,RZ=t=>t,$Z=t=>t,IZ=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),d3={},Gd=class{constructor(){this.colors=d3,this.stream=process.stdout}},KD=class extends Gd{constructor(e){super(),this.options=e}},YD=class{constructor(){}info(){}warn(){}error(){}debug(){}},jZ={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var p3=D(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.isInteractive=lo.checkInteractive=void 0;var NZ=(Cn(),ke(En)),h3=WD(),LZ=NZ.__importDefault(zs()),BZ=uc(),qZ=(...t)=>(0,lo.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(BZ.logger.error(`Non-interactive shell detected.
64
- Run the command with ${LZ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;lo.checkInteractive=qZ;var MZ=()=>h3.TERMINAL_INFO.tty&&!h3.TERMINAL_INFO.ci;lo.isInteractive=MZ});var ze=D((ppe,g3)=>{"use strict";var{FORCE_COLOR:UZ,NODE_DISABLE_COLORS:VZ,TERM:HZ}=process.env,Ee={enabled:!VZ&&HZ!=="dumb"&&UZ!=="0",reset:Ae(0,0),bold:Ae(1,22),dim:Ae(2,22),italic:Ae(3,23),underline:Ae(4,24),inverse:Ae(7,27),hidden:Ae(8,28),strikethrough:Ae(9,29),black:Ae(30,39),red:Ae(31,39),green:Ae(32,39),yellow:Ae(33,39),blue:Ae(34,39),magenta:Ae(35,39),cyan:Ae(36,39),white:Ae(37,39),gray:Ae(90,39),grey:Ae(90,39),bgBlack:Ae(40,49),bgRed:Ae(41,49),bgGreen:Ae(42,49),bgYellow:Ae(43,49),bgBlue:Ae(44,49),bgMagenta:Ae(45,49),bgCyan:Ae(46,49),bgWhite:Ae(47,49)};function m3(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,e.includes(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function zZ(t,e){let r={has:t,keys:e};return r.reset=Ee.reset.bind(r),r.bold=Ee.bold.bind(r),r.dim=Ee.dim.bind(r),r.italic=Ee.italic.bind(r),r.underline=Ee.underline.bind(r),r.inverse=Ee.inverse.bind(r),r.hidden=Ee.hidden.bind(r),r.strikethrough=Ee.strikethrough.bind(r),r.black=Ee.black.bind(r),r.red=Ee.red.bind(r),r.green=Ee.green.bind(r),r.yellow=Ee.yellow.bind(r),r.blue=Ee.blue.bind(r),r.magenta=Ee.magenta.bind(r),r.cyan=Ee.cyan.bind(r),r.white=Ee.white.bind(r),r.gray=Ee.gray.bind(r),r.grey=Ee.grey.bind(r),r.bgBlack=Ee.bgBlack.bind(r),r.bgRed=Ee.bgRed.bind(r),r.bgGreen=Ee.bgGreen.bind(r),r.bgYellow=Ee.bgYellow.bind(r),r.bgBlue=Ee.bgBlue.bind(r),r.bgMagenta=Ee.bgMagenta.bind(r),r.bgCyan=Ee.bgCyan.bind(r),r.bgWhite=Ee.bgWhite.bind(r),r}function Ae(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:Ee.enabled?m3(this.keys,n+""):n+""):n===void 0?zZ([t],[r]):Ee.enabled?m3([r],n+""):n+""}}g3.exports=Ee});var D3=D((mpe,y3)=>{"use strict";y3.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var Wd=D((gpe,v3)=>{"use strict";v3.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var C3=D((ype,E3)=>{"use strict";function GZ(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=WZ(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
65
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function WZ(t,e){if(t){if(typeof t=="string")return b3(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b3(t,e)}}function b3(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var KZ=Wd(),_3=Te(),w3=_3.erase,YZ=_3.cursor,JZ=t=>[...KZ(t)].length;E3.exports=function(t,e){if(!e)return w3.line+YZ.to(0);let r=0,n=t.split(/\r?\n/);var i=GZ(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(JZ(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return w3.lines(r)}});var ZD=D((Dpe,S3)=>{"use strict";var cc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},XZ={arrowUp:cc.arrowUp,arrowDown:cc.arrowDown,arrowLeft:cc.arrowLeft,arrowRight:cc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},ZZ=process.platform==="win32"?XZ:cc;S3.exports=ZZ});var F3=D((vpe,x3)=>{"use strict";var Zs=ze(),fo=ZD(),QD=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),QZ=t=>QD[t]||QD.default,lc=Object.freeze({aborted:Zs.red(fo.cross),done:Zs.green(fo.tick),exited:Zs.yellow(fo.cross),default:Zs.cyan("?")}),eQ=(t,e,r)=>e?lc.aborted:r?lc.exited:t?lc.done:lc.default,tQ=t=>Zs.gray(t?fo.ellipsis:fo.pointerSmall),rQ=(t,e)=>Zs.gray(t?e?fo.pointerSmall:"+":fo.line);x3.exports={styles:QD,render:QZ,symbols:lc,symbol:eQ,delimiter:tQ,item:rQ}});var A3=D((bpe,O3)=>{"use strict";var nQ=Wd();O3.exports=function(t,e){let r=String(nQ(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var T3=D((wpe,k3)=>{"use strict";k3.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
61
+ `+o),t.push(i+"m+"+Ud.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=DZ()+e+" "+t[0]}function DZ(){return yt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function vZ(...t){return process.stderr.write(Md.formatWithOptions(yt.inspectOpts,...t)+`
62
+ `)}function bZ(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function wZ(){return process.env.DEBUG}function _Z(t){t.inspectOpts={};let e=Object.keys(yt.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=yt.inspectOpts[e[r]]}Ud.exports=zD()(yt);var{formatters:u3}=Ud.exports;u3.o=function(t){return this.inspectOpts.colors=this.useColors,Md.inspect(t,this.inspectOpts).split(`
63
+ `).map(e=>e.trim()).join(" ")};u3.O=function(t){return this.inspectOpts.colors=this.useColors,Md.inspect(t,this.inspectOpts)}});var l3=D((lpe,GD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?GD.exports=a3():GD.exports=c3()});var f3=D(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.TERMINAL_INFO=wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES=void 0;var EZ=(ic(),ke(nc)),CZ=l3(),SZ=EZ.__importStar(require("os")),xZ=(0,CZ.debug)("ionic:utils-terminal:info");wr.CI_ENVIRONMENT_VARIABLES=["CI","BUILD_ID","BUILD_NUMBER","BITBUCKET_COMMIT","CODEBUILD_BUILD_ARN","GITHUB_ACTIONS"];wr.CI_ENVIRONMENT_VARIABLES_DETECTED=wr.CI_ENVIRONMENT_VARIABLES.filter(t=>!!process.env[t]);function FZ(){let{shell:t}=SZ.userInfo();return t||(process.env.SHELL?process.env.SHELL:process.platform==="darwin"?"/bin/bash":process.platform==="win32"?process.env.COMSPEC?process.env.COMSPEC:"cmd.exe":"/bin/sh")}wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0&&xZ(`Environment variables for CI detected: ${wr.CI_ENVIRONMENT_VARIABLES_DETECTED.join(", ")}`);wr.TERMINAL_INFO=Object.freeze({ci:wr.CI_ENVIRONMENT_VARIABLES_DETECTED.length>0,shell:FZ(),tty:!!(process.stdin.isTTY&&process.stdout.isTTY&&process.stderr.isTTY),windows:process.platform==="win32"||!!(process.env.OSTYPE&&/^(msys|cygwin)$/.test(process.env.OSTYPE)||process.env.MSYSTEM&&/^MINGW(32|64)$/.test(process.env.MSYSTEM))})});var WD=D(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});var Vd=(ic(),ke(nc));Vd.__exportStar(RD(),Xs);Vd.__exportStar(gk(),Xs);Vd.__exportStar(o3(),Xs);Vd.__exportStar(f3(),Xs)});var zd=D(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.isFatal=Jr.fatal=Jr.FatalException=Jr.BaseException=void 0;var Hd=class extends Error{constructor(e,r){super(e),this.message=e,this.code=r}};Jr.BaseException=Hd;var ac=class extends Hd{constructor(e,r=1){super(e,"FATAL"),this.message=e,this.exitCode=r}};Jr.FatalException=ac;function OZ(t){throw new ac(t)}Jr.fatal=OZ;function AZ(t){return t&&t instanceof ac}Jr.isFatal=AZ});var JD={};mn(JD,{LOGGER_LEVELS:()=>NZ,Logger:()=>YD,NO_COLORS:()=>d3,StreamOutputStrategy:()=>Gd,TTYOutputStrategy:()=>KD,TTY_WIDTH:()=>kZ,createDefaultLogger:()=>jZ,indent:()=>TZ,sliceAnsi:()=>PZ,stringWidth:()=>RZ,stripAnsi:()=>$Z,wordWrap:()=>IZ});var kZ,TZ,PZ,RZ,$Z,IZ,jZ,d3,Gd,KD,YD,NZ,XD=ut(()=>{kZ=80,TZ=t=>t,PZ=t=>t,RZ=t=>t.length,$Z=t=>t,IZ=t=>t,jZ=()=>({info:console.log,warn:console.warn,error:console.error,debug:console.debug}),d3={},Gd=class{constructor(){this.colors=d3,this.stream=process.stdout}},KD=class extends Gd{constructor(e){super(),this.options=e}},YD=class{constructor(){}info(){}warn(){}error(){}debug(){}},NZ={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR"}});var p3=D(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.isInteractive=lo.checkInteractive=void 0;var LZ=(Cn(),ke(En)),h3=WD(),BZ=LZ.__importDefault(zs()),qZ=uc(),MZ=(...t)=>(0,lo.isInteractive)()?!0:t.length?t.filter(e=>!e).length?(qZ.logger.error(`Non-interactive shell detected.
64
+ Run the command with ${BZ.default.input("--help")} to see a list of arguments that must be provided.`),!1):!0:!1;lo.checkInteractive=MZ;var UZ=()=>h3.TERMINAL_INFO.tty&&!h3.TERMINAL_INFO.ci;lo.isInteractive=UZ});var ze=D((mpe,g3)=>{"use strict";var{FORCE_COLOR:VZ,NODE_DISABLE_COLORS:HZ,TERM:zZ}=process.env,Ee={enabled:!HZ&&zZ!=="dumb"&&VZ!=="0",reset:Ae(0,0),bold:Ae(1,22),dim:Ae(2,22),italic:Ae(3,23),underline:Ae(4,24),inverse:Ae(7,27),hidden:Ae(8,28),strikethrough:Ae(9,29),black:Ae(30,39),red:Ae(31,39),green:Ae(32,39),yellow:Ae(33,39),blue:Ae(34,39),magenta:Ae(35,39),cyan:Ae(36,39),white:Ae(37,39),gray:Ae(90,39),grey:Ae(90,39),bgBlack:Ae(40,49),bgRed:Ae(41,49),bgGreen:Ae(42,49),bgYellow:Ae(43,49),bgBlue:Ae(44,49),bgMagenta:Ae(45,49),bgCyan:Ae(46,49),bgWhite:Ae(47,49)};function m3(t,e){let r=0,n,i="",o="";for(;r<t.length;r++)n=t[r],i+=n.open,o+=n.close,e.includes(n.close)&&(e=e.replace(n.rgx,n.close+n.open));return i+e+o}function GZ(t,e){let r={has:t,keys:e};return r.reset=Ee.reset.bind(r),r.bold=Ee.bold.bind(r),r.dim=Ee.dim.bind(r),r.italic=Ee.italic.bind(r),r.underline=Ee.underline.bind(r),r.inverse=Ee.inverse.bind(r),r.hidden=Ee.hidden.bind(r),r.strikethrough=Ee.strikethrough.bind(r),r.black=Ee.black.bind(r),r.red=Ee.red.bind(r),r.green=Ee.green.bind(r),r.yellow=Ee.yellow.bind(r),r.blue=Ee.blue.bind(r),r.magenta=Ee.magenta.bind(r),r.cyan=Ee.cyan.bind(r),r.white=Ee.white.bind(r),r.gray=Ee.gray.bind(r),r.grey=Ee.grey.bind(r),r.bgBlack=Ee.bgBlack.bind(r),r.bgRed=Ee.bgRed.bind(r),r.bgGreen=Ee.bgGreen.bind(r),r.bgYellow=Ee.bgYellow.bind(r),r.bgBlue=Ee.bgBlue.bind(r),r.bgMagenta=Ee.bgMagenta.bind(r),r.bgCyan=Ee.bgCyan.bind(r),r.bgWhite=Ee.bgWhite.bind(r),r}function Ae(t,e){let r={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(n){return this!==void 0&&this.has!==void 0?(this.has.includes(t)||(this.has.push(t),this.keys.push(r)),n===void 0?this:Ee.enabled?m3(this.keys,n+""):n+""):n===void 0?GZ([t],[r]):Ee.enabled?m3([r],n+""):n+""}}g3.exports=Ee});var D3=D((gpe,y3)=>{"use strict";y3.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var Wd=D((ype,v3)=>{"use strict";v3.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var C3=D((Dpe,E3)=>{"use strict";function WZ(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=KZ(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
65
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function KZ(t,e){if(t){if(typeof t=="string")return b3(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b3(t,e)}}function b3(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var YZ=Wd(),_3=Te(),w3=_3.erase,JZ=_3.cursor,XZ=t=>[...YZ(t)].length;E3.exports=function(t,e){if(!e)return w3.line+JZ.to(0);let r=0,n=t.split(/\r?\n/);var i=WZ(n),o;try{for(i.s();!(o=i.n()).done;){let s=o.value;r+=1+Math.floor(Math.max(XZ(s)-1,0)/e)}}catch(s){i.e(s)}finally{i.f()}return w3.lines(r)}});var ZD=D((vpe,S3)=>{"use strict";var cc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},ZZ={arrowUp:cc.arrowUp,arrowDown:cc.arrowDown,arrowLeft:cc.arrowLeft,arrowRight:cc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},QZ=process.platform==="win32"?ZZ:cc;S3.exports=QZ});var F3=D((bpe,x3)=>{"use strict";var Zs=ze(),fo=ZD(),QD=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),eQ=t=>QD[t]||QD.default,lc=Object.freeze({aborted:Zs.red(fo.cross),done:Zs.green(fo.tick),exited:Zs.yellow(fo.cross),default:Zs.cyan("?")}),tQ=(t,e,r)=>e?lc.aborted:r?lc.exited:t?lc.done:lc.default,rQ=t=>Zs.gray(t?fo.ellipsis:fo.pointerSmall),nQ=(t,e)=>Zs.gray(t?e?fo.pointerSmall:"+":fo.line);x3.exports={styles:QD,render:eQ,symbols:lc,symbol:tQ,delimiter:rQ,item:nQ}});var A3=D((wpe,O3)=>{"use strict";var iQ=Wd();O3.exports=function(t,e){let r=String(iQ(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var T3=D((_pe,k3)=>{"use strict";k3.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
66
66
  `)).join(`
67
- `)}});var R3=D((_pe,P3)=>{"use strict";P3.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Pr=D((Epe,$3)=>{"use strict";$3.exports={action:D3(),clear:C3(),style:F3(),strip:Wd(),figures:ZD(),lines:A3(),wrap:T3(),entriesToDisplay:R3()}});var On=D((Cpe,N3)=>{"use strict";var I3=require("readline"),iQ=Pr(),oQ=iQ.action,sQ=require("events"),j3=Te(),aQ=j3.beep,uQ=j3.cursor,cQ=ze(),e0=class extends sQ{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=I3.createInterface({input:this.in,escapeCodeTimeout:50});I3.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=oQ(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(uQ.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(aQ)}render(){this.onRender(cQ),this.firstRender&&(this.firstRender=!1)}};N3.exports=e0});var U3=D((Spe,M3)=>{"use strict";function L3(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function B3(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){L3(o,n,i,s,a,"next",u)}function a(u){L3(o,n,i,s,a,"throw",u)}s(void 0)})}}var Kd=ze(),lQ=On(),q3=Te(),fQ=q3.erase,fc=q3.cursor,Yd=Pr(),t0=Yd.style,r0=Yd.clear,dQ=Yd.lines,hQ=Yd.figures,n0=class extends lQ{constructor(e={}){super(e),this.transform=t0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=r0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Kd.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
67
+ `)}});var R3=D((Epe,P3)=>{"use strict";P3.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Pr=D((Cpe,$3)=>{"use strict";$3.exports={action:D3(),clear:C3(),style:F3(),strip:Wd(),figures:ZD(),lines:A3(),wrap:T3(),entriesToDisplay:R3()}});var On=D((Spe,N3)=>{"use strict";var I3=require("readline"),oQ=Pr(),sQ=oQ.action,aQ=require("events"),j3=Te(),uQ=j3.beep,cQ=j3.cursor,lQ=ze(),e0=class extends aQ{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=I3.createInterface({input:this.in,escapeCodeTimeout:50});I3.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=sQ(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(cQ.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(uQ)}render(){this.onRender(lQ),this.firstRender&&(this.firstRender=!1)}};N3.exports=e0});var U3=D((xpe,M3)=>{"use strict";function L3(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function B3(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){L3(o,n,i,s,a,"next",u)}function a(u){L3(o,n,i,s,a,"throw",u)}s(void 0)})}}var Kd=ze(),fQ=On(),q3=Te(),dQ=q3.erase,fc=q3.cursor,Yd=Pr(),t0=Yd.style,r0=Yd.clear,hQ=Yd.lines,pQ=Yd.figures,n0=class extends fQ{constructor(e={}){super(e),this.transform=t0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=r0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=Kd.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
68
68
  `),this.close()}validate(){var e=this;return B3(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return B3(function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error){e.red=!0,e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
69
- `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(fc.down(dQ(this.outputError,this.out.columns)-1)+r0(this.outputError,this.out.columns)),this.out.write(r0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[t0.symbol(this.done,this.aborted),Kd.bold(this.msg),t0.delimiter(this.done),this.red?Kd.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
69
+ `),e.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(fc.down(hQ(this.outputError,this.out.columns)-1)+r0(this.outputError,this.out.columns)),this.out.write(r0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[t0.symbol(this.done,this.aborted),Kd.bold(this.msg),t0.delimiter(this.done),this.red?Kd.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
70
70
  `).reduce((e,r,n)=>e+`
71
- ${n?" ":hQ.pointerSmall} ${Kd.red().italic(r)}`,"")),this.out.write(fQ.line+fc.to(0)+this.outputText+fc.save+this.outputError+fc.restore+fc.move(this.cursorOffset,0)))}};M3.exports=n0});var G3=D((xpe,z3)=>{"use strict";var An=ze(),pQ=On(),dc=Pr(),V3=dc.style,H3=dc.clear,Jd=dc.figures,mQ=dc.wrap,gQ=dc.entriesToDisplay,yQ=Te(),DQ=yQ.cursor,i0=class extends pQ{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=H3("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
71
+ ${n?" ":pQ.pointerSmall} ${Kd.red().italic(r)}`,"")),this.out.write(dQ.line+fc.to(0)+this.outputText+fc.save+this.outputError+fc.restore+fc.move(this.cursorOffset,0)))}};M3.exports=n0});var G3=D((Fpe,z3)=>{"use strict";var An=ze(),mQ=On(),dc=Pr(),V3=dc.style,H3=dc.clear,Jd=dc.figures,gQ=dc.wrap,yQ=dc.entriesToDisplay,DQ=Te(),vQ=DQ.cursor,i0=class extends mQ{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=H3("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
72
72
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
73
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(DQ.hide):this.out.write(H3(this.outputText,this.out.columns)),super.render();let e=gQ(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,n=e.endIndex;if(this.outputText=[V3.symbol(this.done,this.aborted),An.bold(this.msg),V3.delimiter(!1),this.done?this.selection.title:this.selection.disabled?An.yellow(this.warn):An.gray(this.hint)].join(" "),!this.done){this.outputText+=`
73
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(vQ.hide):this.out.write(H3(this.outputText,this.out.columns)),super.render();let e=yQ(this.cursor,this.choices.length,this.optionsPerPage),r=e.startIndex,n=e.endIndex;if(this.outputText=[V3.symbol(this.done,this.aborted),An.bold(this.msg),V3.delimiter(!1),this.done?this.selection.title:this.selection.disabled?An.yellow(this.warn):An.gray(this.hint)].join(" "),!this.done){this.outputText+=`
74
74
  `;for(let i=r;i<n;i++){let o,s,a="",u=this.choices[i];i===r&&r>0?s=Jd.arrowUp:i===n-1&&n<this.choices.length?s=Jd.arrowDown:s=" ",u.disabled?(o=this.cursor===i?An.gray().underline(u.title):An.strikethrough().gray(u.title),s=(this.cursor===i?An.bold().gray(Jd.pointer)+" ":" ")+s):(o=this.cursor===i?An.cyan().underline(u.title):u.title,s=(this.cursor===i?An.cyan(Jd.pointer)+" ":" ")+s,u.description&&this.cursor===i&&(a=` - ${u.description}`,(s.length+o.length+a.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(a=`
75
- `+mQ(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${o}${An.gray(a)}
76
- `}}this.out.write(this.outputText)}};z3.exports=i0});var Z3=D((Fpe,X3)=>{"use strict";var Xd=ze(),vQ=On(),Y3=Pr(),W3=Y3.style,bQ=Y3.clear,J3=Te(),K3=J3.cursor,wQ=J3.erase,o0=class extends vQ{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
75
+ `+gQ(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${o}${An.gray(a)}
76
+ `}}this.out.write(this.outputText)}};z3.exports=i0});var Z3=D((Ope,X3)=>{"use strict";var Xd=ze(),bQ=On(),Y3=Pr(),W3=Y3.style,wQ=Y3.clear,J3=Te(),K3=J3.cursor,_Q=J3.erase,o0=class extends bQ{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
77
77
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
78
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(K3.hide):this.out.write(bQ(this.outputText,this.out.columns)),super.render(),this.outputText=[W3.symbol(this.done,this.aborted),Xd.bold(this.msg),W3.delimiter(this.done),this.value?this.inactive:Xd.cyan().underline(this.inactive),Xd.gray("/"),this.value?Xd.cyan().underline(this.active):this.active].join(" "),this.out.write(wQ.line+K3.to(0)+this.outputText))}};X3.exports=o0});var Xr=D((Ope,Q3)=>{"use strict";var s0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};Q3.exports=s0});var tT=D((Ape,eT)=>{"use strict";var _Q=Xr(),a0=class extends _Q{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};eT.exports=a0});var nT=D((kpe,rT)=>{"use strict";var EQ=Xr(),CQ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),u0=class extends EQ{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+CQ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};rT.exports=u0});var oT=D((Tpe,iT)=>{"use strict";var SQ=Xr(),c0=class extends SQ{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};iT.exports=c0});var aT=D((Ppe,sT)=>{"use strict";var xQ=Xr(),l0=class extends xQ{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};sT.exports=l0});var cT=D((Rpe,uT)=>{"use strict";var FQ=Xr(),f0=class extends FQ{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};uT.exports=f0});var fT=D(($pe,lT)=>{"use strict";var OQ=Xr(),d0=class extends OQ{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};lT.exports=d0});var hT=D((Ipe,dT)=>{"use strict";var AQ=Xr(),h0=class extends AQ{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};dT.exports=h0});var mT=D((jpe,pT)=>{"use strict";var kQ=Xr(),p0=class extends kQ{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};pT.exports=p0});var yT=D((Npe,gT)=>{"use strict";gT.exports={DatePart:Xr(),Meridiem:tT(),Day:nT(),Hours:oT(),Milliseconds:aT(),Minutes:cT(),Month:fT(),Seconds:hT(),Year:mT()}});var FT=D((Lpe,xT)=>{"use strict";function DT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function vT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){DT(o,n,i,s,a,"next",u)}function a(u){DT(o,n,i,s,a,"throw",u)}s(void 0)})}}var m0=ze(),TQ=On(),y0=Pr(),bT=y0.style,wT=y0.clear,PQ=y0.figures,ST=Te(),RQ=ST.erase,_T=ST.cursor,kn=yT(),ET=kn.DatePart,$Q=kn.Meridiem,IQ=kn.Day,jQ=kn.Hours,NQ=kn.Milliseconds,LQ=kn.Minutes,BQ=kn.Month,qQ=kn.Seconds,MQ=kn.Year,UQ=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,CT={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new IQ(t),3:t=>new BQ(t),4:t=>new MQ(t),5:t=>new $Q(t),6:t=>new jQ(t),7:t=>new LQ(t),8:t=>new qQ(t),9:t=>new NQ(t)},VQ={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},g0=class extends TQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(VQ,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=wT("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=UQ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in CT?CT[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof ET)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
78
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(K3.hide):this.out.write(wQ(this.outputText,this.out.columns)),super.render(),this.outputText=[W3.symbol(this.done,this.aborted),Xd.bold(this.msg),W3.delimiter(this.done),this.value?this.inactive:Xd.cyan().underline(this.inactive),Xd.gray("/"),this.value?Xd.cyan().underline(this.active):this.active].join(" "),this.out.write(_Q.line+K3.to(0)+this.outputText))}};X3.exports=o0});var Xr=D((Ape,Q3)=>{"use strict";var s0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};Q3.exports=s0});var tT=D((kpe,eT)=>{"use strict";var EQ=Xr(),a0=class extends EQ{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};eT.exports=a0});var nT=D((Tpe,rT)=>{"use strict";var CQ=Xr(),SQ=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),u0=class extends CQ{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+SQ(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};rT.exports=u0});var oT=D((Ppe,iT)=>{"use strict";var xQ=Xr(),c0=class extends xQ{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};iT.exports=c0});var aT=D((Rpe,sT)=>{"use strict";var FQ=Xr(),l0=class extends FQ{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};sT.exports=l0});var cT=D(($pe,uT)=>{"use strict";var OQ=Xr(),f0=class extends OQ{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};uT.exports=f0});var fT=D((Ipe,lT)=>{"use strict";var AQ=Xr(),d0=class extends AQ{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};lT.exports=d0});var hT=D((jpe,dT)=>{"use strict";var kQ=Xr(),h0=class extends kQ{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};dT.exports=h0});var mT=D((Npe,pT)=>{"use strict";var TQ=Xr(),p0=class extends TQ{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};pT.exports=p0});var yT=D((Lpe,gT)=>{"use strict";gT.exports={DatePart:Xr(),Meridiem:tT(),Day:nT(),Hours:oT(),Milliseconds:aT(),Minutes:cT(),Month:fT(),Seconds:hT(),Year:mT()}});var FT=D((Bpe,xT)=>{"use strict";function DT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function vT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){DT(o,n,i,s,a,"next",u)}function a(u){DT(o,n,i,s,a,"throw",u)}s(void 0)})}}var m0=ze(),PQ=On(),y0=Pr(),bT=y0.style,wT=y0.clear,RQ=y0.figures,ST=Te(),$Q=ST.erase,_T=ST.cursor,kn=yT(),ET=kn.DatePart,IQ=kn.Meridiem,jQ=kn.Day,NQ=kn.Hours,LQ=kn.Milliseconds,BQ=kn.Minutes,qQ=kn.Month,MQ=kn.Seconds,UQ=kn.Year,VQ=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,CT={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new jQ(t),3:t=>new qQ(t),4:t=>new UQ(t),5:t=>new IQ(t),6:t=>new NQ(t),7:t=>new BQ(t),8:t=>new MQ(t),9:t=>new LQ(t)},HQ={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},g0=class extends PQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(HQ,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=wT("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=VQ.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in CT?CT[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof ET)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
79
79
  `),this.close()}validate(){var e=this;return vT(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return vT(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write(`
80
80
  `),e.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof ET)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(_T.hide):this.out.write(wT(this.outputText,this.out.columns)),super.render(),this.outputText=[bT.symbol(this.done,this.aborted),m0.bold(this.msg),bT.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?m0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
81
81
  `).reduce((e,r,n)=>e+`
82
- ${n?" ":PQ.pointerSmall} ${m0.red().italic(r)}`,"")),this.out.write(RQ.line+_T.to(0)+this.outputText))}};xT.exports=g0});var $T=D((Bpe,RT)=>{"use strict";function OT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function AT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){OT(o,n,i,s,a,"next",u)}function a(u){OT(o,n,i,s,a,"throw",u)}s(void 0)})}}var Zd=ze(),HQ=On(),PT=Te(),Qd=PT.cursor,zQ=PT.erase,eh=Pr(),D0=eh.style,GQ=eh.figures,kT=eh.clear,WQ=eh.lines,KQ=/[0-9]/,v0=t=>t!==void 0,TT=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},b0=class extends HQ{constructor(e={}){super(e),this.transform=D0.render(e.style),this.msg=e.message,this.initial=v0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=v0(e.min)?e.min:-1/0,this.max=v0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Zd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${TT(e,this.round)}`),this._value=TT(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||KQ.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
82
+ ${n?" ":RQ.pointerSmall} ${m0.red().italic(r)}`,"")),this.out.write($Q.line+_T.to(0)+this.outputText))}};xT.exports=g0});var $T=D((qpe,RT)=>{"use strict";function OT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function AT(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){OT(o,n,i,s,a,"next",u)}function a(u){OT(o,n,i,s,a,"throw",u)}s(void 0)})}}var Zd=ze(),zQ=On(),PT=Te(),Qd=PT.cursor,GQ=PT.erase,eh=Pr(),D0=eh.style,WQ=eh.figures,kT=eh.clear,KQ=eh.lines,YQ=/[0-9]/,v0=t=>t!==void 0,TT=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},b0=class extends zQ{constructor(e={}){super(e),this.transform=D0.render(e.style),this.msg=e.message,this.initial=v0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=v0(e.min)?e.min:-1/0,this.max=v0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=Zd.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${TT(e,this.round)}`),this._value=TT(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||YQ.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
83
83
  `),this.close()}validate(){var e=this;return AT(function*(){let r=yield e.validator(e.value);typeof r=="string"&&(e.errorMsg=r,r=!1),e.error=!r})()}submit(){var e=this;return AT(function*(){if(yield e.validate(),e.error){e.color="red",e.fire(),e.render();return}let r=e.value;e.value=r!==""?r:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write(`
84
- `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Qd.down(WQ(this.outputError,this.out.columns)-1)+kT(this.outputError,this.out.columns)),this.out.write(kT(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[D0.symbol(this.done,this.aborted),Zd.bold(this.msg),D0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Zd[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
84
+ `),e.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Qd.down(KQ(this.outputError,this.out.columns)-1)+kT(this.outputError,this.out.columns)),this.out.write(kT(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[D0.symbol(this.done,this.aborted),Zd.bold(this.msg),D0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?Zd[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
85
85
  `).reduce((e,r,n)=>e+`
86
- ${n?" ":GQ.pointerSmall} ${Zd.red().italic(r)}`,"")),this.out.write(zQ.line+Qd.to(0)+this.outputText+Qd.save+this.outputError+Qd.restore))}};RT.exports=b0});var _0=D((qpe,NT)=>{"use strict";var Zr=ze(),YQ=Te(),JQ=YQ.cursor,XQ=On(),hc=Pr(),IT=hc.clear,fi=hc.figures,jT=hc.style,ZQ=hc.wrap,QQ=hc.entriesToDisplay,w0=class extends XQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=IT("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
86
+ ${n?" ":WQ.pointerSmall} ${Zd.red().italic(r)}`,"")),this.out.write(GQ.line+Qd.to(0)+this.outputText+Qd.save+this.outputError+Qd.restore))}};RT.exports=b0});var _0=D((Mpe,NT)=>{"use strict";var Zr=ze(),JQ=Te(),XQ=JQ.cursor,ZQ=On(),hc=Pr(),IT=hc.clear,fi=hc.figures,jT=hc.style,QQ=hc.wrap,eee=hc.entriesToDisplay,w0=class extends ZQ{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=IT("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
87
87
  `),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
88
88
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
89
89
  Instructions:
@@ -91,15 +91,15 @@ Instructions:
91
91
  ${fi.arrowLeft}/${fi.arrowRight}/[space]: Toggle selection
92
92
  `+(this.maxChoices===void 0?` a: Toggle all
93
93
  `:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let o=(r.selected?Zr.green(fi.radioOn):fi.radioOff)+" "+i+" ",s,a;return r.disabled?s=e===n?Zr.gray().underline(r.title):Zr.strikethrough().gray(r.title):(s=e===n?Zr.cyan().underline(r.title):r.title,e===n&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
94
- `+ZQ(r.description,{margin:o.length,width:this.out.columns})))),o+s+Zr.gray(a||"")}paginateOptions(e){if(e.length===0)return Zr.red("No matches for this query.");let r=QQ(this.cursor,e.length,this.optionsPerPage),n=r.startIndex,i=r.endIndex,o,s=[];for(let a=n;a<i;a++)a===n&&n>0?o=fi.arrowUp:a===i-1&&i<e.length?o=fi.arrowDown:o=" ",s.push(this.renderOption(this.cursor,e[a],a,o));return`
94
+ `+QQ(r.description,{margin:o.length,width:this.out.columns})))),o+s+Zr.gray(a||"")}paginateOptions(e){if(e.length===0)return Zr.red("No matches for this query.");let r=eee(this.cursor,e.length,this.optionsPerPage),n=r.startIndex,i=r.endIndex,o,s=[];for(let a=n;a<i;a++)a===n&&n>0?o=fi.arrowUp:a===i-1&&i<e.length?o=fi.arrowDown:o=" ",s.push(this.renderOption(this.cursor,e[a],a,o));return`
95
95
  `+s.join(`
96
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Zr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Zr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(JQ.hide),super.render();let e=[jT.symbol(this.done,this.aborted),Zr.bold(this.msg),jT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Zr.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=IT(e,this.out.columns)}};NT.exports=w0});var HT=D((Mpe,VT)=>{"use strict";function LT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function eee(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){LT(o,n,i,s,a,"next",u)}function a(u){LT(o,n,i,s,a,"throw",u)}s(void 0)})}}var pc=ze(),tee=On(),UT=Te(),ree=UT.erase,BT=UT.cursor,mc=Pr(),E0=mc.style,qT=mc.clear,C0=mc.figures,nee=mc.wrap,iee=mc.entriesToDisplay,MT=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),oee=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),see=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},S0=class extends tee{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:see(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=E0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=qT("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=MT(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return eee(function*(){let n=r.completing=r.suggest(r.input,r.choices),i=yield n;if(r.completing!==n)return;r.suggestions=i.map((s,a,u)=>({title:oee(u,a),value:MT(u,a),description:s.description})),r.completing=!1;let o=Math.max(i.length-1,0);r.moveSelect(Math.min(o,r.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
96
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Zr.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(Zr.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(XQ.hide),super.render();let e=[jT.symbol(this.done,this.aborted),Zr.bold(this.msg),jT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Zr.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=IT(e,this.out.columns)}};NT.exports=w0});var HT=D((Upe,VT)=>{"use strict";function LT(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function tee(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){LT(o,n,i,s,a,"next",u)}function a(u){LT(o,n,i,s,a,"throw",u)}s(void 0)})}}var pc=ze(),ree=On(),UT=Te(),nee=UT.erase,BT=UT.cursor,mc=Pr(),E0=mc.style,qT=mc.clear,C0=mc.figures,iee=mc.wrap,oee=mc.entriesToDisplay,MT=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),see=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),aee=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},S0=class extends ree{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:aee(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=E0.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=qT("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=MT(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(e){var r=this;return tee(function*(){let n=r.completing=r.suggest(r.input,r.choices),i=yield n;if(r.completing!==n)return;r.suggestions=i.map((s,a,u)=>({title:see(u,a),value:MT(u,a),description:s.description})),r.completing=!1;let o=Math.max(i.length-1,0);r.moveSelect(Math.min(o,r.select)),e&&e()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
97
97
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
98
98
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
99
99
  `),this.close()}_(e,r){let n=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${n}${e}${i}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,n,i){let o,s=n?C0.arrowUp:i?C0.arrowDown:" ",a=r?pc.cyan().underline(e.title):e.title;return s=(r?pc.cyan(C0.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
100
- `+nee(e.description,{margin:3,width:this.out.columns}))),s+" "+a+pc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(BT.hide):this.out.write(qT(this.outputText,this.out.columns)),super.render();let e=iee(this.select,this.choices.length,this.limit),r=e.startIndex,n=e.endIndex;if(this.outputText=[E0.symbol(this.done,this.aborted,this.exited),pc.bold(this.msg),E0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(r,n).map((o,s)=>this.renderOption(o,this.select===s+r,s===0&&r>0,s+r===n-1&&n<this.choices.length)).join(`
100
+ `+iee(e.description,{margin:3,width:this.out.columns}))),s+" "+a+pc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(BT.hide):this.out.write(qT(this.outputText,this.out.columns)),super.render();let e=oee(this.select,this.choices.length,this.limit),r=e.startIndex,n=e.endIndex;if(this.outputText=[E0.symbol(this.done,this.aborted,this.exited),pc.bold(this.msg),E0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(r,n).map((o,s)=>this.renderOption(o,this.select===s+r,s===0&&r>0,s+r===n-1&&n<this.choices.length)).join(`
101
101
  `);this.outputText+=`
102
- `+(i||pc.gray(this.fallback.title))}this.out.write(ree.line+BT.to(0)+this.outputText)}};VT.exports=S0});var KT=D((Upe,WT)=>{"use strict";var Tn=ze(),aee=Te(),uee=aee.cursor,cee=_0(),F0=Pr(),zT=F0.clear,GT=F0.style,Qs=F0.figures,x0=class extends cee{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=zT("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
102
+ `+(i||pc.gray(this.fallback.title))}this.out.write(nee.line+BT.to(0)+this.outputText)}};VT.exports=S0});var KT=D((Vpe,WT)=>{"use strict";var Tn=ze(),uee=Te(),cee=uee.cursor,lee=_0(),F0=Pr(),zT=F0.clear,GT=F0.style,Qs=F0.figures,x0=class extends lee{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=zT("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
103
103
  Instructions:
104
104
  ${Qs.arrowUp}/${Qs.arrowDown}: Highlight option
105
105
  ${Qs.arrowLeft}/${Qs.arrowRight}/[space]: Toggle selection
@@ -107,31 +107,31 @@ Instructions:
107
107
  enter/return: Complete answer
108
108
  `:""}renderCurrentInput(){return`
109
109
  Filtered results for: ${this.inputValue?this.inputValue:Tn.gray("Enter something to filter")}
110
- `}renderOption(e,r,n){let i;return r.disabled?i=e===n?Tn.gray().underline(r.title):Tn.strikethrough().gray(r.title):i=e===n?Tn.cyan().underline(r.title):r.title,(r.selected?Tn.green(Qs.radioOn):Qs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Tn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(uee.hide),super.render();let e=[GT.symbol(this.done,this.aborted),Tn.bold(this.msg),GT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=zT(e,this.out.columns)}};WT.exports=x0});var tP=D((Vpe,eP)=>{"use strict";var YT=ze(),lee=On(),ZT=Pr(),JT=ZT.style,fee=ZT.clear,QT=Te(),dee=QT.erase,XT=QT.cursor,O0=class extends lee{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
110
+ `}renderOption(e,r,n){let i;return r.disabled?i=e===n?Tn.gray().underline(r.title):Tn.strikethrough().gray(r.title):i=e===n?Tn.cyan().underline(r.title):r.title,(r.selected?Tn.green(Qs.radioOn):Qs.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[Tn.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push(Tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(cee.hide),super.render();let e=[GT.symbol(this.done,this.aborted),Tn.bold(this.msg),GT.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=Tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=zT(e,this.out.columns)}};WT.exports=x0});var tP=D((Hpe,eP)=>{"use strict";var YT=ze(),fee=On(),ZT=Pr(),JT=ZT.style,dee=ZT.clear,QT=Te(),hee=QT.erase,XT=QT.cursor,O0=class extends fee{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
111
111
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
112
- `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(XT.hide):this.out.write(fee(this.outputText,this.out.columns)),super.render(),this.outputText=[JT.symbol(this.done,this.aborted),YT.bold(this.msg),JT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:YT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(dee.line+XT.to(0)+this.outputText))}};eP.exports=O0});var nP=D((Hpe,rP)=>{"use strict";rP.exports={TextPrompt:U3(),SelectPrompt:G3(),TogglePrompt:Z3(),DatePrompt:FT(),NumberPrompt:$T(),MultiselectPrompt:_0(),AutocompletePrompt:HT(),AutocompleteMultiselectPrompt:KT(),ConfirmPrompt:tP()}});var oP=D(iP=>{"use strict";var Yt=iP,hee=nP(),th=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new hee[t](e),s=r.onAbort||th,a=r.onSubmit||th,u=r.onExit||th;o.on("state",e.onState||th),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Yt.text=t=>Qr("TextPrompt",t);Yt.password=t=>(t.style="password",Yt.text(t));Yt.invisible=t=>(t.style="invisible",Yt.text(t));Yt.number=t=>Qr("NumberPrompt",t);Yt.date=t=>Qr("DatePrompt",t);Yt.confirm=t=>Qr("ConfirmPrompt",t);Yt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Yt.toggle=t=>Qr("TogglePrompt",t);Yt.select=t=>Qr("SelectPrompt",t);Yt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Yt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var pee=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Yt.autocomplete=t=>(t.suggest=t.suggest||pee,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var hP=D((Gpe,dP)=>{"use strict";function sP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function aP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sP(Object(r),!0).forEach(function(n){mee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function gee(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=yee(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
113
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function yee(t,e){if(t){if(typeof t=="string")return uP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uP(t,e)}}function uP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cP(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function lP(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){cP(o,n,i,s,a,"next",u)}function a(u){cP(o,n,i,s,a,"throw",u)}s(void 0)})}}var A0=oP(),Dee=["suggest","format","onState","validate","onRender","type"],fP=()=>{};function di(){return k0.apply(this,arguments)}function k0(){return k0=lP(function*(t=[],{onSubmit:e=fP,onCancel:r=fP}={}){let n={},i=di._override||{};t=[].concat(t);let o,s,a,u,c,l,f=function(){var g=lP(function*(w,x,y=!1){if(!(!y&&w.validate&&w.validate(x)!==!0))return w.format?yield w.format(x,n):x});return function(x,y){return g.apply(this,arguments)}}();var h=gee(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var p=s;if(u=p.name,c=p.type,typeof c=="function"&&(c=yield c(o,aP({},n),s),s.type=c),!!c){for(let g in s){if(Dee.includes(g))continue;let w=s[g];s[g]=typeof w=="function"?yield w(o,aP({},n),l):w}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");var v=s;if(u=v.name,c=v.type,A0[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=yield f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=di._injected?vee(di._injected,s.initial):yield A0[c](s),n[u]=o=yield f(s,o,!0),a=yield e(s,o,n)}catch{a=!(yield r(s,n))}if(a)return n}}}catch(g){h.e(g)}finally{h.f()}return n}),k0.apply(this,arguments)}function vee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function bee(t){di._injected=(di._injected||[]).concat(t)}function wee(t){di._override=Object.assign({},t)}dP.exports=Object.assign(di,{prompt:di,prompts:A0,inject:bee,override:wee})});var mP=D((Wpe,pP)=>{"use strict";pP.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var rh=D((Kpe,gP)=>{"use strict";gP.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var vP=D((Ype,DP)=>{"use strict";var _ee=rh(),{erase:yP,cursor:Eee}=Te(),Cee=t=>[..._ee(t)].length;DP.exports=function(t,e){if(!e)return yP.line+Eee.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(Cee(i)-1,0)/e);return yP.lines(r)}});var T0=D((Jpe,bP)=>{"use strict";var gc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},See={arrowUp:gc.arrowUp,arrowDown:gc.arrowDown,arrowLeft:gc.arrowLeft,arrowRight:gc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},xee=process.platform==="win32"?See:gc;bP.exports=xee});var _P=D((Xpe,wP)=>{"use strict";var ea=ze(),ho=T0(),P0=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),Fee=t=>P0[t]||P0.default,yc=Object.freeze({aborted:ea.red(ho.cross),done:ea.green(ho.tick),exited:ea.yellow(ho.cross),default:ea.cyan("?")}),Oee=(t,e,r)=>e?yc.aborted:r?yc.exited:t?yc.done:yc.default,Aee=t=>ea.gray(t?ho.ellipsis:ho.pointerSmall),kee=(t,e)=>ea.gray(t?e?ho.pointerSmall:"+":ho.line);wP.exports={styles:P0,render:Fee,symbols:yc,symbol:Oee,delimiter:Aee,item:kee}});var CP=D((Zpe,EP)=>{"use strict";var Tee=rh();EP.exports=function(t,e){let r=String(Tee(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var xP=D((Qpe,SP)=>{"use strict";SP.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
112
+ `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(XT.hide):this.out.write(dee(this.outputText,this.out.columns)),super.render(),this.outputText=[JT.symbol(this.done,this.aborted),YT.bold(this.msg),JT.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:YT.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(hee.line+XT.to(0)+this.outputText))}};eP.exports=O0});var nP=D((zpe,rP)=>{"use strict";rP.exports={TextPrompt:U3(),SelectPrompt:G3(),TogglePrompt:Z3(),DatePrompt:FT(),NumberPrompt:$T(),MultiselectPrompt:_0(),AutocompletePrompt:HT(),AutocompleteMultiselectPrompt:KT(),ConfirmPrompt:tP()}});var oP=D(iP=>{"use strict";var Yt=iP,pee=nP(),th=t=>t;function Qr(t,e,r={}){return new Promise((n,i)=>{let o=new pee[t](e),s=r.onAbort||th,a=r.onSubmit||th,u=r.onExit||th;o.on("state",e.onState||th),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Yt.text=t=>Qr("TextPrompt",t);Yt.password=t=>(t.style="password",Yt.text(t));Yt.invisible=t=>(t.style="invisible",Yt.text(t));Yt.number=t=>Qr("NumberPrompt",t);Yt.date=t=>Qr("DatePrompt",t);Yt.confirm=t=>Qr("ConfirmPrompt",t);Yt.list=t=>{let e=t.separator||",";return Qr("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Yt.toggle=t=>Qr("TogglePrompt",t);Yt.select=t=>Qr("SelectPrompt",t);Yt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Yt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return Qr("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var mee=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Yt.autocomplete=t=>(t.suggest=t.suggest||mee,t.choices=[].concat(t.choices||[]),Qr("AutocompletePrompt",t))});var hP=D((Wpe,dP)=>{"use strict";function sP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function aP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?sP(Object(r),!0).forEach(function(n){gee(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):sP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gee(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yee(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Dee(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
113
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}function Dee(t,e){if(t){if(typeof t=="string")return uP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uP(t,e)}}function uP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function cP(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(c){r(c);return}a.done?e(u):Promise.resolve(u).then(n,i)}function lP(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(u){cP(o,n,i,s,a,"next",u)}function a(u){cP(o,n,i,s,a,"throw",u)}s(void 0)})}}var A0=oP(),vee=["suggest","format","onState","validate","onRender","type"],fP=()=>{};function di(){return k0.apply(this,arguments)}function k0(){return k0=lP(function*(t=[],{onSubmit:e=fP,onCancel:r=fP}={}){let n={},i=di._override||{};t=[].concat(t);let o,s,a,u,c,l,f=function(){var g=lP(function*(w,x,y=!1){if(!(!y&&w.validate&&w.validate(x)!==!0))return w.format?yield w.format(x,n):x});return function(x,y){return g.apply(this,arguments)}}();var h=yee(t),d;try{for(h.s();!(d=h.n()).done;){s=d.value;var p=s;if(u=p.name,c=p.type,typeof c=="function"&&(c=yield c(o,aP({},n),s),s.type=c),!!c){for(let g in s){if(vee.includes(g))continue;let w=s[g];s[g]=typeof w=="function"?yield w(o,aP({},n),l):w}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");var v=s;if(u=v.name,c=v.type,A0[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=yield f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=di._injected?bee(di._injected,s.initial):yield A0[c](s),n[u]=o=yield f(s,o,!0),a=yield e(s,o,n)}catch{a=!(yield r(s,n))}if(a)return n}}}catch(g){h.e(g)}finally{h.f()}return n}),k0.apply(this,arguments)}function bee(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function wee(t){di._injected=(di._injected||[]).concat(t)}function _ee(t){di._override=Object.assign({},t)}dP.exports=Object.assign(di,{prompt:di,prompts:A0,inject:wee,override:_ee})});var mP=D((Kpe,pP)=>{"use strict";pP.exports=(t,e)=>{if(!(t.meta&&t.name!=="escape")){if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c"||t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(e){if(t.name==="j")return"down";if(t.name==="k")return"up"}return t.name==="return"||t.name==="enter"?"submit":t.name==="backspace"?"delete":t.name==="delete"?"deleteForward":t.name==="abort"?"abort":t.name==="escape"?"exit":t.name==="tab"?"next":t.name==="pagedown"?"nextPage":t.name==="pageup"?"prevPage":t.name==="home"?"home":t.name==="end"?"end":t.name==="up"?"up":t.name==="down"?"down":t.name==="right"?"right":t.name==="left"?"left":!1}}});var rh=D((Ype,gP)=>{"use strict";gP.exports=t=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(e,"g");return typeof t=="string"?t.replace(r,""):t}});var vP=D((Jpe,DP)=>{"use strict";var Eee=rh(),{erase:yP,cursor:Cee}=Te(),See=t=>[...Eee(t)].length;DP.exports=function(t,e){if(!e)return yP.line+Cee.to(0);let r=0,n=t.split(/\r?\n/);for(let i of n)r+=1+Math.floor(Math.max(See(i)-1,0)/e);return yP.lines(r)}});var T0=D((Xpe,bP)=>{"use strict";var gc={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},xee={arrowUp:gc.arrowUp,arrowDown:gc.arrowDown,arrowLeft:gc.arrowLeft,arrowRight:gc.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Fee=process.platform==="win32"?xee:gc;bP.exports=Fee});var _P=D((Zpe,wP)=>{"use strict";var ea=ze(),ho=T0(),P0=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"\u{1F603}".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}}),Oee=t=>P0[t]||P0.default,yc=Object.freeze({aborted:ea.red(ho.cross),done:ea.green(ho.tick),exited:ea.yellow(ho.cross),default:ea.cyan("?")}),Aee=(t,e,r)=>e?yc.aborted:r?yc.exited:t?yc.done:yc.default,kee=t=>ea.gray(t?ho.ellipsis:ho.pointerSmall),Tee=(t,e)=>ea.gray(t?e?ho.pointerSmall:"+":ho.line);wP.exports={styles:P0,render:Oee,symbols:yc,symbol:Aee,delimiter:kee,item:Tee}});var CP=D((Qpe,EP)=>{"use strict";var Pee=rh();EP.exports=function(t,e){let r=String(Pee(t)||"").split(/\r?\n/);return e?r.map(n=>Math.ceil(n.length/e)).reduce((n,i)=>n+i):r.length}});var xP=D((eme,SP)=>{"use strict";SP.exports=(t,e={})=>{let r=Number.isSafeInteger(parseInt(e.margin))?new Array(parseInt(e.margin)).fill(" ").join(""):e.margin||"",n=e.width;return(t||"").split(/\r?\n/g).map(i=>i.split(/\s+/g).reduce((o,s)=>(s.length+r.length>=n||o[o.length-1].length+s.length+1<n?o[o.length-1]+=` ${s}`:o.push(`${r}${s}`),o),[r]).join(`
114
114
  `)).join(`
115
- `)}});var OP=D((eme,FP)=>{"use strict";FP.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Rr=D((tme,AP)=>{"use strict";AP.exports={action:mP(),clear:vP(),style:_P(),strip:rh(),figures:T0(),lines:CP(),wrap:xP(),entriesToDisplay:OP()}});var Pn=D((rme,TP)=>{"use strict";var kP=require("readline"),{action:Pee}=Rr(),Ree=require("events"),{beep:$ee,cursor:Iee}=Te(),jee=ze(),R0=class extends Ree{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=kP.createInterface({input:this.in,escapeCodeTimeout:50});kP.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=Pee(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(Iee.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write($ee)}render(){this.onRender(jee),this.firstRender&&(this.firstRender=!1)}};TP.exports=R0});var RP=D((nme,PP)=>{var nh=ze(),Nee=Pn(),{erase:Lee,cursor:Dc}=Te(),{style:$0,clear:I0,lines:Bee,figures:qee}=Rr(),j0=class extends Nee{constructor(e={}){super(e),this.transform=$0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=I0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=nh.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
115
+ `)}});var OP=D((tme,FP)=>{"use strict";FP.exports=(t,e,r)=>{r=r||e;let n=Math.min(e-r,t-Math.floor(r/2));n<0&&(n=0);let i=Math.min(n+r,e);return{startIndex:n,endIndex:i}}});var Rr=D((rme,AP)=>{"use strict";AP.exports={action:mP(),clear:vP(),style:_P(),strip:rh(),figures:T0(),lines:CP(),wrap:xP(),entriesToDisplay:OP()}});var Pn=D((nme,TP)=>{"use strict";var kP=require("readline"),{action:Ree}=Rr(),$ee=require("events"),{beep:Iee,cursor:jee}=Te(),Nee=ze(),R0=class extends $ee{constructor(e={}){super(),this.firstRender=!0,this.in=e.stdin||process.stdin,this.out=e.stdout||process.stdout,this.onRender=(e.onRender||(()=>{})).bind(this);let r=kP.createInterface({input:this.in,escapeCodeTimeout:50});kP.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let n=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,i=(o,s)=>{let a=Ree(s,n);a===!1?this._&&this._(o,s):typeof this[a]=="function"?this[a](s):this.bell()};this.close=()=>{this.out.write(jee.show),this.in.removeListener("keypress",i),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",i)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Iee)}render(){this.onRender(Nee),this.firstRender&&(this.firstRender=!1)}};TP.exports=R0});var RP=D((ime,PP)=>{var nh=ze(),Lee=Pn(),{erase:Bee,cursor:Dc}=Te(),{style:$0,clear:I0,lines:qee,figures:Mee}=Rr(),j0=class extends Lee{constructor(e={}){super(e),this.transform=$0.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=I0("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=nh.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
116
116
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
117
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Dc.down(Bee(this.outputError,this.out.columns)-1)+I0(this.outputError,this.out.columns)),this.out.write(I0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[$0.symbol(this.done,this.aborted),nh.bold(this.msg),$0.delimiter(this.done),this.red?nh.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
117
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,r){let n=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.value=`${n}${e}${i}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${e}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${e}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Dc.down(qee(this.outputError,this.out.columns)-1)+I0(this.outputError,this.out.columns)),this.out.write(I0(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[$0.symbol(this.done,this.aborted),nh.bold(this.msg),$0.delimiter(this.done),this.red?nh.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
118
118
  `).reduce((e,r,n)=>e+`
119
- ${n?" ":qee.pointerSmall} ${nh.red().italic(r)}`,"")),this.out.write(Lee.line+Dc.to(0)+this.outputText+Dc.save+this.outputError+Dc.restore+Dc.move(this.cursorOffset,0)))}};PP.exports=j0});var NP=D((ime,jP)=>{"use strict";var Rn=ze(),Mee=Pn(),{style:$P,clear:IP,figures:ih,wrap:Uee,entriesToDisplay:Vee}=Rr(),{cursor:Hee}=Te(),N0=class extends Mee{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=IP("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
119
+ ${n?" ":Mee.pointerSmall} ${nh.red().italic(r)}`,"")),this.out.write(Bee.line+Dc.to(0)+this.outputText+Dc.save+this.outputError+Dc.restore+Dc.move(this.cursorOffset,0)))}};PP.exports=j0});var NP=D((ome,jP)=>{"use strict";var Rn=ze(),Uee=Pn(),{style:$P,clear:IP,figures:ih,wrap:Vee,entriesToDisplay:Hee}=Rr(),{cursor:zee}=Te(),N0=class extends Uee{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?n:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=IP("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
120
120
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
121
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Hee.hide):this.out.write(IP(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Vee(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[$P.symbol(this.done,this.aborted),Rn.bold(this.msg),$P.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Rn.yellow(this.warn):Rn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
121
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,r){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(zee.hide):this.out.write(IP(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Hee(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[$P.symbol(this.done,this.aborted),Rn.bold(this.msg),$P.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Rn.yellow(this.warn):Rn.gray(this.hint)].join(" "),!this.done){this.outputText+=`
122
122
  `;for(let n=e;n<r;n++){let i,o,s="",a=this.choices[n];n===e&&e>0?o=ih.arrowUp:n===r-1&&r<this.choices.length?o=ih.arrowDown:o=" ",a.disabled?(i=this.cursor===n?Rn.gray().underline(a.title):Rn.strikethrough().gray(a.title),o=(this.cursor===n?Rn.bold().gray(ih.pointer)+" ":" ")+o):(i=this.cursor===n?Rn.cyan().underline(a.title):a.title,o=(this.cursor===n?Rn.cyan(ih.pointer)+" ":" ")+o,a.description&&this.cursor===n&&(s=` - ${a.description}`,(o.length+i.length+s.length>=this.out.columns||a.description.split(/\r?\n/).length>1)&&(s=`
123
- `+Uee(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${i}${Rn.gray(s)}
124
- `}}this.out.write(this.outputText)}};jP.exports=N0});var MP=D((ome,qP)=>{var oh=ze(),zee=Pn(),{style:LP,clear:Gee}=Rr(),{cursor:BP,erase:Wee}=Te(),L0=class extends zee{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
123
+ `+Vee(a.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${i}${Rn.gray(s)}
124
+ `}}this.out.write(this.outputText)}};jP.exports=N0});var MP=D((sme,qP)=>{var oh=ze(),Gee=Pn(),{style:LP,clear:Wee}=Rr(),{cursor:BP,erase:Kee}=Te(),L0=class extends Gee{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
125
125
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
126
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(BP.hide):this.out.write(Gee(this.outputText,this.out.columns)),super.render(),this.outputText=[LP.symbol(this.done,this.aborted),oh.bold(this.msg),LP.delimiter(this.done),this.value?this.inactive:oh.cyan().underline(this.inactive),oh.gray("/"),this.value?oh.cyan().underline(this.active):this.active].join(" "),this.out.write(Wee.line+BP.to(0)+this.outputText))}};qP.exports=L0});var en=D((sme,UP)=>{"use strict";var B0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};UP.exports=B0});var HP=D((ame,VP)=>{"use strict";var Kee=en(),q0=class extends Kee{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};VP.exports=q0});var GP=D((ume,zP)=>{"use strict";var Yee=en(),Jee=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),M0=class extends Yee{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Jee(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};zP.exports=M0});var KP=D((cme,WP)=>{"use strict";var Xee=en(),U0=class extends Xee{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};WP.exports=U0});var JP=D((lme,YP)=>{"use strict";var Zee=en(),V0=class extends Zee{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};YP.exports=V0});var ZP=D((fme,XP)=>{"use strict";var Qee=en(),H0=class extends Qee{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};XP.exports=H0});var eR=D((dme,QP)=>{"use strict";var ete=en(),z0=class extends ete{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};QP.exports=z0});var rR=D((hme,tR)=>{"use strict";var tte=en(),G0=class extends tte{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};tR.exports=G0});var iR=D((pme,nR)=>{"use strict";var rte=en(),W0=class extends rte{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};nR.exports=W0});var sR=D((mme,oR)=>{"use strict";oR.exports={DatePart:en(),Meridiem:HP(),Day:GP(),Hours:KP(),Milliseconds:JP(),Minutes:ZP(),Month:eR(),Seconds:rR(),Year:iR()}});var hR=D((gme,dR)=>{"use strict";var K0=ze(),nte=Pn(),{style:aR,clear:uR,figures:ite}=Rr(),{erase:ote,cursor:cR}=Te(),{DatePart:lR,Meridiem:ste,Day:ate,Hours:ute,Milliseconds:cte,Minutes:lte,Month:fte,Seconds:dte,Year:hte}=sR(),pte=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,fR={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new ate(t),3:t=>new fte(t),4:t=>new hte(t),5:t=>new ste(t),6:t=>new ute(t),7:t=>new lte(t),8:t=>new dte(t),9:t=>new cte(t)},mte={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},Y0=class extends nte{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(mte,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=uR("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=pte.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in fR?fR[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof lR)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
126
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,r){if(e===" ")this.value=!this.value;else if(e==="1")this.value=!0;else if(e==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(BP.hide):this.out.write(Wee(this.outputText,this.out.columns)),super.render(),this.outputText=[LP.symbol(this.done,this.aborted),oh.bold(this.msg),LP.delimiter(this.done),this.value?this.inactive:oh.cyan().underline(this.inactive),oh.gray("/"),this.value?oh.cyan().underline(this.active):this.active].join(" "),this.out.write(Kee.line+BP.to(0)+this.outputText))}};qP.exports=L0});var en=D((ame,UP)=>{"use strict";var B0=class t{constructor({token:e,date:r,parts:n,locales:i}){this.token=e,this.date=r||new Date,this.parts=n||[this],this.locales=i||{}}up(){}down(){}next(){let e=this.parts.indexOf(this);return this.parts.find((r,n)=>n>e&&r instanceof t)}setTo(e){}prev(){let e=[].concat(this.parts).reverse(),r=e.indexOf(this);return e.find((n,i)=>i>r&&n instanceof t)}toString(){return String(this.date)}};UP.exports=B0});var HP=D((ume,VP)=>{"use strict";var Yee=en(),q0=class extends Yee{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}};VP.exports=q0});var GP=D((cme,zP)=>{"use strict";var Jee=en(),Xee=t=>(t=t%10,t===1?"st":t===2?"nd":t===3?"rd":"th"),M0=class extends Jee{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+Xee(e):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:e}};zP.exports=M0});var KP=D((lme,WP)=>{"use strict";var Zee=en(),U0=class extends Zee{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}};WP.exports=U0});var JP=D((fme,YP)=>{"use strict";var Qee=en(),V0=class extends Qee{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};YP.exports=V0});var ZP=D((dme,XP)=>{"use strict";var ete=en(),H0=class extends ete{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}};XP.exports=H0});var eR=D((hme,QP)=>{"use strict";var tte=en(),z0=class extends tte{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),r=this.token.length;return r===2?String(e+1).padStart(2,"0"):r===3?this.locales.monthsShort[e]:r===4?this.locales.months[e]:String(e+1)}};QP.exports=z0});var rR=D((pme,tR)=>{"use strict";var rte=en(),G0=class extends rte{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}};tR.exports=G0});var iR=D((mme,nR)=>{"use strict";var nte=en(),W0=class extends nte{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}};nR.exports=W0});var sR=D((gme,oR)=>{"use strict";oR.exports={DatePart:en(),Meridiem:HP(),Day:GP(),Hours:KP(),Milliseconds:JP(),Minutes:ZP(),Month:eR(),Seconds:rR(),Year:iR()}});var hR=D((yme,dR)=>{"use strict";var K0=ze(),ite=Pn(),{style:aR,clear:uR,figures:ote}=Rr(),{erase:ste,cursor:cR}=Te(),{DatePart:lR,Meridiem:ate,Day:ute,Hours:cte,Milliseconds:lte,Minutes:fte,Month:dte,Seconds:hte,Year:pte}=sR(),mte=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,fR={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new ute(t),3:t=>new dte(t),4:t=>new pte(t),5:t=>new ate(t),6:t=>new cte(t),7:t=>new fte(t),8:t=>new hte(t),9:t=>new lte(t)},gte={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},Y0=class extends ite{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(gte,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=uR("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let r;for(this.parts=[];r=mte.exec(e);){let i=r.shift(),o=r.findIndex(s=>s!=null);this.parts.push(o in fR?fR[o]({token:r[o]||i,date:this.date,parts:this.parts,locales:this.locales}):r[o]||i)}let n=this.parts.reduce((i,o)=>(typeof o=="string"&&typeof i[i.length-1]=="string"?i[i.length-1]+=o:i.push(o),i),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex(e=>e instanceof lR)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
127
127
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
128
128
  `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex(r=>r instanceof lR)),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(cR.hide):this.out.write(uR(this.outputText,this.out.columns)),super.render(),this.outputText=[aR.symbol(this.done,this.aborted),K0.bold(this.msg),aR.delimiter(!1),this.parts.reduce((e,r,n)=>e.concat(n===this.cursor&&!this.done?K0.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
129
129
  `).reduce((e,r,n)=>e+`
130
- ${n?" ":ite.pointerSmall} ${K0.red().italic(r)}`,"")),this.out.write(ote.line+cR.to(0)+this.outputText))}};dR.exports=Y0});var yR=D((yme,gR)=>{var sh=ze(),gte=Pn(),{cursor:ah,erase:yte}=Te(),{style:J0,figures:Dte,clear:pR,lines:vte}=Rr(),bte=/[0-9]/,X0=t=>t!==void 0,mR=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Z0=class extends gte{constructor(e={}){super(e),this.transform=J0.render(e.style),this.msg=e.message,this.initial=X0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=X0(e.min)?e.min:-1/0,this.max=X0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=sh.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${mR(e,this.round)}`),this._value=mR(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||bte.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
130
+ ${n?" ":ote.pointerSmall} ${K0.red().italic(r)}`,"")),this.out.write(ste.line+cR.to(0)+this.outputText))}};dR.exports=Y0});var yR=D((Dme,gR)=>{var sh=ze(),yte=Pn(),{cursor:ah,erase:Dte}=Te(),{style:J0,figures:vte,clear:pR,lines:bte}=Rr(),wte=/[0-9]/,X0=t=>t!==void 0,mR=(t,e)=>{let r=Math.pow(10,e);return Math.round(t*r)/r},Z0=class extends yte{constructor(e={}){super(e),this.transform=J0.render(e.style),this.msg=e.message,this.initial=X0(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=X0(e.min)?e.min:-1/0,this.max=X0(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){!e&&e!==0?(this.placeholder=!0,this.rendered=sh.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${mR(e,this.round)}`),this._value=mR(e,this.round)),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e==="-"||e==="."&&this.float||wte.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=e!==""?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
131
131
  `),this.close()}async validate(){let e=await this.validator(this.value);typeof e=="string"&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let e=this.value;this.value=e!==""?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
132
- `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ah.down(vte(this.outputError,this.out.columns)-1)+pR(this.outputError,this.out.columns)),this.out.write(pR(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[J0.symbol(this.done,this.aborted),sh.bold(this.msg),J0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?sh[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
132
+ `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,r){if(!this.valid(e))return this.bell();let n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan",e===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ah.down(bte(this.outputError,this.out.columns)-1)+pR(this.outputError,this.out.columns)),this.out.write(pR(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[J0.symbol(this.done,this.aborted),sh.bold(this.msg),J0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?sh[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
133
133
  `).reduce((e,r,n)=>e+`
134
- ${n?" ":Dte.pointerSmall} ${sh.red().italic(r)}`,"")),this.out.write(yte.line+ah.to(0)+this.outputText+ah.save+this.outputError+ah.restore))}};gR.exports=Z0});var ev=D((Dme,bR)=>{"use strict";var tn=ze(),{cursor:wte}=Te(),_te=Pn(),{clear:DR,figures:hi,style:vR,wrap:Ete,entriesToDisplay:Cte}=Rr(),Q0=class extends _te{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=DR("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
134
+ ${n?" ":vte.pointerSmall} ${sh.red().italic(r)}`,"")),this.out.write(Dte.line+ah.to(0)+this.outputText+ah.save+this.outputError+ah.restore))}};gR.exports=Z0});var ev=D((vme,bR)=>{"use strict";var tn=ze(),{cursor:_te}=Te(),Ete=Pn(),{clear:DR,figures:hi,style:vR,wrap:Cte,entriesToDisplay:Ste}=Rr(),Q0=class extends Ete{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map((r,n)=>(typeof r=="string"&&(r={title:r,value:n}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?n:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=DR("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map(e=>!e.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(e=>e.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
135
135
  `),this.close()}submit(){let e=this.value.filter(r=>r.selected);this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
136
136
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let e=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=e),this.render()}_(e,r){if(e===" ")this.handleSpaceToggle();else if(e==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
137
137
  Instructions:
@@ -139,15 +139,15 @@ Instructions:
139
139
  ${hi.arrowLeft}/${hi.arrowRight}/[space]: Toggle selection
140
140
  `+(this.maxChoices===void 0?` a: Toggle all
141
141
  `:"")+" enter/return: Complete answer":""}renderOption(e,r,n,i){let o=(r.selected?tn.green(hi.radioOn):hi.radioOff)+" "+i+" ",s,a;return r.disabled?s=e===n?tn.gray().underline(r.title):tn.strikethrough().gray(r.title):(s=e===n?tn.cyan().underline(r.title):r.title,e===n&&r.description&&(a=` - ${r.description}`,(o.length+s.length+a.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(a=`
142
- `+Ete(r.description,{margin:o.length,width:this.out.columns})))),o+s+tn.gray(a||"")}paginateOptions(e){if(e.length===0)return tn.red("No matches for this query.");let{startIndex:r,endIndex:n}=Cte(this.cursor,e.length,this.optionsPerPage),i,o=[];for(let s=r;s<n;s++)s===r&&r>0?i=hi.arrowUp:s===n-1&&n<e.length?i=hi.arrowDown:i=" ",o.push(this.renderOption(this.cursor,e[s],s,i));return`
142
+ `+Cte(r.description,{margin:o.length,width:this.out.columns})))),o+s+tn.gray(a||"")}paginateOptions(e){if(e.length===0)return tn.red("No matches for this query.");let{startIndex:r,endIndex:n}=Ste(this.cursor,e.length,this.optionsPerPage),i,o=[];for(let s=r;s<n;s++)s===r&&r>0?i=hi.arrowUp:s===n-1&&n<e.length?i=hi.arrowDown:i=" ",o.push(this.renderOption(this.cursor,e[s],s,i));return`
143
143
  `+o.join(`
144
- `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[tn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(wte.hide),super.render();let e=[vR.symbol(this.done,this.aborted),tn.bold(this.msg),vR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=DR(e,this.out.columns)}};bR.exports=Q0});var SR=D((vme,CR)=>{"use strict";var vc=ze(),Ste=Pn(),{erase:xte,cursor:wR}=Te(),{style:tv,clear:_R,figures:rv,wrap:Fte,entriesToDisplay:Ote}=Rr(),ER=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),Ate=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),kte=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},nv=class extends Ste{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:kte(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=tv.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=_R("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ER(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),n=await r;if(this.completing!==r)return;this.suggestions=n.map((o,s,a)=>({title:Ate(a,s),value:ER(a,s),description:o.description})),this.completing=!1;let i=Math.max(n.length-1,0);this.moveSelect(Math.min(i,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
144
+ `)}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[tn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&e.push(tn.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(_te.hide),super.render();let e=[vR.symbol(this.done,this.aborted),tn.bold(this.msg),vR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=tn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.value),this.out.write(this.clear+e),this.clear=DR(e,this.out.columns)}};bR.exports=Q0});var SR=D((bme,CR)=>{"use strict";var vc=ze(),xte=Pn(),{erase:Fte,cursor:wR}=Te(),{style:tv,clear:_R,figures:rv,wrap:Ote,entriesToDisplay:Ate}=Rr(),ER=(t,e)=>t[e]&&(t[e].value||t[e].title||t[e]),kte=(t,e)=>t[e]&&(t[e].title||t[e].value||t[e]),Tte=(t,e)=>{let r=t.findIndex(n=>n.value===e||n.title===e);return r>-1?r:void 0},nv=class extends xte{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial=typeof e.initial=="number"?e.initial:Tte(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=tv.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=_R("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return typeof this._fb=="number"?e=this.choices[this._fb]:typeof this._fb=="string"&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=ER(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){let r=this.completing=this.suggest(this.input,this.choices),n=await r;if(this.completing!==r)return;this.suggestions=n.map((o,s,a)=>({title:kte(a,s),value:ER(a,s),description:o.description})),this.completing=!1;let i=Math.max(n.length-1,0);this.moveSelect(Math.min(i,this.select)),e&&e()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
145
145
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
146
146
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
147
147
  `),this.close()}_(e,r){let n=this.input.slice(0,this.cursor),i=this.input.slice(this.cursor);this.input=`${n}${e}${i}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${e}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${e}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,r,n,i){let o,s=n?rv.arrowUp:i?rv.arrowDown:" ",a=r?vc.cyan().underline(e.title):e.title;return s=(r?vc.cyan(rv.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o=`
148
- `+Fte(e.description,{margin:3,width:this.out.columns}))),s+" "+a+vc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(wR.hide):this.out.write(_R(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Ote(this.select,this.choices.length,this.limit);if(this.outputText=[tv.symbol(this.done,this.aborted,this.exited),vc.bold(this.msg),tv.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(e,r).map((i,o)=>this.renderOption(i,this.select===o+e,o===0&&e>0,o+e===r-1&&r<this.choices.length)).join(`
148
+ `+Ote(e.description,{margin:3,width:this.out.columns}))),s+" "+a+vc.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(wR.hide):this.out.write(_R(this.outputText,this.out.columns)),super.render();let{startIndex:e,endIndex:r}=Ate(this.select,this.choices.length,this.limit);if(this.outputText=[tv.symbol(this.done,this.aborted,this.exited),vc.bold(this.msg),tv.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(e,r).map((i,o)=>this.renderOption(i,this.select===o+e,o===0&&e>0,o+e===r-1&&r<this.choices.length)).join(`
149
149
  `);this.outputText+=`
150
- `+(n||vc.gray(this.fallback.title))}this.out.write(xte.line+wR.to(0)+this.outputText)}};CR.exports=nv});var AR=D((bme,OR)=>{"use strict";var $n=ze(),{cursor:Tte}=Te(),Pte=ev(),{clear:xR,style:FR,figures:ta}=Rr(),iv=class extends Pte{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=xR("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
150
+ `+(n||vc.gray(this.fallback.title))}this.out.write(Fte.line+wR.to(0)+this.outputText)}};CR.exports=nv});var AR=D((wme,OR)=>{"use strict";var $n=ze(),{cursor:Pte}=Te(),Rte=ev(),{clear:xR,style:FR,figures:ta}=Rr(),iv=class extends Rte{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=xR("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(n=>this.inputValue?!!(typeof n.title=="string"&&n.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof n.value=="string"&&n.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(n=>n===e);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,r){e===" "?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
151
151
  Instructions:
152
152
  ${ta.arrowUp}/${ta.arrowDown}: Highlight option
153
153
  ${ta.arrowLeft}/${ta.arrowRight}/[space]: Toggle selection
@@ -155,62 +155,62 @@ Instructions:
155
155
  enter/return: Complete answer
156
156
  `:""}renderCurrentInput(){return`
157
157
  Filtered results for: ${this.inputValue?this.inputValue:$n.gray("Enter something to filter")}
158
- `}renderOption(e,r,n){let i;return r.disabled?i=e===n?$n.gray().underline(r.title):$n.strikethrough().gray(r.title):i=e===n?$n.cyan().underline(r.title):r.title,(r.selected?$n.green(ta.radioOn):ta.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[$n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push($n.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Tte.hide),super.render();let e=[FR.symbol(this.done,this.aborted),$n.bold(this.msg),FR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=xR(e,this.out.columns)}};OR.exports=iv});var $R=D((wme,RR)=>{var kR=ze(),Rte=Pn(),{style:TR,clear:$te}=Rr(),{erase:Ite,cursor:PR}=Te(),ov=class extends Rte{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
158
+ `}renderOption(e,r,n){let i;return r.disabled?i=e===n?$n.gray().underline(r.title):$n.strikethrough().gray(r.title):i=e===n?$n.cyan().underline(r.title):r.title,(r.selected?$n.green(ta.radioOn):ta.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let e=[$n.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&e.push($n.yellow(this.warn)),e.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Pte.hide),super.render();let e=[FR.symbol(this.done,this.aborted),$n.bold(this.msg),FR.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(e+=$n.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),e+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+e),this.clear=xR(e,this.out.columns)}};OR.exports=iv});var $R=D((_me,RR)=>{var kR=ze(),$te=Pn(),{style:TR,clear:Ite}=Rr(),{erase:jte,cursor:PR}=Te(),ov=class extends $te{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
159
159
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
160
- `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(PR.hide):this.out.write($te(this.outputText,this.out.columns)),super.render(),this.outputText=[TR.symbol(this.done,this.aborted),kR.bold(this.msg),TR.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:kR.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Ite.line+PR.to(0)+this.outputText))}};RR.exports=ov});var jR=D((_me,IR)=>{"use strict";IR.exports={TextPrompt:RP(),SelectPrompt:NP(),TogglePrompt:MP(),DatePrompt:hR(),NumberPrompt:yR(),MultiselectPrompt:ev(),AutocompletePrompt:SR(),AutocompleteMultiselectPrompt:AR(),ConfirmPrompt:$R()}});var LR=D(NR=>{"use strict";var Jt=NR,jte=jR(),uh=t=>t;function rn(t,e,r={}){return new Promise((n,i)=>{let o=new jte[t](e),s=r.onAbort||uh,a=r.onSubmit||uh,u=r.onExit||uh;o.on("state",e.onState||uh),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Jt.text=t=>rn("TextPrompt",t);Jt.password=t=>(t.style="password",Jt.text(t));Jt.invisible=t=>(t.style="invisible",Jt.text(t));Jt.number=t=>rn("NumberPrompt",t);Jt.date=t=>rn("DatePrompt",t);Jt.confirm=t=>rn("ConfirmPrompt",t);Jt.list=t=>{let e=t.separator||",";return rn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Jt.toggle=t=>rn("TogglePrompt",t);Jt.select=t=>rn("SelectPrompt",t);Jt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Jt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Nte=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Jt.autocomplete=t=>(t.suggest=t.suggest||Nte,t.choices=[].concat(t.choices||[]),rn("AutocompletePrompt",t))});var MR=D((Cme,qR)=>{"use strict";var sv=LR(),Lte=["suggest","format","onState","validate","onRender","type"],BR=()=>{};async function pi(t=[],{onSubmit:e=BR,onCancel:r=BR}={}){let n={},i=pi._override||{};t=[].concat(t);let o,s,a,u,c,l,f=async(h,d,p=!1)=>{if(!(!p&&h.validate&&h.validate(d)!==!0))return h.format?await h.format(d,n):d};for(s of t)if({name:u,type:c}=s,typeof c=="function"&&(c=await c(o,{...n},s),s.type=c),!!c){for(let h in s){if(Lte.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},l):d}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=s,sv[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=await f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=pi._injected?Bte(pi._injected,s.initial):await sv[c](s),n[u]=o=await f(s,o,!0),a=await e(s,o,n)}catch{a=!await r(s,n)}if(a)return n}return n}function Bte(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function qte(t){pi._injected=(pi._injected||[]).concat(t)}function Mte(t){pi._override=Object.assign({},t)}qR.exports=Object.assign(pi,{prompt:pi,prompts:sv,inject:qte,override:Mte})});var ch=D((Sme,UR)=>{function Ute(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return!1;if(t[e]>r[e])return!0}return!1}UR.exports=Ute("8.6.0")?hP():MR()});var uc=D(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.logSuccess=Xt.logPrompt=Xt.logger=Xt.output=void 0;var av=(Cn(),ke(En)),po=(XD(),ke(JD)),mo=av.__importDefault(zs()),Vte=p3(),VR={colors:mo.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Xt.output=(0,Vte.isInteractive)()?new po.TTYOutputStrategy(VR):new po.StreamOutputStrategy(VR);Xt.logger=(0,po.createDefaultLogger)({output:Xt.output,formatterOptions:{titleize:!1,tags:new Map([[po.LOGGER_LEVELS.DEBUG,mo.default.log.DEBUG("[debug]")],[po.LOGGER_LEVELS.INFO,mo.default.log.INFO("[info]")],[po.LOGGER_LEVELS.WARN,mo.default.log.WARN("[warn]")],[po.LOGGER_LEVELS.ERROR,mo.default.log.ERROR("[error]")]])}});async function Hte(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>av.__importStar((XD(),ke(JD)))),{prompt:n}=await Promise.resolve().then(()=>av.__importStar(ch()));return Xt.logger.log({msg:`${mo.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Xt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Xt.logPrompt=Hte;function zte(t){Xt.logger.msg(`${mo.default.success("[success]")} ${t}`)}Xt.logSuccess=zte});var lh=D(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.resolveNode=ra.requireTS=void 0;var Gte=Ms(),Wte=require("fs"),Kte=require("path"),Yte=(t,e)=>{let r=(0,Kte.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,Gte.readFileSync)(o,"utf8");o.endsWith(".ts")?a=t.transpileModule(a,{fileName:o,compilerOptions:{module:t.ModuleKind.CommonJS,moduleResolution:t.ModuleResolutionKind.NodeJs,esModuleInterop:!0,strict:!0,target:t.ScriptTarget.ES2017},reportDiagnostics:!0}).outputText:a=a.replace(/export\s+\w+\s+(\w+)/gm,"exports.$1"),(s=i._compile)===null||s===void 0||s.call(i,a,o)};let n=require(r);return delete require.extensions[".ts"],n};ra.requireTS=Yte;function Jte(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,Wte.existsSync)(n)?n:null}}ra.resolveNode=Jte});var HR={};mn(HR,{default:()=>Xte});var Xte,zR=ut(()=>{Xte={}});var GR=D(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.buildXmlElement=nn.writeXML=nn.parseXML=nn.readXML=void 0;var Zte=(Cn(),ke(En)),Qte=Ms(),bc=Zte.__importDefault((zR(),ke(HR)));async function ere(t){var e;try{let r=await(0,Qte.readFile)(t,{encoding:"utf-8"});try{return await bc.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}nn.readXML=ere;function tre(t,e){let r=e!==void 0?new bc.default.Parser({...e}):new bc.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}nn.parseXML=tre;async function rre(t){return new Promise(e=>{let n=new bc.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}nn.writeXML=rre;function nre(t,e){return new bc.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}nn.buildXmlElement=nre});var XR=D(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.getAllElements=Ce.getFilePath=Ce.getAssets=Ce.getJSModules=Ce.getPluginType=Ce.getPlatformElement=Ce.getPluginPlatform=Ce.printPlugins=Ce.fixName=Ce.getDependencies=Ce.resolvePlugin=Ce.getPlugins=Ce.getIncludedPluginPackages=void 0;var ire=(Cn(),ke(En)),ore=Ms(),uv=require("path"),na=ire.__importDefault(zs()),sre=zd(),are=uc(),WR=lh(),ure=GR();function KR(t,e){var r,n,i,o;let{extConfig:s}=t.app;switch(e){case"android":return(n=(r=s.android)===null||r===void 0?void 0:r.includePlugins)!==null&&n!==void 0?n:s.includePlugins;case"ios":return(o=(i=s.ios)===null||i===void 0?void 0:i.includePlugins)!==null&&o!==void 0?o:s.includePlugins}}Ce.getIncludedPluginPackages=KR;async function cre(t,e){var r;let n=(r=KR(t,e))!==null&&r!==void 0?r:JR(t);return(await Promise.all(n.map(async o=>YR(t,o)))).filter(o=>!!o)}Ce.getPlugins=cre;async function YR(t,e){try{let r=(0,WR.resolveNode)(t.app.rootDir,e,"package.json");r||(0,sre.fatal)(`Unable to find ${na.default.strong(`node_modules/${e}`)}.
161
- Are you sure ${na.default.strong(e)} is installed?`);let n=(0,uv.dirname)(r),i=await(0,ore.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:cv(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,uv.join)(n,"plugin.xml"),s=await(0,ure.readXML)(o);return{id:e,name:cv(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ce.resolvePlugin=YR;function JR(t){var e,r;return[...Object.keys((e=t.app.package.dependencies)!==null&&e!==void 0?e:{}),...Object.keys((r=t.app.package.devDependencies)!==null&&r!==void 0?r:{})]}Ce.getDependencies=JR;function cv(t){return t=t.replace(/\//g,"_").replace(/-/g,"_").replace(/@/g,"").replace(/_\w/g,e=>e[1].toUpperCase()),t.charAt(0).toUpperCase()+t.slice(1)}Ce.fixName=cv;function lre(t,e,r="capacitor"){if(t.length===0)return;let n,i=t.length===1?"":"s";switch(r){case"cordova":n=`Found ${t.length} Cordova plugin${i} for ${na.default.strong(e)}:
160
+ `),this.close()}_(e,r){return e.toLowerCase()==="y"?(this.value=!0,this.submit()):e.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(PR.hide):this.out.write(Ite(this.outputText,this.out.columns)),super.render(),this.outputText=[TR.symbol(this.done,this.aborted),kR.bold(this.msg),TR.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:kR.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(jte.line+PR.to(0)+this.outputText))}};RR.exports=ov});var jR=D((Eme,IR)=>{"use strict";IR.exports={TextPrompt:RP(),SelectPrompt:NP(),TogglePrompt:MP(),DatePrompt:hR(),NumberPrompt:yR(),MultiselectPrompt:ev(),AutocompletePrompt:SR(),AutocompleteMultiselectPrompt:AR(),ConfirmPrompt:$R()}});var LR=D(NR=>{"use strict";var Jt=NR,Nte=jR(),uh=t=>t;function rn(t,e,r={}){return new Promise((n,i)=>{let o=new Nte[t](e),s=r.onAbort||uh,a=r.onSubmit||uh,u=r.onExit||uh;o.on("state",e.onState||uh),o.on("submit",c=>n(a(c))),o.on("exit",c=>n(u(c))),o.on("abort",c=>i(s(c)))})}Jt.text=t=>rn("TextPrompt",t);Jt.password=t=>(t.style="password",Jt.text(t));Jt.invisible=t=>(t.style="invisible",Jt.text(t));Jt.number=t=>rn("NumberPrompt",t);Jt.date=t=>rn("DatePrompt",t);Jt.confirm=t=>rn("ConfirmPrompt",t);Jt.list=t=>{let e=t.separator||",";return rn("TextPrompt",t,{onSubmit:r=>r.split(e).map(n=>n.trim())})};Jt.toggle=t=>rn("TogglePrompt",t);Jt.select=t=>rn("SelectPrompt",t);Jt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("MultiselectPrompt",t,{onAbort:e,onSubmit:e})};Jt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let e=r=>r.filter(n=>n.selected).map(n=>n.value);return rn("AutocompleteMultiselectPrompt",t,{onAbort:e,onSubmit:e})};var Lte=(t,e)=>Promise.resolve(e.filter(r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Jt.autocomplete=t=>(t.suggest=t.suggest||Lte,t.choices=[].concat(t.choices||[]),rn("AutocompletePrompt",t))});var MR=D((Sme,qR)=>{"use strict";var sv=LR(),Bte=["suggest","format","onState","validate","onRender","type"],BR=()=>{};async function pi(t=[],{onSubmit:e=BR,onCancel:r=BR}={}){let n={},i=pi._override||{};t=[].concat(t);let o,s,a,u,c,l,f=async(h,d,p=!1)=>{if(!(!p&&h.validate&&h.validate(d)!==!0))return h.format?await h.format(d,n):d};for(s of t)if({name:u,type:c}=s,typeof c=="function"&&(c=await c(o,{...n},s),s.type=c),!!c){for(let h in s){if(Bte.includes(h))continue;let d=s[h];s[h]=typeof d=="function"?await d(o,{...n},l):d}if(l=s,typeof s.message!="string")throw new Error("prompt message is required");if({name:u,type:c}=s,sv[c]===void 0)throw new Error(`prompt type (${c}) is not defined`);if(i[s.name]!==void 0&&(o=await f(s,i[s.name]),o!==void 0)){n[u]=o;continue}try{o=pi._injected?qte(pi._injected,s.initial):await sv[c](s),n[u]=o=await f(s,o,!0),a=await e(s,o,n)}catch{a=!await r(s,n)}if(a)return n}return n}function qte(t,e){let r=t.shift();if(r instanceof Error)throw r;return r===void 0?e:r}function Mte(t){pi._injected=(pi._injected||[]).concat(t)}function Ute(t){pi._override=Object.assign({},t)}qR.exports=Object.assign(pi,{prompt:pi,prompts:sv,inject:Mte,override:Ute})});var ch=D((xme,UR)=>{function Vte(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let e=0,r=process.versions.node.split(".").map(Number);for(;e<t.length;e++){if(r[e]>t[e])return!1;if(t[e]>r[e])return!0}return!1}UR.exports=Vte("8.6.0")?hP():MR()});var uc=D(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.logSuccess=Xt.logPrompt=Xt.logger=Xt.output=void 0;var av=(Cn(),ke(En)),po=(XD(),ke(JD)),mo=av.__importDefault(zs()),Hte=p3(),VR={colors:mo.default,stream:process.argv.includes("--json")?process.stderr:process.stdout};Xt.output=(0,Hte.isInteractive)()?new po.TTYOutputStrategy(VR):new po.StreamOutputStrategy(VR);Xt.logger=(0,po.createDefaultLogger)({output:Xt.output,formatterOptions:{titleize:!1,tags:new Map([[po.LOGGER_LEVELS.DEBUG,mo.default.log.DEBUG("[debug]")],[po.LOGGER_LEVELS.INFO,mo.default.log.INFO("[info]")],[po.LOGGER_LEVELS.WARN,mo.default.log.WARN("[warn]")],[po.LOGGER_LEVELS.ERROR,mo.default.log.ERROR("[error]")]])}});async function zte(t,e){let{wordWrap:r}=await Promise.resolve().then(()=>av.__importStar((XD(),ke(JD)))),{prompt:n}=await Promise.resolve().then(()=>av.__importStar(ch()));return Xt.logger.log({msg:`${mo.default.input("[?]")} ${r(t,{indentation:4})}`,logger:Xt.logger,format:!1}),n(e,{onCancel:()=>process.exit(1)})}Xt.logPrompt=zte;function Gte(t){Xt.logger.msg(`${mo.default.success("[success]")} ${t}`)}Xt.logSuccess=Gte});var lh=D(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.resolveNode=ra.requireTS=void 0;var Wte=Ms(),Kte=require("fs"),Yte=require("path"),Jte=(t,e)=>{let r=(0,Yte.resolve)(e);delete require.cache[r],require.extensions[".ts"]=(i,o)=>{var s;let a=(0,Wte.readFileSync)(o,"utf8");o.endsWith(".ts")?a=t.transpileModule(a,{fileName:o,compilerOptions:{module:t.ModuleKind.CommonJS,moduleResolution:t.ModuleResolutionKind.NodeJs,esModuleInterop:!0,strict:!0,target:t.ScriptTarget.ES2017},reportDiagnostics:!0}).outputText:a=a.replace(/export\s+\w+\s+(\w+)/gm,"exports.$1"),(s=i._compile)===null||s===void 0||s.call(i,a,o)};let n=require(r);return delete require.extensions[".ts"],n};ra.requireTS=Jte;function Xte(t,...e){try{return require.resolve(e.join("/"),{paths:[t]})}catch{let n=[t,"node_modules",...e].join("/");return(0,Kte.existsSync)(n)?n:null}}ra.resolveNode=Xte});var HR={};mn(HR,{default:()=>Zte});var Zte,zR=ut(()=>{Zte={}});var GR=D(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.buildXmlElement=nn.writeXML=nn.parseXML=nn.readXML=void 0;var Qte=(Cn(),ke(En)),ere=Ms(),bc=Qte.__importDefault((zR(),ke(HR)));async function tre(t){var e;try{let r=await(0,ere.readFile)(t,{encoding:"utf-8"});try{return await bc.default.parseStringPromise(r)}catch(n){throw`Error parsing: ${t}, ${(e=n.stack)!==null&&e!==void 0?e:n}`}}catch{throw`Unable to read: ${t}`}}nn.readXML=tre;function rre(t,e){let r=e!==void 0?new bc.default.Parser({...e}):new bc.default.Parser,n;return r.parseString(t,(i,o)=>{i||(n=o)}),n}nn.parseXML=rre;async function nre(t){return new Promise(e=>{let n=new bc.default.Builder({headless:!0,explicitRoot:!1,rootName:"deleteme"}).buildObject(t);n=n.replace("<deleteme>","").replace("</deleteme>",""),e(n)})}nn.writeXML=nre;function ire(t,e){return new bc.default.Builder({headless:!0,explicitRoot:!1,rootName:e}).buildObject(t)}nn.buildXmlElement=ire});var XR=D(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.getAllElements=Ce.getFilePath=Ce.getAssets=Ce.getJSModules=Ce.getPluginType=Ce.getPlatformElement=Ce.getPluginPlatform=Ce.printPlugins=Ce.fixName=Ce.getDependencies=Ce.resolvePlugin=Ce.getPlugins=Ce.getIncludedPluginPackages=void 0;var ore=(Cn(),ke(En)),sre=Ms(),uv=require("path"),na=ore.__importDefault(zs()),are=zd(),ure=uc(),WR=lh(),cre=GR();function KR(t,e){var r,n,i,o;let{extConfig:s}=t.app;switch(e){case"android":return(n=(r=s.android)===null||r===void 0?void 0:r.includePlugins)!==null&&n!==void 0?n:s.includePlugins;case"ios":return(o=(i=s.ios)===null||i===void 0?void 0:i.includePlugins)!==null&&o!==void 0?o:s.includePlugins}}Ce.getIncludedPluginPackages=KR;async function lre(t,e){var r;let n=(r=KR(t,e))!==null&&r!==void 0?r:JR(t);return(await Promise.all(n.map(async o=>YR(t,o)))).filter(o=>!!o)}Ce.getPlugins=lre;async function YR(t,e){try{let r=(0,WR.resolveNode)(t.app.rootDir,e,"package.json");r||(0,are.fatal)(`Unable to find ${na.default.strong(`node_modules/${e}`)}.
161
+ Are you sure ${na.default.strong(e)} is installed?`);let n=(0,uv.dirname)(r),i=await(0,sre.readJSON)(r);if(!i)return null;if(i.capacitor)return{id:e,name:cv(e),version:i.version,rootPath:n,repository:i.repository,manifest:i.capacitor};let o=(0,uv.join)(n,"plugin.xml"),s=await(0,cre.readXML)(o);return{id:e,name:cv(e),version:i.version,rootPath:n,repository:i.repository,xml:s.plugin}}catch{}return null}Ce.resolvePlugin=YR;function JR(t){var e,r;return[...Object.keys((e=t.app.package.dependencies)!==null&&e!==void 0?e:{}),...Object.keys((r=t.app.package.devDependencies)!==null&&r!==void 0?r:{})]}Ce.getDependencies=JR;function cv(t){return t=t.replace(/\//g,"_").replace(/-/g,"_").replace(/@/g,"").replace(/_\w/g,e=>e[1].toUpperCase()),t.charAt(0).toUpperCase()+t.slice(1)}Ce.fixName=cv;function fre(t,e,r="capacitor"){if(t.length===0)return;let n,i=t.length===1?"":"s";switch(r){case"cordova":n=`Found ${t.length} Cordova plugin${i} for ${na.default.strong(e)}:
162
162
  `;break;case"incompatible":n=`Found ${t.length} incompatible Cordova plugin${i} for ${na.default.strong(e)}, skipped install:
163
163
  `;break;case"capacitor":n=`Found ${t.length} Capacitor plugin${i} for ${na.default.strong(e)}:
164
164
  `;break}n+=t.map(o=>`${o.id}${na.default.weak(`@${o.version}`)}`).join(`
165
- `),are.logger.info(n)}Ce.printPlugins=lre;function lv(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ce.getPluginPlatform=lv;function fre(t,e,r){let n=lv(t,e);if(n){let i=n[r];if(i)return i}return[]}Ce.getPlatformElement=fre;function dre(t,e){var r,n,i,o;switch(e){case"ios":return(n=(r=t.ios)===null||r===void 0?void 0:r.type)!==null&&n!==void 0?n:0;case"android":return(o=(i=t.android)===null||i===void 0?void 0:i.type)!==null&&o!==void 0?o:0}return 0}Ce.getPluginType=dre;function hre(t,e){return fv(t,e,"js-module")}Ce.getJSModules=hre;function pre(t,e){return fv(t,e,"asset")}Ce.getAssets=pre;function mre(t,e,r){if(r.startsWith("node_modules")){let n=r.split("/").slice(1);n[0].startsWith("@")&&(n=[n[0]+"/"+n[1],...n.slice(2)]);let i=(0,WR.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,uv.join)(e.rootPath,r)}Ce.getFilePath=mre;function fv(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=lv(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ce.getAllElements=fv});var ZR={};mn(ZR,{default:()=>gre});var gre,QR=ut(()=>{gre={}});var fh=D(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.isInstalled=mi.getCommandOutput=mi.runCommand=void 0;var dv=(QR(),ke(ZR));async function e$(t,e,r={}){let n=new dv.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof dv.SubprocessError?i.output?i.output:i.code?i.code:i.error?i.error.message:"Unknown error":i}}mi.runCommand=e$;async function yre(t,e,r={}){try{return(await e$(t,e,r)).trim()}catch{return null}}mi.getCommandOutput=yre;async function Dre(t){try{await(0,dv.which)(t)}catch{return!1}return!0}mi.isInstalled=Dre});var wc=D((Tme,t$)=>{var vre="2.0.0",bre=Number.MAX_SAFE_INTEGER||9007199254740991,wre=16,_re=250,Ere=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:wre,MAX_SAFE_BUILD_LENGTH:_re,MAX_SAFE_INTEGER:bre,RELEASE_TYPES:Ere,SEMVER_SPEC_VERSION:vre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var _c=D((Pme,r$)=>{var Cre=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};r$.exports=Cre});var ia=D((In,n$)=>{var{MAX_SAFE_COMPONENT_LENGTH:hv,MAX_SAFE_BUILD_LENGTH:Sre,MAX_LENGTH:xre}=wc(),Fre=_c();In=n$.exports={};var Ore=In.re=[],Are=In.safeRe=[],z=In.src=[],G=In.t={},kre=0,pv="[a-zA-Z0-9-]",Tre=[["\\s",1],["\\d",xre],[pv,Sre]],Pre=t=>{for(let[e,r]of Tre)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ne=(t,e,r)=>{let n=Pre(e),i=kre++;Fre(t,i,e),G[t]=i,z[i]=e,Ore[i]=new RegExp(e,r?"g":void 0),Are[i]=new RegExp(n,r?"g":void 0)};ne("NUMERICIDENTIFIER","0|[1-9]\\d*");ne("NUMERICIDENTIFIERLOOSE","\\d+");ne("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${pv}*`);ne("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);ne("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);ne("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);ne("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);ne("BUILDIDENTIFIER",`${pv}+`);ne("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);ne("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);ne("FULL",`^${z[G.FULLPLAIN]}$`);ne("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);ne("LOOSE",`^${z[G.LOOSEPLAIN]}$`);ne("GTLT","((?:<|>)?=?)");ne("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ne("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);ne("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);ne("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);ne("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);ne("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);ne("COERCEPLAIN",`(^|[^\\d])(\\d{1,${hv}})(?:\\.(\\d{1,${hv}}))?(?:\\.(\\d{1,${hv}}))?`);ne("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);ne("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);ne("COERCERTL",z[G.COERCE],!0);ne("COERCERTLFULL",z[G.COERCEFULL],!0);ne("LONETILDE","(?:~>?)");ne("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);In.tildeTrimReplace="$1~";ne("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);ne("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);ne("LONECARET","(?:\\^)");ne("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);In.caretTrimReplace="$1^";ne("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);ne("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);ne("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);ne("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);ne("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);In.comparatorTrimReplace="$1$2$3";ne("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);ne("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);ne("STAR","(<|>)?=?\\s*\\*");ne("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ne("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var dh=D((Rme,i$)=>{var Rre=Object.freeze({loose:!0}),$re=Object.freeze({}),Ire=t=>t?typeof t!="object"?Rre:t:$re;i$.exports=Ire});var mv=D(($me,a$)=>{var o$=/^[0-9]+$/,s$=(t,e)=>{let r=o$.test(t),n=o$.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},jre=(t,e)=>s$(e,t);a$.exports={compareIdentifiers:s$,rcompareIdentifiers:jre}});var St=D((Ime,f$)=>{var hh=_c(),{MAX_LENGTH:u$,MAX_SAFE_INTEGER:ph}=wc(),{safeRe:c$,t:l$}=ia(),Nre=dh(),{compareIdentifiers:oa}=mv(),gv=class t{constructor(e,r){if(r=Nre(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>u$)throw new TypeError(`version is longer than ${u$} characters`);hh("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?c$[l$.LOOSE]:c$[l$.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ph||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ph||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ph||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<ph)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(hh("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),oa(this.major,e.major)||oa(this.minor,e.minor)||oa(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(hh("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return oa(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(hh("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return oa(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),oa(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};f$.exports=gv});var go=D((jme,h$)=>{var d$=St(),Lre=(t,e,r=!1)=>{if(t instanceof d$)return t;try{return new d$(t,e)}catch(n){if(!r)return null;throw n}};h$.exports=Lre});var m$=D((Nme,p$)=>{var Bre=go(),qre=(t,e)=>{let r=Bre(t,e);return r?r.version:null};p$.exports=qre});var y$=D((Lme,g$)=>{var Mre=go(),Ure=(t,e)=>{let r=Mre(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};g$.exports=Ure});var b$=D((Bme,v$)=>{var D$=St(),Vre=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new D$(t instanceof D$?t.version:t,r).inc(e,n,i).version}catch{return null}};v$.exports=Vre});var E$=D((qme,_$)=>{var w$=go(),Hre=(t,e)=>{let r=w$(t,null,!0),n=w$(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":s.patch?"patch":s.minor?"minor":"major";let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};_$.exports=Hre});var S$=D((Mme,C$)=>{var zre=St(),Gre=(t,e)=>new zre(t,e).major;C$.exports=Gre});var F$=D((Ume,x$)=>{var Wre=St(),Kre=(t,e)=>new Wre(t,e).minor;x$.exports=Kre});var A$=D((Vme,O$)=>{var Yre=St(),Jre=(t,e)=>new Yre(t,e).patch;O$.exports=Jre});var T$=D((Hme,k$)=>{var Xre=go(),Zre=(t,e)=>{let r=Xre(t,e);return r&&r.prerelease.length?r.prerelease:null};k$.exports=Zre});var _r=D((zme,R$)=>{var P$=St(),Qre=(t,e,r)=>new P$(t,r).compare(new P$(e,r));R$.exports=Qre});var I$=D((Gme,$$)=>{var ene=_r(),tne=(t,e,r)=>ene(e,t,r);$$.exports=tne});var N$=D((Wme,j$)=>{var rne=_r(),nne=(t,e)=>rne(t,e,!0);j$.exports=nne});var mh=D((Kme,B$)=>{var L$=St(),ine=(t,e,r)=>{let n=new L$(t,r),i=new L$(e,r);return n.compare(i)||n.compareBuild(i)};B$.exports=ine});var M$=D((Yme,q$)=>{var one=mh(),sne=(t,e)=>t.sort((r,n)=>one(r,n,e));q$.exports=sne});var V$=D((Jme,U$)=>{var ane=mh(),une=(t,e)=>t.sort((r,n)=>ane(n,r,e));U$.exports=une});var Ec=D((Xme,H$)=>{var cne=_r(),lne=(t,e,r)=>cne(t,e,r)>0;H$.exports=lne});var gh=D((Zme,z$)=>{var fne=_r(),dne=(t,e,r)=>fne(t,e,r)<0;z$.exports=dne});var yv=D((Qme,G$)=>{var hne=_r(),pne=(t,e,r)=>hne(t,e,r)===0;G$.exports=pne});var Dv=D((ege,W$)=>{var mne=_r(),gne=(t,e,r)=>mne(t,e,r)!==0;W$.exports=gne});var yh=D((tge,K$)=>{var yne=_r(),Dne=(t,e,r)=>yne(t,e,r)>=0;K$.exports=Dne});var Dh=D((rge,Y$)=>{var vne=_r(),bne=(t,e,r)=>vne(t,e,r)<=0;Y$.exports=bne});var vv=D((nge,J$)=>{var wne=yv(),_ne=Dv(),Ene=Ec(),Cne=yh(),Sne=gh(),xne=Dh(),Fne=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return wne(t,r,n);case"!=":return _ne(t,r,n);case">":return Ene(t,r,n);case">=":return Cne(t,r,n);case"<":return Sne(t,r,n);case"<=":return xne(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};J$.exports=Fne});var Z$=D((ige,X$)=>{var One=St(),Ane=go(),{safeRe:vh,t:bh}=ia(),kne=(t,e)=>{if(t instanceof One)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?vh[bh.COERCEFULL]:vh[bh.COERCE]);else{let u=e.includePrerelease?vh[bh.COERCERTLFULL]:vh[bh.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Ane(`${n}.${i}.${o}${s}${a}`,e)};X$.exports=kne});var eI=D((oge,Q$)=>{var bv=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};Q$.exports=bv});var Er=D((sge,iI)=>{var Tne=/\s+/g,wv=class t{constructor(e,r){if(r=Rne(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof _v)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Tne," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!rI(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&qne(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Lne)|(this.options.loose&&Bne))+":"+e,i=tI.get(n);if(i)return i;let o=this.options.loose,s=o?Zt[$t.HYPHENRANGELOOSE]:Zt[$t.HYPHENRANGE];e=e.replace(s,Jne(this.options.includePrerelease)),$e("hyphen replace",e),e=e.replace(Zt[$t.COMPARATORTRIM],Ine),$e("comparator trim",e),e=e.replace(Zt[$t.TILDETRIM],jne),$e("tilde trim",e),e=e.replace(Zt[$t.CARETTRIM],Nne),$e("caret trim",e);let a=e.split(" ").map(f=>Mne(f,this.options)).join(" ").split(/\s+/).map(f=>Yne(f,this.options));o&&(a=a.filter(f=>($e("loose invalid filter",f,this.options),!!f.match(Zt[$t.COMPARATORLOOSE])))),$e("range list",a);let u=new Map,c=a.map(f=>new _v(f,this.options));for(let f of c){if(rI(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return tI.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>nI(n,r)&&e.set.some(i=>nI(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new $ne(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Xne(this.set[r],e,this.options))return!0;return!1}};iI.exports=wv;var Pne=eI(),tI=new Pne,Rne=dh(),_v=Cc(),$e=_c(),$ne=St(),{safeRe:Zt,t:$t,comparatorTrimReplace:Ine,tildeTrimReplace:jne,caretTrimReplace:Nne}=ia(),{FLAG_INCLUDE_PRERELEASE:Lne,FLAG_LOOSE:Bne}=wc(),rI=t=>t.value==="<0.0.0-0",qne=t=>t.value==="",nI=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},Mne=(t,e)=>($e("comp",t,e),t=Hne(t,e),$e("caret",t),t=Une(t,e),$e("tildes",t),t=Gne(t,e),$e("xrange",t),t=Kne(t,e),$e("stars",t),t),It=t=>!t||t.toLowerCase()==="x"||t==="*",Une=(t,e)=>t.trim().split(/\s+/).map(r=>Vne(r,e)).join(" "),Vne=(t,e)=>{let r=e.loose?Zt[$t.TILDELOOSE]:Zt[$t.TILDE];return t.replace(r,(n,i,o,s,a)=>{$e("tilde",t,n,i,o,s,a);let u;return It(i)?u="":It(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:It(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?($e("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,$e("tilde return",u),u})},Hne=(t,e)=>t.trim().split(/\s+/).map(r=>zne(r,e)).join(" "),zne=(t,e)=>{$e("caret",t,e);let r=e.loose?Zt[$t.CARETLOOSE]:Zt[$t.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{$e("caret",t,i,o,s,a,u);let c;return It(o)?c="":It(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:It(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?($e("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):($e("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),$e("caret return",c),c})},Gne=(t,e)=>($e("replaceXRanges",t,e),t.split(/\s+/).map(r=>Wne(r,e)).join(" ")),Wne=(t,e)=>{t=t.trim();let r=e.loose?Zt[$t.XRANGELOOSE]:Zt[$t.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{$e("xRange",t,n,i,o,s,a,u);let c=It(o),l=c||It(s),f=l||It(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),$e("xRange return",n),n})},Kne=(t,e)=>($e("replaceStars",t,e),t.trim().replace(Zt[$t.STAR],"")),Yne=(t,e)=>($e("replaceGTE0",t,e),t.trim().replace(Zt[e.includePrerelease?$t.GTE0PRE:$t.GTE0],"")),Jne=t=>(e,r,n,i,o,s,a,u,c,l,f,h)=>(It(n)?r="":It(i)?r=`>=${n}.0.0${t?"-0":""}`:It(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,It(c)?u="":It(l)?u=`<${+c+1}.0.0-0`:It(f)?u=`<${c}.${+l+1}.0-0`:h?u=`<=${c}.${l}.${f}-${h}`:t?u=`<${c}.${l}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Xne=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if($e(t[n].semver),t[n].semver!==_v.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Cc=D((age,lI)=>{var Sc=Symbol("SemVer ANY"),Sv=class t{static get ANY(){return Sc}constructor(e,r){if(r=oI(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Cv("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Sc?this.value="":this.value=this.operator+this.semver.version,Cv("comp",this)}parse(e){let r=this.options.loose?sI[aI.COMPARATORLOOSE]:sI[aI.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new uI(n[2],this.options.loose):this.semver=Sc}toString(){return this.value}test(e){if(Cv("Comparator.test",e,this.options.loose),this.semver===Sc||e===Sc)return!0;if(typeof e=="string")try{e=new uI(e,this.options)}catch{return!1}return Ev(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new cI(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new cI(this.value,r).test(e.semver):(r=oI(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Ev(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ev(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};lI.exports=Sv;var oI=dh(),{safeRe:sI,t:aI}=ia(),Ev=vv(),Cv=_c(),uI=St(),cI=Er()});var xc=D((uge,fI)=>{var Zne=Er(),Qne=(t,e,r)=>{try{e=new Zne(e,r)}catch{return!1}return e.test(t)};fI.exports=Qne});var hI=D((cge,dI)=>{var eie=Er(),tie=(t,e)=>new eie(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));dI.exports=tie});var mI=D((lge,pI)=>{var rie=St(),nie=Er(),iie=(t,e,r)=>{let n=null,i=null,o=null;try{o=new nie(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new rie(n,r))}),n};pI.exports=iie});var yI=D((fge,gI)=>{var oie=St(),sie=Er(),aie=(t,e,r)=>{let n=null,i=null,o=null;try{o=new sie(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new oie(n,r))}),n};gI.exports=aie});var bI=D((dge,vI)=>{var xv=St(),uie=Er(),DI=Ec(),cie=(t,e)=>{t=new uie(t,e);let r=new xv("0.0.0");if(t.test(r)||(r=new xv("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new xv(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||DI(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||DI(r,o))&&(r=o)}return r&&t.test(r)?r:null};vI.exports=cie});var _I=D((hge,wI)=>{var lie=Er(),fie=(t,e)=>{try{return new lie(t,e).range||"*"}catch{return null}};wI.exports=fie});var wh=D((pge,xI)=>{var die=St(),SI=Cc(),{ANY:hie}=SI,pie=Er(),mie=xc(),EI=Ec(),CI=gh(),gie=Dh(),yie=yh(),Die=(t,e,r,n)=>{t=new die(t,n),e=new pie(e,n);let i,o,s,a,u;switch(r){case">":i=EI,o=gie,s=CI,a=">",u=">=";break;case"<":i=CI,o=yie,s=EI,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(mie(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],f=null,h=null;if(l.forEach(d=>{d.semver===hie&&(d=new SI(">=0.0.0")),f=f||d,h=h||d,i(d.semver,f.semver,n)?f=d:s(d.semver,h.semver,n)&&(h=d)}),f.operator===a||f.operator===u||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===u&&s(t,h.semver))return!1}return!0};xI.exports=Die});var OI=D((mge,FI)=>{var vie=wh(),bie=(t,e,r)=>vie(t,e,">",r);FI.exports=bie});var kI=D((gge,AI)=>{var wie=wh(),_ie=(t,e,r)=>wie(t,e,"<",r);AI.exports=_ie});var RI=D((yge,PI)=>{var TI=Er(),Eie=(t,e,r)=>(t=new TI(t,r),e=new TI(e,r),t.intersects(e,r));PI.exports=Eie});var II=D((Dge,$I)=>{var Cie=xc(),Sie=_r();$I.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,f)=>Sie(l,f,r));for(let l of s)Cie(l,e,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,f]of n)l===f?a.push(l):!f&&l===s[0]?a.push("*"):f?l===s[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var kv=D((vge,qI)=>{var jI=Er(),Ov=Cc(),{ANY:Fv}=Ov,Fc=xc(),Av=_r(),xie=(t,e,r={})=>{if(t===e)return!0;t=new jI(t,r),e=new jI(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=Oie(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Fie=[new Ov(">=0.0.0-0")],NI=[new Ov(">=0.0.0")],Oie=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Fv){if(e.length===1&&e[0].semver===Fv)return!0;r.includePrerelease?t=Fie:t=NI}if(e.length===1&&e[0].semver===Fv){if(r.includePrerelease)return!0;e=NI}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=LI(i,d,r):d.operator==="<"||d.operator==="<="?o=BI(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=Av(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(i&&!Fc(d,String(i),r)||o&&!Fc(d,String(o),r))return null;for(let p of e)if(!Fc(d,String(p),r))return!1;return!0}let a,u,c,l,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(l=l||d.operator===">"||d.operator===">=",c=c||d.operator==="<"||d.operator==="<=",i){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator===">"||d.operator===">="){if(a=LI(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!Fc(i.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(u=BI(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!Fc(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||h||f)},LI=(t,e,r)=>{if(!t)return e;let n=Av(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},BI=(t,e,r)=>{if(!t)return e;let n=Av(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};qI.exports=xie});var Pv=D((bge,VI)=>{var Tv=ia(),MI=wc(),Aie=St(),UI=mv(),kie=go(),Tie=m$(),Pie=y$(),Rie=b$(),$ie=E$(),Iie=S$(),jie=F$(),Nie=A$(),Lie=T$(),Bie=_r(),qie=I$(),Mie=N$(),Uie=mh(),Vie=M$(),Hie=V$(),zie=Ec(),Gie=gh(),Wie=yv(),Kie=Dv(),Yie=yh(),Jie=Dh(),Xie=vv(),Zie=Z$(),Qie=Cc(),eoe=Er(),toe=xc(),roe=hI(),noe=mI(),ioe=yI(),ooe=bI(),soe=_I(),aoe=wh(),uoe=OI(),coe=kI(),loe=RI(),foe=II(),doe=kv();VI.exports={parse:kie,valid:Tie,clean:Pie,inc:Rie,diff:$ie,major:Iie,minor:jie,patch:Nie,prerelease:Lie,compare:Bie,rcompare:qie,compareLoose:Mie,compareBuild:Uie,sort:Vie,rsort:Hie,gt:zie,lt:Gie,eq:Wie,neq:Kie,gte:Yie,lte:Jie,cmp:Xie,coerce:Zie,Comparator:Qie,Range:eoe,satisfies:toe,toComparators:roe,maxSatisfying:noe,minSatisfying:ioe,minVersion:ooe,validRange:soe,outside:aoe,gtr:uoe,ltr:coe,intersects:loe,simplifyRange:foe,subset:doe,SemVer:Aie,re:Tv.re,src:Tv.src,tokens:Tv.t,SEMVER_SPEC_VERSION:MI.SEMVER_SPEC_VERSION,RELEASE_TYPES:MI.RELEASE_TYPES,compareIdentifiers:UI.compareIdentifiers,rcompareIdentifiers:UI.rcompareIdentifiers}});var t6=D(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.parseApkNameFromFlavor=W.checkJDKMajorVersion=W.resolvePlatform=W.checkPlatformVersions=W.getAddedPlatforms=W.getPlatformTargetName=W.promptForPlatformTarget=W.promptForPlatform=W.isValidEnterprisePlatform=W.getKnownEnterprisePlatforms=W.isValidCommunityPlatform=W.getKnownCommunityPlatforms=W.isValidPlatform=W.getKnownPlatforms=W.selectPlatforms=W.getProjectPlatformDirectory=W.getCLIVersion=W.getCoreVersion=W.getCapacitorPackageVersion=W.requireCapacitorPackage=W.getCapacitorPackage=W.runTask=W.runPlatformHook=W.runHooks=W.wait=W.checkAppName=W.checkAppId=W.checkAppDir=W.checkAppConfig=W.checkCapacitorPlatform=W.checkPackage=W.checkWebDir=W.check=void 0;var Ac=(Cn(),ke(En)),gi=Ms(),HI=WD(),yo=require("path"),Se=Ac.__importDefault(zs()),sa=zd(),GI=uc(),hoe=XR(),zI=hl(),Oc=lh(),poe=fh();async function moe(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
166
- `)}W.check=moe;async function goe(t){var e;return!((e=t.app.extConfig.server)===null||e===void 0)&&e.url?null:["",".","..","../","./"].includes(t.app.webDir)?`"${t.app.webDir}" is not a valid value for webDir`:await(0,gi.pathExists)(t.app.webDirAbs)?await(0,gi.pathExists)((0,yo.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Se.default.strong((0,HI.prettyPath)(t.app.webDirAbs))}) must contain an ${Se.default.strong("index.html")} file.
165
+ `),ure.logger.info(n)}Ce.printPlugins=fre;function lv(t,e){return t.xml.platform?t.xml.platform.filter(function(i){return i.$.name===e})[0]:[]}Ce.getPluginPlatform=lv;function dre(t,e,r){let n=lv(t,e);if(n){let i=n[r];if(i)return i}return[]}Ce.getPlatformElement=dre;function hre(t,e){var r,n,i,o;switch(e){case"ios":return(n=(r=t.ios)===null||r===void 0?void 0:r.type)!==null&&n!==void 0?n:0;case"android":return(o=(i=t.android)===null||i===void 0?void 0:i.type)!==null&&o!==void 0?o:0}return 0}Ce.getPluginType=hre;function pre(t,e){return fv(t,e,"js-module")}Ce.getJSModules=pre;function mre(t,e){return fv(t,e,"asset")}Ce.getAssets=mre;function gre(t,e,r){if(r.startsWith("node_modules")){let n=r.split("/").slice(1);n[0].startsWith("@")&&(n=[n[0]+"/"+n[1],...n.slice(2)]);let i=(0,WR.resolveNode)(t.app.rootDir,...n);if(!i)throw new Error(`Can't resolve module ${n[0]}`);return i}return(0,uv.join)(e.rootPath,r)}Ce.getFilePath=gre;function fv(t,e,r){let n=[];t.xml[r]&&(n=n.concat(t.xml[r]));let i=lv(t,e);return i?.[r]&&(n=n.concat(i[r])),n}Ce.getAllElements=fv});var ZR={};mn(ZR,{default:()=>yre});var yre,QR=ut(()=>{yre={}});var fh=D(mi=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.isInstalled=mi.getCommandOutput=mi.runCommand=void 0;var dv=(QR(),ke(ZR));async function e$(t,e,r={}){let n=new dv.Subprocess(t,e,r);try{return await n.output()}catch(i){throw i instanceof dv.SubprocessError?i.output?i.output:i.code?i.code:i.error?i.error.message:"Unknown error":i}}mi.runCommand=e$;async function Dre(t,e,r={}){try{return(await e$(t,e,r)).trim()}catch{return null}}mi.getCommandOutput=Dre;async function vre(t){try{await(0,dv.which)(t)}catch{return!1}return!0}mi.isInstalled=vre});var wc=D((Pme,t$)=>{var bre="2.0.0",wre=Number.MAX_SAFE_INTEGER||9007199254740991,_re=16,Ere=250,Cre=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:_re,MAX_SAFE_BUILD_LENGTH:Ere,MAX_SAFE_INTEGER:wre,RELEASE_TYPES:Cre,SEMVER_SPEC_VERSION:bre,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var _c=D((Rme,r$)=>{var Sre=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};r$.exports=Sre});var ia=D((In,n$)=>{var{MAX_SAFE_COMPONENT_LENGTH:hv,MAX_SAFE_BUILD_LENGTH:xre,MAX_LENGTH:Fre}=wc(),Ore=_c();In=n$.exports={};var Are=In.re=[],kre=In.safeRe=[],z=In.src=[],G=In.t={},Tre=0,pv="[a-zA-Z0-9-]",Pre=[["\\s",1],["\\d",Fre],[pv,xre]],Rre=t=>{for(let[e,r]of Pre)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},ne=(t,e,r)=>{let n=Rre(e),i=Tre++;Ore(t,i,e),G[t]=i,z[i]=e,Are[i]=new RegExp(e,r?"g":void 0),kre[i]=new RegExp(n,r?"g":void 0)};ne("NUMERICIDENTIFIER","0|[1-9]\\d*");ne("NUMERICIDENTIFIERLOOSE","\\d+");ne("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${pv}*`);ne("MAINVERSION",`(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})\\.(${z[G.NUMERICIDENTIFIER]})`);ne("MAINVERSIONLOOSE",`(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})\\.(${z[G.NUMERICIDENTIFIERLOOSE]})`);ne("PRERELEASEIDENTIFIER",`(?:${z[G.NUMERICIDENTIFIER]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASEIDENTIFIERLOOSE",`(?:${z[G.NUMERICIDENTIFIERLOOSE]}|${z[G.NONNUMERICIDENTIFIER]})`);ne("PRERELEASE",`(?:-(${z[G.PRERELEASEIDENTIFIER]}(?:\\.${z[G.PRERELEASEIDENTIFIER]})*))`);ne("PRERELEASELOOSE",`(?:-?(${z[G.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${z[G.PRERELEASEIDENTIFIERLOOSE]})*))`);ne("BUILDIDENTIFIER",`${pv}+`);ne("BUILD",`(?:\\+(${z[G.BUILDIDENTIFIER]}(?:\\.${z[G.BUILDIDENTIFIER]})*))`);ne("FULLPLAIN",`v?${z[G.MAINVERSION]}${z[G.PRERELEASE]}?${z[G.BUILD]}?`);ne("FULL",`^${z[G.FULLPLAIN]}$`);ne("LOOSEPLAIN",`[v=\\s]*${z[G.MAINVERSIONLOOSE]}${z[G.PRERELEASELOOSE]}?${z[G.BUILD]}?`);ne("LOOSE",`^${z[G.LOOSEPLAIN]}$`);ne("GTLT","((?:<|>)?=?)");ne("XRANGEIDENTIFIERLOOSE",`${z[G.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ne("XRANGEIDENTIFIER",`${z[G.NUMERICIDENTIFIER]}|x|X|\\*`);ne("XRANGEPLAIN",`[v=\\s]*(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:\\.(${z[G.XRANGEIDENTIFIER]})(?:${z[G.PRERELEASE]})?${z[G.BUILD]}?)?)?`);ne("XRANGEPLAINLOOSE",`[v=\\s]*(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:\\.(${z[G.XRANGEIDENTIFIERLOOSE]})(?:${z[G.PRERELEASELOOSE]})?${z[G.BUILD]}?)?)?`);ne("XRANGE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAIN]}$`);ne("XRANGELOOSE",`^${z[G.GTLT]}\\s*${z[G.XRANGEPLAINLOOSE]}$`);ne("COERCEPLAIN",`(^|[^\\d])(\\d{1,${hv}})(?:\\.(\\d{1,${hv}}))?(?:\\.(\\d{1,${hv}}))?`);ne("COERCE",`${z[G.COERCEPLAIN]}(?:$|[^\\d])`);ne("COERCEFULL",z[G.COERCEPLAIN]+`(?:${z[G.PRERELEASE]})?(?:${z[G.BUILD]})?(?:$|[^\\d])`);ne("COERCERTL",z[G.COERCE],!0);ne("COERCERTLFULL",z[G.COERCEFULL],!0);ne("LONETILDE","(?:~>?)");ne("TILDETRIM",`(\\s*)${z[G.LONETILDE]}\\s+`,!0);In.tildeTrimReplace="$1~";ne("TILDE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAIN]}$`);ne("TILDELOOSE",`^${z[G.LONETILDE]}${z[G.XRANGEPLAINLOOSE]}$`);ne("LONECARET","(?:\\^)");ne("CARETTRIM",`(\\s*)${z[G.LONECARET]}\\s+`,!0);In.caretTrimReplace="$1^";ne("CARET",`^${z[G.LONECARET]}${z[G.XRANGEPLAIN]}$`);ne("CARETLOOSE",`^${z[G.LONECARET]}${z[G.XRANGEPLAINLOOSE]}$`);ne("COMPARATORLOOSE",`^${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]})$|^$`);ne("COMPARATOR",`^${z[G.GTLT]}\\s*(${z[G.FULLPLAIN]})$|^$`);ne("COMPARATORTRIM",`(\\s*)${z[G.GTLT]}\\s*(${z[G.LOOSEPLAIN]}|${z[G.XRANGEPLAIN]})`,!0);In.comparatorTrimReplace="$1$2$3";ne("HYPHENRANGE",`^\\s*(${z[G.XRANGEPLAIN]})\\s+-\\s+(${z[G.XRANGEPLAIN]})\\s*$`);ne("HYPHENRANGELOOSE",`^\\s*(${z[G.XRANGEPLAINLOOSE]})\\s+-\\s+(${z[G.XRANGEPLAINLOOSE]})\\s*$`);ne("STAR","(<|>)?=?\\s*\\*");ne("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ne("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var dh=D(($me,i$)=>{var $re=Object.freeze({loose:!0}),Ire=Object.freeze({}),jre=t=>t?typeof t!="object"?$re:t:Ire;i$.exports=jre});var mv=D((Ime,a$)=>{var o$=/^[0-9]+$/,s$=(t,e)=>{let r=o$.test(t),n=o$.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Nre=(t,e)=>s$(e,t);a$.exports={compareIdentifiers:s$,rcompareIdentifiers:Nre}});var St=D((jme,f$)=>{var hh=_c(),{MAX_LENGTH:u$,MAX_SAFE_INTEGER:ph}=wc(),{safeRe:c$,t:l$}=ia(),Lre=dh(),{compareIdentifiers:oa}=mv(),gv=class t{constructor(e,r){if(r=Lre(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>u$)throw new TypeError(`version is longer than ${u$} characters`);hh("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?c$[l$.LOOSE]:c$[l$.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ph||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ph||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ph||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<ph)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(hh("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),oa(this.major,e.major)||oa(this.minor,e.minor)||oa(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(hh("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return oa(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(hh("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return oa(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),oa(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};f$.exports=gv});var go=D((Nme,h$)=>{var d$=St(),Bre=(t,e,r=!1)=>{if(t instanceof d$)return t;try{return new d$(t,e)}catch(n){if(!r)return null;throw n}};h$.exports=Bre});var m$=D((Lme,p$)=>{var qre=go(),Mre=(t,e)=>{let r=qre(t,e);return r?r.version:null};p$.exports=Mre});var y$=D((Bme,g$)=>{var Ure=go(),Vre=(t,e)=>{let r=Ure(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};g$.exports=Vre});var b$=D((qme,v$)=>{var D$=St(),Hre=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new D$(t instanceof D$?t.version:t,r).inc(e,n,i).version}catch{return null}};v$.exports=Hre});var E$=D((Mme,_$)=>{var w$=go(),zre=(t,e)=>{let r=w$(t,null,!0),n=w$(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":s.patch?"patch":s.minor?"minor":"major";let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};_$.exports=zre});var S$=D((Ume,C$)=>{var Gre=St(),Wre=(t,e)=>new Gre(t,e).major;C$.exports=Wre});var F$=D((Vme,x$)=>{var Kre=St(),Yre=(t,e)=>new Kre(t,e).minor;x$.exports=Yre});var A$=D((Hme,O$)=>{var Jre=St(),Xre=(t,e)=>new Jre(t,e).patch;O$.exports=Xre});var T$=D((zme,k$)=>{var Zre=go(),Qre=(t,e)=>{let r=Zre(t,e);return r&&r.prerelease.length?r.prerelease:null};k$.exports=Qre});var _r=D((Gme,R$)=>{var P$=St(),ene=(t,e,r)=>new P$(t,r).compare(new P$(e,r));R$.exports=ene});var I$=D((Wme,$$)=>{var tne=_r(),rne=(t,e,r)=>tne(e,t,r);$$.exports=rne});var N$=D((Kme,j$)=>{var nne=_r(),ine=(t,e)=>nne(t,e,!0);j$.exports=ine});var mh=D((Yme,B$)=>{var L$=St(),one=(t,e,r)=>{let n=new L$(t,r),i=new L$(e,r);return n.compare(i)||n.compareBuild(i)};B$.exports=one});var M$=D((Jme,q$)=>{var sne=mh(),ane=(t,e)=>t.sort((r,n)=>sne(r,n,e));q$.exports=ane});var V$=D((Xme,U$)=>{var une=mh(),cne=(t,e)=>t.sort((r,n)=>une(n,r,e));U$.exports=cne});var Ec=D((Zme,H$)=>{var lne=_r(),fne=(t,e,r)=>lne(t,e,r)>0;H$.exports=fne});var gh=D((Qme,z$)=>{var dne=_r(),hne=(t,e,r)=>dne(t,e,r)<0;z$.exports=hne});var yv=D((ege,G$)=>{var pne=_r(),mne=(t,e,r)=>pne(t,e,r)===0;G$.exports=mne});var Dv=D((tge,W$)=>{var gne=_r(),yne=(t,e,r)=>gne(t,e,r)!==0;W$.exports=yne});var yh=D((rge,K$)=>{var Dne=_r(),vne=(t,e,r)=>Dne(t,e,r)>=0;K$.exports=vne});var Dh=D((nge,Y$)=>{var bne=_r(),wne=(t,e,r)=>bne(t,e,r)<=0;Y$.exports=wne});var vv=D((ige,J$)=>{var _ne=yv(),Ene=Dv(),Cne=Ec(),Sne=yh(),xne=gh(),Fne=Dh(),One=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return _ne(t,r,n);case"!=":return Ene(t,r,n);case">":return Cne(t,r,n);case">=":return Sne(t,r,n);case"<":return xne(t,r,n);case"<=":return Fne(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};J$.exports=One});var Z$=D((oge,X$)=>{var Ane=St(),kne=go(),{safeRe:vh,t:bh}=ia(),Tne=(t,e)=>{if(t instanceof Ane)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?vh[bh.COERCEFULL]:vh[bh.COERCE]);else{let u=e.includePrerelease?vh[bh.COERCERTLFULL]:vh[bh.COERCERTL],c;for(;(c=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return kne(`${n}.${i}.${o}${s}${a}`,e)};X$.exports=Tne});var eI=D((sge,Q$)=>{var bv=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};Q$.exports=bv});var Er=D((age,iI)=>{var Pne=/\s+/g,wv=class t{constructor(e,r){if(r=$ne(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof _v)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Pne," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!rI(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Mne(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Bne)|(this.options.loose&&qne))+":"+e,i=tI.get(n);if(i)return i;let o=this.options.loose,s=o?Zt[$t.HYPHENRANGELOOSE]:Zt[$t.HYPHENRANGE];e=e.replace(s,Xne(this.options.includePrerelease)),$e("hyphen replace",e),e=e.replace(Zt[$t.COMPARATORTRIM],jne),$e("comparator trim",e),e=e.replace(Zt[$t.TILDETRIM],Nne),$e("tilde trim",e),e=e.replace(Zt[$t.CARETTRIM],Lne),$e("caret trim",e);let a=e.split(" ").map(f=>Une(f,this.options)).join(" ").split(/\s+/).map(f=>Jne(f,this.options));o&&(a=a.filter(f=>($e("loose invalid filter",f,this.options),!!f.match(Zt[$t.COMPARATORLOOSE])))),$e("range list",a);let u=new Map,c=a.map(f=>new _v(f,this.options));for(let f of c){if(rI(f))return[f];u.set(f.value,f)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return tI.set(n,l),l}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>nI(n,r)&&e.set.some(i=>nI(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Ine(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Zne(this.set[r],e,this.options))return!0;return!1}};iI.exports=wv;var Rne=eI(),tI=new Rne,$ne=dh(),_v=Cc(),$e=_c(),Ine=St(),{safeRe:Zt,t:$t,comparatorTrimReplace:jne,tildeTrimReplace:Nne,caretTrimReplace:Lne}=ia(),{FLAG_INCLUDE_PRERELEASE:Bne,FLAG_LOOSE:qne}=wc(),rI=t=>t.value==="<0.0.0-0",Mne=t=>t.value==="",nI=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},Une=(t,e)=>($e("comp",t,e),t=zne(t,e),$e("caret",t),t=Vne(t,e),$e("tildes",t),t=Wne(t,e),$e("xrange",t),t=Yne(t,e),$e("stars",t),t),It=t=>!t||t.toLowerCase()==="x"||t==="*",Vne=(t,e)=>t.trim().split(/\s+/).map(r=>Hne(r,e)).join(" "),Hne=(t,e)=>{let r=e.loose?Zt[$t.TILDELOOSE]:Zt[$t.TILDE];return t.replace(r,(n,i,o,s,a)=>{$e("tilde",t,n,i,o,s,a);let u;return It(i)?u="":It(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:It(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?($e("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,$e("tilde return",u),u})},zne=(t,e)=>t.trim().split(/\s+/).map(r=>Gne(r,e)).join(" "),Gne=(t,e)=>{$e("caret",t,e);let r=e.loose?Zt[$t.CARETLOOSE]:Zt[$t.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,u)=>{$e("caret",t,i,o,s,a,u);let c;return It(o)?c="":It(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:It(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?($e("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):($e("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),$e("caret return",c),c})},Wne=(t,e)=>($e("replaceXRanges",t,e),t.split(/\s+/).map(r=>Kne(r,e)).join(" ")),Kne=(t,e)=>{t=t.trim();let r=e.loose?Zt[$t.XRANGELOOSE]:Zt[$t.XRANGE];return t.replace(r,(n,i,o,s,a,u)=>{$e("xRange",t,n,i,o,s,a,u);let c=It(o),l=c||It(s),f=l||It(a),h=f;return i==="="&&h&&(i=""),u=e.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),$e("xRange return",n),n})},Yne=(t,e)=>($e("replaceStars",t,e),t.trim().replace(Zt[$t.STAR],"")),Jne=(t,e)=>($e("replaceGTE0",t,e),t.trim().replace(Zt[e.includePrerelease?$t.GTE0PRE:$t.GTE0],"")),Xne=t=>(e,r,n,i,o,s,a,u,c,l,f,h)=>(It(n)?r="":It(i)?r=`>=${n}.0.0${t?"-0":""}`:It(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,It(c)?u="":It(l)?u=`<${+c+1}.0.0-0`:It(f)?u=`<${c}.${+l+1}.0-0`:h?u=`<=${c}.${l}.${f}-${h}`:t?u=`<${c}.${l}.${+f+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Zne=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if($e(t[n].semver),t[n].semver!==_v.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Cc=D((uge,lI)=>{var Sc=Symbol("SemVer ANY"),Sv=class t{static get ANY(){return Sc}constructor(e,r){if(r=oI(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Cv("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Sc?this.value="":this.value=this.operator+this.semver.version,Cv("comp",this)}parse(e){let r=this.options.loose?sI[aI.COMPARATORLOOSE]:sI[aI.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new uI(n[2],this.options.loose):this.semver=Sc}toString(){return this.value}test(e){if(Cv("Comparator.test",e,this.options.loose),this.semver===Sc||e===Sc)return!0;if(typeof e=="string")try{e=new uI(e,this.options)}catch{return!1}return Ev(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new cI(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new cI(this.value,r).test(e.semver):(r=oI(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Ev(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ev(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};lI.exports=Sv;var oI=dh(),{safeRe:sI,t:aI}=ia(),Ev=vv(),Cv=_c(),uI=St(),cI=Er()});var xc=D((cge,fI)=>{var Qne=Er(),eie=(t,e,r)=>{try{e=new Qne(e,r)}catch{return!1}return e.test(t)};fI.exports=eie});var hI=D((lge,dI)=>{var tie=Er(),rie=(t,e)=>new tie(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));dI.exports=rie});var mI=D((fge,pI)=>{var nie=St(),iie=Er(),oie=(t,e,r)=>{let n=null,i=null,o=null;try{o=new iie(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new nie(n,r))}),n};pI.exports=oie});var yI=D((dge,gI)=>{var sie=St(),aie=Er(),uie=(t,e,r)=>{let n=null,i=null,o=null;try{o=new aie(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new sie(n,r))}),n};gI.exports=uie});var bI=D((hge,vI)=>{var xv=St(),cie=Er(),DI=Ec(),lie=(t,e)=>{t=new cie(t,e);let r=new xv("0.0.0");if(t.test(r)||(r=new xv("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new xv(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||DI(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||DI(r,o))&&(r=o)}return r&&t.test(r)?r:null};vI.exports=lie});var _I=D((pge,wI)=>{var fie=Er(),die=(t,e)=>{try{return new fie(t,e).range||"*"}catch{return null}};wI.exports=die});var wh=D((mge,xI)=>{var hie=St(),SI=Cc(),{ANY:pie}=SI,mie=Er(),gie=xc(),EI=Ec(),CI=gh(),yie=Dh(),Die=yh(),vie=(t,e,r,n)=>{t=new hie(t,n),e=new mie(e,n);let i,o,s,a,u;switch(r){case">":i=EI,o=yie,s=CI,a=">",u=">=";break;case"<":i=CI,o=Die,s=EI,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(gie(t,e,n))return!1;for(let c=0;c<e.set.length;++c){let l=e.set[c],f=null,h=null;if(l.forEach(d=>{d.semver===pie&&(d=new SI(">=0.0.0")),f=f||d,h=h||d,i(d.semver,f.semver,n)?f=d:s(d.semver,h.semver,n)&&(h=d)}),f.operator===a||f.operator===u||(!h.operator||h.operator===a)&&o(t,h.semver))return!1;if(h.operator===u&&s(t,h.semver))return!1}return!0};xI.exports=vie});var OI=D((gge,FI)=>{var bie=wh(),wie=(t,e,r)=>bie(t,e,">",r);FI.exports=wie});var kI=D((yge,AI)=>{var _ie=wh(),Eie=(t,e,r)=>_ie(t,e,"<",r);AI.exports=Eie});var RI=D((Dge,PI)=>{var TI=Er(),Cie=(t,e,r)=>(t=new TI(t,r),e=new TI(e,r),t.intersects(e,r));PI.exports=Cie});var II=D((vge,$I)=>{var Sie=xc(),xie=_r();$I.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((l,f)=>xie(l,f,r));for(let l of s)Sie(l,e,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,f]of n)l===f?a.push(l):!f&&l===s[0]?a.push("*"):f?l===s[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof e.raw=="string"?e.raw:String(e);return u.length<c.length?u:e}});var kv=D((bge,qI)=>{var jI=Er(),Ov=Cc(),{ANY:Fv}=Ov,Fc=xc(),Av=_r(),Fie=(t,e,r={})=>{if(t===e)return!0;t=new jI(t,r),e=new jI(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=Aie(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Oie=[new Ov(">=0.0.0-0")],NI=[new Ov(">=0.0.0")],Aie=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Fv){if(e.length===1&&e[0].semver===Fv)return!0;r.includePrerelease?t=Oie:t=NI}if(e.length===1&&e[0].semver===Fv){if(r.includePrerelease)return!0;e=NI}let n=new Set,i,o;for(let d of t)d.operator===">"||d.operator===">="?i=LI(i,d,r):d.operator==="<"||d.operator==="<="?o=BI(o,d,r):n.add(d.semver);if(n.size>1)return null;let s;if(i&&o){if(s=Av(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(i&&!Fc(d,String(i),r)||o&&!Fc(d,String(o),r))return null;for(let p of e)if(!Fc(d,String(p),r))return!1;return!0}let a,u,c,l,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of e){if(l=l||d.operator===">"||d.operator===">=",c=c||d.operator==="<"||d.operator==="<=",i){if(h&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===h.major&&d.semver.minor===h.minor&&d.semver.patch===h.patch&&(h=!1),d.operator===">"||d.operator===">="){if(a=LI(i,d,r),a===d&&a!==i)return!1}else if(i.operator===">="&&!Fc(i.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(u=BI(o,d,r),u===d&&u!==o)return!1}else if(o.operator==="<="&&!Fc(o.semver,String(d),r))return!1}if(!d.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||h||f)},LI=(t,e,r)=>{if(!t)return e;let n=Av(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},BI=(t,e,r)=>{if(!t)return e;let n=Av(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};qI.exports=Fie});var Pv=D((wge,VI)=>{var Tv=ia(),MI=wc(),kie=St(),UI=mv(),Tie=go(),Pie=m$(),Rie=y$(),$ie=b$(),Iie=E$(),jie=S$(),Nie=F$(),Lie=A$(),Bie=T$(),qie=_r(),Mie=I$(),Uie=N$(),Vie=mh(),Hie=M$(),zie=V$(),Gie=Ec(),Wie=gh(),Kie=yv(),Yie=Dv(),Jie=yh(),Xie=Dh(),Zie=vv(),Qie=Z$(),eoe=Cc(),toe=Er(),roe=xc(),noe=hI(),ioe=mI(),ooe=yI(),soe=bI(),aoe=_I(),uoe=wh(),coe=OI(),loe=kI(),foe=RI(),doe=II(),hoe=kv();VI.exports={parse:Tie,valid:Pie,clean:Rie,inc:$ie,diff:Iie,major:jie,minor:Nie,patch:Lie,prerelease:Bie,compare:qie,rcompare:Mie,compareLoose:Uie,compareBuild:Vie,sort:Hie,rsort:zie,gt:Gie,lt:Wie,eq:Kie,neq:Yie,gte:Jie,lte:Xie,cmp:Zie,coerce:Qie,Comparator:eoe,Range:toe,satisfies:roe,toComparators:noe,maxSatisfying:ioe,minSatisfying:ooe,minVersion:soe,validRange:aoe,outside:uoe,gtr:coe,ltr:loe,intersects:foe,simplifyRange:doe,subset:hoe,SemVer:kie,re:Tv.re,src:Tv.src,tokens:Tv.t,SEMVER_SPEC_VERSION:MI.SEMVER_SPEC_VERSION,RELEASE_TYPES:MI.RELEASE_TYPES,compareIdentifiers:UI.compareIdentifiers,rcompareIdentifiers:UI.rcompareIdentifiers}});var t6=D(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.parseApkNameFromFlavor=W.checkJDKMajorVersion=W.resolvePlatform=W.checkPlatformVersions=W.getAddedPlatforms=W.getPlatformTargetName=W.promptForPlatformTarget=W.promptForPlatform=W.isValidEnterprisePlatform=W.getKnownEnterprisePlatforms=W.isValidCommunityPlatform=W.getKnownCommunityPlatforms=W.isValidPlatform=W.getKnownPlatforms=W.selectPlatforms=W.getProjectPlatformDirectory=W.getCLIVersion=W.getCoreVersion=W.getCapacitorPackageVersion=W.requireCapacitorPackage=W.getCapacitorPackage=W.runTask=W.runPlatformHook=W.runHooks=W.wait=W.checkAppName=W.checkAppId=W.checkAppDir=W.checkAppConfig=W.checkCapacitorPlatform=W.checkPackage=W.checkWebDir=W.check=void 0;var Ac=(Cn(),ke(En)),gi=Ms(),HI=WD(),yo=require("path"),Se=Ac.__importDefault(zs()),sa=zd(),GI=uc(),poe=XR(),zI=hl(),Oc=lh(),moe=fh();async function goe(t){let r=(await Promise.all(t.map(n=>n()))).filter(n=>n!=null);if(r.length>0)throw r.join(`
166
+ `)}W.check=goe;async function yoe(t){var e;return!((e=t.app.extConfig.server)===null||e===void 0)&&e.url?null:["",".","..","../","./"].includes(t.app.webDir)?`"${t.app.webDir}" is not a valid value for webDir`:await(0,gi.pathExists)(t.app.webDirAbs)?await(0,gi.pathExists)((0,yo.join)(t.app.webDirAbs,"index.html"))?null:`The web assets directory (${Se.default.strong((0,HI.prettyPath)(t.app.webDirAbs))}) must contain an ${Se.default.strong("index.html")} file.
167
167
  It will be the entry point for the web portion of the Capacitor app.`:`Could not find the web assets directory: ${Se.default.strong((0,HI.prettyPath)(t.app.webDirAbs))}.
168
- Please create it and make sure it has an ${Se.default.strong("index.html")} file. You can change the path of this directory in ${Se.default.strong(t.app.extConfigName)} (${Se.default.input("webDir")} option). You may need to compile the web assets for your app (typically ${Se.default.input("npm run build")}). More info: ${Se.default.strong("https://capacitorjs.com/docs/basics/workflow#sync-your-project")}`}W.checkWebDir=goe;async function yoe(){return await(0,gi.pathExists)("package.json")||await(0,gi.pathExists)("project.json")?null:`The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.
168
+ Please create it and make sure it has an ${Se.default.strong("index.html")} file. You can change the path of this directory in ${Se.default.strong(t.app.extConfigName)} (${Se.default.input("webDir")} option). You may need to compile the web assets for your app (typically ${Se.default.input("npm run build")}). More info: ${Se.default.strong("https://capacitorjs.com/docs/basics/workflow#sync-your-project")}`}W.checkWebDir=yoe;async function Doe(){return await(0,gi.pathExists)("package.json")||await(0,gi.pathExists)("project.json")?null:`The Capacitor CLI needs to run at the root of an npm package or in a valid NX monorepo.
169
169
  Make sure you have a package.json or project.json file in the directory where you run the Capacitor CLI.
170
- More info: ${Se.default.strong("https://docs.npmjs.com/cli/init")}`}W.checkPackage=yoe;async function Doe(t,e){return await $v(t,e)?null:`Could not find the ${Se.default.input(e)} platform.
171
- You must install it in your project first, e.g. w/ ${Se.default.input(`npm install @capacitor/${e}`)}`}W.checkCapacitorPlatform=Doe;async function voe(t){if(!t.app.appId)return`Missing ${Se.default.input("appId")} for new platform.
170
+ More info: ${Se.default.strong("https://docs.npmjs.com/cli/init")}`}W.checkPackage=Doe;async function voe(t,e){return await $v(t,e)?null:`Could not find the ${Se.default.input(e)} platform.
171
+ You must install it in your project first, e.g. w/ ${Se.default.input(`npm install @capacitor/${e}`)}`}W.checkCapacitorPlatform=voe;async function boe(t){if(!t.app.appId)return`Missing ${Se.default.input("appId")} for new platform.
172
172
  Please add it in ${t.app.extConfigName} or run ${Se.default.input("npx cap init")}.`;if(!t.app.appName)return`Missing ${Se.default.input("appName")} for new platform.
173
- Please add it in ${t.app.extConfigName} or run ${Se.default.input("npx cap init")}.`;let e=await WI(t,t.app.appId);if(e)return e;let r=await KI(t,t.app.appName);return r||null}W.checkAppConfig=voe;async function boe(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=boe;async function WI(t,e){return e?/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$/.test(e.toLowerCase())?null:`Invalid App ID "${e}". Must be in Java package form with no dashes (ex: com.example.app)`:"Invalid App ID. Must be in Java package form with no dashes (ex: com.example.app)"}W.checkAppId=WI;async function KI(t,e){return e?.length?null:"Must provide an app name. For example: 'Spacebook'"}W.checkAppName=KI;async function woe(t){return new Promise(e=>setTimeout(e,t))}W.wait=woe;async function _oe(t,e,r,n){await Rv(t,e,r,n),(await(0,hoe.getPlugins)(t,e)).forEach(async o=>{await Rv(t,e,o.rootPath,n)})}W.runHooks=_oe;async function Rv(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>Ac.__importStar(require("child_process"))),s;(0,zI.isNXMonorepo)(r)?s=await(0,gi.readJSON)((0,yo.join)((0,zI.findNXMonorepoRoot)(r),"package.json")):s=await(0,gi.readJSON)((0,yo.join)(r,"package.json"));let a=(i=s.scripts)===null||i===void 0?void 0:i[n];if(a)return new Promise((u,c)=>{let l=o(a,{stdio:"inherit",shell:!0,cwd:r,env:{INIT_CWD:r,CAPACITOR_ROOT_DIR:t.app.rootDir,CAPACITOR_WEB_DIR:t.app.webDirAbs,CAPACITOR_CONFIG:JSON.stringify(t.app.extConfig),CAPACITOR_PLATFORM_NAME:e,...process.env}});l.on("close",()=>{u()}),l.on("error",f=>{c(f)})})}W.runPlatformHook=Rv;async function Eoe(t,e){let r=GI.output.createTaskChain();r.next(t);try{let n=await e();return r.end(),n}catch(n){throw r.fail(),n}}W.runTask=Eoe;async function $v(t,e){let r=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,gi.readJSON)(r):null}W.getCapacitorPackage=$v;async function YI(t,e){let r=await $v(t,e);return r||(0,sa.fatal)(`Unable to find node_modules/@capacitor/${e}.
174
- Are you sure ${Se.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=YI;async function Eh(t,e){return(await YI(t,e)).version}W.getCapacitorPackageVersion=Eh;async function JI(t){return Eh(t,"core")}W.getCoreVersion=JI;async function Coe(t){return Eh(t,"cli")}W.getCLIVersion=Coe;function Soe(t,e){switch(e){case"android":return t.android.platformDirAbs;case"ios":return t.ios.platformDirAbs;case"web":return t.web.platformDirAbs}return null}async function _h(t,e){let r=Soe(t,e);return r&&await(0,gi.pathExists)(r)?r:null}W.getProjectPlatformDirectory=_h;async function xoe(t,e){if(e){let r=e.toLowerCase().trim();return await jv(r)?await _h(t,r)||(r==="web"&&(0,sa.fatal)(`Could not find the web platform directory.
173
+ Please add it in ${t.app.extConfigName} or run ${Se.default.input("npx cap init")}.`;let e=await WI(t,t.app.appId);if(e)return e;let r=await KI(t,t.app.appName);return r||null}W.checkAppConfig=boe;async function woe(t,e){return/^\S*$/.test(e)?null:"Your app directory should not contain spaces"}W.checkAppDir=woe;async function WI(t,e){return e?/^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$/.test(e.toLowerCase())?null:`Invalid App ID "${e}". Must be in Java package form with no dashes (ex: com.example.app)`:"Invalid App ID. Must be in Java package form with no dashes (ex: com.example.app)"}W.checkAppId=WI;async function KI(t,e){return e?.length?null:"Must provide an app name. For example: 'Spacebook'"}W.checkAppName=KI;async function _oe(t){return new Promise(e=>setTimeout(e,t))}W.wait=_oe;async function Eoe(t,e,r,n){await Rv(t,e,r,n),(await(0,poe.getPlugins)(t,e)).forEach(async o=>{await Rv(t,e,o.rootPath,n)})}W.runHooks=Eoe;async function Rv(t,e,r,n){var i;let{spawn:o}=await Promise.resolve().then(()=>Ac.__importStar(require("child_process"))),s;(0,zI.isNXMonorepo)(r)?s=await(0,gi.readJSON)((0,yo.join)((0,zI.findNXMonorepoRoot)(r),"package.json")):s=await(0,gi.readJSON)((0,yo.join)(r,"package.json"));let a=(i=s.scripts)===null||i===void 0?void 0:i[n];if(a)return new Promise((u,c)=>{let l=o(a,{stdio:"inherit",shell:!0,cwd:r,env:{INIT_CWD:r,CAPACITOR_ROOT_DIR:t.app.rootDir,CAPACITOR_WEB_DIR:t.app.webDirAbs,CAPACITOR_CONFIG:JSON.stringify(t.app.extConfig),CAPACITOR_PLATFORM_NAME:e,...process.env}});l.on("close",()=>{u()}),l.on("error",f=>{c(f)})})}W.runPlatformHook=Rv;async function Coe(t,e){let r=GI.output.createTaskChain();r.next(t);try{let n=await e();return r.end(),n}catch(n){throw r.fail(),n}}W.runTask=Coe;async function $v(t,e){let r=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");return r?(0,gi.readJSON)(r):null}W.getCapacitorPackage=$v;async function YI(t,e){let r=await $v(t,e);return r||(0,sa.fatal)(`Unable to find node_modules/@capacitor/${e}.
174
+ Are you sure ${Se.default.strong(`@capacitor/${e}`)} is installed?`),r}W.requireCapacitorPackage=YI;async function Eh(t,e){return(await YI(t,e)).version}W.getCapacitorPackageVersion=Eh;async function JI(t){return Eh(t,"core")}W.getCoreVersion=JI;async function Soe(t){return Eh(t,"cli")}W.getCLIVersion=Soe;function xoe(t,e){switch(e){case"android":return t.android.platformDirAbs;case"ios":return t.ios.platformDirAbs;case"web":return t.web.platformDirAbs}return null}async function _h(t,e){let r=xoe(t,e);return r&&await(0,gi.pathExists)(r)?r:null}W.getProjectPlatformDirectory=_h;async function Foe(t,e){if(e){let r=e.toLowerCase().trim();return await jv(r)?await _h(t,r)||(r==="web"&&(0,sa.fatal)(`Could not find the web platform directory.
175
175
  Make sure ${Se.default.strong(t.app.webDir)} exists.`),(0,sa.fatal)(`${Se.default.strong(r)} platform has not been added yet.
176
- See the docs for adding the ${Se.default.strong(r)} platform: ${Se.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,sa.fatal)(`Invalid platform: ${Se.default.input(r)}`),[r]}return e6(t)}W.selectPlatforms=xoe;async function Iv(){return["web","android","ios"]}W.getKnownPlatforms=Iv;async function jv(t){return(await Iv()).includes(t)}W.isValidPlatform=jv;async function XI(){return["electron"]}W.getKnownCommunityPlatforms=XI;async function Foe(t){return(await XI()).includes(t)}W.isValidCommunityPlatform=Foe;async function ZI(){return["windows"]}W.getKnownEnterprisePlatforms=ZI;async function Ooe(t){return(await ZI()).includes(t)}W.isValidEnterprisePlatform=Ooe;async function Aoe(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>Ac.__importStar(ch()));if(!r)return(await n([{type:"select",name:"mode",message:e,choices:t.map(s=>({title:s,value:s}))}],{onCancel:()=>process.exit(1)})).mode.toLowerCase().trim();let i=r.toLowerCase().trim();if(!await jv(i)){let o=await Iv();(0,sa.fatal)(`Invalid platform: ${Se.default.input(i)}.
177
- Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=Aoe;async function koe(t,e){let{prompt:r}=await Promise.resolve().then(()=>Ac.__importStar(ch())),n=t.filter(s=>s.id!==void 0);if(!e)return n.length===1?n[0]:(await r([{type:"select",name:"target",message:"Please choose a target device:",choices:n.map(a=>({title:`${QI(a)} (${a.id})`,value:a}))}],{onCancel:()=>process.exit(1)})).target;let i=e.trim(),o=t.find(s=>s.id===i);return o||(0,sa.fatal)(`Invalid target ID: ${Se.default.input(i)}.
178
- Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=koe;function QI(t){var e,r,n;return`${(n=(r=(e=t.name)!==null&&e!==void 0?e:t.model)!==null&&r!==void 0?r:t.id)!==null&&n!==void 0?n:"?"}${t.virtual?` (${t.platform==="ios"?"simulator":"emulator"})`:""}`}W.getPlatformTargetName=QI;async function e6(t){let e=[];return await _h(t,t.android.name)&&e.push(t.android.name),await _h(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=e6;async function Toe(t,e){let r=await Promise.resolve().then(()=>Ac.__importStar(Pv())),n=await JI(t),i=await Eh(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&GI.logger.warn(`${Se.default.strong("@capacitor/core")}${Se.default.weak(`@${n}`)} version doesn't match ${Se.default.strong(`@capacitor/${e}`)}${Se.default.weak(`@${i}`)} version.
179
- Consider updating to a matching version, e.g. w/ ${Se.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=Toe;function Poe(t,e){if(e[0]!=="@"){let n=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,yo.dirname)(n);let i=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,yo.dirname)(i);let o=(0,Oc.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,yo.dirname)(o)}let r=(0,Oc.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,yo.dirname)(r):null}W.resolvePlatform=Poe;async function Roe(){try{let t=await(0,poe.runCommand)("java",["--version"]),r=RegExp(/([0-9]+)\.?([0-9]*)\.?([0-9]*)/).exec(t);if(r===null)return-1;let n=parseInt(r[1]),i=parseInt(r[2]);return typeof n=="number"&&n!=1?n:typeof i=="number"&&n==1&&i<9?i:-1}catch{return-1}}W.checkJDKMajorVersion=Roe;function $oe(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=$oe});var r6=D(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.tryFn=void 0;var Ioe=async(t,...e)=>{try{return await t(...e)}catch{}return null};Ch.tryFn=Ioe});var n6=D(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.formatJSObject=void 0;var joe=(Cn(),ke(En)),Noe=joe.__importDefault(require("util"));function Loe(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Noe.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Sh.formatJSObject=Loe});var i6=D(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.lazy=yi.LazyPromise=yi.allSerial=void 0;function Boe(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}yi.allSerial=Boe;var xh=class extends Promise{constructor(e){super(()=>{}),this._executor=e}then(e,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(e,r)}catch(e){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(e)}};yi.LazyPromise=xh;function qoe(t){return new xh(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}yi.lazy=qoe});var c6=D(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.checkExternalConfig=nt.writeConfig=nt.loadConfig=nt.CONFIG_FILE_NAME_JSON=nt.CONFIG_FILE_NAME_JS=nt.CONFIG_FILE_NAME_TS=void 0;var Lv=(Cn(),ke(En)),Qt=Ms(),Moe=Lv.__importDefault(BA()),ie=require("path"),Di=Lv.__importDefault(zs()),Uoe=t6(),Fh=zd(),a6=uc(),Nv=r6(),Voe=n6(),o6=hl(),s6=lh(),aa=i6(),Hoe=fh(),u6=(0,Moe.default)("capacitor:config");nt.CONFIG_FILE_NAME_TS="capacitor.config.ts";nt.CONFIG_FILE_NAME_JS="capacitor.config.js";nt.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function zoe(){var t,e,r,n;let i=process.cwd(),o=(0,ie.dirname)(__dirname),s=await Yoe(i),a=await(async()=>{var d,p;if((0,o6.isNXMonorepo)(i)){let v=(0,o6.findNXMonorepoRoot)(i),g=await(0,Nv.tryFn)(Qt.readJSON,(0,ie.resolve)(v,"package.json")),w=(d=g?.devDependencies)!==null&&d!==void 0?d:{},x=(p=g?.dependencies)!==null&&p!==void 0?p:{};return{devDependencies:w,dependencies:x}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",c=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",l=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await Joe(o),h={android:await Xoe(i,s.extConfig,f),ios:await Zoe(i,s.extConfig),web:await Qoe(i,l),cli:f,app:{rootDir:i,appId:u,appName:c,webDir:l,webDirAbs:(0,ie.resolve)(i,l),package:(n=await(0,Nv.tryFn)(Qt.readJSON,(0,ie.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:c,version:"1.0.0",...a},...s}};return u6("config: %O",h),h}nt.loadConfig=zoe;async function Goe(t,e){switch((0,ie.extname)(e)){case".json":{await(0,Qt.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,Qt.writeFile)(e,ose(t));break}}}nt.writeConfig=Goe;async function Woe(t,e,r){var n;try{let i=(0,s6.resolveNode)(t,"typescript");i||(0,Fh.fatal)(`Could not find installation of TypeScript.
176
+ See the docs for adding the ${Se.default.strong(r)} platform: ${Se.default.strong(`https://capacitorjs.com/docs/${r}#adding-the-${r}-platform`)}`)):(0,sa.fatal)(`Invalid platform: ${Se.default.input(r)}`),[r]}return e6(t)}W.selectPlatforms=Foe;async function Iv(){return["web","android","ios"]}W.getKnownPlatforms=Iv;async function jv(t){return(await Iv()).includes(t)}W.isValidPlatform=jv;async function XI(){return["electron"]}W.getKnownCommunityPlatforms=XI;async function Ooe(t){return(await XI()).includes(t)}W.isValidCommunityPlatform=Ooe;async function ZI(){return["windows"]}W.getKnownEnterprisePlatforms=ZI;async function Aoe(t){return(await ZI()).includes(t)}W.isValidEnterprisePlatform=Aoe;async function koe(t,e,r){let{prompt:n}=await Promise.resolve().then(()=>Ac.__importStar(ch()));if(!r)return(await n([{type:"select",name:"mode",message:e,choices:t.map(s=>({title:s,value:s}))}],{onCancel:()=>process.exit(1)})).mode.toLowerCase().trim();let i=r.toLowerCase().trim();if(!await jv(i)){let o=await Iv();(0,sa.fatal)(`Invalid platform: ${Se.default.input(i)}.
177
+ Valid platforms include: ${o.join(", ")}`)}return i}W.promptForPlatform=koe;async function Toe(t,e){let{prompt:r}=await Promise.resolve().then(()=>Ac.__importStar(ch())),n=t.filter(s=>s.id!==void 0);if(!e)return n.length===1?n[0]:(await r([{type:"select",name:"target",message:"Please choose a target device:",choices:n.map(a=>({title:`${QI(a)} (${a.id})`,value:a}))}],{onCancel:()=>process.exit(1)})).target;let i=e.trim(),o=t.find(s=>s.id===i);return o||(0,sa.fatal)(`Invalid target ID: ${Se.default.input(i)}.
178
+ Valid targets are: ${t.map(s=>s.id).join(", ")}`),o}W.promptForPlatformTarget=Toe;function QI(t){var e,r,n;return`${(n=(r=(e=t.name)!==null&&e!==void 0?e:t.model)!==null&&r!==void 0?r:t.id)!==null&&n!==void 0?n:"?"}${t.virtual?` (${t.platform==="ios"?"simulator":"emulator"})`:""}`}W.getPlatformTargetName=QI;async function e6(t){let e=[];return await _h(t,t.android.name)&&e.push(t.android.name),await _h(t,t.ios.name)&&e.push(t.ios.name),e.push(t.web.name),e}W.getAddedPlatforms=e6;async function Poe(t,e){let r=await Promise.resolve().then(()=>Ac.__importStar(Pv())),n=await JI(t),i=await Eh(t,e);(r.diff(n,i)==="minor"||r.diff(n,i)==="major")&&GI.logger.warn(`${Se.default.strong("@capacitor/core")}${Se.default.weak(`@${n}`)} version doesn't match ${Se.default.strong(`@capacitor/${e}`)}${Se.default.weak(`@${i}`)} version.
179
+ Consider updating to a matching version, e.g. w/ ${Se.default.input(`npm install @capacitor/core@${i}`)}`)}W.checkPlatformVersions=Poe;function Roe(t,e){if(e[0]!=="@"){let n=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor/${e}`,"package.json");if(n)return(0,yo.dirname)(n);let i=(0,Oc.resolveNode)(t.app.rootDir,`@capacitor-community/${e}`,"package.json");if(i)return(0,yo.dirname)(i);let o=(0,Oc.resolveNode)(t.app.rootDir,`@ionic-enterprise/capacitor-${e}`,"package.json");if(o)return(0,yo.dirname)(o)}let r=(0,Oc.resolveNode)(t.app.rootDir,e,"package.json");return r?(0,yo.dirname)(r):null}W.resolvePlatform=Roe;async function $oe(){try{let t=await(0,moe.runCommand)("java",["--version"]),r=RegExp(/([0-9]+)\.?([0-9]*)\.?([0-9]*)/).exec(t);if(r===null)return-1;let n=parseInt(r[1]),i=parseInt(r[2]);return typeof n=="number"&&n!=1?n:typeof i=="number"&&n==1&&i<9?i:-1}catch{return-1}}W.checkJDKMajorVersion=$oe;function Ioe(t){let e=t.replace(/([A-Z])/g,"$1").toLowerCase();return`app-${e?`${e}-`:""}debug.apk`}W.parseApkNameFromFlavor=Ioe});var r6=D(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.tryFn=void 0;var joe=async(t,...e)=>{try{return await t(...e)}catch{}return null};Ch.tryFn=joe});var n6=D(Sh=>{"use strict";Object.defineProperty(Sh,"__esModule",{value:!0});Sh.formatJSObject=void 0;var Noe=(Cn(),ke(En)),Loe=Noe.__importDefault(require("util"));function Boe(t){try{t=JSON.parse(JSON.stringify(t))}catch(e){throw new Error(`Cannot parse object as JSON: ${e.stack?e.stack:e}`)}return Loe.default.inspect(t,{compact:!1,breakLength:1/0,depth:1/0,maxArrayLength:1/0,maxStringLength:1/0})}Sh.formatJSObject=Boe});var i6=D(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.lazy=yi.LazyPromise=yi.allSerial=void 0;function qoe(t){return t.reduce((e,r)=>e.then(n=>r().then(i=>n.concat(i))),Promise.resolve([]))}yi.allSerial=qoe;var xh=class extends Promise{constructor(e){super(()=>{}),this._executor=e}then(e,r){return this._promise=this._promise||new Promise(this._executor),this._promise.then(e,r)}catch(e){return this._promise=this._promise||new Promise(this._executor),this._promise.catch(e)}};yi.LazyPromise=xh;function Moe(t){return new xh(async(e,r)=>{try{e(await t())}catch(n){r(n)}})}yi.lazy=Moe});var c6=D(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.checkExternalConfig=nt.writeConfig=nt.loadConfig=nt.CONFIG_FILE_NAME_JSON=nt.CONFIG_FILE_NAME_JS=nt.CONFIG_FILE_NAME_TS=void 0;var Lv=(Cn(),ke(En)),Qt=Ms(),Uoe=Lv.__importDefault(BA()),ie=require("path"),Di=Lv.__importDefault(zs()),Voe=t6(),Fh=zd(),a6=uc(),Nv=r6(),Hoe=n6(),o6=hl(),s6=lh(),aa=i6(),zoe=fh(),u6=(0,Uoe.default)("capacitor:config");nt.CONFIG_FILE_NAME_TS="capacitor.config.ts";nt.CONFIG_FILE_NAME_JS="capacitor.config.js";nt.CONFIG_FILE_NAME_JSON="capacitor.config.json";async function Goe(){var t,e,r,n;let i=process.cwd(),o=(0,ie.dirname)(__dirname),s=await Joe(i),a=await(async()=>{var d,p;if((0,o6.isNXMonorepo)(i)){let v=(0,o6.findNXMonorepoRoot)(i),g=await(0,Nv.tryFn)(Qt.readJSON,(0,ie.resolve)(v,"package.json")),w=(d=g?.devDependencies)!==null&&d!==void 0?d:{},x=(p=g?.dependencies)!==null&&p!==void 0?p:{};return{devDependencies:w,dependencies:x}}return{}})(),u=(t=s.extConfig.appId)!==null&&t!==void 0?t:"",c=(e=s.extConfig.appName)!==null&&e!==void 0?e:"",l=(r=s.extConfig.webDir)!==null&&r!==void 0?r:"www",f=await Xoe(o),h={android:await Zoe(i,s.extConfig,f),ios:await Qoe(i,s.extConfig),web:await ese(i,l),cli:f,app:{rootDir:i,appId:u,appName:c,webDir:l,webDirAbs:(0,ie.resolve)(i,l),package:(n=await(0,Nv.tryFn)(Qt.readJSON,(0,ie.resolve)(i,"package.json")))!==null&&n!==void 0?n:{name:c,version:"1.0.0",...a},...s}};return u6("config: %O",h),h}nt.loadConfig=Goe;async function Woe(t,e){switch((0,ie.extname)(e)){case".json":{await(0,Qt.writeJSON)(e,t,{spaces:2});break}case".ts":{await(0,Qt.writeFile)(e,sse(t));break}}}nt.writeConfig=Woe;async function Koe(t,e,r){var n;try{let i=(0,s6.resolveNode)(t,"typescript");i||(0,Fh.fatal)(`Could not find installation of TypeScript.
180
180
  To use ${Di.default.strong(e)} files, you must install TypeScript in your project, e.g. w/ ${Di.default.input("npm install -D typescript")}`);let o=require(i),s=(0,s6.requireTS)(o,r),a=s.default?await s.default:s;return{extConfigType:"ts",extConfigName:e,extConfigFilePath:r,extConfig:a}}catch(i){throw(0,Fh.isFatal)(i)||(0,Fh.fatal)(`Parsing ${Di.default.strong(e)} failed.
181
181
 
182
- ${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function Koe(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(i){(0,Fh.fatal)(`Parsing ${Di.default.strong(e)} failed.
182
+ ${(n=i.stack)!==null&&n!==void 0?n:i}`),i}}async function Yoe(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(i){(0,Fh.fatal)(`Parsing ${Di.default.strong(e)} failed.
183
183
 
184
- ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function Yoe(t){var e;let r=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_TS);if(await(0,Qt.pathExists)(r))return Woe(t,nt.CONFIG_FILE_NAME_TS,r);let n=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_JS);if(await(0,Qt.pathExists)(n))return Koe(t,nt.CONFIG_FILE_NAME_JS,n);let i=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:nt.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,Nv.tryFn)(Qt.readJSON,i))!==null&&e!==void 0?e:{}}}async function Joe(t){let e="assets",r=(0,ie.join)(t,e),n="ios-pods-template.tar.gz",i="capacitor-cordova-ios-plugins.tar.gz",o="android-template.tar.gz",s="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ie.resolve)(r,n),cordovaPluginsTemplateArchive:i,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,i)},android:{platformTemplateArchive:o,platformTemplateArchiveAbs:(0,ie.resolve)(r,o),cordovaPluginsTemplateArchive:s,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,s)}},package:await(0,Qt.readJSON)((0,ie.resolve)(t,"package.json")),os:ese(process.platform)}}async function Xoe(t,e,r){var n,i,o,s,a,u,c,l,f,h,d,p,v,g,w,x,y;let C="android",k=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",$=(0,ie.resolve)(t,k),F="app",L=`${F}/src`,S=`${L}/main`,I=`${S}/assets`,R=`${I}/public`,B=`${S}/res`,q=`${F}/build/outputs/apk/`,K=((o=e.android)===null||o===void 0?void 0:o.flavor)||"";!((s=e.android)===null||s===void 0)&&s.flavor&&(q=`${q}/${(a=e.android)===null||a===void 0?void 0:a.flavor}`);let M=(0,Uoe.parseApkNameFromFlavor)(K),E=`${q}/debug`,b="capacitor-cordova-android-plugins",_=(0,aa.lazy)(()=>nse(r.os)),O={keystorePath:(c=(u=e.android)===null||u===void 0?void 0:u.buildOptions)===null||c===void 0?void 0:c.keystorePath,keystorePassword:(f=(l=e.android)===null||l===void 0?void 0:l.buildOptions)===null||f===void 0?void 0:f.keystorePassword,keystoreAlias:(d=(h=e.android)===null||h===void 0?void 0:h.buildOptions)===null||d===void 0?void 0:d.keystoreAlias,keystoreAliasPassword:(v=(p=e.android)===null||p===void 0?void 0:p.buildOptions)===null||v===void 0?void 0:v.keystoreAliasPassword,signingType:(w=(g=e.android)===null||g===void 0?void 0:g.buildOptions)===null||w===void 0?void 0:w.signingType,releaseType:(y=(x=e.android)===null||x===void 0?void 0:x.buildOptions)===null||y===void 0?void 0:y.releaseType};return{name:C,minVersion:"22",studioPath:_,platformDir:k,platformDirAbs:$,cordovaPluginsDir:b,cordovaPluginsDirAbs:(0,ie.resolve)($,b),appDir:F,appDirAbs:(0,ie.resolve)($,F),srcDir:L,srcDirAbs:(0,ie.resolve)($,L),srcMainDir:S,srcMainDirAbs:(0,ie.resolve)($,S),assetsDir:I,assetsDirAbs:(0,ie.resolve)($,I),webDir:R,webDirAbs:(0,ie.resolve)($,R),resDir:B,resDirAbs:(0,ie.resolve)($,B),apkName:M,buildOutputDir:E,buildOutputDirAbs:(0,ie.resolve)($,E),flavor:K,buildOptions:O}}async function Zoe(t,e){var r,n,i,o;let s="ios",a=(n=(r=e.ios)===null||r===void 0?void 0:r.path)!==null&&n!==void 0?n:"ios",u=(0,ie.resolve)(t,a),c=(o=(i=e.ios)===null||i===void 0?void 0:i.scheme)!==null&&o!==void 0?o:"App",l="App",f=(0,ie.resolve)(u,l),h=`${l}/App`,d=(0,ie.resolve)(u,h),p=`${l}/App.xcodeproj`,v=(0,ie.resolve)(u,p),g=(0,aa.lazy)(()=>tse(f)),w=(0,aa.lazy)(()=>ise(t,u,f)),x=(0,aa.lazy)(()=>rse(f,d,v)),y="capacitor-cordova-ios-plugins";return{name:s,minVersion:"13.0",platformDir:a,platformDirAbs:u,scheme:c,cordovaPluginsDir:y,cordovaPluginsDirAbs:(0,ie.resolve)(u,y),nativeProjectDir:l,nativeProjectDirAbs:f,nativeTargetDir:h,nativeTargetDirAbs:d,nativeXcodeProjDir:p,nativeXcodeProjDirAbs:v,nativeXcodeWorkspaceDir:(0,aa.lazy)(async()=>(0,ie.relative)(u,await g)),nativeXcodeWorkspaceDirAbs:g,webDir:(0,aa.lazy)(async()=>(0,ie.relative)(u,await x)),webDirAbs:x,podPath:w}}async function Qoe(t,e){let r=e,n=(0,ie.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function ese(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function tse(t){return(0,ie.resolve)(t,"App.xcworkspace")}async function rse(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,i=(0,ie.resolve)(r,"project.pbxproj");try{let s=(await(0,Qt.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return a6.logger.warn(`Using the iOS project root for the ${Di.default.strong("public")} directory is deprecated.
185
- Please follow the Upgrade Guide to move ${Di.default.strong("public")} inside the iOS target directory: ${Di.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ie.resolve)(t,"public")}catch{}return(0,ie.resolve)(e,"public")}async function nse(t){if(process.env.CAPACITOR_ANDROID_STUDIO_PATH)return process.env.CAPACITOR_ANDROID_STUDIO_PATH;switch(t){case"mac":return"/Applications/Android Studio.app";case"windows":{let{runCommand:e}=await Promise.resolve().then(()=>Lv.__importStar(fh())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,Qt.pathExists)(r)){let n=await e("REG",["QUERY","HKEY_LOCAL_MACHINE\\SOFTWARE\\Android Studio","/v","Path"]);n=n.replace(/(\r\n|\n|\r)/gm,"");let i=n.indexOf("REG_SZ");i>0&&(r=n.substring(i+6).trim()+"\\bin\\studio64.exe")}}catch(n){u6("Error checking registry for Android Studio path: %O",n);break}return r}case"linux":return"/usr/local/android-studio/bin/studio.sh"}return""}async function ise(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,Qt.pathExists)((0,ie.resolve)(t,"Gemfile"))?n=(0,ie.resolve)(t,"Gemfile"):await(0,Qt.pathExists)((0,ie.resolve)(e,"Gemfile"))?n=(0,ie.resolve)(e,"Gemfile"):await(0,Qt.pathExists)((0,ie.resolve)(r,"Gemfile"))&&(n=(0,ie.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,Hoe.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ie.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,Qt.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function ose(t){return`import type { CapacitorConfig } from '@capacitor/cli';
184
+ ${(n=i.stack)!==null&&n!==void 0?n:i}`)}}async function Joe(t){var e;let r=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_TS);if(await(0,Qt.pathExists)(r))return Koe(t,nt.CONFIG_FILE_NAME_TS,r);let n=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_JS);if(await(0,Qt.pathExists)(n))return Yoe(t,nt.CONFIG_FILE_NAME_JS,n);let i=(0,ie.resolve)(t,nt.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:nt.CONFIG_FILE_NAME_JSON,extConfigFilePath:i,extConfig:(e=await(0,Nv.tryFn)(Qt.readJSON,i))!==null&&e!==void 0?e:{}}}async function Xoe(t){let e="assets",r=(0,ie.join)(t,e),n="ios-pods-template.tar.gz",i="capacitor-cordova-ios-plugins.tar.gz",o="android-template.tar.gz",s="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ie.resolve)(r,n),cordovaPluginsTemplateArchive:i,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,i)},android:{platformTemplateArchive:o,platformTemplateArchiveAbs:(0,ie.resolve)(r,o),cordovaPluginsTemplateArchive:s,cordovaPluginsTemplateArchiveAbs:(0,ie.resolve)(r,s)}},package:await(0,Qt.readJSON)((0,ie.resolve)(t,"package.json")),os:tse(process.platform)}}async function Zoe(t,e,r){var n,i,o,s,a,u,c,l,f,h,d,p,v,g,w,x,y;let C="android",k=(i=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"android",$=(0,ie.resolve)(t,k),F="app",L=`${F}/src`,S=`${L}/main`,I=`${S}/assets`,R=`${I}/public`,B=`${S}/res`,q=`${F}/build/outputs/apk/`,K=((o=e.android)===null||o===void 0?void 0:o.flavor)||"";!((s=e.android)===null||s===void 0)&&s.flavor&&(q=`${q}/${(a=e.android)===null||a===void 0?void 0:a.flavor}`);let M=(0,Voe.parseApkNameFromFlavor)(K),E=`${q}/debug`,b="capacitor-cordova-android-plugins",_=(0,aa.lazy)(()=>ise(r.os)),O={keystorePath:(c=(u=e.android)===null||u===void 0?void 0:u.buildOptions)===null||c===void 0?void 0:c.keystorePath,keystorePassword:(f=(l=e.android)===null||l===void 0?void 0:l.buildOptions)===null||f===void 0?void 0:f.keystorePassword,keystoreAlias:(d=(h=e.android)===null||h===void 0?void 0:h.buildOptions)===null||d===void 0?void 0:d.keystoreAlias,keystoreAliasPassword:(v=(p=e.android)===null||p===void 0?void 0:p.buildOptions)===null||v===void 0?void 0:v.keystoreAliasPassword,signingType:(w=(g=e.android)===null||g===void 0?void 0:g.buildOptions)===null||w===void 0?void 0:w.signingType,releaseType:(y=(x=e.android)===null||x===void 0?void 0:x.buildOptions)===null||y===void 0?void 0:y.releaseType};return{name:C,minVersion:"22",studioPath:_,platformDir:k,platformDirAbs:$,cordovaPluginsDir:b,cordovaPluginsDirAbs:(0,ie.resolve)($,b),appDir:F,appDirAbs:(0,ie.resolve)($,F),srcDir:L,srcDirAbs:(0,ie.resolve)($,L),srcMainDir:S,srcMainDirAbs:(0,ie.resolve)($,S),assetsDir:I,assetsDirAbs:(0,ie.resolve)($,I),webDir:R,webDirAbs:(0,ie.resolve)($,R),resDir:B,resDirAbs:(0,ie.resolve)($,B),apkName:M,buildOutputDir:E,buildOutputDirAbs:(0,ie.resolve)($,E),flavor:K,buildOptions:O}}async function Qoe(t,e){var r,n,i,o;let s="ios",a=(n=(r=e.ios)===null||r===void 0?void 0:r.path)!==null&&n!==void 0?n:"ios",u=(0,ie.resolve)(t,a),c=(o=(i=e.ios)===null||i===void 0?void 0:i.scheme)!==null&&o!==void 0?o:"App",l="App",f=(0,ie.resolve)(u,l),h=`${l}/App`,d=(0,ie.resolve)(u,h),p=`${l}/App.xcodeproj`,v=(0,ie.resolve)(u,p),g=(0,aa.lazy)(()=>rse(f)),w=(0,aa.lazy)(()=>ose(t,u,f)),x=(0,aa.lazy)(()=>nse(f,d,v)),y="capacitor-cordova-ios-plugins";return{name:s,minVersion:"13.0",platformDir:a,platformDirAbs:u,scheme:c,cordovaPluginsDir:y,cordovaPluginsDirAbs:(0,ie.resolve)(u,y),nativeProjectDir:l,nativeProjectDirAbs:f,nativeTargetDir:h,nativeTargetDirAbs:d,nativeXcodeProjDir:p,nativeXcodeProjDirAbs:v,nativeXcodeWorkspaceDir:(0,aa.lazy)(async()=>(0,ie.relative)(u,await g)),nativeXcodeWorkspaceDirAbs:g,webDir:(0,aa.lazy)(async()=>(0,ie.relative)(u,await x)),webDirAbs:x,podPath:w}}async function ese(t,e){let r=e,n=(0,ie.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function tse(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function rse(t){return(0,ie.resolve)(t,"App.xcworkspace")}async function nse(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,i=(0,ie.resolve)(r,"project.pbxproj");try{let s=(await(0,Qt.readFile)(i,{encoding:"utf8"})).match(n);if(s&&s[1]==="SOURCE_ROOT")return a6.logger.warn(`Using the iOS project root for the ${Di.default.strong("public")} directory is deprecated.
185
+ Please follow the Upgrade Guide to move ${Di.default.strong("public")} inside the iOS target directory: ${Di.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ie.resolve)(t,"public")}catch{}return(0,ie.resolve)(e,"public")}async function ise(t){if(process.env.CAPACITOR_ANDROID_STUDIO_PATH)return process.env.CAPACITOR_ANDROID_STUDIO_PATH;switch(t){case"mac":return"/Applications/Android Studio.app";case"windows":{let{runCommand:e}=await Promise.resolve().then(()=>Lv.__importStar(fh())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,Qt.pathExists)(r)){let n=await e("REG",["QUERY","HKEY_LOCAL_MACHINE\\SOFTWARE\\Android Studio","/v","Path"]);n=n.replace(/(\r\n|\n|\r)/gm,"");let i=n.indexOf("REG_SZ");i>0&&(r=n.substring(i+6).trim()+"\\bin\\studio64.exe")}}catch(n){u6("Error checking registry for Android Studio path: %O",n);break}return r}case"linux":return"/usr/local/android-studio/bin/studio.sh"}return""}async function ose(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,Qt.pathExists)((0,ie.resolve)(t,"Gemfile"))?n=(0,ie.resolve)(t,"Gemfile"):await(0,Qt.pathExists)((0,ie.resolve)(e,"Gemfile"))?n=(0,ie.resolve)(e,"Gemfile"):await(0,Qt.pathExists)((0,ie.resolve)(r,"Gemfile"))&&(n=(0,ie.resolve)(r,"Gemfile")),!(n!=""))try{let o=await(0,zoe.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});o!=null&&(n=(0,ie.resolve)(o,"Gemfile"))}catch{}try{let o=(await(0,Qt.readFile)(n)).toString();return o&&new RegExp(/gem\s+['"]cocoapods/).test(o)?"bundle exec pod":"pod"}catch{return"pod"}}function sse(t){return`import type { CapacitorConfig } from '@capacitor/cli';
186
186
 
187
- const config: CapacitorConfig = ${(0,Voe.formatJSObject)(t)};
187
+ const config: CapacitorConfig = ${(0,Hoe.formatJSObject)(t)};
188
188
 
189
189
  export default config;
190
- `}function sse(t){if(typeof t.extConfig.bundledWebRuntime<"u"){let e="Can be safely deleted.";t.extConfig.bundledWebRuntime===!0&&(e="Please, use a bundler to bundle Capacitor and its plugins."),a6.logger.warn(`The ${Di.default.strong("bundledWebRuntime")} configuration option has been deprecated. ${e}`)}}nt.checkExternalConfig=sse});function ase(){try{return qv.default.statSync("/.dockerenv"),!0}catch{return!1}}function use(){try{return qv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Mv(){return Bv===void 0&&(Bv=ase()||use()),Bv}var qv,Bv,f6=ut(()=>{qv=ce(require("node:fs"),1)});function ua(){return Uv===void 0&&(Uv=cse()||Mv()),Uv}var d6,Uv,cse,Vv=ut(()=>{d6=ce(require("node:fs"),1);f6();cse=()=>{try{return d6.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var Hv,p6,m6,h6,Tc,g6=ut(()=>{Hv=ce(require("node:process"),1),p6=ce(require("node:os"),1),m6=ce(require("node:fs"),1);Vv();h6=()=>{if(Hv.default.platform!=="linux")return!1;if(p6.default.release().toLowerCase().includes("microsoft"))return!ua();try{return m6.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!ua():!1}catch{return!1}},Tc=Hv.default.env.__IS_WSL_TEST__?h6:h6()});function Do(t,e,r){let n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),t}var y6=ut(()=>{});async function zv(){if(v6.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await lse("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var D6,v6,b6,lse,w6=ut(()=>{D6=require("node:util"),v6=ce(require("node:process"),1),b6=require("node:child_process"),lse=(0,D6.promisify)(b6.execFile)});async function C6(t,{humanReadableOutput:e=!0}={}){if(_6.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await fse("osascript",["-e",t,r]);return n.trim()}var _6,E6,Gv,fse,S6=ut(()=>{_6=ce(require("node:process"),1),E6=require("node:util"),Gv=require("node:child_process"),fse=(0,E6.promisify)(Gv.execFile)});async function Wv(t){return C6(`tell application "Finder" to set app_path to application file id "${t}" as string
191
- tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var x6=ut(()=>{S6()});async function Kv(t=dse){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new Oh(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=hse[n];if(!i)throw new Oh(`Unknown browser ID: ${n}`);return i}var F6,O6,dse,hse,Oh,A6=ut(()=>{F6=require("node:util"),O6=require("node:child_process"),dse=(0,F6.promisify)(O6.execFile),hse={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},Oh=class extends Error{}});async function Yv(){if(Ah.default.platform==="darwin"){let t=await zv();return{name:await Wv(t),id:t}}if(Ah.default.platform==="linux"){let{stdout:t}=await pse("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:mse(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Ah.default.platform==="win32")return Kv();throw new Error("Only macOS, Linux, and Windows are supported")}var k6,Ah,T6,pse,mse,P6=ut(()=>{k6=require("node:util"),Ah=ce(require("node:process"),1),T6=require("node:child_process");w6();x6();A6();pse=(0,k6.promisify)(T6.execFile),mse=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var q6={};mn(q6,{apps:()=>bo,default:()=>vse,openApp:()=>Dse});function j6(t){if(typeof t=="string"||Array.isArray(t))return t;let{[$6]:e}=t;if(!e)throw new Error(`${$6} is not supported`);return e}function Zv({[ca]:t},{wsl:e}){if(e&&Tc)return j6(e);if(!t)throw new Error(`${ca} is not supported`);return j6(t)}var Pc,N6,Xv,L6,B6,vo,bse,Jv,R6,ca,$6,gse,I6,Rc,yse,Dse,bo,vse,M6=ut(()=>{Pc=ce(require("node:process"),1),N6=require("node:buffer"),Xv=ce(require("node:path"),1),L6=require("node:url"),B6=ce(require("node:child_process"),1),vo=ce(require("node:fs/promises"),1);g6();y6();P6();Vv();bse={},Jv=Xv.default.dirname((0,L6.fileURLToPath)(bse.url)),R6=Xv.default.join(Jv,"xdg-open"),{platform:ca,arch:$6}=Pc.default,gse=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await vo.default.access(r,vo.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await vo.default.readFile(r,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(e=o.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),I6=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},Rc=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return I6(t.app,a=>Rc({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return I6(e,a=>Rc({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=await Yv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),Rc({...t,app:{name:bo[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],o={};if(ca==="darwin")n="open",t.wait&&i.push("--wait-apps"),t.background&&i.push("--background"),t.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(ca==="win32"||Tc&&!ua()&&!e){let a=await gse();n=Tc?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${Pc.default.env.SYSTEMROOT||Pc.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Tc||(o.windowsVerbatimArguments=!0);let u=["Start"];t.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&u.push(`"${t.target}"`),r.length>0&&(r=r.map(c=>`"\`"${c}\`""`),u.push("-ArgumentList",r.join(","))),t.target=N6.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!Jv||Jv==="/",u=!1;try{await vo.default.access(R6,vo.constants.X_OK),u=!0}catch{}n=Pc.default.versions.electron??(ca==="android"||a||!u)?"xdg-open":R6}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}ca==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=B6.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}a(s)})}):(s.unref(),s)},yse=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return Rc({...e,target:t})},Dse=(t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return Rc({...e,app:{name:t,arguments:r}})};bo={};Do(bo,"chrome",()=>Zv({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Do(bo,"firefox",()=>Zv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Do(bo,"edge",()=>Zv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Do(bo,"browser",()=>"browser");Do(bo,"browserPrivate",()=>"browserPrivate");vse=yse});var mj=D(Eo=>{Eo.parse=Eo.decode=Pse;Eo.stringify=Eo.encode=dj;Eo.safe=ya;Eo.unsafe=Ih;var ab=typeof process<"u"&&process.platform==="win32"?`\r
190
+ `}function ase(t){if(typeof t.extConfig.bundledWebRuntime<"u"){let e="Can be safely deleted.";t.extConfig.bundledWebRuntime===!0&&(e="Please, use a bundler to bundle Capacitor and its plugins."),a6.logger.warn(`The ${Di.default.strong("bundledWebRuntime")} configuration option has been deprecated. ${e}`)}}nt.checkExternalConfig=ase});function use(){try{return qv.default.statSync("/.dockerenv"),!0}catch{return!1}}function cse(){try{return qv.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Mv(){return Bv===void 0&&(Bv=use()||cse()),Bv}var qv,Bv,f6=ut(()=>{qv=ce(require("node:fs"),1)});function ua(){return Uv===void 0&&(Uv=lse()||Mv()),Uv}var d6,Uv,lse,Vv=ut(()=>{d6=ce(require("node:fs"),1);f6();lse=()=>{try{return d6.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var Hv,p6,m6,h6,Tc,g6=ut(()=>{Hv=ce(require("node:process"),1),p6=ce(require("node:os"),1),m6=ce(require("node:fs"),1);Vv();h6=()=>{if(Hv.default.platform!=="linux")return!1;if(p6.default.release().toLowerCase().includes("microsoft"))return!ua();try{return m6.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!ua():!1}catch{return!1}},Tc=Hv.default.env.__IS_WSL_TEST__?h6:h6()});function Do(t,e,r){let n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let i=r();return n(i),i},set(i){n(i)}}),t}var y6=ut(()=>{});async function zv(){if(v6.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await fse("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari"}var D6,v6,b6,fse,w6=ut(()=>{D6=require("node:util"),v6=ce(require("node:process"),1),b6=require("node:child_process"),fse=(0,D6.promisify)(b6.execFile)});async function C6(t,{humanReadableOutput:e=!0}={}){if(_6.default.platform!=="darwin")throw new Error("macOS only");let r=e?[]:["-ss"],{stdout:n}=await dse("osascript",["-e",t,r]);return n.trim()}var _6,E6,Gv,dse,S6=ut(()=>{_6=ce(require("node:process"),1),E6=require("node:util"),Gv=require("node:child_process"),dse=(0,E6.promisify)(Gv.execFile)});async function Wv(t){return C6(`tell application "Finder" to set app_path to application file id "${t}" as string
191
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var x6=ut(()=>{S6()});async function Kv(t=hse){let{stdout:e}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(e);if(!r)throw new Oh(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,i=pse[n];if(!i)throw new Oh(`Unknown browser ID: ${n}`);return i}var F6,O6,hse,pse,Oh,A6=ut(()=>{F6=require("node:util"),O6=require("node:child_process"),hse=(0,F6.promisify)(O6.execFile),pse={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}},Oh=class extends Error{}});async function Yv(){if(Ah.default.platform==="darwin"){let t=await zv();return{name:await Wv(t),id:t}}if(Ah.default.platform==="linux"){let{stdout:t}=await mse("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:gse(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Ah.default.platform==="win32")return Kv();throw new Error("Only macOS, Linux, and Windows are supported")}var k6,Ah,T6,mse,gse,P6=ut(()=>{k6=require("node:util"),Ah=ce(require("node:process"),1),T6=require("node:child_process");w6();x6();A6();mse=(0,k6.promisify)(T6.execFile),gse=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var q6={};mn(q6,{apps:()=>bo,default:()=>bse,openApp:()=>vse});function j6(t){if(typeof t=="string"||Array.isArray(t))return t;let{[$6]:e}=t;if(!e)throw new Error(`${$6} is not supported`);return e}function Zv({[ca]:t},{wsl:e}){if(e&&Tc)return j6(e);if(!t)throw new Error(`${ca} is not supported`);return j6(t)}var Pc,N6,Xv,L6,B6,vo,wse,Jv,R6,ca,$6,yse,I6,Rc,Dse,vse,bo,bse,M6=ut(()=>{Pc=ce(require("node:process"),1),N6=require("node:buffer"),Xv=ce(require("node:path"),1),L6=require("node:url"),B6=ce(require("node:child_process"),1),vo=ce(require("node:fs/promises"),1);g6();y6();P6();Vv();wse={},Jv=Xv.default.dirname((0,L6.fileURLToPath)(wse.url)),R6=Xv.default.join(Jv,"xdg-open"),{platform:ca,arch:$6}=Pc.default,yse=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await vo.default.access(r,vo.constants.F_OK),n=!0}catch{}if(!n)return t;let i=await vo.default.readFile(r,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(e=o.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),I6=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(i){r=i}throw r},Rc=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return I6(t.app,a=>Rc({...t,app:a}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return I6(e,a=>Rc({...t,app:{name:a,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let a={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=await Yv();if(c.id in a){let l=a[c.id];return e==="browserPrivate"&&r.push(u[l]),Rc({...t,app:{name:bo[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,i=[],o={};if(ca==="darwin")n="open",t.wait&&i.push("--wait-apps"),t.background&&i.push("--background"),t.newInstance&&i.push("--new"),e&&i.push("-a",e);else if(ca==="win32"||Tc&&!ua()&&!e){let a=await yse();n=Tc?`${a}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${Pc.default.env.SYSTEMROOT||Pc.default.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),Tc||(o.windowsVerbatimArguments=!0);let u=["Start"];t.wait&&u.push("-Wait"),e?(u.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&u.push(`"${t.target}"`),r.length>0&&(r=r.map(c=>`"\`"${c}\`""`),u.push("-ArgumentList",r.join(","))),t.target=N6.Buffer.from(u.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let a=!Jv||Jv==="/",u=!1;try{await vo.default.access(R6,vo.constants.X_OK),u=!0}catch{}n=Pc.default.versions.electron??(ca==="android"||a||!u)?"xdg-open":R6}r.length>0&&i.push(...r),t.wait||(o.stdio="ignore",o.detached=!0)}ca==="darwin"&&r.length>0&&i.push("--args",...r),t.target&&i.push(t.target);let s=B6.default.spawn(n,i,o);return t.wait?new Promise((a,u)=>{s.once("error",u),s.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}a(s)})}):(s.unref(),s)},Dse=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return Rc({...e,target:t})},vse=(t,e)=>{if(typeof t!="string"&&!Array.isArray(t))throw new TypeError("Expected a valid `name`");let{arguments:r=[]}=e??{};if(r!=null&&!Array.isArray(r))throw new TypeError("Expected `appArguments` as Array type");return Rc({...e,app:{name:t,arguments:r}})};bo={};Do(bo,"chrome",()=>Zv({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Do(bo,"firefox",()=>Zv({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Do(bo,"edge",()=>Zv({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Do(bo,"browser",()=>"browser");Do(bo,"browserPrivate",()=>"browserPrivate");bse=Dse});var mj=D(Eo=>{Eo.parse=Eo.decode=Rse;Eo.stringify=Eo.encode=dj;Eo.safe=ya;Eo.unsafe=Ih;var ab=typeof process<"u"&&process.platform==="win32"?`\r
192
192
  `:`
193
193
  `;function dj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(c){n+=ya(o+"[]")+i+ya(c)+`
194
- `}):u&&typeof u=="object"?r.push(o):n+=ya(o)+i+ya(u)+ab}),e.section&&n.length&&(n="["+ya(e.section)+"]"+ab+n),r.forEach(function(o,s,a){var u=hj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=dj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=ab),n+=l}),n}function hj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Pse(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=Ih(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=Ih(c[2]);if(l!=="__proto__"){var f=c[3]?Ih(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=hj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,v){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function pj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ya(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&pj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function Ih(t,e){if(t=(t||"").trim(),pj(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var Dj=D((nye,yj)=>{"use strict";var ub=1,gj=2;function Rse(){return""}function $se(t,e,r){return t.slice(e,r).replace(/\S/g," ")}yj.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?Rse:$se,c=0;c<t.length;c++){if(r=t[c],n=t[c+1],!o&&r==='"'){var l=t[c-1]==="\\"&&t[c-2]!=="\\";l||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,c),s=c,o=ub,c++;else if(o===ub&&r+n===`\r
194
+ `}):u&&typeof u=="object"?r.push(o):n+=ya(o)+i+ya(u)+ab}),e.section&&n.length&&(n="["+ya(e.section)+"]"+ab+n),r.forEach(function(o,s,a){var u=hj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=dj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=ab),n+=l}),n}function hj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function Rse(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=Ih(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=Ih(c[2]);if(l!=="__proto__"){var f=c[3]?Ih(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=hj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,v){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function pj(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function ya(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&pj(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function Ih(t,e){if(t=(t||"").trim(),pj(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var Dj=D((iye,yj)=>{"use strict";var ub=1,gj=2;function $se(){return""}function Ise(t,e,r){return t.slice(e,r).replace(/\S/g," ")}yj.exports=function(t,e){e=e||{};for(var r,n,i=!1,o=!1,s=0,a="",u=e.whitespace===!1?$se:Ise,c=0;c<t.length;c++){if(r=t[c],n=t[c+1],!o&&r==='"'){var l=t[c-1]==="\\"&&t[c-2]!=="\\";l||(i=!i)}if(!i){if(!o&&r+n==="//")a+=t.slice(s,c),s=c,o=ub,c++;else if(o===ub&&r+n===`\r
195
195
  `){c++,o=!1,a+=u(t,s,c),s=c;continue}else if(o===ub&&r===`
196
- `)o=!1,a+=u(t,s,c),s=c;else if(!o&&r+n==="/*"){a+=t.slice(s,c),s=c,o=gj,c++;continue}else if(o===gj&&r+n==="*/"){c++,o=!1,a+=u(t,s,c+1),s=c+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var bj=D(Da=>{"use strict";var vj=require("fs"),Ise=mj(),Ic=require("path"),jse=Dj(),Nse=Da.parse=function(t){return/^\s*{/.test(t)?JSON.parse(jse(t)):Ise.parse(t)},Lse=Da.file=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null});for(var e in t)if(typeof t[e]!="string")return;var r=Ic.join.apply(null,t),n;try{return vj.readFileSync(r,"utf-8")}catch{return}},iye=Da.json=function(){var t=Lse.apply(null,arguments);return t?Nse(t):null},oye=Da.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=i.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=r;o.forEach(function(c,l){!c||typeof a!="object"||(l===o.length-1&&(a[c]=e[i]),a[c]===void 0&&(a[c]={}),a=a[c])})}return r},sye=Da.find=function(){var t=Ic.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Ic.join(r,n);try{return vj.statSync(i),i}catch{if(Ic.dirname(r)!==r)return e(Ic.dirname(r),n)}}return e(process.cwd(),t)}});var xj=D((uye,Sj)=>{"use strict";function _j(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Ej(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Cj(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=Cj(r):_j(r)?e[n]=Ej(r):e[n]=cb({},r):e[n]=r}),e}function wj(t,e){return e==="__proto__"?void 0:t[e]}var cb=Sj.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,i;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(n=wj(t,s),r=wj(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=Cj(r);return}else if(_j(r)){t[s]=Ej(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=cb({},r);return}else{t[s]=cb(n,r);return}})}),t}});var kj=D((cye,Aj)=>{"use strict";function Bse(t,e){var r=t;e.slice(0,-1).forEach(function(i){r=r[i]||{}});var n=e[e.length-1];return n in r}function Fj(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Oj(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}Aj.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function i(C){return n[C].some(function(k){return r.bools[k]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(k){n[k]=[C].concat(n[C].filter(function($){return k!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(k){r.strings[k]=!0})});var o=e.default||{},s={_:[]};function a(C,k){return r.allBools&&/^--[^=]+$/.test(k)||r.strings[C]||r.bools[C]||n[C]}function u(C,k,$){for(var F=C,L=0;L<k.length-1;L++){var S=k[L];if(Oj(F,S))return;F[S]===void 0&&(F[S]={}),(F[S]===Object.prototype||F[S]===Number.prototype||F[S]===String.prototype)&&(F[S]={}),F[S]===Array.prototype&&(F[S]=[]),F=F[S]}var I=k[k.length-1];Oj(F,I)||((F===Object.prototype||F===Number.prototype||F===String.prototype)&&(F={}),F===Array.prototype&&(F=[]),F[I]===void 0||r.bools[I]||typeof F[I]=="boolean"?F[I]=$:Array.isArray(F[I])?F[I].push($):F[I]=[F[I],$])}function c(C,k,$){if(!($&&r.unknownFn&&!a(C,$)&&r.unknownFn($)===!1)){var F=!r.strings[C]&&Fj(k)?Number(k):k;u(s,C.split("."),F),(n[C]||[]).forEach(function(L){u(s,L.split("."),F)})}}Object.keys(r.bools).forEach(function(C){c(C,o[C]===void 0?!1:o[C])});var l=[];t.indexOf("--")!==-1&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,p;if(/^--.+=/.test(h)){var v=h.match(/^--([^=]+)=([\s\S]*)$/);d=v[1];var g=v[2];r.bools[d]&&(g=g!=="false"),c(d,g,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],c(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],p=t[f+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(c(d,p,h),f+=1):/^(true|false)$/.test(p)?(c(d,p==="true",h),f+=1):c(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var w=h.slice(1,-1).split(""),x=!1,y=0;y<w.length;y++){if(p=h.slice(y+2),p==="-"){c(w[y],p,h);continue}if(/[A-Za-z]/.test(w[y])&&p[0]==="="){c(w[y],p.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(w[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){c(w[y],p,h),x=!0;break}if(w[y+1]&&w[y+1].match(/\W/)){c(w[y],h.slice(y+2),h),x=!0;break}else c(w[y],r.strings[w[y]]?"":!0,h)}d=h.slice(-1)[0],!x&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(c(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(c(d,t[f+1]==="true",h),f+=1):c(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!Fj(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){Bse(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(k){u(s,k.split("."),o[C])}))}),e["--"]?s["--"]=l.slice():l.forEach(function(C){s._.push(C)}),s}});var $j=D((lye,Rj)=>{var jc=bj(),va=require("path").join,qse=xj(),Tj="/etc",Pj=process.platform==="win32",Nc=Pj?process.env.USERPROFILE:process.env.HOME;Rj.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=kj()(process.argv.slice(2))),e=(typeof e=="string"?jc.json(e):e)||{},n=n||jc.parse;var i=jc.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var c=jc.file(u);c&&(o.push(n(c)),s.push(u))}}return Pj||[va(Tj,t,"config"),va(Tj,t+"rc")].forEach(a),Nc&&[va(Nc,".config",t,"config"),va(Nc,".config",t),va(Nc,"."+t,"config"),va(Nc,"."+t+"rc")].forEach(a),a(jc.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),qse.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var Nj=D((dye,jj)=>{var bi=require("constants"),Mse=process.cwd,jh=null,Use=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return jh||(jh=Mse.call(process)),jh};try{process.cwd()}catch{}typeof process.chdir=="function"&&(fb=process.chdir,process.chdir=function(t){jh=null,fb.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,fb));var fb;jj.exports=Vse;function Vse(t){bi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),Use==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var v=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM")&&Date.now()-v<6e4){setTimeout(function(){t.stat(d,function(y,C){y&&y.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,v,g,w){var x;if(w&&typeof w=="function"){var y=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&y<10)return y++,l.call(t,h,d,p,v,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,v,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,v){for(var g=0;;)try{return l.call(t,f,h,d,p,v)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,bi.O_WRONLY|bi.O_SYMLINK,h,function(p,v){if(p){d&&d(p);return}l.fchmod(v,h,function(g){l.close(v,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,bi.O_WRONLY|bi.O_SYMLINK,h),p=!0,v;try{v=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return v}}function r(l){bi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,bi.O_SYMLINK,function(v,g){if(v){p&&p(v);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,bi.O_SYMLINK),v,g=!0;try{v=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return v}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(v){c(v)&&(v=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(v,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var qj=D((hye,Bj)=>{var Lj=require("stream").Stream;Bj.exports=Hse;function Hse(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Lj.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Lj.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Uj=D((pye,Mj)=>{"use strict";Mj.exports=Gse;var zse=Object.getPrototypeOf||function(t){return t.__proto__};function Gse(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:zse(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Gj=D((mye,pb)=>{var Ge=require("fs"),Wse=Nj(),Kse=qj(),Yse=Uj(),Nh=require("util"),_t,Bh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),Bh=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",Bh="___graceful-fs.previous");function Jse(){}function zj(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var Co=Jse;Nh.debuglog?Co=Nh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Co=function(){var t=Nh.format.apply(Nh,arguments);t="GFS4: "+t.split(/\n/).join(`
197
- GFS4: `),console.error(t)});Ge[_t]||(Vj=global[_t]||[],zj(Ge,Vj),Ge.close=function(t){function e(r,n){return t.call(Ge,r,function(i){i||Hj(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Bh,{value:t}),e}(Ge.close),Ge.closeSync=function(t){function e(r){t.apply(Ge,arguments),Hj()}return Object.defineProperty(e,Bh,{value:t}),e}(Ge.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Co(Ge[_t]),require("assert").equal(Ge[_t].length,0)}));var Vj;global[_t]||zj(global,Ge[_t]);pb.exports=db(Yse(Ge));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ge.__patched&&(pb.exports=db(Ge),Ge.__patched=!0);function db(t){Wse(t),t.gracefulify=db,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(b){b&&(b.code==="EMFILE"||b.code==="ENFILE")?ba([B,[q,K,M],b,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,b,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,b,_){return c(M,q(M,E,b,_))}:function(M,E,b,_){return c(M,E,q(M,E,b,_))};return B(S,I,R);function q(K,M,E,b){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?ba([B,[K,M,E],_,b||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Kse(t);w=h.ReadStream,y=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(y.prototype=Object.create(p.prototype),y.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return y},set:function(S){y=S},enumerable:!0,configurable:!0});var v=w;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(S){v=S},enumerable:!0,configurable:!0});var g=y;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function y(S,I){return this instanceof y?(p.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}return t}function ba(t){Co("ENQUEUE",t[0].name,t[1]),Ge[_t].push(t),hb()}var Lh;function Hj(){for(var t=Date.now(),e=0;e<Ge[_t].length;++e)Ge[_t][e].length>2&&(Ge[_t][e][3]=t,Ge[_t][e][4]=t);hb()}function hb(){if(clearTimeout(Lh),Lh=void 0,Ge[_t].length!==0){var t=Ge[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Co("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Co("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(Co("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ge[_t].push(t)}Lh===void 0&&(Lh=setTimeout(hb,0))}}});var Wj=D(wa=>{"use strict";var Xse=wa&&wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wa,"__esModule",{value:!0});wa.readCAFileSync=void 0;var Zse=Xse(Gj());function Qse(t){try{let e=Zse.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(i=>!!i.trim()).map(i=>`${i.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}wa.readCAFileSync=Qse});var Kj=D(So=>{"use strict";var eae=So&&So.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tae=So&&So.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eae(e,t,r)};Object.defineProperty(So,"__esModule",{value:!0});tae(Wj(),So)});var Xj=D((Dye,Jj)=>{Jj.exports=Yj;function xo(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Yj(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&xo(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Yj.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&xo(this.list[this.list.length-1],t),xo(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&xo(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return xo(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&xo(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)xo(this.list[e],this.list[e+1]||this.root);return t}}});var t8=D(Fo=>{Fo.parse=Fo.decode=rae;Fo.stringify=Fo.encode=Zj;Fo.safe=_a;Fo.unsafe=qh;var mb=typeof process<"u"&&process.platform==="win32"?`\r
196
+ `)o=!1,a+=u(t,s,c),s=c;else if(!o&&r+n==="/*"){a+=t.slice(s,c),s=c,o=gj,c++;continue}else if(o===gj&&r+n==="*/"){c++,o=!1,a+=u(t,s,c+1),s=c+1;continue}}}return a+(o?u(t.substr(s)):t.substr(s))}});var bj=D(Da=>{"use strict";var vj=require("fs"),jse=mj(),Ic=require("path"),Nse=Dj(),Lse=Da.parse=function(t){return/^\s*{/.test(t)?JSON.parse(Nse(t)):jse.parse(t)},Bse=Da.file=function(){var t=[].slice.call(arguments).filter(function(i){return i!=null});for(var e in t)if(typeof t[e]!="string")return;var r=Ic.join.apply(null,t),n;try{return vj.readFileSync(r,"utf-8")}catch{return}},oye=Da.json=function(){var t=Bse.apply(null,arguments);return t?Lse(t):null},sye=Da.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)if(i.toLowerCase().indexOf(t.toLowerCase())===0){for(var o=i.substring(n).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=r;o.forEach(function(c,l){!c||typeof a!="object"||(l===o.length-1&&(a[c]=e[i]),a[c]===void 0&&(a[c]={}),a=a[c])})}return r},aye=Da.find=function(){var t=Ic.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Ic.join(r,n);try{return vj.statSync(i),i}catch{if(Ic.dirname(r)!==r)return e(Ic.dirname(r),n)}}return e(process.cwd(),t)}});var xj=D((cye,Sj)=>{"use strict";function _j(t){return t instanceof Buffer||t instanceof Date||t instanceof RegExp}function Ej(t){if(t instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(t.length):new Buffer(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function Cj(t){var e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=Cj(r):_j(r)?e[n]=Ej(r):e[n]=cb({},r):e[n]=r}),e}function wj(t,e){return e==="__proto__"?void 0:t[e]}var cb=Sj.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var t=arguments[0],e=Array.prototype.slice.call(arguments,1),r,n,i;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(n=wj(t,s),r=wj(o,s),r!==t)if(typeof r!="object"||r===null){t[s]=r;return}else if(Array.isArray(r)){t[s]=Cj(r);return}else if(_j(r)){t[s]=Ej(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){t[s]=cb({},r);return}else{t[s]=cb(n,r);return}})}),t}});var kj=D((lye,Aj)=>{"use strict";function qse(t,e){var r=t;e.slice(0,-1).forEach(function(i){r=r[i]||{}});var n=e[e.length-1];return n in r}function Fj(t){return typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Oj(t,e){return e==="constructor"&&typeof t[e]=="function"||e==="__proto__"}Aj.exports=function(t,e){e||(e={});var r={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(r.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?r.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(C){r.bools[C]=!0});var n={};function i(C){return n[C].some(function(k){return r.bools[k]})}Object.keys(e.alias||{}).forEach(function(C){n[C]=[].concat(e.alias[C]),n[C].forEach(function(k){n[k]=[C].concat(n[C].filter(function($){return k!==$}))})}),[].concat(e.string).filter(Boolean).forEach(function(C){r.strings[C]=!0,n[C]&&[].concat(n[C]).forEach(function(k){r.strings[k]=!0})});var o=e.default||{},s={_:[]};function a(C,k){return r.allBools&&/^--[^=]+$/.test(k)||r.strings[C]||r.bools[C]||n[C]}function u(C,k,$){for(var F=C,L=0;L<k.length-1;L++){var S=k[L];if(Oj(F,S))return;F[S]===void 0&&(F[S]={}),(F[S]===Object.prototype||F[S]===Number.prototype||F[S]===String.prototype)&&(F[S]={}),F[S]===Array.prototype&&(F[S]=[]),F=F[S]}var I=k[k.length-1];Oj(F,I)||((F===Object.prototype||F===Number.prototype||F===String.prototype)&&(F={}),F===Array.prototype&&(F=[]),F[I]===void 0||r.bools[I]||typeof F[I]=="boolean"?F[I]=$:Array.isArray(F[I])?F[I].push($):F[I]=[F[I],$])}function c(C,k,$){if(!($&&r.unknownFn&&!a(C,$)&&r.unknownFn($)===!1)){var F=!r.strings[C]&&Fj(k)?Number(k):k;u(s,C.split("."),F),(n[C]||[]).forEach(function(L){u(s,L.split("."),F)})}}Object.keys(r.bools).forEach(function(C){c(C,o[C]===void 0?!1:o[C])});var l=[];t.indexOf("--")!==-1&&(l=t.slice(t.indexOf("--")+1),t=t.slice(0,t.indexOf("--")));for(var f=0;f<t.length;f++){var h=t[f],d,p;if(/^--.+=/.test(h)){var v=h.match(/^--([^=]+)=([\s\S]*)$/);d=v[1];var g=v[2];r.bools[d]&&(g=g!=="false"),c(d,g,h)}else if(/^--no-.+/.test(h))d=h.match(/^--no-(.+)/)[1],c(d,!1,h);else if(/^--.+/.test(h))d=h.match(/^--(.+)/)[1],p=t[f+1],p!==void 0&&!/^(-|--)[^-]/.test(p)&&!r.bools[d]&&!r.allBools&&(!n[d]||!i(d))?(c(d,p,h),f+=1):/^(true|false)$/.test(p)?(c(d,p==="true",h),f+=1):c(d,r.strings[d]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var w=h.slice(1,-1).split(""),x=!1,y=0;y<w.length;y++){if(p=h.slice(y+2),p==="-"){c(w[y],p,h);continue}if(/[A-Za-z]/.test(w[y])&&p[0]==="="){c(w[y],p.slice(1),h),x=!0;break}if(/[A-Za-z]/.test(w[y])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(p)){c(w[y],p,h),x=!0;break}if(w[y+1]&&w[y+1].match(/\W/)){c(w[y],h.slice(y+2),h),x=!0;break}else c(w[y],r.strings[w[y]]?"":!0,h)}d=h.slice(-1)[0],!x&&d!=="-"&&(t[f+1]&&!/^(-|--)[^-]/.test(t[f+1])&&!r.bools[d]&&(!n[d]||!i(d))?(c(d,t[f+1],h),f+=1):t[f+1]&&/^(true|false)$/.test(t[f+1])?(c(d,t[f+1]==="true",h),f+=1):c(d,r.strings[d]?"":!0,h))}else if((!r.unknownFn||r.unknownFn(h)!==!1)&&s._.push(r.strings._||!Fj(h)?h:Number(h)),e.stopEarly){s._.push.apply(s._,t.slice(f+1));break}}return Object.keys(o).forEach(function(C){qse(s,C.split("."))||(u(s,C.split("."),o[C]),(n[C]||[]).forEach(function(k){u(s,k.split("."),o[C])}))}),e["--"]?s["--"]=l.slice():l.forEach(function(C){s._.push(C)}),s}});var $j=D((fye,Rj)=>{var jc=bj(),va=require("path").join,Mse=xj(),Tj="/etc",Pj=process.platform==="win32",Nc=Pj?process.env.USERPROFILE:process.env.HOME;Rj.exports=function(t,e,r,n){if(typeof t!="string")throw new Error("rc(name): name *must* be string");r||(r=kj()(process.argv.slice(2))),e=(typeof e=="string"?jc.json(e):e)||{},n=n||jc.parse;var i=jc.env(t+"_"),o=[e],s=[];function a(u){if(!(s.indexOf(u)>=0)){var c=jc.file(u);c&&(o.push(n(c)),s.push(u))}}return Pj||[va(Tj,t,"config"),va(Tj,t+"rc")].forEach(a),Nc&&[va(Nc,".config",t,"config"),va(Nc,".config",t),va(Nc,"."+t,"config"),va(Nc,"."+t+"rc")].forEach(a),a(jc.find("."+t+"rc")),i.config&&a(i.config),r.config&&a(r.config),Mse.apply(null,o.concat([i,r,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var Nj=D((hye,jj)=>{var bi=require("constants"),Use=process.cwd,jh=null,Vse=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return jh||(jh=Use.call(process)),jh};try{process.cwd()}catch{}typeof process.chdir=="function"&&(fb=process.chdir,process.chdir=function(t){jh=null,fb.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,fb));var fb;jj.exports=Hse;function Hse(t){bi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(l,f,h){h&&process.nextTick(h)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,h,d){d&&process.nextTick(d)},t.lchownSync=function(){}),Vse==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(l){function f(h,d,p){var v=Date.now(),g=0;l(h,d,function w(x){if(x&&(x.code==="EACCES"||x.code==="EPERM")&&Date.now()-v<6e4){setTimeout(function(){t.stat(d,function(y,C){y&&y.code==="ENOENT"?l(h,d,w):p(x)})},g),g<100&&(g+=10);return}p&&p(x)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.rename)),t.read=typeof t.read!="function"?t.read:function(l){function f(h,d,p,v,g,w){var x;if(w&&typeof w=="function"){var y=0;x=function(C,k,$){if(C&&C.code==="EAGAIN"&&y<10)return y++,l.call(t,h,d,p,v,g,x);w.apply(this,arguments)}}return l.call(t,h,d,p,v,g,x)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(l){return function(f,h,d,p,v){for(var g=0;;)try{return l.call(t,f,h,d,p,v)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(t.readSync);function e(l){l.lchmod=function(f,h,d){l.open(f,bi.O_WRONLY|bi.O_SYMLINK,h,function(p,v){if(p){d&&d(p);return}l.fchmod(v,h,function(g){l.close(v,function(w){d&&d(g||w)})})})},l.lchmodSync=function(f,h){var d=l.openSync(f,bi.O_WRONLY|bi.O_SYMLINK,h),p=!0,v;try{v=l.fchmodSync(d,h),p=!1}finally{if(p)try{l.closeSync(d)}catch{}else l.closeSync(d)}return v}}function r(l){bi.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,h,d,p){l.open(f,bi.O_SYMLINK,function(v,g){if(v){p&&p(v);return}l.futimes(g,h,d,function(w){l.close(g,function(x){p&&p(w||x)})})})},l.lutimesSync=function(f,h,d){var p=l.openSync(f,bi.O_SYMLINK),v,g=!0;try{v=l.futimesSync(p,h,d),g=!1}finally{if(g)try{l.closeSync(p)}catch{}else l.closeSync(p)}return v}):l.futimes&&(l.lutimes=function(f,h,d,p){p&&process.nextTick(p)},l.lutimesSync=function(){})}function n(l){return l&&function(f,h,d){return l.call(t,f,h,function(p){c(p)&&(p=null),d&&d.apply(this,arguments)})}}function i(l){return l&&function(f,h){try{return l.call(t,f,h)}catch(d){if(!c(d))throw d}}}function o(l){return l&&function(f,h,d,p){return l.call(t,f,h,d,function(v){c(v)&&(v=null),p&&p.apply(this,arguments)})}}function s(l){return l&&function(f,h,d){try{return l.call(t,f,h,d)}catch(p){if(!c(p))throw p}}}function a(l){return l&&function(f,h,d){typeof h=="function"&&(d=h,h=null);function p(v,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return h?l.call(t,f,h,p):l.call(t,f,p)}}function u(l){return l&&function(f,h){var d=h?l.call(t,f,h):l.call(t,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function c(l){if(!l||l.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var qj=D((pye,Bj)=>{var Lj=require("stream").Stream;Bj.exports=zse;function zse(t){return{ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);Lj.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var s=Object.keys(i),a=0,u=s.length;a<u;a++){var c=s[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){o.emit("error",l),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function r(n,i){if(!(this instanceof r))return new r(n,i);Lj.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var u=o[s];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Uj=D((mye,Mj)=>{"use strict";Mj.exports=Wse;var Gse=Object.getPrototypeOf||function(t){return t.__proto__};function Wse(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Gse(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Gj=D((gye,pb)=>{var Ge=require("fs"),Kse=Nj(),Yse=qj(),Jse=Uj(),Nh=require("util"),_t,Bh;typeof Symbol=="function"&&typeof Symbol.for=="function"?(_t=Symbol.for("graceful-fs.queue"),Bh=Symbol.for("graceful-fs.previous")):(_t="___graceful-fs.queue",Bh="___graceful-fs.previous");function Xse(){}function zj(t,e){Object.defineProperty(t,_t,{get:function(){return e}})}var Co=Xse;Nh.debuglog?Co=Nh.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Co=function(){var t=Nh.format.apply(Nh,arguments);t="GFS4: "+t.split(/\n/).join(`
197
+ GFS4: `),console.error(t)});Ge[_t]||(Vj=global[_t]||[],zj(Ge,Vj),Ge.close=function(t){function e(r,n){return t.call(Ge,r,function(i){i||Hj(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Bh,{value:t}),e}(Ge.close),Ge.closeSync=function(t){function e(r){t.apply(Ge,arguments),Hj()}return Object.defineProperty(e,Bh,{value:t}),e}(Ge.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Co(Ge[_t]),require("assert").equal(Ge[_t].length,0)}));var Vj;global[_t]||zj(global,Ge[_t]);pb.exports=db(Jse(Ge));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ge.__patched&&(pb.exports=db(Ge),Ge.__patched=!0);function db(t){Kse(t),t.gracefulify=db,t.createReadStream=k,t.createWriteStream=$;var e=t.readFile;t.readFile=r;function r(S,I,R){return typeof I=="function"&&(R=I,I=null),B(S,I,R);function B(q,K,M,E){return e(q,K,function(b){b&&(b.code==="EMFILE"||b.code==="ENFILE")?ba([B,[q,K,M],b,E||Date.now(),Date.now()]):typeof M=="function"&&M.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=i;function i(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return n(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var o=t.appendFile;o&&(t.appendFile=s);function s(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return o(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var a=t.copyFile;a&&(t.copyFile=u);function u(S,I,R,B){return typeof R=="function"&&(B=R,R=0),q(S,I,R,B);function q(K,M,E,b,_){return a(K,M,E,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(S,I,R){typeof I=="function"&&(R=I,I=null);var B=l.test(process.version)?function(M,E,b,_){return c(M,q(M,E,b,_))}:function(M,E,b,_){return c(M,E,q(M,E,b,_))};return B(S,I,R);function q(K,M,E,b){return function(_,O){_&&(_.code==="EMFILE"||_.code==="ENFILE")?ba([B,[K,M,E],_,b||Date.now(),Date.now()]):(O&&O.sort&&O.sort(),typeof E=="function"&&E.call(this,_,O))}}}if(process.version.substr(0,4)==="v0.8"){var h=Yse(t);w=h.ReadStream,y=h.WriteStream}var d=t.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=x);var p=t.WriteStream;p&&(y.prototype=Object.create(p.prototype),y.prototype.open=C),Object.defineProperty(t,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return y},set:function(S){y=S},enumerable:!0,configurable:!0});var v=w;Object.defineProperty(t,"FileReadStream",{get:function(){return v},set:function(S){v=S},enumerable:!0,configurable:!0});var g=y;Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,I){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function x(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.autoClose&&S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R),S.read())})}function y(S,I){return this instanceof y?(p.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function C(){var S=this;L(S.path,S.flags,S.mode,function(I,R){I?(S.destroy(),S.emit("error",I)):(S.fd=R,S.emit("open",R))})}function k(S,I){return new t.ReadStream(S,I)}function $(S,I){return new t.WriteStream(S,I)}var F=t.open;t.open=L;function L(S,I,R,B){return typeof R=="function"&&(B=R,R=null),q(S,I,R,B);function q(K,M,E,b,_){return F(K,M,E,function(O,j){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ba([q,[K,M,E,b],O,_||Date.now(),Date.now()]):typeof b=="function"&&b.apply(this,arguments)})}}return t}function ba(t){Co("ENQUEUE",t[0].name,t[1]),Ge[_t].push(t),hb()}var Lh;function Hj(){for(var t=Date.now(),e=0;e<Ge[_t].length;++e)Ge[_t][e].length>2&&(Ge[_t][e][3]=t,Ge[_t][e][4]=t);hb()}function hb(){if(clearTimeout(Lh),Lh=void 0,Ge[_t].length!==0){var t=Ge[_t].shift(),e=t[0],r=t[1],n=t[2],i=t[3],o=t[4];if(i===void 0)Co("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Co("TIMEOUT",e.name,r);var s=r.pop();typeof s=="function"&&s.call(null,n)}else{var a=Date.now()-o,u=Math.max(o-i,1),c=Math.min(u*1.2,100);a>=c?(Co("RETRY",e.name,r),e.apply(null,r.concat([i]))):Ge[_t].push(t)}Lh===void 0&&(Lh=setTimeout(hb,0))}}});var Wj=D(wa=>{"use strict";var Zse=wa&&wa.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wa,"__esModule",{value:!0});wa.readCAFileSync=void 0;var Qse=Zse(Gj());function eae(t){try{let e=Qse.default.readFileSync(t,"utf8"),r="-----END CERTIFICATE-----";return e.split(r).filter(i=>!!i.trim()).map(i=>`${i.trimLeft()}${r}`)}catch(e){if(e.code==="ENOENT")return;throw e}}wa.readCAFileSync=eae});var Kj=D(So=>{"use strict";var tae=So&&So.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rae=So&&So.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&tae(e,t,r)};Object.defineProperty(So,"__esModule",{value:!0});rae(Wj(),So)});var Xj=D((vye,Jj)=>{Jj.exports=Yj;function xo(t,e){if(typeof Object.setPrototypeOf=="function")return Object.setPrototypeOf(t,e);t.__proto__=e}function Yj(){this.list=[];var t=null;Object.defineProperty(this,"root",{get:function(){return t},set:function(e){t=e,this.list.length&&xo(this.list[this.list.length-1],e)},enumerable:!0,configurable:!0})}Yj.prototype={get length(){return this.list.length},get keys(){var t=[];for(var e in this.list[0])t.push(e);return t},get snapshot(){var t={};return this.keys.forEach(function(e){t[e]=this.get(e)},this),t},get store(){return this.list[0]},push:function(t){return typeof t!="object"&&(t={valueOf:t}),this.list.length>=1&&xo(this.list[this.list.length-1],t),xo(t,this.root),this.list.push(t)},pop:function(){return this.list.length>=2&&xo(this.list[this.list.length-2],this.root),this.list.pop()},unshift:function(t){return xo(t,this.list[0]||this.root),this.list.unshift(t)},shift:function(){return this.list.length===1&&xo(this.list[0],this.root),this.list.shift()},get:function(t){return this.list[0][t]},set:function(t,e,r){return this.length||this.push({}),r&&this.list[0].hasOwnProperty(t)&&this.push({}),this.list[0][t]=e},forEach:function(t,e){for(var r in this.list[0])t.call(e,r,this.list[0][r])},slice:function(){return this.list.slice.apply(this.list,arguments)},splice:function(){for(var t=this.list.splice.apply(this.list,arguments),e=0,r=this.list.length;e<r;e++)xo(this.list[e],this.list[e+1]||this.root);return t}}});var t8=D(Fo=>{Fo.parse=Fo.decode=nae;Fo.stringify=Fo.encode=Zj;Fo.safe=_a;Fo.unsafe=qh;var mb=typeof process<"u"&&process.platform==="win32"?`\r
198
198
  `:`
199
199
  `;function Zj(t,e){var r=[],n="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var i=e.whitespace?" = ":"=";return Object.keys(t).forEach(function(o,s,a){var u=t[o];u&&Array.isArray(u)?u.forEach(function(c){n+=_a(o+"[]")+i+_a(c)+`
200
- `}):u&&typeof u=="object"?r.push(o):n+=_a(o)+i+_a(u)+mb}),e.section&&n.length&&(n="["+_a(e.section)+"]"+mb+n),r.forEach(function(o,s,a){var u=Qj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=Zj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=mb),n+=l}),n}function Qj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function rae(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=qh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=qh(c[2]);if(l!=="__proto__"){var f=c[3]?qh(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=Qj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,v){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function e8(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function _a(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&e8(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function qh(t,e){if(t=(t||"").trim(),e8(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var o8=D((Nn,i8)=>{var r8=Xj(),Lc=require("path"),Mh=require("fs"),gb=t8(),yb=require("events").EventEmitter,nae=require("url"),iae=require("http"),Nn=i8.exports=function(){for(var t=[].slice.call(arguments),e=new Ft;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?sae(r):r)}return e},bye=Nn.find=function(){var t=Lc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Lc.join(r,n);try{return Mh.statSync(i),i}catch{if(Lc.dirname(r)!==r)return e(Lc.dirname(r),n)}}return e(__dirname,t)},oae=Nn.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return gb.parse(t);else try{return JSON.parse(t)}catch{return gb.parse(t)}},sae=Nn.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Lc.join.apply(null,t),r;try{r=Mh.readFileSync(e,"utf-8")}catch{return}return oae(r,e,"json")},wye=Nn.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(n)]=e[i]);return r};Nn.ConfigChain=Ft;function Ft(){yb.apply(this),r8.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var n8={constructor:{value:Ft}};Object.keys(yb.prototype).forEach(function(t){n8[t]=Object.getOwnPropertyDescriptor(yb.prototype,t)});Ft.prototype=Object.create(r8.prototype,n8);Ft.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var n=0,i=this.list.length;n<i;n++)delete this.list[n][t];return this};Ft.prototype.set=function(t,e,r){var n;if(r){if(n=this.sources[r],n=n&&n.data,!n)return this.emit("error",new Error("not found "+r))}else if(n=this.list[0],!n)return this.emit("error",new Error("cannot set, no confs!"));return n[t]=e,this};Ft.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};Ft.prototype.save=function(t,o,r){typeof o=="function"&&(r=o,o=null);var n=this.sources[t];if(!n||!(n.path||n.source)||!n.data)return this.emit("error",new Error("bad save target: "+t));if(n.source){var i=n.prefix||"";return Object.keys(n.data).forEach(function(a){n.source[i+a]=n.data[a]}),this}var o=o||n.type,s=n.data;return n.type==="json"?s=JSON.stringify(s):s=gb.stringify(s),this._saving++,Mh.writeFile(n.path,s,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};Ft.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),Mh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};Ft.prototype.addEnv=function(t,e,r){r=r||"env";var n=Nn.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};Ft.prototype.addUrl=function(t,e,r){this._await();var n=nae.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),iae.request(t,function(o){var s=[],a=o.headers["content-type"];e||(e=a.indexOf("json")!==-1?"json":a.indexOf("ini")!==-1?"ini":n.match(/\.json$/)?"json":n.match(/\.ini$/)?"ini":null,i.type=e),o.on("data",s.push.bind(s)).on("end",function(){this.addString(Buffer.concat(s),n,e,i)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};Ft.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};Ft.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};Ft.prototype.parse=Nn.parse;Ft.prototype._await=function(){this._awaiting++};Ft.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var a8=D((_ye,s8)=>{s8.exports=function(t){let e=t.indexOf(":");if(e===-1)return Db(t);let r=t.substr(0,e),n=t.substr(e+1);return`${Db(r)}:${Db(n)}`};function Db(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var u8=D(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.envReplace=void 0;var aae=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function uae(t,e){return t.replace(aae,cae.bind(null,e))}Uh.envReplace=uae;function cae(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=fae(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var lae=/([^:-]+)(:?)-(.+)/;function fae(t,e){let r=e.match(lae);if(!r)return t[e];let[,n,i,o]=r;return Object.prototype.hasOwnProperty.call(t,n)?!t[n]&&i?o:t[n]:o}});var c8=D(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.envReplace=void 0;var dae=u8();Object.defineProperty(Vh,"envReplace",{enumerable:!0,get:function(){return dae.envReplace}})});var f8=D(Hh=>{"use strict";var hae=require("fs"),Oo=require("path"),{envReplace:l8}=c8(),pae=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(Oo)!==-1,o=n.indexOf(Boolean)!==-1,s=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(o&&!s&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=l8(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Oo.resolve(process.env.HOME,e.substr(2))),e=Oo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},mae=t=>{t=Oo.resolve(t);let e=!1;for(;Oo.basename(t)==="node_modules";)t=Oo.dirname(t),e=!0;if(e)return t;let r=(n,i)=>{let o=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&o.test(n))return i;try{let s=hae.readdirSync(n);if(s.includes("node_modules")||s.includes("package.json")||s.includes("package.json5")||s.includes("package.yaml")||s.includes("pnpm-workspace.yaml"))return n;let a=Oo.dirname(n);return a===n?i:r(a,i)}catch(s){if(n===i){if(s.code==="ENOENT")return i;throw s}return i}};return r(t,t)};Hh.envReplace=l8;Hh.findPrefix=mae;Hh.parseField=pae});var p8=D(h8=>{"use strict";var Ao=require("path"),gae=require("stream").Stream,zh=require("url"),yae=()=>{},Dae=()=>[],d8=()=>{};h8.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:Ao,cache:Ao,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:Ao,"global-style":Boolean,group:[Number,String],"https-proxy":[null,zh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":Ao,"init-author-name":String,"init-author-email":String,"init-author-url":["",zh],"init-license":String,"init-version":d8,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":Dae(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:gae,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,d8],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:Ao,production:Boolean,progress:Boolean,proxy:[null,!1,zh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,zh],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:Ao,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:Ao,umask:yae,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var D8=D((Fye,y8)=>{"use strict";var{readCAFileSync:vae}=Kj(),m8=require("fs"),vb=require("path"),{ConfigChain:bae}=o8(),wae=a8(),g8=f8(),bb=class extends bae{constructor(e,r){super(e),this.root=e,this._parseField=g8.parseField.bind(null,r||p8())}add(e,r){try{for(let n of Object.keys(e))e[n]=this._parseField(e[n],n)}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let i=m8.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{e[n]&&(r[wae(n.substr(11))]=e[n])}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>vb.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:n=>{r=n},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=vb.resolve(e.prefix);else try{r=g8.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=vae(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=vb.resolve(this.get("prefix"));try{let n=m8.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};y8.exports=bb});var C8=D(E8=>{"use strict";var w8=require("os"),Ln=require("path"),_8=w8.tmpdir(),_ae=process.getuid?process.getuid():process.pid,Eae=()=>!0,v8=process.platform==="win32",b8={editor:()=>process.env.EDITOR||process.env.VISUAL||(v8?"notepad.exe":"vi"),shell:()=>v8?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},Cae={fromString:()=>process.umask()},Ea=w8.homedir();Ea?process.env.HOME=Ea:Ea=Ln.resolve(_8,"npm-"+_ae);var Sae=process.platform==="win32"?"npm-cache":".npm",xae=process.platform==="win32"&&process.env.APPDATA||Ea,Fae=Ln.resolve(xae,Sae),Gh,ko;Object.defineProperty(E8,"defaults",{get:function(){return Gh||(process.env.PREFIX?ko=process.env.PREFIX:process.platform==="win32"?ko=Ln.dirname(process.execPath):(ko=Ln.dirname(Ln.dirname(process.execPath)),process.env.DESTDIR&&(ko=Ln.join(process.env.DESTDIR,ko))),Gh={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:Fae,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:b8.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ln.resolve(ko,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ln.resolve(Ea,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:ko,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:15*60,"send-metrics":!1,shell:b8.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:_8,unicode:Eae(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ln.resolve(Ea,".npmrc"),umask:process.umask?process.umask():Cae.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Gh)}})});var x8=D((Aye,wb)=>{"use strict";var To=require("path"),Oae=D8(),S8=C8();wb.exports=(t,e,r)=>{let n=new Oae(Object.assign({},S8.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let c=require.resolve.paths("npm"),l;try{l=require.resolve("npm",{paths:c.slice(-1)})}catch{o=!0}l&&i.push(n.addFile(To.resolve(To.dirname(l),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=To.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let c=To.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(c,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let c=To.resolve(n.get("prefix"),"etc");n.root.globalconfig=To.resolve(c,"npmrc"),n.root.globalignorefile=To.resolve(c,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let u=n.get("cafile");return u&&n.loadCAFile(u),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(wb.exports,"defaults",{get(){return S8.defaults},enumerable:!0})});var $8=D((kye,R8)=>{var _b=require("url"),F8=x8(),O8=":_authToken",A8=":_auth",k8=":username",T8=":_password";R8.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>n[i]}}:F8()).config,e=e||r.npmrc.get("registry")||F8.defaults.registry,P8(e,r)||Aae(r.npmrc)};function P8(t,e){let r=_b.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=Tae(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:P8(_b.resolve(t,"."),e);r.pathname=_b.resolve(kae(n),"..")||"/"}}function Aae(t){return t.get("_auth")?{token:Wh(t.get("_auth")),type:"Basic"}:void 0}function kae(t){return t[t.length-1]==="/"?t:t+"/"}function Tae(t,e){let r=Pae(e.get(t+O8)||e.get(t+"/"+O8));if(r)return r;let n=e.get(t+k8)||e.get(t+"/"+k8),i=e.get(t+T8)||e.get(t+"/"+T8),o=Rae(n,i);if(o)return o;let s=$ae(e.get(t+A8)||e.get(t+"/"+A8));if(s)return s}function Wh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function Pae(t){return t?{token:Wh(t),type:"Bearer"}:void 0}function Rae(t,e){if(!t||!e)return;let r=Buffer.from(Wh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function $ae(t){return t?{token:Wh(t),type:"Basic"}:void 0}});var IL=D((Iwe,Vn)=>{var ot=require("fs"),Zb=require("os"),fr=require("path"),bL=require("crypto"),ln={fs:ot.constants,os:Zb.constants},wL="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",EL=/XXXXXX/,vue=3,CL=(ln.O_CREAT||ln.fs.O_CREAT)|(ln.O_EXCL||ln.fs.O_EXCL)|(ln.O_RDWR||ln.fs.O_RDWR),bue=Zb.platform()==="win32",wue=ln.EBADF||ln.os.errno.EBADF,_ue=ln.ENOENT||ln.os.errno.ENOENT,SL=448,xL=384,Eue="exit",Pa=[],FL=ot.rmdirSync.bind(ot),OL=!1;function Cue(t,e){return ot.rm(t,{recursive:!0},e)}function AL(t){return ot.rmSync(t,{recursive:!0})}function Qb(t,e){let r=Ra(t,e),n=r[0],i=r[1];try{PL(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=TL(n);ot.stat(a,function(u){if(!u)return o-- >0?s():i(new Error("Could not get a unique tmp filename, max tries reached "+a));i(null,a)})}catch(a){i(a)}})()}function ew(t){let e=Ra(t),r=e[0];PL(r);let n=r.tries;do{let i=TL(r);try{ot.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function Sue(t,e){let r=Ra(t,e),n=r[0],i=r[1];Qb(n,function(s,a){if(s)return i(s);ot.open(a,CL,n.mode||xL,function(c,l){if(c)return i(c);if(n.discardDescriptor)return ot.close(l,function(h){return i(h,a,void 0,Yb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,l,Yb(a,f?-1:l,n,!1))}})})}function xue(t){let e=Ra(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=ew(r);var o=ot.openSync(i,CL,r.mode||xL);return r.discardDescriptor&&(ot.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Yb(i,n?-1:o,r,!0)}}function Fue(t,e){let r=Ra(t,e),n=r[0],i=r[1];Qb(n,function(s,a){if(s)return i(s);ot.mkdir(a,n.mode||SL,function(c){if(c)return i(c);i(null,a,kL(a,n,!1))})})}function Oue(t){let e=Ra(t),r=e[0],n=ew(r);return ot.mkdirSync(n,r.mode||SL),{name:n,removeCallback:kL(n,r,!0)}}function Aue(t,e){let r=function(n){if(n&&!Xb(n))return e(n);e()};0<=t[0]?ot.close(t[0],function(){ot.unlink(t[1],r)}):ot.unlink(t[1],r)}function kue(t){let e=null;try{0<=t[0]&&ot.closeSync(t[0])}catch(r){if(!Rue(r)&&!Xb(r))throw r}finally{try{ot.unlinkSync(t[1])}catch(r){Xb(r)||(e=r)}}if(e!==null)throw e}function Yb(t,e,r,n){let i=gp(kue,[e,t],n),o=gp(Aue,[e,t],n,i);return r.keep||Pa.unshift(i),n?i:o}function kL(t,e,r){let n=e.unsafeCleanup?Cue:ot.rmdir.bind(ot),i=e.unsafeCleanup?AL:FL,o=gp(i,t,r),s=gp(n,t,r,o);return e.keep||Pa.unshift(o),r?o:s}function gp(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Pa.indexOf(a);return u>=0&&Pa.splice(u,1),i=!0,r||t===FL||t===AL?t(e):t(e,s||function(){})}}}function Tue(){if(OL)for(;Pa.length;)try{Pa[0]()}catch{}}function _L(t){let e=[],r=null;try{r=bL.randomBytes(t)}catch{r=bL.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(wL[r[n]%wL.length]);return e.join("")}function Pue(t){return t===null||tr(t)||!t.trim()}function tr(t){return typeof t>"u"}function Ra(t,e){if(typeof t=="function")return[{},t];if(tr(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function TL(t){let e=t.tmpdir;if(!tr(t.name))return fr.join(e,t.dir,t.name);if(!tr(t.template))return fr.join(e,t.dir,t.template).replace(EL,_L(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",_L(12),t.postfix?"-"+t.postfix:""].join("");return fr.join(e,t.dir,r)}function PL(t){t.tmpdir=$L(t);let e=t.tmpdir;if(tr(t.name)||Kb(t.name,"name",e),tr(t.dir)||Kb(t.dir,"dir",e),!tr(t.template)&&(Kb(t.template,"template",e),!t.template.match(EL)))throw new Error(`Invalid template, found "${t.template}".`);if(!tr(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=tr(t.name)?t.tries||vue:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=tr(t.dir)?"":fr.relative(e,Jb(t.dir,e)),t.template=tr(t.template)?void 0:fr.relative(e,Jb(t.template,e)),t.template=Pue(t.template)?void 0:fr.relative(t.dir,t.template),t.name=tr(t.name)?void 0:t.name,t.prefix=tr(t.prefix)?"":t.prefix,t.postfix=tr(t.postfix)?"":t.postfix}function Jb(t,e){return t.startsWith(e)?fr.resolve(t):fr.resolve(fr.join(e,t))}function Kb(t,e,r){if(e==="name"){if(fr.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=fr.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(fr.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=Jb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function Rue(t){return RL(t,-wue,"EBADF")}function Xb(t){return RL(t,-_ue,"ENOENT")}function RL(t,e,r){return bue?t.code===r:t.code===r&&t.errno===e}function $ue(){OL=!0}function $L(t){return fr.resolve(t&&t.tmpdir||Zb.tmpdir())}process.addListener(Eue,Tue);Object.defineProperty(Vn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return $L()}});Vn.exports.dir=Fue;Vn.exports.dirSync=Oue;Vn.exports.file=Sue;Vn.exports.fileSync=xue;Vn.exports.tmpName=Qb;Vn.exports.tmpNameSync=ew;Vn.exports.setGracefulCleanup=$ue});var ww=ce(bw(),1),{program:A,createCommand:dce,createArgument:hce,createOption:pce,CommanderError:mce,InvalidArgumentError:gce,InvalidOptionArgumentError:yce,Command:Dce,Argument:vce,Option:bce,Help:wce}=ww.default;var Ir={name:"@capgo/cli",version:"4.26.4",description:"A CLI to upload to capgo servers",author:"github.com/riderx",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLIl#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli"],main:"dist/index.js",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js",test:"npx --yes ts-node -T src/index.ts","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",test_rls:"ts-node ./test/test_headers_rls.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js"},devDependencies:{"@antfu/eslint-config":"^3.9.2","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^6.2.0","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.8.1","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.46.0","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.6","@types/node":"^22.8.4","@types/prettyjson":"^0.0.33","@types/semver":"7.5.8","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.15.0","@typescript-eslint/parser":"^8.15.0","@vercel/ncc":"^0.38.3","adm-zip":"^0.5.16","ci-info":"^4.1.0",commander:"12.1.0",esbuild:"^0.24.0",eslint:"9.15.0","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",ky:"^1.7.2","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",semver:"^7.6.3",tmp:"^0.2.3","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.2.3",typescript:"5.7.2"}};var Ca=require("node:fs"),N8=require("node:process");var At=ce(Te(),1),No=require("node:process"),Gn=ce(require("node:readline"),1),Up=ce(require("node:readline"),1),Rw=require("node:tty"),ul=ce(Bp(),1);function SB({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function $w(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(SB(),"")}function Iw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jw={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){textLen=e.length(n),i=i||0,o=o||1,i<0&&(i=textLen+i),o<0&&(o=textLen+o);for(var s="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],f=e.length(l);if(a>=i-(f==2?1:0))if(a+f<=o)s+=l;else break;a+=f}return s}})(jw);var xB=jw.exports,FB=Iw(xB),OB=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},AB=Iw(OB);function Na(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=$w(t),t.length===0))return 0;t=t.replace(AB()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let o=i.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(FB.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var qp=10,Sw=(t=0)=>e=>`\x1B[${e+t}m`,xw=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Fw=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ie={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],blackBright:[90,39],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Ie.modifier);var kB=Object.keys(Ie.color),TB=Object.keys(Ie.bgColor);[...kB,...TB];function PB(){let t=new Map;for(let[e,r]of Object.entries(Ie)){for(let[n,i]of Object.entries(r))Ie[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ie[n],t.set(i[0],i[1]);Object.defineProperty(Ie,e,{value:r,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:t,enumerable:!1}),Ie.color.close="\x1B[39m",Ie.bgColor.close="\x1B[49m",Ie.color.ansi=Sw(),Ie.color.ansi256=xw(),Ie.color.ansi16m=Fw(),Ie.bgColor.ansi=Sw(qp),Ie.bgColor.ansi256=xw(qp),Ie.bgColor.ansi16m=Fw(qp),Object.defineProperties(Ie,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ie.rgbToAnsi256(...Ie.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(e)),enumerable:!1}}),Ie}var RB=PB(),fl=new Set(["\x1B","\x9B"]),$B=39,Vp="\x07",Nw="[",IB="]",Lw="m",Hp=`${IB}8;;`,Ow=t=>`${fl.values().next().value}${Nw}${t}${Lw}`,Aw=t=>`${fl.values().next().value}${Hp}${t}${Vp}`,jB=t=>t.split(" ").map(e=>Na(e)),Mp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Na($w(t[t.length-1]));for(let[a,u]of n.entries()){let c=Na(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),fl.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(Hp)),i){o?u===Vp&&(i=!1,o=!1):u===Lw&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},NB=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Na(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},LB=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=jB(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Na(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),Mp(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){Mp(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){Mp(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>NB(c)));let u=[...a.join(`
201
- `)];for(let[c,l]of u.entries()){if(n+=l,fl.has(l)){let{groups:h}=new RegExp(`(?:\\${Nw}(?<code>\\d+)m|\\${Hp}(?<uri>.*)${Vp})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===$B?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=RB.codes.get(Number(i));u[c+1]===`
200
+ `}):u&&typeof u=="object"?r.push(o):n+=_a(o)+i+_a(u)+mb}),e.section&&n.length&&(n="["+_a(e.section)+"]"+mb+n),r.forEach(function(o,s,a){var u=Qj(o).join("\\."),c=(e.section?e.section+".":"")+u,l=Zj(t[o],{section:c,whitespace:e.whitespace});n.length&&l.length&&(n+=mb),n+=l}),n}function Qj(t){return t.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function nae(t){var e={},r=e,n=null,i=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=t.split(/[\r\n]+/g);return o.forEach(function(s,a,u){if(!(!s||s.match(/^\s*[;#]/))){var c=s.match(i);if(c){if(c[1]!==void 0){if(n=qh(c[1]),n==="__proto__"){r={};return}r=e[n]=e[n]||{};return}var l=qh(c[2]);if(l!=="__proto__"){var f=c[3]?qh(c[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}if(l.length>2&&l.slice(-2)==="[]"){if(l=l.substring(0,l.length-2),l==="__proto__")return;r[l]?Array.isArray(r[l])||(r[l]=[r[l]]):r[l]=[]}Array.isArray(r[l])?r[l].push(f):r[l]=f}}}}),Object.keys(e).filter(function(s,a,u){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var c=Qj(s),l=e,f=c.pop(),h=f.replace(/\\\./g,".");return c.forEach(function(d,p,v){d!=="__proto__"&&((!l[d]||typeof l[d]!="object")&&(l[d]={}),l=l[d])}),l===e&&h===f?!1:(l[h]=e[s],!0)}).forEach(function(s,a,u){delete e[s]}),e}function e8(t){return t.charAt(0)==='"'&&t.slice(-1)==='"'||t.charAt(0)==="'"&&t.slice(-1)==="'"}function _a(t){return typeof t!="string"||t.match(/[=\r\n]/)||t.match(/^\[/)||t.length>1&&e8(t)||t!==t.trim()?JSON.stringify(t):t.replace(/;/g,"\\;").replace(/#/g,"\\#")}function qh(t,e){if(t=(t||"").trim(),e8(t)){t.charAt(0)==="'"&&(t=t.substr(1,t.length-2));try{t=JSON.parse(t)}catch{}}else{for(var r=!1,n="",i=0,o=t.length;i<o;i++){var s=t.charAt(i);if(r)"\\;#".indexOf(s)!==-1?n+=s:n+="\\"+s,r=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?r=!0:n+=s}}return r&&(n+="\\"),n.trim()}return t}});var o8=D((Nn,i8)=>{var r8=Xj(),Lc=require("path"),Mh=require("fs"),gb=t8(),yb=require("events").EventEmitter,iae=require("url"),oae=require("http"),Nn=i8.exports=function(){for(var t=[].slice.call(arguments),e=new Ft;t.length;){var r=t.shift();r&&e.push(typeof r=="string"?aae(r):r)}return e},wye=Nn.find=function(){var t=Lc.join.apply(null,[].slice.call(arguments));function e(r,n){var i=Lc.join(r,n);try{return Mh.statSync(i),i}catch{if(Lc.dirname(r)!==r)return e(Lc.dirname(r),n)}}return e(__dirname,t)},sae=Nn.parse=function(t,e,r){if(t=""+t,r)if(r==="json")if(this.emit)try{return JSON.parse(t)}catch(n){this.emit("error",n)}else return JSON.parse(t);else return gb.parse(t);else try{return JSON.parse(t)}catch{return gb.parse(t)}},aae=Nn.json=function(){var t=[].slice.call(arguments).filter(function(n){return n!=null}),e=Lc.join.apply(null,t),r;try{r=Mh.readFileSync(e,"utf-8")}catch{return}return sae(r,e,"json")},_ye=Nn.env=function(t,e){e=e||process.env;var r={},n=t.length;for(var i in e)i.indexOf(t)===0&&(r[i.substring(n)]=e[i]);return r};Nn.ConfigChain=Ft;function Ft(){yb.apply(this),r8.apply(this,arguments),this._awaiting=0,this._saving=0,this.sources={}}var n8={constructor:{value:Ft}};Object.keys(yb.prototype).forEach(function(t){n8[t]=Object.getOwnPropertyDescriptor(yb.prototype,t)});Ft.prototype=Object.create(r8.prototype,n8);Ft.prototype.del=function(t,e){if(e){var r=this.sources[e];if(r=r&&r.data,!r)return this.emit("error",new Error("not found "+e));delete r[t]}else for(var n=0,i=this.list.length;n<i;n++)delete this.list[n][t];return this};Ft.prototype.set=function(t,e,r){var n;if(r){if(n=this.sources[r],n=n&&n.data,!n)return this.emit("error",new Error("not found "+r))}else if(n=this.list[0],!n)return this.emit("error",new Error("cannot set, no confs!"));return n[t]=e,this};Ft.prototype.get=function(t,e){return e?(e=this.sources[e],e&&(e=e.data),e&&Object.hasOwnProperty.call(e,t)?e[t]:void 0):this.list[0][t]};Ft.prototype.save=function(t,o,r){typeof o=="function"&&(r=o,o=null);var n=this.sources[t];if(!n||!(n.path||n.source)||!n.data)return this.emit("error",new Error("bad save target: "+t));if(n.source){var i=n.prefix||"";return Object.keys(n.data).forEach(function(a){n.source[i+a]=n.data[a]}),this}var o=o||n.type,s=n.data;return n.type==="json"?s=JSON.stringify(s):s=gb.stringify(s),this._saving++,Mh.writeFile(n.path,s,"utf8",function(a){if(this._saving--,a)return r?r(a):this.emit("error",a);this._saving===0&&(r&&r(),this.emit("save"))}.bind(this)),this};Ft.prototype.addFile=function(t,e,r){r=r||t;var n={__source__:r};return this.sources[r]={path:t,type:e},this.push(n),this._await(),Mh.readFile(t,"utf8",function(i,o){i&&this.emit("error",i),this.addString(o,t,e,n)}.bind(this)),this};Ft.prototype.addEnv=function(t,e,r){r=r||"env";var n=Nn.env(t,e);return this.sources[r]={data:n,source:e,prefix:t},this.add(n,r)};Ft.prototype.addUrl=function(t,e,r){this._await();var n=iae.format(t);r=r||n;var i={__source__:r};return this.sources[r]={href:n,type:e},this.push(i),oae.request(t,function(o){var s=[],a=o.headers["content-type"];e||(e=a.indexOf("json")!==-1?"json":a.indexOf("ini")!==-1?"ini":n.match(/\.json$/)?"json":n.match(/\.ini$/)?"ini":null,i.type=e),o.on("data",s.push.bind(s)).on("end",function(){this.addString(Buffer.concat(s),n,e,i)}.bind(this)).on("error",this.emit.bind(this,"error"))}.bind(this)).on("error",this.emit.bind(this,"error")).end(),this};Ft.prototype.addString=function(t,e,r,n){return t=this.parse(t,e,r),this.add(t,n),this};Ft.prototype.add=function(t,e){if(e&&typeof e=="object"){var r=this.list.indexOf(e);if(r===-1)return this.emit("error",new Error("bad marker"));this.splice(r,1,t),e=e.__source__,this.sources[e]=this.sources[e]||{},this.sources[e].data=t,this._resolve()}else typeof e=="string"&&(this.sources[e]=this.sources[e]||{},this.sources[e].data=t),this._await(),this.push(t),process.nextTick(this._resolve.bind(this));return this};Ft.prototype.parse=Nn.parse;Ft.prototype._await=function(){this._awaiting++};Ft.prototype._resolve=function(){this._awaiting--,this._awaiting===0&&this.emit("load",this)}});var a8=D((Eye,s8)=>{s8.exports=function(t){let e=t.indexOf(":");if(e===-1)return Db(t);let r=t.substr(0,e),n=t.substr(e+1);return`${Db(r)}:${Db(n)}`};function Db(t){if(t=t.toLowerCase(),t==="_authtoken")return"_authToken";let e=t[0];for(let r=1;r<t.length;r++)e+=t[r]==="_"?"-":t[r];return e}});var u8=D(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.envReplace=void 0;var uae=/(?<!\\)(\\*)\$\{([^${}]+)\}/g;function cae(t,e){return t.replace(uae,lae.bind(null,e))}Uh.envReplace=cae;function lae(t,e,r,n){if(r.length%2)return e.slice((r.length+1)/2);let i=dae(t,n);if(i===void 0)throw new Error(`Failed to replace env in config: ${e}`);return`${r.slice(r.length/2)}${i}`}var fae=/([^:-]+)(:?)-(.+)/;function dae(t,e){let r=e.match(fae);if(!r)return t[e];let[,n,i,o]=r;return Object.prototype.hasOwnProperty.call(t,n)?!t[n]&&i?o:t[n]:o}});var c8=D(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.envReplace=void 0;var hae=u8();Object.defineProperty(Vh,"envReplace",{enumerable:!0,get:function(){return hae.envReplace}})});var f8=D(Hh=>{"use strict";var pae=require("fs"),Oo=require("path"),{envReplace:l8}=c8(),mae=(t,e,r)=>{if(typeof e!="string")return e;let n=[].concat(t[r]),i=n.indexOf(Oo)!==-1,o=n.indexOf(Boolean)!==-1,s=n.indexOf(String)!==-1,a=n.indexOf(Number)!==-1;if(e=`${e}`.trim(),/^".*"$/.test(e))try{e=JSON.parse(e)}catch{throw new Error(`Failed parsing JSON config key ${r}: ${e}`)}if(o&&!s&&e==="")return!0;switch(e){case"true":return!0;case"false":return!1;case"null":return null;case"undefined":return}return e=l8(e,process.env),i&&((process.platform==="win32"?/^~(\/|\\)/:/^~\//).test(e)&&process.env.HOME&&(e=Oo.resolve(process.env.HOME,e.substr(2))),e=Oo.resolve(e)),a&&!isNaN(e)&&(e=Number(e)),e},gae=t=>{t=Oo.resolve(t);let e=!1;for(;Oo.basename(t)==="node_modules";)t=Oo.dirname(t),e=!0;if(e)return t;let r=(n,i)=>{let o=/^[a-zA-Z]:(\\|\/)?$/;if(n==="/"||process.platform==="win32"&&o.test(n))return i;try{let s=pae.readdirSync(n);if(s.includes("node_modules")||s.includes("package.json")||s.includes("package.json5")||s.includes("package.yaml")||s.includes("pnpm-workspace.yaml"))return n;let a=Oo.dirname(n);return a===n?i:r(a,i)}catch(s){if(n===i){if(s.code==="ENOENT")return i;throw s}return i}};return r(t,t)};Hh.envReplace=l8;Hh.findPrefix=gae;Hh.parseField=mae});var p8=D(h8=>{"use strict";var Ao=require("path"),yae=require("stream").Stream,zh=require("url"),Dae=()=>{},vae=()=>[],d8=()=>{};h8.types={access:[null,"restricted","public"],"allow-same-version":Boolean,"always-auth":Boolean,also:[null,"dev","development"],audit:Boolean,"auth-type":["legacy","sso","saml","oauth"],"bin-links":Boolean,browser:[null,String],ca:[null,String,Array],cafile:Ao,cache:Ao,"cache-lock-stale":Number,"cache-lock-retries":Number,"cache-lock-wait":Number,"cache-max":Number,"cache-min":Number,cert:[null,String],cidr:[null,String,Array],color:["always",Boolean],depth:Number,description:Boolean,dev:Boolean,"dry-run":Boolean,editor:String,"engine-strict":Boolean,force:Boolean,"fetch-retries":Number,"fetch-retry-factor":Number,"fetch-retry-mintimeout":Number,"fetch-retry-maxtimeout":Number,git:String,"git-tag-version":Boolean,"commit-hooks":Boolean,global:Boolean,globalconfig:Ao,"global-style":Boolean,group:[Number,String],"https-proxy":[null,zh],"user-agent":String,"ham-it-up":Boolean,heading:String,"if-present":Boolean,"ignore-prepublish":Boolean,"ignore-scripts":Boolean,"init-module":Ao,"init-author-name":String,"init-author-email":String,"init-author-url":["",zh],"init-license":String,"init-version":d8,json:Boolean,key:[null,String],"legacy-bundling":Boolean,link:Boolean,"local-address":vae(),loglevel:["silent","error","warn","notice","http","timing","info","verbose","silly"],logstream:yae,"logs-max":Number,long:Boolean,maxsockets:Number,message:String,"metrics-registry":[null,String],"node-options":[null,String],"node-version":[null,d8],"no-proxy":[null,String,Array],offline:Boolean,"onload-script":[null,String],only:[null,"dev","development","prod","production"],optional:Boolean,"package-lock":Boolean,otp:[null,String],"package-lock-only":Boolean,parseable:Boolean,"prefer-offline":Boolean,"prefer-online":Boolean,prefix:Ao,production:Boolean,progress:Boolean,proxy:[null,!1,zh],provenance:Boolean,"read-only":Boolean,"rebuild-bundle":Boolean,registry:[null,zh],rollback:Boolean,save:Boolean,"save-bundle":Boolean,"save-dev":Boolean,"save-exact":Boolean,"save-optional":Boolean,"save-prefix":String,"save-prod":Boolean,scope:String,"script-shell":[null,String],"scripts-prepend-node-path":[!1,!0,"auto","warn-only"],searchopts:String,searchexclude:[null,String],searchlimit:Number,searchstaleness:Number,"send-metrics":Boolean,shell:String,shrinkwrap:Boolean,"sign-git-tag":Boolean,"sso-poll-frequency":Number,"sso-type":[null,"oauth","saml"],"strict-ssl":Boolean,tag:String,timing:Boolean,tmp:Ao,unicode:Boolean,"unsafe-perm":Boolean,usage:Boolean,user:[Number,String],userconfig:Ao,umask:Dae,version:Boolean,"tag-version-prefix":String,versions:Boolean,viewer:String,_exit:Boolean}});var D8=D((Oye,y8)=>{"use strict";var{readCAFileSync:bae}=Kj(),m8=require("fs"),vb=require("path"),{ConfigChain:wae}=o8(),_ae=a8(),g8=f8(),bb=class extends wae{constructor(e,r){super(e),this.root=e,this._parseField=g8.parseField.bind(null,r||p8())}add(e,r){try{for(let n of Object.keys(e))e[n]=this._parseField(e[n],n)}catch(n){throw n}return super.add(e,r)}addFile(e,r){r=r||e;let n={__source__:r};this.sources[r]={path:e,type:"ini"},this.push(n),this._await();try{let i=m8.readFileSync(e,"utf8");this.addString(i,e,"ini",n)}catch(i){if(i.code==="ENOENT")this.add({},n);else return`Issue while reading "${e}". ${i.message}`}}addEnv(e){e=e||process.env;let r={};return Object.keys(e).filter(n=>/^npm_config_/i.test(n)).forEach(n=>{e[n]&&(r[_ae(n.substr(11))]=e[n])}),super.addEnv("",r,"env")}loadPrefix(){let e=this.list[0];Object.defineProperty(this,"prefix",{enumerable:!0,set:n=>{let i=this.get("global");this[i?"globalPrefix":"localPrefix"]=n},get:()=>this.get("global")?this.globalPrefix:this.localPrefix}),Object.defineProperty(this,"globalPrefix",{enumerable:!0,set:n=>{this.set("prefix",n)},get:()=>vb.resolve(this.get("prefix"))});let r;if(Object.defineProperty(this,"localPrefix",{enumerable:!0,set:n=>{r=n},get:()=>r}),Object.prototype.hasOwnProperty.call(e,"prefix"))r=vb.resolve(e.prefix);else try{r=g8.findPrefix(process.cwd())}catch(n){throw n}return r}loadCAFile(e){if(!e)return;let r=bae(e);r&&this.set("ca",r)}loadUser(){let e=this.root;if(this.get("global"))return;if(process.env.SUDO_UID){e.user=Number(process.env.SUDO_UID);return}let r=vb.resolve(this.get("prefix"));try{let n=m8.statSync(r);e.user=n.uid}catch(n){if(n.code==="ENOENT")return;throw n}}};y8.exports=bb});var C8=D(E8=>{"use strict";var w8=require("os"),Ln=require("path"),_8=w8.tmpdir(),Eae=process.getuid?process.getuid():process.pid,Cae=()=>!0,v8=process.platform==="win32",b8={editor:()=>process.env.EDITOR||process.env.VISUAL||(v8?"notepad.exe":"vi"),shell:()=>v8?process.env.COMSPEC||"cmd.exe":process.env.SHELL||"/bin/bash"},Sae={fromString:()=>process.umask()},Ea=w8.homedir();Ea?process.env.HOME=Ea:Ea=Ln.resolve(_8,"npm-"+Eae);var xae=process.platform==="win32"?"npm-cache":".npm",Fae=process.platform==="win32"&&process.env.APPDATA||Ea,Oae=Ln.resolve(Fae,xae),Gh,ko;Object.defineProperty(E8,"defaults",{get:function(){return Gh||(process.env.PREFIX?ko=process.env.PREFIX:process.platform==="win32"?ko=Ln.dirname(process.execPath):(ko=Ln.dirname(Ln.dirname(process.execPath)),process.env.DESTDIR&&(ko=Ln.join(process.env.DESTDIR,ko))),Gh={access:null,"allow-same-version":!1,"always-auth":!1,also:null,audit:!0,"auth-type":"legacy","bin-links":!0,browser:null,ca:null,cafile:null,cache:Oae,"cache-lock-stale":6e4,"cache-lock-retries":10,"cache-lock-wait":1e4,"cache-max":1/0,"cache-min":10,cert:null,cidr:null,color:process.env.NO_COLOR==null,depth:1/0,description:!0,dev:!1,"dry-run":!1,editor:b8.editor(),"engine-strict":!1,force:!1,"fetch-retries":2,"fetch-retry-factor":10,"fetch-retry-mintimeout":1e4,"fetch-retry-maxtimeout":6e4,git:"git","git-tag-version":!0,"commit-hooks":!0,global:!1,globalconfig:Ln.resolve(ko,"etc","npmrc"),"global-style":!1,group:process.platform==="win32"?0:process.env.SUDO_GID||process.getgid&&process.getgid(),"ham-it-up":!1,heading:"npm","if-present":!1,"ignore-prepublish":!1,"ignore-scripts":!1,"init-module":Ln.resolve(Ea,".npm-init.js"),"init-author-name":"","init-author-email":"","init-author-url":"","init-version":"1.0.0","init-license":"ISC",json:!1,key:null,"legacy-bundling":!1,link:!1,"local-address":void 0,loglevel:"notice",logstream:process.stderr,"logs-max":10,long:!1,maxsockets:50,message:"%s","metrics-registry":null,"node-options":null,offline:!1,"onload-script":!1,only:null,optional:!0,otp:null,"package-lock":!0,"package-lock-only":!1,parseable:!1,"prefer-offline":!1,"prefer-online":!1,prefix:ko,production:process.env.NODE_ENV==="production",progress:!process.env.TRAVIS&&!process.env.CI,provenance:!1,proxy:null,"https-proxy":null,"no-proxy":null,"user-agent":"npm/{npm-version} node/{node-version} {platform} {arch}","read-only":!1,"rebuild-bundle":!0,registry:"https://registry.npmjs.org/",rollback:!0,save:!0,"save-bundle":!1,"save-dev":!1,"save-exact":!1,"save-optional":!1,"save-prefix":"^","save-prod":!1,scope:"","script-shell":null,"scripts-prepend-node-path":"warn-only",searchopts:"",searchexclude:null,searchlimit:20,searchstaleness:15*60,"send-metrics":!1,shell:b8.shell(),shrinkwrap:!0,"sign-git-tag":!1,"sso-poll-frequency":500,"sso-type":"oauth","strict-ssl":!0,tag:"latest","tag-version-prefix":"v",timing:!1,tmp:_8,unicode:Cae(),"unsafe-perm":process.platform==="win32"||process.platform==="cygwin"||!(process.getuid&&process.setuid&&process.getgid&&process.setgid)||process.getuid()!==0,usage:!1,user:process.platform==="win32"?0:"nobody",userconfig:Ln.resolve(Ea,".npmrc"),umask:process.umask?process.umask():Sae.fromString("022"),version:!1,versions:!1,viewer:process.platform==="win32"?"browser":"man",_exit:!0},Gh)}})});var x8=D((kye,wb)=>{"use strict";var To=require("path"),Aae=D8(),S8=C8();wb.exports=(t,e,r)=>{let n=new Aae(Object.assign({},S8.defaults,r),e);n.add(Object.assign({},t),"cli");let i=[],o=!1;if(require.resolve.paths){let c=require.resolve.paths("npm"),l;try{l=require.resolve("npm",{paths:c.slice(-1)})}catch{o=!0}l&&i.push(n.addFile(To.resolve(To.dirname(l),"..","npmrc"),"builtin"))}n.addEnv(),n.loadPrefix();let s=To.resolve(n.localPrefix,".npmrc"),a=n.get("userconfig");if(!n.get("global")&&s!==a?i.push(n.addFile(s,"project")):n.add({},"project"),n.get("workspace-prefix")&&n.get("workspace-prefix")!==s){let c=To.resolve(n.get("workspace-prefix"),".npmrc");i.push(n.addFile(c,"workspace"))}if(i.push(n.addFile(n.get("userconfig"),"user")),n.get("prefix")){let c=To.resolve(n.get("prefix"),"etc");n.root.globalconfig=To.resolve(c,"npmrc"),n.root.globalignorefile=To.resolve(c,"npmignore")}i.push(n.addFile(n.get("globalconfig"),"global")),n.loadUser();let u=n.get("cafile");return u&&n.loadCAFile(u),{config:n,warnings:i.filter(Boolean),failedToLoadBuiltInConfig:o}};Object.defineProperty(wb.exports,"defaults",{get(){return S8.defaults},enumerable:!0})});var $8=D((Tye,R8)=>{var _b=require("url"),F8=x8(),O8=":_authToken",A8=":_auth",k8=":username",T8=":_password";R8.exports=function(){let e,r;arguments.length>=2?(e=arguments[0],r=Object.assign({},arguments[1])):typeof arguments[0]=="string"?e=arguments[0]:r=Object.assign({},arguments[0]),r=r||{};let n=r.npmrc;return r.npmrc=(r.npmrc?{config:{get:i=>n[i]}}:F8()).config,e=e||r.npmrc.get("registry")||F8.defaults.registry,P8(e,r)||kae(r.npmrc)};function P8(t,e){let r=_b.parse(t,!1,!0),n;for(;n!=="/"&&r.pathname!==n;){n=r.pathname||"/";let i="//"+r.host+n.replace(/\/$/,""),o=Pae(i,e.npmrc);if(o)return o;if(!e.recursive)return/\/$/.test(t)?void 0:P8(_b.resolve(t,"."),e);r.pathname=_b.resolve(Tae(n),"..")||"/"}}function kae(t){return t.get("_auth")?{token:Wh(t.get("_auth")),type:"Basic"}:void 0}function Tae(t){return t[t.length-1]==="/"?t:t+"/"}function Pae(t,e){let r=Rae(e.get(t+O8)||e.get(t+"/"+O8));if(r)return r;let n=e.get(t+k8)||e.get(t+"/"+k8),i=e.get(t+T8)||e.get(t+"/"+T8),o=$ae(n,i);if(o)return o;let s=Iae(e.get(t+A8)||e.get(t+"/"+A8));if(s)return s}function Wh(t){return t.replace(/^\$\{?([^}]*)\}?$/,function(e,r){return process.env[r]})}function Rae(t){return t?{token:Wh(t),type:"Bearer"}:void 0}function $ae(t,e){if(!t||!e)return;let r=Buffer.from(Wh(e),"base64").toString("utf8");return{token:Buffer.from(t+":"+r,"utf8").toString("base64"),type:"Basic",password:r,username:t}}function Iae(t){return t?{token:Wh(t),type:"Basic"}:void 0}});var jL=D((jwe,Vn)=>{var ot=require("fs"),Zb=require("os"),fr=require("path"),wL=require("crypto"),ln={fs:ot.constants,os:Zb.constants},_L="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",CL=/XXXXXX/,bue=3,SL=(ln.O_CREAT||ln.fs.O_CREAT)|(ln.O_EXCL||ln.fs.O_EXCL)|(ln.O_RDWR||ln.fs.O_RDWR),wue=Zb.platform()==="win32",_ue=ln.EBADF||ln.os.errno.EBADF,Eue=ln.ENOENT||ln.os.errno.ENOENT,xL=448,FL=384,Cue="exit",Pa=[],OL=ot.rmdirSync.bind(ot),AL=!1;function Sue(t,e){return ot.rm(t,{recursive:!0},e)}function kL(t){return ot.rmSync(t,{recursive:!0})}function Qb(t,e){let r=Ra(t,e),n=r[0],i=r[1];try{RL(n)}catch(s){return i(s)}let o=n.tries;(function s(){try{let a=PL(n);ot.stat(a,function(u){if(!u)return o-- >0?s():i(new Error("Could not get a unique tmp filename, max tries reached "+a));i(null,a)})}catch(a){i(a)}})()}function ew(t){let e=Ra(t),r=e[0];RL(r);let n=r.tries;do{let i=PL(r);try{ot.statSync(i)}catch{return i}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function xue(t,e){let r=Ra(t,e),n=r[0],i=r[1];Qb(n,function(s,a){if(s)return i(s);ot.open(a,SL,n.mode||FL,function(c,l){if(c)return i(c);if(n.discardDescriptor)return ot.close(l,function(h){return i(h,a,void 0,Yb(a,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;i(null,a,l,Yb(a,f?-1:l,n,!1))}})})}function Fue(t){let e=Ra(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,i=ew(r);var o=ot.openSync(i,SL,r.mode||FL);return r.discardDescriptor&&(ot.closeSync(o),o=void 0),{name:i,fd:o,removeCallback:Yb(i,n?-1:o,r,!0)}}function Oue(t,e){let r=Ra(t,e),n=r[0],i=r[1];Qb(n,function(s,a){if(s)return i(s);ot.mkdir(a,n.mode||xL,function(c){if(c)return i(c);i(null,a,TL(a,n,!1))})})}function Aue(t){let e=Ra(t),r=e[0],n=ew(r);return ot.mkdirSync(n,r.mode||xL),{name:n,removeCallback:TL(n,r,!0)}}function kue(t,e){let r=function(n){if(n&&!Xb(n))return e(n);e()};0<=t[0]?ot.close(t[0],function(){ot.unlink(t[1],r)}):ot.unlink(t[1],r)}function Tue(t){let e=null;try{0<=t[0]&&ot.closeSync(t[0])}catch(r){if(!$ue(r)&&!Xb(r))throw r}finally{try{ot.unlinkSync(t[1])}catch(r){Xb(r)||(e=r)}}if(e!==null)throw e}function Yb(t,e,r,n){let i=gp(Tue,[e,t],n),o=gp(kue,[e,t],n,i);return r.keep||Pa.unshift(i),n?i:o}function TL(t,e,r){let n=e.unsafeCleanup?Sue:ot.rmdir.bind(ot),i=e.unsafeCleanup?kL:OL,o=gp(i,t,r),s=gp(n,t,r,o);return e.keep||Pa.unshift(o),r?o:s}function gp(t,e,r,n){let i=!1;return function o(s){if(!i){let a=n||o,u=Pa.indexOf(a);return u>=0&&Pa.splice(u,1),i=!0,r||t===OL||t===kL?t(e):t(e,s||function(){})}}}function Pue(){if(AL)for(;Pa.length;)try{Pa[0]()}catch{}}function EL(t){let e=[],r=null;try{r=wL.randomBytes(t)}catch{r=wL.pseudoRandomBytes(t)}for(var n=0;n<t;n++)e.push(_L[r[n]%_L.length]);return e.join("")}function Rue(t){return t===null||tr(t)||!t.trim()}function tr(t){return typeof t>"u"}function Ra(t,e){if(typeof t=="function")return[{},t];if(tr(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function PL(t){let e=t.tmpdir;if(!tr(t.name))return fr.join(e,t.dir,t.name);if(!tr(t.template))return fr.join(e,t.dir,t.template).replace(CL,EL(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",EL(12),t.postfix?"-"+t.postfix:""].join("");return fr.join(e,t.dir,r)}function RL(t){t.tmpdir=IL(t);let e=t.tmpdir;if(tr(t.name)||Kb(t.name,"name",e),tr(t.dir)||Kb(t.dir,"dir",e),!tr(t.template)&&(Kb(t.template,"template",e),!t.template.match(CL)))throw new Error(`Invalid template, found "${t.template}".`);if(!tr(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=tr(t.name)?t.tries||bue:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.dir=tr(t.dir)?"":fr.relative(e,Jb(t.dir,e)),t.template=tr(t.template)?void 0:fr.relative(e,Jb(t.template,e)),t.template=Rue(t.template)?void 0:fr.relative(t.dir,t.template),t.name=tr(t.name)?void 0:t.name,t.prefix=tr(t.prefix)?"":t.prefix,t.postfix=tr(t.postfix)?"":t.postfix}function Jb(t,e){return t.startsWith(e)?fr.resolve(t):fr.resolve(fr.join(e,t))}function Kb(t,e,r){if(e==="name"){if(fr.isAbsolute(t))throw new Error(`${e} option must not contain an absolute path, found "${t}".`);let n=fr.basename(t);if(n===".."||n==="."||n!==t)throw new Error(`${e} option must not contain a path, found "${t}".`)}else{if(fr.isAbsolute(t)&&!t.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${t}".`);let n=Jb(t,r);if(!n.startsWith(r))throw new Error(`${e} option must be relative to "${r}", found "${n}".`)}}function $ue(t){return $L(t,-_ue,"EBADF")}function Xb(t){return $L(t,-Eue,"ENOENT")}function $L(t,e,r){return wue?t.code===r:t.code===r&&t.errno===e}function Iue(){AL=!0}function IL(t){return fr.resolve(t&&t.tmpdir||Zb.tmpdir())}process.addListener(Cue,Pue);Object.defineProperty(Vn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return IL()}});Vn.exports.dir=Oue;Vn.exports.dirSync=Aue;Vn.exports.file=xue;Vn.exports.fileSync=Fue;Vn.exports.tmpName=Qb;Vn.exports.tmpNameSync=ew;Vn.exports.setGracefulCleanup=Iue});var ww=ce(bw(),1),{program:A,createCommand:hce,createArgument:pce,createOption:mce,CommanderError:gce,InvalidArgumentError:yce,InvalidOptionArgumentError:Dce,Command:vce,Argument:bce,Option:wce,Help:_ce}=ww.default;var Ir={name:"@capgo/cli",version:"4.26.6",description:"A CLI to upload to capgo servers",author:"github.com/riderx",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLIl#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli"],main:"dist/index.js",bin:{capgo:"dist/index.js"},engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && node build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js",test:"npx --yes ts-node -T src/index.ts","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",test_rls:"ts-node ./test/test_headers_rls.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js"},devDependencies:{"@antfu/eslint-config":"^3.9.2","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client","@capacitor/cli":"^6.2.0","@capgo/find-package-manager":"^0.0.17","@clack/prompts":"^0.8.1","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver","@supabase/supabase-js":"^2.46.0","@tomasklaen/checksum":"^1.1.0","@types/adm-zip":"^0.5.6","@types/node":"^22.8.4","@types/prettyjson":"^0.0.33","@types/semver":"7.5.8","@types/tmp":"^0.2.6","@typescript-eslint/eslint-plugin":"^8.15.0","@typescript-eslint/parser":"^8.15.0","@vercel/ncc":"^0.38.3","adm-zip":"^0.5.16","ci-info":"^4.1.0",commander:"12.1.0",esbuild:"^0.24.0",eslint:"9.16.0","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",ky:"^1.7.2","latest-version":"^9.0.0",open:"^10.1.0",pkg:"5.8.1",prettyjson:"^1.2.5",semver:"^7.6.3",tmp:"^0.2.3","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"4.2.0","tus-js-client":"^4.2.3",typescript:"5.7.2"}};var Ca=require("node:fs"),N8=require("node:process");var At=ce(Te(),1),No=require("node:process"),Gn=ce(require("node:readline"),1),Up=ce(require("node:readline"),1),Rw=require("node:tty"),ul=ce(Bp(),1);function xB({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function $w(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(xB(),"")}function Iw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jw={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var i=n.charCodeAt(0),o=n.length==2?n.charCodeAt(1):0,s=i;return 55296<=i&&i<=56319&&56320<=o&&o<=57343&&(i&=1023,o&=1023,s=i<<10|o,s+=65536),s==12288||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":s==8361||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||s==172||s==175||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":s==161||s==164||167<=s&&s<=168||s==170||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||s==198||s==208||215<=s&&s<=216||222<=s&&s<=225||s==230||232<=s&&s<=234||236<=s&&s<=237||s==240||242<=s&&s<=243||247<=s&&s<=250||s==252||s==254||s==257||s==273||s==275||s==283||294<=s&&s<=295||s==299||305<=s&&s<=307||s==312||319<=s&&s<=322||s==324||328<=s&&s<=331||s==333||338<=s&&s<=339||358<=s&&s<=359||s==363||s==462||s==464||s==466||s==468||s==470||s==472||s==474||s==476||s==593||s==609||s==708||s==711||713<=s&&s<=715||s==717||s==720||728<=s&&s<=731||s==733||s==735||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||s==1025||1040<=s&&s<=1103||s==1105||s==8208||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||s==8240||8242<=s&&s<=8243||s==8245||s==8251||s==8254||s==8308||s==8319||8321<=s&&s<=8324||s==8364||s==8451||s==8453||s==8457||s==8467||s==8470||8481<=s&&s<=8482||s==8486||s==8491||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||s==8585||8592<=s&&s<=8601||8632<=s&&s<=8633||s==8658||s==8660||s==8679||s==8704||8706<=s&&s<=8707||8711<=s&&s<=8712||s==8715||s==8719||s==8721||s==8725||s==8730||8733<=s&&s<=8736||s==8739||s==8741||8743<=s&&s<=8748||s==8750||8756<=s&&s<=8759||8764<=s&&s<=8765||s==8776||s==8780||s==8786||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||s==8853||s==8857||s==8869||s==8895||s==8978||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||s==9675||9678<=s&&s<=9681||9698<=s&&s<=9701||s==9711||9733<=s&&s<=9734||s==9737||9742<=s&&s<=9743||9748<=s&&s<=9749||s==9756||s==9758||s==9792||s==9794||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||s==9839||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||s==9955||9960<=s&&s<=9983||s==10045||s==10071||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||s==65533||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"},e.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var i=r(n),o=0,s=0;s<i.length;s++)o=o+this.characterLength(i[s]);return o},e.slice=function(n,i,o){textLen=e.length(n),i=i||0,o=o||1,i<0&&(i=textLen+i),o<0&&(o=textLen+o);for(var s="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],f=e.length(l);if(a>=i-(f==2?1:0))if(a+f<=o)s+=l;else break;a+=f}return s}})(jw);var FB=jw.exports,OB=Iw(FB),AB=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},kB=Iw(AB);function Na(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=$w(t),t.length===0))return 0;t=t.replace(kB()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let o=i.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(OB.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var qp=10,Sw=(t=0)=>e=>`\x1B[${e+t}m`,xw=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Fw=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ie={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],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],blackBright:[90,39],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(Ie.modifier);var TB=Object.keys(Ie.color),PB=Object.keys(Ie.bgColor);[...TB,...PB];function RB(){let t=new Map;for(let[e,r]of Object.entries(Ie)){for(let[n,i]of Object.entries(r))Ie[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ie[n],t.set(i[0],i[1]);Object.defineProperty(Ie,e,{value:r,enumerable:!1})}return Object.defineProperty(Ie,"codes",{value:t,enumerable:!1}),Ie.color.close="\x1B[39m",Ie.bgColor.close="\x1B[49m",Ie.color.ansi=Sw(),Ie.color.ansi256=xw(),Ie.color.ansi16m=Fw(),Ie.bgColor.ansi=Sw(qp),Ie.bgColor.ansi256=xw(qp),Ie.bgColor.ansi16m=Fw(qp),Object.defineProperties(Ie,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(o=>o+o).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ie.rgbToAnsi256(...Ie.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let o=Math.max(r,n,i)*2;if(o===0)return 30;let s=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return o===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ie.ansi256ToAnsi(Ie.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ie.ansi256ToAnsi(Ie.hexToAnsi256(e)),enumerable:!1}}),Ie}var $B=RB(),fl=new Set(["\x1B","\x9B"]),IB=39,Vp="\x07",Nw="[",jB="]",Lw="m",Hp=`${jB}8;;`,Ow=t=>`${fl.values().next().value}${Nw}${t}${Lw}`,Aw=t=>`${fl.values().next().value}${Hp}${t}${Vp}`,NB=t=>t.split(" ").map(e=>Na(e)),Mp=(t,e,r)=>{let n=[...e],i=!1,o=!1,s=Na($w(t[t.length-1]));for(let[a,u]of n.entries()){let c=Na(u);if(s+c<=r?t[t.length-1]+=u:(t.push(u),s=0),fl.has(u)&&(i=!0,o=n.slice(a+1).join("").startsWith(Hp)),i){o?u===Vp&&(i=!1,o=!1):u===Lw&&(i=!1);continue}s+=c,s===r&&a<n.length-1&&(t.push(""),s=0)}!s&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},LB=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Na(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},BB=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",i,o,s=NB(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let f=Na(a[a.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),f=0),(f>0||r.trim===!1)&&(a[a.length-1]+=" ",f++)),r.hard&&s[c]>e){let h=e-f,d=1+Math.floor((s[c]-h-1)/e);Math.floor((s[c]-1)/e)<d&&a.push(""),Mp(a,l,e);continue}if(f+s[c]>e&&f>0&&s[c]>0){if(r.wordWrap===!1&&f<e){Mp(a,l,e);continue}a.push("")}if(f+s[c]>e&&r.wordWrap===!1){Mp(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>LB(c)));let u=[...a.join(`
201
+ `)];for(let[c,l]of u.entries()){if(n+=l,fl.has(l)){let{groups:h}=new RegExp(`(?:\\${Nw}(?<code>\\d+)m|\\${Hp}(?<uri>.*)${Vp})`).exec(u.slice(c).join(""))||{groups:{}};if(h.code!==void 0){let d=Number.parseFloat(h.code);i=d===IB?void 0:d}else h.uri!==void 0&&(o=h.uri.length===0?void 0:h.uri)}let f=$B.codes.get(Number(i));u[c+1]===`
202
202
  `?(o&&(n+=Aw("")),i&&f&&(n+=Ow(f))):l===`
203
203
  `&&(i&&f&&(n+=Ow(i)),o&&(n+=Aw(o)))}return n};function kw(t,e,r){return String(t).normalize().replace(/\r\n/g,`
204
204
  `).split(`
205
- `).map(n=>LB(n,e,r)).join(`
206
- `)}var BB=Object.defineProperty,qB=(t,e,r)=>e in t?BB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hr=(t,e,r)=>(qB(t,typeof e!="symbol"?e+"":e,r),r);function MB(t,e){if(t===e)return;let r=t.split(`
205
+ `).map(n=>BB(n,e,r)).join(`
206
+ `)}var qB=Object.defineProperty,MB=(t,e,r)=>e in t?qB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hr=(t,e,r)=>(MB(t,typeof e!="symbol"?e+"":e,r),r);function UB(t,e){if(t===e)return;let r=t.split(`
207
207
  `),n=e.split(`
208
- `),i=[];for(let o=0;o<Math.max(r.length,n.length);o++)r[o]!==n[o]&&i.push(o);return i}var Bw=Symbol("clack:cancel");function kt(t){return t===Bw}function al(t,e){t.isTTY&&t.setRawMode(e)}var Tw=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),UB=new Set(["up","down","left","right","space","enter"]),La=class{constructor({render:e,input:r=No.stdin,output:n=No.stdout,...i},o=!0){hr(this,"input"),hr(this,"output"),hr(this,"rl"),hr(this,"opts"),hr(this,"_track",!1),hr(this,"_render"),hr(this,"_cursor",0),hr(this,"state","initial"),hr(this,"value"),hr(this,"error",""),hr(this,"subscribers",new Map),hr(this,"_prevFrame",""),this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=e.bind(this),this._track=o,this.input=r,this.output=n}prompt(){let e=new Rw.WriteStream(0);return e._write=(r,n,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(e),this.rl=Up.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),Up.default.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),al(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),al(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),al(this.input,!1),r(Bw)})})}on(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r}),this.subscribers.set(e,n)}once(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r,once:!0}),this.subscribers.set(e,n)}emit(e,...r){let n=this.subscribers.get(e)??[],i=[];for(let o of n)o.cb(...r),o.once&&i.push(()=>n.splice(n.indexOf(o),1));for(let o of i)o()}unsubscribe(){this.subscribers.clear()}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&!this._track&&Tw.has(r.name)&&this.emit("cursor",Tw.get(r.name)),r?.name&&UB.has(r.name)&&this.emit("cursor",r.name),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}e===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
208
+ `),i=[];for(let o=0;o<Math.max(r.length,n.length);o++)r[o]!==n[o]&&i.push(o);return i}var Bw=Symbol("clack:cancel");function kt(t){return t===Bw}function al(t,e){t.isTTY&&t.setRawMode(e)}var Tw=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),VB=new Set(["up","down","left","right","space","enter"]),La=class{constructor({render:e,input:r=No.stdin,output:n=No.stdout,...i},o=!0){hr(this,"input"),hr(this,"output"),hr(this,"rl"),hr(this,"opts"),hr(this,"_track",!1),hr(this,"_render"),hr(this,"_cursor",0),hr(this,"state","initial"),hr(this,"value"),hr(this,"error",""),hr(this,"subscribers",new Map),hr(this,"_prevFrame",""),this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=e.bind(this),this._track=o,this.input=r,this.output=n}prompt(){let e=new Rw.WriteStream(0);return e._write=(r,n,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(e),this.rl=Up.default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),Up.default.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),al(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),al(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(At.cursor.show),this.output.off("resize",this.render),al(this.input,!1),r(Bw)})})}on(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r}),this.subscribers.set(e,n)}once(e,r){let n=this.subscribers.get(e)??[];n.push({cb:r,once:!0}),this.subscribers.set(e,n)}emit(e,...r){let n=this.subscribers.get(e)??[],i=[];for(let o of n)o.cb(...r),o.once&&i.push(()=>n.splice(n.indexOf(o),1));for(let o of i)o()}unsubscribe(){this.subscribers.clear()}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&!this._track&&Tw.has(r.name)&&this.emit("cursor",Tw.get(r.name)),r?.name&&VB.has(r.name)&&this.emit("cursor",r.name),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}e===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
209
209
  `),al(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=kw(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
210
- `).length-1;this.output.write(At.cursor.move(-999,e*-1))}render(){let e=kw(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(At.cursor.hide);else{let r=MB(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(At.cursor.move(0,n)),this.output.write(At.erase.lines(1));let i=e.split(`
210
+ `).length-1;this.output.write(At.cursor.move(-999,e*-1))}render(){let e=kw(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(At.cursor.hide);else{let r=UB(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(At.cursor.move(0,n)),this.output.write(At.erase.lines(1));let i=e.split(`
211
211
  `);this.output.write(i[n]),this._prevFrame=e,this.output.write(At.cursor.move(0,i.length-n-1));return}else if(r&&r?.length>1){let n=r[0];this.output.write(At.cursor.move(0,n)),this.output.write(At.erase.down());let i=e.split(`
212
212
  `).slice(n);this.output.write(i.join(`
213
- `)),this._prevFrame=e;return}this.output.write(At.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},cl=class extends La{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(At.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var VB=Object.defineProperty,HB=(t,e,r)=>e in t?VB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pw=(t,e,r)=>(HB(t,typeof e!="symbol"?e+"":e,r),r),qw=class extends La{constructor(t){super(t,!1),Pw(this,"options"),Pw(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:e})=>e===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var zB=Object.defineProperty,GB=(t,e,r)=>e in t?zB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,WB=(t,e,r)=>(GB(t,typeof e!="symbol"?e+"":e,r),r),ll=class extends La{constructor(e){super(e),WB(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${ul.default.inverse(ul.default.hidden("_"))}`;else{let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${r}${ul.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}},KB=globalThis.process.platform.startsWith("win");function Mw({input:t=No.stdin,output:e=No.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Gn.createInterface({input:t,output:e,prompt:"",tabSize:1});Gn.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a})=>{if(String(s)===""&&process.exit(0),!r)return;Gn.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Gn.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&process.stdout.write(At.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&process.stdout.write(At.cursor.show),t.isTTY&&!KB&&t.setRawMode(!1),i.terminal=!1,i.close()}}var pr=ce(require("node:process"),1),H=ce(Bp(),1),Lo=ce(Te(),1);function YB(){return pr.default.platform!=="win32"?pr.default.env.TERM!=="linux":!!pr.default.env.CI||!!pr.default.env.WT_SESSION||!!pr.default.env.TERMINUS_SUBLIME||pr.default.env.ConEmuTask==="{cmd::Cmder}"||pr.default.env.TERM_PROGRAM==="Terminus-Sublime"||pr.default.env.TERM_PROGRAM==="vscode"||pr.default.env.TERM==="xterm-256color"||pr.default.env.TERM==="alacritty"||pr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var zp=YB(),Qe=(t,e)=>zp?t:e,JB=Qe("\u25C6","*"),Uw=Qe("\u25A0","x"),Vw=Qe("\u25B2","x"),Kp=Qe("\u25C7","o"),XB=Qe("\u250C","T"),Ke=Qe("\u2502","|"),Bo=Qe("\u2514","\u2014"),Gp=Qe("\u25CF",">"),Wp=Qe("\u25CB"," "),Rce=Qe("\u25FB","[\u2022]"),$ce=Qe("\u25FC","[+]"),Ice=Qe("\u25FB","[ ]"),jce=Qe("\u25AA","\u2022"),Nce=Qe("\u2500","-"),Lce=Qe("\u256E","+"),Bce=Qe("\u251C","+"),qce=Qe("\u256F","+"),ZB=Qe("\u25CF","\u2022"),QB=Qe("\u25C6","*"),eq=Qe("\u25B2","!"),tq=Qe("\u25A0","x"),Yp=t=>{switch(t){case"initial":case"active":return H.default.cyan(JB);case"cancel":return H.default.red(Uw);case"error":return H.default.yellow(Vw);case"submit":return H.default.green(Kp)}},rq=t=>{let{cursor:e,options:r,style:n}=t,i=t.maxItems??1/0,o=Math.max(process.stdout.rows-4,0),s=Math.min(o,Math.max(i,5)),a=0;e>=a+s-3?a=Math.max(Math.min(e-s+3,r.length-s),0):e<a+2&&(a=Math.max(e-2,0));let u=s<r.length&&a>0,c=s<r.length&&a+s<r.length;return r.slice(a,a+s).map((l,f,h)=>{let d=f===0&&u,p=f===h.length-1&&c;return d||p?H.default.dim("..."):n(l,f+a===e)})},Jp=t=>new ll({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${H.default.gray(Ke)}
213
+ `)),this._prevFrame=e;return}this.output.write(At.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},cl=class extends La{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(At.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var HB=Object.defineProperty,zB=(t,e,r)=>e in t?HB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pw=(t,e,r)=>(zB(t,typeof e!="symbol"?e+"":e,r),r),qw=class extends La{constructor(t){super(t,!1),Pw(this,"options"),Pw(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:e})=>e===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var GB=Object.defineProperty,WB=(t,e,r)=>e in t?GB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,KB=(t,e,r)=>(WB(t,typeof e!="symbol"?e+"":e,r),r),ll=class extends La{constructor(e){super(e),KB(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=e.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${ul.default.inverse(ul.default.hidden("_"))}`;else{let r=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.valueWithCursor=`${r}${ul.default.inverse(n[0])}${n.slice(1)}`}})}get cursor(){return this._cursor}},YB=globalThis.process.platform.startsWith("win");function Mw({input:t=No.stdin,output:e=No.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Gn.createInterface({input:t,output:e,prompt:"",tabSize:1});Gn.emitKeypressEvents(t,i),t.isTTY&&t.setRawMode(!0);let o=(s,{name:a})=>{if(String(s)===""&&process.exit(0),!r)return;Gn.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{Gn.clearLine(e,1,()=>{t.once("keypress",o)})})};return n&&process.stdout.write(At.cursor.hide),t.once("keypress",o),()=>{t.off("keypress",o),n&&process.stdout.write(At.cursor.show),t.isTTY&&!YB&&t.setRawMode(!1),i.terminal=!1,i.close()}}var pr=ce(require("node:process"),1),H=ce(Bp(),1),Lo=ce(Te(),1);function JB(){return pr.default.platform!=="win32"?pr.default.env.TERM!=="linux":!!pr.default.env.CI||!!pr.default.env.WT_SESSION||!!pr.default.env.TERMINUS_SUBLIME||pr.default.env.ConEmuTask==="{cmd::Cmder}"||pr.default.env.TERM_PROGRAM==="Terminus-Sublime"||pr.default.env.TERM_PROGRAM==="vscode"||pr.default.env.TERM==="xterm-256color"||pr.default.env.TERM==="alacritty"||pr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var zp=JB(),Qe=(t,e)=>zp?t:e,XB=Qe("\u25C6","*"),Uw=Qe("\u25A0","x"),Vw=Qe("\u25B2","x"),Kp=Qe("\u25C7","o"),ZB=Qe("\u250C","T"),Ke=Qe("\u2502","|"),Bo=Qe("\u2514","\u2014"),Gp=Qe("\u25CF",">"),Wp=Qe("\u25CB"," "),$ce=Qe("\u25FB","[\u2022]"),Ice=Qe("\u25FC","[+]"),jce=Qe("\u25FB","[ ]"),Nce=Qe("\u25AA","\u2022"),Lce=Qe("\u2500","-"),Bce=Qe("\u256E","+"),qce=Qe("\u251C","+"),Mce=Qe("\u256F","+"),QB=Qe("\u25CF","\u2022"),eq=Qe("\u25C6","*"),tq=Qe("\u25B2","!"),rq=Qe("\u25A0","x"),Yp=t=>{switch(t){case"initial":case"active":return H.default.cyan(XB);case"cancel":return H.default.red(Uw);case"error":return H.default.yellow(Vw);case"submit":return H.default.green(Kp)}},nq=t=>{let{cursor:e,options:r,style:n}=t,i=t.maxItems??1/0,o=Math.max(process.stdout.rows-4,0),s=Math.min(o,Math.max(i,5)),a=0;e>=a+s-3?a=Math.max(Math.min(e-s+3,r.length-s),0):e<a+2&&(a=Math.max(e-2,0));let u=s<r.length&&a>0,c=s<r.length&&a+s<r.length;return r.slice(a,a+s).map((l,f,h)=>{let d=f===0&&u,p=f===h.length-1&&c;return d||p?H.default.dim("..."):n(l,f+a===e)})},Jp=t=>new ll({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${H.default.gray(Ke)}
214
214
  ${Yp(this.state)} ${t.message}
215
215
  `,r=t.placeholder?H.default.inverse(t.placeholder[0])+H.default.dim(t.placeholder.slice(1)):H.default.inverse(H.default.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
216
216
  ${H.default.yellow(Ke)} ${n}
@@ -226,33 +226,33 @@ ${H.default.cyan(Bo)}
226
226
  `}}}).prompt()},qo=t=>{let e=(r,n)=>{let i=r.label??String(r.value);switch(n){case"selected":return`${H.default.dim(i)}`;case"active":return`${H.default.green(Gp)} ${i} ${r.hint?H.default.dim(`(${r.hint})`):""}`;case"cancelled":return`${H.default.strikethrough(H.default.dim(i))}`;default:return`${H.default.dim(Wp)} ${H.default.dim(i)}`}};return new qw({options:t.options,initialValue:t.initialValue,render(){let r=`${H.default.gray(Ke)}
227
227
  ${Yp(this.state)} ${t.message}
228
228
  `;switch(this.state){case"submit":return`${r}${H.default.gray(Ke)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${H.default.gray(Ke)} ${e(this.options[this.cursor],"cancelled")}
229
- ${H.default.gray(Ke)}`;default:return`${r}${H.default.cyan(Ke)} ${rq({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,i)=>e(n,i?"active":"inactive")}).join(`
229
+ ${H.default.gray(Ke)}`;default:return`${r}${H.default.cyan(Ke)} ${nq({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,i)=>e(n,i?"active":"inactive")}).join(`
230
230
  ${H.default.cyan(Ke)} `)}
231
231
  ${H.default.cyan(Bo)}
232
232
  `}}}).prompt()};var Xp=(t="")=>{process.stdout.write(`${H.default.gray(Bo)} ${H.default.red(t)}
233
233
 
234
- `)},Y=(t="")=>{process.stdout.write(`${H.default.gray(XB)} ${t}
234
+ `)},Y=(t="")=>{process.stdout.write(`${H.default.gray(ZB)} ${t}
235
235
  `)},X=(t="")=>{process.stdout.write(`${H.default.gray(Ke)}
236
236
  ${H.default.gray(Bo)} ${t}
237
237
 
238
238
  `)},m={message:(t="",{symbol:e=H.default.gray(Ke)}={})=>{let r=[`${H.default.gray(Ke)}`];if(t){let[n,...i]=t.split(`
239
239
  `);r.push(`${e} ${n}`,...i.map(o=>`${H.default.gray(Ke)} ${o}`))}process.stdout.write(`${r.join(`
240
240
  `)}
241
- `)},info:t=>{m.message(t,{symbol:H.default.blue(ZB)})},success:t=>{m.message(t,{symbol:H.default.green(QB)})},step:t=>{m.message(t,{symbol:H.default.green(Kp)})},warn:t=>{m.message(t,{symbol:H.default.yellow(eq)})},warning:t=>{m.warn(t)},error:t=>{m.message(t,{symbol:H.default.red(tq)})}},be=()=>{let t=zp?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=zp?80:120,r,n,i=!1,o="",s=d=>{let p=d>1?"Something went wrong":"Canceled";i&&h(p,d)},a=()=>s(2),u=()=>s(1),c=()=>{process.on("uncaughtExceptionMonitor",a),process.on("unhandledRejection",a),process.on("SIGINT",u),process.on("SIGTERM",u),process.on("exit",s)},l=()=>{process.removeListener("uncaughtExceptionMonitor",a),process.removeListener("unhandledRejection",a),process.removeListener("SIGINT",u),process.removeListener("SIGTERM",u),process.removeListener("exit",s)},f=(d="")=>{i=!0,r=Mw(),o=d.replace(/\.+$/,""),process.stdout.write(`${H.default.gray(Ke)}
241
+ `)},info:t=>{m.message(t,{symbol:H.default.blue(QB)})},success:t=>{m.message(t,{symbol:H.default.green(eq)})},step:t=>{m.message(t,{symbol:H.default.green(Kp)})},warn:t=>{m.message(t,{symbol:H.default.yellow(tq)})},warning:t=>{m.warn(t)},error:t=>{m.message(t,{symbol:H.default.red(rq)})}},be=()=>{let t=zp?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=zp?80:120,r,n,i=!1,o="",s=d=>{let p=d>1?"Something went wrong":"Canceled";i&&h(p,d)},a=()=>s(2),u=()=>s(1),c=()=>{process.on("uncaughtExceptionMonitor",a),process.on("unhandledRejection",a),process.on("SIGINT",u),process.on("SIGTERM",u),process.on("exit",s)},l=()=>{process.removeListener("uncaughtExceptionMonitor",a),process.removeListener("unhandledRejection",a),process.removeListener("SIGINT",u),process.removeListener("SIGTERM",u),process.removeListener("exit",s)},f=(d="")=>{i=!0,r=Mw(),o=d.replace(/\.+$/,""),process.stdout.write(`${H.default.gray(Ke)}
242
242
  `);let p=0,v=0;c(),n=setInterval(()=>{let g=H.default.magenta(t[p]),w=".".repeat(Math.floor(v)).slice(0,3);process.stdout.write(Lo.cursor.move(-999,0)),process.stdout.write(Lo.erase.down(1)),process.stdout.write(`${g} ${o}${w}`),p=p+1<t.length?p+1:0,v=v<t.length?v+.125:0},e)},h=(d="",p=0)=>{o=d??o,i=!1,clearInterval(n);let v=p===0?H.default.green(Kp):p===1?H.default.red(Uw):H.default.red(Vw);process.stdout.write(Lo.cursor.move(-999,0)),process.stdout.write(Lo.erase.down(1)),process.stdout.write(`${v} ${o}
243
- `),l(),r()};return{start:f,stop:h,message:(d="")=>{o=d??o}}};var it=require("node:fs"),kh=require("node:os"),tt=ce(require("node:path")),ar=require("node:process"),vi=ce(hl());var yn=require("fs"),qa=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bun":(0,yn.existsSync)(n)?"pnpm":(0,yn.existsSync)(i)?"yarn":(0,yn.existsSync)(o)?"npm":e},pl=(t=qa(),e=!1)=>{switch(t){case"bun":return e?"bun install":"install";case"pnpm":return e?"pnpm install":"install";case"yarn":return e?"yarn install":"install";case"npm":return e?"npm install":"install";case"unknown":return e?"unknown unknown":"unknown";default:return e?"npm install":"install"}},Hw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bunx":(0,yn.existsSync)(n)?"pnpm exec":(0,yn.existsSync)(i)?"yarn dlx":(0,yn.existsSync)(o)?"npx":e};var fa=ce(M_()),K6=ce(vu()),eb=ce(IC());var ti=class extends Error{response;request;options;constructor(e,r,n){let i=e.status||e.status===0?e.status:"",o=e.statusText||"",s=`${i} ${o}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}};var ss=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var as=t=>t!==null&&typeof t=="object";var wu=(...t)=>{for(let e of t)if((!as(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Lg({},...t)},jg=(t={},e={})=>{let r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(let[o,s]of i.entries())n&&s==="undefined"||s===void 0?r.delete(o):r.set(o,s);return r};function ef(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Lg(t[r]??[],e[r]??[])}var Ng=(t={},e={})=>({beforeRequest:ef(t,e,"beforeRequest"),beforeRetry:ef(t,e,"beforeRetry"),afterResponse:ef(t,e,"afterResponse"),beforeError:ef(t,e,"beforeError")}),Lg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(as(i)){for(let[o,s]of Object.entries(i))as(s)&&o in e&&(s=Lg(e[o],s)),e={...e,[o]:s};as(i.hooks)&&(n=Ng(n,i.hooks),e.hooks=n),as(i.headers)&&(r=jg(r,i.headers),e.headers=r)}return e};var jC=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),NC=typeof globalThis.AbortController=="function",LC=typeof globalThis.ReadableStream=="function",BC=typeof globalThis.FormData=="function",tf=["get","post","put","patch","head","delete"],u9=()=>{};u9();var qC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},rf=2147483647,nf=Symbol("stop"),MC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},UC={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var HC=t=>tf.includes(t)?t.toUpperCase():t,c9=["get","put","head","delete","options","trace"],l9=[408,413,429,500,502,503,504],f9=[413,429,503],VC={limit:2,methods:c9,statusCodes:l9,afterStatusCodes:f9,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},zC=(t={})=>{if(typeof t=="number")return{...VC,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...VC,...t}};async function Bg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new ss(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function qg(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(o),n(e.reason)}let o=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}var GC=(t,e)=>{let r={};for(let n in e)!(n in UC)&&!(n in MC)&&!(n in t)&&(r[n]=e[n]);return r};var _u=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>rf)throw new RangeError(`The \`timeout\` option cannot be greater than ${rf}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let c=await u(n.request,n._options,n._decorateResponse(a.clone()));c instanceof globalThis.Response&&(a=c)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new ti(a,n.request,n._options);for(let c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!LC)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},s=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(let[a,u]of Object.entries(qC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=(await s).clone();if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[a]()};return s}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:jg(this._input.headers,r.headers),hooks:Ng({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:HC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:zC(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(NC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(jC&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(BC&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof ss)throw e;if(e instanceof ti){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let n=Math.min(this._calculateRetryDelay(r),rf);if(this._retryCount<1)throw r;await qg(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===nf)return;return this._retry(e)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=GC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):Bg(r,e,this.abortController,this._options)}_stream(e,r){let n=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let s=e.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){let{done:u,value:c}=await s.read();if(u){o.close();return}if(r){i+=c.byteLength;let l=n===0?0:i/n;r({percent:l,transferredBytes:i,totalBytes:n},c)}o.enqueue(c),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var Mg=t=>{let e=(r,n)=>_u.create(r,wu(t,n));for(let r of tf)e[r]=(n,i)=>_u.create(n,wu(t,i,{method:r}));return e.create=r=>Mg(wu(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Mg(wu(t,r))),e.stop=nf,e},d9=Mg(),Hr=d9;var Y6=ce(ES()),Th=ce(rD());var kc=ce(c6());async function l6(){let t=await(0,kc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function on(t,e=!1){let r=await(0,kc.loadConfig)(),{extConfig:n}=r.app;n&&(n.plugins||(n.plugins={extConfig:{},CapacitorUpdater:{}}),n.plugins.CapacitorUpdater||(n.plugins.CapacitorUpdater={}),e?n=t.config:n.plugins.CapacitorUpdater=t.config.plugins?.CapacitorUpdater,(0,kc.writeConfig)(n,r.app.extConfigFilePath))}var er=".capgo_key",ur=".capgo_key_v2",cr=`${er}.pub`,jn=`${ur}.pub`;var U6="https://capgo.app",V6="https://files.capgo.app",H6="https://api.capgo.app",z6="https://web.capgo.app",J6=20,X6=12e4,wse="package.json",da=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i,Q=t=>t?`
244
- ${Y6.default.render(t)}`:"";function G6(t){return new Promise(e=>{setTimeout(e,t)})}function tb(t){return(0,vi.isMonorepo)(t)?(0,vi.findMonorepoRoot)(t):(0,vi.isNXMonorepo)(t)?(0,vi.findNXMonorepoRoot)(t):t}async function jt(t=tb((0,ar.cwd)()),e=void 0){e&&((0,it.existsSync)(e)||(m.error(`Package.json at ${e} does not exist`),(0,ar.exit)(1)));let r=(0,it.readFileSync)(e||(0,tt.join)(t,wse));return JSON.parse(r)}async function ee(){try{let t=await l6();return t||(m.error("No capacitor config file found, run `cap init` first"),A.error("")),t}catch(t){m.error(`No capacitor config file found, run \`cap init\` first ${Q(t)}`),A.error("")}}async function wo(t){let e=await ee();return e?.config&&(e.config.plugins||(e.config.plugins={extConfig:{},CapacitorUpdater:{}}),e.config.plugins.CapacitorUpdater||(e.config.plugins.CapacitorUpdater={}),e.config.plugins.CapacitorUpdater={...e.config.plugins.CapacitorUpdater,...t},on(e)),e}async function Cr(){try{let t=await ee(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||U6,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||z6,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||V6,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||H6};return t?.config?.plugins?.CapacitorUpdater?.localSupa&&t?.config?.plugins?.CapacitorUpdater?.localSupaAnon&&(m.info("Using custom supabase instance from capacitor.config.json"),e.supaKey=t?.config?.plugins?.CapacitorUpdater?.localSupaAnon,e.supaHost=t?.config?.plugins?.CapacitorUpdater?.localSupa),e}catch{return{host:U6,hostWeb:z6,hostFilesApi:V6,hostApi:H6}}}var _se=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function rb(){let t=await Cr();return Hr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(m.info(`Local config ${Q(t)}`),t))}async function Z6(){let t=await Cr();return Hr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1}))}async function de(t){let e=await rb();return(!e.supaHost||!e.supaKey)&&(m.error("Cannot connect to server please try again later"),A.error("")),(0,fa.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function Ese(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){m.error("Invalid API key or insufficient permissions.");let i=r.map((o,s)=>r.length===1?`"${o}"`:s===r.length-1?`or "${o}"`:`"${o}", `).join("");m.error(`Your key should be: ${i} mode.`),A.error("")}}async function Cse(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function Sse(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function xse(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function Fse(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var xt=(s=>(s[s.none=0]="none",s[s.read=1]="read",s[s.upload=2]="upload",s[s.write=3]="write",s[s.admin=4]="admin",s[s.super_admin=5]="super_admin",s))(xt||{}),Q6=(t,e)=>t>=e;async function ej(t,e,r){let{data:n,error:i}=await t.rpc("get_org_perm_for_apikey",{apikey:e,app_id:r}).single();if(i&&(m.error("Cannot get permissions for organization!"),console.error(i),(0,ar.exit)(1)),n.includes("perm")){let a=null;switch(n){case"perm_none":{a=0;break}case"perm_read":{a=1;break}case"perm_upload":{a=2;break}case"perm_write":{a=3;break}case"perm_admin":{a=4;break}case"perm_owner":{a=5;break}default:n.includes("invite")&&(m.info("Please accept/deny the organization invitation before trying to access the app"),(0,ar.exit)(1)),m.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!0,data:a}}let s=null;switch(n){case"INVALID_APIKEY":{s="INVALID_APIKEY";break}case"NO_APP":{s="NO_APP";break}case"NO_ORG":{s="NO_ORG";break}default:m.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!1,error:s}}async function ha(t,e,r,n,i=!0){let o=await rb();await(n?Fse(t,n,r):xse(t,e))||(m.error(`You need to upgrade your plan to continue to use capgo.
243
+ `),l(),r()};return{start:f,stop:h,message:(d="")=>{o=d??o}}};var it=require("node:fs"),kh=require("node:os"),tt=ce(require("node:path")),ar=require("node:process"),vi=ce(hl());var yn=require("fs"),qa=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bun":(0,yn.existsSync)(n)?"pnpm":(0,yn.existsSync)(i)?"yarn":(0,yn.existsSync)(o)?"npm":e},pl=(t=qa(),e=!1)=>{switch(t){case"bun":return e?"bun install":"install";case"pnpm":return e?"pnpm install":"install";case"yarn":return e?"yarn install":"install";case"npm":return e?"npm install":"install";case"unknown":return e?"unknown unknown":"unknown";default:return e?"npm install":"install"}},Hw=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/pnpm-lock.yaml`,i=`${t}/yarn.lock`,o=`${t}/package-lock.json`;return(0,yn.existsSync)(r)?"bunx":(0,yn.existsSync)(n)?"pnpm exec":(0,yn.existsSync)(i)?"yarn dlx":(0,yn.existsSync)(o)?"npx":e};var fa=ce(M_()),K6=ce(vu()),eb=ce(IC());var ti=class extends Error{response;request;options;constructor(e,r,n){let i=e.status||e.status===0?e.status:"",o=e.statusText||"",s=`${i} ${o}`.trim(),a=s?`status code ${s}`:"an unknown error";super(`Request failed with ${a}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}};var ss=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}};var as=t=>t!==null&&typeof t=="object";var wu=(...t)=>{for(let e of t)if((!as(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Lg({},...t)},jg=(t={},e={})=>{let r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.Headers(e);for(let[o,s]of i.entries())n&&s==="undefined"||s===void 0?r.delete(o):r.set(o,s);return r};function ef(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Lg(t[r]??[],e[r]??[])}var Ng=(t={},e={})=>({beforeRequest:ef(t,e,"beforeRequest"),beforeRetry:ef(t,e,"beforeRetry"),afterResponse:ef(t,e,"afterResponse"),beforeError:ef(t,e,"beforeError")}),Lg=(...t)=>{let e={},r={},n={};for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(as(i)){for(let[o,s]of Object.entries(i))as(s)&&o in e&&(s=Lg(e[o],s)),e={...e,[o]:s};as(i.hooks)&&(n=Ng(n,i.hooks),e.hooks=n),as(i.headers)&&(r=jg(r,i.headers),e.headers=r)}return e};var jC=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),NC=typeof globalThis.AbortController=="function",LC=typeof globalThis.ReadableStream=="function",BC=typeof globalThis.FormData=="function",tf=["get","post","put","patch","head","delete"],c9=()=>{};c9();var qC={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},rf=2147483647,nf=Symbol("stop"),MC={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},UC={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0};var HC=t=>tf.includes(t)?t.toUpperCase():t,l9=["get","put","head","delete","options","trace"],f9=[408,413,429,500,502,503,504],d9=[413,429,503],VC={limit:2,methods:l9,statusCodes:f9,afterStatusCodes:d9,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},zC=(t={})=>{if(typeof t=="number")return{...VC,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...VC,...t}};async function Bg(t,e,r,n){return new Promise((i,o)=>{let s=setTimeout(()=>{r&&r.abort(),o(new ss(t))},n.timeout);n.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(s)})})}async function qg(t,{signal:e}){return new Promise((r,n)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(o),n(e.reason)}let o=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}var GC=(t,e)=>{let r={};for(let n in e)!(n in UC)&&!(n in MC)&&!(n in t)&&(r[n]=e[n]);return r};var _u=class t{static create(e,r){let n=new t(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>rf)throw new RangeError(`The \`timeout\` option cannot be greater than ${rf}`);await Promise.resolve();let a=await n._fetch();for(let u of n._options.hooks.afterResponse){let c=await u(n.request,n._options,n._decorateResponse(a.clone()));c instanceof globalThis.Response&&(a=c)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new ti(a,n.request,n._options);for(let c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!LC)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},s=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(let[a,u]of Object.entries(qC))s[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);let l=(await s).clone();if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}return l[a]()};return s}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:jg(this._input.headers,r.headers),hooks:Ng({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:HC(r.method??this._input.method),prefixUrl:String(r.prefixUrl||""),retry:zC(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(NC){this.abortController=new globalThis.AbortController;let n=this._options.signal??this._input.signal;n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(jC&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){let i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(BC&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(o,{...this.request}),this._options)}}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount>this._options.retry.limit||e instanceof ss)throw e;if(e instanceof ti){if(!this._options.retry.statusCodes.includes(e.response.status))throw e;let n=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(e.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this._options.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}let r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(r){let n=Math.min(this._calculateRetryDelay(r),rf);if(this._retryCount<1)throw r;await qg(n,{signal:this._options.signal});for(let i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===nf)return;return this._retry(e)}}async _fetch(){for(let n of this._options.hooks.beforeRequest){let i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}let e=GC(this.request,this._options),r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,e):Bg(r,e,this.abortController,this._options)}_stream(e,r){let n=Number(e.headers.get("content-length"))||0,i=0;return e.status===204?(r&&r({percent:1,totalBytes:n,transferredBytes:i},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){let s=e.body.getReader();r&&r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a(){let{done:u,value:c}=await s.read();if(u){o.close();return}if(r){i+=c.byteLength;let l=n===0?0:i/n;r({percent:l,transferredBytes:i,totalBytes:n},c)}o.enqueue(c),await a()}await a()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}};var Mg=t=>{let e=(r,n)=>_u.create(r,wu(t,n));for(let r of tf)e[r]=(n,i)=>_u.create(n,wu(t,i,{method:r}));return e.create=r=>Mg(wu(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),Mg(wu(t,r))),e.stop=nf,e},h9=Mg(),Hr=h9;var Y6=ce(ES()),Th=ce(rD());var kc=ce(c6());async function l6(){let t=await(0,kc.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function on(t,e=!1){let r=await(0,kc.loadConfig)(),{extConfig:n}=r.app;n&&(n.plugins||(n.plugins={extConfig:{},CapacitorUpdater:{}}),n.plugins.CapacitorUpdater||(n.plugins.CapacitorUpdater={}),e?n=t.config:n.plugins.CapacitorUpdater=t.config.plugins?.CapacitorUpdater,(0,kc.writeConfig)(n,r.app.extConfigFilePath))}var er=".capgo_key",ur=".capgo_key_v2",cr=`${er}.pub`,jn=`${ur}.pub`;var U6="https://capgo.app",V6="https://files.capgo.app",H6="https://api.capgo.app",z6="https://web.capgo.app",J6=20,X6=12e4,_se="package.json",da=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-z-][0-9a-z-]*))*))?(?:\+([0-9a-z-]+(?:\.[0-9a-z-]+)*))?$/i,Q=t=>t?`
244
+ ${Y6.default.render(t)}`:"";function G6(t){return new Promise(e=>{setTimeout(e,t)})}function tb(t){return(0,vi.isMonorepo)(t)?(0,vi.findMonorepoRoot)(t):(0,vi.isNXMonorepo)(t)?(0,vi.findNXMonorepoRoot)(t):t}async function jt(t=tb((0,ar.cwd)()),e=void 0){e&&((0,it.existsSync)(e)||(m.error(`Package.json at ${e} does not exist`),(0,ar.exit)(1)));let r=(0,it.readFileSync)(e||(0,tt.join)(t,_se));return JSON.parse(r)}async function ee(){try{let t=await l6();return t||(m.error("No capacitor config file found, run `cap init` first"),A.error("")),t}catch(t){m.error(`No capacitor config file found, run \`cap init\` first ${Q(t)}`),A.error("")}}async function wo(t){let e=await ee();return e?.config&&(e.config.plugins||(e.config.plugins={extConfig:{},CapacitorUpdater:{}}),e.config.plugins.CapacitorUpdater||(e.config.plugins.CapacitorUpdater={}),e.config.plugins.CapacitorUpdater={...e.config.plugins.CapacitorUpdater,...t},on(e)),e}async function Cr(){try{let t=await ee(),e={host:t?.config?.plugins?.CapacitorUpdater?.localHost||U6,hostWeb:t?.config?.plugins?.CapacitorUpdater?.localWebHost||z6,hostFilesApi:t?.config?.plugins?.CapacitorUpdater?.localApiFiles||V6,hostApi:t?.config?.plugins?.CapacitorUpdater?.localApi||H6};return t?.config?.plugins?.CapacitorUpdater?.localSupa&&t?.config?.plugins?.CapacitorUpdater?.localSupaAnon&&(m.info("Using custom supabase instance from capacitor.config.json"),e.supaKey=t?.config?.plugins?.CapacitorUpdater?.localSupaAnon,e.supaHost=t?.config?.plugins?.CapacitorUpdater?.localSupa),e}catch{return{host:U6,hostWeb:z6,hostFilesApi:V6,hostApi:H6}}}var Ese=/([A-Za-z0-9]+)\.(java|swift|kt|scala)$/;async function rb(){let t=await Cr();return Hr.get(`${t.hostApi}/private/config`).then(e=>e.json()).then(e=>({...e,...t})).catch(()=>(m.info(`Local config ${Q(t)}`),t))}async function Z6(){let t=await Cr();return Hr.get(`${t.hostFilesApi}/files/config`).then(e=>e.json()).catch(()=>({partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1}))}async function de(t){let e=await rb();return(!e.supaHost||!e.supaKey)&&(m.error("Cannot connect to server please try again later"),A.error("")),(0,fa.createClient)(e.supaHost,e.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:t}}})}async function Cse(t,e,r){let{data:n}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:r}).single();if(!n){m.error("Invalid API key or insufficient permissions.");let i=r.map((o,s)=>r.length===1?`"${o}"`:s===r.length-1?`or "${o}"`:`"${o}", `).join("");m.error(`Your key should be: ${i} mode.`),A.error("")}}async function Sse(t,e){let{data:r}=await t.rpc("is_paying_org",{orgid:e}).single();return r||!1}async function xse(t,e){let{data:r}=await t.rpc("is_trial_org",{orgid:e}).single();return r||0}async function Fse(t,e){let{data:r}=await t.rpc("is_allowed_action_org",{orgid:e}).single();return!!r}async function Ose(t,e,r){let{data:n}=await t.rpc("is_allowed_action",{apikey:r,appid:e}).single();return!!n}var xt=(s=>(s[s.none=0]="none",s[s.read=1]="read",s[s.upload=2]="upload",s[s.write=3]="write",s[s.admin=4]="admin",s[s.super_admin=5]="super_admin",s))(xt||{}),Q6=(t,e)=>t>=e;async function ej(t,e,r){let{data:n,error:i}=await t.rpc("get_org_perm_for_apikey",{apikey:e,app_id:r}).single();if(i&&(m.error("Cannot get permissions for organization!"),console.error(i),(0,ar.exit)(1)),n.includes("perm")){let a=null;switch(n){case"perm_none":{a=0;break}case"perm_read":{a=1;break}case"perm_upload":{a=2;break}case"perm_write":{a=3;break}case"perm_admin":{a=4;break}case"perm_owner":{a=5;break}default:n.includes("invite")&&(m.info("Please accept/deny the organization invitation before trying to access the app"),(0,ar.exit)(1)),m.error(`Invalid output when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!0,data:a}}let s=null;switch(n){case"INVALID_APIKEY":{s="INVALID_APIKEY";break}case"NO_APP":{s="NO_APP";break}case"NO_ORG":{s="NO_ORG";break}default:m.error(`Invalid error when fetching organization permission. Response: ${n}`),(0,ar.exit)(1)}return{okay:!1,error:s}}async function ha(t,e,r,n,i=!0){let o=await rb();await(n?Ose(t,n,r):Fse(t,e))||(m.error(`You need to upgrade your plan to continue to use capgo.
245
245
  Upgrade here: ${o.hostWeb}/dashboard/settings/plans
246
- `),G6(100),Promise.resolve().then(()=>(M6(),q6)).then(c=>{c.default(`${o.hostWeb}/dashboard/settings/plans`)}),G6(500),A.error(""));let[a,u]=await Promise.all([Sse(t,e),Cse(t,e)]);a>0&&i&&!u&&m.warn(`WARNING !!
246
+ `),G6(100),Promise.resolve().then(()=>(M6(),q6)).then(c=>{c.default(`${o.hostWeb}/dashboard/settings/plans`)}),G6(500),A.error(""));let[a,u]=await Promise.all([xse(t,e),Sse(t,e)]);a>0&&i&&!u&&m.warn(`WARNING !!
247
247
  Trial expires in ${a} days, upgrade here: ${o.hostWeb}/dashboard/settings/plans
248
- `)}function pe(t=!1){let e=(0,kh.homedir)(),r,n=`${e}/.capgo`;return(0,it.existsSync)(n)&&(t||m.info(`Use global API key ${n}`),r=(0,it.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,it.existsSync)(n)&&(t||m.info(`Use local API key ${n}`),r=(0,it.readFileSync)(n,"utf8").trim()),r||(m.error(`Cannot find API key in local folder or global, please login first with ${Nt().runner} @capacitor/cli login`),A.error("")),r}async function*nb(t){let e=await(0,it.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,tt.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*nb(n):yield n}}function pa(t){let e=/\.(jpg|jpeg|png|gif|bmp|webp)$/i,r=t.match(e);if(r)switch(r[1].toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"webp":return"image/webp"}return null}async function ib(){let t=(0,ar.cwd)(),e=!1,r=(0,tt.resolve)(t,"tsconfig.json");(0,it.existsSync)(r)&&(e=!0);for await(let n of nb(t)){if(n.includes("angular.json"))return m.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return m.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return m.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return m.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return m.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return m.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,tt.dirname)(n),o=await jt(i);if(o.dependencies){if(o.dependencies.react)return m.info("Found react project test"),e?"react-ts":"react-js";if(o.dependencies.vue)return m.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function tj(t,e){return t==="angular-js"||t==="angular-ts"?e?"src/main.ts":"src/main.js":t==="nextjs-js"||t==="nextjs-ts"?e?"src/app/layout.tsx":"src/app/layout.js":t==="svelte-js"||t==="svelte-ts"||t==="vue-js"||t==="vue-ts"?e?"src/main.ts":"src/main.js":t==="react-js"||t==="react-ts"?e?"src/index.tsx":"src/index.js":null}async function rj(t){return t==="angular"?(m.info("Angular project detected"),"build"):t==="nuxtjs"?(m.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(m.info("Nextjs project detected"),m.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),m.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Pe({message:"Do you want to continue?"})||(m.error("Aborted"),A.error("")),"build"):(t==="sveltekit"&&(m.info("Sveltekit project detected"),m.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),m.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Pe({message:"Do you want to continue?"})||(m.error("Aborted"),A.error(""))),"build")}async function nj(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,ar.cwd)(),n=r.split("/").length;for await(let i of nb(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,m.info(`Found main file here ${i}`);break}return e}async function ob(t,e){return t.from("app_versions").upsert(e,{onConflict:"name,app_id"}).eq("app_id",e.app_id).eq("name",e.name)}async function ij(t,e,r){let n={app_id:e,name:r,version:0};try{let o=await t.functions.invoke("private/upload_link",{body:JSON.stringify(n)});if(o.error){if(o.error instanceof fa.FunctionsHttpError){let s=await o.error.context.json();m.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){m.error(`Cannot get upload url ${Q(i)}`)}return""}async function*oj(t){let e=(0,it.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,tt.join)(t,r.name);r.isDirectory()?yield*oj(n):yield n}}async function sj(t){let e=[];for await(let r of oj(t)){let n=(0,it.readFileSync)(r),i=await(0,K6.checksum)(n,"sha256"),o=(0,tt.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function Ph(t){return(0,kh.platform)()==="win32"?Ase(t):Ose(t)}function Ose(t){let e=new eb.default;return e.addLocalFolder(t),e.toBuffer()}async function Ase(t){m.info("Zipping file windows mode");let e=new eb.default,r=(n,i)=>{let o=(0,it.readdirSync)(n);for(let s of o){let a=(0,tt.join)(n,s),u=(0,it.statSync)(a);if(u.isFile()){let c=(0,it.readFileSync)(a);e.addFile((0,tt.join)(i,s).split(tt.sep).join("/"),c)}else u.isDirectory()&&r(a,(0,tt.join)(i,s))}};return r(t,""),e.toBuffer()}async function aj(t,e,r,n,i,o,s){return new Promise((a,u)=>{Fe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new Th.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,metadataForPartialUploads:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/zip"},headers:{Authorization:t},onError(l){if(l instanceof Th.DetailedError){let f=l.originalResponse?.getBody(),h=JSON.parse(f||'{"error": "unknown error"}');u(h.status||h.error||h.message||"unknown error")}else u(l.message||l.toString()||"unknown error")},onProgress(l,f){let h=(l/f*100).toFixed(2);o.message(`Uploaded ${h}%`)},async onSuccess(){await Fe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),a(!0)}}).start()})}async function uj(t,e,r){let n={app_id:e,name:r};try{let o=await t.functions.invoke("private/delete_failed_version",{body:JSON.stringify(n),method:"DELETE"});if(o.error){if(o.error instanceof fa.FunctionsHttpError){let s=await o.error.context.json();m.error(`Cannot delete failed version: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot delete failed version: ${o.error.message}`);return}return o.data?.status}catch(i){if(i instanceof fa.FunctionsHttpError){let o=await i.context.json();m.error(`Cannot delete failed version: ${o.message||JSON.stringify(o)}`)}else m.error(`Cannot delete failed version: ${Q(i)}`)}}async function Rh(t,e){if(!e.app_id||!e.name||!e.created_by)return m.error("missing app_id, name, or created_by"),Promise.reject(new Error("missing app_id, name, or created_by"));let{data:r,error:n}=await t.from("channels").select("enable_progressive_deploy, secondary_version_percentage, second_version").eq("app_id",e.app_id).eq("name",e.name).single();if(r&&!n){if(r.enable_progressive_deploy){if(m.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&m.warn("Latest progressive deploy has not finished"),e.second_version=e.version,!r.second_version)return m.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));e.version=r.second_version,e.secondary_version_percentage=.1,m.info("Started new progressive upload!")}return t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single()}return t.from("channels").insert(e).select().single()}async function Fe(t,e){try{let r=await rb(),n=await Hr.post(`${r.host}/private/events`,{json:e,headers:{capgkey:t},timeout:1e4,retry:3}).json();n.error&&m.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function ma(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v5");r&&(m.error("Cannot get the list of organizations - exiting"),m.error(`Error ${JSON.stringify(r)}`),A.error(""));let i=n.filter(u=>!!e.find(c=>c===u.role));i.length===0&&(m.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),A.error(""));let o=i.length>1?await qo({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;kt(o)&&(m.error("Canceled organization selection, exiting"),A.error(""));let s=o,a=n.find(u=>u.gid===s);return m.info(`Using the organization "${a.name}" as the app owner`),a}var _o=t=>t.replace(/\./g,"--");async function me(t,e,r=["all"]){await Ese(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(m.error("Cannot auth user with apikey"),A.error("")),o}async function Sr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(m.error(`Cannot get organization id for app id ${e}`),Q(n),A.error("")),r.owner_org}function ga(t){return new Date(t||"").toLocaleString()}var W6=!1,la="npm",$c="install",Qv="npx";function Nt(){if(W6)return{pm:la,command:$c,installCommand:`${la} ${$c}`,runner:Qv};let t=tb((0,ar.cwd)());return la=qa(t,"npm"),$c=pl(la),W6=!0,Qv=Hw(t),{pm:la,command:$c,installCommand:`${la} ${$c}`,runner:Qv}}function cj(t){return(0,it.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,tt.join)(t,n.name);return n.isDirectory()?cj(i):i.split(`node_modules${tt.sep}`)[1]||i})}async function sb(t,e){let r=e?e.split(","):[],n;try{n=await jt("",t)}catch(l){m.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",l),A.error("")}let i=t?tt.default.resolve(t).replace("package.json",""):tb((0,ar.cwd)()),{dependencies:o}=n;o||(m.error("Missing dependencies section in package.json"),A.error(""));for(let[l,f]of Object.entries(o))typeof f!="string"&&(m.error(`Invalid dependency ${l}: ${f}, expected string, got ${typeof f}`),A.error(""));let s=r.length===0?[(0,tt.join)((0,ar.cwd)(),"node_modules")]:r;if(!s.some(l=>(0,it.existsSync)(l))){let l=qa(i,"npm"),f=pl(l);m.error(`Missing node_modules folder at ${s.join(", ")}, please run ${l} ${f}`),A.error("")}let u=!1,c=await Promise.all(Object.entries(o).map(async([l,f])=>{let h=!1,d=!1;for(let p of s){let v=(0,tt.join)(p,l);if((0,it.existsSync)(v)){h=!0;try{if(cj(v).some(w=>_se.test(w))){d=!0;break}}catch(g){m.error(`Error reading node_modules files for ${l} package in ${p}`),console.error(g),A.error("")}}}if(!h){u=!0;let p=qa(i,"npm"),v=pl(p);return m.error(`Missing dependency ${l}, please run ${p} ${v}`),{name:l,version:f}}return{name:l,version:f,native:d}})).catch(()=>[]);return(u||c.find(l=>l.native===void 0))&&A.error(""),c}async function kse(t,e,r){let{data:n,error:i}=await t.from("channels").select("version(checksum)").eq("name",r).eq("app_id",e).single(),o=n;return i||o===null||!o.version||!o.version.checksum?null:o.version.checksum}async function Tse(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
248
+ `)}function pe(t=!1){let e=(0,kh.homedir)(),r,n=`${e}/.capgo`;return(0,it.existsSync)(n)&&(t||m.info(`Use global API key ${n}`),r=(0,it.readFileSync)(n,"utf8").trim()),n=".capgo",!r&&(0,it.existsSync)(n)&&(t||m.info(`Use local API key ${n}`),r=(0,it.readFileSync)(n,"utf8").trim()),r||(m.error(`Cannot find API key in local folder or global, please login first with ${Nt().runner} @capacitor/cli login`),A.error("")),r}async function*nb(t){let e=await(0,it.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,tt.resolve)(t,r.name);r.isDirectory()&&!r.name.startsWith(".")&&!r.name.startsWith("node_modules")&&!r.name.startsWith("dist")?yield*nb(n):yield n}}function pa(t){let e=/\.(jpg|jpeg|png|gif|bmp|webp)$/i,r=t.match(e);if(r)switch(r[1].toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"webp":return"image/webp"}return null}async function ib(){let t=(0,ar.cwd)(),e=!1,r=(0,tt.resolve)(t,"tsconfig.json");(0,it.existsSync)(r)&&(e=!0);for await(let n of nb(t)){if(n.includes("angular.json"))return m.info("Found angular project"),e?"angular-ts":"angular-js";if(n.includes("nuxt.config.js")||n.includes("nuxt.config.ts"))return m.info("Found nuxtjs project"),e?"nuxtjs-ts":"nuxtjs-js";if(n.includes("next.config.js")||n.includes("next.config.mjs"))return m.info("Found nextjs project"),e?"nextjs-ts":"nextjs-js";if(n.includes("svelte.config.js"))return m.info("Found sveltekit project"),e?"sveltekit-ts":"sveltekit-js";if(n.includes("rolluconfig.js"))return m.info("Found svelte project"),e?"svelte-ts":"svelte-js";if(n.includes("vue.config.js"))return m.info("Found vue project"),e?"vue-ts":"vue-js";if(n.includes("package.json")){let i=(0,tt.dirname)(n),o=await jt(i);if(o.dependencies){if(o.dependencies.react)return m.info("Found react project test"),e?"react-ts":"react-js";if(o.dependencies.vue)return m.info("Found vue project"),e?"vue-ts":"vue-js"}}}return"unknown"}function tj(t,e){return t==="angular-js"||t==="angular-ts"?e?"src/main.ts":"src/main.js":t==="nextjs-js"||t==="nextjs-ts"?e?"src/app/layout.tsx":"src/app/layout.js":t==="svelte-js"||t==="svelte-ts"||t==="vue-js"||t==="vue-ts"?e?"src/main.ts":"src/main.js":t==="react-js"||t==="react-ts"?e?"src/index.tsx":"src/index.js":null}async function rj(t){return t==="angular"?(m.info("Angular project detected"),"build"):t==="nuxtjs"?(m.info("Nuxtjs project detected"),"generate"):t==="nextjs"?(m.info("Nextjs project detected"),m.warn("Please make sure you have configured static export in your next.config.js: https://nextjs.org/docs/pages/building-your-application/deploying/static-exports"),m.warn("Please make sure you have the output: 'export' and distDir: 'dist' in your next.config.js"),await Pe({message:"Do you want to continue?"})||(m.error("Aborted"),A.error("")),"build"):(t==="sveltekit"&&(m.info("Sveltekit project detected"),m.warn("Please make sure you have the adapter-static installed: https://kit.svelte.dev/docs/adapter-static"),m.warn("Please make sure you have the pages: 'dist' and assets: 'dest', in your svelte.config.js adaptater"),await Pe({message:"Do you want to continue?"})||(m.error("Aborted"),A.error(""))),"build")}async function nj(){let t=/(main|index)\.(ts|tsx|js|jsx)$/,e="",r=(0,ar.cwd)(),n=r.split("/").length;for await(let i of nb(r))if(i.split("/").length-n<=2&&t.test(i)){e=i,m.info(`Found main file here ${i}`);break}return e}async function ob(t,e){return t.from("app_versions").upsert(e,{onConflict:"name,app_id"}).eq("app_id",e.app_id).eq("name",e.name)}async function ij(t,e,r){let n={app_id:e,name:r,version:0};try{let o=await t.functions.invoke("private/upload_link",{body:JSON.stringify(n)});if(o.error){if(o.error instanceof fa.FunctionsHttpError){let s=await o.error.context.json();m.error(`Upload URL error: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot get upload url: ${o.error.message}`);return""}return o.data.url}catch(i){m.error(`Cannot get upload url ${Q(i)}`)}return""}async function*oj(t){let e=(0,it.readdirSync)(t,{withFileTypes:!0});for(let r of e){let n=(0,tt.join)(t,r.name);r.isDirectory()?yield*oj(n):yield n}}async function sj(t){let e=[];for await(let r of oj(t)){let n=(0,it.readFileSync)(r),i=await(0,K6.checksum)(n,"sha256"),o=(0,tt.relative)(t,r);o.startsWith("/")&&(o=o.substring(1)),e.push({file:o,hash:i})}return e}async function Ph(t){return(0,kh.platform)()==="win32"?kse(t):Ase(t)}function Ase(t){let e=new eb.default;return e.addLocalFolder(t),e.toBuffer()}async function kse(t){m.info("Zipping file windows mode");let e=new eb.default,r=(n,i)=>{let o=(0,it.readdirSync)(n);for(let s of o){let a=(0,tt.join)(n,s),u=(0,it.statSync)(a);if(u.isFile()){let c=(0,it.readFileSync)(a);e.addFile((0,tt.join)(i,s).split(tt.sep).join("/"),c)}else u.isDirectory()&&r(a,(0,tt.join)(i,s))}};return r(t,""),e.toBuffer()}async function aj(t,e,r,n,i,o,s){return new Promise((a,u)=>{Fe(t,{channel:"app",event:"App TUS upload",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}),new Th.Upload(e,{endpoint:`${s.hostFilesApi}/files/upload/attachments/`,metadataForPartialUploads:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/gzip"},metadata:{filename:`orgs/${r}/apps/${n}/${i}.zip`,filetype:"application/zip"},headers:{Authorization:t},onError(l){if(l instanceof Th.DetailedError){let f=l.originalResponse?.getBody(),h=JSON.parse(f||'{"error": "unknown error"}');u(h.status||h.error||h.message||"unknown error")}else u(l.message||l.toString()||"unknown error")},onProgress(l,f){let h=(l/f*100).toFixed(2);o.message(`Uploaded ${h}%`)},async onSuccess(){await Fe(t,{channel:"app",event:"App TUS done",icon:"\u23EB",user_id:r,tags:{"app-id":n},notify:!1}).catch(),a(!0)}}).start()})}async function uj(t,e,r){let n={app_id:e,name:r};try{let o=await t.functions.invoke("private/delete_failed_version",{body:JSON.stringify(n),method:"DELETE"});if(o.error){if(o.error instanceof fa.FunctionsHttpError){let s=await o.error.context.json();m.error(`Cannot delete failed version: ${s.status||JSON.stringify(s)}`)}else m.error(`Cannot delete failed version: ${o.error.message}`);return}return o.data?.status}catch(i){if(i instanceof fa.FunctionsHttpError){let o=await i.context.json();m.error(`Cannot delete failed version: ${o.message||JSON.stringify(o)}`)}else m.error(`Cannot delete failed version: ${Q(i)}`)}}async function Rh(t,e){if(!e.app_id||!e.name||!e.created_by)return m.error("missing app_id, name, or created_by"),Promise.reject(new Error("missing app_id, name, or created_by"));let{data:r,error:n}=await t.from("channels").select("enable_progressive_deploy, secondary_version_percentage, second_version").eq("app_id",e.app_id).eq("name",e.name).single();if(r&&!n){if(r.enable_progressive_deploy){if(m.info("Progressive deploy is enabled"),r.secondary_version_percentage!==1&&m.warn("Latest progressive deploy has not finished"),e.second_version=e.version,!r.second_version)return m.error("missing secondVersion"),Promise.reject(new Error("missing secondVersion"));e.version=r.second_version,e.secondary_version_percentage=.1,m.info("Started new progressive upload!")}return t.from("channels").update(e).eq("app_id",e.app_id).eq("name",e.name).select().single()}return t.from("channels").insert(e).select().single()}async function Fe(t,e){try{let r=await rb(),n=await Hr.post(`${r.host}/private/events`,{json:e,headers:{capgkey:t},timeout:1e4,retry:3}).json();n.error&&m.error(`Failed to send LogSnag event: ${n.error}`)}catch{}}async function ma(t,e){let{error:r,data:n}=await t.rpc("get_orgs_v5");r&&(m.error("Cannot get the list of organizations - exiting"),m.error(`Error ${JSON.stringify(r)}`),A.error(""));let i=n.filter(u=>!!e.find(c=>c===u.role));i.length===0&&(m.error(`Could not get organization with roles: ${e.join(" or ")} because the user does not have any org`),A.error(""));let o=i.length>1?await qo({message:"Please pick the organization that you want to insert to",options:i.map(u=>({value:u.gid,label:u.name}))}):i[0].gid;kt(o)&&(m.error("Canceled organization selection, exiting"),A.error(""));let s=o,a=n.find(u=>u.gid===s);return m.info(`Using the organization "${a.name}" as the app owner`),a}var _o=t=>t.replace(/\./g,"--");async function me(t,e,r=["all"]){await Cse(t,e,r);let{data:n,error:i}=await t.rpc("get_user_id",{apikey:e}).single(),o=(n||"").toString();return(!o||i)&&(m.error("Cannot auth user with apikey"),A.error("")),o}async function Sr(t,e){let{data:r,error:n}=await t.from("apps").select("owner_org").eq("app_id",e).single();return(!r||n)&&(m.error(`Cannot get organization id for app id ${e}`),Q(n),A.error("")),r.owner_org}function ga(t){return new Date(t||"").toLocaleString()}var W6=!1,la="npm",$c="install",Qv="npx";function Nt(){if(W6)return{pm:la,command:$c,installCommand:`${la} ${$c}`,runner:Qv};let t=tb((0,ar.cwd)());return la=qa(t,"npm"),$c=pl(la),W6=!0,Qv=Hw(t),{pm:la,command:$c,installCommand:`${la} ${$c}`,runner:Qv}}function cj(t){return(0,it.readdirSync)(t,{withFileTypes:!0}).flatMap(n=>{let i=(0,tt.join)(t,n.name);return n.isDirectory()?cj(i):i.split(`node_modules${tt.sep}`)[1]||i})}async function sb(t,e){let r=e?e.split(","):[],n;try{n=await jt("",t)}catch(l){m.error("Invalid package.json, JSON parsing failed"),console.error("json parse error: ",l),A.error("")}let i=t?tt.default.resolve(t).replace("package.json",""):tb((0,ar.cwd)()),{dependencies:o}=n;o||(m.error("Missing dependencies section in package.json"),A.error(""));for(let[l,f]of Object.entries(o))typeof f!="string"&&(m.error(`Invalid dependency ${l}: ${f}, expected string, got ${typeof f}`),A.error(""));let s=r.length===0?[(0,tt.join)((0,ar.cwd)(),"node_modules")]:r;if(!s.some(l=>(0,it.existsSync)(l))){let l=qa(i,"npm"),f=pl(l);m.error(`Missing node_modules folder at ${s.join(", ")}, please run ${l} ${f}`),A.error("")}let u=!1,c=await Promise.all(Object.entries(o).map(async([l,f])=>{let h=!1,d=!1;for(let p of s){let v=(0,tt.join)(p,l);if((0,it.existsSync)(v)){h=!0;try{if(cj(v).some(w=>Ese.test(w))){d=!0;break}}catch(g){m.error(`Error reading node_modules files for ${l} package in ${p}`),console.error(g),A.error("")}}}if(!h){u=!0;let p=qa(i,"npm"),v=pl(p);return m.error(`Missing dependency ${l}, please run ${p} ${v}`),{name:l,version:f}}return{name:l,version:f,native:d}})).catch(()=>[]);return(u||c.find(l=>l.native===void 0))&&A.error(""),c}async function Tse(t,e,r){let{data:n,error:i}=await t.from("channels").select("version(checksum)").eq("name",r).eq("app_id",e).single(),o=n;return i||o===null||!o.version||!o.version.checksum?null:o.version.checksum}async function Pse(t,e,r){let{data:n,error:i}=await t.from("channels").select(`version (
249
249
  native_packages
250
- )`).eq("name",r).eq("app_id",e).single();i&&(m.error(`Error fetching native packages: ${i.message}`),A.error(""));let o;try{o=n.version.native_packages}catch{m.error("Error parsing native packages"),A.error("")}return o||(m.error("Error parsing native packages, perhaps the metadata does not exist?"),A.error("")),o.forEach(a=>{typeof a!="object"&&(m.error(`Invalid remote native package data: ${a}, expected object, got ${typeof a}`),A.error(""));let{name:u,version:c}=a;(!u||typeof u!="string")&&(m.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),A.error("")),(!c||typeof c!="string")&&(m.error(`Invalid remote native package version: ${c}, expected string, got ${typeof c}`),A.error(""))}),new Map(o.map(a=>[a.name,a]))}async function lj(t,e,r,n){let i=be();i.start(`Checking bundle checksum compatibility with channel ${r}`);let o=await kse(t,e,r);if(!o){i.stop(`No checksum found for channel ${r}, the bundle will be uploaded`);return}o&&o===n&&(m.error(`Cannot upload the same bundle content.
250
+ )`).eq("name",r).eq("app_id",e).single();i&&(m.error(`Error fetching native packages: ${i.message}`),A.error(""));let o;try{o=n.version.native_packages}catch{m.error("Error parsing native packages"),A.error("")}return o||(m.error("Error parsing native packages, perhaps the metadata does not exist?"),A.error("")),o.forEach(a=>{typeof a!="object"&&(m.error(`Invalid remote native package data: ${a}, expected object, got ${typeof a}`),A.error(""));let{name:u,version:c}=a;(!u||typeof u!="string")&&(m.error(`Invalid remote native package name: ${u}, expected string, got ${typeof u}`),A.error("")),(!c||typeof c!="string")&&(m.error(`Invalid remote native package version: ${c}, expected string, got ${typeof c}`),A.error(""))}),new Map(o.map(a=>[a.name,a]))}async function lj(t,e,r,n){let i=be();i.start(`Checking bundle checksum compatibility with channel ${r}`);let o=await Tse(t,e,r);if(!o){i.stop(`No checksum found for channel ${r}, the bundle will be uploaded`);return}o&&o===n&&(m.error(`Cannot upload the same bundle content.
251
251
  Current bundle checksum matches remote bundle for channel ${r}
252
252
  Did you builded your app before uploading?
253
- PS: You can ignore this check with "--ignore-checksum-check"`),A.error("")),i.stop(`Checksum compatible with ${r} channel`)}function ge(t,e){return t||e?.plugins?.CapacitorUpdater?.appId||e?.appId}async function $h(t,e,r,n,i){let o=await sb(n,i),s=await Tse(t,e,r),a=o.filter(c=>!!c.native).map(c=>{let l=s.get(c.name);return l?{name:c.name,localVersion:c.version,remoteVersion:l.version}:{name:c.name,localVersion:c.version,remoteVersion:void 0}}),u=[...s].filter(([c])=>o.find(l=>l.name===c)===void 0).map(([c,l])=>({name:c,localVersion:void 0,remoteVersion:l.version}));return a.push(...u),{finalCompatibility:a,localDependencies:o}}async function fj(t,e){let{data:r}=await t.rpc("exist_app_v2",{appid:e}).single();return!!r}async function Be(t,e,r,n){let i=Nt(),o=await ej(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{m.error("Invalid apikey, such apikey does not exists!"),A.error("");break}case"NO_APP":{m.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),A.error("");break}case"NO_ORG":{m.error("Could not find organization, please contact support to resolve this!"),A.error("");break}}let s=o.data;return n>s&&(m.error(`Insuficcent permissions for app ${r}. Current permission: ${xt[o.data]}, required for this action: ${xt[n]}.`),A.error("")),o.data}var xr="assets/icon.png";var Ij=ce($j(),1);function lb(t){let e=(0,Ij.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var I8=ce($8(),1),j8=ce(Pv(),1),Eb=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},Cb=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function Sb(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??lb(i),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),o),a=(0,I8.default)(o.toString(),{recursive:!0}),u={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete u.accept,a&&(u.authorization=`${a.type} ${a.token}`);let c;try{c=await Hr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new Eb(t):f}if(e.allVersions)return c;let l=new Cb(t,r);if(c["dist-tags"][r]){let{time:f}=c;c=c.versions[c["dist-tags"][r]],c.time=f}else if(r){let f=!!c.versions[r];if(n&&!f)for(let[d,p]of Object.entries(c.versions))p.deprecated&&delete c.versions[d];if(!f){let d=Object.keys(c.versions);if(r=j8.default.maxSatisfying(d,r),!r)throw l}let{time:h}=c;if(c=c.versions[r],c.time=h,!c)throw l}return c}async function Bc(t,e){let{version:r}=await Sb(t.toLowerCase(),e);return r}async function De(){let t=await Bc("@capgo/cli").catch(()=>""),e=t?.split(".")[0];t!==Ir.version&&m.warning(`\u{1F6A8} You are using @capgo/cli@${Ir.version} it's not the latest version.
254
- Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function Iae(t,e,r=!0){await xb(t,e,void 0,r)}async function xb(t,e,r,n=!0){n&&Y("Adding"),await De(),e.apikey=e.apikey||pe();let i=await ee();t=ge(t,i?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),t.includes("--")&&(m.error('The app id includes illegal symbols. You cannot use "--" in the app id'),A.error(""));let o=await de(e.apikey);await me(o,e.apikey,["write","all"]),await fj(o,t)&&(m.error(`App ${t} already exist`),A.error("")),r||(r=await ma(o,["admin","super_admin"]));let a=r.gid;await ha(o,a,e.apikey,void 0,!1);let{name:u,icon:c}=e;u=u||i.config?.appName||"Unknown",c=c||"resources/icon.png",(!c||!u)&&(m.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),A.error("")),n&&m.info(`Adding ${t} to Capgo`);let l=null,f=null;c&&(0,Ca.existsSync)(c)?(l=(0,Ca.readFileSync)(c),f=pa(c)||"image/png",m.warn(`Found app icon ${c}`)):(0,Ca.existsSync)(xr)?(l=(0,Ca.readFileSync)(xr),f=pa(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${c}, ${xr}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(l&&f){let{error:g}=await o.storage.from(`images/org/${a}/${t}`).upload(h,l,{contentType:f});g&&(console.error(g),m.error(`Could not add app ${Q(g)}`),A.error(""));let{data:w}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=w?.publicUrl||d}let{error:p}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});p&&(m.error(`Could not add app ${Q(p)}`),A.error(""));let{error:v}=await o.from("app_versions").insert([{owner_org:a,deleted:!0,name:"unknown",app_id:t},{owner_org:a,deleted:!0,name:"builtin",app_id:t}]);return v&&(m.error(`Could not add app ${Q(v)}`),A.error("")),m.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(X("Done \u2705"),(0,N8.exit)()),!0}async function L8(t,e){Iae(t,e,!0)}var B8=require("node:process");async function q8(t,e){Y("Deleting"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all"]);await Be(n,e.apikey,t,5);let{data:o,error:s}=await n.from("apps").select("owner_org ( created_by, id )").eq("app_id",t).single(),a=o;if(!s&&(a?.owner_org.created_by??"")!==i){m.warn("Deleting the app is not recomended for users that are not the organization owner"),m.warn("You are invited as a super_admin but your are not the owner"),m.warn("It's strongly recomended that you do not continue!");let h=await qo({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(kt(h)||h==="no")&&(m.error("Canceled deleting the app, exiting"),A.error(""))}else s&&m.warn(`Cannot get the app owner ${Q(s)}`);let{error:u}=await n.storage.from("images").remove([`org/${a?.owner_org.id}/${t}/icon`]);u&&(console.error(u,`images/org/${a?.owner_org.id}/${t}`),m.error("Could not delete app logo"));let{error:c}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);c&&m.error("Could not delete app version");let{error:l}=await n.from("apps").delete().eq("app_id",t);l&&(m.error("Could not delete app"),A.error(""));let f=await Sr(n,t);await Fe(e.apikey,{channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:f,tags:{"app-id":t},notify:!1}).catch(),m.success("App deleted in Capgo"),X("Done \u2705"),(0,B8.exit)()}var Kh=require("node:os"),Sa=require("node:process");async function jae(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(Bc(n));return await Promise.all(r).then(n=>{let i=Object.keys(t);for(let o=0;o<n.length;o+=1){let s=n[o];s&&(e[i[o]]=s)}}),e}async function Nae(){let{dependencies:t}=await jt(),e={"@capgo/cli":Ir.version};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let n=t[r].replace("^","").replace("~","");e[r]=n}return e}async function M8(t){m.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await ee(),r=await jt("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";m.info(` App Name: ${i}`);let o=ge("",e?.config);m.info(` App ID: ${o}`),m.info(` App Version: ${n}`);let s=e?.config?.webDir||"";m.info(` Web Dir: ${s}`),m.info(` OS: ${(0,Kh.platform)()} ${(0,Kh.version)()}`),m.info(` Node: ${Sa.version}`),m.info(" Installed Dependencies:");let a=await Nae();Object.keys(a).length===0&&(m.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,Sa.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let f=a[l];m.info(` ${l}: ${f}`)}let u=be();u.start("Running: Loading latest dependencies");let c=await jae(a);u.stop("Latest Dependencies:");for(let l in c)if(Object.prototype.hasOwnProperty.call(c,l)){let f=c[l];m.info(` ${l}: ${f}`)}JSON.stringify(a)!==JSON.stringify(c)&&(m.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,Sa.exit)(1)),m.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,Sa.exit)()}var Fb=require("node:process");function U8(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var lr=class t{title=null;headers=[];rows=[];static narrowTheme={top:["\u2554","\u2550","\u2564","\u2557"],row:["\u2551"," ","\u2502","\u2551"],div:["\u255F","\u2500","\u253C","\u2562"],bot:["\u255A","\u2550","\u2567","\u255D"]};static wideTheme={top:["\u2554\u2550","\u2550","\u2550\u2564\u2550","\u2550\u2557"],row:["\u2551 "," "," \u2502 "," \u2551"],div:["\u255F\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2562"],bot:["\u255A\u2550","\u2550","\u2550\u2567\u2550","\u2550\u255D"]};static roundTheme={top:["\u256D\u2500","\u2500","\u2500\u252C\u2500","\u2500\u256E"],row:["\u2502 "," "," \u2502 "," \u2502"],div:["\u251C\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2524"],bot:["\u2570\u2500","\u2500","\u2500\u2534\u2500","\u2500\u256F"]};theme=t.wideTheme;columnWidth(){let e=[this.headers,...this.rows].filter(n=>n.length>0),r=e[0].map(n=>this.cast(n).length);for(let n of e.slice(1))for(let i=0;i<r.length;i++){let o=this.cast(n[i]).length;o>r[i]&&(r[i]=o)}return r}cast(e){return typeof e=="object"?"obj":e!==void 0&&typeof e.toString=="function"?e.toString():""}renderTitle(){return"[ "+this.title+" ]"}renderLine(e){let r=this.columnWidth();return e[0]+r.map(n=>e[1].repeat(n)).join(e[2])+e[3]}renderCell(e,r,n=!1){let i=this.cast(e),o=n?U8("bold",i):i,s=r-i.length,a=this.theme.row[1];switch(typeof e){case"number":return a.repeat(s)+o;case"string":return o+a.repeat(s);case"boolean":case"object":return a.repeat(Math.ceil(s/2))+U8("italic",i)+a.repeat(Math.floor(s/2));default:return a.repeat(s)}}renderRow(e,r=!1){let n=this.theme.row,i=this.columnWidth();return n[0]+e.map((o,s)=>this.renderCell(o,i[s],r)).join(n[2])+n[3]}toString(){let e=this.theme,r=this.headers.length>0,n=this.rows.length>0;return[this.title?this.renderTitle():"",r||n?this.renderLine(e.top):"",r?this.renderRow(this.headers,!0):"",r&&n?this.renderLine(e.div):"",...this.rows.map(i=>this.renderRow(i)),r||n?this.renderLine(e.bot):""].filter(i=>i.length>0).join(`
255
- `)}};function Lae(t){t.length||(m.error("No apps found"),(0,Fb.exit)(1));let e=new lr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,ga(r.created_at)])}),m.success("Apps"),m.success(e.toString())}async function Bae(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(m.error("Apps not found"),A.error("")),e}async function V8(t){Y("List apps in Capgo"),await De(),t.apikey=t.apikey||pe();let e=await de(t.apikey);await me(e,t.apikey,["write","all","read","upload"]),m.info("Getting active bundle in Capgo");let r=await Bae(e);m.info(`Active app in Capgo: ${r?.length}`),Lae(r),X("Done \u2705"),(0,Fb.exit)()}var H8=require("node:crypto"),xa=require("node:fs"),z8=require("node:process");async function G8(t,e){Y("Set app"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),o=(await ma(n,["admin","super_admin"])).gid,s=await me(n,e.apikey,["write","all"]);await Be(n,e.apikey,t,4);let{name:a,icon:u,retention:c}=e;c&&Number.isNaN(Number(c))?(m.error("retention value must be a number"),A.error("")):c&&c<0&&(m.error("retention value cannot be less than 0"),A.error(""));let l,f,h=`icon_${(0,H8.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,xa.existsSync)(u)?(l=(0,xa.readFileSync)(u),f=pa(u)||"image/png",m.warn(`Found app icon ${u}`)):(0,xa.existsSync)(xr)?(l=(0,xa.readFileSync)(xr),f=pa(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${u}, ${xr}`),l&&f){let{error:v}=await n.storage.from(`images/org/${o}/${t}`).upload(h,l,{contentType:f});v&&(m.error(`Could not set app ${Q(v)}`),A.error(""));let{data:g}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=g?.publicUrl||d}let{error:p}=await n.from("apps").update({icon_url:d,name:a,retention:c?c*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);p&&(m.error(`Could not set app ${Q(p)}`),A.error("")),X("Done \u2705"),(0,z8.exit)()}var Fa=require("node:process");async function W8(t,e){Y("Set a specific setting in capacitor config"),e.bool&&e.string&&(m.error("Bool and string CANNOT be set at the same time"),(0,Fa.exit)(1)),!e.bool&&!e.string&&(m.error("You MUST provide either bool or string as the value"),(0,Fa.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(m.error("Invalid bool"),(0,Fa.exit)(1));try{let r=await ee(),n=r.config,i=t.split(".");i.length===0&&(m.error("Invalid path"),(0,Fa.exit)(1));for(let s of i.slice(0,-1))Object.prototype.hasOwnProperty.call(n,s)||(n[s]={}),n=n[s];let o=e.bool?e.bool==="true":e.string;n[i.at(-1)]=o,await on(r,!0),m.success(`Set "${t}" to "${o}"`)}catch(r){m.error(`Cannot set config in capacitor settings ${Q(r)}`),(0,Fa.exit)(1)}X("Done \u2705")}var Nb=require("node:process");function Yh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function J8(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function Ab(t=[],e=[]){let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[n],o=e[n];if(i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(typeof i=="string"&&typeof o=="number")return 1;if(typeof i=="number"&&typeof o=="string"||i<o)return-1;if(i>o)return 1}return 0}var Oa="0|[1-9]\\d*",qae="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Mae=`(?<major>${Oa})\\.(?<minor>${Oa})\\.(?<patch>${Oa})`,K8=`(?:${Oa}|${qae})`,X8=`(?:-(?<prerelease>${K8}(?:\\.${K8})*))`,Y8="[0-9A-Za-z-]+",Z8=`(?:\\+(?<buildmetadata>${Y8}(?:\\.${Y8})*))`,Q8=`v?${Mae}${X8}?${Z8}?`,eN=new RegExp(`^${Q8}$`),tN="(?:<|>)?=?",Uae="x|X|\\*",Ob=`${Oa}|${Uae}`,rN=`[v=\\s]*(?<major>${Ob})(?:\\.(?<minor>${Ob})(?:\\.(?<patch>${Ob})${X8}?${Z8}?)?)?`,Vae=new RegExp(`^(?<operator>~>?|\\^|${tN})\\s*${rN}$`),Hae=new RegExp(`^(?<operator>${tN})\\s*(${Q8})$|^$`);function kb(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Tb=256;var zae=new RegExp(`^${Oa}$`);function Pb(t){return t.split(".").filter(Boolean).map(e=>{if(zae.test(e)){let r=Number(e);if(kb(r))return r}return e})}function qc(t){return t.split(".").filter(Boolean)}function Mc(t,e){let r=Number(t);if(!kb(r))throw new TypeError(e);return r}function Fr(t,e){return t===e?0:Yh(t.major,e.major)||Yh(t.minor,e.minor)||Yh(t.patch,e.patch)||J8(t.prerelease,e.prerelease)||Ab(t.prerelease,e.prerelease)}function Rb(t){return t.toFixed(0)}function Aa(t){let e=Rb(t.major),r=Rb(t.minor),n=Rb(t.patch),i=t.prerelease?.join(".")??"",o=t.build?.join(".")??"";return[[`${e}.${r}.${n}`,i].filter(u=>u).join("-"),o].filter(u=>u).join("+")}function Gae(t=[]){let e=[...t],r=e.length;for(;r>=0;){let n=e[r];if(typeof n=="number"){e[r]=n+1;break}r-=1}return r===-1&&e.push(0),e}function Uc(t=[],e){let r=Gae(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function iN(t,e,r={}){let n=r.build!==void 0?qc(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:Uc(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:Uc(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:Uc(t.prerelease,r.prerelease),build:n};case"prerelease":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:Uc(t.prerelease,r.prerelease),build:n}}case"major":return{major:(t.prerelease??[]).length===0||t.minor!==0||t.patch!==0?t.major+1:t.major,minor:0,patch:0,prerelease:[],build:n};case"minor":{let o=(t.prerelease??[]).length===0||t.patch!==0?t.minor+1:t.minor;return{major:t.major,minor:o,patch:0,prerelease:[],build:n}}case"patch":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:[],build:n}}case"pre":return{major:t.major,minor:t.minor,patch:t.patch,prerelease:Uc(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var $b={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},oN={operator:void 0,...$b};function Ib(t,e){return Fr(t,e)>0}function ka(t,e){return Fr(t,e)<0}function Bn(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Tb)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Tb}`);t=t.trim();let e=t.match(eN)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Mc(e.major,`Cannot parse version ${t}: invalid major version`),n=Mc(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Mc(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Pb(e.prerelease):[],s=e.buildmetadata?qc(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}var mN=require("node:process");var aN=require("node:process");async function uN(t,e,r){let{data:n,error:i}=await t.from("channels").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Version ${e}@${r.name}`),A.error("")),n&&n.length>0){if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await jb(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Q(a)}`),(0,aN.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else m.error("Unlink it first"),A.error("");X(`Version unlinked from ${n.length} channel`)}}function jb(t,e){return t.from("app_versions").select("id").eq("app_id",e).eq("name","unknown").throwOnError().single().then(({data:r,error:n})=>(n&&(m.error(`Cannot call findUnknownVersion as it returned an error.
253
+ PS: You can ignore this check with "--ignore-checksum-check"`),A.error("")),i.stop(`Checksum compatible with ${r} channel`)}function ge(t,e){return t||e?.plugins?.CapacitorUpdater?.appId||e?.appId}async function $h(t,e,r,n,i){let o=await sb(n,i),s=await Pse(t,e,r),a=o.filter(c=>!!c.native).map(c=>{let l=s.get(c.name);return l?{name:c.name,localVersion:c.version,remoteVersion:l.version}:{name:c.name,localVersion:c.version,remoteVersion:void 0}}),u=[...s].filter(([c])=>o.find(l=>l.name===c)===void 0).map(([c,l])=>({name:c,localVersion:void 0,remoteVersion:l.version}));return a.push(...u),{finalCompatibility:a,localDependencies:o}}async function fj(t,e){let{data:r}=await t.rpc("exist_app_v2",{appid:e}).single();return!!r}async function Be(t,e,r,n){let i=Nt(),o=await ej(t,e,r);if(!o.okay)switch(o.error){case"INVALID_APIKEY":{m.error("Invalid apikey, such apikey does not exists!"),A.error("");break}case"NO_APP":{m.error(`App ${r} does not exist, run first \`${i.runner} @capgo/cli app add ${r}\` to create it`),A.error("");break}case"NO_ORG":{m.error("Could not find organization, please contact support to resolve this!"),A.error("");break}}let s=o.data;return n>s&&(m.error(`Insuficcent permissions for app ${r}. Current permission: ${xt[o.data]}, required for this action: ${xt[n]}.`),A.error("")),o.data}var xr="assets/icon.png";var Ij=ce($j(),1);function lb(t){let e=(0,Ij.default)("npm",{registry:"https://registry.npmjs.org/"}),r=e[`${t}:registry`]||e.config_registry||e.registry;return r.slice(-1)==="/"?r:`${r}/`}var I8=ce($8(),1),j8=ce(Pv(),1),Eb=class extends Error{constructor(e){super(`Package \`${e}\` could not be found`),this.name="PackageNotFoundError"}},Cb=class extends Error{constructor(e,r){super(`Version \`${r}\` for package \`${e}\` could not be found`),this.name="VersionNotFoundError"}};async function Sb(t,e={}){let{version:r="latest"}=e,{omitDeprecated:n=!0}=e,i=t.split("/")[0],o=e.registryUrl??lb(i),s=new URL(encodeURIComponent(t).replace(/^%40/,"@"),o),a=(0,I8.default)(o.toString(),{recursive:!0}),u={accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"};e.fullMetadata&&delete u.accept,a&&(u.authorization=`${a.type} ${a.token}`);let c;try{c=await Hr(s,{headers:u,keepalive:!0}).json()}catch(f){throw f?.response?.status===404?new Eb(t):f}if(e.allVersions)return c;let l=new Cb(t,r);if(c["dist-tags"][r]){let{time:f}=c;c=c.versions[c["dist-tags"][r]],c.time=f}else if(r){let f=!!c.versions[r];if(n&&!f)for(let[d,p]of Object.entries(c.versions))p.deprecated&&delete c.versions[d];if(!f){let d=Object.keys(c.versions);if(r=j8.default.maxSatisfying(d,r),!r)throw l}let{time:h}=c;if(c=c.versions[r],c.time=h,!c)throw l}return c}async function Bc(t,e){let{version:r}=await Sb(t.toLowerCase(),e);return r}async function De(){let t=await Bc("@capgo/cli").catch(()=>""),e=t?.split(".")[0];t!==Ir.version&&m.warning(`\u{1F6A8} You are using @capgo/cli@${Ir.version} it's not the latest version.
254
+ Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}async function jae(t,e,r=!0){await xb(t,e,void 0,r)}async function xb(t,e,r,n=!0){n&&Y("Adding"),await De(),e.apikey=e.apikey||pe();let i=await ee();t=ge(t,i?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),t.includes("--")&&(m.error('The app id includes illegal symbols. You cannot use "--" in the app id'),A.error(""));let o=await de(e.apikey);await me(o,e.apikey,["write","all"]),await fj(o,t)&&(m.error(`App ${t} already exist`),A.error("")),r||(r=await ma(o,["admin","super_admin"]));let a=r.gid;await ha(o,a,e.apikey,void 0,!1);let{name:u,icon:c}=e;u=u||i.config?.appName||"Unknown",c=c||"resources/icon.png",(!c||!u)&&(m.error("Missing argument, you need to provide a appId and a name, or be in a capacitor project"),A.error("")),n&&m.info(`Adding ${t} to Capgo`);let l=null,f=null;c&&(0,Ca.existsSync)(c)?(l=(0,Ca.readFileSync)(c),f=pa(c)||"image/png",m.warn(`Found app icon ${c}`)):(0,Ca.existsSync)(xr)?(l=(0,Ca.readFileSync)(xr),f=pa(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${c}, ${xr}`);let h="icon",d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(l&&f){let{error:g}=await o.storage.from(`images/org/${a}/${t}`).upload(h,l,{contentType:f});g&&(console.error(g),m.error(`Could not add app ${Q(g)}`),A.error(""));let{data:w}=await o.storage.from(`images/org/${a}/${t}`).getPublicUrl(h);d=w?.publicUrl||d}let{error:p}=await o.from("apps").insert({icon_url:d,owner_org:a,name:u,app_id:t});p&&(m.error(`Could not add app ${Q(p)}`),A.error(""));let{error:v}=await o.from("app_versions").insert([{owner_org:a,deleted:!0,name:"unknown",app_id:t},{owner_org:a,deleted:!0,name:"builtin",app_id:t}]);return v&&(m.error(`Could not add app ${Q(v)}`),A.error("")),m.success(`App ${t} added to Capgo. ${n?"You can upload a bundle now":""}`),n&&(X("Done \u2705"),(0,N8.exit)()),!0}async function L8(t,e){jae(t,e,!0)}var B8=require("node:process");async function q8(t,e){Y("Deleting"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all"]);await Be(n,e.apikey,t,5);let{data:o,error:s}=await n.from("apps").select("owner_org ( created_by, id )").eq("app_id",t).single(),a=o;if(!s&&(a?.owner_org.created_by??"")!==i){m.warn("Deleting the app is not recomended for users that are not the organization owner"),m.warn("You are invited as a super_admin but your are not the owner"),m.warn("It's strongly recomended that you do not continue!");let h=await qo({message:"Do you want to continue?",options:[{label:"Yes",value:"yes"},{label:"No",value:"no"}]});(kt(h)||h==="no")&&(m.error("Canceled deleting the app, exiting"),A.error(""))}else s&&m.warn(`Cannot get the app owner ${Q(s)}`);let{error:u}=await n.storage.from("images").remove([`org/${a?.owner_org.id}/${t}/icon`]);u&&(console.error(u,`images/org/${a?.owner_org.id}/${t}`),m.error("Could not delete app logo"));let{error:c}=await n.storage.from(`apps/${t}/${i}`).remove(["versions"]);c&&m.error("Could not delete app version");let{error:l}=await n.from("apps").delete().eq("app_id",t);l&&(m.error("Could not delete app"),A.error(""));let f=await Sr(n,t);await Fe(e.apikey,{channel:"app",event:"App Deleted",icon:"\u{1F5D1}\uFE0F",user_id:f,tags:{"app-id":t},notify:!1}).catch(),m.success("App deleted in Capgo"),X("Done \u2705"),(0,B8.exit)()}var Kh=require("node:os"),Sa=require("node:process");async function Nae(t){let e={},r=[];for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&r.push(Bc(n));return await Promise.all(r).then(n=>{let i=Object.keys(t);for(let o=0;o<n.length;o+=1){let s=n[o];s&&(e[i[o]]=s)}}),e}async function Lae(){let{dependencies:t}=await jt(),e={"@capgo/cli":Ir.version};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&r.startsWith("@capgo/")&&r.startsWith("@capawesome/")&&r.startsWith("capacitor")){let n=t[r].replace("^","").replace("~","");e[r]=n}return e}async function M8(t){m.warn(" \u{1F48A} Capgo Doctor \u{1F48A}");let e=await ee(),r=await jt("",t.packageJson),n=e?.config?.plugins?.CapacitorUpdater?.version||r?.version,i=e?.config?.appName||"";m.info(` App Name: ${i}`);let o=ge("",e?.config);m.info(` App ID: ${o}`),m.info(` App Version: ${n}`);let s=e?.config?.webDir||"";m.info(` Web Dir: ${s}`),m.info(` OS: ${(0,Kh.platform)()} ${(0,Kh.version)()}`),m.info(` Node: ${Sa.version}`),m.info(" Installed Dependencies:");let a=await Lae();Object.keys(a).length===0&&(m.warning("\x1B[31m%s\x1B[0m \u{1F6A8} No dependencies found"),(0,Sa.exit)(1));for(let l in a)if(Object.prototype.hasOwnProperty.call(a,l)){let f=a[l];m.info(` ${l}: ${f}`)}let u=be();u.start("Running: Loading latest dependencies");let c=await Nae(a);u.stop("Latest Dependencies:");for(let l in c)if(Object.prototype.hasOwnProperty.call(c,l)){let f=c[l];m.info(` ${l}: ${f}`)}JSON.stringify(a)!==JSON.stringify(c)&&(m.warn("\x1B[31m\u{1F6A8} Some dependencies are not up to date\x1B[0m"),(0,Sa.exit)(1)),m.success("\x1B[32m\u2705 All dependencies are up to date\x1B[0m"),(0,Sa.exit)()}var Fb=require("node:process");function U8(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),i="\x1B[";return i+n+"m"+e+i+"0m"}var lr=class t{title=null;headers=[];rows=[];static narrowTheme={top:["\u2554","\u2550","\u2564","\u2557"],row:["\u2551"," ","\u2502","\u2551"],div:["\u255F","\u2500","\u253C","\u2562"],bot:["\u255A","\u2550","\u2567","\u255D"]};static wideTheme={top:["\u2554\u2550","\u2550","\u2550\u2564\u2550","\u2550\u2557"],row:["\u2551 "," "," \u2502 "," \u2551"],div:["\u255F\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2562"],bot:["\u255A\u2550","\u2550","\u2550\u2567\u2550","\u2550\u255D"]};static roundTheme={top:["\u256D\u2500","\u2500","\u2500\u252C\u2500","\u2500\u256E"],row:["\u2502 "," "," \u2502 "," \u2502"],div:["\u251C\u2500","\u2500","\u2500\u253C\u2500","\u2500\u2524"],bot:["\u2570\u2500","\u2500","\u2500\u2534\u2500","\u2500\u256F"]};theme=t.wideTheme;columnWidth(){let e=[this.headers,...this.rows].filter(n=>n.length>0),r=e[0].map(n=>this.cast(n).length);for(let n of e.slice(1))for(let i=0;i<r.length;i++){let o=this.cast(n[i]).length;o>r[i]&&(r[i]=o)}return r}cast(e){return typeof e=="object"?"obj":e!==void 0&&typeof e.toString=="function"?e.toString():""}renderTitle(){return"[ "+this.title+" ]"}renderLine(e){let r=this.columnWidth();return e[0]+r.map(n=>e[1].repeat(n)).join(e[2])+e[3]}renderCell(e,r,n=!1){let i=this.cast(e),o=n?U8("bold",i):i,s=r-i.length,a=this.theme.row[1];switch(typeof e){case"number":return a.repeat(s)+o;case"string":return o+a.repeat(s);case"boolean":case"object":return a.repeat(Math.ceil(s/2))+U8("italic",i)+a.repeat(Math.floor(s/2));default:return a.repeat(s)}}renderRow(e,r=!1){let n=this.theme.row,i=this.columnWidth();return n[0]+e.map((o,s)=>this.renderCell(o,i[s],r)).join(n[2])+n[3]}toString(){let e=this.theme,r=this.headers.length>0,n=this.rows.length>0;return[this.title?this.renderTitle():"",r||n?this.renderLine(e.top):"",r?this.renderRow(this.headers,!0):"",r&&n?this.renderLine(e.div):"",...this.rows.map(i=>this.renderRow(i)),r||n?this.renderLine(e.bot):""].filter(i=>i.length>0).join(`
255
+ `)}};function Bae(t){t.length||(m.error("No apps found"),(0,Fb.exit)(1));let e=new lr;e.headers=["Name","id","Created"],e.rows=[],t.reverse().forEach(r=>{e.rows.push([r.name??"",r.app_id,ga(r.created_at)])}),m.success("Apps"),m.success(e.toString())}async function qae(t){let{data:e,error:r}=await t.from("apps").select().order("created_at",{ascending:!1});return r&&(m.error("Apps not found"),A.error("")),e}async function V8(t){Y("List apps in Capgo"),await De(),t.apikey=t.apikey||pe();let e=await de(t.apikey);await me(e,t.apikey,["write","all","read","upload"]),m.info("Getting active bundle in Capgo");let r=await qae(e);m.info(`Active app in Capgo: ${r?.length}`),Bae(r),X("Done \u2705"),(0,Fb.exit)()}var H8=require("node:crypto"),xa=require("node:fs"),z8=require("node:process");async function G8(t,e){Y("Set app"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),o=(await ma(n,["admin","super_admin"])).gid,s=await me(n,e.apikey,["write","all"]);await Be(n,e.apikey,t,4);let{name:a,icon:u,retention:c}=e;c&&Number.isNaN(Number(c))?(m.error("retention value must be a number"),A.error("")):c&&c<0&&(m.error("retention value cannot be less than 0"),A.error(""));let l,f,h=`icon_${(0,H8.randomUUID)()}`,d="https://xvwzpoazmxkqosrdewyv.supabase.co/storage/v1/object/public/images/capgo.png";if(u&&(0,xa.existsSync)(u)?(l=(0,xa.readFileSync)(u),f=pa(u)||"image/png",m.warn(`Found app icon ${u}`)):(0,xa.existsSync)(xr)?(l=(0,xa.readFileSync)(xr),f=pa(xr)||"image/png",m.warn(`Found app icon ${xr}`)):m.warn(`Cannot find app icon in any of the following locations: ${u}, ${xr}`),l&&f){let{error:v}=await n.storage.from(`images/org/${o}/${t}`).upload(h,l,{contentType:f});v&&(m.error(`Could not set app ${Q(v)}`),A.error(""));let{data:g}=await n.storage.from(`images/org/${o}/${t}`).getPublicUrl(h);d=g?.publicUrl||d}let{error:p}=await n.from("apps").update({icon_url:d,name:a,retention:c?c*24*60*60:void 0}).eq("app_id",t).eq("user_id",s);p&&(m.error(`Could not set app ${Q(p)}`),A.error("")),X("Done \u2705"),(0,z8.exit)()}var Fa=require("node:process");async function W8(t,e){Y("Set a specific setting in capacitor config"),e.bool&&e.string&&(m.error("Bool and string CANNOT be set at the same time"),(0,Fa.exit)(1)),!e.bool&&!e.string&&(m.error("You MUST provide either bool or string as the value"),(0,Fa.exit)(1)),e.bool&&e.bool!=="true"&&e.bool!=="false"&&(m.error("Invalid bool"),(0,Fa.exit)(1));try{let r=await ee(),n=r.config,i=t.split(".");i.length===0&&(m.error("Invalid path"),(0,Fa.exit)(1));for(let s of i.slice(0,-1))Object.prototype.hasOwnProperty.call(n,s)||(n[s]={}),n=n[s];let o=e.bool?e.bool==="true":e.string;n[i.at(-1)]=o,await on(r,!0),m.success(`Set "${t}" to "${o}"`)}catch(r){m.error(`Cannot set config in capacitor settings ${Q(r)}`),(0,Fa.exit)(1)}X("Done \u2705")}var Nb=require("node:process");function Yh(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function J8(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function Ab(t=[],e=[]){let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let i=t[n],o=e[n];if(i===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(i===void 0)return-1;if(typeof i=="string"&&typeof o=="number")return 1;if(typeof i=="number"&&typeof o=="string"||i<o)return-1;if(i>o)return 1}return 0}var Oa="0|[1-9]\\d*",Mae="\\d*[a-zA-Z-][a-zA-Z0-9-]*",Uae=`(?<major>${Oa})\\.(?<minor>${Oa})\\.(?<patch>${Oa})`,K8=`(?:${Oa}|${Mae})`,X8=`(?:-(?<prerelease>${K8}(?:\\.${K8})*))`,Y8="[0-9A-Za-z-]+",Z8=`(?:\\+(?<buildmetadata>${Y8}(?:\\.${Y8})*))`,Q8=`v?${Uae}${X8}?${Z8}?`,eN=new RegExp(`^${Q8}$`),tN="(?:<|>)?=?",Vae="x|X|\\*",Ob=`${Oa}|${Vae}`,rN=`[v=\\s]*(?<major>${Ob})(?:\\.(?<minor>${Ob})(?:\\.(?<patch>${Ob})${X8}?${Z8}?)?)?`,Hae=new RegExp(`^(?<operator>~>?|\\^|${tN})\\s*${rN}$`),zae=new RegExp(`^(?<operator>${tN})\\s*(${Q8})$|^$`);function kb(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Tb=256;var Gae=new RegExp(`^${Oa}$`);function Pb(t){return t.split(".").filter(Boolean).map(e=>{if(Gae.test(e)){let r=Number(e);if(kb(r))return r}return e})}function qc(t){return t.split(".").filter(Boolean)}function Mc(t,e){let r=Number(t);if(!kb(r))throw new TypeError(e);return r}function Fr(t,e){return t===e?0:Yh(t.major,e.major)||Yh(t.minor,e.minor)||Yh(t.patch,e.patch)||J8(t.prerelease,e.prerelease)||Ab(t.prerelease,e.prerelease)}function Rb(t){return t.toFixed(0)}function Aa(t){let e=Rb(t.major),r=Rb(t.minor),n=Rb(t.patch),i=t.prerelease?.join(".")??"",o=t.build?.join(".")??"";return[[`${e}.${r}.${n}`,i].filter(u=>u).join("-"),o].filter(u=>u).join("+")}function Wae(t=[]){let e=[...t],r=e.length;for(;r>=0;){let n=e[r];if(typeof n=="number"){e[r]=n+1;break}r-=1}return r===-1&&e.push(0),e}function Uc(t=[],e){let r=Wae(t);return e&&(r[0]!==e||isNaN(r[1]))&&(r=[e,0]),r}function iN(t,e,r={}){let n=r.build!==void 0?qc(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:Uc(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:Uc(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:Uc(t.prerelease,r.prerelease),build:n};case"prerelease":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:Uc(t.prerelease,r.prerelease),build:n}}case"major":return{major:(t.prerelease??[]).length===0||t.minor!==0||t.patch!==0?t.major+1:t.major,minor:0,patch:0,prerelease:[],build:n};case"minor":{let o=(t.prerelease??[]).length===0||t.patch!==0?t.minor+1:t.minor;return{major:t.major,minor:o,patch:0,prerelease:[],build:n}}case"patch":{let o=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:o,prerelease:[],build:n}}case"pre":return{major:t.major,minor:t.minor,patch:t.patch,prerelease:Uc(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var $b={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},oN={operator:void 0,...$b};function Ib(t,e){return Fr(t,e)>0}function ka(t,e){return Fr(t,e)<0}function Bn(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Tb)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Tb}`);t=t.trim();let e=t.match(eN)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=Mc(e.major,`Cannot parse version ${t}: invalid major version`),n=Mc(e.minor,`Cannot parse version ${t}: invalid minor version`),i=Mc(e.patch,`Cannot parse version ${t}: invalid patch version`),o=e.prerelease?Pb(e.prerelease):[],s=e.buildmetadata?qc(e.buildmetadata):[];return{major:r,minor:n,patch:i,prerelease:o,build:s}}var mN=require("node:process");var aN=require("node:process");async function uN(t,e,r){let{data:n,error:i}=await t.from("channels").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Version ${e}@${r.name}`),A.error("")),n&&n.length>0){if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} channel`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();s.start(`Unlinking channel ${o.name}`);let{error:a}=await t.from("channels").update({version:(await jb(t,e))?.id}).eq("id",o.id);a&&(s.stop(`Cannot update channel ${o.name} ${Q(a)}`),(0,aN.exit)(1)),s.stop(`\u2705 Channel ${o.name} unlinked`)}else m.error("Unlink it first"),A.error("");X(`Version unlinked from ${n.length} channel`)}}function jb(t,e){return t.from("app_versions").select("id").eq("app_id",e).eq("name","unknown").throwOnError().single().then(({data:r,error:n})=>(n&&(m.error(`Cannot call findUnknownVersion as it returned an error.
256
256
  ${Q(n)}`),A.error("")),r))}function cN(t,e){return t.from("channels").insert(e).select().single()}function lN(t,e,r,n){return t.from("channels").delete().eq("name",e).eq("app_id",r).single()}function fN(t){let e=new lr;e.theme=lr.roundTheme,e.headers=["Name","Version","Public","iOS","Android","Auto Update","Native Auto Update","Device Self Set","Progressive Deploy","Secondary Version","Secondary Version Percentage","AB Testing","AB Testing Version","AB Testing Percentage","Emulator","Dev"],e.rows=[["a",0,!0],["bb",10,!1]],t.reverse().forEach(r=>{e.rows.push([r.name,r.version?.name,r.public?"\u2705":"\u274C",r.ios?"\u2705":"\u274C",r.android?"\u2705":"\u274C",r.disable_auto_update,r.disable_auto_update_under_native?"\u274C":"\u2705",r.allow_device_self_set?"\u2705":"\u274C",r.enable_progressive_deploy?"\u2705":"\u274C",r.enable_progressive_deploy&&r.second_version?r.second_version.name:void 0,r.enable_progressive_deploy&&r.second_version?r.secondary_version_percentage:void 0,r.enable_ab_testing?"\u2705":"\u274C",r.enable_ab_testing&&r.second_version?r.second_version.name:void 0,r.enable_ab_testing&&r.second_version?`${(1-r.secondary_version_percentage)*100}% / ${r.secondary_version_percentage*100}%`:void 0,r.allow_emulator?"\u2705":"\u274C",r.allow_dev?"\u2705":"\u274C"])}),m.success("Channels"),m.success(e.toString())}async function dN(t,e){let{data:r,error:n}=await t.from("channels").select(`
257
257
  id,
258
258
  name,
@@ -272,17 +272,17 @@ ${Q(n)}`),A.error("")),r))}function cN(t,e){return t.from("channels").insert(e).
272
272
  created_by,
273
273
  app_id,
274
274
  version (id, name)
275
- `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),A.error("")),r}var hN=require("node:process");async function pN(t,e,r){let{data:n,error:i}=await t.from("devices_override").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Device override ${e}@${r.name}`),A.error("")),n&&n.length>0)if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} device override`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();s.start(`Unlinking device ${o.device_id}`);let{error:a}=await t.from("devices_override").delete().eq("device_id",o.device_id);a&&(s.stop(`Cannot unlink device ${o.device_id} ${Q(a)}`),(0,hN.exit)(1)),s.stop(`\u2705 Device ${o.device_id} unlinked`)}else m.error("Unlink it first"),A.error("")}async function Wae(t,e,r){let{error:n}=await t.from("app_versions").update({deleted:!0}).eq("app_id",e).eq("deleted",!1).eq("name",r);n&&(m.error(`App Version ${e}@${r} not found in database`),A.error(""))}async function Xh(t,e,r){let n=await Kae(t,e,r);await uN(t,e,n),await pN(t,e,n),await Wae(t,e,r)}function Zh(t){t.length||(m.error("No bundle found"),(0,mN.exit)(1));let e=new lr;e.theme=lr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,ga(r.created_at),r.keep!=null?r.keep:""])}),m.success("Bundles"),m.success(e.toString())}async function Qh(t,e){let{data:r,error:n}=await t.from("app_versions").select().eq("app_id",e).eq("deleted",!1).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),A.error("")),r}async function gN(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(m.error(`App ${e} not found in database`),A.error("")),r.map(i=>i.version)}async function Kae(t,e,r){let{data:n,error:i}=await t.from("app_versions").select().eq("app_id",e).eq("name",r).eq("deleted",!1).single();return(!n||i)&&(m.error(`App Version ${e}@${r} doesn't exist`),A.error("")),n}async function Yae(t,e,r){for await(let n of t)m.warn(`Removing ${n.name} created on ${ga(n.created_at)}`),await Xh(e,r,n.name)}function Jae(t,e,r){let n=[];return t?.forEach(i=>{let o=Bn(i.name);Ib(o,e)&&ka(o,r)&&n.push(i)}),n}async function yN(t,e){Y("Cleanup versions in Capgo"),await De(),e.apikey=e.apikey||pe();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await ee();t=ge(t,o?.config),e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let s=await de(e.apikey);await me(s,e.apikey,["write","all"]),await Be(s,e.apikey,t,3),m.info("Querying all available versions in Capgo");let a=await Qh(s,t),u=await gN(s,t);if(m.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){m.error("No versions found, aborting cleanup");return}if(r){let f=Bn(r),h=iN(f,"major");m.info(`Querying available versions in Capgo between ${Aa(f)} and ${Aa(h)}`),a=Jae(a,f,h),m.info(`Active versions in Capgo between ${Aa(f)} and ${Aa(h)}: ${a?.length}`)}let c=[],l=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);l<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",l+=1):(f.keep="\u274C",c.push(f))}),c.length===0){m.warn("Nothing to be removed, aborting removal...");return}if(Zh(a),!i){let f=await Pe({message:"Do you want to continue removing the versions specified?"});(kt(f)||!f)&&(m.warn("Not confirmed, aborting removal..."),(0,Nb.exit)())}m.success("You have confirmed removal, removing versions now"),await Yae(c,s,t),X("Done \u2705"),(0,Nb.exit)()}var sn=require("node:fs"),_N=require("node:process");var Vc=require("node:buffer"),Lt=require("node:crypto"),DN="aes-128-cbc",vN="sha256",ep="base64",bN=Lt.constants.RSA_PKCS1_OAEP_PADDING;function wN(t,e,r){let[n,i]=e.split(":"),o=(0,Lt.privateDecrypt)({key:r,padding:bN,oaepHash:vN},Vc.Buffer.from(i,ep)),s=Vc.Buffer.from(n,ep),a=(0,Lt.createDecipheriv)(DN,o,s);return a.setAutoPadding(!0),Vc.Buffer.concat([a.update(t),a.final()])}function tp(t,e){let r=(0,Lt.randomBytes)(16),n=(0,Lt.randomBytes)(16),i=(0,Lt.createCipheriv)(DN,n,r);i.setAutoPadding(!0);let o=r.toString(ep),s=(0,Lt.publicEncrypt)({key:e,padding:bN,oaepHash:vN},n).toString(ep),a=`${o}:${s}`;return{encryptedData:Vc.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}function rp(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Lt.generateKeyPairSync)("rsa",{modulusLength:e});return t==="pem"?{publicKey:r.export({type:"pkcs1",format:"pem"}),privateKey:n.export({type:"pkcs1",format:"pem"})}:{publicKey:r.export({type:"spki",format:"der"}).toString("base64"),privateKey:n.export({type:"pkcs1",format:"pem"}).toString("base64")}}async function EN(t,e,r){Y("Decrypt zip file"),await De(),(0,sn.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,sn.existsSync)(er)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${er} or in ${n.path}`),A.error(""));let i=r.key||er,o=n.config.plugins?.CapacitorUpdater?.privateKey;!(0,sn.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,sn.existsSync)(i)&&(o=(0,sn.readFileSync)(i).toString());let s=(0,sn.readFileSync)(t),a=wN(s,e,r.keyData??o??"");(0,sn.writeFileSync)(`${t}_decrypted.zip`,a),X(`Decrypted zip file at ${t}_decrypted.zip`),(0,_N.exit)()}var an=require("node:fs"),FN=require("node:process");var ON=ce(vu());var Po=require("node:buffer"),Ot=require("node:crypto"),CN="aes-128-cbc",wi="base64",np=Ot.constants.RSA_PKCS1_PADDING;function SN(t,e,r){let[n,i]=e.split(":"),o=(0,Ot.publicDecrypt)({key:r,padding:np},Po.Buffer.from(i,wi)),s=Po.Buffer.from(n,wi),a=(0,Ot.createDecipheriv)(CN,o,s);return a.setAutoPadding(!0),Po.Buffer.concat([a.update(t),a.final()])}function ip(t,e){return(0,Ot.privateEncrypt)({key:e,padding:np},Po.Buffer.from(t,wi)).toString(wi)}function xN(t,e){return(0,Ot.publicDecrypt)({key:e,padding:np},Po.Buffer.from(t,wi)).toString(wi)}function op(t,e){let r=(0,Ot.randomBytes)(16),n=(0,Ot.randomBytes)(16),i=(0,Ot.createCipheriv)(CN,n,r);i.setAutoPadding(!0);let o=r.toString(wi),s=(0,Ot.privateEncrypt)({key:e,padding:np},n).toString(wi),a=`${o}:${s}`;return{encryptedData:Po.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}async function AN(t,e,r){Y("Decrypt zip file"),await De(),(0,an.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,an.existsSync)(jn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${jn} or in ${n.path}`),A.error(""));let i=r.key||jn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,an.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,an.existsSync)(i)&&(o=(0,an.readFileSync)(i).toString());let s=(0,an.readFileSync)(t),a=SN(s,e,r.keyData??o??"");if((0,an.writeFileSync)(`${t}_decrypted.zip`,a),m.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,ON.checksum)(a,"sha256"),c=xN(r.checksum,r.keyData??o??"");u!==c?(m.error(`Checksum does not match ${u} !== ${c}`),A.error("")):m.info("Checksum matches")}X("\u2705 done"),(0,FN.exit)()}var kN=require("node:process");async function TN(t,e,r){Y("Delete bundle"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey);await me(i,r.apikey,["write","all"]),await Be(i,r.apikey,e,3),r.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),m.info(`Deleting bundle ${e}@${t} from Capgo`),m.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Xh(i,e,t),m.success(`Bundle ${e}@${t} deleted in Capgo`),X("Done"),(0,kN.exit)()}var _i=require("node:fs"),PN=require("node:process");async function RN(t,e){Y("Encryption"),await De(),(0,_i.existsSync)(t)||(m.error(`Error: Zip not found at the path ${t}`),A.error(""));let r=e.key||cr,n=e.keyData||"";(0,_i.existsSync)(r)&&(n=(0,_i.readFileSync)(r).toString());let i=(0,_i.readFileSync)(t),o=tp(i,n);m.success(`ivSessionKey: ${o.ivSessionKey}`),(0,_i.writeFileSync)(`${t}_encrypted.zip`,o.encryptedData),m.success(`Encrypted zip saved at ${t}_encrypted.zip`),X("Done \u2705"),(0,PN.exit)()}var qn=require("node:fs"),$N=require("node:process");async function IN(t,e,r){let{json:n}=r;n||(Y("Encryption"),await De());let i=await ee(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&m.warning("There is still a privateKey in the config"),(0,qn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):m.error(`Error: Zip not found at the path ${t}`),A.error("")),s||(n?console.error(Q({error:"missing_public_key"})):m.warning("Warning: Missing Public Key in config"),A.error(""));let a=r.key||ur,u=r.keyData||"";!(0,qn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(m.warning(`Cannot find a private key at ${a} or as a keyData option`),m.error("Error: Missing key")),A.error("")):(0,qn.existsSync)(a)&&(u=(0,qn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):m.error("the private key provided is not a valid RSA Private key"),A.error(""));let c=(0,qn.readFileSync)(t),l=op(c,u),f=ip(e,u),h=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:f,filename:h,ivSessionKey:l.ivSessionKey},null,2)):(m.success(`Encoded Checksum: ${f}`),m.success(`ivSessionKey: ${l.ivSessionKey}`)),(0,qn.writeFileSync)(h,l.encryptedData),n||(m.success(`Encrypted zip saved at ${h}`),X("Done \u2705")),(0,$N.exit)()}var jN=require("node:process");async function NN(t,e){Y("List bundles"),await De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let n=await de(e.apikey);await me(n,e.apikey,["write","all","read","upload"]),m.info(`Querying available versions of: ${t} in Capgo`),await Be(n,e.apikey,t,1);let i=await Qh(n,t);m.info(`Active versions in Capgo: ${i?.length}`),Zh(i),X("Done \u2705"),(0,jN.exit)()}var tL=require("node:crypto"),cn=require("node:fs"),rL=require("node:process");function Hc(t,e,r=0){r=Math.max(0,Math.min(r,e.byteLength));let n=e.byteLength-r;return t.byteLength>n&&(t=t.subarray(0,n)),e.set(t,r),t.byteLength}var sp=32*1024,Lb=2**32-2,ap=class{#e;#t=0;constructor(e){this.#e=e===void 0?new Uint8Array(0):new Uint8Array(e)}bytes(e={copy:!0}){return e.copy===!1?this.#e.subarray(this.#t):this.#e.slice(this.#t)}empty(){return this.#e.byteLength<=this.#t}get length(){return this.#e.byteLength-this.#t}get capacity(){return this.#e.buffer.byteLength}truncate(e){if(e===0){this.reset();return}if(e<0||e>this.length)throw Error("bytes.Buffer: truncation out of range");this.#r(this.#t+e)}reset(){this.#r(0),this.#t=0}#i(e){let r=this.#e.byteLength;return e<=this.capacity-r?(this.#r(r+e),r):-1}#r(e){if(e>this.#e.buffer.byteLength)throw new RangeError("Length is greater than buffer capacity");this.#e=new Uint8Array(this.#e.buffer,0,e)}readSync(e){if(this.empty())return this.reset(),e.byteLength===0?0:null;let r=Hc(this.#e.subarray(this.#t),e);return this.#t+=r,r}read(e){let r=this.readSync(e);return Promise.resolve(r)}writeSync(e){let r=this.#n(e.byteLength);return Hc(e,this.#e,r)}write(e){let r=this.writeSync(e);return Promise.resolve(r)}#n(e){let r=this.length;r===0&&this.#t!==0&&this.reset();let n=this.#i(e);if(n>=0)return n;let i=this.capacity;if(e<=Math.floor(i/2)-r)Hc(this.#e.subarray(this.#t),this.#e);else{if(i+e>Lb)throw new Error("The buffer cannot be grown beyond the maximum size.");{let o=new Uint8Array(Math.min(2*i+e,Lb));Hc(this.#e.subarray(this.#t),o),this.#e=o}}return this.#t=0,this.#r(Math.min(r+e,Lb)),r}grow(e){if(e<0)throw Error("Buffer.grow: negative count");let r=this.#n(e);this.#r(r)}async readFrom(e){let r=0,n=new Uint8Array(sp);for(;;){let i=this.capacity-this.length<sp,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=await e.read(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}readFromSync(e){let r=0,n=new Uint8Array(sp);for(;;){let i=this.capacity-this.length<sp,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=e.readSync(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}};var up=class extends TransformStream{constructor(e){let r=new ap;r.grow(e),super({start(){},async transform(n,i){for(r.write(n);r.length>=e;){let o=new Uint8Array(e),s=await r.read(o);if(s!==e)throw new Error(`Unexpectedly read ${s} bytes from transform buffer when trying to read ${e} bytes.`);i.enqueue(o)}},flush(n){r.length&&n.enqueue(r.bytes())}})}};function Ei(t){return t=t.trim(),t=t.replace(/<!--[\s\S]*?-->/g,""),e();function e(){return{declaration:r(),root:n()}}function r(){if(!u(/^<\?xml\s*/))return;let h={attributes:{}};for(;!(c()||l("?>"));){let d=o();if(!d)return h;h.attributes[d.name]=d.value}return u(/\?>\s*/),h}function n(){let f=u(/^<([\w-:.]+)\s*/);if(!f)return;let h={name:f[1],attributes:{},children:[]};for(;!(c()||l(">")||l("?>")||l("/>"));){let p=o();if(!p)return h;h.attributes[p.name]=p.value}if(u(/^\s*\/>\s*/))return h;u(/\??>\s*/),h.content=i();let d;for(;d=n();)h.children.push(d);return u(/^<\/[\w-:.]+>\s*/),h}function i(){let f=u(/^([^<]*)/);return f?a(f[1]):""}function o(){let f=u(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(f)return{name:f[1],value:a(s(f[2]))}}function s(f){return f.replace(/^['"]|['"]$/g,"")}function a(f){return f.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function c(){return t.length==0}function l(f){return t.indexOf(f)==0}}var un=class extends Error{constructor(e){super(e)}};var Or=class extends un{},cp=class extends un{},lp=class extends un{},Mn=class extends un{},Ro=class extends un{},zc=class extends un{},Gc=class extends un{},Un=class extends un{statusCode;code;key;bucketName;resource;region;constructor(e,r,n,i={}){super(n),this.statusCode=e,this.code=r,this.key=i.key,this.bucketName=i.bucketName,this.resource=i.resource,this.region=i.region}};async function LN(t){try{let r=Ei(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(c=>c.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(c=>c.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(c=>c.name==="Key")?.content,s=r.children.find(c=>c.name==="BucketName")?.content,a=r.children.find(c=>c.name==="Resource")?.content,u=r.children.find(c=>c.name==="Region")?.content;return new Un(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new Un(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function BN(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function qN(t){return typeof t!="string"||t.length<3||t.length>63||t.indexOf("..")>-1||t.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)?!1:!!t.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)}function $o(t){return!(!Xae(t)||t.length===0)}function Xae(t){return!(typeof t!="string"||t.length>1024)}function fp(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function Io(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function qb(t){return t.get("x-amz-version-id")??null}function Wc(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,5)+e.substr(14,2)+e.substr(17,2)+"Z"}function Mb(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function Ub(t,e){return`${Mb(e)}/${t}/s3/aws4_request`}async function dp(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),fp(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Zae=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],hp=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,c=[],l=[];super({start(){},async write(f,h){let d="PUT",p=a++;try{if(p==1&&f.length<i){let w=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:Io(w.headers.get("etag")??void 0),versionId:qb(w.headers)};return}p===1&&(u=(await Qae({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let v={"Content-Length":String(f.length)};for(let w of Zae){let x=o[w];x&&(v[w]=x)}let g=e.makeRequest({method:d,query:{partNumber:p.toString(),uploadId:u},headers:new Headers(v),bucketName:r,objectName:n,payload:f});g.then(w=>{let x=w.headers.get("etag")??"";x&&(x=x.replace(/^"/,"").replace(/"$/,"")),c.push({part:p,etag:x})}),l.push(g)}catch(v){throw v}},async close(){if(!s)if(u)await Promise.all(l),c.sort((f,h)=>f.part>h.part?1:-1),s=await eue({client:e,bucketName:r,objectName:n,uploadId:u,etags:c});else throw new Error("Stream was closed without uploading any data.")}}),this.getResult=()=>{if(s===void 0)throw new Error("Result is not ready. await the stream first.");return s}}};async function Qae(t){let e="POST",r=new Headers(t.metadata),o=await(await t.client.makeRequest({method:e,bucketName:t.bucketName,objectName:t.objectName,query:"uploads",headers:r,returnBody:!0})).text(),s=Ei(o).root;if(!s||s.name!=="InitiateMultipartUploadResult")throw new Error(`Unexpected response: ${o}`);let a=s.children.find(u=>u.name==="UploadId")?.content;if(!a)throw new Error(`Unable to get UploadId from response: ${o}`);return{uploadId:a}}async function eue({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
275
+ `).eq("app_id",e).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),A.error("")),r}var hN=require("node:process");async function pN(t,e,r){let{data:n,error:i}=await t.from("devices_override").select().eq("app_id",e).eq("version",r.id);if(i&&(m.error(`Cannot check Device override ${e}@${r.name}`),A.error("")),n&&n.length>0)if(Y(`\u274C Version ${e}@${r.name} is used in ${n.length} device override`),await Pe({message:"unlink it?"}))for(let o of n){let s=be();s.start(`Unlinking device ${o.device_id}`);let{error:a}=await t.from("devices_override").delete().eq("device_id",o.device_id);a&&(s.stop(`Cannot unlink device ${o.device_id} ${Q(a)}`),(0,hN.exit)(1)),s.stop(`\u2705 Device ${o.device_id} unlinked`)}else m.error("Unlink it first"),A.error("")}async function Kae(t,e,r){let{error:n}=await t.from("app_versions").update({deleted:!0}).eq("app_id",e).eq("deleted",!1).eq("name",r);n&&(m.error(`App Version ${e}@${r} not found in database`),A.error(""))}async function Xh(t,e,r){let n=await Yae(t,e,r);await uN(t,e,n),await pN(t,e,n),await Kae(t,e,r)}function Zh(t){t.length||(m.error("No bundle found"),(0,mN.exit)(1));let e=new lr;e.theme=lr.roundTheme,e.headers=["Version","Created","Keep"],t.reverse().forEach(r=>{e.rows.push([r.name,ga(r.created_at),r.keep!=null?r.keep:""])}),m.success("Bundles"),m.success(e.toString())}async function Qh(t,e){let{data:r,error:n}=await t.from("app_versions").select().eq("app_id",e).eq("deleted",!1).order("created_at",{ascending:!1});return n&&(m.error(`App ${e} not found in database`),A.error("")),r}async function gN(t,e){let{data:r,error:n}=await t.from("channels").select("version").eq("app_id",e);return n&&(m.error(`App ${e} not found in database`),A.error("")),r.map(i=>i.version)}async function Yae(t,e,r){let{data:n,error:i}=await t.from("app_versions").select().eq("app_id",e).eq("name",r).eq("deleted",!1).single();return(!n||i)&&(m.error(`App Version ${e}@${r} doesn't exist`),A.error("")),n}async function Jae(t,e,r){for await(let n of t)m.warn(`Removing ${n.name} created on ${ga(n.created_at)}`),await Xh(e,r,n.name)}function Xae(t,e,r){let n=[];return t?.forEach(i=>{let o=Bn(i.name);Ib(o,e)&&ka(o,r)&&n.push(i)}),n}async function yN(t,e){Y("Cleanup versions in Capgo"),await De(),e.apikey=e.apikey||pe();let{bundle:r,keep:n=4}=e,i=e.force||!1,o=await ee();t=ge(t,o?.config),e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let s=await de(e.apikey);await me(s,e.apikey,["write","all"]),await Be(s,e.apikey,t,3),m.info("Querying all available versions in Capgo");let a=await Qh(s,t),u=await gN(s,t);if(m.info(`Total active versions in Capgo: ${a?.length}`),a?.length===0){m.error("No versions found, aborting cleanup");return}if(r){let f=Bn(r),h=iN(f,"major");m.info(`Querying available versions in Capgo between ${Aa(f)} and ${Aa(h)}`),a=Xae(a,f,h),m.info(`Active versions in Capgo between ${Aa(f)} and ${Aa(h)}: ${a?.length}`)}let c=[],l=0;if(a.forEach(f=>{let h=u.find(d=>d===f.id);l<n||h?(h?f.keep="\u2705 (Linked to channel)":f.keep="\u2705",l+=1):(f.keep="\u274C",c.push(f))}),c.length===0){m.warn("Nothing to be removed, aborting removal...");return}if(Zh(a),!i){let f=await Pe({message:"Do you want to continue removing the versions specified?"});(kt(f)||!f)&&(m.warn("Not confirmed, aborting removal..."),(0,Nb.exit)())}m.success("You have confirmed removal, removing versions now"),await Jae(c,s,t),X("Done \u2705"),(0,Nb.exit)()}var sn=require("node:fs"),_N=require("node:process");var Vc=require("node:buffer"),Lt=require("node:crypto"),DN="aes-128-cbc",vN="sha256",ep="base64",bN=Lt.constants.RSA_PKCS1_OAEP_PADDING;function wN(t,e,r){let[n,i]=e.split(":"),o=(0,Lt.privateDecrypt)({key:r,padding:bN,oaepHash:vN},Vc.Buffer.from(i,ep)),s=Vc.Buffer.from(n,ep),a=(0,Lt.createDecipheriv)(DN,o,s);return a.setAutoPadding(!0),Vc.Buffer.concat([a.update(t),a.final()])}function tp(t,e){let r=(0,Lt.randomBytes)(16),n=(0,Lt.randomBytes)(16),i=(0,Lt.createCipheriv)(DN,n,r);i.setAutoPadding(!0);let o=r.toString(ep),s=(0,Lt.publicEncrypt)({key:e,padding:bN,oaepHash:vN},n).toString(ep),a=`${o}:${s}`;return{encryptedData:Vc.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}function rp(t="pem",e=2048){let{publicKey:r,privateKey:n}=(0,Lt.generateKeyPairSync)("rsa",{modulusLength:e});return t==="pem"?{publicKey:r.export({type:"pkcs1",format:"pem"}),privateKey:n.export({type:"pkcs1",format:"pem"})}:{publicKey:r.export({type:"spki",format:"der"}).toString("base64"),privateKey:n.export({type:"pkcs1",format:"pem"}).toString("base64")}}async function EN(t,e,r){Y("Decrypt zip file"),await De(),(0,sn.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,sn.existsSync)(er)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${er} or in ${n.path}`),A.error(""));let i=r.key||er,o=n.config.plugins?.CapacitorUpdater?.privateKey;!(0,sn.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,sn.existsSync)(i)&&(o=(0,sn.readFileSync)(i).toString());let s=(0,sn.readFileSync)(t),a=wN(s,e,r.keyData??o??"");(0,sn.writeFileSync)(`${t}_decrypted.zip`,a),X(`Decrypted zip file at ${t}_decrypted.zip`),(0,_N.exit)()}var an=require("node:fs"),FN=require("node:process");var ON=ce(vu());var Po=require("node:buffer"),Ot=require("node:crypto"),CN="aes-128-cbc",wi="base64",np=Ot.constants.RSA_PKCS1_PADDING;function SN(t,e,r){let[n,i]=e.split(":"),o=(0,Ot.publicDecrypt)({key:r,padding:np},Po.Buffer.from(i,wi)),s=Po.Buffer.from(n,wi),a=(0,Ot.createDecipheriv)(CN,o,s);return a.setAutoPadding(!0),Po.Buffer.concat([a.update(t),a.final()])}function ip(t,e){return(0,Ot.privateEncrypt)({key:e,padding:np},Po.Buffer.from(t,wi)).toString(wi)}function xN(t,e){return(0,Ot.publicDecrypt)({key:e,padding:np},Po.Buffer.from(t,wi)).toString(wi)}function op(t,e){let r=(0,Ot.randomBytes)(16),n=(0,Ot.randomBytes)(16),i=(0,Ot.createCipheriv)(CN,n,r);i.setAutoPadding(!0);let o=r.toString(wi),s=(0,Ot.privateEncrypt)({key:e,padding:np},n).toString(wi),a=`${o}:${s}`;return{encryptedData:Po.Buffer.concat([i.update(t),i.final()]),ivSessionKey:a}}async function AN(t,e,r){Y("Decrypt zip file"),await De(),(0,an.existsSync)(t)||(m.error(`Zip not found at the path ${t}`),A.error(""));let n=await ee();!r.key&&!(0,an.existsSync)(jn)&&!n.config.plugins?.CapacitorUpdater?.privateKey&&(m.error(`Private Key not found at the path ${jn} or in ${n.path}`),A.error(""));let i=r.key||jn,o=n.config.plugins?.CapacitorUpdater?.publicKey;!(0,an.existsSync)(i)&&!o?(m.error(`Cannot find public key ${i} or as keyData option or in ${n.path}`),A.error("")):(0,an.existsSync)(i)&&(o=(0,an.readFileSync)(i).toString());let s=(0,an.readFileSync)(t),a=SN(s,e,r.keyData??o??"");if((0,an.writeFileSync)(`${t}_decrypted.zip`,a),m.info(`Decrypted zip file at ${t}_decrypted.zip`),r.checksum){let u=await(0,ON.checksum)(a,"sha256"),c=xN(r.checksum,r.keyData??o??"");u!==c?(m.error(`Checksum does not match ${u} !== ${c}`),A.error("")):m.info("Checksum matches")}X("\u2705 done"),(0,FN.exit)()}var kN=require("node:process");async function TN(t,e,r){Y("Delete bundle"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey);await me(i,r.apikey,["write","all"]),await Be(i,r.apikey,e,3),r.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a bundleId, or be in a capacitor project"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error("")),m.info(`Deleting bundle ${e}@${t} from Capgo`),m.info("Keep in mind that you will not be able to reuse this bundle version, it's gone forever"),await Xh(i,e,t),m.success(`Bundle ${e}@${t} deleted in Capgo`),X("Done"),(0,kN.exit)()}var _i=require("node:fs"),PN=require("node:process");async function RN(t,e){Y("Encryption"),await De(),(0,_i.existsSync)(t)||(m.error(`Error: Zip not found at the path ${t}`),A.error(""));let r=e.key||cr,n=e.keyData||"";(0,_i.existsSync)(r)&&(n=(0,_i.readFileSync)(r).toString());let i=(0,_i.readFileSync)(t),o=tp(i,n);m.success(`ivSessionKey: ${o.ivSessionKey}`),(0,_i.writeFileSync)(`${t}_encrypted.zip`,o.encryptedData),m.success(`Encrypted zip saved at ${t}_encrypted.zip`),X("Done \u2705"),(0,PN.exit)()}var qn=require("node:fs"),$N=require("node:process");async function IN(t,e,r){let{json:n}=r;n||(Y("Encryption"),await De());let i=await ee(),o=!!i.config.plugins?.CapacitorUpdater?.privateKey,s=!!i.config.plugins?.CapacitorUpdater?.publicKey;o&&!n&&m.warning("There is still a privateKey in the config"),(0,qn.existsSync)(t)||(n?console.error(Q({error:"zip_not_found"})):m.error(`Error: Zip not found at the path ${t}`),A.error("")),s||(n?console.error(Q({error:"missing_public_key"})):m.warning("Warning: Missing Public Key in config"),A.error(""));let a=r.key||ur,u=r.keyData||"";!(0,qn.existsSync)(a)&&!u?(n?console.error(Q({error:"missing_key"})):(m.warning(`Cannot find a private key at ${a} or as a keyData option`),m.error("Error: Missing key")),A.error("")):(0,qn.existsSync)(a)&&(u=(0,qn.readFileSync)(a).toString()),u&&!u.startsWith("-----BEGIN RSA PRIVATE KEY-----")&&(n?console.error(Q({error:"invalid_private_key"})):m.error("the private key provided is not a valid RSA Private key"),A.error(""));let c=(0,qn.readFileSync)(t),l=op(c,u),f=ip(e,u),h=`${t}_encrypted.zip`;n?console.log(JSON.stringify({checksum:f,filename:h,ivSessionKey:l.ivSessionKey},null,2)):(m.success(`Encoded Checksum: ${f}`),m.success(`ivSessionKey: ${l.ivSessionKey}`)),(0,qn.writeFileSync)(h,l.encryptedData),n||(m.success(`Encrypted zip saved at ${h}`),X("Done \u2705")),(0,$N.exit)()}var jN=require("node:process");async function NN(t,e){Y("List bundles"),await De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appid, or be in a capacitor project"),A.error(""));let n=await de(e.apikey);await me(n,e.apikey,["write","all","read","upload"]),m.info(`Querying available versions of: ${t} in Capgo`),await Be(n,e.apikey,t,1);let i=await Qh(n,t);m.info(`Active versions in Capgo: ${i?.length}`),Zh(i),X("Done \u2705"),(0,jN.exit)()}var tL=require("node:crypto"),cn=require("node:fs"),rL=require("node:os"),nL=require("node:process");function Hc(t,e,r=0){r=Math.max(0,Math.min(r,e.byteLength));let n=e.byteLength-r;return t.byteLength>n&&(t=t.subarray(0,n)),e.set(t,r),t.byteLength}var sp=32*1024,Lb=2**32-2,ap=class{#e;#t=0;constructor(e){this.#e=e===void 0?new Uint8Array(0):new Uint8Array(e)}bytes(e={copy:!0}){return e.copy===!1?this.#e.subarray(this.#t):this.#e.slice(this.#t)}empty(){return this.#e.byteLength<=this.#t}get length(){return this.#e.byteLength-this.#t}get capacity(){return this.#e.buffer.byteLength}truncate(e){if(e===0){this.reset();return}if(e<0||e>this.length)throw Error("bytes.Buffer: truncation out of range");this.#r(this.#t+e)}reset(){this.#r(0),this.#t=0}#i(e){let r=this.#e.byteLength;return e<=this.capacity-r?(this.#r(r+e),r):-1}#r(e){if(e>this.#e.buffer.byteLength)throw new RangeError("Length is greater than buffer capacity");this.#e=new Uint8Array(this.#e.buffer,0,e)}readSync(e){if(this.empty())return this.reset(),e.byteLength===0?0:null;let r=Hc(this.#e.subarray(this.#t),e);return this.#t+=r,r}read(e){let r=this.readSync(e);return Promise.resolve(r)}writeSync(e){let r=this.#n(e.byteLength);return Hc(e,this.#e,r)}write(e){let r=this.writeSync(e);return Promise.resolve(r)}#n(e){let r=this.length;r===0&&this.#t!==0&&this.reset();let n=this.#i(e);if(n>=0)return n;let i=this.capacity;if(e<=Math.floor(i/2)-r)Hc(this.#e.subarray(this.#t),this.#e);else{if(i+e>Lb)throw new Error("The buffer cannot be grown beyond the maximum size.");{let o=new Uint8Array(Math.min(2*i+e,Lb));Hc(this.#e.subarray(this.#t),o),this.#e=o}}return this.#t=0,this.#r(Math.min(r+e,Lb)),r}grow(e){if(e<0)throw Error("Buffer.grow: negative count");let r=this.#n(e);this.#r(r)}async readFrom(e){let r=0,n=new Uint8Array(sp);for(;;){let i=this.capacity-this.length<sp,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=await e.read(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}readFromSync(e){let r=0,n=new Uint8Array(sp);for(;;){let i=this.capacity-this.length<sp,o=i?n:new Uint8Array(this.#e.buffer,this.length),s=e.readSync(o);if(s===null)return r;i?this.writeSync(o.subarray(0,s)):this.#r(this.length+s),r+=s}}};var up=class extends TransformStream{constructor(e){let r=new ap;r.grow(e),super({start(){},async transform(n,i){for(r.write(n);r.length>=e;){let o=new Uint8Array(e),s=await r.read(o);if(s!==e)throw new Error(`Unexpectedly read ${s} bytes from transform buffer when trying to read ${e} bytes.`);i.enqueue(o)}},flush(n){r.length&&n.enqueue(r.bytes())}})}};function Ei(t){return t=t.trim(),t=t.replace(/<!--[\s\S]*?-->/g,""),e();function e(){return{declaration:r(),root:n()}}function r(){if(!u(/^<\?xml\s*/))return;let h={attributes:{}};for(;!(c()||l("?>"));){let d=o();if(!d)return h;h.attributes[d.name]=d.value}return u(/\?>\s*/),h}function n(){let f=u(/^<([\w-:.]+)\s*/);if(!f)return;let h={name:f[1],attributes:{},children:[]};for(;!(c()||l(">")||l("?>")||l("/>"));){let p=o();if(!p)return h;h.attributes[p.name]=p.value}if(u(/^\s*\/>\s*/))return h;u(/\??>\s*/),h.content=i();let d;for(;d=n();)h.children.push(d);return u(/^<\/[\w-:.]+>\s*/),h}function i(){let f=u(/^([^<]*)/);return f?a(f[1]):""}function o(){let f=u(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(f)return{name:f[1],value:a(s(f[2]))}}function s(f){return f.replace(/^['"]|['"]$/g,"")}function a(f){return f.replaceAll("&lt;","<").replaceAll("&gt;",">").replaceAll("&amp;","&")}function u(f){let h=t.match(f);if(h)return t=t.slice(h[0].length),h}function c(){return t.length==0}function l(f){return t.indexOf(f)==0}}var un=class extends Error{constructor(e){super(e)}};var Or=class extends un{},cp=class extends un{},lp=class extends un{},Mn=class extends un{},Ro=class extends un{},zc=class extends un{},Gc=class extends un{},Un=class extends un{statusCode;code;key;bucketName;resource;region;constructor(e,r,n,i={}){super(n),this.statusCode=e,this.code=r,this.key=i.key,this.bucketName=i.bucketName,this.resource=i.resource,this.region=i.region}};async function LN(t){try{let r=Ei(await t.text()).root;if(r?.name!=="Error")throw new Error("Invalid root, expected <Error>");let n=r.children.find(c=>c.name==="Code")?.content??"UnknownErrorCode",i=r.children.find(c=>c.name==="Message")?.content??"The error message could not be determined.",o=r.children.find(c=>c.name==="Key")?.content,s=r.children.find(c=>c.name==="BucketName")?.content,a=r.children.find(c=>c.name==="Resource")?.content,u=r.children.find(c=>c.name==="Region")?.content;return new Un(t.status,n,i,{key:o,bucketName:s,resource:a,region:u})}catch{return new Un(t.status,"UnrecognizedError",`Error: Unexpected response code ${t.status} ${t.statusText}. Unable to parse response as XML.`)}}function BN(t){return typeof t!="number"||isNaN(t)||t<=0?!1:t>=1&&t<=65535}function qN(t){return typeof t!="string"||t.length<3||t.length>63||t.indexOf("..")>-1||t.match(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/)?!1:!!t.match(/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/)}function $o(t){return!(!Zae(t)||t.length===0)}function Zae(t){return!(typeof t!="string"||t.length>1024)}function fp(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}function Io(t=""){let e={'"':"","&quot;":"","&#34;":"","&QUOT;":"","&#x00022":""};return t.replace(/^("|&quot;|&#34;)|("|&quot;|&#34;)$/g,r=>e[r])}function qb(t){return t.get("x-amz-version-id")??null}function Wc(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,5)+e.substr(14,2)+e.substr(17,2)+"Z"}function Mb(t){t=t||new Date;let e=t.toISOString();return e.substr(0,4)+e.substr(5,2)+e.substr(8,2)}function Ub(t,e){return`${Mb(e)}/${t}/s3/aws4_request`}async function dp(t){return t instanceof Uint8Array||(t=new TextEncoder().encode(t)),fp(new Uint8Array(await crypto.subtle.digest("SHA-256",t)))}var Qae=["x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5"],hp=class extends WritableStream{getResult;constructor({client:e,bucketName:r,objectName:n,partSize:i,metadata:o}){let s,a=1,u,c=[],l=[];super({start(){},async write(f,h){let d="PUT",p=a++;try{if(p==1&&f.length<i){let w=await e.makeRequest({method:d,headers:new Headers({...o,"Content-Length":String(f.length)}),bucketName:r,objectName:n,payload:f});s={etag:Io(w.headers.get("etag")??void 0),versionId:qb(w.headers)};return}p===1&&(u=(await eue({client:e,bucketName:r,objectName:n,metadata:o})).uploadId);let v={"Content-Length":String(f.length)};for(let w of Qae){let x=o[w];x&&(v[w]=x)}let g=e.makeRequest({method:d,query:{partNumber:p.toString(),uploadId:u},headers:new Headers(v),bucketName:r,objectName:n,payload:f});g.then(w=>{let x=w.headers.get("etag")??"";x&&(x=x.replace(/^"/,"").replace(/"$/,"")),c.push({part:p,etag:x})}),l.push(g)}catch(v){throw v}},async close(){if(!s)if(u)await Promise.all(l),c.sort((f,h)=>f.part>h.part?1:-1),s=await tue({client:e,bucketName:r,objectName:n,uploadId:u,etags:c});else throw new Error("Stream was closed without uploading any data.")}}),this.getResult=()=>{if(s===void 0)throw new Error("Result is not ready. await the stream first.");return s}}};async function eue(t){let e="POST",r=new Headers(t.metadata),o=await(await t.client.makeRequest({method:e,bucketName:t.bucketName,objectName:t.objectName,query:"uploads",headers:r,returnBody:!0})).text(),s=Ei(o).root;if(!s||s.name!=="InitiateMultipartUploadResult")throw new Error(`Unexpected response: ${o}`);let a=s.children.find(u=>u.name==="UploadId")?.content;if(!a)throw new Error(`Unable to get UploadId from response: ${o}`);return{uploadId:a}}async function tue({client:t,bucketName:e,objectName:r,uploadId:n,etags:i}){let o=`
276
276
  <CompleteMultipartUpload xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
277
277
  ${i.map(f=>` <Part><PartNumber>${f.part}</PartNumber><ETag>${f.etag}</ETag></Part>`).join(`
278
278
  `)}
279
279
  </CompleteMultipartUpload>
280
- `,s=await t.makeRequest({method:"POST",bucketName:e,objectName:r,query:`uploadId=${encodeURIComponent(n)}`,payload:new TextEncoder().encode(o),returnBody:!0}),a=await s.text(),u=Ei(a).root;if(!u||u.name!=="CompleteMultipartUploadResult")throw new Error(`Unexpected response: ${a}`);let c=u.children.find(f=>f.name==="ETag")?.content;if(!c)throw new Error(`Unable to get ETag from response: ${a}`);let l=qb(s.headers);return{etag:Io(c),versionId:l}}var Vb="AWS4-HMAC-SHA256";async function MN(t){if(!t.accessKey)throw new Ro("accessKey is required for signing");if(!t.secretKey)throw new zc("secretKey is required for signing");let e=t.headers.get("x-amz-content-sha256");if(e===null)throw new Error("Internal S3 client error - expected x-amz-content-sha256 header, but it's missing.");let r=VN(t.headers),n=HN(t.method,t.path,t.headers,r,e),i=await zN(n,t.date,t.region),o=await GN(t.date,t.region,t.secretKey),s=WN(t.accessKey,t.region,t.date),a=fp(await Ta(o,i)).toLowerCase();return`${Vb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function UN(t){if(!t.accessKey)throw new Ro("accessKey is required for signing");if(!t.secretKey)throw new zc("secretKey is required for signing");if(t.expirySeconds<1)throw new Gc("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new Gc("expirySeconds cannot be greater than 7 days");if(!t.headers.has("Host"))throw new Error("Internal error: host header missing");let e=t.path.split("?")[0],r=t.path.split("?")[1],n=Wc(t.date),i=VN(t.headers),o=WN(t.accessKey,t.region,t.date),s="UNSIGNED-PAYLOAD",a=new URLSearchParams(r);a.set("X-Amz-Algorithm",Vb),a.set("X-Amz-Credential",o),a.set("X-Amz-Date",n),a.set("X-Amz-Expires",t.expirySeconds.toString()),a.set("X-Amz-SignedHeaders",i.join(";").toLowerCase());let u=e+"?"+a.toString().replace("+","%20"),c=HN(t.method,u,t.headers,i,s),l=await zN(c,t.date,t.region),f=await GN(t.date,t.region,t.secretKey),h=fp(await Ta(f,l)).toLowerCase();return`${t.protocol}//${t.headers.get("Host")}${u}&X-Amz-Signature=${h}`}function VN(t){let e=["authorization","content-length","content-type","user-agent"],r=[];for(let n of t.keys())e.includes(n.toLowerCase())||r.push(n);return r.sort(),r}var jo={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},tue="-._~".split("").map(t=>t.charCodeAt(0));function rue(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=jo.A&&i<=jo.Z||i>=jo.a&&i<=jo.z||i>=jo[0]&&i<=jo[9]||tue.includes(i)||i==jo["/"]&&e?n+=String.fromCharCode(i):n+="%"+i.toString(16).padStart(2,"0").toUpperCase();return n}function HN(t,e,r,n,i){let o=n.reduce((c,l)=>{let f=`${r.get(l)}`.replace(/ +/g," ");return c.push(`${l.toLowerCase()}:${f}`),c},[]),s=e.split("?")[0],a=e.split("?")[1];a?a=a.split("&").sort().map(c=>c.indexOf("=")===-1?c+"=":c).join("&"):a="";let u=[];return u.push(t.toUpperCase()),u.push(rue(s,!0)),u.push(a),u.push(o.join(`
280
+ `,s=await t.makeRequest({method:"POST",bucketName:e,objectName:r,query:`uploadId=${encodeURIComponent(n)}`,payload:new TextEncoder().encode(o),returnBody:!0}),a=await s.text(),u=Ei(a).root;if(!u||u.name!=="CompleteMultipartUploadResult")throw new Error(`Unexpected response: ${a}`);let c=u.children.find(f=>f.name==="ETag")?.content;if(!c)throw new Error(`Unable to get ETag from response: ${a}`);let l=qb(s.headers);return{etag:Io(c),versionId:l}}var Vb="AWS4-HMAC-SHA256";async function MN(t){if(!t.accessKey)throw new Ro("accessKey is required for signing");if(!t.secretKey)throw new zc("secretKey is required for signing");let e=t.headers.get("x-amz-content-sha256");if(e===null)throw new Error("Internal S3 client error - expected x-amz-content-sha256 header, but it's missing.");let r=VN(t.headers),n=HN(t.method,t.path,t.headers,r,e),i=await zN(n,t.date,t.region),o=await GN(t.date,t.region,t.secretKey),s=WN(t.accessKey,t.region,t.date),a=fp(await Ta(o,i)).toLowerCase();return`${Vb} Credential=${s}, SignedHeaders=${r.join(";").toLowerCase()}, Signature=${a}`}async function UN(t){if(!t.accessKey)throw new Ro("accessKey is required for signing");if(!t.secretKey)throw new zc("secretKey is required for signing");if(t.expirySeconds<1)throw new Gc("expirySeconds cannot be less than 1 seconds");if(t.expirySeconds>604800)throw new Gc("expirySeconds cannot be greater than 7 days");if(!t.headers.has("Host"))throw new Error("Internal error: host header missing");let e=t.path.split("?")[0],r=t.path.split("?")[1],n=Wc(t.date),i=VN(t.headers),o=WN(t.accessKey,t.region,t.date),s="UNSIGNED-PAYLOAD",a=new URLSearchParams(r);a.set("X-Amz-Algorithm",Vb),a.set("X-Amz-Credential",o),a.set("X-Amz-Date",n),a.set("X-Amz-Expires",t.expirySeconds.toString()),a.set("X-Amz-SignedHeaders",i.join(";").toLowerCase());let u=e+"?"+a.toString().replace("+","%20"),c=HN(t.method,u,t.headers,i,s),l=await zN(c,t.date,t.region),f=await GN(t.date,t.region,t.secretKey),h=fp(await Ta(f,l)).toLowerCase();return`${t.protocol}//${t.headers.get("Host")}${u}&X-Amz-Signature=${h}`}function VN(t){let e=["authorization","content-length","content-type","user-agent"],r=[];for(let n of t.keys())e.includes(n.toLowerCase())||r.push(n);return r.sort(),r}var jo={A:65,Z:90,a:97,z:122,0:48,9:57,"/":47},rue="-._~".split("").map(t=>t.charCodeAt(0));function nue(t,e=!1){let r=new TextEncoder().encode(t),n="";for(let i of r)i>=jo.A&&i<=jo.Z||i>=jo.a&&i<=jo.z||i>=jo[0]&&i<=jo[9]||rue.includes(i)||i==jo["/"]&&e?n+=String.fromCharCode(i):n+="%"+i.toString(16).padStart(2,"0").toUpperCase();return n}function HN(t,e,r,n,i){let o=n.reduce((c,l)=>{let f=`${r.get(l)}`.replace(/ +/g," ");return c.push(`${l.toLowerCase()}:${f}`),c},[]),s=e.split("?")[0],a=e.split("?")[1];a?a=a.split("&").sort().map(c=>c.indexOf("=")===-1?c+"=":c).join("&"):a="";let u=[];return u.push(t.toUpperCase()),u.push(nue(s,!0)),u.push(a),u.push(o.join(`
281
281
  `)+`
282
282
  `),u.push(n.join(";").toLowerCase()),u.push(i),u.join(`
283
283
  `)}async function zN(t,e,r){let n=await dp(t),i=Ub(r,e),o=[];return o.push(Vb),o.push(Wc(e)),o.push(i),o.push(n),o.join(`
284
- `)}async function GN(t,e,r){let n=Mb(t),i=await Ta("AWS4"+r,n),o=await Ta(i,e),s=await Ta(o,"s3");return await Ta(s,"aws4_request")}function WN(t,e,r){return`${t}/${Ub(e,r)}`}async function Ta(t,e){let r=new TextEncoder,n=await crypto.subtle.importKey("raw",t instanceof Uint8Array?t:r.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),i=await crypto.subtle.sign("HMAC",n,e instanceof Uint8Array?e:r.encode(e));return new Uint8Array(i)}var nue=["Content-Type","Cache-Control","Content-Disposition","Content-Encoding","Content-Language","Expires","x-amz-grant-full-control","x-amz-grant-read","x-amz-grant-read-acp","x-amz-grant-write-acp","x-amz-server-side-encryption","x-amz-storage-class","x-amz-website-redirect-location","x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5","x-amz-server-side-encryption-aws-kms-key-id","x-amz-server-side-encryption-context","x-amz-server-side-encryption-bucket-key-enabled","x-amz-request-payer","x-amz-tagging","x-amz-object-lock-mode","x-amz-object-lock-retain-until-date","x-amz-object-lock-legal-hold","x-amz-expected-bucket-owner"],iue=5*1024*1024,oue=5*1024*1024*1024,Hb=5*1024*1024*1024*1024,Kc=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;constructor(e){if(e.useSSL===void 0&&(e.useSSL=!0),typeof e.endPoint!="string"||e.endPoint.length===0||e.endPoint.indexOf("/")!==-1)throw new cp(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!BN(e.port))throw new Or(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Or("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Or("If specifying temporary access key, session token must also be provided.");let r=e.useSSL?443:80;this.port=e.port??r,this.host=e.endPoint.toLowerCase()+(this.port!==r?`:${e.port}`:""),this.protocol=e.useSSL?"https:":"http:",this.accessKey=e.accessKey,this.#e=e.secretKey??"",this.sessionToken=e.sessionToken,this.pathStyle=e.pathStyle??!0,this.defaultBucket=e.bucket,this.region=e.region}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!qN(r))throw new lp(`Invalid bucket name: ${r}`);return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let o=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,s=(this.pathStyle?`/${r}/${e.objectName}`:`/${e.objectName}`)+(o?`?${o}`:"");return{headers:i,host:n,path:s}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:o,host:s,path:a}=this.buildRequestOptions(n),u=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),o.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let c=await dp(r??new Uint8Array);o.set("x-amz-date",Wc(i)),o.set("x-amz-content-sha256",c),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await MN({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let l=`${this.protocol}//${s}${a}`,f=await fetch(l,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await LN(f):f.status===301?new Un(f.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new Un(f.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${u}, got ${f.status} ${f.statusText}).`);return n.returnBody||await f.body?.getReader().read(),f}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let i=r.versionId?{versionId:r.versionId}:{},o=new Headers;r.governanceBypass&&o.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:o,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof Un&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let o=this.getBucketName(i);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),s.set("Range",c),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:o,objectName:e,headers:s,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new Ro(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!$o(r))throw new Mn(`Invalid object name: ${r}`);let{headers:i,path:o}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),s=n.requestDate??new Date,a=n.expirySeconds??24*60*60*7;return UN({protocol:this.protocol,headers:i,method:e,path:o,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:s,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...o}=r,s={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:s,...o})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Or("pageSize must be between 1 and 1,000.");let o=0;for(;;){let s=e.maxResults?Math.min(i,e.maxResults-o):i;if(s===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(s),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=Ei(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of l)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of c.children.filter(p=>p.name==="Contents"))f.push({type:"Object",key:d.children.find(p=>p.name==="Key")?.content??"",etag:Io(d.children.find(p=>p.name==="ETag")?.content??""),size:parseInt(d.children.find(p=>p.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(p=>p.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,p)=>{let v=d.type==="Object"?d.key:d.prefix,g=p.type==="Object"?p.key:p.prefix;return v>g?1:v<g?-1:0});for(let d of f)yield d;if(c.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=c.children.find(p=>p.name==="NextContinuationToken")?.content;if(!d)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=d}else return}}async putObject(e,r,n){let i=this.getBucketName(n);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([l]):s=new ReadableStream({start(f){f.enqueue(l),f.close()}}),o=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(l){l.enqueue(r),l.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Or("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Or(`size was specified (${n.size}) but doesn't match auto-detected size (${o}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Or(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<iue)throw new Or("Part size should be greater than 5MB");if(a>oue)throw new Or("Part size should be less than 6MB");let u=new up(a),c=new hp({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=Hb),e>Hb)throw new TypeError(`size should not be more than ${Hb}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let i={};r?.versionId&&(i.versionId=r.versionId);let o=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i}),s={};for(let a of nue)o.headers.has(a)&&(s[a]=o.headers.get(a));return o.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(s[u]=o.headers.get(u))}),{type:"Object",key:e,size:parseInt(o.headers.get("content-length")??"",10),metadata:s,lastModified:new Date(o.headers.get("Last-Modified")??"error: missing last modified"),versionId:o.headers.get("x-amz-version-id")||null,etag:Io(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!$o(r))throw new Mn(`Invalid object name: ${r}`);let s=`${o}/${e.sourceKey}`;e.sourceVersionId&&(s+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",s);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),c=await u.text(),l=Ei(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let f=l.children.find(d=>d.name==="ETag")?.content??"",h=l.children.find(d=>d.name==="LastModified")?.content;if(h===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:Io(f),lastModified:new Date(h),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof Un&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}};var zb=ce(vu());var Ci=require("node:fs"),Yc=require("node:path");function sue(t,e){return(0,Ci.readFileSync)(t,"utf8").includes(e)}function Jc(t,e){let r=(0,Ci.readdirSync)(t);for(let n of r){let i=(0,Yc.join)(t,n),o=(0,Ci.statSync)(i);if(o.isDirectory()){if(Jc(i,e))return!0}else if(o.isFile()&&(0,Yc.extname)(i)===".js"&&sue(i,e))return!0}return!1}function Xc(t){let e=(0,Ci.readdirSync)(t);if(e.length===1){let n=(0,Yc.join)(t,e[0]);if((0,Ci.statSync)(n).isDirectory())return Xc(n)}return e.indexOf("index.html")>-1}var KN=require("node:fs"),YN=require("node:path"),JN=require("node:stream/consumers"),XN=require("node:zlib");var ZN=ce(rD());async function QN(t,e,r,n){let i=be();i.start("Generating the update manifest");let o=await sj(t);return i.stop("Manifest generated successfully"),await Fe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),o}async function eL(t,e,r,n,i,o){let s=be();s.start("Preparing partial update with TUS protocol");let a=performance.now(),u=await Cr(),c=0,l=e.length,f=e.map(async h=>{let d=(0,YN.join)(r,h.file),p=(0,KN.createReadStream)(d).pipe((0,XN.createBrotliCompress)()),v=await(0,JN.buffer)(p);return new Promise((g,w)=>{new ZN.Upload(v,{endpoint:`${u.hostFilesApi}/files/upload/attachments/`,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${h.file}`},headers:{Authorization:t},onError(y){m.info(`Failed to upload ${h.file}: ${y}`),w(y)},onProgress(){let y=(c/l*100).toFixed(2);s.message(`Uploading partial update: ${y}%`)},onSuccess(){c++,g({file_name:h.file,s3_path:`orgs/${o}/apps/${n}/${i}/${h.file}`,file_hash:h.hash})}}).start()})});try{let h=await Promise.all(f),p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${p} seconds)`),await Fe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await Fe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:p},notify:!1}),h}catch(h){let p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Failed to upload Partial bundle ( after ${p} seconds)`),m.info(`Error uploading partial update: ${h}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function aue(t,e){let r=await jt("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,tL.randomUUID)().split("-")[0]}`;return da.test(n)||(m.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n}function uue(t){let e=t.apikey||pe();return e||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e}function cue(t,e,r){let n=ge(t,r),i=e.path||r?.webDir;return n||(m.error("Missing argument, you need to provide a appid or be in a capacitor project"),A.error("")),i||(m.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),A.error("")),(0,cn.existsSync)(i)||(m.error(`Path ${i} does not exist, build your app first, or provide a valid path`),A.error("")),{appid:n,path:i}}function lue(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Jc(e,"notifyAppReady")||(m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Xc(e)||(m.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")))}async function fue(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:c,error:l}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!c&&c.disable_auto_update==="version_number",h,d;if(!l&&c&&c.version&&c.version.native_packages&&!s){let g=be();g.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:w,localDependencies:x}=await $h(t,i,n,r.packageJson,r.nodeModules);if(d=w,h=x,d.find(y=>y.localVersion!==y.remoteVersion))g.stop(`Bundle NOT compatible with ${n} channel`),m.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,m.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:y}=c.version;(!y||!da.test(y))&&(m.error("Invalid remote min update version, skipping auto setting compatibility"),A.error("")),u=y,g.stop(`Auto set min-update-version to ${u}`)}catch{m.error(`Cannot auto set compatibility, invalid data ${c}`),A.error("")}else g.stop(`Bundle compatible with ${n} channel`)}else s||(m.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await sb(r.packageJson,r.nodeModules),a&&(u=o,m.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(m.error("You need to provide a min-update-version to upload a bundle to this channel"),A.error("")),u&&(da.test(u)||(m.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),A.error("")));let p=h?new Map(h.filter(g=>!!g.native&&g.native!==void 0).map(g=>[g.name,g])):new Map;return{nativePackages:p.size>0||!r.ignoreMetadataCheck?Array.from(p,([g,w])=>({name:g,version:w.version})):void 0,minUpdateVersion:u}}async function due(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(m.warn(`WARNING !!
285
- Trial expires in ${n} days`),m.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function hue(t,e,r){let{data:n,error:i}=await t.rpc("exist_app_versions",{appid:e,apikey:"",name_version:r}).single();(n||i)&&(m.error(`Version already exists ${Q(i)}`),A.error(""))}async function pue(t,e,r,n,i,o){let s,a="",u=null,c=e.key,l=e.keyV2;u=await Ph(t);let f=be();if(f.start("Calculating checksum"),(l||e.keyDataV2||(0,cn.existsSync)(ur))&&c!==!1?a=await(0,zb.checksum)(u,"sha256"):a=await(0,zb.checksum)(u,"crc32"),f.stop(`Checksum: ${a}`),c===!1)m.info("Encryption ignored");else if((l||(0,cn.existsSync)(ur)||e.keyDataV2)&&!e.oldEncryption){let d=typeof l=="string"?l:ur,p=e.keyDataV2||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find private key ${d}`),A.error("")),await Fe(n,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle with V2");let v=op(u,p);a=ip(a,p),s=v.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
284
+ `)}async function GN(t,e,r){let n=Mb(t),i=await Ta("AWS4"+r,n),o=await Ta(i,e),s=await Ta(o,"s3");return await Ta(s,"aws4_request")}function WN(t,e,r){return`${t}/${Ub(e,r)}`}async function Ta(t,e){let r=new TextEncoder,n=await crypto.subtle.importKey("raw",t instanceof Uint8Array?t:r.encode(t),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]),i=await crypto.subtle.sign("HMAC",n,e instanceof Uint8Array?e:r.encode(e));return new Uint8Array(i)}var iue=["Content-Type","Cache-Control","Content-Disposition","Content-Encoding","Content-Language","Expires","x-amz-grant-full-control","x-amz-grant-read","x-amz-grant-read-acp","x-amz-grant-write-acp","x-amz-server-side-encryption","x-amz-storage-class","x-amz-website-redirect-location","x-amz-server-side-encryption-customer-algorithm","x-amz-server-side-encryption-customer-key","x-amz-server-side-encryption-customer-key-MD5","x-amz-server-side-encryption-aws-kms-key-id","x-amz-server-side-encryption-context","x-amz-server-side-encryption-bucket-key-enabled","x-amz-request-payer","x-amz-tagging","x-amz-object-lock-mode","x-amz-object-lock-retain-until-date","x-amz-object-lock-legal-hold","x-amz-expected-bucket-owner"],oue=5*1024*1024,sue=5*1024*1024*1024,Hb=5*1024*1024*1024*1024,Kc=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;constructor(e){if(e.useSSL===void 0&&(e.useSSL=!0),typeof e.endPoint!="string"||e.endPoint.length===0||e.endPoint.indexOf("/")!==-1)throw new cp(`Invalid endPoint : ${e.endPoint}`);if(e.port!==void 0&&!BN(e.port))throw new Or(`Invalid port : ${e.port}`);if(e.accessKey&&!e.secretKey)throw new Or("If specifying access key, secret key must also be provided.");if(e.accessKey&&e.accessKey.startsWith("ASIA")&&!e.sessionToken)throw new Or("If specifying temporary access key, session token must also be provided.");let r=e.useSSL?443:80;this.port=e.port??r,this.host=e.endPoint.toLowerCase()+(this.port!==r?`:${e.port}`:""),this.protocol=e.useSSL?"https:":"http:",this.accessKey=e.accessKey,this.#e=e.secretKey??"",this.sessionToken=e.sessionToken,this.pathStyle=e.pathStyle??!0,this.defaultBucket=e.bucket,this.region=e.region}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!qN(r))throw new lp(`Invalid bucket name: ${r}`);return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,i=e.headers??new Headers;i.set("host",n);let o=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,s=(this.pathStyle?`/${r}/${e.objectName}`:`/${e.objectName}`)+(o?`?${o}`:"");return{headers:i,host:n,path:s}}async makeRequest({method:e,payload:r,...n}){let i=new Date,{headers:o,host:s,path:a}=this.buildRequestOptions(n),u=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),o.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let c=await dp(r??new Uint8Array);o.set("x-amz-date",Wc(i)),o.set("x-amz-content-sha256",c),this.accessKey&&(this.sessionToken&&o.set("x-amz-security-token",this.sessionToken),o.set("authorization",await MN({headers:o,method:e,path:a,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:i})));let l=`${this.protocol}//${s}${a}`,f=await fetch(l,{method:e,headers:o,body:r});if(f.status!==u)throw f.status>=400?await LN(f):f.status===301?new Un(f.status,"UnexpectedRedirect",'The server unexpectedly returned a redirect response. With AWS S3, this usually means you need to use a region-specific endpoint like "s3.us-west-2.amazonaws.com" instead of "s3.amazonaws.com"'):new Un(f.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${u}, got ${f.status} ${f.statusText}).`);return n.returnBody||await f.body?.getReader().read(),f}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let i=r.versionId?{versionId:r.versionId}:{},o=new Headers;r.governanceBypass&&o.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:o,query:i,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof Un&&n.statusCode===404)return!1;throw n}}getObject(e,r){return this.getPartialObject(e,{...r,offset:0,length:0})}async getPartialObject(e,{offset:r,length:n,...i}){let o=this.getBucketName(i);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let s=new Headers(Object.entries(i.metadata??{})),a=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),s.set("Range",c),a=206}let u={...i.responseParams,...i.versionId?{versionId:i.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:o,objectName:e,headers:s,query:u,statusCode:a,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new Ro(`Presigned ${e} URLs cannot be generated for anonymous requests. Specify an accessKey and secretKey.`);if(!$o(r))throw new Mn(`Invalid object name: ${r}`);let{headers:i,path:o}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),s=n.requestDate??new Date,a=n.expirySeconds??24*60*60*7;return UN({protocol:this.protocol,headers:i,method:e,path:o,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:s,expirySeconds:a})}presignedGetObject(e,r={}){let{versionId:n,responseParams:i,...o}=r,s={...i,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:s,...o})}async*listObjects(e={}){for await(let r of this.listObjectsGrouped({...e,delimiter:""}))if(r.type==="Object")yield r;else throw new Error(`Unexpected result from listObjectsGrouped(): ${r}`)}async*listObjectsGrouped(e){let r=this.getBucketName(e),n="",i=e.pageSize??1e3;if(i<1||i>1e3)throw new Or("pageSize must be between 1 and 1,000.");let o=0;for(;;){let s=e.maxResults?Math.min(i,e.maxResults-o):i;if(s===0)return;let u=await(await this.makeRequest({method:"GET",bucketName:r,objectName:"",query:{"list-type":"2",prefix:e.prefix??"",delimiter:e.delimiter,"max-keys":String(s),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=Ei(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(d=>d.name==="CommonPrefixes").flatMap(d=>d.children),f=[];for(let d of l)f.push({type:"CommonPrefix",prefix:d.content??""}),o++;for(let d of c.children.filter(p=>p.name==="Contents"))f.push({type:"Object",key:d.children.find(p=>p.name==="Key")?.content??"",etag:Io(d.children.find(p=>p.name==="ETag")?.content??""),size:parseInt(d.children.find(p=>p.name==="Size")?.content??"",10),lastModified:new Date(d.children.find(p=>p.name==="LastModified")?.content??"invalid")}),o++;f.sort((d,p)=>{let v=d.type==="Object"?d.key:d.prefix,g=p.type==="Object"?p.key:p.prefix;return v>g?1:v<g?-1:0});for(let d of f)yield d;if(c.children.find(d=>d.name==="IsTruncated")?.content==="true"){let d=c.children.find(p=>p.name==="NextContinuationToken")?.content;if(!d)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=d}else return}}async putObject(e,r,n){let i=this.getBucketName(n);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let o,s;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?s=ReadableStream.from([l]):s=new ReadableStream({start(f){f.enqueue(l),f.close()}}),o=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?s=ReadableStream.from([r]):s=new ReadableStream({start(l){l.enqueue(r),l.close()}}),o=r.byteLength;else if(r instanceof ReadableStream)s=r;else throw new Or("Invalid stream/data type provided.");if(n?.size!==void 0){if(o!==void 0&&n?.size!==o)throw new Or(`size was specified (${n.size}) but doesn't match auto-detected size (${o}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new Or(`invalid size specified: ${n.size}`);o=n.size}let a=n?.partSize??this.calculatePartSize(o);if(a<oue)throw new Or("Part size should be greater than 5MB");if(a>sue)throw new Or("Part size should be less than 6MB");let u=new up(a),c=new hp({client:this,bucketName:i,objectName:e,partSize:a,metadata:n?.metadata??{}});return await s.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=Hb),e>Hb)throw new TypeError(`size should not be more than ${Hb}`);let r=64*1024*1024;for(;;){if(r*1e4>e)return r;r+=16*1024*1024}}async statObject(e,r){let n=this.getBucketName(r);if(!$o(e))throw new Mn(`Invalid object name: ${e}`);let i={};r?.versionId&&(i.versionId=r.versionId);let o=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:i}),s={};for(let a of iue)o.headers.has(a)&&(s[a]=o.headers.get(a));return o.headers.forEach((a,u)=>{u.startsWith("x-amz-meta-")&&(s[u]=o.headers.get(u))}),{type:"Object",key:e,size:parseInt(o.headers.get("content-length")??"",10),metadata:s,lastModified:new Date(o.headers.get("Last-Modified")??"error: missing last modified"),versionId:o.headers.get("x-amz-version-id")||null,etag:Io(o.headers.get("ETag")??"")}}async copyObject(e,r,n){let i=this.getBucketName(n),o=e.sourceBucketName??i;if(!$o(r))throw new Mn(`Invalid object name: ${r}`);let s=`${o}/${e.sourceKey}`;e.sourceVersionId&&(s+=`?versionId=${e.sourceVersionId}`);let a=new Headers(n?.metadata);n?.metadata!==void 0&&a.set("x-amz-metadata-directive","REPLACE"),a.set("x-amz-copy-source",s);let u=await this.makeRequest({method:"PUT",bucketName:i,objectName:r,headers:a,returnBody:!0}),c=await u.text(),l=Ei(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let f=l.children.find(d=>d.name==="ETag")?.content??"",h=l.children.find(d=>d.name==="LastModified")?.content;if(h===void 0)throw new Error("Unable to find <LastModified>...</LastModified> from the server.");return{copySourceVersionId:u.headers.get("x-amz-copy-source-version-id")||null,etag:Io(f),lastModified:new Date(h),versionId:u.headers.get("x-amz-version-id")||null}}async bucketExists(e){try{return await this.listObjects({bucketName:e}).next(),!0}catch(r){if(r instanceof Un&&r.statusCode===404)return!1;throw r}}async makeBucket(e){await this.makeRequest({method:"PUT",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:200})}async removeBucket(e){await this.makeRequest({method:"DELETE",bucketName:this.getBucketName({bucketName:e}),objectName:"",statusCode:204})}};var zb=ce(vu());var Ci=require("node:fs"),Yc=require("node:path");function aue(t,e){return(0,Ci.readFileSync)(t,"utf8").includes(e)}function Jc(t,e){let r=(0,Ci.readdirSync)(t);for(let n of r){let i=(0,Yc.join)(t,n),o=(0,Ci.statSync)(i);if(o.isDirectory()){if(Jc(i,e))return!0}else if(o.isFile()&&(0,Yc.extname)(i)===".js"&&aue(i,e))return!0}return!1}function Xc(t){let e=(0,Ci.readdirSync)(t);if(e.length===1){let n=(0,Yc.join)(t,e[0]);if((0,Ci.statSync)(n).isDirectory())return Xc(n)}return e.indexOf("index.html")>-1}var KN=require("node:fs"),YN=require("node:path"),JN=require("node:stream/consumers"),XN=require("node:zlib");var ZN=ce(rD());async function QN(t,e,r,n){let i=be();i.start("Generating the update manifest");let o=await sj(t);return i.stop("Manifest generated successfully"),await Fe(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),o}async function eL(t,e,r,n,i,o){let s=be();s.start("Preparing partial update with TUS protocol");let a=performance.now(),u=await Cr(),c=0,l=e.length,f=e.map(async h=>{let d=(0,YN.join)(r,h.file),p=(0,KN.createReadStream)(d).pipe((0,XN.createBrotliCompress)()),v=await(0,JN.buffer)(p);return new Promise((g,w)=>{new ZN.Upload(v,{endpoint:`${u.hostFilesApi}/files/upload/attachments/`,metadata:{filename:`orgs/${o}/apps/${n}/${i}/${h.file}`},headers:{Authorization:t},onError(y){m.info(`Failed to upload ${h.file}: ${y}`),w(y)},onProgress(){let y=(c/l*100).toFixed(2);s.message(`Uploading partial update: ${y}%`)},onSuccess(){c++,g({file_name:h.file,s3_path:`orgs/${o}/apps/${n}/${i}/${h.file}`,file_hash:h.hash})}}).start()})});try{let h=await Promise.all(f),p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${p} seconds)`),await Fe(t,{channel:"app",event:"App Partial TUS done",icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await Fe(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:p},notify:!1}),h}catch(h){let p=((performance.now()-a)/1e3).toFixed(2);return s.stop(`Failed to upload Partial bundle ( after ${p} seconds)`),m.info(`Error uploading partial update: ${h}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}async function uue(t,e){let r=await jt("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r?.version||`0.0.1-beta.${(0,tL.randomUUID)().split("-")[0]}`;return da.test(n)||(m.error(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n}function cue(t){let e=t.apikey||pe();return e||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e}function lue(t,e,r){let n=ge(t,r),i=e.path||r?.webDir;return n||(m.error("Missing argument, you need to provide a appid or be in a capacitor project"),A.error("")),i||(m.error("Missing argument, you need to provide a path (--path), or be in a capacitor project"),A.error("")),(0,cn.existsSync)(i)||(m.error(`Path ${i} does not exist, build your app first, or provide a valid path`),A.error("")),{appid:n,path:i}}function fue(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Jc(e,"notifyAppReady")||(m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Xc(e)||(m.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")))}async function due(t,e,r,n,i,o){let s=r.ignoreMetadataCheck,a=r.autoMinUpdateVersion,u=r.minUpdateVersion,{data:c,error:l}=await t.from("channels").select("disable_auto_update, version ( min_update_version, native_packages )").eq("name",n).eq("app_id",i).single(),f=!!c&&c.disable_auto_update==="version_number",h,d;if(!l&&c&&c.version&&c.version.native_packages&&!s){let g=be();g.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:w,localDependencies:x}=await $h(t,i,n,r.packageJson,r.nodeModules);if(d=w,h=x,d.find(y=>y.localVersion!==y.remoteVersion))g.stop(`Bundle NOT compatible with ${n} channel`),m.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),a&&(u=o,m.info(`Auto set min-update-version to ${u}`));else if(a)try{let{min_update_version:y}=c.version;(!y||!da.test(y))&&(m.error("Invalid remote min update version, skipping auto setting compatibility"),A.error("")),u=y,g.stop(`Auto set min-update-version to ${u}`)}catch{m.error(`Cannot auto set compatibility, invalid data ${c}`),A.error("")}else g.stop(`Bundle compatible with ${n} channel`)}else s||(m.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),h=await sb(r.packageJson,r.nodeModules),a&&(u=o,m.info(`Auto set min-update-version to ${u}`)));f&&!u&&!s&&(m.error("You need to provide a min-update-version to upload a bundle to this channel"),A.error("")),u&&(da.test(u)||(m.error(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`),A.error("")));let p=h?new Map(h.filter(g=>!!g.native&&g.native!==void 0).map(g=>[g.name,g])):new Map;return{nativePackages:p.size>0||!r.ignoreMetadataCheck?Array.from(p,([g,w])=>({name:g,version:w.version})):void 0,minUpdateVersion:u}}async function hue(t,e,r){let{data:n,error:i}=await t.rpc("is_trial_org",{orgid:e}).single();(n&&n>0||i)&&(m.warn(`WARNING !!
285
+ Trial expires in ${n} days`),m.warn(`Upgrade here: ${r.hostWeb}/dashboard/settings/plans?oid=${e}`))}async function pue(t,e,r){let{data:n,error:i}=await t.rpc("exist_app_versions",{appid:e,apikey:"",name_version:r}).single();(n||i)&&(m.error(`Version already exists ${Q(i)}`),A.error(""))}async function mue(t,e,r,n,i,o){let s,a="",u=null,c=e.key,l=e.keyV2;u=await Ph(t);let f=be();if(f.start("Calculating checksum"),(l||e.keyDataV2||(0,cn.existsSync)(ur))&&c!==!1?a=await(0,zb.checksum)(u,"sha256"):a=await(0,zb.checksum)(u,"crc32"),f.stop(`Checksum: ${a}`),c===!1)m.info("Encryption ignored");else if((l||(0,cn.existsSync)(ur)||e.keyDataV2)&&!e.oldEncryption){let d=typeof l=="string"?l:ur,p=e.keyDataV2||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find private key ${d}`),A.error("")),await Fe(n,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle with V2");let v=op(u,p);a=ip(a,p),s=v.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
286
286
  keep it safe, you will need it to decrypt your bundle.
287
287
  It will be also visible in your dashboard
288
288
  `),u=v.encryptedData}else if(c||e.keyData||(0,cn.existsSync)(cr)){let d=typeof c=="string"?c:cr,p=e.keyData||"";!p&&!(0,cn.existsSync)(d)&&(m.error(`Cannot find public key ${d}`),A.error("")),await Fe(n,{channel:"app",event:"App encryption",icon:"\u{1F511}",user_id:i,tags:{"app-id":o},notify:!1}),p||(p=(0,cn.readFileSync)(d).toString()),m.info("Encrypting your bundle");let v=tp(u,p);s=v.ivSessionKey,e.displayIvSession&&m.info(`Your Iv Session key is ${s},
@@ -291,12 +291,12 @@ It will be also visible in your dashboard
291
291
  `),u=v.encryptedData}let h=Math.floor((u?.byteLength??0)/1024/1024);return h>J6&&(m.warn(`WARNING !!
292
292
  The app size is ${h} Mb, this may take a while to download for users
293
293
  `),m.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
294
- `),await Fe(n,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:i,tags:{"app-id":o},notify:!1})),{zipped:u,sessionKey:s,checksum:a}}async function mue(t,e,r,n,i,o,s){let a=be();a.start("Uploading Bundle");let u=performance.now(),c=!1;if(s.dryRun){a.stop(`Dry run, bundle not uploaded
295
- Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let h=await Cr();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?m.info("Uploading bundle with multipart protocol, multipart is deprecated"):m.info("Uploading bundle with TUS protocol"),await aj(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:p}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);p&&(m.error(`Cannot finish TUS upload ${Q(p)}`),Promise.reject(new Error("Cannot finish TUS upload")))}else{let d=await ij(e,r,n);d||(m.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"))),await Hr.put(d,{timeout:s.timeout||X6,retry:5,body:o})}}catch(h){let p=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload bundle ( after ${p} seconds)`),h instanceof ti){let v=await h.response.json();m.error(`Response Error: ${v.error||v.status||v.message}`)}else m.error(`Cannot upload bundle ( try again with --tus option) ${Q(h)}`);await uj(e,r,n),A.error("")}let f=((performance.now()-u)/1e3).toFixed(2);a.stop(`Bundle uploaded \u{1F4AA} in (${f} seconds)`),await Fe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:f},notify:!1})}async function gue(t,e,r,n,i,o,s,a,u){let{data:c}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();c||(m.warn("Cannot get version id, cannot set channel"),A.error(""));let{error:l,data:f}=await Rh(t,{name:i,app_id:a,created_by:o,version:c,owner_org:s});l&&(m.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(l)}`),A.error(""));let h=_o(a),d=`${u.hostWeb}/app/p/${h}/channel/${f.id}`;f?.public?m.info("Your update is now available in your public channel \u{1F389}"):f?.id&&m.info(`Link device to this bundle to try it: ${d}`),r?m.info(`Bundle url: ${d}`):c||(m.warn("Cannot set bundle with upload key, use key with more rights for that"),A.error(""))}async function yue(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){m.warn("Cannot find default upload channel");let o=_o(t);return m.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function pp(t,e,r=!0){Y(`Uploading with CLI version ${Ir.version}`);let n=Nt();await De();let{s3Region:i,s3Apikey:o,s3Apisecret:s,s3BucketName:a,s3Endpoint:u,s3Port:c,s3SSL:l}=e,f=uue(e),h=await ee(),d=await Z6(),{appid:p,path:v}=cue(t,e,h.config),g=await aue(h.config,e);e.autoSetBundle&&await wo({version:g}),lue(e,v),m.info(`Upload ${p}@${g} started from path "${v}" to Capgo cloud`);let w=await Cr(),x=await de(f),y=await me(x,f,["write","all","upload"]),C=e.channel||await yue(p,x,w.hostWeb)||"dev",k=await Sr(x,p);await ha(x,k,f,p,!0),await due(x,k,w);let{nativePackages:$,minUpdateVersion:F}=await fue(x,n,e,C,p,g);await hue(x,p,g),e.external&&!e.external.startsWith("https://")&&(m.error(`External link should should start with "https://" current is "${e.external}"`),A.error(""));let L={name:g,app_id:p,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:F,native_packages:$,owner_org:k,user_id:y,checksum:void 0},S=null;if(e.external)await Fe(f,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:k,tags:{"app-id":p},notify:!1}),L.session_key=e.ivSessionKey,L.checksum=e.encryptedChecksum;else{let{zipped:q,sessionKey:K,checksum:M}=await pue(v,e,w,f,k,p);L.session_key=K,L.checksum=M,S=q,e.ignoreChecksumCheck||await lj(x,p,C,M)}!d.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||d.TUSUploadForced,!d.partialUpload||e.external?e.partial=!1:e.partial=e.partial||d.partialUploadForced;let I=e.partial?await QN(v,f,k,p):[],{error:R}=await ob(x,L);if(R&&(m.error(`Cannot add bundle ${Q(R)}`),A.error("")),S&&(a||u||i||o||s||c||l)){(!a||!u||!i||!o||!s||!c)&&(m.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),A.error("")),m.info("Uploading to S3");let q=new Kc({endPoint:u,region:i,port:c,useSSL:l,bucket:a,accessKey:o,secretKey:s}),K=`${p}-${g}`,M=encodeURIComponent(K);await q.putObject(K,Uint8Array.from(S)),L.external_url=`https://${u}/${M}`,L.storage_provider="external"}else if(S){await mue(f,x,p,g,k,S,e);let q=null;try{e.dryRun&&(e.partial=!1),q=e.partial?await eL(f,I,v,p,g,k):null}catch(M){m.info(`Failed to upload partial files to capgo cloud. Error: ${Q(M)}. This is not a critical error, the bundle has been uploaded without the partial files`)}L.storage_provider="r2",L.manifest=q;let{error:K}=await ob(x,L);K&&(m.error(`Cannot update bundle ${Q(K)}`),A.error(""))}let B=await Be(x,f,p,2);return Q6(B,3)?await gue(x,f,!!e.bundleUrl,g,C,y,k,p,w):m.warn("Cannot set channel as a upload organization member"),await Fe(f,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:k,tags:{"app-id":p},notify:!1}),r&&(X("Time to share your update to the world \u{1F30D}"),(0,rL.exit)()),!0}function nL(t){t.ivSessionKey&&!t.external&&(m.error("You need to provide an external url if you want to use the --iv-session-key option"),A.error("")),t.encryptedChecksum&&!t.external&&(m.error("You need to provide an external url if you want to use the --encrypted-checksum option"),A.error("")),t.partial&&t.external&&(m.error("You cannot use the --partial option with an external url"),A.error("")),t.tus&&t.external&&(m.error("You cannot use the --tus option with an external url"),A.error("")),t.dryRun&&t.external&&(m.error("You cannot use the --dry-run option with an external url"),A.error("")),t.multipart&&t.external&&(m.error("You cannot use the --multipart option with an external url"),A.error("")),t.external&&(t.key||t.keyData||t.keyV2||t.keyDataV2)&&(m.error("You cannot set a key if you are uploading to an external url"),A.error("")),(t.key||t.keyData)&&(t.keyV2||t.keyDataV2)&&(m.error("You cannot set both key and key-v2"),A.error("")),t.key&&t.keyData&&(m.error("You cannot set both key and key-data"),A.error("")),t.keyV2&&t.keyDataV2&&(m.error("You cannot set both key-v2 and key-data-v2"),A.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(m.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),A.error("")),t.encryptedChecksum&&!t.external&&(m.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),A.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(m.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),A.error(""))}async function iL(t,e){try{nL(e),await pp(t,e,!0)}catch(r){m.error(Q(r)),A.error("")}}async function oL(t,e){let r=Nt();m.warn(`\u26A0\uFE0F This command is deprecated, use "${r.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);try{nL(e),await pp(t,e,!0)}catch(n){m.error(Q(n)),A.error("")}}var sL=require("node:crypto"),mp=require("node:fs"),aL=require("node:process");var Gb=ce(vu());var Due=20;async function uL(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await De();let o=await ee();t=ge(t,o?.config);let s=(0,sL.randomUUID)().split("-")[0],a=await jt("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Y(`Zipping ${t}@${r}`),r&&!da.test(r)&&(i?console.error(Q({error:"invalid_semver"})):m.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Q({error:"missing_argument"})):m.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),A.error("")),i||m.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Jc(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Xc(n)||(i?console.error(Q({error:"index_html_not_found"})):m.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")));let c=await Ph(n);i||m.info(`Zipped ${c.byteLength} bytes`);let l=be();i||l.start("Calculating checksum");let f="";e.keyV2||(0,mp.existsSync)(ur)?f=await(0,Gb.checksum)(c,"sha256"):f=await(0,Gb.checksum)(c,"crc32"),i||l.stop(`Checksum: ${f}`);let h=Math.floor(c.byteLength/1024/1024);h>Due&&!i&&(m.warn(`WARNING !!
294
+ `),await Fe(n,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:i,tags:{"app-id":o},notify:!1})),{zipped:u,sessionKey:s,checksum:a}}async function gue(t,e,r,n,i,o,s){let a=be();a.start("Uploading Bundle");let u=performance.now(),c=!1;if(s.dryRun){a.stop(`Dry run, bundle not uploaded
295
+ Bundle uploaded \u{1F4AA} in 0 seconds`);return}try{let h=await Cr();if(s.multipart!==void 0&&s.multipart||s.tus!==void 0&&s.tus){s.multipart?m.info("Uploading bundle with multipart protocol, multipart is deprecated"):m.info("Uploading bundle with TUS protocol"),await aj(t,o,i,r,n,a,h),c=!0;let d=`orgs/${i}/apps/${r}/${n}.zip`,{error:p}=await e.from("app_versions").update({r2_path:d}).eq("name",n).eq("app_id",r);p&&(m.error(`Cannot finish TUS upload ${Q(p)}`),Promise.reject(new Error("Cannot finish TUS upload")))}else{let d=await ij(e,r,n);d||(m.error("Cannot get upload url"),Promise.reject(new Error("Cannot get upload url"))),await Hr.put(d,{timeout:s.timeout||X6,retry:5,body:o})}}catch(h){let p=((performance.now()-u)/1e3).toFixed(2);if(a.stop(`Failed to upload bundle ( after ${p} seconds)`),h instanceof ti){let v=await h.response.json();m.error(`Response Error: ${v.error||v.status||v.message}`)}else m.error(`Cannot upload bundle ( try again with --tus option) ${Q(h)}`);await uj(e,r,n),A.error("")}let f=((performance.now()-u)/1e3).toFixed(2);a.stop(`Bundle uploaded \u{1F4AA} in (${f} seconds)`),await Fe(t,{channel:"performance",event:c?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:i,tags:{"app-id":r,time:f},notify:!1})}async function yue(t,e,r,n,i,o,s,a,u){let{data:c}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:a}).single();c||(m.warn("Cannot get version id, cannot set channel"),A.error(""));let{error:l,data:f}=await Rh(t,{name:i,app_id:a,created_by:o,version:c,owner_org:s});l&&(m.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${Q(l)}`),A.error(""));let h=_o(a),d=`${u.hostWeb}/app/p/${h}/channel/${f.id}`;f?.public?m.info("Your update is now available in your public channel \u{1F389}"):f?.id&&m.info(`Link device to this bundle to try it: ${d}`),r?m.info(`Bundle url: ${d}`):c||(m.warn("Cannot set bundle with upload key, use key with more rights for that"),A.error(""))}async function Due(t,e,r){let{error:n,data:i}=await e.from("apps").select("default_upload_channel").single();if(n){m.warn("Cannot find default upload channel");let o=_o(t);return m.info(`You can set it here: ${r}/app/p/${o}/settings`),null}return i.default_upload_channel}async function pp(t,e,r=!0){Y(`Uploading with CLI version ${Ir.version}`);let n=Nt();await De();let{s3Region:i,s3Apikey:o,s3Apisecret:s,s3BucketName:a,s3Endpoint:u,s3Port:c,s3SSL:l}=e,f=cue(e),h=await ee(),d=await Z6(),{appid:p,path:v}=lue(t,e,h.config),g=await uue(h.config,e);e.autoSetBundle&&await wo({version:g}),fue(e,v),m.info(`Upload ${p}@${g} started from path "${v}" to Capgo cloud`);let w=await Cr(),x=await de(f),y=await me(x,f,["write","all","upload"]),C=e.channel||await Due(p,x,w.hostWeb)||"dev",k=await Sr(x,p);await ha(x,k,f,p,!0),await hue(x,k,w);let{nativePackages:$,minUpdateVersion:F}=await due(x,n,e,C,p,g);await pue(x,p,g),e.external&&!e.external.startsWith("https://")&&(m.error(`External link should should start with "https://" current is "${e.external}"`),A.error(""));let L={name:g,app_id:p,session_key:void 0,external_url:e.external,storage_provider:e.external?"external":"r2-direct",min_update_version:F,native_packages:$,owner_org:k,user_id:y,checksum:void 0},S=null;if(e.external)await Fe(f,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:k,tags:{"app-id":p},notify:!1}),L.session_key=e.ivSessionKey,L.checksum=e.encryptedChecksum;else{let{zipped:q,sessionKey:K,checksum:M}=await mue(v,e,w,f,k,p);L.session_key=K,L.checksum=M,S=q,e.ignoreChecksumCheck||await lj(x,p,C,M)}!d.TUSUpload||e.external?e.tus=!1:e.tus=e.tus||d.TUSUploadForced,!d.partialUpload||e.external||(0,rL.platform)()==="win32"?e.partial=!1:e.partial=e.partial||d.partialUploadForced;let I=e.partial?await QN(v,f,k,p):[],{error:R}=await ob(x,L);if(R&&(m.error(`Cannot add bundle ${Q(R)}`),A.error("")),S&&(a||u||i||o||s||c||l)){(!a||!u||!i||!o||!s||!c)&&(m.error("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),A.error("")),m.info("Uploading to S3");let q=new Kc({endPoint:u,region:i,port:c,useSSL:l,bucket:a,accessKey:o,secretKey:s}),K=`${p}-${g}`,M=encodeURIComponent(K);await q.putObject(K,Uint8Array.from(S)),L.external_url=`https://${u}/${M}`,L.storage_provider="external"}else if(S){await gue(f,x,p,g,k,S,e);let q=null;try{e.dryRun&&(e.partial=!1),q=e.partial?await eL(f,I,v,p,g,k):null}catch(M){m.info(`Failed to upload partial files to capgo cloud. Error: ${Q(M)}. This is not a critical error, the bundle has been uploaded without the partial files`)}L.storage_provider="r2",L.manifest=q;let{error:K}=await ob(x,L);K&&(m.error(`Cannot update bundle ${Q(K)}`),A.error(""))}let B=await Be(x,f,p,2);return Q6(B,3)?await yue(x,f,!!e.bundleUrl,g,C,y,k,p,w):m.warn("Cannot set channel as a upload organization member"),await Fe(f,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:k,tags:{"app-id":p},notify:!1}),r&&(X("Time to share your update to the world \u{1F30D}"),(0,nL.exit)()),!0}function iL(t){t.ivSessionKey&&!t.external&&(m.error("You need to provide an external url if you want to use the --iv-session-key option"),A.error("")),t.encryptedChecksum&&!t.external&&(m.error("You need to provide an external url if you want to use the --encrypted-checksum option"),A.error("")),t.partial&&t.external&&(m.error("You cannot use the --partial option with an external url"),A.error("")),t.tus&&t.external&&(m.error("You cannot use the --tus option with an external url"),A.error("")),t.dryRun&&t.external&&(m.error("You cannot use the --dry-run option with an external url"),A.error("")),t.multipart&&t.external&&(m.error("You cannot use the --multipart option with an external url"),A.error("")),t.external&&(t.key||t.keyData||t.keyV2||t.keyDataV2)&&(m.error("You cannot set a key if you are uploading to an external url"),A.error("")),(t.key||t.keyData)&&(t.keyV2||t.keyDataV2)&&(m.error("You cannot set both key and key-v2"),A.error("")),t.key&&t.keyData&&(m.error("You cannot set both key and key-data"),A.error("")),t.keyV2&&t.keyDataV2&&(m.error("You cannot set both key-v2 and key-data-v2"),A.error("")),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&(m.error("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),A.error("")),t.encryptedChecksum&&!t.external&&(m.error("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),A.error("")),t.minUpdateVersion&&t.autoMinUpdateVersion&&(m.error("You cannot set both min-update-version and auto-min-update-version, use only one of them"),A.error(""))}async function oL(t,e){try{iL(e),await pp(t,e,!0)}catch(r){m.error(Q(r)),A.error("")}}async function sL(t,e){let r=Nt();m.warn(`\u26A0\uFE0F This command is deprecated, use "${r.runner} @capgo/cli bundle upload" instead \u26A0\uFE0F`);try{iL(e),await pp(t,e,!0)}catch(n){m.error(Q(n)),A.error("")}}var aL=require("node:crypto"),mp=require("node:fs"),uL=require("node:process");var Gb=ce(vu());var vue=20;async function cL(t,e){try{let{bundle:r,path:n}=e,{json:i}=e;i||await De();let o=await ee();t=ge(t,o?.config);let s=(0,aL.randomUUID)().split("-")[0],a=await jt("",e.packageJson);r=r||a?.version||`0.0.1-beta.${s}`,i||Y(`Zipping ${t}@${r}`),r&&!da.test(r)&&(i?console.error(Q({error:"invalid_semver"})):m.error(`Your bundle name ${r}, is not valid it should follow semver convention : https://semver.org/`),A.error("")),n=n||o?.config?.webDir,(!t||!r||!n)&&(i?console.error(Q({error:"missing_argument"})):m.error("Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project"),A.error("")),i||m.info(`Started from path "${n}"`);let u=e.codeCheck;(typeof u>"u"||u)&&(Jc(n,"notifyAppReady")||(i?console.error(Q({error:"notifyAppReady_not_in_source_code"})):m.error("notifyAppReady() is missing in the source code. see: https://capgo.app/docs/plugin/api/#notifyappready"),A.error("")),Xc(n)||(i?console.error(Q({error:"index_html_not_found"})):m.error("index.html is missing in the root folder or in the only folder in the root folder"),A.error("")));let c=await Ph(n);i||m.info(`Zipped ${c.byteLength} bytes`);let l=be();i||l.start("Calculating checksum");let f="";e.keyV2||(0,mp.existsSync)(ur)?f=await(0,Gb.checksum)(c,"sha256"):f=await(0,Gb.checksum)(c,"crc32"),i||l.stop(`Checksum: ${f}`);let h=Math.floor(c.byteLength/1024/1024);h>vue&&!i&&(m.warn(`WARNING !!
296
296
  The app size is ${h} Mb, this may take a while to download for users
297
297
  `),m.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
298
- `));let d=be(),p=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${p}`),(0,mp.writeFileSync)(p,c),i||d.stop(`Saved to ${p}`),i||X("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:p,checksum:f},null,2)),(0,aL.exit)()}catch(r){m.error(Q(r)),A.error("")}}var cL=require("node:process");async function Wb(t,e,r,n=!0){Y("Create channel"),r.apikey=r.apikey||pe();let i=await ee();e=ge(e,i?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey);await me(o,r.apikey,["write","all"]),await Be(o,r.apikey,e,4),m.info(`Creating channel ${e}#${t} to Capgo`);try{let s=await jb(o,e),a=await Sr(o,e);s||(m.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),A.error(""));let u=await cN(o,{name:t,app_id:e,version:s.id,owner_org:a});u.error&&(m.error(`Cannot create Channel \u{1F640}
299
- ${Q(u.error)}`),A.error("")),m.success("Channel created \u2705"),await Fe(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch()}catch{return m.error("Cannot create Channel \u{1F640}"),!1}return n&&(X("Done \u2705"),(0,cL.exit)()),!0}async function lL(t,e,r){Wb(t,e,r,!0)}var fL=require("node:process");async function dL(t,e,r){let{quiet:n}=r;n||Y("List current bundle"),r.apikey=r.apikey||pe(n);let i=await ee();e=ge(e,i?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey),s=await me(o,r.apikey,["write","all","read"]);await Be(o,r.apikey,e,1),t||(m.error("Please provide a channel to get the bundle from."),A.error(""));let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);(u||a.length===0)&&(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error(""));let{version:c}=a[0];c||(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error("")),n?m.info(c.name):m.info(`Current bundle for channel ${t} is ${c.name}`),(0,fL.exit)()}var hL=require("node:process");async function pL(t,e,r){Y("Delete channel"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await Be(i,r.apikey,e,4),m.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await lN(i,t,e,o);s.error&&(m.error(`Cannot delete Channel \u{1F640} ${Q(s.error)}`),A.error(""));let a=await Sr(i,e);m.success("Channel deleted"),await Fe(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:a,tags:{"user-id":o,"app-id":e,channel:t},notify:!1}).catch()}catch{m.error("Cannot delete Channel \u{1F640}")}X("Done \u2705"),(0,hL.exit)()}var mL=require("node:process");async function gL(t,e){Y("List channels"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||m.error("Missing API key, you need to provide a API key to upload your bundle"),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all","read","upload"]);await Be(n,e.apikey,t,1),m.info("Querying available channels in Capgo");let o=await dN(n,t);m.info(`Active channels in Capgo: ${o?.length}`),fN(o),await Fe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),X("Done \u2705"),(0,mL.exit)()}var DL=require("node:process");var yL=["major","minor","metadata","patch","none"];async function vL(t,e,r){Y("Set channel"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await Be(i,r.apikey,e,4);let s=await Sr(i,e),{bundle:a,state:u,downgrade:c,latest:l,upgrade:f,ios:h,android:d,selfAssign:p,disableAutoUpdate:v,dev:g,emulator:w}=r;t||(m.error("Missing argument, you need to provide a channel"),A.error("")),l&&a&&(m.error("Cannot set latest and bundle at the same time"),A.error("")),a==null&&u==null&&l==null&&c==null&&f==null&&h==null&&d==null&&p==null&&g==null&&w==null&&v==null&&(m.error("Missing argument, you need to provide a option to set"),A.error(""));try{await ha(i,s,r.apikey,e);let x={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},y=await jt("",r.packageJson),C=l?n?.config?.plugins?.CapacitorUpdater?.version||y?.version:a;if(C!=null){let{data:k,error:$}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();($||!k)&&(m.error(`Cannot find version ${C}`),A.error("")),m.info(`Set ${e} channel: ${t} to @${C}`),x.version=k.id}if(u!=null&&((u==="public"||u==="private")&&m.info(`Set ${e} channel: ${t} to public or private is deprecated, use default or normal instead`),m.info(`Set ${e} channel: ${t} to ${u==="public"||u==="default"?"default":"normal"}`),x.public=u==="public"||u==="default"),c!=null&&(m.info(`Set ${e} channel: ${t} to ${c?"allow":"disallow"} downgrade`),x.disable_auto_update_under_native=!c),h!=null&&(m.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),x.ios=!!h),d!=null&&(m.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),x.android=!!d),p!=null&&(m.info(`Set ${e} channel: ${t} to ${p?"allow":"disallow"} self assign to this channel`),x.allow_device_self_set=!!p),v!=null){let k=v.toLocaleLowerCase();yL.includes(k)||(m.error(`Channel strategy ${k} is not known. The possible values are: ${yL.join(", ")}.`),A.error("")),k==="metadata"&&(k="version_number"),x.disable_auto_update=k,m.info(`Set ${e} channel: ${t} to ${k} disable update strategy to this channel`)}try{let{error:k}=await Rh(i,x);k&&(m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error(""))}catch{m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error("")}await Fe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(x){m.error(`Unknow error ${Q(x)}`),A.error("")}X("Done \u2705"),(0,DL.exit)()}var Qc=require("node:child_process"),st=require("node:fs"),Dp=require("node:path"),rr=require("node:process");var vp=ce(IL());var tw=require("node:process");function Iue(t){return new Promise(e=>{setTimeout(e,t)})}async function Hn(t,e,r,n,i="\u2705"){await Fe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function jue(t,e,r,n){kt(e)&&(await Hn(t,r,n,"canceled","\u{1F937}"),(0,tw.exit)())}async function Nue(t,e,r){try{let n=await Cr(),i=await Hr.post(`${n.hostApi}/private/stats`,{headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(e)}).then(o=>o.json()).catch(o=>(console.error("Cannot get devices",o),[]));if(i?.length>0&&(r===null||r!==i[0].created_at))return i}catch(n){m.error(`Cannot get stats ${Q(n)}`)}return[]}async function Lue(t,e,r,n,i,o){if(m.info(`Log from Device: ${t.device_id}`),t.action==="get")m.info("Update Sent your your device, wait until event download complete"),await Hn(e,r,n,"done");else if(t.action.startsWith("download_")){let s=t.action.split("_")[1];s==="complete"?(m.info("Your bundle has been downloaded on your device, background the app now and open it again to see the update"),await Hn(e,r,n,"downloaded")):s==="fail"?(m.error("Your bundle has failed to download on your device."),m.error("Please check if you have network connection and try again")):m.info(`Your bundle is downloading ${s}% ...`)}else{if(t.action==="set")return m.info("Your bundle has been set on your device \u2764\uFE0F"),await Hn(e,r,n,"set"),!1;t.action==="NoChannelOrOverride"?m.error(`No default channel or override (channel/device) found, please create it here ${i}`):t.action==="needPlanUpgrade"?m.error(`Your are out of quota, please upgrade your plan here ${o}/dashboard/settings/plans`):t.action==="missingBundle"?m.error("Your bundle is missing, please check how you build your app"):t.action==="noNew"?(m.error(`The version number you uploaded to your default channel in Capgo, is the same as the present in the device ${t.device_id}.`),m.error(`To fix it, ensure the variable:
298
+ `));let d=be(),p=e.name||`${t}_${r}.zip`;i||d.start(`Saving to ${p}`),(0,mp.writeFileSync)(p,c),i||d.stop(`Saved to ${p}`),i||X("Done \u2705"),i&&console.log(JSON.stringify({bundle:r,filename:p,checksum:f},null,2)),(0,uL.exit)()}catch(r){m.error(Q(r)),A.error("")}}var lL=require("node:process");async function Wb(t,e,r,n=!0){Y("Create channel"),r.apikey=r.apikey||pe();let i=await ee();e=ge(e,i?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey);await me(o,r.apikey,["write","all"]),await Be(o,r.apikey,e,4),m.info(`Creating channel ${e}#${t} to Capgo`);try{let s=await jb(o,e),a=await Sr(o,e);s||(m.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),A.error(""));let u=await cN(o,{name:t,app_id:e,version:s.id,owner_org:a});u.error&&(m.error(`Cannot create Channel \u{1F640}
299
+ ${Q(u.error)}`),A.error("")),m.success("Channel created \u2705"),await Fe(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:a,tags:{"app-id":e,channel:t},notify:!1}).catch()}catch{return m.error("Cannot create Channel \u{1F640}"),!1}return n&&(X("Done \u2705"),(0,lL.exit)()),!0}async function fL(t,e,r){Wb(t,e,r,!0)}var dL=require("node:process");async function hL(t,e,r){let{quiet:n}=r;n||Y("List current bundle"),r.apikey=r.apikey||pe(n);let i=await ee();e=ge(e,i?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let o=await de(r.apikey),s=await me(o,r.apikey,["write","all","read"]);await Be(o,r.apikey,e,1),t||(m.error("Please provide a channel to get the bundle from."),A.error(""));let{data:a,error:u}=await o.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);(u||a.length===0)&&(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error(""));let{version:c}=a[0];c||(m.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exists?`),A.error("")),n?m.info(c.name):m.info(`Current bundle for channel ${t} is ${c.name}`),(0,dL.exit)()}var pL=require("node:process");async function mL(t,e,r){Y("Delete channel"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await Be(i,r.apikey,e,4),m.info(`Deleting channel ${e}#${t} from Capgo`);try{let s=await lN(i,t,e,o);s.error&&(m.error(`Cannot delete Channel \u{1F640} ${Q(s.error)}`),A.error(""));let a=await Sr(i,e);m.success("Channel deleted"),await Fe(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:a,tags:{"user-id":o,"app-id":e,channel:t},notify:!1}).catch()}catch{m.error("Cannot delete Channel \u{1F640}")}X("Done \u2705"),(0,pL.exit)()}var gL=require("node:process");async function yL(t,e){Y("List channels"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config),e.apikey||m.error("Missing API key, you need to provide a API key to upload your bundle"),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let n=await de(e.apikey),i=await me(n,e.apikey,["write","all","read","upload"]);await Be(n,e.apikey,t,1),m.info("Querying available channels in Capgo");let o=await dN(n,t);m.info(`Active channels in Capgo: ${o?.length}`),fN(o),await Fe(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(),X("Done \u2705"),(0,gL.exit)()}var vL=require("node:process");var DL=["major","minor","metadata","patch","none"];async function bL(t,e,r){Y("Set channel"),r.apikey=r.apikey||pe();let n=await ee();e=ge(e,n?.config),r.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),e||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(r.apikey),o=await me(i,r.apikey,["write","all"]);await Be(i,r.apikey,e,4);let s=await Sr(i,e),{bundle:a,state:u,downgrade:c,latest:l,upgrade:f,ios:h,android:d,selfAssign:p,disableAutoUpdate:v,dev:g,emulator:w}=r;t||(m.error("Missing argument, you need to provide a channel"),A.error("")),l&&a&&(m.error("Cannot set latest and bundle at the same time"),A.error("")),a==null&&u==null&&l==null&&c==null&&f==null&&h==null&&d==null&&p==null&&g==null&&w==null&&v==null&&(m.error("Missing argument, you need to provide a option to set"),A.error(""));try{await ha(i,s,r.apikey,e);let x={created_by:o,app_id:e,name:t,owner_org:s,version:void 0},y=await jt("",r.packageJson),C=l?n?.config?.plugins?.CapacitorUpdater?.version||y?.version:a;if(C!=null){let{data:k,error:$}=await i.from("app_versions").select().eq("app_id",e).eq("name",C).eq("user_id",o).eq("deleted",!1).single();($||!k)&&(m.error(`Cannot find version ${C}`),A.error("")),m.info(`Set ${e} channel: ${t} to @${C}`),x.version=k.id}if(u!=null&&((u==="public"||u==="private")&&m.info(`Set ${e} channel: ${t} to public or private is deprecated, use default or normal instead`),m.info(`Set ${e} channel: ${t} to ${u==="public"||u==="default"?"default":"normal"}`),x.public=u==="public"||u==="default"),c!=null&&(m.info(`Set ${e} channel: ${t} to ${c?"allow":"disallow"} downgrade`),x.disable_auto_update_under_native=!c),h!=null&&(m.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),x.ios=!!h),d!=null&&(m.info(`Set ${e} channel: ${t} to ${d?"allow":"disallow"} android update`),x.android=!!d),p!=null&&(m.info(`Set ${e} channel: ${t} to ${p?"allow":"disallow"} self assign to this channel`),x.allow_device_self_set=!!p),v!=null){let k=v.toLocaleLowerCase();DL.includes(k)||(m.error(`Channel strategy ${k} is not known. The possible values are: ${DL.join(", ")}.`),A.error("")),k==="metadata"&&(k="version_number"),x.disable_auto_update=k,m.info(`Set ${e} channel: ${t} to ${k} disable update strategy to this channel`)}try{let{error:k}=await Rh(i,x);k&&(m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error(""))}catch{m.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),A.error("")}await Fe(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch()}catch(x){m.error(`Unknow error ${Q(x)}`),A.error("")}X("Done \u2705"),(0,vL.exit)()}var Qc=require("node:child_process"),st=require("node:fs"),Dp=require("node:path"),rr=require("node:process");var vp=ce(jL());var tw=require("node:process");function jue(t){return new Promise(e=>{setTimeout(e,t)})}async function Hn(t,e,r,n,i="\u2705"){await Fe(r,{channel:t,event:n,icon:i,user_id:e,notify:!1})}async function Nue(t,e,r,n){kt(e)&&(await Hn(t,r,n,"canceled","\u{1F937}"),(0,tw.exit)())}async function Lue(t,e,r){try{let n=await Cr(),i=await Hr.post(`${n.hostApi}/private/stats`,{headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(e)}).then(o=>o.json()).catch(o=>(console.error("Cannot get devices",o),[]));if(i?.length>0&&(r===null||r!==i[0].created_at))return i}catch(n){m.error(`Cannot get stats ${Q(n)}`)}return[]}async function Bue(t,e,r,n,i,o){if(m.info(`Log from Device: ${t.device_id}`),t.action==="get")m.info("Update Sent your your device, wait until event download complete"),await Hn(e,r,n,"done");else if(t.action.startsWith("download_")){let s=t.action.split("_")[1];s==="complete"?(m.info("Your bundle has been downloaded on your device, background the app now and open it again to see the update"),await Hn(e,r,n,"downloaded")):s==="fail"?(m.error("Your bundle has failed to download on your device."),m.error("Please check if you have network connection and try again")):m.info(`Your bundle is downloading ${s}% ...`)}else{if(t.action==="set")return m.info("Your bundle has been set on your device \u2764\uFE0F"),await Hn(e,r,n,"set"),!1;t.action==="NoChannelOrOverride"?m.error(`No default channel or override (channel/device) found, please create it here ${i}`):t.action==="needPlanUpgrade"?m.error(`Your are out of quota, please upgrade your plan here ${o}/dashboard/settings/plans`):t.action==="missingBundle"?m.error("Your bundle is missing, please check how you build your app"):t.action==="noNew"?(m.error(`The version number you uploaded to your default channel in Capgo, is the same as the present in the device ${t.device_id}.`),m.error(`To fix it, ensure the variable:
300
300
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
301
301
  - Android: versionName
302
302
  Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disablePlatformIos"?m.error(`iOS is disabled in the default channel and your device ${t.device_id} is an iOS device ${i}`):t.action==="disablePlatformAndroid"?m.error(`Android is disabled in the default channel and your device ${t.device_id} is an Android device ${i}`):t.action==="disableAutoUpdateToMajor"?(m.error(`The version number you uploaded to your default channel in Capgo, is a major version higher (ex: 1.0.0 in device to 2.0.0 in Capgo) than the present in the device ${t.device_id}.`),m.error("Capgo is set by default to protect you from this, and avoid sending breaking changes incompatible with the native code present in the device."),m.error(`To fix it, ensure the variable:
@@ -305,28 +305,28 @@ ${Q(u.error)}`),A.error("")),m.success("Channel created \u2705"),await Fe(r.apik
305
305
  Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableAutoUpdateUnderNative"?(m.error(`The version number you uploaded to your default channel in Capgo, is lower than the present in the device ${t.device_id}.`),m.error(`To fix it, ensure the variable:
306
306
  - iOS: keyCFBundleShortVersionString or MARKETING_VERSION
307
307
  - Android: versionName
308
- Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(m.error(`Dev build is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(m.error(`Emulator is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(m.error(`We cannot get your bundle from the default channel. ${i}`),m.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?m.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?m.error("Your device has been reset to the builtin bundle, did notifyAppReady() is present in the code builded and uploaded to Capgo ?"):t.action==="update_fail"?(m.error("Your bundle has been installed but failed to call notifyAppReady()"),m.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?m.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):m.error(`Log from Capgo ${t.action}`)}return!0}async function rw(t,e,r,n,i){let o=!0,s=_o(r),a=await Cr(),u=`${a.hostWeb}/app/p/${s}`;await Hn(t,n,e,"Use waitlog");let c={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},l=null,f=be();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await Iue(5e3);let h=await Nue(e,c,l);if(h.length>0){l=h[0].created_at;for(let d of h)if(o=await Lue(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function jL(t,e){Y("Debug Live update in Capgo"),await De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let n=e.device;e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey),o=await Sr(i,t),s=await Pe({message:"Automatic check if update working in device ?"});await jue("debug",s,o,e.apikey),s?(m.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await rw("debug",e.apikey,t,o,n),X("Done \u2705")):X("Canceled \u274C"),X("Done \u2705"),(0,tw.exit)()}var Bt=require("node:fs");async function Bue(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||jn,i=t.keyData||"";if(!(0,Bt.existsSync)(n)&&!i)if(m)m.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,Bt.existsSync)(n)&&(i=(0,Bt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(m)m.error("the public key provided is not a valid RSA Public key"),A.error("");else return!1;return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey&&(delete r.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(r.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),r.config.plugins.CapacitorUpdater.publicKey=i,await on(r)),e&&(m.success(`public key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function que(t,e=!0){e&&Y("Deleting old private key \u{1F5D1}\uFE0F");let r=await ee();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await on(r),(0,Bt.existsSync)(er))try{(0,Bt.unlinkSync)(er),e&&m.success(`Old private key file deleted: ${er}`)}catch{e&&m.error(`Failed to delete old private key file: ${er}`)}if((0,Bt.existsSync)(cr))try{(0,Bt.unlinkSync)(cr),e&&m.success(`Old public key file deleted: ${cr}`)}catch{e&&m.error(`Failed to delete old public key file: ${jn}`)}return e&&m.success(`Old private key deleted from ${r.path} file`),!0}else return e&&m.info("No old private key found in config file"),!1}async function NL(t){Y("Save keys \u{1F511}"),await De(),await Bue(t)}async function nw(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=rp();if((0,Bt.existsSync)(jn)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,Bt.writeFileSync)(jn,r),(0,Bt.existsSync)(ur)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,Bt.writeFileSync)(ur,n);let i=await ee();return i&&(i.config.plugins||(i.config.plugins={extConfig:{},CapacitorUpdater:{}}),i.config.plugins.CapacitorUpdater||(i.config.plugins.CapacitorUpdater={}),i.config.plugins.CapacitorUpdater.privateKey&&(delete i.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(i.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),i.config.plugins.CapacitorUpdater.publicKey=r,on(i)),m&&(m.success("Your RSA key has been generated"),m.success(`Private key saved in ${ur}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Public key saved in ${i.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function LL(t){await De(),await nw(t)}async function BL(t){await De(),await que(t)}var zn=require("node:fs"),ow=require("node:os"),iw=require("node:process");async function qL(){let t=(0,ow.homedir)();return(0,zn.existsSync)(`${t}/.capgo`)||(0,zn.existsSync)(".capgo")}async function sw(t,e,r=!0){if(r&&Y("Login to Capgo"),!t)return r&&(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),!1;await De();try{let{local:n}=e;if(n)(0,zn.existsSync)(".git")||(m.error("To use local you should be in a git repository"),A.error("")),(0,zn.writeFileSync)(".capgo",`${t}
308
+ Are lower than the version number you uploaded to Capgo.`),m.error("More info here: https://capgo.app/blog/how-version-work-in-capgo/#versioning-system")):t.action==="disableDevBuild"?(m.error(`Dev build is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="disableEmulator"?(m.error(`Emulator is disabled in the default channel. ${i}`),m.error("Set your channel to allow it if you wanna test your app")):t.action==="cannotGetBundle"?(m.error(`We cannot get your bundle from the default channel. ${i}`),m.error("Are you sure your default channel has a bundle set?")):t.action==="set_fail"?m.error(`Your bundle seems to be corrupted, try to download from ${i} to identify the issue`):t.action==="reset"?m.error("Your device has been reset to the builtin bundle, did notifyAppReady() is present in the code builded and uploaded to Capgo ?"):t.action==="update_fail"?(m.error("Your bundle has been installed but failed to call notifyAppReady()"),m.error("Please check if you have network connection and try again")):t.action==="checksum_fail"?m.error("Your bundle has failed to validate checksum, please check your code and send it again to Capgo"):m.error(`Log from Capgo ${t.action}`)}return!0}async function rw(t,e,r,n,i){let o=!0,s=_o(r),a=await Cr(),u=`${a.hostWeb}/app/p/${s}`;await Hn(t,n,e,"Use waitlog");let c={appId:r,devicesId:i?[i]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},l=null,f=be();for(f.start("Waiting for logs (Expect delay of 30 sec)");o;){await jue(5e3);let h=await Lue(e,c,l);if(h.length>0){l=h[0].created_at;for(let d of h)if(o=await Bue(d,t,n,e,u,a.hostWeb),!o)break}}return f.stop("Stop watching logs"),Promise.resolve()}async function NL(t,e){Y("Debug Live update in Capgo"),await De(),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let n=e.device;e.apikey||(m.error("Missing API key, you need to provide an API key to delete your app"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey),o=await Sr(i,t),s=await Pe({message:"Automatic check if update working in device ?"});await Nue("debug",s,o,e.apikey),s?(m.info(`Wait logs sent to Capgo from ${t} device, Please open your app \u{1F4AA}`),await rw("debug",e.apikey,t,o,n),X("Done \u2705")):X("Canceled \u274C"),X("Done \u2705"),(0,tw.exit)()}var Bt=require("node:fs");async function que(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||jn,i=t.keyData||"";if(!(0,Bt.existsSync)(n)&&!i)if(m)m.error(`Cannot find a public key at ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,Bt.existsSync)(n)&&(i=(0,Bt.readFileSync)(n).toString());if(i&&!i.startsWith("-----BEGIN RSA PUBLIC KEY-----"))if(m)m.error("the public key provided is not a valid RSA Public key"),A.error("");else return!1;return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey&&(delete r.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(r.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),r.config.plugins.CapacitorUpdater.publicKey=i,await on(r)),e&&(m.success(`public key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function Mue(t,e=!0){e&&Y("Deleting old private key \u{1F5D1}\uFE0F");let r=await ee();if(r?.config?.plugins?.CapacitorUpdater?.privateKey){if(delete r.config.plugins.CapacitorUpdater.privateKey,await on(r),(0,Bt.existsSync)(er))try{(0,Bt.unlinkSync)(er),e&&m.success(`Old private key file deleted: ${er}`)}catch{e&&m.error(`Failed to delete old private key file: ${er}`)}if((0,Bt.existsSync)(cr))try{(0,Bt.unlinkSync)(cr),e&&m.success(`Old public key file deleted: ${cr}`)}catch{e&&m.error(`Failed to delete old public key file: ${jn}`)}return e&&m.success(`Old private key deleted from ${r.path} file`),!0}else return e&&m.info("No old private key found in config file"),!1}async function LL(t){Y("Save keys \u{1F511}"),await De(),await que(t)}async function nw(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=rp();if((0,Bt.existsSync)(jn)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,Bt.writeFileSync)(jn,r),(0,Bt.existsSync)(ur)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,Bt.writeFileSync)(ur,n);let i=await ee();return i&&(i.config.plugins||(i.config.plugins={extConfig:{},CapacitorUpdater:{}}),i.config.plugins.CapacitorUpdater||(i.config.plugins.CapacitorUpdater={}),i.config.plugins.CapacitorUpdater.privateKey&&(delete i.config.plugins.CapacitorUpdater.privateKey,m.info("Old private key deleted from config file"),await Pe({message:"Do you want to setup encryption with the new channel in order to support old apps and facilitate the migration?"})&&(i.config.plugins.CapacitorUpdater.defaultChannel="encryption_v2")),i.config.plugins.CapacitorUpdater.publicKey=r,on(i)),m&&(m.success("Your RSA key has been generated"),m.success(`Private key saved in ${ur}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Public key saved in ${i.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function BL(t){await De(),await nw(t)}async function qL(t){await De(),await Mue(t)}var zn=require("node:fs"),ow=require("node:os"),iw=require("node:process");async function ML(){let t=(0,ow.homedir)();return(0,zn.existsSync)(`${t}/.capgo`)||(0,zn.existsSync)(".capgo")}async function sw(t,e,r=!0){if(r&&Y("Login to Capgo"),!t)return r&&(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),!1;await De();try{let{local:n}=e;if(n)(0,zn.existsSync)(".git")||(m.error("To use local you should be in a git repository"),A.error("")),(0,zn.writeFileSync)(".capgo",`${t}
309
309
  `),(0,zn.appendFileSync)(".gitignore",`.capgo
310
310
  `);else{let s=(0,ow.homedir)();(0,zn.writeFileSync)(`${s}/.capgo`,`${t}
311
- `)}let i=await de(t),o=await me(i,t,["write","all","upload"]);await Fe(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:o,notify:!1}).catch(),m.success(`login saved into .capgo file in ${n?"local":"home"} directory`)}catch{m.error("Error while saving login"),(0,iw.exit)(1)}return r&&(X("Done \u2705"),(0,iw.exit)()),!0}async function ML(t,e){sw(t,e,!0)}var UL="import { CapacitorUpdater } from '@capgo/capacitor-updater'",yp="CapacitorUpdater.notifyAppReady()",Mue=/import.*from.*/g,Zc="production",VL={stdio:"pipe"},$a;function HL(){$a||($a=(0,st.readdirSync)(vp.default.tmpdir).map(t=>({name:t,full:`${vp.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??vp.default.fileSync({prefix:"capgocli"}).name)}function Si(t){try{HL(),(0,st.writeFileSync)($a,JSON.stringify({step_done:t}))}catch(e){m.error(`Cannot mark step as done in the CLI, error:
312
- ${e}`),m.warn("Onboarding will continue but please report it to the capgo team!")}}async function Uue(t,e){try{HL();let r=(0,st.readFileSync)($a,"utf-8");if(!r||r.length===0)return;let{step_done:n}=JSON.parse(r);m.info(`You have already got to the step ${n}/10 in the previous session`);let i=await Pe({message:"Would you like to continue from where you left off?"});return await fn(i,t,e),i?n:void 0}catch(r){m.error(`Cannot read which steps have been compleated, error:
313
- ${r}`),m.warn("Onboarding will continue but please report it to the capgo team!");return}}function Vue(){if($a)try{(0,st.rmSync)($a)}catch(t){m.error(`Cannot delete the tmp steps file.
314
- Error: ${t}`)}}async function fn(t,e,r){kt(t)&&(await Hn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,rr.exit)())}async function $r(t,e,r){return Hn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function Hue(t,e,r,n){let i=Nt(),o=await Pe({message:`Add ${r} in Capgo?`});if(await fn(o,t.gid,e),o){let s=be();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await xb(r,n,t,!1)?s.stop("App add Done \u2705"):s.stop("App already add \u2705")}else m.info(`If you change your mind, run it for yourself with: "${i.runner} @capgo/cli@latest app add ${r}"`);await $r(t.gid,e,2)}async function zue(t,e,r){let n=Nt(),i=await Pe({message:`Create default channel ${Zc} for ${r} in Capgo?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Zc} ${r} --default`),await Wb(Zc,r,{default:!0,apikey:e},!1)?o.stop("Channel add Done \u2705"):o.stop("Channel already added \u2705")}else m.info(`If you change your mind, run it for yourself with: "${n.runner} @capgo/cli@latest channel add ${Zc} ${r} --default"`);await $r(t,e,3)}var Gue="https://capacitorjs.com/docs/updating/6-0",Wue="https://capacitorjs.com/docs/updating/5-0";async function Kue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await fn(i,t,e),i){let o=be();o.start("Checking if @capgo/capacitor-updater is installed");let s="latest",a=await jt(),u=a.dependencies["@capacitor/core"]||a.devDependencies["@capacitor/core"];if(u=Bn(u?.replace("^","").replace("~","")),u?ka(u,Bn("5.0.0"))?(o.stop("Error"),m.warn(`@capacitor/core version is ${u}, please update to Capacitor v5 first: ${Wue}`),X("Bye \u{1F44B}"),(0,rr.exit)()):ka(u,Bn("6.0.0"))&&(o.stop(`@capacitor/core version is ${u}, please update to Capacitor v6: ${Gue} to access the best features of Capgo`),s="^5.0.0"):(o.stop("Error"),m.warn("Cannot find @capacitor/core in package.json, please run `capgo init` in a capacitor project"),X("Bye \u{1F44B}"),(0,rr.exit)()),n.pm==="unknown"&&(o.stop("Error"),m.warn("Cannot reconize package manager, please run `capgo init` in a capacitor project with npm, pnpm, bun or yarn"),X("Bye \u{1F44B}"),(0,rr.exit)()),a.dependencies["@capgo/capacitor-updater"])o.stop("Capgo already installed \u2705");else{await(0,Qc.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,VL);let c=await jt();await wo({version:c?.version||"1.0.0",appId:r,autoUpdate:!0}),o.stop("Install Done \u2705")}}else m.info(`If you change your mind, run it for yourself with: "${n.installCommand} @capgo/capacitor-updater@latest"`);await $r(t,e,4)}async function Yue(t,e,r){let n=await Pe({message:`Automatic Add "${yp}" code and import in ${r}?`});if(await fn(n,t,e),n){let i=be();i.start("Adding @capacitor-updater to your main file");let o=await ib();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,Dp.join)("plugins");(0,st.existsSync)(s)||(0,st.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,Dp.join)(s,"capacitorUpdater.client.ts"):a=(0,Dp.join)(s,"capacitorUpdater.client.js");let u=`
311
+ `)}let i=await de(t),o=await me(i,t,["write","all","upload"]);await Fe(t,{channel:"user-login",event:"User CLI login",icon:"\u2705",user_id:o,notify:!1}).catch(),m.success(`login saved into .capgo file in ${n?"local":"home"} directory`)}catch{m.error("Error while saving login"),(0,iw.exit)(1)}return r&&(X("Done \u2705"),(0,iw.exit)()),!0}async function UL(t,e){sw(t,e,!0)}var VL="import { CapacitorUpdater } from '@capgo/capacitor-updater'",yp="CapacitorUpdater.notifyAppReady()",Uue=/import.*from.*/g,Zc="production",HL={stdio:"pipe"},$a;function zL(){$a||($a=(0,st.readdirSync)(vp.default.tmpdir).map(t=>({name:t,full:`${vp.default.tmpdir}/${t}`})).find(t=>t.name.startsWith("capgocli"))?.full??vp.default.fileSync({prefix:"capgocli"}).name)}function Si(t){try{zL(),(0,st.writeFileSync)($a,JSON.stringify({step_done:t}))}catch(e){m.error(`Cannot mark step as done in the CLI, error:
312
+ ${e}`),m.warn("Onboarding will continue but please report it to the capgo team!")}}async function Vue(t,e){try{zL();let r=(0,st.readFileSync)($a,"utf-8");if(!r||r.length===0)return;let{step_done:n}=JSON.parse(r);m.info(`You have already got to the step ${n}/10 in the previous session`);let i=await Pe({message:"Would you like to continue from where you left off?"});return await fn(i,t,e),i?n:void 0}catch(r){m.error(`Cannot read which steps have been compleated, error:
313
+ ${r}`),m.warn("Onboarding will continue but please report it to the capgo team!");return}}function Hue(){if($a)try{(0,st.rmSync)($a)}catch(t){m.error(`Cannot delete the tmp steps file.
314
+ Error: ${t}`)}}async function fn(t,e,r){kt(t)&&(await Hn("onboarding-v2",e,r,"canceled","\u{1F937}"),(0,rr.exit)())}async function $r(t,e,r){return Hn("onboarding-v2",t,e,`onboarding-step-${r}`)}async function zue(t,e,r,n){let i=Nt(),o=await Pe({message:`Add ${r} in Capgo?`});if(await fn(o,t.gid,e),o){let s=be();s.start(`Running: ${i.runner} @capgo/cli@latest app add ${r}`),await xb(r,n,t,!1)?s.stop("App add Done \u2705"):s.stop("App already add \u2705")}else m.info(`If you change your mind, run it for yourself with: "${i.runner} @capgo/cli@latest app add ${r}"`);await $r(t.gid,e,2)}async function Gue(t,e,r){let n=Nt(),i=await Pe({message:`Create default channel ${Zc} for ${r} in Capgo?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest channel add ${Zc} ${r} --default`),await Wb(Zc,r,{default:!0,apikey:e},!1)?o.stop("Channel add Done \u2705"):o.stop("Channel already added \u2705")}else m.info(`If you change your mind, run it for yourself with: "${n.runner} @capgo/cli@latest channel add ${Zc} ${r} --default"`);await $r(t,e,3)}var Wue="https://capacitorjs.com/docs/updating/6-0",Kue="https://capacitorjs.com/docs/updating/5-0";async function Yue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic Install "@capgo/capacitor-updater" dependency in ${r}?`});if(await fn(i,t,e),i){let o=be();o.start("Checking if @capgo/capacitor-updater is installed");let s="latest",a=await jt(),u=a.dependencies["@capacitor/core"]||a.devDependencies["@capacitor/core"];if(u=Bn(u?.replace("^","").replace("~","")),u?ka(u,Bn("5.0.0"))?(o.stop("Error"),m.warn(`@capacitor/core version is ${u}, please update to Capacitor v5 first: ${Kue}`),X("Bye \u{1F44B}"),(0,rr.exit)()):ka(u,Bn("6.0.0"))&&(o.stop(`@capacitor/core version is ${u}, please update to Capacitor v6: ${Wue} to access the best features of Capgo`),s="^5.0.0"):(o.stop("Error"),m.warn("Cannot find @capacitor/core in package.json, please run `capgo init` in a capacitor project"),X("Bye \u{1F44B}"),(0,rr.exit)()),n.pm==="unknown"&&(o.stop("Error"),m.warn("Cannot reconize package manager, please run `capgo init` in a capacitor project with npm, pnpm, bun or yarn"),X("Bye \u{1F44B}"),(0,rr.exit)()),a.dependencies["@capgo/capacitor-updater"])o.stop("Capgo already installed \u2705");else{await(0,Qc.execSync)(`${n.installCommand} @capgo/capacitor-updater@${s}`,HL);let c=await jt();await wo({version:c?.version||"1.0.0",appId:r,autoUpdate:!0}),o.stop("Install Done \u2705")}}else m.info(`If you change your mind, run it for yourself with: "${n.installCommand} @capgo/capacitor-updater@latest"`);await $r(t,e,4)}async function Jue(t,e,r){let n=await Pe({message:`Automatic Add "${yp}" code and import in ${r}?`});if(await fn(n,t,e),n){let i=be();i.start("Adding @capacitor-updater to your main file");let o=await ib();if(o==="nuxtjs-js"||o==="nuxtjs-ts"){let s=(0,Dp.join)("plugins");(0,st.existsSync)(s)||(0,st.mkdirSync)(s,{recursive:!0});let a;o==="nuxtjs-ts"?a=(0,Dp.join)(s,"capacitorUpdater.client.ts"):a=(0,Dp.join)(s,"capacitorUpdater.client.js");let u=`
315
315
  import { CapacitorUpdater } from '@capgo/capacitor-updater'
316
316
 
317
317
  export default defineNuxtPlugin(() => {
318
318
  CapacitorUpdater.notifyAppReady()
319
319
  })
320
- `;(0,st.existsSync)(a)?(0,st.readFileSync)(a,"utf8").includes("CapacitorUpdater.notifyAppReady()")?(i.stop("Code already added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Plugins directory and capacitorUpdater.client.ts file already exist with required code")):((0,st.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Updated capacitorUpdater.client.ts file with required code")):((0,st.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Created plugins directory and capacitorUpdater.client.ts file"))}else{let s;if(o==="unknown")s=await nj();else{let f=o.endsWith("-ts");s=await tj(o,f)}if(!s||!(0,st.existsSync)(s)){i.stop("Cannot find main file to install Updater plugin");let f=await Jp({message:"Provide the correct relative path to your main file (JS or TS):",validate:h=>{if(!(0,st.existsSync)(h))return"File does not exist. Please provide a valid path."}});kt(f)&&(Xp("Operation cancelled."),(0,rr.exit)(1)),s=f}let u=(0,st.readFileSync)(s,"utf8").toString(),l=u.match(Mue)?.pop();if(l||(i.stop("Error"),m.warn("Cannot find import line in main file, use manual installation: https://capgo.app/docs/plugin/cloud-mode/auto-update/"),X("Bye \u{1F44B}"),(0,rr.exit)()),u.includes(yp))i.stop(`Code already added to ${s} \u2705`);else{let f=u.replace(l,`${l}
321
- ${UL};
320
+ `;(0,st.existsSync)(a)?(0,st.readFileSync)(a,"utf8").includes("CapacitorUpdater.notifyAppReady()")?(i.stop("Code already added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Plugins directory and capacitorUpdater.client.ts file already exist with required code")):((0,st.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Updated capacitorUpdater.client.ts file with required code")):((0,st.writeFileSync)(a,u,"utf8"),i.stop("Code added to capacitorUpdater.client.ts file inside plugins directory \u2705"),m.info("Created plugins directory and capacitorUpdater.client.ts file"))}else{let s;if(o==="unknown")s=await nj();else{let f=o.endsWith("-ts");s=await tj(o,f)}if(!s||!(0,st.existsSync)(s)){i.stop("Cannot find main file to install Updater plugin");let f=await Jp({message:"Provide the correct relative path to your main file (JS or TS):",validate:h=>{if(!(0,st.existsSync)(h))return"File does not exist. Please provide a valid path."}});kt(f)&&(Xp("Operation cancelled."),(0,rr.exit)(1)),s=f}let u=(0,st.readFileSync)(s,"utf8").toString(),l=u.match(Uue)?.pop();if(l||(i.stop("Error"),m.warn("Cannot find import line in main file, use manual installation: https://capgo.app/docs/plugin/cloud-mode/auto-update/"),X("Bye \u{1F44B}"),(0,rr.exit)()),u.includes(yp))i.stop(`Code already added to ${s} \u2705`);else{let f=u.replace(l,`${l}
321
+ ${VL};
322
322
 
323
323
  ${yp};
324
324
  `);(0,st.writeFileSync)(s,f,"utf8"),i.stop(`Code added to ${s} \u2705`)}}await $r(t,e,5)}else m.info(`Add to your main file the following code:
325
325
 
326
- ${UL};
326
+ ${VL};
327
327
 
328
328
  ${yp};
329
- `)}async function Jue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest key create`),await nw({force:!0},!1)?o.stop("key created \u{1F511}"):(o.stop("Error"),m.warn("Cannot create key \u274C"),X("Bye \u{1F44B}"),(0,rr.exit)(1)),Hn("onboarding-v2",t,e,"Use encryption v2")}await $r(t,e,6)}async function Xue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await fn(i,t,e),i){let o=be(),s=await ib(),a=await rj(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await jt()).scripts[a]||(o.stop("Error"),m.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),X("Bye \u{1F44B}"),(0,rr.exit)()),(0,Qc.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,VL),o.stop("Build & Sync Done \u2705")}else m.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await $r(t,e,7)}async function Zue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic upload ${r} bundle to Capgo?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await pp(r,{channel:Zc,apikey:e},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),m.warn("Upload failed \u274C"),X("Bye \u{1F44B}"),(0,rr.exit)())}else m.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await $r(t,e,8)}async function Que(t,e){let r=Nt(),n=await Pe({message:"Run in device now ?"});if(await fn(n,t,e),n){let i=await qo({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});kt(i)&&(X("Bye \u{1F44B}"),(0,rr.exit)());let o=i,s=be();s.start(`Running: ${r.runner} cap run ${o}`),await(0,Qc.spawnSync)(r.runner,["cap","run",o],{stdio:"inherit"}),s.stop("Started Done \u2705")}else m.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await $r(t,e,9)}async function ece(t,e,r,n){let i=await Pe({message:"Automatic check if update working in device ?"});if(await fn(i,t,e),i)m.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await rw("onboarding-v2",e,r,e,t);else{let o=_o(r);m.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await $r(t,e,10)}async function zL(t,e,r){let n=Nt();Y("Capgo onboarding \u{1F6EB}"),await De();let i=!r.supaAnon||!r.supaHost?await ee():await wo({statsUrl:`${r.supaHost}/functions/v1/stats`,channelUrl:`${r.supaHost}/functions/v1/channel_self`,updateUrl:`${r.supaHost}/functions/v1/updates`,localApiFiles:`${r.supaHost}/functions/v1`,localS3:!0,localSupa:r.supaHost,localSupaAnon:r.supaAnon}),o=await Cr();e=ge(e,i?.config),r.apikey=t||pe(),e===void 0&&(e=await Jp({message:"Enter your appId:"}),kt(e)&&(Xp("Operation cancelled."),(0,rr.exit)(1)));let s=be();(!qL()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await sw(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await de(r.apikey);await me(a,r.apikey,["upload","all","read","write"]);let u=await ma(a,["admin","super_admin"]),c=u.gid,l=await Uue(c,r.apikey)??0;try{l<1&&await $r(c,r.apikey,1),l<2&&(await Hue(u,r.apikey,e,r),Si(2)),l<3&&(await zue(c,r.apikey,e),Si(3)),l<4&&(await Kue(c,r.apikey,e),Si(4)),l<5&&(await Yue(c,r.apikey,e),Si(5)),l<6&&(await Jue(c,r.apikey,e),Si(6)),l<7&&(await Xue(c,r.apikey,e),Si(7)),l<8&&(await Zue(c,r.apikey,e),Si(8)),l<9&&(await Que(c,r.apikey),Si(9)),await ece(c,r.apikey,e,o.hostWeb),await $r(c,r.apikey,0),Vue()}catch(f){console.error(f),m.error("Error during onboarding, please try again later"),(0,rr.exit)(1)}m.info("Welcome onboard \u2708\uFE0F!"),m.info("Your Capgo update system is setup"),m.info(`Next time use \`${n.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),m.info(`If you have any issue try to use the debug command \`${n.runner} @capgo/cli@latest app debug\``),X("Bye \u{1F44B}"),(0,rr.exit)()}var dn=require("node:fs");async function tce(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||er,i=t.keyData||"";if(!(0,dn.existsSync)(n)&&!i)if(e)m.error(`Cannot find public key ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,dn.existsSync)(n)&&(i=(0,dn.readFileSync)(n).toString());return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey=i,await on(r)),m&&(m.success(`private key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function GL(t){Y("Save keys \u{1F511}"),await De(),await tce(t)}async function rce(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=rp();if((0,dn.existsSync)(cr)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,dn.writeFileSync)(cr,r),(0,dn.existsSync)(er)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,dn.writeFileSync)(er,n);let i=n.replace(/\\n/g,"\\n"),o=await wo({privateKey:i});return e&&(m.success("Your RSA key has been generated"),m.success(`Public key saved in ${cr}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Private key saved in ${o.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function WL(t){await De(),await rce(t)}async function KL(t){Y("Getting user id"),t.apikey=t.apikey||pe();let e=await de(t.apikey),r=await me(e,t.apikey,["read","all","write"]);X(`Done \u2705: ${r}`)}var YL=ce(kv());async function JL(t,e){Y("Check compatibility"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let{channel:n}=e;n||(m.error("Missing argument, you need to provide a channel"),A.error("")),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey);await me(i,e.apikey,["write","all","read","upload"]),await Be(i,e.apikey,t,1);let{finalCompatibility:o}=await $h(i,t,n,e.packageJson,e.nodeModules),s=new lr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=lr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(c=>{let{name:l,localVersion:f,remoteVersion:h}=c,d=u;try{d=(0,YL.default)(f??"",h??"")?a:u}catch(p){m.error(`Fail when compare. Error: ${p}`)}s.rows.push([l,f,h,d])}),m.success("Compatibility"),m.success(s.toString())}A.name(Ir.name).description("Manage packages and bundle versions in Capgo Cloud").version(Ir.version,"-v, --version","output the current version");A.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(ML).option("--local","Only save in local folder");A.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").action(M8);A.command("init [apikey] [appId]").description("Init a new app").action(zL).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("--supa-host <supaHost>","Supabase host URL").option("--supa-anon <supaAnon>","Supabase anon token");var Ia=A.command("app").description("Manage app");Ia.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(L8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");Ia.command("delete [appId]").description("Delete an app in Capgo Cloud").action(q8).option("-a, --apikey <apikey>","apikey to link to your account");Ia.command("list").alias("l").description("list apps in Capgo Cloud").action(V8).option("-a, --apikey <apikey>","apikey to link to your account");Ia.command("debug [appId]").description("Listen for live updates event in Capgo Cloud to debug your app").option("-a, --apikey <apikey>","apikey to link to your account").option("-d, --device <device>","the specific device to debug").action(jL);Ia.command("setting [path]").description("Modifies capacitor config programmatically").option("--bool <bool>","A value for the setting to modify as a boolean").option("--string <string>","A value for the setting to modify as a string").action(W8);Ia.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(G8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account").option("-r, --retention <retention>","retention period of app bundle in days");var hn=A.command("bundle").description("Manage bundle");hn.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(iL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>","Set the iv and session key for bundle url external").option("--s3-region <region>","Region for your S3 bucket").option("--s3-apikey <apikey>","Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>","Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>","Url of S3 endpoint").option("--s3-bucket-name <bucketName>","Name for your AWS S3 bucket").option("--s3-port <port>","Port for your S3 endpoint").option("--no-s3-ssl","Disable SSL for S3 upload").option("--key <key>","custom path for public signing key (v1 system)").option("--key-data <keyData>","public signing key (v1 system)").option("--key-v2 <key>","custom path for private signing key (v2 system)").option("--key-data-v2 <keyDataV2>","private signing key (v2 system)").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the bundle to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--auto-min-update-version","Set the min update version based on native packages").option("--ignore-metadata-check","Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check","Ignores the checksum check when uploading").option("--timeout <timeout>","Timeout for the upload process in seconds").option("--multipart","Uses multipart protocol to upload data to S3, Deprecated, use tus instead").option("--tus","Upload the bundle using TUS to Capgo cloud").option("--partial","Upload partial files to Capgo cloud").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--auto-set-bundle","Set the bundle in capacitor.config.json").option("--dry-run","Dry run the upload process").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");hn.command("compatibility [appId]").action(JL).option("-a, --apikey <apikey>","apikey to link to your account").option("-c, --channel <channel>","channel to check the compatibility with").option("--text","output text instead of emojis").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");hn.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(TN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(NN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("cleanup [appId]").alias("c").action(yN).description("Cleanup bundle in Capgo Cloud").option("-b, --bundle <bundle>","bundle version number of the app to delete").option("-a, --apikey <apikey>","apikey to link to your account").option("-k, --keep <keep>","number of version to keep").option("-f, --force","force removal");hn.command("decrypt [zipPath] [sessionKey]").description("Decrypt a signed zip bundle").action(EN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encrypt [zipPath]").description("Encrypt a zip bundle").action(RN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encryptV2 [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(IN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("-j, --json","output in JSON");hn.command("decryptV2 [zipPath] [checksum]").description("Decrypt a zip bundle using the new encryption method").action(AN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("--checksum <checksum>","checksum of the bundle, to verify the integrity of the bundle");hn.command("zip [appId]").description("Zip a bundle").action(uL).option("-p, --path <path>","path of the folder to upload").option("-b, --bundle <bundle>","bundle version number to name the zip file").option("-n, --name <name>","name of the zip file").option("-j, --json","output in JSON").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--key-v2","use encryption v2").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var el=A.command("channel").description("Manage channel");el.command("add [channelId] [appId]").alias("a").description("Create channel").action(lL).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");el.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(pL).option("-a, --apikey <apikey>","apikey to link to your account");el.command("list [appId]").alias("l").description("List channel").action(gL).option("-a, --apikey <apikey>","apikey to link to your account");el.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(dL).option("-c, --channel <channel>","channel to get the current bundle from").option("-a, --apikey <apikey>","apikey to link to your account").option("--quiet","only print the bundle version");el.command("set [channelId] [appId]").alias("s").description("Set channel").action(vL).option("-a, --apikey <apikey>","apikey to link to your account").option("-b, --bundle <bundle>","bundle version number of the file to set").option("-s, --state <state>","set the state of the channel, default or normal").option("--latest","get the latest version key in the package.json to set it to the channel").option("--downgrade","Allow to downgrade to version under native one").option("--no-downgrade","Disable downgrade to version under native one").option("--upgrade","Allow to upgrade to version above native one").option("--no-upgrade","Disable upgrade to version above native one").option("--ios","Allow sending update to ios devices").option("--no-ios","Disable sending update to ios devices").option("--android","Allow sending update to android devices").option("--no-android","Disable sending update to android devices").option("--self-assign","Allow to device to self assign to this channel").option("--no-self-assign","Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>","Disable auto update strategy for this channel.The possible options are: major, minor, metadata, patch, none").option("--dev","Allow sending update to development devices").option("--no-dev","Disable sending update to development devices").option("--emulator","Allow sending update to emulator devices").option("--no-emulator","Disable sending update to emulator devices").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var XL=A.command("key_old").description("Manage old encryption key");XL.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(GL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");XL.command("create").description("Create a new encryption key").action(WL).option("-f, --force","force generate a new one");var aw=A.command("key").description("Manage encryption key");aw.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(NL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");aw.command("create").description("Create a new encryption key").action(LL).option("-f, --force","force generate a new one");aw.command("delete_old").description("Delete the old encryption key").action(BL);A.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(oL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--old-encryption","use old encryption").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the file to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel");var nce=A.command("account").description("Manage account");nce.command("id").description("Get your account ID").action(KL).option("-a, --apikey <apikey>","apikey to link to your account");A.parseAsync();
329
+ `)}async function Xue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic configure end-to-end encryption in ${r} updates?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest key create`),await nw({force:!0},!1)?o.stop("key created \u{1F511}"):(o.stop("Error"),m.warn("Cannot create key \u274C"),X("Bye \u{1F44B}"),(0,rr.exit)(1)),Hn("onboarding-v2",t,e,"Use encryption v2")}await $r(t,e,6)}async function Zue(t,e,r){let n=Nt(),i=await Pe({message:`Automatic build ${r} with "${n.pm} run build" ?`});if(await fn(i,t,e),i){let o=be(),s=await ib(),a=await rj(s);o.start(`Running: ${n.pm} run ${a} && ${n.runner} cap sync`),(await jt()).scripts[a]||(o.stop("Error"),m.warn(`Cannot find ${a} script in package.json, please add it and run \`capgo init\` again`),X("Bye \u{1F44B}"),(0,rr.exit)()),(0,Qc.execSync)(`${n.pm} run ${a} && ${n.runner} cap sync`,HL),o.stop("Build & Sync Done \u2705")}else m.info(`Build yourself with command: ${n.pm} run build && ${n.runner} cap sync`);await $r(t,e,7)}async function Que(t,e,r){let n=Nt(),i=await Pe({message:`Automatic upload ${r} bundle to Capgo?`});if(await fn(i,t,e),i){let o=be();o.start(`Running: ${n.runner} @capgo/cli@latest bundle upload`),await pp(r,{channel:Zc,apikey:e},!1)?o.stop("Upload Done \u2705"):(o.stop("Error"),m.warn("Upload failed \u274C"),X("Bye \u{1F44B}"),(0,rr.exit)())}else m.info(`Upload yourself with command: ${n.runner} @capgo/cli@latest bundle upload`);await $r(t,e,8)}async function ece(t,e){let r=Nt(),n=await Pe({message:"Run in device now ?"});if(await fn(n,t,e),n){let i=await qo({message:"Pick a platform to run your app",options:[{value:"ios",label:"IOS"},{value:"android",label:"Android"}]});kt(i)&&(X("Bye \u{1F44B}"),(0,rr.exit)());let o=i,s=be();s.start(`Running: ${r.runner} cap run ${o}`),await(0,Qc.spawnSync)(r.runner,["cap","run",o],{stdio:"inherit"}),s.stop("Started Done \u2705")}else m.info(`If you change your mind, run it for yourself with: ${r.runner} cap run <ios|android>`);await $r(t,e,9)}async function tce(t,e,r,n){let i=await Pe({message:"Automatic check if update working in device ?"});if(await fn(i,t,e),i)m.info(`Wait logs sent to Capgo from ${r} device, Please open your app \u{1F4AA}`),await rw("onboarding-v2",e,r,e,t);else{let o=_o(r);m.info(`Check logs in ${n}/app/p/${o}/logs to see if update works.`)}await $r(t,e,10)}async function GL(t,e,r){let n=Nt();Y("Capgo onboarding \u{1F6EB}"),await De();let i=!r.supaAnon||!r.supaHost?await ee():await wo({statsUrl:`${r.supaHost}/functions/v1/stats`,channelUrl:`${r.supaHost}/functions/v1/channel_self`,updateUrl:`${r.supaHost}/functions/v1/updates`,localApiFiles:`${r.supaHost}/functions/v1`,localS3:!0,localSupa:r.supaHost,localSupaAnon:r.supaAnon}),o=await Cr();e=ge(e,i?.config),r.apikey=t||pe(),e===void 0&&(e=await Jp({message:"Enter your appId:"}),kt(e)&&(Xp("Operation cancelled."),(0,rr.exit)(1)));let s=be();(!ML()||t)&&(s.start(`Running: ${n.runner} @capgo/cli@latest login ***`),await sw(r.apikey,r,!1),s.stop("Login Done \u2705"));let a=await de(r.apikey);await me(a,r.apikey,["upload","all","read","write"]);let u=await ma(a,["admin","super_admin"]),c=u.gid,l=await Vue(c,r.apikey)??0;try{l<1&&await $r(c,r.apikey,1),l<2&&(await zue(u,r.apikey,e,r),Si(2)),l<3&&(await Gue(c,r.apikey,e),Si(3)),l<4&&(await Yue(c,r.apikey,e),Si(4)),l<5&&(await Jue(c,r.apikey,e),Si(5)),l<6&&(await Xue(c,r.apikey,e),Si(6)),l<7&&(await Zue(c,r.apikey,e),Si(7)),l<8&&(await Que(c,r.apikey,e),Si(8)),l<9&&(await ece(c,r.apikey),Si(9)),await tce(c,r.apikey,e,o.hostWeb),await $r(c,r.apikey,0),Hue()}catch(f){console.error(f),m.error("Error during onboarding, please try again later"),(0,rr.exit)(1)}m.info("Welcome onboard \u2708\uFE0F!"),m.info("Your Capgo update system is setup"),m.info(`Next time use \`${n.runner} @capgo/cli@latest bundle upload\` to only upload your bundle`),m.info(`If you have any issue try to use the debug command \`${n.runner} @capgo/cli@latest app debug\``),X("Bye \u{1F44B}"),(0,rr.exit)()}var dn=require("node:fs");async function rce(t,e=!0){e&&Y("Save keys \u{1F511}");let r=await ee(),n=t.key||er,i=t.keyData||"";if(!(0,dn.existsSync)(n)&&!i)if(e)m.error(`Cannot find public key ${n} or as keyData option or in ${r.path}`),A.error("");else return!1;else(0,dn.existsSync)(n)&&(i=(0,dn.readFileSync)(n).toString());return r?.config&&(r.config.plugins||(r.config.plugins={extConfig:{},CapacitorUpdater:{}}),r.config.plugins.CapacitorUpdater||(r.config.plugins.CapacitorUpdater={}),r.config.plugins.CapacitorUpdater.privateKey=i,await on(r)),m&&(m.success(`private key saved into ${r.path} file in local directory`),m.success("your app will decode the zip archive with this key")),!0}async function WL(t){Y("Save keys \u{1F511}"),await De(),await rce(t)}async function nce(t,e=!0){e&&Y("Create keys \u{1F511}");let{publicKey:r,privateKey:n}=rp();if((0,dn.existsSync)(cr)&&!t.force)if(m.error("Public Key already exists, use --force to overwrite"),e)A.error("");else return!1;if((0,dn.writeFileSync)(cr,r),(0,dn.existsSync)(er)&&!t.force)if(m.error("Private Key already exists, use --force to overwrite"),e)A.error("");else return!1;(0,dn.writeFileSync)(er,n);let i=n.replace(/\\n/g,"\\n"),o=await wo({privateKey:i});return e&&(m.success("Your RSA key has been generated"),m.success(`Public key saved in ${cr}`),m.success("This key will be use to encrypt your bundle before sending it to Capgo"),m.success("Keep it safe"),m.success("Than make it unreadable by Capgo and unmodifiable by anyone"),m.success(`Private key saved in ${o.path}`),m.success("Your app will be the only one having it"),m.success("Only your users can decrypt your update"),m.success("Only you can send them an update"),X("Done \u2705")),!0}async function KL(t){await De(),await nce(t)}async function YL(t){Y("Getting user id"),t.apikey=t.apikey||pe();let e=await de(t.apikey),r=await me(e,t.apikey,["read","all","write"]);X(`Done \u2705: ${r}`)}var JL=ce(kv());async function XL(t,e){Y("Check compatibility"),e.apikey=e.apikey||pe();let r=await ee();t=ge(t,r?.config);let{channel:n}=e;n||(m.error("Missing argument, you need to provide a channel"),A.error("")),e.apikey||(m.error("Missing API key, you need to provide a API key to upload your bundle"),A.error("")),t||(m.error("Missing argument, you need to provide a appId, or be in a capacitor project"),A.error(""));let i=await de(e.apikey);await me(i,e.apikey,["write","all","read","upload"]),await Be(i,e.apikey,t,1);let{finalCompatibility:o}=await $h(i,t,n,e.packageJson,e.nodeModules),s=new lr;s.headers=["Package","Local version","Remote version","Compatible"],s.theme=lr.roundTheme,s.rows=[];let a=e.text?"Yes":"\u2705",u=e.text?"No":"\u274C";o.forEach(c=>{let{name:l,localVersion:f,remoteVersion:h}=c,d=u;try{d=(0,JL.default)(f??"",h??"")?a:u}catch(p){m.error(`Fail when compare. Error: ${p}`)}s.rows.push([l,f,h,d])}),m.success("Compatibility"),m.success(s.toString())}A.name(Ir.name).description("Manage packages and bundle versions in Capgo Cloud").version(Ir.version,"-v, --version","output the current version");A.command("login [apikey]").alias("l").description("Save apikey to your machine or folder").action(UL).option("--local","Only save in local folder");A.command("doctor").description("Get info about your Capgo app install").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").action(M8);A.command("init [apikey] [appId]").description("Init a new app").action(GL).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("--supa-host <supaHost>","Supabase host URL").option("--supa-anon <supaAnon>","Supabase anon token");var Ia=A.command("app").description("Manage app");Ia.command("add [appId]").alias("a").description("Add a new app in Capgo Cloud").action(L8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account");Ia.command("delete [appId]").description("Delete an app in Capgo Cloud").action(q8).option("-a, --apikey <apikey>","apikey to link to your account");Ia.command("list").alias("l").description("list apps in Capgo Cloud").action(V8).option("-a, --apikey <apikey>","apikey to link to your account");Ia.command("debug [appId]").description("Listen for live updates event in Capgo Cloud to debug your app").option("-a, --apikey <apikey>","apikey to link to your account").option("-d, --device <device>","the specific device to debug").action(NL);Ia.command("setting [path]").description("Modifies capacitor config programmatically").option("--bool <bool>","A value for the setting to modify as a boolean").option("--string <string>","A value for the setting to modify as a string").action(W8);Ia.command("set [appId]").alias("s").description("Set an app in Capgo Cloud").action(G8).option("-n, --name <name>","app name").option("-i, --icon <icon>","app icon path").option("-a, --apikey <apikey>","apikey to link to your account").option("-r, --retention <retention>","retention period of app bundle in days");var hn=A.command("bundle").description("Manage bundle");hn.command("upload [appId]").alias("u").description("Upload a new bundle in Capgo Cloud").action(oL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--iv-session-key <key>","Set the iv and session key for bundle url external").option("--s3-region <region>","Region for your S3 bucket").option("--s3-apikey <apikey>","Apikey for your S3 endpoint").option("--s3-apisecret <apisecret>","Api secret for your S3 endpoint").option("--s3-endoint <s3Endpoint>","Url of S3 endpoint").option("--s3-bucket-name <bucketName>","Name for your AWS S3 bucket").option("--s3-port <port>","Port for your S3 endpoint").option("--no-s3-ssl","Disable SSL for S3 upload").option("--key <key>","custom path for public signing key (v1 system)").option("--key-data <keyData>","public signing key (v1 system)").option("--key-v2 <key>","custom path for private signing key (v2 system)").option("--key-data-v2 <keyDataV2>","private signing key (v2 system)").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the bundle to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel").option("--auto-min-update-version","Set the min update version based on native packages").option("--ignore-metadata-check","Ignores the metadata (node_modules) check when uploading").option("--ignore-checksum-check","Ignores the checksum check when uploading").option("--timeout <timeout>","Timeout for the upload process in seconds").option("--multipart","Uses multipart protocol to upload data to S3, Deprecated, use tus instead").option("--tus","Upload the bundle using TUS to Capgo cloud").option("--partial","Upload partial files to Capgo cloud").option("--encrypted-checksum <encryptedChecksum>","An encrypted checksum (signature). Used only when uploading an external bundle.").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--auto-set-bundle","Set the bundle in capacitor.config.json").option("--dry-run","Dry run the upload process").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");hn.command("compatibility [appId]").action(XL).option("-a, --apikey <apikey>","apikey to link to your account").option("-c, --channel <channel>","channel to check the compatibility with").option("--text","output text instead of emojis").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos").option("--node-modules <nodeModules>","A list of path to node_modules. Usefull for monorepos (comma separated ex: ../../node_modules,./node_modules)");hn.command("delete [bundleId] [appId]").alias("d").description("Delete a bundle in Capgo Cloud").action(TN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("list [appId]").alias("l").description("List bundle in Capgo Cloud").action(NN).option("-a, --apikey <apikey>","apikey to link to your account");hn.command("cleanup [appId]").alias("c").action(yN).description("Cleanup bundle in Capgo Cloud").option("-b, --bundle <bundle>","bundle version number of the app to delete").option("-a, --apikey <apikey>","apikey to link to your account").option("-k, --keep <keep>","number of version to keep").option("-f, --force","force removal");hn.command("decrypt [zipPath] [sessionKey]").description("Decrypt a signed zip bundle").action(EN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encrypt [zipPath]").description("Encrypt a zip bundle").action(RN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key");hn.command("encryptV2 [zipPath] [checksum]").description("Encrypt a zip bundle using the new encryption method").action(IN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("-j, --json","output in JSON");hn.command("decryptV2 [zipPath] [checksum]").description("Decrypt a zip bundle using the new encryption method").action(AN).option("--key <key>","custom path for private signing key").option("--key-data <keyData>","private signing key").option("--checksum <checksum>","checksum of the bundle, to verify the integrity of the bundle");hn.command("zip [appId]").description("Zip a bundle").action(cL).option("-p, --path <path>","path of the folder to upload").option("-b, --bundle <bundle>","bundle version number to name the zip file").option("-n, --name <name>","name of the zip file").option("-j, --json","output in JSON").option("--no-code-check","Ignore checking if notifyAppReady() is called in soure code and index present in root folder").option("--key-v2","use encryption v2").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var el=A.command("channel").description("Manage channel");el.command("add [channelId] [appId]").alias("a").description("Create channel").action(fL).option("-d, --default","set the channel as default").option("-a, --apikey <apikey>","apikey to link to your account");el.command("delete [channelId] [appId]").alias("d").description("Delete channel").action(mL).option("-a, --apikey <apikey>","apikey to link to your account");el.command("list [appId]").alias("l").description("List channel").action(yL).option("-a, --apikey <apikey>","apikey to link to your account");el.command("currentBundle [channel] [appId]").description("Get current bundle for specific channel in Capgo Cloud").action(hL).option("-c, --channel <channel>","channel to get the current bundle from").option("-a, --apikey <apikey>","apikey to link to your account").option("--quiet","only print the bundle version");el.command("set [channelId] [appId]").alias("s").description("Set channel").action(bL).option("-a, --apikey <apikey>","apikey to link to your account").option("-b, --bundle <bundle>","bundle version number of the file to set").option("-s, --state <state>","set the state of the channel, default or normal").option("--latest","get the latest version key in the package.json to set it to the channel").option("--downgrade","Allow to downgrade to version under native one").option("--no-downgrade","Disable downgrade to version under native one").option("--upgrade","Allow to upgrade to version above native one").option("--no-upgrade","Disable upgrade to version above native one").option("--ios","Allow sending update to ios devices").option("--no-ios","Disable sending update to ios devices").option("--android","Allow sending update to android devices").option("--no-android","Disable sending update to android devices").option("--self-assign","Allow to device to self assign to this channel").option("--no-self-assign","Disable devices to self assign to this channel").option("--disable-auto-update <disableAutoUpdate>","Disable auto update strategy for this channel.The possible options are: major, minor, metadata, patch, none").option("--dev","Allow sending update to development devices").option("--no-dev","Disable sending update to development devices").option("--emulator","Allow sending update to emulator devices").option("--no-emulator","Disable sending update to emulator devices").option("--package-json <packageJson>","A path to package.json. Usefull for monorepos");var ZL=A.command("key_old").description("Manage old encryption key");ZL.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(WL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");ZL.command("create").description("Create a new encryption key").action(KL).option("-f, --force","force generate a new one");var aw=A.command("key").description("Manage encryption key");aw.command("save").description("Save base64 encryption key in capacitor config, usefull for CI").action(LL).option("-f, --force","force generate a new one").option("--key","key path to save in capacitor config").option("--key-data","key data to save in capacitor config");aw.command("create").description("Create a new encryption key").action(BL).option("-f, --force","force generate a new one");aw.command("delete_old").description("Delete the old encryption key").action(qL);A.command("upload [appId]").alias("u").description("(Deprecated) Upload a new bundle to Capgo Cloud").action(sL).option("-a, --apikey <apikey>","apikey to link to your account").option("-p, --path <path>","path of the folder to upload").option("-c, --channel <channel>","channel to link to").option("-e, --external <url>","link to external url intead of upload to Capgo Cloud").option("--old-encryption","use old encryption").option("--key <key>","custom path for public signing key").option("--key-data <keyData>","public signing key").option("--bundle-url","prints bundle url into stdout").option("--no-key","ignore signing key and send clear update").option("--display-iv-session","Show in the console the iv and session key used to encrypt the update").option("-b, --bundle <bundle>","bundle version number of the file to upload").option("--min-update-version <minUpdateVersion>","Minimal version required to update to this version. Used only if the disable auto update is set to metadata in channel");var ice=A.command("account").description("Manage account");ice.command("id").description("Get your account ID").action(YL).option("-a, --apikey <apikey>","apikey to link to your account");A.parseAsync();
330
330
  /*! Bundled license information:
331
331
 
332
332
  safe-buffer/index.js: