@capgo/cli 7.26.0 → 7.26.1
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 +14 -14
- package/dist/package.json +1 -1
- package/dist/src/bundle/partial.d.ts.map +1 -1
- package/dist/src/sdk.js +25 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24,24 +24,24 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
|
|
|
24
24
|
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in ve.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()}`,ve.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new mA(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(o=>!r(o)).forEach(o=>{this.setOptionValueWithSource(o,n.implied[o],"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=a=>{let s=a.attributeName(),u=this.getOptionValue(s),c=this.options.find(f=>f.negate&&s===f.attributeName()),l=this.options.find(f=>!f.negate&&s===f.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||a},o=a=>{let s=n(a),u=s.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},i=`error: ${o(e)} cannot be used with ${o(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let o=[],i=this;do{let a=i.createHelp().visibleOptions(i).filter(s=>s.long).map(s=>s.long);o=o.concat(a),i=i.parent}while(i&&!i._enablePositionalOptions);r=uD(e,o)}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",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(i=>{o.push(i.name()),i.alias()&&o.push(i.alias())}),r=uD(e,o)}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 o=this.createOption(r,n);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
25
25
|
`),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 o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${o}'`)}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=>pA(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)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=Hr.basename(e,Hr.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let o=r.formatHelp(this,r);return n.hasColors?o:this._outputConfiguration.stripColor(o)}_getOutputContext(e){e=e||{};let r=!!e.error,n,o,i;return r?(n=s=>this._outputConfiguration.writeErr(s),o=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=s=>this._outputConfiguration.writeOut(s),o=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:s=>(o||(s=this._outputConfiguration.stripColor(s)),n(s)),hasColors:o,helpWidth:i}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),o={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let i=this.helpInformation({error:n.error});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",o),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",o))}helpOption(e,r){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",r??"display help for command"),(e||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let r=Number(ve.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.
|
|
26
26
|
Expecting one of '${n.join("', '")}'`);let o=`${e}Help`;return this.on(o,i=>{let a;typeof r=="function"?a=r({error:i.error,command:i.command}):a=r,a&&i.write(`${a}
|
|
27
|
-
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function cD(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",o="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],o=i[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:e})}function bf(){if(ve.env.NO_COLOR||ve.env.FORCE_COLOR==="0"||ve.env.FORCE_COLOR==="false")return!1;if(ve.env.FORCE_COLOR||ve.env.CLICOLOR_FORCE!==void 0)return!0}vf.Command=yf;vf.useColor=bf});var hD=x(Xt=>{var{Argument:fD}=Ls(),{Command:wf}=lD(),{CommanderError:gA,InvalidArgumentError:pD}=la(),{Help:DA}=ff(),{Option:dD}=mf();Xt.program=new wf;Xt.createCommand=t=>new wf(t);Xt.createOption=(t,e)=>new dD(t,e);Xt.createArgument=(t,e)=>new fD(t,e);Xt.Command=wf;Xt.Option=dD;Xt.Argument=fD;Xt.Help=DA;Xt.CommanderError=gA;Xt.InvalidArgumentError=pD;Xt.InvalidOptionArgumentError=pD});var Ef=x((m7,gD)=>{"use strict";var Cf={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},bA={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},vA={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Cf.up():"");return t&&(e+=Cf.left),e}};gD.exports={cursor:Cf,scroll:bA,erase:vA,beep:"\x07"}});var xf=x((g7,_f)=>{var qs=process||{},DD=qs.argv||[],Ms=qs.env||{},wA=!(Ms.NO_COLOR||DD.includes("--no-color"))&&(!!Ms.FORCE_COLOR||DD.includes("--color")||qs.platform==="win32"||(qs.stdout||{}).isTTY&&Ms.TERM!=="dumb"||!!Ms.CI),CA=(t,e,r=t)=>n=>{let o=""+n,i=o.indexOf(e,t.length);return~i?t+EA(o,e,r,i)+e:t+o+e},EA=(t,e,r,n)=>{let o="",i=0;do o+=t.substring(i,n)+r,i=n+e.length,n=t.indexOf(e,i);while(~n);return o+t.substring(i)},yD=(t=wA)=>{let e=t?CA:()=>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")}};_f.exports=yD();_f.exports.createColors=yD});var Xs=x(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.isNXMonorepo=Tt.isMonorepo=Tt.findPackageRelativePathInMonorepo=Tt.findPackagePath=Tt.findNXMonorepoRoot=Tt.findMonorepoRoot=void 0;var da=require("node:fs"),pn=require("node:path");function Js(t){let e=(0,pn.join)(t,"package.json"),r=(0,pn.join)(t,"pnpm-workspace.yaml");if((0,da.existsSync)(r)||(0,da.existsSync)(e)&&JSON.parse((0,da.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,pn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return Js(n)}Tt.findMonorepoRoot=Js;function Nf(t){let e=(0,pn.join)(t,"nx.json");if((0,da.existsSync)(e))return t;let r=(0,pn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Nf(r)}Tt.findNXMonorepoRoot=Nf;function Lf(t,e,r){let n=(0,pn.join)(e,"node_modules",t);if((0,da.existsSync)(n))return n;if(e===r)return null;let o=(0,pn.dirname)(e);return Lf(t,o,r)}Tt.findPackagePath=Lf;function tO(t,e){let r=Js(e),n=Lf(t,e,r);return n?(0,pn.relative)(e,n):null}Tt.findPackageRelativePathInMonorepo=tO;function rO(t){try{return Js(t),!0}catch{return!1}}Tt.isMonorepo=rO;function nO(t){try{return Nf(t),!0}catch{return!1}}Tt.isNXMonorepo=nO});var le={};qr(le,{__addDisposableResource:()=>vy,__assign:()=>ou,__asyncDelegator:()=>py,__asyncGenerator:()=>fy,__asyncValues:()=>dy,__await:()=>Uo,__awaiter:()=>iy,__classPrivateFieldGet:()=>Dy,__classPrivateFieldIn:()=>by,__classPrivateFieldSet:()=>yy,__createBinding:()=>au,__decorate:()=>ZD,__disposeResources:()=>wy,__esDecorate:()=>ey,__exportStar:()=>sy,__extends:()=>JD,__generator:()=>ay,__importDefault:()=>gy,__importStar:()=>my,__makeTemplateObject:()=>hy,__metadata:()=>oy,__param:()=>QD,__propKey:()=>ry,__read:()=>Kf,__rest:()=>XD,__rewriteRelativeImportExtension:()=>Cy,__runInitializers:()=>ty,__setFunctionName:()=>ny,__spread:()=>uy,__spreadArray:()=>ly,__spreadArrays:()=>cy,__values:()=>iu,default:()=>FO});function JD(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Gf(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function XD(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 o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r}function ZD(t,e,r,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(o<3?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i}function QD(t,e){return function(r,n){e(r,n,t)}}function ey(t,e,r,n,o,i){function a(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var s=n.kind,u=s==="getter"?"get":s==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,d=!1,h=r.length-1;h>=0;h--){var m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.addInitializer=function(C){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(C||null))};var D=(0,r[h])(s==="accessor"?{get:l.get,set:l.set}:l[u],m);if(s==="accessor"){if(D===void 0)continue;if(D===null||typeof D!="object")throw new TypeError("Object expected");(f=a(D.get))&&(l.get=f),(f=a(D.set))&&(l.set=f),(f=a(D.init))&&o.unshift(f)}else(f=a(D))&&(s==="field"?o.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),d=!0}function ty(t,e,r){for(var n=arguments.length>2,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0}function ry(t){return typeof t=="symbol"?t:"".concat(t)}function ny(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 oy(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function iy(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(l){try{c(n.next(l))}catch(f){a(f)}}function u(l){try{c(n.throw(l))}catch(f){a(f)}}function c(l){l.done?i(l.value):o(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function ay(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function sy(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&au(e,t,r)}function iu(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 Kf(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function uy(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Kf(arguments[e]));return t}function cy(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),o=0,e=0;e<r;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}function ly(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function Uo(t){return this instanceof Uo?(this.v=t,this):new Uo(t)}function fy(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(h){return function(m){return Promise.resolve(m).then(h,f)}}function s(h,m){n[h]&&(o[h]=function(b){return new Promise(function(D,C){i.push([h,b,D,C])>1||u(h,b)})},m&&(o[h]=m(o[h])))}function u(h,m){try{c(n[h](m))}catch(b){d(i[0][3],b)}}function c(h){h.value instanceof Uo?Promise.resolve(h.value.v).then(l,f):d(i[0][2],h)}function l(h){u("next",h)}function f(h){u("throw",h)}function d(h,m){h(m),i.shift(),i.length&&u(i[0][0],i[0][1])}}function py(t){var e,r;return e={},n("next"),n("throw",function(o){throw o}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(o,i){e[o]=t[o]?function(a){return(r=!r)?{value:Uo(t[o](a)),done:!1}:i?i(a):a}:i}}function dy(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 iu=="function"?iu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(a){return new Promise(function(s,u){a=t[i](a),o(s,u,a.done,a.value)})}}function o(i,a,s,u){Promise.resolve(u).then(function(c){i({value:c,done:s})},a)}}function hy(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function my(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Wf(t),n=0;n<r.length;n++)r[n]!=="default"&&au(e,t,r[n]);return xO(e,t),e}function gy(t){return t&&t.__esModule?t:{default:t}}function Dy(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 yy(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r}function by(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 vy(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,o;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&&(o=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function wy(t){function e(i){t.error=t.hasError?new SO(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var r,n=0;function o(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(a){return e(a),o()})}else n|=1}catch(a){e(a)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return o()}function Cy(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,o,i,a){return n?e?".jsx":".js":o&&(!i||!a)?r:o+i+"."+a.toLowerCase()+"js"}):t}var Gf,ou,au,xO,Wf,SO,FO,fe=tt(()=>{Gf=function(t,e){return Gf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Gf(t,e)};ou=function(){return ou=Object.assign||function(e){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},ou.apply(this,arguments)};au=Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]});xO=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},Wf=function(t){return Wf=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},Wf(t)};SO=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};FO={__extends:JD,__assign:ou,__rest:XD,__decorate:ZD,__param:QD,__esDecorate:ey,__runInitializers:ty,__propKey:ry,__setFunctionName:ny,__metadata:oy,__awaiter:iy,__generator:ay,__createBinding:au,__exportStar:sy,__values:iu,__read:Kf,__spread:uy,__spreadArrays:cy,__spreadArray:ly,__await:Uo,__asyncGenerator:fy,__asyncDelegator:py,__asyncValues:dy,__makeTemplateObject:hy,__importStar:my,__importDefault:gy,__classPrivateFieldGet:Dy,__classPrivateFieldSet:yy,__classPrivateFieldIn:by,__addDisposableResource:vy,__disposeResources:wy,__rewriteRelativeImportExtension:Cy}});var Ey=x(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.resolveFetch=void 0;var AO=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);su.resolveFetch=AO});var Zf=x(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.FunctionRegion=Qt.FunctionsHttpError=Qt.FunctionsRelayError=Qt.FunctionsFetchError=Qt.FunctionsError=void 0;var Mo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};Qt.FunctionsError=Mo;var Yf=class extends Mo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};Qt.FunctionsFetchError=Yf;var Jf=class extends Mo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};Qt.FunctionsRelayError=Jf;var Xf=class extends Mo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};Qt.FunctionsHttpError=Xf;var _y;(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"})(_y||(Qt.FunctionRegion=_y={}))});var xy=x(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.FunctionsClient=void 0;var OO=(fe(),re(le)),kO=Ey(),Hn=Zf(),Qf=class{constructor(e,{headers:r={},customFetch:n,region:o=Hn.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=o,this.fetch=(0,kO.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return OO.__awaiter(this,arguments,void 0,function*(r,n={}){var o;try{let{headers:i,method:a,body:s,signal:u}=n,c={},{region:l}=n;l||(l=this.region);let f=new URL(`${this.url}/${r}`);l&&l!=="any"&&(c["x-region"]=l,f.searchParams.set("forceFunctionRegion",l));let d;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)?typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(c["Content-Type"]="application/octet-stream",d=s):typeof s=="string"?(c["Content-Type"]="text/plain",d=s):typeof FormData<"u"&&s instanceof FormData?d=s:(c["Content-Type"]="application/json",d=JSON.stringify(s)):d=s;let h=yield this.fetch(f.toString(),{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},c),this.headers),i),body:d,signal:u}).catch(C=>{throw C.name==="AbortError"?C:new Hn.FunctionsFetchError(C)}),m=h.headers.get("x-relay-error");if(m&&m==="true")throw new Hn.FunctionsRelayError(h);if(!h.ok)throw new Hn.FunctionsHttpError(h);let b=((o=h.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),D;return b==="application/json"?D=yield h.json():b==="application/octet-stream"||b==="application/pdf"?D=yield h.blob():b==="text/event-stream"?D=h:b==="multipart/form-data"?D=yield h.formData():D=yield h.text(),{data:D,error:null,response:h}}catch(i){return i instanceof Error&&i.name==="AbortError"?{data:null,error:new Hn.FunctionsFetchError(i)}:{data:null,error:i,response:i instanceof Hn.FunctionsHttpError||i instanceof Hn.FunctionsRelayError?i.context:void 0}}})}};uu.FunctionsClient=Qf});var ep=x(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.FunctionRegion=It.FunctionsRelayError=It.FunctionsHttpError=It.FunctionsFetchError=It.FunctionsError=It.FunctionsClient=void 0;var $O=xy();Object.defineProperty(It,"FunctionsClient",{enumerable:!0,get:function(){return $O.FunctionsClient}});var ya=Zf();Object.defineProperty(It,"FunctionsError",{enumerable:!0,get:function(){return ya.FunctionsError}});Object.defineProperty(It,"FunctionsFetchError",{enumerable:!0,get:function(){return ya.FunctionsFetchError}});Object.defineProperty(It,"FunctionsHttpError",{enumerable:!0,get:function(){return ya.FunctionsHttpError}});Object.defineProperty(It,"FunctionsRelayError",{enumerable:!0,get:function(){return ya.FunctionsRelayError}});Object.defineProperty(It,"FunctionRegion",{enumerable:!0,get:function(){return ya.FunctionRegion}})});var np=x(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});var tp=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};rp.default=tp});var ap=x(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});var PO=(fe(),re(le)),TO=PO.__importDefault(np()),op=class{constructor(e){var r,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(r=e.shouldThrowOnError)!==null&&r!==void 0?r:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=new Headers(this.headers),this.headers.set(e,r),this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let n=this.fetch,o=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var a,s,u,c;let l=null,f=null,d=null,h=i.status,m=i.statusText;if(i.ok){if(this.method!=="HEAD"){let E=await i.text();E===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((a=this.headers.get("Accept"))===null||a===void 0)&&a.includes("application/vnd.pgrst.plan+text"))?f=E:f=JSON.parse(E))}let D=(s=this.headers.get("Prefer"))===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),C=(u=i.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");D&&C&&C.length>1&&(d=parseInt(C[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(f)&&(f.length>1?(l={code:"PGRST116",details:`Results contain ${f.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},f=null,d=null,h=406,m="Not Acceptable"):f.length===1?f=f[0]:f=null)}else{let D=await i.text();try{l=JSON.parse(D),Array.isArray(l)&&i.status===404&&(f=[],l=null,h=200,m="OK")}catch{i.status===404&&D===""?(h=204,m="No Content"):l={message:D}}if(l&&this.isMaybeSingle&&(!((c=l?.details)===null||c===void 0)&&c.includes("0 rows"))&&(l=null,h=200,m="OK"),l&&this.shouldThrowOnError)throw new TO.default(l)}return{error:l,data:f,count:d,status:h,statusText:m}});return this.shouldThrowOnError||(o=o.catch(i=>{var a,s,u;return{error:{message:`${(a=i?.name)!==null&&a!==void 0?a:"FetchError"}: ${i?.message}`,details:`${(s=i?.stack)!==null&&s!==void 0?s:""}`,hint:"",code:`${(u=i?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),o.then(e,r)}returns(){return this}overrideTypes(){return this}};ip.default=op});var cp=x(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});var IO=(fe(),re(le)),RO=IO.__importDefault(ap()),sp=class extends RO.default{select(e){let r=!1,n=(e??"*").split("").map(o=>/\s/.test(o)&&!r?"":(o==='"'&&(r=!r),o)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:o,referencedTable:i=o}={}){let a=i?`${i}.order`:"order",s=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${s?`${s},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let o=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(o,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:o=n}={}){let i=typeof o>"u"?"offset":`${o}.offset`,a=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:o=!1,wal:i=!1,format:a="text"}={}){var s;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,o?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=(s=this.headers.get("Accept"))!==null&&s!==void 0?s:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${c}"; options=${u};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};up.default=sp});var cu=x(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});var BO=(fe(),re(le)),jO=BO.__importDefault(cp()),NO=new RegExp("[,()]"),lp=class extends jO.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(o=>typeof o=="string"&&NO.test(o)?`"${o}"`:`${o}`).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:o}={}){let i="";o==="plain"?i="pl":o==="phrase"?i="ph":o==="websearch"&&(i="w");let a=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${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 o=n?`${n}.or`:"or";return this.url.searchParams.append(o,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};fp.default=lp});var hp=x(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});var LO=(fe(),re(le)),ba=LO.__importDefault(cu()),pp=class{constructor(e,{headers:r={},schema:n,fetch:o}){this.url=e,this.headers=new Headers(r),this.schema=n,this.fetch=o}select(e,r){let{head:n=!1,count:o}=r??{},i=n?"HEAD":"GET",a=!1,s=(e??"*").split("").map(u=>/\s/.test(u)&&!a?"":(u==='"'&&(a=!a),u)).join("");return this.url.searchParams.set("select",s),o&&this.headers.append("Prefer",`count=${o}`),new ba.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(e,{count:r,defaultToNull:n=!0}={}){var o;let i="POST";if(r&&this.headers.append("Prefer",`count=${r}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(e)){let a=e.reduce((s,u)=>s.concat(Object.keys(u)),[]);if(a.length>0){let s=[...new Set(a)].map(u=>`"${u}"`);this.url.searchParams.set("columns",s.join(","))}}return new ba.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:o,defaultToNull:i=!0}={}){var a;let s="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),r!==void 0&&this.url.searchParams.set("on_conflict",r),o&&this.headers.append("Prefer",`count=${o}`),i||this.headers.append("Prefer","missing=default"),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 ba.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}update(e,{count:r}={}){var n;let o="PATCH";return r&&this.headers.append("Prefer",`count=${r}`),new ba.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:e}={}){var r;let n="DELETE";return e&&this.headers.append("Prefer",`count=${e}`),new ba.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}};dp.default=pp});var Fy=x(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});var Sy=(fe(),re(le)),UO=Sy.__importDefault(hp()),MO=Sy.__importDefault(cu()),mp=class t{constructor(e,{headers:r={},schema:n,fetch:o}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.fetch=o}from(e){let r=new URL(`${this.url}/${e}`);return new UO.default(r,{headers:new Headers(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:o=!1,count:i}={}){var a;let s,u=new URL(`${this.url}/rpc/${e}`),c;n||o?(s=n?"HEAD":"GET",Object.entries(r).filter(([f,d])=>d!==void 0).map(([f,d])=>[f,Array.isArray(d)?`{${d.join(",")}}`:`${d}`]).forEach(([f,d])=>{u.searchParams.append(f,d)})):(s="POST",c=r);let l=new Headers(this.headers);return i&&l.set("Prefer",`count=${i}`),new MO.default({method:s,url:u,headers:l,schema:this.schemaName,body:c,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};gp.default=mp});var Dp=x(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.PostgrestError=xt.PostgrestBuilder=xt.PostgrestTransformBuilder=xt.PostgrestFilterBuilder=xt.PostgrestQueryBuilder=xt.PostgrestClient=void 0;var qo=(fe(),re(le)),Ay=qo.__importDefault(Fy());xt.PostgrestClient=Ay.default;var Oy=qo.__importDefault(hp());xt.PostgrestQueryBuilder=Oy.default;var ky=qo.__importDefault(cu());xt.PostgrestFilterBuilder=ky.default;var $y=qo.__importDefault(cp());xt.PostgrestTransformBuilder=$y.default;var Py=qo.__importDefault(ap());xt.PostgrestBuilder=Py.default;var Ty=qo.__importDefault(np());xt.PostgrestError=Ty.default;xt.default={PostgrestClient:Ay.default,PostgrestQueryBuilder:Oy.default,PostgrestFilterBuilder:ky.default,PostgrestTransformBuilder:$y.default,PostgrestBuilder:Py.default,PostgrestError:Ty.default}});var bp={};qr(bp,{RealtimeClient:()=>yp});var yp,vp=tt(()=>{yp=class{constructor(){}connect(){}disconnect(){}}});var mn=x(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.StorageUnknownError=zr.StorageApiError=zr.StorageError=void 0;zr.isStorageError=qO;var va=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};zr.StorageError=va;function qO(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var wp=class extends va{constructor(e,r,n){super(e),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};zr.StorageApiError=wp;var Cp=class extends va{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};zr.StorageUnknownError=Cp});var wa=x(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.isPlainObject=er.recursiveToCamel=er.resolveResponse=er.resolveFetch=void 0;var HO=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);er.resolveFetch=HO;var VO=()=>Response;er.resolveResponse=VO;var zO=t=>{if(Array.isArray(t))return t.map(r=>(0,er.recursiveToCamel)(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let o=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[o]=(0,er.recursiveToCamel)(n)}),e};er.recursiveToCamel=zO;var GO=t=>{if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};er.isPlainObject=GO});var lu=x(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.get=YO;zn.post=JO;zn.put=XO;zn.head=ZO;zn.remove=QO;var Vn=(fe(),re(le)),Ep=mn(),Iy=wa(),_p=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},WO=(t,e,r)=>Vn.__awaiter(void 0,void 0,void 0,function*(){let n=yield(0,Iy.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(o=>{let i=t.status||500,a=o?.statusCode||i+"";e(new Ep.StorageApiError(_p(o),i,a))}).catch(o=>{e(new Ep.StorageUnknownError(_p(o),o))}):e(new Ep.StorageUnknownError(_p(t),t))}),KO=(t,e,r,n)=>{let o={method:t,headers:e?.headers||{}};return t==="GET"||!n?o:((0,Iy.isPlainObject)(n)?(o.headers=Object.assign({"Content-Type":"application/json"},e?.headers),o.body=JSON.stringify(n)):o.body=n,e?.duplex&&(o.duplex=e.duplex),Object.assign(Object.assign({},o),r))};function Ca(t,e,r,n,o,i){return Vn.__awaiter(this,void 0,void 0,function*(){return new Promise((a,s)=>{t(r,KO(e,n,o,i)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>a(u)).catch(u=>WO(u,s,n))})})}function YO(t,e,r,n){return Vn.__awaiter(this,void 0,void 0,function*(){return Ca(t,"GET",e,r,n)})}function JO(t,e,r,n,o){return Vn.__awaiter(this,void 0,void 0,function*(){return Ca(t,"POST",e,n,o,r)})}function XO(t,e,r,n,o){return Vn.__awaiter(this,void 0,void 0,function*(){return Ca(t,"PUT",e,n,o,r)})}function ZO(t,e,r,n){return Vn.__awaiter(this,void 0,void 0,function*(){return Ca(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function QO(t,e,r,n,o){return Vn.__awaiter(this,void 0,void 0,function*(){return Ca(t,"DELETE",e,n,o,r)})}});var Ry=x(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});var ek=(fe(),re(le)),tk=mn(),xp=class{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r}then(e,r){return this.execute().then(e,r)}execute(){return ek.__awaiter(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if((0,tk.isStorageError)(e))return{data:null,error:e};throw e}})}};Sp.default=xp});var Ny=x(Ap=>{"use strict";var By;Object.defineProperty(Ap,"__esModule",{value:!0});var jy=(fe(),re(le)),rk=mn(),nk=jy.__importDefault(Ry()),Fp=class{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r,this[By]="BlobDownloadBuilder",this.promise=null}asStream(){return new nk.default(this.downloadFn,this.shouldThrowOnError)}then(e,r){return this.getPromise().then(e,r)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return jy.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if((0,rk.isStorageError)(e))return{data:null,error:e};throw e}})}};By=Symbol.toStringTag;Ap.default=Fp});var My=x(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});var St=(fe(),re(le)),Rt=mn(),Bt=lu(),Ly=wa(),ok=St.__importDefault(Ny()),ik={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Uy={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Op=class{constructor(e,r={},n,o){this.shouldThrowOnError=!1,this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,Ly.resolveFetch)(o)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,r,n,o){return St.__awaiter(this,void 0,void 0,function*(){try{let i,a=Object.assign(Object.assign({},Uy),o),s=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(a.upsert)}),u=a.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",a.cacheControl),u&&i.append("metadata",this.encodeMetadata(u)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",a.cacheControl),u&&!i.has("metadata")&&i.append("metadata",this.encodeMetadata(u))):(i=n,s["cache-control"]=`max-age=${a.cacheControl}`,s["content-type"]=a.contentType,u&&(s["x-metadata"]=this.toBase64(this.encodeMetadata(u))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!a.duplex&&(a.duplex="half")),o?.headers&&(s=Object.assign(Object.assign({},s),o.headers));let c=this._removeEmptyFolders(r),l=this._getFinalPath(c),f=yield(e=="PUT"?Bt.put:Bt.post)(this.fetch,`${this.url}/object/${l}`,i,Object.assign({headers:s},a?.duplex?{duplex:a.duplex}:{}));return{data:{path:c,id:f.Id,fullPath:f.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if((0,Rt.isStorageError)(i))return{data:null,error:i};throw i}})}upload(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,o){return St.__awaiter(this,void 0,void 0,function*(){let i=this._removeEmptyFolders(e),a=this._getFinalPath(i),s=new URL(this.url+`/object/upload/sign/${a}`);s.searchParams.set("token",r);try{let u,c=Object.assign({upsert:Uy.upsert},o),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(0,Bt.put)(this.fetch,s.toString(),u,{headers:l});return{data:{path:i,fullPath:f.Key},error:null}}catch(u){if(this.shouldThrowOnError)throw u;if((0,Rt.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return St.__awaiter(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),o=Object.assign({},this.headers);r?.upsert&&(o["x-upsert"]="true");let i=yield(0,Bt.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:o}),a=new URL(this.url+i.url),s=a.searchParams.get("token");if(!s)throw new Rt.StorageError("No token returned by API");return{data:{signedUrl:a.toString(),path:e,token:s},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,Rt.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,Bt.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Rt.isStorageError)(o))return{data:null,error:o};throw o}})}copy(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Bt.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Rt.isStorageError)(o))return{data:null,error:o};throw o}})}createSignedUrl(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){try{let o=this._getFinalPath(e),i=yield(0,Bt.post)(this.fetch,`${this.url}/object/sign/${o}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),a=n?.download?`&download=${n.download===!0?"":n.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${a}`)},{data:i,error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Rt.isStorageError)(o))return{data:null,error:o};throw o}})}createSignedUrls(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){try{let o=yield(0,Bt.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),i=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:o.map(a=>Object.assign(Object.assign({},a),{signedUrl:a.signedURL?encodeURI(`${this.url}${a.signedURL}${i}`):null})),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Rt.isStorageError)(o))return{data:null,error:o};throw o}})}download(e,r){let o=typeof r?.transform<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString(r?.transform||{}),a=i?`?${i}`:"",s=this._getFinalPath(e),u=()=>(0,Bt.get)(this.fetch,`${this.url}/${o}/${s}${a}`,{headers:this.headers,noResolveJson:!0});return new ok.default(u,this.shouldThrowOnError)}info(e){return St.__awaiter(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Bt.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,Ly.recursiveToCamel)(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,Rt.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return St.__awaiter(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Bt.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,Rt.isStorageError)(n)&&n instanceof Rt.StorageUnknownError){let o=n.originalError;if([400,404].includes(o?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),o=[],i=r?.download?`download=${r.download===!0?"":r.download}`:"";i!==""&&o.push(i);let s=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&o.push(u);let c=o.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}${c}`)}}}remove(e){return St.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,Bt.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Rt.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){try{let o=Object.assign(Object.assign(Object.assign({},ik),r),{prefix:e||""});return{data:yield(0,Bt.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,o,{headers:this.headers},n),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Rt.isStorageError)(o))return{data:null,error:o};throw o}})}listV2(e,r){return St.__awaiter(this,void 0,void 0,function*(){try{let n=Object.assign({},e);return{data:yield(0,Bt.post)(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,Rt.isStorageError)(n))return{data:null,error:n};throw n}})}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.replace(/^\/+/,"")}`}_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("&")}};kp.default=Op});var $p=x(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.version=void 0;fu.version="2.79.0"});var Pp=x(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.DEFAULT_HEADERS=void 0;var ak=$p();pu.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${ak.version}`}});var qy=x(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});var Ho=(fe(),re(le)),sk=Pp(),Vo=mn(),zo=lu(),uk=wa(),Tp=class{constructor(e,r={},n,o){this.shouldThrowOnError=!1;let i=new URL(e);o?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},sk.DEFAULT_HEADERS),r),this.fetch=(0,uk.resolveFetch)(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return Ho.__awaiter(this,void 0,void 0,function*(){try{let r=this.listBucketOptionsToQueryString(e);return{data:yield(0,zo.get)(this.fetch,`${this.url}/bucket${r}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}getBucket(e){return Ho.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,zo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e){return Ho.__awaiter(this,arguments,void 0,function*(r,n={public:!1}){try{return{data:yield(0,zo.post)(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Vo.isStorageError)(o))return{data:null,error:o};throw o}})}updateBucket(e,r){return Ho.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,zo.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(this.shouldThrowOnError)throw n;if((0,Vo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Ho.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,zo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Ho.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,zo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}listBucketOptionsToQueryString(e){let r={};return e&&("limit"in e&&(r.limit=String(e.limit)),"offset"in e&&(r.offset=String(e.offset)),e.search&&(r.search=e.search),e.sortColumn&&(r.sortColumn=e.sortColumn),e.sortOrder&&(r.sortOrder=e.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}};Ip.default=Tp});var Up=x(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});var Rp=(fe(),re(le)),ck=Pp(),Bp=mn(),jp=lu(),lk=wa(),Np=class{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},ck.DEFAULT_HEADERS),r),this.fetch=(0,lk.resolveFetch)(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return Rp.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,jp.post)(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Bp.isStorageError)(r))return{data:null,error:r};throw r}})}listBuckets(e){return Rp.__awaiter(this,void 0,void 0,function*(){try{let r=new URLSearchParams;e?.limit!==void 0&&r.set("limit",e.limit.toString()),e?.offset!==void 0&&r.set("offset",e.offset.toString()),e?.sortColumn&&r.set("sortColumn",e.sortColumn),e?.sortOrder&&r.set("sortOrder",e.sortOrder),e?.search&&r.set("search",e.search);let n=r.toString(),o=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield(0,jp.get)(this.fetch,o,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Bp.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Rp.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,jp.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Bp.isStorageError)(r))return{data:null,error:r};throw r}})}};Lp.default=Np});var hu=x(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.DEFAULT_HEADERS=void 0;var fk=$p();du.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${fk.version}`,"Content-Type":"application/json"}});var Go=x(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.StorageVectorsErrorCode=br.StorageVectorsUnknownError=br.StorageVectorsApiError=br.StorageVectorsError=void 0;br.isStorageVectorsError=pk;var Ea=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};br.StorageVectorsError=Ea;function pk(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}var Mp=class extends Ea{constructor(e,r,n){super(e),this.name="StorageVectorsApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};br.StorageVectorsApiError=Mp;var qp=class extends Ea{constructor(e,r){super(e),this.name="StorageVectorsUnknownError",this.originalError=r}};br.StorageVectorsUnknownError=qp;var Hy;(function(t){t.InternalError="InternalError",t.S3VectorConflictException="S3VectorConflictException",t.S3VectorNotFoundException="S3VectorNotFoundException",t.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",t.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",t.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(Hy||(br.StorageVectorsErrorCode=Hy={}))});var Wo=x(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.validateVectorDimension=tr.normalizeToFloat32=tr.isPlainObject=tr.resolveResponse=tr.resolveFetch=void 0;var dk=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);tr.resolveFetch=dk;var hk=()=>Response;tr.resolveResponse=hk;var mk=t=>{if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};tr.isPlainObject=mk;var gk=t=>Array.from(new Float32Array(t));tr.normalizeToFloat32=gk;var Dk=(t,e)=>{if(e!==void 0&&t.float32.length!==e)throw new Error(`Vector dimension mismatch: expected ${e}, got ${t.float32.length}`)};tr.validateVectorDimension=Dk});var Du=x(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.get=wk;Yo.post=Ck;Yo.put=Ek;Yo.remove=_k;var Ko=(fe(),re(le)),mu=Go(),yk=Wo(),Vy=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),bk=(t,e,r)=>Ko.__awaiter(void 0,void 0,void 0,function*(){if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!r?.noResolveJson){let o=t.status||500,i=t;if(typeof i.json=="function")i.json().then(a=>{let s=a?.statusCode||a?.code||o+"";e(new mu.StorageVectorsApiError(Vy(a),o,s))}).catch(()=>{let a=o+"",s=i.statusText||`HTTP ${o} error`;e(new mu.StorageVectorsApiError(s,o,a))});else{let a=o+"",s=i.statusText||`HTTP ${o} error`;e(new mu.StorageVectorsApiError(s,o,a))}}else e(new mu.StorageVectorsUnknownError(Vy(t),t))}),vk=(t,e,r,n)=>{let o={method:t,headers:e?.headers||{}};return t==="GET"||!n?o:((0,yk.isPlainObject)(n)?(o.headers=Object.assign({"Content-Type":"application/json"},e?.headers),o.body=JSON.stringify(n)):o.body=n,Object.assign(Object.assign({},o),r))};function gu(t,e,r,n,o,i){return Ko.__awaiter(this,void 0,void 0,function*(){return new Promise((a,s)=>{t(r,vk(e,n,o,i)).then(u=>{if(!u.ok)throw u;if(n?.noResolveJson)return u;let c=u.headers.get("content-type");return!c||!c.includes("application/json")?{}:u.json()}).then(u=>a(u)).catch(u=>bk(u,s,n))})})}function wk(t,e,r,n){return Ko.__awaiter(this,void 0,void 0,function*(){return gu(t,"GET",e,r,n)})}function Ck(t,e,r,n,o){return Ko.__awaiter(this,void 0,void 0,function*(){return gu(t,"POST",e,n,o,r)})}function Ek(t,e,r,n,o){return Ko.__awaiter(this,void 0,void 0,function*(){return gu(t,"PUT",e,n,o,r)})}function _k(t,e,r,n,o){return Ko.__awaiter(this,void 0,void 0,function*(){return gu(t,"DELETE",e,n,o,r)})}});var zp=x(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});var yu=(fe(),re(le)),xk=hu(),bu=Go(),vu=Du(),Sk=Wo(),Hp=class{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},xk.DEFAULT_HEADERS),r),this.fetch=(0,Sk.resolveFetch)(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return yu.__awaiter(this,void 0,void 0,function*(){try{return{data:(yield(0,vu.post)(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,bu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}getIndex(e,r){return yu.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,vu.post)(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,bu.isStorageVectorsError)(n))return{data:null,error:n};throw n}})}listIndexes(e){return yu.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,vu.post)(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,bu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}deleteIndex(e,r){return yu.__awaiter(this,void 0,void 0,function*(){try{return{data:(yield(0,vu.post)(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,bu.isStorageVectorsError)(n))return{data:null,error:n};throw n}})}};Vp.default=Hp});var Kp=x(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});var _a=(fe(),re(le)),Fk=hu(),xa=Go(),Sa=Du(),Ak=Wo(),Gp=class{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Fk.DEFAULT_HEADERS),r),this.fetch=(0,Ak.resolveFetch)(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return _a.__awaiter(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield(0,Sa.post)(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,xa.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}getVectors(e){return _a.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,Sa.post)(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,xa.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}listVectors(e){return _a.__awaiter(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield(0,Sa.post)(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,xa.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}queryVectors(e){return _a.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,Sa.post)(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,xa.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}deleteVectors(e){return _a.__awaiter(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield(0,Sa.post)(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,xa.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}};Wp.default=Gp});var Xp=x(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});var wu=(fe(),re(le)),Ok=hu(),Cu=Go(),Eu=Du(),kk=Wo(),Yp=class{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Ok.DEFAULT_HEADERS),r),this.fetch=(0,kk.resolveFetch)(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return wu.__awaiter(this,void 0,void 0,function*(){try{return{data:(yield(0,Eu.post)(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Cu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}getBucket(e){return wu.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,Eu.post)(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Cu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}listBuckets(){return wu.__awaiter(this,arguments,void 0,function*(e={}){try{return{data:yield(0,Eu.post)(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Cu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return wu.__awaiter(this,void 0,void 0,function*(){try{return{data:(yield(0,Eu.post)(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Cu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}};Jp.default=Yp});var zy=x(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.VectorIndexScope=gn.VectorBucketScope=gn.StorageVectorsClient=void 0;var rr=(fe(),re(le)),$k=rr.__importDefault(zp()),Pk=rr.__importDefault(Kp()),Tk=rr.__importDefault(Xp()),Zp=class extends Tk.default{constructor(e,r={}){super(e,r.headers||{},r.fetch)}from(e){return new _u(this.url,this.headers,e,this.fetch)}};gn.StorageVectorsClient=Zp;var _u=class extends $k.default{constructor(e,r,n,o){super(e,r,o),this.vectorBucketName=n}createIndex(e){let r=Object.create(null,{createIndex:{get:()=>super.createIndex}});return rr.__awaiter(this,void 0,void 0,function*(){return r.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){let e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return rr.__awaiter(this,arguments,void 0,function*(r={}){return e.listIndexes.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){let r=Object.create(null,{getIndex:{get:()=>super.getIndex}});return rr.__awaiter(this,void 0,void 0,function*(){return r.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){let r=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return rr.__awaiter(this,void 0,void 0,function*(){return r.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new xu(this.url,this.headers,this.vectorBucketName,e,this.fetch)}};gn.VectorBucketScope=_u;var xu=class extends Pk.default{constructor(e,r,n,o,i){super(e,r,i),this.vectorBucketName=n,this.indexName=o}putVectors(e){let r=Object.create(null,{putVectors:{get:()=>super.putVectors}});return rr.__awaiter(this,void 0,void 0,function*(){return r.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){let r=Object.create(null,{getVectors:{get:()=>super.getVectors}});return rr.__awaiter(this,void 0,void 0,function*(){return r.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){let e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return rr.__awaiter(this,arguments,void 0,function*(r={}){return e.listVectors.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){let r=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return rr.__awaiter(this,void 0,void 0,function*(){return r.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){let r=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return rr.__awaiter(this,void 0,void 0,function*(){return r.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}};gn.VectorIndexScope=xu});var td=x(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.validateVectorDimension=pe.normalizeToFloat32=pe.isPlainObject=pe.resolveResponse=pe.resolveFetch=pe.isStorageVectorsError=pe.StorageVectorsErrorCode=pe.StorageVectorsUnknownError=pe.StorageVectorsApiError=pe.StorageVectorsError=pe.VectorDataApi=pe.VectorIndexApi=pe.VectorBucketApi=pe.VectorIndexScope=pe.VectorBucketScope=pe.StorageVectorsClient=void 0;var Qp=(fe(),re(le)),ed=zy();Object.defineProperty(pe,"StorageVectorsClient",{enumerable:!0,get:function(){return ed.StorageVectorsClient}});Object.defineProperty(pe,"VectorBucketScope",{enumerable:!0,get:function(){return ed.VectorBucketScope}});Object.defineProperty(pe,"VectorIndexScope",{enumerable:!0,get:function(){return ed.VectorIndexScope}});var Ik=Xp();Object.defineProperty(pe,"VectorBucketApi",{enumerable:!0,get:function(){return Qp.__importDefault(Ik).default}});var Rk=zp();Object.defineProperty(pe,"VectorIndexApi",{enumerable:!0,get:function(){return Qp.__importDefault(Rk).default}});var Bk=Kp();Object.defineProperty(pe,"VectorDataApi",{enumerable:!0,get:function(){return Qp.__importDefault(Bk).default}});var Fa=Go();Object.defineProperty(pe,"StorageVectorsError",{enumerable:!0,get:function(){return Fa.StorageVectorsError}});Object.defineProperty(pe,"StorageVectorsApiError",{enumerable:!0,get:function(){return Fa.StorageVectorsApiError}});Object.defineProperty(pe,"StorageVectorsUnknownError",{enumerable:!0,get:function(){return Fa.StorageVectorsUnknownError}});Object.defineProperty(pe,"StorageVectorsErrorCode",{enumerable:!0,get:function(){return Fa.StorageVectorsErrorCode}});Object.defineProperty(pe,"isStorageVectorsError",{enumerable:!0,get:function(){return Fa.isStorageVectorsError}});var Aa=Wo();Object.defineProperty(pe,"resolveFetch",{enumerable:!0,get:function(){return Aa.resolveFetch}});Object.defineProperty(pe,"resolveResponse",{enumerable:!0,get:function(){return Aa.resolveResponse}});Object.defineProperty(pe,"isPlainObject",{enumerable:!0,get:function(){return Aa.isPlainObject}});Object.defineProperty(pe,"normalizeToFloat32",{enumerable:!0,get:function(){return Aa.normalizeToFloat32}});Object.defineProperty(pe,"validateVectorDimension",{enumerable:!0,get:function(){return Aa.validateVectorDimension}})});var Gy=x(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.StorageClient=void 0;var nd=(fe(),re(le)),jk=nd.__importDefault(My()),Nk=nd.__importDefault(qy()),Lk=nd.__importDefault(Up()),Uk=td(),rd=class extends Nk.default{constructor(e,r={},n,o){super(e,r,n,o)}from(e){return new jk.default(this.url,this.headers,e,this.fetch)}get vectors(){return new Uk.StorageVectorsClient(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Lk.default(this.url+"/iceberg",this.headers,this.fetch)}};Su.StorageClient=rd});var Ky=x(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0})});var Yy=x(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.StorageAnalyticsApi=Gr.StorageClient=void 0;var Fu=(fe(),re(le)),Mk=Gy();Object.defineProperty(Gr,"StorageClient",{enumerable:!0,get:function(){return Mk.StorageClient}});var qk=Up();Object.defineProperty(Gr,"StorageAnalyticsApi",{enumerable:!0,get:function(){return Fu.__importDefault(qk).default}});Fu.__exportStar(Ky(),Gr);Fu.__exportStar(mn(),Gr);Fu.__exportStar(td(),Gr)});var Jy=x(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.version=void 0;Au.version="2.79.0"});var Xy=x(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.DEFAULT_REALTIME_OPTIONS=Vt.DEFAULT_AUTH_OPTIONS=Vt.DEFAULT_DB_OPTIONS=Vt.DEFAULT_GLOBAL_OPTIONS=Vt.DEFAULT_HEADERS=void 0;var Hk=Jy(),Oa="";typeof Deno<"u"?Oa="deno":typeof document<"u"?Oa="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Oa="react-native":Oa="node";Vt.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${Oa}/${Hk.version}`};Vt.DEFAULT_GLOBAL_OPTIONS={headers:Vt.DEFAULT_HEADERS};Vt.DEFAULT_DB_OPTIONS={schema:"public"};Vt.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};Vt.DEFAULT_REALTIME_OPTIONS={}});var Zy=x(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.fetchWithAuth=xr.resolveHeadersConstructor=xr.resolveFetch=void 0;var Vk=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);xr.resolveFetch=Vk;var zk=()=>Headers;xr.resolveHeadersConstructor=zk;var Gk=(t,e,r)=>{let n=(0,xr.resolveFetch)(r),o=(0,xr.resolveHeadersConstructor)();return async(i,a)=>{var s;let u=(s=await e())!==null&&s!==void 0?s:t,c=new o(a?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(i,Object.assign(Object.assign({},a),{headers:c}))}};xr.fetchWithAuth=Gk});var e0=x(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.isBrowser=void 0;Dn.uuid=Wk;Dn.ensureTrailingSlash=Qy;Dn.applySettingDefaults=Yk;Dn.validateSupabaseUrl=Jk;function Wk(){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)})}function Qy(t){return t.endsWith("/")?t:t+"/"}var Kk=()=>typeof window<"u";Dn.isBrowser=Kk;function Yk(t,e){var r,n;let{db:o,auth:i,realtime:a,global:s}=t,{db:u,auth:c,realtime:l,global:f}=e,d={db:Object.assign(Object.assign({},u),o),auth:Object.assign(Object.assign({},c),i),realtime:Object.assign(Object.assign({},l),a),storage:{},global:Object.assign(Object.assign(Object.assign({},f),s),{headers:Object.assign(Object.assign({},(r=f?.headers)!==null&&r!==void 0?r:{}),(n=s?.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return t.accessToken?d.accessToken=t.accessToken:delete d.accessToken,d}function Jk(t){let e=t?.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Qy(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}});var gd={};qr(gd,{AuthAdminApi:()=>id,AuthApiError:()=>ad,AuthClient:()=>od,AuthError:()=>vr,AuthImplicitGrantRedirectError:()=>fd,AuthInvalidCredentialsError:()=>ld,AuthInvalidTokenResponseError:()=>cd,AuthPKCEGrantCodeExchangeError:()=>pd,AuthRetryableError:()=>sd,AuthSessionMissingError:()=>ud,AuthWeakPasswordError:()=>dd,GoTrueAdminApi:()=>ku,GoTrueClient:()=>Ou,NavigatorLockAcquireTimeoutError:()=>hd,isAuthApiError:()=>t3,isAuthError:()=>e3,isAuthRetryableError:()=>r3,isAuthSessionMissingError:()=>n3,isAuthWeakPasswordError:()=>o3,lockInternals:()=>Qk,navigatorLock:()=>Xk,processLock:()=>Zk});var md,t0,Ou,ku,od,id,vr,ad,sd,ud,cd,ld,fd,pd,dd,Xk,Zk,hd,Qk,e3,t3,r3,n3,o3,Dd=tt(()=>{md=()=>Promise.resolve({data:{session:null,user:null},error:null}),t0={get:(t,e)=>{if(e==="constructor")return t.constructor;if(!(e==="then"||e==="catch"||e==="finally")&&typeof e!="symbol")return e==="getSession"?()=>Promise.resolve({data:{session:null,user:null},error:null}):e==="onAuthStateChange"?()=>({data:{subscription:{unsubscribe:()=>{}}},error:null}):md}},Ou=class{constructor(e){return this.options=e,new Proxy(this,t0)}},ku=class{constructor(e){return this.options=e,new Proxy(this,t0)}},od=class extends Ou{},id=class extends ku{},vr=class extends Error{},ad=class extends vr{},sd=class extends vr{},ud=class extends vr{},cd=class extends vr{},ld=class extends vr{},fd=class extends vr{},pd=class extends vr{},dd=class extends vr{},Xk=md,Zk=md,hd=class extends Error{},Qk={},e3=()=>!1,t3=()=>!1,r3=()=>!1,n3=()=>!1,o3=()=>!1});var r0=x($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.SupabaseAuthClient=void 0;var i3=(Dd(),re(gd)),yd=class extends i3.AuthClient{constructor(e){super(e)}};$u.SupabaseAuthClient=yd});var wd=x(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var a3=ep(),s3=Dp(),u3=(vp(),re(bp)),c3=Yy(),Pu=Xy(),l3=Zy(),n0=e0(),f3=r0(),bd=class{constructor(e,r,n){var o,i,a;this.supabaseUrl=e,this.supabaseKey=r;let s=(0,n0.validateSupabaseUrl)(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);let u=`sb-${s.hostname.split(".")[0]}-auth-token`,c={db:Pu.DEFAULT_DB_OPTIONS,realtime:Pu.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Pu.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Pu.DEFAULT_GLOBAL_OPTIONS},l=(0,n0.applySettingDefaults)(n??{},c);this.storageKey=(o=l.auth.storageKey)!==null&&o!==void 0?o:"",this.headers=(i=l.global.headers)!==null&&i!==void 0?i:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((a=l.auth)!==null&&a!==void 0?a:{},this.headers,l.global.fetch),this.fetch=(0,l3.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.rest=new s3.PostgrestClient(new URL("rest/v1",s).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new c3.StorageClient(this.storageUrl.href,this.headers,this.fetch,n?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new a3.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){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()}async _getAccessToken(){var e,r;if(this.accessToken)return await this.accessToken();let{data:n}=await this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:o,userStorage:i,storageKey:a,flowType:s,lock:u,debug:c,throwOnError:l},f,d){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new f3.SupabaseAuthClient({url:this.authUrl.href,headers:Object.assign(Object.assign({},h),f),storageKey:a,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:o,userStorage:i,flowType:s,lock:u,debug:c,throwOnError:l,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new u3.RealtimeClient(this.realtimeUrl.href,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.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};vd.default=bd});var a0=x(Ie=>{"use strict";var p3=Ie&&Ie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),o0=Ie&&Ie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p3(e,t,r)},i0=Ie&&Ie.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.createClient=Ie.SupabaseClient=Ie.FunctionRegion=Ie.FunctionsError=Ie.FunctionsRelayError=Ie.FunctionsFetchError=Ie.FunctionsHttpError=Ie.PostgrestError=void 0;var d3=i0(wd());o0((Dd(),re(gd)),Ie);var h3=Dp();Object.defineProperty(Ie,"PostgrestError",{enumerable:!0,get:function(){return h3.PostgrestError}});var ka=ep();Object.defineProperty(Ie,"FunctionsHttpError",{enumerable:!0,get:function(){return ka.FunctionsHttpError}});Object.defineProperty(Ie,"FunctionsFetchError",{enumerable:!0,get:function(){return ka.FunctionsFetchError}});Object.defineProperty(Ie,"FunctionsRelayError",{enumerable:!0,get:function(){return ka.FunctionsRelayError}});Object.defineProperty(Ie,"FunctionsError",{enumerable:!0,get:function(){return ka.FunctionsError}});Object.defineProperty(Ie,"FunctionRegion",{enumerable:!0,get:function(){return ka.FunctionRegion}});o0((vp(),re(bp)),Ie);var m3=wd();Object.defineProperty(Ie,"SupabaseClient",{enumerable:!0,get:function(){return i0(m3).default}});var g3=(t,e,r)=>new d3.default(t,e,r);Ie.createClient=g3;function D3(){if(typeof window<"u"||typeof process>"u")return!1;let t=process.version;if(t==null)return!1;let e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}D3()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217")});var Cd=x((lV,s0)=>{s0.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 Tu=x(c0=>{var u0={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 y3(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(u0))c0[t]=y3(u0[t])});var h0=x((pV,d0)=>{var b3=require("fs"),rt=require("path"),l0=Cd(),v3=Tu(),w3=typeof process=="object"&&process.platform==="win32",f0=t=>typeof t=="object"&&t!==null,p0=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=3988292384^e>>>1:e>>>=1;return e>>>0});function We(t){this.sep=rt.sep,this.fs=b3,f0(t)&&f0(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}d0.exports=We;We.prototype.makeDir=function(t){let e=this;function r(n){let o=n.split(e.sep)[0];n.split(e.sep).forEach(function(i){if(!(!i||i.substr(-1,1)===":")){o+=e.sep+i;var a;try{a=e.fs.statSync(o)}catch{e.fs.mkdirSync(o)}if(a&&a.isFile())throw v3.FILE_IN_THE_WAY(`"${o}"`)}})}r(t)};We.prototype.writeFileTo=function(t,e,r,n){let o=this;if(o.fs.existsSync(t)){if(!r)return!1;var i=o.fs.statSync(t);if(i.isDirectory())return!1}var a=rt.dirname(t);o.fs.existsSync(a)||o.makeDir(a);var s;try{s=o.fs.openSync(t,"w",438)}catch{o.fs.chmodSync(t,438),s=o.fs.openSync(t,"w",438)}if(s)try{o.fs.writeSync(s,e,0,e.length,0)}finally{o.fs.closeSync(s)}return o.fs.chmodSync(t,n||438),!0};We.prototype.writeFileToAsync=function(t,e,r,n,o){typeof n=="function"&&(o=n,n=void 0);let i=this;i.fs.exists(t,function(a){if(a&&!r)return o(!1);i.fs.stat(t,function(s,u){if(a&&u.isDirectory())return o(!1);var c=rt.dirname(t);i.fs.exists(c,function(l){l||i.makeDir(c),i.fs.open(t,"w",438,function(f,d){f?i.fs.chmod(t,438,function(){i.fs.open(t,"w",438,function(h,m){i.fs.write(m,e,0,e.length,0,function(){i.fs.close(m,function(){i.fs.chmod(t,n||438,function(){o(!0)})})})})}):d?i.fs.write(d,e,0,e.length,0,function(){i.fs.close(d,function(){i.fs.chmod(t,n||438,function(){o(!0)})})}):i.fs.chmod(t,n||438,function(){o(!0)})})})})})};We.prototype.findFiles=function(t){let e=this;function r(n,o,i){typeof o=="boolean"&&(i=o,o=void 0);let a=[];return e.fs.readdirSync(n).forEach(function(s){let u=rt.join(n,s),c=e.fs.statSync(u);(!o||o.test(u))&&a.push(rt.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&i&&(a=a.concat(r(u,o,i)))}),a}return r(t,void 0,!0)};We.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(o,i){if(o)return e(o);let a=i.length;if(!a)return e(null,n);i.forEach(function(s){s=rt.join(t,s),r.fs.stat(s,function(u,c){if(u)return e(u);c&&(n.push(rt.normalize(s)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(s,function(l,f){if(l)return e(l);n=n.concat(f),--a||e(null,n)}):--a||e(null,n))})})})};We.prototype.getAttributes=function(){};We.prototype.setAttributes=function(){};We.crc32update=function(t,e){return p0[(t^e)&255]^t>>>8};We.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=We.crc32update(r,t[n++]);return~r>>>0};We.methodToString=function(t){switch(t){case l0.STORED:return"STORED ("+t+")";case l0.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};We.canonical=function(t){if(!t)return"";let e=rt.posix.normalize("/"+t.split("\\").join("/"));return rt.join(".",e)};We.zipnamefix=function(t){if(!t)return"";let e=rt.posix.normalize("/"+t.split("\\").join("/"));return rt.posix.join(".",e)};We.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]};We.sanitize=function(t,e){t=rt.resolve(rt.normalize(t));for(var r=e.split("/"),n=0,o=r.length;n<o;n++){var i=rt.normalize(rt.join(t,r.slice(n,o).join(rt.sep)));if(i.indexOf(t)===0)return i}return rt.normalize(rt.join(t,rt.basename(e)))};We.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};We.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};We.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)};We.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};We.isWin=w3;We.crcTable=p0});var g0=x((dV,m0)=>{var C3=require("path");m0.exports=function(t,{fs:e}){var r=t||"",n=i(),o=null;function i(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(o=e.statSync(r),n.directory=o.isDirectory(),n.mtime=o.mtime,n.atime=o.atime,n.executable=(73&o.mode)!==0,n.readonly=(128&o.mode)===0,n.hidden=C3.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 y0=x((hV,D0)=>{D0.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var Xo=x((mV,Jo)=>{Jo.exports=h0();Jo.exports.Constants=Cd();Jo.exports.Errors=Tu();Jo.exports.FileAttr=g0();Jo.exports.decoder=y0()});var v0=x((gV,b0)=>{var yn=Xo(),W=yn.Constants;b0.exports=function(){var t=20,e=10,r=0,n=0,o=0,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,h=0,m=0;t|=yn.isWin?2560:768,r|=W.FLG_EFS;let b={extraLen:0},D=g=>Math.max(0,g)>>>0,C=g=>Math.max(0,g)&65535,E=g=>Math.max(0,g)&255;return o=yn.fromDate2DOS(new Date),{get made(){return t},set made(g){t=g},get version(){return e},set version(g){e=g},get flags(){return r},set flags(g){r=g},get flags_efs(){return(r&W.FLG_EFS)>0},set flags_efs(g){g?r|=W.FLG_EFS:r&=~W.FLG_EFS},get flags_desc(){return(r&W.FLG_DESC)>0},set flags_desc(g){g?r|=W.FLG_DESC:r&=~W.FLG_DESC},get method(){return n},set method(g){switch(g){case W.STORED:this.version=10;case W.DEFLATED:default:this.version=20}n=g},get time(){return yn.fromDOS2Date(this.timeval)},set time(g){this.timeval=yn.fromDate2DOS(g)},get timeval(){return o},set timeval(g){o=D(g)},get timeHighByte(){return E(o>>>8)},get crc(){return i},set crc(g){i=D(g)},get compressedSize(){return a},set compressedSize(g){a=D(g)},get size(){return s},set size(g){s=D(g)},get fileNameLength(){return u},set fileNameLength(g){u=g},get extraLength(){return c},set extraLength(g){c=g},get extraLocalLength(){return b.extraLen},set extraLocalLength(g){b.extraLen=g},get commentLength(){return l},set commentLength(g){l=g},get diskNumStart(){return f},set diskNumStart(g){f=D(g)},get inAttr(){return d},set inAttr(g){d=D(g)},get attr(){return h},set attr(g){h=D(g)},get fileAttr(){return(h||0)>>16&4095},get offset(){return m},set offset(g){m=D(g)},get encrypted(){return(r&W.FLG_ENC)===W.FLG_ENC},get centralHeaderSize(){return W.CENHDR+u+c+l},get realDataOffset(){return m+W.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(g){var _=g.slice(m,m+W.LOCHDR);if(_.readUInt32LE(0)!==W.LOCSIG)throw yn.Errors.INVALID_LOC();b.version=_.readUInt16LE(W.LOCVER),b.flags=_.readUInt16LE(W.LOCFLG),b.method=_.readUInt16LE(W.LOCHOW),b.time=_.readUInt32LE(W.LOCTIM),b.crc=_.readUInt32LE(W.LOCCRC),b.compressedSize=_.readUInt32LE(W.LOCSIZ),b.size=_.readUInt32LE(W.LOCLEN),b.fnameLen=_.readUInt16LE(W.LOCNAM),b.extraLen=_.readUInt16LE(W.LOCEXT);let S=m+W.LOCHDR+b.fnameLen,T=S+b.extraLen;return g.slice(S,T)},loadFromBinary:function(g){if(g.length!==W.CENHDR||g.readUInt32LE(0)!==W.CENSIG)throw yn.Errors.INVALID_CEN();t=g.readUInt16LE(W.CENVEM),e=g.readUInt16LE(W.CENVER),r=g.readUInt16LE(W.CENFLG),n=g.readUInt16LE(W.CENHOW),o=g.readUInt32LE(W.CENTIM),i=g.readUInt32LE(W.CENCRC),a=g.readUInt32LE(W.CENSIZ),s=g.readUInt32LE(W.CENLEN),u=g.readUInt16LE(W.CENNAM),c=g.readUInt16LE(W.CENEXT),l=g.readUInt16LE(W.CENCOM),f=g.readUInt16LE(W.CENDSK),d=g.readUInt16LE(W.CENATT),h=g.readUInt32LE(W.CENATX),m=g.readUInt32LE(W.CENOFF)},localHeaderToBinary:function(){var g=Buffer.alloc(W.LOCHDR);return g.writeUInt32LE(W.LOCSIG,0),g.writeUInt16LE(e,W.LOCVER),g.writeUInt16LE(r,W.LOCFLG),g.writeUInt16LE(n,W.LOCHOW),g.writeUInt32LE(o,W.LOCTIM),g.writeUInt32LE(i,W.LOCCRC),g.writeUInt32LE(a,W.LOCSIZ),g.writeUInt32LE(s,W.LOCLEN),g.writeUInt16LE(u,W.LOCNAM),g.writeUInt16LE(b.extraLen,W.LOCEXT),g},centralHeaderToBinary:function(){var g=Buffer.alloc(W.CENHDR+u+c+l);return g.writeUInt32LE(W.CENSIG,0),g.writeUInt16LE(t,W.CENVEM),g.writeUInt16LE(e,W.CENVER),g.writeUInt16LE(r,W.CENFLG),g.writeUInt16LE(n,W.CENHOW),g.writeUInt32LE(o,W.CENTIM),g.writeUInt32LE(i,W.CENCRC),g.writeUInt32LE(a,W.CENSIZ),g.writeUInt32LE(s,W.CENLEN),g.writeUInt16LE(u,W.CENNAM),g.writeUInt16LE(c,W.CENEXT),g.writeUInt16LE(l,W.CENCOM),g.writeUInt16LE(f,W.CENDSK),g.writeUInt16LE(d,W.CENATT),g.writeUInt32LE(h,W.CENATX),g.writeUInt32LE(m,W.CENOFF),g},toJSON:function(){let g=function(_){return _+" bytes"};return{made:t,version:e,flags:r,method:yn.methodToString(n),time:this.time,crc:"0x"+i.toString(16).toUpperCase(),compressedSize:g(a),size:g(s),fileNameLength:g(u),extraLength:g(c),commentLength:g(l),diskNumStart:f,inAttr:d,attr:h,offset:m,centralHeaderSize:g(W.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var C0=x((DV,w0)=>{var Zo=Xo(),He=Zo.Constants;w0.exports=function(){var t=0,e=0,r=0,n=0,o=0;return{get diskEntries(){return t},set diskEntries(i){t=e=i},get totalEntries(){return e},set totalEntries(i){e=t=i},get size(){return r},set size(i){r=i},get offset(){return n},set offset(i){n=i},get commentLength(){return o},set commentLength(i){o=i},get mainHeaderSize(){return He.ENDHDR+o},loadFromBinary:function(i){if((i.length!==He.ENDHDR||i.readUInt32LE(0)!==He.ENDSIG)&&(i.length<He.ZIP64HDR||i.readUInt32LE(0)!==He.ZIP64SIG))throw Zo.Errors.INVALID_END();i.readUInt32LE(0)===He.ENDSIG?(t=i.readUInt16LE(He.ENDSUB),e=i.readUInt16LE(He.ENDTOT),r=i.readUInt32LE(He.ENDSIZ),n=i.readUInt32LE(He.ENDOFF),o=i.readUInt16LE(He.ENDCOM)):(t=Zo.readBigUInt64LE(i,He.ZIP64SUB),e=Zo.readBigUInt64LE(i,He.ZIP64TOT),r=Zo.readBigUInt64LE(i,He.ZIP64SIZE),n=Zo.readBigUInt64LE(i,He.ZIP64OFF),o=0)},toBinary:function(){var i=Buffer.alloc(He.ENDHDR+o);return i.writeUInt32LE(He.ENDSIG,0),i.writeUInt32LE(0,4),i.writeUInt16LE(t,He.ENDSUB),i.writeUInt16LE(e,He.ENDTOT),i.writeUInt32LE(r,He.ENDSIZ),i.writeUInt32LE(n,He.ENDOFF),i.writeUInt16LE(o,He.ENDCOM),i.fill(" ",He.ENDHDR),i},toJSON:function(){let i=function(a,s){let u=a.toString(16).toUpperCase();for(;u.length<s;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:i(n,4),commentLength:o}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var _d=x(Ed=>{Ed.EntryHeader=v0();Ed.MainHeader=C0()});var _0=x((bV,E0)=>{E0.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 o=e.createDeflateRaw(r),i=[],a=0;o.on("data",function(s){i.push(s),a+=s.length}),o.on("end",function(){var s=Buffer.alloc(a),u=0;s.fill(0);for(var c=0;c<i.length;c++){var l=i[c];l.copy(s,u),u+=l.length}n&&n(s)}),o.end(t)}}}});var S0=x((vV,x0)=>{var E3=+(process.versions?process.versions.node:"").split(".")[0]||0;x0.exports=function(t,e){var r=require("zlib");let n=E3>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(o){var i=r.createInflateRaw(n),a=[],s=0;i.on("data",function(u){a.push(u),s+=u.length}),i.on("end",function(){var u=Buffer.alloc(s),c=0;u.fill(0);for(var l=0;l<a.length;l++){var f=a[l];f.copy(u,c),c+=f.length}o&&o(u)}),i.end(t)}}}});var $0=x((wV,k0)=>{"use strict";var{randomFillSync:F0}=require("crypto"),_3=Tu(),x3=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=e>>>1^3988292384:e>>>=1;return e>>>0}),O0=(t,e)=>Math.imul(t,e)>>>0,A0=(t,e)=>x3[(t^e)&255]^t>>>8,$a=()=>typeof F0=="function"?F0(Buffer.alloc(12)):$a.node();$a.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 Iu={genSalt:$a};function Ru(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])}Ru.prototype.updateKeys=function(t){let e=this.keys;return e[0]=A0(e[0],t),e[1]+=e[0]&255,e[1]=O0(e[1],134775813)+1,e[2]=A0(e[2],e[1]>>>24),t};Ru.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return O0(t,t^1)>>8&255};function S3(t){let e=new Ru(t);return function(r){let n=Buffer.alloc(r.length),o=0;for(let i of r)n[o++]=e.updateKeys(i^e.next());return n}}function F3(t){let e=new Ru(t);return function(r,n,o=0){n||(n=Buffer.alloc(r.length));for(let i of r){let a=e.next();n[o++]=i^a,e.updateKeys(i)}return n}}function A3(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=S3(r),o=n(t.slice(0,12)),i=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(o[11]!==i)throw _3.WRONG_PASSWORD();return n(t.slice(12))}function O3(t){Buffer.isBuffer(t)&&t.length>=12?Iu.genSalt=function(){return t.slice(0,12)}:t==="node"?Iu.genSalt=$a.node:Iu.genSalt=$a}function k3(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let o=F3(r),i=Iu.genSalt();i[11]=e.crc>>>24&255,n&&(i[10]=e.crc>>>16&255);let a=Buffer.alloc(t.length+12);return o(i,a),o(t,a,12)}k0.exports={decrypt:A3,encrypt:k3,_salter:O3}});var P0=x(Bu=>{Bu.Deflater=_0();Bu.Inflater=S0();Bu.ZipCrypto=$0()});var Sd=x((EV,T0)=>{var xe=Xo(),$3=_d(),Ke=xe.Constants,xd=P0();T0.exports=function(t,e){var r=new $3.EntryHeader,n=Buffer.alloc(0),o=Buffer.alloc(0),i=!1,a=null,s=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,f=typeof l.decoder=="object"?l.decoder:xe.decoder;c=f.hasOwnProperty("efs")?f.efs:!1;function d(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function h(g){if(r.flags_desc){let _={},S=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(S)==Ke.LOCSIG||e.readUInt32LE(S)==Ke.CENSIG)throw xe.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(S)==Ke.EXTSIG)_.crc=e.readUInt32LE(S+Ke.EXTCRC),_.compressedSize=e.readUInt32LE(S+Ke.EXTSIZ),_.size=e.readUInt32LE(S+Ke.EXTLEN);else if(e.readUInt16LE(S+12)===19280)_.crc=e.readUInt32LE(S+Ke.EXTCRC-4),_.compressedSize=e.readUInt32LE(S+Ke.EXTSIZ-4),_.size=e.readUInt32LE(S+Ke.EXTLEN-4);else throw xe.Errors.DESCRIPTOR_UNKNOWN();if(_.compressedSize!==r.compressedSize||_.size!==r.size||_.crc!==r.crc)throw xe.Errors.DESCRIPTOR_FAULTY();if(xe.crc32(g)!==_.crc)return!1}else if(xe.crc32(g)!==r.localHeader.crc)return!1;return!0}function m(g,_,S){if(typeof _>"u"&&typeof g=="string"&&(S=g,g=void 0),i)return g&&_&&_(Buffer.alloc(0),xe.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var T=d();if(T.length===0)return g&&_&&_(T),T;if(r.encrypted){if(typeof S!="string"&&!Buffer.isBuffer(S))throw xe.Errors.INVALID_PASS_PARAM();T=xd.ZipCrypto.decrypt(T,r,S)}var k=Buffer.alloc(r.size);switch(r.method){case xe.Constants.STORED:if(T.copy(k),h(k))return g&&_&&_(k),k;throw g&&_&&_(k,xe.Errors.BAD_CRC()),xe.Errors.BAD_CRC();case xe.Constants.DEFLATED:var B=new xd.Inflater(T,r.size);if(g)B.inflateAsync(function(R){R.copy(R,0),_&&(h(R)?_(R):_(R,xe.Errors.BAD_CRC()))});else{if(B.inflate(k).copy(k,0),!h(k))throw xe.Errors.BAD_CRC(`"${f.decode(n)}"`);return k}break;default:throw g&&_&&_(Buffer.alloc(0),xe.Errors.UNKNOWN_METHOD()),xe.Errors.UNKNOWN_METHOD()}}function b(g,_){if((!a||!a.length)&&Buffer.isBuffer(e))return g&&_&&_(d()),d();if(a.length&&!i){var S;switch(r.method){case xe.Constants.STORED:return r.compressedSize=r.size,S=Buffer.alloc(a.length),a.copy(S),g&&_&&_(S),S;default:case xe.Constants.DEFLATED:var T=new xd.Deflater(a);if(g)T.deflateAsync(function(B){S=Buffer.alloc(B.length),r.compressedSize=B.length,B.copy(S),_&&_(S)});else{var k=T.deflate();return r.compressedSize=k.length,k}T=null;break}}else if(g&&_)_(Buffer.alloc(0));else return Buffer.alloc(0)}function D(g,_){return(g.readUInt32LE(_+4)<<4)+g.readUInt32LE(_)}function C(g){try{for(var _=0,S,T,k;_+4<g.length;)S=g.readUInt16LE(_),_+=2,T=g.readUInt16LE(_),_+=2,k=g.slice(_,_+T),_+=T,Ke.ID_ZIP64===S&&E(k)}catch{throw xe.Errors.EXTRA_FIELD_PARSE_ERROR()}}function E(g){var _,S,T,k;g.length>=Ke.EF_ZIP64_SCOMP&&(_=D(g,Ke.EF_ZIP64_SUNCOMP),r.size===Ke.EF_ZIP64_OR_32&&(r.size=_)),g.length>=Ke.EF_ZIP64_RHO&&(S=D(g,Ke.EF_ZIP64_SCOMP),r.compressedSize===Ke.EF_ZIP64_OR_32&&(r.compressedSize=S)),g.length>=Ke.EF_ZIP64_DSN&&(T=D(g,Ke.EF_ZIP64_RHO),r.offset===Ke.EF_ZIP64_OR_32&&(r.offset=T)),g.length>=Ke.EF_ZIP64_DSN+4&&(k=g.readUInt32LE(Ke.EF_ZIP64_DSN),r.diskNumStart===Ke.EF_ZIP64_OR_16&&(r.diskNumStart=k))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(g){n=xe.toBuffer(g,f.encode);var _=n[n.length-1];i=_===47||_===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return s},set extra(g){s=g,r.extraLength=g.length,C(g)},get comment(){return f.decode(o)},set comment(g){if(o=xe.toBuffer(g,f.encode),r.commentLength=o.length,o.length>65535)throw xe.Errors.COMMENT_TOO_LONG()},get name(){var g=f.decode(n);return i?g.substr(g.length-1).split("/").pop():g.split("/").pop()},get isDirectory(){return i},getCompressedData:function(){return b(!1,null)},getCompressedDataAsync:function(g){b(!0,g)},setData:function(g){a=xe.toBuffer(g,xe.decoder.encode),!i&&a.length?(r.size=a.length,r.method=xe.Constants.DEFLATED,r.crc=xe.crc32(g),r.changed=!0):r.method=xe.Constants.STORED},getData:function(g){return r.changed?a:m(!1,null,g)},getDataAsync:function(g,_){r.changed?g(a):m(!0,g,_)},set attr(g){r.attr=g},get attr(){return r.attr},set header(g){r.loadFromBinary(g)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=s.length;var g=r.centralHeaderToBinary(),_=xe.Constants.CENHDR;return n.copy(g,_),_+=n.length,s.copy(g,_),_+=r.extraLength,o.copy(g,_),g},packLocalHeader:function(){let g=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let _=r.localHeaderToBinary(),S=Buffer.alloc(_.length+n.length+r.extraLocalLength);return _.copy(S,g),g+=_.length,n.copy(S,g),g+=n.length,u.copy(S,g),g+=u.length,S},toJSON:function(){let g=function(_){return"<"+(_&&_.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:g(e),data:g(a)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var B0=x((_V,R0)=>{var I0=Sd(),P3=_d(),pt=Xo();R0.exports=function(t,e){var r=[],n={},o=Buffer.alloc(0),i=new P3.MainHeader,a=!1,s=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?m(c.readEntries):a=!0;function d(){let D=new Set;for(let C of Object.keys(n)){let E=C.split("/");if(E.pop(),!!E.length)for(let g=0;g<E.length;g++){let _=E.slice(0,g+1).join("/")+"/";D.add(_)}}for(let C of D)if(!(C in n)){let E=new I0(c);E.entryName=C,E.attr=16,E.temporary=!0,r.push(E),n[E.entryName]=E,u.add(E)}}function h(){if(a=!0,n={},i.diskEntries>(t.length-i.offset)/pt.Constants.CENHDR)throw pt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(i.diskEntries);for(var D=i.offset,C=0;C<r.length;C++){var E=D,g=new I0(c,t);g.header=t.slice(E,E+=pt.Constants.CENHDR),g.entryName=t.slice(E,E+=g.header.fileNameLength),g.header.extraLength&&(g.extra=t.slice(E,E+=g.header.extraLength)),g.header.commentLength&&(g.comment=t.slice(E,E+g.header.commentLength)),D+=g.header.centralHeaderSize,r[C]=g,n[g.entryName]=g}u.clear(),d()}function m(D){var C=t.length-pt.Constants.ENDHDR,E=Math.max(0,C-65535),g=E,_=t.length,S=-1,T=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(E=0),C;C>=g;C--)if(t[C]===80){if(t.readUInt32LE(C)===pt.Constants.ENDSIG){S=C,T=C,_=C+pt.Constants.ENDHDR,g=C-pt.Constants.END64HDR;continue}if(t.readUInt32LE(C)===pt.Constants.END64SIG){g=E;continue}if(t.readUInt32LE(C)===pt.Constants.ZIP64SIG){S=C,_=C+pt.readBigUInt64LE(t,C+pt.Constants.ZIP64SIZE)+pt.Constants.ZIP64LEAD;break}}if(S==-1)throw pt.Errors.INVALID_FORMAT();i.loadFromBinary(t.slice(S,_)),i.commentLength&&(o=t.slice(T+pt.Constants.ENDHDR)),D&&h()}function b(){r.length>1&&!l&&r.sort((D,C)=>D.entryName.toLowerCase().localeCompare(C.entryName.toLowerCase()))}return{get entries(){return a||h(),r.filter(D=>!u.has(D))},get comment(){return f.decode(o)},set comment(D){o=pt.toBuffer(D,f.encode),i.commentLength=o.length},getEntryCount:function(){return a?r.length:i.diskEntries},forEach:function(D){this.entries.forEach(D)},getEntry:function(D){return a||h(),n[D]||null},setEntry:function(D){a||h(),r.push(D),n[D.entryName]=D,i.totalEntries=r.length},deleteFile:function(D,C=!0){a||h();let E=n[D];this.getEntryChildren(E,C).map(_=>_.entryName).forEach(this.deleteEntry)},deleteEntry:function(D){a||h();let C=n[D],E=r.indexOf(C);E>=0&&(r.splice(E,1),delete n[D],i.totalEntries=r.length)},getEntryChildren:function(D,C=!0){if(a||h(),typeof D=="object")if(D.isDirectory&&C){let E=[],g=D.entryName;for(let _ of r)_.entryName.startsWith(g)&&E.push(_);return E}else return[D];return[]},getChildCount:function(D){if(D&&D.isDirectory){let C=this.getEntryChildren(D);return C.includes(D)?C.length-1:C.length}return 0},compressToBuffer:function(){a||h(),b();let D=[],C=[],E=0,g=0;i.size=0,i.offset=0;let _=0;for(let k of this.entries){let B=k.getCompressedData();k.header.offset=g;let R=k.packLocalHeader(),N=R.length+B.length;g+=N,D.push(R),D.push(B);let A=k.packCentralHeader();C.push(A),i.size+=A.length,E+=N+A.length,_++}E+=i.mainHeaderSize,i.offset=g,i.totalEntries=_,g=0;let S=Buffer.alloc(E);for(let k of D)k.copy(S,g),g+=k.length;for(let k of C)k.copy(S,g),g+=k.length;let T=i.toBinary();return o&&o.copy(T,pt.Constants.ENDHDR),T.copy(S,g),t=S,a=!1,S},toAsyncBuffer:function(D,C,E,g){try{a||h(),b();let _=[],S=[],T=0,k=0,B=0;i.size=0,i.offset=0;let R=function(N){if(N.length>0){let A=N.shift(),U=A.entryName+A.extra.toString();E&&E(U),A.getCompressedDataAsync(function(M){g&&g(U),A.header.offset=k;let Q=A.packLocalHeader(),$=Q.length+M.length;k+=$,_.push(Q),_.push(M);let y=A.packCentralHeader();S.push(y),i.size+=y.length,T+=$+y.length,B++,R(N)})}else{T+=i.mainHeaderSize,i.offset=k,i.totalEntries=B,k=0;let A=Buffer.alloc(T);_.forEach(function(M){M.copy(A,k),k+=M.length}),S.forEach(function(M){M.copy(A,k),k+=M.length});let U=i.toBinary();o&&o.copy(U,pt.Constants.ENDHDR),U.copy(A,k),t=A,a=!1,D(A)}};R(Array.from(this.entries))}catch(_){C(_)}}}}});var L0=x((xV,N0)=>{var Ve=Xo(),Ye=require("path"),T3=Sd(),I3=B0(),Gn=(...t)=>Ve.findLast(t,e=>typeof e=="boolean"),j0=(...t)=>Ve.findLast(t,e=>typeof e=="string"),R3=(...t)=>Ve.findLast(t,e=>typeof e=="function"),B3={noSort:!1,readEntries:!1,method:Ve.Constants.NONE,fs:null};N0.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),B3);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=Ve.Constants.BUFFER,t=void 0)),Object.assign(n,e);let o=new Ve(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=Ve.decoder),t&&typeof t=="string")if(o.fs.existsSync(t))n.method=Ve.Constants.FILE,n.filename=t,r=o.fs.readFileSync(t);else throw Ve.Errors.INVALID_FILENAME();let i=new I3(r,n),{canonical:a,sanitize:s,zipnamefix:u}=Ve;function c(h){if(h&&i){var m;if(typeof h=="string"&&(m=i.getEntry(Ye.posix.normalize(h))),typeof h=="object"&&typeof h.entryName<"u"&&typeof h.header<"u"&&(m=i.getEntry(h.entryName)),m)return m}return null}function l(h){let{join:m,normalize:b,sep:D}=Ye.posix;return m(".",b(D+h.split("\\").join(D)+D))}function f(h){return h instanceof RegExp?(function(m){return function(b){return m.test(b)}})(h):typeof h!="function"?()=>!0:h}let d=(h,m)=>{let b=m.slice(-1);return b=b===o.sep?o.sep:"",Ye.relative(h,m)+b};return{readFile:function(h,m){var b=c(h);return b&&b.getData(m)||null},childCount:function(h){let m=c(h);if(m)return i.getChildCount(m)},readFileAsync:function(h,m){var b=c(h);b?b.getDataAsync(m):m(null,"getEntry failed for:"+h)},readAsText:function(h,m){var b=c(h);if(b){var D=b.getData();if(D&&D.length)return D.toString(m||"utf8")}return""},readAsTextAsync:function(h,m,b){var D=c(h);D?D.getDataAsync(function(C,E){if(E){m(C,E);return}C&&C.length?m(C.toString(b||"utf8")):m("")}):m("")},deleteFile:function(h,m=!0){var b=c(h);b&&i.deleteFile(b.entryName,m)},deleteEntry:function(h){var m=c(h);m&&i.deleteEntry(m.entryName)},addZipComment:function(h){i.comment=h},getZipComment:function(){return i.comment||""},addZipEntryComment:function(h,m){var b=c(h);b&&(b.comment=m)},getZipEntryComment:function(h){var m=c(h);return m&&m.comment||""},updateFile:function(h,m){var b=c(h);b&&b.setData(m)},addLocalFile:function(h,m,b,D){if(o.fs.existsSync(h)){m=m?l(m):"";let C=Ye.win32.basename(Ye.win32.normalize(h));m+=b||C;let E=o.fs.statSync(h),g=E.isFile()?o.fs.readFileSync(h):Buffer.alloc(0);E.isDirectory()&&(m+=o.sep),this.addFile(m,g,D,E)}else throw Ve.Errors.FILE_NOT_FOUND(h)},addLocalFileAsync:function(h,m){h=typeof h=="object"?h:{localPath:h};let b=Ye.resolve(h.localPath),{comment:D}=h,{zipPath:C,zipName:E}=h,g=this;o.fs.stat(b,function(_,S){if(_)return m(_,!1);C=C?l(C):"";let T=Ye.win32.basename(Ye.win32.normalize(b));if(C+=E||T,S.isFile())o.fs.readFile(b,function(k,B){return k?m(k,!1):(g.addFile(C,B,D,S),setImmediate(m,void 0,!0))});else if(S.isDirectory())return C+=o.sep,g.addFile(C,Buffer.alloc(0),D,S),setImmediate(m,void 0,!0)})},addLocalFolder:function(h,m,b){if(b=f(b),m=m?l(m):"",h=Ye.normalize(h),o.fs.existsSync(h)){let D=o.findFiles(h),C=this;if(D.length)for(let E of D){let g=Ye.join(m,d(h,E));b(g)&&C.addLocalFile(E,Ye.dirname(g))}}else throw Ve.Errors.FILE_NOT_FOUND(h)},addLocalFolderAsync:function(h,m,b,D){D=f(D),b=b?l(b):"",h=Ye.normalize(h);var C=this;o.fs.open(h,"r",function(E){if(E&&E.code==="ENOENT")m(void 0,Ve.Errors.FILE_NOT_FOUND(h));else if(E)m(void 0,E);else{var g=o.findFiles(h),_=-1,S=function(){if(_+=1,_<g.length){var T=g[_],k=d(h,T).split("\\").join("/");k=k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),D(k)?o.fs.stat(T,function(B,R){B&&m(void 0,B),R.isFile()?o.fs.readFile(T,function(N,A){N?m(void 0,N):(C.addFile(b+k,A,"",R),S())}):(C.addFile(b+k+"/",Buffer.alloc(0),"",R),S())}):process.nextTick(()=>{S()})}else m(!0,void 0)};S()}})},addLocalFolderAsync2:function(h,m){let b=this;h=typeof h=="object"?h:{localPath:h},localPath=Ye.resolve(l(h.localPath));let{zipPath:D,filter:C,namefix:E}=h;C instanceof RegExp?C=(function(S){return function(T){return S.test(T)}})(C):typeof C!="function"&&(C=function(){return!0}),D=D?l(D):"",E=="latin1"&&(E=S=>S.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof E!="function"&&(E=S=>S);let g=S=>Ye.join(D,E(d(localPath,S))),_=S=>Ye.win32.basename(Ye.win32.normalize(E(S)));o.fs.open(localPath,"r",function(S){S&&S.code==="ENOENT"?m(void 0,Ve.Errors.FILE_NOT_FOUND(localPath)):S?m(void 0,S):o.findFilesAsync(localPath,function(T,k){if(T)return m(T);k=k.filter(B=>C(g(B))),k.length||m(void 0,!1),setImmediate(k.reverse().reduce(function(B,R){return function(N,A){if(N||A===!1)return setImmediate(B,N,!1);b.addLocalFileAsync({localPath:R,zipPath:Ye.dirname(g(R)),zipName:_(R)},B)}},m))})})},addLocalFolderPromise:function(h,m){return new Promise((b,D)=>{this.addLocalFolderAsync2(Object.assign({localPath:h},m),(C,E)=>{C&&D(C),E&&b(this)})})},addFile:function(h,m,b,D){h=u(h);let C=c(h),E=C!=null;E||(C=new T3(n),C.entryName=h),C.comment=b||"";let g=typeof D=="object"&&D instanceof o.fs.Stats;g&&(C.header.time=D.mtime);var _=C.isDirectory?16:0;let S=C.isDirectory?16384:32768;return g?S|=4095&D.mode:typeof D=="number"?S|=4095&D:S|=C.isDirectory?493:420,_=(_|S<<16)>>>0,C.attr=_,C.setData(m),E||i.setEntry(C),C},getEntries:function(h){return i.password=h,i?i.entries:[]},getEntry:function(h){return c(h)},getEntryCount:function(){return i.getEntryCount()},forEach:function(h){return i.forEach(h)},extractEntryTo:function(h,m,b,D,C,E){D=Gn(!1,D),C=Gn(!1,C),b=Gn(!0,b),E=j0(C,E);var g=c(h);if(!g)throw Ve.Errors.NO_ENTRY();var _=a(g.entryName),S=s(m,E&&!g.isDirectory?E:b?_:Ye.basename(_));if(g.isDirectory){var T=i.getEntryChildren(g);return T.forEach(function(R){if(R.isDirectory)return;var N=R.getData();if(!N)throw Ve.Errors.CANT_EXTRACT_FILE();var A=a(R.entryName),U=s(m,b?A:Ye.basename(A));let M=C?R.header.fileAttr:void 0;o.writeFileTo(U,N,D,M)}),!0}var k=g.getData(i.password);if(!k)throw Ve.Errors.CANT_EXTRACT_FILE();if(o.fs.existsSync(S)&&!D)throw Ve.Errors.CANT_OVERRIDE();let B=C?h.header.fileAttr:void 0;return o.writeFileTo(S,k,D,B),!0},test:function(h){if(!i)return!1;for(var m in i.entries)try{if(m.isDirectory)continue;var b=i.entries[m].getData(h);if(!b)return!1}catch{return!1}return!0},extractAllTo:function(h,m,b,D){if(b=Gn(!1,b),D=j0(b,D),m=Gn(!1,m),!i)throw Ve.Errors.NO_ZIP();i.entries.forEach(function(C){var E=s(h,a(C.entryName));if(C.isDirectory){o.makeDir(E);return}var g=C.getData(D);if(!g)throw Ve.Errors.CANT_EXTRACT_FILE();let _=b?C.header.fileAttr:void 0;o.writeFileTo(E,g,m,_);try{o.fs.utimesSync(E,C.header.time,C.header.time)}catch{throw Ve.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(h,m,b,D){if(D=R3(m,b,D),b=Gn(!1,b),m=Gn(!1,m),!D)return new Promise((S,T)=>{this.extractAllToAsync(h,m,b,function(k){k?T(k):S(this)})});if(!i){D(Ve.Errors.NO_ZIP());return}h=Ye.resolve(h);let C=S=>s(h,Ye.normalize(a(S.entryName))),E=(S,T)=>new Error(S+': "'+T+'"'),g=[],_=[];i.entries.forEach(S=>{S.isDirectory?g.push(S):_.push(S)});for(let S of g){let T=C(S),k=b?S.header.fileAttr:void 0;try{o.makeDir(T),k&&o.fs.chmodSync(T,k),o.fs.utimesSync(T,S.header.time,S.header.time)}catch{D(E("Unable to create folder",T))}}_.reverse().reduce(function(S,T){return function(k){if(k)S(k);else{let B=Ye.normalize(a(T.entryName)),R=s(h,B);T.getDataAsync(function(N,A){if(A)S(A);else if(!N)S(Ve.Errors.CANT_EXTRACT_FILE());else{let U=b?T.header.fileAttr:void 0;o.writeFileToAsync(R,N,m,U,function(M){M||S(E("Unable to write file",R)),o.fs.utimes(R,T.header.time,T.header.time,function(Q){Q?S(E("Unable to set times",R)):S()})})}})}}},D)()},writeZip:function(h,m){if(arguments.length===1&&typeof h=="function"&&(m=h,h=""),!h&&n.filename&&(h=n.filename),!!h){var b=i.compressToBuffer();if(b){var D=o.writeFileTo(h,b,!0);typeof m=="function"&&m(D?null:new Error("failed"),"")}}},writeZipPromise:function(h,m){let{overwrite:b,perm:D}=Object.assign({overwrite:!0},m);return new Promise((C,E)=>{!h&&n.filename&&(h=n.filename),h||E("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(g=>{let _=S=>S?C(S):E("ADM-ZIP: Wasn't able to write zip file");o.writeFileToAsync(h,g,b,D,_)},E)})},toBufferPromise:function(){return new Promise((h,m)=>{i.toAsyncBuffer(h,m)})},toBuffer:function(h,m,b,D){return typeof h=="function"?(i.toAsyncBuffer(h,m,b,D),null):i.compressToBuffer()}}}});var H0=x((SV,q0)=>{var M0={};q0.exports=M0;var U0={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(U0).forEach(function(t){var e=U0[t],r=M0[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var z0=x((FV,V0)=>{"use strict";V0.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",o=e.indexOf(n+t);return o!==-1&&(r===-1?!0:o<r)}});var W0=x((AV,G0)=>{"use strict";var j3=require("os"),wr=z0(),Ft=process.env,Qo=void 0;wr("no-color")||wr("no-colors")||wr("color=false")?Qo=!1:(wr("color")||wr("colors")||wr("color=true")||wr("color=always"))&&(Qo=!0);"FORCE_COLOR"in Ft&&(Qo=Ft.FORCE_COLOR.length===0||parseInt(Ft.FORCE_COLOR,10)!==0);function N3(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function L3(t){if(Qo===!1)return 0;if(wr("color=16m")||wr("color=full")||wr("color=truecolor"))return 3;if(wr("color=256"))return 2;if(t&&!t.isTTY&&Qo!==!0)return 0;var e=Qo?1:0;if(process.platform==="win32"){var r=j3.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 Ft)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(o){return o in Ft})||Ft.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Ft)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ft.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Ft){var n=parseInt((Ft.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ft.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ft.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ft.TERM)||"COLORTERM"in Ft?1:(Ft.TERM==="dumb",e)}function Fd(t){var e=L3(t);return N3(e)}G0.exports={supportsColor:Fd,stdout:Fd(process.stdout),stderr:Fd(process.stderr)}});var Y0=x((OV,K0)=>{K0.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var o={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(i){i=i.toLowerCase();var a=o[i]||[" "],s=Math.floor(Math.random()*a.length);typeof o[i]<"u"?n+=o[i][s]:n+=i}),n}});var X0=x((kV,J0)=>{J0.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"]},o=[].concat(n.up,n.down,n.mid);function i(u){var c=Math.floor(Math.random()*u);return c}function a(u){var c=!1;return o.filter(function(l){c=l===u}),c}function s(u,c){var l="",f,d;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(d in u)if(!a(d)){switch(l=l+u[d],f={up:0,down:0,mid:0},c.size){case"mini":f.up=i(8),f.mid=i(2),f.down=i(8);break;case"maxi":f.up=i(16)+3,f.mid=i(4)+1,f.down=i(64)+3;break;default:f.up=i(8)+1,f.mid=i(6)/2,f.down=i(8)+1;break}var h=["up","mid","down"];for(var m in h)for(var b=h[m],D=0;D<=f[b];D++)c[b]&&(l=l+n[b][i(n[b].length)])}return l}return s(e,r)}});var Q0=x(($V,Z0)=>{Z0.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 tb=x((PV,eb)=>{eb.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var nb=x((TV,rb)=>{rb.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,o){return r===" "?r:t[e[n++%e.length]](r)}}});var ib=x((IV,ob)=>{ob.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,o){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var fb=x((BV,lb)=>{var ce={};lb.exports=ce;ce.themes={};var U3=require("util"),Wn=ce.styles=H0(),sb=Object.defineProperties,M3=new RegExp(/[\r\n]+/g);ce.supportsColor=W0().supportsColor;typeof ce.enabled>"u"&&(ce.enabled=ce.supportsColor()!==!1);ce.enable=function(){ce.enabled=!0};ce.disable=function(){ce.enabled=!1};ce.stripColors=ce.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var RV=ce.stylize=function(e,r){if(!ce.enabled)return e+"";var n=Wn[r];return!n&&r in ce?ce[r](e):n.open+e+n.close},q3=/[|\\{}()[\]^$+*?.]/g,H3=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(q3,"\\$&")};function ub(t){var e=function r(){return z3.apply(r,arguments)};return e._styles=t,e.__proto__=V3,e}var cb=(function(){var t={};return Wn.grey=Wn.gray,Object.keys(Wn).forEach(function(e){Wn[e].closeRe=new RegExp(H3(Wn[e].close),"g"),t[e]={get:function(){return ub(this._styles.concat(e))}}}),t})(),V3=sb(function(){},cb);function z3(){var t=Array.prototype.slice.call(arguments),e=t.map(function(a){return a!=null&&a.constructor===String?a:U3.inspect(a)}).join(" ");if(!ce.enabled||!e)return e;for(var r=e.indexOf(`
|
|
27
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function cD(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",o="9229",i;return(i=e.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],o=i[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:e})}function bf(){if(ve.env.NO_COLOR||ve.env.FORCE_COLOR==="0"||ve.env.FORCE_COLOR==="false")return!1;if(ve.env.FORCE_COLOR||ve.env.CLICOLOR_FORCE!==void 0)return!0}vf.Command=yf;vf.useColor=bf});var hD=x(Xt=>{var{Argument:fD}=Ls(),{Command:wf}=lD(),{CommanderError:gA,InvalidArgumentError:pD}=la(),{Help:DA}=ff(),{Option:dD}=mf();Xt.program=new wf;Xt.createCommand=t=>new wf(t);Xt.createOption=(t,e)=>new dD(t,e);Xt.createArgument=(t,e)=>new fD(t,e);Xt.Command=wf;Xt.Option=dD;Xt.Argument=fD;Xt.Help=DA;Xt.CommanderError=gA;Xt.InvalidArgumentError=pD;Xt.InvalidOptionArgumentError=pD});var Ef=x((m7,gD)=>{"use strict";var Cf={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},bA={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},vA={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?Cf.up():"");return t&&(e+=Cf.left),e}};gD.exports={cursor:Cf,scroll:bA,erase:vA,beep:"\x07"}});var xf=x((g7,_f)=>{var qs=process||{},DD=qs.argv||[],Ms=qs.env||{},wA=!(Ms.NO_COLOR||DD.includes("--no-color"))&&(!!Ms.FORCE_COLOR||DD.includes("--color")||qs.platform==="win32"||(qs.stdout||{}).isTTY&&Ms.TERM!=="dumb"||!!Ms.CI),CA=(t,e,r=t)=>n=>{let o=""+n,i=o.indexOf(e,t.length);return~i?t+EA(o,e,r,i)+e:t+o+e},EA=(t,e,r,n)=>{let o="",i=0;do o+=t.substring(i,n)+r,i=n+e.length,n=t.indexOf(e,i);while(~n);return o+t.substring(i)},yD=(t=wA)=>{let e=t?CA:()=>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")}};_f.exports=yD();_f.exports.createColors=yD});var Xs=x(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.isNXMonorepo=Tt.isMonorepo=Tt.findPackageRelativePathInMonorepo=Tt.findPackagePath=Tt.findNXMonorepoRoot=Tt.findMonorepoRoot=void 0;var da=require("node:fs"),pn=require("node:path");function Js(t){let e=(0,pn.join)(t,"package.json"),r=(0,pn.join)(t,"pnpm-workspace.yaml");if((0,da.existsSync)(r)||(0,da.existsSync)(e)&&JSON.parse((0,da.readFileSync)(e,"utf-8")).workspaces)return t;let n=(0,pn.dirname)(t);if(n===t)throw new Error("Monorepo root not found");return Js(n)}Tt.findMonorepoRoot=Js;function Nf(t){let e=(0,pn.join)(t,"nx.json");if((0,da.existsSync)(e))return t;let r=(0,pn.dirname)(t);if(r===t)throw new Error("Monorepo root not found");return Nf(r)}Tt.findNXMonorepoRoot=Nf;function Lf(t,e,r){let n=(0,pn.join)(e,"node_modules",t);if((0,da.existsSync)(n))return n;if(e===r)return null;let o=(0,pn.dirname)(e);return Lf(t,o,r)}Tt.findPackagePath=Lf;function tO(t,e){let r=Js(e),n=Lf(t,e,r);return n?(0,pn.relative)(e,n):null}Tt.findPackageRelativePathInMonorepo=tO;function rO(t){try{return Js(t),!0}catch{return!1}}Tt.isMonorepo=rO;function nO(t){try{return Nf(t),!0}catch{return!1}}Tt.isNXMonorepo=nO});var le={};qr(le,{__addDisposableResource:()=>vy,__assign:()=>ou,__asyncDelegator:()=>py,__asyncGenerator:()=>fy,__asyncValues:()=>dy,__await:()=>Uo,__awaiter:()=>iy,__classPrivateFieldGet:()=>Dy,__classPrivateFieldIn:()=>by,__classPrivateFieldSet:()=>yy,__createBinding:()=>au,__decorate:()=>ZD,__disposeResources:()=>wy,__esDecorate:()=>ey,__exportStar:()=>sy,__extends:()=>JD,__generator:()=>ay,__importDefault:()=>gy,__importStar:()=>my,__makeTemplateObject:()=>hy,__metadata:()=>oy,__param:()=>QD,__propKey:()=>ry,__read:()=>Kf,__rest:()=>XD,__rewriteRelativeImportExtension:()=>Cy,__runInitializers:()=>ty,__setFunctionName:()=>ny,__spread:()=>uy,__spreadArray:()=>ly,__spreadArrays:()=>cy,__values:()=>iu,default:()=>FO});function JD(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Gf(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function XD(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 o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r}function ZD(t,e,r,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(i=(o<3?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i}function QD(t,e){return function(r,n){e(r,n,t)}}function ey(t,e,r,n,o,i){function a(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var s=n.kind,u=s==="getter"?"get":s==="setter"?"set":"value",c=!e&&t?n.static?t:t.prototype:null,l=e||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),f,d=!1,h=r.length-1;h>=0;h--){var m={};for(var b in n)m[b]=b==="access"?{}:n[b];for(var b in n.access)m.access[b]=n.access[b];m.addInitializer=function(C){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(C||null))};var D=(0,r[h])(s==="accessor"?{get:l.get,set:l.set}:l[u],m);if(s==="accessor"){if(D===void 0)continue;if(D===null||typeof D!="object")throw new TypeError("Object expected");(f=a(D.get))&&(l.get=f),(f=a(D.set))&&(l.set=f),(f=a(D.init))&&o.unshift(f)}else(f=a(D))&&(s==="field"?o.unshift(f):l[u]=f)}c&&Object.defineProperty(c,n.name,l),d=!0}function ty(t,e,r){for(var n=arguments.length>2,o=0;o<e.length;o++)r=n?e[o].call(t,r):e[o].call(t);return n?r:void 0}function ry(t){return typeof t=="symbol"?t:"".concat(t)}function ny(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 oy(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function iy(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(l){try{c(n.next(l))}catch(f){a(f)}}function u(l){try{c(n.throw(l))}catch(f){a(f)}}function c(l){l.done?i(l.value):o(l.value).then(s,u)}c((n=n.apply(t,e||[])).next())})}function ay(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function sy(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&au(e,t,r)}function iu(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 Kf(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function uy(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Kf(arguments[e]));return t}function cy(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),o=0,e=0;e<r;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}function ly(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function Uo(t){return this instanceof Uo?(this.v=t,this):new Uo(t)}function fy(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(h){return function(m){return Promise.resolve(m).then(h,f)}}function s(h,m){n[h]&&(o[h]=function(b){return new Promise(function(D,C){i.push([h,b,D,C])>1||u(h,b)})},m&&(o[h]=m(o[h])))}function u(h,m){try{c(n[h](m))}catch(b){d(i[0][3],b)}}function c(h){h.value instanceof Uo?Promise.resolve(h.value.v).then(l,f):d(i[0][2],h)}function l(h){u("next",h)}function f(h){u("throw",h)}function d(h,m){h(m),i.shift(),i.length&&u(i[0][0],i[0][1])}}function py(t){var e,r;return e={},n("next"),n("throw",function(o){throw o}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(o,i){e[o]=t[o]?function(a){return(r=!r)?{value:Uo(t[o](a)),done:!1}:i?i(a):a}:i}}function dy(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 iu=="function"?iu(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(a){return new Promise(function(s,u){a=t[i](a),o(s,u,a.done,a.value)})}}function o(i,a,s,u){Promise.resolve(u).then(function(c){i({value:c,done:s})},a)}}function hy(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function my(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Wf(t),n=0;n<r.length;n++)r[n]!=="default"&&au(e,t,r[n]);return xO(e,t),e}function gy(t){return t&&t.__esModule?t:{default:t}}function Dy(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 yy(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r}function by(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 vy(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,o;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&&(o=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function wy(t){function e(i){t.error=t.hasError?new SO(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var r,n=0;function o(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(a){return e(a),o()})}else n|=1}catch(a){e(a)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return o()}function Cy(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,o,i,a){return n?e?".jsx":".js":o&&(!i||!a)?r:o+i+"."+a.toLowerCase()+"js"}):t}var Gf,ou,au,xO,Wf,SO,FO,fe=tt(()=>{Gf=function(t,e){return Gf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Gf(t,e)};ou=function(){return ou=Object.assign||function(e){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},ou.apply(this,arguments)};au=Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]});xO=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},Wf=function(t){return Wf=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},Wf(t)};SO=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};FO={__extends:JD,__assign:ou,__rest:XD,__decorate:ZD,__param:QD,__esDecorate:ey,__runInitializers:ty,__propKey:ry,__setFunctionName:ny,__metadata:oy,__awaiter:iy,__generator:ay,__createBinding:au,__exportStar:sy,__values:iu,__read:Kf,__spread:uy,__spreadArrays:cy,__spreadArray:ly,__await:Uo,__asyncGenerator:fy,__asyncDelegator:py,__asyncValues:dy,__makeTemplateObject:hy,__importStar:my,__importDefault:gy,__classPrivateFieldGet:Dy,__classPrivateFieldSet:yy,__classPrivateFieldIn:by,__addDisposableResource:vy,__disposeResources:wy,__rewriteRelativeImportExtension:Cy}});var Ey=x(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});su.resolveFetch=void 0;var AO=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);su.resolveFetch=AO});var Zf=x(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.FunctionRegion=Qt.FunctionsHttpError=Qt.FunctionsRelayError=Qt.FunctionsFetchError=Qt.FunctionsError=void 0;var Mo=class extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}};Qt.FunctionsError=Mo;var Yf=class extends Mo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}};Qt.FunctionsFetchError=Yf;var Jf=class extends Mo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}};Qt.FunctionsRelayError=Jf;var Xf=class extends Mo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}};Qt.FunctionsHttpError=Xf;var _y;(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"})(_y||(Qt.FunctionRegion=_y={}))});var xy=x(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.FunctionsClient=void 0;var OO=(fe(),re(le)),kO=Ey(),Hn=Zf(),Qf=class{constructor(e,{headers:r={},customFetch:n,region:o=Hn.FunctionRegion.Any}={}){this.url=e,this.headers=r,this.region=o,this.fetch=(0,kO.resolveFetch)(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return OO.__awaiter(this,arguments,void 0,function*(r,n={}){var o;try{let{headers:i,method:a,body:s,signal:u}=n,c={},{region:l}=n;l||(l=this.region);let f=new URL(`${this.url}/${r}`);l&&l!=="any"&&(c["x-region"]=l,f.searchParams.set("forceFunctionRegion",l));let d;s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)?typeof Blob<"u"&&s instanceof Blob||s instanceof ArrayBuffer?(c["Content-Type"]="application/octet-stream",d=s):typeof s=="string"?(c["Content-Type"]="text/plain",d=s):typeof FormData<"u"&&s instanceof FormData?d=s:(c["Content-Type"]="application/json",d=JSON.stringify(s)):d=s;let h=yield this.fetch(f.toString(),{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},c),this.headers),i),body:d,signal:u}).catch(C=>{throw C.name==="AbortError"?C:new Hn.FunctionsFetchError(C)}),m=h.headers.get("x-relay-error");if(m&&m==="true")throw new Hn.FunctionsRelayError(h);if(!h.ok)throw new Hn.FunctionsHttpError(h);let b=((o=h.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),D;return b==="application/json"?D=yield h.json():b==="application/octet-stream"||b==="application/pdf"?D=yield h.blob():b==="text/event-stream"?D=h:b==="multipart/form-data"?D=yield h.formData():D=yield h.text(),{data:D,error:null,response:h}}catch(i){return i instanceof Error&&i.name==="AbortError"?{data:null,error:new Hn.FunctionsFetchError(i)}:{data:null,error:i,response:i instanceof Hn.FunctionsHttpError||i instanceof Hn.FunctionsRelayError?i.context:void 0}}})}};uu.FunctionsClient=Qf});var ep=x(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.FunctionRegion=It.FunctionsRelayError=It.FunctionsHttpError=It.FunctionsFetchError=It.FunctionsError=It.FunctionsClient=void 0;var $O=xy();Object.defineProperty(It,"FunctionsClient",{enumerable:!0,get:function(){return $O.FunctionsClient}});var ya=Zf();Object.defineProperty(It,"FunctionsError",{enumerable:!0,get:function(){return ya.FunctionsError}});Object.defineProperty(It,"FunctionsFetchError",{enumerable:!0,get:function(){return ya.FunctionsFetchError}});Object.defineProperty(It,"FunctionsHttpError",{enumerable:!0,get:function(){return ya.FunctionsHttpError}});Object.defineProperty(It,"FunctionsRelayError",{enumerable:!0,get:function(){return ya.FunctionsRelayError}});Object.defineProperty(It,"FunctionRegion",{enumerable:!0,get:function(){return ya.FunctionRegion}})});var np=x(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});var tp=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}};rp.default=tp});var ap=x(ip=>{"use strict";Object.defineProperty(ip,"__esModule",{value:!0});var PO=(fe(),re(le)),TO=PO.__importDefault(np()),op=class{constructor(e){var r,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(r=e.shouldThrowOnError)!==null&&r!==void 0?r:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,r){return this.headers=new Headers(this.headers),this.headers.set(e,r),this}then(e,r){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let n=this.fetch,o=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{var a,s,u,c;let l=null,f=null,d=null,h=i.status,m=i.statusText;if(i.ok){if(this.method!=="HEAD"){let E=await i.text();E===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((a=this.headers.get("Accept"))===null||a===void 0)&&a.includes("application/vnd.pgrst.plan+text"))?f=E:f=JSON.parse(E))}let D=(s=this.headers.get("Prefer"))===null||s===void 0?void 0:s.match(/count=(exact|planned|estimated)/),C=(u=i.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");D&&C&&C.length>1&&(d=parseInt(C[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(f)&&(f.length>1?(l={code:"PGRST116",details:`Results contain ${f.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},f=null,d=null,h=406,m="Not Acceptable"):f.length===1?f=f[0]:f=null)}else{let D=await i.text();try{l=JSON.parse(D),Array.isArray(l)&&i.status===404&&(f=[],l=null,h=200,m="OK")}catch{i.status===404&&D===""?(h=204,m="No Content"):l={message:D}}if(l&&this.isMaybeSingle&&(!((c=l?.details)===null||c===void 0)&&c.includes("0 rows"))&&(l=null,h=200,m="OK"),l&&this.shouldThrowOnError)throw new TO.default(l)}return{error:l,data:f,count:d,status:h,statusText:m}});return this.shouldThrowOnError||(o=o.catch(i=>{var a,s,u;return{error:{message:`${(a=i?.name)!==null&&a!==void 0?a:"FetchError"}: ${i?.message}`,details:`${(s=i?.stack)!==null&&s!==void 0?s:""}`,hint:"",code:`${(u=i?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),o.then(e,r)}returns(){return this}overrideTypes(){return this}};ip.default=op});var cp=x(up=>{"use strict";Object.defineProperty(up,"__esModule",{value:!0});var IO=(fe(),re(le)),RO=IO.__importDefault(ap()),sp=class extends RO.default{select(e){let r=!1,n=(e??"*").split("").map(o=>/\s/.test(o)&&!r?"":(o==='"'&&(r=!r),o)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:r=!0,nullsFirst:n,foreignTable:o,referencedTable:i=o}={}){let a=i?`${i}.order`:"order",s=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${s?`${s},`:""}${e}.${r?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:r,referencedTable:n=r}={}){let o=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(o,`${e}`),this}range(e,r,{foreignTable:n,referencedTable:o=n}={}){let i=typeof o>"u"?"offset":`${o}.offset`,a=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(a,`${r-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:r=!1,settings:n=!1,buffers:o=!1,wal:i=!1,format:a="text"}={}){var s;let u=[e?"analyze":null,r?"verbose":null,n?"settings":null,o?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=(s=this.headers.get("Accept"))!==null&&s!==void 0?s:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${a}; for="${c}"; options=${u};`),a==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};up.default=sp});var cu=x(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});var BO=(fe(),re(le)),jO=BO.__importDefault(cp()),NO=new RegExp("[,()]"),lp=class extends jO.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(o=>typeof o=="string"&&NO.test(o)?`"${o}"`:`${o}`).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:o}={}){let i="";o==="plain"?i="pl":o==="phrase"?i="ph":o==="websearch"&&(i="w");let a=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${i}fts${a}.${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 o=n?`${n}.or`:"or";return this.url.searchParams.append(o,`(${e})`),this}filter(e,r,n){return this.url.searchParams.append(e,`${r}.${n}`),this}};fp.default=lp});var hp=x(dp=>{"use strict";Object.defineProperty(dp,"__esModule",{value:!0});var LO=(fe(),re(le)),ba=LO.__importDefault(cu()),pp=class{constructor(e,{headers:r={},schema:n,fetch:o}){this.url=e,this.headers=new Headers(r),this.schema=n,this.fetch=o}select(e,r){let{head:n=!1,count:o}=r??{},i=n?"HEAD":"GET",a=!1,s=(e??"*").split("").map(u=>/\s/.test(u)&&!a?"":(u==='"'&&(a=!a),u)).join("");return this.url.searchParams.set("select",s),o&&this.headers.append("Prefer",`count=${o}`),new ba.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(e,{count:r,defaultToNull:n=!0}={}){var o;let i="POST";if(r&&this.headers.append("Prefer",`count=${r}`),n||this.headers.append("Prefer","missing=default"),Array.isArray(e)){let a=e.reduce((s,u)=>s.concat(Object.keys(u)),[]);if(a.length>0){let s=[...new Set(a)].map(u=>`"${u}"`);this.url.searchParams.set("columns",s.join(","))}}return new ba.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}upsert(e,{onConflict:r,ignoreDuplicates:n=!1,count:o,defaultToNull:i=!0}={}){var a;let s="POST";if(this.headers.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),r!==void 0&&this.url.searchParams.set("on_conflict",r),o&&this.headers.append("Prefer",`count=${o}`),i||this.headers.append("Prefer","missing=default"),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 ba.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}update(e,{count:r}={}){var n;let o="PATCH";return r&&this.headers.append("Prefer",`count=${r}`),new ba.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:e}={}){var r;let n="DELETE";return e&&this.headers.append("Prefer",`count=${e}`),new ba.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}};dp.default=pp});var Fy=x(gp=>{"use strict";Object.defineProperty(gp,"__esModule",{value:!0});var Sy=(fe(),re(le)),UO=Sy.__importDefault(hp()),MO=Sy.__importDefault(cu()),mp=class t{constructor(e,{headers:r={},schema:n,fetch:o}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.fetch=o}from(e){let r=new URL(`${this.url}/${e}`);return new UO.default(r,{headers:new Headers(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:o=!1,count:i}={}){var a;let s,u=new URL(`${this.url}/rpc/${e}`),c;n||o?(s=n?"HEAD":"GET",Object.entries(r).filter(([f,d])=>d!==void 0).map(([f,d])=>[f,Array.isArray(d)?`{${d.join(",")}}`:`${d}`]).forEach(([f,d])=>{u.searchParams.append(f,d)})):(s="POST",c=r);let l=new Headers(this.headers);return i&&l.set("Prefer",`count=${i}`),new MO.default({method:s,url:u,headers:l,schema:this.schemaName,body:c,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};gp.default=mp});var Dp=x(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.PostgrestError=xt.PostgrestBuilder=xt.PostgrestTransformBuilder=xt.PostgrestFilterBuilder=xt.PostgrestQueryBuilder=xt.PostgrestClient=void 0;var qo=(fe(),re(le)),Ay=qo.__importDefault(Fy());xt.PostgrestClient=Ay.default;var Oy=qo.__importDefault(hp());xt.PostgrestQueryBuilder=Oy.default;var ky=qo.__importDefault(cu());xt.PostgrestFilterBuilder=ky.default;var $y=qo.__importDefault(cp());xt.PostgrestTransformBuilder=$y.default;var Py=qo.__importDefault(ap());xt.PostgrestBuilder=Py.default;var Ty=qo.__importDefault(np());xt.PostgrestError=Ty.default;xt.default={PostgrestClient:Ay.default,PostgrestQueryBuilder:Oy.default,PostgrestFilterBuilder:ky.default,PostgrestTransformBuilder:$y.default,PostgrestBuilder:Py.default,PostgrestError:Ty.default}});var bp={};qr(bp,{RealtimeClient:()=>yp});var yp,vp=tt(()=>{yp=class{constructor(){}connect(){}disconnect(){}}});var mn=x(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.StorageUnknownError=zr.StorageApiError=zr.StorageError=void 0;zr.isStorageError=qO;var va=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};zr.StorageError=va;function qO(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var wp=class extends va{constructor(e,r,n){super(e),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};zr.StorageApiError=wp;var Cp=class extends va{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}};zr.StorageUnknownError=Cp});var wa=x(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.isPlainObject=er.recursiveToCamel=er.resolveResponse=er.resolveFetch=void 0;var HO=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);er.resolveFetch=HO;var VO=()=>Response;er.resolveResponse=VO;var zO=t=>{if(Array.isArray(t))return t.map(r=>(0,er.recursiveToCamel)(r));if(typeof t=="function"||t!==Object(t))return t;let e={};return Object.entries(t).forEach(([r,n])=>{let o=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[o]=(0,er.recursiveToCamel)(n)}),e};er.recursiveToCamel=zO;var GO=t=>{if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};er.isPlainObject=GO});var lu=x(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.get=YO;zn.post=JO;zn.put=XO;zn.head=ZO;zn.remove=QO;var Vn=(fe(),re(le)),Ep=mn(),Iy=wa(),_p=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},WO=(t,e,r)=>Vn.__awaiter(void 0,void 0,void 0,function*(){let n=yield(0,Iy.resolveResponse)();t instanceof n&&!r?.noResolveJson?t.json().then(o=>{let i=t.status||500,a=o?.statusCode||i+"";e(new Ep.StorageApiError(_p(o),i,a))}).catch(o=>{e(new Ep.StorageUnknownError(_p(o),o))}):e(new Ep.StorageUnknownError(_p(t),t))}),KO=(t,e,r,n)=>{let o={method:t,headers:e?.headers||{}};return t==="GET"||!n?o:((0,Iy.isPlainObject)(n)?(o.headers=Object.assign({"Content-Type":"application/json"},e?.headers),o.body=JSON.stringify(n)):o.body=n,e?.duplex&&(o.duplex=e.duplex),Object.assign(Object.assign({},o),r))};function Ca(t,e,r,n,o,i){return Vn.__awaiter(this,void 0,void 0,function*(){return new Promise((a,s)=>{t(r,KO(e,n,o,i)).then(u=>{if(!u.ok)throw u;return n?.noResolveJson?u:u.json()}).then(u=>a(u)).catch(u=>WO(u,s,n))})})}function YO(t,e,r,n){return Vn.__awaiter(this,void 0,void 0,function*(){return Ca(t,"GET",e,r,n)})}function JO(t,e,r,n,o){return Vn.__awaiter(this,void 0,void 0,function*(){return Ca(t,"POST",e,n,o,r)})}function XO(t,e,r,n,o){return Vn.__awaiter(this,void 0,void 0,function*(){return Ca(t,"PUT",e,n,o,r)})}function ZO(t,e,r,n){return Vn.__awaiter(this,void 0,void 0,function*(){return Ca(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function QO(t,e,r,n,o){return Vn.__awaiter(this,void 0,void 0,function*(){return Ca(t,"DELETE",e,n,o,r)})}});var Ry=x(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});var ek=(fe(),re(le)),tk=mn(),xp=class{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r}then(e,r){return this.execute().then(e,r)}execute(){return ek.__awaiter(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if((0,tk.isStorageError)(e))return{data:null,error:e};throw e}})}};Sp.default=xp});var Ny=x(Ap=>{"use strict";var By;Object.defineProperty(Ap,"__esModule",{value:!0});var jy=(fe(),re(le)),rk=mn(),nk=jy.__importDefault(Ry()),Fp=class{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r,this[By]="BlobDownloadBuilder",this.promise=null}asStream(){return new nk.default(this.downloadFn,this.shouldThrowOnError)}then(e,r){return this.getPromise().then(e,r)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return jy.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if((0,rk.isStorageError)(e))return{data:null,error:e};throw e}})}};By=Symbol.toStringTag;Ap.default=Fp});var My=x(kp=>{"use strict";Object.defineProperty(kp,"__esModule",{value:!0});var St=(fe(),re(le)),Rt=mn(),Bt=lu(),Ly=wa(),ok=St.__importDefault(Ny()),ik={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Uy={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1},Op=class{constructor(e,r={},n,o){this.shouldThrowOnError=!1,this.url=e,this.headers=r,this.bucketId=n,this.fetch=(0,Ly.resolveFetch)(o)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,r,n,o){return St.__awaiter(this,void 0,void 0,function*(){try{let i,a=Object.assign(Object.assign({},Uy),o),s=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(a.upsert)}),u=a.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",a.cacheControl),u&&i.append("metadata",this.encodeMetadata(u)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",a.cacheControl),u&&!i.has("metadata")&&i.append("metadata",this.encodeMetadata(u))):(i=n,s["cache-control"]=`max-age=${a.cacheControl}`,s["content-type"]=a.contentType,u&&(s["x-metadata"]=this.toBase64(this.encodeMetadata(u))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!a.duplex&&(a.duplex="half")),o?.headers&&(s=Object.assign(Object.assign({},s),o.headers));let c=this._removeEmptyFolders(r),l=this._getFinalPath(c),f=yield(e=="PUT"?Bt.put:Bt.post)(this.fetch,`${this.url}/object/${l}`,i,Object.assign({headers:s},a?.duplex?{duplex:a.duplex}:{}));return{data:{path:c,id:f.Id,fullPath:f.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if((0,Rt.isStorageError)(i))return{data:null,error:i};throw i}})}upload(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,o){return St.__awaiter(this,void 0,void 0,function*(){let i=this._removeEmptyFolders(e),a=this._getFinalPath(i),s=new URL(this.url+`/object/upload/sign/${a}`);s.searchParams.set("token",r);try{let u,c=Object.assign({upsert:Uy.upsert},o),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(0,Bt.put)(this.fetch,s.toString(),u,{headers:l});return{data:{path:i,fullPath:f.Key},error:null}}catch(u){if(this.shouldThrowOnError)throw u;if((0,Rt.isStorageError)(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return St.__awaiter(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),o=Object.assign({},this.headers);r?.upsert&&(o["x-upsert"]="true");let i=yield(0,Bt.post)(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:o}),a=new URL(this.url+i.url),s=a.searchParams.get("token");if(!s)throw new Rt.StorageError("No token returned by API");return{data:{signedUrl:a.toString(),path:e,token:s},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,Rt.isStorageError)(n))return{data:null,error:n};throw n}})}update(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,Bt.post)(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers}),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Rt.isStorageError)(o))return{data:null,error:o};throw o}})}copy(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){try{return{data:{path:(yield(0,Bt.post)(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Rt.isStorageError)(o))return{data:null,error:o};throw o}})}createSignedUrl(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){try{let o=this._getFinalPath(e),i=yield(0,Bt.post)(this.fetch,`${this.url}/object/sign/${o}`,Object.assign({expiresIn:r},n?.transform?{transform:n.transform}:{}),{headers:this.headers}),a=n?.download?`&download=${n.download===!0?"":n.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${a}`)},{data:i,error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Rt.isStorageError)(o))return{data:null,error:o};throw o}})}createSignedUrls(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){try{let o=yield(0,Bt.post)(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),i=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:o.map(a=>Object.assign(Object.assign({},a),{signedUrl:a.signedURL?encodeURI(`${this.url}${a.signedURL}${i}`):null})),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Rt.isStorageError)(o))return{data:null,error:o};throw o}})}download(e,r){let o=typeof r?.transform<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString(r?.transform||{}),a=i?`?${i}`:"",s=this._getFinalPath(e),u=()=>(0,Bt.get)(this.fetch,`${this.url}/${o}/${s}${a}`,{headers:this.headers,noResolveJson:!0});return new ok.default(u,this.shouldThrowOnError)}info(e){return St.__awaiter(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{let n=yield(0,Bt.get)(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:(0,Ly.recursiveToCamel)(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,Rt.isStorageError)(n))return{data:null,error:n};throw n}})}exists(e){return St.__awaiter(this,void 0,void 0,function*(){let r=this._getFinalPath(e);try{return yield(0,Bt.head)(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,Rt.isStorageError)(n)&&n instanceof Rt.StorageUnknownError){let o=n.originalError;if([400,404].includes(o?.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){let n=this._getFinalPath(e),o=[],i=r?.download?`download=${r.download===!0?"":r.download}`:"";i!==""&&o.push(i);let s=typeof r?.transform<"u"?"render/image":"object",u=this.transformOptsToQueryString(r?.transform||{});u!==""&&o.push(u);let c=o.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}${c}`)}}}remove(e){return St.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,Bt.remove)(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Rt.isStorageError)(r))return{data:null,error:r};throw r}})}list(e,r,n){return St.__awaiter(this,void 0,void 0,function*(){try{let o=Object.assign(Object.assign(Object.assign({},ik),r),{prefix:e||""});return{data:yield(0,Bt.post)(this.fetch,`${this.url}/object/list/${this.bucketId}`,o,{headers:this.headers},n),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Rt.isStorageError)(o))return{data:null,error:o};throw o}})}listV2(e,r){return St.__awaiter(this,void 0,void 0,function*(){try{let n=Object.assign({},e);return{data:yield(0,Bt.post)(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,Rt.isStorageError)(n))return{data:null,error:n};throw n}})}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.replace(/^\/+/,"")}`}_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("&")}};kp.default=Op});var $p=x(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.version=void 0;fu.version="2.79.0"});var Pp=x(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.DEFAULT_HEADERS=void 0;var ak=$p();pu.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${ak.version}`}});var qy=x(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});var Ho=(fe(),re(le)),sk=Pp(),Vo=mn(),zo=lu(),uk=wa(),Tp=class{constructor(e,r={},n,o){this.shouldThrowOnError=!1;let i=new URL(e);o?.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},sk.DEFAULT_HEADERS),r),this.fetch=(0,uk.resolveFetch)(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return Ho.__awaiter(this,void 0,void 0,function*(){try{let r=this.listBucketOptionsToQueryString(e);return{data:yield(0,zo.get)(this.fetch,`${this.url}/bucket${r}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}getBucket(e){return Ho.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,zo.get)(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}createBucket(e){return Ho.__awaiter(this,arguments,void 0,function*(r,n={public:!1}){try{return{data:yield(0,zo.post)(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(o){if(this.shouldThrowOnError)throw o;if((0,Vo.isStorageError)(o))return{data:null,error:o};throw o}})}updateBucket(e,r){return Ho.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,zo.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(this.shouldThrowOnError)throw n;if((0,Vo.isStorageError)(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Ho.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,zo.post)(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Ho.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,zo.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Vo.isStorageError)(r))return{data:null,error:r};throw r}})}listBucketOptionsToQueryString(e){let r={};return e&&("limit"in e&&(r.limit=String(e.limit)),"offset"in e&&(r.offset=String(e.offset)),e.search&&(r.search=e.search),e.sortColumn&&(r.sortColumn=e.sortColumn),e.sortOrder&&(r.sortOrder=e.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}};Ip.default=Tp});var Up=x(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});var Rp=(fe(),re(le)),ck=Pp(),Bp=mn(),jp=lu(),lk=wa(),Np=class{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},ck.DEFAULT_HEADERS),r),this.fetch=(0,lk.resolveFetch)(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return Rp.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,jp.post)(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Bp.isStorageError)(r))return{data:null,error:r};throw r}})}listBuckets(e){return Rp.__awaiter(this,void 0,void 0,function*(){try{let r=new URLSearchParams;e?.limit!==void 0&&r.set("limit",e.limit.toString()),e?.offset!==void 0&&r.set("offset",e.offset.toString()),e?.sortColumn&&r.set("sortColumn",e.sortColumn),e?.sortOrder&&r.set("sortOrder",e.sortOrder),e?.search&&r.set("search",e.search);let n=r.toString(),o=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield(0,jp.get)(this.fetch,o,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Bp.isStorageError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Rp.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,jp.remove)(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Bp.isStorageError)(r))return{data:null,error:r};throw r}})}};Lp.default=Np});var hu=x(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.DEFAULT_HEADERS=void 0;var fk=$p();du.DEFAULT_HEADERS={"X-Client-Info":`storage-js/${fk.version}`,"Content-Type":"application/json"}});var Go=x(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.StorageVectorsErrorCode=br.StorageVectorsUnknownError=br.StorageVectorsApiError=br.StorageVectorsError=void 0;br.isStorageVectorsError=pk;var Ea=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};br.StorageVectorsError=Ea;function pk(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}var Mp=class extends Ea{constructor(e,r,n){super(e),this.name="StorageVectorsApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};br.StorageVectorsApiError=Mp;var qp=class extends Ea{constructor(e,r){super(e),this.name="StorageVectorsUnknownError",this.originalError=r}};br.StorageVectorsUnknownError=qp;var Hy;(function(t){t.InternalError="InternalError",t.S3VectorConflictException="S3VectorConflictException",t.S3VectorNotFoundException="S3VectorNotFoundException",t.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",t.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",t.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(Hy||(br.StorageVectorsErrorCode=Hy={}))});var Wo=x(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.validateVectorDimension=tr.normalizeToFloat32=tr.isPlainObject=tr.resolveResponse=tr.resolveFetch=void 0;var dk=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);tr.resolveFetch=dk;var hk=()=>Response;tr.resolveResponse=hk;var mk=t=>{if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};tr.isPlainObject=mk;var gk=t=>Array.from(new Float32Array(t));tr.normalizeToFloat32=gk;var Dk=(t,e)=>{if(e!==void 0&&t.float32.length!==e)throw new Error(`Vector dimension mismatch: expected ${e}, got ${t.float32.length}`)};tr.validateVectorDimension=Dk});var Du=x(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.get=wk;Yo.post=Ck;Yo.put=Ek;Yo.remove=_k;var Ko=(fe(),re(le)),mu=Go(),yk=Wo(),Vy=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),bk=(t,e,r)=>Ko.__awaiter(void 0,void 0,void 0,function*(){if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!r?.noResolveJson){let o=t.status||500,i=t;if(typeof i.json=="function")i.json().then(a=>{let s=a?.statusCode||a?.code||o+"";e(new mu.StorageVectorsApiError(Vy(a),o,s))}).catch(()=>{let a=o+"",s=i.statusText||`HTTP ${o} error`;e(new mu.StorageVectorsApiError(s,o,a))});else{let a=o+"",s=i.statusText||`HTTP ${o} error`;e(new mu.StorageVectorsApiError(s,o,a))}}else e(new mu.StorageVectorsUnknownError(Vy(t),t))}),vk=(t,e,r,n)=>{let o={method:t,headers:e?.headers||{}};return t==="GET"||!n?o:((0,yk.isPlainObject)(n)?(o.headers=Object.assign({"Content-Type":"application/json"},e?.headers),o.body=JSON.stringify(n)):o.body=n,Object.assign(Object.assign({},o),r))};function gu(t,e,r,n,o,i){return Ko.__awaiter(this,void 0,void 0,function*(){return new Promise((a,s)=>{t(r,vk(e,n,o,i)).then(u=>{if(!u.ok)throw u;if(n?.noResolveJson)return u;let c=u.headers.get("content-type");return!c||!c.includes("application/json")?{}:u.json()}).then(u=>a(u)).catch(u=>bk(u,s,n))})})}function wk(t,e,r,n){return Ko.__awaiter(this,void 0,void 0,function*(){return gu(t,"GET",e,r,n)})}function Ck(t,e,r,n,o){return Ko.__awaiter(this,void 0,void 0,function*(){return gu(t,"POST",e,n,o,r)})}function Ek(t,e,r,n,o){return Ko.__awaiter(this,void 0,void 0,function*(){return gu(t,"PUT",e,n,o,r)})}function _k(t,e,r,n,o){return Ko.__awaiter(this,void 0,void 0,function*(){return gu(t,"DELETE",e,n,o,r)})}});var zp=x(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});var yu=(fe(),re(le)),xk=hu(),bu=Go(),vu=Du(),Sk=Wo(),Hp=class{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},xk.DEFAULT_HEADERS),r),this.fetch=(0,Sk.resolveFetch)(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return yu.__awaiter(this,void 0,void 0,function*(){try{return{data:(yield(0,vu.post)(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,bu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}getIndex(e,r){return yu.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,vu.post)(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,bu.isStorageVectorsError)(n))return{data:null,error:n};throw n}})}listIndexes(e){return yu.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,vu.post)(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,bu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}deleteIndex(e,r){return yu.__awaiter(this,void 0,void 0,function*(){try{return{data:(yield(0,vu.post)(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if((0,bu.isStorageVectorsError)(n))return{data:null,error:n};throw n}})}};Vp.default=Hp});var Kp=x(Wp=>{"use strict";Object.defineProperty(Wp,"__esModule",{value:!0});var _a=(fe(),re(le)),Fk=hu(),xa=Go(),Sa=Du(),Ak=Wo(),Gp=class{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Fk.DEFAULT_HEADERS),r),this.fetch=(0,Ak.resolveFetch)(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return _a.__awaiter(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield(0,Sa.post)(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,xa.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}getVectors(e){return _a.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,Sa.post)(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,xa.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}listVectors(e){return _a.__awaiter(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield(0,Sa.post)(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,xa.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}queryVectors(e){return _a.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,Sa.post)(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,xa.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}deleteVectors(e){return _a.__awaiter(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield(0,Sa.post)(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,xa.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}};Wp.default=Gp});var Xp=x(Jp=>{"use strict";Object.defineProperty(Jp,"__esModule",{value:!0});var wu=(fe(),re(le)),Ok=hu(),Cu=Go(),Eu=Du(),kk=Wo(),Yp=class{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Ok.DEFAULT_HEADERS),r),this.fetch=(0,kk.resolveFetch)(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return wu.__awaiter(this,void 0,void 0,function*(){try{return{data:(yield(0,Eu.post)(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Cu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}getBucket(e){return wu.__awaiter(this,void 0,void 0,function*(){try{return{data:yield(0,Eu.post)(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Cu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}listBuckets(){return wu.__awaiter(this,arguments,void 0,function*(e={}){try{return{data:yield(0,Eu.post)(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Cu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}deleteBucket(e){return wu.__awaiter(this,void 0,void 0,function*(){try{return{data:(yield(0,Eu.post)(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if((0,Cu.isStorageVectorsError)(r))return{data:null,error:r};throw r}})}};Jp.default=Yp});var zy=x(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.VectorIndexScope=gn.VectorBucketScope=gn.StorageVectorsClient=void 0;var rr=(fe(),re(le)),$k=rr.__importDefault(zp()),Pk=rr.__importDefault(Kp()),Tk=rr.__importDefault(Xp()),Zp=class extends Tk.default{constructor(e,r={}){super(e,r.headers||{},r.fetch)}from(e){return new _u(this.url,this.headers,e,this.fetch)}};gn.StorageVectorsClient=Zp;var _u=class extends $k.default{constructor(e,r,n,o){super(e,r,o),this.vectorBucketName=n}createIndex(e){let r=Object.create(null,{createIndex:{get:()=>super.createIndex}});return rr.__awaiter(this,void 0,void 0,function*(){return r.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){let e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return rr.__awaiter(this,arguments,void 0,function*(r={}){return e.listIndexes.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){let r=Object.create(null,{getIndex:{get:()=>super.getIndex}});return rr.__awaiter(this,void 0,void 0,function*(){return r.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){let r=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return rr.__awaiter(this,void 0,void 0,function*(){return r.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new xu(this.url,this.headers,this.vectorBucketName,e,this.fetch)}};gn.VectorBucketScope=_u;var xu=class extends Pk.default{constructor(e,r,n,o,i){super(e,r,i),this.vectorBucketName=n,this.indexName=o}putVectors(e){let r=Object.create(null,{putVectors:{get:()=>super.putVectors}});return rr.__awaiter(this,void 0,void 0,function*(){return r.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){let r=Object.create(null,{getVectors:{get:()=>super.getVectors}});return rr.__awaiter(this,void 0,void 0,function*(){return r.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){let e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return rr.__awaiter(this,arguments,void 0,function*(r={}){return e.listVectors.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){let r=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return rr.__awaiter(this,void 0,void 0,function*(){return r.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){let r=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return rr.__awaiter(this,void 0,void 0,function*(){return r.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}};gn.VectorIndexScope=xu});var td=x(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.validateVectorDimension=pe.normalizeToFloat32=pe.isPlainObject=pe.resolveResponse=pe.resolveFetch=pe.isStorageVectorsError=pe.StorageVectorsErrorCode=pe.StorageVectorsUnknownError=pe.StorageVectorsApiError=pe.StorageVectorsError=pe.VectorDataApi=pe.VectorIndexApi=pe.VectorBucketApi=pe.VectorIndexScope=pe.VectorBucketScope=pe.StorageVectorsClient=void 0;var Qp=(fe(),re(le)),ed=zy();Object.defineProperty(pe,"StorageVectorsClient",{enumerable:!0,get:function(){return ed.StorageVectorsClient}});Object.defineProperty(pe,"VectorBucketScope",{enumerable:!0,get:function(){return ed.VectorBucketScope}});Object.defineProperty(pe,"VectorIndexScope",{enumerable:!0,get:function(){return ed.VectorIndexScope}});var Ik=Xp();Object.defineProperty(pe,"VectorBucketApi",{enumerable:!0,get:function(){return Qp.__importDefault(Ik).default}});var Rk=zp();Object.defineProperty(pe,"VectorIndexApi",{enumerable:!0,get:function(){return Qp.__importDefault(Rk).default}});var Bk=Kp();Object.defineProperty(pe,"VectorDataApi",{enumerable:!0,get:function(){return Qp.__importDefault(Bk).default}});var Fa=Go();Object.defineProperty(pe,"StorageVectorsError",{enumerable:!0,get:function(){return Fa.StorageVectorsError}});Object.defineProperty(pe,"StorageVectorsApiError",{enumerable:!0,get:function(){return Fa.StorageVectorsApiError}});Object.defineProperty(pe,"StorageVectorsUnknownError",{enumerable:!0,get:function(){return Fa.StorageVectorsUnknownError}});Object.defineProperty(pe,"StorageVectorsErrorCode",{enumerable:!0,get:function(){return Fa.StorageVectorsErrorCode}});Object.defineProperty(pe,"isStorageVectorsError",{enumerable:!0,get:function(){return Fa.isStorageVectorsError}});var Aa=Wo();Object.defineProperty(pe,"resolveFetch",{enumerable:!0,get:function(){return Aa.resolveFetch}});Object.defineProperty(pe,"resolveResponse",{enumerable:!0,get:function(){return Aa.resolveResponse}});Object.defineProperty(pe,"isPlainObject",{enumerable:!0,get:function(){return Aa.isPlainObject}});Object.defineProperty(pe,"normalizeToFloat32",{enumerable:!0,get:function(){return Aa.normalizeToFloat32}});Object.defineProperty(pe,"validateVectorDimension",{enumerable:!0,get:function(){return Aa.validateVectorDimension}})});var Gy=x(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.StorageClient=void 0;var nd=(fe(),re(le)),jk=nd.__importDefault(My()),Nk=nd.__importDefault(qy()),Lk=nd.__importDefault(Up()),Uk=td(),rd=class extends Nk.default{constructor(e,r={},n,o){super(e,r,n,o)}from(e){return new jk.default(this.url,this.headers,e,this.fetch)}get vectors(){return new Uk.StorageVectorsClient(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new Lk.default(this.url+"/iceberg",this.headers,this.fetch)}};Su.StorageClient=rd});var Ky=x(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0})});var Yy=x(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.StorageAnalyticsApi=Gr.StorageClient=void 0;var Fu=(fe(),re(le)),Mk=Gy();Object.defineProperty(Gr,"StorageClient",{enumerable:!0,get:function(){return Mk.StorageClient}});var qk=Up();Object.defineProperty(Gr,"StorageAnalyticsApi",{enumerable:!0,get:function(){return Fu.__importDefault(qk).default}});Fu.__exportStar(Ky(),Gr);Fu.__exportStar(mn(),Gr);Fu.__exportStar(td(),Gr)});var Jy=x(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.version=void 0;Au.version="2.79.0"});var Xy=x(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.DEFAULT_REALTIME_OPTIONS=Vt.DEFAULT_AUTH_OPTIONS=Vt.DEFAULT_DB_OPTIONS=Vt.DEFAULT_GLOBAL_OPTIONS=Vt.DEFAULT_HEADERS=void 0;var Hk=Jy(),Oa="";typeof Deno<"u"?Oa="deno":typeof document<"u"?Oa="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Oa="react-native":Oa="node";Vt.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${Oa}/${Hk.version}`};Vt.DEFAULT_GLOBAL_OPTIONS={headers:Vt.DEFAULT_HEADERS};Vt.DEFAULT_DB_OPTIONS={schema:"public"};Vt.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"};Vt.DEFAULT_REALTIME_OPTIONS={}});var Zy=x(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.fetchWithAuth=xr.resolveHeadersConstructor=xr.resolveFetch=void 0;var Vk=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);xr.resolveFetch=Vk;var zk=()=>Headers;xr.resolveHeadersConstructor=zk;var Gk=(t,e,r)=>{let n=(0,xr.resolveFetch)(r),o=(0,xr.resolveHeadersConstructor)();return async(i,a)=>{var s;let u=(s=await e())!==null&&s!==void 0?s:t,c=new o(a?.headers);return c.has("apikey")||c.set("apikey",t),c.has("Authorization")||c.set("Authorization",`Bearer ${u}`),n(i,Object.assign(Object.assign({},a),{headers:c}))}};xr.fetchWithAuth=Gk});var e0=x(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.isBrowser=void 0;Dn.uuid=Wk;Dn.ensureTrailingSlash=Qy;Dn.applySettingDefaults=Yk;Dn.validateSupabaseUrl=Jk;function Wk(){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)})}function Qy(t){return t.endsWith("/")?t:t+"/"}var Kk=()=>typeof window<"u";Dn.isBrowser=Kk;function Yk(t,e){var r,n;let{db:o,auth:i,realtime:a,global:s}=t,{db:u,auth:c,realtime:l,global:f}=e,d={db:Object.assign(Object.assign({},u),o),auth:Object.assign(Object.assign({},c),i),realtime:Object.assign(Object.assign({},l),a),storage:{},global:Object.assign(Object.assign(Object.assign({},f),s),{headers:Object.assign(Object.assign({},(r=f?.headers)!==null&&r!==void 0?r:{}),(n=s?.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return t.accessToken?d.accessToken=t.accessToken:delete d.accessToken,d}function Jk(t){let e=t?.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(Qy(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}});var gd={};qr(gd,{AuthAdminApi:()=>id,AuthApiError:()=>ad,AuthClient:()=>od,AuthError:()=>vr,AuthImplicitGrantRedirectError:()=>fd,AuthInvalidCredentialsError:()=>ld,AuthInvalidTokenResponseError:()=>cd,AuthPKCEGrantCodeExchangeError:()=>pd,AuthRetryableError:()=>sd,AuthSessionMissingError:()=>ud,AuthWeakPasswordError:()=>dd,GoTrueAdminApi:()=>ku,GoTrueClient:()=>Ou,NavigatorLockAcquireTimeoutError:()=>hd,isAuthApiError:()=>t3,isAuthError:()=>e3,isAuthRetryableError:()=>r3,isAuthSessionMissingError:()=>n3,isAuthWeakPasswordError:()=>o3,lockInternals:()=>Qk,navigatorLock:()=>Xk,processLock:()=>Zk});var md,t0,Ou,ku,od,id,vr,ad,sd,ud,cd,ld,fd,pd,dd,Xk,Zk,hd,Qk,e3,t3,r3,n3,o3,Dd=tt(()=>{md=()=>Promise.resolve({data:{session:null,user:null},error:null}),t0={get:(t,e)=>{if(e==="constructor")return t.constructor;if(!(e==="then"||e==="catch"||e==="finally")&&typeof e!="symbol")return e==="getSession"?()=>Promise.resolve({data:{session:null,user:null},error:null}):e==="onAuthStateChange"?()=>({data:{subscription:{unsubscribe:()=>{}}},error:null}):md}},Ou=class{constructor(e){return this.options=e,new Proxy(this,t0)}},ku=class{constructor(e){return this.options=e,new Proxy(this,t0)}},od=class extends Ou{},id=class extends ku{},vr=class extends Error{},ad=class extends vr{},sd=class extends vr{},ud=class extends vr{},cd=class extends vr{},ld=class extends vr{},fd=class extends vr{},pd=class extends vr{},dd=class extends vr{},Xk=md,Zk=md,hd=class extends Error{},Qk={},e3=()=>!1,t3=()=>!1,r3=()=>!1,n3=()=>!1,o3=()=>!1});var r0=x($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.SupabaseAuthClient=void 0;var i3=(Dd(),re(gd)),yd=class extends i3.AuthClient{constructor(e){super(e)}};$u.SupabaseAuthClient=yd});var wd=x(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var a3=ep(),s3=Dp(),u3=(vp(),re(bp)),c3=Yy(),Pu=Xy(),l3=Zy(),n0=e0(),f3=r0(),bd=class{constructor(e,r,n){var o,i,a;this.supabaseUrl=e,this.supabaseKey=r;let s=(0,n0.validateSupabaseUrl)(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);let u=`sb-${s.hostname.split(".")[0]}-auth-token`,c={db:Pu.DEFAULT_DB_OPTIONS,realtime:Pu.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},Pu.DEFAULT_AUTH_OPTIONS),{storageKey:u}),global:Pu.DEFAULT_GLOBAL_OPTIONS},l=(0,n0.applySettingDefaults)(n??{},c);this.storageKey=(o=l.auth.storageKey)!==null&&o!==void 0?o:"",this.headers=(i=l.global.headers)!==null&&i!==void 0?i:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(f,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((a=l.auth)!==null&&a!==void 0?a:{},this.headers,l.global.fetch),this.fetch=(0,l3.fetchWithAuth)(r,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.rest=new s3.PostgrestClient(new URL("rest/v1",s).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),this.storage=new c3.StorageClient(this.storageUrl.href,this.headers,this.fetch,n?.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new a3.FunctionsClient(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){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()}async _getAccessToken(){var e,r;if(this.accessToken)return await this.accessToken();let{data:n}=await this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:o,userStorage:i,storageKey:a,flowType:s,lock:u,debug:c,throwOnError:l},f,d){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new f3.SupabaseAuthClient({url:this.authUrl.href,headers:Object.assign(Object.assign({},h),f),storageKey:a,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:o,userStorage:i,flowType:s,lock:u,debug:c,throwOnError:l,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(m=>m.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new u3.RealtimeClient(this.realtimeUrl.href,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.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};vd.default=bd});var a0=x(Ie=>{"use strict";var p3=Ie&&Ie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),o0=Ie&&Ie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&p3(e,t,r)},i0=Ie&&Ie.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.createClient=Ie.SupabaseClient=Ie.FunctionRegion=Ie.FunctionsError=Ie.FunctionsRelayError=Ie.FunctionsFetchError=Ie.FunctionsHttpError=Ie.PostgrestError=void 0;var d3=i0(wd());o0((Dd(),re(gd)),Ie);var h3=Dp();Object.defineProperty(Ie,"PostgrestError",{enumerable:!0,get:function(){return h3.PostgrestError}});var ka=ep();Object.defineProperty(Ie,"FunctionsHttpError",{enumerable:!0,get:function(){return ka.FunctionsHttpError}});Object.defineProperty(Ie,"FunctionsFetchError",{enumerable:!0,get:function(){return ka.FunctionsFetchError}});Object.defineProperty(Ie,"FunctionsRelayError",{enumerable:!0,get:function(){return ka.FunctionsRelayError}});Object.defineProperty(Ie,"FunctionsError",{enumerable:!0,get:function(){return ka.FunctionsError}});Object.defineProperty(Ie,"FunctionRegion",{enumerable:!0,get:function(){return ka.FunctionRegion}});o0((vp(),re(bp)),Ie);var m3=wd();Object.defineProperty(Ie,"SupabaseClient",{enumerable:!0,get:function(){return i0(m3).default}});var g3=(t,e,r)=>new d3.default(t,e,r);Ie.createClient=g3;function D3(){if(typeof window<"u"||typeof process>"u")return!1;let t=process.version;if(t==null)return!1;let e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}D3()&&console.warn("\u26A0\uFE0F Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217")});var Cd=x((lV,s0)=>{s0.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 Tu=x(c0=>{var u0={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 y3(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(u0))c0[t]=y3(u0[t])});var h0=x((pV,d0)=>{var b3=require("fs"),rt=require("path"),l0=Cd(),v3=Tu(),w3=typeof process=="object"&&process.platform==="win32",f0=t=>typeof t=="object"&&t!==null,p0=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=3988292384^e>>>1:e>>>=1;return e>>>0});function We(t){this.sep=rt.sep,this.fs=b3,f0(t)&&f0(t.fs)&&typeof t.fs.statSync=="function"&&(this.fs=t.fs)}d0.exports=We;We.prototype.makeDir=function(t){let e=this;function r(n){let o=n.split(e.sep)[0];n.split(e.sep).forEach(function(i){if(!(!i||i.substr(-1,1)===":")){o+=e.sep+i;var a;try{a=e.fs.statSync(o)}catch{e.fs.mkdirSync(o)}if(a&&a.isFile())throw v3.FILE_IN_THE_WAY(`"${o}"`)}})}r(t)};We.prototype.writeFileTo=function(t,e,r,n){let o=this;if(o.fs.existsSync(t)){if(!r)return!1;var i=o.fs.statSync(t);if(i.isDirectory())return!1}var a=rt.dirname(t);o.fs.existsSync(a)||o.makeDir(a);var s;try{s=o.fs.openSync(t,"w",438)}catch{o.fs.chmodSync(t,438),s=o.fs.openSync(t,"w",438)}if(s)try{o.fs.writeSync(s,e,0,e.length,0)}finally{o.fs.closeSync(s)}return o.fs.chmodSync(t,n||438),!0};We.prototype.writeFileToAsync=function(t,e,r,n,o){typeof n=="function"&&(o=n,n=void 0);let i=this;i.fs.exists(t,function(a){if(a&&!r)return o(!1);i.fs.stat(t,function(s,u){if(a&&u.isDirectory())return o(!1);var c=rt.dirname(t);i.fs.exists(c,function(l){l||i.makeDir(c),i.fs.open(t,"w",438,function(f,d){f?i.fs.chmod(t,438,function(){i.fs.open(t,"w",438,function(h,m){i.fs.write(m,e,0,e.length,0,function(){i.fs.close(m,function(){i.fs.chmod(t,n||438,function(){o(!0)})})})})}):d?i.fs.write(d,e,0,e.length,0,function(){i.fs.close(d,function(){i.fs.chmod(t,n||438,function(){o(!0)})})}):i.fs.chmod(t,n||438,function(){o(!0)})})})})})};We.prototype.findFiles=function(t){let e=this;function r(n,o,i){typeof o=="boolean"&&(i=o,o=void 0);let a=[];return e.fs.readdirSync(n).forEach(function(s){let u=rt.join(n,s),c=e.fs.statSync(u);(!o||o.test(u))&&a.push(rt.normalize(u)+(c.isDirectory()?e.sep:"")),c.isDirectory()&&i&&(a=a.concat(r(u,o,i)))}),a}return r(t,void 0,!0)};We.prototype.findFilesAsync=function(t,e){let r=this,n=[];r.fs.readdir(t,function(o,i){if(o)return e(o);let a=i.length;if(!a)return e(null,n);i.forEach(function(s){s=rt.join(t,s),r.fs.stat(s,function(u,c){if(u)return e(u);c&&(n.push(rt.normalize(s)+(c.isDirectory()?r.sep:"")),c.isDirectory()?r.findFilesAsync(s,function(l,f){if(l)return e(l);n=n.concat(f),--a||e(null,n)}):--a||e(null,n))})})})};We.prototype.getAttributes=function(){};We.prototype.setAttributes=function(){};We.crc32update=function(t,e){return p0[(t^e)&255]^t>>>8};We.crc32=function(t){typeof t=="string"&&(t=Buffer.from(t,"utf8"));let e=t.length,r=-1;for(let n=0;n<e;)r=We.crc32update(r,t[n++]);return~r>>>0};We.methodToString=function(t){switch(t){case l0.STORED:return"STORED ("+t+")";case l0.DEFLATED:return"DEFLATED ("+t+")";default:return"UNSUPPORTED ("+t+")"}};We.canonical=function(t){if(!t)return"";let e=rt.posix.normalize("/"+t.split("\\").join("/"));return rt.join(".",e)};We.zipnamefix=function(t){if(!t)return"";let e=rt.posix.normalize("/"+t.split("\\").join("/"));return rt.posix.join(".",e)};We.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]};We.sanitize=function(t,e){t=rt.resolve(rt.normalize(t));for(var r=e.split("/"),n=0,o=r.length;n<o;n++){var i=rt.normalize(rt.join(t,r.slice(n,o).join(rt.sep)));if(i.indexOf(t)===0)return i}return rt.normalize(rt.join(t,rt.basename(e)))};We.toBuffer=function(e,r){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e=="string"?r(e):Buffer.alloc(0)};We.readBigUInt64LE=function(t,e){var r=Buffer.from(t.slice(e,e+8));return r.swap64(),parseInt(`0x${r.toString("hex")}`)};We.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)};We.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};We.isWin=w3;We.crcTable=p0});var g0=x((dV,m0)=>{var C3=require("path");m0.exports=function(t,{fs:e}){var r=t||"",n=i(),o=null;function i(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return r&&e.existsSync(r)?(o=e.statSync(r),n.directory=o.isDirectory(),n.mtime=o.mtime,n.atime=o.atime,n.executable=(73&o.mode)!==0,n.readonly=(128&o.mode)===0,n.hidden=C3.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 y0=x((hV,D0)=>{D0.exports={efs:!0,encode:t=>Buffer.from(t,"utf8"),decode:t=>t.toString("utf8")}});var Xo=x((mV,Jo)=>{Jo.exports=h0();Jo.exports.Constants=Cd();Jo.exports.Errors=Tu();Jo.exports.FileAttr=g0();Jo.exports.decoder=y0()});var v0=x((gV,b0)=>{var yn=Xo(),W=yn.Constants;b0.exports=function(){var t=20,e=10,r=0,n=0,o=0,i=0,a=0,s=0,u=0,c=0,l=0,f=0,d=0,h=0,m=0;t|=yn.isWin?2560:768,r|=W.FLG_EFS;let b={extraLen:0},D=g=>Math.max(0,g)>>>0,C=g=>Math.max(0,g)&65535,E=g=>Math.max(0,g)&255;return o=yn.fromDate2DOS(new Date),{get made(){return t},set made(g){t=g},get version(){return e},set version(g){e=g},get flags(){return r},set flags(g){r=g},get flags_efs(){return(r&W.FLG_EFS)>0},set flags_efs(g){g?r|=W.FLG_EFS:r&=~W.FLG_EFS},get flags_desc(){return(r&W.FLG_DESC)>0},set flags_desc(g){g?r|=W.FLG_DESC:r&=~W.FLG_DESC},get method(){return n},set method(g){switch(g){case W.STORED:this.version=10;case W.DEFLATED:default:this.version=20}n=g},get time(){return yn.fromDOS2Date(this.timeval)},set time(g){this.timeval=yn.fromDate2DOS(g)},get timeval(){return o},set timeval(g){o=D(g)},get timeHighByte(){return E(o>>>8)},get crc(){return i},set crc(g){i=D(g)},get compressedSize(){return a},set compressedSize(g){a=D(g)},get size(){return s},set size(g){s=D(g)},get fileNameLength(){return u},set fileNameLength(g){u=g},get extraLength(){return c},set extraLength(g){c=g},get extraLocalLength(){return b.extraLen},set extraLocalLength(g){b.extraLen=g},get commentLength(){return l},set commentLength(g){l=g},get diskNumStart(){return f},set diskNumStart(g){f=D(g)},get inAttr(){return d},set inAttr(g){d=D(g)},get attr(){return h},set attr(g){h=D(g)},get fileAttr(){return(h||0)>>16&4095},get offset(){return m},set offset(g){m=D(g)},get encrypted(){return(r&W.FLG_ENC)===W.FLG_ENC},get centralHeaderSize(){return W.CENHDR+u+c+l},get realDataOffset(){return m+W.LOCHDR+b.fnameLen+b.extraLen},get localHeader(){return b},loadLocalHeaderFromBinary:function(g){var _=g.slice(m,m+W.LOCHDR);if(_.readUInt32LE(0)!==W.LOCSIG)throw yn.Errors.INVALID_LOC();b.version=_.readUInt16LE(W.LOCVER),b.flags=_.readUInt16LE(W.LOCFLG),b.method=_.readUInt16LE(W.LOCHOW),b.time=_.readUInt32LE(W.LOCTIM),b.crc=_.readUInt32LE(W.LOCCRC),b.compressedSize=_.readUInt32LE(W.LOCSIZ),b.size=_.readUInt32LE(W.LOCLEN),b.fnameLen=_.readUInt16LE(W.LOCNAM),b.extraLen=_.readUInt16LE(W.LOCEXT);let S=m+W.LOCHDR+b.fnameLen,P=S+b.extraLen;return g.slice(S,P)},loadFromBinary:function(g){if(g.length!==W.CENHDR||g.readUInt32LE(0)!==W.CENSIG)throw yn.Errors.INVALID_CEN();t=g.readUInt16LE(W.CENVEM),e=g.readUInt16LE(W.CENVER),r=g.readUInt16LE(W.CENFLG),n=g.readUInt16LE(W.CENHOW),o=g.readUInt32LE(W.CENTIM),i=g.readUInt32LE(W.CENCRC),a=g.readUInt32LE(W.CENSIZ),s=g.readUInt32LE(W.CENLEN),u=g.readUInt16LE(W.CENNAM),c=g.readUInt16LE(W.CENEXT),l=g.readUInt16LE(W.CENCOM),f=g.readUInt16LE(W.CENDSK),d=g.readUInt16LE(W.CENATT),h=g.readUInt32LE(W.CENATX),m=g.readUInt32LE(W.CENOFF)},localHeaderToBinary:function(){var g=Buffer.alloc(W.LOCHDR);return g.writeUInt32LE(W.LOCSIG,0),g.writeUInt16LE(e,W.LOCVER),g.writeUInt16LE(r,W.LOCFLG),g.writeUInt16LE(n,W.LOCHOW),g.writeUInt32LE(o,W.LOCTIM),g.writeUInt32LE(i,W.LOCCRC),g.writeUInt32LE(a,W.LOCSIZ),g.writeUInt32LE(s,W.LOCLEN),g.writeUInt16LE(u,W.LOCNAM),g.writeUInt16LE(b.extraLen,W.LOCEXT),g},centralHeaderToBinary:function(){var g=Buffer.alloc(W.CENHDR+u+c+l);return g.writeUInt32LE(W.CENSIG,0),g.writeUInt16LE(t,W.CENVEM),g.writeUInt16LE(e,W.CENVER),g.writeUInt16LE(r,W.CENFLG),g.writeUInt16LE(n,W.CENHOW),g.writeUInt32LE(o,W.CENTIM),g.writeUInt32LE(i,W.CENCRC),g.writeUInt32LE(a,W.CENSIZ),g.writeUInt32LE(s,W.CENLEN),g.writeUInt16LE(u,W.CENNAM),g.writeUInt16LE(c,W.CENEXT),g.writeUInt16LE(l,W.CENCOM),g.writeUInt16LE(f,W.CENDSK),g.writeUInt16LE(d,W.CENATT),g.writeUInt32LE(h,W.CENATX),g.writeUInt32LE(m,W.CENOFF),g},toJSON:function(){let g=function(_){return _+" bytes"};return{made:t,version:e,flags:r,method:yn.methodToString(n),time:this.time,crc:"0x"+i.toString(16).toUpperCase(),compressedSize:g(a),size:g(s),fileNameLength:g(u),extraLength:g(c),commentLength:g(l),diskNumStart:f,inAttr:d,attr:h,offset:m,centralHeaderSize:g(W.CENHDR+u+c+l)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var C0=x((DV,w0)=>{var Zo=Xo(),He=Zo.Constants;w0.exports=function(){var t=0,e=0,r=0,n=0,o=0;return{get diskEntries(){return t},set diskEntries(i){t=e=i},get totalEntries(){return e},set totalEntries(i){e=t=i},get size(){return r},set size(i){r=i},get offset(){return n},set offset(i){n=i},get commentLength(){return o},set commentLength(i){o=i},get mainHeaderSize(){return He.ENDHDR+o},loadFromBinary:function(i){if((i.length!==He.ENDHDR||i.readUInt32LE(0)!==He.ENDSIG)&&(i.length<He.ZIP64HDR||i.readUInt32LE(0)!==He.ZIP64SIG))throw Zo.Errors.INVALID_END();i.readUInt32LE(0)===He.ENDSIG?(t=i.readUInt16LE(He.ENDSUB),e=i.readUInt16LE(He.ENDTOT),r=i.readUInt32LE(He.ENDSIZ),n=i.readUInt32LE(He.ENDOFF),o=i.readUInt16LE(He.ENDCOM)):(t=Zo.readBigUInt64LE(i,He.ZIP64SUB),e=Zo.readBigUInt64LE(i,He.ZIP64TOT),r=Zo.readBigUInt64LE(i,He.ZIP64SIZE),n=Zo.readBigUInt64LE(i,He.ZIP64OFF),o=0)},toBinary:function(){var i=Buffer.alloc(He.ENDHDR+o);return i.writeUInt32LE(He.ENDSIG,0),i.writeUInt32LE(0,4),i.writeUInt16LE(t,He.ENDSUB),i.writeUInt16LE(e,He.ENDTOT),i.writeUInt32LE(r,He.ENDSIZ),i.writeUInt32LE(n,He.ENDOFF),i.writeUInt16LE(o,He.ENDCOM),i.fill(" ",He.ENDHDR),i},toJSON:function(){let i=function(a,s){let u=a.toString(16).toUpperCase();for(;u.length<s;)u="0"+u;return"0x"+u};return{diskEntries:t,totalEntries:e,size:r+" bytes",offset:i(n,4),commentLength:o}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var _d=x(Ed=>{Ed.EntryHeader=v0();Ed.MainHeader=C0()});var _0=x((bV,E0)=>{E0.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 o=e.createDeflateRaw(r),i=[],a=0;o.on("data",function(s){i.push(s),a+=s.length}),o.on("end",function(){var s=Buffer.alloc(a),u=0;s.fill(0);for(var c=0;c<i.length;c++){var l=i[c];l.copy(s,u),u+=l.length}n&&n(s)}),o.end(t)}}}});var S0=x((vV,x0)=>{var E3=+(process.versions?process.versions.node:"").split(".")[0]||0;x0.exports=function(t,e){var r=require("zlib");let n=E3>=15&&e>0?{maxOutputLength:e}:{};return{inflate:function(){return r.inflateRawSync(t,n)},inflateAsync:function(o){var i=r.createInflateRaw(n),a=[],s=0;i.on("data",function(u){a.push(u),s+=u.length}),i.on("end",function(){var u=Buffer.alloc(s),c=0;u.fill(0);for(var l=0;l<a.length;l++){var f=a[l];f.copy(u,c),c+=f.length}o&&o(u)}),i.end(t)}}}});var $0=x((wV,k0)=>{"use strict";var{randomFillSync:F0}=require("crypto"),_3=Tu(),x3=new Uint32Array(256).map((t,e)=>{for(let r=0;r<8;r++)(e&1)!==0?e=e>>>1^3988292384:e>>>=1;return e>>>0}),O0=(t,e)=>Math.imul(t,e)>>>0,A0=(t,e)=>x3[(t^e)&255]^t>>>8,$a=()=>typeof F0=="function"?F0(Buffer.alloc(12)):$a.node();$a.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 Iu={genSalt:$a};function Ru(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])}Ru.prototype.updateKeys=function(t){let e=this.keys;return e[0]=A0(e[0],t),e[1]+=e[0]&255,e[1]=O0(e[1],134775813)+1,e[2]=A0(e[2],e[1]>>>24),t};Ru.prototype.next=function(){let t=(this.keys[2]|2)>>>0;return O0(t,t^1)>>8&255};function S3(t){let e=new Ru(t);return function(r){let n=Buffer.alloc(r.length),o=0;for(let i of r)n[o++]=e.updateKeys(i^e.next());return n}}function F3(t){let e=new Ru(t);return function(r,n,o=0){n||(n=Buffer.alloc(r.length));for(let i of r){let a=e.next();n[o++]=i^a,e.updateKeys(i)}return n}}function A3(t,e,r){if(!t||!Buffer.isBuffer(t)||t.length<12)return Buffer.alloc(0);let n=S3(r),o=n(t.slice(0,12)),i=(e.flags&8)===8?e.timeHighByte:e.crc>>>24;if(o[11]!==i)throw _3.WRONG_PASSWORD();return n(t.slice(12))}function O3(t){Buffer.isBuffer(t)&&t.length>=12?Iu.genSalt=function(){return t.slice(0,12)}:t==="node"?Iu.genSalt=$a.node:Iu.genSalt=$a}function k3(t,e,r,n=!1){t==null&&(t=Buffer.alloc(0)),Buffer.isBuffer(t)||(t=Buffer.from(t.toString()));let o=F3(r),i=Iu.genSalt();i[11]=e.crc>>>24&255,n&&(i[10]=e.crc>>>16&255);let a=Buffer.alloc(t.length+12);return o(i,a),o(t,a,12)}k0.exports={decrypt:A3,encrypt:k3,_salter:O3}});var P0=x(Bu=>{Bu.Deflater=_0();Bu.Inflater=S0();Bu.ZipCrypto=$0()});var Sd=x((EV,T0)=>{var xe=Xo(),$3=_d(),Ke=xe.Constants,xd=P0();T0.exports=function(t,e){var r=new $3.EntryHeader,n=Buffer.alloc(0),o=Buffer.alloc(0),i=!1,a=null,s=Buffer.alloc(0),u=Buffer.alloc(0),c=!0;let l=t,f=typeof l.decoder=="object"?l.decoder:xe.decoder;c=f.hasOwnProperty("efs")?f.efs:!1;function d(){return!e||!(e instanceof Uint8Array)?Buffer.alloc(0):(u=r.loadLocalHeaderFromBinary(e),e.slice(r.realDataOffset,r.realDataOffset+r.compressedSize))}function h(g){if(r.flags_desc){let _={},S=r.realDataOffset+r.compressedSize;if(e.readUInt32LE(S)==Ke.LOCSIG||e.readUInt32LE(S)==Ke.CENSIG)throw xe.Errors.DESCRIPTOR_NOT_EXIST();if(e.readUInt32LE(S)==Ke.EXTSIG)_.crc=e.readUInt32LE(S+Ke.EXTCRC),_.compressedSize=e.readUInt32LE(S+Ke.EXTSIZ),_.size=e.readUInt32LE(S+Ke.EXTLEN);else if(e.readUInt16LE(S+12)===19280)_.crc=e.readUInt32LE(S+Ke.EXTCRC-4),_.compressedSize=e.readUInt32LE(S+Ke.EXTSIZ-4),_.size=e.readUInt32LE(S+Ke.EXTLEN-4);else throw xe.Errors.DESCRIPTOR_UNKNOWN();if(_.compressedSize!==r.compressedSize||_.size!==r.size||_.crc!==r.crc)throw xe.Errors.DESCRIPTOR_FAULTY();if(xe.crc32(g)!==_.crc)return!1}else if(xe.crc32(g)!==r.localHeader.crc)return!1;return!0}function m(g,_,S){if(typeof _>"u"&&typeof g=="string"&&(S=g,g=void 0),i)return g&&_&&_(Buffer.alloc(0),xe.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var P=d();if(P.length===0)return g&&_&&_(P),P;if(r.encrypted){if(typeof S!="string"&&!Buffer.isBuffer(S))throw xe.Errors.INVALID_PASS_PARAM();P=xd.ZipCrypto.decrypt(P,r,S)}var k=Buffer.alloc(r.size);switch(r.method){case xe.Constants.STORED:if(P.copy(k),h(k))return g&&_&&_(k),k;throw g&&_&&_(k,xe.Errors.BAD_CRC()),xe.Errors.BAD_CRC();case xe.Constants.DEFLATED:var B=new xd.Inflater(P,r.size);if(g)B.inflateAsync(function(R){R.copy(R,0),_&&(h(R)?_(R):_(R,xe.Errors.BAD_CRC()))});else{if(B.inflate(k).copy(k,0),!h(k))throw xe.Errors.BAD_CRC(`"${f.decode(n)}"`);return k}break;default:throw g&&_&&_(Buffer.alloc(0),xe.Errors.UNKNOWN_METHOD()),xe.Errors.UNKNOWN_METHOD()}}function b(g,_){if((!a||!a.length)&&Buffer.isBuffer(e))return g&&_&&_(d()),d();if(a.length&&!i){var S;switch(r.method){case xe.Constants.STORED:return r.compressedSize=r.size,S=Buffer.alloc(a.length),a.copy(S),g&&_&&_(S),S;default:case xe.Constants.DEFLATED:var P=new xd.Deflater(a);if(g)P.deflateAsync(function(B){S=Buffer.alloc(B.length),r.compressedSize=B.length,B.copy(S),_&&_(S)});else{var k=P.deflate();return r.compressedSize=k.length,k}P=null;break}}else if(g&&_)_(Buffer.alloc(0));else return Buffer.alloc(0)}function D(g,_){return(g.readUInt32LE(_+4)<<4)+g.readUInt32LE(_)}function C(g){try{for(var _=0,S,P,k;_+4<g.length;)S=g.readUInt16LE(_),_+=2,P=g.readUInt16LE(_),_+=2,k=g.slice(_,_+P),_+=P,Ke.ID_ZIP64===S&&E(k)}catch{throw xe.Errors.EXTRA_FIELD_PARSE_ERROR()}}function E(g){var _,S,P,k;g.length>=Ke.EF_ZIP64_SCOMP&&(_=D(g,Ke.EF_ZIP64_SUNCOMP),r.size===Ke.EF_ZIP64_OR_32&&(r.size=_)),g.length>=Ke.EF_ZIP64_RHO&&(S=D(g,Ke.EF_ZIP64_SCOMP),r.compressedSize===Ke.EF_ZIP64_OR_32&&(r.compressedSize=S)),g.length>=Ke.EF_ZIP64_DSN&&(P=D(g,Ke.EF_ZIP64_RHO),r.offset===Ke.EF_ZIP64_OR_32&&(r.offset=P)),g.length>=Ke.EF_ZIP64_DSN+4&&(k=g.readUInt32LE(Ke.EF_ZIP64_DSN),r.diskNumStart===Ke.EF_ZIP64_OR_16&&(r.diskNumStart=k))}return{get entryName(){return f.decode(n)},get rawEntryName(){return n},set entryName(g){n=xe.toBuffer(g,f.encode);var _=n[n.length-1];i=_===47||_===92,r.fileNameLength=n.length},get efs(){return typeof c=="function"?c(this.entryName):c},get extra(){return s},set extra(g){s=g,r.extraLength=g.length,C(g)},get comment(){return f.decode(o)},set comment(g){if(o=xe.toBuffer(g,f.encode),r.commentLength=o.length,o.length>65535)throw xe.Errors.COMMENT_TOO_LONG()},get name(){var g=f.decode(n);return i?g.substr(g.length-1).split("/").pop():g.split("/").pop()},get isDirectory(){return i},getCompressedData:function(){return b(!1,null)},getCompressedDataAsync:function(g){b(!0,g)},setData:function(g){a=xe.toBuffer(g,xe.decoder.encode),!i&&a.length?(r.size=a.length,r.method=xe.Constants.DEFLATED,r.crc=xe.crc32(g),r.changed=!0):r.method=xe.Constants.STORED},getData:function(g){return r.changed?a:m(!1,null,g)},getDataAsync:function(g,_){r.changed?g(a):m(!0,g,_)},set attr(g){r.attr=g},get attr(){return r.attr},set header(g){r.loadFromBinary(g)},get header(){return r},packCentralHeader:function(){r.flags_efs=this.efs,r.extraLength=s.length;var g=r.centralHeaderToBinary(),_=xe.Constants.CENHDR;return n.copy(g,_),_+=n.length,s.copy(g,_),_+=r.extraLength,o.copy(g,_),g},packLocalHeader:function(){let g=0;r.flags_efs=this.efs,r.extraLocalLength=u.length;let _=r.localHeaderToBinary(),S=Buffer.alloc(_.length+n.length+r.extraLocalLength);return _.copy(S,g),g+=_.length,n.copy(S,g),g+=n.length,u.copy(S,g),g+=u.length,S},toJSON:function(){let g=function(_){return"<"+(_&&_.length+" bytes buffer"||"null")+">"};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:r.toJSON(),compressedData:g(e),data:g(a)}},toString:function(){return JSON.stringify(this.toJSON(),null," ")}}}});var B0=x((_V,R0)=>{var I0=Sd(),P3=_d(),pt=Xo();R0.exports=function(t,e){var r=[],n={},o=Buffer.alloc(0),i=new P3.MainHeader,a=!1,s=null;let u=new Set,c=e,{noSort:l,decoder:f}=c;t?m(c.readEntries):a=!0;function d(){let D=new Set;for(let C of Object.keys(n)){let E=C.split("/");if(E.pop(),!!E.length)for(let g=0;g<E.length;g++){let _=E.slice(0,g+1).join("/")+"/";D.add(_)}}for(let C of D)if(!(C in n)){let E=new I0(c);E.entryName=C,E.attr=16,E.temporary=!0,r.push(E),n[E.entryName]=E,u.add(E)}}function h(){if(a=!0,n={},i.diskEntries>(t.length-i.offset)/pt.Constants.CENHDR)throw pt.Errors.DISK_ENTRY_TOO_LARGE();r=new Array(i.diskEntries);for(var D=i.offset,C=0;C<r.length;C++){var E=D,g=new I0(c,t);g.header=t.slice(E,E+=pt.Constants.CENHDR),g.entryName=t.slice(E,E+=g.header.fileNameLength),g.header.extraLength&&(g.extra=t.slice(E,E+=g.header.extraLength)),g.header.commentLength&&(g.comment=t.slice(E,E+g.header.commentLength)),D+=g.header.centralHeaderSize,r[C]=g,n[g.entryName]=g}u.clear(),d()}function m(D){var C=t.length-pt.Constants.ENDHDR,E=Math.max(0,C-65535),g=E,_=t.length,S=-1,P=0;for((typeof c.trailingSpace=="boolean"?c.trailingSpace:!1)&&(E=0),C;C>=g;C--)if(t[C]===80){if(t.readUInt32LE(C)===pt.Constants.ENDSIG){S=C,P=C,_=C+pt.Constants.ENDHDR,g=C-pt.Constants.END64HDR;continue}if(t.readUInt32LE(C)===pt.Constants.END64SIG){g=E;continue}if(t.readUInt32LE(C)===pt.Constants.ZIP64SIG){S=C,_=C+pt.readBigUInt64LE(t,C+pt.Constants.ZIP64SIZE)+pt.Constants.ZIP64LEAD;break}}if(S==-1)throw pt.Errors.INVALID_FORMAT();i.loadFromBinary(t.slice(S,_)),i.commentLength&&(o=t.slice(P+pt.Constants.ENDHDR)),D&&h()}function b(){r.length>1&&!l&&r.sort((D,C)=>D.entryName.toLowerCase().localeCompare(C.entryName.toLowerCase()))}return{get entries(){return a||h(),r.filter(D=>!u.has(D))},get comment(){return f.decode(o)},set comment(D){o=pt.toBuffer(D,f.encode),i.commentLength=o.length},getEntryCount:function(){return a?r.length:i.diskEntries},forEach:function(D){this.entries.forEach(D)},getEntry:function(D){return a||h(),n[D]||null},setEntry:function(D){a||h(),r.push(D),n[D.entryName]=D,i.totalEntries=r.length},deleteFile:function(D,C=!0){a||h();let E=n[D];this.getEntryChildren(E,C).map(_=>_.entryName).forEach(this.deleteEntry)},deleteEntry:function(D){a||h();let C=n[D],E=r.indexOf(C);E>=0&&(r.splice(E,1),delete n[D],i.totalEntries=r.length)},getEntryChildren:function(D,C=!0){if(a||h(),typeof D=="object")if(D.isDirectory&&C){let E=[],g=D.entryName;for(let _ of r)_.entryName.startsWith(g)&&E.push(_);return E}else return[D];return[]},getChildCount:function(D){if(D&&D.isDirectory){let C=this.getEntryChildren(D);return C.includes(D)?C.length-1:C.length}return 0},compressToBuffer:function(){a||h(),b();let D=[],C=[],E=0,g=0;i.size=0,i.offset=0;let _=0;for(let k of this.entries){let B=k.getCompressedData();k.header.offset=g;let R=k.packLocalHeader(),N=R.length+B.length;g+=N,D.push(R),D.push(B);let A=k.packCentralHeader();C.push(A),i.size+=A.length,E+=N+A.length,_++}E+=i.mainHeaderSize,i.offset=g,i.totalEntries=_,g=0;let S=Buffer.alloc(E);for(let k of D)k.copy(S,g),g+=k.length;for(let k of C)k.copy(S,g),g+=k.length;let P=i.toBinary();return o&&o.copy(P,pt.Constants.ENDHDR),P.copy(S,g),t=S,a=!1,S},toAsyncBuffer:function(D,C,E,g){try{a||h(),b();let _=[],S=[],P=0,k=0,B=0;i.size=0,i.offset=0;let R=function(N){if(N.length>0){let A=N.shift(),U=A.entryName+A.extra.toString();E&&E(U),A.getCompressedDataAsync(function(M){g&&g(U),A.header.offset=k;let Q=A.packLocalHeader(),$=Q.length+M.length;k+=$,_.push(Q),_.push(M);let y=A.packCentralHeader();S.push(y),i.size+=y.length,P+=$+y.length,B++,R(N)})}else{P+=i.mainHeaderSize,i.offset=k,i.totalEntries=B,k=0;let A=Buffer.alloc(P);_.forEach(function(M){M.copy(A,k),k+=M.length}),S.forEach(function(M){M.copy(A,k),k+=M.length});let U=i.toBinary();o&&o.copy(U,pt.Constants.ENDHDR),U.copy(A,k),t=A,a=!1,D(A)}};R(Array.from(this.entries))}catch(_){C(_)}}}}});var L0=x((xV,N0)=>{var Ve=Xo(),Ye=require("path"),T3=Sd(),I3=B0(),Gn=(...t)=>Ve.findLast(t,e=>typeof e=="boolean"),j0=(...t)=>Ve.findLast(t,e=>typeof e=="string"),R3=(...t)=>Ve.findLast(t,e=>typeof e=="function"),B3={noSort:!1,readEntries:!1,method:Ve.Constants.NONE,fs:null};N0.exports=function(t,e){let r=null,n=Object.assign(Object.create(null),B3);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=Ve.Constants.BUFFER,t=void 0)),Object.assign(n,e);let o=new Ve(n);if((typeof n.decoder!="object"||typeof n.decoder.encode!="function"||typeof n.decoder.decode!="function")&&(n.decoder=Ve.decoder),t&&typeof t=="string")if(o.fs.existsSync(t))n.method=Ve.Constants.FILE,n.filename=t,r=o.fs.readFileSync(t);else throw Ve.Errors.INVALID_FILENAME();let i=new I3(r,n),{canonical:a,sanitize:s,zipnamefix:u}=Ve;function c(h){if(h&&i){var m;if(typeof h=="string"&&(m=i.getEntry(Ye.posix.normalize(h))),typeof h=="object"&&typeof h.entryName<"u"&&typeof h.header<"u"&&(m=i.getEntry(h.entryName)),m)return m}return null}function l(h){let{join:m,normalize:b,sep:D}=Ye.posix;return m(".",b(D+h.split("\\").join(D)+D))}function f(h){return h instanceof RegExp?(function(m){return function(b){return m.test(b)}})(h):typeof h!="function"?()=>!0:h}let d=(h,m)=>{let b=m.slice(-1);return b=b===o.sep?o.sep:"",Ye.relative(h,m)+b};return{readFile:function(h,m){var b=c(h);return b&&b.getData(m)||null},childCount:function(h){let m=c(h);if(m)return i.getChildCount(m)},readFileAsync:function(h,m){var b=c(h);b?b.getDataAsync(m):m(null,"getEntry failed for:"+h)},readAsText:function(h,m){var b=c(h);if(b){var D=b.getData();if(D&&D.length)return D.toString(m||"utf8")}return""},readAsTextAsync:function(h,m,b){var D=c(h);D?D.getDataAsync(function(C,E){if(E){m(C,E);return}C&&C.length?m(C.toString(b||"utf8")):m("")}):m("")},deleteFile:function(h,m=!0){var b=c(h);b&&i.deleteFile(b.entryName,m)},deleteEntry:function(h){var m=c(h);m&&i.deleteEntry(m.entryName)},addZipComment:function(h){i.comment=h},getZipComment:function(){return i.comment||""},addZipEntryComment:function(h,m){var b=c(h);b&&(b.comment=m)},getZipEntryComment:function(h){var m=c(h);return m&&m.comment||""},updateFile:function(h,m){var b=c(h);b&&b.setData(m)},addLocalFile:function(h,m,b,D){if(o.fs.existsSync(h)){m=m?l(m):"";let C=Ye.win32.basename(Ye.win32.normalize(h));m+=b||C;let E=o.fs.statSync(h),g=E.isFile()?o.fs.readFileSync(h):Buffer.alloc(0);E.isDirectory()&&(m+=o.sep),this.addFile(m,g,D,E)}else throw Ve.Errors.FILE_NOT_FOUND(h)},addLocalFileAsync:function(h,m){h=typeof h=="object"?h:{localPath:h};let b=Ye.resolve(h.localPath),{comment:D}=h,{zipPath:C,zipName:E}=h,g=this;o.fs.stat(b,function(_,S){if(_)return m(_,!1);C=C?l(C):"";let P=Ye.win32.basename(Ye.win32.normalize(b));if(C+=E||P,S.isFile())o.fs.readFile(b,function(k,B){return k?m(k,!1):(g.addFile(C,B,D,S),setImmediate(m,void 0,!0))});else if(S.isDirectory())return C+=o.sep,g.addFile(C,Buffer.alloc(0),D,S),setImmediate(m,void 0,!0)})},addLocalFolder:function(h,m,b){if(b=f(b),m=m?l(m):"",h=Ye.normalize(h),o.fs.existsSync(h)){let D=o.findFiles(h),C=this;if(D.length)for(let E of D){let g=Ye.join(m,d(h,E));b(g)&&C.addLocalFile(E,Ye.dirname(g))}}else throw Ve.Errors.FILE_NOT_FOUND(h)},addLocalFolderAsync:function(h,m,b,D){D=f(D),b=b?l(b):"",h=Ye.normalize(h);var C=this;o.fs.open(h,"r",function(E){if(E&&E.code==="ENOENT")m(void 0,Ve.Errors.FILE_NOT_FOUND(h));else if(E)m(void 0,E);else{var g=o.findFiles(h),_=-1,S=function(){if(_+=1,_<g.length){var P=g[_],k=d(h,P).split("\\").join("/");k=k.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,""),D(k)?o.fs.stat(P,function(B,R){B&&m(void 0,B),R.isFile()?o.fs.readFile(P,function(N,A){N?m(void 0,N):(C.addFile(b+k,A,"",R),S())}):(C.addFile(b+k+"/",Buffer.alloc(0),"",R),S())}):process.nextTick(()=>{S()})}else m(!0,void 0)};S()}})},addLocalFolderAsync2:function(h,m){let b=this;h=typeof h=="object"?h:{localPath:h},localPath=Ye.resolve(l(h.localPath));let{zipPath:D,filter:C,namefix:E}=h;C instanceof RegExp?C=(function(S){return function(P){return S.test(P)}})(C):typeof C!="function"&&(C=function(){return!0}),D=D?l(D):"",E=="latin1"&&(E=S=>S.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\x20-\x7E]/g,"")),typeof E!="function"&&(E=S=>S);let g=S=>Ye.join(D,E(d(localPath,S))),_=S=>Ye.win32.basename(Ye.win32.normalize(E(S)));o.fs.open(localPath,"r",function(S){S&&S.code==="ENOENT"?m(void 0,Ve.Errors.FILE_NOT_FOUND(localPath)):S?m(void 0,S):o.findFilesAsync(localPath,function(P,k){if(P)return m(P);k=k.filter(B=>C(g(B))),k.length||m(void 0,!1),setImmediate(k.reverse().reduce(function(B,R){return function(N,A){if(N||A===!1)return setImmediate(B,N,!1);b.addLocalFileAsync({localPath:R,zipPath:Ye.dirname(g(R)),zipName:_(R)},B)}},m))})})},addLocalFolderPromise:function(h,m){return new Promise((b,D)=>{this.addLocalFolderAsync2(Object.assign({localPath:h},m),(C,E)=>{C&&D(C),E&&b(this)})})},addFile:function(h,m,b,D){h=u(h);let C=c(h),E=C!=null;E||(C=new T3(n),C.entryName=h),C.comment=b||"";let g=typeof D=="object"&&D instanceof o.fs.Stats;g&&(C.header.time=D.mtime);var _=C.isDirectory?16:0;let S=C.isDirectory?16384:32768;return g?S|=4095&D.mode:typeof D=="number"?S|=4095&D:S|=C.isDirectory?493:420,_=(_|S<<16)>>>0,C.attr=_,C.setData(m),E||i.setEntry(C),C},getEntries:function(h){return i.password=h,i?i.entries:[]},getEntry:function(h){return c(h)},getEntryCount:function(){return i.getEntryCount()},forEach:function(h){return i.forEach(h)},extractEntryTo:function(h,m,b,D,C,E){D=Gn(!1,D),C=Gn(!1,C),b=Gn(!0,b),E=j0(C,E);var g=c(h);if(!g)throw Ve.Errors.NO_ENTRY();var _=a(g.entryName),S=s(m,E&&!g.isDirectory?E:b?_:Ye.basename(_));if(g.isDirectory){var P=i.getEntryChildren(g);return P.forEach(function(R){if(R.isDirectory)return;var N=R.getData();if(!N)throw Ve.Errors.CANT_EXTRACT_FILE();var A=a(R.entryName),U=s(m,b?A:Ye.basename(A));let M=C?R.header.fileAttr:void 0;o.writeFileTo(U,N,D,M)}),!0}var k=g.getData(i.password);if(!k)throw Ve.Errors.CANT_EXTRACT_FILE();if(o.fs.existsSync(S)&&!D)throw Ve.Errors.CANT_OVERRIDE();let B=C?h.header.fileAttr:void 0;return o.writeFileTo(S,k,D,B),!0},test:function(h){if(!i)return!1;for(var m in i.entries)try{if(m.isDirectory)continue;var b=i.entries[m].getData(h);if(!b)return!1}catch{return!1}return!0},extractAllTo:function(h,m,b,D){if(b=Gn(!1,b),D=j0(b,D),m=Gn(!1,m),!i)throw Ve.Errors.NO_ZIP();i.entries.forEach(function(C){var E=s(h,a(C.entryName));if(C.isDirectory){o.makeDir(E);return}var g=C.getData(D);if(!g)throw Ve.Errors.CANT_EXTRACT_FILE();let _=b?C.header.fileAttr:void 0;o.writeFileTo(E,g,m,_);try{o.fs.utimesSync(E,C.header.time,C.header.time)}catch{throw Ve.Errors.CANT_EXTRACT_FILE()}})},extractAllToAsync:function(h,m,b,D){if(D=R3(m,b,D),b=Gn(!1,b),m=Gn(!1,m),!D)return new Promise((S,P)=>{this.extractAllToAsync(h,m,b,function(k){k?P(k):S(this)})});if(!i){D(Ve.Errors.NO_ZIP());return}h=Ye.resolve(h);let C=S=>s(h,Ye.normalize(a(S.entryName))),E=(S,P)=>new Error(S+': "'+P+'"'),g=[],_=[];i.entries.forEach(S=>{S.isDirectory?g.push(S):_.push(S)});for(let S of g){let P=C(S),k=b?S.header.fileAttr:void 0;try{o.makeDir(P),k&&o.fs.chmodSync(P,k),o.fs.utimesSync(P,S.header.time,S.header.time)}catch{D(E("Unable to create folder",P))}}_.reverse().reduce(function(S,P){return function(k){if(k)S(k);else{let B=Ye.normalize(a(P.entryName)),R=s(h,B);P.getDataAsync(function(N,A){if(A)S(A);else if(!N)S(Ve.Errors.CANT_EXTRACT_FILE());else{let U=b?P.header.fileAttr:void 0;o.writeFileToAsync(R,N,m,U,function(M){M||S(E("Unable to write file",R)),o.fs.utimes(R,P.header.time,P.header.time,function(Q){Q?S(E("Unable to set times",R)):S()})})}})}}},D)()},writeZip:function(h,m){if(arguments.length===1&&typeof h=="function"&&(m=h,h=""),!h&&n.filename&&(h=n.filename),!!h){var b=i.compressToBuffer();if(b){var D=o.writeFileTo(h,b,!0);typeof m=="function"&&m(D?null:new Error("failed"),"")}}},writeZipPromise:function(h,m){let{overwrite:b,perm:D}=Object.assign({overwrite:!0},m);return new Promise((C,E)=>{!h&&n.filename&&(h=n.filename),h||E("ADM-ZIP: ZIP File Name Missing"),this.toBufferPromise().then(g=>{let _=S=>S?C(S):E("ADM-ZIP: Wasn't able to write zip file");o.writeFileToAsync(h,g,b,D,_)},E)})},toBufferPromise:function(){return new Promise((h,m)=>{i.toAsyncBuffer(h,m)})},toBuffer:function(h,m,b,D){return typeof h=="function"?(i.toAsyncBuffer(h,m,b,D),null):i.compressToBuffer()}}}});var H0=x((SV,q0)=>{var M0={};q0.exports=M0;var U0={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(U0).forEach(function(t){var e=U0[t],r=M0[t]=[];r.open="\x1B["+e[0]+"m",r.close="\x1B["+e[1]+"m"})});var z0=x((FV,V0)=>{"use strict";V0.exports=function(t,e){e=e||process.argv;var r=e.indexOf("--"),n=/^-{1,2}/.test(t)?"":"--",o=e.indexOf(n+t);return o!==-1&&(r===-1?!0:o<r)}});var W0=x((AV,G0)=>{"use strict";var j3=require("os"),wr=z0(),Ft=process.env,Qo=void 0;wr("no-color")||wr("no-colors")||wr("color=false")?Qo=!1:(wr("color")||wr("colors")||wr("color=true")||wr("color=always"))&&(Qo=!0);"FORCE_COLOR"in Ft&&(Qo=Ft.FORCE_COLOR.length===0||parseInt(Ft.FORCE_COLOR,10)!==0);function N3(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function L3(t){if(Qo===!1)return 0;if(wr("color=16m")||wr("color=full")||wr("color=truecolor"))return 3;if(wr("color=256"))return 2;if(t&&!t.isTTY&&Qo!==!0)return 0;var e=Qo?1:0;if(process.platform==="win32"){var r=j3.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 Ft)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(o){return o in Ft})||Ft.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Ft)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ft.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Ft){var n=parseInt((Ft.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ft.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ft.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ft.TERM)||"COLORTERM"in Ft?1:(Ft.TERM==="dumb",e)}function Fd(t){var e=L3(t);return N3(e)}G0.exports={supportsColor:Fd,stdout:Fd(process.stdout),stderr:Fd(process.stderr)}});var Y0=x((OV,K0)=>{K0.exports=function(e,r){var n="";e=e||"Run the trap, drop the bass",e=e.split("");var o={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(i){i=i.toLowerCase();var a=o[i]||[" "],s=Math.floor(Math.random()*a.length);typeof o[i]<"u"?n+=o[i][s]:n+=i}),n}});var X0=x((kV,J0)=>{J0.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"]},o=[].concat(n.up,n.down,n.mid);function i(u){var c=Math.floor(Math.random()*u);return c}function a(u){var c=!1;return o.filter(function(l){c=l===u}),c}function s(u,c){var l="",f,d;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(d in u)if(!a(d)){switch(l=l+u[d],f={up:0,down:0,mid:0},c.size){case"mini":f.up=i(8),f.mid=i(2),f.down=i(8);break;case"maxi":f.up=i(16)+3,f.mid=i(4)+1,f.down=i(64)+3;break;default:f.up=i(8)+1,f.mid=i(6)/2,f.down=i(8)+1;break}var h=["up","mid","down"];for(var m in h)for(var b=h[m],D=0;D<=f[b];D++)c[b]&&(l=l+n[b][i(n[b].length)])}return l}return s(e,r)}});var Q0=x(($V,Z0)=>{Z0.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 tb=x((PV,eb)=>{eb.exports=function(t){return function(e,r,n){return r%2===0?e:t.inverse(e)}}});var nb=x((TV,rb)=>{rb.exports=function(t){var e=["red","yellow","green","blue","magenta"];return function(r,n,o){return r===" "?r:t[e[n++%e.length]](r)}}});var ib=x((IV,ob)=>{ob.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,o){return r===" "?r:t[e[Math.round(Math.random()*(e.length-2))]](r)}}});var fb=x((BV,lb)=>{var ce={};lb.exports=ce;ce.themes={};var U3=require("util"),Wn=ce.styles=H0(),sb=Object.defineProperties,M3=new RegExp(/[\r\n]+/g);ce.supportsColor=W0().supportsColor;typeof ce.enabled>"u"&&(ce.enabled=ce.supportsColor()!==!1);ce.enable=function(){ce.enabled=!0};ce.disable=function(){ce.enabled=!1};ce.stripColors=ce.strip=function(t){return(""+t).replace(/\x1B\[\d+m/g,"")};var RV=ce.stylize=function(e,r){if(!ce.enabled)return e+"";var n=Wn[r];return!n&&r in ce?ce[r](e):n.open+e+n.close},q3=/[|\\{}()[\]^$+*?.]/g,H3=function(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(q3,"\\$&")};function ub(t){var e=function r(){return z3.apply(r,arguments)};return e._styles=t,e.__proto__=V3,e}var cb=(function(){var t={};return Wn.grey=Wn.gray,Object.keys(Wn).forEach(function(e){Wn[e].closeRe=new RegExp(H3(Wn[e].close),"g"),t[e]={get:function(){return ub(this._styles.concat(e))}}}),t})(),V3=sb(function(){},cb);function z3(){var t=Array.prototype.slice.call(arguments),e=t.map(function(a){return a!=null&&a.constructor===String?a:U3.inspect(a)}).join(" ");if(!ce.enabled||!e)return e;for(var r=e.indexOf(`
|
|
28
28
|
`)!=-1,n=this._styles,o=n.length;o--;){var i=Wn[n[o]];e=i.open+e.replace(i.closeRe,i.open)+i.close,r&&(e=e.replace(M3,function(a){return i.close+a+i.open}))}return e}ce.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){ce[r]=function(n){if(typeof t[r]=="object"){var o=n;for(var i in t[r])o=ce[t[r][i]](o);return o}return ce[t[r]](n)}})(e)};function G3(){var t={};return Object.keys(cb).forEach(function(e){t[e]={get:function(){return ub([e])}}}),t}var W3=function(e,r){var n=r.split("");return n=n.map(e),n.join("")};ce.trap=Y0();ce.zalgo=X0();ce.maps={};ce.maps.america=Q0()(ce);ce.maps.zebra=tb()(ce);ce.maps.rainbow=nb()(ce);ce.maps.random=ib()(ce);for(ab in ce.maps)(function(t){ce[t]=function(e){return W3(ce.maps[t],e)}})(ab);var ab;sb(ce,G3())});var db=x((jV,pb)=>{var K3=fb();pb.exports=K3});var hb=x(Ad=>{"use strict";Ad.indent=function(e){return new Array(e+1).join(" ")};Ad.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 mb=x((LV,Y3)=>{Y3.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 gb=x(Pa=>{"use strict";var Sr=db(),bn=hb(),J3=/[^\w\s\n\r\v\t\.,]/i;Pa.version=mb().version;var Od=function(t,e){return t!==void 0||e.renderUndefined},ju=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(`
|
|
29
29
|
`)===-1||r.inlineArrays&&!e&&Array.isArray(t)&&ju(t[0],!0,r))},X3=function(t,e){if(e.noColor)return t;if(typeof t=="string")return e.stringColor?Sr[e.stringColor](t):t;var r=t+"";return t===!0?Sr.green(r):t===!1?Sr.red(r):t==null?Sr.grey(r):typeof t=="number"?t>=0?Sr[e.positiveNumberColor](r):Sr[e.negativeNumberColor](r):typeof t=="function"?"function() {}":Array.isArray(t)?t.join(", "):r},kd=function(t,e){return t.multilineStringColor===null||t.noColor?e:Sr[t.multilineStringColor](e)},Z3=function(t,e,r){var n=t.split(`
|
|
30
30
|
`);return n=n.map(function(o){return bn.indent(e)+kd(r,o)}),n.join(`
|
|
31
31
|
`)},ei=function(t,e,r){if(typeof t=="string"&&t.match(J3)&&e.escape&&(t=JSON.stringify(t)),!Od(t,e))return[];if(ju(t,!1,e))return[bn.indent(r)+X3(t,e)];if(typeof t=="string")return[bn.indent(r)+kd(e,'"""'),Z3(t,r+e.defaultIndentation,e),bn.indent(r)+kd(e,'"""')];if(Array.isArray(t)){if(t.length===0)return[bn.indent(r)+e.emptyArrayMsg];var n=[];return t.forEach(function(s){if(Od(s,e)){var u="- ";e.noColor||(u=Sr[e.dashColor](u)),u=bn.indent(r)+u,ju(s,!1,e)?(u+=ei(s,e,0)[0],n.push(u)):(n.push(u),n.push.apply(n,ei(s,e,r+e.defaultIndentation)))}}),n}if(t instanceof Error)return ei({message:t.message,stack:t.stack.split(`
|
|
32
32
|
`)},e,r);var o=e.noAlign?0:bn.getMaxIndexLength(t),i,a=[];return Object.getOwnPropertyNames(t).forEach(function(s){if(Od(t[s],e))if(i=s+": ",e.noColor||(i=Sr[e.keysColor](i)),i=bn.indent(r)+i,ju(t[s],!1,e)){var u=e.noAlign?0:o-s.length;i+=ei(t[s],e,u)[0],a.push(i)}else a.push(i),a.push.apply(a,ei(t[s],e,r+e.defaultIndentation))}),a};Pa.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,ei(e,r,n).join(`
|
|
33
33
|
`)};Pa.renderString=function(e,r,n){var o="",i;if(typeof e!="string"||e==="")return"";if(e[0]!=="{"&&e[0]!=="["){var a;e.indexOf("{")===-1?a=e.indexOf("["):e.indexOf("[")===-1||e.indexOf("{")<e.indexOf("[")?a=e.indexOf("{"):a=e.indexOf("["),o+=e.substr(0,a)+`
|
|
34
|
-
`,e=e.substr(a)}try{i=JSON.parse(e)}catch{return Sr.red("Error:")+" Not valid JSON!"}return o+=Pa.render(i,r,n),o}});var Td=x(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.default=void 0;function ti(t){"@babel/helpers - typeof";return ti=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},ti(t)}function Db(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,e$(n.key),n)}}function Q3(t,e,r){return e&&Db(t.prototype,e),r&&Db(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function e$(t){var e=t$(t,"string");return ti(e)=="symbol"?e:e+""}function t$(t,e){if(ti(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ti(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function r$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n$(t,e,r){return e=Ia(e),o$(t,Pd()?Reflect.construct(e,r||[],Ia(t).constructor):e.apply(t,r))}function o$(t,e){if(e&&(ti(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i$(t)}function i$(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a$(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&&Ta(t,e)}function $d(t){var e=typeof Map=="function"?new Map:void 0;return $d=function(n){if(n===null||!u$(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,o)}function o(){return s$(n,arguments,Ia(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Ta(o,n)},$d(t)}function s$(t,e,r){if(Pd())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&Ta(o,r.prototype),o}function Pd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Pd=function(){return!!t})()}function u$(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Ta(t,e){return Ta=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ta(t,e)}function Ia(t){return Ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ia(t)}var c$=(function(t){function e(r){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(r$(this,e),n=n$(this,e,[r]),n.originalRequest=i,n.originalResponse=a,n.causingError=o,o!=null&&(r+=", caused by ".concat(o.toString())),i!=null){var s=i.getHeader("X-Request-ID")||"n/a",u=i.getMethod(),c=i.getURL(),l=a?a.getStatus():"n/a",f=a?a.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(f,", request id: ").concat(s,")")}return n.message=r,n}return a$(e,t),Q3(e)})($d(Error)),MV=Nu.default=c$});var Id=x(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.enableDebugLog=l$;Lu.log=f$;var yb=!1;function l$(){yb=!0}function f$(t){yb&&console.log(t)}});var vb=x(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.default=void 0;function Ra(t){"@babel/helpers - typeof";return Ra=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},Ra(t)}function p$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bb(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,h$(n.key),n)}}function d$(t,e,r){return e&&bb(t.prototype,e),r&&bb(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function h$(t){var e=m$(t,"string");return Ra(e)=="symbol"?e:e+""}function m$(t,e){if(Ra(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ra(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var VV=Uu.default=(function(){function t(){p$(this,t)}return d$(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 wb=x((Rd,Bd)=>{(function(t,e){typeof Rd=="object"&&typeof Bd<"u"?Bd.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:Rd,function(){"use strict";var t="3.7.8",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,o=typeof TextEncoder=="function"?new TextEncoder:void 0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=Array.prototype.slice.call(i),s=(function(P){var j={};return P.forEach(function(ee,V){return j[ee]=V}),j})(a),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(P){return new Uint8Array(Array.prototype.slice.call(P,0))},f=function(P){return P.replace(/=/g,"").replace(/[+\/]/g,function(j){return j=="+"?"-":"_"})},d=function(P){return P.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(P){for(var j,ee,V,se,dr="",z=P.length%3,Ee=0;Ee<P.length;){if((ee=P.charCodeAt(Ee++))>255||(V=P.charCodeAt(Ee++))>255||(se=P.charCodeAt(Ee++))>255)throw new TypeError("invalid character found");j=ee<<16|V<<8|se,dr+=a[j>>18&63]+a[j>>12&63]+a[j>>6&63]+a[j&63]}return z?dr.slice(0,z-3)+"===".substring(z):dr},m=typeof btoa=="function"?function(P){return btoa(P)}:r?function(P){return Buffer.from(P,"binary").toString("base64")}:h,b=r?function(P){return Buffer.from(P).toString("base64")}:function(P){for(var j=4096,ee=[],V=0,se=P.length;V<se;V+=j)ee.push(c.apply(null,P.subarray(V,V+j)));return m(ee.join(""))},D=function(P,j){return j===void 0&&(j=!1),j?f(b(P)):b(P)},C=function(P){if(P.length<2){var j=P.charCodeAt(0);return j<128?P:j<2048?c(192|j>>>6)+c(128|j&63):c(224|j>>>12&15)+c(128|j>>>6&63)+c(128|j&63)}else{var j=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return c(240|j>>>18&7)+c(128|j>>>12&63)+c(128|j>>>6&63)+c(128|j&63)}},E=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,g=function(P){return P.replace(E,C)},_=r?function(P){return Buffer.from(P,"utf8").toString("base64")}:o?function(P){return b(o.encode(P))}:function(P){return m(g(P))},S=function(P,j){return j===void 0&&(j=!1),j?f(_(P)):_(P)},T=function(P){return S(P,!0)},k=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,B=function(P){switch(P.length){case 4:var j=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),ee=j-65536;return c((ee>>>10)+55296)+c((ee&1023)+56320);case 3:return c((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return c((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},R=function(P){return P.replace(k,B)},N=function(P){if(P=P.replace(/\s+/g,""),!u.test(P))throw new TypeError("malformed base64.");P+="==".slice(2-(P.length&3));for(var j,ee,V,se=[],dr=0;dr<P.length;)j=s[P.charAt(dr++)]<<18|s[P.charAt(dr++)]<<12|(ee=s[P.charAt(dr++)])<<6|(V=s[P.charAt(dr++)]),ee===64?se.push(c(j>>16&255)):V===64?se.push(c(j>>16&255,j>>8&255)):se.push(c(j>>16&255,j>>8&255,j&255));return se.join("")},A=typeof atob=="function"?function(P){return atob(d(P))}:r?function(P){return Buffer.from(P,"base64").toString("binary")}:N,U=r?function(P){return l(Buffer.from(P,"base64"))}:function(P){return l(A(P).split("").map(function(j){return j.charCodeAt(0)}))},M=function(P){return U($(P))},Q=r?function(P){return Buffer.from(P,"base64").toString("utf8")}:n?function(P){return n.decode(U(P))}:function(P){return R(A(P))},$=function(P){return d(P.replace(/[-_]/g,function(j){return j=="-"?"+":"/"}))},y=function(P){return Q($(P))},v=function(P){if(typeof P!="string")return!1;var j=P.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(j)||!/[^\s0-9a-zA-Z\-_]/.test(j)},w=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}},F=function(){var P=function(j,ee){return Object.defineProperty(String.prototype,j,w(ee))};P("fromBase64",function(){return y(this)}),P("toBase64",function(j){return S(this,j)}),P("toBase64URI",function(){return S(this,!0)}),P("toBase64URL",function(){return S(this,!0)}),P("toUint8Array",function(){return M(this)})},I=function(){var P=function(j,ee){return Object.defineProperty(Uint8Array.prototype,j,w(ee))};P("toBase64",function(j){return D(this,j)}),P("toBase64URI",function(){return D(this,!0)}),P("toBase64URL",function(){return D(this,!0)})},O=function(){F(),I()},q={version:t,VERSION:e,atob:A,atobPolyfill:N,btoa:m,btoaPolyfill:h,fromBase64:y,toBase64:S,encode:S,encodeURI:T,encodeURL:T,utob:g,btou:R,decode:y,isValid:v,fromUint8Array:D,toUint8Array:M,extendString:F,extendUint8Array:I,extendBuiltins:O};return q.Base64={},Object.keys(q).forEach(function(P){return q.Base64[P]=q[P]}),q})});var Eb=x((GV,Cb)=>{"use strict";Cb.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 Sb=x(jd=>{"use strict";var g$=Object.prototype.hasOwnProperty,D$;function _b(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function xb(t){try{return encodeURIComponent(t)}catch{return null}}function y$(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var o=_b(n[1]),i=_b(n[2]);o===null||i===null||o in r||(r[o]=i)}return r}function b$(t,e){e=e||"";var r=[],n,o;typeof e!="string"&&(e="?");for(o in t)if(g$.call(t,o)){if(n=t[o],!n&&(n===null||n===D$||isNaN(n))&&(n=""),o=xb(o),n=xb(n),o===null||n===null)continue;r.push(o+"="+n)}return r.length?e+r.join("&"):""}jd.stringify=b$;jd.parse=y$});var Ib=x((KV,Tb)=>{"use strict";var Ab=Eb(),Mu=Sb(),v$=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Ob=/[\n\r\t]/g,w$=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,kb=/:\d+$/,C$=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,E$=/^[a-zA-Z]:/;function Ld(t){return(t||"").toString().replace(v$,"")}var Nd=[["#","hash"],["?","query"],function(e,r){return Fr(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]],Fb={hash:1,query:1};function $b(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={},o=typeof t,i;if(t.protocol==="blob:")n=new Ar(unescape(t.pathname),{});else if(o==="string"){n=new Ar(t,{});for(i in Fb)delete n[i]}else if(o==="object"){for(i in t)i in Fb||(n[i]=t[i]);n.slashes===void 0&&(n.slashes=w$.test(t.href))}return n}function Fr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function Pb(t,e){t=Ld(t),t=t.replace(Ob,""),e=e||{};var r=C$.exec(t),n=r[1]?r[1].toLowerCase():"",o=!!r[2],i=!!r[3],a=0,s;return o?i?(s=r[2]+r[3]+r[4],a=r[2].length+r[3].length):(s=r[2]+r[4],a=r[2].length):i?(s=r[3]+r[4],a=r[3].length):s=r[4],n==="file:"?a>=2&&(s=s.slice(2)):Fr(n)?s=r[4]:n?o&&(s=s.slice(2)):a>=2&&Fr(e.protocol)&&(s=r[4]),{protocol:n,slashes:o||Fr(n),slashesCount:a,rest:s}}function _$(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,o=r[n-1],i=!1,a=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),a++):a&&(n===0&&(i=!0),r.splice(n,1),a--);return i&&r.unshift(""),(o==="."||o==="..")&&r.push(""),r.join("/")}function Ar(t,e,r){if(t=Ld(t),t=t.replace(Ob,""),!(this instanceof Ar))return new Ar(t,e,r);var n,o,i,a,s,u,c=Nd.slice(),l=typeof e,f=this,d=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=Mu.parse),e=$b(e),o=Pb(t||"",e),n=!o.protocol&&!o.slashes,f.slashes=o.slashes||n&&e.slashes,f.protocol=o.protocol||e.protocol||"",t=o.rest,(o.protocol==="file:"&&(o.slashesCount!==2||E$.test(t))||!o.slashes&&(o.protocol||o.slashesCount<2||!Fr(f.protocol)))&&(c[3]=[/(.*)/,"pathname"]);d<c.length;d++){if(a=c[d],typeof a=="function"){t=a(t,f);continue}i=a[0],u=a[1],i!==i?f[u]=t:typeof i=="string"?(s=i==="@"?t.lastIndexOf(i):t.indexOf(i),~s&&(typeof a[2]=="number"?(f[u]=t.slice(0,s),t=t.slice(s+a[2])):(f[u]=t.slice(s),t=t.slice(0,s)))):(s=i.exec(t))&&(f[u]=s[1],t=t.slice(0,s.index)),f[u]=f[u]||n&&a[3]&&e[u]||"",a[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=_$(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Fr(f.protocol)&&(f.pathname="/"+f.pathname),Ab(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(s=f.auth.indexOf(":"),~s?(f.username=f.auth.slice(0,s),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(s+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:"&&Fr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function x$(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||Mu.parse)(e)),n[t]=e;break;case"port":n[t]=e,Ab(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,kb.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 o=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==o?o+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var i=e.indexOf(":");~i?(n.username=e.slice(0,i),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(i+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var a=0;a<Nd.length;a++){var s=Nd[a];s[4]&&(n[s[1]]=n[s[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Fr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function S$(t){(!t||typeof t!="function")&&(t=Mu.stringify);var e,r=this,n=r.host,o=r.protocol;o&&o.charAt(o.length-1)!==":"&&(o+=":");var i=o+(r.protocol&&r.slashes||Fr(r.protocol)?"//":"");return r.username?(i+=r.username,r.password&&(i+=":"+r.password),i+="@"):r.password?(i+=":"+r.password,i+="@"):r.protocol!=="file:"&&Fr(r.protocol)&&!n&&r.pathname!=="/"&&(i+="@"),(n[n.length-1]===":"||kb.test(r.hostname)&&!r.port)&&(n+=":"),i+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(i+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(i+=r.hash),i}Ar.prototype={set:x$,toString:S$};Ar.extractProtocol=Pb;Ar.location=$b;Ar.trimLeft=Ld;Ar.qs=Mu;Tb.exports=Ar});var Rb=x(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.default=F$;function F$(){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 Jb=x(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.default=void 0;var A$=wb(),O$=Hd(Ib()),qu=Hd(Td()),Kn=Id(),k$=Hd(Rb());function Hd(t){return t&&t.__esModule?t:{default:t}}function Md(){"use strict";Md=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(y,v,w){y[v]=w.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(y,v,w){return Object.defineProperty(y,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),y[v]}try{c({},"")}catch{c=function(w,F,I){return w[F]=I}}function l(y,v,w,F){var I=v&&v.prototype instanceof C?v:C,O=Object.create(I.prototype),q=new Q(F||[]);return o(O,"_invoke",{value:N(y,w,q)}),O}function f(y,v,w){try{return{type:"normal",arg:y.call(v,w)}}catch(F){return{type:"throw",arg:F}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",m="executing",b="completed",D={};function C(){}function E(){}function g(){}var _={};c(_,a,function(){return this});var S=Object.getPrototypeOf,T=S&&S(S($([])));T&&T!==r&&n.call(T,a)&&(_=T);var k=g.prototype=C.prototype=Object.create(_);function B(y){["next","throw","return"].forEach(function(v){c(y,v,function(w){return this._invoke(v,w)})})}function R(y,v){function w(I,O,q,P){var j=f(y[I],y,O);if(j.type!=="throw"){var ee=j.arg,V=ee.value;return V&&Yn(V)=="object"&&n.call(V,"__await")?v.resolve(V.__await).then(function(se){w("next",se,q,P)},function(se){w("throw",se,q,P)}):v.resolve(V).then(function(se){ee.value=se,q(ee)},function(se){return w("throw",se,q,P)})}P(j.arg)}var F;o(this,"_invoke",{value:function(O,q){function P(){return new v(function(j,ee){w(O,q,j,ee)})}return F=F?F.then(P,P):P()}})}function N(y,v,w){var F=d;return function(I,O){if(F===m)throw Error("Generator is already running");if(F===b){if(I==="throw")throw O;return{value:t,done:!0}}for(w.method=I,w.arg=O;;){var q=w.delegate;if(q){var P=A(q,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(F===d)throw F=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);F=m;var j=f(y,v,w);if(j.type==="normal"){if(F=w.done?b:h,j.arg===D)continue;return{value:j.arg,done:w.done}}j.type==="throw"&&(F=b,w.method="throw",w.arg=j.arg)}}}function A(y,v){var w=v.method,F=y.iterator[w];if(F===t)return v.delegate=null,w==="throw"&&y.iterator.return&&(v.method="return",v.arg=t,A(y,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var I=f(F,y.iterator,v.arg);if(I.type==="throw")return v.method="throw",v.arg=I.arg,v.delegate=null,D;var O=I.arg;return O?O.done?(v[y.resultName]=O.value,v.next=y.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):O:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function U(y){var v={tryLoc:y[0]};1 in y&&(v.catchLoc=y[1]),2 in y&&(v.finallyLoc=y[2],v.afterLoc=y[3]),this.tryEntries.push(v)}function M(y){var v=y.completion||{};v.type="normal",delete v.arg,y.completion=v}function Q(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(U,this),this.reset(!0)}function $(y){if(y||y===""){var v=y[a];if(v)return v.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var w=-1,F=function I(){for(;++w<y.length;)if(n.call(y,w))return I.value=y[w],I.done=!1,I;return I.value=t,I.done=!0,I};return F.next=F}}throw new TypeError(Yn(y)+" is not iterable")}return E.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:E,configurable:!0}),E.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(y){var v=typeof y=="function"&&y.constructor;return!!v&&(v===E||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,g):(y.__proto__=g,c(y,u,"GeneratorFunction")),y.prototype=Object.create(k),y},e.awrap=function(y){return{__await:y}},B(R.prototype),c(R.prototype,s,function(){return this}),e.AsyncIterator=R,e.async=function(y,v,w,F,I){I===void 0&&(I=Promise);var O=new R(l(y,v,w,F),I);return e.isGeneratorFunction(v)?O:O.next().then(function(q){return q.done?q.value:O.next()})},B(k),c(k,u,"Generator"),c(k,a,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(y){var v=Object(y),w=[];for(var F in v)w.push(F);return w.reverse(),function I(){for(;w.length;){var O=w.pop();if(O in v)return I.value=O,I.done=!1,I}return I.done=!0,I}},e.values=$,Q.prototype={constructor:Q,reset:function(v){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(M),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function F(ee,V){return q.type="throw",q.arg=v,w.next=ee,V&&(w.method="next",w.arg=t),!!V}for(var I=this.tryEntries.length-1;I>=0;--I){var O=this.tryEntries[I],q=O.completion;if(O.tryLoc==="root")return F("end");if(O.tryLoc<=this.prev){var P=n.call(O,"catchLoc"),j=n.call(O,"finallyLoc");if(P&&j){if(this.prev<O.catchLoc)return F(O.catchLoc,!0);if(this.prev<O.finallyLoc)return F(O.finallyLoc)}else if(P){if(this.prev<O.catchLoc)return F(O.catchLoc,!0)}else{if(!j)throw Error("try statement without catch or finally");if(this.prev<O.finallyLoc)return F(O.finallyLoc)}}}},abrupt:function(v,w){for(var F=this.tryEntries.length-1;F>=0;--F){var I=this.tryEntries[F];if(I.tryLoc<=this.prev&&n.call(I,"finallyLoc")&&this.prev<I.finallyLoc){var O=I;break}}O&&(v==="break"||v==="continue")&&O.tryLoc<=w&&w<=O.finallyLoc&&(O=null);var q=O?O.completion:{};return q.type=v,q.arg=w,O?(this.method="next",this.next=O.finallyLoc,D):this.complete(q)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.finallyLoc===v)return this.complete(F.completion,F.afterLoc),M(F),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.tryLoc===v){var I=F.completion;if(I.type==="throw"){var O=I.arg;M(F)}return O}}throw Error("illegal catch attempt")},delegateYield:function(v,w,F){return this.delegate={iterator:$(v),resultName:w,nextLoc:F},this.method==="next"&&(this.arg=t),D}},e}function Bb(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(c){r(c);return}s.done?e(u):Promise.resolve(u).then(n,o)}function $$(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(u){Bb(i,n,o,a,s,"next",u)}function s(u){Bb(i,n,o,a,s,"throw",u)}a(void 0)})}}function zb(t,e){return I$(t)||T$(t,e)||Gb(t,e)||P$()}function P$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
34
|
+
`,e=e.substr(a)}try{i=JSON.parse(e)}catch{return Sr.red("Error:")+" Not valid JSON!"}return o+=Pa.render(i,r,n),o}});var Td=x(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.default=void 0;function ti(t){"@babel/helpers - typeof";return ti=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},ti(t)}function Db(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,e$(n.key),n)}}function Q3(t,e,r){return e&&Db(t.prototype,e),r&&Db(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function e$(t){var e=t$(t,"string");return ti(e)=="symbol"?e:e+""}function t$(t,e){if(ti(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ti(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function r$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n$(t,e,r){return e=Ia(e),o$(t,Pd()?Reflect.construct(e,r||[],Ia(t).constructor):e.apply(t,r))}function o$(t,e){if(e&&(ti(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return i$(t)}function i$(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function a$(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&&Ta(t,e)}function $d(t){var e=typeof Map=="function"?new Map:void 0;return $d=function(n){if(n===null||!u$(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,o)}function o(){return s$(n,arguments,Ia(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Ta(o,n)},$d(t)}function s$(t,e,r){if(Pd())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&Ta(o,r.prototype),o}function Pd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Pd=function(){return!!t})()}function u$(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Ta(t,e){return Ta=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ta(t,e)}function Ia(t){return Ia=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ia(t)}var c$=(function(t){function e(r){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(r$(this,e),n=n$(this,e,[r]),n.originalRequest=i,n.originalResponse=a,n.causingError=o,o!=null&&(r+=", caused by ".concat(o.toString())),i!=null){var s=i.getHeader("X-Request-ID")||"n/a",u=i.getMethod(),c=i.getURL(),l=a?a.getStatus():"n/a",f=a?a.getBody()||"":"n/a";r+=", originated from request (method: ".concat(u,", url: ").concat(c,", response code: ").concat(l,", response text: ").concat(f,", request id: ").concat(s,")")}return n.message=r,n}return a$(e,t),Q3(e)})($d(Error)),MV=Nu.default=c$});var Id=x(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.enableDebugLog=l$;Lu.log=f$;var yb=!1;function l$(){yb=!0}function f$(t){yb&&console.log(t)}});var vb=x(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.default=void 0;function Ra(t){"@babel/helpers - typeof";return Ra=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},Ra(t)}function p$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bb(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,h$(n.key),n)}}function d$(t,e,r){return e&&bb(t.prototype,e),r&&bb(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function h$(t){var e=m$(t,"string");return Ra(e)=="symbol"?e:e+""}function m$(t,e){if(Ra(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ra(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var VV=Uu.default=(function(){function t(){p$(this,t)}return d$(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 wb=x((Rd,Bd)=>{(function(t,e){typeof Rd=="object"&&typeof Bd<"u"?Bd.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:Rd,function(){"use strict";var t="3.7.8",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,o=typeof TextEncoder=="function"?new TextEncoder:void 0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=Array.prototype.slice.call(i),s=(function(T){var j={};return T.forEach(function(ee,V){return j[ee]=V}),j})(a),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(j){return j=="+"?"-":"_"})},d=function(T){return T.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(T){for(var j,ee,V,se,dr="",z=T.length%3,Ee=0;Ee<T.length;){if((ee=T.charCodeAt(Ee++))>255||(V=T.charCodeAt(Ee++))>255||(se=T.charCodeAt(Ee++))>255)throw new TypeError("invalid character found");j=ee<<16|V<<8|se,dr+=a[j>>18&63]+a[j>>12&63]+a[j>>6&63]+a[j&63]}return z?dr.slice(0,z-3)+"===".substring(z):dr},m=typeof btoa=="function"?function(T){return btoa(T)}:r?function(T){return Buffer.from(T,"binary").toString("base64")}:h,b=r?function(T){return Buffer.from(T).toString("base64")}:function(T){for(var j=4096,ee=[],V=0,se=T.length;V<se;V+=j)ee.push(c.apply(null,T.subarray(V,V+j)));return m(ee.join(""))},D=function(T,j){return j===void 0&&(j=!1),j?f(b(T)):b(T)},C=function(T){if(T.length<2){var j=T.charCodeAt(0);return j<128?T:j<2048?c(192|j>>>6)+c(128|j&63):c(224|j>>>12&15)+c(128|j>>>6&63)+c(128|j&63)}else{var j=65536+(T.charCodeAt(0)-55296)*1024+(T.charCodeAt(1)-56320);return c(240|j>>>18&7)+c(128|j>>>12&63)+c(128|j>>>6&63)+c(128|j&63)}},E=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,g=function(T){return T.replace(E,C)},_=r?function(T){return Buffer.from(T,"utf8").toString("base64")}:o?function(T){return b(o.encode(T))}:function(T){return m(g(T))},S=function(T,j){return j===void 0&&(j=!1),j?f(_(T)):_(T)},P=function(T){return S(T,!0)},k=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,B=function(T){switch(T.length){case 4:var j=(7&T.charCodeAt(0))<<18|(63&T.charCodeAt(1))<<12|(63&T.charCodeAt(2))<<6|63&T.charCodeAt(3),ee=j-65536;return c((ee>>>10)+55296)+c((ee&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))}},R=function(T){return T.replace(k,B)},N=function(T){if(T=T.replace(/\s+/g,""),!u.test(T))throw new TypeError("malformed base64.");T+="==".slice(2-(T.length&3));for(var j,ee,V,se=[],dr=0;dr<T.length;)j=s[T.charAt(dr++)]<<18|s[T.charAt(dr++)]<<12|(ee=s[T.charAt(dr++)])<<6|(V=s[T.charAt(dr++)]),ee===64?se.push(c(j>>16&255)):V===64?se.push(c(j>>16&255,j>>8&255)):se.push(c(j>>16&255,j>>8&255,j&255));return se.join("")},A=typeof atob=="function"?function(T){return atob(d(T))}:r?function(T){return Buffer.from(T,"base64").toString("binary")}:N,U=r?function(T){return l(Buffer.from(T,"base64"))}:function(T){return l(A(T).split("").map(function(j){return j.charCodeAt(0)}))},M=function(T){return U($(T))},Q=r?function(T){return Buffer.from(T,"base64").toString("utf8")}:n?function(T){return n.decode(U(T))}:function(T){return R(A(T))},$=function(T){return d(T.replace(/[-_]/g,function(j){return j=="-"?"+":"/"}))},y=function(T){return Q($(T))},v=function(T){if(typeof T!="string")return!1;var j=T.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(j)||!/[^\s0-9a-zA-Z\-_]/.test(j)},w=function(T){return{value:T,enumerable:!1,writable:!0,configurable:!0}},F=function(){var T=function(j,ee){return Object.defineProperty(String.prototype,j,w(ee))};T("fromBase64",function(){return y(this)}),T("toBase64",function(j){return S(this,j)}),T("toBase64URI",function(){return S(this,!0)}),T("toBase64URL",function(){return S(this,!0)}),T("toUint8Array",function(){return M(this)})},I=function(){var T=function(j,ee){return Object.defineProperty(Uint8Array.prototype,j,w(ee))};T("toBase64",function(j){return D(this,j)}),T("toBase64URI",function(){return D(this,!0)}),T("toBase64URL",function(){return D(this,!0)})},O=function(){F(),I()},q={version:t,VERSION:e,atob:A,atobPolyfill:N,btoa:m,btoaPolyfill:h,fromBase64:y,toBase64:S,encode:S,encodeURI:P,encodeURL:P,utob:g,btou:R,decode:y,isValid:v,fromUint8Array:D,toUint8Array:M,extendString:F,extendUint8Array:I,extendBuiltins:O};return q.Base64={},Object.keys(q).forEach(function(T){return q.Base64[T]=q[T]}),q})});var Eb=x((GV,Cb)=>{"use strict";Cb.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 Sb=x(jd=>{"use strict";var g$=Object.prototype.hasOwnProperty,D$;function _b(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function xb(t){try{return encodeURIComponent(t)}catch{return null}}function y$(t){for(var e=/([^=?#&]+)=?([^&]*)/g,r={},n;n=e.exec(t);){var o=_b(n[1]),i=_b(n[2]);o===null||i===null||o in r||(r[o]=i)}return r}function b$(t,e){e=e||"";var r=[],n,o;typeof e!="string"&&(e="?");for(o in t)if(g$.call(t,o)){if(n=t[o],!n&&(n===null||n===D$||isNaN(n))&&(n=""),o=xb(o),n=xb(n),o===null||n===null)continue;r.push(o+"="+n)}return r.length?e+r.join("&"):""}jd.stringify=b$;jd.parse=y$});var Ib=x((KV,Tb)=>{"use strict";var Ab=Eb(),Mu=Sb(),v$=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Ob=/[\n\r\t]/g,w$=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,kb=/:\d+$/,C$=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,E$=/^[a-zA-Z]:/;function Ld(t){return(t||"").toString().replace(v$,"")}var Nd=[["#","hash"],["?","query"],function(e,r){return Fr(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]],Fb={hash:1,query:1};function $b(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={},o=typeof t,i;if(t.protocol==="blob:")n=new Ar(unescape(t.pathname),{});else if(o==="string"){n=new Ar(t,{});for(i in Fb)delete n[i]}else if(o==="object"){for(i in t)i in Fb||(n[i]=t[i]);n.slashes===void 0&&(n.slashes=w$.test(t.href))}return n}function Fr(t){return t==="file:"||t==="ftp:"||t==="http:"||t==="https:"||t==="ws:"||t==="wss:"}function Pb(t,e){t=Ld(t),t=t.replace(Ob,""),e=e||{};var r=C$.exec(t),n=r[1]?r[1].toLowerCase():"",o=!!r[2],i=!!r[3],a=0,s;return o?i?(s=r[2]+r[3]+r[4],a=r[2].length+r[3].length):(s=r[2]+r[4],a=r[2].length):i?(s=r[3]+r[4],a=r[3].length):s=r[4],n==="file:"?a>=2&&(s=s.slice(2)):Fr(n)?s=r[4]:n?o&&(s=s.slice(2)):a>=2&&Fr(e.protocol)&&(s=r[4]),{protocol:n,slashes:o||Fr(n),slashesCount:a,rest:s}}function _$(t,e){if(t==="")return e;for(var r=(e||"/").split("/").slice(0,-1).concat(t.split("/")),n=r.length,o=r[n-1],i=!1,a=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),a++):a&&(n===0&&(i=!0),r.splice(n,1),a--);return i&&r.unshift(""),(o==="."||o==="..")&&r.push(""),r.join("/")}function Ar(t,e,r){if(t=Ld(t),t=t.replace(Ob,""),!(this instanceof Ar))return new Ar(t,e,r);var n,o,i,a,s,u,c=Nd.slice(),l=typeof e,f=this,d=0;for(l!=="object"&&l!=="string"&&(r=e,e=null),r&&typeof r!="function"&&(r=Mu.parse),e=$b(e),o=Pb(t||"",e),n=!o.protocol&&!o.slashes,f.slashes=o.slashes||n&&e.slashes,f.protocol=o.protocol||e.protocol||"",t=o.rest,(o.protocol==="file:"&&(o.slashesCount!==2||E$.test(t))||!o.slashes&&(o.protocol||o.slashesCount<2||!Fr(f.protocol)))&&(c[3]=[/(.*)/,"pathname"]);d<c.length;d++){if(a=c[d],typeof a=="function"){t=a(t,f);continue}i=a[0],u=a[1],i!==i?f[u]=t:typeof i=="string"?(s=i==="@"?t.lastIndexOf(i):t.indexOf(i),~s&&(typeof a[2]=="number"?(f[u]=t.slice(0,s),t=t.slice(s+a[2])):(f[u]=t.slice(s),t=t.slice(0,s)))):(s=i.exec(t))&&(f[u]=s[1],t=t.slice(0,s.index)),f[u]=f[u]||n&&a[3]&&e[u]||"",a[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=_$(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Fr(f.protocol)&&(f.pathname="/"+f.pathname),Ab(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(s=f.auth.indexOf(":"),~s?(f.username=f.auth.slice(0,s),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(s+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:"&&Fr(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}function x$(t,e,r){var n=this;switch(t){case"query":typeof e=="string"&&e.length&&(e=(r||Mu.parse)(e)),n[t]=e;break;case"port":n[t]=e,Ab(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,kb.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 o=t==="pathname"?"/":"#";n[t]=e.charAt(0)!==o?o+e:e}else n[t]=e;break;case"username":case"password":n[t]=encodeURIComponent(e);break;case"auth":var i=e.indexOf(":");~i?(n.username=e.slice(0,i),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=e.slice(i+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(e))}for(var a=0;a<Nd.length;a++){var s=Nd[a];s[4]&&(n[s[1]]=n[s[1]].toLowerCase())}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&Fr(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function S$(t){(!t||typeof t!="function")&&(t=Mu.stringify);var e,r=this,n=r.host,o=r.protocol;o&&o.charAt(o.length-1)!==":"&&(o+=":");var i=o+(r.protocol&&r.slashes||Fr(r.protocol)?"//":"");return r.username?(i+=r.username,r.password&&(i+=":"+r.password),i+="@"):r.password?(i+=":"+r.password,i+="@"):r.protocol!=="file:"&&Fr(r.protocol)&&!n&&r.pathname!=="/"&&(i+="@"),(n[n.length-1]===":"||kb.test(r.hostname)&&!r.port)&&(n+=":"),i+=n+r.pathname,e=typeof r.query=="object"?t(r.query):r.query,e&&(i+=e.charAt(0)!=="?"?"?"+e:e),r.hash&&(i+=r.hash),i}Ar.prototype={set:x$,toString:S$};Ar.extractProtocol=Pb;Ar.location=$b;Ar.trimLeft=Ld;Ar.qs=Mu;Tb.exports=Ar});var Rb=x(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.default=F$;function F$(){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 Jb=x(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.default=void 0;var A$=wb(),O$=Hd(Ib()),qu=Hd(Td()),Kn=Id(),k$=Hd(Rb());function Hd(t){return t&&t.__esModule?t:{default:t}}function Md(){"use strict";Md=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(y,v,w){y[v]=w.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(y,v,w){return Object.defineProperty(y,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),y[v]}try{c({},"")}catch{c=function(w,F,I){return w[F]=I}}function l(y,v,w,F){var I=v&&v.prototype instanceof C?v:C,O=Object.create(I.prototype),q=new Q(F||[]);return o(O,"_invoke",{value:N(y,w,q)}),O}function f(y,v,w){try{return{type:"normal",arg:y.call(v,w)}}catch(F){return{type:"throw",arg:F}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",m="executing",b="completed",D={};function C(){}function E(){}function g(){}var _={};c(_,a,function(){return this});var S=Object.getPrototypeOf,P=S&&S(S($([])));P&&P!==r&&n.call(P,a)&&(_=P);var k=g.prototype=C.prototype=Object.create(_);function B(y){["next","throw","return"].forEach(function(v){c(y,v,function(w){return this._invoke(v,w)})})}function R(y,v){function w(I,O,q,T){var j=f(y[I],y,O);if(j.type!=="throw"){var ee=j.arg,V=ee.value;return V&&Yn(V)=="object"&&n.call(V,"__await")?v.resolve(V.__await).then(function(se){w("next",se,q,T)},function(se){w("throw",se,q,T)}):v.resolve(V).then(function(se){ee.value=se,q(ee)},function(se){return w("throw",se,q,T)})}T(j.arg)}var F;o(this,"_invoke",{value:function(O,q){function T(){return new v(function(j,ee){w(O,q,j,ee)})}return F=F?F.then(T,T):T()}})}function N(y,v,w){var F=d;return function(I,O){if(F===m)throw Error("Generator is already running");if(F===b){if(I==="throw")throw O;return{value:t,done:!0}}for(w.method=I,w.arg=O;;){var q=w.delegate;if(q){var T=A(q,w);if(T){if(T===D)continue;return T}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(F===d)throw F=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);F=m;var j=f(y,v,w);if(j.type==="normal"){if(F=w.done?b:h,j.arg===D)continue;return{value:j.arg,done:w.done}}j.type==="throw"&&(F=b,w.method="throw",w.arg=j.arg)}}}function A(y,v){var w=v.method,F=y.iterator[w];if(F===t)return v.delegate=null,w==="throw"&&y.iterator.return&&(v.method="return",v.arg=t,A(y,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var I=f(F,y.iterator,v.arg);if(I.type==="throw")return v.method="throw",v.arg=I.arg,v.delegate=null,D;var O=I.arg;return O?O.done?(v[y.resultName]=O.value,v.next=y.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):O:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function U(y){var v={tryLoc:y[0]};1 in y&&(v.catchLoc=y[1]),2 in y&&(v.finallyLoc=y[2],v.afterLoc=y[3]),this.tryEntries.push(v)}function M(y){var v=y.completion||{};v.type="normal",delete v.arg,y.completion=v}function Q(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(U,this),this.reset(!0)}function $(y){if(y||y===""){var v=y[a];if(v)return v.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var w=-1,F=function I(){for(;++w<y.length;)if(n.call(y,w))return I.value=y[w],I.done=!1,I;return I.value=t,I.done=!0,I};return F.next=F}}throw new TypeError(Yn(y)+" is not iterable")}return E.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:E,configurable:!0}),E.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(y){var v=typeof y=="function"&&y.constructor;return!!v&&(v===E||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,g):(y.__proto__=g,c(y,u,"GeneratorFunction")),y.prototype=Object.create(k),y},e.awrap=function(y){return{__await:y}},B(R.prototype),c(R.prototype,s,function(){return this}),e.AsyncIterator=R,e.async=function(y,v,w,F,I){I===void 0&&(I=Promise);var O=new R(l(y,v,w,F),I);return e.isGeneratorFunction(v)?O:O.next().then(function(q){return q.done?q.value:O.next()})},B(k),c(k,u,"Generator"),c(k,a,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(y){var v=Object(y),w=[];for(var F in v)w.push(F);return w.reverse(),function I(){for(;w.length;){var O=w.pop();if(O in v)return I.value=O,I.done=!1,I}return I.done=!0,I}},e.values=$,Q.prototype={constructor:Q,reset:function(v){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(M),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function F(ee,V){return q.type="throw",q.arg=v,w.next=ee,V&&(w.method="next",w.arg=t),!!V}for(var I=this.tryEntries.length-1;I>=0;--I){var O=this.tryEntries[I],q=O.completion;if(O.tryLoc==="root")return F("end");if(O.tryLoc<=this.prev){var T=n.call(O,"catchLoc"),j=n.call(O,"finallyLoc");if(T&&j){if(this.prev<O.catchLoc)return F(O.catchLoc,!0);if(this.prev<O.finallyLoc)return F(O.finallyLoc)}else if(T){if(this.prev<O.catchLoc)return F(O.catchLoc,!0)}else{if(!j)throw Error("try statement without catch or finally");if(this.prev<O.finallyLoc)return F(O.finallyLoc)}}}},abrupt:function(v,w){for(var F=this.tryEntries.length-1;F>=0;--F){var I=this.tryEntries[F];if(I.tryLoc<=this.prev&&n.call(I,"finallyLoc")&&this.prev<I.finallyLoc){var O=I;break}}O&&(v==="break"||v==="continue")&&O.tryLoc<=w&&w<=O.finallyLoc&&(O=null);var q=O?O.completion:{};return q.type=v,q.arg=w,O?(this.method="next",this.next=O.finallyLoc,D):this.complete(q)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.finallyLoc===v)return this.complete(F.completion,F.afterLoc),M(F),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.tryLoc===v){var I=F.completion;if(I.type==="throw"){var O=I.arg;M(F)}return O}}throw Error("illegal catch attempt")},delegateYield:function(v,w,F){return this.delegate={iterator:$(v),resultName:w,nextLoc:F},this.method==="next"&&(this.arg=t),D}},e}function Bb(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(c){r(c);return}s.done?e(u):Promise.resolve(u).then(n,o)}function $$(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(u){Bb(i,n,o,a,s,"next",u)}function s(u){Bb(i,n,o,a,s,"throw",u)}a(void 0)})}}function zb(t,e){return I$(t)||T$(t,e)||Gb(t,e)||P$()}function P$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
35
35
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T$(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,o,i,a,s=[],u=!0,c=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(l){c=!0,o=l}finally{try{if(!u&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}function I$(t){if(Array.isArray(t))return t}function Yn(t){"@babel/helpers - typeof";return Yn=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},Yn(t)}function R$(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Gb(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
36
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,s;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return i=c.done,c},e:function(c){a=!0,s=c},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}}}function Gb(t,e){if(t){if(typeof t=="string")return jb(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 jb(t,e)}}function jb(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 Nb(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function ri(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nb(Object(r),!0).forEach(function(n){B$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nb(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function B$(t,e,r){return e=Wb(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lb(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,Wb(n.key),n)}}function N$(t,e,r){return e&&Lb(t.prototype,e),r&&Lb(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wb(t){var e=L$(t,"string");return Yn(e)=="symbol"?e:e+""}function L$(t,e){if(Yn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Yn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Hu="tus-v1",Vu="ietf-draft-03",Ba="ietf-draft-05",U$={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:Yb,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:Hu},Kb=(function(){function t(e,r){j$(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 N$(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(![Hu,Vu,Ba].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 o=this.options.retryDelays;if(o!=null&&Object.prototype.toString.call(o)!=="[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 i=0,a=["uploadUrl","uploadSize","uploadLengthDeferred"];i<a.length;i++){var s=a[i];if(this.options[s]){this._emitError(new Error("tus: cannot use the ".concat(s," 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,Kn.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Kn.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,o=this._size,i=0;this._parallelUploads=[];var a=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,s=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:q$(this._source.size,a);this._parallelUploadUrls&&s.forEach(function(l,f){l.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(s.length);var u=s.map(function(l,f){var d=0;return n._source.slice(l.start,l.end).then(function(h){var m=h.value;return new Promise(function(b,D){var C=ri(ri({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:ri(ri({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:b,onError:D,onProgress:function(_){i=i-d+_,d=_,n._emitProgress(i,o)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=E.url,n._parallelUploadUrls.filter(function(_){return!!_}).length===s.length&&n._saveUploadInUrlStorage()}}),E=new t(m,C);E.start(),n._parallelUploads.push(E)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=Ub(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!ni(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=Vb(n.options.endpoint,f),(0,Kn.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,Kn.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Kn.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Kn.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var o=R$(this._parallelUploads),i;try{for(o.s();!(i=o.n()).done;){var a=i.value;a.abort(r)}}catch(s){o.e(s)}finally{o.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,o,i){this._emitError(new qu.default(o,i,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var o=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(o&&(this._retryAttempt=0),Hb(r,this._retryAttempt,this.options)){var i=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},i);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,o){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,o)}},{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 o=Ub(this.options.metadata);o!==""&&n.setHeader("Upload-Metadata",o);var i;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,i=this._addChunkToRequest(n)):((this.options.protocol===Vu||this.options.protocol===Ba)&&n.setHeader("Upload-Complete","?0"),i=this._sendRequest(n,null)),i.then(function(a){if(!ni(a.getStatus(),200)){r._emitHttpError(n,a,"tus: unexpected response while creating upload");return}var s=a.getHeader("Location");if(s==null){r._emitHttpError(n,a,"tus: invalid or missing Location header");return}if(r.url=Vb(r.options.endpoint,s),(0,Kn.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(a),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,a):(r._offset=0,r._performUpload())})}).catch(function(a){r._emitHttpError(n,null,"tus: failed to create upload",a)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),o=this._sendRequest(n,null);o.then(function(i){var a=i.getStatus();if(!ni(a,200)){if(a===423){r._emitHttpError(n,i,"tus: upload is currently locked; retry later");return}if(ni(a,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,i,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var s=Number.parseInt(i.getHeader("Upload-Offset"),10);if(Number.isNaN(s)){r._emitHttpError(n,i,"tus: invalid or missing offset value");return}var u=Number.parseInt(i.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===Hu){r._emitHttpError(n,i,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(s===u){r._emitProgress(u,u),r._emitSuccess(i);return}r._offset=s,r._performUpload()})}).catch(function(i){r._emitHttpError(n,null,"tus: failed to resume upload",i)})}},{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 o=this._addChunkToRequest(n);o.then(function(i){if(!ni(i.getStatus(),200)){r._emitHttpError(n,i,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,i)}).catch(function(i){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),i)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,o=this._offset,i=this._offset+this.options.chunkSize;return r.setProgressHandler(function(a){n._emitProgress(o+a,n._size)}),this.options.protocol===Hu?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===Ba&&r.setHeader("Content-Type","application/partial-upload"),(i===Number.POSITIVE_INFINITY||i>this._size)&&!this.options.uploadLengthDeferred&&(i=this._size),this._source.slice(o,i).then(function(a){var s=a.value,u=a.done,c=s!=null&&s.size?s.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"))):s===null?n._sendRequest(r):((n.options.protocol===Vu||n.options.protocol===Ba)&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,s))})}},{key:"_handleUploadResponse",value:function(r,n){var o=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(o)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(o,this._size),this._emitChunkComplete(o-this._offset,o,this._size),this._offset=o,o===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var o=Mb(r,n,this.options);return this._req=o,o}},{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(o){r._urlStorageKey=o})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return qb(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=Mb("DELETE",r,n);return qb(o,null,n).then(function(i){if(i.getStatus()!==204)throw new qu.default("tus: unexpected response while terminating upload",null,o,i)}).catch(function(i){if(i instanceof qu.default||(i=new qu.default("tus: failed to terminate upload",i,o,null)),!Hb(i,0,n))throw i;var a=n.retryDelays[0],s=n.retryDelays.slice(1),u=ri(ri({},n),{},{retryDelays:s});return new Promise(function(c){return setTimeout(c,a)}).then(function(){return t.terminate(r,u)})})}}])})();function Ub(t){return Object.entries(t).map(function(e){var r=zb(e,2),n=r[0],o=r[1];return"".concat(n," ").concat(A$.Base64.encode(String(o)))}).join(",")}function ni(t,e){return t>=e&&t<e+100}function Mb(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===Vu?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===Ba?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var o=r.headers||{},i=0,a=Object.entries(o);i<a.length;i++){var s=zb(a[i],2),u=s[0],c=s[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,k$.default)();n.setHeader("X-Request-ID",l)}return n}function qb(t,e,r){return qd.apply(this,arguments)}function qd(){return qd=$$(Md().mark(function t(e,r,n){var o;return Md().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(typeof n.onBeforeRequest!="function"){a.next=3;break}return a.next=3,n.onBeforeRequest(e);case 3:return a.next=5,e.send(r);case 5:if(o=a.sent,typeof n.onAfterResponse!="function"){a.next=9;break}return a.next=9,n.onAfterResponse(e,o);case 9:return a.abrupt("return",o);case 10:case"end":return a.stop()}},t)})),qd.apply(this,arguments)}function M$(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function Hb(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):Yb(t)}function Yb(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!ni(e,400)||e===409||e===423)&&M$()}function Vb(t,e){return new O$.default(e,t).toString()}function q$(t,e){for(var r=Math.floor(t/e),n=[],o=0;o<e;o++)n.push({start:r*o,end:r*(o+1)});return n[e-1].end=t,n}Kb.defaultOptions=U$;var JV=zu.default=Kb});var Zb=x((ZV,Xb)=>{"use strict";var Or=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Or.writable=t=>Or(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Or.readable=t=>Or(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Or.duplex=t=>Or.writable(t)&&Or.readable(t);Or.transform=t=>Or.duplex(t)&&typeof t._transform=="function";Xb.exports=Or});var ev=x(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.default=void 0;function ja(t){"@babel/helpers - typeof";return ja=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},ja(t)}function H$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qb(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,z$(n.key),n)}}function V$(t,e,r){return e&&Qb(t.prototype,e),r&&Qb(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function z$(t){var e=G$(t,"string");return ja(e)=="symbol"?e:e+""}function G$(t,e){if(ja(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ja(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var QV=Gu.default=(function(){function t(e){H$(this,t),this._buffer=e,this.size=e.length}return V$(t,[{key:"slice",value:function(r,n){var o=this._buffer.slice(r,n);o.size=o.length;var i=n>=this.size;return Promise.resolve({value:o,done:i})}},{key:"close",value:function(){}}])})()});var ov=x(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.default=Z$;var nv=require("fs");function Jn(t){"@babel/helpers - typeof";return Jn=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},Jn(t)}function Vd(){"use strict";Vd=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(y,v,w){y[v]=w.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(y,v,w){return Object.defineProperty(y,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),y[v]}try{c({},"")}catch{c=function(w,F,I){return w[F]=I}}function l(y,v,w,F){var I=v&&v.prototype instanceof C?v:C,O=Object.create(I.prototype),q=new Q(F||[]);return o(O,"_invoke",{value:N(y,w,q)}),O}function f(y,v,w){try{return{type:"normal",arg:y.call(v,w)}}catch(F){return{type:"throw",arg:F}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",m="executing",b="completed",D={};function C(){}function E(){}function g(){}var _={};c(_,a,function(){return this});var S=Object.getPrototypeOf,T=S&&S(S($([])));T&&T!==r&&n.call(T,a)&&(_=T);var k=g.prototype=C.prototype=Object.create(_);function B(y){["next","throw","return"].forEach(function(v){c(y,v,function(w){return this._invoke(v,w)})})}function R(y,v){function w(I,O,q,P){var j=f(y[I],y,O);if(j.type!=="throw"){var ee=j.arg,V=ee.value;return V&&Jn(V)=="object"&&n.call(V,"__await")?v.resolve(V.__await).then(function(se){w("next",se,q,P)},function(se){w("throw",se,q,P)}):v.resolve(V).then(function(se){ee.value=se,q(ee)},function(se){return w("throw",se,q,P)})}P(j.arg)}var F;o(this,"_invoke",{value:function(O,q){function P(){return new v(function(j,ee){w(O,q,j,ee)})}return F=F?F.then(P,P):P()}})}function N(y,v,w){var F=d;return function(I,O){if(F===m)throw Error("Generator is already running");if(F===b){if(I==="throw")throw O;return{value:t,done:!0}}for(w.method=I,w.arg=O;;){var q=w.delegate;if(q){var P=A(q,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(F===d)throw F=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);F=m;var j=f(y,v,w);if(j.type==="normal"){if(F=w.done?b:h,j.arg===D)continue;return{value:j.arg,done:w.done}}j.type==="throw"&&(F=b,w.method="throw",w.arg=j.arg)}}}function A(y,v){var w=v.method,F=y.iterator[w];if(F===t)return v.delegate=null,w==="throw"&&y.iterator.return&&(v.method="return",v.arg=t,A(y,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var I=f(F,y.iterator,v.arg);if(I.type==="throw")return v.method="throw",v.arg=I.arg,v.delegate=null,D;var O=I.arg;return O?O.done?(v[y.resultName]=O.value,v.next=y.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):O:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function U(y){var v={tryLoc:y[0]};1 in y&&(v.catchLoc=y[1]),2 in y&&(v.finallyLoc=y[2],v.afterLoc=y[3]),this.tryEntries.push(v)}function M(y){var v=y.completion||{};v.type="normal",delete v.arg,y.completion=v}function Q(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(U,this),this.reset(!0)}function $(y){if(y||y===""){var v=y[a];if(v)return v.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var w=-1,F=function I(){for(;++w<y.length;)if(n.call(y,w))return I.value=y[w],I.done=!1,I;return I.value=t,I.done=!0,I};return F.next=F}}throw new TypeError(Jn(y)+" is not iterable")}return E.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:E,configurable:!0}),E.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(y){var v=typeof y=="function"&&y.constructor;return!!v&&(v===E||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,g):(y.__proto__=g,c(y,u,"GeneratorFunction")),y.prototype=Object.create(k),y},e.awrap=function(y){return{__await:y}},B(R.prototype),c(R.prototype,s,function(){return this}),e.AsyncIterator=R,e.async=function(y,v,w,F,I){I===void 0&&(I=Promise);var O=new R(l(y,v,w,F),I);return e.isGeneratorFunction(v)?O:O.next().then(function(q){return q.done?q.value:O.next()})},B(k),c(k,u,"Generator"),c(k,a,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(y){var v=Object(y),w=[];for(var F in v)w.push(F);return w.reverse(),function I(){for(;w.length;){var O=w.pop();if(O in v)return I.value=O,I.done=!1,I}return I.done=!0,I}},e.values=$,Q.prototype={constructor:Q,reset:function(v){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(M),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function F(ee,V){return q.type="throw",q.arg=v,w.next=ee,V&&(w.method="next",w.arg=t),!!V}for(var I=this.tryEntries.length-1;I>=0;--I){var O=this.tryEntries[I],q=O.completion;if(O.tryLoc==="root")return F("end");if(O.tryLoc<=this.prev){var P=n.call(O,"catchLoc"),j=n.call(O,"finallyLoc");if(P&&j){if(this.prev<O.catchLoc)return F(O.catchLoc,!0);if(this.prev<O.finallyLoc)return F(O.finallyLoc)}else if(P){if(this.prev<O.catchLoc)return F(O.catchLoc,!0)}else{if(!j)throw Error("try statement without catch or finally");if(this.prev<O.finallyLoc)return F(O.finallyLoc)}}}},abrupt:function(v,w){for(var F=this.tryEntries.length-1;F>=0;--F){var I=this.tryEntries[F];if(I.tryLoc<=this.prev&&n.call(I,"finallyLoc")&&this.prev<I.finallyLoc){var O=I;break}}O&&(v==="break"||v==="continue")&&O.tryLoc<=w&&w<=O.finallyLoc&&(O=null);var q=O?O.completion:{};return q.type=v,q.arg=w,O?(this.method="next",this.next=O.finallyLoc,D):this.complete(q)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.finallyLoc===v)return this.complete(F.completion,F.afterLoc),M(F),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.tryLoc===v){var I=F.completion;if(I.type==="throw"){var O=I.arg;M(F)}return O}}throw Error("illegal catch attempt")},delegateYield:function(v,w,F){return this.delegate={iterator:$(v),resultName:w,nextLoc:F},this.method==="next"&&(this.arg=t),D}},e}function W$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tv(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,Y$(n.key),n)}}function K$(t,e,r){return e&&tv(t.prototype,e),r&&tv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Y$(t){var e=J$(t,"string");return Jn(e)=="symbol"?e:e+""}function J$(t,e){if(Jn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Jn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rv(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(c){r(c);return}s.done?e(u):Promise.resolve(u).then(n,o)}function X$(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(u){rv(i,n,o,a,s,"next",u)}function s(u){rv(i,n,o,a,s,"throw",u)}a(void 0)})}}function Z$(t){return zd.apply(this,arguments)}function zd(){return zd=X$(Vd().mark(function t(e){var r,n,o,i,a,s,u;return Vd().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,nv.promises.stat(n);case 3:return o=l.sent,i=o.size,a=(r=e.start)!==null&&r!==void 0?r:0,s=Number.isFinite(e.end)?e.end+1:i,u=s-a,l.abrupt("return",new Q$(e,n,u));case 9:case"end":return l.stop()}},t)})),zd.apply(this,arguments)}var Q$=(function(){function t(e,r,n){W$(this,t),this._stream=e,this._path=r,this.size=n}return K$(t,[{key:"slice",value:function(r,n){var o,i=(o=this._stream.start)!==null&&o!==void 0?o:0,a=(0,nv.createReadStream)(this._path,{start:i+r,end:i+n-1,autoClose:!0});a.size=Math.min(n-r,this.size);var s=a.size>=this.size;return Promise.resolve({value:a,done:s})}},{key:"close",value:function(){this._stream.destroy()}}])})()});var Kd=x(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.default=void 0;function Xn(t){"@babel/helpers - typeof";return Xn=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},Xn(t)}function Na(){"use strict";Na=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(y,v,w){y[v]=w.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(y,v,w){return Object.defineProperty(y,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),y[v]}try{c({},"")}catch{c=function(w,F,I){return w[F]=I}}function l(y,v,w,F){var I=v&&v.prototype instanceof C?v:C,O=Object.create(I.prototype),q=new Q(F||[]);return o(O,"_invoke",{value:N(y,w,q)}),O}function f(y,v,w){try{return{type:"normal",arg:y.call(v,w)}}catch(F){return{type:"throw",arg:F}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",m="executing",b="completed",D={};function C(){}function E(){}function g(){}var _={};c(_,a,function(){return this});var S=Object.getPrototypeOf,T=S&&S(S($([])));T&&T!==r&&n.call(T,a)&&(_=T);var k=g.prototype=C.prototype=Object.create(_);function B(y){["next","throw","return"].forEach(function(v){c(y,v,function(w){return this._invoke(v,w)})})}function R(y,v){function w(I,O,q,P){var j=f(y[I],y,O);if(j.type!=="throw"){var ee=j.arg,V=ee.value;return V&&Xn(V)=="object"&&n.call(V,"__await")?v.resolve(V.__await).then(function(se){w("next",se,q,P)},function(se){w("throw",se,q,P)}):v.resolve(V).then(function(se){ee.value=se,q(ee)},function(se){return w("throw",se,q,P)})}P(j.arg)}var F;o(this,"_invoke",{value:function(O,q){function P(){return new v(function(j,ee){w(O,q,j,ee)})}return F=F?F.then(P,P):P()}})}function N(y,v,w){var F=d;return function(I,O){if(F===m)throw Error("Generator is already running");if(F===b){if(I==="throw")throw O;return{value:t,done:!0}}for(w.method=I,w.arg=O;;){var q=w.delegate;if(q){var P=A(q,w);if(P){if(P===D)continue;return P}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(F===d)throw F=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);F=m;var j=f(y,v,w);if(j.type==="normal"){if(F=w.done?b:h,j.arg===D)continue;return{value:j.arg,done:w.done}}j.type==="throw"&&(F=b,w.method="throw",w.arg=j.arg)}}}function A(y,v){var w=v.method,F=y.iterator[w];if(F===t)return v.delegate=null,w==="throw"&&y.iterator.return&&(v.method="return",v.arg=t,A(y,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var I=f(F,y.iterator,v.arg);if(I.type==="throw")return v.method="throw",v.arg=I.arg,v.delegate=null,D;var O=I.arg;return O?O.done?(v[y.resultName]=O.value,v.next=y.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):O:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function U(y){var v={tryLoc:y[0]};1 in y&&(v.catchLoc=y[1]),2 in y&&(v.finallyLoc=y[2],v.afterLoc=y[3]),this.tryEntries.push(v)}function M(y){var v=y.completion||{};v.type="normal",delete v.arg,y.completion=v}function Q(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(U,this),this.reset(!0)}function $(y){if(y||y===""){var v=y[a];if(v)return v.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var w=-1,F=function I(){for(;++w<y.length;)if(n.call(y,w))return I.value=y[w],I.done=!1,I;return I.value=t,I.done=!0,I};return F.next=F}}throw new TypeError(Xn(y)+" is not iterable")}return E.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:E,configurable:!0}),E.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(y){var v=typeof y=="function"&&y.constructor;return!!v&&(v===E||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,g):(y.__proto__=g,c(y,u,"GeneratorFunction")),y.prototype=Object.create(k),y},e.awrap=function(y){return{__await:y}},B(R.prototype),c(R.prototype,s,function(){return this}),e.AsyncIterator=R,e.async=function(y,v,w,F,I){I===void 0&&(I=Promise);var O=new R(l(y,v,w,F),I);return e.isGeneratorFunction(v)?O:O.next().then(function(q){return q.done?q.value:O.next()})},B(k),c(k,u,"Generator"),c(k,a,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(y){var v=Object(y),w=[];for(var F in v)w.push(F);return w.reverse(),function I(){for(;w.length;){var O=w.pop();if(O in v)return I.value=O,I.done=!1,I}return I.done=!0,I}},e.values=$,Q.prototype={constructor:Q,reset:function(v){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(M),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function F(ee,V){return q.type="throw",q.arg=v,w.next=ee,V&&(w.method="next",w.arg=t),!!V}for(var I=this.tryEntries.length-1;I>=0;--I){var O=this.tryEntries[I],q=O.completion;if(O.tryLoc==="root")return F("end");if(O.tryLoc<=this.prev){var P=n.call(O,"catchLoc"),j=n.call(O,"finallyLoc");if(P&&j){if(this.prev<O.catchLoc)return F(O.catchLoc,!0);if(this.prev<O.finallyLoc)return F(O.finallyLoc)}else if(P){if(this.prev<O.catchLoc)return F(O.catchLoc,!0)}else{if(!j)throw Error("try statement without catch or finally");if(this.prev<O.finallyLoc)return F(O.finallyLoc)}}}},abrupt:function(v,w){for(var F=this.tryEntries.length-1;F>=0;--F){var I=this.tryEntries[F];if(I.tryLoc<=this.prev&&n.call(I,"finallyLoc")&&this.prev<I.finallyLoc){var O=I;break}}O&&(v==="break"||v==="continue")&&O.tryLoc<=w&&w<=O.finallyLoc&&(O=null);var q=O?O.completion:{};return q.type=v,q.arg=w,O?(this.method="next",this.next=O.finallyLoc,D):this.complete(q)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.finallyLoc===v)return this.complete(F.completion,F.afterLoc),M(F),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.tryLoc===v){var I=F.completion;if(I.type==="throw"){var O=I.arg;M(F)}return O}}throw Error("illegal catch attempt")},delegateYield:function(v,w,F){return this.delegate={iterator:$(v),resultName:w,nextLoc:F},this.method==="next"&&(this.arg=t),D}},e}function eP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function iv(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,rP(n.key),n)}}function tP(t,e,r){return e&&iv(t.prototype,e),r&&iv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function rP(t){var e=nP(t,"string");return Xn(e)=="symbol"?e:e+""}function nP(t,e){if(Xn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Xn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function av(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(c){r(c);return}s.done?e(u):Promise.resolve(u).then(n,o)}function sv(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(u){av(i,n,o,a,s,"next",u)}function s(u){av(i,n,o,a,s,"throw",u)}a(void 0)})}}function oP(t,e){return Wd.apply(this,arguments)}function Wd(){return Wd=sv(Na().mark(function t(e,r){return Na().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new Promise(function(i,a){var s=function(l){e.off("readable",u),a(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",s),e.off("readable",c),i(l))};e.once("error",s),e.on("readable",u)}));case 1:case"end":return o.stop()}},t)})),Wd.apply(this,arguments)}var rz=Wu.default=(function(){function t(e){var r=this;eP(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 tP(t,[{key:"slice",value:(function(){var e=sv(Na().mark(function n(o,i){var a,s,u,c,l;return Na().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(!(o<this._bufPos)){d.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(o>this._bufPos+this._buf.length)){d.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){d.next=6;break}throw this._error;case 6:if(o<this._bufPos+this._buf.length?(s=o-this._bufPos,u=Math.min(this._buf.length,i-this._bufPos),a=this._buf.slice(s,u)):a=Buffer.alloc(0),!this._ended){d.next=10;break}return a.size=a.length,d.abrupt("return",{value:a,done:!0});case 10:if(c=i-o,!(c>a.length)){d.next=16;break}return d.next=14,oP(this._stream,c-a.length);case 14:l=d.sent,a=Buffer.concat([a,l]);case 16:return this._buf=a,this._bufPos=o,a.size=a.length,d.abrupt("return",{value:a,done:this._ended});case 20:case"end":return d.stop()}},n,this)}));function r(n,o){return e.apply(this,arguments)}return r})()},{key:"close",value:function(){this._stream.destroy()}}])})()});var cv=x(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.default=void 0;var iP=require("fs"),aP=Ku(Zb()),sP=Ku(ev()),uP=Ku(ov()),cP=Ku(Kd());function Ku(t){return t&&t.__esModule?t:{default:t}}function La(t){"@babel/helpers - typeof";return La=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},La(t)}function lP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uv(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,pP(n.key),n)}}function fP(t,e,r){return e&&uv(t.prototype,e),r&&uv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function pP(t){var e=dP(t,"string");return La(e)=="symbol"?e:e+""}function dP(t,e){if(La(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(La(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var oz=Yu.default=(function(){function t(){lP(this,t)}return fP(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new sP.default(r)):r instanceof iP.ReadStream&&r.path!=null?(0,uP.default)(r):aP.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new cP.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 dv=x(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.default=gP;var hP=require("crypto"),lv=pv(require("fs")),mP=pv(require("path"));function fv(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(fv=function(n){return n?r:e})(t)}function pv(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=fv(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,r&&r.set(t,n),n}function gP(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),o=(0,hP.createHash)("md5").update(n).digest("hex"),i=["node-buffer",o,t.length,e.endpoint].join("-");return Promise.resolve(i)}return t instanceof lv.ReadStream&&t.path!=null?new Promise(function(a,s){var u=mP.resolve(t.path);lv.stat(t.path,function(c,l){if(c){s(c);return}var f=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");a(f)})}):Promise.resolve(null)}});var yv=x((sz,Dv)=>{var gv="Expected a function",hv=NaN,DP="[object Symbol]",yP=/^\s+|\s+$/g,bP=/^[-+]0x[0-9a-f]+$/i,vP=/^0b[01]+$/i,wP=/^0o[0-7]+$/i,CP=parseInt,EP=typeof global=="object"&&global&&global.Object===Object&&global,_P=typeof self=="object"&&self&&self.Object===Object&&self,xP=EP||_P||Function("return this")(),SP=Object.prototype,FP=SP.toString,AP=Math.max,OP=Math.min,Jd=function(){return xP.Date.now()};function kP(t,e,r){var n,o,i,a,s,u,c=0,l=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(gv);e=mv(e)||0,Ju(r)&&(l=!!r.leading,f="maxWait"in r,i=f?AP(mv(r.maxWait)||0,e):i,d="trailing"in r?!!r.trailing:d);function h(T){var k=n,B=o;return n=o=void 0,c=T,a=t.apply(B,k),a}function m(T){return c=T,s=setTimeout(C,e),l?h(T):a}function b(T){var k=T-u,B=T-c,R=e-k;return f?OP(R,i-B):R}function D(T){var k=T-u,B=T-c;return u===void 0||k>=e||k<0||f&&B>=i}function C(){var T=Jd();if(D(T))return E(T);s=setTimeout(C,b(T))}function E(T){return s=void 0,d&&n?h(T):(n=o=void 0,a)}function g(){s!==void 0&&clearTimeout(s),c=0,n=u=o=s=void 0}function _(){return s===void 0?a:E(Jd())}function S(){var T=Jd(),k=D(T);if(n=arguments,o=this,u=T,k){if(s===void 0)return m(u);if(f)return s=setTimeout(C,e),h(u)}return s===void 0&&(s=setTimeout(C,e)),a}return S.cancel=g,S.flush=_,S}function $P(t,e,r){var n=!0,o=!0;if(typeof t!="function")throw new TypeError(gv);return Ju(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),kP(t,e,{leading:n,maxWait:e,trailing:o})}function Ju(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function PP(t){return!!t&&typeof t=="object"}function TP(t){return typeof t=="symbol"||PP(t)&&FP.call(t)==DP}function mv(t){if(typeof t=="number")return t;if(TP(t))return hv;if(Ju(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ju(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(yP,"");var r=vP.test(t);return r||wP.test(t)?CP(t.slice(2),r?2:8):bP.test(t)?hv:+t}Dv.exports=$P});var Fv=x(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.default=void 0;var IP=_v(require("http")),RP=_v(require("https")),wv=require("stream"),BP=require("url"),Cv=jP(yv());function jP(t){return t&&t.__esModule?t:{default:t}}function Ev(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Ev=function(n){return n?r:e})(t)}function _v(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=Ev(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,r&&r.set(t,n),n}function NP(t,e,r){return e=Xu(e),LP(t,xv()?Reflect.construct(e,r||[],Xu(t).constructor):e.apply(t,r))}function LP(t,e){if(e&&(oi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UP(t)}function UP(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xv=function(){return!!t})()}function Xu(t){return Xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xu(t)}function MP(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&&Xd(t,e)}function Xd(t,e){return Xd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Xd(t,e)}function bv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function Ua(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bv(Object(r),!0).forEach(function(n){qP(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bv(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qP(t,e,r){return e=Sv(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oi(t){"@babel/helpers - typeof";return oi=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},oi(t)}function Zu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vv(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,Sv(n.key),n)}}function Qu(t,e,r){return e&&vv(t.prototype,e),r&&vv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Sv(t){var e=HP(t,"string");return oi(e)=="symbol"?e:e+""}function HP(t,e){if(oi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(oi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var uz=ec.default=(function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zu(this,t),this._requestOptions=e}return Qu(t,[{key:"createRequest",value:function(r,n){return new VP(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])})(),VP=(function(){function t(e,r,n){Zu(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return Qu(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(o,i){var a=Ua(Ua(Ua({},(0,BP.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Ua(Ua({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(a.headers["Content-Length"]=n.size);var s=a.protocol==="https:"?RP:IP;r._request=s.request(a);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");o(new zP(c,f))})}),u.on("error",function(c){i(c)}),n instanceof wv.Readable?n.pipe(new GP(r._progressHandler)).pipe(u):n instanceof Uint8Array?WP(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}}])})(),zP=(function(){function t(e,r){Zu(this,t),this._response=e,this._body=r}return Qu(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}}])})(),GP=(function(t){function e(r){var n;return Zu(this,e),n=NP(this,e),n._onprogress=(0,Cv.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return MP(e,t),Qu(e,[{key:"_transform",value:function(n,o,i){this._position+=n.length,this._onprogress(this._position),i(null,n)}}])})(wv.Transform),WP=function(e,r,n){n=(0,Cv.default)(n,100,{leading:!0,trailing:!1});var o=0;function i(){var a=Math.min(e.writableHighWaterMark,r.length-o),s=r.subarray(o,o+a);o+=s.length;var u=e.write(s);u?o<r.length?i():e.end():(e.once("drain",i),n(o))}i()}});var Av=x(Zd=>{"use strict";Zd.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};Zd.root=function(t,e,r){var n=this,o,i={stackLength:Error.stackTraceLimit,rootOnly:!0},a="",s=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
|
|
36
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,a=!1,s;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return i=c.done,c},e:function(c){a=!0,s=c},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(a)throw s}}}}function Gb(t,e){if(t){if(typeof t=="string")return jb(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 jb(t,e)}}function jb(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 Nb(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function ri(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Nb(Object(r),!0).forEach(function(n){B$(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nb(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function B$(t,e,r){return e=Wb(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lb(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,Wb(n.key),n)}}function N$(t,e,r){return e&&Lb(t.prototype,e),r&&Lb(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wb(t){var e=L$(t,"string");return Yn(e)=="symbol"?e:e+""}function L$(t,e){if(Yn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Yn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Hu="tus-v1",Vu="ietf-draft-03",Ba="ietf-draft-05",U$={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:Yb,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:Hu},Kb=(function(){function t(e,r){j$(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 N$(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(![Hu,Vu,Ba].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 o=this.options.retryDelays;if(o!=null&&Object.prototype.toString.call(o)!=="[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 i=0,a=["uploadUrl","uploadSize","uploadLengthDeferred"];i<a.length;i++){var s=a[i];if(this.options[s]){this._emitError(new Error("tus: cannot use the ".concat(s," 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,Kn.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Kn.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,o=this._size,i=0;this._parallelUploads=[];var a=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,s=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:q$(this._source.size,a);this._parallelUploadUrls&&s.forEach(function(l,f){l.uploadUrl=n._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(s.length);var u=s.map(function(l,f){var d=0;return n._source.slice(l.start,l.end).then(function(h){var m=h.value;return new Promise(function(b,D){var C=ri(ri({},n.options),{},{uploadUrl:l.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:ri(ri({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:b,onError:D,onProgress:function(_){i=i-d+_,d=_,n._emitProgress(i,o)},onUploadUrlAvailable:function(){n._parallelUploadUrls[f]=E.url,n._parallelUploadUrls.filter(function(_){return!!_}).length===s.length&&n._saveUploadInUrlStorage()}}),E=new t(m,C);E.start(),n._parallelUploads.push(E)})})}),c;Promise.all(u).then(function(){c=n._openRequest("POST",n.options.endpoint),c.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var l=Ub(n.options.metadata);return l!==""&&c.setHeader("Upload-Metadata",l),n._sendRequest(c,null)}).then(function(l){if(!ni(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=Vb(n.options.endpoint,f),(0,Kn.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,Kn.log)("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){(0,Kn.log)("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}(0,Kn.log)("Creating a new upload"),this._createUpload()}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var o=R$(this._parallelUploads),i;try{for(o.s();!(i=o.n()).done;){var a=i.value;a.abort(r)}}catch(s){o.e(s)}finally{o.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,o,i){this._emitError(new qu.default(o,i,r,n))}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var o=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(o&&(this._retryAttempt=0),Hb(r,this._retryAttempt,this.options)){var i=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start()},i);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,o){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,o)}},{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 o=Ub(this.options.metadata);o!==""&&n.setHeader("Upload-Metadata",o);var i;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,i=this._addChunkToRequest(n)):((this.options.protocol===Vu||this.options.protocol===Ba)&&n.setHeader("Upload-Complete","?0"),i=this._sendRequest(n,null)),i.then(function(a){if(!ni(a.getStatus(),200)){r._emitHttpError(n,a,"tus: unexpected response while creating upload");return}var s=a.getHeader("Location");if(s==null){r._emitHttpError(n,a,"tus: invalid or missing Location header");return}if(r.url=Vb(r.options.endpoint,s),(0,Kn.log)("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(a),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,a):(r._offset=0,r._performUpload())})}).catch(function(a){r._emitHttpError(n,null,"tus: failed to create upload",a)})}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),o=this._sendRequest(n,null);o.then(function(i){var a=i.getStatus();if(!ni(a,200)){if(a===423){r._emitHttpError(n,i,"tus: upload is currently locked; retry later");return}if(ni(a,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,i,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var s=Number.parseInt(i.getHeader("Upload-Offset"),10);if(Number.isNaN(s)){r._emitHttpError(n,i,"tus: invalid or missing offset value");return}var u=Number.parseInt(i.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!r.options.uploadLengthDeferred&&r.options.protocol===Hu){r._emitHttpError(n,i,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(s===u){r._emitProgress(u,u),r._emitSuccess(i);return}r._offset=s,r._performUpload()})}).catch(function(i){r._emitHttpError(n,null,"tus: failed to resume upload",i)})}},{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 o=this._addChunkToRequest(n);o.then(function(i){if(!ni(i.getStatus(),200)){r._emitHttpError(n,i,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,i)}).catch(function(i){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),i)})}}},{key:"_addChunkToRequest",value:function(r){var n=this,o=this._offset,i=this._offset+this.options.chunkSize;return r.setProgressHandler(function(a){n._emitProgress(o+a,n._size)}),this.options.protocol===Hu?r.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===Ba&&r.setHeader("Content-Type","application/partial-upload"),(i===Number.POSITIVE_INFINITY||i>this._size)&&!this.options.uploadLengthDeferred&&(i=this._size),this._source.slice(o,i).then(function(a){var s=a.value,u=a.done,c=s!=null&&s.size?s.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"))):s===null?n._sendRequest(r):((n.options.protocol===Vu||n.options.protocol===Ba)&&r.setHeader("Upload-Complete",u?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,s))})}},{key:"_handleUploadResponse",value:function(r,n){var o=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(o)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(o,this._size),this._emitChunkComplete(o-this._offset,o,this._size),this._offset=o,o===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(r,n){var o=Mb(r,n,this.options);return this._req=o,o}},{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(o){r._urlStorageKey=o})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return qb(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=Mb("DELETE",r,n);return qb(o,null,n).then(function(i){if(i.getStatus()!==204)throw new qu.default("tus: unexpected response while terminating upload",null,o,i)}).catch(function(i){if(i instanceof qu.default||(i=new qu.default("tus: failed to terminate upload",i,o,null)),!Hb(i,0,n))throw i;var a=n.retryDelays[0],s=n.retryDelays.slice(1),u=ri(ri({},n),{},{retryDelays:s});return new Promise(function(c){return setTimeout(c,a)}).then(function(){return t.terminate(r,u)})})}}])})();function Ub(t){return Object.entries(t).map(function(e){var r=zb(e,2),n=r[0],o=r[1];return"".concat(n," ").concat(A$.Base64.encode(String(o)))}).join(",")}function ni(t,e){return t>=e&&t<e+100}function Mb(t,e,r){var n=r.httpStack.createRequest(t,e);r.protocol===Vu?n.setHeader("Upload-Draft-Interop-Version","5"):r.protocol===Ba?n.setHeader("Upload-Draft-Interop-Version","6"):n.setHeader("Tus-Resumable","1.0.0");for(var o=r.headers||{},i=0,a=Object.entries(o);i<a.length;i++){var s=zb(a[i],2),u=s[0],c=s[1];n.setHeader(u,c)}if(r.addRequestId){var l=(0,k$.default)();n.setHeader("X-Request-ID",l)}return n}function qb(t,e,r){return qd.apply(this,arguments)}function qd(){return qd=$$(Md().mark(function t(e,r,n){var o;return Md().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(typeof n.onBeforeRequest!="function"){a.next=3;break}return a.next=3,n.onBeforeRequest(e);case 3:return a.next=5,e.send(r);case 5:if(o=a.sent,typeof n.onAfterResponse!="function"){a.next=9;break}return a.next=9,n.onAfterResponse(e,o);case 9:return a.abrupt("return",o);case 10:case"end":return a.stop()}},t)})),qd.apply(this,arguments)}function M$(){var t=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(t=!1),t}function Hb(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):Yb(t)}function Yb(t){var e=t.originalResponse?t.originalResponse.getStatus():0;return(!ni(e,400)||e===409||e===423)&&M$()}function Vb(t,e){return new O$.default(e,t).toString()}function q$(t,e){for(var r=Math.floor(t/e),n=[],o=0;o<e;o++)n.push({start:r*o,end:r*(o+1)});return n[e-1].end=t,n}Kb.defaultOptions=U$;var JV=zu.default=Kb});var Zb=x((ZV,Xb)=>{"use strict";var Or=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";Or.writable=t=>Or(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";Or.readable=t=>Or(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";Or.duplex=t=>Or.writable(t)&&Or.readable(t);Or.transform=t=>Or.duplex(t)&&typeof t._transform=="function";Xb.exports=Or});var ev=x(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.default=void 0;function ja(t){"@babel/helpers - typeof";return ja=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},ja(t)}function H$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qb(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,z$(n.key),n)}}function V$(t,e,r){return e&&Qb(t.prototype,e),r&&Qb(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function z$(t){var e=G$(t,"string");return ja(e)=="symbol"?e:e+""}function G$(t,e){if(ja(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ja(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var QV=Gu.default=(function(){function t(e){H$(this,t),this._buffer=e,this.size=e.length}return V$(t,[{key:"slice",value:function(r,n){var o=this._buffer.slice(r,n);o.size=o.length;var i=n>=this.size;return Promise.resolve({value:o,done:i})}},{key:"close",value:function(){}}])})()});var ov=x(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.default=Z$;var nv=require("fs");function Jn(t){"@babel/helpers - typeof";return Jn=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},Jn(t)}function Vd(){"use strict";Vd=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(y,v,w){y[v]=w.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(y,v,w){return Object.defineProperty(y,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),y[v]}try{c({},"")}catch{c=function(w,F,I){return w[F]=I}}function l(y,v,w,F){var I=v&&v.prototype instanceof C?v:C,O=Object.create(I.prototype),q=new Q(F||[]);return o(O,"_invoke",{value:N(y,w,q)}),O}function f(y,v,w){try{return{type:"normal",arg:y.call(v,w)}}catch(F){return{type:"throw",arg:F}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",m="executing",b="completed",D={};function C(){}function E(){}function g(){}var _={};c(_,a,function(){return this});var S=Object.getPrototypeOf,P=S&&S(S($([])));P&&P!==r&&n.call(P,a)&&(_=P);var k=g.prototype=C.prototype=Object.create(_);function B(y){["next","throw","return"].forEach(function(v){c(y,v,function(w){return this._invoke(v,w)})})}function R(y,v){function w(I,O,q,T){var j=f(y[I],y,O);if(j.type!=="throw"){var ee=j.arg,V=ee.value;return V&&Jn(V)=="object"&&n.call(V,"__await")?v.resolve(V.__await).then(function(se){w("next",se,q,T)},function(se){w("throw",se,q,T)}):v.resolve(V).then(function(se){ee.value=se,q(ee)},function(se){return w("throw",se,q,T)})}T(j.arg)}var F;o(this,"_invoke",{value:function(O,q){function T(){return new v(function(j,ee){w(O,q,j,ee)})}return F=F?F.then(T,T):T()}})}function N(y,v,w){var F=d;return function(I,O){if(F===m)throw Error("Generator is already running");if(F===b){if(I==="throw")throw O;return{value:t,done:!0}}for(w.method=I,w.arg=O;;){var q=w.delegate;if(q){var T=A(q,w);if(T){if(T===D)continue;return T}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(F===d)throw F=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);F=m;var j=f(y,v,w);if(j.type==="normal"){if(F=w.done?b:h,j.arg===D)continue;return{value:j.arg,done:w.done}}j.type==="throw"&&(F=b,w.method="throw",w.arg=j.arg)}}}function A(y,v){var w=v.method,F=y.iterator[w];if(F===t)return v.delegate=null,w==="throw"&&y.iterator.return&&(v.method="return",v.arg=t,A(y,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var I=f(F,y.iterator,v.arg);if(I.type==="throw")return v.method="throw",v.arg=I.arg,v.delegate=null,D;var O=I.arg;return O?O.done?(v[y.resultName]=O.value,v.next=y.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):O:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function U(y){var v={tryLoc:y[0]};1 in y&&(v.catchLoc=y[1]),2 in y&&(v.finallyLoc=y[2],v.afterLoc=y[3]),this.tryEntries.push(v)}function M(y){var v=y.completion||{};v.type="normal",delete v.arg,y.completion=v}function Q(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(U,this),this.reset(!0)}function $(y){if(y||y===""){var v=y[a];if(v)return v.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var w=-1,F=function I(){for(;++w<y.length;)if(n.call(y,w))return I.value=y[w],I.done=!1,I;return I.value=t,I.done=!0,I};return F.next=F}}throw new TypeError(Jn(y)+" is not iterable")}return E.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:E,configurable:!0}),E.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(y){var v=typeof y=="function"&&y.constructor;return!!v&&(v===E||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,g):(y.__proto__=g,c(y,u,"GeneratorFunction")),y.prototype=Object.create(k),y},e.awrap=function(y){return{__await:y}},B(R.prototype),c(R.prototype,s,function(){return this}),e.AsyncIterator=R,e.async=function(y,v,w,F,I){I===void 0&&(I=Promise);var O=new R(l(y,v,w,F),I);return e.isGeneratorFunction(v)?O:O.next().then(function(q){return q.done?q.value:O.next()})},B(k),c(k,u,"Generator"),c(k,a,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(y){var v=Object(y),w=[];for(var F in v)w.push(F);return w.reverse(),function I(){for(;w.length;){var O=w.pop();if(O in v)return I.value=O,I.done=!1,I}return I.done=!0,I}},e.values=$,Q.prototype={constructor:Q,reset:function(v){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(M),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function F(ee,V){return q.type="throw",q.arg=v,w.next=ee,V&&(w.method="next",w.arg=t),!!V}for(var I=this.tryEntries.length-1;I>=0;--I){var O=this.tryEntries[I],q=O.completion;if(O.tryLoc==="root")return F("end");if(O.tryLoc<=this.prev){var T=n.call(O,"catchLoc"),j=n.call(O,"finallyLoc");if(T&&j){if(this.prev<O.catchLoc)return F(O.catchLoc,!0);if(this.prev<O.finallyLoc)return F(O.finallyLoc)}else if(T){if(this.prev<O.catchLoc)return F(O.catchLoc,!0)}else{if(!j)throw Error("try statement without catch or finally");if(this.prev<O.finallyLoc)return F(O.finallyLoc)}}}},abrupt:function(v,w){for(var F=this.tryEntries.length-1;F>=0;--F){var I=this.tryEntries[F];if(I.tryLoc<=this.prev&&n.call(I,"finallyLoc")&&this.prev<I.finallyLoc){var O=I;break}}O&&(v==="break"||v==="continue")&&O.tryLoc<=w&&w<=O.finallyLoc&&(O=null);var q=O?O.completion:{};return q.type=v,q.arg=w,O?(this.method="next",this.next=O.finallyLoc,D):this.complete(q)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.finallyLoc===v)return this.complete(F.completion,F.afterLoc),M(F),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.tryLoc===v){var I=F.completion;if(I.type==="throw"){var O=I.arg;M(F)}return O}}throw Error("illegal catch attempt")},delegateYield:function(v,w,F){return this.delegate={iterator:$(v),resultName:w,nextLoc:F},this.method==="next"&&(this.arg=t),D}},e}function W$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tv(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,Y$(n.key),n)}}function K$(t,e,r){return e&&tv(t.prototype,e),r&&tv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Y$(t){var e=J$(t,"string");return Jn(e)=="symbol"?e:e+""}function J$(t,e){if(Jn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Jn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function rv(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(c){r(c);return}s.done?e(u):Promise.resolve(u).then(n,o)}function X$(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(u){rv(i,n,o,a,s,"next",u)}function s(u){rv(i,n,o,a,s,"throw",u)}a(void 0)})}}function Z$(t){return zd.apply(this,arguments)}function zd(){return zd=X$(Vd().mark(function t(e){var r,n,o,i,a,s,u;return Vd().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=e.path.toString(),l.next=3,nv.promises.stat(n);case 3:return o=l.sent,i=o.size,a=(r=e.start)!==null&&r!==void 0?r:0,s=Number.isFinite(e.end)?e.end+1:i,u=s-a,l.abrupt("return",new Q$(e,n,u));case 9:case"end":return l.stop()}},t)})),zd.apply(this,arguments)}var Q$=(function(){function t(e,r,n){W$(this,t),this._stream=e,this._path=r,this.size=n}return K$(t,[{key:"slice",value:function(r,n){var o,i=(o=this._stream.start)!==null&&o!==void 0?o:0,a=(0,nv.createReadStream)(this._path,{start:i+r,end:i+n-1,autoClose:!0});a.size=Math.min(n-r,this.size);var s=a.size>=this.size;return Promise.resolve({value:a,done:s})}},{key:"close",value:function(){this._stream.destroy()}}])})()});var Kd=x(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.default=void 0;function Xn(t){"@babel/helpers - typeof";return Xn=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},Xn(t)}function Na(){"use strict";Na=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(y,v,w){y[v]=w.value},i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(y,v,w){return Object.defineProperty(y,v,{value:w,enumerable:!0,configurable:!0,writable:!0}),y[v]}try{c({},"")}catch{c=function(w,F,I){return w[F]=I}}function l(y,v,w,F){var I=v&&v.prototype instanceof C?v:C,O=Object.create(I.prototype),q=new Q(F||[]);return o(O,"_invoke",{value:N(y,w,q)}),O}function f(y,v,w){try{return{type:"normal",arg:y.call(v,w)}}catch(F){return{type:"throw",arg:F}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",m="executing",b="completed",D={};function C(){}function E(){}function g(){}var _={};c(_,a,function(){return this});var S=Object.getPrototypeOf,P=S&&S(S($([])));P&&P!==r&&n.call(P,a)&&(_=P);var k=g.prototype=C.prototype=Object.create(_);function B(y){["next","throw","return"].forEach(function(v){c(y,v,function(w){return this._invoke(v,w)})})}function R(y,v){function w(I,O,q,T){var j=f(y[I],y,O);if(j.type!=="throw"){var ee=j.arg,V=ee.value;return V&&Xn(V)=="object"&&n.call(V,"__await")?v.resolve(V.__await).then(function(se){w("next",se,q,T)},function(se){w("throw",se,q,T)}):v.resolve(V).then(function(se){ee.value=se,q(ee)},function(se){return w("throw",se,q,T)})}T(j.arg)}var F;o(this,"_invoke",{value:function(O,q){function T(){return new v(function(j,ee){w(O,q,j,ee)})}return F=F?F.then(T,T):T()}})}function N(y,v,w){var F=d;return function(I,O){if(F===m)throw Error("Generator is already running");if(F===b){if(I==="throw")throw O;return{value:t,done:!0}}for(w.method=I,w.arg=O;;){var q=w.delegate;if(q){var T=A(q,w);if(T){if(T===D)continue;return T}}if(w.method==="next")w.sent=w._sent=w.arg;else if(w.method==="throw"){if(F===d)throw F=b,w.arg;w.dispatchException(w.arg)}else w.method==="return"&&w.abrupt("return",w.arg);F=m;var j=f(y,v,w);if(j.type==="normal"){if(F=w.done?b:h,j.arg===D)continue;return{value:j.arg,done:w.done}}j.type==="throw"&&(F=b,w.method="throw",w.arg=j.arg)}}}function A(y,v){var w=v.method,F=y.iterator[w];if(F===t)return v.delegate=null,w==="throw"&&y.iterator.return&&(v.method="return",v.arg=t,A(y,v),v.method==="throw")||w!=="return"&&(v.method="throw",v.arg=new TypeError("The iterator does not provide a '"+w+"' method")),D;var I=f(F,y.iterator,v.arg);if(I.type==="throw")return v.method="throw",v.arg=I.arg,v.delegate=null,D;var O=I.arg;return O?O.done?(v[y.resultName]=O.value,v.next=y.nextLoc,v.method!=="return"&&(v.method="next",v.arg=t),v.delegate=null,D):O:(v.method="throw",v.arg=new TypeError("iterator result is not an object"),v.delegate=null,D)}function U(y){var v={tryLoc:y[0]};1 in y&&(v.catchLoc=y[1]),2 in y&&(v.finallyLoc=y[2],v.afterLoc=y[3]),this.tryEntries.push(v)}function M(y){var v=y.completion||{};v.type="normal",delete v.arg,y.completion=v}function Q(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(U,this),this.reset(!0)}function $(y){if(y||y===""){var v=y[a];if(v)return v.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var w=-1,F=function I(){for(;++w<y.length;)if(n.call(y,w))return I.value=y[w],I.done=!1,I;return I.value=t,I.done=!0,I};return F.next=F}}throw new TypeError(Xn(y)+" is not iterable")}return E.prototype=g,o(k,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:E,configurable:!0}),E.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(y){var v=typeof y=="function"&&y.constructor;return!!v&&(v===E||(v.displayName||v.name)==="GeneratorFunction")},e.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,g):(y.__proto__=g,c(y,u,"GeneratorFunction")),y.prototype=Object.create(k),y},e.awrap=function(y){return{__await:y}},B(R.prototype),c(R.prototype,s,function(){return this}),e.AsyncIterator=R,e.async=function(y,v,w,F,I){I===void 0&&(I=Promise);var O=new R(l(y,v,w,F),I);return e.isGeneratorFunction(v)?O:O.next().then(function(q){return q.done?q.value:O.next()})},B(k),c(k,u,"Generator"),c(k,a,function(){return this}),c(k,"toString",function(){return"[object Generator]"}),e.keys=function(y){var v=Object(y),w=[];for(var F in v)w.push(F);return w.reverse(),function I(){for(;w.length;){var O=w.pop();if(O in v)return I.value=O,I.done=!1,I}return I.done=!0,I}},e.values=$,Q.prototype={constructor:Q,reset:function(v){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(M),!v)for(var w in this)w.charAt(0)==="t"&&n.call(this,w)&&!isNaN(+w.slice(1))&&(this[w]=t)},stop:function(){this.done=!0;var v=this.tryEntries[0].completion;if(v.type==="throw")throw v.arg;return this.rval},dispatchException:function(v){if(this.done)throw v;var w=this;function F(ee,V){return q.type="throw",q.arg=v,w.next=ee,V&&(w.method="next",w.arg=t),!!V}for(var I=this.tryEntries.length-1;I>=0;--I){var O=this.tryEntries[I],q=O.completion;if(O.tryLoc==="root")return F("end");if(O.tryLoc<=this.prev){var T=n.call(O,"catchLoc"),j=n.call(O,"finallyLoc");if(T&&j){if(this.prev<O.catchLoc)return F(O.catchLoc,!0);if(this.prev<O.finallyLoc)return F(O.finallyLoc)}else if(T){if(this.prev<O.catchLoc)return F(O.catchLoc,!0)}else{if(!j)throw Error("try statement without catch or finally");if(this.prev<O.finallyLoc)return F(O.finallyLoc)}}}},abrupt:function(v,w){for(var F=this.tryEntries.length-1;F>=0;--F){var I=this.tryEntries[F];if(I.tryLoc<=this.prev&&n.call(I,"finallyLoc")&&this.prev<I.finallyLoc){var O=I;break}}O&&(v==="break"||v==="continue")&&O.tryLoc<=w&&w<=O.finallyLoc&&(O=null);var q=O?O.completion:{};return q.type=v,q.arg=w,O?(this.method="next",this.next=O.finallyLoc,D):this.complete(q)},complete:function(v,w){if(v.type==="throw")throw v.arg;return v.type==="break"||v.type==="continue"?this.next=v.arg:v.type==="return"?(this.rval=this.arg=v.arg,this.method="return",this.next="end"):v.type==="normal"&&w&&(this.next=w),D},finish:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.finallyLoc===v)return this.complete(F.completion,F.afterLoc),M(F),D}},catch:function(v){for(var w=this.tryEntries.length-1;w>=0;--w){var F=this.tryEntries[w];if(F.tryLoc===v){var I=F.completion;if(I.type==="throw"){var O=I.arg;M(F)}return O}}throw Error("illegal catch attempt")},delegateYield:function(v,w,F){return this.delegate={iterator:$(v),resultName:w,nextLoc:F},this.method==="next"&&(this.arg=t),D}},e}function eP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function iv(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,rP(n.key),n)}}function tP(t,e,r){return e&&iv(t.prototype,e),r&&iv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function rP(t){var e=nP(t,"string");return Xn(e)=="symbol"?e:e+""}function nP(t,e){if(Xn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Xn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function av(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(c){r(c);return}s.done?e(u):Promise.resolve(u).then(n,o)}function sv(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(u){av(i,n,o,a,s,"next",u)}function s(u){av(i,n,o,a,s,"throw",u)}a(void 0)})}}function oP(t,e){return Wd.apply(this,arguments)}function Wd(){return Wd=sv(Na().mark(function t(e,r){return Na().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new Promise(function(i,a){var s=function(l){e.off("readable",u),a(l)},u=function c(){var l=e.read(r);l!==null&&(e.off("error",s),e.off("readable",c),i(l))};e.once("error",s),e.on("readable",u)}));case 1:case"end":return o.stop()}},t)})),Wd.apply(this,arguments)}var rz=Wu.default=(function(){function t(e){var r=this;eP(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 tP(t,[{key:"slice",value:(function(){var e=sv(Na().mark(function n(o,i){var a,s,u,c,l;return Na().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(!(o<this._bufPos)){d.next=2;break}throw new Error("cannot slice from position which we already seeked away");case 2:if(!(o>this._bufPos+this._buf.length)){d.next=4;break}throw new Error("slice start is outside of buffer (currently not implemented)");case 4:if(!this._error){d.next=6;break}throw this._error;case 6:if(o<this._bufPos+this._buf.length?(s=o-this._bufPos,u=Math.min(this._buf.length,i-this._bufPos),a=this._buf.slice(s,u)):a=Buffer.alloc(0),!this._ended){d.next=10;break}return a.size=a.length,d.abrupt("return",{value:a,done:!0});case 10:if(c=i-o,!(c>a.length)){d.next=16;break}return d.next=14,oP(this._stream,c-a.length);case 14:l=d.sent,a=Buffer.concat([a,l]);case 16:return this._buf=a,this._bufPos=o,a.size=a.length,d.abrupt("return",{value:a,done:this._ended});case 20:case"end":return d.stop()}},n,this)}));function r(n,o){return e.apply(this,arguments)}return r})()},{key:"close",value:function(){this._stream.destroy()}}])})()});var cv=x(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.default=void 0;var iP=require("fs"),aP=Ku(Zb()),sP=Ku(ev()),uP=Ku(ov()),cP=Ku(Kd());function Ku(t){return t&&t.__esModule?t:{default:t}}function La(t){"@babel/helpers - typeof";return La=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},La(t)}function lP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function uv(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,pP(n.key),n)}}function fP(t,e,r){return e&&uv(t.prototype,e),r&&uv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function pP(t){var e=dP(t,"string");return La(e)=="symbol"?e:e+""}function dP(t,e){if(La(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(La(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var oz=Yu.default=(function(){function t(){lP(this,t)}return fP(t,[{key:"openFile",value:function(r,n){return Buffer.isBuffer(r)?Promise.resolve(new sP.default(r)):r instanceof iP.ReadStream&&r.path!=null?(0,uP.default)(r):aP.default.readable(r)?(n=Number(n),Number.isFinite(n)?Promise.resolve(new cP.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 dv=x(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.default=gP;var hP=require("crypto"),lv=pv(require("fs")),mP=pv(require("path"));function fv(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(fv=function(n){return n?r:e})(t)}function pv(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=fv(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,r&&r.set(t,n),n}function gP(t,e){if(Buffer.isBuffer(t)){var r=65536,n=t.slice(0,Math.min(r,t.length)),o=(0,hP.createHash)("md5").update(n).digest("hex"),i=["node-buffer",o,t.length,e.endpoint].join("-");return Promise.resolve(i)}return t instanceof lv.ReadStream&&t.path!=null?new Promise(function(a,s){var u=mP.resolve(t.path);lv.stat(t.path,function(c,l){if(c){s(c);return}var f=["node-file",u,l.size,l.mtime.getTime(),e.endpoint].join("-");a(f)})}):Promise.resolve(null)}});var yv=x((sz,Dv)=>{var gv="Expected a function",hv=NaN,DP="[object Symbol]",yP=/^\s+|\s+$/g,bP=/^[-+]0x[0-9a-f]+$/i,vP=/^0b[01]+$/i,wP=/^0o[0-7]+$/i,CP=parseInt,EP=typeof global=="object"&&global&&global.Object===Object&&global,_P=typeof self=="object"&&self&&self.Object===Object&&self,xP=EP||_P||Function("return this")(),SP=Object.prototype,FP=SP.toString,AP=Math.max,OP=Math.min,Jd=function(){return xP.Date.now()};function kP(t,e,r){var n,o,i,a,s,u,c=0,l=!1,f=!1,d=!0;if(typeof t!="function")throw new TypeError(gv);e=mv(e)||0,Ju(r)&&(l=!!r.leading,f="maxWait"in r,i=f?AP(mv(r.maxWait)||0,e):i,d="trailing"in r?!!r.trailing:d);function h(P){var k=n,B=o;return n=o=void 0,c=P,a=t.apply(B,k),a}function m(P){return c=P,s=setTimeout(C,e),l?h(P):a}function b(P){var k=P-u,B=P-c,R=e-k;return f?OP(R,i-B):R}function D(P){var k=P-u,B=P-c;return u===void 0||k>=e||k<0||f&&B>=i}function C(){var P=Jd();if(D(P))return E(P);s=setTimeout(C,b(P))}function E(P){return s=void 0,d&&n?h(P):(n=o=void 0,a)}function g(){s!==void 0&&clearTimeout(s),c=0,n=u=o=s=void 0}function _(){return s===void 0?a:E(Jd())}function S(){var P=Jd(),k=D(P);if(n=arguments,o=this,u=P,k){if(s===void 0)return m(u);if(f)return s=setTimeout(C,e),h(u)}return s===void 0&&(s=setTimeout(C,e)),a}return S.cancel=g,S.flush=_,S}function $P(t,e,r){var n=!0,o=!0;if(typeof t!="function")throw new TypeError(gv);return Ju(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),kP(t,e,{leading:n,maxWait:e,trailing:o})}function Ju(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function PP(t){return!!t&&typeof t=="object"}function TP(t){return typeof t=="symbol"||PP(t)&&FP.call(t)==DP}function mv(t){if(typeof t=="number")return t;if(TP(t))return hv;if(Ju(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ju(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(yP,"");var r=vP.test(t);return r||wP.test(t)?CP(t.slice(2),r?2:8):bP.test(t)?hv:+t}Dv.exports=$P});var Fv=x(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.default=void 0;var IP=_v(require("http")),RP=_v(require("https")),wv=require("stream"),BP=require("url"),Cv=jP(yv());function jP(t){return t&&t.__esModule?t:{default:t}}function Ev(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(Ev=function(n){return n?r:e})(t)}function _v(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=Ev(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,r&&r.set(t,n),n}function NP(t,e,r){return e=Xu(e),LP(t,xv()?Reflect.construct(e,r||[],Xu(t).constructor):e.apply(t,r))}function LP(t,e){if(e&&(oi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UP(t)}function UP(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xv(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xv=function(){return!!t})()}function Xu(t){return Xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xu(t)}function MP(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&&Xd(t,e)}function Xd(t,e){return Xd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Xd(t,e)}function bv(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function Ua(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bv(Object(r),!0).forEach(function(n){qP(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bv(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qP(t,e,r){return e=Sv(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oi(t){"@babel/helpers - typeof";return oi=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},oi(t)}function Zu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vv(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,Sv(n.key),n)}}function Qu(t,e,r){return e&&vv(t.prototype,e),r&&vv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Sv(t){var e=HP(t,"string");return oi(e)=="symbol"?e:e+""}function HP(t,e){if(oi(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(oi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var uz=ec.default=(function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zu(this,t),this._requestOptions=e}return Qu(t,[{key:"createRequest",value:function(r,n){return new VP(r,n,this._requestOptions)}},{key:"getName",value:function(){return"NodeHttpStack"}}])})(),VP=(function(){function t(e,r,n){Zu(this,t),this._method=e,this._url=r,this._headers={},this._request=null,this._progressHandler=function(){},this._requestOptions=n||{}}return Qu(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(o,i){var a=Ua(Ua(Ua({},(0,BP.parse)(r._url)),r._requestOptions),{},{method:r._method,headers:Ua(Ua({},r._requestOptions.headers||{}),r._headers)});n!=null&&n.size&&(a.headers["Content-Length"]=n.size);var s=a.protocol==="https:"?RP:IP;r._request=s.request(a);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");o(new zP(c,f))})}),u.on("error",function(c){i(c)}),n instanceof wv.Readable?n.pipe(new GP(r._progressHandler)).pipe(u):n instanceof Uint8Array?WP(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}}])})(),zP=(function(){function t(e,r){Zu(this,t),this._response=e,this._body=r}return Qu(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}}])})(),GP=(function(t){function e(r){var n;return Zu(this,e),n=NP(this,e),n._onprogress=(0,Cv.default)(r,100,{leading:!0,trailing:!1}),n._position=0,n}return MP(e,t),Qu(e,[{key:"_transform",value:function(n,o,i){this._position+=n.length,this._onprogress(this._position),i(null,n)}}])})(wv.Transform),WP=function(e,r,n){n=(0,Cv.default)(n,100,{leading:!0,trailing:!1});var o=0;function i(){var a=Math.min(e.writableHighWaterMark,r.length-o),s=r.subarray(o,o+a);o+=s.length;var u=e.write(s);u?o<r.length?i():e.end():(e.once("drain",i),n(o))}i()}});var Av=x(Zd=>{"use strict";Zd.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};Zd.root=function(t,e,r){var n=this,o,i={stackLength:Error.stackTraceLimit,rootOnly:!0},a="",s=Error.stackTraceLimit,u;function c(){u[0]=n.toString(),n.stack=u.join(`
|
|
37
37
|
`)}(!e||typeof e!="object")&&(e={}),e.hasOwnProperty("stackLength")&&typeof e.stackLength=="number"&&!isNaN(e.stackLength)&&e.stackLength>=0&&(i.stackLength=e.stackLength),e.hasOwnProperty("rootOnly")||(i.rootOnly=e.rootOnly),(!i.rootOnly||this.CustomError.parent===Error)&&(Object.keys(t).forEach(function(l){switch(l){case"code":o=t.code||void 0;break;case"message":a=t.message||"";break;default:n[l]=t[l]}}),Error.stackTraceLimit=i.stackLength+2,u=new Error().stack.split(`
|
|
38
38
|
`),u.splice(0,3),u.unshift(""),Error.stackTraceLimit=s,this.stack=u.join(`
|
|
39
39
|
`),Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,get:function(){return o},set:function(l){o=l,c()}}),Object.defineProperty(this,"message",{configurable:!0,enumerable:!0,get:function(){return a},set:function(l){a=l,c()}}),c())}});var $v=x((fz,kv)=>{"use strict";kv.exports=Zn;Zn.factory=Av();var th=Zn("CustomError");th.order=Zn(th,{message:"Arguments out of order.",code:"EOARG"});function Zn(t,e,r,n){var o,i;return e=tc(arguments,1,Error,Ov,[Qd,rc]),r=tc(arguments,2,{},Qd,[rc]),n=tc(arguments,3,eh,rc,[]),t=tc(arguments,0,e===Error?"Error":e.prototype.CustomError.name,KP,[Ov,Qd,rc]),i=e===Error,i&&n===eh&&(n=Zn.factory.root),o=function(a,s){var u,c,l,f,d,h;if(!(this instanceof o))return new o(a,s);for(delete this.constructor.name,Object.defineProperty(this.constructor,"name",{enumerable:!1,configurable:!0,value:t,writable:!1}),typeof a=="string"&&(a={message:a}),a||(a={}),c=this.CustomError.chain.slice(0).reverse().map(function(m){return m.properties}),c.push(a),c.unshift({}),h=Object.assign.apply(Object,c),u=this,l={},Object.keys(Zn.factory).forEach(function(m){l[m]=function(b,D){Zn.factory[m].call(u,b,D,l)}}),f=this.CustomError.chain.length-1;f>=0;f--)d=this.CustomError.chain[f],d.factory!==eh&&d.factory.call(this,h,s,l)},o.prototype=Object.create(e.prototype),o.prototype.constructor=o,o.prototype.name=t,o.prototype.CustomError={chain:i?[]:e.prototype.CustomError.chain.slice(0),factory:n,name:t,parent:e,properties:r},o.prototype.CustomError.chain.unshift(o.prototype.CustomError),o.prototype.toString=function(){var a=this.CustomError.chain[this.CustomError.chain.length-1].name;return this.code&&(a+=" "+this.code),this.message&&(a+=": "+this.message),a},o}function tc(t,e,r,n,o){var i=-1,a=-1,s,u,c=e<t.length?e:t.length,l;for(s=0;s<=c;s++){if(l=t[s],i===-1)for(u=0;u<o.length;u++)o[u](l)&&(i=s);a===-1&&n(l)&&(a=s)}if(a!==-1&&i!==-1&&i<a)throw new th.order;return a!==-1?t[a]:r}function rc(t){return typeof t=="function"&&t!==Error&&!t.prototype.CustomError}function KP(t){return typeof t=="string"}function Ov(t){return typeof t=="function"&&(t===Error||t.prototype.CustomError)}function Qd(t){return t&&typeof t=="object"}function eh(){}});var Tv=x((pz,Pv)=>{Pv.exports=$v()});var Nv=x((Qn,ii)=>{var YP=1/0,JP="[object Symbol]",Ma={function:!0,object:!0},XP=Ma[typeof Qn]&&Qn&&!Qn.nodeType?Qn:void 0,ZP=Ma[typeof ii]&&ii&&!ii.nodeType?ii:void 0,QP=nc(XP&&ZP&&typeof global=="object"&&global),eT=nc(Ma[typeof self]&&self),Iv=nc(Ma[typeof window]&&window),rh=nc(Ma[typeof Qn]&&Qn),tT=QP||Iv!==(rh&&rh.window)&&Iv||eT||rh||Function("return this")();function nc(t){return t&&t.Object===Object?t:null}var rT=Object.prototype,nT=rT.toString,Rv=tT.Symbol,Bv=Rv?Rv.prototype:void 0,jv=Bv?Bv.toString:void 0;function oT(t){if(typeof t=="string")return t;if(aT(t))return jv?jv.call(t):"";var e=t+"";return e=="0"&&1/t==-YP?"-0":e}function iT(t){return!!t&&typeof t=="object"}function aT(t){return typeof t=="symbol"||iT(t)&&nT.call(t)==JP}ii.exports=oT});var zv=x((eo,ai)=>{var sT=Nv(),uT="Expected a function",Uv="__lodash_hash_undefined__",cT="[object Function]",lT="[object GeneratorFunction]",fT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,pT=/[\\^$.*+?()[\]{}|]/g,dT=/\\(\\)?/g,hT=/^\[object .+?Constructor\]$/,Ha={function:!0,object:!0},mT=Ha[typeof eo]&&eo&&!eo.nodeType?eo:void 0,gT=Ha[typeof ai]&&ai&&!ai.nodeType?ai:void 0,DT=oc(mT&&gT&&typeof global=="object"&&global),yT=oc(Ha[typeof self]&&self),Lv=oc(Ha[typeof window]&&window),nh=oc(Ha[typeof eo]&&eo),bT=DT||Lv!==(nh&&nh.window)&&Lv||yT||nh||Function("return this")();function oc(t){return t&&t.Object===Object?t:null}function vT(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}var wT=Array.prototype,Mv=Object.prototype,qv=Function.prototype.toString,oh=Mv.hasOwnProperty,CT=Mv.toString,ET=RegExp("^"+qv.call(oh).replace(pT,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_T=wT.splice,xT=Hv(bT,"Map"),qa=Hv(Object,"create");function to(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 ST(){this.__data__=qa?qa(null):{}}function FT(t){return this.has(t)&&delete this.__data__[t]}function AT(t){var e=this.__data__;if(qa){var r=e[t];return r===Uv?void 0:r}return oh.call(e,t)?e[t]:void 0}function OT(t){var e=this.__data__;return qa?e[t]!==void 0:oh.call(e,t)}function kT(t,e){var r=this.__data__;return r[t]=qa&&e===void 0?Uv:e,this}to.prototype.clear=ST;to.prototype.delete=FT;to.prototype.get=AT;to.prototype.has=OT;to.prototype.set=kT;function si(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 $T(){this.__data__=[]}function PT(t){var e=this.__data__,r=ic(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():_T.call(e,r,1),!0}function TT(t){var e=this.__data__,r=ic(e,t);return r<0?void 0:e[r][1]}function IT(t){return ic(this.__data__,t)>-1}function RT(t,e){var r=this.__data__,n=ic(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}si.prototype.clear=$T;si.prototype.delete=PT;si.prototype.get=TT;si.prototype.has=IT;si.prototype.set=RT;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 BT(){this.__data__={hash:new to,map:new(xT||si),string:new to}}function jT(t){return ac(this,t).delete(t)}function NT(t){return ac(this,t).get(t)}function LT(t){return ac(this,t).has(t)}function UT(t,e){return ac(this,t).set(t,e),this}ro.prototype.clear=BT;ro.prototype.delete=jT;ro.prototype.get=NT;ro.prototype.has=LT;ro.prototype.set=UT;function ic(t,e){for(var r=t.length;r--;)if(VT(t[r][0],e))return r;return-1}function ac(t,e){var r=t.__data__;return MT(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Hv(t,e){var r=t[e];return GT(r)?r:void 0}function MT(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var qT=ih(function(t){var e=[];return WT(t).replace(fT,function(r,n,o,i){e.push(o?i.replace(dT,"$1"):n||r)}),e});function HT(t){if(t!=null){try{return qv.call(t)}catch{}try{return t+""}catch{}}return""}function ih(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(uT);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a),a};return r.cache=new(ih.Cache||ro),r}ih.Cache=ro;function VT(t,e){return t===e||t!==t&&e!==e}function zT(t){var e=Vv(t)?CT.call(t):"";return e==cT||e==lT}function Vv(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function GT(t){if(!Vv(t))return!1;var e=zT(t)||vT(t)?ET:hT;return e.test(HT(t))}function WT(t){return t==null?"":sT(t)}ai.exports=qT});var ww=x((no,ci)=>{var KT=zv(),YT=200,gh="__lodash_hash_undefined__",fc=1,li=2,JT=1/0,Xv=9007199254740991,sc="[object Arguments]",uh="[object Array]",Zv="[object Boolean]",Qv="[object Date]",ew="[object Error]",tw="[object Function]",XT="[object GeneratorFunction]",Va="[object Map]",rw="[object Number]",ui="[object Object]",Gv="[object Promise]",nw="[object RegExp]",za="[object Set]",Dh="[object String]",ow="[object Symbol]",ch="[object WeakMap]",iw="[object ArrayBuffer]",uc="[object DataView]",ZT="[object Float32Array]",QT="[object Float64Array]",e6="[object Int8Array]",t6="[object Int16Array]",r6="[object Int32Array]",n6="[object Uint8Array]",o6="[object Uint8ClampedArray]",i6="[object Uint16Array]",a6="[object Uint32Array]",s6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u6=/^\w*$/,c6=/[\\^$.*+?()[\]{}|]/g,l6=/^\[object .+?Constructor\]$/,f6=/^(?:0|[1-9]\d*)$/,Be={};Be[ZT]=Be[QT]=Be[e6]=Be[t6]=Be[r6]=Be[n6]=Be[o6]=Be[i6]=Be[a6]=!0;Be[sc]=Be[uh]=Be[iw]=Be[Zv]=Be[uc]=Be[Qv]=Be[ew]=Be[tw]=Be[Va]=Be[rw]=Be[ui]=Be[nw]=Be[za]=Be[Dh]=Be[ch]=!1;var Wa={function:!0,object:!0},p6=Wa[typeof no]&&no&&!no.nodeType?no:void 0,d6=Wa[typeof ci]&&ci&&!ci.nodeType?ci:void 0,h6=pc(p6&&d6&&typeof global=="object"&&global),m6=pc(Wa[typeof self]&&self),Wv=pc(Wa[typeof window]&&window),ah=pc(Wa[typeof no]&&no),ao=h6||Wv!==(ah&&ah.window)&&Wv||m6||ah||Function("return this")();function g6(t,e){for(var r=-1,n=t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}function D6(t,e){for(var r=-1,n=t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function y6(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function b6(t,e){return g6(e,function(r){return[r,t[r]]})}function pc(t){return t&&t.Object===Object?t:null}function lh(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function aw(t){var e=-1,r=Array(t.size);return t.forEach(function(n,o){r[++e]=[o,n]}),r}function v6(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}function w6(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=[n,n]}),r}var C6=Array.prototype,dc=Object.prototype,sw=Function.prototype.toString,oo=dc.hasOwnProperty,so=dc.toString,E6=RegExp("^"+sw.call(oo).replace(c6,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kv=ao.Symbol,Yv=ao.Uint8Array,_6=dc.propertyIsEnumerable,x6=C6.splice,S6=Object.getPrototypeOf,F6=Object.keys,fh=fi(ao,"DataView"),cc=fi(ao,"Map"),ph=fi(ao,"Promise"),dh=fi(ao,"Set"),hh=fi(ao,"WeakMap"),Ga=fi(Object,"create"),A6=co(fh),O6=co(cc),k6=co(ph),$6=co(dh),P6=co(hh),Jv=Kv?Kv.prototype:void 0,sh=Jv?Jv.valueOf:void 0;function io(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 T6(){this.__data__=Ga?Ga(null):{}}function I6(t){return this.has(t)&&delete this.__data__[t]}function R6(t){var e=this.__data__;if(Ga){var r=e[t];return r===gh?void 0:r}return oo.call(e,t)?e[t]:void 0}function B6(t){var e=this.__data__;return Ga?e[t]!==void 0:oo.call(e,t)}function j6(t,e){var r=this.__data__;return r[t]=Ga&&e===void 0?gh:e,this}io.prototype.clear=T6;io.prototype.delete=I6;io.prototype.get=R6;io.prototype.has=B6;io.prototype.set=j6;function Yr(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 N6(){this.__data__=[]}function L6(t){var e=this.__data__,r=hc(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():x6.call(e,r,1),!0}function U6(t){var e=this.__data__,r=hc(e,t);return r<0?void 0:e[r][1]}function M6(t){return hc(this.__data__,t)>-1}function q6(t,e){var r=this.__data__,n=hc(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Yr.prototype.clear=N6;Yr.prototype.delete=L6;Yr.prototype.get=U6;Yr.prototype.has=M6;Yr.prototype.set=q6;function uo(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 H6(){this.__data__={hash:new io,map:new(cc||Yr),string:new io}}function V6(t){return mc(this,t).delete(t)}function z6(t){return mc(this,t).get(t)}function G6(t){return mc(this,t).has(t)}function W6(t,e){return mc(this,t).set(t,e),this}uo.prototype.clear=H6;uo.prototype.delete=V6;uo.prototype.get=z6;uo.prototype.has=G6;uo.prototype.set=W6;function lc(t){var e=-1,r=t?t.length:0;for(this.__data__=new uo;++e<r;)this.add(t[e])}function K6(t){return this.__data__.set(t,gh),this}function Y6(t){return this.__data__.has(t)}lc.prototype.add=lc.prototype.push=K6;lc.prototype.has=Y6;function Kr(t){this.__data__=new Yr(t)}function J6(){this.__data__=new Yr}function X6(t){return this.__data__.delete(t)}function Z6(t){return this.__data__.get(t)}function Q6(t){return this.__data__.has(t)}function eI(t,e){var r=this.__data__;return r instanceof Yr&&r.__data__.length==YT&&(r=this.__data__=new uo(r.__data__)),r.set(t,e),this}Kr.prototype.clear=J6;Kr.prototype.delete=X6;Kr.prototype.get=Z6;Kr.prototype.has=Q6;Kr.prototype.set=eI;function hc(t,e){for(var r=t.length;r--;)if(bI(t[r][0],e))return r;return-1}function uw(t,e){e=gc(e,t)?[e]:fw(e);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Dc(e[r++])];return r&&r==n?t:void 0}function cw(t,e){return oo.call(t,e)||typeof t=="object"&&e in t&&hI(t)===null}function tI(t,e){return e in Object(t)}function yh(t,e,r,n,o){return t===e?!0:t==null||e==null||!bc(t)&&!Ka(e)?t!==t&&e!==e:rI(t,e,yh,r,n,o)}function rI(t,e,r,n,o,i){var a=vn(t),s=vn(e),u=uh,c=uh;a||(u=Wr(t),u=u==sc?ui:u),s||(c=Wr(e),c=c==sc?ui:c);var l=u==ui&&!lh(t),f=c==ui&&!lh(e),d=u==c;if(d&&!l)return i||(i=new Kr),a||CI(t)?pw(t,e,r,n,o,i):lI(t,e,u,r,n,o,i);if(!(o&li)){var h=l&&oo.call(t,"__wrapped__"),m=f&&oo.call(e,"__wrapped__");if(h||m){var b=h?t.value():t,D=m?e.value():e;return i||(i=new Kr),r(b,D,n,o,i)}}return d?(i||(i=new Kr),fI(t,e,r,n,o,i)):!1}function nI(t,e,r,n){var o=r.length,i=o,a=!n;if(t==null)return!i;for(t=Object(t);o--;){var s=r[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){s=r[o];var u=s[0],c=t[u],l=s[1];if(a&&s[2]){if(c===void 0&&!(u in t))return!1}else{var f=new Kr;if(n)var d=n(c,l,u,t,e,f);if(!(d===void 0?yh(l,c,n,fc|li,f):d))return!1}}return!0}function oI(t){return typeof t=="function"?t:t==null?SI:typeof t=="object"?vn(t)?sI(t[0],t[1]):aI(t):FI(t)}function iI(t){return F6(Object(t))}function aI(t){var e=dI(t);return e.length==1&&e[0][2]?mw(e[0][0],e[0][1]):function(r){return r===t||nI(r,t,e)}}function sI(t,e){return gc(t)&&hw(e)?mw(Dc(t),e):function(r){var n=EI(r,t);return n===void 0&&n===e?_I(r,t):yh(e,n,void 0,fc|li)}}function lw(t){return function(e){return e?.[t]}}function uI(t){return function(e){return uw(e,t)}}function fw(t){return vn(t)?t:KT(t)}function cI(t){return function(e){var r=Wr(e);return r==Va?aw(e):r==za?w6(e):b6(e,t(e))}}function pw(t,e,r,n,o,i){var a=o&li,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return!1;var c=i.get(t);if(c)return c==e;var l=-1,f=!0,d=o&fc?new lc:void 0;for(i.set(t,e);++l<s;){var h=t[l],m=e[l];if(n)var b=a?n(m,h,l,e,t,i):n(h,m,l,t,e,i);if(b!==void 0){if(b)continue;f=!1;break}if(d){if(!D6(e,function(D,C){if(!d.has(C)&&(h===D||r(h,D,n,o,i)))return d.add(C)})){f=!1;break}}else if(!(h===m||r(h,m,n,o,i))){f=!1;break}}return i.delete(t),f}function lI(t,e,r,n,o,i,a){switch(r){case uc:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case iw:return!(t.byteLength!=e.byteLength||!n(new Yv(t),new Yv(e)));case Zv:case Qv:return+t==+e;case ew:return t.name==e.name&&t.message==e.message;case rw:return t!=+t?e!=+e:t==+e;case nw:case Dh:return t==e+"";case Va:var s=aw;case za:var u=i&li;if(s||(s=v6),t.size!=e.size&&!u)return!1;var c=a.get(t);return c?c==e:(i|=fc,a.set(t,e),pw(s(t),s(e),n,o,i,a));case ow:if(sh)return sh.call(t)==sh.call(e)}return!1}function fI(t,e,r,n,o,i){var a=o&li,s=mh(t),u=s.length,c=mh(e),l=c.length;if(u!=l&&!a)return!1;for(var f=u;f--;){var d=s[f];if(!(a?d in e:cw(e,d)))return!1}var h=i.get(t);if(h)return h==e;var m=!0;i.set(t,e);for(var b=a;++f<u;){d=s[f];var D=t[d],C=e[d];if(n)var E=a?n(C,D,d,e,t,i):n(D,C,d,t,e,i);if(!(E===void 0?D===C||r(D,C,n,o,i):E)){m=!1;break}b||(b=d=="constructor")}if(m&&!b){var g=t.constructor,_=e.constructor;g!=_&&"constructor"in t&&"constructor"in e&&!(typeof g=="function"&&g instanceof g&&typeof _=="function"&&_ instanceof _)&&(m=!1)}return i.delete(t),m}var pI=lw("length");function mc(t,e){var r=t.__data__;return DI(e)?r[typeof e=="string"?"string":"hash"]:r.map}function dI(t){for(var e=xI(t),r=e.length;r--;)e[r][2]=hw(e[r][1]);return e}function fi(t,e){var r=t[e];return wI(r)?r:void 0}function hI(t){return S6(Object(t))}function Wr(t){return so.call(t)}(fh&&Wr(new fh(new ArrayBuffer(1)))!=uc||cc&&Wr(new cc)!=Va||ph&&Wr(ph.resolve())!=Gv||dh&&Wr(new dh)!=za||hh&&Wr(new hh)!=ch)&&(Wr=function(t){var e=so.call(t),r=e==ui?t.constructor:void 0,n=r?co(r):void 0;if(n)switch(n){case A6:return uc;case O6:return Va;case k6:return Gv;case $6:return za;case P6:return ch}return e});function mI(t,e,r){e=gc(e,t)?[e]:fw(e);for(var n,o=-1,a=e.length;++o<a;){var i=Dc(e[o]);if(!(n=t!=null&&r(t,i)))break;t=t[i]}if(n)return n;var a=t?t.length:0;return!!a&&yc(a)&&dw(i,a)&&(vn(t)||bw(t)||gw(t))}function gI(t){var e=t?t.length:void 0;return yc(e)&&(vn(t)||bw(t)||gw(t))?y6(e,String):null}function dw(t,e){return e=e??Xv,!!e&&(typeof t=="number"||f6.test(t))&&t>-1&&t%1==0&&t<e}function gc(t,e){if(vn(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||vw(t)?!0:u6.test(t)||!s6.test(t)||e!=null&&t in Object(e)}function DI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function yI(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||dc;return t===r}function hw(t){return t===t&&!bc(t)}function mw(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Dc(t){if(typeof t=="string"||vw(t))return t;var e=t+"";return e=="0"&&1/t==-JT?"-0":e}function co(t){if(t!=null){try{return sw.call(t)}catch{}try{return t+""}catch{}}return""}function bI(t,e){return t===e||t!==t&&e!==e}function gw(t){return vI(t)&&oo.call(t,"callee")&&(!_6.call(t,"callee")||so.call(t)==sc)}var vn=Array.isArray;function Dw(t){return t!=null&&yc(pI(t))&&!yw(t)}function vI(t){return Ka(t)&&Dw(t)}function yw(t){var e=bc(t)?so.call(t):"";return e==tw||e==XT}function yc(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Xv}function bc(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function Ka(t){return!!t&&typeof t=="object"}function wI(t){if(!bc(t))return!1;var e=yw(t)||lh(t)?E6:l6;return e.test(co(t))}function bw(t){return typeof t=="string"||!vn(t)&&Ka(t)&&so.call(t)==Dh}function vw(t){return typeof t=="symbol"||Ka(t)&&so.call(t)==ow}function CI(t){return Ka(t)&&yc(t.length)&&!!Be[so.call(t)]}function EI(t,e,r){var n=t==null?void 0:uw(t,e);return n===void 0?r:n}function _I(t,e){return t!=null&&mI(t,e,tI)}function mh(t){var e=yI(t);if(!(e||Dw(t)))return iI(t);var r=gI(t),n=!!r,o=r||[],i=o.length;for(var a in t)cw(t,a)&&!(n&&(a=="length"||dw(a,i)))&&!(e&&a=="constructor")&&o.push(a);return o}var xI=cI(mh);function SI(t){return t}function FI(t){return gc(t)?lw(Dc(t)):uI(t)}ci.exports=oI});var Sw=x((lo,pi)=>{var AI=1/0,OI="[object Function]",kI="[object GeneratorFunction]",$I=/[\\^$.*+?()[\]{}|]/g,PI=/^\[object .+?Constructor\]$/,Ya={function:!0,object:!0},TI=Ya[typeof lo]&&lo&&!lo.nodeType?lo:void 0,II=Ya[typeof pi]&&pi&&!pi.nodeType?pi:void 0,RI=vc(TI&&II&&typeof global=="object"&&global),BI=vc(Ya[typeof self]&&self),Cw=vc(Ya[typeof window]&&window),bh=vc(Ya[typeof lo]&&lo),jI=RI||Cw!==(bh&&bh.window)&&Cw||BI||bh||Function("return this")();function vc(t){return t&&t.Object===Object?t:null}function NI(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function LI(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Ew=Object.prototype,_w=Function.prototype.toString,UI=Ew.hasOwnProperty,MI=Ew.toString,qI=RegExp("^"+_w.call(UI).replace($I,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vh=VI(jI,"Set"),HI=vh&&1/LI(new vh([,-0]))[1]==AI?function(t){return new vh(t)}:KI;function VI(t,e){var r=t[e];return WI(r)?r:void 0}function zI(t){if(t!=null){try{return _w.call(t)}catch{}try{return t+""}catch{}}return""}function GI(t){var e=xw(t)?MI.call(t):"";return e==OI||e==kI}function xw(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function WI(t){if(!xw(t))return!1;var e=GI(t)||NI(t)?qI:PI;return e.test(zI(t))}function KI(){}pi.exports=HI});var Aw=x((fo,di)=>{var Ja={function:!0,object:!0},YI=Ja[typeof fo]&&fo&&!fo.nodeType?fo:void 0,JI=Ja[typeof di]&&di&&!di.nodeType?di:void 0,XI=wc(YI&&JI&&typeof global=="object"&&global),ZI=wc(Ja[typeof self]&&self),Fw=wc(Ja[typeof window]&&window),wh=wc(Ja[typeof fo]&&fo),QI=XI||Fw!==(wh&&wh.window)&&Fw||ZI||wh||Function("return this")();function wc(t){return t&&t.Object===Object?t:null}di.exports=QI});var Iw=x((dz,Tw)=>{var e8=Sw(),t8=Aw(),r8=200,Ch="__lodash_hash_undefined__",n8="[object Function]",o8="[object GeneratorFunction]",i8=/[\\^$.*+?()[\]{}|]/g,a8=/^\[object .+?Constructor\]$/;function s8(t,e){return!!t.length&&c8(t,e,0)>-1}function u8(t,e,r){for(var n=-1,o=t.length;++n<o;)if(r(e,t[n]))return!0;return!1}function c8(t,e,r){if(e!==e)return f8(t,r);for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function l8(t,e){return t.has(e)}function f8(t,e,r){for(var n=t.length,o=e+(r?0:-1);r?o--:++o<n;){var i=t[o];if(i!==i)return o}return-1}function p8(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function d8(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var h8=Array.prototype,Ow=Object.prototype,kw=Function.prototype.toString,Eh=Ow.hasOwnProperty,m8=Ow.toString,g8=RegExp("^"+kw.call(Eh).replace(i8,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),D8=h8.splice,y8=$w(t8,"Map"),Xa=$w(Object,"create");function po(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 b8(){this.__data__=Xa?Xa(null):{}}function v8(t){return this.has(t)&&delete this.__data__[t]}function w8(t){var e=this.__data__;if(Xa){var r=e[t];return r===Ch?void 0:r}return Eh.call(e,t)?e[t]:void 0}function C8(t){var e=this.__data__;return Xa?e[t]!==void 0:Eh.call(e,t)}function E8(t,e){var r=this.__data__;return r[t]=Xa&&e===void 0?Ch:e,this}po.prototype.clear=b8;po.prototype.delete=v8;po.prototype.get=w8;po.prototype.has=C8;po.prototype.set=E8;function hi(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 _8(){this.__data__=[]}function x8(t){var e=this.__data__,r=Ec(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():D8.call(e,r,1),!0}function S8(t){var e=this.__data__,r=Ec(e,t);return r<0?void 0:e[r][1]}function F8(t){return Ec(this.__data__,t)>-1}function A8(t,e){var r=this.__data__,n=Ec(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}hi.prototype.clear=_8;hi.prototype.delete=x8;hi.prototype.get=S8;hi.prototype.has=F8;hi.prototype.set=A8;function mi(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 O8(){this.__data__={hash:new po,map:new(y8||hi),string:new po}}function k8(t){return _c(this,t).delete(t)}function $8(t){return _c(this,t).get(t)}function P8(t){return _c(this,t).has(t)}function T8(t,e){return _c(this,t).set(t,e),this}mi.prototype.clear=O8;mi.prototype.delete=k8;mi.prototype.get=$8;mi.prototype.has=P8;mi.prototype.set=T8;function Cc(t){var e=-1,r=t?t.length:0;for(this.__data__=new mi;++e<r;)this.add(t[e])}function I8(t){return this.__data__.set(t,Ch),this}function R8(t){return this.__data__.has(t)}Cc.prototype.add=Cc.prototype.push=I8;Cc.prototype.has=R8;function Ec(t,e){for(var r=t.length;r--;)if(L8(t[r][0],e))return r;return-1}function B8(t,e,r){var n=-1,o=s8,i=t.length,a=!0,s=[],u=s;if(r)a=!1,o=u8;else if(i>=r8){var c=e?null:e8(t);if(c)return d8(c);a=!1,o=l8,u=new Cc}else u=e?[]:s;e:for(;++n<i;){var l=t[n],f=e?e(l):l;if(l=r||l!==0?l:0,a&&f===f){for(var d=u.length;d--;)if(u[d]===f)continue e;e&&u.push(f),s.push(l)}else o(u,f,r)||(u!==s&&u.push(f),s.push(l))}return s}function _c(t,e){var r=t.__data__;return j8(e)?r[typeof e=="string"?"string":"hash"]:r.map}function $w(t,e){var r=t[e];return M8(r)?r:void 0}function j8(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function N8(t){if(t!=null){try{return kw.call(t)}catch{}try{return t+""}catch{}}return""}function L8(t,e){return t===e||t!==t&&e!==e}function U8(t){var e=Pw(t)?m8.call(t):"";return e==n8||e==o8}function Pw(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function M8(t){if(!Pw(t))return!1;var e=U8(t)||p8(t)?g8:a8;return e.test(N8(t))}Tw.exports=B8});var Bw=x((hz,Rw)=>{var q8=ww(),H8=Iw();function V8(t,e){return t&&t.length?H8(t,q8(e)):[]}Rw.exports=V8});var Nw=x((mz,jw)=>{"use strict";var z8=Tv(),G8=Bw(),W8=z8("MultiError");jw.exports=_h;function _h(t){if(!(this instanceof _h))return new _h(t);if(t=Array.isArray(t)?t:[t],t=G8(t,function(r){return r.stack}),t.length===1)return t[0];var e=new W8({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(`
|
|
40
40
|
|
|
41
41
|
`)}),e.__defineSetter__("stack",function(r){return[r].concat(e.stack).join(`
|
|
42
42
|
|
|
43
|
-
`)}),e}});var Uw=x((gz,Lw)=>{var wn=require("constants"),K8=process.cwd,xc=null,Y8=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xc||(xc=K8.call(process)),xc};try{process.cwd()}catch{}typeof process.chdir=="function"&&(xh=process.chdir,process.chdir=function(t){xc=null,xh.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,xh));var xh;Lw.exports=J8;function J8(t){wn.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=s(t.stat),t.fstat=s(t.fstat),t.lstat=s(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,d){d&&process.nextTick(d)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,d,h){h&&process.nextTick(h)},t.lchownSync=function(){}),Y8==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(l){function f(d,h,m){var b=Date.now(),D=0;l(d,h,function C(E){if(E&&(E.code==="EACCES"||E.code==="EPERM"||E.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(h,function(g,_){g&&g.code==="ENOENT"?l(d,h,C):m(E)})},D),D<100&&(D+=10);return}m&&m(E)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(l){function f(d,h,m,b,D,C){var E;if(C&&typeof C=="function"){var g=0;E=function(_,S,
|
|
44
|
-
GFS4: `),console.error(t)});ze[dt]||(Gw=global[dt]||[],Kw(ze,Gw),ze.close=(function(t){function e(r,n){return t.call(ze,r,function(o){o||Ww(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Ac,{value:t}),e})(ze.close),ze.closeSync=(function(t){function e(r){t.apply(ze,arguments),Ww()}return Object.defineProperty(e,Ac,{value:t}),e})(ze.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){ho(ze[dt]),require("assert").equal(ze[dt].length,0)}));var Gw;global[dt]||Kw(global,ze[dt]);Ah.exports=Sh(rR(ze));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ze.__patched&&(Ah.exports=Sh(ze),ze.__patched=!0);function Sh(t){eR(t),t.gracefulify=Sh,t.createReadStream=S,t.createWriteStream=T;var e=t.readFile;t.readFile=r;function r(R,N,A){return typeof N=="function"&&(A=N,N=null),U(R,N,A);function U(M,Q,$,y){return e(M,Q,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?gi([U,[M,Q,$],v,y||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=o;function o(R,N,A,U){return typeof A=="function"&&(U=A,A=null),M(R,N,A,U);function M(Q,$,y,v,w){return n(Q,$,y,function(F){F&&(F.code==="EMFILE"||F.code==="ENFILE")?gi([M,[Q,$,y,v],F,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var i=t.appendFile;i&&(t.appendFile=a);function a(R,N,A,U){return typeof A=="function"&&(U=A,A=null),M(R,N,A,U);function M(Q,$,y,v,w){return i(Q,$,y,function(F){F&&(F.code==="EMFILE"||F.code==="ENFILE")?gi([M,[Q,$,y,v],F,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var s=t.copyFile;s&&(t.copyFile=u);function u(R,N,A,U){return typeof A=="function"&&(U=A,A=0),M(R,N,A,U);function M(Q,$,y,v,w){return s(Q,$,y,function(F){F&&(F.code==="EMFILE"||F.code==="ENFILE")?gi([M,[Q,$,y,v],F,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(R,N,A){typeof N=="function"&&(A=N,N=null);var U=l.test(process.version)?function($,y,v,w){return c($,M($,y,v,w))}:function($,y,v,w){return c($,y,M($,y,v,w))};return U(R,N,A);function M(Q,$,y,v){return function(w,F){w&&(w.code==="EMFILE"||w.code==="ENFILE")?gi([U,[Q,$,y],w,v||Date.now(),Date.now()]):(F&&F.sort&&F.sort(),typeof y=="function"&&y.call(this,w,F))}}}if(process.version.substr(0,4)==="v0.8"){var d=tR(t);C=d.ReadStream,g=d.WriteStream}var h=t.ReadStream;h&&(C.prototype=Object.create(h.prototype),C.prototype.open=E);var m=t.WriteStream;m&&(g.prototype=Object.create(m.prototype),g.prototype.open=_),Object.defineProperty(t,"ReadStream",{get:function(){return C},set:function(R){C=R},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return g},set:function(R){g=R},enumerable:!0,configurable:!0});var b=C;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(R){b=R},enumerable:!0,configurable:!0});var D=g;Object.defineProperty(t,"FileWriteStream",{get:function(){return D},set:function(R){D=R},enumerable:!0,configurable:!0});function C(R,N){return this instanceof C?(h.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function E(){var R=this;B(R.path,R.flags,R.mode,function(N,A){N?(R.autoClose&&R.destroy(),R.emit("error",N)):(R.fd=A,R.emit("open",A),R.read())})}function g(R,N){return this instanceof g?(m.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function _(){var R=this;B(R.path,R.flags,R.mode,function(N,A){N?(R.destroy(),R.emit("error",N)):(R.fd=A,R.emit("open",A))})}function S(R,N){return new t.ReadStream(R,N)}function T(R,N){return new t.WriteStream(R,N)}var k=t.open;t.open=B;function B(R,N,A,U){return typeof A=="function"&&(U=A,A=null),M(R,N,A,U);function M(Q,$,y,v,w){return k(Q,$,y,function(F,I){F&&(F.code==="EMFILE"||F.code==="ENFILE")?gi([M,[Q,$,y,v],F,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function gi(t){ho("ENQUEUE",t[0].name,t[1]),ze[dt].push(t),Fh()}var Fc;function Ww(){for(var t=Date.now(),e=0;e<ze[dt].length;++e)ze[dt][e].length>2&&(ze[dt][e][3]=t,ze[dt][e][4]=t);Fh()}function Fh(){if(clearTimeout(Fc),Fc=void 0,ze[dt].length!==0){var t=ze[dt].shift(),e=t[0],r=t[1],n=t[2],o=t[3],i=t[4];if(o===void 0)ho("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){ho("TIMEOUT",e.name,r);var a=r.pop();typeof a=="function"&&a.call(null,n)}else{var s=Date.now()-i,u=Math.max(i-o,1),c=Math.min(u*1.2,100);s>=c?(ho("RETRY",e.name,r),e.apply(null,r.concat([o]))):ze[dt].push(t)}Fc===void 0&&(Fc=setTimeout(Fh,0))}}});var Jw=x((vz,Yw)=>{function nr(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))}Yw.exports=nr;nr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};nr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};nr.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,o=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&&o.unref(),!0};nr.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)};nr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};nr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};nr.prototype.start=nr.prototype.try;nr.prototype.errors=function(){return this._errors};nr.prototype.attempts=function(){return this._attempts};nr.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 o=this._errors[n],i=o.message,a=(t[i]||0)+1;t[i]=a,a>=r&&(e=o,r=a)}return e}});var Xw=x(mo=>{var oR=Jw();mo.operation=function(t){var e=mo.timeouts(t);return new oR(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};mo.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=[],o=0;o<e.retries;o++)n.push(this.createTimeout(o,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(o,e)),n.sort(function(i,a){return i-a}),n};mo.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};mo.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 o=0;o<r.length;o++){var i=r[o],a=t[i];t[i]=function(u){var c=mo.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(d){c.retry(d)||(d&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,a),t[i].options=e}}});var Qw=x((Cz,Zw)=>{Zw.exports=Xw()});var eC=x((Ez,Oc)=>{Oc.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Oc.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Oc.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var $h=x((_z,bi)=>{var Le=global.process,go=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"};go(Le)?(tC=require("assert"),Di=eC(),rC=/^win/i.test(Le.platform),Za=require("events"),typeof Za!="function"&&(Za=Za.EventEmitter),Le.__signal_exit_emitter__?nt=Le.__signal_exit_emitter__:(nt=Le.__signal_exit_emitter__=new Za,nt.count=0,nt.emitted={}),nt.infinite||(nt.setMaxListeners(1/0),nt.infinite=!0),bi.exports=function(t,e){if(!go(global.process))return function(){};tC.equal(typeof t,"function","a callback must be provided for exit handler"),yi===!1&&Oh();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){nt.removeListener(r,t),nt.listeners("exit").length===0&&nt.listeners("afterexit").length===0&&kc()};return nt.on(r,t),n},kc=function(){!yi||!go(global.process)||(yi=!1,Di.forEach(function(e){try{Le.removeListener(e,$c[e])}catch{}}),Le.emit=Pc,Le.reallyExit=kh,nt.count-=1)},bi.exports.unload=kc,Do=function(e,r,n){nt.emitted[e]||(nt.emitted[e]=!0,nt.emit(e,r,n))},$c={},Di.forEach(function(t){$c[t]=function(){if(go(global.process)){var r=Le.listeners(t);r.length===nt.count&&(kc(),Do("exit",null,t),Do("afterexit",null,t),rC&&t==="SIGHUP"&&(t="SIGINT"),Le.kill(Le.pid,t))}}}),bi.exports.signals=function(){return Di},yi=!1,Oh=function(){yi||!go(global.process)||(yi=!0,nt.count+=1,Di=Di.filter(function(e){try{return Le.on(e,$c[e]),!0}catch{return!1}}),Le.emit=oC,Le.reallyExit=nC)},bi.exports.load=Oh,kh=Le.reallyExit,nC=function(e){go(global.process)&&(Le.exitCode=e||0,Do("exit",Le.exitCode,null),Do("afterexit",Le.exitCode,null),kh.call(Le,Le.exitCode))},Pc=Le.emit,oC=function(e,r){if(e==="exit"&&go(global.process)){r!==void 0&&(Le.exitCode=r);var n=Pc.apply(this,arguments);return Do("exit",Le.exitCode,null),Do("afterexit",Le.exitCode,null),n}else return Pc.apply(this,arguments)}):bi.exports=function(){return function(){}};var tC,Di,rC,Za,nt,kc,Do,$c,yi,Oh,kh,nC,Pc,oC});var aC=x((xz,Ph)=>{"use strict";var iC=Symbol();function iR(t,e,r){let n=e[iC];if(n)return e.stat(t,(i,a)=>{if(i)return r(i);r(null,a.mtime,n)});let o=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,o,o,i=>{if(i)return r(i);e.stat(t,(a,s)=>{if(a)return r(a);let u=s.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,iC,{value:u}),r(null,s.mtime,u)})})}function aR(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Ph.exports.probe=iR;Ph.exports.getMtime=aR});var fC=x((Sz,es)=>{"use strict";var sR=require("path"),Rh=Cn(),uR=Qw(),cR=$h(),sC=aC(),Jr={};function Qa(t,e){return e.lockfilePath||`${t}.lock`}function Bh(t,e,r){if(!e.realpath)return r(null,sR.resolve(t));e.fs.realpath(t,r)}function Ih(t,e,r){let n=Qa(t,e);e.fs.mkdir(n,o=>{if(!o)return sC.probe(n,e.fs,(i,a,s)=>{if(i)return e.fs.rmdir(n,()=>{}),r(i);r(null,a,s)});if(o.code!=="EEXIST")return r(o);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(i,a)=>{if(i)return i.code==="ENOENT"?Ih(t,{...e,stale:0},r):r(i);if(!uC(a,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));cC(t,e,s=>{if(s)return r(s);Ih(t,{...e,stale:0},r)})})})}function uC(t,e){return t.mtime.getTime()<Date.now()-e.stale}function cC(t,e,r){e.fs.rmdir(Qa(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Tc(t,e){let r=Jr[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,o)=>{let i=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||i?Th(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Tc(t,e));if(!(r.mtime.getTime()===o.mtime.getTime()))return Th(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let s=sC.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,s,s,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?Th(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Tc(t,e));r.mtime=s,r.lastUpdate=Date.now(),r.updateDelay=null,Tc(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Th(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),Jr[t]===e&&delete Jr[t],e.options.onCompromised(r)}function lR(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Rh,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),Bh(t,e,(n,o)=>{if(n)return r(n);let i=uR.operation(e.retries);i.attempt(()=>{Ih(o,e,(a,s,u)=>{if(i.retry(a))return;if(a)return r(i.mainError());let c=Jr[o]={lockfilePath:Qa(o,e),mtime:s,mtimePrecision:u,options:e,lastUpdate:Date.now()};Tc(o,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));lC(o,{...e,realpath:!1},l)})})})})}function lC(t,e,r){e={fs:Rh,realpath:!0,...e},Bh(t,e,(n,o)=>{if(n)return r(n);let i=Jr[o];if(!i)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete Jr[o],cC(o,e,r)})}function fR(t,e,r){e={stale:1e4,realpath:!0,fs:Rh,...e},e.stale=Math.max(e.stale||0,2e3),Bh(t,e,(n,o)=>{if(n)return r(n);e.fs.stat(Qa(o,e),(i,a)=>i?i.code==="ENOENT"?r(null,!1):r(i):r(null,!uC(a,e)))})}function pR(){return Jr}cR(()=>{for(let t in Jr){let e=Jr[t].options;try{e.fs.rmdirSync(Qa(t,e))}catch{}}});es.exports.lock=lR;es.exports.unlock=lC;es.exports.check=fR;es.exports.getLocks=pR});var dC=x((Fz,pC)=>{"use strict";var dR=Cn();function hR(t){let e=["mkdir","realpath","stat","rmdir","utimes"],r={...t};return e.forEach(n=>{r[n]=(...o)=>{let i=o.pop(),a;try{a=t[`${n}Sync`](...o)}catch(s){return i(s)}i(null,a)}}),r}function mR(t){return(...e)=>new Promise((r,n)=>{e.push((o,i)=>{o?n(o):r(i)}),t(...e)})}function gR(t){return(...e)=>{let r,n;if(e.push((o,i)=>{r=o,n=i}),t(...e),r)throw r;return n}}function DR(t){if(t={...t},t.fs=hR(t.fs||dR),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}pC.exports={toPromise:mR,toSync:gR,toSyncOptions:DR}});var mC=x((Az,En)=>{"use strict";var vi=fC(),{toPromise:Ic,toSync:Rc,toSyncOptions:jh}=dC();async function hC(t,e){let r=await Ic(vi.lock)(t,e);return Ic(r)}function yR(t,e){let r=Rc(vi.lock)(t,jh(e));return Rc(r)}function bR(t,e){return Ic(vi.unlock)(t,e)}function vR(t,e){return Rc(vi.unlock)(t,jh(e))}function wR(t,e){return Ic(vi.check)(t,e)}function CR(t,e){return Rc(vi.check)(t,jh(e))}En.exports=hC;En.exports.lock=hC;En.exports.unlock=bR;En.exports.lockSync=yR;En.exports.unlockSync=vR;En.exports.check=wR;En.exports.checkSync=CR});var vC=x(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.canStoreURLs=wi.FileUrlStorage=void 0;var gC=require("fs"),ER=xR(Nw()),DC=_R(mC());function bC(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(bC=function(n){return n?r:e})(t)}function _R(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=bC(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,r&&r.set(t,n),n}function xR(t){return t&&t.__esModule?t:{default:t}}function ts(t){"@babel/helpers - typeof";return ts=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},ts(t)}function SR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yC(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,AR(n.key),n)}}function FR(t,e,r){return e&&yC(t.prototype,e),r&&yC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function AR(t){var e=OR(t,"string");return ts(e)=="symbol"?e:e+""}function OR(t,e){if(ts(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ts(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Oz=wi.canStoreURLs=!0,kz=wi.FileUrlStorage=(function(){function t(e){SR(this,t),this.path=e}return FR(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,o){r._getItems("tus::",function(i,a){i?o(i):n(a)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(o,i){n._getItems("tus::".concat(r),function(a,s){a?i(a):o(s)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(o,i){n._removeItem(r,function(a){a?i(a):o()})})}},{key:"addUpload",value:function(r,n){var o=this,i=Math.round(Math.random()*1e12),a="tus::".concat(r,"::").concat(i);return new Promise(function(s,u){o._setItem(a,n,function(c){c?u(c):s(a)})})}},{key:"_setItem",value:function(r,n,o){var i=this;DC.lock(this.path,this._lockfileOptions()).then(function(a){o=i._releaseAndCb(a,o),i._getData(function(s,u){if(s){o(s);return}u[r]=n,i._writeData(u,function(c){return o(c)})})}).catch(o)}},{key:"_getItems",value:function(r,n){this._getData(function(o,i){if(o){n(o);return}var a=Object.keys(i).filter(function(s){return s.startsWith(r)}).map(function(s){var u=i[s];return u.urlStorageKey=s,u});n(null,a)})}},{key:"_removeItem",value:function(r,n){var o=this;DC.lock(this.path,this._lockfileOptions()).then(function(i){n=o._releaseAndCb(i,n),o._getData(function(a,s){if(a){n(a);return}delete s[r],o._writeData(s,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(o){if(o){r().then(function(){return n(o)}).catch(function(i){return n((0,ER.default)([o,i]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var o={encoding:"utf8",mode:432,flag:"w"};(0,gC.writeFile)(this.path,JSON.stringify(r),o,function(i){return n(i)})}},{key:"_getData",value:function(r){(0,gC.readFile)(this.path,"utf8",function(n,o){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{o=o.trim().length?JSON.parse(o):{}}catch(i){r(i);return}r(null,o)})}}])})()});var Uh=x(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});Object.defineProperty(jt,"DefaultHttpStack",{enumerable:!0,get:function(){return _C.default}});Object.defineProperty(jt,"DetailedError",{enumerable:!0,get:function(){return kR.default}});Object.defineProperty(jt,"FileUrlStorage",{enumerable:!0,get:function(){return xC.FileUrlStorage}});Object.defineProperty(jt,"StreamSource",{enumerable:!0,get:function(){return RR.default}});jt.Upload=void 0;Object.defineProperty(jt,"canStoreURLs",{enumerable:!0,get:function(){return xC.canStoreURLs}});jt.defaultOptions=void 0;Object.defineProperty(jt,"enableDebugLog",{enumerable:!0,get:function(){return $R.enableDebugLog}});jt.isSupported=void 0;var kR=yo(Td()),$R=Id(),PR=yo(vb()),Nh=yo(Jb()),TR=yo(cv()),IR=yo(dv()),_C=yo(Fv()),RR=yo(Kd()),xC=vC();function yo(t){return t&&t.__esModule?t:{default:t}}function Ei(t){"@babel/helpers - typeof";return Ei=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},Ei(t)}function BR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wC(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,FC(n.key),n)}}function jR(t,e,r){return e&&wC(t.prototype,e),r&&wC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function NR(t,e,r){return e=Bc(e),LR(t,SC()?Reflect.construct(e,r||[],Bc(t).constructor):e.apply(t,r))}function LR(t,e){if(e&&(Ei(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UR(t)}function UR(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function SC(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SC=function(){return!!t})()}function Bc(t){return Bc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bc(t)}function MR(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&&Lh(t,e)}function Lh(t,e){return Lh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Lh(t,e)}function CC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function Ci(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?CC(Object(r),!0).forEach(function(n){qR(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):CC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qR(t,e,r){return e=FC(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FC(t){var e=HR(t,"string");return Ei(e)=="symbol"?e:e+""}function HR(t,e){if(Ei(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ei(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var EC=jt.defaultOptions=Ci(Ci({},Nh.default.defaultOptions),{},{httpStack:new _C.default,fileReader:new TR.default,urlStorage:new PR.default,fingerprint:IR.default}),Pz=jt.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 BR(this,e),n=Ci(Ci({},EC),n),NR(this,e,[r,n])}return MR(e,t),jR(e,null,[{key:"terminate",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=Ci(Ci({},EC),o),Nh.default.terminate(n,o)}}])})(Nh.default),Tz=jt.isSupported=!0});var PC=x((Yz,$C)=>{var _i=1e3,xi=_i*60,Si=xi*60,bo=Si*24,ZR=bo*7,QR=bo*365.25;$C.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return eB(t);if(r==="number"&&isFinite(t))return e.long?rB(t):tB(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function eB(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*QR;case"weeks":case"week":case"w":return r*ZR;case"days":case"day":case"d":return r*bo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Si;case"minutes":case"minute":case"mins":case"min":case"m":return r*xi;case"seconds":case"second":case"secs":case"sec":case"s":return r*_i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function tB(t){var e=Math.abs(t);return e>=bo?Math.round(t/bo)+"d":e>=Si?Math.round(t/Si)+"h":e>=xi?Math.round(t/xi)+"m":e>=_i?Math.round(t/_i)+"s":t+"ms"}function rB(t){var e=Math.abs(t);return e>=bo?Nc(t,e,bo,"day"):e>=Si?Nc(t,e,Si,"hour"):e>=xi?Nc(t,e,xi,"minute"):e>=_i?Nc(t,e,_i,"second"):t+" ms"}function Nc(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}});var Hh=x((Jz,TC)=>{function nB(t){r.debug=r,r.default=r,r.coerce=u,r.disable=a,r.enable=o,r.enabled=s,r.humanize=PC(),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 d=0;d<l.length;d++)f=(f<<5)-f+l.charCodeAt(d),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,d=null,h,m;function b(...D){if(!b.enabled)return;let C=b,E=Number(new Date),g=E-(f||E);C.diff=g,C.prev=f,C.curr=E,f=E,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let _=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(T,k)=>{if(T==="%%")return"%";_++;let B=r.formatters[k];if(typeof B=="function"){let R=D[_];T=B.call(C,R),D.splice(_,1),_--}return T}),r.formatArgs.call(C,D),(C.log||r.log).apply(C,D)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(h!==r.namespaces&&(h=r.namespaces,m=r.enabled(l)),m),set:D=>{d=D}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let d=r(this.namespace+(typeof f>"u"?":":f)+l);return d.log=this.log,d}function o(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function i(l,f){let d=0,h=0,m=-1,b=0;for(;d<l.length;)if(h<f.length&&(f[h]===l[d]||f[h]==="*"))f[h]==="*"?(m=h,b=d,h++):(d++,h++);else if(m!==-1)h=m+1,b++,d=b;else return!1;for(;h<f.length&&f[h]==="*";)h++;return h===f.length}function a(){let l=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){for(let f of r.skips)if(i(l,f))return!1;for(let f of r.names)if(i(l,f))return!0;return!1}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}TC.exports=nB});var IC=x((Nt,Lc)=>{Nt.formatArgs=iB;Nt.save=aB;Nt.load=sB;Nt.useColors=oB;Nt.storage=uB();Nt.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`."))}})();Nt.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 oB(){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 iB(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Lc.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,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}Nt.log=console.debug||console.log||(()=>{});function aB(t){try{t?Nt.storage.setItem("debug",t):Nt.storage.removeItem("debug")}catch{}}function sB(){let t;try{t=Nt.storage.getItem("debug")||Nt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function uB(){try{return localStorage}catch{}}Lc.exports=Hh()(Nt);var{formatters:cB}=Lc.exports;cB.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var BC=x((Xz,RC)=>{"use strict";RC.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n<o)}});var LC=x((Zz,NC)=>{"use strict";var lB=require("os"),jC=require("tty"),sr=BC(),{env:it}=process,_n;sr("no-color")||sr("no-colors")||sr("color=false")||sr("color=never")?_n=0:(sr("color")||sr("colors")||sr("color=true")||sr("color=always"))&&(_n=1);"FORCE_COLOR"in it&&(it.FORCE_COLOR==="true"?_n=1:it.FORCE_COLOR==="false"?_n=0:_n=it.FORCE_COLOR.length===0?1:Math.min(parseInt(it.FORCE_COLOR,10),3));function Vh(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function zh(t,e){if(_n===0)return 0;if(sr("color=16m")||sr("color=full")||sr("color=truecolor"))return 3;if(sr("color=256"))return 2;if(t&&!e&&_n===void 0)return 0;let r=_n||0;if(it.TERM==="dumb")return r;if(process.platform==="win32"){let n=lB.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in it)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in it)||it.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in it)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(it.TEAMCITY_VERSION)?1:0;if(it.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in it){let n=parseInt((it.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(it.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(it.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(it.TERM)||"COLORTERM"in it?1:r}function fB(t){let e=zh(t,t&&t.isTTY);return Vh(e)}NC.exports={supportsColor:fB,stdout:Vh(zh(!0,jC.isatty(1))),stderr:Vh(zh(!0,jC.isatty(2)))}});var MC=x((at,Mc)=>{var pB=require("tty"),Uc=require("util");at.init=bB;at.log=gB;at.formatArgs=hB;at.save=DB;at.load=yB;at.useColors=dB;at.destroy=Uc.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");at.colors=[6,2,3,4,5,1];try{let t=LC();t&&(t.stderr||t).level>=2&&(at.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{}at.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.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 dB(){return"colors"in at.inspectOpts?!!at.inspectOpts.colors:pB.isatty(process.stderr.fd)}function hB(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${o};1m${e} \x1B[0m`;t[0]=i+t[0].split(`
|
|
43
|
+
`)}),e}});var Uw=x((gz,Lw)=>{var wn=require("constants"),K8=process.cwd,xc=null,Y8=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xc||(xc=K8.call(process)),xc};try{process.cwd()}catch{}typeof process.chdir=="function"&&(xh=process.chdir,process.chdir=function(t){xc=null,xh.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,xh));var xh;Lw.exports=J8;function J8(t){wn.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=s(t.stat),t.fstat=s(t.fstat),t.lstat=s(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,d){d&&process.nextTick(d)},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(l,f,d,h){h&&process.nextTick(h)},t.lchownSync=function(){}),Y8==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:(function(l){function f(d,h,m){var b=Date.now(),D=0;l(d,h,function C(E){if(E&&(E.code==="EACCES"||E.code==="EPERM"||E.code==="EBUSY")&&Date.now()-b<6e4){setTimeout(function(){t.stat(h,function(g,_){g&&g.code==="ENOENT"?l(d,h,C):m(E)})},D),D<100&&(D+=10);return}m&&m(E)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f})(t.rename)),t.read=typeof t.read!="function"?t.read:(function(l){function f(d,h,m,b,D,C){var E;if(C&&typeof C=="function"){var g=0;E=function(_,S,P){if(_&&_.code==="EAGAIN"&&g<10)return g++,l.call(t,d,h,m,b,D,E);C.apply(this,arguments)}}return l.call(t,d,h,m,b,D,E)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,l),f})(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:(function(l){return function(f,d,h,m,b){for(var D=0;;)try{return l.call(t,f,d,h,m,b)}catch(C){if(C.code==="EAGAIN"&&D<10){D++;continue}throw C}}})(t.readSync);function e(l){l.lchmod=function(f,d,h){l.open(f,wn.O_WRONLY|wn.O_SYMLINK,d,function(m,b){if(m){h&&h(m);return}l.fchmod(b,d,function(D){l.close(b,function(C){h&&h(D||C)})})})},l.lchmodSync=function(f,d){var h=l.openSync(f,wn.O_WRONLY|wn.O_SYMLINK,d),m=!0,b;try{b=l.fchmodSync(h,d),m=!1}finally{if(m)try{l.closeSync(h)}catch{}else l.closeSync(h)}return b}}function r(l){wn.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(f,d,h,m){l.open(f,wn.O_SYMLINK,function(b,D){if(b){m&&m(b);return}l.futimes(D,d,h,function(C){l.close(D,function(E){m&&m(C||E)})})})},l.lutimesSync=function(f,d,h){var m=l.openSync(f,wn.O_SYMLINK),b,D=!0;try{b=l.futimesSync(m,d,h),D=!1}finally{if(D)try{l.closeSync(m)}catch{}else l.closeSync(m)}return b}):l.futimes&&(l.lutimes=function(f,d,h,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function n(l){return l&&function(f,d,h){return l.call(t,f,d,function(m){c(m)&&(m=null),h&&h.apply(this,arguments)})}}function o(l){return l&&function(f,d){try{return l.call(t,f,d)}catch(h){if(!c(h))throw h}}}function i(l){return l&&function(f,d,h,m){return l.call(t,f,d,h,function(b){c(b)&&(b=null),m&&m.apply(this,arguments)})}}function a(l){return l&&function(f,d,h){try{return l.call(t,f,d,h)}catch(m){if(!c(m))throw m}}}function s(l){return l&&function(f,d,h){typeof d=="function"&&(h=d,d=null);function m(b,D){D&&(D.uid<0&&(D.uid+=4294967296),D.gid<0&&(D.gid+=4294967296)),h&&h.apply(this,arguments)}return d?l.call(t,f,d,m):l.call(t,f,m)}}function u(l){return l&&function(f,d){var h=d?l.call(t,f,d):l.call(t,f);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}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 Hw=x((Dz,qw)=>{var Mw=require("stream").Stream;qw.exports=X8;function X8(t){return{ReadStream:e,WriteStream:r};function e(n,o){if(!(this instanceof e))return new e(n,o);Mw.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,o=o||{};for(var a=Object.keys(o),s=0,u=a.length;s<u;s++){var c=a[s];this[c]=o[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(){i._read()});return}t.open(this.path,this.flags,this.mode,function(l,f){if(l){i.emit("error",l),i.readable=!1;return}i.fd=f,i.emit("open",f),i._read()})}function r(n,o){if(!(this instanceof r))return new r(n,o);Mw.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,o=o||{};for(var i=Object.keys(o),a=0,s=i.length;a<s;a++){var u=i[a];this[u]=o[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 zw=x((yz,Vw)=>{"use strict";Vw.exports=Q8;var Z8=Object.getPrototypeOf||function(t){return t.__proto__};function Q8(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:Z8(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}});var Cn=x((bz,Ah)=>{var ze=require("fs"),eR=Uw(),tR=Hw(),rR=zw(),Sc=require("util"),dt,Ac;typeof Symbol=="function"&&typeof Symbol.for=="function"?(dt=Symbol.for("graceful-fs.queue"),Ac=Symbol.for("graceful-fs.previous")):(dt="___graceful-fs.queue",Ac="___graceful-fs.previous");function nR(){}function Kw(t,e){Object.defineProperty(t,dt,{get:function(){return e}})}var ho=nR;Sc.debuglog?ho=Sc.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(ho=function(){var t=Sc.format.apply(Sc,arguments);t="GFS4: "+t.split(/\n/).join(`
|
|
44
|
+
GFS4: `),console.error(t)});ze[dt]||(Gw=global[dt]||[],Kw(ze,Gw),ze.close=(function(t){function e(r,n){return t.call(ze,r,function(o){o||Ww(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(e,Ac,{value:t}),e})(ze.close),ze.closeSync=(function(t){function e(r){t.apply(ze,arguments),Ww()}return Object.defineProperty(e,Ac,{value:t}),e})(ze.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){ho(ze[dt]),require("assert").equal(ze[dt].length,0)}));var Gw;global[dt]||Kw(global,ze[dt]);Ah.exports=Sh(rR(ze));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ze.__patched&&(Ah.exports=Sh(ze),ze.__patched=!0);function Sh(t){eR(t),t.gracefulify=Sh,t.createReadStream=S,t.createWriteStream=P;var e=t.readFile;t.readFile=r;function r(R,N,A){return typeof N=="function"&&(A=N,N=null),U(R,N,A);function U(M,Q,$,y){return e(M,Q,function(v){v&&(v.code==="EMFILE"||v.code==="ENFILE")?gi([U,[M,Q,$],v,y||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var n=t.writeFile;t.writeFile=o;function o(R,N,A,U){return typeof A=="function"&&(U=A,A=null),M(R,N,A,U);function M(Q,$,y,v,w){return n(Q,$,y,function(F){F&&(F.code==="EMFILE"||F.code==="ENFILE")?gi([M,[Q,$,y,v],F,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var i=t.appendFile;i&&(t.appendFile=a);function a(R,N,A,U){return typeof A=="function"&&(U=A,A=null),M(R,N,A,U);function M(Q,$,y,v,w){return i(Q,$,y,function(F){F&&(F.code==="EMFILE"||F.code==="ENFILE")?gi([M,[Q,$,y,v],F,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var s=t.copyFile;s&&(t.copyFile=u);function u(R,N,A,U){return typeof A=="function"&&(U=A,A=0),M(R,N,A,U);function M(Q,$,y,v,w){return s(Q,$,y,function(F){F&&(F.code==="EMFILE"||F.code==="ENFILE")?gi([M,[Q,$,y,v],F,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}var c=t.readdir;t.readdir=f;var l=/^v[0-5]\./;function f(R,N,A){typeof N=="function"&&(A=N,N=null);var U=l.test(process.version)?function($,y,v,w){return c($,M($,y,v,w))}:function($,y,v,w){return c($,y,M($,y,v,w))};return U(R,N,A);function M(Q,$,y,v){return function(w,F){w&&(w.code==="EMFILE"||w.code==="ENFILE")?gi([U,[Q,$,y],w,v||Date.now(),Date.now()]):(F&&F.sort&&F.sort(),typeof y=="function"&&y.call(this,w,F))}}}if(process.version.substr(0,4)==="v0.8"){var d=tR(t);C=d.ReadStream,g=d.WriteStream}var h=t.ReadStream;h&&(C.prototype=Object.create(h.prototype),C.prototype.open=E);var m=t.WriteStream;m&&(g.prototype=Object.create(m.prototype),g.prototype.open=_),Object.defineProperty(t,"ReadStream",{get:function(){return C},set:function(R){C=R},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return g},set:function(R){g=R},enumerable:!0,configurable:!0});var b=C;Object.defineProperty(t,"FileReadStream",{get:function(){return b},set:function(R){b=R},enumerable:!0,configurable:!0});var D=g;Object.defineProperty(t,"FileWriteStream",{get:function(){return D},set:function(R){D=R},enumerable:!0,configurable:!0});function C(R,N){return this instanceof C?(h.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function E(){var R=this;B(R.path,R.flags,R.mode,function(N,A){N?(R.autoClose&&R.destroy(),R.emit("error",N)):(R.fd=A,R.emit("open",A),R.read())})}function g(R,N){return this instanceof g?(m.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}function _(){var R=this;B(R.path,R.flags,R.mode,function(N,A){N?(R.destroy(),R.emit("error",N)):(R.fd=A,R.emit("open",A))})}function S(R,N){return new t.ReadStream(R,N)}function P(R,N){return new t.WriteStream(R,N)}var k=t.open;t.open=B;function B(R,N,A,U){return typeof A=="function"&&(U=A,A=null),M(R,N,A,U);function M(Q,$,y,v,w){return k(Q,$,y,function(F,I){F&&(F.code==="EMFILE"||F.code==="ENFILE")?gi([M,[Q,$,y,v],F,w||Date.now(),Date.now()]):typeof v=="function"&&v.apply(this,arguments)})}}return t}function gi(t){ho("ENQUEUE",t[0].name,t[1]),ze[dt].push(t),Fh()}var Fc;function Ww(){for(var t=Date.now(),e=0;e<ze[dt].length;++e)ze[dt][e].length>2&&(ze[dt][e][3]=t,ze[dt][e][4]=t);Fh()}function Fh(){if(clearTimeout(Fc),Fc=void 0,ze[dt].length!==0){var t=ze[dt].shift(),e=t[0],r=t[1],n=t[2],o=t[3],i=t[4];if(o===void 0)ho("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-o>=6e4){ho("TIMEOUT",e.name,r);var a=r.pop();typeof a=="function"&&a.call(null,n)}else{var s=Date.now()-i,u=Math.max(i-o,1),c=Math.min(u*1.2,100);s>=c?(ho("RETRY",e.name,r),e.apply(null,r.concat([o]))):ze[dt].push(t)}Fc===void 0&&(Fc=setTimeout(Fh,0))}}});var Jw=x((vz,Yw)=>{function nr(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))}Yw.exports=nr;nr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};nr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timeouts=[],this._cachedTimeouts=null};nr.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,o=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&&o.unref(),!0};nr.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)};nr.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};nr.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};nr.prototype.start=nr.prototype.try;nr.prototype.errors=function(){return this._errors};nr.prototype.attempts=function(){return this._attempts};nr.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 o=this._errors[n],i=o.message,a=(t[i]||0)+1;t[i]=a,a>=r&&(e=o,r=a)}return e}});var Xw=x(mo=>{var oR=Jw();mo.operation=function(t){var e=mo.timeouts(t);return new oR(e,{forever:t&&t.forever,unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};mo.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=[],o=0;o<e.retries;o++)n.push(this.createTimeout(o,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(o,e)),n.sort(function(i,a){return i-a}),n};mo.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};mo.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 o=0;o<r.length;o++){var i=r[o],a=t[i];t[i]=function(u){var c=mo.operation(e),l=Array.prototype.slice.call(arguments,1),f=l.pop();l.push(function(d){c.retry(d)||(d&&(arguments[0]=c.mainError()),f.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,a),t[i].options=e}}});var Qw=x((Cz,Zw)=>{Zw.exports=Xw()});var eC=x((Ez,Oc)=>{Oc.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Oc.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Oc.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var $h=x((_z,bi)=>{var Le=global.process,go=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"};go(Le)?(tC=require("assert"),Di=eC(),rC=/^win/i.test(Le.platform),Za=require("events"),typeof Za!="function"&&(Za=Za.EventEmitter),Le.__signal_exit_emitter__?nt=Le.__signal_exit_emitter__:(nt=Le.__signal_exit_emitter__=new Za,nt.count=0,nt.emitted={}),nt.infinite||(nt.setMaxListeners(1/0),nt.infinite=!0),bi.exports=function(t,e){if(!go(global.process))return function(){};tC.equal(typeof t,"function","a callback must be provided for exit handler"),yi===!1&&Oh();var r="exit";e&&e.alwaysLast&&(r="afterexit");var n=function(){nt.removeListener(r,t),nt.listeners("exit").length===0&&nt.listeners("afterexit").length===0&&kc()};return nt.on(r,t),n},kc=function(){!yi||!go(global.process)||(yi=!1,Di.forEach(function(e){try{Le.removeListener(e,$c[e])}catch{}}),Le.emit=Pc,Le.reallyExit=kh,nt.count-=1)},bi.exports.unload=kc,Do=function(e,r,n){nt.emitted[e]||(nt.emitted[e]=!0,nt.emit(e,r,n))},$c={},Di.forEach(function(t){$c[t]=function(){if(go(global.process)){var r=Le.listeners(t);r.length===nt.count&&(kc(),Do("exit",null,t),Do("afterexit",null,t),rC&&t==="SIGHUP"&&(t="SIGINT"),Le.kill(Le.pid,t))}}}),bi.exports.signals=function(){return Di},yi=!1,Oh=function(){yi||!go(global.process)||(yi=!0,nt.count+=1,Di=Di.filter(function(e){try{return Le.on(e,$c[e]),!0}catch{return!1}}),Le.emit=oC,Le.reallyExit=nC)},bi.exports.load=Oh,kh=Le.reallyExit,nC=function(e){go(global.process)&&(Le.exitCode=e||0,Do("exit",Le.exitCode,null),Do("afterexit",Le.exitCode,null),kh.call(Le,Le.exitCode))},Pc=Le.emit,oC=function(e,r){if(e==="exit"&&go(global.process)){r!==void 0&&(Le.exitCode=r);var n=Pc.apply(this,arguments);return Do("exit",Le.exitCode,null),Do("afterexit",Le.exitCode,null),n}else return Pc.apply(this,arguments)}):bi.exports=function(){return function(){}};var tC,Di,rC,Za,nt,kc,Do,$c,yi,Oh,kh,nC,Pc,oC});var aC=x((xz,Ph)=>{"use strict";var iC=Symbol();function iR(t,e,r){let n=e[iC];if(n)return e.stat(t,(i,a)=>{if(i)return r(i);r(null,a.mtime,n)});let o=new Date(Math.ceil(Date.now()/1e3)*1e3+5);e.utimes(t,o,o,i=>{if(i)return r(i);e.stat(t,(a,s)=>{if(a)return r(a);let u=s.mtime.getTime()%1e3===0?"s":"ms";Object.defineProperty(e,iC,{value:u}),r(null,s.mtime,u)})})}function aR(t){let e=Date.now();return t==="s"&&(e=Math.ceil(e/1e3)*1e3),new Date(e)}Ph.exports.probe=iR;Ph.exports.getMtime=aR});var fC=x((Sz,es)=>{"use strict";var sR=require("path"),Rh=Cn(),uR=Qw(),cR=$h(),sC=aC(),Jr={};function Qa(t,e){return e.lockfilePath||`${t}.lock`}function Bh(t,e,r){if(!e.realpath)return r(null,sR.resolve(t));e.fs.realpath(t,r)}function Ih(t,e,r){let n=Qa(t,e);e.fs.mkdir(n,o=>{if(!o)return sC.probe(n,e.fs,(i,a,s)=>{if(i)return e.fs.rmdir(n,()=>{}),r(i);r(null,a,s)});if(o.code!=="EEXIST")return r(o);if(e.stale<=0)return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));e.fs.stat(n,(i,a)=>{if(i)return i.code==="ENOENT"?Ih(t,{...e,stale:0},r):r(i);if(!uC(a,e))return r(Object.assign(new Error("Lock file is already being held"),{code:"ELOCKED",file:t}));cC(t,e,s=>{if(s)return r(s);Ih(t,{...e,stale:0},r)})})})}function uC(t,e){return t.mtime.getTime()<Date.now()-e.stale}function cC(t,e,r){e.fs.rmdir(Qa(t,e),n=>{if(n&&n.code!=="ENOENT")return r(n);r()})}function Tc(t,e){let r=Jr[t];r.updateTimeout||(r.updateDelay=r.updateDelay||e.update,r.updateTimeout=setTimeout(()=>{r.updateTimeout=null,e.fs.stat(r.lockfilePath,(n,o)=>{let i=r.lastUpdate+e.stale<Date.now();if(n)return n.code==="ENOENT"||i?Th(t,r,Object.assign(n,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Tc(t,e));if(!(r.mtime.getTime()===o.mtime.getTime()))return Th(t,r,Object.assign(new Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let s=sC.getMtime(r.mtimePrecision);e.fs.utimes(r.lockfilePath,s,s,u=>{let c=r.lastUpdate+e.stale<Date.now();if(!r.released){if(u)return u.code==="ENOENT"||c?Th(t,r,Object.assign(u,{code:"ECOMPROMISED"})):(r.updateDelay=1e3,Tc(t,e));r.mtime=s,r.lastUpdate=Date.now(),r.updateDelay=null,Tc(t,e)}})})},r.updateDelay),r.updateTimeout.unref&&r.updateTimeout.unref())}function Th(t,e,r){e.released=!0,e.updateTimeout&&clearTimeout(e.updateTimeout),Jr[t]===e&&delete Jr[t],e.options.onCompromised(r)}function lR(t,e,r){e={stale:1e4,update:null,realpath:!0,retries:0,fs:Rh,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),Bh(t,e,(n,o)=>{if(n)return r(n);let i=uR.operation(e.retries);i.attempt(()=>{Ih(o,e,(a,s,u)=>{if(i.retry(a))return;if(a)return r(i.mainError());let c=Jr[o]={lockfilePath:Qa(o,e),mtime:s,mtimePrecision:u,options:e,lastUpdate:Date.now()};Tc(o,e),r(null,l=>{if(c.released)return l&&l(Object.assign(new Error("Lock is already released"),{code:"ERELEASED"}));lC(o,{...e,realpath:!1},l)})})})})}function lC(t,e,r){e={fs:Rh,realpath:!0,...e},Bh(t,e,(n,o)=>{if(n)return r(n);let i=Jr[o];if(!i)return r(Object.assign(new Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));i.updateTimeout&&clearTimeout(i.updateTimeout),i.released=!0,delete Jr[o],cC(o,e,r)})}function fR(t,e,r){e={stale:1e4,realpath:!0,fs:Rh,...e},e.stale=Math.max(e.stale||0,2e3),Bh(t,e,(n,o)=>{if(n)return r(n);e.fs.stat(Qa(o,e),(i,a)=>i?i.code==="ENOENT"?r(null,!1):r(i):r(null,!uC(a,e)))})}function pR(){return Jr}cR(()=>{for(let t in Jr){let e=Jr[t].options;try{e.fs.rmdirSync(Qa(t,e))}catch{}}});es.exports.lock=lR;es.exports.unlock=lC;es.exports.check=fR;es.exports.getLocks=pR});var dC=x((Fz,pC)=>{"use strict";var dR=Cn();function hR(t){let e=["mkdir","realpath","stat","rmdir","utimes"],r={...t};return e.forEach(n=>{r[n]=(...o)=>{let i=o.pop(),a;try{a=t[`${n}Sync`](...o)}catch(s){return i(s)}i(null,a)}}),r}function mR(t){return(...e)=>new Promise((r,n)=>{e.push((o,i)=>{o?n(o):r(i)}),t(...e)})}function gR(t){return(...e)=>{let r,n;if(e.push((o,i)=>{r=o,n=i}),t(...e),r)throw r;return n}}function DR(t){if(t={...t},t.fs=hR(t.fs||dR),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}pC.exports={toPromise:mR,toSync:gR,toSyncOptions:DR}});var mC=x((Az,En)=>{"use strict";var vi=fC(),{toPromise:Ic,toSync:Rc,toSyncOptions:jh}=dC();async function hC(t,e){let r=await Ic(vi.lock)(t,e);return Ic(r)}function yR(t,e){let r=Rc(vi.lock)(t,jh(e));return Rc(r)}function bR(t,e){return Ic(vi.unlock)(t,e)}function vR(t,e){return Rc(vi.unlock)(t,jh(e))}function wR(t,e){return Ic(vi.check)(t,e)}function CR(t,e){return Rc(vi.check)(t,jh(e))}En.exports=hC;En.exports.lock=hC;En.exports.unlock=bR;En.exports.lockSync=yR;En.exports.unlockSync=vR;En.exports.check=wR;En.exports.checkSync=CR});var vC=x(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.canStoreURLs=wi.FileUrlStorage=void 0;var gC=require("fs"),ER=xR(Nw()),DC=_R(mC());function bC(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,r=new WeakMap;return(bC=function(n){return n?r:e})(t)}function _R(t,e){if(!e&&t&&t.__esModule)return t;if(t===null||typeof t!="object"&&typeof t!="function")return{default:t};var r=bC(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=t[i]}return n.default=t,r&&r.set(t,n),n}function xR(t){return t&&t.__esModule?t:{default:t}}function ts(t){"@babel/helpers - typeof";return ts=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},ts(t)}function SR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yC(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,AR(n.key),n)}}function FR(t,e,r){return e&&yC(t.prototype,e),r&&yC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function AR(t){var e=OR(t,"string");return ts(e)=="symbol"?e:e+""}function OR(t,e){if(ts(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(ts(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Oz=wi.canStoreURLs=!0,kz=wi.FileUrlStorage=(function(){function t(e){SR(this,t),this.path=e}return FR(t,[{key:"findAllUploads",value:function(){var r=this;return new Promise(function(n,o){r._getItems("tus::",function(i,a){i?o(i):n(a)})})}},{key:"findUploadsByFingerprint",value:function(r){var n=this;return new Promise(function(o,i){n._getItems("tus::".concat(r),function(a,s){a?i(a):o(s)})})}},{key:"removeUpload",value:function(r){var n=this;return new Promise(function(o,i){n._removeItem(r,function(a){a?i(a):o()})})}},{key:"addUpload",value:function(r,n){var o=this,i=Math.round(Math.random()*1e12),a="tus::".concat(r,"::").concat(i);return new Promise(function(s,u){o._setItem(a,n,function(c){c?u(c):s(a)})})}},{key:"_setItem",value:function(r,n,o){var i=this;DC.lock(this.path,this._lockfileOptions()).then(function(a){o=i._releaseAndCb(a,o),i._getData(function(s,u){if(s){o(s);return}u[r]=n,i._writeData(u,function(c){return o(c)})})}).catch(o)}},{key:"_getItems",value:function(r,n){this._getData(function(o,i){if(o){n(o);return}var a=Object.keys(i).filter(function(s){return s.startsWith(r)}).map(function(s){var u=i[s];return u.urlStorageKey=s,u});n(null,a)})}},{key:"_removeItem",value:function(r,n){var o=this;DC.lock(this.path,this._lockfileOptions()).then(function(i){n=o._releaseAndCb(i,n),o._getData(function(a,s){if(a){n(a);return}delete s[r],o._writeData(s,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(o){if(o){r().then(function(){return n(o)}).catch(function(i){return n((0,ER.default)([o,i]))});return}r().then(n).catch(n)}}},{key:"_writeData",value:function(r,n){var o={encoding:"utf8",mode:432,flag:"w"};(0,gC.writeFile)(this.path,JSON.stringify(r),o,function(i){return n(i)})}},{key:"_getData",value:function(r){(0,gC.readFile)(this.path,"utf8",function(n,o){if(n){n.code==="ENOENT"?r(null,{}):r(n);return}try{o=o.trim().length?JSON.parse(o):{}}catch(i){r(i);return}r(null,o)})}}])})()});var Uh=x(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});Object.defineProperty(jt,"DefaultHttpStack",{enumerable:!0,get:function(){return _C.default}});Object.defineProperty(jt,"DetailedError",{enumerable:!0,get:function(){return kR.default}});Object.defineProperty(jt,"FileUrlStorage",{enumerable:!0,get:function(){return xC.FileUrlStorage}});Object.defineProperty(jt,"StreamSource",{enumerable:!0,get:function(){return RR.default}});jt.Upload=void 0;Object.defineProperty(jt,"canStoreURLs",{enumerable:!0,get:function(){return xC.canStoreURLs}});jt.defaultOptions=void 0;Object.defineProperty(jt,"enableDebugLog",{enumerable:!0,get:function(){return $R.enableDebugLog}});jt.isSupported=void 0;var kR=yo(Td()),$R=Id(),PR=yo(vb()),Nh=yo(Jb()),TR=yo(cv()),IR=yo(dv()),_C=yo(Fv()),RR=yo(Kd()),xC=vC();function yo(t){return t&&t.__esModule?t:{default:t}}function Ei(t){"@babel/helpers - typeof";return Ei=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},Ei(t)}function BR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wC(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,FC(n.key),n)}}function jR(t,e,r){return e&&wC(t.prototype,e),r&&wC(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function NR(t,e,r){return e=Bc(e),LR(t,SC()?Reflect.construct(e,r||[],Bc(t).constructor):e.apply(t,r))}function LR(t,e){if(e&&(Ei(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UR(t)}function UR(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function SC(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SC=function(){return!!t})()}function Bc(t){return Bc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bc(t)}function MR(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&&Lh(t,e)}function Lh(t,e){return Lh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Lh(t,e)}function CC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function Ci(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?CC(Object(r),!0).forEach(function(n){qR(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):CC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qR(t,e,r){return e=FC(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function FC(t){var e=HR(t,"string");return Ei(e)=="symbol"?e:e+""}function HR(t,e){if(Ei(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ei(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var EC=jt.defaultOptions=Ci(Ci({},Nh.default.defaultOptions),{},{httpStack:new _C.default,fileReader:new TR.default,urlStorage:new PR.default,fingerprint:IR.default}),Pz=jt.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 BR(this,e),n=Ci(Ci({},EC),n),NR(this,e,[r,n])}return MR(e,t),jR(e,null,[{key:"terminate",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=Ci(Ci({},EC),o),Nh.default.terminate(n,o)}}])})(Nh.default),Tz=jt.isSupported=!0});var PC=x((Yz,$C)=>{var _i=1e3,xi=_i*60,Si=xi*60,bo=Si*24,ZR=bo*7,QR=bo*365.25;$C.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return eB(t);if(r==="number"&&isFinite(t))return e.long?rB(t):tB(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function eB(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*QR;case"weeks":case"week":case"w":return r*ZR;case"days":case"day":case"d":return r*bo;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Si;case"minutes":case"minute":case"mins":case"min":case"m":return r*xi;case"seconds":case"second":case"secs":case"sec":case"s":return r*_i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function tB(t){var e=Math.abs(t);return e>=bo?Math.round(t/bo)+"d":e>=Si?Math.round(t/Si)+"h":e>=xi?Math.round(t/xi)+"m":e>=_i?Math.round(t/_i)+"s":t+"ms"}function rB(t){var e=Math.abs(t);return e>=bo?Nc(t,e,bo,"day"):e>=Si?Nc(t,e,Si,"hour"):e>=xi?Nc(t,e,xi,"minute"):e>=_i?Nc(t,e,_i,"second"):t+" ms"}function Nc(t,e,r,n){var o=e>=r*1.5;return Math.round(t/r)+" "+n+(o?"s":"")}});var Hh=x((Jz,TC)=>{function nB(t){r.debug=r,r.default=r,r.coerce=u,r.disable=a,r.enable=o,r.enabled=s,r.humanize=PC(),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 d=0;d<l.length;d++)f=(f<<5)-f+l.charCodeAt(d),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=e;function r(l){let f,d=null,h,m;function b(...D){if(!b.enabled)return;let C=b,E=Number(new Date),g=E-(f||E);C.diff=g,C.prev=f,C.curr=E,f=E,D[0]=r.coerce(D[0]),typeof D[0]!="string"&&D.unshift("%O");let _=0;D[0]=D[0].replace(/%([a-zA-Z%])/g,(P,k)=>{if(P==="%%")return"%";_++;let B=r.formatters[k];if(typeof B=="function"){let R=D[_];P=B.call(C,R),D.splice(_,1),_--}return P}),r.formatArgs.call(C,D),(C.log||r.log).apply(C,D)}return b.namespace=l,b.useColors=r.useColors(),b.color=r.selectColor(l),b.extend=n,b.destroy=r.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(h!==r.namespaces&&(h=r.namespaces,m=r.enabled(l)),m),set:D=>{d=D}}),typeof r.init=="function"&&r.init(b),b}function n(l,f){let d=r(this.namespace+(typeof f>"u"?":":f)+l);return d.log=this.log,d}function o(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function i(l,f){let d=0,h=0,m=-1,b=0;for(;d<l.length;)if(h<f.length&&(f[h]===l[d]||f[h]==="*"))f[h]==="*"?(m=h,b=d,h++):(d++,h++);else if(m!==-1)h=m+1,b++,d=b;else return!1;for(;h<f.length&&f[h]==="*";)h++;return h===f.length}function a(){let l=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),l}function s(l){for(let f of r.skips)if(i(l,f))return!1;for(let f of r.names)if(i(l,f))return!0;return!1}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}TC.exports=nB});var IC=x((Nt,Lc)=>{Nt.formatArgs=iB;Nt.save=aB;Nt.load=sB;Nt.useColors=oB;Nt.storage=uB();Nt.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`."))}})();Nt.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 oB(){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 iB(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Lc.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,o=>{o!=="%%"&&(r++,o==="%c"&&(n=r))}),t.splice(n,0,e)}Nt.log=console.debug||console.log||(()=>{});function aB(t){try{t?Nt.storage.setItem("debug",t):Nt.storage.removeItem("debug")}catch{}}function sB(){let t;try{t=Nt.storage.getItem("debug")||Nt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function uB(){try{return localStorage}catch{}}Lc.exports=Hh()(Nt);var{formatters:cB}=Lc.exports;cB.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var BC=x((Xz,RC)=>{"use strict";RC.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),o=e.indexOf("--");return n!==-1&&(o===-1||n<o)}});var LC=x((Zz,NC)=>{"use strict";var lB=require("os"),jC=require("tty"),sr=BC(),{env:it}=process,_n;sr("no-color")||sr("no-colors")||sr("color=false")||sr("color=never")?_n=0:(sr("color")||sr("colors")||sr("color=true")||sr("color=always"))&&(_n=1);"FORCE_COLOR"in it&&(it.FORCE_COLOR==="true"?_n=1:it.FORCE_COLOR==="false"?_n=0:_n=it.FORCE_COLOR.length===0?1:Math.min(parseInt(it.FORCE_COLOR,10),3));function Vh(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function zh(t,e){if(_n===0)return 0;if(sr("color=16m")||sr("color=full")||sr("color=truecolor"))return 3;if(sr("color=256"))return 2;if(t&&!e&&_n===void 0)return 0;let r=_n||0;if(it.TERM==="dumb")return r;if(process.platform==="win32"){let n=lB.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in it)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in it)||it.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in it)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(it.TEAMCITY_VERSION)?1:0;if(it.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in it){let n=parseInt((it.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(it.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(it.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(it.TERM)||"COLORTERM"in it?1:r}function fB(t){let e=zh(t,t&&t.isTTY);return Vh(e)}NC.exports={supportsColor:fB,stdout:Vh(zh(!0,jC.isatty(1))),stderr:Vh(zh(!0,jC.isatty(2)))}});var MC=x((at,Mc)=>{var pB=require("tty"),Uc=require("util");at.init=bB;at.log=gB;at.formatArgs=hB;at.save=DB;at.load=yB;at.useColors=dB;at.destroy=Uc.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");at.colors=[6,2,3,4,5,1];try{let t=LC();t&&(t.stderr||t).level>=2&&(at.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{}at.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.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 dB(){return"colors"in at.inspectOpts?!!at.inspectOpts.colors:pB.isatty(process.stderr.fd)}function hB(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),i=` ${o};1m${e} \x1B[0m`;t[0]=i+t[0].split(`
|
|
45
45
|
`).join(`
|
|
46
46
|
`+i),t.push(o+"m+"+Mc.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=mB()+e+" "+t[0]}function mB(){return at.inspectOpts.hideDate?"":new Date().toISOString()+" "}function gB(...t){return process.stderr.write(Uc.formatWithOptions(at.inspectOpts,...t)+`
|
|
47
47
|
`)}function DB(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function yB(){return process.env.DEBUG}function bB(t){t.inspectOpts={};let e=Object.keys(at.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=at.inspectOpts[e[r]]}Mc.exports=Hh()(at);var{formatters:UC}=Mc.exports;UC.o=function(t){return this.inspectOpts.colors=this.useColors,Uc.inspect(t,this.inspectOpts).split(`
|
|
@@ -93,7 +93,7 @@ To use ${xo.default.strong(e)} files, you must install TypeScript in your projec
|
|
|
93
93
|
|
|
94
94
|
${(n=o.stack)!==null&&n!==void 0?n:o}`),o}}async function n5(t,e,r){var n;try{return{extConfigType:"js",extConfigName:e,extConfigFilePath:r,extConfig:await require(r)}}catch(o){(0,ml.fatal)(`Parsing ${xo.default.strong(e)} failed.
|
|
95
95
|
|
|
96
|
-
${(n=o.stack)!==null&&n!==void 0?n:o}`)}}async function o5(t){var e;let r=(0,ae.resolve)(t,lt.CONFIG_FILE_NAME_TS);if(await(0,Ut.pathExists)(r))return r5(t,lt.CONFIG_FILE_NAME_TS,r);let n=(0,ae.resolve)(t,lt.CONFIG_FILE_NAME_JS);if(await(0,Ut.pathExists)(n))return n5(t,lt.CONFIG_FILE_NAME_JS,n);let o=(0,ae.resolve)(t,lt.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:lt.CONFIG_FILE_NAME_JSON,extConfigFilePath:o,extConfig:(e=await(0,Pm.tryFn)(Ut.readJSON,o))!==null&&e!==void 0?e:{}}}async function i5(t){let e="assets",r=(0,ae.join)(t,e),n="ios-pods-template.tar.gz",o="capacitor-cordova-ios-plugins.tar.gz",i="android-template.tar.gz",a="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ae.resolve)(r,n),cordovaPluginsTemplateArchive:o,cordovaPluginsTemplateArchiveAbs:(0,ae.resolve)(r,o)},android:{platformTemplateArchive:i,platformTemplateArchiveAbs:(0,ae.resolve)(r,i),cordovaPluginsTemplateArchive:a,cordovaPluginsTemplateArchiveAbs:(0,ae.resolve)(r,a)}},package:await(0,Ut.readJSON)((0,ae.resolve)(t,"package.json")),os:c5(process.platform)}}async function a5(t,e,r){var n,o,i,a,s,u,c,l,f,d,h,m,b,D,C,E,g;let _="android",S=(o=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&o!==void 0?o:"android",
|
|
96
|
+
${(n=o.stack)!==null&&n!==void 0?n:o}`)}}async function o5(t){var e;let r=(0,ae.resolve)(t,lt.CONFIG_FILE_NAME_TS);if(await(0,Ut.pathExists)(r))return r5(t,lt.CONFIG_FILE_NAME_TS,r);let n=(0,ae.resolve)(t,lt.CONFIG_FILE_NAME_JS);if(await(0,Ut.pathExists)(n))return n5(t,lt.CONFIG_FILE_NAME_JS,n);let o=(0,ae.resolve)(t,lt.CONFIG_FILE_NAME_JSON);return{extConfigType:"json",extConfigName:lt.CONFIG_FILE_NAME_JSON,extConfigFilePath:o,extConfig:(e=await(0,Pm.tryFn)(Ut.readJSON,o))!==null&&e!==void 0?e:{}}}async function i5(t){let e="assets",r=(0,ae.join)(t,e),n="ios-pods-template.tar.gz",o="capacitor-cordova-ios-plugins.tar.gz",i="android-template.tar.gz",a="capacitor-cordova-android-plugins.tar.gz";return{rootDir:t,assetsDir:e,assetsDirAbs:r,assets:{ios:{platformTemplateArchive:n,platformTemplateArchiveAbs:(0,ae.resolve)(r,n),cordovaPluginsTemplateArchive:o,cordovaPluginsTemplateArchiveAbs:(0,ae.resolve)(r,o)},android:{platformTemplateArchive:i,platformTemplateArchiveAbs:(0,ae.resolve)(r,i),cordovaPluginsTemplateArchive:a,cordovaPluginsTemplateArchiveAbs:(0,ae.resolve)(r,a)}},package:await(0,Ut.readJSON)((0,ae.resolve)(t,"package.json")),os:c5(process.platform)}}async function a5(t,e,r){var n,o,i,a,s,u,c,l,f,d,h,m,b,D,C,E,g;let _="android",S=(o=(n=e.android)===null||n===void 0?void 0:n.path)!==null&&o!==void 0?o:"android",P=(0,ae.resolve)(t,S),k="app",B=`${k}/src`,R=`${B}/main`,N=`${R}/assets`,A=`${N}/public`,U=`${R}/res`,M=`${k}/build/outputs/apk/`,Q=((i=e.android)===null||i===void 0?void 0:i.flavor)||"";!((a=e.android)===null||a===void 0)&&a.flavor&&(M=`${M}/${(s=e.android)===null||s===void 0?void 0:s.flavor}`);let $=(0,J4.parseApkNameFromFlavor)(Q),y=`${M}/debug`,v="capacitor-cordova-android-plugins",w=(0,Ui.lazy)(()=>p5(r.os)),F={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:(h=(d=e.android)===null||d===void 0?void 0:d.buildOptions)===null||h===void 0?void 0:h.keystoreAlias,keystoreAliasPassword:(b=(m=e.android)===null||m===void 0?void 0:m.buildOptions)===null||b===void 0?void 0:b.keystoreAliasPassword,signingType:(C=(D=e.android)===null||D===void 0?void 0:D.buildOptions)===null||C===void 0?void 0:C.signingType,releaseType:(g=(E=e.android)===null||E===void 0?void 0:E.buildOptions)===null||g===void 0?void 0:g.releaseType};return{name:_,minVersion:"23",studioPath:w,platformDir:S,platformDirAbs:P,cordovaPluginsDir:v,cordovaPluginsDirAbs:(0,ae.resolve)(P,v),appDir:k,appDirAbs:(0,ae.resolve)(P,k),srcDir:B,srcDirAbs:(0,ae.resolve)(P,B),srcMainDir:R,srcMainDirAbs:(0,ae.resolve)(P,R),assetsDir:N,assetsDirAbs:(0,ae.resolve)(P,N),webDir:A,webDirAbs:(0,ae.resolve)(P,A),resDir:U,resDirAbs:(0,ae.resolve)(P,U),apkName:$,buildOutputDir:y,buildOutputDirAbs:(0,ae.resolve)(P,y),flavor:Q,buildOptions:F}}async function s5(t,e){var r,n,o,i,a,s,u,c,l,f,d,h;let b=(n=(r=e.ios)===null||r===void 0?void 0:r.path)!==null&&n!==void 0?n:"ios",D=(0,ae.resolve)(t,b),C=(i=(o=e.ios)===null||o===void 0?void 0:o.scheme)!==null&&i!==void 0?i:"App",E="App",g=(0,ae.resolve)(D,E),_=`${E}/App`,S=(0,ae.resolve)(D,_),P=`${E}/App.xcodeproj`,k=(0,ae.resolve)(D,P),B=(0,Ui.lazy)(()=>l5(g)),R=(0,Ui.lazy)(()=>d5(t,D,g)),N=(0,Ui.lazy)(()=>f5(g,S,k)),A="capacitor-cordova-ios-plugins",U={exportMethod:(s=(a=e.ios)===null||a===void 0?void 0:a.buildOptions)===null||s===void 0?void 0:s.exportMethod,xcodeSigningStyle:(c=(u=e.ios)===null||u===void 0?void 0:u.buildOptions)===null||c===void 0?void 0:c.signingStyle,signingCertificate:(f=(l=e.ios)===null||l===void 0?void 0:l.buildOptions)===null||f===void 0?void 0:f.signingCertificate,provisioningProfile:(h=(d=e.ios)===null||d===void 0?void 0:d.buildOptions)===null||h===void 0?void 0:h.provisioningProfile};return{name:"ios",minVersion:"14.0",platformDir:b,platformDirAbs:D,scheme:C,cordovaPluginsDir:A,cordovaPluginsDirAbs:(0,ae.resolve)(D,A),nativeProjectDir:E,nativeProjectDirAbs:g,nativeTargetDir:_,nativeTargetDirAbs:S,nativeXcodeProjDir:P,nativeXcodeProjDirAbs:k,nativeXcodeWorkspaceDir:(0,Ui.lazy)(async()=>(0,ae.relative)(D,await B)),nativeXcodeWorkspaceDirAbs:B,webDir:(0,Ui.lazy)(async()=>(0,ae.relative)(D,await N)),webDirAbs:N,podPath:R,buildOptions:U}}async function u5(t,e){let r=e,n=(0,ae.resolve)(t,r);return{name:"web",platformDir:r,platformDirAbs:n}}function c5(t){switch(t){case"darwin":return"mac";case"win32":return"windows";case"linux":return"linux"}return"unknown"}async function l5(t){return(0,ae.resolve)(t,"App.xcworkspace")}async function f5(t,e,r){let n=/path\s=\spublic[\s\S]+?sourceTree\s=\s([^;]+)/,o=(0,ae.resolve)(r,"project.pbxproj");try{let a=(await(0,Ut.readFile)(o,{encoding:"utf8"})).match(n);if(a&&a[1]==="SOURCE_ROOT")return X4.logger.warn(`Using the iOS project root for the ${xo.default.strong("public")} directory is deprecated.
|
|
97
97
|
Please follow the Upgrade Guide to move ${xo.default.strong("public")} inside the iOS target directory: ${xo.default.strong("https://capacitorjs.com/docs/updating/3-0#move-public-into-the-ios-target-directory")}`),(0,ae.resolve)(t,"public")}catch{}return(0,ae.resolve)(e,"public")}async function p5(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(()=>Tm.__importStar(cl())),r="C:\\Program Files\\Android\\Android Studio\\bin\\studio64.exe";try{if(!await(0,Ut.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 o=n.indexOf("REG_SZ");o>0&&(r=n.substring(o+6).trim()+"\\bin\\studio64.exe")}}catch(n){s1("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 d5(t,e,r){if(process.env.CAPACITOR_COCOAPODS_PATH)return process.env.CAPACITOR_COCOAPODS_PATH;let n="";if(await(0,Ut.pathExists)((0,ae.resolve)(t,"Gemfile"))?n=(0,ae.resolve)(t,"Gemfile"):await(0,Ut.pathExists)((0,ae.resolve)(e,"Gemfile"))?n=(0,ae.resolve)(e,"Gemfile"):await(0,Ut.pathExists)((0,ae.resolve)(r,"Gemfile"))&&(n=(0,ae.resolve)(r,"Gemfile")),!(n!=""))try{let i=await(0,Q4.getCommandOutput)("git",["rev-parse","--show-toplevel"],{cwd:t});i!=null&&(n=(0,ae.resolve)(i,"Gemfile"))}catch{}try{let i=(await(0,Ut.readFile)(n)).toString();return i&&new RegExp(/gem\s+['"]cocoapods/).test(i)?"bundle exec pod":"pod"}catch{return"pod"}}function h5(t){return`import type { CapacitorConfig } from '@capacitor/cli';
|
|
98
98
|
|
|
99
99
|
const config: CapacitorConfig = ${(0,Z4.formatJSObject)(t)};
|
|
@@ -101,7 +101,7 @@ const config: CapacitorConfig = ${(0,Z4.formatJSObject)(t)};
|
|
|
101
101
|
export default config;
|
|
102
102
|
`}});function m5(){try{return Bm.default.statSync("/.dockerenv"),!0}catch{return!1}}function g5(){try{return Bm.default.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function jm(){return Rm===void 0&&(Rm=m5()||g5()),Rm}var Bm,Rm,l1=tt(()=>{Bm=ge(require("node:fs"),1)});function qi(){return Nm===void 0&&(Nm=D5()||jm()),Nm}var f1,Nm,D5,Lm=tt(()=>{f1=ge(require("node:fs"),1);l1();D5=()=>{try{return f1.default.statSync("/run/.containerenv"),!0}catch{return!1}}});var Um,d1,h1,p1,$n,Mm=tt(()=>{Um=ge(require("node:process"),1),d1=ge(require("node:os"),1),h1=ge(require("node:fs"),1);Lm();p1=()=>{if(Um.default.platform!=="linux")return!1;if(d1.default.release().toLowerCase().includes("microsoft"))return!qi();try{return h1.default.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!qi():!1}catch{return!1}},$n=Um.default.env.__IS_WSL_TEST__?p1:p1()});var qm,Ds,y5,b5,Hm,m1=tt(()=>{qm=ge(require("node:process"),1),Ds=ge(require("node:fs/promises"),1);Mm();Mm();y5=(()=>{let t="/mnt/",e;return async function(){if(e)return e;let r="/etc/wsl.conf",n=!1;try{await Ds.default.access(r,Ds.constants.F_OK),n=!0}catch{}if(!n)return t;let o=await Ds.default.readFile(r,{encoding:"utf8"}),i=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(o);return i?(e=i.groups.mountPoint.trim(),e=e.endsWith("/")?e:`${e}/`,e):t}})(),b5=async()=>`${await y5()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,Hm=async()=>$n?b5():`${qm.default.env.SYSTEMROOT||qm.default.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`});function Pn(t,e,r){let n=o=>Object.defineProperty(t,e,{value:o,enumerable:!0,writable:!0});return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){let o=r();return n(o),o},set(o){n(o)}}),t}var g1=tt(()=>{});async function Vm(){if(y1.default.platform!=="darwin")throw new Error("macOS only");let{stdout:t}=await v5("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 D1,y1,b1,v5,v1=tt(()=>{D1=require("node:util"),y1=ge(require("node:process"),1),b1=require("node:child_process"),v5=(0,D1.promisify)(b1.execFile)});async function E1(t,{humanReadableOutput:e=!0,signal:r}={}){if(w1.default.platform!=="darwin")throw new Error("macOS only");let n=e?[]:["-ss"],o={};r&&(o.signal=r);let{stdout:i}=await w5("osascript",["-e",t,n],o);return i.trim()}var w1,C1,zm,w5,_1=tt(()=>{w1=ge(require("node:process"),1),C1=require("node:util"),zm=require("node:child_process"),w5=(0,C1.promisify)(zm.execFile)});async function Gm(t){return E1(`tell application "Finder" to set app_path to application file id "${t}" as string
|
|
103
103
|
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}var x1=tt(()=>{_1()});async function Wm(t=C5){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 gl(`Cannot find Windows browser in stdout: ${JSON.stringify(e)}`);let{id:n}=r.groups,o=E5[n];if(!o)throw new gl(`Unknown browser ID: ${n}`);return o}var S1,F1,C5,E5,gl,A1=tt(()=>{S1=require("node:util"),F1=require("node:child_process"),C5=(0,S1.promisify)(F1.execFile),E5={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"}},gl=class extends Error{}});async function Km(){if(Dl.default.platform==="darwin"){let t=await Vm();return{name:await Gm(t),id:t}}if(Dl.default.platform==="linux"){let{stdout:t}=await _5("xdg-mime",["query","default","x-scheme-handler/http"]),e=t.trim();return{name:x5(e.replace(/.desktop$/,"").replace("-"," ")),id:e}}if(Dl.default.platform==="win32")return Wm();throw new Error("Only macOS, Linux, and Windows are supported")}var O1,Dl,k1,_5,x5,$1=tt(()=>{O1=require("node:util"),Dl=ge(require("node:process"),1),k1=require("node:child_process");v1();x1();A1();_5=(0,O1.promisify)(k1.execFile),x5=t=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase())});var eg={};qr(eg,{apps:()=>Tn,default:()=>k5,openApp:()=>O5});async function F5(){let t=await Hm(),e=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,r=Xm.Buffer.from(e,"utf16le").toString("base64"),{stdout:n}=await S5(t,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",r],{encoding:"utf8"}),o=n.trim(),i={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return i[o]?{id:i[o]}:{}}function R1(t){if(typeof t=="string"||Array.isArray(t))return t;let{[T1]:e}=t;if(!e)throw new Error(`${T1} is not supported`);return e}function bl({[Hi]:t},{wsl:e}){if(e&&$n)return R1(e);if(!t)throw new Error(`${Hi} is not supported`);return R1(t)}var Jm,Xm,Zm,B1,j1,Qm,yl,$5,S5,Ym,P1,Hi,T1,I1,ys,A5,O5,Tn,k5,tg=tt(()=>{Jm=ge(require("node:process"),1),Xm=require("node:buffer"),Zm=ge(require("node:path"),1),B1=require("node:url"),j1=require("node:util"),Qm=ge(require("node:child_process"),1),yl=ge(require("node:fs/promises"),1);m1();g1();$1();Lm();$5={},S5=(0,j1.promisify)(Qm.default.execFile),Ym=Zm.default.dirname((0,B1.fileURLToPath)($5.url)),P1=Zm.default.join(Ym,"xdg-open"),{platform:Hi,arch:T1}=Jm.default;I1=async(t,e)=>{let r;for(let n of t)try{return await e(n)}catch(o){r=o}throw r},ys=async t=>{if(t={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...t},Array.isArray(t.app))return I1(t.app,s=>ys({...t,app:s}));let{name:e,arguments:r=[]}=t.app??{};if(r=[...r],Array.isArray(e))return I1(e,s=>ys({...t,app:{name:s,arguments:r}}));if(e==="browser"||e==="browserPrivate"){let s={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},u={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},c=$n?await F5():await Km();if(c.id in s){let l=s[c.id];return e==="browserPrivate"&&r.push(u[l]),ys({...t,app:{name:Tn[l],arguments:r}})}throw new Error(`${c.name} is not supported as a default browser`)}let n,o=[],i={};if(Hi==="darwin")n="open",t.wait&&o.push("--wait-apps"),t.background&&o.push("--background"),t.newInstance&&o.push("--new"),e&&o.push("-a",e);else if(Hi==="win32"||$n&&!qi()&&!e){n=await Hm(),o.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),$n||(i.windowsVerbatimArguments=!0);let s=["Start"];t.wait&&s.push("-Wait"),e?(s.push(`"\`"${e}\`""`),t.target&&r.push(t.target)):t.target&&s.push(`"${t.target}"`),r.length>0&&(r=r.map(u=>`"\`"${u}\`""`),s.push("-ArgumentList",r.join(","))),t.target=Xm.Buffer.from(s.join(" "),"utf16le").toString("base64")}else{if(e)n=e;else{let s=!Ym||Ym==="/",u=!1;try{await yl.default.access(P1,yl.constants.X_OK),u=!0}catch{}n=Jm.default.versions.electron??(Hi==="android"||s||!u)?"xdg-open":P1}r.length>0&&o.push(...r),t.wait||(i.stdio="ignore",i.detached=!0)}Hi==="darwin"&&r.length>0&&o.push("--args",...r),t.target&&o.push(t.target);let a=Qm.default.spawn(n,o,i);return t.wait?new Promise((s,u)=>{a.once("error",u),a.once("close",c=>{if(!t.allowNonzeroExitCode&&c>0){u(new Error(`Exited with code ${c}`));return}s(a)})}):(a.unref(),a)},A5=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a `target`");return ys({...e,target:t})},O5=(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 ys({...e,app:{name:t,arguments:r}})};Tn={};Pn(Tn,"chrome",()=>bl({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"]}}));Pn(Tn,"brave",()=>bl({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));Pn(Tn,"firefox",()=>bl({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Pn(Tn,"edge",()=>bl({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Pn(Tn,"browser",()=>"browser");Pn(Tn,"browserPrivate",()=>"browserPrivate");k5=A5});var ql=x(lr=>{"use strict";lr.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;lr.find=(t,e)=>t.nodes.find(r=>r.type===e);lr.exceedsLimit=(t,e,r=1,n)=>n===!1||!lr.isInteger(t)||!lr.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;lr.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};lr.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;lr.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;lr.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;lr.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);lr.flatten=(...t)=>{let e=[],r=n=>{for(let o=0;o<n.length;o++){let i=n[o];if(Array.isArray(i)){r(i);continue}i!==void 0&&e.push(i)}return e};return r(t),e}});var Hl=x((AY,J2)=>{"use strict";var Y2=ql();J2.exports=(t,e={})=>{let r=(n,o={})=>{let i=e.escapeInvalid&&Y2.isInvalidBrace(o),a=n.invalid===!0&&e.escapeInvalid===!0,s="";if(n.value)return(i||a)&&Y2.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let u of n.nodes)s+=r(u);return s};return r(t)}});var Z2=x((OY,X2)=>{"use strict";X2.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var sS=x((kY,aS)=>{"use strict";var Q2=Z2(),Po=(t,e,r)=>{if(Q2(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Q2(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let o=String(n.relaxZeros),i=String(n.shorthand),a=String(n.capture),s=String(n.wrap),u=t+":"+e+"="+o+i+a+s;if(Po.cache.hasOwnProperty(u))return Po.cache[u].result;let c=Math.min(t,e),l=Math.max(t,e);if(Math.abs(c-l)===1){let b=t+"|"+e;return n.capture?`(${b})`:n.wrap===!1?b:`(?:${b})`}let f=iS(t)||iS(e),d={min:t,max:e,a:c,b:l},h=[],m=[];if(f&&(d.isPadded=f,d.maxLen=String(d.max).length),c<0){let b=l<0?Math.abs(l):1;m=eS(b,Math.abs(c),d,n),c=d.a=0}return l>=0&&(h=eS(c,l,d,n)),d.negatives=m,d.positives=h,d.result=yU(m,h,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&h.length+m.length>1&&(d.result=`(?:${d.result})`),Po.cache[u]=d,d.result};function yU(t,e,r){let n=Eg(t,e,"-",!1,r)||[],o=Eg(e,t,"",!1,r)||[],i=Eg(t,e,"-?",!0,r)||[];return n.concat(i).concat(o).join("|")}function bU(t,e){let r=1,n=1,o=rS(t,r),i=new Set([e]);for(;t<=o&&o<=e;)i.add(o),r+=1,o=rS(t,r);for(o=nS(e+1,n)-1;t<o&&o<=e;)i.add(o),n+=1,o=nS(e+1,n)-1;return i=[...i],i.sort(CU),i}function vU(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=wU(t,e),o=n.length,i="",a=0;for(let s=0;s<o;s++){let[u,c]=n[s];u===c?i+=u:u!=="0"||c!=="9"?i+=EU(u,c,r):a++}return a&&(i+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:i,count:[a],digits:o}}function eS(t,e,r,n){let o=bU(t,e),i=[],a=t,s;for(let u=0;u<o.length;u++){let c=o[u],l=vU(String(a),String(c),n),f="";if(!r.isPadded&&s&&s.pattern===l.pattern){s.count.length>1&&s.count.pop(),s.count.push(l.count[0]),s.string=s.pattern+oS(s.count),a=c+1;continue}r.isPadded&&(f=_U(c,r,n)),l.string=f+l.pattern+oS(l.count),i.push(l),a=c+1,s=l}return i}function Eg(t,e,r,n,o){let i=[];for(let a of t){let{string:s}=a;!n&&!tS(e,"string",s)&&i.push(r+s),n&&tS(e,"string",s)&&i.push(r+s)}return i}function wU(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function CU(t,e){return t>e?1:e>t?-1:0}function tS(t,e,r){return t.some(n=>n[e]===r)}function rS(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function nS(t,e){return t-t%Math.pow(10,e)}function oS(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function EU(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function iS(t){return/^-?(0+)\d/.test(t)}function _U(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),o=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return o?"0?":"0";case 2:return o?"0{0,2}":"00";default:return o?`0{0,${n}}`:`0{${n}}`}}Po.cache={};Po.clearCache=()=>Po.cache={};aS.exports=Po});var Sg=x(($Y,hS)=>{"use strict";var xU=require("util"),cS=sS(),uS=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),SU=t=>e=>t===!0?Number(e):String(e),_g=t=>typeof t=="number"||typeof t=="string"&&t!=="",As=t=>Number.isInteger(+t),xg=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},FU=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,AU=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},zl=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},OU=(t,e,r)=>{t.negatives.sort((s,u)=>s<u?-1:s>u?1:0),t.positives.sort((s,u)=>s<u?-1:s>u?1:0);let n=e.capture?"":"?:",o="",i="",a;return t.positives.length&&(o=t.positives.map(s=>zl(String(s),r)).join("|")),t.negatives.length&&(i=`-(${n}${t.negatives.map(s=>zl(String(s),r)).join("|")})`),o&&i?a=`${o}|${i}`:a=o||i,e.wrap?`(${n}${a})`:a},lS=(t,e,r,n)=>{if(r)return cS(t,e,{wrap:!1,...n});let o=String.fromCharCode(t);if(t===e)return o;let i=String.fromCharCode(e);return`[${o}-${i}]`},fS=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,o=r.capture?"":"?:";return n?`(${o}${t.join("|")})`:t.join("|")}return cS(t,e,r)},pS=(...t)=>new RangeError("Invalid range arguments: "+xU.inspect(...t)),dS=(t,e,r)=>{if(r.strictRanges===!0)throw pS([t,e]);return[]},kU=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},$U=(t,e,r=1,n={})=>{let o=Number(t),i=Number(e);if(!Number.isInteger(o)||!Number.isInteger(i)){if(n.strictRanges===!0)throw pS([t,e]);return[]}o===0&&(o=0),i===0&&(i=0);let a=o>i,s=String(t),u=String(e),c=String(r);r=Math.max(Math.abs(r),1);let l=xg(s)||xg(u)||xg(c),f=l?Math.max(s.length,u.length,c.length):0,d=l===!1&&FU(t,e,n)===!1,h=n.transform||SU(d);if(n.toRegex&&r===1)return lS(zl(t,f),zl(e,f),!0,n);let m={negatives:[],positives:[]},b=E=>m[E<0?"negatives":"positives"].push(Math.abs(E)),D=[],C=0;for(;a?o>=i:o<=i;)n.toRegex===!0&&r>1?b(o):D.push(AU(h(o,C),f,d)),o=a?o-r:o+r,C++;return n.toRegex===!0?r>1?OU(m,n,f):fS(D,null,{wrap:!1,...n}):D},PU=(t,e,r=1,n={})=>{if(!As(t)&&t.length>1||!As(e)&&e.length>1)return dS(t,e,n);let o=n.transform||(d=>String.fromCharCode(d)),i=`${t}`.charCodeAt(0),a=`${e}`.charCodeAt(0),s=i>a,u=Math.min(i,a),c=Math.max(i,a);if(n.toRegex&&r===1)return lS(u,c,!1,n);let l=[],f=0;for(;s?i>=a:i<=a;)l.push(o(i,f)),i=s?i-r:i+r,f++;return n.toRegex===!0?fS(l,null,{wrap:!1,options:n}):l},Vl=(t,e,r,n={})=>{if(e==null&&_g(t))return[t];if(!_g(t)||!_g(e))return dS(t,e,n);if(typeof r=="function")return Vl(t,e,1,{transform:r});if(uS(r))return Vl(t,e,0,r);let o={...n};return o.capture===!0&&(o.wrap=!0),r=r||o.step||1,As(r)?As(t)&&As(e)?$U(t,e,r,o):PU(t,e,Math.max(Math.abs(r),1),o):r!=null&&!uS(r)?kU(r,o):Vl(t,e,1,r)};hS.exports=Vl});var DS=x((PY,gS)=>{"use strict";var TU=Sg(),mS=ql(),IU=(t,e={})=>{let r=(n,o={})=>{let i=mS.isInvalidBrace(o),a=n.invalid===!0&&e.escapeInvalid===!0,s=i===!0||a===!0,u=e.escapeInvalid===!0?"\\":"",c="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return s?u+n.value:"(";if(n.type==="close")return s?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":s?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=mS.reduce(n.nodes),f=TU(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return l.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(t)};gS.exports=IU});var vS=x((TY,bS)=>{"use strict";var RU=Sg(),yS=Hl(),na=ql(),To=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?na.flatten(e).map(o=>`{${o}}`):e;for(let o of t)if(Array.isArray(o))for(let i of o)n.push(To(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?To(o,i,r):o+i);return na.flatten(n)},BU=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(o,i={})=>{o.queue=[];let a=i,s=i.queue;for(;a.type!=="brace"&&a.type!=="root"&&a.parent;)a=a.parent,s=a.queue;if(o.invalid||o.dollar){s.push(To(s.pop(),yS(o,e)));return}if(o.type==="brace"&&o.invalid!==!0&&o.nodes.length===2){s.push(To(s.pop(),["{}"]));return}if(o.nodes&&o.ranges>0){let f=na.reduce(o.nodes);if(na.exceedsLimit(...f,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=RU(...f,e);d.length===0&&(d=yS(o,e)),s.push(To(s.pop(),d)),o.nodes=[];return}let u=na.encloseBrace(o),c=o.queue,l=o;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let f=0;f<o.nodes.length;f++){let d=o.nodes[f];if(d.type==="comma"&&o.type==="brace"){f===1&&c.push(""),c.push("");continue}if(d.type==="close"){s.push(To(s.pop(),c,u));continue}if(d.value&&d.type!=="open"){c.push(To(c.pop(),d.value));continue}d.nodes&&n(d,o)}return c};return na.flatten(n(t))};bS.exports=BU});var CS=x((IY,wS)=>{"use strict";wS.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
104
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var FS=x((RY,SS)=>{"use strict";var jU=Hl(),{MAX_LENGTH:ES,CHAR_BACKSLASH:Fg,CHAR_BACKTICK:NU,CHAR_COMMA:LU,CHAR_DOT:UU,CHAR_LEFT_PARENTHESES:MU,CHAR_RIGHT_PARENTHESES:qU,CHAR_LEFT_CURLY_BRACE:HU,CHAR_RIGHT_CURLY_BRACE:VU,CHAR_LEFT_SQUARE_BRACKET:_S,CHAR_RIGHT_SQUARE_BRACKET:xS,CHAR_DOUBLE_QUOTE:zU,CHAR_SINGLE_QUOTE:GU,CHAR_NO_BREAK_SPACE:WU,CHAR_ZERO_WIDTH_NOBREAK_SPACE:KU}=CS(),YU=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(ES,r.maxLength):ES;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let o={type:"root",input:t,nodes:[]},i=[o],a=o,s=o,u=0,c=t.length,l=0,f=0,d,h=()=>t[l++],m=b=>{if(b.type==="text"&&s.type==="dot"&&(s.type="text"),s&&s.type==="text"&&b.type==="text"){s.value+=b.value;return}return a.nodes.push(b),b.parent=a,b.prev=s,s=b,b};for(m({type:"bos"});l<c;)if(a=i[i.length-1],d=h(),!(d===KU||d===WU)){if(d===Fg){m({type:"text",value:(e.keepEscaping?d:"")+h()});continue}if(d===xS){m({type:"text",value:"\\"+d});continue}if(d===_S){u++;let b;for(;l<c&&(b=h());){if(d+=b,b===_S){u++;continue}if(b===Fg){d+=h();continue}if(b===xS&&(u--,u===0))break}m({type:"text",value:d});continue}if(d===MU){a=m({type:"paren",nodes:[]}),i.push(a),m({type:"text",value:d});continue}if(d===qU){if(a.type!=="paren"){m({type:"text",value:d});continue}a=i.pop(),m({type:"text",value:d}),a=i[i.length-1];continue}if(d===zU||d===GU||d===NU){let b=d,D;for(e.keepQuotes!==!0&&(d="");l<c&&(D=h());){if(D===Fg){d+=D+h();continue}if(D===b){e.keepQuotes===!0&&(d+=D);break}d+=D}m({type:"text",value:d});continue}if(d===HU){f++;let D={type:"brace",open:!0,close:!1,dollar:s.value&&s.value.slice(-1)==="$"||a.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};a=m(D),i.push(a),m({type:"open",value:d});continue}if(d===VU){if(a.type!=="brace"){m({type:"text",value:d});continue}let b="close";a=i.pop(),a.close=!0,m({type:b,value:d}),f--,a=i[i.length-1];continue}if(d===LU&&f>0){if(a.ranges>0){a.ranges=0;let b=a.nodes.shift();a.nodes=[b,{type:"text",value:jU(a)}]}m({type:"comma",value:d}),a.commas++;continue}if(d===UU&&f>0&&a.commas===0){let b=a.nodes;if(f===0||b.length===0){m({type:"text",value:d});continue}if(s.type==="dot"){if(a.range=[],s.value+=d,s.type="range",a.nodes.length!==3&&a.nodes.length!==5){a.invalid=!0,a.ranges=0,s.type="text";continue}a.ranges++,a.args=[];continue}if(s.type==="range"){b.pop();let D=b[b.length-1];D.value+=s.value+d,s=D,a.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(a=i.pop(),a.type!=="root"){a.nodes.forEach(C=>{C.nodes||(C.type==="open"&&(C.isOpen=!0),C.type==="close"&&(C.isClose=!0),C.nodes||(C.type="text"),C.invalid=!0)});let b=i[i.length-1],D=b.nodes.indexOf(a);b.nodes.splice(D,1,...a.nodes)}while(i.length>0);return m({type:"eos"}),o};SS.exports=YU});var kS=x((BY,OS)=>{"use strict";var AS=Hl(),JU=DS(),XU=vS(),ZU=FS(),Kt=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let o=Kt.create(n,e);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Kt.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Kt.parse=(t,e={})=>ZU(t,e);Kt.stringify=(t,e={})=>AS(typeof t=="string"?Kt.parse(t,e):t,e);Kt.compile=(t,e={})=>(typeof t=="string"&&(t=Kt.parse(t,e)),JU(t,e));Kt.expand=(t,e={})=>{typeof t=="string"&&(t=Kt.parse(t,e));let r=XU(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Kt.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Kt.compile(t,e):Kt.expand(t,e);OS.exports=Kt});var Os=x((jY,RS)=>{"use strict";var QU=require("path"),Nr="\\\\/",$S=`[^${Nr}]`,un="\\.",eM="\\+",tM="\\?",Gl="\\/",rM="(?=.)",PS="[^/]",Ag=`(?:${Gl}|$)`,TS=`(?:^|${Gl})`,Og=`${un}{1,2}${Ag}`,nM=`(?!${un})`,oM=`(?!${TS}${Og})`,iM=`(?!${un}{0,1}${Ag})`,aM=`(?!${Og})`,sM=`[^.${Gl}]`,uM=`${PS}*?`,IS={DOT_LITERAL:un,PLUS_LITERAL:eM,QMARK_LITERAL:tM,SLASH_LITERAL:Gl,ONE_CHAR:rM,QMARK:PS,END_ANCHOR:Ag,DOTS_SLASH:Og,NO_DOT:nM,NO_DOTS:oM,NO_DOT_SLASH:iM,NO_DOTS_SLASH:aM,QMARK_NO_DOT:sM,STAR:uM,START_ANCHOR:TS},cM={...IS,SLASH_LITERAL:`[${Nr}]`,QMARK:$S,STAR:`${$S}*?`,DOTS_SLASH:`${un}{1,2}(?:[${Nr}]|$)`,NO_DOT:`(?!${un})`,NO_DOTS:`(?!(?:^|[${Nr}])${un}{1,2}(?:[${Nr}]|$))`,NO_DOT_SLASH:`(?!${un}{0,1}(?:[${Nr}]|$))`,NO_DOTS_SLASH:`(?!${un}{1,2}(?:[${Nr}]|$))`,QMARK_NO_DOT:`[^.${Nr}]`,START_ANCHOR:`(?:^|[${Nr}])`,END_ANCHOR:`(?:[${Nr}]|$)`},lM={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};RS.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:lM,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:QU.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?cM:IS}}});var ks=x(Mt=>{"use strict";var fM=require("path"),pM=process.platform==="win32",{REGEX_BACKSLASH:dM,REGEX_REMOVE_BACKSLASH:hM,REGEX_SPECIAL_CHARS:mM,REGEX_SPECIAL_CHARS_GLOBAL:gM}=Os();Mt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Mt.hasRegexChars=t=>mM.test(t);Mt.isRegexChar=t=>t.length===1&&Mt.hasRegexChars(t);Mt.escapeRegex=t=>t.replace(gM,"\\$1");Mt.toPosixSlashes=t=>t.replace(dM,"/");Mt.removeBackslashes=t=>t.replace(hM,e=>e==="\\"?"":e);Mt.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Mt.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:pM===!0||fM.sep==="\\";Mt.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Mt.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Mt.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Mt.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${t})${o}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var HS=x((LY,qS)=>{"use strict";var BS=ks(),{CHAR_ASTERISK:kg,CHAR_AT:DM,CHAR_BACKWARD_SLASH:$s,CHAR_COMMA:yM,CHAR_DOT:$g,CHAR_EXCLAMATION_MARK:Pg,CHAR_FORWARD_SLASH:MS,CHAR_LEFT_CURLY_BRACE:Tg,CHAR_LEFT_PARENTHESES:Ig,CHAR_LEFT_SQUARE_BRACKET:bM,CHAR_PLUS:vM,CHAR_QUESTION_MARK:jS,CHAR_RIGHT_CURLY_BRACE:wM,CHAR_RIGHT_PARENTHESES:NS,CHAR_RIGHT_SQUARE_BRACKET:CM}=Os(),LS=t=>t===MS||t===$s,US=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},EM=(t,e)=>{let r=e||{},n=t.length-1,o=r.parts===!0||r.scanToEnd===!0,i=[],a=[],s=[],u=t,c=-1,l=0,f=0,d=!1,h=!1,m=!1,b=!1,D=!1,C=!1,E=!1,g=!1,_=!1,S=!1,T=0,k,B,R={value:"",depth:0,isGlob:!1},N=()=>c>=n,A=()=>u.charCodeAt(c+1),U=()=>(k=B,u.charCodeAt(++c));for(;c<n;){B=U();let v;if(B===$s){E=R.backslashes=!0,B=U(),B===Tg&&(C=!0);continue}if(C===!0||B===Tg){for(T++;N()!==!0&&(B=U());){if(B===$s){E=R.backslashes=!0,U();continue}if(B===Tg){T++;continue}if(C!==!0&&B===$g&&(B=U())===$g){if(d=R.isBrace=!0,m=R.isGlob=!0,S=!0,o===!0)continue;break}if(C!==!0&&B===yM){if(d=R.isBrace=!0,m=R.isGlob=!0,S=!0,o===!0)continue;break}if(B===wM&&(T--,T===0)){C=!1,d=R.isBrace=!0,S=!0;break}}if(o===!0)continue;break}if(B===MS){if(i.push(c),a.push(R),R={value:"",depth:0,isGlob:!1},S===!0)continue;if(k===$g&&c===l+1){l+=2;continue}f=c+1;continue}if(r.noext!==!0&&(B===vM||B===DM||B===kg||B===jS||B===Pg)===!0&&A()===Ig){if(m=R.isGlob=!0,b=R.isExtglob=!0,S=!0,B===Pg&&c===l&&(_=!0),o===!0){for(;N()!==!0&&(B=U());){if(B===$s){E=R.backslashes=!0,B=U();continue}if(B===NS){m=R.isGlob=!0,S=!0;break}}continue}break}if(B===kg){if(k===kg&&(D=R.isGlobstar=!0),m=R.isGlob=!0,S=!0,o===!0)continue;break}if(B===jS){if(m=R.isGlob=!0,S=!0,o===!0)continue;break}if(B===bM){for(;N()!==!0&&(v=U());){if(v===$s){E=R.backslashes=!0,U();continue}if(v===CM){h=R.isBracket=!0,m=R.isGlob=!0,S=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&B===Pg&&c===l){g=R.negated=!0,l++;continue}if(r.noparen!==!0&&B===Ig){if(m=R.isGlob=!0,o===!0){for(;N()!==!0&&(B=U());){if(B===Ig){E=R.backslashes=!0,B=U();continue}if(B===NS){S=!0;break}}continue}break}if(m===!0){if(S=!0,o===!0)continue;break}}r.noext===!0&&(b=!1,m=!1);let M=u,Q="",$="";l>0&&(Q=u.slice(0,l),u=u.slice(l),f-=l),M&&m===!0&&f>0?(M=u.slice(0,f),$=u.slice(f)):m===!0?(M="",$=u):M=u,M&&M!==""&&M!=="/"&&M!==u&&LS(M.charCodeAt(M.length-1))&&(M=M.slice(0,-1)),r.unescape===!0&&($&&($=BS.removeBackslashes($)),M&&E===!0&&(M=BS.removeBackslashes(M)));let y={prefix:Q,input:t,start:l,base:M,glob:$,isBrace:d,isBracket:h,isGlob:m,isExtglob:b,isGlobstar:D,negated:g,negatedExtglob:_};if(r.tokens===!0&&(y.maxDepth=0,LS(B)||a.push(R),y.tokens=a),r.parts===!0||r.tokens===!0){let v;for(let w=0;w<i.length;w++){let F=v?v+1:l,I=i[w],O=t.slice(F,I);r.tokens&&(w===0&&l!==0?(a[w].isPrefix=!0,a[w].value=Q):a[w].value=O,US(a[w]),y.maxDepth+=a[w].depth),(w!==0||O!=="")&&s.push(O),v=I}if(v&&v+1<t.length){let w=t.slice(v+1);s.push(w),r.tokens&&(a[a.length-1].value=w,US(a[a.length-1]),y.maxDepth+=a[a.length-1].depth)}y.slashes=i,y.parts=s}return y};qS.exports=EM});var GS=x((UY,zS)=>{"use strict";var Wl=Os(),Yt=ks(),{MAX_LENGTH:Kl,POSIX_REGEX_SOURCE:_M,REGEX_NON_SPECIAL_CHARS:xM,REGEX_SPECIAL_CHARS_BACKREF:SM,REPLACEMENTS:VS}=Wl,FM=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(o=>Yt.escapeRegex(o)).join("..")}return r},oa=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Rg=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=VS[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Kl,r.maxLength):Kl,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},a=[i],s=r.capture?"":"?:",u=Yt.isWindows(e),c=Wl.globChars(u),l=Wl.extglobChars(c),{DOT_LITERAL:f,PLUS_LITERAL:d,SLASH_LITERAL:h,ONE_CHAR:m,DOTS_SLASH:b,NO_DOT:D,NO_DOT_SLASH:C,NO_DOTS_SLASH:E,QMARK:g,QMARK_NO_DOT:_,STAR:S,START_ANCHOR:T}=c,k=z=>`(${s}(?:(?!${T}${z.dot?b:f}).)*?)`,B=r.dot?"":D,R=r.dot?g:_,N=r.bash===!0?k(r):S;r.capture&&(N=`(${N})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let A={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:a};t=Yt.removePrefix(t,A),o=t.length;let U=[],M=[],Q=[],$=i,y,v=()=>A.index===o-1,w=A.peek=(z=1)=>t[A.index+z],F=A.advance=()=>t[++A.index]||"",I=()=>t.slice(A.index+1),O=(z="",Ee=0)=>{A.consumed+=z,A.index+=Ee},q=z=>{A.output+=z.output!=null?z.output:z.value,O(z.value)},P=()=>{let z=1;for(;w()==="!"&&(w(2)!=="("||w(3)==="?");)F(),A.start++,z++;return z%2===0?!1:(A.negated=!0,A.start++,!0)},j=z=>{A[z]++,Q.push(z)},ee=z=>{A[z]--,Q.pop()},V=z=>{if($.type==="globstar"){let Ee=A.braces>0&&(z.type==="comma"||z.type==="brace"),H=z.extglob===!0||U.length&&(z.type==="pipe"||z.type==="paren");z.type!=="slash"&&z.type!=="paren"&&!Ee&&!H&&(A.output=A.output.slice(0,-$.output.length),$.type="star",$.value="*",$.output=N,A.output+=$.output)}if(U.length&&z.type!=="paren"&&(U[U.length-1].inner+=z.value),(z.value||z.output)&&q(z),$&&$.type==="text"&&z.type==="text"){$.value+=z.value,$.output=($.output||"")+z.value;return}z.prev=$,a.push(z),$=z},se=(z,Ee)=>{let H={...l[Ee],conditions:1,inner:""};H.prev=$,H.parens=A.parens,H.output=A.output;let ue=(r.capture?"(":"")+H.open;j("parens"),V({type:z,value:Ee,output:A.output?"":m}),V({type:"paren",extglob:!0,value:F(),output:ue}),U.push(H)},dr=z=>{let Ee=z.close+(r.capture?")":""),H;if(z.type==="negate"){let ue=N;if(z.inner&&z.inner.length>1&&z.inner.includes("/")&&(ue=k(r)),(ue!==N||v()||/^\)+$/.test(I()))&&(Ee=z.close=`)$))${ue}`),z.inner.includes("*")&&(H=I())&&/^\.[^\\/.]+$/.test(H)){let Me=Rg(H,{...e,fastpaths:!1}).output;Ee=z.close=`)${Me})${ue})`}z.prev.type==="bos"&&(A.negatedExtglob=!0)}V({type:"paren",extglob:!0,value:y,output:Ee}),ee("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let z=!1,Ee=t.replace(SM,(H,ue,Me,wt,et,nf)=>wt==="\\"?(z=!0,H):wt==="?"?ue?ue+wt+(et?g.repeat(et.length):""):nf===0?R+(et?g.repeat(et.length):""):g.repeat(Me.length):wt==="."?f.repeat(Me.length):wt==="*"?ue?ue+wt+(et?N:""):N:ue?H:`\\${H}`);return z===!0&&(r.unescape===!0?Ee=Ee.replace(/\\/g,""):Ee=Ee.replace(/\\+/g,H=>H.length%2===0?"\\\\":H?"\\":"")),Ee===t&&r.contains===!0?(A.output=t,A):(A.output=Yt.wrapOutput(Ee,A,e),A)}for(;!v();){if(y=F(),y==="\0")continue;if(y==="\\"){let H=w();if(H==="/"&&r.bash!==!0||H==="."||H===";")continue;if(!H){y+="\\",V({type:"text",value:y});continue}let ue=/^\\+/.exec(I()),Me=0;if(ue&&ue[0].length>2&&(Me=ue[0].length,A.index+=Me,Me%2!==0&&(y+="\\")),r.unescape===!0?y=F():y+=F(),A.brackets===0){V({type:"text",value:y});continue}}if(A.brackets>0&&(y!=="]"||$.value==="["||$.value==="[^")){if(r.posix!==!1&&y===":"){let H=$.value.slice(1);if(H.includes("[")&&($.posix=!0,H.includes(":"))){let ue=$.value.lastIndexOf("["),Me=$.value.slice(0,ue),wt=$.value.slice(ue+2),et=_M[wt];if(et){$.value=Me+et,A.backtrack=!0,F(),!i.output&&a.indexOf($)===1&&(i.output=m);continue}}}(y==="["&&w()!==":"||y==="-"&&w()==="]")&&(y=`\\${y}`),y==="]"&&($.value==="["||$.value==="[^")&&(y=`\\${y}`),r.posix===!0&&y==="!"&&$.value==="["&&(y="^"),$.value+=y,q({value:y});continue}if(A.quotes===1&&y!=='"'){y=Yt.escapeRegex(y),$.value+=y,q({value:y});continue}if(y==='"'){A.quotes=A.quotes===1?0:1,r.keepQuotes===!0&&V({type:"text",value:y});continue}if(y==="("){j("parens"),V({type:"paren",value:y});continue}if(y===")"){if(A.parens===0&&r.strictBrackets===!0)throw new SyntaxError(oa("opening","("));let H=U[U.length-1];if(H&&A.parens===H.parens+1){dr(U.pop());continue}V({type:"paren",value:y,output:A.parens?")":"\\)"}),ee("parens");continue}if(y==="["){if(r.nobracket===!0||!I().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(oa("closing","]"));y=`\\${y}`}else j("brackets");V({type:"bracket",value:y});continue}if(y==="]"){if(r.nobracket===!0||$&&$.type==="bracket"&&$.value.length===1){V({type:"text",value:y,output:`\\${y}`});continue}if(A.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(oa("opening","["));V({type:"text",value:y,output:`\\${y}`});continue}ee("brackets");let H=$.value.slice(1);if($.posix!==!0&&H[0]==="^"&&!H.includes("/")&&(y=`/${y}`),$.value+=y,q({value:y}),r.literalBrackets===!1||Yt.hasRegexChars(H))continue;let ue=Yt.escapeRegex($.value);if(A.output=A.output.slice(0,-$.value.length),r.literalBrackets===!0){A.output+=ue,$.value=ue;continue}$.value=`(${s}${ue}|${$.value})`,A.output+=$.value;continue}if(y==="{"&&r.nobrace!==!0){j("braces");let H={type:"brace",value:y,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};M.push(H),V(H);continue}if(y==="}"){let H=M[M.length-1];if(r.nobrace===!0||!H){V({type:"text",value:y,output:y});continue}let ue=")";if(H.dots===!0){let Me=a.slice(),wt=[];for(let et=Me.length-1;et>=0&&(a.pop(),Me[et].type!=="brace");et--)Me[et].type!=="dots"&&wt.unshift(Me[et].value);ue=FM(wt,r),A.backtrack=!0}if(H.comma!==!0&&H.dots!==!0){let Me=A.output.slice(0,H.outputIndex),wt=A.tokens.slice(H.tokensIndex);H.value=H.output="\\{",y=ue="\\}",A.output=Me;for(let et of wt)A.output+=et.output||et.value}V({type:"brace",value:y,output:ue}),ee("braces"),M.pop();continue}if(y==="|"){U.length>0&&U[U.length-1].conditions++,V({type:"text",value:y});continue}if(y===","){let H=y,ue=M[M.length-1];ue&&Q[Q.length-1]==="braces"&&(ue.comma=!0,H="|"),V({type:"comma",value:y,output:H});continue}if(y==="/"){if($.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",a.pop(),$=i;continue}V({type:"slash",value:y,output:h});continue}if(y==="."){if(A.braces>0&&$.type==="dot"){$.value==="."&&($.output=f);let H=M[M.length-1];$.type="dots",$.output+=y,$.value+=y,H.dots=!0;continue}if(A.braces+A.parens===0&&$.type!=="bos"&&$.type!=="slash"){V({type:"text",value:y,output:f});continue}V({type:"dot",value:y,output:f});continue}if(y==="?"){if(!($&&$.value==="(")&&r.noextglob!==!0&&w()==="("&&w(2)!=="?"){se("qmark",y);continue}if($&&$.type==="paren"){let ue=w(),Me=y;if(ue==="<"&&!Yt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");($.value==="("&&!/[!=<:]/.test(ue)||ue==="<"&&!/<([!=]|\w+>)/.test(I()))&&(Me=`\\${y}`),V({type:"text",value:y,output:Me});continue}if(r.dot!==!0&&($.type==="slash"||$.type==="bos")){V({type:"qmark",value:y,output:_});continue}V({type:"qmark",value:y,output:g});continue}if(y==="!"){if(r.noextglob!==!0&&w()==="("&&(w(2)!=="?"||!/[!=<:]/.test(w(3)))){se("negate",y);continue}if(r.nonegate!==!0&&A.index===0){P();continue}}if(y==="+"){if(r.noextglob!==!0&&w()==="("&&w(2)!=="?"){se("plus",y);continue}if($&&$.value==="("||r.regex===!1){V({type:"plus",value:y,output:d});continue}if($&&($.type==="bracket"||$.type==="paren"||$.type==="brace")||A.parens>0){V({type:"plus",value:y});continue}V({type:"plus",value:d});continue}if(y==="@"){if(r.noextglob!==!0&&w()==="("&&w(2)!=="?"){V({type:"at",extglob:!0,value:y,output:""});continue}V({type:"text",value:y});continue}if(y!=="*"){(y==="$"||y==="^")&&(y=`\\${y}`);let H=xM.exec(I());H&&(y+=H[0],A.index+=H[0].length),V({type:"text",value:y});continue}if($&&($.type==="globstar"||$.star===!0)){$.type="star",$.star=!0,$.value+=y,$.output=N,A.backtrack=!0,A.globstar=!0,O(y);continue}let z=I();if(r.noextglob!==!0&&/^\([^?]/.test(z)){se("star",y);continue}if($.type==="star"){if(r.noglobstar===!0){O(y);continue}let H=$.prev,ue=H.prev,Me=H.type==="slash"||H.type==="bos",wt=ue&&(ue.type==="star"||ue.type==="globstar");if(r.bash===!0&&(!Me||z[0]&&z[0]!=="/")){V({type:"star",value:y,output:""});continue}let et=A.braces>0&&(H.type==="comma"||H.type==="brace"),nf=U.length&&(H.type==="pipe"||H.type==="paren");if(!Me&&H.type!=="paren"&&!et&&!nf){V({type:"star",value:y,output:""});continue}for(;z.slice(0,3)==="/**";){let Bs=t[A.index+4];if(Bs&&Bs!=="/")break;z=z.slice(3),O("/**",3)}if(H.type==="bos"&&v()){$.type="globstar",$.value+=y,$.output=k(r),A.output=$.output,A.globstar=!0,O(y);continue}if(H.type==="slash"&&H.prev.type!=="bos"&&!wt&&v()){A.output=A.output.slice(0,-(H.output+$.output).length),H.output=`(?:${H.output}`,$.type="globstar",$.output=k(r)+(r.strictSlashes?")":"|$)"),$.value+=y,A.globstar=!0,A.output+=H.output+$.output,O(y);continue}if(H.type==="slash"&&H.prev.type!=="bos"&&z[0]==="/"){let Bs=z[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(H.output+$.output).length),H.output=`(?:${H.output}`,$.type="globstar",$.output=`${k(r)}${h}|${h}${Bs})`,$.value+=y,A.output+=H.output+$.output,A.globstar=!0,O(y+F()),V({type:"slash",value:"/",output:""});continue}if(H.type==="bos"&&z[0]==="/"){$.type="globstar",$.value+=y,$.output=`(?:^|${h}|${k(r)}${h})`,A.output=$.output,A.globstar=!0,O(y+F()),V({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-$.output.length),$.type="globstar",$.output=k(r),$.value+=y,A.output+=$.output,A.globstar=!0,O(y);continue}let Ee={type:"star",value:y,output:N};if(r.bash===!0){Ee.output=".*?",($.type==="bos"||$.type==="slash")&&(Ee.output=B+Ee.output),V(Ee);continue}if($&&($.type==="bracket"||$.type==="paren")&&r.regex===!0){Ee.output=y,V(Ee);continue}(A.index===A.start||$.type==="slash"||$.type==="dot")&&($.type==="dot"?(A.output+=C,$.output+=C):r.dot===!0?(A.output+=E,$.output+=E):(A.output+=B,$.output+=B),w()!=="*"&&(A.output+=m,$.output+=m)),V(Ee)}for(;A.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(oa("closing","]"));A.output=Yt.escapeLast(A.output,"["),ee("brackets")}for(;A.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(oa("closing",")"));A.output=Yt.escapeLast(A.output,"("),ee("parens")}for(;A.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(oa("closing","}"));A.output=Yt.escapeLast(A.output,"{"),ee("braces")}if(r.strictSlashes!==!0&&($.type==="star"||$.type==="bracket")&&V({type:"maybe_slash",value:"",output:`${h}?`}),A.backtrack===!0){A.output="";for(let z of A.tokens)A.output+=z.output!=null?z.output:z.value,z.suffix&&(A.output+=z.suffix)}return A};Rg.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Kl,r.maxLength):Kl,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=VS[t]||t;let i=Yt.isWindows(e),{DOT_LITERAL:a,SLASH_LITERAL:s,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:f,NO_DOTS_SLASH:d,STAR:h,START_ANCHOR:m}=Wl.globChars(i),b=r.dot?f:l,D=r.dot?d:l,C=r.capture?"":"?:",E={negated:!1,prefix:""},g=r.bash===!0?".*?":h;r.capture&&(g=`(${g})`);let _=B=>B.noglobstar===!0?g:`(${C}(?:(?!${m}${B.dot?c:a}).)*?)`,S=B=>{switch(B){case"*":return`${b}${u}${g}`;case".*":return`${a}${u}${g}`;case"*.*":return`${b}${g}${a}${u}${g}`;case"*/*":return`${b}${g}${s}${u}${D}${g}`;case"**":return b+_(r);case"**/*":return`(?:${b}${_(r)}${s})?${D}${u}${g}`;case"**/*.*":return`(?:${b}${_(r)}${s})?${D}${g}${a}${u}${g}`;case"**/.*":return`(?:${b}${_(r)}${s})?${a}${u}${g}`;default:{let R=/^(.*?)\.(\w+)$/.exec(B);if(!R)return;let N=S(R[1]);return N?N+a+R[2]:void 0}}},T=Yt.removePrefix(t,E),k=S(T);return k&&r.strictSlashes!==!0&&(k+=`${s}?`),k};zS.exports=Rg});var KS=x((MY,WS)=>{"use strict";var AM=require("path"),OM=HS(),Bg=GS(),jg=ks(),kM=Os(),$M=t=>t&&typeof t=="object"&&!Array.isArray(t),Ze=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(d=>Ze(d,e,r));return d=>{for(let h of l){let m=h(d);if(m)return m}return!1}}let n=$M(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},i=jg.isWindows(e),a=n?Ze.compileRe(t,e):Ze.makeRe(t,e,!1,!0),s=a.state;delete a.state;let u=()=>!1;if(o.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};u=Ze(o.ignore,l,r)}let c=(l,f=!1)=>{let{isMatch:d,match:h,output:m}=Ze.test(l,a,e,{glob:t,posix:i}),b={glob:t,state:s,regex:a,posix:i,input:l,output:m,match:h,isMatch:d};return typeof o.onResult=="function"&&o.onResult(b),d===!1?(b.isMatch=!1,f?b:!1):u(l)?(typeof o.onIgnore=="function"&&o.onIgnore(b),b.isMatch=!1,f?b:!1):(typeof o.onMatch=="function"&&o.onMatch(b),f?b:!0)};return r&&(c.state=s),c};Ze.test=(t,e,r,{glob:n,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let i=r||{},a=i.format||(o?jg.toPosixSlashes:null),s=t===n,u=s&&a?a(t):t;return s===!1&&(u=a?a(t):t,s=u===n),(s===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?s=Ze.matchBase(t,e,r,o):s=e.exec(u)),{isMatch:!!s,match:s,output:u}};Ze.matchBase=(t,e,r,n=jg.isWindows(r))=>(e instanceof RegExp?e:Ze.makeRe(e,r)).test(AM.basename(t));Ze.isMatch=(t,e,r)=>Ze(e,r)(t);Ze.parse=(t,e)=>Array.isArray(t)?t.map(r=>Ze.parse(r,e)):Bg(t,{...e,fastpaths:!1});Ze.scan=(t,e)=>OM(t,e);Ze.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let o=e||{},i=o.contains?"":"^",a=o.contains?"":"$",s=`${i}(?:${t.output})${a}`;t&&t.negated===!0&&(s=`^(?!${s}).*$`);let u=Ze.toRegex(s,e);return n===!0&&(u.state=t),u};Ze.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=Bg.fastpaths(t,e)),o.output||(o=Bg(t,e)),Ze.compileRe(o,e,r,n)};Ze.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Ze.constants=kM;WS.exports=Ze});var JS=x((qY,YS)=>{"use strict";YS.exports=KS()});var rF=x((HY,tF)=>{"use strict";var ZS=require("util"),QS=kS(),Lr=JS(),Ng=ks(),XS=t=>t===""||t==="./",eF=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},je=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,o=new Set,i=new Set,a=0,s=l=>{i.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<e.length;l++){let f=Lr(String(e[l]),{...r,onResult:s},!0),d=f.state.negated||f.state.negatedExtglob;d&&a++;for(let h of t){let m=f(h,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),o.add(m.output)))}}let c=(a===e.length?[...i]:[...o]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return c};je.match=je;je.matcher=(t,e)=>Lr(t,e);je.isMatch=(t,e,r)=>Lr(e,r)(t);je.any=je.isMatch;je.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,o=[],i=s=>{r.onResult&&r.onResult(s),o.push(s.output)},a=new Set(je(t,e,{...r,onResult:i}));for(let s of o)a.has(s)||n.add(s);return[...n]};je.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${ZS.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>je.contains(t,n,r));if(typeof e=="string"){if(XS(t)||XS(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return je.isMatch(t,e,{...r,contains:!0})};je.matchKeys=(t,e,r)=>{if(!Ng.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=je(Object.keys(t),e,r),o={};for(let i of n)o[i]=t[i];return o};je.some=(t,e,r)=>{let n=[].concat(t);for(let o of[].concat(e)){let i=Lr(String(o),r);if(n.some(a=>i(a)))return!0}return!1};je.every=(t,e,r)=>{let n=[].concat(t);for(let o of[].concat(e)){let i=Lr(String(o),r);if(!n.every(a=>i(a)))return!1}return!0};je.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${ZS.inspect(t)}"`);return[].concat(e).every(n=>Lr(n,r)(t))};je.capture=(t,e,r)=>{let n=Ng.isWindows(r),i=Lr.makeRe(String(t),{...r,capture:!0}).exec(n?Ng.toPosixSlashes(e):e);if(i)return i.slice(1).map(a=>a===void 0?"":a)};je.makeRe=(...t)=>Lr.makeRe(...t);je.scan=(...t)=>Lr.scan(...t);je.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let o of QS(String(n),e))r.push(Lr.parse(o,e));return r};je.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!eF(t)?[t]:QS(t,e)};je.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return je.braces(t,{...e,expand:!0})};je.hasBraces=eF;tF.exports=je});var MF=x((MJ,cn)=>{var $e=require("fs"),Zl=require("os"),mt=require("path"),_F=require("crypto"),Mr={fs:$e.constants,os:Zl.constants},xF="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",OF=/XXXXXX/,o9=3,kF=(Mr.O_CREAT||Mr.fs.O_CREAT)|(Mr.O_EXCL||Mr.fs.O_EXCL)|(Mr.O_RDWR||Mr.fs.O_RDWR),i9=Zl.platform()==="win32",a9=Mr.EBADF||Mr.os.errno.EBADF,s9=Mr.ENOENT||Mr.os.errno.ENOENT,$F=448,PF=384,u9="exit",aa=[],TF=$e.rmdirSync.bind($e),IF=!1;function c9(t,e){return $e.rm(t,{recursive:!0},e)}function RF(t){return $e.rmSync(t,{recursive:!0})}function zg(t,e){let r=sa(t,e),n=r[0],o=r[1];b9(n,function(i,a){if(i)return o(i);let s=a.tries;(function u(){try{let c=jF(a);$e.stat(c,function(l){if(!l)return s-- >0?u():o(new Error("Could not get a unique tmp filename, max tries reached "+c));o(null,c)})}catch(c){o(c)}})()})}function Gg(t){let e=sa(t),r=e[0],n=v9(r),o=n.tries;do{let i=jF(n);try{$e.statSync(i)}catch{return i}}while(o-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function l9(t,e){let r=sa(t,e),n=r[0],o=r[1];zg(n,function(a,s){if(a)return o(a);$e.open(s,kF,n.mode||PF,function(c,l){if(c)return o(c);if(n.discardDescriptor)return $e.close(l,function(d){return o(d,s,void 0,Hg(s,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;o(null,s,l,Hg(s,f?-1:l,n,!1))}})})}function f9(t){let e=sa(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,o=Gg(r),i=$e.openSync(o,kF,r.mode||PF);return r.discardDescriptor&&($e.closeSync(i),i=void 0),{name:o,fd:i,removeCallback:Hg(o,n?-1:i,r,!0)}}function p9(t,e){let r=sa(t,e),n=r[0],o=r[1];zg(n,function(a,s){if(a)return o(a);$e.mkdir(s,n.mode||$F,function(c){if(c)return o(c);o(null,s,BF(s,n,!1))})})}function d9(t){let e=sa(t),r=e[0],n=Gg(r);return $e.mkdirSync(n,r.mode||$F),{name:n,removeCallback:BF(n,r,!0)}}function h9(t,e){let r=function(n){if(n&&!Vg(n))return e(n);e()};0<=t[0]?$e.close(t[0],function(){$e.unlink(t[1],r)}):$e.unlink(t[1],r)}function m9(t){let e=null;try{0<=t[0]&&$e.closeSync(t[0])}catch(r){if(!w9(r)&&!Vg(r))throw r}finally{try{$e.unlinkSync(t[1])}catch(r){Vg(r)||(e=r)}}if(e!==null)throw e}function Hg(t,e,r,n){let o=Xl(m9,[e,t],n),i=Xl(h9,[e,t],n,o);return r.keep||aa.unshift(o),n?o:i}function BF(t,e,r){let n=e.unsafeCleanup?c9:$e.rmdir.bind($e),o=e.unsafeCleanup?RF:TF,i=Xl(o,t,r),a=Xl(n,t,r,i);return e.keep||aa.unshift(i),r?i:a}function Xl(t,e,r,n){let o=!1;return function i(a){if(!o){let s=n||i,u=aa.indexOf(s);return u>=0&&aa.splice(u,1),o=!0,r||t===TF||t===RF?t(e):t(e,a||function(){})}}}function g9(){if(IF)for(;aa.length;)try{aa[0]()}catch{}}function SF(t){let e=[],r=null;try{r=_F.randomBytes(t)}catch{r=_F.pseudoRandomBytes(t)}for(let n=0;n<t;n++)e.push(xF[r[n]%xF.length]);return e.join("")}function Jt(t){return typeof t>"u"}function sa(t,e){if(typeof t=="function")return[{},t];if(Jt(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function D9(t,e,r){let n=mt.isAbsolute(t)?t:mt.join(e,t);$e.stat(n,function(o){o?$e.realpath(mt.dirname(n),function(i,a){if(i)return r(i);r(null,mt.join(a,mt.basename(n)))}):$e.realpath(n,r)})}function y9(t,e){let r=mt.isAbsolute(t)?t:mt.join(e,t);try{return $e.statSync(r),$e.realpathSync(r)}catch{let o=$e.realpathSync(mt.dirname(r));return mt.join(o,mt.basename(r))}}function jF(t){let e=t.tmpdir;if(!Jt(t.name))return mt.join(e,t.dir,t.name);if(!Jt(t.template))return mt.join(e,t.dir,t.template).replace(OF,SF(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",SF(12),t.postfix?"-"+t.postfix:""].join("");return mt.join(e,t.dir,r)}function NF(t){if(!Jt(t.name)){let e=t.name;if(mt.isAbsolute(e))throw new Error(`name option must not contain an absolute path, found "${e}".`);let r=mt.basename(e);if(r===".."||r==="."||r!==e)throw new Error(`name option must not contain a path, found "${e}".`)}if(!Jt(t.template)&&!t.template.match(OF))throw new Error(`Invalid template, found "${t.template}".`);if(!Jt(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=Jt(t.name)?t.tries||o9:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.prefix=Jt(t.prefix)?"":t.prefix,t.postfix=Jt(t.postfix)?"":t.postfix}function FF(t,e,r,n){if(Jt(e))return n(null);D9(e,r,function(o,i){if(o)return n(o);let a=mt.relative(r,i);if(!i.startsWith(r))return n(new Error(`${t} option must be relative to "${r}", found "${a}".`));n(null,a)})}function AF(t,e,r){if(Jt(e))return;let n=y9(e,r),o=mt.relative(r,n);if(!n.startsWith(r))throw new Error(`${t} option must be relative to "${r}", found "${o}".`);return o}function b9(t,e){E9(t,function(r,n){if(r)return e(r);t.tmpdir=n;try{NF(t,n)}catch(o){return e(o)}FF("dir",t.dir,n,function(o,i){if(o)return e(o);t.dir=Jt(i)?"":i,FF("template",t.template,n,function(a,s){if(a)return e(a);t.template=s,e(null,t)})})})}function v9(t){let e=t.tmpdir=UF(t);NF(t,e);let r=AF("dir",t.dir,e);return t.dir=Jt(r)?"":r,t.template=AF("template",t.template,e),t}function w9(t){return LF(t,-a9,"EBADF")}function Vg(t){return LF(t,-s9,"ENOENT")}function LF(t,e,r){return i9?t.code===r:t.code===r&&t.errno===e}function C9(){IF=!0}function E9(t,e){return $e.realpath(t&&t.tmpdir||Zl.tmpdir(),e)}function UF(t){return $e.realpathSync(t&&t.tmpdir||Zl.tmpdir())}process.addListener(u9,g9);Object.defineProperty(cn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return UF()}});cn.exports.dir=p9;cn.exports.dirSync=d9;cn.exports.file=l9;cn.exports.fileSync=f9;cn.exports.tmpName=zg;cn.exports.tmpNameSync=Gg;cn.exports.setGracefulCleanup=C9});var tf=require("node:process");var mD=ge(hD(),1),{program:ft,createCommand:n7,createArgument:o7,createOption:i7,CommanderError:a7,InvalidArgumentError:s7,InvalidOptionArgumentError:u7,Command:c7,Argument:l7,Option:f7,Help:p7}=mD.default;var hr={name:"@capgo/cli",version:"7.26.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#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","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js",require:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",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","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload"},devDependencies:{"@antfu/eslint-config":"^6.1.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^7.4.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^0.11.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^24.9.1","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",esbuild:"^0.25.11",eslint:"^9.38.0","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",open:"^10.1.2",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3"}};var Zi=require("node:fs");var gt=ge(Ef(),1),Bo=require("node:process"),fn=ge(require("node:readline"),1),Af=ge(require("node:readline"),1),SD=require("node:stream"),FD=ge(xf(),1);function _A({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var xA=_A();function AD(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(xA,"")}function OD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kD={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var o=n.charCodeAt(0),i=n.length==2?n.charCodeAt(1):0,a=o;return 55296<=o&&o<=56319&&56320<=i&&i<=57343&&(o&=1023,i&=1023,a=o<<10|i,a+=65536),a==12288||65281<=a&&a<=65376||65504<=a&&a<=65510?"F":a==8361||65377<=a&&a<=65470||65474<=a&&a<=65479||65482<=a&&a<=65487||65490<=a&&a<=65495||65498<=a&&a<=65500||65512<=a&&a<=65518?"H":4352<=a&&a<=4447||4515<=a&&a<=4519||4602<=a&&a<=4607||9001<=a&&a<=9002||11904<=a&&a<=11929||11931<=a&&a<=12019||12032<=a&&a<=12245||12272<=a&&a<=12283||12289<=a&&a<=12350||12353<=a&&a<=12438||12441<=a&&a<=12543||12549<=a&&a<=12589||12593<=a&&a<=12686||12688<=a&&a<=12730||12736<=a&&a<=12771||12784<=a&&a<=12830||12832<=a&&a<=12871||12880<=a&&a<=13054||13056<=a&&a<=19903||19968<=a&&a<=42124||42128<=a&&a<=42182||43360<=a&&a<=43388||44032<=a&&a<=55203||55216<=a&&a<=55238||55243<=a&&a<=55291||63744<=a&&a<=64255||65040<=a&&a<=65049||65072<=a&&a<=65106||65108<=a&&a<=65126||65128<=a&&a<=65131||110592<=a&&a<=110593||127488<=a&&a<=127490||127504<=a&&a<=127546||127552<=a&&a<=127560||127568<=a&&a<=127569||131072<=a&&a<=194367||177984<=a&&a<=196605||196608<=a&&a<=262141?"W":32<=a&&a<=126||162<=a&&a<=163||165<=a&&a<=166||a==172||a==175||10214<=a&&a<=10221||10629<=a&&a<=10630?"Na":a==161||a==164||167<=a&&a<=168||a==170||173<=a&&a<=174||176<=a&&a<=180||182<=a&&a<=186||188<=a&&a<=191||a==198||a==208||215<=a&&a<=216||222<=a&&a<=225||a==230||232<=a&&a<=234||236<=a&&a<=237||a==240||242<=a&&a<=243||247<=a&&a<=250||a==252||a==254||a==257||a==273||a==275||a==283||294<=a&&a<=295||a==299||305<=a&&a<=307||a==312||319<=a&&a<=322||a==324||328<=a&&a<=331||a==333||338<=a&&a<=339||358<=a&&a<=359||a==363||a==462||a==464||a==466||a==468||a==470||a==472||a==474||a==476||a==593||a==609||a==708||a==711||713<=a&&a<=715||a==717||a==720||728<=a&&a<=731||a==733||a==735||768<=a&&a<=879||913<=a&&a<=929||931<=a&&a<=937||945<=a&&a<=961||963<=a&&a<=969||a==1025||1040<=a&&a<=1103||a==1105||a==8208||8211<=a&&a<=8214||8216<=a&&a<=8217||8220<=a&&a<=8221||8224<=a&&a<=8226||8228<=a&&a<=8231||a==8240||8242<=a&&a<=8243||a==8245||a==8251||a==8254||a==8308||a==8319||8321<=a&&a<=8324||a==8364||a==8451||a==8453||a==8457||a==8467||a==8470||8481<=a&&a<=8482||a==8486||a==8491||8531<=a&&a<=8532||8539<=a&&a<=8542||8544<=a&&a<=8555||8560<=a&&a<=8569||a==8585||8592<=a&&a<=8601||8632<=a&&a<=8633||a==8658||a==8660||a==8679||a==8704||8706<=a&&a<=8707||8711<=a&&a<=8712||a==8715||a==8719||a==8721||a==8725||a==8730||8733<=a&&a<=8736||a==8739||a==8741||8743<=a&&a<=8748||a==8750||8756<=a&&a<=8759||8764<=a&&a<=8765||a==8776||a==8780||a==8786||8800<=a&&a<=8801||8804<=a&&a<=8807||8810<=a&&a<=8811||8814<=a&&a<=8815||8834<=a&&a<=8835||8838<=a&&a<=8839||a==8853||a==8857||a==8869||a==8895||a==8978||9312<=a&&a<=9449||9451<=a&&a<=9547||9552<=a&&a<=9587||9600<=a&&a<=9615||9618<=a&&a<=9621||9632<=a&&a<=9633||9635<=a&&a<=9641||9650<=a&&a<=9651||9654<=a&&a<=9655||9660<=a&&a<=9661||9664<=a&&a<=9665||9670<=a&&a<=9672||a==9675||9678<=a&&a<=9681||9698<=a&&a<=9701||a==9711||9733<=a&&a<=9734||a==9737||9742<=a&&a<=9743||9748<=a&&a<=9749||a==9756||a==9758||a==9792||a==9794||9824<=a&&a<=9825||9827<=a&&a<=9829||9831<=a&&a<=9834||9836<=a&&a<=9837||a==9839||9886<=a&&a<=9887||9918<=a&&a<=9919||9924<=a&&a<=9933||9935<=a&&a<=9953||a==9955||9960<=a&&a<=9983||a==10045||a==10071||10102<=a&&a<=10111||11093<=a&&a<=11097||12872<=a&&a<=12879||57344<=a&&a<=63743||65024<=a&&a<=65039||a==65533||127232<=a&&a<=127242||127248<=a&&a<=127277||127280<=a&&a<=127337||127344<=a&&a<=127386||917760<=a&&a<=917999||983040<=a&&a<=1048573||1048576<=a&&a<=1114109?"A":"N"},e.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var o=r(n),i=0,a=0;a<o.length;a++)i=i+this.characterLength(o[a]);return i},e.slice=function(n,o,i){textLen=e.length(n),o=o||0,i=i||1,o<0&&(o=textLen+o),i<0&&(i=textLen+i);for(var a="",s=0,u=r(n),c=0;c<u.length;c++){var l=u[c],f=e.length(l);if(s>=o-(f==2?1:0))if(s+f<=i)a+=l;else break;s+=f}return a}})(kD);var SA=kD.exports,FA=OD(SA),AA=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},OA=OD(AA);function fa(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=AD(t),t.length===0))return 0;t=t.replace(OA()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let o of t){let i=o.codePointAt(0);if(!(i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(FA.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Sf=10,bD=(t=0)=>e=>`\x1B[${e+t}m`,vD=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,wD=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ne={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(Ne.modifier);var kA=Object.keys(Ne.color),$A=Object.keys(Ne.bgColor);[...kA,...$A];function PA(){let t=new Map;for(let[e,r]of Object.entries(Ne)){for(let[n,o]of Object.entries(r))Ne[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Ne[n],t.set(o[0],o[1]);Object.defineProperty(Ne,e,{value:r,enumerable:!1})}return Object.defineProperty(Ne,"codes",{value:t,enumerable:!1}),Ne.color.close="\x1B[39m",Ne.bgColor.close="\x1B[49m",Ne.color.ansi=bD(),Ne.color.ansi256=vD(),Ne.color.ansi16m=wD(),Ne.bgColor.ansi=bD(Sf),Ne.bgColor.ansi256=vD(Sf),Ne.bgColor.ansi16m=wD(Sf),Object.defineProperties(Ne,{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(i=>i+i).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:e=>Ne.rgbToAnsi256(...Ne.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let s=e%36;r=Math.floor(e/36)/5,n=Math.floor(s/6)/5,o=s%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let a=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ne.ansi256ToAnsi(Ne.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ne.ansi256ToAnsi(Ne.hexToAnsi256(e)),enumerable:!1}}),Ne}var TA=PA(),Ks=new Set(["\x1B","\x9B"]),IA=39,kf="\x07",$D="[",RA="]",PD="m",$f=`${RA}8;;`,CD=t=>`${Ks.values().next().value}${$D}${t}${PD}`,ED=t=>`${Ks.values().next().value}${$f}${t}${kf}`,BA=t=>t.split(" ").map(e=>fa(e)),Ff=(t,e,r)=>{let n=[...e],o=!1,i=!1,a=fa(AD(t[t.length-1]));for(let[s,u]of n.entries()){let c=fa(u);if(a+c<=r?t[t.length-1]+=u:(t.push(u),a=0),Ks.has(u)&&(o=!0,i=n.slice(s+1).join("").startsWith($f)),o){i?u===kf&&(o=!1,i=!1):u===PD&&(o=!1);continue}a+=c,a===r&&s<n.length-1&&(t.push(""),a=0)}!a&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},jA=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(fa(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},NA=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,i,a=BA(t),s=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let f=fa(s[s.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(s.push(""),f=0),(f>0||r.trim===!1)&&(s[s.length-1]+=" ",f++)),r.hard&&a[c]>e){let d=e-f,h=1+Math.floor((a[c]-d-1)/e);Math.floor((a[c]-1)/e)<h&&s.push(""),Ff(s,l,e);continue}if(f+a[c]>e&&f>0&&a[c]>0){if(r.wordWrap===!1&&f<e){Ff(s,l,e);continue}s.push("")}if(f+a[c]>e&&r.wordWrap===!1){Ff(s,l,e);continue}s[s.length-1]+=l}r.trim!==!1&&(s=s.map(c=>jA(c)));let u=[...s.join(`
|
|
104
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var FS=x((RY,SS)=>{"use strict";var jU=Hl(),{MAX_LENGTH:ES,CHAR_BACKSLASH:Fg,CHAR_BACKTICK:NU,CHAR_COMMA:LU,CHAR_DOT:UU,CHAR_LEFT_PARENTHESES:MU,CHAR_RIGHT_PARENTHESES:qU,CHAR_LEFT_CURLY_BRACE:HU,CHAR_RIGHT_CURLY_BRACE:VU,CHAR_LEFT_SQUARE_BRACKET:_S,CHAR_RIGHT_SQUARE_BRACKET:xS,CHAR_DOUBLE_QUOTE:zU,CHAR_SINGLE_QUOTE:GU,CHAR_NO_BREAK_SPACE:WU,CHAR_ZERO_WIDTH_NOBREAK_SPACE:KU}=CS(),YU=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(ES,r.maxLength):ES;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let o={type:"root",input:t,nodes:[]},i=[o],a=o,s=o,u=0,c=t.length,l=0,f=0,d,h=()=>t[l++],m=b=>{if(b.type==="text"&&s.type==="dot"&&(s.type="text"),s&&s.type==="text"&&b.type==="text"){s.value+=b.value;return}return a.nodes.push(b),b.parent=a,b.prev=s,s=b,b};for(m({type:"bos"});l<c;)if(a=i[i.length-1],d=h(),!(d===KU||d===WU)){if(d===Fg){m({type:"text",value:(e.keepEscaping?d:"")+h()});continue}if(d===xS){m({type:"text",value:"\\"+d});continue}if(d===_S){u++;let b;for(;l<c&&(b=h());){if(d+=b,b===_S){u++;continue}if(b===Fg){d+=h();continue}if(b===xS&&(u--,u===0))break}m({type:"text",value:d});continue}if(d===MU){a=m({type:"paren",nodes:[]}),i.push(a),m({type:"text",value:d});continue}if(d===qU){if(a.type!=="paren"){m({type:"text",value:d});continue}a=i.pop(),m({type:"text",value:d}),a=i[i.length-1];continue}if(d===zU||d===GU||d===NU){let b=d,D;for(e.keepQuotes!==!0&&(d="");l<c&&(D=h());){if(D===Fg){d+=D+h();continue}if(D===b){e.keepQuotes===!0&&(d+=D);break}d+=D}m({type:"text",value:d});continue}if(d===HU){f++;let D={type:"brace",open:!0,close:!1,dollar:s.value&&s.value.slice(-1)==="$"||a.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};a=m(D),i.push(a),m({type:"open",value:d});continue}if(d===VU){if(a.type!=="brace"){m({type:"text",value:d});continue}let b="close";a=i.pop(),a.close=!0,m({type:b,value:d}),f--,a=i[i.length-1];continue}if(d===LU&&f>0){if(a.ranges>0){a.ranges=0;let b=a.nodes.shift();a.nodes=[b,{type:"text",value:jU(a)}]}m({type:"comma",value:d}),a.commas++;continue}if(d===UU&&f>0&&a.commas===0){let b=a.nodes;if(f===0||b.length===0){m({type:"text",value:d});continue}if(s.type==="dot"){if(a.range=[],s.value+=d,s.type="range",a.nodes.length!==3&&a.nodes.length!==5){a.invalid=!0,a.ranges=0,s.type="text";continue}a.ranges++,a.args=[];continue}if(s.type==="range"){b.pop();let D=b[b.length-1];D.value+=s.value+d,s=D,a.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(a=i.pop(),a.type!=="root"){a.nodes.forEach(C=>{C.nodes||(C.type==="open"&&(C.isOpen=!0),C.type==="close"&&(C.isClose=!0),C.nodes||(C.type="text"),C.invalid=!0)});let b=i[i.length-1],D=b.nodes.indexOf(a);b.nodes.splice(D,1,...a.nodes)}while(i.length>0);return m({type:"eos"}),o};SS.exports=YU});var kS=x((BY,OS)=>{"use strict";var AS=Hl(),JU=DS(),XU=vS(),ZU=FS(),Kt=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let o=Kt.create(n,e);Array.isArray(o)?r.push(...o):r.push(o)}else r=[].concat(Kt.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Kt.parse=(t,e={})=>ZU(t,e);Kt.stringify=(t,e={})=>AS(typeof t=="string"?Kt.parse(t,e):t,e);Kt.compile=(t,e={})=>(typeof t=="string"&&(t=Kt.parse(t,e)),JU(t,e));Kt.expand=(t,e={})=>{typeof t=="string"&&(t=Kt.parse(t,e));let r=XU(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Kt.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Kt.compile(t,e):Kt.expand(t,e);OS.exports=Kt});var Os=x((jY,RS)=>{"use strict";var QU=require("path"),Nr="\\\\/",$S=`[^${Nr}]`,un="\\.",eM="\\+",tM="\\?",Gl="\\/",rM="(?=.)",PS="[^/]",Ag=`(?:${Gl}|$)`,TS=`(?:^|${Gl})`,Og=`${un}{1,2}${Ag}`,nM=`(?!${un})`,oM=`(?!${TS}${Og})`,iM=`(?!${un}{0,1}${Ag})`,aM=`(?!${Og})`,sM=`[^.${Gl}]`,uM=`${PS}*?`,IS={DOT_LITERAL:un,PLUS_LITERAL:eM,QMARK_LITERAL:tM,SLASH_LITERAL:Gl,ONE_CHAR:rM,QMARK:PS,END_ANCHOR:Ag,DOTS_SLASH:Og,NO_DOT:nM,NO_DOTS:oM,NO_DOT_SLASH:iM,NO_DOTS_SLASH:aM,QMARK_NO_DOT:sM,STAR:uM,START_ANCHOR:TS},cM={...IS,SLASH_LITERAL:`[${Nr}]`,QMARK:$S,STAR:`${$S}*?`,DOTS_SLASH:`${un}{1,2}(?:[${Nr}]|$)`,NO_DOT:`(?!${un})`,NO_DOTS:`(?!(?:^|[${Nr}])${un}{1,2}(?:[${Nr}]|$))`,NO_DOT_SLASH:`(?!${un}{0,1}(?:[${Nr}]|$))`,NO_DOTS_SLASH:`(?!${un}{1,2}(?:[${Nr}]|$))`,QMARK_NO_DOT:`[^.${Nr}]`,START_ANCHOR:`(?:^|[${Nr}])`,END_ANCHOR:`(?:[${Nr}]|$)`},lM={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};RS.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:lM,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:QU.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?cM:IS}}});var ks=x(Mt=>{"use strict";var fM=require("path"),pM=process.platform==="win32",{REGEX_BACKSLASH:dM,REGEX_REMOVE_BACKSLASH:hM,REGEX_SPECIAL_CHARS:mM,REGEX_SPECIAL_CHARS_GLOBAL:gM}=Os();Mt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Mt.hasRegexChars=t=>mM.test(t);Mt.isRegexChar=t=>t.length===1&&Mt.hasRegexChars(t);Mt.escapeRegex=t=>t.replace(gM,"\\$1");Mt.toPosixSlashes=t=>t.replace(dM,"/");Mt.removeBackslashes=t=>t.replace(hM,e=>e==="\\"?"":e);Mt.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Mt.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:pM===!0||fM.sep==="\\";Mt.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Mt.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Mt.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Mt.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",i=`${n}(?:${t})${o}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i}});var HS=x((LY,qS)=>{"use strict";var BS=ks(),{CHAR_ASTERISK:kg,CHAR_AT:DM,CHAR_BACKWARD_SLASH:$s,CHAR_COMMA:yM,CHAR_DOT:$g,CHAR_EXCLAMATION_MARK:Pg,CHAR_FORWARD_SLASH:MS,CHAR_LEFT_CURLY_BRACE:Tg,CHAR_LEFT_PARENTHESES:Ig,CHAR_LEFT_SQUARE_BRACKET:bM,CHAR_PLUS:vM,CHAR_QUESTION_MARK:jS,CHAR_RIGHT_CURLY_BRACE:wM,CHAR_RIGHT_PARENTHESES:NS,CHAR_RIGHT_SQUARE_BRACKET:CM}=Os(),LS=t=>t===MS||t===$s,US=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},EM=(t,e)=>{let r=e||{},n=t.length-1,o=r.parts===!0||r.scanToEnd===!0,i=[],a=[],s=[],u=t,c=-1,l=0,f=0,d=!1,h=!1,m=!1,b=!1,D=!1,C=!1,E=!1,g=!1,_=!1,S=!1,P=0,k,B,R={value:"",depth:0,isGlob:!1},N=()=>c>=n,A=()=>u.charCodeAt(c+1),U=()=>(k=B,u.charCodeAt(++c));for(;c<n;){B=U();let v;if(B===$s){E=R.backslashes=!0,B=U(),B===Tg&&(C=!0);continue}if(C===!0||B===Tg){for(P++;N()!==!0&&(B=U());){if(B===$s){E=R.backslashes=!0,U();continue}if(B===Tg){P++;continue}if(C!==!0&&B===$g&&(B=U())===$g){if(d=R.isBrace=!0,m=R.isGlob=!0,S=!0,o===!0)continue;break}if(C!==!0&&B===yM){if(d=R.isBrace=!0,m=R.isGlob=!0,S=!0,o===!0)continue;break}if(B===wM&&(P--,P===0)){C=!1,d=R.isBrace=!0,S=!0;break}}if(o===!0)continue;break}if(B===MS){if(i.push(c),a.push(R),R={value:"",depth:0,isGlob:!1},S===!0)continue;if(k===$g&&c===l+1){l+=2;continue}f=c+1;continue}if(r.noext!==!0&&(B===vM||B===DM||B===kg||B===jS||B===Pg)===!0&&A()===Ig){if(m=R.isGlob=!0,b=R.isExtglob=!0,S=!0,B===Pg&&c===l&&(_=!0),o===!0){for(;N()!==!0&&(B=U());){if(B===$s){E=R.backslashes=!0,B=U();continue}if(B===NS){m=R.isGlob=!0,S=!0;break}}continue}break}if(B===kg){if(k===kg&&(D=R.isGlobstar=!0),m=R.isGlob=!0,S=!0,o===!0)continue;break}if(B===jS){if(m=R.isGlob=!0,S=!0,o===!0)continue;break}if(B===bM){for(;N()!==!0&&(v=U());){if(v===$s){E=R.backslashes=!0,U();continue}if(v===CM){h=R.isBracket=!0,m=R.isGlob=!0,S=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&B===Pg&&c===l){g=R.negated=!0,l++;continue}if(r.noparen!==!0&&B===Ig){if(m=R.isGlob=!0,o===!0){for(;N()!==!0&&(B=U());){if(B===Ig){E=R.backslashes=!0,B=U();continue}if(B===NS){S=!0;break}}continue}break}if(m===!0){if(S=!0,o===!0)continue;break}}r.noext===!0&&(b=!1,m=!1);let M=u,Q="",$="";l>0&&(Q=u.slice(0,l),u=u.slice(l),f-=l),M&&m===!0&&f>0?(M=u.slice(0,f),$=u.slice(f)):m===!0?(M="",$=u):M=u,M&&M!==""&&M!=="/"&&M!==u&&LS(M.charCodeAt(M.length-1))&&(M=M.slice(0,-1)),r.unescape===!0&&($&&($=BS.removeBackslashes($)),M&&E===!0&&(M=BS.removeBackslashes(M)));let y={prefix:Q,input:t,start:l,base:M,glob:$,isBrace:d,isBracket:h,isGlob:m,isExtglob:b,isGlobstar:D,negated:g,negatedExtglob:_};if(r.tokens===!0&&(y.maxDepth=0,LS(B)||a.push(R),y.tokens=a),r.parts===!0||r.tokens===!0){let v;for(let w=0;w<i.length;w++){let F=v?v+1:l,I=i[w],O=t.slice(F,I);r.tokens&&(w===0&&l!==0?(a[w].isPrefix=!0,a[w].value=Q):a[w].value=O,US(a[w]),y.maxDepth+=a[w].depth),(w!==0||O!=="")&&s.push(O),v=I}if(v&&v+1<t.length){let w=t.slice(v+1);s.push(w),r.tokens&&(a[a.length-1].value=w,US(a[a.length-1]),y.maxDepth+=a[a.length-1].depth)}y.slashes=i,y.parts=s}return y};qS.exports=EM});var GS=x((UY,zS)=>{"use strict";var Wl=Os(),Yt=ks(),{MAX_LENGTH:Kl,POSIX_REGEX_SOURCE:_M,REGEX_NON_SPECIAL_CHARS:xM,REGEX_SPECIAL_CHARS_BACKREF:SM,REPLACEMENTS:VS}=Wl,FM=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(o=>Yt.escapeRegex(o)).join("..")}return r},oa=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Rg=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=VS[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Kl,r.maxLength):Kl,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},a=[i],s=r.capture?"":"?:",u=Yt.isWindows(e),c=Wl.globChars(u),l=Wl.extglobChars(c),{DOT_LITERAL:f,PLUS_LITERAL:d,SLASH_LITERAL:h,ONE_CHAR:m,DOTS_SLASH:b,NO_DOT:D,NO_DOT_SLASH:C,NO_DOTS_SLASH:E,QMARK:g,QMARK_NO_DOT:_,STAR:S,START_ANCHOR:P}=c,k=z=>`(${s}(?:(?!${P}${z.dot?b:f}).)*?)`,B=r.dot?"":D,R=r.dot?g:_,N=r.bash===!0?k(r):S;r.capture&&(N=`(${N})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let A={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:a};t=Yt.removePrefix(t,A),o=t.length;let U=[],M=[],Q=[],$=i,y,v=()=>A.index===o-1,w=A.peek=(z=1)=>t[A.index+z],F=A.advance=()=>t[++A.index]||"",I=()=>t.slice(A.index+1),O=(z="",Ee=0)=>{A.consumed+=z,A.index+=Ee},q=z=>{A.output+=z.output!=null?z.output:z.value,O(z.value)},T=()=>{let z=1;for(;w()==="!"&&(w(2)!=="("||w(3)==="?");)F(),A.start++,z++;return z%2===0?!1:(A.negated=!0,A.start++,!0)},j=z=>{A[z]++,Q.push(z)},ee=z=>{A[z]--,Q.pop()},V=z=>{if($.type==="globstar"){let Ee=A.braces>0&&(z.type==="comma"||z.type==="brace"),H=z.extglob===!0||U.length&&(z.type==="pipe"||z.type==="paren");z.type!=="slash"&&z.type!=="paren"&&!Ee&&!H&&(A.output=A.output.slice(0,-$.output.length),$.type="star",$.value="*",$.output=N,A.output+=$.output)}if(U.length&&z.type!=="paren"&&(U[U.length-1].inner+=z.value),(z.value||z.output)&&q(z),$&&$.type==="text"&&z.type==="text"){$.value+=z.value,$.output=($.output||"")+z.value;return}z.prev=$,a.push(z),$=z},se=(z,Ee)=>{let H={...l[Ee],conditions:1,inner:""};H.prev=$,H.parens=A.parens,H.output=A.output;let ue=(r.capture?"(":"")+H.open;j("parens"),V({type:z,value:Ee,output:A.output?"":m}),V({type:"paren",extglob:!0,value:F(),output:ue}),U.push(H)},dr=z=>{let Ee=z.close+(r.capture?")":""),H;if(z.type==="negate"){let ue=N;if(z.inner&&z.inner.length>1&&z.inner.includes("/")&&(ue=k(r)),(ue!==N||v()||/^\)+$/.test(I()))&&(Ee=z.close=`)$))${ue}`),z.inner.includes("*")&&(H=I())&&/^\.[^\\/.]+$/.test(H)){let Me=Rg(H,{...e,fastpaths:!1}).output;Ee=z.close=`)${Me})${ue})`}z.prev.type==="bos"&&(A.negatedExtglob=!0)}V({type:"paren",extglob:!0,value:y,output:Ee}),ee("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let z=!1,Ee=t.replace(SM,(H,ue,Me,wt,et,nf)=>wt==="\\"?(z=!0,H):wt==="?"?ue?ue+wt+(et?g.repeat(et.length):""):nf===0?R+(et?g.repeat(et.length):""):g.repeat(Me.length):wt==="."?f.repeat(Me.length):wt==="*"?ue?ue+wt+(et?N:""):N:ue?H:`\\${H}`);return z===!0&&(r.unescape===!0?Ee=Ee.replace(/\\/g,""):Ee=Ee.replace(/\\+/g,H=>H.length%2===0?"\\\\":H?"\\":"")),Ee===t&&r.contains===!0?(A.output=t,A):(A.output=Yt.wrapOutput(Ee,A,e),A)}for(;!v();){if(y=F(),y==="\0")continue;if(y==="\\"){let H=w();if(H==="/"&&r.bash!==!0||H==="."||H===";")continue;if(!H){y+="\\",V({type:"text",value:y});continue}let ue=/^\\+/.exec(I()),Me=0;if(ue&&ue[0].length>2&&(Me=ue[0].length,A.index+=Me,Me%2!==0&&(y+="\\")),r.unescape===!0?y=F():y+=F(),A.brackets===0){V({type:"text",value:y});continue}}if(A.brackets>0&&(y!=="]"||$.value==="["||$.value==="[^")){if(r.posix!==!1&&y===":"){let H=$.value.slice(1);if(H.includes("[")&&($.posix=!0,H.includes(":"))){let ue=$.value.lastIndexOf("["),Me=$.value.slice(0,ue),wt=$.value.slice(ue+2),et=_M[wt];if(et){$.value=Me+et,A.backtrack=!0,F(),!i.output&&a.indexOf($)===1&&(i.output=m);continue}}}(y==="["&&w()!==":"||y==="-"&&w()==="]")&&(y=`\\${y}`),y==="]"&&($.value==="["||$.value==="[^")&&(y=`\\${y}`),r.posix===!0&&y==="!"&&$.value==="["&&(y="^"),$.value+=y,q({value:y});continue}if(A.quotes===1&&y!=='"'){y=Yt.escapeRegex(y),$.value+=y,q({value:y});continue}if(y==='"'){A.quotes=A.quotes===1?0:1,r.keepQuotes===!0&&V({type:"text",value:y});continue}if(y==="("){j("parens"),V({type:"paren",value:y});continue}if(y===")"){if(A.parens===0&&r.strictBrackets===!0)throw new SyntaxError(oa("opening","("));let H=U[U.length-1];if(H&&A.parens===H.parens+1){dr(U.pop());continue}V({type:"paren",value:y,output:A.parens?")":"\\)"}),ee("parens");continue}if(y==="["){if(r.nobracket===!0||!I().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(oa("closing","]"));y=`\\${y}`}else j("brackets");V({type:"bracket",value:y});continue}if(y==="]"){if(r.nobracket===!0||$&&$.type==="bracket"&&$.value.length===1){V({type:"text",value:y,output:`\\${y}`});continue}if(A.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(oa("opening","["));V({type:"text",value:y,output:`\\${y}`});continue}ee("brackets");let H=$.value.slice(1);if($.posix!==!0&&H[0]==="^"&&!H.includes("/")&&(y=`/${y}`),$.value+=y,q({value:y}),r.literalBrackets===!1||Yt.hasRegexChars(H))continue;let ue=Yt.escapeRegex($.value);if(A.output=A.output.slice(0,-$.value.length),r.literalBrackets===!0){A.output+=ue,$.value=ue;continue}$.value=`(${s}${ue}|${$.value})`,A.output+=$.value;continue}if(y==="{"&&r.nobrace!==!0){j("braces");let H={type:"brace",value:y,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};M.push(H),V(H);continue}if(y==="}"){let H=M[M.length-1];if(r.nobrace===!0||!H){V({type:"text",value:y,output:y});continue}let ue=")";if(H.dots===!0){let Me=a.slice(),wt=[];for(let et=Me.length-1;et>=0&&(a.pop(),Me[et].type!=="brace");et--)Me[et].type!=="dots"&&wt.unshift(Me[et].value);ue=FM(wt,r),A.backtrack=!0}if(H.comma!==!0&&H.dots!==!0){let Me=A.output.slice(0,H.outputIndex),wt=A.tokens.slice(H.tokensIndex);H.value=H.output="\\{",y=ue="\\}",A.output=Me;for(let et of wt)A.output+=et.output||et.value}V({type:"brace",value:y,output:ue}),ee("braces"),M.pop();continue}if(y==="|"){U.length>0&&U[U.length-1].conditions++,V({type:"text",value:y});continue}if(y===","){let H=y,ue=M[M.length-1];ue&&Q[Q.length-1]==="braces"&&(ue.comma=!0,H="|"),V({type:"comma",value:y,output:H});continue}if(y==="/"){if($.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",a.pop(),$=i;continue}V({type:"slash",value:y,output:h});continue}if(y==="."){if(A.braces>0&&$.type==="dot"){$.value==="."&&($.output=f);let H=M[M.length-1];$.type="dots",$.output+=y,$.value+=y,H.dots=!0;continue}if(A.braces+A.parens===0&&$.type!=="bos"&&$.type!=="slash"){V({type:"text",value:y,output:f});continue}V({type:"dot",value:y,output:f});continue}if(y==="?"){if(!($&&$.value==="(")&&r.noextglob!==!0&&w()==="("&&w(2)!=="?"){se("qmark",y);continue}if($&&$.type==="paren"){let ue=w(),Me=y;if(ue==="<"&&!Yt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");($.value==="("&&!/[!=<:]/.test(ue)||ue==="<"&&!/<([!=]|\w+>)/.test(I()))&&(Me=`\\${y}`),V({type:"text",value:y,output:Me});continue}if(r.dot!==!0&&($.type==="slash"||$.type==="bos")){V({type:"qmark",value:y,output:_});continue}V({type:"qmark",value:y,output:g});continue}if(y==="!"){if(r.noextglob!==!0&&w()==="("&&(w(2)!=="?"||!/[!=<:]/.test(w(3)))){se("negate",y);continue}if(r.nonegate!==!0&&A.index===0){T();continue}}if(y==="+"){if(r.noextglob!==!0&&w()==="("&&w(2)!=="?"){se("plus",y);continue}if($&&$.value==="("||r.regex===!1){V({type:"plus",value:y,output:d});continue}if($&&($.type==="bracket"||$.type==="paren"||$.type==="brace")||A.parens>0){V({type:"plus",value:y});continue}V({type:"plus",value:d});continue}if(y==="@"){if(r.noextglob!==!0&&w()==="("&&w(2)!=="?"){V({type:"at",extglob:!0,value:y,output:""});continue}V({type:"text",value:y});continue}if(y!=="*"){(y==="$"||y==="^")&&(y=`\\${y}`);let H=xM.exec(I());H&&(y+=H[0],A.index+=H[0].length),V({type:"text",value:y});continue}if($&&($.type==="globstar"||$.star===!0)){$.type="star",$.star=!0,$.value+=y,$.output=N,A.backtrack=!0,A.globstar=!0,O(y);continue}let z=I();if(r.noextglob!==!0&&/^\([^?]/.test(z)){se("star",y);continue}if($.type==="star"){if(r.noglobstar===!0){O(y);continue}let H=$.prev,ue=H.prev,Me=H.type==="slash"||H.type==="bos",wt=ue&&(ue.type==="star"||ue.type==="globstar");if(r.bash===!0&&(!Me||z[0]&&z[0]!=="/")){V({type:"star",value:y,output:""});continue}let et=A.braces>0&&(H.type==="comma"||H.type==="brace"),nf=U.length&&(H.type==="pipe"||H.type==="paren");if(!Me&&H.type!=="paren"&&!et&&!nf){V({type:"star",value:y,output:""});continue}for(;z.slice(0,3)==="/**";){let Bs=t[A.index+4];if(Bs&&Bs!=="/")break;z=z.slice(3),O("/**",3)}if(H.type==="bos"&&v()){$.type="globstar",$.value+=y,$.output=k(r),A.output=$.output,A.globstar=!0,O(y);continue}if(H.type==="slash"&&H.prev.type!=="bos"&&!wt&&v()){A.output=A.output.slice(0,-(H.output+$.output).length),H.output=`(?:${H.output}`,$.type="globstar",$.output=k(r)+(r.strictSlashes?")":"|$)"),$.value+=y,A.globstar=!0,A.output+=H.output+$.output,O(y);continue}if(H.type==="slash"&&H.prev.type!=="bos"&&z[0]==="/"){let Bs=z[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(H.output+$.output).length),H.output=`(?:${H.output}`,$.type="globstar",$.output=`${k(r)}${h}|${h}${Bs})`,$.value+=y,A.output+=H.output+$.output,A.globstar=!0,O(y+F()),V({type:"slash",value:"/",output:""});continue}if(H.type==="bos"&&z[0]==="/"){$.type="globstar",$.value+=y,$.output=`(?:^|${h}|${k(r)}${h})`,A.output=$.output,A.globstar=!0,O(y+F()),V({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-$.output.length),$.type="globstar",$.output=k(r),$.value+=y,A.output+=$.output,A.globstar=!0,O(y);continue}let Ee={type:"star",value:y,output:N};if(r.bash===!0){Ee.output=".*?",($.type==="bos"||$.type==="slash")&&(Ee.output=B+Ee.output),V(Ee);continue}if($&&($.type==="bracket"||$.type==="paren")&&r.regex===!0){Ee.output=y,V(Ee);continue}(A.index===A.start||$.type==="slash"||$.type==="dot")&&($.type==="dot"?(A.output+=C,$.output+=C):r.dot===!0?(A.output+=E,$.output+=E):(A.output+=B,$.output+=B),w()!=="*"&&(A.output+=m,$.output+=m)),V(Ee)}for(;A.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(oa("closing","]"));A.output=Yt.escapeLast(A.output,"["),ee("brackets")}for(;A.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(oa("closing",")"));A.output=Yt.escapeLast(A.output,"("),ee("parens")}for(;A.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(oa("closing","}"));A.output=Yt.escapeLast(A.output,"{"),ee("braces")}if(r.strictSlashes!==!0&&($.type==="star"||$.type==="bracket")&&V({type:"maybe_slash",value:"",output:`${h}?`}),A.backtrack===!0){A.output="";for(let z of A.tokens)A.output+=z.output!=null?z.output:z.value,z.suffix&&(A.output+=z.suffix)}return A};Rg.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Kl,r.maxLength):Kl,o=t.length;if(o>n)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);t=VS[t]||t;let i=Yt.isWindows(e),{DOT_LITERAL:a,SLASH_LITERAL:s,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:f,NO_DOTS_SLASH:d,STAR:h,START_ANCHOR:m}=Wl.globChars(i),b=r.dot?f:l,D=r.dot?d:l,C=r.capture?"":"?:",E={negated:!1,prefix:""},g=r.bash===!0?".*?":h;r.capture&&(g=`(${g})`);let _=B=>B.noglobstar===!0?g:`(${C}(?:(?!${m}${B.dot?c:a}).)*?)`,S=B=>{switch(B){case"*":return`${b}${u}${g}`;case".*":return`${a}${u}${g}`;case"*.*":return`${b}${g}${a}${u}${g}`;case"*/*":return`${b}${g}${s}${u}${D}${g}`;case"**":return b+_(r);case"**/*":return`(?:${b}${_(r)}${s})?${D}${u}${g}`;case"**/*.*":return`(?:${b}${_(r)}${s})?${D}${g}${a}${u}${g}`;case"**/.*":return`(?:${b}${_(r)}${s})?${a}${u}${g}`;default:{let R=/^(.*?)\.(\w+)$/.exec(B);if(!R)return;let N=S(R[1]);return N?N+a+R[2]:void 0}}},P=Yt.removePrefix(t,E),k=S(P);return k&&r.strictSlashes!==!0&&(k+=`${s}?`),k};zS.exports=Rg});var KS=x((MY,WS)=>{"use strict";var AM=require("path"),OM=HS(),Bg=GS(),jg=ks(),kM=Os(),$M=t=>t&&typeof t=="object"&&!Array.isArray(t),Ze=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(d=>Ze(d,e,r));return d=>{for(let h of l){let m=h(d);if(m)return m}return!1}}let n=$M(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},i=jg.isWindows(e),a=n?Ze.compileRe(t,e):Ze.makeRe(t,e,!1,!0),s=a.state;delete a.state;let u=()=>!1;if(o.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};u=Ze(o.ignore,l,r)}let c=(l,f=!1)=>{let{isMatch:d,match:h,output:m}=Ze.test(l,a,e,{glob:t,posix:i}),b={glob:t,state:s,regex:a,posix:i,input:l,output:m,match:h,isMatch:d};return typeof o.onResult=="function"&&o.onResult(b),d===!1?(b.isMatch=!1,f?b:!1):u(l)?(typeof o.onIgnore=="function"&&o.onIgnore(b),b.isMatch=!1,f?b:!1):(typeof o.onMatch=="function"&&o.onMatch(b),f?b:!0)};return r&&(c.state=s),c};Ze.test=(t,e,r,{glob:n,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let i=r||{},a=i.format||(o?jg.toPosixSlashes:null),s=t===n,u=s&&a?a(t):t;return s===!1&&(u=a?a(t):t,s=u===n),(s===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?s=Ze.matchBase(t,e,r,o):s=e.exec(u)),{isMatch:!!s,match:s,output:u}};Ze.matchBase=(t,e,r,n=jg.isWindows(r))=>(e instanceof RegExp?e:Ze.makeRe(e,r)).test(AM.basename(t));Ze.isMatch=(t,e,r)=>Ze(e,r)(t);Ze.parse=(t,e)=>Array.isArray(t)?t.map(r=>Ze.parse(r,e)):Bg(t,{...e,fastpaths:!1});Ze.scan=(t,e)=>OM(t,e);Ze.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let o=e||{},i=o.contains?"":"^",a=o.contains?"":"$",s=`${i}(?:${t.output})${a}`;t&&t.negated===!0&&(s=`^(?!${s}).*$`);let u=Ze.toRegex(s,e);return n===!0&&(u.state=t),u};Ze.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=Bg.fastpaths(t,e)),o.output||(o=Bg(t,e)),Ze.compileRe(o,e,r,n)};Ze.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Ze.constants=kM;WS.exports=Ze});var JS=x((qY,YS)=>{"use strict";YS.exports=KS()});var rF=x((HY,tF)=>{"use strict";var ZS=require("util"),QS=kS(),Lr=JS(),Ng=ks(),XS=t=>t===""||t==="./",eF=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},je=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,o=new Set,i=new Set,a=0,s=l=>{i.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<e.length;l++){let f=Lr(String(e[l]),{...r,onResult:s},!0),d=f.state.negated||f.state.negatedExtglob;d&&a++;for(let h of t){let m=f(h,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),o.add(m.output)))}}let c=(a===e.length?[...i]:[...o]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return c};je.match=je;je.matcher=(t,e)=>Lr(t,e);je.isMatch=(t,e,r)=>Lr(e,r)(t);je.any=je.isMatch;je.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,o=[],i=s=>{r.onResult&&r.onResult(s),o.push(s.output)},a=new Set(je(t,e,{...r,onResult:i}));for(let s of o)a.has(s)||n.add(s);return[...n]};je.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${ZS.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>je.contains(t,n,r));if(typeof e=="string"){if(XS(t)||XS(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return je.isMatch(t,e,{...r,contains:!0})};je.matchKeys=(t,e,r)=>{if(!Ng.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=je(Object.keys(t),e,r),o={};for(let i of n)o[i]=t[i];return o};je.some=(t,e,r)=>{let n=[].concat(t);for(let o of[].concat(e)){let i=Lr(String(o),r);if(n.some(a=>i(a)))return!0}return!1};je.every=(t,e,r)=>{let n=[].concat(t);for(let o of[].concat(e)){let i=Lr(String(o),r);if(!n.every(a=>i(a)))return!1}return!0};je.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${ZS.inspect(t)}"`);return[].concat(e).every(n=>Lr(n,r)(t))};je.capture=(t,e,r)=>{let n=Ng.isWindows(r),i=Lr.makeRe(String(t),{...r,capture:!0}).exec(n?Ng.toPosixSlashes(e):e);if(i)return i.slice(1).map(a=>a===void 0?"":a)};je.makeRe=(...t)=>Lr.makeRe(...t);je.scan=(...t)=>Lr.scan(...t);je.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let o of QS(String(n),e))r.push(Lr.parse(o,e));return r};je.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!eF(t)?[t]:QS(t,e)};je.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return je.braces(t,{...e,expand:!0})};je.hasBraces=eF;tF.exports=je});var MF=x((MJ,cn)=>{var $e=require("fs"),Zl=require("os"),mt=require("path"),_F=require("crypto"),Mr={fs:$e.constants,os:Zl.constants},xF="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",OF=/XXXXXX/,o9=3,kF=(Mr.O_CREAT||Mr.fs.O_CREAT)|(Mr.O_EXCL||Mr.fs.O_EXCL)|(Mr.O_RDWR||Mr.fs.O_RDWR),i9=Zl.platform()==="win32",a9=Mr.EBADF||Mr.os.errno.EBADF,s9=Mr.ENOENT||Mr.os.errno.ENOENT,$F=448,PF=384,u9="exit",aa=[],TF=$e.rmdirSync.bind($e),IF=!1;function c9(t,e){return $e.rm(t,{recursive:!0},e)}function RF(t){return $e.rmSync(t,{recursive:!0})}function zg(t,e){let r=sa(t,e),n=r[0],o=r[1];b9(n,function(i,a){if(i)return o(i);let s=a.tries;(function u(){try{let c=jF(a);$e.stat(c,function(l){if(!l)return s-- >0?u():o(new Error("Could not get a unique tmp filename, max tries reached "+c));o(null,c)})}catch(c){o(c)}})()})}function Gg(t){let e=sa(t),r=e[0],n=v9(r),o=n.tries;do{let i=jF(n);try{$e.statSync(i)}catch{return i}}while(o-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function l9(t,e){let r=sa(t,e),n=r[0],o=r[1];zg(n,function(a,s){if(a)return o(a);$e.open(s,kF,n.mode||PF,function(c,l){if(c)return o(c);if(n.discardDescriptor)return $e.close(l,function(d){return o(d,s,void 0,Hg(s,-1,n,!1))});{let f=n.discardDescriptor||n.detachDescriptor;o(null,s,l,Hg(s,f?-1:l,n,!1))}})})}function f9(t){let e=sa(t),r=e[0],n=r.discardDescriptor||r.detachDescriptor,o=Gg(r),i=$e.openSync(o,kF,r.mode||PF);return r.discardDescriptor&&($e.closeSync(i),i=void 0),{name:o,fd:i,removeCallback:Hg(o,n?-1:i,r,!0)}}function p9(t,e){let r=sa(t,e),n=r[0],o=r[1];zg(n,function(a,s){if(a)return o(a);$e.mkdir(s,n.mode||$F,function(c){if(c)return o(c);o(null,s,BF(s,n,!1))})})}function d9(t){let e=sa(t),r=e[0],n=Gg(r);return $e.mkdirSync(n,r.mode||$F),{name:n,removeCallback:BF(n,r,!0)}}function h9(t,e){let r=function(n){if(n&&!Vg(n))return e(n);e()};0<=t[0]?$e.close(t[0],function(){$e.unlink(t[1],r)}):$e.unlink(t[1],r)}function m9(t){let e=null;try{0<=t[0]&&$e.closeSync(t[0])}catch(r){if(!w9(r)&&!Vg(r))throw r}finally{try{$e.unlinkSync(t[1])}catch(r){Vg(r)||(e=r)}}if(e!==null)throw e}function Hg(t,e,r,n){let o=Xl(m9,[e,t],n),i=Xl(h9,[e,t],n,o);return r.keep||aa.unshift(o),n?o:i}function BF(t,e,r){let n=e.unsafeCleanup?c9:$e.rmdir.bind($e),o=e.unsafeCleanup?RF:TF,i=Xl(o,t,r),a=Xl(n,t,r,i);return e.keep||aa.unshift(i),r?i:a}function Xl(t,e,r,n){let o=!1;return function i(a){if(!o){let s=n||i,u=aa.indexOf(s);return u>=0&&aa.splice(u,1),o=!0,r||t===TF||t===RF?t(e):t(e,a||function(){})}}}function g9(){if(IF)for(;aa.length;)try{aa[0]()}catch{}}function SF(t){let e=[],r=null;try{r=_F.randomBytes(t)}catch{r=_F.pseudoRandomBytes(t)}for(let n=0;n<t;n++)e.push(xF[r[n]%xF.length]);return e.join("")}function Jt(t){return typeof t>"u"}function sa(t,e){if(typeof t=="function")return[{},t];if(Jt(t))return[{},e];let r={};for(let n of Object.getOwnPropertyNames(t))r[n]=t[n];return[r,e]}function D9(t,e,r){let n=mt.isAbsolute(t)?t:mt.join(e,t);$e.stat(n,function(o){o?$e.realpath(mt.dirname(n),function(i,a){if(i)return r(i);r(null,mt.join(a,mt.basename(n)))}):$e.realpath(n,r)})}function y9(t,e){let r=mt.isAbsolute(t)?t:mt.join(e,t);try{return $e.statSync(r),$e.realpathSync(r)}catch{let o=$e.realpathSync(mt.dirname(r));return mt.join(o,mt.basename(r))}}function jF(t){let e=t.tmpdir;if(!Jt(t.name))return mt.join(e,t.dir,t.name);if(!Jt(t.template))return mt.join(e,t.dir,t.template).replace(OF,SF(6));let r=[t.prefix?t.prefix:"tmp","-",process.pid,"-",SF(12),t.postfix?"-"+t.postfix:""].join("");return mt.join(e,t.dir,r)}function NF(t){if(!Jt(t.name)){let e=t.name;if(mt.isAbsolute(e))throw new Error(`name option must not contain an absolute path, found "${e}".`);let r=mt.basename(e);if(r===".."||r==="."||r!==e)throw new Error(`name option must not contain a path, found "${e}".`)}if(!Jt(t.template)&&!t.template.match(OF))throw new Error(`Invalid template, found "${t.template}".`);if(!Jt(t.tries)&&isNaN(t.tries)||t.tries<0)throw new Error(`Invalid tries, found "${t.tries}".`);t.tries=Jt(t.name)?t.tries||o9:1,t.keep=!!t.keep,t.detachDescriptor=!!t.detachDescriptor,t.discardDescriptor=!!t.discardDescriptor,t.unsafeCleanup=!!t.unsafeCleanup,t.prefix=Jt(t.prefix)?"":t.prefix,t.postfix=Jt(t.postfix)?"":t.postfix}function FF(t,e,r,n){if(Jt(e))return n(null);D9(e,r,function(o,i){if(o)return n(o);let a=mt.relative(r,i);if(!i.startsWith(r))return n(new Error(`${t} option must be relative to "${r}", found "${a}".`));n(null,a)})}function AF(t,e,r){if(Jt(e))return;let n=y9(e,r),o=mt.relative(r,n);if(!n.startsWith(r))throw new Error(`${t} option must be relative to "${r}", found "${o}".`);return o}function b9(t,e){E9(t,function(r,n){if(r)return e(r);t.tmpdir=n;try{NF(t,n)}catch(o){return e(o)}FF("dir",t.dir,n,function(o,i){if(o)return e(o);t.dir=Jt(i)?"":i,FF("template",t.template,n,function(a,s){if(a)return e(a);t.template=s,e(null,t)})})})}function v9(t){let e=t.tmpdir=UF(t);NF(t,e);let r=AF("dir",t.dir,e);return t.dir=Jt(r)?"":r,t.template=AF("template",t.template,e),t}function w9(t){return LF(t,-a9,"EBADF")}function Vg(t){return LF(t,-s9,"ENOENT")}function LF(t,e,r){return i9?t.code===r:t.code===r&&t.errno===e}function C9(){IF=!0}function E9(t,e){return $e.realpath(t&&t.tmpdir||Zl.tmpdir(),e)}function UF(t){return $e.realpathSync(t&&t.tmpdir||Zl.tmpdir())}process.addListener(u9,g9);Object.defineProperty(cn.exports,"tmpdir",{enumerable:!0,configurable:!1,get:function(){return UF()}});cn.exports.dir=p9;cn.exports.dirSync=d9;cn.exports.file=l9;cn.exports.fileSync=f9;cn.exports.tmpName=zg;cn.exports.tmpNameSync=Gg;cn.exports.setGracefulCleanup=C9});var tf=require("node:process");var mD=ge(hD(),1),{program:ft,createCommand:n7,createArgument:o7,createOption:i7,CommanderError:a7,InvalidArgumentError:s7,InvalidOptionArgumentError:u7,Command:c7,Argument:l7,Option:f7,Help:p7}=mD.default;var hr={name:"@capgo/cli",version:"7.26.1",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#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","sdk"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js",require:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",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","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload"},devDependencies:{"@antfu/eslint-config":"^6.1.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.4","@capacitor/cli":"^7.4.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^0.11.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.6","@supabase/supabase-js":"^2.79.0","@types/adm-zip":"^0.5.7","@types/node":"^24.9.1","@types/prettyjson":"^0.0.33","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",esbuild:"^0.25.11",eslint:"^9.38.0","git-format-staged":"3.1.1",husky:"^9.1.7","is-wsl":"^3.1.0",open:"^10.1.2",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3"}};var Zi=require("node:fs");var gt=ge(Ef(),1),Bo=require("node:process"),fn=ge(require("node:readline"),1),Af=ge(require("node:readline"),1),SD=require("node:stream"),FD=ge(xf(),1);function _A({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var xA=_A();function AD(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(xA,"")}function OD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kD={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var o=n.charCodeAt(0),i=n.length==2?n.charCodeAt(1):0,a=o;return 55296<=o&&o<=56319&&56320<=i&&i<=57343&&(o&=1023,i&=1023,a=o<<10|i,a+=65536),a==12288||65281<=a&&a<=65376||65504<=a&&a<=65510?"F":a==8361||65377<=a&&a<=65470||65474<=a&&a<=65479||65482<=a&&a<=65487||65490<=a&&a<=65495||65498<=a&&a<=65500||65512<=a&&a<=65518?"H":4352<=a&&a<=4447||4515<=a&&a<=4519||4602<=a&&a<=4607||9001<=a&&a<=9002||11904<=a&&a<=11929||11931<=a&&a<=12019||12032<=a&&a<=12245||12272<=a&&a<=12283||12289<=a&&a<=12350||12353<=a&&a<=12438||12441<=a&&a<=12543||12549<=a&&a<=12589||12593<=a&&a<=12686||12688<=a&&a<=12730||12736<=a&&a<=12771||12784<=a&&a<=12830||12832<=a&&a<=12871||12880<=a&&a<=13054||13056<=a&&a<=19903||19968<=a&&a<=42124||42128<=a&&a<=42182||43360<=a&&a<=43388||44032<=a&&a<=55203||55216<=a&&a<=55238||55243<=a&&a<=55291||63744<=a&&a<=64255||65040<=a&&a<=65049||65072<=a&&a<=65106||65108<=a&&a<=65126||65128<=a&&a<=65131||110592<=a&&a<=110593||127488<=a&&a<=127490||127504<=a&&a<=127546||127552<=a&&a<=127560||127568<=a&&a<=127569||131072<=a&&a<=194367||177984<=a&&a<=196605||196608<=a&&a<=262141?"W":32<=a&&a<=126||162<=a&&a<=163||165<=a&&a<=166||a==172||a==175||10214<=a&&a<=10221||10629<=a&&a<=10630?"Na":a==161||a==164||167<=a&&a<=168||a==170||173<=a&&a<=174||176<=a&&a<=180||182<=a&&a<=186||188<=a&&a<=191||a==198||a==208||215<=a&&a<=216||222<=a&&a<=225||a==230||232<=a&&a<=234||236<=a&&a<=237||a==240||242<=a&&a<=243||247<=a&&a<=250||a==252||a==254||a==257||a==273||a==275||a==283||294<=a&&a<=295||a==299||305<=a&&a<=307||a==312||319<=a&&a<=322||a==324||328<=a&&a<=331||a==333||338<=a&&a<=339||358<=a&&a<=359||a==363||a==462||a==464||a==466||a==468||a==470||a==472||a==474||a==476||a==593||a==609||a==708||a==711||713<=a&&a<=715||a==717||a==720||728<=a&&a<=731||a==733||a==735||768<=a&&a<=879||913<=a&&a<=929||931<=a&&a<=937||945<=a&&a<=961||963<=a&&a<=969||a==1025||1040<=a&&a<=1103||a==1105||a==8208||8211<=a&&a<=8214||8216<=a&&a<=8217||8220<=a&&a<=8221||8224<=a&&a<=8226||8228<=a&&a<=8231||a==8240||8242<=a&&a<=8243||a==8245||a==8251||a==8254||a==8308||a==8319||8321<=a&&a<=8324||a==8364||a==8451||a==8453||a==8457||a==8467||a==8470||8481<=a&&a<=8482||a==8486||a==8491||8531<=a&&a<=8532||8539<=a&&a<=8542||8544<=a&&a<=8555||8560<=a&&a<=8569||a==8585||8592<=a&&a<=8601||8632<=a&&a<=8633||a==8658||a==8660||a==8679||a==8704||8706<=a&&a<=8707||8711<=a&&a<=8712||a==8715||a==8719||a==8721||a==8725||a==8730||8733<=a&&a<=8736||a==8739||a==8741||8743<=a&&a<=8748||a==8750||8756<=a&&a<=8759||8764<=a&&a<=8765||a==8776||a==8780||a==8786||8800<=a&&a<=8801||8804<=a&&a<=8807||8810<=a&&a<=8811||8814<=a&&a<=8815||8834<=a&&a<=8835||8838<=a&&a<=8839||a==8853||a==8857||a==8869||a==8895||a==8978||9312<=a&&a<=9449||9451<=a&&a<=9547||9552<=a&&a<=9587||9600<=a&&a<=9615||9618<=a&&a<=9621||9632<=a&&a<=9633||9635<=a&&a<=9641||9650<=a&&a<=9651||9654<=a&&a<=9655||9660<=a&&a<=9661||9664<=a&&a<=9665||9670<=a&&a<=9672||a==9675||9678<=a&&a<=9681||9698<=a&&a<=9701||a==9711||9733<=a&&a<=9734||a==9737||9742<=a&&a<=9743||9748<=a&&a<=9749||a==9756||a==9758||a==9792||a==9794||9824<=a&&a<=9825||9827<=a&&a<=9829||9831<=a&&a<=9834||9836<=a&&a<=9837||a==9839||9886<=a&&a<=9887||9918<=a&&a<=9919||9924<=a&&a<=9933||9935<=a&&a<=9953||a==9955||9960<=a&&a<=9983||a==10045||a==10071||10102<=a&&a<=10111||11093<=a&&a<=11097||12872<=a&&a<=12879||57344<=a&&a<=63743||65024<=a&&a<=65039||a==65533||127232<=a&&a<=127242||127248<=a&&a<=127277||127280<=a&&a<=127337||127344<=a&&a<=127386||917760<=a&&a<=917999||983040<=a&&a<=1048573||1048576<=a&&a<=1114109?"A":"N"},e.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var o=r(n),i=0,a=0;a<o.length;a++)i=i+this.characterLength(o[a]);return i},e.slice=function(n,o,i){textLen=e.length(n),o=o||0,i=i||1,o<0&&(o=textLen+o),i<0&&(i=textLen+i);for(var a="",s=0,u=r(n),c=0;c<u.length;c++){var l=u[c],f=e.length(l);if(s>=o-(f==2?1:0))if(s+f<=i)a+=l;else break;s+=f}return a}})(kD);var SA=kD.exports,FA=OD(SA),AA=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},OA=OD(AA);function fa(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=AD(t),t.length===0))return 0;t=t.replace(OA()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let o of t){let i=o.codePointAt(0);if(!(i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(FA.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Sf=10,bD=(t=0)=>e=>`\x1B[${e+t}m`,vD=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,wD=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ne={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(Ne.modifier);var kA=Object.keys(Ne.color),$A=Object.keys(Ne.bgColor);[...kA,...$A];function PA(){let t=new Map;for(let[e,r]of Object.entries(Ne)){for(let[n,o]of Object.entries(r))Ne[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=Ne[n],t.set(o[0],o[1]);Object.defineProperty(Ne,e,{value:r,enumerable:!1})}return Object.defineProperty(Ne,"codes",{value:t,enumerable:!1}),Ne.color.close="\x1B[39m",Ne.bgColor.close="\x1B[49m",Ne.color.ansi=bD(),Ne.color.ansi256=vD(),Ne.color.ansi16m=wD(),Ne.bgColor.ansi=bD(Sf),Ne.bgColor.ansi256=vD(Sf),Ne.bgColor.ansi16m=wD(Sf),Object.defineProperties(Ne,{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(i=>i+i).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:e=>Ne.rgbToAnsi256(...Ne.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let s=e%36;r=Math.floor(e/36)/5,n=Math.floor(s/6)/5,o=s%6/5}let i=Math.max(r,n,o)*2;if(i===0)return 30;let a=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ne.ansi256ToAnsi(Ne.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ne.ansi256ToAnsi(Ne.hexToAnsi256(e)),enumerable:!1}}),Ne}var TA=PA(),Ks=new Set(["\x1B","\x9B"]),IA=39,kf="\x07",$D="[",RA="]",PD="m",$f=`${RA}8;;`,CD=t=>`${Ks.values().next().value}${$D}${t}${PD}`,ED=t=>`${Ks.values().next().value}${$f}${t}${kf}`,BA=t=>t.split(" ").map(e=>fa(e)),Ff=(t,e,r)=>{let n=[...e],o=!1,i=!1,a=fa(AD(t[t.length-1]));for(let[s,u]of n.entries()){let c=fa(u);if(a+c<=r?t[t.length-1]+=u:(t.push(u),a=0),Ks.has(u)&&(o=!0,i=n.slice(s+1).join("").startsWith($f)),o){i?u===kf&&(o=!1,i=!1):u===PD&&(o=!1);continue}a+=c,a===r&&s<n.length-1&&(t.push(""),a=0)}!a&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},jA=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(fa(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},NA=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,i,a=BA(t),s=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let f=fa(s[s.length-1]);if(c!==0&&(f>=e&&(r.wordWrap===!1||r.trim===!1)&&(s.push(""),f=0),(f>0||r.trim===!1)&&(s[s.length-1]+=" ",f++)),r.hard&&a[c]>e){let d=e-f,h=1+Math.floor((a[c]-d-1)/e);Math.floor((a[c]-1)/e)<h&&s.push(""),Ff(s,l,e);continue}if(f+a[c]>e&&f>0&&a[c]>0){if(r.wordWrap===!1&&f<e){Ff(s,l,e);continue}s.push("")}if(f+a[c]>e&&r.wordWrap===!1){Ff(s,l,e);continue}s[s.length-1]+=l}r.trim!==!1&&(s=s.map(c=>jA(c)));let u=[...s.join(`
|
|
105
105
|
`)];for(let[c,l]of u.entries()){if(n+=l,Ks.has(l)){let{groups:d}=new RegExp(`(?:\\${$D}(?<code>\\d+)m|\\${$f}(?<uri>.*)${kf})`).exec(u.slice(c).join(""))||{groups:{}};if(d.code!==void 0){let h=Number.parseFloat(d.code);o=h===IA?void 0:h}else d.uri!==void 0&&(i=d.uri.length===0?void 0:d.uri)}let f=TA.codes.get(Number(o));u[c+1]===`
|
|
106
106
|
`?(i&&(n+=ED("")),o&&f&&(n+=CD(f))):l===`
|
|
107
107
|
`&&(o&&f&&(n+=CD(o)),i&&(n+=ED(i)))}return n};function _D(t,e,r){return String(t).normalize().replace(/\r\n/g,`
|
|
@@ -144,9 +144,9 @@ ${G.default.gray(jo)} ${t}
|
|
|
144
144
|
`)}
|
|
145
145
|
`)},info:t=>{p.message(t,{symbol:G.default.blue(JA)})},success:t=>{p.message(t,{symbol:G.default.green(XA)})},step:t=>{p.message(t,{symbol:G.default.green(Bf)})},warn:t=>{p.message(t,{symbol:G.default.yellow(ZA)})},warning:t=>{p.warn(t)},error:t=>{p.message(t,{symbol:G.default.red(QA)})}},P7=`${G.default.gray(qe)} `;var we=({indicator:t="dots"}={})=>{let e=Tf?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=Tf?80:120,n=process.env.CI==="true",o,i,a=!1,s="",u,c=performance.now(),l=_=>{let S=_>1?"Something went wrong":"Canceled";a&&g(S,_)},f=()=>l(2),d=()=>l(1),h=()=>{process.on("uncaughtExceptionMonitor",f),process.on("unhandledRejection",f),process.on("SIGINT",d),process.on("SIGTERM",d),process.on("exit",l)},m=()=>{process.removeListener("uncaughtExceptionMonitor",f),process.removeListener("unhandledRejection",f),process.removeListener("SIGINT",d),process.removeListener("SIGTERM",d),process.removeListener("exit",l)},b=()=>{if(u===void 0)return;n&&process.stdout.write(`
|
|
146
146
|
`);let _=u.split(`
|
|
147
|
-
`);process.stdout.write(Ys.cursor.move(-999,_.length-1)),process.stdout.write(Ys.erase.down(_.length))},D=_=>_.replace(/\.+$/,""),C=_=>{let S=(performance.now()-_)/1e3,
|
|
148
|
-
`);let S=0,
|
|
149
|
-
`):process.stdout.write(`${
|
|
147
|
+
`);process.stdout.write(Ys.cursor.move(-999,_.length-1)),process.stdout.write(Ys.erase.down(_.length))},D=_=>_.replace(/\.+$/,""),C=_=>{let S=(performance.now()-_)/1e3,P=Math.floor(S/60),k=Math.floor(S%60);return P>0?`[${P}m ${k}s]`:`[${k}s]`},E=(_="")=>{a=!0,o=TD(),s=D(_),c=performance.now(),process.stdout.write(`${G.default.gray(qe)}
|
|
148
|
+
`);let S=0,P=0;h(),i=setInterval(()=>{if(n&&s===u)return;b(),u=s;let k=G.default.magenta(e[S]);if(n)process.stdout.write(`${k} ${s}...`);else if(t==="timer")process.stdout.write(`${k} ${s} ${C(c)}`);else{let B=".".repeat(Math.floor(P)).slice(0,3);process.stdout.write(`${k} ${s}${B}`)}S=S+1<e.length?S+1:0,P=P<e.length?P+.125:0},r)},g=(_="",S=0)=>{a=!1,clearInterval(i),b();let P=S===0?G.default.green(Bf):S===1?G.default.red(ID):G.default.red(RD);s=D(_??s),t==="timer"?process.stdout.write(`${P} ${s} ${C(c)}
|
|
149
|
+
`):process.stdout.write(`${P} ${s}
|
|
150
150
|
`),m(),o()};return{start:E,stop:g,message:(_="")=>{s=D(_??s)}}};var V1=require("node:child_process"),ke=require("node:fs"),wl=require("node:os"),Fe=ge(require("node:path")),zt=require("node:process"),Ir=ge(Xs());var Ct=require("fs"),ha=(t=".",e="unknown")=>{let r=`${t}/bun.lockb`,n=`${t}/bun.lock`,o=`${t}/pnpm-lock.yaml`,i=`${t}/shrinkwrap.yaml`,a=`${t}/yarn.lock`,s=`${t}/package-lock.json`,u=`${t}/npm-shrinkwrap.json`;return(0,Ct.existsSync)(r)||(0,Ct.existsSync)(n)?"bun":(0,Ct.existsSync)(o)||(0,Ct.existsSync)(i)?"pnpm":(0,Ct.existsSync)(a)?"yarn":(0,Ct.existsSync)(s)||(0,Ct.existsSync)(u)?"npm":e},Zs=(t=ha(),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"}},BD=(t=".",e="npx")=>{let r=`${t}/bun.lockb`,n=`${t}/bun.lock`,o=`${t}/pnpm-lock.yaml`,i=`${t}/shrinkwrap.yaml`,a=`${t}/yarn.lock`,s=`${t}/package-lock.json`,u=`${t}/npm-shrinkwrap.json`;return(0,Ct.existsSync)(r)||(0,Ct.existsSync)(n)?"bunx":(0,Ct.existsSync)(o)||(0,Ct.existsSync)(i)?"pnpm exec":(0,Ct.existsSync)(a)?"yarn dlx":(0,Ct.existsSync)(s)||(0,Ct.existsSync)(u)?"npx":e};function Qs(t,e){if(isNaN(t)||isNaN(e))throw new Error("Cannot compare against non-numbers");return t===e?0:t<e?-1:1}function LD(t=[],e=[]){return t.length&&!e.length?-1:!t.length&&e.length?1:0}function Mf(t=[],e=[]){let r=Math.max(t.length,e.length);for(let n=0;n<r;n++){let o=t[n],i=e[n];if(o===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(o===void 0)return-1;if(typeof o=="string"&&typeof i=="number")return 1;if(typeof o=="number"&&typeof i=="string"||o<i)return-1;if(o>i)return 1}return 0}var No="0|[1-9]\\d*",oO="\\d*[a-zA-Z-][a-zA-Z0-9-]*",iO=`(?<major>${No})\\.(?<minor>${No})\\.(?<patch>${No})`,jD=`(?:${No}|${oO})`,UD=`(?:-(?<prerelease>${jD}(?:\\.${jD})*))`,ND="[0-9A-Za-z-]+",MD=`(?:\\+(?<buildmetadata>${ND}(?:\\.${ND})*))`,qD=`v?${iO}${UD}?${MD}?`,HD=new RegExp(`^${qD}$`),VD="(?:<|>)?=?",aO="x|X|\\*",Uf=`${No}|${aO}`,eu=`[v=\\s]*(?<major>${Uf})(?:\\.(?<minor>${Uf})(?:\\.(?<patch>${Uf})${UD}?${MD}?)?)?`,zD=new RegExp(`^(?<operator>~>?|\\^|${VD})\\s*${eu}$`),GD=new RegExp(`^(?<operator>${VD})\\s*(${qD})$|^$`);function qf(t){return typeof t=="number"&&!Number.isNaN(t)&&(!Number.isFinite(t)||0<=t&&t<=Number.MAX_SAFE_INTEGER)}var Hf=256;var sO=new RegExp(`^${No}$`);function Et(t){return t.split(".").filter(Boolean).map(e=>{if(sO.test(e)){let r=Number(e);if(qf(r))return r}return e})}function Dr(t){return t.split(".").filter(Boolean)}function dn(t,e){let r=Number(t);if(!qf(r))throw new TypeError(e);return r}function Vr(t){return Number.isNaN(t.major)&&Number.isNaN(t.minor)&&Number.isNaN(t.patch)&&(t.prerelease===void 0||t.prerelease.length===0)&&(t.build===void 0||t.build.length===0)}function _t(t,e){return t===e?0:Qs(t.major,e.major)||Qs(t.minor,e.minor)||Qs(t.patch,e.patch)||LD(t.prerelease,e.prerelease)||Mf(t.prerelease,e.prerelease)}function Vf(t){return t.toFixed(0)}function yr(t){let e=Vf(t.major),r=Vf(t.minor),n=Vf(t.patch),o=t.prerelease?.join(".")??"",i=t.build?.join(".")??"";return[[`${e}.${r}.${n}`,o].filter(u=>u).join("-"),i].filter(u=>u).join("+")}function uO(t,e){if(Vr(e))return!0;let r=_t(t,e);switch(e.operator){case"=":case void 0:return r===0;case"!=":return r!==0;case">":return r>0;case"<":return r<0;case">=":return r>=0;case"<=":return r<=0}}function tu(t,e){for(let r of e)if(!uO(t,r))return!1;if(t.prerelease&&t.prerelease.length>0){for(let r of e){if(Vr(r))continue;let{major:n,minor:o,patch:i,prerelease:a}=r;if(a&&a.length>0&&t.major===n&&t.minor===o&&t.patch===i)return!0}return!1}return!0}function ma(t,e){return e.some(r=>tu(t,r))}function cO(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 ga(t=[],e){let r=cO(t);if(!e)return r;let n=Et(e);if(n.every(o=>typeof o=="string")){if(n.every((o,i)=>o===r[i])&&typeof r[n.length]=="number")return r;n=[...n,0]}return n}function Da(t,e,r={}){let n=r.build!==void 0?Dr(r.build):t.build??[];switch(e){case"premajor":return{major:t.major+1,minor:0,patch:0,prerelease:ga(t.prerelease,r.prerelease),build:n};case"preminor":return{major:t.major,minor:t.minor+1,patch:0,prerelease:ga(t.prerelease,r.prerelease),build:n};case"prepatch":return{major:t.major,minor:t.minor,patch:t.patch+1,prerelease:ga(t.prerelease,r.prerelease),build:n};case"prerelease":{let i=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:i,prerelease:ga(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 i=(t.prerelease??[]).length===0||t.patch!==0?t.minor+1:t.minor;return{major:t.major,minor:i,patch:0,prerelease:[],build:n}}case"patch":{let i=(t.prerelease??[]).length===0?t.patch+1:t.patch;return{major:t.major,minor:t.minor,patch:i,prerelease:[],build:n}}case"pre":return{major:t.major,minor:t.minor,patch:t.patch,prerelease:ga(t.prerelease,r.prerelease),build:n};default:throw new TypeError(`Cannot increment version: invalid argument ${e}`)}}var ru={major:Number.NaN,minor:Number.NaN,patch:Number.NaN,prerelease:[],build:[]},Lo={operator:void 0,...ru};function zf(t,e){return _t(t,e)>0}function qn(t,e){return _t(t,e)<0}function lO(t){let r=t.match(GD)?.groups;if(!r)return null;let{operator:n,prerelease:o,buildmetadata:i}=r,a=r.major?{major:dn(r.major,`Cannot parse comparator ${t}: invalid major version`),minor:dn(r.minor,`Cannot parse comparator ${t}: invalid minor version`),patch:dn(r.patch,`Cannot parse comparator ${t}: invalid patch version`),prerelease:o?Et(o):[],build:i?Dr(i):[]}:ru;return{operator:n||void 0,...a}}function Te(t){return!t||t.toLowerCase()==="x"||t==="*"}function fO(t){if(!Te(t.major))return Te(t.minor)?{operator:">=",major:+t.major,minor:0,patch:0,prerelease:[],build:[]}:Te(t.patch)?{operator:">=",major:+t.major,minor:+t.minor,patch:0,prerelease:[],build:[]}:{operator:">=",major:+t.major,minor:+t.minor,patch:+t.patch,prerelease:t.prerelease?Et(t.prerelease):[],build:[]}}function pO(t){if(!Te(t.major))return Te(t.minor)?{operator:"<",major:+t.major+1,minor:0,patch:0,prerelease:[],build:[]}:Te(t.patch)?{operator:"<",major:+t.major,minor:+t.minor+1,patch:0,prerelease:[],build:[]}:t.prerelease?{operator:"<=",major:+t.major,minor:+t.minor,patch:+t.patch,prerelease:Et(t.prerelease),build:[]}:{operator:"<=",major:+t.major,minor:+t.minor,patch:+t.patch,prerelease:[],build:[]}}function dO(t){let e=t.match(new RegExp(`^${eu}`)),r=e?.groups;if(!r)return null;let n=e[0].length,o=t.slice(n).match(/^\s+-\s+/);if(!o)return null;let i=o[0].length,s=t.slice(n+i).match(new RegExp(`^${eu}\\s*$`))?.groups;if(!s)return null;let u=fO(r),c=pO(s);return[u,c].filter(Boolean)}function hO(t){let e=Te(t.major),r=Te(t.minor),n=Te(t.patch),o=+t.major,i=+t.minor,a=+t.patch;if(e)return[Lo];if(r)return[{operator:">=",major:o,minor:0,patch:0},{operator:"<",major:o+1,minor:0,patch:0}];if(n)return o===0?[{operator:">=",major:o,minor:i,patch:0},{operator:"<",major:o,minor:i+1,patch:0}]:[{operator:">=",major:o,minor:i,patch:0},{operator:"<",major:o+1,minor:0,patch:0}];let s=Et(t.prerelease??"");return o===0?i===0?[{operator:">=",major:o,minor:i,patch:a,prerelease:s},{operator:"<",major:o,minor:i,patch:a+1}]:[{operator:">=",major:o,minor:i,patch:a,prerelease:s},{operator:"<",major:o,minor:i+1,patch:0}]:[{operator:">=",major:o,minor:i,patch:a,prerelease:s},{operator:"<",major:o+1,minor:0,patch:0}]}function mO(t){let e=Te(t.major),r=Te(t.minor),n=Te(t.patch),o=+t.major,i=+t.minor,a=+t.patch;if(e)return[Lo];if(r)return[{operator:">=",major:o,minor:0,patch:0},{operator:"<",major:o+1,minor:0,patch:0}];if(n)return[{operator:">=",major:o,minor:i,patch:0},{operator:"<",major:o,minor:i+1,patch:0}];let s=Et(t.prerelease??"");return[{operator:">=",major:o,minor:i,patch:a,prerelease:s},{operator:"<",major:o,minor:i+1,patch:0}]}function gO(t){let e=Te(t.major),r=Te(t.minor),n=Te(t.patch),o=+t.major,i=+t.minor,a=+t.patch;if(e)return[{operator:"<",major:0,minor:0,patch:0}];if(r)return n?[{operator:"<",major:o,minor:0,patch:0}]:[{operator:"<",major:o,minor:0,patch:0}];if(n)return[{operator:"<",major:o,minor:i,patch:0}];let s=Et(t.prerelease??""),u=Dr(t.build??"");return[{operator:"<",major:o,minor:i,patch:a,prerelease:s,build:u}]}function DO(t){let e=Te(t.minor),r=Te(t.patch),n=+t.major,o=+t.minor,i=+t.patch;if(e)return r?[{operator:"<",major:n+1,minor:0,patch:0}]:[{operator:"<",major:n,minor:o+1,patch:0}];if(r)return[{operator:"<",major:n,minor:o+1,patch:0}];let a=Et(t.prerelease??""),s=Dr(t.build??"");return[{operator:"<=",major:n,minor:o,patch:i,prerelease:a,build:s}]}function yO(t){let e=Te(t.major),r=Te(t.minor),n=Te(t.patch),o=+t.major,i=+t.minor,a=+t.patch;if(e)return[{operator:"<",major:0,minor:0,patch:0}];if(r)return[{operator:">=",major:o+1,minor:0,patch:0}];if(n)return[{operator:">=",major:o,minor:i+1,patch:0}];let s=Et(t.prerelease??""),u=Dr(t.build??"");return[{operator:">",major:o,minor:i,patch:a,prerelease:s,build:u}]}function bO(t){let e=Te(t.major),r=Te(t.minor),n=Te(t.patch),o=+t.major,i=+t.minor,a=+t.patch;if(e)return[Lo];if(r)return n?[{operator:">=",major:o,minor:0,patch:0}]:[{operator:">=",major:o,minor:0,patch:0}];if(n)return[{operator:">=",major:o,minor:i,patch:0}];let s=Et(t.prerelease??""),u=Dr(t.build??"");return[{operator:">=",major:o,minor:i,patch:a,prerelease:s,build:u}]}function vO(t){let e=Te(t.major),r=Te(t.minor),n=Te(t.patch),o=+t.major,i=+t.minor,a=+t.patch;if(e)return[Lo];if(r)return[{operator:">=",major:o,minor:0,patch:0},{operator:"<",major:o+1,minor:0,patch:0}];if(n)return[{operator:">=",major:o,minor:i,patch:0},{operator:"<",major:o,minor:i+1,patch:0}];let s=Et(t.prerelease??""),u=Dr(t.build??"");return[{operator:void 0,major:o,minor:i,patch:a,prerelease:s,build:u}]}function wO(t){let e=t.match(zD)?.groups;if(!e)return lO(t);switch(e.operator){case"^":return hO(e);case"~":case"~>":return mO(e);case"<":return gO(e);case"<=":return DO(e);case">":return yO(e);case">=":return bO(e);case"=":case"":return vO(e);default:throw new Error(`Cannot parse version range: '${e.operator}' is not a valid operator`)}}function CO(t){return t.split(/\s+/).flatMap(wO)}function nu(t){let e=t.replaceAll(/(?<=<|>|=|~|\^)(\s+)/g,"").split(/\s*\|\|\s*/).map(r=>dO(r)||CO(r));if(e.some(r=>r.includes(null)))throw new TypeError(`Cannot parse version range: range "${t}" is invalid`);return e}function _e(t){if(typeof t!="string")throw new TypeError(`Cannot parse version as version must be a string: received ${typeof t}`);if(t.length>Hf)throw new TypeError(`Cannot parse version as version length is too long: length is ${t.length}, max length is ${Hf}`);t=t.trim();let e=t.match(HD)?.groups;if(!e)throw new TypeError(`Cannot parse version: ${t}`);let r=dn(e.major,`Cannot parse version ${t}: invalid major version`),n=dn(e.minor,`Cannot parse version ${t}: invalid minor version`),o=dn(e.patch,`Cannot parse version ${t}: invalid patch version`),i=e.prerelease?Et(e.prerelease):[],a=e.buildmetadata?Dr(e.buildmetadata):[];return{major:r,minor:n,patch:o,prerelease:i,build:a}}function WD(t,e){let r=t.operator,n=e.operator;if(r===void 0)return Vr(t)?!0:ma(t,[[e]]);if(n===void 0)return Vr(e)?!0:ma(e,[[t]]);let o=_t(t,e);return(r===">="||r===">")&&(n===">="||n===">")||(r==="<="||r==="<")&&(n==="<="||n==="<")||o===0&&((r===">="||r==="<=")&&(n===">="||n==="<="))||o===-1&&(r===">="||r===">")&&(n==="<="||n==="<")||o===1&&(r==="<="||r==="<")&&(n===">="||n===">")}function EO(t){return t.every(e=>e.some(r=>_O(r)))}function _O(t){for(let e=0;e<t.length-1;e++){let r=t[e];for(let n of t.slice(e+1))if(!WD(r,n))return!1}return!0}function KD(t,e){return EO([t,e])&&t.some(r=>e.some(n=>r.every(o=>n.every(i=>WD(o,i)))))}function YD(t){try{return _e(t),!0}catch{return!1}}function hn(t,e){return _t(t,e)>=0}var zi=ge(a0()),ng=ge(L0()),z1=ge(gb()),Cl=ge(Uh());function AC(t,e){let n=["normal","bold","dim","italic","underline","strikethrough"].indexOf(t),o="\x1B[";return o+n+"m"+e+o+"0m"}var ot=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 o=0;o<r.length;o++){let i=this.cast(n[o]).length;i>r[o]&&(r[o]=i)}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 o=this.cast(e),i=n?AC("bold",o):o,a=r-o.length,s=this.theme.row[1];switch(typeof e){case"number":return s.repeat(a)+i;case"string":return i+s.repeat(a);case"boolean":case"object":return s.repeat(Math.ceil(a/2))+AC("italic",o)+s.repeat(Math.floor(a/2));default:return s.repeat(a)}}renderRow(e,r=!1){let n=this.theme.row,o=this.columnWidth();return n[0]+e.map((i,a)=>this.renderCell(i,o[a],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(o=>this.renderRow(o)),r||n?this.renderLine(e.bot):""].filter(o=>o.length>0).join(`
|
|
151
151
|
`)}};async function jc(t){try{let r=`https://registry.npmjs.org/${encodeURIComponent(t.toLowerCase())}`,n=await fetch(r,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});return n.ok&&(await n.json())["dist-tags"]?.latest||null}catch{return null}}async function de(){let t=await jc("@capgo/cli")??"",e=t?.split(".")[0];t!==hr.version&&p.warning(`\u{1F6A8} You are using @capgo/cli@${hr.version} it's not the latest version.
|
|
152
152
|
Please use @capgo/cli@${t}" or @capgo/cli@${e} to keep up to date with the latest features and bug fixes.`)}function VR(t){return new Promise(e=>{setTimeout(e,t)})}function zR(t){return new Date(t||"").toLocaleTimeString()}async function or(t,e,r,n,o,i="\u2705"){await be(r,{channel:t,event:n,icon:i,user_id:e,...o?{tags:{"app-id":o}}:{},notify:!1})}async function GR(t,e,r,n){if(De(e))throw await or(t,r,n,"canceled",void 0,"\u{1F937}"),new Error("Command cancelled")}async function WR(t,e,r){try{let n=await ir(),o=r?{...e,rangeStart:r}:{...e},i=await fetch(`${n.hostApi}/private/stats`,{method:"POST",headers:{"Content-Type":"application/json",capgkey:t},body:JSON.stringify(o)});if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);let a=await i.json();if(a?.length>0)return a}catch(n){console.error("Cannot get devices",n),p.error(`Cannot get stats ${L(n)}`)}return[]}function KR(t){let e={get:{summary:()=>"Update request by device. Waiting for download\u2026",level:"info",snag:"done"},delete:{summary:()=>"Bundle deleted on device",level:"info"},set:{summary:()=>"Bundle set on device \u2764\uFE0F",level:"info",snag:"set",stop:!0},NoChannelOrOverride:{summary:()=>"No default channel/override; create it in channel settings",level:"error"},needPlanUpgrade:{summary:({baseUrl:r})=>`Out of quota. Upgrade plan: ${r}/dashboard/settings/plans`,level:"error"},missingBundle:{summary:()=>"Requested bundle not found on server",level:"error"},noNew:{summary:()=>"Device already has latest available version",level:"info"},disablePlatformIos:{summary:()=>"iOS platform disabled in channel",level:"error"},disablePlatformAndroid:{summary:()=>"Android platform disabled in channel",level:"error"},disableAutoUpdate:{summary:()=>"Automatic updates disabled in channel",level:"error"},disableAutoUpdateToMajor:{summary:()=>"Auto-update to major versions disabled",level:"error"},disableAutoUpdateToMinor:{summary:()=>"Auto-update to minor versions disabled",level:"error"},disableAutoUpdateToPatch:{summary:()=>"Auto-update to patch versions disabled",level:"error"},disableAutoUpdateUnderNative:{summary:()=>"Channel update version is lower than device native",level:"error"},disableDevBuild:{summary:()=>"Dev build updates disabled in channel",level:"error"},disableEmulator:{summary:()=>"Emulator updates disabled in channel",level:"error"},cannotGetBundle:{summary:()=>"Cannot retrieve bundle from channel",level:"error"},cannotUpdateViaPrivateChannel:{summary:()=>"No access to private channel",level:"error"},channelMisconfigured:{summary:()=>"Channel configuration invalid or incomplete",level:"error"},disableAutoUpdateMetadata:{summary:()=>"Auto-update on metadata disabled",level:"error"},set_fail:{summary:()=>"Bundle set failed. Possibly corrupted",level:"error"},reset:{summary:()=>"Device reset to builtin bundle",level:"warn"},update_fail:{summary:()=>"Installed bundle failed to call notifyAppReady",level:"error"},checksum_fail:{summary:()=>"Downloaded bundle checksum validation failed",level:"error"},windows_path_fail:{summary:()=>"Bundle contains illegal Windows-style paths",level:"error"},canonical_path_fail:{summary:()=>"Bundle contains non-canonical paths",level:"error"},directory_path_fail:{summary:()=>"Bundle ZIP contains invalid directory paths",level:"error"},unzip_fail:{summary:()=>"Failed to unzip bundle on device",level:"error"},low_mem_fail:{summary:()=>"Download failed due to low device memory",level:"error"},app_moved_to_background:{summary:()=>"App moved to background",level:"info"},app_moved_to_foreground:{summary:()=>"App moved to foreground",level:"info"},decrypt_fail:{summary:()=>"Failed to decrypt downloaded bundle",level:"error"},getChannel:{summary:()=>"Queried current channel on device",level:"info"},setChannel:{summary:()=>"Channel set on device",level:"info"},InvalidIp:{summary:()=>"Device appears in Google datacenter; blocking recent updates (<4h)",level:"warn"},uninstall:{summary:()=>"App uninstalled or Capgo data cleared on device",level:"warn"}};if(t.action.startsWith("download_")){let r=t.action.split("_")[1];return r==="complete"?{summary:()=>"Download complete; relaunch app to apply",level:"info",snag:"downloaded"}:r==="fail"?{summary:()=>"Download failed on device",level:"error"}:{summary:()=>`Downloading ${r}%`,level:"info"}}return e[t.action]||null}async function YR(t,e,r,n,o,i){let a=KR(t);if(!a)return{};a.snag&&await or(e,r,n,a.snag);let s=zR(t.created_at),u=t.action,c=t.version_id?`(version #${t.version_id})`:"",l=t.version?` (version ${t.version})`:c,f=`${a.summary({data:t,baseAppUrl:o,baseUrl:i})}${l}`;return{row:[s,t.device_id,u,f],stop:a.stop}}async function Mh(t,e,r,n,o){let i=!0,a=await ir(),s=`${a.hostWeb}/app/p/${r}`;await or(t,n,e,"Use waitlog",r);let u={appId:r,devicesId:o?[o]:void 0,order:[{key:"created_at",sortable:"desc"}],rangeStart:new Date().toISOString()},c=null,l=new Set,f=we(),d=`${a.host}/docs/plugins/updater/debugging/#sent-from-the-backend`;for(f.start(`Waiting for logs (Expect delay of 30 sec) more info: ${d}`);i;){await VR(5e3);let h=await WR(e,u,c);if(h.length>0){let m=h.reduce((E,g)=>{let _=new Date(g.created_at).getTime();return Math.max(E,_)},c?new Date(c).getTime():0);m>0&&(c=new Date(m).toISOString());let b=h.filter(E=>{let g=`${E.app_id}|${E.device_id}|${E.action}|${E.version_id}|${E.created_at}`;return l.has(g)?!1:(l.add(g),!0)}).sort((E,g)=>new Date(E.created_at).getTime()-new Date(g.created_at).getTime()),D=new ot;D.headers=["Time","Device","Key","Message"],D.theme=ot.roundTheme,D.rows=[];let C=!1;for(let E of b){let{row:g,stop:_}=await YR(E,t,n,e,s,a.hostWeb);g&&D.rows.push(g),_&&(C=!0)}if(D.rows.length&&(f.stop(""),p.info(D.toString()),f.start(`Waiting for logs (Expect delay of 30 sec) more info: ${d}`)),C){i=!1;break}}}return f.stop("Stop watching logs"),Promise.resolve()}async function OC(t,e){Z("Debug Live update in Capgo"),await de(),e.apikey=e.apikey||ie();let r=await te();t=he(t,r?.config);let n=e.device;if(!e.apikey)throw p.error("Missing API key, you need to provide an API key to delete your app"),new Error("Missing API key");if(!t)throw p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let o=await ne(e.apikey,e.supaHost,e.supaAnon),i=await ar(o,t),a=await ye({message:"Automatic check if update working in device ?"});await GR("debug",a,i,e.apikey),a?(p.info(`Wait logs sent to Capgo from ${t} device, Please background your app and open it again \u{1F4AA}`),await Mh("debug",e.apikey,t,i,n),J("Done \u2705")):J("Canceled \u274C")}var qh=require("node:buffer"),kC=require("node:crypto"),JR=(()=>{let t=[];for(let e=0;e<256;e++){let r=e;for(let n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r}return t})();function XR(t){let e=4294967295;for(let r=0;r<t.length;r++){let n=t[r];e=JR[(e^n)&255]^e>>>8}return e=e^4294967295,(e>>>0).toString(16).padStart(8,"0")}async function Xr(t,e="sha256"){let r=qh.Buffer.isBuffer(t)?t:qh.Buffer.from(t);if(e==="crc32")return XR(r);let n=(0,kC.createHash)(e);return n.update(r),n.digest("hex")}var gs=ge(u1());async function c1(){let t=await(0,gs.loadConfig)();return{config:t.app.extConfig,path:t.app.extConfigFilePath}}async function Im(t,e,r=!1){let n=await(0,gs.loadConfig)(),{extConfig:o}=n.app;o&&(o.plugins||(o.plugins={extConfig:{},[t]:{}}),o.plugins[t]||(o.plugins[t]={}),r?o=e.config:o.plugins[t]=e.config.plugins?.[t],(0,gs.writeConfig)(o,n.app.extConfigFilePath))}async function Mi(t,e=!1){await Im("CapacitorUpdater",t,e)}var Gi=".capgo_key",Wt=".capgo_key_v2",El=`${Gi}.pub`,tn=`${Wt}.pub`,N1="https://capgo.app",L1="https://files.capgo.app",U1="https://api.capgo.app",M1="https://console.capgo.app",og=12e4,P5=1024*1024*20,T5=1024*1024*1024,I5=1024*1024*99,Rr="package.json",Wi=/^(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,L=t=>t?`
|
|
@@ -193,19 +193,19 @@ ${L(i)}`),new Error(`Cannot retrieve unknown version for app ${e}: ${L(i)}`)}fun
|
|
|
193
193
|
`)+`
|
|
194
194
|
`,n.join(";").toLowerCase(),o].join(`
|
|
195
195
|
`)}async function W2(t,e,r){let n=await Nl(t),o=yg(r,e);return[xs,Ao(e),o,n].join(`
|
|
196
|
-
`)}async function vg(t,e,r){let n=Dg(t),o=await ko("AWS4"+r,n),i=await ko(o,e),a=await ko(i,"s3");return await ko(a,"aws4_request")}function wg(t,e,r){return`${t}/${yg(e,r)}`}async function ko(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"]),o=await crypto.subtle.sign("HMAC",n,e instanceof Uint8Array?e:r.encode(e));return new Uint8Array(o)}async function K2(t){if(!t.accessKey)throw new Bn;if(!t.secretKey)throw new ra;if(t.expirySeconds<1||t.expirySeconds>604800)throw new Es;let e=new Date(t.date);e.setSeconds(e.getSeconds()+t.expirySeconds);let r=wg(t.accessKey,t.region,t.date),n=Ao(t.date),o={"X-Amz-Algorithm":xs,"X-Amz-Credential":r,"X-Amz-Date":n,key:t.objectKey,...t.fields},i=[{bucket:t.bucket},{key:t.objectKey},{"X-Amz-Algorithm":xs},{"X-Amz-Credential":r},{"X-Amz-Date":n}];t.conditions&&i.push(...t.conditions);for(let[h,m]of Object.entries(t.fields||{}))["key","X-Amz-Algorithm","X-Amz-Credential","X-Amz-Date"].includes(h)||i.push({[h]:m});let a={expiration:e.toISOString(),conditions:i},s=new TextEncoder().encode(JSON.stringify(a)),u=btoa(String.fromCharCode(...s));o.policy=u;let c=u,l=await vg(t.date,t.region,t.secretKey),f=_s(await ko(l,c)).toLowerCase();return o["X-Amz-Signature"]=f,{url:`${t.protocol}//${t.host}/${t.bucket}`,fields:o}}var hU=["Content-Type","Cache-Control","Content-Disposition","Content-Encoding","Content-Language","Expires","x-amz-checksum-sha256","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"],mU=5*1024*1024,gU=5*1024*1024*1024,Cg=5*1024*1024*1024*1024,Ss=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;pathPrefix;constructor({endPoint:e,useSSL:r,port:n,pathPrefix:o,...i}){if(/^https?:\/\//i.test(e)){if(r!==void 0||n!==void 0||o!==void 0)throw new vt("useSSL/port/pathPrefix cannot be specified if endPoint is a URL.");try{let s=new URL(e);e=s.hostname,r=s.protocol==="https:",n=s.port?parseInt(s.port,10):r?443:80,s.pathname&&s.pathname!=="/"&&(o=s.pathname.endsWith("/")?s.pathname.slice(0,-1):s.pathname)}catch{throw new Cs(`Invalid endPoint URL: ${e}`)}}if(typeof e!="string"||e.length===0)throw new Cs(`Invalid endPoint: ${e}`);if(r===void 0&&(r=!0),n!==void 0&&!M2(n))throw new vt(`Invalid port: ${n}`);if(i.accessKey&&!i.secretKey)throw new vt("If specifying access key, secret key must also be provided.");if(i.accessKey&&i.accessKey.startsWith("ASIA")&&!i.sessionToken)throw new vt("If specifying temporary access key, session token must also be provided.");let a=r?443:80;if(this.port=n??a,this.host=e.toLowerCase()+(this.port!==a?`:${this.port}`:""),this.protocol=r?"https:":"http:",this.accessKey=i.accessKey,this.#e=i.secretKey??"",this.sessionToken=i.sessionToken,this.pathStyle=i.pathStyle??!0,this.pathPrefix=o??"",this.defaultBucket=i.bucket,this.region=i.region,this.pathPrefix){if(!this.pathStyle)throw new vt("pathPrefix is incompatible with pathStyle=false");if(!this.pathPrefix.startsWith("/"))throw new vt("pathPrefix should start with /");if(this.pathPrefix.endsWith("/"))throw new vt("pathPrefix should not end with /")}}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!q2(r))throw new jl(r??"");return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,o=e.headers??new Headers;o.set("host",n);let i=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,a=this.pathStyle?`${this.pathPrefix}/${r}/${e.objectName}`:`/${e.objectName}`,s=i?`?${i}`:"",u=a+s,c=a.split("/").map(l=>encodeURIComponent(l)).join("/")+s;return{headers:o,host:n,path:u,encodedPath:c}}async makeRequest({method:e,payload:r,...n}){let o=new Date,{headers:i,host:a,path:s,encodedPath:u}=this.buildRequestOptions(n),c=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),i.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let l=await Nl(r??new Uint8Array);i.set("x-amz-date",Ao(o)),i.set("x-amz-content-sha256",l),this.accessKey&&(this.sessionToken&&i.set("x-amz-security-token",this.sessionToken),i.set("authorization",await H2({headers:i,method:e,path:s,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:o})));let f=`${this.protocol}//${a}${u}`,d=await fetch(f,{method:e,headers:i,body:r});if(d.status!==c)throw d.status>=400?await U2(d):d.status===301?new sn(d.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 sn(d.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${c}, got ${d.status} ${d.statusText}).`);return n.returnBody||await d.body?.getReader().read(),d}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!jn(e))throw new jr(e);let o=r.versionId?{versionId:r.versionId}:{},i=new Headers;r.governanceBypass&&i.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:i,query:o,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof sn&&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,...o}){let i=this.getBucketName(o);if(!jn(e))throw new jr(e);let a=new Headers(Object.entries(o.metadata??{})),s=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),a.set("Range",c),s=206}let u={...o.responseParams,...o.versionId?{versionId:o.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:i,objectName:e,headers:a,query:u,statusCode:s,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new Bn;if(!jn(r))throw new jr(r);let{headers:o,path:i}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),a=n.requestDate??new Date,s=n.expirySeconds??1440*60*7;return V2({protocol:this.protocol,headers:o,method:e,path:i,accessKey:this.accessKey,secretKey:this.#e,sessionToken:this.sessionToken,region:this.region,date:a,expirySeconds:s})}presignedGetObject(e,r={}){let{versionId:n,responseParams:o,...i}=r,a={...o,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:a,...i})}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="",o=e.pageSize??1e3;if(o<1||o>1e3)throw new vt("pageSize must be between 1 and 1,000.");let i=0;for(;;){let a=e.maxResults?Math.min(o,e.maxResults-i):o;if(a===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(a),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=Rn(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(h=>h.name==="CommonPrefixes").flatMap(h=>h.children),f=[];for(let h of l)f.push({type:"CommonPrefix",prefix:h.content??""}),i++;for(let h of c.children.filter(m=>m.name==="Contents"))f.push({type:"Object",key:h.children.find(m=>m.name==="Key")?.content??"",etag:Fo(h.children.find(m=>m.name==="ETag")?.content??""),size:parseInt(h.children.find(m=>m.name==="Size")?.content??"",10),lastModified:new Date(h.children.find(m=>m.name==="LastModified")?.content??"invalid")}),i++;f.sort((h,m)=>{let b=h.type==="Object"?h.key:h.prefix,D=m.type==="Object"?m.key:m.prefix;return b>D?1:b<D?-1:0});for(let h of f)yield h;if(c.children.find(h=>h.name==="IsTruncated")?.content==="true"){let h=c.children.find(m=>m.name==="NextContinuationToken")?.content;if(!h)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=h}else return}}async putObject(e,r,n){let o=this.getBucketName(n);if(!jn(e))throw new jr(e);let i,a;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?a=ReadableStream.from([l]):a=new ReadableStream({start(f){f.enqueue(l),f.close()}}),i=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?a=ReadableStream.from([r]):a=new ReadableStream({start(l){l.enqueue(r),l.close()}}),i=r.byteLength;else if(r instanceof ReadableStream)a=r;else throw new vt("Invalid stream/data type provided.");if(n?.size!==void 0){if(i!==void 0&&n?.size!==i)throw new vt(`size was specified (${n.size}) but doesn't match auto-detected size (${i}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new vt(`invalid size specified: ${n.size}`);i=n.size}let s=n?.partSize??this.calculatePartSize(i);if(s<mU)throw new vt("Part size should be greater than 5MB");if(s>gU)throw new vt("Part size should be less than 6MB");let u=new Bl(s),c=new Ll({client:this,bucketName:o,objectName:e,partSize:s,metadata:n?.metadata??{}});return await a.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=Cg),e>Cg)throw new TypeError(`size should not be more than ${Cg}`);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(!jn(e))throw new jr(e);let o={};r?.versionId&&(o.versionId=r.versionId);let i=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:o,headers:new Headers(r?.headers)}),a={};for(let s of hU)i.headers.has(s)&&(a[s]=i.headers.get(s));return i.headers.forEach((s,u)=>{u.startsWith("x-amz-meta-")&&(a[u]=i.headers.get(u))}),{type:"Object",key:e,size:parseInt(i.headers.get("content-length")??"",10),metadata:a,lastModified:new Date(i.headers.get("Last-Modified")??"error: missing last modified"),versionId:i.headers.get("x-amz-version-id")||null,etag:Fo(i.headers.get("ETag")??"")}}async copyObject(e,r,n){let o=this.getBucketName(n),i=e.sourceBucketName??o;if(!jn(r))throw new jr(r);let a=`${i}/${e.sourceKey}`;e.sourceVersionId&&(a+=`?versionId=${e.sourceVersionId}`);let s=new Headers(n?.metadata);n?.metadata!==void 0&&s.set("x-amz-metadata-directive","REPLACE"),s.set("x-amz-copy-source",a);let u=await this.makeRequest({method:"PUT",bucketName:o,objectName:r,headers:s,returnBody:!0}),c=await u.text(),l=Rn(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let f=l.children.find(h=>h.name==="ETag")?.content??"",d=l.children.find(h=>h.name==="LastModified")?.content;if(d===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:Fo(f),lastModified:new Date(d),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 sn&&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})}presignedPostObject(e,r={}){if(!jn(e))throw new jr(e);let n=this.getBucketName(r);if(!n)throw new Error("Bucket name is required for presignedPost, but none was provided either to this method nor to the client constructor");let o=r.requestDate||new Date,i=r.expirySeconds??3600;return K2({protocol:this.protocol,host:this.host,bucket:n,objectKey:e,accessKey:this.accessKey||"",secretKey:this.#e||"",region:this.region,date:o,expirySeconds:i,conditions:r.conditions,fields:r.fields})}};var $o=require("node:fs"),Ul=require("node:path");function DU(t,e){return(0,$o.readFileSync)(t,"utf8").includes(e)}function Fs(t,e){let r=(0,$o.readdirSync)(t);for(let n of r){let o=(0,Ul.join)(t,n),i=(0,$o.statSync)(o);if(i.isDirectory()){if(Fs(o,e))return!0}else if(i.isFile()&&(0,Ul.extname)(o)===".js"&&DU(o,e))return!0}return!1}function Ml(t){return(0,$o.readdirSync)(t).indexOf("index.html")>-1}var ia=require("node:fs"),nF=require("node:os"),Io=require("node:path"),oF=require("node:process"),Yl=require("node:stream/consumers"),iF=require("node:zlib");var aF=ge(rF()),sF=ge(Uh());async function PM(t,e){try{return(await fetch(`${t.hostFilesApi}/files/read/attachments/${encodeURIComponent(e)}`,{method:"HEAD"})).ok}catch{return!1}}var TM=8192,uF="6.25.0",cF="7.0.35";async function IM(t){let e=yt((0,oF.cwd)()),r=await rn("@capgo/capacitor-updater",e,t.packageJson),n;try{n=r?_e(r):void 0}catch{n=void 0}if(!r||!n)return{version:null,supportsBrotliV2:!1};let o=n.major===6&&hn(n,_e(uF)),i=n.major>=7&&hn(n,_e(cF)),a=o||i;return{version:`${n.major}.${n.minor}.${n.patch}`,supportsBrotliV2:a}}function RM(t,e){if(!e)return!1;let r=e.split(",").map(n=>n.trim()).filter(n=>!!n);return r.length===0?!1:aF.isMatch(t,r)}async function BM(t,e,r){let o=(0,ia.statSync)(t).size,i=await(0,Yl.buffer)((0,ia.createReadStream)(t));if(o===0)return{buffer:i,useBrotli:!1};if(RM(e,r.noBrotliPatterns))return p.info(`Skipping brotli for excluded file: ${e}`),{buffer:i,useBrotli:!1};if(o<TM)return{buffer:i,useBrotli:!1};try{let a=await(0,Yl.buffer)((0,ia.createReadStream)(t).pipe((0,iF.createBrotliCompress)({})));return a.length>=o-10?{buffer:i,useBrotli:!1}:{buffer:a,useBrotli:!0}}catch(a){return p.warn(`Brotli compression failed for ${t}: ${a}, using original file`),{buffer:i,useBrotli:!1}}}async function lF(t,e,r,n,o,i){let a=we();a.start(o!=="v2"?"Generating the update manifest":"Generating the update manifest with v2 encryption");let s=await i2(t);if(o==="v2")for(let u of s)u.hash=ta(u.hash,i);return a.stop("Manifest generated successfully"),await be(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),s}function jM(t){return(0,nF.platform)()!=="win32"?t:Io.win32.normalize(t).split(Io.win32.sep).join(Io.posix.sep)}function NM(t){let e=t.split("/").map(r=>encodeURIComponent(r)).join("/");return t.includes(" ")&&p.warn(`File "${t}" contains spaces in its name.`),e}async function fF(t,e,r,n,o,i,a){let s=we();s.start("Preparing partial update with TUS protocol");let u=performance.now(),c=await ir(),l=!!(a.partial||a.delta||a.partialOnly||a.deltaOnly),{version:f,supportsBrotliV2:d}=await IM(a);if(d)a.disableBrotli?p.info("Brotli compression disabled by user request"):a.noBrotliPatterns&&p.info(`Files matching patterns (${a.noBrotliPatterns}) will be excluded from brotli compression`);else throw new Error(`Your project is using an older version of @capgo/capacitor-updater (${f||"unknown"}). To use Delta updates, please upgrade to version ${uF} (v6) or ${cF} (v7) or higher.`);let h=e.filter(C=>C.file.includes(" "));if(h.length>0)throw new Error(`Files with spaces in their names (${h.map(C=>C.file).join(", ")}). Please rename the files.`);let m=0,b=e.length,D=0;try{s.message(`Uploading ${b} files using TUS protocol`);let C=e.map(async S=>{let T=(0,Io.join)(r,S.file),k=jM(S.file),B,R=!1;if(a.disableBrotli)B=await(0,Yl.buffer)((0,ia.createReadStream)(T)),R=!1;else{let Q=await BM(T,k,a);B=Q.buffer,R=Q.useBrotli}let N=B;i&&(N=ea(B,i.sessionKey,i.ivSessionKey));let A=k;R&&(A=`${k}.br`,D++);let U=NM(A),M=`orgs/${o}/apps/${n}/delta/${S.hash}_${U}`;return await PM(c,M)?(m++,Promise.resolve({file_name:U,s3_path:M,file_hash:S.hash})):new Promise((Q,$)=>{let y=0,v=3,w=()=>{s.message(`Prepare upload partial file: ${k}`),new sF.Upload(N,{endpoint:`${c.hostFilesApi}/files/upload/attachments/`,chunkSize:a.tusChunkSize,retryDelays:[0,1e3,3e3,5e3],removeFingerprintOnSuccess:!0,metadata:{filename:M},headers:{Authorization:t},onError:async I=>{let O=I.toString(),q;try{let j=O.match(/response text: (\{.*?\})/);j&&j[1]&&(q=JSON.parse(j[1]).moreInfo?.requestId)}catch{}let P=q?` [requestId: ${q}]`:"";if(O.includes("offset")||O.includes("409")||O.includes("conflict"))if(y++,y<=v){p.warn(`Offset mismatch for ${k}, retrying (attempt ${y}/${v})...${P}`),await new Promise(j=>setTimeout(j,1e3*y)),w();return}else p.error(`Failed to upload ${k} after ${v} retries due to offset errors${P}`),p.info("This may happen if the upload expired or there was a network issue. The file will be skipped.");else p.error(`Failed to upload ${k}: ${O}${P}`);$(I)},onProgress(){let I=(m/b*100).toFixed(2);s.message(`Uploading partial update: ${I}%`)},onSuccess(){m++,Q({file_name:U,s3_path:M,file_hash:S.hash})}}).start()};w()})}),E=await Promise.all(C),_=((performance.now()-u)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${_} seconds)`),D>0&&p.info(`${D} of ${b} files were compressed with brotli and use .br extension`),await be(t,{channel:"app",event:`App Partial TUS done${D>0?" with .br extension":""}`,icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await be(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:_},notify:!1}),E}catch(C){let g=((performance.now()-u)/1e3).toFixed(2);if(s.stop(`Failed to upload Partial bundle (after ${g} seconds)`),l)throw p.error(`Error uploading partial update: ${C}`),p.error("Delta/partial upload was explicitly requested but failed. Upload aborted."),C;return p.info(`Error uploading partial update: ${C}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}function me(t){throw p.error(t),new Error(t)}async function LM(t,e){let r=_r("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r||`0.0.1-beta.${(0,pF.randomUUID)().split("-")[0]}`;return Wi.test(n)||me(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),n}function UM(t){let e=t.apikey||ie();return e||me("Missing API key, you need to provide an API key to upload your bundle"),e}function MM(t,e,r){let n=he(t,r),o=e.path||r?.webDir;return n||me("Missing argument, you need to provide a appid or be in a capacitor project"),o||me("Missing argument, you need to provide a path (--path), or be in a capacitor project"),(0,Ro.existsSync)(o)||me(`Path ${o} does not exist, build your app first, or provide a valid path`),{appid:n,path:o}}function qM(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Fs(e,"notifyAppReady")||me(`notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready
|
|
197
|
-
If you are sure your app has this code, you can use the --no-code-check option`),Ml(e)||me(`index.html is missing in the root folder of ${e}`))}async function HM(t,e,r,n,o,i){let a=r.ignoreMetadataCheck,s=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",o).single(),f=!!c&&c.disable_auto_update==="version_number",d,h;if(!l&&c&&c.version&&c.version.native_packages&&!a){let D=we();D.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:C,localDependencies:E}=await Al(t,o,n,r.packageJson,r.nodeModules);if(h=C,d=E,h.find(g=>!So(g)))D.stop(`Bundle NOT compatible with ${n} channel`),p.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),s&&(u=i,p.info(`Auto set min-update-version to ${u}`));else if(s)try{let{min_update_version:g}=c.version;(!g||!Wi.test(g))&&me("Invalid remote min update version, skipping auto setting compatibility"),u=g,D.stop(`Auto set min-update-version to ${u}`)}catch{me(`Cannot auto set compatibility, invalid data ${c}`)}else D.stop(`Bundle compatible with ${n} channel`)}else a||(p.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),d=await lg(r.packageJson,r.nodeModules),s&&(u=i,p.info(`Auto set min-update-version to ${u}`)));f&&!u&&!a&&me("You need to provide a min-update-version to upload a bundle to this channel"),u&&(Wi.test(u)||me(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`));let m=d?new Map(d.filter(D=>!!D.native&&D.native!==void 0).map(D=>[D.name,D])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([D,C])=>({name:D,version:C.version})):void 0,minUpdateVersion:u}}async function VM(t,e,r,n=!1){let{data:o,error:i}=await t.rpc("exist_app_versions",{appid:e,name_version:r}).single();if(o||i){if(n)return p.warn(`Version ${r} already exists - exiting gracefully due to --silent-fail option`),J("Bundle version already exists - exiting gracefully \u{1F389}"),!0;me(`Version ${r} already exists ${L(i)}`)}return!1}async function zM(t,e,r,n,o,i,a){let s,u,c="",l=null,f="none",d="",h=e.keyV2,m=e.key===!1;l=await Sl(t);let b=we();b.start("Calculating checksum");let D=yt((0,Lg.cwd)()),C=await rn("@capgo/capacitor-updater",D,e.packageJson),E=!1,g;try{g=C?_e(C):void 0}catch{g=void 0}if(C?g?E=hn(g,_e("6.25.0")):(C==="link:@capgo/capacitor-updater"||C==="file:.."||C==="file:../")&&(p.warn("Using local @capgo/capacitor-updater. Assuming latest version for checksum calculation."),E=!0):me("Cannot find @capgo/capacitor-updater in node_modules, please install it first with your package manager"),(h||e.keyDataV2||(0,Ro.existsSync)(Wt))&&!m||E?c=await Xr(l,"sha256"):c=await Xr(l,"crc32"),b.stop(`Checksum ${E?"SHA256":"CRC32"}: ${c}`),m)p.info("Encryption ignored");else if((h||(0,Ro.existsSync)(Wt)||e.keyDataV2)&&!e.oldEncryption){let
|
|
196
|
+
`)}async function vg(t,e,r){let n=Dg(t),o=await ko("AWS4"+r,n),i=await ko(o,e),a=await ko(i,"s3");return await ko(a,"aws4_request")}function wg(t,e,r){return`${t}/${yg(e,r)}`}async function ko(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"]),o=await crypto.subtle.sign("HMAC",n,e instanceof Uint8Array?e:r.encode(e));return new Uint8Array(o)}async function K2(t){if(!t.accessKey)throw new Bn;if(!t.secretKey)throw new ra;if(t.expirySeconds<1||t.expirySeconds>604800)throw new Es;let e=new Date(t.date);e.setSeconds(e.getSeconds()+t.expirySeconds);let r=wg(t.accessKey,t.region,t.date),n=Ao(t.date),o={"X-Amz-Algorithm":xs,"X-Amz-Credential":r,"X-Amz-Date":n,key:t.objectKey,...t.fields},i=[{bucket:t.bucket},{key:t.objectKey},{"X-Amz-Algorithm":xs},{"X-Amz-Credential":r},{"X-Amz-Date":n}];t.conditions&&i.push(...t.conditions);for(let[h,m]of Object.entries(t.fields||{}))["key","X-Amz-Algorithm","X-Amz-Credential","X-Amz-Date"].includes(h)||i.push({[h]:m});let a={expiration:e.toISOString(),conditions:i},s=new TextEncoder().encode(JSON.stringify(a)),u=btoa(String.fromCharCode(...s));o.policy=u;let c=u,l=await vg(t.date,t.region,t.secretKey),f=_s(await ko(l,c)).toLowerCase();return o["X-Amz-Signature"]=f,{url:`${t.protocol}//${t.host}/${t.bucket}`,fields:o}}var hU=["Content-Type","Cache-Control","Content-Disposition","Content-Encoding","Content-Language","Expires","x-amz-checksum-sha256","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"],mU=5*1024*1024,gU=5*1024*1024*1024,Cg=5*1024*1024*1024*1024,Ss=class{host;port;protocol;accessKey;#e;sessionToken;defaultBucket;region;userAgent="s3-lite-client";pathStyle;pathPrefix;constructor({endPoint:e,useSSL:r,port:n,pathPrefix:o,...i}){if(/^https?:\/\//i.test(e)){if(r!==void 0||n!==void 0||o!==void 0)throw new vt("useSSL/port/pathPrefix cannot be specified if endPoint is a URL.");try{let s=new URL(e);e=s.hostname,r=s.protocol==="https:",n=s.port?parseInt(s.port,10):r?443:80,s.pathname&&s.pathname!=="/"&&(o=s.pathname.endsWith("/")?s.pathname.slice(0,-1):s.pathname)}catch{throw new Cs(`Invalid endPoint URL: ${e}`)}}if(typeof e!="string"||e.length===0)throw new Cs(`Invalid endPoint: ${e}`);if(r===void 0&&(r=!0),n!==void 0&&!M2(n))throw new vt(`Invalid port: ${n}`);if(i.accessKey&&!i.secretKey)throw new vt("If specifying access key, secret key must also be provided.");if(i.accessKey&&i.accessKey.startsWith("ASIA")&&!i.sessionToken)throw new vt("If specifying temporary access key, session token must also be provided.");let a=r?443:80;if(this.port=n??a,this.host=e.toLowerCase()+(this.port!==a?`:${this.port}`:""),this.protocol=r?"https:":"http:",this.accessKey=i.accessKey,this.#e=i.secretKey??"",this.sessionToken=i.sessionToken,this.pathStyle=i.pathStyle??!0,this.pathPrefix=o??"",this.defaultBucket=i.bucket,this.region=i.region,this.pathPrefix){if(!this.pathStyle)throw new vt("pathPrefix is incompatible with pathStyle=false");if(!this.pathPrefix.startsWith("/"))throw new vt("pathPrefix should start with /");if(this.pathPrefix.endsWith("/"))throw new vt("pathPrefix should not end with /")}}getBucketName(e){let r=e?.bucketName??this.defaultBucket;if(r===void 0||!q2(r))throw new jl(r??"");return r}buildRequestOptions(e){let r=this.getBucketName(e),n=this.pathStyle?this.host:`${r}.${this.host}`,o=e.headers??new Headers;o.set("host",n);let i=typeof e.query=="object"?new URLSearchParams(e.query).toString().replace("+","%20"):e.query,a=this.pathStyle?`${this.pathPrefix}/${r}/${e.objectName}`:`/${e.objectName}`,s=i?`?${i}`:"",u=a+s,c=a.split("/").map(l=>encodeURIComponent(l)).join("/")+s;return{headers:o,host:n,path:u,encodedPath:c}}async makeRequest({method:e,payload:r,...n}){let o=new Date,{headers:i,host:a,path:s,encodedPath:u}=this.buildRequestOptions(n),c=n.statusCode??200;if(e==="POST"||e==="PUT"||e==="DELETE")r===void 0?r=new Uint8Array:typeof r=="string"&&(r=new TextEncoder().encode(r)),i.set("Content-Length",String(r.length));else if(r)throw new Error(`Unexpected payload on ${e} request.`);let l=await Nl(r??new Uint8Array);i.set("x-amz-date",Ao(o)),i.set("x-amz-content-sha256",l),this.accessKey&&(this.sessionToken&&i.set("x-amz-security-token",this.sessionToken),i.set("authorization",await H2({headers:i,method:e,path:s,accessKey:this.accessKey,secretKey:this.#e,region:this.region,date:o})));let f=`${this.protocol}//${a}${u}`,d=await fetch(f,{method:e,headers:i,body:r});if(d.status!==c)throw d.status>=400?await U2(d):d.status===301?new sn(d.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 sn(d.status,"UnexpectedStatusCode",`Unexpected response code from the server (expected ${c}, got ${d.status} ${d.statusText}).`);return n.returnBody||await d.body?.getReader().read(),d}async deleteObject(e,r={}){let n=this.getBucketName(r);if(!jn(e))throw new jr(e);let o=r.versionId?{versionId:r.versionId}:{},i=new Headers;r.governanceBypass&&i.set("X-Amz-Bypass-Governance-Retention","true"),await this.makeRequest({method:"DELETE",bucketName:n,objectName:e,headers:i,query:o,statusCode:204})}async exists(e,r){try{return await this.statObject(e,r),!0}catch(n){if(n instanceof sn&&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,...o}){let i=this.getBucketName(o);if(!jn(e))throw new jr(e);let a=new Headers(Object.entries(o.metadata??{})),s=200;if(r||n){let c="";r?c=`bytes=${+r}-`:(c="bytes=0-",r=0),n&&(c+=`${+n+r-1}`),a.set("Range",c),s=206}let u={...o.responseParams,...o.versionId?{versionId:o.versionId}:{}};return await this.makeRequest({method:"GET",bucketName:i,objectName:e,headers:a,query:u,statusCode:s,returnBody:!0})}getPresignedUrl(e,r,n={}){if(!this.accessKey)throw new Bn;if(!jn(r))throw new jr(r);let{headers:o,path:i}=this.buildRequestOptions({objectName:r,bucketName:n.bucketName,query:n.parameters}),a=n.requestDate??new Date,s=n.expirySeconds??1440*60*7;return V2({protocol:this.protocol,headers:o,method:e,path:i,accessKey:this.accessKey,secretKey:this.#e,sessionToken:this.sessionToken,region:this.region,date:a,expirySeconds:s})}presignedGetObject(e,r={}){let{versionId:n,responseParams:o,...i}=r,a={...o,...n?{versionId:n}:{}};return this.getPresignedUrl("GET",e,{parameters:a,...i})}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="",o=e.pageSize??1e3;if(o<1||o>1e3)throw new vt("pageSize must be between 1 and 1,000.");let i=0;for(;;){let a=e.maxResults?Math.min(o,e.maxResults-i):o;if(a===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(a),...n?{"continuation-token":n}:{}},returnBody:!0})).text(),c=Rn(u).root;if(!c||c.name!=="ListBucketResult")throw new Error(`Unexpected response: ${u}`);let l=c.children.filter(h=>h.name==="CommonPrefixes").flatMap(h=>h.children),f=[];for(let h of l)f.push({type:"CommonPrefix",prefix:h.content??""}),i++;for(let h of c.children.filter(m=>m.name==="Contents"))f.push({type:"Object",key:h.children.find(m=>m.name==="Key")?.content??"",etag:Fo(h.children.find(m=>m.name==="ETag")?.content??""),size:parseInt(h.children.find(m=>m.name==="Size")?.content??"",10),lastModified:new Date(h.children.find(m=>m.name==="LastModified")?.content??"invalid")}),i++;f.sort((h,m)=>{let b=h.type==="Object"?h.key:h.prefix,D=m.type==="Object"?m.key:m.prefix;return b>D?1:b<D?-1:0});for(let h of f)yield h;if(c.children.find(h=>h.name==="IsTruncated")?.content==="true"){let h=c.children.find(m=>m.name==="NextContinuationToken")?.content;if(!h)throw new Error("Unexpectedly missing continuation token, but server said there are more results.");n=h}else return}}async putObject(e,r,n){let o=this.getBucketName(n);if(!jn(e))throw new jr(e);let i,a;if(typeof r=="string"){let l=new TextEncoder().encode(r);typeof ReadableStream.from<"u"?a=ReadableStream.from([l]):a=new ReadableStream({start(f){f.enqueue(l),f.close()}}),i=l.length}else if(r instanceof Uint8Array)typeof ReadableStream.from<"u"?a=ReadableStream.from([r]):a=new ReadableStream({start(l){l.enqueue(r),l.close()}}),i=r.byteLength;else if(r instanceof ReadableStream)a=r;else throw new vt("Invalid stream/data type provided.");if(n?.size!==void 0){if(i!==void 0&&n?.size!==i)throw new vt(`size was specified (${n.size}) but doesn't match auto-detected size (${i}).`);if(typeof n.size!="number"||n.size<0||isNaN(n.size))throw new vt(`invalid size specified: ${n.size}`);i=n.size}let s=n?.partSize??this.calculatePartSize(i);if(s<mU)throw new vt("Part size should be greater than 5MB");if(s>gU)throw new vt("Part size should be less than 6MB");let u=new Bl(s),c=new Ll({client:this,bucketName:o,objectName:e,partSize:s,metadata:n?.metadata??{}});return await a.pipeThrough(u).pipeTo(c),c.getResult()}calculatePartSize(e){if(e===void 0&&(e=Cg),e>Cg)throw new TypeError(`size should not be more than ${Cg}`);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(!jn(e))throw new jr(e);let o={};r?.versionId&&(o.versionId=r.versionId);let i=await this.makeRequest({method:"HEAD",bucketName:n,objectName:e,query:o,headers:new Headers(r?.headers)}),a={};for(let s of hU)i.headers.has(s)&&(a[s]=i.headers.get(s));return i.headers.forEach((s,u)=>{u.startsWith("x-amz-meta-")&&(a[u]=i.headers.get(u))}),{type:"Object",key:e,size:parseInt(i.headers.get("content-length")??"",10),metadata:a,lastModified:new Date(i.headers.get("Last-Modified")??"error: missing last modified"),versionId:i.headers.get("x-amz-version-id")||null,etag:Fo(i.headers.get("ETag")??"")}}async copyObject(e,r,n){let o=this.getBucketName(n),i=e.sourceBucketName??o;if(!jn(r))throw new jr(r);let a=`${i}/${e.sourceKey}`;e.sourceVersionId&&(a+=`?versionId=${e.sourceVersionId}`);let s=new Headers(n?.metadata);n?.metadata!==void 0&&s.set("x-amz-metadata-directive","REPLACE"),s.set("x-amz-copy-source",a);let u=await this.makeRequest({method:"PUT",bucketName:o,objectName:r,headers:s,returnBody:!0}),c=await u.text(),l=Rn(c).root;if(!l||l.name!=="CopyObjectResult")throw new Error(`Unexpected response: ${c}`);let f=l.children.find(h=>h.name==="ETag")?.content??"",d=l.children.find(h=>h.name==="LastModified")?.content;if(d===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:Fo(f),lastModified:new Date(d),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 sn&&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})}presignedPostObject(e,r={}){if(!jn(e))throw new jr(e);let n=this.getBucketName(r);if(!n)throw new Error("Bucket name is required for presignedPost, but none was provided either to this method nor to the client constructor");let o=r.requestDate||new Date,i=r.expirySeconds??3600;return K2({protocol:this.protocol,host:this.host,bucket:n,objectKey:e,accessKey:this.accessKey||"",secretKey:this.#e||"",region:this.region,date:o,expirySeconds:i,conditions:r.conditions,fields:r.fields})}};var $o=require("node:fs"),Ul=require("node:path");function DU(t,e){return(0,$o.readFileSync)(t,"utf8").includes(e)}function Fs(t,e){let r=(0,$o.readdirSync)(t);for(let n of r){let o=(0,Ul.join)(t,n),i=(0,$o.statSync)(o);if(i.isDirectory()){if(Fs(o,e))return!0}else if(i.isFile()&&(0,Ul.extname)(o)===".js"&&DU(o,e))return!0}return!1}function Ml(t){return(0,$o.readdirSync)(t).indexOf("index.html")>-1}var ia=require("node:fs"),nF=require("node:os"),Io=require("node:path"),oF=require("node:process"),Yl=require("node:stream/consumers"),iF=require("node:zlib");var aF=ge(rF()),sF=ge(Uh());async function PM(t,e){try{return(await fetch(`${t.hostFilesApi}/files/read/attachments/${encodeURIComponent(e)}`,{method:"HEAD"})).ok}catch{return!1}}var TM=8192,uF="6.25.0",cF="7.0.35";async function IM(t){let e=yt((0,oF.cwd)()),r=await rn("@capgo/capacitor-updater",e,t.packageJson),n;try{n=r?_e(r):void 0}catch{n=void 0}if(!r||!n)return{version:null,supportsBrotliV2:!1};let o=n.major===6&&hn(n,_e(uF)),i=n.major>=7&&hn(n,_e(cF)),a=o||i;return{version:`${n.major}.${n.minor}.${n.patch}`,supportsBrotliV2:a}}function RM(t,e){if(!e)return!1;let r=e.split(",").map(n=>n.trim()).filter(n=>!!n);return r.length===0?!1:aF.isMatch(t,r)}async function BM(t,e,r){let o=(0,ia.statSync)(t).size,i=await(0,Yl.buffer)((0,ia.createReadStream)(t));if(o===0)return{buffer:i,useBrotli:!1};if(RM(e,r.noBrotliPatterns))return p.info(`Skipping brotli for excluded file: ${e}`),{buffer:i,useBrotli:!1};if(o<TM)return{buffer:i,useBrotli:!1};try{let a=await(0,Yl.buffer)((0,ia.createReadStream)(t).pipe((0,iF.createBrotliCompress)({})));return a.length>=o-10?{buffer:i,useBrotli:!1}:{buffer:a,useBrotli:!0}}catch(a){return p.warn(`Brotli compression failed for ${t}: ${a}, using original file`),{buffer:i,useBrotli:!1}}}async function lF(t,e,r,n,o,i){let a=we();a.start(o!=="v2"?"Generating the update manifest":"Generating the update manifest with v2 encryption");let s=await i2(t);if(o==="v2")for(let u of s)u.hash=ta(u.hash,i);return a.stop("Manifest generated successfully"),await be(e,{channel:"partial-update",event:"Generate manifest",icon:"\u{1F4C2}",user_id:r,tags:{"app-id":n},notify:!1}),s}function jM(t){return(0,nF.platform)()!=="win32"?t:Io.win32.normalize(t).split(Io.win32.sep).join(Io.posix.sep)}function NM(t){let e=t.split("/").map(r=>encodeURIComponent(r)).join("/");return t.includes(" ")&&p.warn(`File "${t}" contains spaces in its name.`),e}async function fF(t,e,r,n,o,i,a){let s=we();s.start("Preparing partial update with TUS protocol");let u=performance.now(),c=await ir(),l=!!(a.partial||a.delta||a.partialOnly||a.deltaOnly),{version:f,supportsBrotliV2:d}=await IM(a);if(d)a.disableBrotli?p.info("Brotli compression disabled by user request"):a.noBrotliPatterns&&p.info(`Files matching patterns (${a.noBrotliPatterns}) will be excluded from brotli compression`);else throw new Error(`Your project is using an older version of @capgo/capacitor-updater (${f||"unknown"}). To use Delta updates, please upgrade to version ${uF} (v6) or ${cF} (v7) or higher.`);let h=e.filter(C=>C.file.includes(" "));if(h.length>0)throw new Error(`Files with spaces in their names (${h.map(C=>C.file).join(", ")}). Please rename the files.`);let m=0,b=e.length,D=0;try{s.message(`Uploading ${b} files using TUS protocol`);let C=e.map(async S=>{let P=(0,Io.join)(r,S.file),k=jM(S.file),B,R=!1;if(a.disableBrotli)B=await(0,Yl.buffer)((0,ia.createReadStream)(P)),R=!1;else{let Q=await BM(P,k,a);B=Q.buffer,R=Q.useBrotli}let N=B;i&&(N=ea(B,i.sessionKey,i.ivSessionKey));let A=k;R&&(A=`${k}.br`,D++);let U=NM(A),M=`orgs/${o}/apps/${n}/delta/${S.hash}_${U}`;return await PM(c,M)?(m++,Promise.resolve({file_name:U,s3_path:M,file_hash:S.hash})):new Promise((Q,$)=>{s.message(`Prepare upload partial file: ${k}`),new sF.Upload(N,{endpoint:`${c.hostFilesApi}/files/upload/attachments/`,chunkSize:a.tusChunkSize,retryDelays:[0,1e3,3e3,5e3,1e4],removeFingerprintOnSuccess:!0,metadata:{filename:M},headers:{Authorization:t},onError:v=>{let w=v.toString(),F;try{let O=w.match(/response text: (\{.*?\})/);O&&O[1]&&(F=JSON.parse(O[1]).moreInfo?.requestId)}catch{}let I=F?` [requestId: ${F}]`:"";p.error(`Failed to upload ${k}: ${w}${I}`),$(v)},onProgress(){let v=(m/b*100).toFixed(2);s.message(`Uploading partial update: ${v}%`)},onSuccess(){m++,Q({file_name:U,s3_path:M,file_hash:S.hash})}}).start()})}),E=await Promise.all(C),_=((performance.now()-u)/1e3).toFixed(2);return s.stop(`Partial update uploaded successfully \u{1F4AA} in (${_} seconds)`),D>0&&p.info(`${D} of ${b} files were compressed with brotli and use .br extension`),await be(t,{channel:"app",event:`App Partial TUS done${D>0?" with .br extension":""}`,icon:"\u23EB",user_id:o,tags:{"app-id":n},notify:!1}),await be(t,{channel:"performance",event:"Partial upload performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":n,time:_},notify:!1}),E}catch(C){let g=((performance.now()-u)/1e3).toFixed(2);if(s.stop(`Failed to upload Partial bundle (after ${g} seconds)`),l)throw p.error(`Error uploading partial update: ${C}`),p.error("Delta/partial upload was explicitly requested but failed. Upload aborted."),C;return p.info(`Error uploading partial update: ${C}, This is not a critical error, the bundle has been uploaded without the partial files`),null}}function me(t){throw p.error(t),new Error(t)}async function LM(t,e){let r=_r("",e.packageJson),n=e.bundle||t?.plugins?.CapacitorUpdater?.version||r||`0.0.1-beta.${(0,pF.randomUUID)().split("-")[0]}`;return Wi.test(n)||me(`Your bundle name ${n}, is not valid it should follow semver convention : https://semver.org/`),n}function UM(t){let e=t.apikey||ie();return e||me("Missing API key, you need to provide an API key to upload your bundle"),e}function MM(t,e,r){let n=he(t,r),o=e.path||r?.webDir;return n||me("Missing argument, you need to provide a appid or be in a capacitor project"),o||me("Missing argument, you need to provide a path (--path), or be in a capacitor project"),(0,Ro.existsSync)(o)||me(`Path ${o} does not exist, build your app first, or provide a valid path`),{appid:n,path:o}}function qM(t,e){let r=t.codeCheck;(typeof r>"u"||r)&&(Fs(e,"notifyAppReady")||me(`notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready
|
|
197
|
+
If you are sure your app has this code, you can use the --no-code-check option`),Ml(e)||me(`index.html is missing in the root folder of ${e}`))}async function HM(t,e,r,n,o,i){let a=r.ignoreMetadataCheck,s=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",o).single(),f=!!c&&c.disable_auto_update==="version_number",d,h;if(!l&&c&&c.version&&c.version.native_packages&&!a){let D=we();D.start(`Checking bundle compatibility with channel ${n}`);let{finalCompatibility:C,localDependencies:E}=await Al(t,o,n,r.packageJson,r.nodeModules);if(h=C,d=E,h.find(g=>!So(g)))D.stop(`Bundle NOT compatible with ${n} channel`),p.warn(`You can check compatibility with "${e.runner} @capgo/cli bundle compatibility"`),s&&(u=i,p.info(`Auto set min-update-version to ${u}`));else if(s)try{let{min_update_version:g}=c.version;(!g||!Wi.test(g))&&me("Invalid remote min update version, skipping auto setting compatibility"),u=g,D.stop(`Auto set min-update-version to ${u}`)}catch{me(`Cannot auto set compatibility, invalid data ${c}`)}else D.stop(`Bundle compatible with ${n} channel`)}else a||(p.warn(`Channel ${n} is new or it's your first upload with compatibility check, it will be ignored this time`),d=await lg(r.packageJson,r.nodeModules),s&&(u=i,p.info(`Auto set min-update-version to ${u}`)));f&&!u&&!a&&me("You need to provide a min-update-version to upload a bundle to this channel"),u&&(Wi.test(u)||me(`Your minimal version update ${u}, is not valid it should follow semver convention : https://semver.org/`));let m=d?new Map(d.filter(D=>!!D.native&&D.native!==void 0).map(D=>[D.name,D])):new Map;return{nativePackages:m.size>0||!r.ignoreMetadataCheck?Array.from(m,([D,C])=>({name:D,version:C.version})):void 0,minUpdateVersion:u}}async function VM(t,e,r,n=!1){let{data:o,error:i}=await t.rpc("exist_app_versions",{appid:e,name_version:r}).single();if(o||i){if(n)return p.warn(`Version ${r} already exists - exiting gracefully due to --silent-fail option`),J("Bundle version already exists - exiting gracefully \u{1F389}"),!0;me(`Version ${r} already exists ${L(i)}`)}return!1}async function zM(t,e,r,n,o,i,a){let s,u,c="",l=null,f="none",d="",h=e.keyV2,m=e.key===!1;l=await Sl(t);let b=we();b.start("Calculating checksum");let D=yt((0,Lg.cwd)()),C=await rn("@capgo/capacitor-updater",D,e.packageJson),E=!1,g;try{g=C?_e(C):void 0}catch{g=void 0}if(C?g?E=hn(g,_e("6.25.0")):(C==="link:@capgo/capacitor-updater"||C==="file:.."||C==="file:../")&&(p.warn("Using local @capgo/capacitor-updater. Assuming latest version for checksum calculation."),E=!0):me("Cannot find @capgo/capacitor-updater in node_modules, please install it first with your package manager"),(h||e.keyDataV2||(0,Ro.existsSync)(Wt))&&!m||E?c=await Xr(l,"sha256"):c=await Xr(l,"crc32"),b.stop(`Checksum ${E?"SHA256":"CRC32"}: ${c}`),m)p.info("Encryption ignored");else if((h||(0,Ro.existsSync)(Wt)||e.keyDataV2)&&!e.oldEncryption){let P=typeof h=="string"?h:Wt,k=e.keyDataV2||"";!k&&!(0,Ro.existsSync)(P)&&me(`Cannot find private key ${P}`),await be(r,{channel:"app",event:"App encryption v2",icon:"\u{1F511}",user_id:n,tags:{"app-id":o},notify:!1},e.verbose),k||(k=(0,Ro.readFileSync)(P).toString()),p.info("Encrypting your bundle with V2");let{sessionKey:B,ivSessionKey:R}=Rl(k),N=ea(l,B,R);c=ta(c,k),s=R,u=B,f="v2",d=k,e.displayIvSession&&p.info(`Your Iv Session key is ${s},
|
|
198
198
|
keep it safe, you will need it to decrypt your bundle.
|
|
199
199
|
It will be also visible in your dashboard
|
|
200
200
|
`),l=N}let _=Math.floor((l?.byteLength??0)/1024/1024),S=Math.floor(i/1024/1024);return l?.byteLength>i?me(`The bundle size is ${_} Mb, this is greater than the maximum upload length ${S} Mb, please reduce the size of your bundle`):l?.byteLength>a?(p.warn(`WARNING !!
|
|
201
201
|
The bundle size is ${_} Mb, this may take a while to download for users
|
|
202
202
|
`),p.info(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
|
|
203
203
|
`),e.verbose&&(p.info("[Verbose] Bundle size details:"),p.info(` - Actual size: ${_} MB (${l?.byteLength} bytes)`),p.info(` - Alert threshold: ${Math.floor(a/1024/1024)} MB`),p.info(` - Maximum allowed: ${S} MB`),p.info("[Verbose] Sending 'App Too Large' event to analytics...")),await be(r,{channel:"app-error",event:"App Too Large",icon:"\u{1F69B}",user_id:n,tags:{"app-id":o},notify:!1},e.verbose),e.verbose&&p.info("[Verbose] Event sent successfully")):e.verbose&&p.info(`[Verbose] Bundle size OK: ${_} MB (under ${Math.floor(a/1024/1024)} MB alert threshold)`),e.verbose&&p.info("[Verbose] Bundle preparation complete, returning bundle data"),{zipped:l,ivSessionKey:s,sessionKey:u,checksum:c,encryptionMethod:f,finalKeyData:d}}async function GM(t,e,r,n,o,i,a,s){let u=we();u.start("Uploading Bundle");let c=performance.now(),l=!1;if(a.verbose&&(p.info("[Verbose] uploadBundleToCapgoCloud called:"),p.info(` - Bundle size: ${Math.floor(i.byteLength/1024)} KB`),p.info(` - App ID: ${r}`),p.info(` - Bundle version: ${n}`),p.info(` - Chunk size: ${Math.floor(s/1024/1024)} MB`)),a.dryUpload){u.stop(`Dry run, bundle not uploaded
|
|
204
|
-
Bundle uploaded \u{1F4AA} in 0 seconds`),a.verbose&&p.info("[Verbose] Dry upload mode - skipping actual upload");return}try{let h=await ir();if(a.verbose&&p.info("[Verbose] Local config retrieved for upload"),a.multipart!==void 0&&a.multipart||a.tus!==void 0&&a.tus){a.multipart?p.info("Uploading bundle with multipart is deprecated, we upload with TUS instead"):p.info("Uploading bundle with TUS protocol"),a.verbose&&(p.info("[Verbose] Starting TUS resumable upload..."),p.info(` - Host: ${h.hostWeb}`),p.info(` - Chunk size: ${Math.floor(s/1024/1024)} MB`)),await a2(t,i,o,r,n,u,h,s),l=!0,a.verbose&&p.info("[Verbose] TUS upload completed, updating database with R2 path...");let m=`orgs/${o}/apps/${r}/${n}.zip`,{error:b}=await e.from("app_versions").update({r2_path:m}).eq("name",n).eq("app_id",r);if(b)return p.error(`Cannot finish TUS upload ${L(b)}`),a.verbose&&p.info(`[Verbose] Database update failed: ${L(b)}`),Promise.reject(new Error("Cannot finish TUS upload"));a.verbose&&p.info(`[Verbose] Database updated with R2 path: ${m}`)}else{a.verbose&&p.info("[Verbose] Using standard upload (non-TUS), getting presigned URL...");let m=await n2(e,r,n);if(!m)return p.error("Cannot get upload url"),a.verbose&&p.info("[Verbose] Failed to retrieve presigned upload URL from database"),Promise.reject(new Error("Cannot get upload url"));a.verbose&&(p.info("[Verbose] Presigned URL obtained, uploading via HTTP PUT..."),p.info(` - Timeout: ${a.timeout||og}ms`),p.info(" - Retry attempts: 5"),p.info(" - Content-Type: application/zip"));let b=new AbortController,D=setTimeout(()=>b.abort(),a.timeout||og);try{let C=await fetch(m,{method:"PUT",body:i,headers:{"Content-Type":"application/zip"},signal:b.signal});if(!C.ok)throw new Error(`HTTP error! status: ${C.status}`)}finally{clearTimeout(D)}a.verbose&&p.info("[Verbose] HTTP PUT upload completed successfully")}}catch(h){let b=((performance.now()-c)/1e3).toFixed(2);if(u.stop(`Failed to upload bundle ( after ${b} seconds)`),a.verbose&&(p.info(`[Verbose] Upload failed after ${b} seconds`),p.info(`[Verbose] Error type: ${h instanceof Error?"Error":typeof h}`)),h instanceof Error&&h.message.includes("HTTP error"))try{let D=h.message.match(/status: (\d+)/),C=D?D[1]:"unknown";p.error(`Upload failed with status ${C}: ${h.message}`)}catch{p.error(`Upload failed: ${h.message}`)}else a.verbose&&p.info(`[Verbose] Non-HTTP error: ${L(h)}`),a.tus?p.error(`Cannot upload bundle please contact support if the issue persists ${L(h)}`):p.error(`Cannot upload bundle ( try again with --tus option) ${L(h)}`);throw a.verbose&&p.info("[Verbose] Cleaning up failed version from database..."),await s2(e,r,n),a.verbose&&p.info("[Verbose] Failed version cleaned up"),h instanceof Error?h:new Error(String(h))}let d=((performance.now()-c)/1e3).toFixed(2);u.stop(`Bundle uploaded \u{1F4AA} in (${d} seconds)`),a.verbose&&(p.info("[Verbose] Upload successful:"),p.info(` - Upload time: ${d} seconds`),p.info(` - Upload method: ${l?"TUS (resumable)":"Standard HTTP PUT"}`),p.info(` - Bundle size: ${Math.floor(i.byteLength/1024)} KB`),p.info("[Verbose] Sending performance event...")),await be(t,{channel:"performance",event:l?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":r,time:d},notify:!1},a.verbose),a.verbose&&p.info("[Verbose] Performance event sent successfully")}async function WM(t,e,r){let{data:n,error:o}=await t.from("channels").select("version ( id, name, deleted )").eq("app_id",e).eq("name",r);if(o){p.error(`Cannot delete linked bundle on upload ${L(o)}`);return}if(n.length===0){p.warn("No linked bundle found in the channel you are trying to upload to");return}let i=n[0].version;if(i.deleted){p.warn("The linked bundle is already deleted");return}let{error:a}=await t.from("app_versions").update({deleted:!0}).eq("id",i.id);if(a){p.error(`Cannot delete linked bundle on upload ${L(a)}`);return}p.info("Linked bundle deleted")}async function KM(t,e,r,n,o,i,a,s,u,c){let{data:l}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:s}).single();l||me("Cannot get version id, cannot set channel");let{data:f}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:["write","all"]}).single();if(f){let{error:d,data:h}=await Fl(t,{name:o,app_id:s,created_by:i,version:l,owner_org:a,...c?{allow_device_self_set:!0}:{}});d&&me(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${L(d)}`);let m=`${u.hostWeb}/app/p/${s}/channel/${h.id}`;h?.public?p.info("Your update is now available in your public channel \u{1F389}"):h?.id&&p.info(`Link device to this bundle to try it: ${m}`),r&&p.info(`Bundle url: ${m}`)}else p.warn("The upload key is not allowed to set the version in the channel")}async function YM(t,e,r){let{error:n,data:o}=await e.from("apps").select("default_upload_channel").eq("app_id",t).single();return n?(p.warn("Cannot find default upload channel"),p.info(`You can set it here: ${r}/app/p/${t}/settings`),null):o.default_upload_channel}async function Ug(t,e,r=!1){r||Z(`Uploading with CLI version ${hr.version}`);let n,o=Qe();await de();let{s3Region:i,s3Apikey:a,s3Apisecret:s,s3BucketName:u,s3Endpoint:c,s3Port:l,s3SSL:f}=e;e.verbose&&(p.info("[Verbose] Starting upload process with options:"),p.info(` - API key: ${e.apikey?"provided":"from saved key"}`),p.info(` - Path: ${e.path||"from capacitor config"}`),p.info(` - Channel: ${e.channel||"from default upload channel"}`),p.info(` - Bundle: ${e.bundle||"auto-detected"}`),p.info(` - External: ${e.external||"false"}`),p.info(` - Encryption: ${e.keyV2||e.keyDataV2?"v2":e.key===!1?"disabled":"auto"}`),p.info(` - Upload method: ${e.tus?"TUS":e.zip?"ZIP":"auto"}`),p.info(` - Delta updates: ${e.delta||e.partial?"enabled":"disabled"}`));let d=UM(e);e.verbose&&p.info("[Verbose] API key retrieved successfully");let h=await te();e.verbose&&p.info("[Verbose] Capacitor config loaded successfully");let m=await K1();e.verbose&&(p.info("[Verbose] Remote file config retrieved:"),p.info(` - Max upload length: ${Math.floor(m.maxUploadLength/1024/1024)} MB`),p.info(` - Alert upload size: ${Math.floor(m.alertUploadSize/1024/1024)} MB`),p.info(` - TUS upload: ${m.TUSUpload?"enabled":"disabled"}`),p.info(` - TUS upload forced: ${m.TUSUploadForced?"yes":"no"}`),p.info(` - Partial upload: ${m.partialUpload?"enabled":"disabled"}`),p.info(` - Max chunk size: ${Math.floor(m.maxChunkSize/1024/1024)} MB`));let{appid:b,path:D}=MM(t,e,h.config);e.verbose&&p.info(`[Verbose] App ID: ${b}, Build path: ${D}`);let C=await LM(h.config,e);e.verbose&&p.info(`[Verbose] Bundle version: ${C}`);let E=e.external?"external":"r2-direct",g="none";e.autoSetBundle&&(await vs({version:C}),e.verbose&&p.info("[Verbose] Auto-set bundle version in capacitor.config.json")),qM(e,D),e.verbose&&p.info("[Verbose] Code check passed (notifyAppReady found and index.html present)"),p.info(`Upload ${b}@${C} started from path "${D}" to Capgo cloud`);let _=await ir();e.verbose&&p.info(`[Verbose] Local config loaded: host=${_.hostWeb}`),e.supaHost&&e.supaAnon&&(p.info("Using custom supabase instance from provided options"),_.supaHost=e.supaHost,_.supaKey=e.supaAnon,e.verbose&&p.info(`[Verbose] Custom Supabase host: ${e.supaHost}`));let S=await ne(d,e.supaHost,e.supaAnon);e.verbose&&p.info("[Verbose] Supabase client created successfully");let T=await oe(S,d,["write","all","upload"]);e.verbose&&p.info(`[Verbose] User verified successfully, user_id: ${T}`);let k=e.channel||await YM(b,S,_.hostWeb)||"dev";e.verbose&&p.info(`[Verbose] Target channel: ${k}`);let B=await ar(S,b);e.verbose&&p.info(`[Verbose] Organization ID: ${B}`),await Z1(S,B,hr.version),e.verbose&&p.info("[Verbose] Remote CLI messages checked"),await e2(S,B,d,b,!0),e.verbose&&p.info("[Verbose] Plan validation passed"),e.verbose&&p.info("[Verbose] Trial check completed"),e.verbose&&p.info(`[Verbose] Checking compatibility with channel ${k}...`);let{nativePackages:R,minUpdateVersion:N}=await HM(S,o,e,k,b,C);e.verbose&&(p.info("[Verbose] Compatibility check completed:"),p.info(` - Native packages: ${R?R.length:0}`),p.info(` - Min update version: ${N||"none"}`)),e.verbose&&p.info(`[Verbose] Checking if version ${C} already exists...`);let A=await VM(S,b,C,e.versionExistsOk);if(e.verbose&&p.info(`[Verbose] Version exists check: ${A?"yes (skipping)":"no (continuing)"}`),A)return{success:!0,skipped:!0,reason:"VERSION_EXISTS",bundle:C,checksum:null,encryptionMethod:g,storageProvider:E};e.external&&!e.external.startsWith("https://")&&me(`External link should should start with "https://" current is "${e.external}"`),e.deleteLinkedBundleOnUpload&&(p.warn("Deleting linked bundle on upload is destructive, it will delete the currently linked bundle in the channel you are trying to upload to."),p.warn("Please make sure you want to do this, if you are not sure, please do not use this option."));let U={name:C,app_id:b,session_key:void 0,external_url:e.external,storage_provider:E,min_update_version:N,native_packages:R,owner_org:B,user_id:T,checksum:void 0,link:e.link||null,comment:e.comment||null},M=null,Q="";if(e.external)e.verbose&&p.info(`[Verbose] Using external URL: ${e.external}`),await be(d,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:B,tags:{"app-id":b},notify:!1},e.verbose),U.session_key=e.ivSessionKey,U.checksum=e.encryptedChecksum,e.verbose&&(p.info("[Verbose] External bundle configured:"),p.info(` - URL: ${e.external}`),p.info(` - IV Session Key: ${e.ivSessionKey?"provided":"none"}`),p.info(` - Encrypted Checksum: ${e.encryptedChecksum?"provided":"none"}`));else{e.verbose&&p.info(`[Verbose] Preparing bundle file from path: ${D}`);let{zipped:F,ivSessionKey:I,checksum:O,sessionKey:q,encryptionMethod:P,finalKeyData:j}=await zM(D,e,d,B,b,m.maxUploadLength,m.alertUploadSize);U.session_key=I,U.checksum=O,n=q,M=F,g=P,Q=j,e.verbose&&(p.info("[Verbose] Bundle prepared:"),p.info(` - Size: ${Math.floor((F?.byteLength??0)/1024)} KB`),p.info(` - Checksum: ${O}`),p.info(` - Encryption: ${P}`),p.info(` - IV Session Key: ${I?"present":"none"}`)),e.ignoreChecksumCheck||(e.verbose&&p.info("[Verbose] Checking for duplicate checksum..."),await l2(S,b,k,O),e.verbose&&p.info("[Verbose] Checksum is unique"))}if(e.zip?(e.tus=!1,e.verbose&&p.info("[Verbose] Upload method: ZIP (explicitly set via --zip)")):!m.TUSUpload||e.external?(e.tus=!1,e.verbose&&p.info("[Verbose] Upload method: Standard (TUS not available or external URL)")):(e.tus=e.tus||m.TUSUploadForced,e.verbose&&p.info(`[Verbose] Upload method: ${e.tus?"TUS (resumable)":"Standard"}`)),!m.partialUpload||e.external?(e.delta=!1,e.verbose&&e.external&&p.info("[Verbose] Delta updates disabled (not available with external URLs)")):(e.delta=e.delta||e.partial||e.deltaOnly||e.partialOnly||m.partialUploadForced,e.verbose&&p.info(`[Verbose] Delta updates: ${e.delta?"enabled":"disabled"}`)),e.encryptPartial&&g==="v1"&&me("You cannot encrypt the partial update if you are not using the v2 encryption method"),e.delta&&g==="v2"&&!e.encryptPartial){let F=yt((0,Lg.cwd)()),I=await rn("@capgo/capacitor-updater",F,e.packageJson),O;try{O=I?_e(I):void 0}catch{O=void 0}I&&O&&hn(O,_e("6.14.4"))&&(p.info(`Auto-enabling partial update encryption for updater version ${O} (> 6.14.4)`),e.verbose&&p.info("[Verbose] Partial encryption auto-enabled for updater >= 6.14.4"),e.encryptPartial=!0)}e.verbose&&e.delta&&p.info("[Verbose] Preparing delta/partial update manifest...");let $=e.delta?await lF(D,d,B,b,e.encryptPartial?g:"none",Q):[];e.verbose&&e.delta&&p.info(`[Verbose] Delta manifest prepared with ${$.length} files`),e.verbose&&p.info("[Verbose] Creating version record in database...");let{error:y}=await cg(S,U);if(y&&me(`Cannot add bundle ${L(y)}`),e.verbose&&p.info("[Verbose] Version record created successfully"),e.tusChunkSize&&e.tusChunkSize>m.maxChunkSize?(p.error(`Chunk size ${e.tusChunkSize} is greater than the maximum chunk size ${m.maxChunkSize}, using the maximum chunk size`),e.tusChunkSize=m.maxChunkSize):e.tusChunkSize||(e.tusChunkSize=m.maxChunkSize),e.verbose&&p.info(`[Verbose] TUS chunk size: ${Math.floor(e.tusChunkSize/1024/1024)} MB`),M&&(u||c||i||a||s||l||f)){(!u||!c||!i||!a||!s||!l)&&me("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),p.info("Uploading to S3"),e.verbose&&(p.info("[Verbose] S3 configuration:"),p.info(` - Endpoint: ${c}`),p.info(` - Region: ${i}`),p.info(` - Bucket: ${u}`),p.info(` - Port: ${l}`),p.info(` - SSL: ${f?"enabled":"disabled"}`));let F=f?`https://${c}`:`http://${c}`,I=new Ss({endPoint:c,region:i,port:l,pathStyle:!0,bucket:u,accessKey:a,secretKey:s}),O=`${b}-${C}`,q=encodeURIComponent(O);e.verbose&&p.info(`[Verbose] Uploading to S3 as: ${O}`),await I.putObject(O,Uint8Array.from(M)),U.external_url=`${F}/${q}`,U.storage_provider="external",e.verbose&&p.info(`[Verbose] S3 upload complete, external URL: ${U.external_url}`)}else if(M){!e.partialOnly&&!e.deltaOnly?(e.verbose&&p.info("[Verbose] Starting full bundle upload to Capgo Cloud..."),await GM(d,S,b,C,B,M,e,e.tusChunkSize)):e.verbose&&p.info("[Verbose] Skipping full bundle upload (delta-only mode)");let F=null;try{e.dryUpload&&(e.delta=!1,e.verbose&&p.info("[Verbose] Dry upload mode: skipping delta upload"));let O=U.session_key&&e.encryptPartial&&n?{sessionKey:n,ivSessionKey:U.session_key}:void 0;e.verbose&&e.delta&&(p.info("[Verbose] Starting delta/partial file upload..."),p.info(` - Manifest entries: ${$.length}`),p.info(` - Encryption: ${O?"enabled":"disabled"}`)),F=e.delta?await fF(d,$,D,b,B,O,e):null,e.verbose&&F&&p.info(`[Verbose] Delta upload complete with ${F.length} files`)}catch(O){if(!!(e.partial||e.delta||e.partialOnly||e.deltaOnly))throw O;p.info(`Failed to upload partial files to capgo cloud. Error: ${L(O)}. This is not a critical error, the bundle has been uploaded without the partial files`),e.verbose&&p.info(`[Verbose] Delta upload error details: ${L(O)}`)}U.storage_provider="r2",U.manifest=F,e.verbose&&p.info("[Verbose] Updating version record with storage provider and manifest...");let{error:I}=await cg(S,U);I&&me(`Cannot update bundle ${L(I)}`),e.verbose&&p.info("[Verbose] Version record updated successfully")}e.verbose&&p.info("[Verbose] Checking app permissions...");let v=await Ue(S,d,b,2);e.verbose&&(p.info("[Verbose] Permissions:"),p.info(` - Upload: ${Ki(v,2)?"yes":"no"}`),p.info(` - Write: ${Ki(v,3)?"yes":"no"}`),p.info(` - Admin: ${Ki(v,4)?"yes":"no"}`)),e.deleteLinkedBundleOnUpload&&Ki(v,3)?(e.verbose&&p.info(`[Verbose] Deleting linked bundle in channel ${k}...`),await WM(S,b,k)):e.deleteLinkedBundleOnUpload&&p.warn("Cannot delete linked bundle on upload as a upload organization member"),Ki(v,3)?(e.verbose&&p.info(`[Verbose] Setting bundle ${C} to channel ${k}...`),await KM(S,d,!!e.bundleUrl,C,k,T,B,b,_,e.selfAssign),e.verbose&&p.info("[Verbose] Channel updated successfully")):p.warn("Cannot set channel as a upload organization member"),e.verbose&&p.info("[Verbose] Sending upload event..."),await be(d,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:B,tags:{"app-id":b},notify:!1},e.verbose);let w={success:!0,bundle:C,checksum:U.checksum??null,encryptionMethod:g,sessionKey:n?n.toString("base64"):void 0,ivSessionKey:typeof U.session_key=="string"?U.session_key:void 0,storageProvider:U.storage_provider};return e.verbose&&(p.info("[Verbose] Upload completed successfully:"),p.info(` - Bundle: ${w.bundle}`),p.info(` - Checksum: ${w.checksum}`),p.info(` - Encryption: ${w.encryptionMethod}`),p.info(` - Storage: ${w.storageProvider}`)),r&&!w.skipped&&J("Time to share your update to the world \u{1F30D}"),w}function JM(t){t.ivSessionKey&&!t.external&&me("You need to provide an external url if you want to use the --iv-session-key option"),t.encryptedChecksum&&!t.external&&me("You need to provide an external url if you want to use the --encrypted-checksum option"),(t.partial||t.delta||t.partialOnly||t.deltaOnly)&&t.external&&me("You cannot use the --partial/--delta/--partial-only/--delta-only option with an external url"),t.tus&&t.external&&me("You cannot use the --tus option with an external url"),t.dryUpload&&t.external&&me("You cannot use the --dry-upload option with an external url"),t.multipart&&t.external&&me("You cannot use the --multipart option with an external url"),t.external&&(t.keyV2||t.keyDataV2)&&me("You cannot set a key if you are uploading to an external url"),t.keyV2&&t.keyDataV2&&me("You cannot set both key-v2 and key-data-v2"),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&me("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),t.encryptedChecksum&&!t.external&&me("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),t.minUpdateVersion&&t.autoMinUpdateVersion&&me("You cannot set both min-update-version and auto-min-update-version, use only one of them")}async function dF(t,e){try{JM(e),await Ug(t,e)}catch(r){throw p.error(`uploadBundle failed: ${L(r)}`),r instanceof Error?r:new Error(String(r))}}var hF=require("node:crypto"),Jl=require("node:fs"),mF=require("node:process");var XM=20;function ZM(t){console.log(JSON.stringify(t,null,2))}function Ps(t){console.error(L(t))}async function QM(t,e,r=!1){let{json:n}=e,{bundle:o,path:i}=e,a=!n&&!r;try{a&&await de();let s=await te(),u=he(t,s?.config),c=(0,hF.randomUUID)().split("-")[0],l=_r("",e.packageJson);if(o=o||l||`0.0.1-beta.${c}`,a&&Z(`Zipping ${u}@${o}`),o&&!Wi.test(o)){let T=`Your bundle name ${o}, is not valid it should follow semver convention : https://semver.org/`;throw r||(n?Ps({error:"invalid_semver"}):p.error(T)),new Error("Invalid bundle version format")}if(i=i||s?.config?.webDir,!u||!o||!i){let T="Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project";throw r||(n?Ps({error:"missing_argument"}):p.error(T)),new Error(T)}if(a&&p.info(`Started from path "${i}"`),typeof e.codeCheck>"u"?!0:e.codeCheck){if(!Fs(i,"notifyAppReady"))throw r||(n?Ps({error:"notifyAppReady_not_in_source_code"}):p.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready")),new Error("notifyAppReady() is missing in build folder");if(!Ml(i))throw r||(n?Ps({error:"index_html_not_found"}):p.error(`index.html is missing in the root folder of ${i}`)),new Error("index.html is missing in root folder")}let d=await Sl(i);a&&p.info(`Zipped ${d.byteLength} bytes`);let h=a?we():null;h&&h.start("Calculating checksum");let m=yt((0,mF.cwd)()),b=await rn("@capgo/capacitor-updater",m,e.packageJson);if(!b){let T="Cannot find @capgo/capacitor-updater in node_modules, please install it first with your package manager";throw r||p.warn(T),new Error(T)}let D=!1,C;try{C=b?_e(b):void 0}catch{C=void 0}if(C){let T=C.major===6&&hn(C,_e("6.25.0")),k=C.major>=7;D=T||k}else b==="link:@capgo/capacitor-updater"&&(r||p.warn("Using local @capgo/capacitor-updater. Assuming v7"),D=!0);let E=await Xr(d,e.keyV2||(0,Jl.existsSync)(Wt)||D?"sha256":"crc32");h&&h.stop(`Checksum ${D?"SHA256":"CRC32"}: ${E}`);let g=Math.floor(d.byteLength/1024/1024);g>XM&&a&&(p.warn(`WARNING !!
|
|
204
|
+
Bundle uploaded \u{1F4AA} in 0 seconds`),a.verbose&&p.info("[Verbose] Dry upload mode - skipping actual upload");return}try{let h=await ir();if(a.verbose&&p.info("[Verbose] Local config retrieved for upload"),a.multipart!==void 0&&a.multipart||a.tus!==void 0&&a.tus){a.multipart?p.info("Uploading bundle with multipart is deprecated, we upload with TUS instead"):p.info("Uploading bundle with TUS protocol"),a.verbose&&(p.info("[Verbose] Starting TUS resumable upload..."),p.info(` - Host: ${h.hostWeb}`),p.info(` - Chunk size: ${Math.floor(s/1024/1024)} MB`)),await a2(t,i,o,r,n,u,h,s),l=!0,a.verbose&&p.info("[Verbose] TUS upload completed, updating database with R2 path...");let m=`orgs/${o}/apps/${r}/${n}.zip`,{error:b}=await e.from("app_versions").update({r2_path:m}).eq("name",n).eq("app_id",r);if(b)return p.error(`Cannot finish TUS upload ${L(b)}`),a.verbose&&p.info(`[Verbose] Database update failed: ${L(b)}`),Promise.reject(new Error("Cannot finish TUS upload"));a.verbose&&p.info(`[Verbose] Database updated with R2 path: ${m}`)}else{a.verbose&&p.info("[Verbose] Using standard upload (non-TUS), getting presigned URL...");let m=await n2(e,r,n);if(!m)return p.error("Cannot get upload url"),a.verbose&&p.info("[Verbose] Failed to retrieve presigned upload URL from database"),Promise.reject(new Error("Cannot get upload url"));a.verbose&&(p.info("[Verbose] Presigned URL obtained, uploading via HTTP PUT..."),p.info(` - Timeout: ${a.timeout||og}ms`),p.info(" - Retry attempts: 5"),p.info(" - Content-Type: application/zip"));let b=new AbortController,D=setTimeout(()=>b.abort(),a.timeout||og);try{let C=await fetch(m,{method:"PUT",body:i,headers:{"Content-Type":"application/zip"},signal:b.signal});if(!C.ok)throw new Error(`HTTP error! status: ${C.status}`)}finally{clearTimeout(D)}a.verbose&&p.info("[Verbose] HTTP PUT upload completed successfully")}}catch(h){let b=((performance.now()-c)/1e3).toFixed(2);if(u.stop(`Failed to upload bundle ( after ${b} seconds)`),a.verbose&&(p.info(`[Verbose] Upload failed after ${b} seconds`),p.info(`[Verbose] Error type: ${h instanceof Error?"Error":typeof h}`)),h instanceof Error&&h.message.includes("HTTP error"))try{let D=h.message.match(/status: (\d+)/),C=D?D[1]:"unknown";p.error(`Upload failed with status ${C}: ${h.message}`)}catch{p.error(`Upload failed: ${h.message}`)}else a.verbose&&p.info(`[Verbose] Non-HTTP error: ${L(h)}`),a.tus?p.error(`Cannot upload bundle please contact support if the issue persists ${L(h)}`):p.error(`Cannot upload bundle ( try again with --tus option) ${L(h)}`);throw a.verbose&&p.info("[Verbose] Cleaning up failed version from database..."),await s2(e,r,n),a.verbose&&p.info("[Verbose] Failed version cleaned up"),h instanceof Error?h:new Error(String(h))}let d=((performance.now()-c)/1e3).toFixed(2);u.stop(`Bundle uploaded \u{1F4AA} in (${d} seconds)`),a.verbose&&(p.info("[Verbose] Upload successful:"),p.info(` - Upload time: ${d} seconds`),p.info(` - Upload method: ${l?"TUS (resumable)":"Standard HTTP PUT"}`),p.info(` - Bundle size: ${Math.floor(i.byteLength/1024)} KB`),p.info("[Verbose] Sending performance event...")),await be(t,{channel:"performance",event:l?"TUS upload zip performance":"Upload zip performance",icon:"\u{1F684}",user_id:o,tags:{"app-id":r,time:d},notify:!1},a.verbose),a.verbose&&p.info("[Verbose] Performance event sent successfully")}async function WM(t,e,r){let{data:n,error:o}=await t.from("channels").select("version ( id, name, deleted )").eq("app_id",e).eq("name",r);if(o){p.error(`Cannot delete linked bundle on upload ${L(o)}`);return}if(n.length===0){p.warn("No linked bundle found in the channel you are trying to upload to");return}let i=n[0].version;if(i.deleted){p.warn("The linked bundle is already deleted");return}let{error:a}=await t.from("app_versions").update({deleted:!0}).eq("id",i.id);if(a){p.error(`Cannot delete linked bundle on upload ${L(a)}`);return}p.info("Linked bundle deleted")}async function KM(t,e,r,n,o,i,a,s,u,c){let{data:l}=await t.rpc("get_app_versions",{apikey:e,name_version:n,appid:s}).single();l||me("Cannot get version id, cannot set channel");let{data:f}=await t.rpc("is_allowed_capgkey",{apikey:e,keymode:["write","all"]}).single();if(f){let{error:d,data:h}=await Fl(t,{name:o,app_id:s,created_by:i,version:l,owner_org:a,...c?{allow_device_self_set:!0}:{}});d&&me(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${L(d)}`);let m=`${u.hostWeb}/app/p/${s}/channel/${h.id}`;h?.public?p.info("Your update is now available in your public channel \u{1F389}"):h?.id&&p.info(`Link device to this bundle to try it: ${m}`),r&&p.info(`Bundle url: ${m}`)}else p.warn("The upload key is not allowed to set the version in the channel")}async function YM(t,e,r){let{error:n,data:o}=await e.from("apps").select("default_upload_channel").eq("app_id",t).single();return n?(p.warn("Cannot find default upload channel"),p.info(`You can set it here: ${r}/app/p/${t}/settings`),null):o.default_upload_channel}async function Ug(t,e,r=!1){r||Z(`Uploading with CLI version ${hr.version}`);let n,o=Qe();await de();let{s3Region:i,s3Apikey:a,s3Apisecret:s,s3BucketName:u,s3Endpoint:c,s3Port:l,s3SSL:f}=e;e.verbose&&(p.info("[Verbose] Starting upload process with options:"),p.info(` - API key: ${e.apikey?"provided":"from saved key"}`),p.info(` - Path: ${e.path||"from capacitor config"}`),p.info(` - Channel: ${e.channel||"from default upload channel"}`),p.info(` - Bundle: ${e.bundle||"auto-detected"}`),p.info(` - External: ${e.external||"false"}`),p.info(` - Encryption: ${e.keyV2||e.keyDataV2?"v2":e.key===!1?"disabled":"auto"}`),p.info(` - Upload method: ${e.tus?"TUS":e.zip?"ZIP":"auto"}`),p.info(` - Delta updates: ${e.delta||e.partial?"enabled":"disabled"}`));let d=UM(e);e.verbose&&p.info("[Verbose] API key retrieved successfully");let h=await te();e.verbose&&p.info("[Verbose] Capacitor config loaded successfully");let m=await K1();e.verbose&&(p.info("[Verbose] Remote file config retrieved:"),p.info(` - Max upload length: ${Math.floor(m.maxUploadLength/1024/1024)} MB`),p.info(` - Alert upload size: ${Math.floor(m.alertUploadSize/1024/1024)} MB`),p.info(` - TUS upload: ${m.TUSUpload?"enabled":"disabled"}`),p.info(` - TUS upload forced: ${m.TUSUploadForced?"yes":"no"}`),p.info(` - Partial upload: ${m.partialUpload?"enabled":"disabled"}`),p.info(` - Max chunk size: ${Math.floor(m.maxChunkSize/1024/1024)} MB`));let{appid:b,path:D}=MM(t,e,h.config);e.verbose&&p.info(`[Verbose] App ID: ${b}, Build path: ${D}`);let C=await LM(h.config,e);e.verbose&&p.info(`[Verbose] Bundle version: ${C}`);let E=e.external?"external":"r2-direct",g="none";e.autoSetBundle&&(await vs({version:C}),e.verbose&&p.info("[Verbose] Auto-set bundle version in capacitor.config.json")),qM(e,D),e.verbose&&p.info("[Verbose] Code check passed (notifyAppReady found and index.html present)"),p.info(`Upload ${b}@${C} started from path "${D}" to Capgo cloud`);let _=await ir();e.verbose&&p.info(`[Verbose] Local config loaded: host=${_.hostWeb}`),e.supaHost&&e.supaAnon&&(p.info("Using custom supabase instance from provided options"),_.supaHost=e.supaHost,_.supaKey=e.supaAnon,e.verbose&&p.info(`[Verbose] Custom Supabase host: ${e.supaHost}`));let S=await ne(d,e.supaHost,e.supaAnon);e.verbose&&p.info("[Verbose] Supabase client created successfully");let P=await oe(S,d,["write","all","upload"]);e.verbose&&p.info(`[Verbose] User verified successfully, user_id: ${P}`);let k=e.channel||await YM(b,S,_.hostWeb)||"dev";e.verbose&&p.info(`[Verbose] Target channel: ${k}`);let B=await ar(S,b);e.verbose&&p.info(`[Verbose] Organization ID: ${B}`),await Z1(S,B,hr.version),e.verbose&&p.info("[Verbose] Remote CLI messages checked"),await e2(S,B,d,b,!0),e.verbose&&p.info("[Verbose] Plan validation passed"),e.verbose&&p.info("[Verbose] Trial check completed"),e.verbose&&p.info(`[Verbose] Checking compatibility with channel ${k}...`);let{nativePackages:R,minUpdateVersion:N}=await HM(S,o,e,k,b,C);e.verbose&&(p.info("[Verbose] Compatibility check completed:"),p.info(` - Native packages: ${R?R.length:0}`),p.info(` - Min update version: ${N||"none"}`)),e.verbose&&p.info(`[Verbose] Checking if version ${C} already exists...`);let A=await VM(S,b,C,e.versionExistsOk);if(e.verbose&&p.info(`[Verbose] Version exists check: ${A?"yes (skipping)":"no (continuing)"}`),A)return{success:!0,skipped:!0,reason:"VERSION_EXISTS",bundle:C,checksum:null,encryptionMethod:g,storageProvider:E};e.external&&!e.external.startsWith("https://")&&me(`External link should should start with "https://" current is "${e.external}"`),e.deleteLinkedBundleOnUpload&&(p.warn("Deleting linked bundle on upload is destructive, it will delete the currently linked bundle in the channel you are trying to upload to."),p.warn("Please make sure you want to do this, if you are not sure, please do not use this option."));let U={name:C,app_id:b,session_key:void 0,external_url:e.external,storage_provider:E,min_update_version:N,native_packages:R,owner_org:B,user_id:P,checksum:void 0,link:e.link||null,comment:e.comment||null},M=null,Q="";if(e.external)e.verbose&&p.info(`[Verbose] Using external URL: ${e.external}`),await be(d,{channel:"app",event:"App external",icon:"\u{1F4E4}",user_id:B,tags:{"app-id":b},notify:!1},e.verbose),U.session_key=e.ivSessionKey,U.checksum=e.encryptedChecksum,e.verbose&&(p.info("[Verbose] External bundle configured:"),p.info(` - URL: ${e.external}`),p.info(` - IV Session Key: ${e.ivSessionKey?"provided":"none"}`),p.info(` - Encrypted Checksum: ${e.encryptedChecksum?"provided":"none"}`));else{e.verbose&&p.info(`[Verbose] Preparing bundle file from path: ${D}`);let{zipped:F,ivSessionKey:I,checksum:O,sessionKey:q,encryptionMethod:T,finalKeyData:j}=await zM(D,e,d,B,b,m.maxUploadLength,m.alertUploadSize);U.session_key=I,U.checksum=O,n=q,M=F,g=T,Q=j,e.verbose&&(p.info("[Verbose] Bundle prepared:"),p.info(` - Size: ${Math.floor((F?.byteLength??0)/1024)} KB`),p.info(` - Checksum: ${O}`),p.info(` - Encryption: ${T}`),p.info(` - IV Session Key: ${I?"present":"none"}`)),e.ignoreChecksumCheck||(e.verbose&&p.info("[Verbose] Checking for duplicate checksum..."),await l2(S,b,k,O),e.verbose&&p.info("[Verbose] Checksum is unique"))}if(e.zip?(e.tus=!1,e.verbose&&p.info("[Verbose] Upload method: ZIP (explicitly set via --zip)")):!m.TUSUpload||e.external?(e.tus=!1,e.verbose&&p.info("[Verbose] Upload method: Standard (TUS not available or external URL)")):(e.tus=e.tus||m.TUSUploadForced,e.verbose&&p.info(`[Verbose] Upload method: ${e.tus?"TUS (resumable)":"Standard"}`)),!m.partialUpload||e.external?(e.delta=!1,e.verbose&&e.external&&p.info("[Verbose] Delta updates disabled (not available with external URLs)")):(e.delta=e.delta||e.partial||e.deltaOnly||e.partialOnly||m.partialUploadForced,e.verbose&&p.info(`[Verbose] Delta updates: ${e.delta?"enabled":"disabled"}`)),e.encryptPartial&&g==="v1"&&me("You cannot encrypt the partial update if you are not using the v2 encryption method"),e.delta&&g==="v2"&&!e.encryptPartial){let F=yt((0,Lg.cwd)()),I=await rn("@capgo/capacitor-updater",F,e.packageJson),O;try{O=I?_e(I):void 0}catch{O=void 0}I&&O&&hn(O,_e("6.14.4"))&&(p.info(`Auto-enabling partial update encryption for updater version ${O} (> 6.14.4)`),e.verbose&&p.info("[Verbose] Partial encryption auto-enabled for updater >= 6.14.4"),e.encryptPartial=!0)}e.verbose&&e.delta&&p.info("[Verbose] Preparing delta/partial update manifest...");let $=e.delta?await lF(D,d,B,b,e.encryptPartial?g:"none",Q):[];e.verbose&&e.delta&&p.info(`[Verbose] Delta manifest prepared with ${$.length} files`),e.verbose&&p.info("[Verbose] Creating version record in database...");let{error:y}=await cg(S,U);if(y&&me(`Cannot add bundle ${L(y)}`),e.verbose&&p.info("[Verbose] Version record created successfully"),e.tusChunkSize&&e.tusChunkSize>m.maxChunkSize?(p.error(`Chunk size ${e.tusChunkSize} is greater than the maximum chunk size ${m.maxChunkSize}, using the maximum chunk size`),e.tusChunkSize=m.maxChunkSize):e.tusChunkSize||(e.tusChunkSize=m.maxChunkSize),e.verbose&&p.info(`[Verbose] TUS chunk size: ${Math.floor(e.tusChunkSize/1024/1024)} MB`),M&&(u||c||i||a||s||l||f)){(!u||!c||!i||!a||!s||!l)&&me("Missing argument, for S3 upload you need to provide a bucket name, endpoint, region, port, API key, and API secret"),p.info("Uploading to S3"),e.verbose&&(p.info("[Verbose] S3 configuration:"),p.info(` - Endpoint: ${c}`),p.info(` - Region: ${i}`),p.info(` - Bucket: ${u}`),p.info(` - Port: ${l}`),p.info(` - SSL: ${f?"enabled":"disabled"}`));let F=f?`https://${c}`:`http://${c}`,I=new Ss({endPoint:c,region:i,port:l,pathStyle:!0,bucket:u,accessKey:a,secretKey:s}),O=`${b}-${C}`,q=encodeURIComponent(O);e.verbose&&p.info(`[Verbose] Uploading to S3 as: ${O}`),await I.putObject(O,Uint8Array.from(M)),U.external_url=`${F}/${q}`,U.storage_provider="external",e.verbose&&p.info(`[Verbose] S3 upload complete, external URL: ${U.external_url}`)}else if(M){!e.partialOnly&&!e.deltaOnly?(e.verbose&&p.info("[Verbose] Starting full bundle upload to Capgo Cloud..."),await GM(d,S,b,C,B,M,e,e.tusChunkSize)):e.verbose&&p.info("[Verbose] Skipping full bundle upload (delta-only mode)");let F=null;try{e.dryUpload&&(e.delta=!1,e.verbose&&p.info("[Verbose] Dry upload mode: skipping delta upload"));let O=U.session_key&&e.encryptPartial&&n?{sessionKey:n,ivSessionKey:U.session_key}:void 0;e.verbose&&e.delta&&(p.info("[Verbose] Starting delta/partial file upload..."),p.info(` - Manifest entries: ${$.length}`),p.info(` - Encryption: ${O?"enabled":"disabled"}`)),F=e.delta?await fF(d,$,D,b,B,O,e):null,e.verbose&&F&&p.info(`[Verbose] Delta upload complete with ${F.length} files`)}catch(O){if(!!(e.partial||e.delta||e.partialOnly||e.deltaOnly))throw O;p.info(`Failed to upload partial files to capgo cloud. Error: ${L(O)}. This is not a critical error, the bundle has been uploaded without the partial files`),e.verbose&&p.info(`[Verbose] Delta upload error details: ${L(O)}`)}U.storage_provider="r2",U.manifest=F,e.verbose&&p.info("[Verbose] Updating version record with storage provider and manifest...");let{error:I}=await cg(S,U);I&&me(`Cannot update bundle ${L(I)}`),e.verbose&&p.info("[Verbose] Version record updated successfully")}e.verbose&&p.info("[Verbose] Checking app permissions...");let v=await Ue(S,d,b,2);e.verbose&&(p.info("[Verbose] Permissions:"),p.info(` - Upload: ${Ki(v,2)?"yes":"no"}`),p.info(` - Write: ${Ki(v,3)?"yes":"no"}`),p.info(` - Admin: ${Ki(v,4)?"yes":"no"}`)),e.deleteLinkedBundleOnUpload&&Ki(v,3)?(e.verbose&&p.info(`[Verbose] Deleting linked bundle in channel ${k}...`),await WM(S,b,k)):e.deleteLinkedBundleOnUpload&&p.warn("Cannot delete linked bundle on upload as a upload organization member"),Ki(v,3)?(e.verbose&&p.info(`[Verbose] Setting bundle ${C} to channel ${k}...`),await KM(S,d,!!e.bundleUrl,C,k,P,B,b,_,e.selfAssign),e.verbose&&p.info("[Verbose] Channel updated successfully")):p.warn("Cannot set channel as a upload organization member"),e.verbose&&p.info("[Verbose] Sending upload event..."),await be(d,{channel:"app",event:"App Uploaded",icon:"\u23EB",user_id:B,tags:{"app-id":b},notify:!1},e.verbose);let w={success:!0,bundle:C,checksum:U.checksum??null,encryptionMethod:g,sessionKey:n?n.toString("base64"):void 0,ivSessionKey:typeof U.session_key=="string"?U.session_key:void 0,storageProvider:U.storage_provider};return e.verbose&&(p.info("[Verbose] Upload completed successfully:"),p.info(` - Bundle: ${w.bundle}`),p.info(` - Checksum: ${w.checksum}`),p.info(` - Encryption: ${w.encryptionMethod}`),p.info(` - Storage: ${w.storageProvider}`)),r&&!w.skipped&&J("Time to share your update to the world \u{1F30D}"),w}function JM(t){t.ivSessionKey&&!t.external&&me("You need to provide an external url if you want to use the --iv-session-key option"),t.encryptedChecksum&&!t.external&&me("You need to provide an external url if you want to use the --encrypted-checksum option"),(t.partial||t.delta||t.partialOnly||t.deltaOnly)&&t.external&&me("You cannot use the --partial/--delta/--partial-only/--delta-only option with an external url"),t.tus&&t.external&&me("You cannot use the --tus option with an external url"),t.dryUpload&&t.external&&me("You cannot use the --dry-upload option with an external url"),t.multipart&&t.external&&me("You cannot use the --multipart option with an external url"),t.external&&(t.keyV2||t.keyDataV2)&&me("You cannot set a key if you are uploading to an external url"),t.keyV2&&t.keyDataV2&&me("You cannot set both key-v2 and key-data-v2"),t.external&&(t.s3Region||t.s3Apikey||t.s3Apisecret||t.s3Endpoint||t.s3BucketName||t.s3Port||t.s3SSL)&&me("You cannot set S3 options if you are uploading to an external url, it's automatically handled"),t.encryptedChecksum&&!t.external&&me("You cannot set the --encrypted-checksum option if you are not uploading to an external url"),t.minUpdateVersion&&t.autoMinUpdateVersion&&me("You cannot set both min-update-version and auto-min-update-version, use only one of them")}async function dF(t,e){try{JM(e),await Ug(t,e)}catch(r){throw p.error(`uploadBundle failed: ${L(r)}`),r instanceof Error?r:new Error(String(r))}}var hF=require("node:crypto"),Jl=require("node:fs"),mF=require("node:process");var XM=20;function ZM(t){console.log(JSON.stringify(t,null,2))}function Ps(t){console.error(L(t))}async function QM(t,e,r=!1){let{json:n}=e,{bundle:o,path:i}=e,a=!n&&!r;try{a&&await de();let s=await te(),u=he(t,s?.config),c=(0,hF.randomUUID)().split("-")[0],l=_r("",e.packageJson);if(o=o||l||`0.0.1-beta.${c}`,a&&Z(`Zipping ${u}@${o}`),o&&!Wi.test(o)){let P=`Your bundle name ${o}, is not valid it should follow semver convention : https://semver.org/`;throw r||(n?Ps({error:"invalid_semver"}):p.error(P)),new Error("Invalid bundle version format")}if(i=i||s?.config?.webDir,!u||!o||!i){let P="Missing argument, you need to provide a appId and a bundle and a path, or be in a capacitor project";throw r||(n?Ps({error:"missing_argument"}):p.error(P)),new Error(P)}if(a&&p.info(`Started from path "${i}"`),typeof e.codeCheck>"u"?!0:e.codeCheck){if(!Fs(i,"notifyAppReady"))throw r||(n?Ps({error:"notifyAppReady_not_in_source_code"}):p.error("notifyAppReady() is missing in the build folder of your app. see: https://capgo.app/docs/plugin/api/#notifyappready")),new Error("notifyAppReady() is missing in build folder");if(!Ml(i))throw r||(n?Ps({error:"index_html_not_found"}):p.error(`index.html is missing in the root folder of ${i}`)),new Error("index.html is missing in root folder")}let d=await Sl(i);a&&p.info(`Zipped ${d.byteLength} bytes`);let h=a?we():null;h&&h.start("Calculating checksum");let m=yt((0,mF.cwd)()),b=await rn("@capgo/capacitor-updater",m,e.packageJson);if(!b){let P="Cannot find @capgo/capacitor-updater in node_modules, please install it first with your package manager";throw r||p.warn(P),new Error(P)}let D=!1,C;try{C=b?_e(b):void 0}catch{C=void 0}if(C){let P=C.major===6&&hn(C,_e("6.25.0")),k=C.major>=7;D=P||k}else b==="link:@capgo/capacitor-updater"&&(r||p.warn("Using local @capgo/capacitor-updater. Assuming v7"),D=!0);let E=await Xr(d,e.keyV2||(0,Jl.existsSync)(Wt)||D?"sha256":"crc32");h&&h.stop(`Checksum ${D?"SHA256":"CRC32"}: ${E}`);let g=Math.floor(d.byteLength/1024/1024);g>XM&&a&&(p.warn(`WARNING !!
|
|
205
205
|
The bundle size is ${g} Mb, this may take a while to download for users
|
|
206
206
|
`),p.warn(`Learn how to optimize your assets https://capgo.app/blog/optimise-your-images-for-updates/
|
|
207
207
|
`));let _=a?we():null,S=e.name||`${u}_${o}.zip`;return _&&_.start(`Saving to ${S}`),(0,Jl.writeFileSync)(S,d),_&&_.stop(`Saved to ${S}`),a&&J("Done \u2705"),!r&&n&&ZM({bundle:o,filename:S,checksum:E}),{bundle:o,filename:S,checksum:E}}catch(s){throw r||(n?Ps(s):p.error(L(s))),s instanceof Error?s:new Error(String(s))}}async function gF(t,e){await QM(t,e,!1)}async function Mg(t,e,r,n=!1){n||Z("Create channel"),r.apikey=r.apikey||ie();let o=await te().catch(()=>{});if(e=he(e,o?.config),!r.apikey)throw n||p.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let i=await ne(r.apikey,r.supaHost,r.supaAnon);await oe(i,r.apikey,["write","all"]),await Ue(i,r.apikey,e,4,n),n||p.info(`Creating channel ${e}#${t} to Capgo`);let a=await dg(i,e);if(!a)throw n||p.error("Cannot find default version for channel creation, please contact Capgo support \u{1F928}"),new Error("Cannot find default version for channel creation");let s=await ar(i,e),u=await oe(i,r.apikey,["write","all"]),c=await C2(i,{name:t,app_id:e,version:a.id,created_by:u,owner_org:s,allow_device_self_set:r.selfAssign??!1,public:r.default??!1});if(c.error)throw n||p.error(`Cannot create Channel \u{1F640}
|
|
208
|
-
${L(c.error)}`),new Error(`Cannot create channel: ${L(c.error)}`);return await be(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:s,tags:{"app-id":e,channel:t},notify:!1}).catch(()=>{}),n||(p.success("Channel created \u2705"),J("Done \u2705")),c.data??!0}async function DF(t,e,r){await Mg(t,e,r,!1)}async function e9(t,e,r,n=!1){let{quiet:o}=r;!o&&!n&&Z("List current bundle"),r.apikey=r.apikey||ie(o);let i=await te();if(e=he(e,i?.config),!r.apikey)throw n||p.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let a=await ne(r.apikey,r.supaHost,r.supaAnon);if(await oe(a,r.apikey,["write","all","read"]),await Ue(a,r.apikey,e,1,n),!t)throw n||p.error("Please provide a channel to get the bundle from."),new Error("Channel name missing");let{data:s,error:u}=await a.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);if(u||!s?.length)throw n||p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exist?`),new Error(`Channel ${t} not found for app ${e}`);let{version:c}=s[0];if(!c)throw n||p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exist?`),new Error(`Channel ${t} does not have a bundle linked`);return n||(o?p.info(c.name):p.info(`Current bundle for channel ${t} is ${c.name}`)),c.name}async function yF(t,e,r){return e9(t,e,r)}async function t9(t,e,r,n=!1){n||Z("Delete channel"),r.apikey=r.apikey||ie();let o=await te();if(e=he(e,o?.config),!r.apikey)throw n||p.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let i=await ne(r.apikey,r.supaHost,r.supaAnon),a=await oe(i,r.apikey,["all"]);if(await Ue(i,r.apikey,e,4,n),r.deleteBundle&&!n&&p.info(`Deleting bundle ${e}#${t} from Capgo`),r.deleteBundle){let d=await S2(i,e,t);d?.name&&!n&&p.info(`Deleting bundle ${d.name} from Capgo`),d?.name&&await hg(i,e,d.name)}let{data:s,error:u}=await _2(i,e,t);if(u||!s){if(n||p.error(`Channel ${t} not found`),r.successIfNotFound)return n||p.success(`Channel ${t} not found and successIfNotFound is true`),!0;throw new Error(`Channel ${t} not found`)}let{error:c}=await x2(i,e,s.id);if(c)throw n||p.error(`Cannot delete channel devices: ${L(c)}`),new Error(`Cannot delete channel devices: ${L(c)}`);n||p.info(`Deleting channel ${e}#${t} from Capgo`);let l=await E2(i,t,e,a);if(l.error)throw n||p.error(`Cannot delete Channel \u{1F640} ${L(l.error)}`),new Error(`Cannot delete channel: ${L(l.error)}`);let f=await ar(i,e);return await be(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:f,tags:{"app-id":e,channel:t},notify:!1}).catch(()=>{}),n||(p.success("Channel deleted"),J("Done \u2705")),!0}async function bF(t,e,r){return t9(t,e,r,!1)}async function r9(t,e,r=!1){r||Z("List channels"),e.apikey=e.apikey||ie();let n=await te();if(t=he(t,n?.config),!e.apikey)throw r||p.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!t)throw r||p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let o=await ne(e.apikey,e.supaHost,e.supaAnon),i=await oe(o,e.apikey,["write","all","read","upload"]);await Ue(o,e.apikey,t,1,r),r||p.info("Querying available channels in Capgo");let a=await A2(o,t);return r||(p.info(`Active channels in Capgo: ${a?.length??0}`),F2(a)),await be(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(()=>{}),r||J("Done \u2705"),a}async function vF(t,e){return r9(t,e,!1)}var wF=["major","minor","metadata","patch","none"];async function n9(t,e,r,n=!1){n||Z("Set channel"),r.apikey=r.apikey||ie();let o=await te();if(e=he(e,o?.config),!r.apikey)throw n||p.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");if(!t)throw n||p.error("Missing argument, you need to provide a channel"),new Error("Missing channel id");let i=await ne(r.apikey,r.supaHost,r.supaAnon),a=await oe(i,r.apikey,["write","all"]);await Ue(i,r.apikey,e,4,n);let s=await ar(i,e),{bundle:u,state:c,downgrade:l,latest:f,latestRemote:d,ios:h,android:m,selfAssign:b,disableAutoUpdate:D,dev:C,emulator:E}=r;if(f&&u)throw n||p.error("Cannot set latest and bundle at the same time"),new Error("Cannot set both latest and bundle simultaneously");if(d&&u)throw n||p.error("Cannot set latest remote and bundle at the same time"),new Error("Cannot set both latest remote and bundle simultaneously");if(d&&f)throw n||p.error("Cannot set latest remote and latest at the same time"),new Error("Cannot set both latest remote and latest simultaneously");if(u==null&&c==null&&f==null&&d==null&&l==null&&h==null&&m==null&&b==null&&C==null&&E==null&&D==null)throw n||p.error("Missing argument, you need to provide a option to set"),new Error("No channel option provided");await Q1(i,s,r.apikey,e);let g={created_by:a,app_id:e,name:t,owner_org:s,version:void 0},{error:_}=await i.from("channels").select().eq("app_id",e).eq("name",t).single();if(_)throw n||p.error(`Cannot find channel ${t}`),new Error(`Cannot find channel ${t}`);let S=f?o?.config?.plugins?.CapacitorUpdater?.version||_r("",r.packageJson):u;if(S!=null){let{data:k,error:B}=await i.from("app_versions").select().eq("app_id",e).eq("name",S).eq("user_id",a).eq("deleted",!1).single();if(B||!k)throw n||p.error(`Cannot find version ${S}`),new Error(`Cannot find version ${S}`);if(!r.ignoreMetadataCheck){let{finalCompatibility:R,localDependencies:N}=await fg(i,e,t,k.native_packages??[]),A=Qe();if(N.length>0&&R.some(U=>!So(U)))throw n||(p.warn(`Bundle NOT compatible with ${t} channel`),p.warn(`You can check compatibility with "${A.runner} @capgo/cli bundle compatibility"`)),new Error(`Bundle is not compatible with ${t} channel`);n||(N.length===0&&R.length>0?p.info(`Ignoring check compatibility with ${t} channel because the bundle does not contain any native packages`):p.info(`Bundle is compatible with ${t} channel`))}n||p.info(`Set ${e} channel: ${t} to @${S}`),g.version=k.id}if(d){let{data:k,error:B}=await i.from("app_versions").select().eq("app_id",e).eq("user_id",a).eq("deleted",!1).order("created_at",{ascending:!1}).single();if(B||!k)throw n||p.error("Cannot find latest remote version"),new Error("Cannot find latest remote version");if(!r.ignoreMetadataCheck){let{finalCompatibility:R}=await fg(i,e,t,k.native_packages??[]),N=Qe();if(R.some(A=>!So(A)))throw n||(p.warn(`Bundle NOT compatible with ${t} channel`),p.warn(`You can check compatibility with "${N.runner} @capgo/cli bundle compatibility"`)),new Error(`Latest remote bundle is not compatible with ${t} channel`)}n||p.info(`Set ${e} channel: ${t} to @${k.name}`),g.version=k.id}if(c!=null){if(c!=="normal"&&c!=="default")throw n||p.error(`State ${c} is not known. The possible values are: normal, default.`),new Error(`Unknown state ${c}. Expected normal or default`);n||p.info(`Set ${e} channel: ${t} to ${c}`),g.public=c==="default"}if(l!=null&&(n||p.info(`Set ${e} channel: ${t} to ${l?"allow":"disallow"} downgrade`),g.disable_auto_update_under_native=!l),h!=null&&(n||p.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),g.ios=!!h),m!=null&&(n||p.info(`Set ${e} channel: ${t} to ${m?"allow":"disallow"} android update`),g.android=!!m),b!=null&&(n||p.info(`Set ${e} channel: ${t} to ${b?"allow":"disallow"} self assign to this channel`),g.allow_device_self_set=!!b),C!=null&&(n||p.info(`Set ${e} channel: ${t} to ${C?"allow":"disallow"} dev devices`),g.allow_dev=!!C),E!=null&&(n||p.info(`Set ${e} channel: ${t} to ${E?"allow":"disallow"} emulator devices`),g.allow_emulator=!!E),D!=null){let k=D.toLowerCase();if(!wF.includes(k))throw n||p.error(`Channel strategy ${k} is not known. The possible values are: ${wF.join(", ")}.`),new Error(`Unknown channel strategy ${k}`);k==="metadata"&&(k="version_number"),g.disable_auto_update=k,n||p.info(`Set ${e} channel: ${t} to ${k} disable update strategy to this channel`)}let{error:T}=await Fl(i,g);if(T)throw n||p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),new Error("Upload key is not allowed to set this channel");return await be(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch(()=>{}),n||J("Done \u2705"),!0}async function CF(t,e,r){return n9(t,e,r,!1)}var Ur=require("node:fs");function qg(t){let e="\u{1F539}";return t.includes("upload")?e="\u2B06\uFE0F":t.includes("delete")?e="\u{1F5D1}\uFE0F":t.includes("list")?e="\u{1F4CB}":t.includes("add")?e="\u2795":t.includes("set")?e="\u2699\uFE0F":t.includes("create")?e="\u{1F528}":t.includes("encrypt")?e="\u{1F512}":t.includes("decrypt")?e="\u{1F513}":t.includes("debug")?e="\u{1F41E}":t.includes("doctor")?e="\u{1F468}\u200D\u2695\uFE0F":t.includes("login")?e="\u{1F511}":t.includes("init")?e="\u{1F680}":t.includes("compatibility")?e="\u{1F9EA}":t.includes("cleanup")?e="\u{1F9F9}":t.includes("currentBundle")?e="\u{1F4E6}":t.includes("setting")?e="\u2699\uFE0F":t==="app"?e="\u{1F4F1}":t==="bundle"?e="\u{1F4E6}":t==="channel"?e="\u{1F4E2}":t==="key"?e="\u{1F510}":t==="account"&&(e="\u{1F464}"),e}function EF(t="./README.md",e){let r=ft.commands.map(o=>{let i=o,a=i._actionHandler!==null&&i._actionHandler!==void 0,u=o.commands&&o.commands.length>0&&!a;return{name:o.name(),alias:o.alias()||"",description:o.description(),options:o.options.map(c=>({flags:c.flags,description:c.description||""})),subcommands:o.commands?o.commands.map(c=>{let l=c,f=l._actionHandler!==null&&l._actionHandler!==void 0;return{name:c.name(),alias:c.alias()||"",description:c.description(),options:c.options.map(d=>({flags:d.flags,description:d.description||""})),subcommands:[],hasAction:f,isCommandGroup:!1}}):[],hasAction:a,isCommandGroup:u}}),n=(o,i=!1,a,s=!1)=>{let u=o.name,c=u.charAt(0).toUpperCase()+u.slice(1),l;i?l=a?`${a}-${u}`:u:l=s?"options":u;let f=i?"###":"##",d="",h=qg(u);s&&!i||(d+=`${f} <a id="${l}"></a> ${h} **${c}**
|
|
208
|
+
${L(c.error)}`),new Error(`Cannot create channel: ${L(c.error)}`);return await be(r.apikey,{channel:"channel",event:"Create channel",icon:"\u2705",user_id:s,tags:{"app-id":e,channel:t},notify:!1}).catch(()=>{}),n||(p.success("Channel created \u2705"),J("Done \u2705")),c.data??!0}async function DF(t,e,r){await Mg(t,e,r,!1)}async function e9(t,e,r,n=!1){let{quiet:o}=r;!o&&!n&&Z("List current bundle"),r.apikey=r.apikey||ie(o);let i=await te();if(e=he(e,i?.config),!r.apikey)throw n||p.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let a=await ne(r.apikey,r.supaHost,r.supaAnon);if(await oe(a,r.apikey,["write","all","read"]),await Ue(a,r.apikey,e,1,n),!t)throw n||p.error("Please provide a channel to get the bundle from."),new Error("Channel name missing");let{data:s,error:u}=await a.from("channels").select("version ( name )").eq("name",t).eq("app_id",e).limit(1);if(u||!s?.length)throw n||p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exist?`),new Error(`Channel ${t} not found for app ${e}`);let{version:c}=s[0];if(!c)throw n||p.error(`Error retrieving channel ${t} for app ${e}. Perhaps the channel does not exist?`),new Error(`Channel ${t} does not have a bundle linked`);return n||(o?p.info(c.name):p.info(`Current bundle for channel ${t} is ${c.name}`)),c.name}async function yF(t,e,r){return e9(t,e,r)}async function t9(t,e,r,n=!1){n||Z("Delete channel"),r.apikey=r.apikey||ie();let o=await te();if(e=he(e,o?.config),!r.apikey)throw n||p.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let i=await ne(r.apikey,r.supaHost,r.supaAnon),a=await oe(i,r.apikey,["all"]);if(await Ue(i,r.apikey,e,4,n),r.deleteBundle&&!n&&p.info(`Deleting bundle ${e}#${t} from Capgo`),r.deleteBundle){let d=await S2(i,e,t);d?.name&&!n&&p.info(`Deleting bundle ${d.name} from Capgo`),d?.name&&await hg(i,e,d.name)}let{data:s,error:u}=await _2(i,e,t);if(u||!s){if(n||p.error(`Channel ${t} not found`),r.successIfNotFound)return n||p.success(`Channel ${t} not found and successIfNotFound is true`),!0;throw new Error(`Channel ${t} not found`)}let{error:c}=await x2(i,e,s.id);if(c)throw n||p.error(`Cannot delete channel devices: ${L(c)}`),new Error(`Cannot delete channel devices: ${L(c)}`);n||p.info(`Deleting channel ${e}#${t} from Capgo`);let l=await E2(i,t,e,a);if(l.error)throw n||p.error(`Cannot delete Channel \u{1F640} ${L(l.error)}`),new Error(`Cannot delete channel: ${L(l.error)}`);let f=await ar(i,e);return await be(r.apikey,{channel:"channel",event:"Delete channel",icon:"\u2705",user_id:f,tags:{"app-id":e,channel:t},notify:!1}).catch(()=>{}),n||(p.success("Channel deleted"),J("Done \u2705")),!0}async function bF(t,e,r){return t9(t,e,r,!1)}async function r9(t,e,r=!1){r||Z("List channels"),e.apikey=e.apikey||ie();let n=await te();if(t=he(t,n?.config),!e.apikey)throw r||p.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!t)throw r||p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");let o=await ne(e.apikey,e.supaHost,e.supaAnon),i=await oe(o,e.apikey,["write","all","read","upload"]);await Ue(o,e.apikey,t,1,r),r||p.info("Querying available channels in Capgo");let a=await A2(o,t);return r||(p.info(`Active channels in Capgo: ${a?.length??0}`),F2(a)),await be(e.apikey,{channel:"channel",event:"List channel",icon:"\u2705",user_id:i,tags:{"app-id":t},notify:!1}).catch(()=>{}),r||J("Done \u2705"),a}async function vF(t,e){return r9(t,e,!1)}var wF=["major","minor","metadata","patch","none"];async function n9(t,e,r,n=!1){n||Z("Set channel"),r.apikey=r.apikey||ie();let o=await te();if(e=he(e,o?.config),!r.apikey)throw n||p.error("Missing API key, you need to provide an API key to upload your bundle"),new Error("Missing API key");if(!e)throw n||p.error("Missing argument, you need to provide a appId, or be in a capacitor project"),new Error("Missing appId");if(!t)throw n||p.error("Missing argument, you need to provide a channel"),new Error("Missing channel id");let i=await ne(r.apikey,r.supaHost,r.supaAnon),a=await oe(i,r.apikey,["write","all"]);await Ue(i,r.apikey,e,4,n);let s=await ar(i,e),{bundle:u,state:c,downgrade:l,latest:f,latestRemote:d,ios:h,android:m,selfAssign:b,disableAutoUpdate:D,dev:C,emulator:E}=r;if(f&&u)throw n||p.error("Cannot set latest and bundle at the same time"),new Error("Cannot set both latest and bundle simultaneously");if(d&&u)throw n||p.error("Cannot set latest remote and bundle at the same time"),new Error("Cannot set both latest remote and bundle simultaneously");if(d&&f)throw n||p.error("Cannot set latest remote and latest at the same time"),new Error("Cannot set both latest remote and latest simultaneously");if(u==null&&c==null&&f==null&&d==null&&l==null&&h==null&&m==null&&b==null&&C==null&&E==null&&D==null)throw n||p.error("Missing argument, you need to provide a option to set"),new Error("No channel option provided");await Q1(i,s,r.apikey,e);let g={created_by:a,app_id:e,name:t,owner_org:s,version:void 0},{error:_}=await i.from("channels").select().eq("app_id",e).eq("name",t).single();if(_)throw n||p.error(`Cannot find channel ${t}`),new Error(`Cannot find channel ${t}`);let S=f?o?.config?.plugins?.CapacitorUpdater?.version||_r("",r.packageJson):u;if(S!=null){let{data:k,error:B}=await i.from("app_versions").select().eq("app_id",e).eq("name",S).eq("user_id",a).eq("deleted",!1).single();if(B||!k)throw n||p.error(`Cannot find version ${S}`),new Error(`Cannot find version ${S}`);if(!r.ignoreMetadataCheck){let{finalCompatibility:R,localDependencies:N}=await fg(i,e,t,k.native_packages??[]),A=Qe();if(N.length>0&&R.some(U=>!So(U)))throw n||(p.warn(`Bundle NOT compatible with ${t} channel`),p.warn(`You can check compatibility with "${A.runner} @capgo/cli bundle compatibility"`)),new Error(`Bundle is not compatible with ${t} channel`);n||(N.length===0&&R.length>0?p.info(`Ignoring check compatibility with ${t} channel because the bundle does not contain any native packages`):p.info(`Bundle is compatible with ${t} channel`))}n||p.info(`Set ${e} channel: ${t} to @${S}`),g.version=k.id}if(d){let{data:k,error:B}=await i.from("app_versions").select().eq("app_id",e).eq("user_id",a).eq("deleted",!1).order("created_at",{ascending:!1}).single();if(B||!k)throw n||p.error("Cannot find latest remote version"),new Error("Cannot find latest remote version");if(!r.ignoreMetadataCheck){let{finalCompatibility:R}=await fg(i,e,t,k.native_packages??[]),N=Qe();if(R.some(A=>!So(A)))throw n||(p.warn(`Bundle NOT compatible with ${t} channel`),p.warn(`You can check compatibility with "${N.runner} @capgo/cli bundle compatibility"`)),new Error(`Latest remote bundle is not compatible with ${t} channel`)}n||p.info(`Set ${e} channel: ${t} to @${k.name}`),g.version=k.id}if(c!=null){if(c!=="normal"&&c!=="default")throw n||p.error(`State ${c} is not known. The possible values are: normal, default.`),new Error(`Unknown state ${c}. Expected normal or default`);n||p.info(`Set ${e} channel: ${t} to ${c}`),g.public=c==="default"}if(l!=null&&(n||p.info(`Set ${e} channel: ${t} to ${l?"allow":"disallow"} downgrade`),g.disable_auto_update_under_native=!l),h!=null&&(n||p.info(`Set ${e} channel: ${t} to ${h?"allow":"disallow"} ios update`),g.ios=!!h),m!=null&&(n||p.info(`Set ${e} channel: ${t} to ${m?"allow":"disallow"} android update`),g.android=!!m),b!=null&&(n||p.info(`Set ${e} channel: ${t} to ${b?"allow":"disallow"} self assign to this channel`),g.allow_device_self_set=!!b),C!=null&&(n||p.info(`Set ${e} channel: ${t} to ${C?"allow":"disallow"} dev devices`),g.allow_dev=!!C),E!=null&&(n||p.info(`Set ${e} channel: ${t} to ${E?"allow":"disallow"} emulator devices`),g.allow_emulator=!!E),D!=null){let k=D.toLowerCase();if(!wF.includes(k))throw n||p.error(`Channel strategy ${k} is not known. The possible values are: ${wF.join(", ")}.`),new Error(`Unknown channel strategy ${k}`);k==="metadata"&&(k="version_number"),g.disable_auto_update=k,n||p.info(`Set ${e} channel: ${t} to ${k} disable update strategy to this channel`)}let{error:P}=await Fl(i,g);if(P)throw n||p.error('Cannot set channel the upload key is not allowed to do that, use the "all" for this.'),new Error("Upload key is not allowed to set this channel");return await be(r.apikey,{channel:"channel",event:"Set channel",icon:"\u2705",user_id:s,tags:{"app-id":e},notify:!1}).catch(()=>{}),n||J("Done \u2705"),!0}async function CF(t,e,r){return n9(t,e,r,!1)}var Ur=require("node:fs");function qg(t){let e="\u{1F539}";return t.includes("upload")?e="\u2B06\uFE0F":t.includes("delete")?e="\u{1F5D1}\uFE0F":t.includes("list")?e="\u{1F4CB}":t.includes("add")?e="\u2795":t.includes("set")?e="\u2699\uFE0F":t.includes("create")?e="\u{1F528}":t.includes("encrypt")?e="\u{1F512}":t.includes("decrypt")?e="\u{1F513}":t.includes("debug")?e="\u{1F41E}":t.includes("doctor")?e="\u{1F468}\u200D\u2695\uFE0F":t.includes("login")?e="\u{1F511}":t.includes("init")?e="\u{1F680}":t.includes("compatibility")?e="\u{1F9EA}":t.includes("cleanup")?e="\u{1F9F9}":t.includes("currentBundle")?e="\u{1F4E6}":t.includes("setting")?e="\u2699\uFE0F":t==="app"?e="\u{1F4F1}":t==="bundle"?e="\u{1F4E6}":t==="channel"?e="\u{1F4E2}":t==="key"?e="\u{1F510}":t==="account"&&(e="\u{1F464}"),e}function EF(t="./README.md",e){let r=ft.commands.map(o=>{let i=o,a=i._actionHandler!==null&&i._actionHandler!==void 0,u=o.commands&&o.commands.length>0&&!a;return{name:o.name(),alias:o.alias()||"",description:o.description(),options:o.options.map(c=>({flags:c.flags,description:c.description||""})),subcommands:o.commands?o.commands.map(c=>{let l=c,f=l._actionHandler!==null&&l._actionHandler!==void 0;return{name:c.name(),alias:c.alias()||"",description:c.description(),options:c.options.map(d=>({flags:d.flags,description:d.description||""})),subcommands:[],hasAction:f,isCommandGroup:!1}}):[],hasAction:a,isCommandGroup:u}}),n=(o,i=!1,a,s=!1)=>{let u=o.name,c=u.charAt(0).toUpperCase()+u.slice(1),l;i?l=a?`${a}-${u}`:u:l=s?"options":u;let f=i?"###":"##",d="",h=qg(u);s&&!i||(d+=`${f} <a id="${l}"></a> ${h} **${c}**
|
|
209
209
|
|
|
210
210
|
`),o.alias&&(d+=`**Alias:** \`${o.alias}\`
|
|
211
211
|
|