storeconfig 0.0.2 → 0.0.3
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/cli.js +70 -48
- package/dist/cli.js.map +4 -4
- package/package.json +4 -3
package/dist/cli.js
CHANGED
|
@@ -1,45 +1,68 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
3
|
-
${n.message}`,t=t.concat(n.details||[])}return{message:i,status:400,details:t}}return typeof r=="string"?{message:r,status:400}:r instanceof Error?{message:r.message,status:400}:{message:"Internal server error",status:500}}});var Ot=c(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.isValidProductId=void 0;Je.deepEqualUnordered=Ji;Je.readJsonFile=rp;Je.validateAppStoreModelData=ip;var Xd=require("zod"),Qd=require("fs"),ep=jr();function Ji(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(Array.isArray(r)&&Array.isArray(e)){if(r.length!==e.length)return!1;let t=new Array(e.length).fill(!1);for(let i of r){let n=!1;for(let o=0;o<e.length;o++)if(!t[o]&&Ji(i,e[o])){t[o]=!0,n=!0;break}if(!n)return!1}return!0}if(r&&e&&typeof r=="object"){let t=Object.keys(r),i=Object.keys(e);if(t.length!==i.length)return!1;for(let n of t)if(!Object.prototype.hasOwnProperty.call(e,n)||!Ji(r[n],e[n]))return!1;return!0}return!1}function rp(r){let e=(0,Qd.readFileSync)(r,"utf-8");try{return JSON.parse(e)}catch(t){throw new ep.ContextualError(`\u274C Invalid JSON format! ${r}`,{filePath:r,jsonError:t})}}var tp=r=>/^[a-zA-Z0-9._]+$/.test(r);Je.isValidProductId=tp;function ip(r,e){r.primaryLocale&&r.localizations&&r.localizations.length>0&&(r.localizations.some(i=>i.locale===r.primaryLocale)||e.addIssue({code:Xd.z.ZodIssueCode.custom,message:`Primary locale '${r.primaryLocale}' must exist in the localizations array`,path:["primaryLocale"]}))}});var ra=c((Bv,np)=>{np.exports=[{duration:7,durationType:"1w",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:2},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:3},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:4},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:5},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:6},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:7},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:8},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:9},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:10},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:11},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:12}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:30,durationType:"1m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:4},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:5},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:6},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:7},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:8},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:9},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:10},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:11},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:12}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:60,durationType:"2m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:4},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:5},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:6}]},{modeType:"FreeTrial",durations:[{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:90,durationType:"3m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:4}]},{modeType:"FreeTrial",durations:[{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:180,durationType:"6m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:2}]},{modeType:"FreeTrial",durations:[{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:365,durationType:"1y",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]}]});var Zi=c(Ce=>{"use strict";var op=Ce&&Ce.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.getValidIntroductoryOfferDurations=oa;Ce.getValidPayAsYouGoPeriods=aa;Ce.isValidIntroductoryOfferDuration=sp;Ce.isValidPayAsYouGoPeriods=up;var ta=op(ra()),ia={ONE_WEEK:7,ONE_MONTH:30,TWO_MONTHS:60,THREE_MONTHS:90,SIX_MONTHS:180,ONE_YEAR:365},na={PAY_AS_YOU_GO:"PayAsYouGo",PAY_UP_FRONT:"PayUpFront",FREE_TRIAL:"FreeTrial"};function ap(r,e){if(e==="ONE_MONTH")switch(r){case 1:return"ONE_MONTH";case 2:return"TWO_MONTHS";case 3:return"THREE_MONTHS";case 6:return"SIX_MONTHS";default:return null}else if(e==="ONE_WEEK")switch(r){case 1:return"ONE_WEEK";case 2:return"TWO_WEEKS";default:return null}else if(e==="ONE_DAY")switch(r){case 3:return"THREE_DAYS";default:return null}else if(e==="ONE_YEAR")switch(r){case 1:return"ONE_YEAR";default:return null}return null}function oa(r,e){if(e==="PAY_AS_YOU_GO")return[];let t=ia[r],i=na[e],n=ta.default.find(s=>s.duration===t);if(!n)throw new Error(`No duration configuration found for subscription period: ${r}`);let o=n.introOfferDurations.find(s=>s.modeType===i);if(!o)throw new Error(`No intro offer configuration found for offer type: ${e}`);let a=new Set;for(let s of o.durations){let u=ap(s.typeDuration,s.typeUnit);u&&a.add(u)}return Array.from(a)}function aa(r){let e=ia[r],t=na.PAY_AS_YOU_GO,i=ta.default.find(o=>o.duration===e);if(!i)throw new Error(`No duration configuration found for subscription period: ${r}`);let n=i.introOfferDurations.find(o=>o.modeType===t);if(!n)throw new Error(`No PAY_AS_YOU_GO configuration found for subscription period: ${r}`);return n.durations.map(o=>o.numberOfPeriods)}function sp(r,e,t){return e==="PAY_AS_YOU_GO"?!1:oa(r,e).includes(t)}function up(r,e){return aa(r).includes(e)}});var ne=c((Kv,sa)=>{"use strict";var Xi=class r extends Error{constructor(e){super(`Format functions must be synchronous taking a two arguments: (info, opts)
|
|
4
|
-
|
|
2
|
+
"use strict";var Jg=Object.create;var Ss=Object.defineProperty;var Zg=Object.getOwnPropertyDescriptor;var Xg=Object.getOwnPropertyNames;var Qg=Object.getPrototypeOf,em=Object.prototype.hasOwnProperty;var m=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var rm=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Xg(r))!em.call(e,i)&&i!==t&&Ss(e,i,{get:()=>r[i],enumerable:!(n=Zg(r,i))||n.enumerable});return e};var L=(e,r,t)=>(t=e!=null?Jg(Qg(e)):{},rm(r||!e||!e.__esModule?Ss(t,"default",{value:e,enumerable:!0}):t,e));var Zi=m((Ji,Os)=>{(function(e,r){"use strict";typeof define=="function"&&define.amd?define("stackframe",[],r):typeof Ji=="object"?Os.exports=r():e.StackFrame=r()})(Ji,function(){"use strict";function e(S){return!isNaN(parseFloat(S))&&isFinite(S)}function r(S){return S.charAt(0).toUpperCase()+S.substring(1)}function t(S){return function(){return this[S]}}var n=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],a=["fileName","functionName","source"],s=["args"],u=["evalOrigin"],d=n.concat(i,a,s,u);function h(S){if(S)for(var g=0;g<d.length;g++)S[d[g]]!==void 0&&this["set"+r(d[g])](S[d[g]])}h.prototype={getArgs:function(){return this.args},setArgs:function(S){if(Object.prototype.toString.call(S)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=S},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(S){if(S instanceof h)this.evalOrigin=S;else if(S instanceof Object)this.evalOrigin=new h(S);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var S=this.getFileName()||"",g=this.getLineNumber()||"",w=this.getColumnNumber()||"",T=this.getFunctionName()||"";return this.getIsEval()?S?"[eval] ("+S+":"+g+":"+w+")":"[eval]:"+g+":"+w:T?T+" ("+S+":"+g+":"+w+")":S+":"+g+":"+w}},h.fromString=function(g){var w=g.indexOf("("),T=g.lastIndexOf(")"),D=g.substring(0,w),$=g.substring(w+1,T).split(","),P=g.substring(T+1);if(P.indexOf("@")===0)var C=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(P,""),z=C[1],Y=C[2],B=C[3];return new h({functionName:D,args:$||void 0,fileName:z,lineNumber:Y||void 0,columnNumber:B||void 0})};for(var y=0;y<n.length;y++)h.prototype["get"+r(n[y])]=t(n[y]),h.prototype["set"+r(n[y])]=(function(S){return function(g){this[S]=!!g}})(n[y]);for(var b=0;b<i.length;b++)h.prototype["get"+r(i[b])]=t(i[b]),h.prototype["set"+r(i[b])]=(function(S){return function(g){if(!e(g))throw new TypeError(S+" must be a Number");this[S]=Number(g)}})(i[b]);for(var _=0;_<a.length;_++)h.prototype["get"+r(a[_])]=t(a[_]),h.prototype["set"+r(a[_])]=(function(S){return function(g){this[S]=String(g)}})(a[_]);return h})});var As=m((Xi,Ps)=>{(function(e,r){"use strict";typeof define=="function"&&define.amd?define("error-stack-parser",["stackframe"],r):typeof Xi=="object"?Ps.exports=r(Zi()):e.ErrorStackParser=r(e.StackFrame)})(Xi,function(r){"use strict";var t=/(^|@)\S+:\d+/,n=/^\s*at .*(\S+:\d+|\(native\))/m,i=/^(eval@)?(\[native code])?$/;return{parse:function(s){if(typeof s.stacktrace<"u"||typeof s["opera#sourceloc"]<"u")return this.parseOpera(s);if(s.stack&&s.stack.match(n))return this.parseV8OrIE(s);if(s.stack)return this.parseFFOrSafari(s);throw new Error("Cannot parse given Error object")},extractLocation:function(s){if(s.indexOf(":")===-1)return[s];var u=/(.+?)(?::(\d+))?(?::(\d+))?$/,d=u.exec(s.replace(/[()]/g,""));return[d[1],d[2]||void 0,d[3]||void 0]},parseV8OrIE:function(s){var u=s.stack.split(`
|
|
3
|
+
`).filter(function(d){return!!d.match(n)},this);return u.map(function(d){d.indexOf("(eval ")>-1&&(d=d.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var h=d.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),y=h.match(/ (\(.+\)$)/);h=y?h.replace(y[0],""):h;var b=this.extractLocation(y?y[1]:h),_=y&&h||void 0,S=["eval","<anonymous>"].indexOf(b[0])>-1?void 0:b[0];return new r({functionName:_,fileName:S,lineNumber:b[1],columnNumber:b[2],source:d})},this)},parseFFOrSafari:function(s){var u=s.stack.split(`
|
|
4
|
+
`).filter(function(d){return!d.match(i)},this);return u.map(function(d){if(d.indexOf(" > eval")>-1&&(d=d.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),d.indexOf("@")===-1&&d.indexOf(":")===-1)return new r({functionName:d});var h=/((.*".+"[^@]*)?[^@]*)(?:@)/,y=d.match(h),b=y&&y[1]?y[1]:void 0,_=this.extractLocation(d.replace(h,""));return new r({functionName:b,fileName:_[0],lineNumber:_[1],columnNumber:_[2],source:d})},this)},parseOpera:function(s){return!s.stacktrace||s.message.indexOf(`
|
|
5
|
+
`)>-1&&s.message.split(`
|
|
6
|
+
`).length>s.stacktrace.split(`
|
|
7
|
+
`).length?this.parseOpera9(s):s.stack?this.parseOpera11(s):this.parseOpera10(s)},parseOpera9:function(s){for(var u=/Line (\d+).*script (?:in )?(\S+)/i,d=s.message.split(`
|
|
8
|
+
`),h=[],y=2,b=d.length;y<b;y+=2){var _=u.exec(d[y]);_&&h.push(new r({fileName:_[2],lineNumber:_[1],source:d[y]}))}return h},parseOpera10:function(s){for(var u=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,d=s.stacktrace.split(`
|
|
9
|
+
`),h=[],y=0,b=d.length;y<b;y+=2){var _=u.exec(d[y]);_&&h.push(new r({functionName:_[3]||void 0,fileName:_[2],lineNumber:_[1],source:d[y]}))}return h},parseOpera11:function(s){var u=s.stack.split(`
|
|
10
|
+
`).filter(function(d){return!!d.match(t)&&!d.match(/^Error created at/)},this);return u.map(function(d){var h=d.split("@"),y=this.extractLocation(h.pop()),b=h.shift()||"",_=b.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,S;b.match(/\(([^)]*)\)/)&&(S=b.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var g=S===void 0||S==="[arguments not available]"?void 0:S.split(",");return new r({functionName:_,args:g,fileName:y[0],lineNumber:y[1],columnNumber:y[2],source:d})},this)}}})});var Ns=m((vE,Ts)=>{Ts.exports=tm;function tm(e){switch(Object.prototype.toString.call(e)){case"[object Error]":return!0;case"[object Exception]":return!0;case"[object DOMException]":return!0;default:return e instanceof Error}}});var Ms=m((Qi,xs)=>{(function(e,r){"use strict";typeof define=="function"&&define.amd?define("stack-generator",["stackframe"],r):typeof Qi=="object"?xs.exports=r(Zi()):e.StackGenerator=r(e.StackFrame)})(Qi,function(e){return{backtrace:function(t){var n=[],i=10;typeof t=="object"&&typeof t.maxStackSize=="number"&&(i=t.maxStackSize);for(var a=arguments.callee;a&&n.length<i&&a.arguments;){for(var s=new Array(a.arguments.length),u=0;u<s.length;++u)s[u]=a.arguments[u];/function(?:\s+([\w$]+))+\s*\(/.test(a.toString())?n.push(new e({functionName:RegExp.$1||void 0,args:s})):n.push(new e({args:s}));try{a=a.caller}catch{break}}return n}}})});var Ds=m((bE,Is)=>{Is.exports=Rs;function Rs(e,r){if(e&&r)return Rs(e)(r);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){t[n]=e[n]}),t;function t(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var a=e.apply(this,n),s=n[n.length-1];return typeof a=="function"&&a!==s&&Object.keys(s).forEach(function(u){a[u]=s[u]}),a}}});var ra=m((_E,ea)=>{var Cs=Ds();ea.exports=Cs(cn);ea.exports.strict=Cs(Ls);cn.proto=cn(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return cn(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return Ls(this)},configurable:!0})});function cn(e){var r=function(){return r.called?r.value:(r.called=!0,r.value=e.apply(this,arguments))};return r.called=!1,r}function Ls(e){var r=function(){if(r.called)throw new Error(r.onceError);return r.called=!0,r.value=e.apply(this,arguments)},t=e.name||"Function wrapped with `once`";return r.onceError=t+" shouldn't be called more than once",r.called=!1,r}});var Us=m((wE,$s)=>{var nm=ra(),im=function(){},am=global.Bare?queueMicrotask:process.nextTick.bind(process),om=function(e){return e.setHeader&&typeof e.abort=="function"},sm=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},qs=function(e,r,t){if(typeof r=="function")return qs(e,null,r);r||(r={}),t=nm(t||im);var n=e._writableState,i=e._readableState,a=r.readable||r.readable!==!1&&e.readable,s=r.writable||r.writable!==!1&&e.writable,u=!1,d=function(){e.writable||h()},h=function(){s=!1,a||t.call(e)},y=function(){a=!1,s||t.call(e)},b=function(T){t.call(e,T?new Error("exited with error code: "+T):null)},_=function(T){t.call(e,T)},S=function(){am(g)},g=function(){if(!u){if(a&&!(i&&i.ended&&!i.destroyed))return t.call(e,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return t.call(e,new Error("premature close"))}},w=function(){e.req.on("finish",h)};return om(e)?(e.on("complete",h),e.on("abort",S),e.req?w():e.on("request",w)):s&&!n&&(e.on("end",d),e.on("close",d)),sm(e)&&e.on("exit",b),e.on("end",y),e.on("finish",h),r.error!==!1&&e.on("error",_),e.on("close",S),function(){u=!0,e.removeListener("complete",h),e.removeListener("abort",S),e.removeListener("request",w),e.req&&e.req.removeListener("finish",h),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",h),e.removeListener("exit",b),e.removeListener("end",y),e.removeListener("error",_),e.removeListener("close",S)}};$s.exports=qs});var ks=m((EE,Fs)=>{var um=ra(),lm=Us(),fn;try{fn=require("fs")}catch{}var vt=function(){},cm=typeof process>"u"?!1:/^v?\.0/.test(process.version),dn=function(e){return typeof e=="function"},fm=function(e){return!cm||!fn?!1:(e instanceof(fn.ReadStream||vt)||e instanceof(fn.WriteStream||vt))&&dn(e.close)},dm=function(e){return e.setHeader&&dn(e.abort)},pm=function(e,r,t,n){n=um(n);var i=!1;e.on("close",function(){i=!0}),lm(e,{readable:r,writable:t},function(s){if(s)return n(s);i=!0,n()});var a=!1;return function(s){if(!i&&!a){if(a=!0,fm(e))return e.close(vt);if(dm(e))return e.abort();if(dn(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},js=function(e){e()},hm=function(e,r){return e.pipe(r)},gm=function(){var e=Array.prototype.slice.call(arguments),r=dn(e[e.length-1]||vt)&&e.pop()||vt;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var t,n=e.map(function(i,a){var s=a<e.length-1,u=a>0;return pm(i,s,u,function(d){t||(t=d),d&&n.forEach(js),!s&&(n.forEach(js),r(t))})});return e.reduce(hm)};Fs.exports=gm});var Bs=m((SE,Jr)=>{var ta=require("stream"),mm=require("util"),ym=require("timers");Jr.exports=function(e,r){return Jr.exports.createStream(e,r)};Jr.exports.createStream=function(e,r){return e?zs(e,r):new or(r)};Jr.exports.createLineStream=function(e){return console.log("WARNING: byline#createLineStream is deprecated and will be removed soon"),zs(e)};function zs(e,r){if(!e)throw new Error("expected readStream");if(!e.readable)throw new Error("readStream must be readable");var t=new or(r);return e.pipe(t),t}Jr.exports.LineStream=or;function or(e){ta.Transform.call(this,e),e=e||{},this._readableState.objectMode=!0,this._lineBuffer=[],this._keepEmptyLines=e.keepEmptyLines||!1,this._lastChunkEndedWithCR=!1;var r=this;this.on("pipe",function(t){r.encoding||t instanceof ta.Readable&&(r.encoding=t._readableState.encoding)})}mm.inherits(or,ta.Transform);or.prototype._transform=function(e,r,t){r=r||"utf8",Buffer.isBuffer(e)&&(r=="buffer"?(e=e.toString(),r="utf8"):e=e.toString(r)),this._chunkEncoding=r;var n=e.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g);this._lastChunkEndedWithCR&&e[0]==`
|
|
11
|
+
`&&n.shift(),this._lineBuffer.length>0&&(this._lineBuffer[this._lineBuffer.length-1]+=n[0],n.shift()),this._lastChunkEndedWithCR=e[e.length-1]=="\r",this._lineBuffer=this._lineBuffer.concat(n),this._pushBuffer(r,1,t)};or.prototype._pushBuffer=function(e,r,t){for(;this._lineBuffer.length>r;){var n=this._lineBuffer.shift();if((this._keepEmptyLines||n.length>0)&&!this.push(this._reencode(n,e))){var i=this;ym.setImmediate(function(){i._pushBuffer(e,r,t)});return}}t()};or.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};or.prototype._reencode=function(e,r){return this.encoding&&this.encoding!=r?new Buffer(e,r).toString(this.encoding):this.encoding?e:new Buffer(e,r)}});var Gs=m((Hs,na)=>{(function(e){if(typeof Hs=="object"&&typeof na<"u")na.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var r;typeof window<"u"?r=window:typeof global<"u"?r=global:typeof self<"u"?r=self:r=this,r.bugsnag=e()}})(function(){var e,r,t,n=(function(){function o(f,l,p,v){v===void 0&&(v=new Date),this.type=p,this.message=f,this.metadata=l,this.timestamp=v}var c=o.prototype;return c.toJSON=function(){return{type:this.type,name:this.message,timestamp:this.timestamp,metaData:this.metadata}},o})(),i=n,a=["navigation","request","process","log","user","state","error","manual"],s=function(o,c,f){for(var l=f,p=0,v=o.length;p<v;p++)l=c(l,o[p],p,o);return l},u=function(o,c){return s(o,function(f,l,p,v){return c(l,p,v)?f.concat(l):f},[])},d=function(o,c){return s(o,function(f,l,p,v){return f===!0||l===c},!1)},h=function(o){return Object.prototype.toString.call(o)==="[object Array]"},y=!{toString:null}.propertyIsEnumerable("toString"),b=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],_=function(o){var c=[],f;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&c.push(f);if(!y)return c;for(var l=0,p=b.length;l<p;l++)Object.prototype.hasOwnProperty.call(o,b[l])&&c.push(b[l]);return c},S=function(o,c){return o===void 0&&(o=1),c===void 0&&(c=1/0),function(f){return typeof f=="number"&&parseInt(""+f,10)===f&&f>=o&&f<=c}},g=function(o){return typeof o=="function"||h(o)&&u(o,function(c){return typeof c=="function"}).length===o.length},w=function(o){return typeof o=="string"&&!!o.length},T={},D=function(){return{unhandledExceptions:!0,unhandledRejections:!0}};T.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:w},appVersion:{defaultValue:function(){},message:"should be a string",validate:function(o){return o===void 0||w(o)}},appType:{defaultValue:function(){},message:"should be a string",validate:function(o){return o===void 0||w(o)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(o){return o===!0||o===!1}},enabledErrorTypes:{defaultValue:function(){return D()},message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(o){if(typeof o!="object"||!o)return!1;var c=_(o),f=_(D());return!(u(c,function(l){return d(f,l)}).length<c.length||u(_(o),function(l){return typeof o[l]!="boolean"}).length>0)}},onError:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:g},onSession:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:g},onBreadcrumb:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:g},endpoints:{defaultValue:function(o){return typeof o>"u"?{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}:{notify:null,sessions:null}},message:"should be an object containing endpoint URLs { notify, sessions }",validate:function(o){return o&&typeof o=="object"&&w(o.notify)&&w(o.sessions)&&u(_(o),function(c){return!d(["notify","sessions"],c)}).length===0}},autoTrackSessions:{defaultValue:function(o){return!0},message:"should be true|false",validate:function(o){return o===!0||o===!1}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(o){return o===null||h(o)&&u(o,function(c){return typeof c=="string"}).length===o.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(o){return typeof o=="string"&&o.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number \u2264100",validate:function(o){return S(0,100)(o)}},enabledBreadcrumbTypes:{defaultValue:function(){return a},message:"should be null or a list of available breadcrumb types ("+a.join(",")+")",validate:function(o){return o===null||h(o)&&s(o,function(c,f){return c===!1?c:d(a,f)},!0)}},context:{defaultValue:function(){},message:"should be a string",validate:function(o){return o===void 0||typeof o=="string"}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(o){return o===null||o&&s(_(o),function(c,f){return c&&d(["id","email","name"],f)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(o){return typeof o=="object"&&o!==null}},logger:{defaultValue:function(){},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(o){return!o||o&&s(["debug","info","warn","error"],function(c,f){return c&&typeof o[f]=="function"},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(o){return h(o)&&o.length===u(o,function(c){return typeof c=="string"||c&&typeof c.test=="function"}).length}},plugins:{defaultValue:function(){return[]},message:"should be an array of plugin objects",validate:function(o){return h(o)&&o.length===u(o,function(c){return c&&typeof c=="object"&&typeof c.load=="function"}).length}},featureFlags:{defaultValue:function(){return[]},message:'should be an array of objects that have a "name" property',validate:function(o){return h(o)&&o.length===u(o,function(c){return c&&typeof c=="object"&&typeof c.name=="string"}).length}},reportUnhandledPromiseRejectionsAsHandled:{defaultValue:function(){return!1},message:"should be true|false",validate:function(o){return o===!0||o===!1}},sendPayloadChecksums:{defaultValue:function(){return!1},message:"should be true|false",validate:function(o){return o===!0||o===!1}}};var $=As(),P=function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)Object.prototype.hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},C=function(o,c){return s(o,function(f,l,p,v){return f.concat(c(l,p,v))},[])},z=function(o,c,f,l){var p=l&&l.redactedKeys?l.redactedKeys:[],v=l&&l.redactedPaths?l.redactedPaths:[];return JSON.stringify(R(o,p,v),c,f)},Y=20,B=25e3,G=8,U="...";function Z(o){return o instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(o))}function ne(o){return"[Throws: "+(o?o.message:"?")+"]"}function te(o,c){for(var f=0,l=o.length;f<l;f++)if(o[f]===c)return!0;return!1}function ce(o,c){for(var f=0,l=o.length;f<l;f++)if(c.indexOf(o[f])===0)return!0;return!1}function fe(o,c){for(var f=0,l=o.length;f<l;f++)if(typeof o[f]=="string"&&o[f].toLowerCase()===c.toLowerCase()||o[f]&&typeof o[f].test=="function"&&o[f].test(c))return!0;return!1}function $e(o){return Object.prototype.toString.call(o)==="[object Array]"}function O(o,c){try{return o[c]}catch(f){return ne(f)}}function R(o,c,f){var l=[],p=0;function v(E,x){function M(){return x.length>G&&p>B}if(p++,x.length>Y||M())return U;if(E===null||typeof E!="object")return E;if(te(l,E))return"[Circular]";if(l.push(E),typeof E.toJSON=="function")try{p--;var j=v(E.toJSON(),x);return l.pop(),j}catch(Kr){return ne(Kr)}var H=Z(E);if(H){p--;var pe=v({name:E.name,message:E.message},x);return l.pop(),pe}if($e(E)){for(var ye=[],ar=0,De=E.length;ar<De;ar++){if(M()){ye.push(U);break}ye.push(v(E[ar],x.concat("[]")))}return l.pop(),ye}var Vr={};try{for(var We in E)if(Object.prototype.hasOwnProperty.call(E,We)){if(ce(f,x.join("."))&&fe(c,We)){Vr[We]="[REDACTED]";continue}if(M()){Vr[We]=U;break}Vr[We]=v(O(E,We),x.concat(We))}}catch{}return l.pop(),Vr}return v(o,[])}function V(o,c,f,l){if(typeof f=="string"){l===void 0?l=null:l!==null&&typeof l!="string"&&(l=z(l));var p=c[f];if(typeof p=="number"){o[p]={name:f,variant:l};return}o.push({name:f,variant:l}),c[f]=o.length-1}}function ue(o,c,f){if(h(c)){for(var l=0;l<c.length;++l){var p=c[l];p===null||typeof p!="object"||V(o,f,p.name,p.variant)}return o}}function q(o){return C(u(o,Boolean),function(c){var f=c.name,l=c.variant,p={featureFlag:f};return typeof l=="string"&&(p.variant=l),p})}function _e(o,c,f){var l=c[f];typeof l=="number"&&(o[l]=null,delete c[f])}var de={add:V,clear:_e,merge:ue,toEventApi:q},Ne=function(o){return!!o&&(!!o.stack||!!o.stacktrace||!!o["opera#sourceloc"])&&typeof(o.stack||o.stacktrace||o["opera#sourceloc"])=="string"&&o.stack!==o.name+": "+o.message},Ue=Ns(),Br=function(o,c,f,l){var p;if(c){var v;if(f===null)return Hr(o,c);typeof f=="object"&&(v=f),typeof f=="string"&&(v=(p={},p[f]=l,p)),v&&(c==="__proto__"||c==="constructor"||c==="prototype"||(o[c]||(o[c]={}),o[c]=P({},o[c],v)))}},er=function(o,c,f){if(typeof c=="string"){if(!f)return o[c];if(o[c])return o[c][f]}},Hr=function(o,c,f){if(typeof c=="string"){if(!f){delete o[c];return}c==="__proto__"||c==="constructor"||c==="prototype"||o[c]&&delete o[c][f]}},ie={add:Br,get:er,clear:Hr};function rr(){return rr=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},rr.apply(null,arguments)}var ht=Ms(),Se=(function(){function o(f,l,p,v,E){p===void 0&&(p=[]),v===void 0&&(v=tr()),this.apiKey=void 0,this.context=void 0,this.groupingHash=void 0,this.originalError=E,this._handledState=v,this.severity=this._handledState.severity,this.unhandled=this._handledState.unhandled,this.app={},this.device={},this.request={},this.breadcrumbs=[],this.threads=[],this._metadata={},this._features=[],this._featuresIndex={},this._user={},this._session=void 0,this._correlation=void 0,this._groupingDiscriminator=void 0,this.errors=[nr(f,l,o.__type,p)]}var c=o.prototype;return c.addMetadata=function(l,p,v){return ie.add(this._metadata,l,p,v)},c.setTraceCorrelation=function(l,p){typeof l=="string"&&(this._correlation=rr({traceId:l},typeof p=="string"?{spanId:p}:{}))},c.getGroupingDiscriminator=function(){return this._groupingDiscriminator},c.setGroupingDiscriminator=function(l){var p=this._groupingDiscriminator;return(typeof l=="string"||l===null||l===void 0)&&(this._groupingDiscriminator=l),p},c.getMetadata=function(l,p){return ie.get(this._metadata,l,p)},c.clearMetadata=function(l,p){return ie.clear(this._metadata,l,p)},c.addFeatureFlag=function(l,p){p===void 0&&(p=null),de.add(this._features,this._featuresIndex,l,p)},c.addFeatureFlags=function(l){de.merge(this._features,l,this._featuresIndex)},c.getFeatureFlags=function(){return de.toEventApi(this._features)},c.clearFeatureFlag=function(l){de.clear(this._features,this._featuresIndex,l)},c.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},c.getUser=function(){return this._user},c.setUser=function(l,p,v){this._user={id:l,email:p,name:v}},c.toJSON=function(){return{payloadVersion:"4",exceptions:C(this.errors,function(l){return P({},l,{message:l.errorMessage})}),severity:this.severity,unhandled:this._handledState.unhandled,severityReason:this._handledState.severityReason,app:this.app,device:this.device,request:this.request,breadcrumbs:this.breadcrumbs,context:this.context,groupingHash:this.groupingHash,groupingDiscriminator:this._groupingDiscriminator,metaData:this._metadata,user:this._user,session:this._session,featureFlags:this.getFeatureFlags(),correlation:this._correlation}},o})(),Gr=function(o){var c={file:o.fileName,method:Re(o.functionName),lineNumber:o.lineNumber,columnNumber:o.columnNumber,code:void 0,inProject:void 0};return c.lineNumber>-1&&!c.file&&!c.method&&(c.file="global code"),c},Re=function(o){return/^global code$/i.test(o)?"global code":o},tr=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},Zt=function(o){return typeof o=="string"?o:""};function nr(o,c,f,l){return{errorClass:Zt(o),errorMessage:Zt(c),type:f,stacktrace:s(l,function(p,v){var E=Gr(v);try{return JSON.stringify(E)==="{}"?p:p.concat(E)}catch{return p}},[])}}function Ge(o){return o.cause?[o].concat(Ge(o.cause)):[o]}Se.getStacktrace=function(o,c,f){if(Ne(o))return $.parse(o).slice(c);try{return u(ht.backtrace(),function(l){return(l.functionName||"").indexOf("StackGenerator$$")===-1}).slice(1+f)}catch{return[]}},Se.create=function(o,c,f,l,p,v){p===void 0&&(p=0);var E=Xt(o,c,l,v),x=E[0],M=E[1],j;try{var H=Se.getStacktrace(x,M>0?1+M+p:0,1+p);j=new Se(x.name,x.message,H,f,o)}catch{j=new Se(x.name,x.message,[],f,o)}if(x.name==="InvalidError"&&j.addMetadata(""+l,"non-error parameter",Wr(o)),x.cause){var pe,ye=Ge(x).slice(1),ar=C(ye,function(De){var Vr=Ue(De)&&Ne(De)?$.parse(De):[],We=Xt(De,!0,"error cause"),Kr=We[0];return Kr.name==="InvalidError"&&j.addMetadata("error cause",Wr(De)),nr(Kr.name,Kr.message,Se.__type,Vr)});(pe=j.errors).push.apply(pe,ar)}return j};var Wr=function(o){return o===null?"null":o===void 0?"undefined":o},Xt=function(o,c,f,l){var p,v=0,E=function(x){var M=f==="error cause"?"was":"received";l&&l.warn(f+" "+M+' a non-error: "'+x+'"');var j=new Error(f+" "+M+' a non-error. See "'+f+'" tab for more detail.');return j.name="InvalidError",j};if(!c)Ue(o)?p=o:(p=E(typeof o),v+=2);else switch(typeof o){case"string":case"number":case"boolean":p=new Error(String(o)),v+=1;break;case"function":p=E("function"),v+=2;break;case"object":o!==null&&Ue(o)?p=o:o!==null&&Qt(o)?(p=new Error(o.message||o.errorMessage),p.name=o.name||o.errorClass,v+=1):(p=E(o===null?"null":"unsupported object"),v+=2);break;default:p=E("nothing"),v+=2}if(!Ne(p))try{throw p}catch(x){Ne(x)&&(p=x,v=1)}return[p,v]};Se.__type="browserjs";var Qt=function(o){return(typeof o.name=="string"||typeof o.errorClass=="string")&&(typeof o.message=="string"||typeof o.errorMessage=="string")},en=Se,Ih=function(o,c,f){var l=0,p=function(){if(l>=o.length)return f(null,!0);c(o[l],function(v,E){if(v)return f(v);if(E===!1)return f(null,!1);l++,p()})};p()},Dh=function(o,c,f,l){var p=function(v,E){if(typeof v!="function")return E(null);try{if(v.length!==2){var x=v(c);return x&&typeof x.then=="function"?x.then(function(M){return setTimeout(function(){return E(null,M)})},function(M){setTimeout(function(){return f(M),E(null,!0)})}):E(null,x)}v(c,function(M,j){if(M)return f(M),E(null);E(null,j)})}catch(M){f(M),E(null)}};Ih(o,p,l)},qi=function(o,c,f,l){for(var p=!1,v=o.slice();!p&&v.length;)try{p=v.pop()(c)===!1}catch(E){l.error("Error occurred in "+f+" callback, continuing anyway\u2026"),l.error(E)}return p},rn=function(c,f){var l="000000000"+c;return l.substr(l.length-f)},Ch=require("os");function Lh(){try{return Ch.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var ss=2,qh=rn(process.pid.toString(36),ss),us=Lh(),$h=us.length,Uh=rn(us.split("").reduce(function(o,c){return+o+c.charCodeAt(0)},+$h+36).toString(36),ss),ls=function(){return qh+Uh},jh=function(c){return typeof c=="string"&&/^c[a-z0-9]{20,32}$/.test(c)},gt=0,$i=4,tn=36,cs=Math.pow(tn,$i);function fs(){return rn((Math.random()*cs<<0).toString(tn),$i)}function Fh(){return gt=gt<cs?gt:0,gt++,gt-1}function Ui(){var o="c",c=new Date().getTime().toString(tn),f=rn(Fh().toString(tn),$i),l=ls(),p=fs()+fs();return o+c+f+l+p}Ui.fingerprint=ls,Ui.isCuid=jh;var kh=Ui,zh=(function(){function o(){this.id=kh(),this.startedAt=new Date,this._handled=0,this._unhandled=0,this._user={},this.app={},this.device={}}var c=o.prototype;return c.getUser=function(){return this._user},c.setUser=function(l,p,v){this._user={id:l,email:p,name:v}},c.toJSON=function(){return{id:this.id,startedAt:this.startedAt,events:{handled:this._handled,unhandled:this._unhandled}}},c._track=function(l){this[l._handledState.unhandled?"_unhandled":"_handled"]+=1},o})(),ji=zh,Bh=de.add,Hh=de.clear,Fi=de.merge,Gh="00000",Wh="https://notify.insighthub.smartbear.com",Yh="https://sessions.insighthub.smartbear.com",ir=function(){},Vh=(function(){function o(f,l,p,v){var E=this;l===void 0&&(l=T.schema),p===void 0&&(p=[]),this._notifier=v,this._config={},this._schema=l,this._delivery={sendSession:ir,sendEvent:ir},this._logger={debug:ir,info:ir,warn:ir,error:ir},this._plugins={},this._breadcrumbs=[],this._session=null,this._metadata={},this._featuresIndex={},this._features=[],this._context=void 0,this._user={},this._groupingDiscriminator=void 0,this._cbs={e:[],s:[],sp:[],b:[]},this.Client=o,this.Event=en,this.Breadcrumb=i,this.Session=ji,this._config=this._configure(f,p),C(p.concat(this._config.plugins),function(j){j&&E._loadPlugin(j)}),this._depth=1;var x=this,M=this.notify;this.notify=function(){return M.apply(x,arguments)}}var c=o.prototype;return c.addMetadata=function(l,p,v){return ie.add(this._metadata,l,p,v)},c.getMetadata=function(l,p){return ie.get(this._metadata,l,p)},c.clearMetadata=function(l,p){return ie.clear(this._metadata,l,p)},c.addFeatureFlag=function(l,p){p===void 0&&(p=null),Bh(this._features,this._featuresIndex,l,p)},c.addFeatureFlags=function(l){Fi(this._features,l,this._featuresIndex)},c.clearFeatureFlag=function(l){Hh(this._features,this._featuresIndex,l)},c.clearFeatureFlags=function(){this._features=[],this._featuresIndex={}},c.getContext=function(){return this._context},c.setContext=function(l){this._context=l},c.getGroupingDiscriminator=function(){return this._groupingDiscriminator},c.setGroupingDiscriminator=function(l){var p=this._groupingDiscriminator;return(typeof l=="string"||l===null||l===void 0)&&(this._groupingDiscriminator=l),p},c._configure=function(l,p){var v=s(p,function(j,H){return H&&H.configSchema?P({},j,H.configSchema):j},this._schema);l.endpoints||(l.sendPayloadChecksums="sendPayloadChecksums"in l?l.sendPayloadChecksums:!0);var E=s(_(v),function(j,H){var pe=v[H].defaultValue(l[H]);if(l[H]!==void 0){var ye=v[H].validate(l[H]);ye?v[H].allowPartialObject?j.config[H]=P(pe,l[H]):j.config[H]=l[H]:(j.errors[H]=v[H].message,j.config[H]=pe)}else j.config[H]=pe;return j},{errors:{},config:{}}),x=E.errors,M=E.config;if(v.apiKey){if(!M.apiKey)throw new Error("No Bugsnag API Key set");/^[0-9a-f]{32}$/i.test(M.apiKey)||(x.apiKey="should be a string of 32 hexadecimal characters"),l.endpoints===void 0&&M.apiKey.startsWith(Gh)&&(M.endpoints={notify:Wh,sessions:Yh})}return this._metadata=P({},M.metadata),Fi(this._features,M.featureFlags,this._featuresIndex),this._user=P({},M.user),this._context=M.context,M.logger&&(this._logger=M.logger),M.onError&&(this._cbs.e=this._cbs.e.concat(M.onError)),M.onBreadcrumb&&(this._cbs.b=this._cbs.b.concat(M.onBreadcrumb)),M.onSession&&(this._cbs.s=this._cbs.s.concat(M.onSession)),_(x).length&&this._logger.warn(Kh(x,l)),M},c.getUser=function(){return this._user},c.setUser=function(l,p,v){this._user={id:l,email:p,name:v}},c._loadPlugin=function(l){var p=l.load(this);l.name&&(this._plugins["~"+l.name+"~"]=p)},c.getPlugin=function(l){return this._plugins["~"+l+"~"]},c._setDelivery=function(l){this._delivery=l(this)},c.startSession=function(){var l=new ji;l.app.releaseStage=this._config.releaseStage,l.app.version=this._config.appVersion,l.app.type=this._config.appType,l._user=P({},this._user);var p=qi(this._cbs.s,l,"onSession",this._logger);return p?(this._logger.debug("Session not started due to onSession callback"),this):this._sessionDelegate.startSession(this,l)},c.addOnError=function(l,p){p===void 0&&(p=!1),this._cbs.e[p?"unshift":"push"](l)},c.removeOnError=function(l){this._cbs.e=u(this._cbs.e,function(p){return p!==l})},c._addOnSessionPayload=function(l){this._cbs.sp.push(l)},c.addOnSession=function(l){this._cbs.s.push(l)},c.removeOnSession=function(l){this._cbs.s=u(this._cbs.s,function(p){return p!==l})},c.addOnBreadcrumb=function(l,p){p===void 0&&(p=!1),this._cbs.b[p?"unshift":"push"](l)},c.removeOnBreadcrumb=function(l){this._cbs.b=u(this._cbs.b,function(p){return p!==l})},c.pauseSession=function(){return this._sessionDelegate.pauseSession(this)},c.resumeSession=function(){return this._sessionDelegate.resumeSession(this)},c.leaveBreadcrumb=function(l,p,v){if(l=typeof l=="string"?l:"",v=typeof v=="string"&&d(a,v)?v:"manual",p=typeof p=="object"&&p!==null?p:{},!!l){var E=new i(l,p,v),x=qi(this._cbs.b,E,"onBreadcrumb",this._logger);if(x){this._logger.debug("Breadcrumb not attached due to onBreadcrumb callback");return}this._breadcrumbs.push(E),this._breadcrumbs.length>this._config.maxBreadcrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(this._breadcrumbs.length-this._config.maxBreadcrumbs))}},c._isBreadcrumbTypeEnabled=function(l){var p=this._config.enabledBreadcrumbTypes;return p===null||d(p,l)},c.notify=function(l,p,v){v===void 0&&(v=ir);var E=en.create(l,!0,void 0,"notify()",this._depth+1,this._logger);this._notify(E,p,v)},c._notify=function(l,p,v){var E=this;if(v===void 0&&(v=ir),l.app=P({},l.app,{releaseStage:this._config.releaseStage,version:this._config.appVersion,type:this._config.appType}),l.context=l.context||this._context,l._metadata=P({},l._metadata,this._metadata),l._user=P({},l._user,this._user),l.breadcrumbs=this._breadcrumbs.slice(),l.setGroupingDiscriminator(this._groupingDiscriminator),Fi(l._features,this._features,l._featuresIndex),this._config.enabledReleaseStages!==null&&!d(this._config.enabledReleaseStages,this._config.releaseStage))return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"),v(null,l);var x=l.severity,M=function(H){E._logger.error("Error occurred in onError callback, continuing anyway\u2026"),E._logger.error(H)},j=[].concat(this._cbs.e).concat(p);Dh(j,l,M,function(H,pe){if(H&&M(H),!pe)return E._logger.debug("Event not sent due to onError callback"),v(null,l);E._isBreadcrumbTypeEnabled("error")&&o.prototype.leaveBreadcrumb.call(E,l.errors[0].errorClass,{errorClass:l.errors[0].errorClass,errorMessage:l.errors[0].errorMessage,severity:l.severity},"error"),x!==l.severity&&(l._handledState.severityReason={type:"userCallbackSetSeverity"}),l.unhandled!==l._handledState.unhandled&&(l._handledState.severityReason.unhandledOverridden=!0,l._handledState.unhandled=l.unhandled),E._session&&(E._session._track(l),l._session=E._session),E._delivery.sendEvent({apiKey:l.apiKey||E._config.apiKey,notifier:E._notifier,events:[l]},function(ye){return v(ye,l)})})},o})(),Kh=function(o,c){var f=new Error(`Invalid configuration
|
|
12
|
+
`+C(_(o),function(l){return" - "+l+" "+o[l]+", got "+Jh(c[l])}).join(`
|
|
13
|
+
|
|
14
|
+
`));return f},Jh=function(o){switch(typeof o){case"string":case"number":case"object":return JSON.stringify(o);default:return String(o)}},nn=Vh,an={},ds=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"];an.event=function(o,c){var f=z(o,null,null,{redactedPaths:ds,redactedKeys:c});return f.length>1e6&&(o.events[0]._metadata={notifier:`WARNING!
|
|
15
|
+
Serialized payload was `+f.length/1e6+`MB (limit = 1MB)
|
|
16
|
+
metadata was removed`},f=z(o,null,null,{redactedPaths:ds,redactedKeys:c})),f},an.session=function(o,c){var f=z(o,null,null);return f};var Zh=require("http"),Xh=require("https"),Qh=require("url"),eg=Qh.parse,ps=function(o,c){var f=o.url,l=o.headers,p=o.body,v=o.agent,E=!1,x=function(ye){E||(E=!0,c(ye))},M=eg(f),j=M.protocol==="https:",H=j?Xh:Zh,pe=H.request({method:"POST",hostname:M.hostname,port:M.port,path:M.path,headers:l,agent:v});pe.on("error",x),pe.on("response",function(ye){rg(ye,function(ar,De){if(ar)return x(ar);if(ye.statusCode<200||ye.statusCode>=300)return x(new Error("Bad statusCode from API: "+ye.statusCode+`
|
|
17
|
+
`+De));c(null,De)})}),pe.write(p),pe.end()},rg=function(o,c){var f="";o.on("error",c),o.setEncoding("utf8"),o.on("data",function(l){f+=l}),o.on("end",function(){return c(null,f)})},tg=function(o){return{sendEvent:function(c,f){f===void 0&&(f=function(){});var l=an.event(c,o._config.redactedKeys),p=function(E){E&&o._logger.error(`Event failed to send\u2026
|
|
18
|
+
`+(E&&E.stack?E.stack:E),E),l.length>1e6&&o._logger.warn("Event oversized ("+(l.length/1e6).toFixed(2)+" MB)"),f(E)};if(o._config.endpoints.notify===null){var v=new Error("Event not sent due to incomplete endpoint configuration");return p(v)}try{ps({url:o._config.endpoints.notify,headers:{"Content-Type":"application/json","Bugsnag-Api-Key":c.apiKey||o._config.apiKey,"Bugsnag-Payload-Version":"4","Bugsnag-Sent-At":new Date().toISOString()},body:l,agent:o._config.agent},function(E,x){return p(E)})}catch(E){p(E)}},sendSession:function(c,f){f===void 0&&(f=function(){});var l=function(v){v&&o._logger.error(`Session failed to send\u2026
|
|
19
|
+
`+(v&&v.stack?v.stack:v),v),f(v)};if(o._config.endpoints.session===null){var p=new Error("Session not sent due to incomplete endpoint configuration");return l(p)}try{ps({url:o._config.endpoints.sessions,headers:{"Content-Type":"application/json","Bugsnag-Api-Key":o._config.apiKey,"Bugsnag-Payload-Version":"1","Bugsnag-Sent-At":new Date().toISOString()},body:an.session(c,o._config.redactedKeys),agent:o._config.agent},function(v){return l(v)})}catch(v){l(v)}}}};function mt(){return mt=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},mt.apply(null,arguments)}var ki=T.schema,ng=require("os"),ig=require("util"),ag=ig.inspect,og={appType:mt({},ki.appType,{defaultValue:function(){return"node"}}),projectRoot:{defaultValue:function(){return process.cwd()},validate:function(o){return o===null||w(o)},message:"should be string"},hostname:{defaultValue:function(){return ng.hostname()},message:"should be a string",validate:function(o){return o===null||w(o)}},logger:mt({},ki.logger,{defaultValue:function(){return sg()}}),releaseStage:mt({},ki.releaseStage,{defaultValue:function(){return process.env.NODE_ENV||"production"}}),agent:{defaultValue:function(){},message:"should be an HTTP(s) agent",validate:function(o){return o===void 0||ug(o)}},onUncaughtException:{defaultValue:function(){return function(o,c,f){f.error("Uncaught exception"+gs(c)+`, the process will now terminate\u2026
|
|
20
|
+
`+hs(o)),process.exit(1)}},message:"should be a function",validate:function(o){return typeof o=="function"}},onUnhandledRejection:{defaultValue:function(){return function(o,c,f){f.error("Unhandled rejection"+gs(c)+`\u2026
|
|
21
|
+
`+hs(o))}},message:"should be a function",validate:function(o){return typeof o=="function"}}},hs=function(o){return o&&o.stack?o.stack:ag(o)},sg=function(){return["debug","info","warn","error"].reduce(function(o,c){var f=console[c]||console.log;return o[c]=f.bind(console,"[bugsnag]"),o},{})},gs=function(o){return o.request&&Object.keys(o.request).length?" at "+o.request.httpMethod+" "+(o.request.path||o.request.url):""},ug=function(o){return typeof o=="object"&&o!==null||typeof o=="boolean"},ms=new Date,lg=function(){ms=new Date},cg={name:"appDuration",load:function(o){return o.addOnError(function(c){var f=new Date;c.app.duration=f-ms},!0),{reset:lg}}},zi={};zi.load=function(o){var c=/^(local-)?dev(elopment)?$/.test(o._config.releaseStage);c||!o._isBreadcrumbTypeEnabled("log")||C(ys,function(f){var l=console[f];console[f]=function(){for(var p=arguments.length,v=new Array(p),E=0;E<p;E++)v[E]=arguments[E];o.leaveBreadcrumb("Console output",s(v,function(x,M,j){var H="[Unknown value]";try{H=String(M)}catch{}if(H==="[object Object]")try{H=JSON.stringify(M)}catch{}return x["["+j+"]"]=H,x},{severity:f.indexOf("group")===0?"log":f}),"log"),l.apply(console,v)},console[f]._restore=function(){console[f]=l}})},process.env.NODE_ENV!=="production"&&(zi.destroy=function(){return ys.forEach(function(o){typeof console[o]._restore=="function"&&console[o]._restore()})});var ys=u(["log","debug","info","warn","error"],function(o){return typeof console<"u"&&typeof console[o]=="function"}),Bi={},vs=[];Bi=function(o){var c=new o.Client({},{},[],o._notifier);return c._config=o._config,c._breadcrumbs=o._breadcrumbs.slice(),c._metadata=P({},o._metadata),c._features=[].concat(o._features),c._featuresIndex=P({},o._featuresIndex),c._user=P({},o._user),c._context=o._context,c._cbs={e:o._cbs.e.slice(),s:o._cbs.s.slice(),sp:o._cbs.sp.slice(),b:o._cbs.b.slice()},c._logger=o._logger,c._delivery=o._delivery,c._sessionDelegate=o._sessionDelegate,vs.forEach(function(f){f(c)}),c},Bi.registerCallback=function(o){vs.push(o)};var Yr={};Yr.getStack=function(){return new Error().stack.split(`
|
|
22
|
+
`).slice(3).join(`
|
|
23
|
+
`)},Yr.maybeUseFallbackStack=function(o,c){var f=o.stack.split(`
|
|
24
|
+
`);return(f.length===1||f.length===2&&/at Error \(native\)/.test(f[1]))&&(o.stack=f[0]+`
|
|
25
|
+
`+c),o};var on={},fg=Yr.getStack;on={name:"contextualize",load:function(o){var c=function(f,l){var p=fg(),v=Bi(o);v.fallbackStack=p,v.addOnError(l),o._clientContext.run(v,f)};return c}},on.default=on;var sn={},dg=Yr.getStack,pg=Yr.maybeUseFallbackStack;sn={name:"intercept",load:function(o){var c=function(f,l){f===void 0&&(f=function(){}),typeof l!="function"&&(l=f,f=function(){});var p=dg();return function(v){if(v){v.stack&&pg(v,p);var E=o.Event.create(v,!0,{severity:"warning",unhandled:!1,severityReason:{type:"callbackErrorIntercept"}},"intercept()",1);o._notify(E,f);return}for(var x=arguments.length,M=new Array(x>1?x-1:0),j=1;j<x;j++)M[j-1]=arguments[j];l.apply(void 0,M)}};return c}},sn.default=sn;function un(){return un=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},un.apply(null,arguments)}var yt=require("os"),hg={load:function(o){var c={osName:yt.platform()+" ("+yt.arch()+")",osVersion:yt.release(),totalMemory:yt.totalmem(),hostname:o._config.hostname,runtimeVersions:{node:process.versions.node}};o._addOnSessionPayload(function(f){f.device=un({},f.device,c)}),o.addOnError(function(f){f.device=un({},f.device,c,{freeMemory:yt.freemem(),time:new Date})},!0)}},bs=require("path"),gg=bs.join,mg=bs.resolve,_s=function(o){return gg(mg(o),"/")},yg={load:function(o){return o.addOnError(function(c){if(o._config.projectRoot){var f=_s(o._config.projectRoot),l=c.errors.reduce(function(p,v){return p.concat(v.stacktrace)},[]);l.map(function(p){p.inProject=typeof p.file=="string"&&p.file.indexOf(f)===0&&!/\/node_modules\//.test(p.file)})}})}};function Hi(){return Hi=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},Hi.apply(null,arguments)}function vg(o,c){o.prototype=Object.create(c.prototype),o.prototype.constructor=o,Gi(o,c)}function Gi(o,c){return Gi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,l){return f.__proto__=l,f},Gi(o,c)}var ws=3,Es=200,bg=require("fs"),_g=bg.createReadStream,wg=require("stream"),Eg=wg.Writable,Sg=ks(),Og=Bs(),Pg=require("path"),Ag={load:function(o){if(o._config.sendCode){var c=function(f,l){return new Promise(function(p,v){try{if(!f.lineNumber||!f.file)return p(f);var E=Pg.resolve(o._config.projectRoot,f.file),x=E+"@"+f.lineNumber;if(x in l)return f.code=l[x],p(f);Tg(E,f.lineNumber,function(M,j){return M||(f.code=l[x]=j),p(f)})}catch{return p(f)}})};o.addOnError(function(f){return new Promise(function(l,p){var v=Object.create(null),E=f.errors.reduce(function(x,M){return x.concat(M.stacktrace)},[]);xg(E.map(function(x){return function(){return c(x,v)}})).then(l).catch(p)})})}},configSchema:{sendCode:{defaultValue:function(){return!0},validate:function(o){return o===!0||o===!1},message:"should be true or false"}}},Tg=function(o,c,f){var l=c-ws,p=c+ws,v=_g(o,{encoding:"utf8"}),E=new Og.LineStream({keepEmptyLines:!0}),x=new Ng({start:l,end:p});x.on("done",function(){return v.destroy()}),Sg(v,E,x,function(M){if(M&&M.message!=="premature close")return f(M);f(null,x.getCode())})},Ng=(function(o){function c(l){var p;return p=o.call(this,Hi({},l,{decodeStrings:!1}))||this,p._start=l.start,p._end=l.end,p._n=0,p._code={},p}vg(c,o);var f=c.prototype;return f._write=function(p,v,E){return this._n++,this._n<this._start?E(null):this._n<=this._end?(this._code[String(this._n)]=p.length<=Es?p:p.substr(0,Es),E(null)):(this.emit("done"),E(null))},f.getCode=function(){return this._code},c})(Eg),xg=function(o){return new Promise(function(c,f){var l=[];o.reduce(function(p,v){return p.then(function(E){return l.push(E),v()})},Promise.resolve()).then(function(p){l.push(p)}).then(function(){c(l.slice(1))})})},Mg=Yr.maybeUseFallbackStack,Wi,Rg={load:function(o){o._config.autoDetectErrors&&o._config.enabledErrorTypes.unhandledExceptions&&(Wi=function(c){var f=o._clientContext&&o._clientContext.getStore(),l=f||o;c.stack&&l.fallbackStack&&Mg(c,l.fallbackStack);var p=l.Event.create(c,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},"uncaughtException handler",1);return new Promise(function(v){l._notify(p,function(){},function(E,x){E&&l._logger.error("Failed to send event to Bugsnag"),l._config.onUncaughtException(c,x,l._logger),v()})})},process.prependListener("uncaughtException",Wi))},destroy:function(){process.removeListener("uncaughtException",Wi)}},ln,Ig={load:function(o){!o._config.autoDetectErrors||!o._config.enabledErrorTypes.unhandledRejections||(ln=function(c){var f=o._clientContext&&o._clientContext.getStore(),l=f||o,p=!o._config.reportUnhandledPromiseRejectionsAsHandled,v=l.Event.create(c,!1,{severity:"error",unhandled:p,severityReason:{type:"unhandledPromiseRejection"}},"unhandledRejection handler",1);return new Promise(function(E){l._notify(v,function(){},function(x,M){x&&l._logger.error("Failed to send event to Bugsnag"),l._config.onUnhandledRejection(c,M,l._logger),E()})})},process.prependListener?process.prependListener("unhandledRejection",ln):process.on("unhandledRejection",ln))},destroy:function(){process.removeListener("unhandledRejection",ln)}},Dg=Yi;function Yi(o){o=o||{},this.ms=o.min||100,this.max=o.max||1e4,this.factor=o.factor||2,this.jitter=o.jitter>0&&o.jitter<=1?o.jitter:0,this.attempts=0}Yi.prototype.duration=function(){var o=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var c=Math.random(),f=Math.floor(c*this.jitter*o);o=(Math.floor(c*10)&1)==0?o-f:o+f}return Math.min(o,this.max)|0},Yi.prototype.reset=function(){this.attempts=0};function Cg(o,c){o.prototype=Object.create(c.prototype),o.prototype.constructor=o,Vi(o,c)}function Vi(o,c){return Vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,l){return f.__proto__=l,f},Vi(o,c)}var Lg=10*1e3,qg=require("events").EventEmitter,$g=(function(o){function c(l){var p;return p=o.call(this)||this,p._sessions=new Map,p._interval=null,p._intervalLength=l||Lg,p._summarize=p._summarize.bind(p),p}Cg(c,o);var f=c.prototype;return f.start=function(){this._interval||(this._interval=setInterval(this._summarize,this._intervalLength).unref())},f.stop=function(){clearInterval(this._interval),this._interval=null},f.track=function(p){var v=Ug(p.startedAt),E=this._sessions.get(v);return this._sessions.set(v,typeof E>"u"?1:E+1),p},f._summarize=function(){var p=this,v=[];this._sessions.forEach(function(E,x){v.push({startedAt:x,sessionsStarted:E}),p._sessions.delete(x)}),v.length&&this.emit("summary",v)},c})(qg),Ug=function(o){var c=new Date(o);return c.setSeconds(0),c.setMilliseconds(0),c.toISOString()},jg={load:function(o){var c=new $g(o._config.sessionSummaryInterval);c.on("summary",Fg(o)),c.start(),o._sessionDelegate={startSession:function(f,l){return f._session=l,f._pausedSession=null,c.track(f._session),f},pauseSession:function(f){f._pausedSession=f._session,f._session=null},resumeSession:function(f){return f._session?f:f._pausedSession?(f._session=f._pausedSession,f._pausedSession=null,f):f.startSession()}}},configSchema:{sessionSummaryInterval:{defaultValue:function(){},validate:function(o){return o===void 0||S()(o)},message:"should be a positive integer"}}},Fg=function(o){return function(c){if(o._config.enabledReleaseStages!==null&&!o._config.enabledReleaseStages.includes(o._config.releaseStage)){o._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration");return}if(!c.length)return;var f=new Dg({min:1e3,max:1e4}),l=10;v(p);function p(E){if(!E){var x=c.reduce(function(M,j){return M+j.sessionsStarted},0);return o._logger.debug(x+" session(s) reported")}if(f.attempts===10){o._logger.error("Session delivery failed, max retries exceeded",E);return}o._logger.debug("Session delivery failed, retry #"+(f.attempts+1)+"/"+l,E),setTimeout(function(){return v(p)},f.duration())}function v(E){var x={notifier:o._notifier,device:{},app:{releaseStage:o._config.releaseStage,version:o._config.appVersion,type:o._config.appType},sessionCounts:c},M=qi(o._cbs.sp,x,"onSessionPayload",o._logger);if(M)return o._logger.debug("Session not sent due to onSessionPayload callback"),E(null);o._delivery.sendSession(x,E)}}},kg={load:function(o){o.addOnError(function(c){var f=c.errors.reduce(function(l,p){return l.concat(p.stacktrace)},[]);f.forEach(function(l){typeof l.file=="string"&&(l.file=l.file.replace(/\\/g,"/"))})})}},zg={load:function(o){return o.addOnError(function(c){if(o._config.projectRoot){var f=_s(o._config.projectRoot),l=c.errors.reduce(function(p,v){return p.concat(v.stacktrace)},[]);l.map(function(p){typeof p.file=="string"&&p.file.indexOf(f)===0&&(p.file=p.file.replace(f,""))})}})}},br={};function Ki(){return Ki=Object.assign?Object.assign.bind():function(o){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var l in f)({}).hasOwnProperty.call(f,l)&&(o[l]=f[l])}return o},Ki.apply(null,arguments)}var Bg="Bugsnag Node",Hg="8.6.0",Gg="https://github.com/bugsnag/bugsnag-js",Wg=require("async_hooks"),Yg=Wg.AsyncLocalStorage;en.__type="nodejs";var Vg=Ki({},T.schema,og),Kg=[cg,Ag,yg,zg,jg,hg,Rg,Ig,sn,on,kg,zi],Ie={_client:null,createClient:function(o){typeof o=="string"&&(o={apiKey:o}),o||(o={});var c=new nn(o,Vg,Kg,{name:Bg,version:Hg,url:Gg});return Object.keys(nn.prototype).forEach(function(f){var l=c[f];c[f]=function(){var p=c._clientContext&&typeof c._clientContext.getStore=="function"?c._clientContext.getStore():null,v=p||c,E=p?p[f]:l;v._depth+=1;var x=E.apply(v,arguments);return v._depth-=1,x}}),c._clientContext=new Yg,c._setDelivery(tg),c._logger.debug("Loaded!"),c},start:function(o){return Ie._client?(Ie._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),Ie._client):(Ie._client=Ie.createClient(o),Ie._client)},isStarted:function(){return Ie._client!=null}};return Object.keys(nn.prototype).forEach(function(o){/^_/.test(o)||(Ie[o]=function(){var c=Ie._client,f=c&&c._clientContext&&c._clientContext.getStore();if(f&&(c=f),!c)return console.error("Bugsnag."+o+"() was called before Bugsnag.start()");c._depth+=1;var l=c[o].apply(c,arguments);return c._depth-=1,l})}),br=Ie,br.Client=nn,br.Event=en,br.Session=ji,br.Breadcrumb=i,br.default=Ie,br})});var ia=m((OE,Ws)=>{Ws.exports=Gs()});var pn=m(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TerritoryCodeSchema=_r.territoryCodes=void 0;var bm=require("zod");_r.territoryCodes=["AFG","AGO","AIA","ALB","ARE","ARG","ARM","ATG","AUS","AUT","AZE","BEL","BEN","BFA","BGR","BHR","BHS","BIH","BLR","BLZ","BMU","BOL","BRA","BRB","BRN","BTN","BWA","CAN","CHE","CHL","CHN","CIV","CMR","COD","COG","COL","CPV","CRI","CYM","CYP","CZE","DEU","DMA","DNK","DOM","DZA","ECU","EGY","ESP","EST","FIN","FJI","FRA","FSM","GAB","GBR","GEO","GHA","GMB","GNB","GRC","GRD","GTM","GUY","HKG","HND","HRV","HUN","IDN","IND","IRL","IRQ","ISL","ISR","ITA","JAM","JOR","JPN","KAZ","KEN","KGZ","KHM","KNA","KOR","KWT","LAO","LBN","LBR","LBY","LCA","LKA","LTU","LUX","LVA","MAC","MAR","MDA","MDG","MDV","MEX","MKD","MLI","MLT","MMR","MNE","MNG","MOZ","MRT","MSR","MUS","MWI","MYS","NAM","NER","NGA","NIC","NLD","NOR","NPL","NRU","NZL","OMN","PAK","PAN","PER","PHL","PLW","PNG","POL","PRT","PRY","QAT","ROU","RUS","RWA","SAU","SEN","SGP","SLB","SLE","SLV","SRB","STP","SUR","SVK","SVN","SWE","SWZ","SYC","TCA","TCD","THA","TJK","TKM","TON","TTO","TUN","TUR","TWN","TZA","UGA","UKR","URY","USA","UZB","VCT","VEN","VGB","VNM","VUT","XKS","YEM","ZAF","ZMB","ZWE"];_r.TerritoryCodeSchema=bm.z.enum(_r.territoryCodes)});var aa=m(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.LocaleCodeSchema=wr.localeCodes=void 0;var _m=require("zod");wr.localeCodes=["ar-SA","ca","zh-Hans","zh-Hant","hr","cs","da","nl-NL","en-AU","en-CA","en-GB","en-US","fi","fr-FR","fr-CA","de-DE","el","he","hi","hu","id","it","ja","ko","ms","no","pl","pt-BR","pt-PT","ro","ru","sk","es-MX","es-ES","sv","th","tr","uk","vi"];wr.LocaleCodeSchema=_m.z.enum(wr.localeCodes)});var bt=m(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.ContextualError=void 0;Ye.isNotFoundError=wm;Ye.isRateLimitError=Em;Ye.isNotAuthorizedError=Sm;Ye.isVersionNotUpdatableError=Om;Ye.extractClientErrorToSend=Ys;var oa=require("zod-validation-error"),hn=class e extends Error{constructor(r,t){super(r),this.stack=new Error(r).stack,this.context=t,Object.setPrototypeOf(this,e.prototype)}};Ye.ContextualError=hn;function Er(e){let r=[];if(!e||typeof e!="object")return r;e.errors&&Array.isArray(e.errors)&&r.push(e);for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];Array.isArray(n)?n.forEach(i=>{r.push(...Er(i))}):n&&typeof n=="object"&&r.push(...Er(n))}return r}function wm(e){let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status==="404"||n.status===404))return!0;return e?.status===404||e?.status==="404"||e?.response?.status===404}function Em(e){if(e?.status===429||e?.status==="429")return!0;let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status===429||n.status==="429"))return!0;return!1}function Sm(e){if(e?.status===401||e?.status==="401")return!0;let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status===401||n.status==="401"||n.code==="NOT_AUTHORIZED"))return!0;return!1}function Om(e){if(e?.status===409||e?.status==="409")return!0;let r=Er(e);for(let t of r)if(t.errors&&Array.isArray(t.errors)&&t.errors.some(n=>n.status===409||n.status==="409"||n.code==="ENTITY_ERROR.ATTRIBUTE.INVALID.INVALID_STATE"))return!0;return!1}function Ys(e){try{if(oa.isZodErrorLike&&(0,oa.isZodErrorLike)(e))return{message:(0,oa.fromError)(e).message,status:400}}catch{}if(e instanceof hn){let t=Er(e.context).flatMap(i=>Array.isArray(i.errors)?i.errors.map(a=>({title:a?.title,detail:a?.detail})):[]),n=e.message;if(e.context instanceof Error){let i=Ys(e.context);n=n+`
|
|
26
|
+
${i.message}`,t=t.concat(i.details||[])}return{message:n,status:400,details:t}}return typeof e=="string"?{message:e,status:400}:e instanceof Error?{message:e.message,status:400}:{message:"Internal server error",status:500}}});var gn=m(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.isValidProductId=void 0;Sr.deepEqualUnordered=sa;Sr.readJsonFile=Nm;Sr.validateAppStoreModelData=Mm;var Pm=require("zod"),Am=require("fs"),Tm=bt();function sa(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return!1;let t=new Array(r.length).fill(!1);for(let n of e){let i=!1;for(let a=0;a<r.length;a++)if(!t[a]&&sa(n,r[a])){t[a]=!0,i=!0;break}if(!i)return!1}return!0}if(e&&r&&typeof e=="object"){let t=Object.keys(e),n=Object.keys(r);if(t.length!==n.length)return!1;for(let i of t)if(!Object.prototype.hasOwnProperty.call(r,i)||!sa(e[i],r[i]))return!1;return!0}return!1}function Nm(e){let r=(0,Am.readFileSync)(e,"utf-8");try{return JSON.parse(r)}catch(t){throw new Tm.ContextualError(`\u274C Invalid JSON format! ${e}`,{filePath:e,jsonError:t})}}var xm=e=>/^[a-zA-Z0-9._]+$/.test(e);Sr.isValidProductId=xm;function Mm(e,r){e.primaryLocale&&e.localizations&&e.localizations.length>0&&(e.localizations.some(n=>n.locale===e.primaryLocale)||r.addIssue({code:Pm.z.ZodIssueCode.custom,message:`Primary locale '${e.primaryLocale}' must exist in the localizations array`,path:["primaryLocale"]}))}});var Vs=m((xE,Rm)=>{Rm.exports=[{duration:7,durationType:"1w",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:2},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:3},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:4},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:5},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:6},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:7},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:8},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:9},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:10},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:11},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:12}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:30,durationType:"1m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:4},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:5},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:6},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:7},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:8},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:9},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:10},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:11},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:12}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:60,durationType:"2m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:4},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:5},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:6}]},{modeType:"FreeTrial",durations:[{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:90,durationType:"3m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:2},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:3},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:4}]},{modeType:"FreeTrial",durations:[{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:180,durationType:"6m",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:2}]},{modeType:"FreeTrial",durations:[{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]},{duration:365,durationType:"1y",bonusPeriods:["1w","1m","2m","3m","6m","1y","3d","2w"],introOfferDurations:[{modeType:"PayUpFront",durations:[{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"PayAsYouGo",durations:[{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1}]},{modeType:"FreeTrial",durations:[{typeDuration:1,typeUnit:"ONE_YEAR",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_WEEK",numberOfPeriods:1},{typeDuration:1,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:6,typeUnit:"ONE_MONTH",numberOfPeriods:1},{typeDuration:3,typeUnit:"ONE_DAY",numberOfPeriods:1},{typeDuration:2,typeUnit:"ONE_WEEK",numberOfPeriods:1}]}]}]});var ua=m(sr=>{"use strict";var Im=sr&&sr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sr,"__esModule",{value:!0});sr.getValidIntroductoryOfferDurations=Xs;sr.getValidPayAsYouGoPeriods=Qs;sr.isValidIntroductoryOfferDuration=Cm;sr.isValidPayAsYouGoPeriods=Lm;var Ks=Im(Vs()),Js={ONE_WEEK:7,ONE_MONTH:30,TWO_MONTHS:60,THREE_MONTHS:90,SIX_MONTHS:180,ONE_YEAR:365},Zs={PAY_AS_YOU_GO:"PayAsYouGo",PAY_UP_FRONT:"PayUpFront",FREE_TRIAL:"FreeTrial"};function Dm(e,r){if(r==="ONE_MONTH")switch(e){case 1:return"ONE_MONTH";case 2:return"TWO_MONTHS";case 3:return"THREE_MONTHS";case 6:return"SIX_MONTHS";default:return null}else if(r==="ONE_WEEK")switch(e){case 1:return"ONE_WEEK";case 2:return"TWO_WEEKS";default:return null}else if(r==="ONE_DAY")switch(e){case 3:return"THREE_DAYS";default:return null}else if(r==="ONE_YEAR")switch(e){case 1:return"ONE_YEAR";default:return null}return null}function Xs(e,r){if(r==="PAY_AS_YOU_GO")return[];let t=Js[e],n=Zs[r],i=Ks.default.find(u=>u.duration===t);if(!i)throw new Error(`No duration configuration found for subscription period: ${e}`);let a=i.introOfferDurations.find(u=>u.modeType===n);if(!a)throw new Error(`No intro offer configuration found for offer type: ${r}`);let s=new Set;for(let u of a.durations){let d=Dm(u.typeDuration,u.typeUnit);d&&s.add(d)}return Array.from(s)}function Qs(e){let r=Js[e],t=Zs.PAY_AS_YOU_GO,n=Ks.default.find(a=>a.duration===r);if(!n)throw new Error(`No duration configuration found for subscription period: ${e}`);let i=n.introOfferDurations.find(a=>a.modeType===t);if(!i)throw new Error(`No PAY_AS_YOU_GO configuration found for subscription period: ${e}`);return i.durations.map(a=>a.numberOfPeriods)}function Cm(e,r,t){return r==="PAY_AS_YOU_GO"?!1:Xs(e,r).includes(t)}function Lm(e,r){return Qs(e).includes(r)}});var we=m((RE,eu)=>{"use strict";var la=class e extends Error{constructor(r){super(`Format functions must be synchronous taking a two arguments: (info, opts)
|
|
27
|
+
Found: ${r.toString().split(`
|
|
5
28
|
`)[0]}
|
|
6
|
-
`),Error.captureStackTrace(this,
|
|
7
|
-
`)!=-1,
|
|
8
|
-
`));return!0}
|
|
9
|
-
${
|
|
10
|
-
${
|
|
11
|
-
${
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${
|
|
15
|
-
${
|
|
16
|
-
${
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
${N}`),g.pop(),`{${U}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function p(_,f,g){switch(typeof f){case"string":return qe(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(_),typeof f!="object")return p(_,f,g);if(f===null)return"null"}if(g.indexOf(f)!==-1)return t;let E="",P=f.length!==void 0;if(P&&Array.isArray(f)){if(f.length===0)return"[]";if(a<g.length+1)return'"[Array]"';g.push(f);let U=Math.min(f.length,s),D=0;for(;D<U-1;D++){let x=p(String(D),f[D],g);E+=x!==void 0?x:"null",E+=","}let L=p(String(D),f[D],g);if(E+=L!==void 0?L:"null",f.length-1>s){let x=f.length-s-1;E+=`,"... ${Xe(x)} not stringified"`}return g.pop(),`[${E}]`}let N=Object.keys(f),v=N.length;if(v===0)return"{}";if(a<g.length+1)return'"[Object]"';let T="",q=Math.min(v,s);P&&hn(f)&&(E+=Za(f,",",s),N=N.slice(f.length),q-=f.length,T=","),n&&(N=pn(N,o)),g.push(f);for(let U=0;U<q;U++){let D=N[U],L=p(D,f[D],g);L!==void 0&&(E+=`${T}${qe(D)}:${L}`,T=",")}if(v>s){let U=v-s;E+=`${T}"...":"${Xe(U)} not stringified"`}return g.pop(),`{${E}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(i)return String(f);default:return e?e(f):void 0}}function m(_,f,g){if(arguments.length>1){let E="";if(typeof g=="number"?E=" ".repeat(Math.min(g,10)):typeof g=="string"&&(E=g.slice(0,10)),f!=null){if(typeof f=="function")return u("",{"":_},[],f,E,"");if(Array.isArray(f))return l("",_,[],qp(f),E,"")}if(E.length!==0)return d("",_,[],E,"")}return p("",_,[])}return m}});var yn=c((_1,es)=>{"use strict";var Up=ne(),{MESSAGE:Fp}=G(),jp=Hr();function kp(r,e){return typeof e=="bigint"?e.toString():e}es.exports=Up((r,e)=>{let t=jp.configure(e);return r[Fp]=t(r,e.replacer||kp,e.space),r})});var ts=c((w1,rs)=>{"use strict";var zp=ne();rs.exports=zp((r,e)=>e.message?(r.message=`[${e.label}] ${r.message}`,r):(r.label=e.label,r))});var ns=c((E1,is)=>{"use strict";var Hp=ne(),{MESSAGE:Gp}=G(),Yp=Hr();is.exports=Hp(r=>{let e={};return r.message&&(e["@message"]=r.message,delete r.message),r.timestamp&&(e["@timestamp"]=r.timestamp,delete r.timestamp),e["@fields"]=r,r[Gp]=Yp(e),r})});var as=c((O1,os)=>{"use strict";var Wp=ne();function Bp(r,e,t){let i=e.reduce((o,a)=>(o[a]=r[a],delete r[a],o),{}),n=Object.keys(r).reduce((o,a)=>(o[a]=r[a],delete r[a],o),{});return Object.assign(r,i,{[t]:n}),r}function Vp(r,e,t){return r[t]=e.reduce((i,n)=>(i[n]=r[n],delete r[n],i),{}),r}os.exports=Wp((r,e={})=>{let t="metadata";e.key&&(t=e.key);let i=[];return!e.fillExcept&&!e.fillWith&&(i.push("level"),i.push("message")),e.fillExcept&&(i=e.fillExcept),i.length>0?Bp(r,i,t):e.fillWith?Vp(r,e.fillWith,t):r})});var us=c((S1,ss)=>{var Er=1e3,Or=Er*60,Sr=Or*60,er=Sr*24,Kp=er*7,Jp=er*365.25;ss.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return Zp(r);if(t==="number"&&isFinite(r))return e.long?Qp(r):Xp(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Zp(r){if(r=String(r),!(r.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(r);if(e){var t=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return t*Jp;case"weeks":case"week":case"w":return t*Kp;case"days":case"day":case"d":return t*er;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Sr;case"minutes":case"minute":case"mins":case"min":case"m":return t*Or;case"seconds":case"second":case"secs":case"sec":case"s":return t*Er;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Xp(r){var e=Math.abs(r);return e>=er?Math.round(r/er)+"d":e>=Sr?Math.round(r/Sr)+"h":e>=Or?Math.round(r/Or)+"m":e>=Er?Math.round(r/Er)+"s":r+"ms"}function Qp(r){var e=Math.abs(r);return e>=er?xt(r,e,er,"day"):e>=Sr?xt(r,e,Sr,"hour"):e>=Or?xt(r,e,Or,"minute"):e>=Er?xt(r,e,Er,"second"):r+" ms"}function xt(r,e,t,i){var n=e>=t*1.5;return Math.round(r/t)+" "+i+(n?"s":"")}});var cs=c((Gr,ls)=>{"use strict";var eh=ne(),rh=us();ls.exports=eh(r=>{let e=+new Date;return Gr.diff=e-(Gr.prevTime||e),Gr.prevTime=e,r.ms=`+${rh(Gr.diff)}`,r})});var ps=c((P1,ds)=>{"use strict";var th=require("util").inspect,ih=ne(),{LEVEL:nh,MESSAGE:fs,SPLAT:oh}=G();ds.exports=ih((r,e={})=>{let t=Object.assign({},r);return delete t[nh],delete t[fs],delete t[oh],r[fs]=th(t,!1,e.depth||null,e.colorize),r})});var hs=c((A1,Dt)=>{"use strict";var{MESSAGE:ah}=G(),It=class{constructor(e){this.template=e}transform(e){return e[ah]=this.template(e),e}};Dt.exports=r=>new It(r);Dt.exports.Printf=Dt.exports.Format=It});var ys=c((T1,gs)=>{"use strict";var sh=ne(),{MESSAGE:ms}=G(),uh=Hr();gs.exports=sh(r=>{let e=uh(Object.assign({},r,{level:void 0,message:void 0,splat:void 0})),t=r.padding&&r.padding[r.level]||"";return e!=="{}"?r[ms]=`${r.level}:${t} ${r.message} ${e}`:r[ms]=`${r.level}:${t} ${r.message}`,r})});var _s=c((N1,vs)=>{"use strict";var lh=require("util"),{SPLAT:bs}=G(),ch=/%[scdjifoO%]/g,fh=/%%/g,bn=class{constructor(e){this.options=e}_splat(e,t){let i=e.message,n=e[bs]||e.splat||[],o=i.match(fh),a=o&&o.length||0,u=t.length-a-n.length,l=u<0?n.splice(u,-1*u):[],d=l.length;if(d)for(let p=0;p<d;p++)Object.assign(e,l[p]);return e.message=lh.format(i,...n),e}transform(e){let t=e.message,i=e[bs]||e.splat;if(!i||!i.length)return e;let n=t&&t.match&&t.match(ch);if(!n&&(i||i.length)){let o=i.length>1?i.splice(0):i,a=o.length;if(a)for(let s=0;s<a;s++)Object.assign(e,o[s]);return e}return n?this._splat(e,n):e}};vs.exports=r=>new bn(r)});var Es=c((Lt,ws)=>{(function(r,e){typeof Lt=="object"&&typeof ws<"u"?e(Lt):typeof define=="function"&&define.amd?define(["exports"],e):e(r.fecha={})})(Lt,(function(r){"use strict";var e=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,t="\\d\\d?",i="\\d\\d",n="\\d{3}",o="\\d{4}",a="[^\\s]+",s=/\[([^]*?)\]/gm;function u(h,w){for(var $=[],Q=0,A=h.length;Q<A;Q++)$.push(h[Q].substr(0,w));return $}var l=function(h){return function(w,$){var Q=$[h].map(function(de){return de.toLowerCase()}),A=Q.indexOf(w.toLowerCase());return A>-1?A:null}};function d(h){for(var w=[],$=1;$<arguments.length;$++)w[$-1]=arguments[$];for(var Q=0,A=w;Q<A.length;Q++){var de=A[Q];for(var Pe in de)h[Pe]=de[Pe]}return h}var p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],m=["January","February","March","April","May","June","July","August","September","October","November","December"],_=u(m,3),f=u(p,3),g={dayNamesShort:f,dayNames:p,monthNamesShort:_,monthNames:m,amPm:["am","pm"],DoFn:function(h){return h+["th","st","nd","rd"][h%10>3?0:(h-h%10!==10?1:0)*h%10]}},E=d({},g),P=function(h){return E=d(E,h)},N=function(h){return h.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},v=function(h,w){for(w===void 0&&(w=2),h=String(h);h.length<w;)h="0"+h;return h},T={D:function(h){return String(h.getDate())},DD:function(h){return v(h.getDate())},Do:function(h,w){return w.DoFn(h.getDate())},d:function(h){return String(h.getDay())},dd:function(h){return v(h.getDay())},ddd:function(h,w){return w.dayNamesShort[h.getDay()]},dddd:function(h,w){return w.dayNames[h.getDay()]},M:function(h){return String(h.getMonth()+1)},MM:function(h){return v(h.getMonth()+1)},MMM:function(h,w){return w.monthNamesShort[h.getMonth()]},MMMM:function(h,w){return w.monthNames[h.getMonth()]},YY:function(h){return v(String(h.getFullYear()),4).substr(2)},YYYY:function(h){return v(h.getFullYear(),4)},h:function(h){return String(h.getHours()%12||12)},hh:function(h){return v(h.getHours()%12||12)},H:function(h){return String(h.getHours())},HH:function(h){return v(h.getHours())},m:function(h){return String(h.getMinutes())},mm:function(h){return v(h.getMinutes())},s:function(h){return String(h.getSeconds())},ss:function(h){return v(h.getSeconds())},S:function(h){return String(Math.round(h.getMilliseconds()/100))},SS:function(h){return v(Math.round(h.getMilliseconds()/10),2)},SSS:function(h){return v(h.getMilliseconds(),3)},a:function(h,w){return h.getHours()<12?w.amPm[0]:w.amPm[1]},A:function(h,w){return h.getHours()<12?w.amPm[0].toUpperCase():w.amPm[1].toUpperCase()},ZZ:function(h){var w=h.getTimezoneOffset();return(w>0?"-":"+")+v(Math.floor(Math.abs(w)/60)*100+Math.abs(w)%60,4)},Z:function(h){var w=h.getTimezoneOffset();return(w>0?"-":"+")+v(Math.floor(Math.abs(w)/60),2)+":"+v(Math.abs(w)%60,2)}},q=function(h){return+h-1},U=[null,t],D=[null,a],L=["isPm",a,function(h,w){var $=h.toLowerCase();return $===w.amPm[0]?0:$===w.amPm[1]?1:null}],x=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(h){var w=(h+"").match(/([+-]|\d\d)/gi);if(w){var $=+w[1]*60+parseInt(w[2],10);return w[0]==="+"?$:-$}return 0}],j={D:["day",t],DD:["day",i],Do:["day",t+a,function(h){return parseInt(h,10)}],M:["month",t,q],MM:["month",i,q],YY:["year",i,function(h){var w=new Date,$=+(""+w.getFullYear()).substr(0,2);return+(""+(+h>68?$-1:$)+h)}],h:["hour",t,void 0,"isPm"],hh:["hour",i,void 0,"isPm"],H:["hour",t],HH:["hour",i],m:["minute",t],mm:["minute",i],s:["second",t],ss:["second",i],YYYY:["year",o],S:["millisecond","\\d",function(h){return+h*100}],SS:["millisecond",i,function(h){return+h*10}],SSS:["millisecond",n],d:U,dd:U,ddd:D,dddd:D,MMM:["month",a,l("monthNamesShort")],MMMM:["month",a,l("monthNames")],a:L,A:L,ZZ:x,Z:x},K={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},W=function(h){return d(K,h)},ee=function(h,w,$){if(w===void 0&&(w=K.default),$===void 0&&($={}),typeof h=="number"&&(h=new Date(h)),Object.prototype.toString.call(h)!=="[object Date]"||isNaN(h.getTime()))throw new Error("Invalid Date pass to format");w=K[w]||w;var Q=[];w=w.replace(s,function(de,Pe){return Q.push(Pe),"@@@"});var A=d(d({},E),$);return w=w.replace(e,function(de){return T[de](h,A)}),w.replace(/@@@/g,function(){return Q.shift()})};function re(h,w,$){if($===void 0&&($={}),typeof w!="string")throw new Error("Invalid format in fecha parse");if(w=K[w]||w,h.length>1e3)return null;var Q=new Date,A={year:Q.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},de=[],Pe=[],We=w.replace(s,function(Fr,_r){return Pe.push(N(_r)),"@@@"}),yr={},yt={};We=N(We).replace(e,function(Fr){var _r=j[Fr],Bi=_r[0],Fd=_r[1],Xo=_r[3];if(yr[Bi])throw new Error("Invalid format. "+Bi+" specified twice in format");return yr[Bi]=!0,Xo&&(yt[Xo]=!0),de.push(_r),"("+Fd+")"}),Object.keys(yt).forEach(function(Fr){if(!yr[Fr])throw new Error("Invalid format. "+Fr+" is required in specified format")}),We=We.replace(/@@@/g,function(){return Pe.shift()});var br=h.match(new RegExp(We,"i"));if(!br)return null;for(var Yi=d(d({},E),$),ue=1;ue<br.length;ue++){var bt=de[ue-1],Wi=bt[0],vt=bt[2],_t=vt?vt(br[ue],Yi):+br[ue];if(_t==null)return null;A[Wi]=_t}A.isPm===1&&A.hour!=null&&+A.hour!=12?A.hour=+A.hour+12:A.isPm===0&&+A.hour==12&&(A.hour=0);var Ae;if(A.timezoneOffset==null){Ae=new Date(A.year,A.month,A.day,A.hour,A.minute,A.second,A.millisecond);for(var vr=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],ue=0,Ud=vr.length;ue<Ud;ue++)if(yr[vr[ue][0]]&&A[vr[ue][0]]!==Ae[vr[ue][1]]())return null}else if(Ae=new Date(Date.UTC(A.year,A.month,A.day,A.hour,A.minute-A.timezoneOffset,A.second,A.millisecond)),A.month>11||A.month<0||A.day>31||A.day<1||A.hour>23||A.hour<0||A.minute>59||A.minute<0||A.second>59||A.second<0)return null;return Ae}var Le={format:ee,parse:re,defaultI18n:g,setGlobalDateI18n:P,setGlobalDateMasks:W};r.assign=d,r.default=Le,r.format=ee,r.parse=re,r.defaultI18n=g,r.setGlobalDateI18n=P,r.setGlobalDateMasks=W,Object.defineProperty(r,"__esModule",{value:!0})}))});var Ss=c((M1,Os)=>{"use strict";var dh=Es(),ph=ne();Os.exports=ph((r,e={})=>(e.format&&(r.timestamp=typeof e.format=="function"?e.format():dh.format(new Date,e.format)),r.timestamp||(r.timestamp=new Date().toISOString()),e.alias&&(r[e.alias]=r.timestamp),r))});var As=c((R1,Ps)=>{"use strict";var vn=en(),hh=ne(),{MESSAGE:_n}=G();Ps.exports=hh((r,e)=>(e.level!==!1&&(r.level=vn.strip(r.level)),e.message!==!1&&(r.message=vn.strip(String(r.message))),e.raw!==!1&&r[_n]&&(r[_n]=vn.strip(String(r[_n]))),r))});var En=c(wn=>{"use strict";var mh=wn.format=ne();wn.levels=ka();function J(r,e){Object.defineProperty(mh,r,{get(){return e()},configurable:!0})}J("align",function(){return Ha()});J("errors",function(){return Wa()});J("cli",function(){return Va()});J("combine",function(){return Ja()});J("colorize",function(){return Tt()});J("json",function(){return yn()});J("label",function(){return ts()});J("logstash",function(){return ns()});J("metadata",function(){return as()});J("ms",function(){return cs()});J("padLevels",function(){return cn()});J("prettyPrint",function(){return ps()});J("printf",function(){return hs()});J("simple",function(){return ys()});J("splat",function(){return _s()});J("timestamp",function(){return Ss()});J("uncolorize",function(){return As()})});var On=c(Ct=>{"use strict";var{format:Ts}=require("util");Ct.warn={deprecated(r){return()=>{throw new Error(Ts("{ %s } was removed in winston@3.0.0.",r))}},useFormat(r){return()=>{throw new Error([Ts("{ %s } was removed in winston@3.0.0.",r),"Use a custom winston.format = winston.format(function) instead."].join(`
|
|
27
|
-
`))}},forFunctions(r,e,t){t.forEach(i=>{r[i]=Ct.warn[e](i)})},forProperties(r,e,t){t.forEach(i=>{let n=Ct.warn[e](i);Object.defineProperty(r,i,{get:n,set:n})})}}});var Ns=c((D1,gh)=>{gh.exports={name:"winston",description:"A logger for just about everything.",version:"3.17.0",author:"Charlie Robbins <charlie.robbins@gmail.com>",maintainers:["David Hyde <dabh@alumni.stanford.edu>"],repository:{type:"git",url:"https://github.com/winstonjs/winston.git"},keywords:["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],dependencies:{"@dabh/diagnostics":"^2.0.2","@colors/colors":"^1.6.0",async:"^3.2.3","is-stream":"^2.0.0",logform:"^2.7.0","one-time":"^1.0.0","readable-stream":"^3.4.0","safe-stable-stringify":"^2.3.1","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.9.0"},devDependencies:{"@babel/cli":"^7.23.9","@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@dabh/eslint-config-populist":"^4.4.0","@types/node":"^20.11.24","abstract-winston-transport":"^0.5.1",assume:"^2.2.0","cross-spawn-async":"^2.2.5",eslint:"^8.57.0",hock:"^1.4.1",mocha:"^10.3.0",nyc:"^17.1.0",rimraf:"5.0.1",split2:"^4.1.0","std-mocks":"^2.0.0",through2:"^4.0.2","winston-compat":"^0.1.5"},main:"./lib/winston.js",browser:"./dist/winston",types:"./index.d.ts",scripts:{lint:"eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",test:"rimraf test/fixtures/logs/* && mocha","test:coverage":"nyc npm run test:unit","test:unit":"mocha test/unit","test:integration":"mocha test/integration",build:"rimraf dist && babel lib -d dist",prepublishOnly:"npm run build"},engines:{node:">= 12.0.0"},license:"MIT"}});var Rs=c((L1,Ms)=>{Ms.exports=require("util").deprecate});var Sn=c((C1,xs)=>{xs.exports=require("stream")});var An=c((q1,Ds)=>{"use strict";function yh(r,e){var t=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Pn,this,r)):process.nextTick(Pn,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(o){!e&&o?t._writableState?t._writableState.errorEmitted?process.nextTick(qt,t):(t._writableState.errorEmitted=!0,process.nextTick(Is,t,o)):process.nextTick(Is,t,o):e?(process.nextTick(qt,t),e(o)):process.nextTick(qt,t)}),this)}function Is(r,e){Pn(r,e),qt(r)}function qt(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function bh(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Pn(r,e){r.emit("error",e)}function vh(r,e){var t=r._readableState,i=r._writableState;t&&t.autoDestroy||i&&i.autoDestroy?r.destroy(e):r.emit("error",e)}Ds.exports={destroy:yh,undestroy:bh,errorOrDestroy:vh}});var $e=c(($1,qs)=>{"use strict";var Cs={};function pe(r,e,t){t||(t=Error);function i(o,a,s){return typeof e=="string"?e:e(o,a,s)}class n extends t{constructor(a,s,u){super(i(a,s,u))}}n.prototype.name=t.name,n.prototype.code=r,Cs[r]=n}function Ls(r,e){if(Array.isArray(r)){let t=r.length;return r=r.map(i=>String(i)),t>2?`one of ${e} ${r.slice(0,t-1).join(", ")}, or `+r[t-1]:t===2?`one of ${e} ${r[0]} or ${r[1]}`:`of ${e} ${r[0]}`}else return`of ${e} ${String(r)}`}function _h(r,e,t){return r.substr(!t||t<0?0:+t,e.length)===e}function wh(r,e,t){return(t===void 0||t>r.length)&&(t=r.length),r.substring(t-e.length,t)===e}function Eh(r,e,t){return typeof t!="number"&&(t=0),t+e.length>r.length?!1:r.indexOf(e,t)!==-1}pe("ERR_INVALID_OPT_VALUE",function(r,e){return'The value "'+e+'" is invalid for option "'+r+'"'},TypeError);pe("ERR_INVALID_ARG_TYPE",function(r,e,t){let i;typeof e=="string"&&_h(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(wh(r," argument"))n=`The ${r} ${i} ${Ls(e,"type")}`;else{let o=Eh(r,".")?"property":"argument";n=`The "${r}" ${o} ${i} ${Ls(e,"type")}`}return n+=`. Received type ${typeof t}`,n},TypeError);pe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");pe("ERR_METHOD_NOT_IMPLEMENTED",function(r){return"The "+r+" method is not implemented"});pe("ERR_STREAM_PREMATURE_CLOSE","Premature close");pe("ERR_STREAM_DESTROYED",function(r){return"Cannot call "+r+" after a stream was destroyed"});pe("ERR_MULTIPLE_CALLBACK","Callback called multiple times");pe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");pe("ERR_STREAM_WRITE_AFTER_END","write after end");pe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);pe("ERR_UNKNOWN_ENCODING",function(r){return"Unknown encoding: "+r},TypeError);pe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");qs.exports.codes=Cs});var Tn=c((U1,$s)=>{"use strict";var Oh=$e().codes.ERR_INVALID_OPT_VALUE;function Sh(r,e,t){return r.highWaterMark!=null?r.highWaterMark:e?r[t]:null}function Ph(r,e,t,i){var n=Sh(e,i,t);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?t:"highWaterMark";throw new Oh(o,n)}return Math.floor(n)}return r.objectMode?16:16*1024}$s.exports={getHighWaterMark:Ph}});var Us=c((F1,Nn)=>{typeof Object.create=="function"?Nn.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Nn.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}});var Pr=c((j1,Rn)=>{try{if(Mn=require("util"),typeof Mn.inherits!="function")throw"";Rn.exports=Mn.inherits}catch{Rn.exports=Us()}var Mn});var Gs=c((k1,Hs)=>{"use strict";function Fs(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function js(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fs(Object(t),!0).forEach(function(i){Ah(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fs(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Ah(r,e,t){return e=zs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Th(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function ks(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,zs(i.key),i)}}function Nh(r,e,t){return e&&ks(r.prototype,e),t&&ks(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}function zs(r){var e=Mh(r,"string");return typeof e=="symbol"?e:String(e)}function Mh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Rh=require("buffer"),$t=Rh.Buffer,xh=require("util"),xn=xh.inspect,Ih=xn&&xn.custom||"inspect";function Dh(r,e,t){$t.prototype.copy.call(r,e,t)}Hs.exports=(function(){function r(){Th(this,r),this.head=null,this.tail=null,this.length=0}return Nh(r,[{key:"push",value:function(t){var i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(t){var i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=t+i.data;return n}},{key:"concat",value:function(t){if(this.length===0)return $t.alloc(0);for(var i=$t.allocUnsafe(t>>>0),n=this.head,o=0;n;)Dh(n.data,i,o),o+=n.data.length,n=n.next;return i}},{key:"consume",value:function(t,i){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?n=this.shift():n=i?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var i=this.head,n=1,o=i.data;for(t-=o.length;i=i.next;){var a=i.data,s=t>a.length?a.length:t;if(s===a.length?o+=a:o+=a.slice(0,t),t-=s,t===0){s===a.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(s));break}++n}return this.length-=n,o}},{key:"_getBuffer",value:function(t){var i=$t.allocUnsafe(t),n=this.head,o=1;for(n.data.copy(i),t-=n.data.length;n=n.next;){var a=n.data,s=t>a.length?a.length:t;if(a.copy(i,i.length-t,0,s),t-=s,t===0){s===a.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(s));break}++o}return this.length-=o,i}},{key:Ih,value:function(t,i){return xn(this,js(js({},i),{},{depth:0,customInspect:!1}))}}]),r})()});var Bs=c((In,Ws)=>{var Ut=require("buffer"),be=Ut.Buffer;function Ys(r,e){for(var t in r)e[t]=r[t]}be.from&&be.alloc&&be.allocUnsafe&&be.allocUnsafeSlow?Ws.exports=Ut:(Ys(Ut,In),In.Buffer=rr);function rr(r,e,t){return be(r,e,t)}rr.prototype=Object.create(be.prototype);Ys(be,rr);rr.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return be(r,e,t)};rr.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=be(r);return e!==void 0?typeof t=="string"?i.fill(e,t):i.fill(e):i.fill(0),i};rr.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return be(r)};rr.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Ut.SlowBuffer(r)}});var Cn=c(Ks=>{"use strict";var Ln=Bs().Buffer,Vs=Ln.isEncoding||function(r){switch(r=""+r,r&&r.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Lh(r){if(!r)return"utf8";for(var e;;)switch(r){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return r;default:if(e)return;r=(""+r).toLowerCase(),e=!0}}function Ch(r){var e=Lh(r);if(typeof e!="string"&&(Ln.isEncoding===Vs||!Vs(r)))throw new Error("Unknown encoding: "+r);return e||r}Ks.StringDecoder=Yr;function Yr(r){this.encoding=Ch(r);var e;switch(this.encoding){case"utf16le":this.text=kh,this.end=zh,e=4;break;case"utf8":this.fillLast=Uh,e=4;break;case"base64":this.text=Hh,this.end=Gh,e=3;break;default:this.write=Yh,this.end=Wh;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ln.allocUnsafe(e)}Yr.prototype.write=function(r){if(r.length===0)return"";var e,t;if(this.lastNeed){if(e=this.fillLast(r),e===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<r.length?e?e+this.text(r,t):this.text(r,t):e||""};Yr.prototype.end=jh;Yr.prototype.text=Fh;Yr.prototype.fillLast=function(r){if(this.lastNeed<=r.length)return r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,this.lastTotal-this.lastNeed,0,r.length),this.lastNeed-=r.length};function Dn(r){return r<=127?0:r>>5===6?2:r>>4===14?3:r>>3===30?4:r>>6===2?-1:-2}function qh(r,e,t){var i=e.length-1;if(i<t)return 0;var n=Dn(e[i]);return n>=0?(n>0&&(r.lastNeed=n-1),n):--i<t||n===-2?0:(n=Dn(e[i]),n>=0?(n>0&&(r.lastNeed=n-2),n):--i<t||n===-2?0:(n=Dn(e[i]),n>=0?(n>0&&(n===2?n=0:r.lastNeed=n-3),n):0))}function $h(r,e,t){if((e[0]&192)!==128)return r.lastNeed=0,"\uFFFD";if(r.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return r.lastNeed=1,"\uFFFD";if(r.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return r.lastNeed=2,"\uFFFD"}}function Uh(r){var e=this.lastTotal-this.lastNeed,t=$h(this,r,e);if(t!==void 0)return t;if(this.lastNeed<=r.length)return r.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);r.copy(this.lastChar,e,0,r.length),this.lastNeed-=r.length}function Fh(r,e){var t=qh(this,r,e);if(!this.lastNeed)return r.toString("utf8",e);this.lastTotal=t;var i=r.length-(t-this.lastNeed);return r.copy(this.lastChar,0,i),r.toString("utf8",e,i)}function jh(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+"\uFFFD":e}function kh(r,e){if((r.length-e)%2===0){var t=r.toString("utf16le",e);if(t){var i=t.charCodeAt(t.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=r[r.length-1],r.toString("utf16le",e,r.length-1)}function zh(r){var e=r&&r.length?this.write(r):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,t)}return e}function Hh(r,e){var t=(r.length-e)%3;return t===0?r.toString("base64",e):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=r[r.length-1]:(this.lastChar[0]=r[r.length-2],this.lastChar[1]=r[r.length-1]),r.toString("base64",e,r.length-t))}function Gh(r){var e=r&&r.length?this.write(r):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Yh(r){return r.toString(this.encoding)}function Wh(r){return r&&r.length?this.write(r):""}});var Ft=c((H1,Xs)=>{"use strict";var Js=$e().codes.ERR_STREAM_PREMATURE_CLOSE;function Bh(r){var e=!1;return function(){if(!e){e=!0;for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];r.apply(this,i)}}}function Vh(){}function Kh(r){return r.setHeader&&typeof r.abort=="function"}function Zs(r,e,t){if(typeof e=="function")return Zs(r,null,e);e||(e={}),t=Bh(t||Vh);var i=e.readable||e.readable!==!1&&r.readable,n=e.writable||e.writable!==!1&&r.writable,o=function(){r.writable||s()},a=r._writableState&&r._writableState.finished,s=function(){n=!1,a=!0,i||t.call(r)},u=r._readableState&&r._readableState.endEmitted,l=function(){i=!1,u=!0,n||t.call(r)},d=function(f){t.call(r,f)},p=function(){var f;if(i&&!u)return(!r._readableState||!r._readableState.ended)&&(f=new Js),t.call(r,f);if(n&&!a)return(!r._writableState||!r._writableState.ended)&&(f=new Js),t.call(r,f)},m=function(){r.req.on("finish",s)};return Kh(r)?(r.on("complete",s),r.on("abort",p),r.req?m():r.on("request",m)):n&&!r._writableState&&(r.on("end",o),r.on("close",o)),r.on("end",l),r.on("finish",s),e.error!==!1&&r.on("error",d),r.on("close",p),function(){r.removeListener("complete",s),r.removeListener("abort",p),r.removeListener("request",m),r.req&&r.req.removeListener("finish",s),r.removeListener("end",o),r.removeListener("close",o),r.removeListener("finish",s),r.removeListener("end",l),r.removeListener("error",d),r.removeListener("close",p)}}Xs.exports=Zs});var eu=c((G1,Qs)=>{"use strict";var jt;function Ue(r,e,t){return e=Jh(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Jh(r){var e=Zh(r,"string");return typeof e=="symbol"?e:String(e)}function Zh(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Xh=Ft(),Fe=Symbol("lastResolve"),tr=Symbol("lastReject"),Wr=Symbol("error"),kt=Symbol("ended"),ir=Symbol("lastPromise"),qn=Symbol("handlePromise"),nr=Symbol("stream");function je(r,e){return{value:r,done:e}}function Qh(r){var e=r[Fe];if(e!==null){var t=r[nr].read();t!==null&&(r[ir]=null,r[Fe]=null,r[tr]=null,e(je(t,!1)))}}function em(r){process.nextTick(Qh,r)}function rm(r,e){return function(t,i){r.then(function(){if(e[kt]){t(je(void 0,!0));return}e[qn](t,i)},i)}}var tm=Object.getPrototypeOf(function(){}),im=Object.setPrototypeOf((jt={get stream(){return this[nr]},next:function(){var e=this,t=this[Wr];if(t!==null)return Promise.reject(t);if(this[kt])return Promise.resolve(je(void 0,!0));if(this[nr].destroyed)return new Promise(function(a,s){process.nextTick(function(){e[Wr]?s(e[Wr]):a(je(void 0,!0))})});var i=this[ir],n;if(i)n=new Promise(rm(i,this));else{var o=this[nr].read();if(o!==null)return Promise.resolve(je(o,!1));n=new Promise(this[qn])}return this[ir]=n,n}},Ue(jt,Symbol.asyncIterator,function(){return this}),Ue(jt,"return",function(){var e=this;return new Promise(function(t,i){e[nr].destroy(null,function(n){if(n){i(n);return}t(je(void 0,!0))})})}),jt),tm),nm=function(e){var t,i=Object.create(im,(t={},Ue(t,nr,{value:e,writable:!0}),Ue(t,Fe,{value:null,writable:!0}),Ue(t,tr,{value:null,writable:!0}),Ue(t,Wr,{value:null,writable:!0}),Ue(t,kt,{value:e._readableState.endEmitted,writable:!0}),Ue(t,qn,{value:function(o,a){var s=i[nr].read();s?(i[ir]=null,i[Fe]=null,i[tr]=null,o(je(s,!1))):(i[Fe]=o,i[tr]=a)},writable:!0}),t));return i[ir]=null,Xh(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[tr];o!==null&&(i[ir]=null,i[Fe]=null,i[tr]=null,o(n)),i[Wr]=n;return}var a=i[Fe];a!==null&&(i[ir]=null,i[Fe]=null,i[tr]=null,a(je(void 0,!0))),i[kt]=!0}),e.on("readable",em.bind(null,i)),i};Qs.exports=nm});var nu=c((Y1,iu)=>{"use strict";function ru(r,e,t,i,n,o,a){try{var s=r[o](a),u=s.value}catch(l){t(l);return}s.done?e(u):Promise.resolve(u).then(i,n)}function om(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var o=r.apply(e,t);function a(u){ru(o,i,n,a,s,"next",u)}function s(u){ru(o,i,n,a,s,"throw",u)}a(void 0)})}}function tu(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function am(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tu(Object(t),!0).forEach(function(i){sm(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):tu(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function sm(r,e,t){return e=um(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function um(r){var e=lm(r,"string");return typeof e=="symbol"?e:String(e)}function lm(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var cm=$e().codes.ERR_INVALID_ARG_TYPE;function fm(r,e,t){var i;if(e&&typeof e.next=="function")i=e;else if(e&&e[Symbol.asyncIterator])i=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])i=e[Symbol.iterator]();else throw new cm("iterable",["Iterable"],e);var n=new r(am({objectMode:!0},t)),o=!1;n._read=function(){o||(o=!0,a())};function a(){return s.apply(this,arguments)}function s(){return s=om(function*(){try{var u=yield i.next(),l=u.value,d=u.done;d?n.push(null):n.push(yield l)?a():o=!1}catch(p){n.destroy(p)}}),s.apply(this,arguments)}return n}iu.exports=fm});var Wn=c((B1,hu)=>{"use strict";hu.exports=I;var Ar;I.ReadableState=uu;var W1=require("events").EventEmitter,su=function(e,t){return e.listeners(t).length},Vr=Sn(),zt=require("buffer").Buffer,dm=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function pm(r){return zt.from(r)}function hm(r){return zt.isBuffer(r)||r instanceof dm}var $n=require("util"),M;$n&&$n.debuglog?M=$n.debuglog("stream"):M=function(){};var mm=Gs(),Gn=An(),gm=Tn(),ym=gm.getHighWaterMark,Ht=$e().codes,bm=Ht.ERR_INVALID_ARG_TYPE,vm=Ht.ERR_STREAM_PUSH_AFTER_EOF,_m=Ht.ERR_METHOD_NOT_IMPLEMENTED,wm=Ht.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Tr,Un,Fn;Pr()(I,Vr);var Br=Gn.errorOrDestroy,jn=["error","close","destroy","pause","resume"];function Em(r,e,t){if(typeof r.prependListener=="function")return r.prependListener(e,t);!r._events||!r._events[e]?r.on(e,t):Array.isArray(r._events[e])?r._events[e].unshift(t):r._events[e]=[t,r._events[e]]}function uu(r,e,t){Ar=Ar||or(),r=r||{},typeof t!="boolean"&&(t=e instanceof Ar),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.readableObjectMode),this.highWaterMark=ym(this,r,"readableHighWaterMark",t),this.buffer=new mm,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=r.emitClose!==!1,this.autoDestroy=!!r.autoDestroy,this.destroyed=!1,this.defaultEncoding=r.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,r.encoding&&(Tr||(Tr=Cn().StringDecoder),this.decoder=new Tr(r.encoding),this.encoding=r.encoding)}function I(r){if(Ar=Ar||or(),!(this instanceof I))return new I(r);var e=this instanceof Ar;this._readableState=new uu(r,this,e),this.readable=!0,r&&(typeof r.read=="function"&&(this._read=r.read),typeof r.destroy=="function"&&(this._destroy=r.destroy)),Vr.call(this)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});I.prototype.destroy=Gn.destroy;I.prototype._undestroy=Gn.undestroy;I.prototype._destroy=function(r,e){e(r)};I.prototype.push=function(r,e){var t=this._readableState,i;return t.objectMode?i=!0:typeof r=="string"&&(e=e||t.defaultEncoding,e!==t.encoding&&(r=zt.from(r,e),e=""),i=!0),lu(this,r,e,!1,i)};I.prototype.unshift=function(r){return lu(this,r,null,!0,!1)};function lu(r,e,t,i,n){M("readableAddChunk",e);var o=r._readableState;if(e===null)o.reading=!1,Pm(r,o);else{var a;if(n||(a=Om(o,e)),a)Br(r,a);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==zt.prototype&&(e=pm(e)),i)o.endEmitted?Br(r,new wm):kn(r,o,e,!0);else if(o.ended)Br(r,new vm);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!t?(e=o.decoder.write(e),o.objectMode||e.length!==0?kn(r,o,e,!1):Hn(r,o)):kn(r,o,e,!1)}else i||(o.reading=!1,Hn(r,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function kn(r,e,t,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,r.emit("data",t)):(e.length+=e.objectMode?1:t.length,i?e.buffer.unshift(t):e.buffer.push(t),e.needReadable&&Gt(r)),Hn(r,e)}function Om(r,e){var t;return!hm(e)&&typeof e!="string"&&e!==void 0&&!r.objectMode&&(t=new bm("chunk",["string","Buffer","Uint8Array"],e)),t}I.prototype.isPaused=function(){return this._readableState.flowing===!1};I.prototype.setEncoding=function(r){Tr||(Tr=Cn().StringDecoder);var e=new Tr(r);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var t=this._readableState.buffer.head,i="";t!==null;)i+=e.write(t.data),t=t.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var ou=1073741824;function Sm(r){return r>=ou?r=ou:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r}function au(r,e){return r<=0||e.length===0&&e.ended?0:e.objectMode?1:r!==r?e.flowing&&e.length?e.buffer.head.data.length:e.length:(r>e.highWaterMark&&(e.highWaterMark=Sm(r)),r<=e.length?r:e.ended?e.length:(e.needReadable=!0,0))}I.prototype.read=function(r){M("read",r),r=parseInt(r,10);var e=this._readableState,t=r;if(r!==0&&(e.emittedReadable=!1),r===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return M("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?zn(this):Gt(this),null;if(r=au(r,e),r===0&&e.ended)return e.length===0&&zn(this),null;var i=e.needReadable;M("need readable",i),(e.length===0||e.length-r<e.highWaterMark)&&(i=!0,M("length less than watermark",i)),e.ended||e.reading?(i=!1,M("reading or ended",i)):i&&(M("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(r=au(t,e)));var n;return r>0?n=du(r,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,r=0):(e.length-=r,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),t!==r&&e.ended&&zn(this)),n!==null&&this.emit("data",n),n};function Pm(r,e){if(M("onEofChunk"),!e.ended){if(e.decoder){var t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,e.sync?Gt(r):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,cu(r)))}}function Gt(r){var e=r._readableState;M("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(M("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(cu,r))}function cu(r){var e=r._readableState;M("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(r.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Yn(r)}function Hn(r,e){e.readingMore||(e.readingMore=!0,process.nextTick(Am,r,e))}function Am(r,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var t=e.length;if(M("maybeReadMore read 0"),r.read(0),t===e.length)break}e.readingMore=!1}I.prototype._read=function(r){Br(this,new _m("_read()"))};I.prototype.pipe=function(r,e){var t=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=r;break;case 1:i.pipes=[i.pipes,r];break;default:i.pipes.push(r);break}i.pipesCount+=1,M("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&r!==process.stdout&&r!==process.stderr,o=n?s:g;i.endEmitted?process.nextTick(o):t.once("end",o),r.on("unpipe",a);function a(E,P){M("onunpipe"),E===t&&P&&P.hasUnpiped===!1&&(P.hasUnpiped=!0,d())}function s(){M("onend"),r.end()}var u=Tm(t);r.on("drain",u);var l=!1;function d(){M("cleanup"),r.removeListener("close",_),r.removeListener("finish",f),r.removeListener("drain",u),r.removeListener("error",m),r.removeListener("unpipe",a),t.removeListener("end",s),t.removeListener("end",g),t.removeListener("data",p),l=!0,i.awaitDrain&&(!r._writableState||r._writableState.needDrain)&&u()}t.on("data",p);function p(E){M("ondata");var P=r.write(E);M("dest.write",P),P===!1&&((i.pipesCount===1&&i.pipes===r||i.pipesCount>1&&pu(i.pipes,r)!==-1)&&!l&&(M("false write response, pause",i.awaitDrain),i.awaitDrain++),t.pause())}function m(E){M("onerror",E),g(),r.removeListener("error",m),su(r,"error")===0&&Br(r,E)}Em(r,"error",m);function _(){r.removeListener("finish",f),g()}r.once("close",_);function f(){M("onfinish"),r.removeListener("close",_),g()}r.once("finish",f);function g(){M("unpipe"),t.unpipe(r)}return r.emit("pipe",t),i.flowing||(M("pipe resume"),t.resume()),r};function Tm(r){return function(){var t=r._readableState;M("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&su(r,"data")&&(t.flowing=!0,Yn(r))}}I.prototype.unpipe=function(r){var e=this._readableState,t={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return r&&r!==e.pipes?this:(r||(r=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,r&&r.emit("unpipe",this,t),this);if(!r){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=pu(e.pipes,r);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),r.emit("unpipe",this,t),this)};I.prototype.on=function(r,e){var t=Vr.prototype.on.call(this,r,e),i=this._readableState;return r==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):r==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,M("on readable",i.length,i.reading),i.length?Gt(this):i.reading||process.nextTick(Nm,this)),t};I.prototype.addListener=I.prototype.on;I.prototype.removeListener=function(r,e){var t=Vr.prototype.removeListener.call(this,r,e);return r==="readable"&&process.nextTick(fu,this),t};I.prototype.removeAllListeners=function(r){var e=Vr.prototype.removeAllListeners.apply(this,arguments);return(r==="readable"||r===void 0)&&process.nextTick(fu,this),e};function fu(r){var e=r._readableState;e.readableListening=r.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:r.listenerCount("data")>0&&r.resume()}function Nm(r){M("readable nexttick read 0"),r.read(0)}I.prototype.resume=function(){var r=this._readableState;return r.flowing||(M("resume"),r.flowing=!r.readableListening,Mm(this,r)),r.paused=!1,this};function Mm(r,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(Rm,r,e))}function Rm(r,e){M("resume",e.reading),e.reading||r.read(0),e.resumeScheduled=!1,r.emit("resume"),Yn(r),e.flowing&&!e.reading&&r.read(0)}I.prototype.pause=function(){return M("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(M("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Yn(r){var e=r._readableState;for(M("flow",e.flowing);e.flowing&&r.read()!==null;);}I.prototype.wrap=function(r){var e=this,t=this._readableState,i=!1;r.on("end",function(){if(M("wrapped end"),t.decoder&&!t.ended){var a=t.decoder.end();a&&a.length&&e.push(a)}e.push(null)}),r.on("data",function(a){if(M("wrapped data"),t.decoder&&(a=t.decoder.write(a)),!(t.objectMode&&a==null)&&!(!t.objectMode&&(!a||!a.length))){var s=e.push(a);s||(i=!0,r.pause())}});for(var n in r)this[n]===void 0&&typeof r[n]=="function"&&(this[n]=(function(s){return function(){return r[s].apply(r,arguments)}})(n));for(var o=0;o<jn.length;o++)r.on(jn[o],this.emit.bind(this,jn[o]));return this._read=function(a){M("wrapped _read",a),i&&(i=!1,r.resume())},this};typeof Symbol=="function"&&(I.prototype[Symbol.asyncIterator]=function(){return Un===void 0&&(Un=eu()),Un(this)});Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});I._fromList=du;Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function du(r,e){if(e.length===0)return null;var t;return e.objectMode?t=e.buffer.shift():!r||r>=e.length?(e.decoder?t=e.buffer.join(""):e.buffer.length===1?t=e.buffer.first():t=e.buffer.concat(e.length),e.buffer.clear()):t=e.buffer.consume(r,e.decoder),t}function zn(r){var e=r._readableState;M("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(xm,e,r))}function xm(r,e){if(M("endReadableNT",r.endEmitted,r.length),!r.endEmitted&&r.length===0&&(r.endEmitted=!0,e.readable=!1,e.emit("end"),r.autoDestroy)){var t=e._writableState;(!t||t.autoDestroy&&t.finished)&&e.destroy()}}typeof Symbol=="function"&&(I.from=function(r,e){return Fn===void 0&&(Fn=nu()),Fn(I,r,e)});function pu(r,e){for(var t=0,i=r.length;t<i;t++)if(r[t]===e)return t;return-1}});var or=c((V1,gu)=>{"use strict";var Im=Object.keys||function(r){var e=[];for(var t in r)e.push(t);return e};gu.exports=ve;var mu=Wn(),Vn=Bt();Pr()(ve,mu);for(Bn=Im(Vn.prototype),Yt=0;Yt<Bn.length;Yt++)Wt=Bn[Yt],ve.prototype[Wt]||(ve.prototype[Wt]=Vn.prototype[Wt]);var Bn,Wt,Yt;function ve(r){if(!(this instanceof ve))return new ve(r);mu.call(this,r),Vn.call(this,r),this.allowHalfOpen=!0,r&&(r.readable===!1&&(this.readable=!1),r.writable===!1&&(this.writable=!1),r.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Dm)))}Object.defineProperty(ve.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(ve.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(ve.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Dm(){this._writableState.ended||process.nextTick(Lm,this)}function Lm(r){r.end()}Object.defineProperty(ve.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Bt=c((K1,Eu)=>{"use strict";Eu.exports=z;function bu(r){var e=this;this.next=null,this.entry=null,this.finish=function(){sg(e,r)}}var Nr;z.WritableState=Jr;var Cm={deprecate:Rs()},vu=Sn(),Kt=require("buffer").Buffer,qm=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function $m(r){return Kt.from(r)}function Um(r){return Kt.isBuffer(r)||r instanceof qm}var Jn=An(),Fm=Tn(),jm=Fm.getHighWaterMark,ke=$e().codes,km=ke.ERR_INVALID_ARG_TYPE,zm=ke.ERR_METHOD_NOT_IMPLEMENTED,Hm=ke.ERR_MULTIPLE_CALLBACK,Gm=ke.ERR_STREAM_CANNOT_PIPE,Ym=ke.ERR_STREAM_DESTROYED,Wm=ke.ERR_STREAM_NULL_VALUES,Bm=ke.ERR_STREAM_WRITE_AFTER_END,Vm=ke.ERR_UNKNOWN_ENCODING,Mr=Jn.errorOrDestroy;Pr()(z,vu);function Km(){}function Jr(r,e,t){Nr=Nr||or(),r=r||{},typeof t!="boolean"&&(t=e instanceof Nr),this.objectMode=!!r.objectMode,t&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=jm(this,r,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=r.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){tg(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=r.emitClose!==!1,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new bu(this)}Jr.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};(function(){try{Object.defineProperty(Jr.prototype,"buffer",{get:Cm.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Vt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Vt=Function.prototype[Symbol.hasInstance],Object.defineProperty(z,Symbol.hasInstance,{value:function(e){return Vt.call(this,e)?!0:this!==z?!1:e&&e._writableState instanceof Jr}})):Vt=function(e){return e instanceof this};function z(r){Nr=Nr||or();var e=this instanceof Nr;if(!e&&!Vt.call(z,this))return new z(r);this._writableState=new Jr(r,this,e),this.writable=!0,r&&(typeof r.write=="function"&&(this._write=r.write),typeof r.writev=="function"&&(this._writev=r.writev),typeof r.destroy=="function"&&(this._destroy=r.destroy),typeof r.final=="function"&&(this._final=r.final)),vu.call(this)}z.prototype.pipe=function(){Mr(this,new Gm)};function Jm(r,e){var t=new Bm;Mr(r,t),process.nextTick(e,t)}function Zm(r,e,t,i){var n;return t===null?n=new Wm:typeof t!="string"&&!e.objectMode&&(n=new km("chunk",["string","Buffer"],t)),n?(Mr(r,n),process.nextTick(i,n),!1):!0}z.prototype.write=function(r,e,t){var i=this._writableState,n=!1,o=!i.objectMode&&Um(r);return o&&!Kt.isBuffer(r)&&(r=$m(r)),typeof e=="function"&&(t=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof t!="function"&&(t=Km),i.ending?Jm(this,t):(o||Zm(this,i,r,t))&&(i.pendingcb++,n=Qm(this,i,o,r,e,t)),n};z.prototype.cork=function(){this._writableState.corked++};z.prototype.uncork=function(){var r=this._writableState;r.corked&&(r.corked--,!r.writing&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&_u(this,r))};z.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new Vm(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Xm(r,e,t){return!r.objectMode&&r.decodeStrings!==!1&&typeof e=="string"&&(e=Kt.from(e,t)),e}Object.defineProperty(z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Qm(r,e,t,i,n,o){if(!t){var a=Xm(e,i,n);i!==a&&(t=!0,n="buffer",i=a)}var s=e.objectMode?1:i.length;e.length+=s;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:t,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Kn(r,e,!1,s,i,n,o);return u}function Kn(r,e,t,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Ym("write")):t?r._writev(n,e.onwrite):r._write(n,o,e.onwrite),e.sync=!1}function eg(r,e,t,i,n){--e.pendingcb,t?(process.nextTick(n,i),process.nextTick(Kr,r,e),r._writableState.errorEmitted=!0,Mr(r,i)):(n(i),r._writableState.errorEmitted=!0,Mr(r,i),Kr(r,e))}function rg(r){r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0}function tg(r,e){var t=r._writableState,i=t.sync,n=t.writecb;if(typeof n!="function")throw new Hm;if(rg(t),e)eg(r,t,i,e,n);else{var o=wu(t)||r.destroyed;!o&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&_u(r,t),i?process.nextTick(yu,r,t,o,n):yu(r,t,o,n)}}function yu(r,e,t,i){t||ig(r,e),e.pendingcb--,i(),Kr(r,e)}function ig(r,e){e.length===0&&e.needDrain&&(e.needDrain=!1,r.emit("drain"))}function _u(r,e){e.bufferProcessing=!0;var t=e.bufferedRequest;if(r._writev&&t&&t.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=t;for(var a=0,s=!0;t;)n[a]=t,t.isBuf||(s=!1),t=t.next,a+=1;n.allBuffers=s,Kn(r,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new bu(e),e.bufferedRequestCount=0}else{for(;t;){var u=t.chunk,l=t.encoding,d=t.callback,p=e.objectMode?1:u.length;if(Kn(r,e,!1,p,u,l,d),t=t.next,e.bufferedRequestCount--,e.writing)break}t===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=t,e.bufferProcessing=!1}z.prototype._write=function(r,e,t){t(new zm("_write()"))};z.prototype._writev=null;z.prototype.end=function(r,e,t){var i=this._writableState;return typeof r=="function"?(t=r,r=null,e=null):typeof e=="function"&&(t=e,e=null),r!=null&&this.write(r,e),i.corked&&(i.corked=1,this.uncork()),i.ending||ag(this,i,t),this};Object.defineProperty(z.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function wu(r){return r.ending&&r.length===0&&r.bufferedRequest===null&&!r.finished&&!r.writing}function ng(r,e){r._final(function(t){e.pendingcb--,t&&Mr(r,t),e.prefinished=!0,r.emit("prefinish"),Kr(r,e)})}function og(r,e){!e.prefinished&&!e.finalCalled&&(typeof r._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(ng,r,e)):(e.prefinished=!0,r.emit("prefinish")))}function Kr(r,e){var t=wu(e);if(t&&(og(r,e),e.pendingcb===0&&(e.finished=!0,r.emit("finish"),e.autoDestroy))){var i=r._readableState;(!i||i.autoDestroy&&i.endEmitted)&&r.destroy()}return t}function ag(r,e,t){e.ending=!0,Kr(r,e),t&&(e.finished?process.nextTick(t):r.once("finish",t)),e.ended=!0,r.writable=!1}function sg(r,e,t){var i=r.entry;for(r.entry=null;i;){var n=i.callback;e.pendingcb--,n(t),i=i.next}e.corkedRequestsFree.next=r}Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});z.prototype.destroy=Jn.destroy;z.prototype._undestroy=Jn.undestroy;z.prototype._destroy=function(r,e){e(r)}});var Zn=c((J1,Pu)=>{"use strict";var ug=require("util"),Ou=Bt(),{LEVEL:Su}=G(),Zr=Pu.exports=function(e={}){Ou.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this.format=e.format,this.level=e.level,this.handleExceptions=e.handleExceptions,this.handleRejections=e.handleRejections,this.silent=e.silent,e.log&&(this.log=e.log),e.logv&&(this.logv=e.logv),e.close&&(this.close=e.close),this.once("pipe",t=>{this.levels=t.levels,this.parent=t}),this.once("unpipe",t=>{t===this.parent&&(this.parent=null,this.close&&this.close())})};ug.inherits(Zr,Ou);Zr.prototype._write=function(e,t,i){if(this.silent||e.exception===!0&&!this.handleExceptions)return i(null);let n=this.level||this.parent&&this.parent.level;if(!n||this.levels[n]>=this.levels[e[Su]]){if(e&&!this.format)return this.log(e,i);let o,a;try{a=this.format.transform(Object.assign({},e),this.format.options)}catch(s){o=s}if(o||!a){if(i(),o)throw o;return}return this.log(a,i)}return this._writableState.sync=!1,i(null)};Zr.prototype._writev=function(e,t){if(this.logv){let i=e.filter(this._accept,this);return i.length?this.logv(i,t):t(null)}for(let i=0;i<e.length;i++){if(!this._accept(e[i]))continue;if(e[i].chunk&&!this.format){this.log(e[i].chunk,e[i].callback);continue}let n,o;try{o=this.format.transform(Object.assign({},e[i].chunk),this.format.options)}catch(a){n=a}if(n||!o){if(e[i].callback(),n)throw t(null),n}else this.log(o,e[i].callback)}return t(null)};Zr.prototype._accept=function(e){let t=e.chunk;if(this.silent)return!1;let i=this.level||this.parent&&this.parent.level;return!!((t.exception===!0||!i||this.levels[i]>=this.levels[t[Su]])&&(this.handleExceptions||t.exception!==!0))};Zr.prototype._nop=function(){}});var Qn=c((Z1,Tu)=>{"use strict";var lg=require("util"),{LEVEL:Xn}=G(),Au=Zn(),Xr=Tu.exports=function(e={}){if(Au.call(this,e),!e.transport||typeof e.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated();function t(i){this.emit("error",i,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=t.bind(this),this.transport.on("error",this.transport.__winstonError))};lg.inherits(Xr,Au);Xr.prototype._write=function(e,t,i){if(this.silent||e.exception===!0&&!this.handleExceptions)return i(null);(!this.level||this.levels[this.level]>=this.levels[e[Xn]])&&this.transport.log(e[Xn],e.message,e,this._nop),i(null)};Xr.prototype._writev=function(e,t){for(let i=0;i<e.length;i++)this._accept(e[i])&&(this.transport.log(e[i].chunk[Xn],e[i].chunk.message,e[i].chunk,this._nop),e[i].callback());return t(null)};Xr.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
|
|
28
|
-
`))};Xr.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var Rr=c((X1,eo)=>{"use strict";eo.exports=Zn();eo.exports.LegacyTransportStream=Qn()});var Ru=c((e_,Mu)=>{"use strict";var cg=require("os"),{LEVEL:Nu,MESSAGE:xr}=G(),fg=Rr();Mu.exports=class extends fg{constructor(e={}){super(e),this.name=e.name||"console",this.stderrLevels=this._stringArrayToSet(e.stderrLevels),this.consoleWarnLevels=this._stringArrayToSet(e.consoleWarnLevels),this.eol=typeof e.eol=="string"?e.eol:cg.EOL,this.forceConsole=e.forceConsole||!1,this._consoleLog=console.log.bind(console),this._consoleWarn=console.warn.bind(console),this._consoleError=console.error.bind(console),this.setMaxListeners(30)}log(e,t){if(setImmediate(()=>this.emit("logged",e)),this.stderrLevels[e[Nu]]){console._stderr&&!this.forceConsole?console._stderr.write(`${e[xr]}${this.eol}`):this._consoleError(e[xr]),t&&t();return}else if(this.consoleWarnLevels[e[Nu]]){console._stderr&&!this.forceConsole?console._stderr.write(`${e[xr]}${this.eol}`):this._consoleWarn(e[xr]),t&&t();return}console._stdout&&!this.forceConsole?console._stdout.write(`${e[xr]}${this.eol}`):this._consoleLog(e[xr]),t&&t()}_stringArrayToSet(e,t){if(!e)return{};if(t=t||"Cannot make set from type other than Array of string elements",!Array.isArray(e))throw new Error(t);return e.reduce((i,n)=>{if(typeof n!="string")throw new Error(t);return i[n]=!0,i},{})}}});var Zt=c((Jt,xu)=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.default=dg;function dg(r){return r&&typeof r.length=="number"&&r.length>=0&&r.length%1===0}xu.exports=Jt.default});var Du=c((Xt,Iu)=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.default=function(r){return function(...e){var t=e.pop();return r.call(this,e,t)}};Iu.exports=Xt.default});var qu=c(ze=>{"use strict";Object.defineProperty(ze,"__esModule",{value:!0});ze.fallback=Lu;ze.wrap=Cu;var pg=ze.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,hg=ze.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,mg=ze.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function Lu(r){setTimeout(r,0)}function Cu(r){return(e,...t)=>r(()=>e(...t))}var Qr;pg?Qr=queueMicrotask:hg?Qr=setImmediate:mg?Qr=process.nextTick:Qr=Lu;ze.default=Cu(Qr)});var ku=c((Qt,ju)=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.default=wg;var gg=Du(),yg=Fu(gg),bg=qu(),vg=Fu(bg),_g=ar();function Fu(r){return r&&r.__esModule?r:{default:r}}function wg(r){return(0,_g.isAsync)(r)?function(...e){let t=e.pop(),i=r.apply(this,e);return $u(i,t)}:(0,yg.default)(function(e,t){var i;try{i=r.apply(this,e)}catch(n){return t(n)}if(i&&typeof i.then=="function")return $u(i,t);t(null,i)})}function $u(r,e){return r.then(t=>{Uu(e,null,t)},t=>{Uu(e,t&&(t instanceof Error||t.message)?t:new Error(t))})}function Uu(r,e,t){try{r(e,t)}catch(i){(0,vg.default)(n=>{throw n},i)}}ju.exports=Qt.default});var ar=c(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.isAsyncIterable=Ne.isAsyncGenerator=Ne.isAsync=void 0;var Eg=ku(),Og=Sg(Eg);function Sg(r){return r&&r.__esModule?r:{default:r}}function zu(r){return r[Symbol.toStringTag]==="AsyncFunction"}function Pg(r){return r[Symbol.toStringTag]==="AsyncGenerator"}function Ag(r){return typeof r[Symbol.asyncIterator]=="function"}function Tg(r){if(typeof r!="function")throw new Error("expected a function");return zu(r)?(0,Og.default)(r):r}Ne.default=Tg;Ne.isAsync=zu;Ne.isAsyncGenerator=Pg;Ne.isAsyncIterable=Ag});var Ir=c((ei,Hu)=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.default=Ng;function Ng(r,e){if(e||(e=r.length),!e)throw new Error("arity is undefined");function t(...i){return typeof i[e-1]=="function"?r.apply(this,i):new Promise((n,o)=>{i[e-1]=(a,...s)=>{if(a)return o(a);n(s.length>1?s:s[0])},r.apply(this,i)})}return t}Hu.exports=ei.default});var Yu=c((ri,Gu)=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});var Mg=Zt(),Rg=ro(Mg),xg=ar(),Ig=ro(xg),Dg=Ir(),Lg=ro(Dg);function ro(r){return r&&r.__esModule?r:{default:r}}ri.default=(0,Lg.default)((r,e,t)=>{var i=(0,Rg.default)(e)?[]:{};r(e,(n,o,a)=>{(0,Ig.default)(n)((s,...u)=>{u.length<2&&([u]=u),i[o]=u,a(s)})},n=>t(n,i))},3);Gu.exports=ri.default});var to=c((ti,Wu)=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.default=Cg;function Cg(r){function e(...t){if(r!==null){var i=r;r=null,i.apply(this,t)}}return Object.assign(e,r),e}Wu.exports=ti.default});var Vu=c((ii,Bu)=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.default=function(r){return r[Symbol.iterator]&&r[Symbol.iterator]()};Bu.exports=ii.default});var Zu=c((ni,Ju)=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.default=Hg;var qg=Zt(),$g=Ku(qg),Ug=Vu(),Fg=Ku(Ug);function Ku(r){return r&&r.__esModule?r:{default:r}}function jg(r){var e=-1,t=r.length;return function(){return++e<t?{value:r[e],key:e}:null}}function kg(r){var e=-1;return function(){var i=r.next();return i.done?null:(e++,{value:i.value,key:e})}}function zg(r){var e=r?Object.keys(r):[],t=-1,i=e.length;return function n(){var o=e[++t];return o==="__proto__"?n():t<i?{value:r[o],key:o}:null}}function Hg(r){if((0,$g.default)(r))return jg(r);var e=(0,Fg.default)(r);return e?kg(e):zg(r)}Ju.exports=ni.default});var io=c((oi,Xu)=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.default=Gg;function Gg(r){return function(...e){if(r===null)throw new Error("Callback was already called.");var t=r;r=null,t.apply(this,e)}}Xu.exports=oi.default});var si=c((ai,Qu)=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});var Yg={};ai.default=Yg;Qu.exports=ai.default});var rl=c((ui,el)=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.default=Kg;var Wg=si(),Bg=Vg(Wg);function Vg(r){return r&&r.__esModule?r:{default:r}}function Kg(r,e,t,i){let n=!1,o=!1,a=!1,s=0,u=0;function l(){s>=e||a||n||(a=!0,r.next().then(({value:m,done:_})=>{if(!(o||n)){if(a=!1,_){n=!0,s<=0&&i(null);return}s++,t(m,u,d),u++,l()}}).catch(p))}function d(m,_){if(s-=1,!o){if(m)return p(m);if(m===!1){n=!0,o=!0;return}if(_===Bg.default||n&&s<=0)return n=!0,i(null);l()}}function p(m){o||(a=!1,n=!0,i(m))}l()}el.exports=ui.default});var ol=c((li,nl)=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});var Jg=to(),Zg=et(Jg),Xg=Zu(),Qg=et(Xg),ey=io(),ry=et(ey),tl=ar(),ty=rl(),il=et(ty),iy=si(),ny=et(iy);function et(r){return r&&r.__esModule?r:{default:r}}li.default=r=>(e,t,i)=>{if(i=(0,Zg.default)(i),r<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return i(null);if((0,tl.isAsyncGenerator)(e))return(0,il.default)(e,r,t,i);if((0,tl.isAsyncIterable)(e))return(0,il.default)(e[Symbol.asyncIterator](),r,t,i);var n=(0,Qg.default)(e),o=!1,a=!1,s=0,u=!1;function l(p,m){if(!a)if(s-=1,p)o=!0,i(p);else if(p===!1)o=!0,a=!0;else{if(m===ny.default||o&&s<=0)return o=!0,i(null);u||d()}}function d(){for(u=!0;s<r&&!o;){var p=n();if(p===null){o=!0,s<=0&&i(null);return}s+=1,t(p.value,p.key,(0,ry.default)(l))}u=!1}d()};nl.exports=li.default});var oo=c((ci,al)=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});var oy=ol(),ay=no(oy),sy=ar(),uy=no(sy),ly=Ir(),cy=no(ly);function no(r){return r&&r.__esModule?r:{default:r}}function fy(r,e,t,i){return(0,ay.default)(e)(r,(0,uy.default)(t),i)}ci.default=(0,cy.default)(fy,4);al.exports=ci.default});var ll=c((fi,ul)=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});var dy=oo(),py=sl(dy),hy=Ir(),my=sl(hy);function sl(r){return r&&r.__esModule?r:{default:r}}function gy(r,e,t){return(0,py.default)(r,1,e,t)}fi.default=(0,my.default)(gy,3);ul.exports=fi.default});var dl=c((di,fl)=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.default=wy;var yy=Yu(),by=cl(yy),vy=ll(),_y=cl(vy);function cl(r){return r&&r.__esModule?r:{default:r}}function wy(r,e){return(0,by.default)(_y.default,r,e)}fl.exports=di.default});var ao=c((i_,hl)=>{"use strict";hl.exports=Me;var pi=$e().codes,Ey=pi.ERR_METHOD_NOT_IMPLEMENTED,Oy=pi.ERR_MULTIPLE_CALLBACK,Sy=pi.ERR_TRANSFORM_ALREADY_TRANSFORMING,Py=pi.ERR_TRANSFORM_WITH_LENGTH_0,hi=or();Pr()(Me,hi);function Ay(r,e){var t=this._transformState;t.transforming=!1;var i=t.writecb;if(i===null)return this.emit("error",new Oy);t.writechunk=null,t.writecb=null,e!=null&&this.push(e),i(r);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Me(r){if(!(this instanceof Me))return new Me(r);hi.call(this,r),this._transformState={afterTransform:Ay.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,r&&(typeof r.transform=="function"&&(this._transform=r.transform),typeof r.flush=="function"&&(this._flush=r.flush)),this.on("prefinish",Ty)}function Ty(){var r=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,t){pl(r,e,t)}):pl(this,null,null)}Me.prototype.push=function(r,e){return this._transformState.needTransform=!1,hi.prototype.push.call(this,r,e)};Me.prototype._transform=function(r,e,t){t(new Ey("_transform()"))};Me.prototype._write=function(r,e,t){var i=this._transformState;if(i.writecb=t,i.writechunk=r,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Me.prototype._read=function(r){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Me.prototype._destroy=function(r,e){hi.prototype._destroy.call(this,r,function(t){e(t)})};function pl(r,e,t){if(e)return r.emit("error",e);if(t!=null&&r.push(t),r._writableState.length)throw new Py;if(r._transformState.transforming)throw new Sy;return r.push(null)}});var yl=c((n_,gl)=>{"use strict";gl.exports=rt;var ml=ao();Pr()(rt,ml);function rt(r){if(!(this instanceof rt))return new rt(r);ml.call(this,r)}rt.prototype._transform=function(r,e,t){t(null,r)}});var El=c((o_,wl)=>{"use strict";var so;function Ny(r){var e=!1;return function(){e||(e=!0,r.apply(void 0,arguments))}}var _l=$e().codes,My=_l.ERR_MISSING_ARGS,Ry=_l.ERR_STREAM_DESTROYED;function bl(r){if(r)throw r}function xy(r){return r.setHeader&&typeof r.abort=="function"}function Iy(r,e,t,i){i=Ny(i);var n=!1;r.on("close",function(){n=!0}),so===void 0&&(so=Ft()),so(r,{readable:e,writable:t},function(a){if(a)return i(a);n=!0,i()});var o=!1;return function(a){if(!n&&!o){if(o=!0,xy(r))return r.abort();if(typeof r.destroy=="function")return r.destroy();i(a||new Ry("pipe"))}}}function vl(r){r()}function Dy(r,e){return r.pipe(e)}function Ly(r){return!r.length||typeof r[r.length-1]!="function"?bl:r.pop()}function Cy(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var i=Ly(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new My("streams");var n,o=e.map(function(a,s){var u=s<e.length-1,l=s>0;return Iy(a,u,l,function(d){n||(n=d),d&&o.forEach(vl),!u&&(o.forEach(vl),i(n))})});return e.reduce(Dy)}wl.exports=Cy});var sr=c((he,it)=>{var tt=require("stream");process.env.READABLE_STREAM==="disable"&&tt?(it.exports=tt.Readable,Object.assign(it.exports,tt),it.exports.Stream=tt):(he=it.exports=Wn(),he.Stream=tt||he,he.Readable=he,he.Writable=Bt(),he.Duplex=or(),he.Transform=ao(),he.PassThrough=yl(),he.finished=Ft(),he.pipeline=El())});var mo=c((a_,Sl)=>{var Dr=[],nt=[],uo=function(){};function co(r){return~Dr.indexOf(r)?!1:(Dr.push(r),!0)}function fo(r){uo=r}function qy(r){for(var e=[],t=0;t<Dr.length;t++){if(Dr[t].async){e.push(Dr[t]);continue}if(Dr[t](r))return!0}return e.length?new Promise(function(n){Promise.all(e.map(function(a){return a(r)})).then(function(a){n(a.some(Boolean))})}):!1}function po(r){return~nt.indexOf(r)?!1:(nt.push(r),!0)}function lo(){uo.apply(uo,arguments)}function Ol(r){for(var e=0;e<nt.length;e++)r=nt[e].apply(nt[e],arguments);return r}function ho(r,e){var t=Object.prototype.hasOwnProperty;for(var i in e)t.call(e,i)&&(r[i]=e[i]);return r}function $y(r){return r.enabled=!1,r.modify=po,r.set=fo,r.use=co,ho(function(){return!1},r)}function Uy(r){function e(){var t=Array.prototype.slice.call(arguments,0);return lo.call(lo,r,Ol(t,r)),!0}return r.enabled=!0,r.modify=po,r.set=fo,r.use=co,ho(e,r)}Sl.exports=function(e){return e.introduce=ho,e.enabled=qy,e.process=Ol,e.modify=po,e.write=lo,e.nope=$y,e.yep=Uy,e.set=fo,e.use=co,e}});var Al=c((s_,Pl)=>{var Fy=mo(),jy=Fy(function r(e,t){return t=t||{},t.namespace=e,t.prod=!0,t.dev=!1,t.force||r.force?r.yep(t):r.nope(t)});Pl.exports=jy});var Nl=c((u_,Tl)=>{"use strict";Tl.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Rl=c((l_,Ml)=>{Ml.exports=function(e){return!e||typeof e=="string"?!1:e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&e.constructor.name!=="String")}});var Dl=c((c_,Il)=>{"use strict";var ky=Rl(),zy=Array.prototype.concat,Hy=Array.prototype.slice,xl=Il.exports=function(e){for(var t=[],i=0,n=e.length;i<n;i++){var o=e[i];ky(o)?t=zy.call(t,Hy.call(o)):t.push(o)}return t};xl.wrap=function(r){return function(){return r(xl(arguments))}}});var $l=c((f_,ql)=>{var ot=Nl(),at=Dl(),Ll=Object.hasOwnProperty,Cl=Object.create(null);for(mi in ot)Ll.call(ot,mi)&&(Cl[ot[mi]]=mi);var mi,le=ql.exports={to:{},get:{}};le.get=function(r){var e=r.substring(0,3).toLowerCase(),t,i;switch(e){case"hsl":t=le.get.hsl(r),i="hsl";break;case"hwb":t=le.get.hwb(r),i="hwb";break;default:t=le.get.rgb(r),i="rgb";break}return t?{model:i,value:t}:null};le.get.rgb=function(r){if(!r)return null;var e=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,i=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,n=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,a=[0,0,0,1],s,u,l;if(s=r.match(t)){for(l=s[2],s=s[1],u=0;u<3;u++){var d=u*2;a[u]=parseInt(s.slice(d,d+2),16)}l&&(a[3]=parseInt(l,16)/255)}else if(s=r.match(e)){for(s=s[1],l=s[3],u=0;u<3;u++)a[u]=parseInt(s[u]+s[u],16);l&&(a[3]=parseInt(l+l,16)/255)}else if(s=r.match(i)){for(u=0;u<3;u++)a[u]=parseInt(s[u+1],0);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else if(s=r.match(n)){for(u=0;u<3;u++)a[u]=Math.round(parseFloat(s[u+1])*2.55);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else return(s=r.match(o))?s[1]==="transparent"?[0,0,0,0]:Ll.call(ot,s[1])?(a=ot[s[1]],a[3]=1,a):null:null;for(u=0;u<3;u++)a[u]=He(a[u],0,255);return a[3]=He(a[3],0,1),a};le.get.hsl=function(r){if(!r)return null;var e=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=r.match(e);if(t){var i=parseFloat(t[4]),n=(parseFloat(t[1])%360+360)%360,o=He(parseFloat(t[2]),0,100),a=He(parseFloat(t[3]),0,100),s=He(isNaN(i)?1:i,0,1);return[n,o,a,s]}return null};le.get.hwb=function(r){if(!r)return null;var e=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=r.match(e);if(t){var i=parseFloat(t[4]),n=(parseFloat(t[1])%360+360)%360,o=He(parseFloat(t[2]),0,100),a=He(parseFloat(t[3]),0,100),s=He(isNaN(i)?1:i,0,1);return[n,o,a,s]}return null};le.to.hex=function(){var r=at(arguments);return"#"+gi(r[0])+gi(r[1])+gi(r[2])+(r[3]<1?gi(Math.round(r[3]*255)):"")};le.to.rgb=function(){var r=at(arguments);return r.length<4||r[3]===1?"rgb("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+")":"rgba("+Math.round(r[0])+", "+Math.round(r[1])+", "+Math.round(r[2])+", "+r[3]+")"};le.to.rgb.percent=function(){var r=at(arguments),e=Math.round(r[0]/255*100),t=Math.round(r[1]/255*100),i=Math.round(r[2]/255*100);return r.length<4||r[3]===1?"rgb("+e+"%, "+t+"%, "+i+"%)":"rgba("+e+"%, "+t+"%, "+i+"%, "+r[3]+")"};le.to.hsl=function(){var r=at(arguments);return r.length<4||r[3]===1?"hsl("+r[0]+", "+r[1]+"%, "+r[2]+"%)":"hsla("+r[0]+", "+r[1]+"%, "+r[2]+"%, "+r[3]+")"};le.to.hwb=function(){var r=at(arguments),e="";return r.length>=4&&r[3]!==1&&(e=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+e+")"};le.to.keyword=function(r){return Cl[r.slice(0,3)]};function He(r,e,t){return Math.min(Math.max(e,r),t)}function gi(r){var e=Math.round(r).toString(16).toUpperCase();return e.length<2?"0"+e:e}});var Fl=c((d_,Ul)=>{"use strict";Ul.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var go=c((p_,Hl)=>{var ur=Fl(),zl={};for(yi in ur)ur.hasOwnProperty(yi)&&(zl[ur[yi]]=yi);var yi,O=Hl.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(ie in O)if(O.hasOwnProperty(ie)){if(!("channels"in O[ie]))throw new Error("missing channels property: "+ie);if(!("labels"in O[ie]))throw new Error("missing channel labels property: "+ie);if(O[ie].labels.length!==O[ie].channels)throw new Error("channel and label counts mismatch: "+ie);jl=O[ie].channels,kl=O[ie].labels,delete O[ie].channels,delete O[ie].labels,Object.defineProperty(O[ie],"channels",{value:jl}),Object.defineProperty(O[ie],"labels",{value:kl})}var jl,kl,ie;O.rgb.hsl=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.min(e,t,i),o=Math.max(e,t,i),a=o-n,s,u,l;return o===n?s=0:e===o?s=(t-i)/a:t===o?s=2+(i-e)/a:i===o&&(s=4+(e-t)/a),s=Math.min(s*60,360),s<0&&(s+=360),l=(n+o)/2,o===n?u=0:l<=.5?u=a/(o+n):u=a/(2-o-n),[s,u*100,l*100]};O.rgb.hsv=function(r){var e,t,i,n,o,a=r[0]/255,s=r[1]/255,u=r[2]/255,l=Math.max(a,s,u),d=l-Math.min(a,s,u),p=function(m){return(l-m)/6/d+1/2};return d===0?n=o=0:(o=d/l,e=p(a),t=p(s),i=p(u),a===l?n=i-t:s===l?n=1/3+e-i:u===l&&(n=2/3+t-e),n<0?n+=1:n>1&&(n-=1)),[n*360,o*100,l*100]};O.rgb.hwb=function(r){var e=r[0],t=r[1],i=r[2],n=O.rgb.hsl(r)[0],o=1/255*Math.min(e,Math.min(t,i));return i=1-1/255*Math.max(e,Math.max(t,i)),[n,o*100,i*100]};O.rgb.cmyk=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n,o,a,s;return s=Math.min(1-e,1-t,1-i),n=(1-e-s)/(1-s)||0,o=(1-t-s)/(1-s)||0,a=(1-i-s)/(1-s)||0,[n*100,o*100,a*100,s*100]};function Gy(r,e){return Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2)+Math.pow(r[2]-e[2],2)}O.rgb.keyword=function(r){var e=zl[r];if(e)return e;var t=1/0,i;for(var n in ur)if(ur.hasOwnProperty(n)){var o=ur[n],a=Gy(r,o);a<t&&(t=a,i=n)}return i};O.keyword.rgb=function(r){return ur[r]};O.rgb.xyz=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var n=e*.4124+t*.3576+i*.1805,o=e*.2126+t*.7152+i*.0722,a=e*.0193+t*.1192+i*.9505;return[n*100,o*100,a*100]};O.rgb.lab=function(r){var e=O.rgb.xyz(r),t=e[0],i=e[1],n=e[2],o,a,s;return t/=95.047,i/=100,n/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,o=116*i-16,a=500*(t-i),s=200*(i-n),[o,a,s]};O.hsl.rgb=function(r){var e=r[0]/360,t=r[1]/100,i=r[2]/100,n,o,a,s,u;if(t===0)return u=i*255,[u,u,u];i<.5?o=i*(1+t):o=i+t-i*t,n=2*i-o,s=[0,0,0];for(var l=0;l<3;l++)a=e+1/3*-(l-1),a<0&&a++,a>1&&a--,6*a<1?u=n+(o-n)*6*a:2*a<1?u=o:3*a<2?u=n+(o-n)*(2/3-a)*6:u=n,s[l]=u*255;return s};O.hsl.hsv=function(r){var e=r[0],t=r[1]/100,i=r[2]/100,n=t,o=Math.max(i,.01),a,s;return i*=2,t*=i<=1?i:2-i,n*=o<=1?o:2-o,s=(i+t)/2,a=i===0?2*n/(o+n):2*t/(i+t),[e,a*100,s*100]};O.hsv.rgb=function(r){var e=r[0]/60,t=r[1]/100,i=r[2]/100,n=Math.floor(e)%6,o=e-Math.floor(e),a=255*i*(1-t),s=255*i*(1-t*o),u=255*i*(1-t*(1-o));switch(i*=255,n){case 0:return[i,u,a];case 1:return[s,i,a];case 2:return[a,i,u];case 3:return[a,s,i];case 4:return[u,a,i];case 5:return[i,a,s]}};O.hsv.hsl=function(r){var e=r[0],t=r[1]/100,i=r[2]/100,n=Math.max(i,.01),o,a,s;return s=(2-t)*i,o=(2-t)*n,a=t*n,a/=o<=1?o:2-o,a=a||0,s/=2,[e,a*100,s*100]};O.hwb.rgb=function(r){var e=r[0]/360,t=r[1]/100,i=r[2]/100,n=t+i,o,a,s,u;n>1&&(t/=n,i/=n),o=Math.floor(6*e),a=1-i,s=6*e-o,(o&1)!==0&&(s=1-s),u=t+s*(a-t);var l,d,p;switch(o){default:case 6:case 0:l=a,d=u,p=t;break;case 1:l=u,d=a,p=t;break;case 2:l=t,d=a,p=u;break;case 3:l=t,d=u,p=a;break;case 4:l=u,d=t,p=a;break;case 5:l=a,d=t,p=u;break}return[l*255,d*255,p*255]};O.cmyk.rgb=function(r){var e=r[0]/100,t=r[1]/100,i=r[2]/100,n=r[3]/100,o,a,s;return o=1-Math.min(1,e*(1-n)+n),a=1-Math.min(1,t*(1-n)+n),s=1-Math.min(1,i*(1-n)+n),[o*255,a*255,s*255]};O.xyz.rgb=function(r){var e=r[0]/100,t=r[1]/100,i=r[2]/100,n,o,a;return n=e*3.2406+t*-1.5372+i*-.4986,o=e*-.9689+t*1.8758+i*.0415,a=e*.0557+t*-.204+i*1.057,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,n=Math.min(Math.max(0,n),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[n*255,o*255,a*255]};O.xyz.lab=function(r){var e=r[0],t=r[1],i=r[2],n,o,a;return e/=95.047,t/=100,i/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,n=116*t-16,o=500*(e-t),a=200*(t-i),[n,o,a]};O.lab.xyz=function(r){var e=r[0],t=r[1],i=r[2],n,o,a;o=(e+16)/116,n=t/500+o,a=o-i/200;var s=Math.pow(o,3),u=Math.pow(n,3),l=Math.pow(a,3);return o=s>.008856?s:(o-16/116)/7.787,n=u>.008856?u:(n-16/116)/7.787,a=l>.008856?l:(a-16/116)/7.787,n*=95.047,o*=100,a*=108.883,[n,o,a]};O.lab.lch=function(r){var e=r[0],t=r[1],i=r[2],n,o,a;return n=Math.atan2(i,t),o=n*360/2/Math.PI,o<0&&(o+=360),a=Math.sqrt(t*t+i*i),[e,a,o]};O.lch.lab=function(r){var e=r[0],t=r[1],i=r[2],n,o,a;return a=i/360*2*Math.PI,n=t*Math.cos(a),o=t*Math.sin(a),[e,n,o]};O.rgb.ansi16=function(r){var e=r[0],t=r[1],i=r[2],n=1 in arguments?arguments[1]:O.rgb.hsv(r)[2];if(n=Math.round(n/50),n===0)return 30;var o=30+(Math.round(i/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return n===2&&(o+=60),o};O.hsv.ansi16=function(r){return O.rgb.ansi16(O.hsv.rgb(r),r[2])};O.rgb.ansi256=function(r){var e=r[0],t=r[1],i=r[2];if(e===t&&t===i)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var n=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5);return n};O.ansi16.rgb=function(r){var e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(r>50)+1)*.5,i=(e&1)*t*255,n=(e>>1&1)*t*255,o=(e>>2&1)*t*255;return[i,n,o]};O.ansi256.rgb=function(r){if(r>=232){var e=(r-232)*10+8;return[e,e,e]}r-=16;var t,i=Math.floor(r/36)/5*255,n=Math.floor((t=r%36)/6)/5*255,o=t%6/5*255;return[i,n,o]};O.rgb.hex=function(r){var e=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};O.hex.rgb=function(r){var e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(s){return s+s}).join(""));var i=parseInt(t,16),n=i>>16&255,o=i>>8&255,a=i&255;return[n,o,a]};O.rgb.hcg=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.max(Math.max(e,t),i),o=Math.min(Math.min(e,t),i),a=n-o,s,u;return a<1?s=o/(1-a):s=0,a<=0?u=0:n===e?u=(t-i)/a%6:n===t?u=2+(i-e)/a:u=4+(e-t)/a+4,u/=6,u%=1,[u*360,a*100,s*100]};O.hsl.hcg=function(r){var e=r[1]/100,t=r[2]/100,i=1,n=0;return t<.5?i=2*e*t:i=2*e*(1-t),i<1&&(n=(t-.5*i)/(1-i)),[r[0],i*100,n*100]};O.hsv.hcg=function(r){var e=r[1]/100,t=r[2]/100,i=e*t,n=0;return i<1&&(n=(t-i)/(1-i)),[r[0],i*100,n*100]};O.hcg.rgb=function(r){var e=r[0]/360,t=r[1]/100,i=r[2]/100;if(t===0)return[i*255,i*255,i*255];var n=[0,0,0],o=e%1*6,a=o%1,s=1-a,u=0;switch(Math.floor(o)){case 0:n[0]=1,n[1]=a,n[2]=0;break;case 1:n[0]=s,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=a;break;case 3:n[0]=0,n[1]=s,n[2]=1;break;case 4:n[0]=a,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=s}return u=(1-t)*i,[(t*n[0]+u)*255,(t*n[1]+u)*255,(t*n[2]+u)*255]};O.hcg.hsv=function(r){var e=r[1]/100,t=r[2]/100,i=e+t*(1-e),n=0;return i>0&&(n=e/i),[r[0],n*100,i*100]};O.hcg.hsl=function(r){var e=r[1]/100,t=r[2]/100,i=t*(1-e)+.5*e,n=0;return i>0&&i<.5?n=e/(2*i):i>=.5&&i<1&&(n=e/(2*(1-i))),[r[0],n*100,i*100]};O.hcg.hwb=function(r){var e=r[1]/100,t=r[2]/100,i=e+t*(1-e);return[r[0],(i-e)*100,(1-i)*100]};O.hwb.hcg=function(r){var e=r[1]/100,t=r[2]/100,i=1-t,n=i-e,o=0;return n<1&&(o=(i-n)/(1-n)),[r[0],n*100,o*100]};O.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};O.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};O.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};O.gray.hsl=O.gray.hsv=function(r){return[0,0,r[0]]};O.gray.hwb=function(r){return[0,100,r[0]]};O.gray.cmyk=function(r){return[0,0,0,r[0]]};O.gray.lab=function(r){return[r[0],0,0]};O.gray.hex=function(r){var e=Math.round(r[0]/100*255)&255,t=(e<<16)+(e<<8)+e,i=t.toString(16).toUpperCase();return"000000".substring(i.length)+i};O.rgb.gray=function(r){var e=(r[0]+r[1]+r[2])/3;return[e/255*100]}});var Yl=c((h_,Gl)=>{var bi=go();function Yy(){for(var r={},e=Object.keys(bi),t=e.length,i=0;i<t;i++)r[e[i]]={distance:-1,parent:null};return r}function Wy(r){var e=Yy(),t=[r];for(e[r].distance=0;t.length;)for(var i=t.pop(),n=Object.keys(bi[i]),o=n.length,a=0;a<o;a++){var s=n[a],u=e[s];u.distance===-1&&(u.distance=e[i].distance+1,u.parent=i,t.unshift(s))}return e}function By(r,e){return function(t){return e(r(t))}}function Vy(r,e){for(var t=[e[r].parent,r],i=bi[e[r].parent][r],n=e[r].parent;e[n].parent;)t.unshift(e[n].parent),i=By(bi[e[n].parent][n],i),n=e[n].parent;return i.conversion=t,i}Gl.exports=function(r){for(var e=Wy(r),t={},i=Object.keys(e),n=i.length,o=0;o<n;o++){var a=i[o],s=e[a];s.parent!==null&&(t[a]=Vy(a,e))}return t}});var Bl=c((m_,Wl)=>{var yo=go(),Ky=Yl(),Lr={},Jy=Object.keys(yo);function Zy(r){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function Xy(r){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var i=r(t);if(typeof i=="object")for(var n=i.length,o=0;o<n;o++)i[o]=Math.round(i[o]);return i};return"conversion"in r&&(e.conversion=r.conversion),e}Jy.forEach(function(r){Lr[r]={},Object.defineProperty(Lr[r],"channels",{value:yo[r].channels}),Object.defineProperty(Lr[r],"labels",{value:yo[r].labels});var e=Ky(r),t=Object.keys(e);t.forEach(function(i){var n=e[i];Lr[r][i]=Xy(n),Lr[r][i].raw=Zy(n)})});Wl.exports=Lr});var Jl=c((g_,Kl)=>{"use strict";var st=$l(),ce=Bl(),_o=[].slice,Vl=["keyword","gray","hex"],bo={};Object.keys(ce).forEach(function(r){bo[_o.call(ce[r].labels).sort().join("")]=r});var vi={};function Z(r,e){if(!(this instanceof Z))return new Z(r,e);if(e&&e in Vl&&(e=null),e&&!(e in ce))throw new Error("Unknown model: "+e);var t,i;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof Z)this.model=r.model,this.color=r.color.slice(),this.valpha=r.valpha;else if(typeof r=="string"){var n=st.get(r);if(n===null)throw new Error("Unable to parse color from string: "+r);this.model=n.model,i=ce[this.model].channels,this.color=n.value.slice(0,i),this.valpha=typeof n.value[i]=="number"?n.value[i]:1}else if(r.length){this.model=e||"rgb",i=ce[this.model].channels;var o=_o.call(r,0,i);this.color=vo(o,i),this.valpha=typeof r[i]=="number"?r[i]:1}else if(typeof r=="number")r&=16777215,this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;var a=Object.keys(r);"alpha"in r&&(a.splice(a.indexOf("alpha"),1),this.valpha=typeof r.alpha=="number"?r.alpha:0);var s=a.sort().join("");if(!(s in bo))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=bo[s];var u=ce[this.model].labels,l=[];for(t=0;t<u.length;t++)l.push(r[u[t]]);this.color=vo(l)}if(vi[this.model])for(i=ce[this.model].channels,t=0;t<i;t++){var d=vi[this.model][t];d&&(this.color[t]=d(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Z.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(r){var e=this.model in st.to?this:this.rgb();e=e.round(typeof r=="number"?r:1);var t=e.valpha===1?e.color:e.color.concat(this.valpha);return st.to[e.model](t)},percentString:function(r){var e=this.rgb().round(typeof r=="number"?r:1),t=e.valpha===1?e.color:e.color.concat(this.valpha);return st.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var r={},e=ce[this.model].channels,t=ce[this.model].labels,i=0;i<e;i++)r[t[i]]=this.color[i];return this.valpha!==1&&(r.alpha=this.valpha),r},unitArray:function(){var r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,this.valpha!==1&&r.push(this.valpha),r},unitObject:function(){var r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,this.valpha!==1&&(r.alpha=this.valpha),r},round:function(r){return r=Math.max(r||0,0),new Z(this.color.map(eb(r)).concat(this.valpha),this.model)},alpha:function(r){return arguments.length?new Z(this.color.concat(Math.max(0,Math.min(1,r))),this.model):this.valpha},red:H("rgb",0,B(255)),green:H("rgb",1,B(255)),blue:H("rgb",2,B(255)),hue:H(["hsl","hsv","hsl","hwb","hcg"],0,function(r){return(r%360+360)%360}),saturationl:H("hsl",1,B(100)),lightness:H("hsl",2,B(100)),saturationv:H("hsv",1,B(100)),value:H("hsv",2,B(100)),chroma:H("hcg",1,B(100)),gray:H("hcg",2,B(100)),white:H("hwb",1,B(100)),wblack:H("hwb",2,B(100)),cyan:H("cmyk",0,B(100)),magenta:H("cmyk",1,B(100)),yellow:H("cmyk",2,B(100)),black:H("cmyk",3,B(100)),x:H("xyz",0,B(100)),y:H("xyz",1,B(100)),z:H("xyz",2,B(100)),l:H("lab",0,B(100)),a:H("lab",1),b:H("lab",2),keyword:function(r){return arguments.length?new Z(r):ce[this.model].keyword(this.color)},hex:function(r){return arguments.length?new Z(r):st.to.hex(this.rgb().round().color)},rgbNumber:function(){var r=this.rgb().color;return(r[0]&255)<<16|(r[1]&255)<<8|r[2]&255},luminosity:function(){for(var r=this.rgb().color,e=[],t=0;t<r.length;t++){var i=r[t]/255;e[t]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return .2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(r){var e=this.luminosity(),t=r.luminosity();return e>t?(e+.05)/(t+.05):(t+.05)/(e+.05)},level:function(r){var e=this.contrast(r);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var r=this.rgb().color,e=(r[0]*299+r[1]*587+r[2]*114)/1e3;return e<128},isLight:function(){return!this.isDark()},negate:function(){for(var r=this.rgb(),e=0;e<3;e++)r.color[e]=255-r.color[e];return r},lighten:function(r){var e=this.hsl();return e.color[2]+=e.color[2]*r,e},darken:function(r){var e=this.hsl();return e.color[2]-=e.color[2]*r,e},saturate:function(r){var e=this.hsl();return e.color[1]+=e.color[1]*r,e},desaturate:function(r){var e=this.hsl();return e.color[1]-=e.color[1]*r,e},whiten:function(r){var e=this.hwb();return e.color[1]+=e.color[1]*r,e},blacken:function(r){var e=this.hwb();return e.color[2]+=e.color[2]*r,e},grayscale:function(){var r=this.rgb().color,e=r[0]*.3+r[1]*.59+r[2]*.11;return Z.rgb(e,e,e)},fade:function(r){return this.alpha(this.valpha-this.valpha*r)},opaquer:function(r){return this.alpha(this.valpha+this.valpha*r)},rotate:function(r){var e=this.hsl(),t=e.color[0];return t=(t+r)%360,t=t<0?360+t:t,e.color[0]=t,e},mix:function(r,e){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);var t=r.rgb(),i=this.rgb(),n=e===void 0?.5:e,o=2*n-1,a=t.alpha()-i.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,u=1-s;return Z.rgb(s*t.red()+u*i.red(),s*t.green()+u*i.green(),s*t.blue()+u*i.blue(),t.alpha()*n+i.alpha()*(1-n))}};Object.keys(ce).forEach(function(r){if(Vl.indexOf(r)===-1){var e=ce[r].channels;Z.prototype[r]=function(){if(this.model===r)return new Z(this);if(arguments.length)return new Z(arguments,r);var t=typeof arguments[e]=="number"?e:this.valpha;return new Z(rb(ce[this.model][r].raw(this.color)).concat(t),r)},Z[r]=function(t){return typeof t=="number"&&(t=vo(_o.call(arguments),e)),new Z(t,r)}}});function Qy(r,e){return Number(r.toFixed(e))}function eb(r){return function(e){return Qy(e,r)}}function H(r,e,t){return r=Array.isArray(r)?r:[r],r.forEach(function(i){(vi[i]||(vi[i]=[]))[e]=t}),r=r[0],function(i){var n;return arguments.length?(t&&(i=t(i)),n=this[r](),n.color[e]=i,n):(n=this[r]().color[e],t&&(n=t(n)),n)}}function B(r){return function(e){return Math.max(0,Math.min(r,e))}}function rb(r){return Array.isArray(r)?r:[r]}function vo(r,e){for(var t=0;t<e;t++)typeof r[t]!="number"&&(r[t]=0);return r}Kl.exports=Z});var Xl=c((y_,Zl)=>{"use strict";Zl.exports=function(e){for(var t=0,i=0;t<e.length;i=e.charCodeAt(t++)+((i<<5)-i));var n=Math.floor(Math.abs(Math.sin(i)*1e4%1*16777216)).toString(16);return"#"+Array(6-n.length+1).join("0")+n}});var tc=c((b_,rc)=>{"use strict";var Ql=Jl(),ec=Xl();rc.exports=function(e,t){var i=e.split(t||":"),n=ec(i[0]);if(!i.length)return n;for(var o=0,a=i.length-1;o<a;o++)n=Ql(n).mix(Ql(ec(i[o+1]))).saturate(1).hex();return n}});var nc=c((v_,ic)=>{"use strict";function ge(r,e){if(e)return new ge(r).style(e);if(!(this instanceof ge))return new ge(r);this.text=r}ge.prototype.prefix="\x1B[";ge.prototype.suffix="m";ge.prototype.hex=function(e){e=e[0]==="#"?e.substring(1):e,e.length===3&&(e=e.split(""),e[5]=e[2],e[4]=e[2],e[3]=e[1],e[2]=e[1],e[1]=e[0],e=e.join(""));var t=e.substring(0,2),i=e.substring(2,4),n=e.substring(4,6);return[parseInt(t,16),parseInt(i,16),parseInt(n,16)]};ge.prototype.rgb=function(e,t,i){var n=e/255*5,o=t/255*5,a=i/255*5;return this.ansi(n,o,a)};ge.prototype.ansi=function(e,t,i){var n=Math.round(e),o=Math.round(t),a=Math.round(i);return 16+n*36+o*6+a};ge.prototype.reset=function(){return this.prefix+"39;49"+this.suffix};ge.prototype.style=function(e){return this.prefix+"38;5;"+this.rgb.apply(this,this.hex(e))+this.suffix+this.text+this.reset()};ic.exports=ge});var ac=c((__,oc)=>{var tb=tc(),ib=nc();oc.exports=function(e,t){var i=t.namespace,n=t.colors!==!1?ib(i+":",tb(i)):i+":";return e[0]=n+" "+e[0],e}});var uc=c((w_,sc)=>{"use strict";sc.exports=function(e,t){if(!t)return!1;for(var i=t.split(/[\s,]+/),n=0;n<i.length;n++){if(t=i[n].replace("*",".*?"),t.charAt(0)==="-"){if(new RegExp("^"+t.substr(1)+"$").test(e))return!1;continue}if(new RegExp("^"+t+"$").test(e))return!0}return!1}});var cc=c((E_,lc)=>{var nb=uc();lc.exports=function(e){return function(i){try{return nb(i,e())}catch{}return!1}}});var dc=c((O_,fc)=>{var ob=cc();fc.exports=ob(function(){return process.env.DEBUG||process.env.DIAGNOSTICS})});var hc=c((S_,pc)=>{pc.exports=function(r,e){try{Function.prototype.apply.call(console.log,console,e)}catch{}}});var gc=c((P_,mc)=>{var ab=mo(),sb=require("tty").isatty(1),_i=ab(function r(e,t){return t=t||{},t.colors="colors"in t?t.colors:sb,t.namespace=e,t.prod=!1,t.dev=!0,!r.enabled(e)&&!(t.force||r.force)?r.nope(t):r.yep(t)});_i.modify(ac());_i.use(dc());_i.set(hc());mc.exports=_i});var ut=c((A_,wo)=>{process.env.NODE_ENV==="production"?wo.exports=Al():wo.exports=gc()});var bc=c((T_,yc)=>{"use strict";var Eo=require("fs"),{StringDecoder:ub}=require("string_decoder"),{Stream:lb}=sr();function cb(){}yc.exports=(r,e)=>{let t=Buffer.alloc(65536),i=new ub("utf8"),n=new lb,o="",a=0,s=0;return r.start===-1&&delete r.start,n.readable=!0,n.destroy=()=>{n.destroyed=!0,n.emit("end"),n.emit("close")},Eo.open(r.file,"a+","0644",(u,l)=>{if(u){e?e(u):n.emit("error",u),n.destroy();return}(function d(){if(n.destroyed){Eo.close(l,cb);return}return Eo.read(l,t,0,t.length,a,(p,m)=>{if(p){e?e(p):n.emit("error",p),n.destroy();return}if(!m)return o&&((r.start==null||s>r.start)&&(e?e(null,o):n.emit("line",o)),s++,o=""),setTimeout(d,1e3);let _=i.write(t.slice(0,m));e||n.emit("data",_),_=(o+_).split(/\n+/);let f=_.length-1,g=0;for(;g<f;g++)(r.start==null||s>r.start)&&(e?e(null,_[g]):n.emit("line",_[g])),s++;return o=_[f],a+=m,d()})})()}),e?n.destroy:n}});var Ec=c((M_,wc)=>{"use strict";var oe=require("fs"),V=require("path"),vc=dl(),fb=require("zlib"),{MESSAGE:db}=G(),{Stream:pb,PassThrough:_c}=sr(),hb=Rr(),ye=ut()("winston:file"),mb=require("os"),gb=bc();wc.exports=class extends hb{constructor(e={}){super(e),this.name=e.name||"file";function t(i,...n){n.slice(1).forEach(o=>{if(e[o])throw new Error(`Cannot set ${o} and ${i} together`)})}if(this._stream=new _c,this._stream.setMaxListeners(30),this._onError=this._onError.bind(this),e.filename||e.dirname)t("filename or dirname","stream"),this._basename=this.filename=e.filename?V.basename(e.filename):"winston.log",this.dirname=e.dirname||V.dirname(e.filename),this.options=e.options||{flags:"a"};else if(e.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),t("stream","filename","maxsize"),this._dest=this._stream.pipe(this._setupStream(e.stream)),this.dirname=V.dirname(this._dest.path);else throw new Error("Cannot log to file without filename or stream.");this.maxsize=e.maxsize||null,this.rotationFormat=e.rotationFormat||!1,this.zippedArchive=e.zippedArchive||!1,this.maxFiles=e.maxFiles||null,this.eol=typeof e.eol=="string"?e.eol:mb.EOL,this.tailable=e.tailable||!1,this.lazy=e.lazy||!1,this._size=0,this._pendingSize=0,this._created=0,this._drain=!1,this._opening=!1,this._ending=!1,this._fileExist=!1,this.dirname&&this._createLogDirIfNotExist(this.dirname),this.lazy||this.open()}finishIfEnding(){this._ending&&(this._opening?this.once("open",()=>{this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())}):(this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())))}log(e,t=()=>{}){if(this.silent)return t(),!0;if(this._drain){this._stream.once("drain",()=>{this._drain=!1,this.log(e,t)});return}if(this._rotate){this._stream.once("rotate",()=>{this._rotate=!1,this.log(e,t)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",()=>{this._fileExist=!0,this.log(e,t)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",()=>{this._opening||this.open(),this.once("open",()=>{this.log(e,t)})});return}}let i=`${e[db]}${this.eol}`,n=Buffer.byteLength(i);function o(){if(this._size+=n,this._pendingSize-=n,ye("logged %s %s",this._size,i),this.emit("logged",e),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(()=>{this.emit("fileclosed")});return}this._rotate=!0,this._endStream(()=>this._rotateFile())}}this._pendingSize+=n,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);let a=this._stream.write(i,o.bind(this));return a?t():(this._drain=!0,this._stream.once("drain",()=>{this._drain=!1,t()})),ye("written",a,this._drain),this.finishIfEnding(),a}query(e,t){typeof e=="function"&&(t=e,e={}),e=p(e);let i=V.join(this.dirname,this.filename),n="",o=[],a=0,s=oe.createReadStream(i,{encoding:"utf8"});s.on("error",m=>{if(s.readable&&s.destroy(),!!t)return m.code!=="ENOENT"?t(m):t(null,o)}),s.on("data",m=>{m=(n+m).split(/\n+/);let _=m.length-1,f=0;for(;f<_;f++)(!e.start||a>=e.start)&&u(m[f]),a++;n=m[_]}),s.on("close",()=>{n&&u(n,!0),e.order==="desc"&&(o=o.reverse()),t&&t(null,o)});function u(m,_){try{let f=JSON.parse(m);d(f)&&l(f)}catch(f){_||s.emit("error",f)}}function l(m){if(e.rows&&o.length>=e.rows&&e.order!=="desc"){s.readable&&s.destroy();return}e.fields&&(m=e.fields.reduce((_,f)=>(_[f]=m[f],_),{})),e.order==="desc"&&o.length>=e.rows&&o.shift(),o.push(m)}function d(m){if(!m||typeof m!="object")return;let _=new Date(m.timestamp);if(!(e.from&&_<e.from||e.until&&_>e.until||e.level&&e.level!==m.level))return!0}function p(m){return m=m||{},m.rows=m.rows||m.limit||10,m.start=m.start||0,m.until=m.until||new Date,typeof m.until!="object"&&(m.until=new Date(m.until)),m.from=m.from||m.until-1440*60*1e3,typeof m.from!="object"&&(m.from=new Date(m.from)),m.order=m.order||"desc",m}}stream(e={}){let t=V.join(this.dirname,this.filename),i=new pb,n={file:t,start:e.start};return i.destroy=gb(n,(o,a)=>{if(o)return i.emit("error",o);try{i.emit("data",a),a=JSON.parse(a),i.emit("log",a)}catch(s){i.emit("error",s)}}),i}open(){this.filename&&(this._opening||(this._opening=!0,this.stat((e,t)=>{if(e)return this.emit("error",e);ye("stat done: %s { size: %s }",this.filename,t),this._size=t,this._dest=this._createStream(this._stream),this._opening=!1,this.once("open",()=>{this._stream.emit("rotate")||(this._rotate=!1)})})))}stat(e){let t=this._getFile(),i=V.join(this.dirname,t);oe.stat(i,(n,o)=>{if(n&&n.code==="ENOENT")return ye("ENOENT\xA0ok",i),this.filename=t,e(null,0);if(n)return ye(`err ${n.code} ${i}`),e(n);if(!o||this._needsNewFile(o.size))return this._incFile(()=>this.stat(e));this.filename=t,e(null,o.size)})}close(e){this._stream&&this._stream.end(()=>{e&&e(),this.emit("flush"),this.emit("closed")})}_needsNewFile(e){return e=e||this._size,this.maxsize&&e>=this.maxsize}_onError(e){this.emit("error",e)}_setupStream(e){return e.on("error",this._onError),e}_cleanupStream(e){return e.removeListener("error",this._onError),e.destroy(),e}_rotateFile(){this._incFile(()=>this.open())}_endStream(e=()=>{}){this._dest?(this._stream.unpipe(this._dest),this._dest.end(()=>{this._cleanupStream(this._dest),e()})):e()}_createStream(e){let t=V.join(this.dirname,this.filename);ye("create stream start",t,this.options);let i=oe.createWriteStream(t,this.options).on("error",n=>ye(n)).on("close",()=>ye("close",i.path,i.bytesWritten)).on("open",()=>{ye("file open ok",t),this.emit("open",t),e.pipe(i),this.rotatedWhileOpening&&(this._stream=new _c,this._stream.setMaxListeners(30),this._rotateFile(),this.rotatedWhileOpening=!1,this._cleanupStream(i),e.end())});return ye("create stream ok",t),i}_incFile(e){ye("_incFile",this.filename);let t=V.extname(this._basename),i=V.basename(this._basename,t),n=[];this.zippedArchive&&n.push(function(o){let a=this._created>0&&!this.tailable?this._created:"";this._compressFile(V.join(this.dirname,`${i}${a}${t}`),V.join(this.dirname,`${i}${a}${t}.gz`),o)}.bind(this)),n.push(function(o){this.tailable?this._checkMaxFilesTailable(t,i,o):(this._created+=1,this._checkMaxFilesIncrementing(t,i,o))}.bind(this)),vc(n,e)}_getFile(){let e=V.extname(this._basename),t=V.basename(this._basename,e),i=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?`${t}${i}${e}`:`${t}${e}`}_checkMaxFilesIncrementing(e,t,i){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(i);let n=this._created-this.maxFiles,o=n!==0?n:"",a=this.zippedArchive?".gz":"",s=`${t}${o}${e}${a}`,u=V.join(this.dirname,s);oe.unlink(u,i)}_checkMaxFilesTailable(e,t,i){let n=[];if(!this.maxFiles)return;let o=this.zippedArchive?".gz":"";for(let a=this.maxFiles-1;a>1;a--)n.push(function(s,u){let l=`${t}${s-1}${e}${o}`,d=V.join(this.dirname,l);oe.exists(d,p=>{if(!p)return u(null);l=`${t}${s}${e}${o}`,oe.rename(d,V.join(this.dirname,l),u)})}.bind(this,a));vc(n,()=>{oe.rename(V.join(this.dirname,`${t}${e}${o}`),V.join(this.dirname,`${t}1${e}${o}`),i)})}_compressFile(e,t,i){oe.access(e,oe.F_OK,n=>{if(n)return i();var o=fb.createGzip(),a=oe.createReadStream(e),s=oe.createWriteStream(t);s.on("finish",()=>{oe.unlink(e,i)}),a.pipe(o).pipe(s)})}_createLogDirIfNotExist(e){oe.existsSync(e)||oe.mkdirSync(e,{recursive:!0})}}});var Sc=c((x_,Oc)=>{"use strict";var yb=require("http"),bb=require("https"),{Stream:vb}=sr(),_b=Rr(),{configure:wb}=Hr();Oc.exports=class extends _b{constructor(e={}){super(e),this.options=e,this.name=e.name||"http",this.ssl=!!e.ssl,this.host=e.host||"localhost",this.port=e.port,this.auth=e.auth,this.path=e.path||"",this.maximumDepth=e.maximumDepth,this.agent=e.agent,this.headers=e.headers||{},this.headers["content-type"]="application/json",this.batch=e.batch||!1,this.batchInterval=e.batchInterval||5e3,this.batchCount=e.batchCount||10,this.batchOptions=[],this.batchTimeoutID=-1,this.batchCallback={},this.port||(this.port=this.ssl?443:80)}log(e,t){this._request(e,null,null,(i,n)=>{n&&n.statusCode!==200&&(i=new Error(`Invalid HTTP Status Code: ${n.statusCode}`)),i?this.emit("warn",i):this.emit("logged",e)}),t&&setImmediate(t)}query(e,t){typeof e=="function"&&(t=e,e={}),e={method:"query",params:this.normalizeQuery(e)};let i=e.params.auth||null;delete e.params.auth;let n=e.params.path||null;delete e.params.path,this._request(e,i,n,(o,a,s)=>{if(a&&a.statusCode!==200&&(o=new Error(`Invalid HTTP Status Code: ${a.statusCode}`)),o)return t(o);if(typeof s=="string")try{s=JSON.parse(s)}catch(u){return t(u)}t(null,s)})}stream(e={}){let t=new vb;e={method:"stream",params:e};let i=e.params.path||null;delete e.params.path;let n=e.params.auth||null;delete e.params.auth;let o="",a=this._request(e,n,i);return t.destroy=()=>a.destroy(),a.on("data",s=>{s=(o+s).split(/\n+/);let u=s.length-1,l=0;for(;l<u;l++)try{t.emit("log",JSON.parse(s[l]))}catch(d){t.emit("error",d)}o=s[u]}),a.on("error",s=>t.emit("error",s)),t}_request(e,t,i,n){e=e||{},t=t||this.auth,i=i||this.path||"",this.batch?this._doBatch(e,n,t,i):this._doRequest(e,n,t,i)}_doBatch(e,t,i,n){if(this.batchOptions.push(e),this.batchOptions.length===1){let o=this;this.batchCallback=t,this.batchTimeoutID=setTimeout(function(){o.batchTimeoutID=-1,o._doBatchRequest(o.batchCallback,i,n)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,i,n)}_doBatchRequest(e,t,i){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);let n=this.batchOptions.slice();this.batchOptions=[],this._doRequest(n,e,t,i)}_doRequest(e,t,i,n){let o=Object.assign({},this.headers);i&&i.bearer&&(o.Authorization=`Bearer ${i.bearer}`);let a=(this.ssl?bb:yb).request({...this.options,method:"POST",host:this.host,port:this.port,path:`/${n.replace(/^\//,"")}`,headers:o,auth:i&&i.username&&i.password?`${i.username}:${i.password}`:"",agent:this.agent});a.on("error",t),a.on("response",u=>u.on("end",()=>t(null,u)).resume());let s=wb({...this.maximumDepth&&{maximumDepth:this.maximumDepth}});a.end(Buffer.from(s(e,this.options.replacer),"utf8"))}}});var Oo=c((I_,Pc)=>{"use strict";var _e=r=>r!==null&&typeof r=="object"&&typeof r.pipe=="function";_e.writable=r=>_e(r)&&r.writable!==!1&&typeof r._write=="function"&&typeof r._writableState=="object";_e.readable=r=>_e(r)&&r.readable!==!1&&typeof r._read=="function"&&typeof r._readableState=="object";_e.duplex=r=>_e.writable(r)&&_e.readable(r);_e.transform=r=>_e.duplex(r)&&typeof r._transform=="function";Pc.exports=_e});var Tc=c((L_,Ac)=>{"use strict";var Eb=Oo(),{MESSAGE:Ob}=G(),Sb=require("os"),Pb=Rr();Ac.exports=class extends Pb{constructor(e={}){if(super(e),!e.stream||!Eb(e.stream))throw new Error("options.stream is required.");this._stream=e.stream,this._stream.setMaxListeners(1/0),this.isObjectMode=e.stream._writableState.objectMode,this.eol=typeof e.eol=="string"?e.eol:Sb.EOL}log(e,t){if(setImmediate(()=>this.emit("logged",e)),this.isObjectMode){this._stream.write(e),t&&t();return}this._stream.write(`${e[Ob]}${this.eol}`),t&&t()}}});var Nc=c(lt=>{"use strict";Object.defineProperty(lt,"Console",{configurable:!0,enumerable:!0,get(){return Ru()}});Object.defineProperty(lt,"File",{configurable:!0,enumerable:!0,get(){return Ec()}});Object.defineProperty(lt,"Http",{configurable:!0,enumerable:!0,get(){return Sc()}});Object.defineProperty(lt,"Stream",{configurable:!0,enumerable:!0,get(){return Tc()}})});var Ei=c(ct=>{"use strict";var wi=En(),{configs:So}=G();ct.cli=wi.levels(So.cli);ct.npm=wi.levels(So.npm);ct.syslog=wi.levels(So.syslog);ct.addColors=wi.levels});var Rc=c((Oi,Mc)=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});var Ab=Zt(),Tb=lr(Ab),Nb=si(),Mb=lr(Nb),Rb=oo(),xb=lr(Rb),Ib=to(),Db=lr(Ib),Lb=io(),Cb=lr(Lb),qb=ar(),$b=lr(qb),Ub=Ir(),Fb=lr(Ub);function lr(r){return r&&r.__esModule?r:{default:r}}function jb(r,e,t){t=(0,Db.default)(t);var i=0,n=0,{length:o}=r,a=!1;o===0&&t(null);function s(u,l){u===!1&&(a=!0),a!==!0&&(u?t(u):(++n===o||l===Mb.default)&&t(null))}for(;i<o;i++)e(r[i],i,(0,Cb.default)(s))}function kb(r,e,t){return(0,xb.default)(r,1/0,e,t)}function zb(r,e,t){var i=(0,Tb.default)(r)?jb:kb;return i(r,(0,$b.default)(e),t)}Oi.default=(0,Fb.default)(zb,3);Mc.exports=Oi.default});var Ic=c((Si,xc)=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.default=Hb;function Hb(r){return(e,t,i)=>r(e,i)}xc.exports=Si.default});var Ti=c((Ai,Dc)=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});var Gb=Rc(),Yb=Pi(Gb),Wb=Ic(),Bb=Pi(Wb),Vb=ar(),Kb=Pi(Vb),Jb=Ir(),Zb=Pi(Jb);function Pi(r){return r&&r.__esModule?r:{default:r}}function Xb(r,e,t){return(0,Yb.default)(r,(0,Bb.default)((0,Kb.default)(e)),t)}Ai.default=(0,Zb.default)(Xb,3);Dc.exports=Ai.default});var Cc=c(($_,Lc)=>{"use strict";var Qb=Object.prototype.toString;Lc.exports=function(e){if(typeof e.displayName=="string"&&e.constructor.name)return e.displayName;if(typeof e.name=="string"&&e.name)return e.name;if(typeof e=="object"&&e.constructor&&typeof e.constructor.name=="string")return e.constructor.name;var t=e.toString(),i=Qb.call(e).slice(8,-1);return i==="Function"?t=t.substring(t.indexOf("(")+1,t.indexOf(")")):t=i,t||"anonymous"}});var Po=c((U_,qc)=>{"use strict";var e0=Cc();qc.exports=function(e){var t=0,i;function n(){return t||(t=1,i=e.apply(this,arguments),e=null),i}return n.displayName=e0(e),n}});var Ao=c(dt=>{dt.get=function(r){var e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var t={},i=Error.prepareStackTrace;Error.prepareStackTrace=function(o,a){return a},Error.captureStackTrace(t,r||dt.get);var n=t.stack;return Error.prepareStackTrace=i,Error.stackTraceLimit=e,n};dt.parse=function(r){if(!r.stack)return[];var e=this,t=r.stack.split(`
|
|
29
|
-
`).slice(1);return t.map(function(
|
|
30
|
-
`),stack:
|
|
31
|
-
`),stack:
|
|
32
|
-
`));
|
|
33
|
-
`))}_onEvent(
|
|
34
|
-
${
|
|
35
|
-
`)}`);let
|
|
36
|
-
${
|
|
37
|
-
`});return r?t(n({format:"YYYY-MM-DD HH:mm:ss"}),l):t(l)}function T0(r){return Ge.default.format.printf(e=>{let{level:t,message:i,timestamp:n,...o}=e,a=cr(i,r),u=(o[Symbol.for("splat")]||[]).map(d=>cr(d,r)),l={timestamp:n||new Date().toISOString(),level:t.toUpperCase(),message:a};return u.length>0&&(u.length===1?l.meta=u[0]:l.meta=u),JSON.stringify(l,null,0)})}function sf(r,e){let t=[];for(let i of r)i.mode==="console"?t.push(new Ge.default.transports.Console({format:af(!1,i.showErrorStack)})):i.mode==="file"?e?t.push(new Ge.default.transports.File({filename:e,format:af(!0,i.showErrorStack),maxsize:10*1024*1024,maxFiles:5,tailable:!0})):console.warn("File output mode requested but no filename provided. Skipping file transport."):i.mode==="json"&&t.push(new Ge.default.transports.Console({format:Ge.default.format.combine(Ge.default.format.timestamp(),T0(i.showErrorStack))}));return t}var cr=(r,e)=>{if(r==null)return r;if(r instanceof Error){let t={message:r.message};return e&&r.stack&&(t.stack=r.stack),(0,of.isZodErrorLike)(r)&&(t.message=(0,of.fromError)(r).message),Object.keys(r).forEach(i=>{i!=="name"&&i!=="message"&&i!=="stack"&&(t[i]=cr(r[i],e))}),t.context&&(t.context=cr(t.context,e)),t}if(Array.isArray(r))return r.map(t=>cr(t,e));if(typeof r=="object"){let t={};for(let[i,n]of Object.entries(r))t[i]=cr(n,e);return t}return r},uf=(r,e)=>{try{if(typeof r=="string")return r;let t=cr(r,e);return A0.default.inspect(t,{colors:!1,depth:null,compact:!1,maxArrayLength:null,maxStringLength:null,customInspect:!0})}catch{return String(r)}},Lo=class r{constructor(){this.currentConfig=[],this.debug=(e,...t)=>{this.winstonLogger.debug(e,...t)},this.info=(e,...t)=>{this.winstonLogger.info(e,...t)},this.warn=(e,...t)=>{this.winstonLogger.warn(e,...t)},this.error=(e,...t)=>{this.winstonLogger.error(e,...t)},this.std=e=>{console.log(typeof e=="object"?JSON.stringify(e,null,2):e)},this.setLevel=e=>{ae.LOG_LEVELS.includes(e)?this.winstonLogger.level=e:(this.winstonLogger.warn(`Invalid log level: ${e}. Using '${ae.DEFAULT_LOG_LEVEL}' as default.`),this.winstonLogger.level=ae.DEFAULT_LOG_LEVEL)},this.getLevel=()=>this.winstonLogger.level,this.setOutputModes=(e,t)=>{let i=e.filter(o=>o.mode==="console"||o.mode==="file"||o.mode==="json");i.length===0&&this.winstonLogger.warn("No valid output modes provided."),this.currentConfig=i,this.winstonLogger.clear(),sf(i,t).forEach(o=>this.winstonLogger.add(o))},this.getOutputModes=()=>this.currentConfig,this.currentConfig=[{mode:"console",showErrorStack:!1}],this.winstonLogger=r.createWinstonLogger(this.currentConfig)}static createWinstonLogger(e){let t=sf(e);return Ge.default.createLogger({exitOnError:!0,level:ae.DEFAULT_LOG_LEVEL,transports:t})}},N0=new Lo;ae.logger=N0});var Co=c(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.getIntroductoryOfferGroupingKey=ff;dr.getIntroductoryOfferGroupingDescription=df;dr.validateIntroductoryOffersGrouping=R0;dr.validateIntroductoryOffers=x0;dr.validateIntroductoryOfferAppleRestrictions=I0;var Ri=Zi(),M0=fr(),cf=jr();function ff(r){return r.type==="PAY_AS_YOU_GO"?`${r.type}_${r.numberOfPeriods}`:`${r.type}_${r.duration}`}function df(r){return r.type==="PAY_AS_YOU_GO"?`type '${r.type}' with numberOfPeriods '${r.numberOfPeriods}'`:`type '${r.type}' with duration '${r.duration}'`}function R0(r,e){let t=new Map;for(let i=0;i<r.length;i++){let n=r[i],o=ff(n),a=df(n);if(t.has(o)){let s=t.get(o);s.count++,s.indices.push(i);let u=s.indices;if(u.length<2){M0.logger.error(`Logic error: Expected at least 2 duplicate indices, but found ${u.length} for ${a} in subscription '${e||"unknown"}'`);continue}let l=u[0],d=u[1],p=e?` in subscription '${e}'`:"";return{success:!1,error:`Duplicate introductory offers found with ${a}${p}. Items at indices ${l} and ${d} have the same grouping criteria.`}}else t.set(o,{count:1,indices:[i]})}return{success:!0}}function x0(r,e,t){if(!t)return;let i=new Map;for(let n of t){if(n.type==="FREE_TRIAL"||n.type==="PAY_UP_FRONT"){if(!(0,Ri.isValidIntroductoryOfferDuration)(e,n.type,n.duration)){let o=(0,Ri.getValidIntroductoryOfferDurations)(e,n.type);throw new cf.ContextualError(`Invalid duration '${n.duration}' for ${n.type} offer in subscription '${r}' with period '${e}'.`,{subscriptionProductId:r,subscriptionPeriod:e,offer:n,validDurations:o})}}else if(n.type==="PAY_AS_YOU_GO"&&!(0,Ri.isValidPayAsYouGoPeriods)(e,n.numberOfPeriods)){let o=(0,Ri.getValidPayAsYouGoPeriods)(e);throw new cf.ContextualError(`Invalid numberOfPeriods '${n.numberOfPeriods}' for PAY_AS_YOU_GO offer in subscription '${r}' with period '${e}'.`,{subscriptionProductId:r,subscriptionPeriod:e,offer:n,validPeriods:o})}for(let o of n.availableTerritories){if(i.has(o))throw new Error(`Multiple introductory offers found for territory '${o}' in subscription '${r}'. Only one offer per territory is allowed.`);i.set(o,n)}}}function I0(r,e,t){if(!t||t.length===0)return;let i=e.availability&&e.availability.availableTerritories&&e.availability.availableTerritories.length>0,n=e.pricing&&e.pricing.prices&&e.pricing.prices.length>0;if(!i||!n)throw new Error(`Cannot create introductory offers for subscription '${r}'. Apple requires subscriptions to have both availability and pricing before introductory offers can be created.`)}});var Di=c(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.validateSubscriptionTerritoryPricing=D0;Ii.validateSubscription=L0;var xi=require("zod"),pf=Co();function D0(r,e){let t=r.pricing?.prices||[],i=r.availability,n=r.introductoryOffers||[];if(r.pricing&&!i){e.addIssue({code:xi.z.ZodIssueCode.custom,message:`Subscription '${r.productId}' has pricing defined but no availability. You need to set up availabilities first.`,path:["availability"]});return}if(n.length>0&&t.length===0){e.addIssue({code:xi.z.ZodIssueCode.custom,message:`Subscription '${r.productId}' has introductory offers but no pricing defined. Apple requires subscription pricing to be set up before any introductory offers can be created.`,path:["pricing"]});return}}function L0(r,e){if(r.introductoryOffers&&r.introductoryOffers.length>0){let t=(0,pf.validateIntroductoryOffersGrouping)(r.introductoryOffers,r.productId);t.success||e.addIssue({code:xi.z.ZodIssueCode.custom,message:t.error||"Introductory offers must have unique type+duration or type+numberOfPeriods combinations",path:["introductoryOffers"]})}try{(0,pf.validateIntroductoryOffers)(r.productId,r.subscriptionPeriod,r.introductoryOffers)}catch(t){e.addIssue({code:xi.z.ZodIssueCode.custom,message:t instanceof Error?t.message:"Introductory offers validation failed",path:["introductoryOffers"]})}}});var Ci=c(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.AppStoreModelSchema=b.AppStoreLocalizationSchema=b.AppStoreAppInfoLocalizationSchema=b.AppStoreVersionLocalizationSchema=b.InAppPurchaseSchema=b.SubscriptionGroupSchema=b.SubscriptionSchema=b.PromotionalOfferSchema=b.IntroductoryOfferSchema=b.SubscriptionGroupLocalizationSchema=b.AvailabilitySchema=b.LocalizationSchema=b.PriceScheduleSchema=b.PriceSchema=b.AvailableTerritoriesSchema=b.SubscriptionOfferDurationSchema=b.SubscriptionPeriodSchema=b.APP_STORE_SCHEMA_VERSION=b.WORLDWIDE_TERRITORY_CODE=b.LocaleCodeSchema=b.TerritoryCodeSchema=void 0;var y=require("zod"),Li=wt();Object.defineProperty(b,"TerritoryCodeSchema",{enumerable:!0,get:function(){return Li.TerritoryCodeSchema}});var ht=Vi();Object.defineProperty(b,"LocaleCodeSchema",{enumerable:!0,get:function(){return ht.LocaleCodeSchema}});var qo=Ot(),C0=Di(),Re=fr();b.WORLDWIDE_TERRITORY_CODE="worldwide";var mt=64,$o=100;b.APP_STORE_SCHEMA_VERSION="1.0.0";b.SubscriptionPeriodSchema=y.z.enum(["ONE_WEEK","ONE_MONTH","TWO_MONTHS","THREE_MONTHS","SIX_MONTHS","ONE_YEAR"]);b.SubscriptionOfferDurationSchema=y.z.enum(["THREE_DAYS","ONE_WEEK","TWO_WEEKS","ONE_MONTH","TWO_MONTHS","THREE_MONTHS","SIX_MONTHS","ONE_YEAR"]);b.AvailableTerritoriesSchema=y.z.union([y.z.array(Li.TerritoryCodeSchema),y.z.literal(b.WORLDWIDE_TERRITORY_CODE)]);b.PriceSchema=y.z.object({price:y.z.string(),territory:Li.TerritoryCodeSchema});b.PriceScheduleSchema=y.z.object({baseTerritory:Li.TerritoryCodeSchema,prices:y.z.array(b.PriceSchema)}).refine(r=>r.prices.some(e=>e.territory===r.baseTerritory),{message:"The base territory must have a corresponding price in the prices array",path:["prices"]});b.LocalizationSchema=y.z.object({locale:ht.LocaleCodeSchema,name:y.z.string(),description:y.z.string()});b.AvailabilitySchema=y.z.object({availableInNewTerritories:y.z.boolean(),availableTerritories:b.AvailableTerritoriesSchema});b.SubscriptionGroupLocalizationSchema=y.z.object({locale:ht.LocaleCodeSchema,name:y.z.string(),customName:y.z.string().optional().nullable()}).superRefine((r,e)=>{r.customName&&r.customName.length>mt&&Re.logger.warn(`Warning: customName '${r.customName}' is ${r.customName.length} characters long, but should be at most 30 characters for optimal App Store display.`)});var q0=y.z.object({type:y.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:y.z.number(),pricing:b.PriceScheduleSchema,availableTerritories:b.AvailableTerritoriesSchema}),$0=y.z.object({type:y.z.literal("PAY_UP_FRONT"),duration:b.SubscriptionOfferDurationSchema,pricing:b.PriceScheduleSchema,availableTerritories:b.AvailableTerritoriesSchema}),U0=y.z.object({type:y.z.literal("FREE_TRIAL"),duration:b.SubscriptionOfferDurationSchema,availableTerritories:b.AvailableTerritoriesSchema});b.IntroductoryOfferSchema=y.z.discriminatedUnion("type",[q0,$0,U0]);var F0=y.z.object({id:y.z.string(),referenceName:y.z.string(),type:y.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:y.z.number(),pricing:b.PriceScheduleSchema}),j0=y.z.object({id:y.z.string(),referenceName:y.z.string(),type:y.z.literal("PAY_UP_FRONT"),duration:b.SubscriptionOfferDurationSchema,pricing:b.PriceScheduleSchema}),k0=y.z.object({id:y.z.string(),referenceName:y.z.string(),type:y.z.literal("FREE_TRIAL"),duration:b.SubscriptionOfferDurationSchema});b.PromotionalOfferSchema=y.z.discriminatedUnion("type",[F0,j0,k0]).superRefine((r,e)=>{r.referenceName.length>mt&&Re.logger.warn(`Warning: referenceName '${r.referenceName}' is ${r.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`),r.id.length>$o&&Re.logger.warn(`Warning: productId '${r.id}' is ${r.id.length} characters long, but should be at most 100 characters for optimal App Store display.`)});b.SubscriptionSchema=y.z.object({productId:y.z.string().refine(qo.isValidProductId,{message:"Product ID can only contain alphanumeric characters, underscores, and periods"}),referenceName:y.z.string(),groupLevel:y.z.number(),subscriptionPeriod:b.SubscriptionPeriodSchema,familySharable:y.z.boolean(),reviewNote:y.z.string().optional(),pricing:b.PriceScheduleSchema.optional(),introductoryOffers:y.z.array(b.IntroductoryOfferSchema).optional(),promotionalOffers:y.z.array(b.PromotionalOfferSchema).optional(),availability:b.AvailabilitySchema.optional(),localizations:y.z.array(b.LocalizationSchema).optional()}).superRefine((r,e)=>{r.productId.length>$o&&Re.logger.warn(`Warning: productId '${r.productId}' is ${r.productId.length} characters long, but should be at most 100 characters for optimal App Store display.`),r.referenceName.length>mt&&Re.logger.warn(`Warning: referenceName '${r.referenceName}' is ${r.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)}).superRefine(C0.validateSubscription);b.SubscriptionGroupSchema=y.z.object({referenceName:y.z.string(),localizations:y.z.array(b.SubscriptionGroupLocalizationSchema),subscriptions:y.z.array(b.SubscriptionSchema)}).superRefine((r,e)=>{r.referenceName.length>mt&&Re.logger.warn(`Warning: referenceName '${r.referenceName}' is ${r.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)});b.InAppPurchaseSchema=y.z.object({productId:y.z.string().refine(qo.isValidProductId,{message:"Product ID can only contain alphanumeric characters, underscores, and periods"}),type:y.z.enum(["CONSUMABLE","NON_CONSUMABLE","NON_RENEWING_SUBSCRIPTION"]),referenceName:y.z.string(),familySharable:y.z.boolean(),reviewNote:y.z.string().optional(),pricing:b.PriceScheduleSchema.optional(),availability:b.AvailabilitySchema.optional(),localizations:y.z.array(b.LocalizationSchema).optional()}).superRefine((r,e)=>{r.productId.length>$o&&Re.logger.warn(`Warning: productId '${r.productId}' is ${r.productId.length} characters long, but should be at most 30 characters for optimal App Store display.`),r.referenceName.length>mt&&Re.logger.warn(`Warning: referenceName '${r.referenceName}' is ${r.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)});b.AppStoreVersionLocalizationSchema=y.z.object({description:y.z.string().optional(),keywords:y.z.string().optional(),marketingUrl:y.z.string().url().optional(),promotionalText:y.z.string().optional(),supportUrl:y.z.string().url().optional(),whatsNew:y.z.string().optional()});b.AppStoreAppInfoLocalizationSchema=y.z.object({name:y.z.string().optional(),subtitle:y.z.string().optional(),privacyPolicyUrl:y.z.string().url().optional(),privacyChoicesUrl:y.z.string().url().optional()});b.AppStoreLocalizationSchema=y.z.object({locale:ht.LocaleCodeSchema}).and(b.AppStoreAppInfoLocalizationSchema).and(b.AppStoreVersionLocalizationSchema).superRefine((r,e)=>{r.description&&r.description.length<10&&Re.logger.warn(`Warning: description for locale '${r.locale}' is ${r.description.length} characters long, but should be at least 10 characters.`)});b.AppStoreModelSchema=y.z.object({schemaVersion:y.z.string(),appId:y.z.string(),versionString:y.z.string().optional(),pricing:b.PriceScheduleSchema.optional(),availableTerritories:b.AvailableTerritoriesSchema.optional(),inAppPurchases:y.z.array(b.InAppPurchaseSchema).optional(),subscriptionGroups:y.z.array(b.SubscriptionGroupSchema).optional(),primaryLocale:ht.LocaleCodeSchema.optional(),localizations:y.z.array(b.AppStoreLocalizationSchema).optional(),copyright:y.z.string().optional()}).superRefine(qo.validateAppStoreModelData)});var mf=c(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0})});var vf=c(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.PricingRequestSchema=Oe.PricingItemSchema=Oe.PricePointInfoSchema=Oe.PricingStrategySchema=void 0;var fe=require("zod"),gf=fe.z.enum(["apple","purchasingPower"]);Oe.PricingStrategySchema=gf;var yf=fe.z.object({id:fe.z.string(),price:fe.z.string()});Oe.PricePointInfoSchema=yf;var bf=fe.z.object({type:fe.z.enum(["app","inAppPurchase","subscription","offer"]),id:fe.z.string(),name:fe.z.string(),offerType:fe.z.string().optional(),parentName:fe.z.string().optional()});Oe.PricingItemSchema=bf;var z0=fe.z.object({appId:fe.z.string(),selectedItem:bf,basePricePoint:yf,pricingStrategy:gf,minimumPrice:fe.z.string().optional()});Oe.PricingRequestSchema=z0});var wf=c(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0})});var Ef=c(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});Uo.validateAppStoreModel=V0;var H0=require("zod"),G0=fr(),Y0=Ci(),W0=Di(),B0=jr();function V0(r,e=!1,t="fetch"){let i=Y0.AppStoreModelSchema.safeParse(r);if(i.success){if(t==="apply"&&i.data.subscriptionGroups)for(let n of i.data.subscriptionGroups)for(let o of n.subscriptions){let a=[],s={addIssue:u=>{a.push(u)},path:[],value:o,issues:a};if((0,W0.validateSubscriptionTerritoryPricing)(o,s),a.length>0)throw new H0.z.ZodError(a)}return e&&G0.logger.info("\u2705 Validation passed! The JSON file format and structure are valid."),i.data}else throw new B0.ContextualError(`\u274C Validation failed for '${t}'!`,i.error)}});var Sf=c(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.useShortcuts=J0;Ui.removeShortcuts=Q0;var qi=wt(),K0=Ot(),Of=fr(),$i=Ci();function Fo(r){return r.toLowerCase()===$i.WORLDWIDE_TERRITORY_CODE.toLowerCase()}function jo(r){return(0,K0.deepEqualUnordered)(r,qi.territoryCodes)}function J0(r){if(!r||typeof r!="object")return r;let e=ko(r);return e=Z0(e),e}function ko(r){if(!r||typeof r!="object")return r;let e={...r};return e.availableTerritories&&Array.isArray(e.availableTerritories)&&jo(e.availableTerritories)&&(e.availableTerritories=$i.WORLDWIDE_TERRITORY_CODE),e.availability&&typeof e.availability=="object"&&e.availability.availableTerritories&&Array.isArray(e.availability.availableTerritories)&&jo(e.availability.availableTerritories)&&(e.availability.availableTerritories=$i.WORLDWIDE_TERRITORY_CODE),Array.isArray(e.introductoryOffers)&&(e.introductoryOffers=e.introductoryOffers.map(t=>{let i={...t};return i.availableTerritories&&Array.isArray(i.availableTerritories)&&jo(i.availableTerritories)&&(i.availableTerritories=$i.WORLDWIDE_TERRITORY_CODE),i})),Array.isArray(e.inAppPurchases)&&(e.inAppPurchases=e.inAppPurchases.map(t=>ko(t))),Array.isArray(e.subscriptionGroups)&&(e.subscriptionGroups=e.subscriptionGroups.map(t=>{let i={...t};return Array.isArray(i.subscriptions)&&(i.subscriptions=i.subscriptions.map(n=>ko(n))),i})),e}function Z0(r){if(!r||typeof r!="object")return r;let e={...r};return Array.isArray(e.localizations)&&e.primaryLocale&&(e.localizations=X0(e.localizations,e.primaryLocale)),e}function X0(r,e){if(!e)return r;let t=r.find(n=>n.locale===e);if(!t)return r;let i=r.map(n=>{if(n.locale===e)return n;let o={locale:n.locale};return Object.keys(n).filter(s=>s!=="locale").forEach(s=>{let u=s;n[u]!==t[u]&&(o[u]=n[u])}),o});return Of.logger.debug(`Optimized ${r.length} localizations to avoid duplicates with primary locale: ${e}`),i}function Q0(r){if(!r||typeof r!="object")return r;let e=ev(r);return e=zo(e),e}function zo(r){if(!r||typeof r!="object")return r;let e={...r};return e.availableTerritories&&typeof e.availableTerritories=="string"&&Fo(e.availableTerritories)&&(e.availableTerritories=[...qi.territoryCodes]),e.availability&&typeof e.availability=="object"&&e.availability.availableTerritories&&typeof e.availability.availableTerritories=="string"&&Fo(e.availability.availableTerritories)&&(e.availability.availableTerritories=[...qi.territoryCodes]),Array.isArray(e.introductoryOffers)&&(e.introductoryOffers=e.introductoryOffers.map(t=>{let i={...t};return i.availableTerritories&&typeof i.availableTerritories=="string"&&Fo(i.availableTerritories)&&(i.availableTerritories=[...qi.territoryCodes]),i})),Array.isArray(e.inAppPurchases)&&(e.inAppPurchases=e.inAppPurchases.map(t=>zo(t))),Array.isArray(e.subscriptionGroups)&&(e.subscriptionGroups=e.subscriptionGroups.map(t=>{let i={...t};return Array.isArray(i.subscriptions)&&(i.subscriptions=i.subscriptions.map(n=>zo(n))),i})),e}function ev(r){if(!r||typeof r!="object")return r;let e={...r};return Array.isArray(e.localizations)&&e.primaryLocale&&(e.localizations=rv(e.localizations,e.primaryLocale)),e}function rv(r,e){if(!e)return r;let t=r.find(n=>n.locale===e);if(!t)return r;let i=r.map(n=>{if(n.locale===e)return n;let o={...t,locale:n.locale};return Object.keys(n).forEach(a=>{if(a!=="locale"){let s=a;o[s]=n[s]}}),o});return Of.logger.debug(`Deoptimized ${r.length} localizations to restore full data with primary locale: ${e}`),i}});var Ho=c(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.DEFAULT_CONFIG_FILENAME=Cr.BASE_TERRITORY=void 0;Cr.BASE_TERRITORY="USA";Cr.DEFAULT_CONFIG_FILENAME="storeconfig.json"});var Pf=c(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.collectPricingItems=tv;function tv(r){let e=[];return e.push({type:"app",id:r.appId,name:"App"}),r.inAppPurchases&&r.inAppPurchases.forEach(t=>{e.push({type:"inAppPurchase",id:t.productId,name:t.referenceName})}),r.subscriptionGroups&&r.subscriptionGroups.forEach(t=>{t.subscriptions.forEach(i=>{e.push({type:"subscription",id:i.productId,name:i.referenceName}),i.introductoryOffers&&i.introductoryOffers.filter(n=>n.type!=="FREE_TRIAL").forEach(n=>{e.push({type:"offer",id:i.productId,name:`${n.type} Introductory Offer`,offerType:n.type,parentName:i.referenceName})}),i.promotionalOffers&&i.promotionalOffers.filter(n=>n.type!=="FREE_TRIAL").forEach(n=>{e.push({type:"offer",id:n.id,name:`${n.type} Promotional Offer`,offerType:n.type,parentName:i.referenceName})})})}),e}});var Mf=c(xe=>{"use strict";var iv=xe&&xe.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),nv=xe&&xe.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Nf=xe&&xe.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var i=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[i.length]=n);return i},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i=r(e),n=0;n<i.length;n++)i[n]!=="default"&&iv(t,e,i[n]);return nv(t,e),t}})();Object.defineProperty(xe,"__esModule",{value:!0});xe.validateFileExists=sv;var ov=Nf(require("fs")),Af=Nf(require("path")),Tf=fr(),av=Ho();function sv(r,e={}){let{defaultFilename:t=av.DEFAULT_CONFIG_FILENAME,fileDescription:i="JSON file",resolution:n=`Please either:
|
|
29
|
+
`),Error.captureStackTrace(this,e)}};eu.exports=e=>{if(e.length>2)throw new la(e);function r(n={}){this.options=n}r.prototype.transform=e;function t(n){return new r(n)}return t.Format=r,t}});var iu=m((IE,nu)=>{var tu={};nu.exports=tu;var ru={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(ru).forEach(function(e){var r=ru[e],t=tu[e]=[];t.open="\x1B["+r[0]+"m",t.close="\x1B["+r[1]+"m"})});var ou=m((DE,au)=>{"use strict";au.exports=function(e,r){r=r||process.argv||[];var t=r.indexOf("--"),n=/^-{1,2}/.test(e)?"":"--",i=r.indexOf(n+e);return i!==-1&&(t===-1?!0:i<t)}});var uu=m((CE,su)=>{"use strict";var qm=require("os"),Ce=ou(),ve=process.env,Zr=void 0;Ce("no-color")||Ce("no-colors")||Ce("color=false")?Zr=!1:(Ce("color")||Ce("colors")||Ce("color=true")||Ce("color=always"))&&(Zr=!0);"FORCE_COLOR"in ve&&(Zr=ve.FORCE_COLOR.length===0||parseInt(ve.FORCE_COLOR,10)!==0);function $m(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Um(e){if(Zr===!1)return 0;if(Ce("color=16m")||Ce("color=full")||Ce("color=truecolor"))return 3;if(Ce("color=256"))return 2;if(e&&!e.isTTY&&Zr!==!0)return 0;var r=Zr?1:0;if(process.platform==="win32"){var t=qm.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in ve)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in ve})||ve.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in ve)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(ve.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in ve){var n=parseInt((ve.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(ve.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(ve.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(ve.TERM)||"COLORTERM"in ve?1:(ve.TERM==="dumb",r)}function ca(e){var r=Um(e);return $m(r)}su.exports={supportsColor:ca,stdout:ca(process.stdout),stderr:ca(process.stderr)}});var cu=m((LE,lu)=>{lu.exports=function(r,t){var n="";r=r||"Run the trap, drop the bass",r=r.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return r.forEach(function(a){a=a.toLowerCase();var s=i[a]||[" "],u=Math.floor(Math.random()*s.length);typeof i[a]<"u"?n+=i[a][u]:n+=a}),n}});var du=m((qE,fu)=>{fu.exports=function(r,t){r=r||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(n.up,n.down,n.mid);function a(d){var h=Math.floor(Math.random()*d);return h}function s(d){var h=!1;return i.filter(function(y){h=y===d}),h}function u(d,h){var y="",b,_;h=h||{},h.up=typeof h.up<"u"?h.up:!0,h.mid=typeof h.mid<"u"?h.mid:!0,h.down=typeof h.down<"u"?h.down:!0,h.size=typeof h.size<"u"?h.size:"maxi",d=d.split("");for(_ in d)if(!s(_)){switch(y=y+d[_],b={up:0,down:0,mid:0},h.size){case"mini":b.up=a(8),b.mid=a(2),b.down=a(8);break;case"maxi":b.up=a(16)+3,b.mid=a(4)+1,b.down=a(64)+3;break;default:b.up=a(8)+1,b.mid=a(6)/2,b.down=a(8)+1;break}var S=["up","mid","down"];for(var g in S)for(var w=S[g],T=0;T<=b[w];T++)h[w]&&(y=y+n[w][a(n[w].length)])}return y}return u(r,t)}});var hu=m(($E,pu)=>{pu.exports=function(e){return function(r,t,n){if(r===" ")return r;switch(t%3){case 0:return e.red(r);case 1:return e.white(r);case 2:return e.blue(r)}}}});var mu=m((UE,gu)=>{gu.exports=function(e){return function(r,t,n){return t%2===0?r:e.inverse(r)}}});var vu=m((jE,yu)=>{yu.exports=function(e){var r=["red","yellow","green","blue","magenta"];return function(t,n,i){return t===" "?t:e[r[n++%r.length]](t)}}});var _u=m((FE,bu)=>{bu.exports=function(e){var r=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(t,n,i){return t===" "?t:e[r[Math.round(Math.random()*(r.length-2))]](t)}}});var Au=m((zE,Pu)=>{var k={};Pu.exports=k;k.themes={};var jm=require("util"),Or=k.styles=iu(),Eu=Object.defineProperties,Fm=new RegExp(/[\r\n]+/g);k.supportsColor=uu().supportsColor;typeof k.enabled>"u"&&(k.enabled=k.supportsColor()!==!1);k.enable=function(){k.enabled=!0};k.disable=function(){k.enabled=!1};k.stripColors=k.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var kE=k.stylize=function(r,t){if(!k.enabled)return r+"";var n=Or[t];return!n&&t in k?k[t](r):n.open+r+n.close},km=/[|\\{}()[\]^$+*?.]/g,zm=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(km,"\\$&")};function Su(e){var r=function t(){return Hm.apply(t,arguments)};return r._styles=e,r.__proto__=Bm,r}var Ou=(function(){var e={};return Or.grey=Or.gray,Object.keys(Or).forEach(function(r){Or[r].closeRe=new RegExp(zm(Or[r].close),"g"),e[r]={get:function(){return Su(this._styles.concat(r))}}}),e})(),Bm=Eu(function(){},Ou);function Hm(){var e=Array.prototype.slice.call(arguments),r=e.map(function(s){return s!=null&&s.constructor===String?s:jm.inspect(s)}).join(" ");if(!k.enabled||!r)return r;for(var t=r.indexOf(`
|
|
30
|
+
`)!=-1,n=this._styles,i=n.length;i--;){var a=Or[n[i]];r=a.open+r.replace(a.closeRe,a.open)+a.close,t&&(r=r.replace(Fm,function(s){return a.close+s+a.open}))}return r}k.setTheme=function(e){if(typeof e=="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 r in e)(function(t){k[t]=function(n){if(typeof e[t]=="object"){var i=n;for(var a in e[t])i=k[e[t][a]](i);return i}return k[e[t]](n)}})(r)};function Gm(){var e={};return Object.keys(Ou).forEach(function(r){e[r]={get:function(){return Su([r])}}}),e}var Wm=function(r,t){var n=t.split("");return n=n.map(r),n.join("")};k.trap=cu();k.zalgo=du();k.maps={};k.maps.america=hu()(k);k.maps.zebra=mu()(k);k.maps.rainbow=vu()(k);k.maps.random=_u()(k);for(wu in k.maps)(function(e){k[e]=function(r){return Wm(k.maps[e],r)}})(wu);var wu;Eu(k,Gm())});var fa=m((BE,Tu)=>{var Ym=Au();Tu.exports=Ym});var Nu=m(da=>{"use strict";da.levels={error:0,warn:1,help:2,data:3,info:4,debug:5,prompt:6,verbose:7,input:8,silly:9};da.colors={error:"red",warn:"yellow",help:"cyan",data:"grey",info:"green",debug:"blue",prompt:"grey",verbose:"cyan",input:"grey",silly:"magenta"}});var xu=m(pa=>{"use strict";pa.levels={error:0,warn:1,info:2,http:3,verbose:4,debug:5,silly:6};pa.colors={error:"red",warn:"yellow",info:"green",http:"green",verbose:"cyan",debug:"blue",silly:"magenta"}});var Mu=m(ha=>{"use strict";ha.levels={emerg:0,alert:1,crit:2,error:3,warning:4,notice:5,info:6,debug:7};ha.colors={emerg:"red",alert:"yellow",crit:"red",error:"red",warning:"red",notice:"yellow",info:"green",debug:"blue"}});var Ru=m(mn=>{"use strict";Object.defineProperty(mn,"cli",{value:Nu()});Object.defineProperty(mn,"npm",{value:xu()});Object.defineProperty(mn,"syslog",{value:Mu()})});var ae=m(_t=>{"use strict";Object.defineProperty(_t,"LEVEL",{value:Symbol.for("level")});Object.defineProperty(_t,"MESSAGE",{value:Symbol.for("message")});Object.defineProperty(_t,"SPLAT",{value:Symbol.for("splat")});Object.defineProperty(_t,"configs",{value:Ru()})});var bn=m((KE,vn)=>{"use strict";var ya=fa(),{LEVEL:ga,MESSAGE:ma}=ae();ya.enabled=!0;var Iu=/\s+/,yn=class e{constructor(r={}){r.colors&&this.addColors(r.colors),this.options=r}static addColors(r){let t=Object.keys(r).reduce((n,i)=>(n[i]=Iu.test(r[i])?r[i].split(Iu):r[i],n),{});return e.allColors=Object.assign({},e.allColors||{},t),e.allColors}addColors(r){return e.addColors(r)}colorize(r,t,n){if(typeof n>"u"&&(n=t),!Array.isArray(e.allColors[r]))return ya[e.allColors[r]](n);for(let i=0,a=e.allColors[r].length;i<a;i++)n=ya[e.allColors[r][i]](n);return n}transform(r,t){return t.all&&typeof r[ma]=="string"&&(r[ma]=this.colorize(r[ga],r.level,r[ma])),(t.level||t.all||!t.message)&&(r.level=this.colorize(r[ga],r.level)),(t.all||t.message)&&(r.message=this.colorize(r[ga],r.level,r.message)),r}};vn.exports=e=>new yn(e);vn.exports.Colorizer=vn.exports.Format=yn});var Cu=m((JE,Du)=>{"use strict";var{Colorizer:Vm}=bn();Du.exports=e=>(Vm.addColors(e.colors||e),e)});var qu=m((ZE,Lu)=>{"use strict";var Km=we();Lu.exports=Km(e=>(e.message=` ${e.message}`,e))});var ju=m((XE,Uu)=>{"use strict";var Jm=we(),{LEVEL:$u,MESSAGE:va}=ae();Uu.exports=Jm((e,{stack:r,cause:t})=>{if(e instanceof Error){let i=Object.assign({},e,{level:e.level,[$u]:e[$u]||e.level,message:e.message,[va]:e[va]||e.message});return r&&(i.stack=e.stack),t&&(i.cause=e.cause),i}if(!(e.message instanceof Error))return e;let n=e.message;return Object.assign(e,n),e.message=n.message,e[va]=n.message,r&&(e.stack=n.stack),t&&(e.cause=n.cause),e})});var _a=m((QE,wn)=>{"use strict";var{configs:Zm,LEVEL:Fu,MESSAGE:ba}=ae(),_n=class e{constructor(r={levels:Zm.npm.levels}){this.paddings=e.paddingForLevels(r.levels,r.filler),this.options=r}static getLongestLevel(r){let t=Object.keys(r).map(n=>n.length);return Math.max(...t)}static paddingForLevel(r,t,n){let i=n+1-r.length,a=Math.floor(i/t.length);return`${t}${t.repeat(a)}`.slice(0,i)}static paddingForLevels(r,t=" "){let n=e.getLongestLevel(r);return Object.keys(r).reduce((i,a)=>(i[a]=e.paddingForLevel(a,t,n),i),{})}transform(r,t){return r.message=`${this.paddings[r[Fu]]}${r.message}`,r[ba]&&(r[ba]=`${this.paddings[r[Fu]]}${r[ba]}`),r}};wn.exports=e=>new _n(e);wn.exports.Padder=wn.exports.Format=_n});var ku=m((eS,wa)=>{"use strict";var{Colorizer:Xm}=bn(),{Padder:Qm}=_a(),{configs:ey,MESSAGE:ry}=ae(),En=class{constructor(r={}){r.levels||(r.levels=ey.cli.levels),this.colorizer=new Xm(r),this.padder=new Qm(r),this.options=r}transform(r,t){return this.colorizer.transform(this.padder.transform(r,t),t),r[ry]=`${r.level}:${r.message}`,r}};wa.exports=e=>new En(e);wa.exports.Format=En});var Bu=m((rS,Ea)=>{"use strict";var ty=we();function zu(e){if(e.every(ny))return r=>{let t=r;for(let n=0;n<e.length;n++)if(t=e[n].transform(t,e[n].options),!t)return!1;return t}}function ny(e){if(typeof e.transform!="function")throw new Error(["No transform function found on format. Did you create a format instance?","const myFormat = format(formatFn);","const instance = myFormat();"].join(`
|
|
31
|
+
`));return!0}Ea.exports=(...e)=>{let r=ty(zu(e)),t=r();return t.Format=r.Format,t};Ea.exports.cascade=zu});var Et=m((Aa,Wu)=>{"use strict";var{hasOwnProperty:wt}=Object.prototype,Ar=Pa();Ar.configure=Pa;Ar.stringify=Ar;Ar.default=Ar;Aa.stringify=Ar;Aa.configure=Pa;Wu.exports=Ar;var iy=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function ur(e){return e.length<5e3&&!iy.test(e)?`"${e}"`:JSON.stringify(e)}function Sa(e,r){if(e.length>200||r)return e.sort(r);for(let t=1;t<e.length;t++){let n=e[t],i=t;for(;i!==0&&e[i-1]>n;)e[i]=e[i-1],i--;e[i]=n}return e}var ay=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Oa(e){return ay.call(e)!==void 0&&e.length!==0}function Hu(e,r,t){e.length<t&&(t=e.length);let n=r===","?"":" ",i=`"0":${n}${e[0]}`;for(let a=1;a<t;a++)i+=`${r}"${a}":${n}${e[a]}`;return i}function oy(e){if(wt.call(e,"circularValue")){let r=e.circularValue;if(typeof r=="string")return`"${r}"`;if(r==null)return r;if(r===Error||r===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function sy(e){let r;if(wt.call(e,"deterministic")&&(r=e.deterministic,typeof r!="boolean"&&typeof r!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return r===void 0?!0:r}function uy(e,r){let t;if(wt.call(e,r)&&(t=e[r],typeof t!="boolean"))throw new TypeError(`The "${r}" argument must be of type boolean`);return t===void 0?!0:t}function Gu(e,r){let t;if(wt.call(e,r)){if(t=e[r],typeof t!="number")throw new TypeError(`The "${r}" argument must be of type number`);if(!Number.isInteger(t))throw new TypeError(`The "${r}" argument must be an integer`);if(t<1)throw new RangeError(`The "${r}" argument must be >= 1`)}return t===void 0?1/0:t}function Pr(e){return e===1?"1 item":`${e} items`}function ly(e){let r=new Set;for(let t of e)(typeof t=="string"||typeof t=="number")&&r.add(String(t));return r}function cy(e){if(wt.call(e,"strict")){let r=e.strict;if(typeof r!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(r)return t=>{let n=`Object can not safely be stringified. Received type ${typeof t}`;throw typeof t!="function"&&(n+=` (${t.toString()})`),new Error(n)}}}function Pa(e){e={...e};let r=cy(e);r&&(e.bigint===void 0&&(e.bigint=!1),"circularValue"in e||(e.circularValue=Error));let t=oy(e),n=uy(e,"bigint"),i=sy(e),a=typeof i=="function"?i:void 0,s=Gu(e,"maximumDepth"),u=Gu(e,"maximumBreadth");function d(S,g,w,T,D,$){let P=g[S];switch(typeof P=="object"&&P!==null&&typeof P.toJSON=="function"&&(P=P.toJSON(S)),P=T.call(g,S,P),typeof P){case"string":return ur(P);case"object":{if(P===null)return"null";if(w.indexOf(P)!==-1)return t;let C="",z=",",Y=$;if(Array.isArray(P)){if(P.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(P),D!==""&&($+=D,C+=`
|
|
32
|
+
${$}`,z=`,
|
|
33
|
+
${$}`);let te=Math.min(P.length,u),ce=0;for(;ce<te-1;ce++){let $e=d(String(ce),P,w,T,D,$);C+=$e!==void 0?$e:"null",C+=z}let fe=d(String(ce),P,w,T,D,$);if(C+=fe!==void 0?fe:"null",P.length-1>u){let $e=P.length-u-1;C+=`${z}"... ${Pr($e)} not stringified"`}return D!==""&&(C+=`
|
|
34
|
+
${Y}`),w.pop(),`[${C}]`}let B=Object.keys(P),G=B.length;if(G===0)return"{}";if(s<w.length+1)return'"[Object]"';let U="",Z="";D!==""&&($+=D,z=`,
|
|
35
|
+
${$}`,U=" ");let ne=Math.min(G,u);i&&!Oa(P)&&(B=Sa(B,a)),w.push(P);for(let te=0;te<ne;te++){let ce=B[te],fe=d(ce,P,w,T,D,$);fe!==void 0&&(C+=`${Z}${ur(ce)}:${U}${fe}`,Z=z)}if(G>u){let te=G-u;C+=`${Z}"...":${U}"${Pr(te)} not stringified"`,Z=z}return D!==""&&Z.length>1&&(C=`
|
|
36
|
+
${$}${C}
|
|
37
|
+
${Y}`),w.pop(),`{${C}}`}case"number":return isFinite(P)?String(P):r?r(P):"null";case"boolean":return P===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(P);default:return r?r(P):void 0}}function h(S,g,w,T,D,$){switch(typeof g=="object"&&g!==null&&typeof g.toJSON=="function"&&(g=g.toJSON(S)),typeof g){case"string":return ur(g);case"object":{if(g===null)return"null";if(w.indexOf(g)!==-1)return t;let P=$,C="",z=",";if(Array.isArray(g)){if(g.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(g),D!==""&&($+=D,C+=`
|
|
38
|
+
${$}`,z=`,
|
|
39
|
+
${$}`);let G=Math.min(g.length,u),U=0;for(;U<G-1;U++){let ne=h(String(U),g[U],w,T,D,$);C+=ne!==void 0?ne:"null",C+=z}let Z=h(String(U),g[U],w,T,D,$);if(C+=Z!==void 0?Z:"null",g.length-1>u){let ne=g.length-u-1;C+=`${z}"... ${Pr(ne)} not stringified"`}return D!==""&&(C+=`
|
|
40
|
+
${P}`),w.pop(),`[${C}]`}w.push(g);let Y="";D!==""&&($+=D,z=`,
|
|
41
|
+
${$}`,Y=" ");let B="";for(let G of T){let U=h(G,g[G],w,T,D,$);U!==void 0&&(C+=`${B}${ur(G)}:${Y}${U}`,B=z)}return D!==""&&B.length>1&&(C=`
|
|
42
|
+
${$}${C}
|
|
43
|
+
${P}`),w.pop(),`{${C}}`}case"number":return isFinite(g)?String(g):r?r(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return r?r(g):void 0}}function y(S,g,w,T,D){switch(typeof g){case"string":return ur(g);case"object":{if(g===null)return"null";if(typeof g.toJSON=="function"){if(g=g.toJSON(S),typeof g!="object")return y(S,g,w,T,D);if(g===null)return"null"}if(w.indexOf(g)!==-1)return t;let $=D;if(Array.isArray(g)){if(g.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(g),D+=T;let U=`
|
|
44
|
+
${D}`,Z=`,
|
|
45
|
+
${D}`,ne=Math.min(g.length,u),te=0;for(;te<ne-1;te++){let fe=y(String(te),g[te],w,T,D);U+=fe!==void 0?fe:"null",U+=Z}let ce=y(String(te),g[te],w,T,D);if(U+=ce!==void 0?ce:"null",g.length-1>u){let fe=g.length-u-1;U+=`${Z}"... ${Pr(fe)} not stringified"`}return U+=`
|
|
46
|
+
${$}`,w.pop(),`[${U}]`}let P=Object.keys(g),C=P.length;if(C===0)return"{}";if(s<w.length+1)return'"[Object]"';D+=T;let z=`,
|
|
47
|
+
${D}`,Y="",B="",G=Math.min(C,u);Oa(g)&&(Y+=Hu(g,z,u),P=P.slice(g.length),G-=g.length,B=z),i&&(P=Sa(P,a)),w.push(g);for(let U=0;U<G;U++){let Z=P[U],ne=y(Z,g[Z],w,T,D);ne!==void 0&&(Y+=`${B}${ur(Z)}: ${ne}`,B=z)}if(C>u){let U=C-u;Y+=`${B}"...": "${Pr(U)} not stringified"`,B=z}return B!==""&&(Y=`
|
|
48
|
+
${D}${Y}
|
|
49
|
+
${$}`),w.pop(),`{${Y}}`}case"number":return isFinite(g)?String(g):r?r(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return r?r(g):void 0}}function b(S,g,w){switch(typeof g){case"string":return ur(g);case"object":{if(g===null)return"null";if(typeof g.toJSON=="function"){if(g=g.toJSON(S),typeof g!="object")return b(S,g,w);if(g===null)return"null"}if(w.indexOf(g)!==-1)return t;let T="",D=g.length!==void 0;if(D&&Array.isArray(g)){if(g.length===0)return"[]";if(s<w.length+1)return'"[Array]"';w.push(g);let Y=Math.min(g.length,u),B=0;for(;B<Y-1;B++){let U=b(String(B),g[B],w);T+=U!==void 0?U:"null",T+=","}let G=b(String(B),g[B],w);if(T+=G!==void 0?G:"null",g.length-1>u){let U=g.length-u-1;T+=`,"... ${Pr(U)} not stringified"`}return w.pop(),`[${T}]`}let $=Object.keys(g),P=$.length;if(P===0)return"{}";if(s<w.length+1)return'"[Object]"';let C="",z=Math.min(P,u);D&&Oa(g)&&(T+=Hu(g,",",u),$=$.slice(g.length),z-=g.length,C=","),i&&($=Sa($,a)),w.push(g);for(let Y=0;Y<z;Y++){let B=$[Y],G=b(B,g[B],w);G!==void 0&&(T+=`${C}${ur(B)}:${G}`,C=",")}if(P>u){let Y=P-u;T+=`${C}"...":"${Pr(Y)} not stringified"`}return w.pop(),`{${T}}`}case"number":return isFinite(g)?String(g):r?r(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return r?r(g):void 0}}function _(S,g,w){if(arguments.length>1){let T="";if(typeof w=="number"?T=" ".repeat(Math.min(w,10)):typeof w=="string"&&(T=w.slice(0,10)),g!=null){if(typeof g=="function")return d("",{"":S},[],g,T,"");if(Array.isArray(g))return h("",S,[],ly(g),T,"")}if(T.length!==0)return y("",S,[],T,"")}return b("",S,[])}return _}});var Ta=m((tS,Yu)=>{"use strict";var fy=we(),{MESSAGE:dy}=ae(),py=Et();function hy(e,r){return typeof r=="bigint"?r.toString():r}Yu.exports=fy((e,r)=>{let t=py.configure(r);return e[dy]=t(e,r.replacer||hy,r.space),e})});var Ku=m((nS,Vu)=>{"use strict";var gy=we();Vu.exports=gy((e,r)=>r.message?(e.message=`[${r.label}] ${e.message}`,e):(e.label=r.label,e))});var Zu=m((iS,Ju)=>{"use strict";var my=we(),{MESSAGE:yy}=ae(),vy=Et();Ju.exports=my(e=>{let r={};return e.message&&(r["@message"]=e.message,delete e.message),e.timestamp&&(r["@timestamp"]=e.timestamp,delete e.timestamp),r["@fields"]=e,e[yy]=vy(r),e})});var Qu=m((aS,Xu)=>{"use strict";var by=we();function _y(e,r,t){let n=r.reduce((a,s)=>(a[s]=e[s],delete e[s],a),{}),i=Object.keys(e).reduce((a,s)=>(a[s]=e[s],delete e[s],a),{});return Object.assign(e,n,{[t]:i}),e}function wy(e,r,t){return e[t]=r.reduce((n,i)=>(n[i]=e[i],delete e[i],n),{}),e}Xu.exports=by((e,r={})=>{let t="metadata";r.key&&(t=r.key);let n=[];return!r.fillExcept&&!r.fillWith&&(n.push("level"),n.push("message")),r.fillExcept&&(n=r.fillExcept),n.length>0?_y(e,n,t):r.fillWith?wy(e,r.fillWith,t):e})});var rl=m((oS,el)=>{var Xr=1e3,Qr=Xr*60,et=Qr*60,Tr=et*24,Ey=Tr*7,Sy=Tr*365.25;el.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0)return Oy(e);if(t==="number"&&isFinite(e))return r.long?Ay(e):Py(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Oy(e){if(e=String(e),!(e.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var t=parseFloat(r[1]),n=(r[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*Sy;case"weeks":case"week":case"w":return t*Ey;case"days":case"day":case"d":return t*Tr;case"hours":case"hour":case"hrs":case"hr":case"h":return t*et;case"minutes":case"minute":case"mins":case"min":case"m":return t*Qr;case"seconds":case"second":case"secs":case"sec":case"s":return t*Xr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Py(e){var r=Math.abs(e);return r>=Tr?Math.round(e/Tr)+"d":r>=et?Math.round(e/et)+"h":r>=Qr?Math.round(e/Qr)+"m":r>=Xr?Math.round(e/Xr)+"s":e+"ms"}function Ay(e){var r=Math.abs(e);return r>=Tr?Sn(e,r,Tr,"day"):r>=et?Sn(e,r,et,"hour"):r>=Qr?Sn(e,r,Qr,"minute"):r>=Xr?Sn(e,r,Xr,"second"):e+" ms"}function Sn(e,r,t,n){var i=r>=t*1.5;return Math.round(e/t)+" "+n+(i?"s":"")}});var nl=m((St,tl)=>{"use strict";var Ty=we(),Ny=rl();tl.exports=Ty(e=>{let r=+new Date;return St.diff=r-(St.prevTime||r),St.prevTime=r,e.ms=`+${Ny(St.diff)}`,e})});var ol=m((sS,al)=>{"use strict";var xy=require("util").inspect,My=we(),{LEVEL:Ry,MESSAGE:il,SPLAT:Iy}=ae();al.exports=My((e,r={})=>{let t=Object.assign({},e);return delete t[Ry],delete t[il],delete t[Iy],e[il]=xy(t,!1,r.depth||null,r.colorize),e})});var sl=m((uS,Pn)=>{"use strict";var{MESSAGE:Dy}=ae(),On=class{constructor(r){this.template=r}transform(r){return r[Dy]=this.template(r),r}};Pn.exports=e=>new On(e);Pn.exports.Printf=Pn.exports.Format=On});var cl=m((lS,ll)=>{"use strict";var Cy=we(),{MESSAGE:ul}=ae(),Ly=Et();ll.exports=Cy(e=>{let r=Ly(Object.assign({},e,{level:void 0,message:void 0,splat:void 0})),t=e.padding&&e.padding[e.level]||"";return r!=="{}"?e[ul]=`${e.level}:${t} ${e.message} ${r}`:e[ul]=`${e.level}:${t} ${e.message}`,e})});var pl=m((cS,dl)=>{"use strict";var qy=require("util"),{SPLAT:fl}=ae(),$y=/%[scdjifoO%]/g,Uy=/%%/g,Na=class{constructor(r){this.options=r}_splat(r,t){let n=r.message,i=r[fl]||r.splat||[],a=n.match(Uy),s=a&&a.length||0,d=t.length-s-i.length,h=d<0?i.splice(d,-1*d):[],y=h.length;if(y)for(let b=0;b<y;b++)Object.assign(r,h[b]);return r.message=qy.format(n,...i),r}transform(r){let t=r.message,n=r[fl]||r.splat;if(!n||!n.length)return r;let i=t&&t.match&&t.match($y);if(!i&&(n||n.length)){let a=n.length>1?n.splice(0):n,s=a.length;if(s)for(let u=0;u<s;u++)Object.assign(r,a[u]);return r}return i?this._splat(r,i):r}};dl.exports=e=>new Na(e)});var gl=m((An,hl)=>{(function(e,r){typeof An=="object"&&typeof hl<"u"?r(An):typeof define=="function"&&define.amd?define(["exports"],r):r(e.fecha={})})(An,(function(e){"use strict";var r=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,t="\\d\\d?",n="\\d\\d",i="\\d{3}",a="\\d{4}",s="[^\\s]+",u=/\[([^]*?)\]/gm;function d(O,R){for(var V=[],ue=0,q=O.length;ue<q;ue++)V.push(O[ue].substr(0,R));return V}var h=function(O){return function(R,V){var ue=V[O].map(function(_e){return _e.toLowerCase()}),q=ue.indexOf(R.toLowerCase());return q>-1?q:null}};function y(O){for(var R=[],V=1;V<arguments.length;V++)R[V-1]=arguments[V];for(var ue=0,q=R;ue<q.length;ue++){var _e=q[ue];for(var de in _e)O[de]=_e[de]}return O}var b=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_=["January","February","March","April","May","June","July","August","September","October","November","December"],S=d(_,3),g=d(b,3),w={dayNamesShort:g,dayNames:b,monthNamesShort:S,monthNames:_,amPm:["am","pm"],DoFn:function(O){return O+["th","st","nd","rd"][O%10>3?0:(O-O%10!==10?1:0)*O%10]}},T=y({},w),D=function(O){return T=y(T,O)},$=function(O){return O.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},P=function(O,R){for(R===void 0&&(R=2),O=String(O);O.length<R;)O="0"+O;return O},C={D:function(O){return String(O.getDate())},DD:function(O){return P(O.getDate())},Do:function(O,R){return R.DoFn(O.getDate())},d:function(O){return String(O.getDay())},dd:function(O){return P(O.getDay())},ddd:function(O,R){return R.dayNamesShort[O.getDay()]},dddd:function(O,R){return R.dayNames[O.getDay()]},M:function(O){return String(O.getMonth()+1)},MM:function(O){return P(O.getMonth()+1)},MMM:function(O,R){return R.monthNamesShort[O.getMonth()]},MMMM:function(O,R){return R.monthNames[O.getMonth()]},YY:function(O){return P(String(O.getFullYear()),4).substr(2)},YYYY:function(O){return P(O.getFullYear(),4)},h:function(O){return String(O.getHours()%12||12)},hh:function(O){return P(O.getHours()%12||12)},H:function(O){return String(O.getHours())},HH:function(O){return P(O.getHours())},m:function(O){return String(O.getMinutes())},mm:function(O){return P(O.getMinutes())},s:function(O){return String(O.getSeconds())},ss:function(O){return P(O.getSeconds())},S:function(O){return String(Math.round(O.getMilliseconds()/100))},SS:function(O){return P(Math.round(O.getMilliseconds()/10),2)},SSS:function(O){return P(O.getMilliseconds(),3)},a:function(O,R){return O.getHours()<12?R.amPm[0]:R.amPm[1]},A:function(O,R){return O.getHours()<12?R.amPm[0].toUpperCase():R.amPm[1].toUpperCase()},ZZ:function(O){var R=O.getTimezoneOffset();return(R>0?"-":"+")+P(Math.floor(Math.abs(R)/60)*100+Math.abs(R)%60,4)},Z:function(O){var R=O.getTimezoneOffset();return(R>0?"-":"+")+P(Math.floor(Math.abs(R)/60),2)+":"+P(Math.abs(R)%60,2)}},z=function(O){return+O-1},Y=[null,t],B=[null,s],G=["isPm",s,function(O,R){var V=O.toLowerCase();return V===R.amPm[0]?0:V===R.amPm[1]?1:null}],U=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(O){var R=(O+"").match(/([+-]|\d\d)/gi);if(R){var V=+R[1]*60+parseInt(R[2],10);return R[0]==="+"?V:-V}return 0}],Z={D:["day",t],DD:["day",n],Do:["day",t+s,function(O){return parseInt(O,10)}],M:["month",t,z],MM:["month",n,z],YY:["year",n,function(O){var R=new Date,V=+(""+R.getFullYear()).substr(0,2);return+(""+(+O>68?V-1:V)+O)}],h:["hour",t,void 0,"isPm"],hh:["hour",n,void 0,"isPm"],H:["hour",t],HH:["hour",n],m:["minute",t],mm:["minute",n],s:["second",t],ss:["second",n],YYYY:["year",a],S:["millisecond","\\d",function(O){return+O*100}],SS:["millisecond",n,function(O){return+O*10}],SSS:["millisecond",i],d:Y,dd:Y,ddd:B,dddd:B,MMM:["month",s,h("monthNamesShort")],MMMM:["month",s,h("monthNames")],a:G,A:G,ZZ:U,Z:U},ne={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},te=function(O){return y(ne,O)},ce=function(O,R,V){if(R===void 0&&(R=ne.default),V===void 0&&(V={}),typeof O=="number"&&(O=new Date(O)),Object.prototype.toString.call(O)!=="[object Date]"||isNaN(O.getTime()))throw new Error("Invalid Date pass to format");R=ne[R]||R;var ue=[];R=R.replace(u,function(_e,de){return ue.push(de),"@@@"});var q=y(y({},T),V);return R=R.replace(r,function(_e){return C[_e](O,q)}),R.replace(/@@@/g,function(){return ue.shift()})};function fe(O,R,V){if(V===void 0&&(V={}),typeof R!="string")throw new Error("Invalid format in fecha parse");if(R=ne[R]||R,O.length>1e3)return null;var ue=new Date,q={year:ue.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},_e=[],de=[],Ne=R.replace(u,function(nr,Ge){return de.push($(Ge)),"@@@"}),Ue={},Br={};Ne=$(Ne).replace(r,function(nr){var Ge=Z[nr],Wr=Ge[0],Xt=Ge[1],Qt=Ge[3];if(Ue[Wr])throw new Error("Invalid format. "+Wr+" specified twice in format");return Ue[Wr]=!0,Qt&&(Br[Qt]=!0),_e.push(Ge),"("+Xt+")"}),Object.keys(Br).forEach(function(nr){if(!Ue[nr])throw new Error("Invalid format. "+nr+" is required in specified format")}),Ne=Ne.replace(/@@@/g,function(){return de.shift()});var er=O.match(new RegExp(Ne,"i"));if(!er)return null;for(var Hr=y(y({},T),V),ie=1;ie<er.length;ie++){var rr=_e[ie-1],ht=rr[0],Se=rr[2],Gr=Se?Se(er[ie],Hr):+er[ie];if(Gr==null)return null;q[ht]=Gr}q.isPm===1&&q.hour!=null&&+q.hour!=12?q.hour=+q.hour+12:q.isPm===0&&+q.hour==12&&(q.hour=0);var Re;if(q.timezoneOffset==null){Re=new Date(q.year,q.month,q.day,q.hour,q.minute,q.second,q.millisecond);for(var tr=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],ie=0,Zt=tr.length;ie<Zt;ie++)if(Ue[tr[ie][0]]&&q[tr[ie][0]]!==Re[tr[ie][1]]())return null}else if(Re=new Date(Date.UTC(q.year,q.month,q.day,q.hour,q.minute-q.timezoneOffset,q.second,q.millisecond)),q.month>11||q.month<0||q.day>31||q.day<1||q.hour>23||q.hour<0||q.minute>59||q.minute<0||q.second>59||q.second<0)return null;return Re}var $e={format:ce,parse:fe,defaultI18n:w,setGlobalDateI18n:D,setGlobalDateMasks:te};e.assign=y,e.default=$e,e.format=ce,e.parse=fe,e.defaultI18n=w,e.setGlobalDateI18n=D,e.setGlobalDateMasks=te,Object.defineProperty(e,"__esModule",{value:!0})}))});var yl=m((fS,ml)=>{"use strict";var jy=gl(),Fy=we();ml.exports=Fy((e,r={})=>(r.format&&(e.timestamp=typeof r.format=="function"?r.format():jy.format(new Date,r.format)),e.timestamp||(e.timestamp=new Date().toISOString()),r.alias&&(e[r.alias]=e.timestamp),e))});var bl=m((dS,vl)=>{"use strict";var xa=fa(),ky=we(),{MESSAGE:Ma}=ae();vl.exports=ky((e,r)=>(r.level!==!1&&(e.level=xa.strip(e.level)),r.message!==!1&&(e.message=xa.strip(String(e.message))),r.raw!==!1&&e[Ma]&&(e[Ma]=xa.strip(String(e[Ma]))),e))});var Ia=m(Ra=>{"use strict";var zy=Ra.format=we();Ra.levels=Cu();function he(e,r){Object.defineProperty(zy,e,{get(){return r()},configurable:!0})}he("align",function(){return qu()});he("errors",function(){return ju()});he("cli",function(){return ku()});he("combine",function(){return Bu()});he("colorize",function(){return bn()});he("json",function(){return Ta()});he("label",function(){return Ku()});he("logstash",function(){return Zu()});he("metadata",function(){return Qu()});he("ms",function(){return nl()});he("padLevels",function(){return _a()});he("prettyPrint",function(){return ol()});he("printf",function(){return sl()});he("simple",function(){return cl()});he("splat",function(){return pl()});he("timestamp",function(){return yl()});he("uncolorize",function(){return bl()})});var Da=m(Tn=>{"use strict";var{format:_l}=require("util");Tn.warn={deprecated(e){return()=>{throw new Error(_l("{ %s } was removed in winston@3.0.0.",e))}},useFormat(e){return()=>{throw new Error([_l("{ %s } was removed in winston@3.0.0.",e),"Use a custom winston.format = winston.format(function) instead."].join(`
|
|
50
|
+
`))}},forFunctions(e,r,t){t.forEach(n=>{e[n]=Tn.warn[r](n)})},forProperties(e,r,t){t.forEach(n=>{let i=Tn.warn[r](n);Object.defineProperty(e,n,{get:i,set:i})})}}});var wl=m((gS,By)=>{By.exports={name:"winston",description:"A logger for just about everything.",version:"3.17.0",author:"Charlie Robbins <charlie.robbins@gmail.com>",maintainers:["David Hyde <dabh@alumni.stanford.edu>"],repository:{type:"git",url:"https://github.com/winstonjs/winston.git"},keywords:["winston","logger","logging","logs","sysadmin","bunyan","pino","loglevel","tools","json","stream"],dependencies:{"@dabh/diagnostics":"^2.0.2","@colors/colors":"^1.6.0",async:"^3.2.3","is-stream":"^2.0.0",logform:"^2.7.0","one-time":"^1.0.0","readable-stream":"^3.4.0","safe-stable-stringify":"^2.3.1","stack-trace":"0.0.x","triple-beam":"^1.3.0","winston-transport":"^4.9.0"},devDependencies:{"@babel/cli":"^7.23.9","@babel/core":"^7.24.0","@babel/preset-env":"^7.24.0","@dabh/eslint-config-populist":"^4.4.0","@types/node":"^20.11.24","abstract-winston-transport":"^0.5.1",assume:"^2.2.0","cross-spawn-async":"^2.2.5",eslint:"^8.57.0",hock:"^1.4.1",mocha:"^10.3.0",nyc:"^17.1.0",rimraf:"5.0.1",split2:"^4.1.0","std-mocks":"^2.0.0",through2:"^4.0.2","winston-compat":"^0.1.5"},main:"./lib/winston.js",browser:"./dist/winston",types:"./index.d.ts",scripts:{lint:"eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",test:"rimraf test/fixtures/logs/* && mocha","test:coverage":"nyc npm run test:unit","test:unit":"mocha test/unit","test:integration":"mocha test/integration",build:"rimraf dist && babel lib -d dist",prepublishOnly:"npm run build"},engines:{node:">= 12.0.0"},license:"MIT"}});var Sl=m((mS,El)=>{El.exports=require("util").deprecate});var Ca=m((yS,Ol)=>{Ol.exports=require("stream")});var qa=m((vS,Al)=>{"use strict";function Hy(e,r){var t=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(r?r(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(La,this,e)):process.nextTick(La,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!r&&a?t._writableState?t._writableState.errorEmitted?process.nextTick(Nn,t):(t._writableState.errorEmitted=!0,process.nextTick(Pl,t,a)):process.nextTick(Pl,t,a):r?(process.nextTick(Nn,t),r(a)):process.nextTick(Nn,t)}),this)}function Pl(e,r){La(e,r),Nn(e)}function Nn(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Gy(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function La(e,r){e.emit("error",r)}function Wy(e,r){var t=e._readableState,n=e._writableState;t&&t.autoDestroy||n&&n.autoDestroy?e.destroy(r):e.emit("error",r)}Al.exports={destroy:Hy,undestroy:Gy,errorOrDestroy:Wy}});var lr=m((bS,xl)=>{"use strict";var Nl={};function xe(e,r,t){t||(t=Error);function n(a,s,u){return typeof r=="string"?r:r(a,s,u)}class i extends t{constructor(s,u,d){super(n(s,u,d))}}i.prototype.name=t.name,i.prototype.code=e,Nl[e]=i}function Tl(e,r){if(Array.isArray(e)){let t=e.length;return e=e.map(n=>String(n)),t>2?`one of ${r} ${e.slice(0,t-1).join(", ")}, or `+e[t-1]:t===2?`one of ${r} ${e[0]} or ${e[1]}`:`of ${r} ${e[0]}`}else return`of ${r} ${String(e)}`}function Yy(e,r,t){return e.substr(!t||t<0?0:+t,r.length)===r}function Vy(e,r,t){return(t===void 0||t>e.length)&&(t=e.length),e.substring(t-r.length,t)===r}function Ky(e,r,t){return typeof t!="number"&&(t=0),t+r.length>e.length?!1:e.indexOf(r,t)!==-1}xe("ERR_INVALID_OPT_VALUE",function(e,r){return'The value "'+r+'" is invalid for option "'+e+'"'},TypeError);xe("ERR_INVALID_ARG_TYPE",function(e,r,t){let n;typeof r=="string"&&Yy(r,"not ")?(n="must not be",r=r.replace(/^not /,"")):n="must be";let i;if(Vy(e," argument"))i=`The ${e} ${n} ${Tl(r,"type")}`;else{let a=Ky(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${Tl(r,"type")}`}return i+=`. Received type ${typeof t}`,i},TypeError);xe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");xe("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});xe("ERR_STREAM_PREMATURE_CLOSE","Premature close");xe("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});xe("ERR_MULTIPLE_CALLBACK","Callback called multiple times");xe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");xe("ERR_STREAM_WRITE_AFTER_END","write after end");xe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);xe("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);xe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");xl.exports.codes=Nl});var $a=m((_S,Ml)=>{"use strict";var Jy=lr().codes.ERR_INVALID_OPT_VALUE;function Zy(e,r,t){return e.highWaterMark!=null?e.highWaterMark:r?e[t]:null}function Xy(e,r,t,n){var i=Zy(r,n,t);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?t:"highWaterMark";throw new Jy(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}Ml.exports={getHighWaterMark:Xy}});var Rl=m((wS,Ua)=>{typeof Object.create=="function"?Ua.exports=function(r,t){t&&(r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:Ua.exports=function(r,t){if(t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r}}});var rt=m((ES,Fa)=>{try{if(ja=require("util"),typeof ja.inherits!="function")throw"";Fa.exports=ja.inherits}catch{Fa.exports=Rl()}var ja});var $l=m((SS,ql)=>{"use strict";function Il(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Dl(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Il(Object(t),!0).forEach(function(n){Qy(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Il(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Qy(e,r,t){return r=Ll(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ev(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Cl(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Ll(n.key),n)}}function rv(e,r,t){return r&&Cl(e.prototype,r),t&&Cl(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ll(e){var r=tv(e,"string");return typeof r=="symbol"?r:String(r)}function tv(e,r){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var nv=require("buffer"),xn=nv.Buffer,iv=require("util"),ka=iv.inspect,av=ka&&ka.custom||"inspect";function ov(e,r,t){xn.prototype.copy.call(e,r,t)}ql.exports=(function(){function e(){ev(this,e),this.head=null,this.tail=null,this.length=0}return rv(e,[{key:"push",value:function(t){var n={data:t,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(t){var n={data:t,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=t+n.data;return i}},{key:"concat",value:function(t){if(this.length===0)return xn.alloc(0);for(var n=xn.allocUnsafe(t>>>0),i=this.head,a=0;i;)ov(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(t,n){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):t===this.head.data.length?i=this.shift():i=n?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var n=this.head,i=1,a=n.data;for(t-=a.length;n=n.next;){var s=n.data,u=t>s.length?s.length:t;if(u===s.length?a+=s:a+=s.slice(0,t),t-=u,t===0){u===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(u));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(t){var n=xn.allocUnsafe(t),i=this.head,a=1;for(i.data.copy(n),t-=i.data.length;i=i.next;){var s=i.data,u=t>s.length?s.length:t;if(s.copy(n,n.length-t,0,u),t-=u,t===0){u===s.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(u));break}++a}return this.length-=a,n}},{key:av,value:function(t,n){return ka(this,Dl(Dl({},n),{},{depth:0,customInspect:!1}))}}]),e})()});var Fl=m((za,jl)=>{var Mn=require("buffer"),je=Mn.Buffer;function Ul(e,r){for(var t in e)r[t]=e[t]}je.from&&je.alloc&&je.allocUnsafe&&je.allocUnsafeSlow?jl.exports=Mn:(Ul(Mn,za),za.Buffer=Nr);function Nr(e,r,t){return je(e,r,t)}Nr.prototype=Object.create(je.prototype);Ul(je,Nr);Nr.from=function(e,r,t){if(typeof e=="number")throw new TypeError("Argument must not be a number");return je(e,r,t)};Nr.alloc=function(e,r,t){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=je(e);return r!==void 0?typeof t=="string"?n.fill(r,t):n.fill(r):n.fill(0),n};Nr.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return je(e)};Nr.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Mn.SlowBuffer(e)}});var Ga=m(zl=>{"use strict";var Ha=Fl().Buffer,kl=Ha.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function sv(e){if(!e)return"utf8";for(var r;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(r)return;e=(""+e).toLowerCase(),r=!0}}function uv(e){var r=sv(e);if(typeof r!="string"&&(Ha.isEncoding===kl||!kl(e)))throw new Error("Unknown encoding: "+e);return r||e}zl.StringDecoder=Ot;function Ot(e){this.encoding=uv(e);var r;switch(this.encoding){case"utf16le":this.text=hv,this.end=gv,r=4;break;case"utf8":this.fillLast=fv,r=4;break;case"base64":this.text=mv,this.end=yv,r=3;break;default:this.write=vv,this.end=bv;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ha.allocUnsafe(r)}Ot.prototype.write=function(e){if(e.length===0)return"";var r,t;if(this.lastNeed){if(r=this.fillLast(e),r===void 0)return"";t=this.lastNeed,this.lastNeed=0}else t=0;return t<e.length?r?r+this.text(e,t):this.text(e,t):r||""};Ot.prototype.end=pv;Ot.prototype.text=dv;Ot.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Ba(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function lv(e,r,t){var n=r.length-1;if(n<t)return 0;var i=Ba(r[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<t||i===-2?0:(i=Ba(r[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<t||i===-2?0:(i=Ba(r[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function cv(e,r,t){if((r[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&r.length>1){if((r[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&r.length>2&&(r[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function fv(e){var r=this.lastTotal-this.lastNeed,t=cv(this,e,r);if(t!==void 0)return t;if(this.lastNeed<=e.length)return e.copy(this.lastChar,r,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,r,0,e.length),this.lastNeed-=e.length}function dv(e,r){var t=lv(this,e,r);if(!this.lastNeed)return e.toString("utf8",r);this.lastTotal=t;var n=e.length-(t-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",r,n)}function pv(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+"\uFFFD":r}function hv(e,r){if((e.length-r)%2===0){var t=e.toString("utf16le",r);if(t){var n=t.charCodeAt(t.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],t.slice(0,-1)}return t}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",r,e.length-1)}function gv(e){var r=e&&e.length?this.write(e):"";if(this.lastNeed){var t=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,t)}return r}function mv(e,r){var t=(e.length-r)%3;return t===0?e.toString("base64",r):(this.lastNeed=3-t,this.lastTotal=3,t===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",r,e.length-t))}function yv(e){var r=e&&e.length?this.write(e):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function vv(e){return e.toString(this.encoding)}function bv(e){return e&&e.length?this.write(e):""}});var Rn=m((PS,Gl)=>{"use strict";var Bl=lr().codes.ERR_STREAM_PREMATURE_CLOSE;function _v(e){var r=!1;return function(){if(!r){r=!0;for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];e.apply(this,n)}}}function wv(){}function Ev(e){return e.setHeader&&typeof e.abort=="function"}function Hl(e,r,t){if(typeof r=="function")return Hl(e,null,r);r||(r={}),t=_v(t||wv);var n=r.readable||r.readable!==!1&&e.readable,i=r.writable||r.writable!==!1&&e.writable,a=function(){e.writable||u()},s=e._writableState&&e._writableState.finished,u=function(){i=!1,s=!0,n||t.call(e)},d=e._readableState&&e._readableState.endEmitted,h=function(){n=!1,d=!0,i||t.call(e)},y=function(g){t.call(e,g)},b=function(){var g;if(n&&!d)return(!e._readableState||!e._readableState.ended)&&(g=new Bl),t.call(e,g);if(i&&!s)return(!e._writableState||!e._writableState.ended)&&(g=new Bl),t.call(e,g)},_=function(){e.req.on("finish",u)};return Ev(e)?(e.on("complete",u),e.on("abort",b),e.req?_():e.on("request",_)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",h),e.on("finish",u),r.error!==!1&&e.on("error",y),e.on("close",b),function(){e.removeListener("complete",u),e.removeListener("abort",b),e.removeListener("request",_),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",h),e.removeListener("error",y),e.removeListener("close",b)}}Gl.exports=Hl});var Yl=m((AS,Wl)=>{"use strict";var In;function cr(e,r,t){return r=Sv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Sv(e){var r=Ov(e,"string");return typeof r=="symbol"?r:String(r)}function Ov(e,r){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var Pv=Rn(),fr=Symbol("lastResolve"),xr=Symbol("lastReject"),Pt=Symbol("error"),Dn=Symbol("ended"),Mr=Symbol("lastPromise"),Wa=Symbol("handlePromise"),Rr=Symbol("stream");function dr(e,r){return{value:e,done:r}}function Av(e){var r=e[fr];if(r!==null){var t=e[Rr].read();t!==null&&(e[Mr]=null,e[fr]=null,e[xr]=null,r(dr(t,!1)))}}function Tv(e){process.nextTick(Av,e)}function Nv(e,r){return function(t,n){e.then(function(){if(r[Dn]){t(dr(void 0,!0));return}r[Wa](t,n)},n)}}var xv=Object.getPrototypeOf(function(){}),Mv=Object.setPrototypeOf((In={get stream(){return this[Rr]},next:function(){var r=this,t=this[Pt];if(t!==null)return Promise.reject(t);if(this[Dn])return Promise.resolve(dr(void 0,!0));if(this[Rr].destroyed)return new Promise(function(s,u){process.nextTick(function(){r[Pt]?u(r[Pt]):s(dr(void 0,!0))})});var n=this[Mr],i;if(n)i=new Promise(Nv(n,this));else{var a=this[Rr].read();if(a!==null)return Promise.resolve(dr(a,!1));i=new Promise(this[Wa])}return this[Mr]=i,i}},cr(In,Symbol.asyncIterator,function(){return this}),cr(In,"return",function(){var r=this;return new Promise(function(t,n){r[Rr].destroy(null,function(i){if(i){n(i);return}t(dr(void 0,!0))})})}),In),xv),Rv=function(r){var t,n=Object.create(Mv,(t={},cr(t,Rr,{value:r,writable:!0}),cr(t,fr,{value:null,writable:!0}),cr(t,xr,{value:null,writable:!0}),cr(t,Pt,{value:null,writable:!0}),cr(t,Dn,{value:r._readableState.endEmitted,writable:!0}),cr(t,Wa,{value:function(a,s){var u=n[Rr].read();u?(n[Mr]=null,n[fr]=null,n[xr]=null,a(dr(u,!1))):(n[fr]=a,n[xr]=s)},writable:!0}),t));return n[Mr]=null,Pv(r,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[xr];a!==null&&(n[Mr]=null,n[fr]=null,n[xr]=null,a(i)),n[Pt]=i;return}var s=n[fr];s!==null&&(n[Mr]=null,n[fr]=null,n[xr]=null,s(dr(void 0,!0))),n[Dn]=!0}),r.on("readable",Tv.bind(null,n)),n};Wl.exports=Rv});var Zl=m((TS,Jl)=>{"use strict";function Vl(e,r,t,n,i,a,s){try{var u=e[a](s),d=u.value}catch(h){t(h);return}u.done?r(d):Promise.resolve(d).then(n,i)}function Iv(e){return function(){var r=this,t=arguments;return new Promise(function(n,i){var a=e.apply(r,t);function s(d){Vl(a,n,i,s,u,"next",d)}function u(d){Vl(a,n,i,s,u,"throw",d)}s(void 0)})}}function Kl(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Dv(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Kl(Object(t),!0).forEach(function(n){Cv(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kl(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Cv(e,r,t){return r=Lv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Lv(e){var r=qv(e,"string");return typeof r=="symbol"?r:String(r)}function qv(e,r){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var $v=lr().codes.ERR_INVALID_ARG_TYPE;function Uv(e,r,t){var n;if(r&&typeof r.next=="function")n=r;else if(r&&r[Symbol.asyncIterator])n=r[Symbol.asyncIterator]();else if(r&&r[Symbol.iterator])n=r[Symbol.iterator]();else throw new $v("iterable",["Iterable"],r);var i=new e(Dv({objectMode:!0},t)),a=!1;i._read=function(){a||(a=!0,s())};function s(){return u.apply(this,arguments)}function u(){return u=Iv(function*(){try{var d=yield n.next(),h=d.value,y=d.done;y?i.push(null):i.push(yield h)?s():a=!1}catch(b){i.destroy(b)}}),u.apply(this,arguments)}return i}Jl.exports=Uv});var to=m((xS,sc)=>{"use strict";sc.exports=W;var tt;W.ReadableState=rc;var NS=require("events").EventEmitter,ec=function(r,t){return r.listeners(t).length},Tt=Ca(),Cn=require("buffer").Buffer,jv=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Fv(e){return Cn.from(e)}function kv(e){return Cn.isBuffer(e)||e instanceof jv}var Ya=require("util"),F;Ya&&Ya.debuglog?F=Ya.debuglog("stream"):F=function(){};var zv=$l(),eo=qa(),Bv=$a(),Hv=Bv.getHighWaterMark,Ln=lr().codes,Gv=Ln.ERR_INVALID_ARG_TYPE,Wv=Ln.ERR_STREAM_PUSH_AFTER_EOF,Yv=Ln.ERR_METHOD_NOT_IMPLEMENTED,Vv=Ln.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,nt,Va,Ka;rt()(W,Tt);var At=eo.errorOrDestroy,Ja=["error","close","destroy","pause","resume"];function Kv(e,r,t){if(typeof e.prependListener=="function")return e.prependListener(r,t);!e._events||!e._events[r]?e.on(r,t):Array.isArray(e._events[r])?e._events[r].unshift(t):e._events[r]=[t,e._events[r]]}function rc(e,r,t){tt=tt||Ir(),e=e||{},typeof t!="boolean"&&(t=r instanceof tt),this.objectMode=!!e.objectMode,t&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Hv(this,e,"readableHighWaterMark",t),this.buffer=new zv,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(nt||(nt=Ga().StringDecoder),this.decoder=new nt(e.encoding),this.encoding=e.encoding)}function W(e){if(tt=tt||Ir(),!(this instanceof W))return new W(e);var r=this instanceof tt;this._readableState=new rc(e,this,r),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Tt.call(this)}Object.defineProperty(W.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(r){this._readableState&&(this._readableState.destroyed=r)}});W.prototype.destroy=eo.destroy;W.prototype._undestroy=eo.undestroy;W.prototype._destroy=function(e,r){r(e)};W.prototype.push=function(e,r){var t=this._readableState,n;return t.objectMode?n=!0:typeof e=="string"&&(r=r||t.defaultEncoding,r!==t.encoding&&(e=Cn.from(e,r),r=""),n=!0),tc(this,e,r,!1,n)};W.prototype.unshift=function(e){return tc(this,e,null,!0,!1)};function tc(e,r,t,n,i){F("readableAddChunk",r);var a=e._readableState;if(r===null)a.reading=!1,Xv(e,a);else{var s;if(i||(s=Jv(a,r)),s)At(e,s);else if(a.objectMode||r&&r.length>0)if(typeof r!="string"&&!a.objectMode&&Object.getPrototypeOf(r)!==Cn.prototype&&(r=Fv(r)),n)a.endEmitted?At(e,new Vv):Za(e,a,r,!0);else if(a.ended)At(e,new Wv);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!t?(r=a.decoder.write(r),a.objectMode||r.length!==0?Za(e,a,r,!1):Qa(e,a)):Za(e,a,r,!1)}else n||(a.reading=!1,Qa(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function Za(e,r,t,n){r.flowing&&r.length===0&&!r.sync?(r.awaitDrain=0,e.emit("data",t)):(r.length+=r.objectMode?1:t.length,n?r.buffer.unshift(t):r.buffer.push(t),r.needReadable&&qn(e)),Qa(e,r)}function Jv(e,r){var t;return!kv(r)&&typeof r!="string"&&r!==void 0&&!e.objectMode&&(t=new Gv("chunk",["string","Buffer","Uint8Array"],r)),t}W.prototype.isPaused=function(){return this._readableState.flowing===!1};W.prototype.setEncoding=function(e){nt||(nt=Ga().StringDecoder);var r=new nt(e);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var t=this._readableState.buffer.head,n="";t!==null;)n+=r.write(t.data),t=t.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var Xl=1073741824;function Zv(e){return e>=Xl?e=Xl:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Ql(e,r){return e<=0||r.length===0&&r.ended?0:r.objectMode?1:e!==e?r.flowing&&r.length?r.buffer.head.data.length:r.length:(e>r.highWaterMark&&(r.highWaterMark=Zv(e)),e<=r.length?e:r.ended?r.length:(r.needReadable=!0,0))}W.prototype.read=function(e){F("read",e),e=parseInt(e,10);var r=this._readableState,t=e;if(e!==0&&(r.emittedReadable=!1),e===0&&r.needReadable&&((r.highWaterMark!==0?r.length>=r.highWaterMark:r.length>0)||r.ended))return F("read: emitReadable",r.length,r.ended),r.length===0&&r.ended?Xa(this):qn(this),null;if(e=Ql(e,r),e===0&&r.ended)return r.length===0&&Xa(this),null;var n=r.needReadable;F("need readable",n),(r.length===0||r.length-e<r.highWaterMark)&&(n=!0,F("length less than watermark",n)),r.ended||r.reading?(n=!1,F("reading or ended",n)):n&&(F("do read"),r.reading=!0,r.sync=!0,r.length===0&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(e=Ql(t,r)));var i;return e>0?i=ac(e,r):i=null,i===null?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),r.length===0&&(r.ended||(r.needReadable=!0),t!==e&&r.ended&&Xa(this)),i!==null&&this.emit("data",i),i};function Xv(e,r){if(F("onEofChunk"),!r.ended){if(r.decoder){var t=r.decoder.end();t&&t.length&&(r.buffer.push(t),r.length+=r.objectMode?1:t.length)}r.ended=!0,r.sync?qn(e):(r.needReadable=!1,r.emittedReadable||(r.emittedReadable=!0,nc(e)))}}function qn(e){var r=e._readableState;F("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(F("emitReadable",r.flowing),r.emittedReadable=!0,process.nextTick(nc,e))}function nc(e){var r=e._readableState;F("emitReadable_",r.destroyed,r.length,r.ended),!r.destroyed&&(r.length||r.ended)&&(e.emit("readable"),r.emittedReadable=!1),r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark,ro(e)}function Qa(e,r){r.readingMore||(r.readingMore=!0,process.nextTick(Qv,e,r))}function Qv(e,r){for(;!r.reading&&!r.ended&&(r.length<r.highWaterMark||r.flowing&&r.length===0);){var t=r.length;if(F("maybeReadMore read 0"),e.read(0),t===r.length)break}r.readingMore=!1}W.prototype._read=function(e){At(this,new Yv("_read()"))};W.prototype.pipe=function(e,r){var t=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,F("pipe count=%d opts=%j",n.pipesCount,r);var i=(!r||r.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?u:w;n.endEmitted?process.nextTick(a):t.once("end",a),e.on("unpipe",s);function s(T,D){F("onunpipe"),T===t&&D&&D.hasUnpiped===!1&&(D.hasUnpiped=!0,y())}function u(){F("onend"),e.end()}var d=eb(t);e.on("drain",d);var h=!1;function y(){F("cleanup"),e.removeListener("close",S),e.removeListener("finish",g),e.removeListener("drain",d),e.removeListener("error",_),e.removeListener("unpipe",s),t.removeListener("end",u),t.removeListener("end",w),t.removeListener("data",b),h=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&d()}t.on("data",b);function b(T){F("ondata");var D=e.write(T);F("dest.write",D),D===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&oc(n.pipes,e)!==-1)&&!h&&(F("false write response, pause",n.awaitDrain),n.awaitDrain++),t.pause())}function _(T){F("onerror",T),w(),e.removeListener("error",_),ec(e,"error")===0&&At(e,T)}Kv(e,"error",_);function S(){e.removeListener("finish",g),w()}e.once("close",S);function g(){F("onfinish"),e.removeListener("close",S),w()}e.once("finish",g);function w(){F("unpipe"),t.unpipe(e)}return e.emit("pipe",t),n.flowing||(F("pipe resume"),t.resume()),e};function eb(e){return function(){var t=e._readableState;F("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&ec(e,"data")&&(t.flowing=!0,ro(e))}}W.prototype.unpipe=function(e){var r=this._readableState,t={hasUnpiped:!1};if(r.pipesCount===0)return this;if(r.pipesCount===1)return e&&e!==r.pipes?this:(e||(e=r.pipes),r.pipes=null,r.pipesCount=0,r.flowing=!1,e&&e.emit("unpipe",this,t),this);if(!e){var n=r.pipes,i=r.pipesCount;r.pipes=null,r.pipesCount=0,r.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=oc(r.pipes,e);return s===-1?this:(r.pipes.splice(s,1),r.pipesCount-=1,r.pipesCount===1&&(r.pipes=r.pipes[0]),e.emit("unpipe",this,t),this)};W.prototype.on=function(e,r){var t=Tt.prototype.on.call(this,e,r),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,F("on readable",n.length,n.reading),n.length?qn(this):n.reading||process.nextTick(rb,this)),t};W.prototype.addListener=W.prototype.on;W.prototype.removeListener=function(e,r){var t=Tt.prototype.removeListener.call(this,e,r);return e==="readable"&&process.nextTick(ic,this),t};W.prototype.removeAllListeners=function(e){var r=Tt.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(ic,this),r};function ic(e){var r=e._readableState;r.readableListening=e.listenerCount("readable")>0,r.resumeScheduled&&!r.paused?r.flowing=!0:e.listenerCount("data")>0&&e.resume()}function rb(e){F("readable nexttick read 0"),e.read(0)}W.prototype.resume=function(){var e=this._readableState;return e.flowing||(F("resume"),e.flowing=!e.readableListening,tb(this,e)),e.paused=!1,this};function tb(e,r){r.resumeScheduled||(r.resumeScheduled=!0,process.nextTick(nb,e,r))}function nb(e,r){F("resume",r.reading),r.reading||e.read(0),r.resumeScheduled=!1,e.emit("resume"),ro(e),r.flowing&&!r.reading&&e.read(0)}W.prototype.pause=function(){return F("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(F("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ro(e){var r=e._readableState;for(F("flow",r.flowing);r.flowing&&e.read()!==null;);}W.prototype.wrap=function(e){var r=this,t=this._readableState,n=!1;e.on("end",function(){if(F("wrapped end"),t.decoder&&!t.ended){var s=t.decoder.end();s&&s.length&&r.push(s)}r.push(null)}),e.on("data",function(s){if(F("wrapped data"),t.decoder&&(s=t.decoder.write(s)),!(t.objectMode&&s==null)&&!(!t.objectMode&&(!s||!s.length))){var u=r.push(s);u||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=(function(u){return function(){return e[u].apply(e,arguments)}})(i));for(var a=0;a<Ja.length;a++)e.on(Ja[a],this.emit.bind(this,Ja[a]));return this._read=function(s){F("wrapped _read",s),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(W.prototype[Symbol.asyncIterator]=function(){return Va===void 0&&(Va=Yl()),Va(this)});Object.defineProperty(W.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(W.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(W.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(r){this._readableState&&(this._readableState.flowing=r)}});W._fromList=ac;Object.defineProperty(W.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ac(e,r){if(r.length===0)return null;var t;return r.objectMode?t=r.buffer.shift():!e||e>=r.length?(r.decoder?t=r.buffer.join(""):r.buffer.length===1?t=r.buffer.first():t=r.buffer.concat(r.length),r.buffer.clear()):t=r.buffer.consume(e,r.decoder),t}function Xa(e){var r=e._readableState;F("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,process.nextTick(ib,r,e))}function ib(e,r){if(F("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,r.readable=!1,r.emit("end"),e.autoDestroy)){var t=r._writableState;(!t||t.autoDestroy&&t.finished)&&r.destroy()}}typeof Symbol=="function"&&(W.from=function(e,r){return Ka===void 0&&(Ka=Zl()),Ka(W,e,r)});function oc(e,r){for(var t=0,n=e.length;t<n;t++)if(e[t]===r)return t;return-1}});var Ir=m((MS,lc)=>{"use strict";var ab=Object.keys||function(e){var r=[];for(var t in e)r.push(t);return r};lc.exports=Fe;var uc=to(),io=jn();rt()(Fe,uc);for(no=ab(io.prototype),$n=0;$n<no.length;$n++)Un=no[$n],Fe.prototype[Un]||(Fe.prototype[Un]=io.prototype[Un]);var no,Un,$n;function Fe(e){if(!(this instanceof Fe))return new Fe(e);uc.call(this,e),io.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",ob)))}Object.defineProperty(Fe.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Fe.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Fe.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ob(){this._writableState.ended||process.nextTick(sb,this)}function sb(e){e.end()}Object.defineProperty(Fe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(r){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=r,this._writableState.destroyed=r)}})});var jn=m((RS,gc)=>{"use strict";gc.exports=ee;function fc(e){var r=this;this.next=null,this.entry=null,this.finish=function(){Cb(r,e)}}var it;ee.WritableState=xt;var ub={deprecate:Sl()},dc=Ca(),kn=require("buffer").Buffer,lb=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function cb(e){return kn.from(e)}function fb(e){return kn.isBuffer(e)||e instanceof lb}var oo=qa(),db=$a(),pb=db.getHighWaterMark,pr=lr().codes,hb=pr.ERR_INVALID_ARG_TYPE,gb=pr.ERR_METHOD_NOT_IMPLEMENTED,mb=pr.ERR_MULTIPLE_CALLBACK,yb=pr.ERR_STREAM_CANNOT_PIPE,vb=pr.ERR_STREAM_DESTROYED,bb=pr.ERR_STREAM_NULL_VALUES,_b=pr.ERR_STREAM_WRITE_AFTER_END,wb=pr.ERR_UNKNOWN_ENCODING,at=oo.errorOrDestroy;rt()(ee,dc);function Eb(){}function xt(e,r,t){it=it||Ir(),e=e||{},typeof t!="boolean"&&(t=r instanceof it),this.objectMode=!!e.objectMode,t&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=pb(this,e,"writableHighWaterMark",t),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){xb(r,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new fc(this)}xt.prototype.getBuffer=function(){for(var r=this.bufferedRequest,t=[];r;)t.push(r),r=r.next;return t};(function(){try{Object.defineProperty(xt.prototype,"buffer",{get:ub.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Fn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Fn=Function.prototype[Symbol.hasInstance],Object.defineProperty(ee,Symbol.hasInstance,{value:function(r){return Fn.call(this,r)?!0:this!==ee?!1:r&&r._writableState instanceof xt}})):Fn=function(r){return r instanceof this};function ee(e){it=it||Ir();var r=this instanceof it;if(!r&&!Fn.call(ee,this))return new ee(e);this._writableState=new xt(e,this,r),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),dc.call(this)}ee.prototype.pipe=function(){at(this,new yb)};function Sb(e,r){var t=new _b;at(e,t),process.nextTick(r,t)}function Ob(e,r,t,n){var i;return t===null?i=new bb:typeof t!="string"&&!r.objectMode&&(i=new hb("chunk",["string","Buffer"],t)),i?(at(e,i),process.nextTick(n,i),!1):!0}ee.prototype.write=function(e,r,t){var n=this._writableState,i=!1,a=!n.objectMode&&fb(e);return a&&!kn.isBuffer(e)&&(e=cb(e)),typeof r=="function"&&(t=r,r=null),a?r="buffer":r||(r=n.defaultEncoding),typeof t!="function"&&(t=Eb),n.ending?Sb(this,t):(a||Ob(this,n,e,t))&&(n.pendingcb++,i=Ab(this,n,a,e,r,t)),i};ee.prototype.cork=function(){this._writableState.corked++};ee.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&pc(this,e))};ee.prototype.setDefaultEncoding=function(r){if(typeof r=="string"&&(r=r.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((r+"").toLowerCase())>-1))throw new wb(r);return this._writableState.defaultEncoding=r,this};Object.defineProperty(ee.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Pb(e,r,t){return!e.objectMode&&e.decodeStrings!==!1&&typeof r=="string"&&(r=kn.from(r,t)),r}Object.defineProperty(ee.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Ab(e,r,t,n,i,a){if(!t){var s=Pb(r,n,i);n!==s&&(t=!0,i="buffer",n=s)}var u=r.objectMode?1:n.length;r.length+=u;var d=r.length<r.highWaterMark;if(d||(r.needDrain=!0),r.writing||r.corked){var h=r.lastBufferedRequest;r.lastBufferedRequest={chunk:n,encoding:i,isBuf:t,callback:a,next:null},h?h.next=r.lastBufferedRequest:r.bufferedRequest=r.lastBufferedRequest,r.bufferedRequestCount+=1}else ao(e,r,!1,u,n,i,a);return d}function ao(e,r,t,n,i,a,s){r.writelen=n,r.writecb=s,r.writing=!0,r.sync=!0,r.destroyed?r.onwrite(new vb("write")):t?e._writev(i,r.onwrite):e._write(i,a,r.onwrite),r.sync=!1}function Tb(e,r,t,n,i){--r.pendingcb,t?(process.nextTick(i,n),process.nextTick(Nt,e,r),e._writableState.errorEmitted=!0,at(e,n)):(i(n),e._writableState.errorEmitted=!0,at(e,n),Nt(e,r))}function Nb(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function xb(e,r){var t=e._writableState,n=t.sync,i=t.writecb;if(typeof i!="function")throw new mb;if(Nb(t),r)Tb(e,t,n,r,i);else{var a=hc(t)||e.destroyed;!a&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&pc(e,t),n?process.nextTick(cc,e,t,a,i):cc(e,t,a,i)}}function cc(e,r,t,n){t||Mb(e,r),r.pendingcb--,n(),Nt(e,r)}function Mb(e,r){r.length===0&&r.needDrain&&(r.needDrain=!1,e.emit("drain"))}function pc(e,r){r.bufferProcessing=!0;var t=r.bufferedRequest;if(e._writev&&t&&t.next){var n=r.bufferedRequestCount,i=new Array(n),a=r.corkedRequestsFree;a.entry=t;for(var s=0,u=!0;t;)i[s]=t,t.isBuf||(u=!1),t=t.next,s+=1;i.allBuffers=u,ao(e,r,!0,r.length,i,"",a.finish),r.pendingcb++,r.lastBufferedRequest=null,a.next?(r.corkedRequestsFree=a.next,a.next=null):r.corkedRequestsFree=new fc(r),r.bufferedRequestCount=0}else{for(;t;){var d=t.chunk,h=t.encoding,y=t.callback,b=r.objectMode?1:d.length;if(ao(e,r,!1,b,d,h,y),t=t.next,r.bufferedRequestCount--,r.writing)break}t===null&&(r.lastBufferedRequest=null)}r.bufferedRequest=t,r.bufferProcessing=!1}ee.prototype._write=function(e,r,t){t(new gb("_write()"))};ee.prototype._writev=null;ee.prototype.end=function(e,r,t){var n=this._writableState;return typeof e=="function"?(t=e,e=null,r=null):typeof r=="function"&&(t=r,r=null),e!=null&&this.write(e,r),n.corked&&(n.corked=1,this.uncork()),n.ending||Db(this,n,t),this};Object.defineProperty(ee.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function hc(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function Rb(e,r){e._final(function(t){r.pendingcb--,t&&at(e,t),r.prefinished=!0,e.emit("prefinish"),Nt(e,r)})}function Ib(e,r){!r.prefinished&&!r.finalCalled&&(typeof e._final=="function"&&!r.destroyed?(r.pendingcb++,r.finalCalled=!0,process.nextTick(Rb,e,r)):(r.prefinished=!0,e.emit("prefinish")))}function Nt(e,r){var t=hc(r);if(t&&(Ib(e,r),r.pendingcb===0&&(r.finished=!0,e.emit("finish"),r.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return t}function Db(e,r,t){r.ending=!0,Nt(e,r),t&&(r.finished?process.nextTick(t):e.once("finish",t)),r.ended=!0,e.writable=!1}function Cb(e,r,t){var n=e.entry;for(e.entry=null;n;){var i=n.callback;r.pendingcb--,i(t),n=n.next}r.corkedRequestsFree.next=e}Object.defineProperty(ee.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(r){this._writableState&&(this._writableState.destroyed=r)}});ee.prototype.destroy=oo.destroy;ee.prototype._undestroy=oo.undestroy;ee.prototype._destroy=function(e,r){r(e)}});var so=m((IS,vc)=>{"use strict";var Lb=require("util"),mc=jn(),{LEVEL:yc}=ae(),Mt=vc.exports=function(r={}){mc.call(this,{objectMode:!0,highWaterMark:r.highWaterMark}),this.format=r.format,this.level=r.level,this.handleExceptions=r.handleExceptions,this.handleRejections=r.handleRejections,this.silent=r.silent,r.log&&(this.log=r.log),r.logv&&(this.logv=r.logv),r.close&&(this.close=r.close),this.once("pipe",t=>{this.levels=t.levels,this.parent=t}),this.once("unpipe",t=>{t===this.parent&&(this.parent=null,this.close&&this.close())})};Lb.inherits(Mt,mc);Mt.prototype._write=function(r,t,n){if(this.silent||r.exception===!0&&!this.handleExceptions)return n(null);let i=this.level||this.parent&&this.parent.level;if(!i||this.levels[i]>=this.levels[r[yc]]){if(r&&!this.format)return this.log(r,n);let a,s;try{s=this.format.transform(Object.assign({},r),this.format.options)}catch(u){a=u}if(a||!s){if(n(),a)throw a;return}return this.log(s,n)}return this._writableState.sync=!1,n(null)};Mt.prototype._writev=function(r,t){if(this.logv){let n=r.filter(this._accept,this);return n.length?this.logv(n,t):t(null)}for(let n=0;n<r.length;n++){if(!this._accept(r[n]))continue;if(r[n].chunk&&!this.format){this.log(r[n].chunk,r[n].callback);continue}let i,a;try{a=this.format.transform(Object.assign({},r[n].chunk),this.format.options)}catch(s){i=s}if(i||!a){if(r[n].callback(),i)throw t(null),i}else this.log(a,r[n].callback)}return t(null)};Mt.prototype._accept=function(r){let t=r.chunk;if(this.silent)return!1;let n=this.level||this.parent&&this.parent.level;return!!((t.exception===!0||!n||this.levels[n]>=this.levels[t[yc]])&&(this.handleExceptions||t.exception!==!0))};Mt.prototype._nop=function(){}});var lo=m((DS,_c)=>{"use strict";var qb=require("util"),{LEVEL:uo}=ae(),bc=so(),Rt=_c.exports=function(r={}){if(bc.call(this,r),!r.transport||typeof r.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=r.transport,this.level=this.level||r.transport.level,this.handleExceptions=this.handleExceptions||r.transport.handleExceptions,this._deprecated();function t(n){this.emit("error",n,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=t.bind(this),this.transport.on("error",this.transport.__winstonError))};qb.inherits(Rt,bc);Rt.prototype._write=function(r,t,n){if(this.silent||r.exception===!0&&!this.handleExceptions)return n(null);(!this.level||this.levels[this.level]>=this.levels[r[uo]])&&this.transport.log(r[uo],r.message,r,this._nop),n(null)};Rt.prototype._writev=function(r,t){for(let n=0;n<r.length;n++)this._accept(r[n])&&(this.transport.log(r[n].chunk[uo],r[n].chunk.message,r[n].chunk,this._nop),r[n].callback());return t(null)};Rt.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
|
|
51
|
+
`))};Rt.prototype.close=function(){this.transport.close&&this.transport.close(),this.transport.__winstonError&&(this.transport.removeListener("error",this.transport.__winstonError),this.transport.__winstonError=null)}});var ot=m((CS,co)=>{"use strict";co.exports=so();co.exports.LegacyTransportStream=lo()});var Sc=m((qS,Ec)=>{"use strict";var $b=require("os"),{LEVEL:wc,MESSAGE:st}=ae(),Ub=ot();Ec.exports=class extends Ub{constructor(r={}){super(r),this.name=r.name||"console",this.stderrLevels=this._stringArrayToSet(r.stderrLevels),this.consoleWarnLevels=this._stringArrayToSet(r.consoleWarnLevels),this.eol=typeof r.eol=="string"?r.eol:$b.EOL,this.forceConsole=r.forceConsole||!1,this._consoleLog=console.log.bind(console),this._consoleWarn=console.warn.bind(console),this._consoleError=console.error.bind(console),this.setMaxListeners(30)}log(r,t){if(setImmediate(()=>this.emit("logged",r)),this.stderrLevels[r[wc]]){console._stderr&&!this.forceConsole?console._stderr.write(`${r[st]}${this.eol}`):this._consoleError(r[st]),t&&t();return}else if(this.consoleWarnLevels[r[wc]]){console._stderr&&!this.forceConsole?console._stderr.write(`${r[st]}${this.eol}`):this._consoleWarn(r[st]),t&&t();return}console._stdout&&!this.forceConsole?console._stdout.write(`${r[st]}${this.eol}`):this._consoleLog(r[st]),t&&t()}_stringArrayToSet(r,t){if(!r)return{};if(t=t||"Cannot make set from type other than Array of string elements",!Array.isArray(r))throw new Error(t);return r.reduce((n,i)=>{if(typeof i!="string")throw new Error(t);return n[i]=!0,n},{})}}});var Bn=m((zn,Oc)=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.default=jb;function jb(e){return e&&typeof e.length=="number"&&e.length>=0&&e.length%1===0}Oc.exports=zn.default});var Ac=m((Hn,Pc)=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.default=function(e){return function(...r){var t=r.pop();return e.call(this,r,t)}};Pc.exports=Hn.default});var xc=m(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.fallback=Tc;hr.wrap=Nc;var Fb=hr.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,kb=hr.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,zb=hr.hasNextTick=typeof process=="object"&&typeof process.nextTick=="function";function Tc(e){setTimeout(e,0)}function Nc(e){return(r,...t)=>e(()=>r(...t))}var It;Fb?It=queueMicrotask:kb?It=setImmediate:zb?It=process.nextTick:It=Tc;hr.default=Nc(It)});var Cc=m((Gn,Dc)=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.default=Vb;var Bb=Ac(),Hb=Ic(Bb),Gb=xc(),Wb=Ic(Gb),Yb=Dr();function Ic(e){return e&&e.__esModule?e:{default:e}}function Vb(e){return(0,Yb.isAsync)(e)?function(...r){let t=r.pop(),n=e.apply(this,r);return Mc(n,t)}:(0,Hb.default)(function(r,t){var n;try{n=e.apply(this,r)}catch(i){return t(i)}if(n&&typeof n.then=="function")return Mc(n,t);t(null,n)})}function Mc(e,r){return e.then(t=>{Rc(r,null,t)},t=>{Rc(r,t&&(t instanceof Error||t.message)?t:new Error(t))})}function Rc(e,r,t){try{e(r,t)}catch(n){(0,Wb.default)(i=>{throw i},n)}}Dc.exports=Gn.default});var Dr=m(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.isAsyncIterable=Ve.isAsyncGenerator=Ve.isAsync=void 0;var Kb=Cc(),Jb=Zb(Kb);function Zb(e){return e&&e.__esModule?e:{default:e}}function Lc(e){return e[Symbol.toStringTag]==="AsyncFunction"}function Xb(e){return e[Symbol.toStringTag]==="AsyncGenerator"}function Qb(e){return typeof e[Symbol.asyncIterator]=="function"}function e_(e){if(typeof e!="function")throw new Error("expected a function");return Lc(e)?(0,Jb.default)(e):e}Ve.default=e_;Ve.isAsync=Lc;Ve.isAsyncGenerator=Xb;Ve.isAsyncIterable=Qb});var ut=m((Wn,qc)=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.default=r_;function r_(e,r){if(r||(r=e.length),!r)throw new Error("arity is undefined");function t(...n){return typeof n[r-1]=="function"?e.apply(this,n):new Promise((i,a)=>{n[r-1]=(s,...u)=>{if(s)return a(s);i(u.length>1?u:u[0])},e.apply(this,n)})}return t}qc.exports=Wn.default});var Uc=m((Yn,$c)=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});var t_=Bn(),n_=fo(t_),i_=Dr(),a_=fo(i_),o_=ut(),s_=fo(o_);function fo(e){return e&&e.__esModule?e:{default:e}}Yn.default=(0,s_.default)((e,r,t)=>{var n=(0,n_.default)(r)?[]:{};e(r,(i,a,s)=>{(0,a_.default)(i)((u,...d)=>{d.length<2&&([d]=d),n[a]=d,s(u)})},i=>t(i,n))},3);$c.exports=Yn.default});var po=m((Vn,jc)=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.default=u_;function u_(e){function r(...t){if(e!==null){var n=e;e=null,n.apply(this,t)}}return Object.assign(r,e),r}jc.exports=Vn.default});var kc=m((Kn,Fc)=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()};Fc.exports=Kn.default});var Hc=m((Jn,Bc)=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.default=m_;var l_=Bn(),c_=zc(l_),f_=kc(),d_=zc(f_);function zc(e){return e&&e.__esModule?e:{default:e}}function p_(e){var r=-1,t=e.length;return function(){return++r<t?{value:e[r],key:r}:null}}function h_(e){var r=-1;return function(){var n=e.next();return n.done?null:(r++,{value:n.value,key:r})}}function g_(e){var r=e?Object.keys(e):[],t=-1,n=r.length;return function i(){var a=r[++t];return a==="__proto__"?i():t<n?{value:e[a],key:a}:null}}function m_(e){if((0,c_.default)(e))return p_(e);var r=(0,d_.default)(e);return r?h_(r):g_(e)}Bc.exports=Jn.default});var ho=m((Zn,Gc)=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.default=y_;function y_(e){return function(...r){if(e===null)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,r)}}Gc.exports=Zn.default});var Qn=m((Xn,Wc)=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});var v_={};Xn.default=v_;Wc.exports=Xn.default});var Vc=m((ei,Yc)=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.default=E_;var b_=Qn(),__=w_(b_);function w_(e){return e&&e.__esModule?e:{default:e}}function E_(e,r,t,n){let i=!1,a=!1,s=!1,u=0,d=0;function h(){u>=r||s||i||(s=!0,e.next().then(({value:_,done:S})=>{if(!(a||i)){if(s=!1,S){i=!0,u<=0&&n(null);return}u++,t(_,d,y),d++,h()}}).catch(b))}function y(_,S){if(u-=1,!a){if(_)return b(_);if(_===!1){i=!0,a=!0;return}if(S===__.default||i&&u<=0)return i=!0,n(null);h()}}function b(_){a||(s=!1,i=!0,n(_))}h()}Yc.exports=ei.default});var Xc=m((ri,Zc)=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});var S_=po(),O_=Dt(S_),P_=Hc(),A_=Dt(P_),T_=ho(),N_=Dt(T_),Kc=Dr(),x_=Vc(),Jc=Dt(x_),M_=Qn(),R_=Dt(M_);function Dt(e){return e&&e.__esModule?e:{default:e}}ri.default=e=>(r,t,n)=>{if(n=(0,O_.default)(n),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!r)return n(null);if((0,Kc.isAsyncGenerator)(r))return(0,Jc.default)(r,e,t,n);if((0,Kc.isAsyncIterable)(r))return(0,Jc.default)(r[Symbol.asyncIterator](),e,t,n);var i=(0,A_.default)(r),a=!1,s=!1,u=0,d=!1;function h(b,_){if(!s)if(u-=1,b)a=!0,n(b);else if(b===!1)a=!0,s=!0;else{if(_===R_.default||a&&u<=0)return a=!0,n(null);d||y()}}function y(){for(d=!0;u<e&&!a;){var b=i();if(b===null){a=!0,u<=0&&n(null);return}u+=1,t(b.value,b.key,(0,N_.default)(h))}d=!1}y()};Zc.exports=ri.default});var mo=m((ti,Qc)=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});var I_=Xc(),D_=go(I_),C_=Dr(),L_=go(C_),q_=ut(),$_=go(q_);function go(e){return e&&e.__esModule?e:{default:e}}function U_(e,r,t,n){return(0,D_.default)(r)(e,(0,L_.default)(t),n)}ti.default=(0,$_.default)(U_,4);Qc.exports=ti.default});var tf=m((ni,rf)=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});var j_=mo(),F_=ef(j_),k_=ut(),z_=ef(k_);function ef(e){return e&&e.__esModule?e:{default:e}}function B_(e,r,t){return(0,F_.default)(e,1,r,t)}ni.default=(0,z_.default)(B_,3);rf.exports=ni.default});var of=m((ii,af)=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.default=V_;var H_=Uc(),G_=nf(H_),W_=tf(),Y_=nf(W_);function nf(e){return e&&e.__esModule?e:{default:e}}function V_(e,r){return(0,G_.default)(Y_.default,e,r)}af.exports=ii.default});var yo=m((jS,uf)=>{"use strict";uf.exports=Ke;var ai=lr().codes,K_=ai.ERR_METHOD_NOT_IMPLEMENTED,J_=ai.ERR_MULTIPLE_CALLBACK,Z_=ai.ERR_TRANSFORM_ALREADY_TRANSFORMING,X_=ai.ERR_TRANSFORM_WITH_LENGTH_0,oi=Ir();rt()(Ke,oi);function Q_(e,r){var t=this._transformState;t.transforming=!1;var n=t.writecb;if(n===null)return this.emit("error",new J_);t.writechunk=null,t.writecb=null,r!=null&&this.push(r),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Ke(e){if(!(this instanceof Ke))return new Ke(e);oi.call(this,e),this._transformState={afterTransform:Q_.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",e0)}function e0(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(r,t){sf(e,r,t)}):sf(this,null,null)}Ke.prototype.push=function(e,r){return this._transformState.needTransform=!1,oi.prototype.push.call(this,e,r)};Ke.prototype._transform=function(e,r,t){t(new K_("_transform()"))};Ke.prototype._write=function(e,r,t){var n=this._transformState;if(n.writecb=t,n.writechunk=e,n.writeencoding=r,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Ke.prototype._read=function(e){var r=this._transformState;r.writechunk!==null&&!r.transforming?(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform)):r.needTransform=!0};Ke.prototype._destroy=function(e,r){oi.prototype._destroy.call(this,e,function(t){r(t)})};function sf(e,r,t){if(r)return e.emit("error",r);if(t!=null&&e.push(t),e._writableState.length)throw new X_;if(e._transformState.transforming)throw new Z_;return e.push(null)}});var ff=m((FS,cf)=>{"use strict";cf.exports=Ct;var lf=yo();rt()(Ct,lf);function Ct(e){if(!(this instanceof Ct))return new Ct(e);lf.call(this,e)}Ct.prototype._transform=function(e,r,t){t(null,e)}});var mf=m((kS,gf)=>{"use strict";var vo;function r0(e){var r=!1;return function(){r||(r=!0,e.apply(void 0,arguments))}}var hf=lr().codes,t0=hf.ERR_MISSING_ARGS,n0=hf.ERR_STREAM_DESTROYED;function df(e){if(e)throw e}function i0(e){return e.setHeader&&typeof e.abort=="function"}function a0(e,r,t,n){n=r0(n);var i=!1;e.on("close",function(){i=!0}),vo===void 0&&(vo=Rn()),vo(e,{readable:r,writable:t},function(s){if(s)return n(s);i=!0,n()});var a=!1;return function(s){if(!i&&!a){if(a=!0,i0(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(s||new n0("pipe"))}}}function pf(e){e()}function o0(e,r){return e.pipe(r)}function s0(e){return!e.length||typeof e[e.length-1]!="function"?df:e.pop()}function u0(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];var n=s0(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new t0("streams");var i,a=r.map(function(s,u){var d=u<r.length-1,h=u>0;return a0(s,d,h,function(y){i||(i=y),y&&a.forEach(pf),!d&&(a.forEach(pf),n(i))})});return r.reduce(o0)}gf.exports=u0});var Cr=m((Me,qt)=>{var Lt=require("stream");process.env.READABLE_STREAM==="disable"&&Lt?(qt.exports=Lt.Readable,Object.assign(qt.exports,Lt),qt.exports.Stream=Lt):(Me=qt.exports=to(),Me.Stream=Lt||Me,Me.Readable=Me,Me.Writable=jn(),Me.Duplex=Ir(),Me.Transform=yo(),Me.PassThrough=ff(),Me.finished=Rn(),Me.pipeline=mf())});var Po=m((zS,vf)=>{var lt=[],$t=[],bo=function(){};function wo(e){return~lt.indexOf(e)?!1:(lt.push(e),!0)}function Eo(e){bo=e}function l0(e){for(var r=[],t=0;t<lt.length;t++){if(lt[t].async){r.push(lt[t]);continue}if(lt[t](e))return!0}return r.length?new Promise(function(i){Promise.all(r.map(function(s){return s(e)})).then(function(s){i(s.some(Boolean))})}):!1}function So(e){return~$t.indexOf(e)?!1:($t.push(e),!0)}function _o(){bo.apply(bo,arguments)}function yf(e){for(var r=0;r<$t.length;r++)e=$t[r].apply($t[r],arguments);return e}function Oo(e,r){var t=Object.prototype.hasOwnProperty;for(var n in r)t.call(r,n)&&(e[n]=r[n]);return e}function c0(e){return e.enabled=!1,e.modify=So,e.set=Eo,e.use=wo,Oo(function(){return!1},e)}function f0(e){function r(){var t=Array.prototype.slice.call(arguments,0);return _o.call(_o,e,yf(t,e)),!0}return e.enabled=!0,e.modify=So,e.set=Eo,e.use=wo,Oo(r,e)}vf.exports=function(r){return r.introduce=Oo,r.enabled=l0,r.process=yf,r.modify=So,r.write=_o,r.nope=c0,r.yep=f0,r.set=Eo,r.use=wo,r}});var _f=m((BS,bf)=>{var d0=Po(),p0=d0(function e(r,t){return t=t||{},t.namespace=r,t.prod=!0,t.dev=!1,t.force||e.force?e.yep(t):e.nope(t)});bf.exports=p0});var Ef=m((HS,wf)=>{"use strict";wf.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Of=m((GS,Sf)=>{Sf.exports=function(r){return!r||typeof r=="string"?!1:r instanceof Array||Array.isArray(r)||r.length>=0&&(r.splice instanceof Function||Object.getOwnPropertyDescriptor(r,r.length-1)&&r.constructor.name!=="String")}});var Tf=m((WS,Af)=>{"use strict";var h0=Of(),g0=Array.prototype.concat,m0=Array.prototype.slice,Pf=Af.exports=function(r){for(var t=[],n=0,i=r.length;n<i;n++){var a=r[n];h0(a)?t=g0.call(t,m0.call(a)):t.push(a)}return t};Pf.wrap=function(e){return function(){return e(Pf(arguments))}}});var Rf=m((YS,Mf)=>{var Ut=Ef(),jt=Tf(),Nf=Object.hasOwnProperty,xf=Object.create(null);for(si in Ut)Nf.call(Ut,si)&&(xf[Ut[si]]=si);var si,Oe=Mf.exports={to:{},get:{}};Oe.get=function(e){var r=e.substring(0,3).toLowerCase(),t,n;switch(r){case"hsl":t=Oe.get.hsl(e),n="hsl";break;case"hwb":t=Oe.get.hwb(e),n="hwb";break;default:t=Oe.get.rgb(e),n="rgb";break}return t?{model:n,value:t}:null};Oe.get.rgb=function(e){if(!e)return null;var r=/^#([a-f0-9]{3,4})$/i,t=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,n=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,a=/^(\w+)$/,s=[0,0,0,1],u,d,h;if(u=e.match(t)){for(h=u[2],u=u[1],d=0;d<3;d++){var y=d*2;s[d]=parseInt(u.slice(y,y+2),16)}h&&(s[3]=parseInt(h,16)/255)}else if(u=e.match(r)){for(u=u[1],h=u[3],d=0;d<3;d++)s[d]=parseInt(u[d]+u[d],16);h&&(s[3]=parseInt(h+h,16)/255)}else if(u=e.match(n)){for(d=0;d<3;d++)s[d]=parseInt(u[d+1],0);u[4]&&(u[5]?s[3]=parseFloat(u[4])*.01:s[3]=parseFloat(u[4]))}else if(u=e.match(i)){for(d=0;d<3;d++)s[d]=Math.round(parseFloat(u[d+1])*2.55);u[4]&&(u[5]?s[3]=parseFloat(u[4])*.01:s[3]=parseFloat(u[4]))}else return(u=e.match(a))?u[1]==="transparent"?[0,0,0,0]:Nf.call(Ut,u[1])?(s=Ut[u[1]],s[3]=1,s):null:null;for(d=0;d<3;d++)s[d]=gr(s[d],0,255);return s[3]=gr(s[3],0,1),s};Oe.get.hsl=function(e){if(!e)return null;var r=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(r);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=gr(parseFloat(t[2]),0,100),s=gr(parseFloat(t[3]),0,100),u=gr(isNaN(n)?1:n,0,1);return[i,a,s,u]}return null};Oe.get.hwb=function(e){if(!e)return null;var r=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,t=e.match(r);if(t){var n=parseFloat(t[4]),i=(parseFloat(t[1])%360+360)%360,a=gr(parseFloat(t[2]),0,100),s=gr(parseFloat(t[3]),0,100),u=gr(isNaN(n)?1:n,0,1);return[i,a,s,u]}return null};Oe.to.hex=function(){var e=jt(arguments);return"#"+ui(e[0])+ui(e[1])+ui(e[2])+(e[3]<1?ui(Math.round(e[3]*255)):"")};Oe.to.rgb=function(){var e=jt(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};Oe.to.rgb.percent=function(){var e=jt(arguments),r=Math.round(e[0]/255*100),t=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+r+"%, "+t+"%, "+n+"%)":"rgba("+r+"%, "+t+"%, "+n+"%, "+e[3]+")"};Oe.to.hsl=function(){var e=jt(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};Oe.to.hwb=function(){var e=jt(arguments),r="";return e.length>=4&&e[3]!==1&&(r=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+r+")"};Oe.to.keyword=function(e){return xf[e.slice(0,3)]};function gr(e,r,t){return Math.min(Math.max(r,e),t)}function ui(e){var r=Math.round(e).toString(16).toUpperCase();return r.length<2?"0"+r:r}});var Df=m((VS,If)=>{"use strict";If.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Ao=m((KS,$f)=>{var Lr=Df(),qf={};for(li in Lr)Lr.hasOwnProperty(li)&&(qf[Lr[li]]=li);var li,I=$f.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(be in I)if(I.hasOwnProperty(be)){if(!("channels"in I[be]))throw new Error("missing channels property: "+be);if(!("labels"in I[be]))throw new Error("missing channel labels property: "+be);if(I[be].labels.length!==I[be].channels)throw new Error("channel and label counts mismatch: "+be);Cf=I[be].channels,Lf=I[be].labels,delete I[be].channels,delete I[be].labels,Object.defineProperty(I[be],"channels",{value:Cf}),Object.defineProperty(I[be],"labels",{value:Lf})}var Cf,Lf,be;I.rgb.hsl=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,i=Math.min(r,t,n),a=Math.max(r,t,n),s=a-i,u,d,h;return a===i?u=0:r===a?u=(t-n)/s:t===a?u=2+(n-r)/s:n===a&&(u=4+(r-t)/s),u=Math.min(u*60,360),u<0&&(u+=360),h=(i+a)/2,a===i?d=0:h<=.5?d=s/(a+i):d=s/(2-a-i),[u,d*100,h*100]};I.rgb.hsv=function(e){var r,t,n,i,a,s=e[0]/255,u=e[1]/255,d=e[2]/255,h=Math.max(s,u,d),y=h-Math.min(s,u,d),b=function(_){return(h-_)/6/y+1/2};return y===0?i=a=0:(a=y/h,r=b(s),t=b(u),n=b(d),s===h?i=n-t:u===h?i=1/3+r-n:d===h&&(i=2/3+t-r),i<0?i+=1:i>1&&(i-=1)),[i*360,a*100,h*100]};I.rgb.hwb=function(e){var r=e[0],t=e[1],n=e[2],i=I.rgb.hsl(e)[0],a=1/255*Math.min(r,Math.min(t,n));return n=1-1/255*Math.max(r,Math.max(t,n)),[i,a*100,n*100]};I.rgb.cmyk=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,i,a,s,u;return u=Math.min(1-r,1-t,1-n),i=(1-r-u)/(1-u)||0,a=(1-t-u)/(1-u)||0,s=(1-n-u)/(1-u)||0,[i*100,a*100,s*100,u*100]};function y0(e,r){return Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2)+Math.pow(e[2]-r[2],2)}I.rgb.keyword=function(e){var r=qf[e];if(r)return r;var t=1/0,n;for(var i in Lr)if(Lr.hasOwnProperty(i)){var a=Lr[i],s=y0(e,a);s<t&&(t=s,n=i)}return n};I.keyword.rgb=function(e){return Lr[e]};I.rgb.xyz=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var i=r*.4124+t*.3576+n*.1805,a=r*.2126+t*.7152+n*.0722,s=r*.0193+t*.1192+n*.9505;return[i*100,a*100,s*100]};I.rgb.lab=function(e){var r=I.rgb.xyz(e),t=r[0],n=r[1],i=r[2],a,s,u;return t/=95.047,n/=100,i/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,a=116*n-16,s=500*(t-n),u=200*(n-i),[a,s,u]};I.hsl.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100,i,a,s,u,d;if(t===0)return d=n*255,[d,d,d];n<.5?a=n*(1+t):a=n+t-n*t,i=2*n-a,u=[0,0,0];for(var h=0;h<3;h++)s=r+1/3*-(h-1),s<0&&s++,s>1&&s--,6*s<1?d=i+(a-i)*6*s:2*s<1?d=a:3*s<2?d=i+(a-i)*(2/3-s)*6:d=i,u[h]=d*255;return u};I.hsl.hsv=function(e){var r=e[0],t=e[1]/100,n=e[2]/100,i=t,a=Math.max(n,.01),s,u;return n*=2,t*=n<=1?n:2-n,i*=a<=1?a:2-a,u=(n+t)/2,s=n===0?2*i/(a+i):2*t/(n+t),[r,s*100,u*100]};I.hsv.rgb=function(e){var r=e[0]/60,t=e[1]/100,n=e[2]/100,i=Math.floor(r)%6,a=r-Math.floor(r),s=255*n*(1-t),u=255*n*(1-t*a),d=255*n*(1-t*(1-a));switch(n*=255,i){case 0:return[n,d,s];case 1:return[u,n,s];case 2:return[s,n,d];case 3:return[s,u,n];case 4:return[d,s,n];case 5:return[n,s,u]}};I.hsv.hsl=function(e){var r=e[0],t=e[1]/100,n=e[2]/100,i=Math.max(n,.01),a,s,u;return u=(2-t)*n,a=(2-t)*i,s=t*i,s/=a<=1?a:2-a,s=s||0,u/=2,[r,s*100,u*100]};I.hwb.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100,i=t+n,a,s,u,d;i>1&&(t/=i,n/=i),a=Math.floor(6*r),s=1-n,u=6*r-a,(a&1)!==0&&(u=1-u),d=t+u*(s-t);var h,y,b;switch(a){default:case 6:case 0:h=s,y=d,b=t;break;case 1:h=d,y=s,b=t;break;case 2:h=t,y=s,b=d;break;case 3:h=t,y=d,b=s;break;case 4:h=d,y=t,b=s;break;case 5:h=s,y=t,b=d;break}return[h*255,y*255,b*255]};I.cmyk.rgb=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,i=e[3]/100,a,s,u;return a=1-Math.min(1,r*(1-i)+i),s=1-Math.min(1,t*(1-i)+i),u=1-Math.min(1,n*(1-i)+i),[a*255,s*255,u*255]};I.xyz.rgb=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,i,a,s;return i=r*3.2406+t*-1.5372+n*-.4986,a=r*-.9689+t*1.8758+n*.0415,s=r*.0557+t*-.204+n*1.057,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),s=Math.min(Math.max(0,s),1),[i*255,a*255,s*255]};I.xyz.lab=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;return r/=95.047,t/=100,n/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,i=116*t-16,a=500*(r-t),s=200*(t-n),[i,a,s]};I.lab.xyz=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;a=(r+16)/116,i=t/500+a,s=a-n/200;var u=Math.pow(a,3),d=Math.pow(i,3),h=Math.pow(s,3);return a=u>.008856?u:(a-16/116)/7.787,i=d>.008856?d:(i-16/116)/7.787,s=h>.008856?h:(s-16/116)/7.787,i*=95.047,a*=100,s*=108.883,[i,a,s]};I.lab.lch=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;return i=Math.atan2(n,t),a=i*360/2/Math.PI,a<0&&(a+=360),s=Math.sqrt(t*t+n*n),[r,s,a]};I.lch.lab=function(e){var r=e[0],t=e[1],n=e[2],i,a,s;return s=n/360*2*Math.PI,i=t*Math.cos(s),a=t*Math.sin(s),[r,i,a]};I.rgb.ansi16=function(e){var r=e[0],t=e[1],n=e[2],i=1 in arguments?arguments[1]:I.rgb.hsv(e)[2];if(i=Math.round(i/50),i===0)return 30;var a=30+(Math.round(n/255)<<2|Math.round(t/255)<<1|Math.round(r/255));return i===2&&(a+=60),a};I.hsv.ansi16=function(e){return I.rgb.ansi16(I.hsv.rgb(e),e[2])};I.rgb.ansi256=function(e){var r=e[0],t=e[1],n=e[2];if(r===t&&t===n)return r<8?16:r>248?231:Math.round((r-8)/247*24)+232;var i=16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5);return i};I.ansi16.rgb=function(e){var r=e%10;if(r===0||r===7)return e>50&&(r+=3.5),r=r/10.5*255,[r,r,r];var t=(~~(e>50)+1)*.5,n=(r&1)*t*255,i=(r>>1&1)*t*255,a=(r>>2&1)*t*255;return[n,i,a]};I.ansi256.rgb=function(e){if(e>=232){var r=(e-232)*10+8;return[r,r,r]}e-=16;var t,n=Math.floor(e/36)/5*255,i=Math.floor((t=e%36)/6)/5*255,a=t%6/5*255;return[n,i,a]};I.rgb.hex=function(e){var r=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255),t=r.toString(16).toUpperCase();return"000000".substring(t.length)+t};I.hex.rgb=function(e){var r=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!r)return[0,0,0];var t=r[0];r[0].length===3&&(t=t.split("").map(function(u){return u+u}).join(""));var n=parseInt(t,16),i=n>>16&255,a=n>>8&255,s=n&255;return[i,a,s]};I.rgb.hcg=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,i=Math.max(Math.max(r,t),n),a=Math.min(Math.min(r,t),n),s=i-a,u,d;return s<1?u=a/(1-s):u=0,s<=0?d=0:i===r?d=(t-n)/s%6:i===t?d=2+(n-r)/s:d=4+(r-t)/s+4,d/=6,d%=1,[d*360,s*100,u*100]};I.hsl.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=1,i=0;return t<.5?n=2*r*t:n=2*r*(1-t),n<1&&(i=(t-.5*n)/(1-n)),[e[0],n*100,i*100]};I.hsv.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=r*t,i=0;return n<1&&(i=(t-n)/(1-n)),[e[0],n*100,i*100]};I.hcg.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100;if(t===0)return[n*255,n*255,n*255];var i=[0,0,0],a=r%1*6,s=a%1,u=1-s,d=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=u,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=u,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=u}return d=(1-t)*n,[(t*i[0]+d)*255,(t*i[1]+d)*255,(t*i[2]+d)*255]};I.hcg.hsv=function(e){var r=e[1]/100,t=e[2]/100,n=r+t*(1-r),i=0;return n>0&&(i=r/n),[e[0],i*100,n*100]};I.hcg.hsl=function(e){var r=e[1]/100,t=e[2]/100,n=t*(1-r)+.5*r,i=0;return n>0&&n<.5?i=r/(2*n):n>=.5&&n<1&&(i=r/(2*(1-n))),[e[0],i*100,n*100]};I.hcg.hwb=function(e){var r=e[1]/100,t=e[2]/100,n=r+t*(1-r);return[e[0],(n-r)*100,(1-n)*100]};I.hwb.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=1-t,i=n-r,a=0;return i<1&&(a=(n-i)/(1-i)),[e[0],i*100,a*100]};I.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};I.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};I.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};I.gray.hsl=I.gray.hsv=function(e){return[0,0,e[0]]};I.gray.hwb=function(e){return[0,100,e[0]]};I.gray.cmyk=function(e){return[0,0,0,e[0]]};I.gray.lab=function(e){return[e[0],0,0]};I.gray.hex=function(e){var r=Math.round(e[0]/100*255)&255,t=(r<<16)+(r<<8)+r,n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};I.rgb.gray=function(e){var r=(e[0]+e[1]+e[2])/3;return[r/255*100]}});var jf=m((JS,Uf)=>{var ci=Ao();function v0(){for(var e={},r=Object.keys(ci),t=r.length,n=0;n<t;n++)e[r[n]]={distance:-1,parent:null};return e}function b0(e){var r=v0(),t=[e];for(r[e].distance=0;t.length;)for(var n=t.pop(),i=Object.keys(ci[n]),a=i.length,s=0;s<a;s++){var u=i[s],d=r[u];d.distance===-1&&(d.distance=r[n].distance+1,d.parent=n,t.unshift(u))}return r}function _0(e,r){return function(t){return r(e(t))}}function w0(e,r){for(var t=[r[e].parent,e],n=ci[r[e].parent][e],i=r[e].parent;r[i].parent;)t.unshift(r[i].parent),n=_0(ci[r[i].parent][i],n),i=r[i].parent;return n.conversion=t,n}Uf.exports=function(e){for(var r=b0(e),t={},n=Object.keys(r),i=n.length,a=0;a<i;a++){var s=n[a],u=r[s];u.parent!==null&&(t[s]=w0(s,r))}return t}});var kf=m((ZS,Ff)=>{var To=Ao(),E0=jf(),ct={},S0=Object.keys(To);function O0(e){var r=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(r.conversion=e.conversion),r}function P0(e){var r=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if(typeof n=="object")for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in e&&(r.conversion=e.conversion),r}S0.forEach(function(e){ct[e]={},Object.defineProperty(ct[e],"channels",{value:To[e].channels}),Object.defineProperty(ct[e],"labels",{value:To[e].labels});var r=E0(e),t=Object.keys(r);t.forEach(function(n){var i=r[n];ct[e][n]=P0(i),ct[e][n].raw=O0(i)})});Ff.exports=ct});var Hf=m((XS,Bf)=>{"use strict";var Ft=Rf(),Pe=kf(),Mo=[].slice,zf=["keyword","gray","hex"],No={};Object.keys(Pe).forEach(function(e){No[Mo.call(Pe[e].labels).sort().join("")]=e});var fi={};function ge(e,r){if(!(this instanceof ge))return new ge(e,r);if(r&&r in zf&&(r=null),r&&!(r in Pe))throw new Error("Unknown model: "+r);var t,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof ge)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if(typeof e=="string"){var i=Ft.get(e);if(i===null)throw new Error("Unable to parse color from string: "+e);this.model=i.model,n=Pe[this.model].channels,this.color=i.value.slice(0,n),this.valpha=typeof i.value[n]=="number"?i.value[n]:1}else if(e.length){this.model=r||"rgb",n=Pe[this.model].channels;var a=Mo.call(e,0,n);this.color=xo(a,n),this.valpha=typeof e[n]=="number"?e[n]:1}else if(typeof e=="number")e&=16777215,this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;var s=Object.keys(e);"alpha"in e&&(s.splice(s.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);var u=s.sort().join("");if(!(u in No))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=No[u];var d=Pe[this.model].labels,h=[];for(t=0;t<d.length;t++)h.push(e[d[t]]);this.color=xo(h)}if(fi[this.model])for(n=Pe[this.model].channels,t=0;t<n;t++){var y=fi[this.model][t];y&&(this.color[t]=y(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}ge.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(e){var r=this.model in Ft.to?this:this.rgb();r=r.round(typeof e=="number"?e:1);var t=r.valpha===1?r.color:r.color.concat(this.valpha);return Ft.to[r.model](t)},percentString:function(e){var r=this.rgb().round(typeof e=="number"?e:1),t=r.valpha===1?r.color:r.color.concat(this.valpha);return Ft.to.rgb.percent(t)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var e={},r=Pe[this.model].channels,t=Pe[this.model].labels,n=0;n<r;n++)e[t[n]]=this.color[n];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray:function(){var e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject:function(){var e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round:function(e){return e=Math.max(e||0,0),new ge(this.color.map(T0(e)).concat(this.valpha),this.model)},alpha:function(e){return arguments.length?new ge(this.color.concat(Math.max(0,Math.min(1,e))),this.model):this.valpha},red:re("rgb",0,se(255)),green:re("rgb",1,se(255)),blue:re("rgb",2,se(255)),hue:re(["hsl","hsv","hsl","hwb","hcg"],0,function(e){return(e%360+360)%360}),saturationl:re("hsl",1,se(100)),lightness:re("hsl",2,se(100)),saturationv:re("hsv",1,se(100)),value:re("hsv",2,se(100)),chroma:re("hcg",1,se(100)),gray:re("hcg",2,se(100)),white:re("hwb",1,se(100)),wblack:re("hwb",2,se(100)),cyan:re("cmyk",0,se(100)),magenta:re("cmyk",1,se(100)),yellow:re("cmyk",2,se(100)),black:re("cmyk",3,se(100)),x:re("xyz",0,se(100)),y:re("xyz",1,se(100)),z:re("xyz",2,se(100)),l:re("lab",0,se(100)),a:re("lab",1),b:re("lab",2),keyword:function(e){return arguments.length?new ge(e):Pe[this.model].keyword(this.color)},hex:function(e){return arguments.length?new ge(e):Ft.to.hex(this.rgb().round().color)},rgbNumber:function(){var e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity:function(){for(var e=this.rgb().color,r=[],t=0;t<e.length;t++){var n=e[t]/255;r[t]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return .2126*r[0]+.7152*r[1]+.0722*r[2]},contrast:function(e){var r=this.luminosity(),t=e.luminosity();return r>t?(r+.05)/(t+.05):(t+.05)/(r+.05)},level:function(e){var r=this.contrast(e);return r>=7.1?"AAA":r>=4.5?"AA":""},isDark:function(){var e=this.rgb().color,r=(e[0]*299+e[1]*587+e[2]*114)/1e3;return r<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),r=0;r<3;r++)e.color[r]=255-e.color[r];return e},lighten:function(e){var r=this.hsl();return r.color[2]+=r.color[2]*e,r},darken:function(e){var r=this.hsl();return r.color[2]-=r.color[2]*e,r},saturate:function(e){var r=this.hsl();return r.color[1]+=r.color[1]*e,r},desaturate:function(e){var r=this.hsl();return r.color[1]-=r.color[1]*e,r},whiten:function(e){var r=this.hwb();return r.color[1]+=r.color[1]*e,r},blacken:function(e){var r=this.hwb();return r.color[2]+=r.color[2]*e,r},grayscale:function(){var e=this.rgb().color,r=e[0]*.3+e[1]*.59+e[2]*.11;return ge.rgb(r,r,r)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var r=this.hsl(),t=r.color[0];return t=(t+e)%360,t=t<0?360+t:t,r.color[0]=t,r},mix:function(e,r){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var t=e.rgb(),n=this.rgb(),i=r===void 0?.5:r,a=2*i-1,s=t.alpha()-n.alpha(),u=((a*s===-1?a:(a+s)/(1+a*s))+1)/2,d=1-u;return ge.rgb(u*t.red()+d*n.red(),u*t.green()+d*n.green(),u*t.blue()+d*n.blue(),t.alpha()*i+n.alpha()*(1-i))}};Object.keys(Pe).forEach(function(e){if(zf.indexOf(e)===-1){var r=Pe[e].channels;ge.prototype[e]=function(){if(this.model===e)return new ge(this);if(arguments.length)return new ge(arguments,e);var t=typeof arguments[r]=="number"?r:this.valpha;return new ge(N0(Pe[this.model][e].raw(this.color)).concat(t),e)},ge[e]=function(t){return typeof t=="number"&&(t=xo(Mo.call(arguments),r)),new ge(t,e)}}});function A0(e,r){return Number(e.toFixed(r))}function T0(e){return function(r){return A0(r,e)}}function re(e,r,t){return e=Array.isArray(e)?e:[e],e.forEach(function(n){(fi[n]||(fi[n]=[]))[r]=t}),e=e[0],function(n){var i;return arguments.length?(t&&(n=t(n)),i=this[e](),i.color[r]=n,i):(i=this[e]().color[r],t&&(i=t(i)),i)}}function se(e){return function(r){return Math.max(0,Math.min(e,r))}}function N0(e){return Array.isArray(e)?e:[e]}function xo(e,r){for(var t=0;t<r;t++)typeof e[t]!="number"&&(e[t]=0);return e}Bf.exports=ge});var Wf=m((QS,Gf)=>{"use strict";Gf.exports=function(r){for(var t=0,n=0;t<r.length;n=r.charCodeAt(t++)+((n<<5)-n));var i=Math.floor(Math.abs(Math.sin(n)*1e4%1*16777216)).toString(16);return"#"+Array(6-i.length+1).join("0")+i}});var Jf=m((eO,Kf)=>{"use strict";var Yf=Hf(),Vf=Wf();Kf.exports=function(r,t){var n=r.split(t||":"),i=Vf(n[0]);if(!n.length)return i;for(var a=0,s=n.length-1;a<s;a++)i=Yf(i).mix(Yf(Vf(n[a+1]))).saturate(1).hex();return i}});var Xf=m((rO,Zf)=>{"use strict";function Le(e,r){if(r)return new Le(e).style(r);if(!(this instanceof Le))return new Le(e);this.text=e}Le.prototype.prefix="\x1B[";Le.prototype.suffix="m";Le.prototype.hex=function(r){r=r[0]==="#"?r.substring(1):r,r.length===3&&(r=r.split(""),r[5]=r[2],r[4]=r[2],r[3]=r[1],r[2]=r[1],r[1]=r[0],r=r.join(""));var t=r.substring(0,2),n=r.substring(2,4),i=r.substring(4,6);return[parseInt(t,16),parseInt(n,16),parseInt(i,16)]};Le.prototype.rgb=function(r,t,n){var i=r/255*5,a=t/255*5,s=n/255*5;return this.ansi(i,a,s)};Le.prototype.ansi=function(r,t,n){var i=Math.round(r),a=Math.round(t),s=Math.round(n);return 16+i*36+a*6+s};Le.prototype.reset=function(){return this.prefix+"39;49"+this.suffix};Le.prototype.style=function(r){return this.prefix+"38;5;"+this.rgb.apply(this,this.hex(r))+this.suffix+this.text+this.reset()};Zf.exports=Le});var ed=m((tO,Qf)=>{var x0=Jf(),M0=Xf();Qf.exports=function(r,t){var n=t.namespace,i=t.colors!==!1?M0(n+":",x0(n)):n+":";return r[0]=i+" "+r[0],r}});var td=m((nO,rd)=>{"use strict";rd.exports=function(r,t){if(!t)return!1;for(var n=t.split(/[\s,]+/),i=0;i<n.length;i++){if(t=n[i].replace("*",".*?"),t.charAt(0)==="-"){if(new RegExp("^"+t.substr(1)+"$").test(r))return!1;continue}if(new RegExp("^"+t+"$").test(r))return!0}return!1}});var id=m((iO,nd)=>{var R0=td();nd.exports=function(r){return function(n){try{return R0(n,r())}catch{}return!1}}});var od=m((aO,ad)=>{var I0=id();ad.exports=I0(function(){return process.env.DEBUG||process.env.DIAGNOSTICS})});var ud=m((oO,sd)=>{sd.exports=function(e,r){try{Function.prototype.apply.call(console.log,console,r)}catch{}}});var cd=m((sO,ld)=>{var D0=Po(),C0=require("tty").isatty(1),di=D0(function e(r,t){return t=t||{},t.colors="colors"in t?t.colors:C0,t.namespace=r,t.prod=!1,t.dev=!0,!e.enabled(r)&&!(t.force||e.force)?e.nope(t):e.yep(t)});di.modify(ed());di.use(od());di.set(ud());ld.exports=di});var kt=m((uO,Ro)=>{process.env.NODE_ENV==="production"?Ro.exports=_f():Ro.exports=cd()});var dd=m((lO,fd)=>{"use strict";var Io=require("fs"),{StringDecoder:L0}=require("string_decoder"),{Stream:q0}=Cr();function $0(){}fd.exports=(e,r)=>{let t=Buffer.alloc(65536),n=new L0("utf8"),i=new q0,a="",s=0,u=0;return e.start===-1&&delete e.start,i.readable=!0,i.destroy=()=>{i.destroyed=!0,i.emit("end"),i.emit("close")},Io.open(e.file,"a+","0644",(d,h)=>{if(d){r?r(d):i.emit("error",d),i.destroy();return}(function y(){if(i.destroyed){Io.close(h,$0);return}return Io.read(h,t,0,t.length,s,(b,_)=>{if(b){r?r(b):i.emit("error",b),i.destroy();return}if(!_)return a&&((e.start==null||u>e.start)&&(r?r(null,a):i.emit("line",a)),u++,a=""),setTimeout(y,1e3);let S=n.write(t.slice(0,_));r||i.emit("data",S),S=(a+S).split(/\n+/);let g=S.length-1,w=0;for(;w<g;w++)(e.start==null||u>e.start)&&(r?r(null,S[w]):i.emit("line",S[w])),u++;return a=S[g],s+=_,y()})})()}),r?i.destroy:i}});var md=m((fO,gd)=>{"use strict";var Ee=require("fs"),le=require("path"),pd=of(),U0=require("zlib"),{MESSAGE:j0}=ae(),{Stream:F0,PassThrough:hd}=Cr(),k0=ot(),qe=kt()("winston:file"),z0=require("os"),B0=dd();gd.exports=class extends k0{constructor(r={}){super(r),this.name=r.name||"file";function t(n,...i){i.slice(1).forEach(a=>{if(r[a])throw new Error(`Cannot set ${a} and ${n} together`)})}if(this._stream=new hd,this._stream.setMaxListeners(30),this._onError=this._onError.bind(this),r.filename||r.dirname)t("filename or dirname","stream"),this._basename=this.filename=r.filename?le.basename(r.filename):"winston.log",this.dirname=r.dirname||le.dirname(r.filename),this.options=r.options||{flags:"a"};else if(r.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),t("stream","filename","maxsize"),this._dest=this._stream.pipe(this._setupStream(r.stream)),this.dirname=le.dirname(this._dest.path);else throw new Error("Cannot log to file without filename or stream.");this.maxsize=r.maxsize||null,this.rotationFormat=r.rotationFormat||!1,this.zippedArchive=r.zippedArchive||!1,this.maxFiles=r.maxFiles||null,this.eol=typeof r.eol=="string"?r.eol:z0.EOL,this.tailable=r.tailable||!1,this.lazy=r.lazy||!1,this._size=0,this._pendingSize=0,this._created=0,this._drain=!1,this._opening=!1,this._ending=!1,this._fileExist=!1,this.dirname&&this._createLogDirIfNotExist(this.dirname),this.lazy||this.open()}finishIfEnding(){this._ending&&(this._opening?this.once("open",()=>{this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())}):(this._stream.once("finish",()=>this.emit("finish")),setImmediate(()=>this._stream.end())))}log(r,t=()=>{}){if(this.silent)return t(),!0;if(this._drain){this._stream.once("drain",()=>{this._drain=!1,this.log(r,t)});return}if(this._rotate){this._stream.once("rotate",()=>{this._rotate=!1,this.log(r,t)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",()=>{this._fileExist=!0,this.log(r,t)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",()=>{this._opening||this.open(),this.once("open",()=>{this.log(r,t)})});return}}let n=`${r[j0]}${this.eol}`,i=Buffer.byteLength(n);function a(){if(this._size+=i,this._pendingSize-=i,qe("logged %s %s",this._size,n),this.emit("logged",r),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(()=>{this.emit("fileclosed")});return}this._rotate=!0,this._endStream(()=>this._rotateFile())}}this._pendingSize+=i,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);let s=this._stream.write(n,a.bind(this));return s?t():(this._drain=!0,this._stream.once("drain",()=>{this._drain=!1,t()})),qe("written",s,this._drain),this.finishIfEnding(),s}query(r,t){typeof r=="function"&&(t=r,r={}),r=b(r);let n=le.join(this.dirname,this.filename),i="",a=[],s=0,u=Ee.createReadStream(n,{encoding:"utf8"});u.on("error",_=>{if(u.readable&&u.destroy(),!!t)return _.code!=="ENOENT"?t(_):t(null,a)}),u.on("data",_=>{_=(i+_).split(/\n+/);let S=_.length-1,g=0;for(;g<S;g++)(!r.start||s>=r.start)&&d(_[g]),s++;i=_[S]}),u.on("close",()=>{i&&d(i,!0),r.order==="desc"&&(a=a.reverse()),t&&t(null,a)});function d(_,S){try{let g=JSON.parse(_);y(g)&&h(g)}catch(g){S||u.emit("error",g)}}function h(_){if(r.rows&&a.length>=r.rows&&r.order!=="desc"){u.readable&&u.destroy();return}r.fields&&(_=r.fields.reduce((S,g)=>(S[g]=_[g],S),{})),r.order==="desc"&&a.length>=r.rows&&a.shift(),a.push(_)}function y(_){if(!_||typeof _!="object")return;let S=new Date(_.timestamp);if(!(r.from&&S<r.from||r.until&&S>r.until||r.level&&r.level!==_.level))return!0}function b(_){return _=_||{},_.rows=_.rows||_.limit||10,_.start=_.start||0,_.until=_.until||new Date,typeof _.until!="object"&&(_.until=new Date(_.until)),_.from=_.from||_.until-1440*60*1e3,typeof _.from!="object"&&(_.from=new Date(_.from)),_.order=_.order||"desc",_}}stream(r={}){let t=le.join(this.dirname,this.filename),n=new F0,i={file:t,start:r.start};return n.destroy=B0(i,(a,s)=>{if(a)return n.emit("error",a);try{n.emit("data",s),s=JSON.parse(s),n.emit("log",s)}catch(u){n.emit("error",u)}}),n}open(){this.filename&&(this._opening||(this._opening=!0,this.stat((r,t)=>{if(r)return this.emit("error",r);qe("stat done: %s { size: %s }",this.filename,t),this._size=t,this._dest=this._createStream(this._stream),this._opening=!1,this.once("open",()=>{this._stream.emit("rotate")||(this._rotate=!1)})})))}stat(r){let t=this._getFile(),n=le.join(this.dirname,t);Ee.stat(n,(i,a)=>{if(i&&i.code==="ENOENT")return qe("ENOENT\xA0ok",n),this.filename=t,r(null,0);if(i)return qe(`err ${i.code} ${n}`),r(i);if(!a||this._needsNewFile(a.size))return this._incFile(()=>this.stat(r));this.filename=t,r(null,a.size)})}close(r){this._stream&&this._stream.end(()=>{r&&r(),this.emit("flush"),this.emit("closed")})}_needsNewFile(r){return r=r||this._size,this.maxsize&&r>=this.maxsize}_onError(r){this.emit("error",r)}_setupStream(r){return r.on("error",this._onError),r}_cleanupStream(r){return r.removeListener("error",this._onError),r.destroy(),r}_rotateFile(){this._incFile(()=>this.open())}_endStream(r=()=>{}){this._dest?(this._stream.unpipe(this._dest),this._dest.end(()=>{this._cleanupStream(this._dest),r()})):r()}_createStream(r){let t=le.join(this.dirname,this.filename);qe("create stream start",t,this.options);let n=Ee.createWriteStream(t,this.options).on("error",i=>qe(i)).on("close",()=>qe("close",n.path,n.bytesWritten)).on("open",()=>{qe("file open ok",t),this.emit("open",t),r.pipe(n),this.rotatedWhileOpening&&(this._stream=new hd,this._stream.setMaxListeners(30),this._rotateFile(),this.rotatedWhileOpening=!1,this._cleanupStream(n),r.end())});return qe("create stream ok",t),n}_incFile(r){qe("_incFile",this.filename);let t=le.extname(this._basename),n=le.basename(this._basename,t),i=[];this.zippedArchive&&i.push(function(a){let s=this._created>0&&!this.tailable?this._created:"";this._compressFile(le.join(this.dirname,`${n}${s}${t}`),le.join(this.dirname,`${n}${s}${t}.gz`),a)}.bind(this)),i.push(function(a){this.tailable?this._checkMaxFilesTailable(t,n,a):(this._created+=1,this._checkMaxFilesIncrementing(t,n,a))}.bind(this)),pd(i,r)}_getFile(){let r=le.extname(this._basename),t=le.basename(this._basename,r),n=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?`${t}${n}${r}`:`${t}${r}`}_checkMaxFilesIncrementing(r,t,n){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(n);let i=this._created-this.maxFiles,a=i!==0?i:"",s=this.zippedArchive?".gz":"",u=`${t}${a}${r}${s}`,d=le.join(this.dirname,u);Ee.unlink(d,n)}_checkMaxFilesTailable(r,t,n){let i=[];if(!this.maxFiles)return;let a=this.zippedArchive?".gz":"";for(let s=this.maxFiles-1;s>1;s--)i.push(function(u,d){let h=`${t}${u-1}${r}${a}`,y=le.join(this.dirname,h);Ee.exists(y,b=>{if(!b)return d(null);h=`${t}${u}${r}${a}`,Ee.rename(y,le.join(this.dirname,h),d)})}.bind(this,s));pd(i,()=>{Ee.rename(le.join(this.dirname,`${t}${r}${a}`),le.join(this.dirname,`${t}1${r}${a}`),n)})}_compressFile(r,t,n){Ee.access(r,Ee.F_OK,i=>{if(i)return n();var a=U0.createGzip(),s=Ee.createReadStream(r),u=Ee.createWriteStream(t);u.on("finish",()=>{Ee.unlink(r,n)}),s.pipe(a).pipe(u)})}_createLogDirIfNotExist(r){Ee.existsSync(r)||Ee.mkdirSync(r,{recursive:!0})}}});var vd=m((pO,yd)=>{"use strict";var H0=require("http"),G0=require("https"),{Stream:W0}=Cr(),Y0=ot(),{configure:V0}=Et();yd.exports=class extends Y0{constructor(r={}){super(r),this.options=r,this.name=r.name||"http",this.ssl=!!r.ssl,this.host=r.host||"localhost",this.port=r.port,this.auth=r.auth,this.path=r.path||"",this.maximumDepth=r.maximumDepth,this.agent=r.agent,this.headers=r.headers||{},this.headers["content-type"]="application/json",this.batch=r.batch||!1,this.batchInterval=r.batchInterval||5e3,this.batchCount=r.batchCount||10,this.batchOptions=[],this.batchTimeoutID=-1,this.batchCallback={},this.port||(this.port=this.ssl?443:80)}log(r,t){this._request(r,null,null,(n,i)=>{i&&i.statusCode!==200&&(n=new Error(`Invalid HTTP Status Code: ${i.statusCode}`)),n?this.emit("warn",n):this.emit("logged",r)}),t&&setImmediate(t)}query(r,t){typeof r=="function"&&(t=r,r={}),r={method:"query",params:this.normalizeQuery(r)};let n=r.params.auth||null;delete r.params.auth;let i=r.params.path||null;delete r.params.path,this._request(r,n,i,(a,s,u)=>{if(s&&s.statusCode!==200&&(a=new Error(`Invalid HTTP Status Code: ${s.statusCode}`)),a)return t(a);if(typeof u=="string")try{u=JSON.parse(u)}catch(d){return t(d)}t(null,u)})}stream(r={}){let t=new W0;r={method:"stream",params:r};let n=r.params.path||null;delete r.params.path;let i=r.params.auth||null;delete r.params.auth;let a="",s=this._request(r,i,n);return t.destroy=()=>s.destroy(),s.on("data",u=>{u=(a+u).split(/\n+/);let d=u.length-1,h=0;for(;h<d;h++)try{t.emit("log",JSON.parse(u[h]))}catch(y){t.emit("error",y)}a=u[d]}),s.on("error",u=>t.emit("error",u)),t}_request(r,t,n,i){r=r||{},t=t||this.auth,n=n||this.path||"",this.batch?this._doBatch(r,i,t,n):this._doRequest(r,i,t,n)}_doBatch(r,t,n,i){if(this.batchOptions.push(r),this.batchOptions.length===1){let a=this;this.batchCallback=t,this.batchTimeoutID=setTimeout(function(){a.batchTimeoutID=-1,a._doBatchRequest(a.batchCallback,n,i)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,n,i)}_doBatchRequest(r,t,n){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);let i=this.batchOptions.slice();this.batchOptions=[],this._doRequest(i,r,t,n)}_doRequest(r,t,n,i){let a=Object.assign({},this.headers);n&&n.bearer&&(a.Authorization=`Bearer ${n.bearer}`);let s=(this.ssl?G0:H0).request({...this.options,method:"POST",host:this.host,port:this.port,path:`/${i.replace(/^\//,"")}`,headers:a,auth:n&&n.username&&n.password?`${n.username}:${n.password}`:"",agent:this.agent});s.on("error",t),s.on("response",d=>d.on("end",()=>t(null,d)).resume());let u=V0({...this.maximumDepth&&{maximumDepth:this.maximumDepth}});s.end(Buffer.from(u(r,this.options.replacer),"utf8"))}}});var Do=m((hO,bd)=>{"use strict";var ke=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";ke.writable=e=>ke(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";ke.readable=e=>ke(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";ke.duplex=e=>ke.writable(e)&&ke.readable(e);ke.transform=e=>ke.duplex(e)&&typeof e._transform=="function";bd.exports=ke});var wd=m((mO,_d)=>{"use strict";var K0=Do(),{MESSAGE:J0}=ae(),Z0=require("os"),X0=ot();_d.exports=class extends X0{constructor(r={}){if(super(r),!r.stream||!K0(r.stream))throw new Error("options.stream is required.");this._stream=r.stream,this._stream.setMaxListeners(1/0),this.isObjectMode=r.stream._writableState.objectMode,this.eol=typeof r.eol=="string"?r.eol:Z0.EOL}log(r,t){if(setImmediate(()=>this.emit("logged",r)),this.isObjectMode){this._stream.write(r),t&&t();return}this._stream.write(`${r[J0]}${this.eol}`),t&&t()}}});var Ed=m(zt=>{"use strict";Object.defineProperty(zt,"Console",{configurable:!0,enumerable:!0,get(){return Sc()}});Object.defineProperty(zt,"File",{configurable:!0,enumerable:!0,get(){return md()}});Object.defineProperty(zt,"Http",{configurable:!0,enumerable:!0,get(){return vd()}});Object.defineProperty(zt,"Stream",{configurable:!0,enumerable:!0,get(){return wd()}})});var hi=m(Bt=>{"use strict";var pi=Ia(),{configs:Co}=ae();Bt.cli=pi.levels(Co.cli);Bt.npm=pi.levels(Co.npm);Bt.syslog=pi.levels(Co.syslog);Bt.addColors=pi.levels});var Od=m((gi,Sd)=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});var Q0=Bn(),e1=qr(Q0),r1=Qn(),t1=qr(r1),n1=mo(),i1=qr(n1),a1=po(),o1=qr(a1),s1=ho(),u1=qr(s1),l1=Dr(),c1=qr(l1),f1=ut(),d1=qr(f1);function qr(e){return e&&e.__esModule?e:{default:e}}function p1(e,r,t){t=(0,o1.default)(t);var n=0,i=0,{length:a}=e,s=!1;a===0&&t(null);function u(d,h){d===!1&&(s=!0),s!==!0&&(d?t(d):(++i===a||h===t1.default)&&t(null))}for(;n<a;n++)r(e[n],n,(0,u1.default)(u))}function h1(e,r,t){return(0,i1.default)(e,1/0,r,t)}function g1(e,r,t){var n=(0,e1.default)(e)?p1:h1;return n(e,(0,c1.default)(r),t)}gi.default=(0,d1.default)(g1,3);Sd.exports=gi.default});var Ad=m((mi,Pd)=>{"use strict";Object.defineProperty(mi,"__esModule",{value:!0});mi.default=m1;function m1(e){return(r,t,n)=>e(r,n)}Pd.exports=mi.default});var bi=m((vi,Td)=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});var y1=Od(),v1=yi(y1),b1=Ad(),_1=yi(b1),w1=Dr(),E1=yi(w1),S1=ut(),O1=yi(S1);function yi(e){return e&&e.__esModule?e:{default:e}}function P1(e,r,t){return(0,v1.default)(e,(0,_1.default)((0,E1.default)(r)),t)}vi.default=(0,O1.default)(P1,3);Td.exports=vi.default});var xd=m((bO,Nd)=>{"use strict";var A1=Object.prototype.toString;Nd.exports=function(r){if(typeof r.displayName=="string"&&r.constructor.name)return r.displayName;if(typeof r.name=="string"&&r.name)return r.name;if(typeof r=="object"&&r.constructor&&typeof r.constructor.name=="string")return r.constructor.name;var t=r.toString(),n=A1.call(r).slice(8,-1);return n==="Function"?t=t.substring(t.indexOf("(")+1,t.indexOf(")")):t=n,t||"anonymous"}});var Lo=m((_O,Md)=>{"use strict";var T1=xd();Md.exports=function(r){var t=0,n;function i(){return t||(t=1,n=r.apply(this,arguments),r=null),n}return i.displayName=T1(r),i}});var qo=m(Gt=>{Gt.get=function(e){var r=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var t={},n=Error.prepareStackTrace;Error.prepareStackTrace=function(a,s){return s},Error.captureStackTrace(t,e||Gt.get);var i=t.stack;return Error.prepareStackTrace=n,Error.stackTraceLimit=r,i};Gt.parse=function(e){if(!e.stack)return[];var r=this,t=e.stack.split(`
|
|
52
|
+
`).slice(1);return t.map(function(n){if(n.match(/^\s*[-]{4,}$/))return r._createParsedCallSite({fileName:n,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var i=n.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(i){var a=null,s=null,u=null,d=null,h=null,y=i[5]==="native";if(i[1]){u=i[1];var b=u.lastIndexOf(".");if(u[b-1]=="."&&b--,b>0){a=u.substr(0,b),s=u.substr(b+1);var _=a.indexOf(".Module");_>0&&(u=u.substr(_+1),a=a.substr(0,_))}d=null}s&&(d=a,h=s),s==="<anonymous>"&&(h=null,u=null);var S={fileName:i[2]||null,lineNumber:parseInt(i[3],10)||null,functionName:u,typeName:d,methodName:h,columnNumber:parseInt(i[4],10)||null,native:y};return r._createParsedCallSite(S)}}).filter(function(n){return!!n})};function Ht(e){for(var r in e)this[r]=e[r]}var N1=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],x1=["topLevel","eval","native","constructor"];N1.forEach(function(e){Ht.prototype[e]=null,Ht.prototype["get"+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}});x1.forEach(function(e){Ht.prototype[e]=!1,Ht.prototype["is"+e[0].toUpperCase()+e.substr(1)]=function(){return this[e]}});Gt._createParsedCallSite=function(e){return new Ht(e)}});var Id=m((SO,Rd)=>{"use strict";var{Writable:M1}=Cr();Rd.exports=class extends M1{constructor(r){if(super({objectMode:!0}),!r)throw new Error("ExceptionStream requires a TransportStream instance.");this.handleExceptions=!0,this.transport=r}_write(r,t,n){return r.exception?this.transport.log(r,n):(n(),!0)}}});var Uo=m((PO,Ld)=>{"use strict";var Dd=require("os"),R1=bi(),$o=kt()("winston:exception"),I1=Lo(),Cd=qo(),D1=Id();Ld.exports=class{constructor(r){if(!r)throw new Error("Logger is required to handle exceptions");this.logger=r,this.handlers=new Map}handle(...r){r.forEach(t=>{if(Array.isArray(t))return t.forEach(n=>this._addHandler(n));this._addHandler(t)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),process.on("uncaughtException",this.catcher))}unhandle(){this.catcher&&(process.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(r=>this.logger.unpipe(r)))}getAllInfo(r){let t=null;return r&&(t=typeof r=="string"?r:r.message),{error:r,level:"error",message:[`uncaughtException: ${t||"(no error message)"}`,r&&r.stack||" No stack trace"].join(`
|
|
53
|
+
`),stack:r&&r.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:Dd.loadavg(),uptime:Dd.uptime()}}getTrace(r){return(r?Cd.parse(r):Cd.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(r){if(!this.handlers.has(r)){r.handleExceptions=!0;let t=new D1(r);this.handlers.set(r,t),this.logger.pipe(t)}}_uncaughtException(r){let t=this.getAllInfo(r),n=this._getExceptionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,a;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),i=!1);function s(){$o("doExit",i),$o("process._exiting",process._exiting),i&&!process._exiting&&(a&&clearTimeout(a),process.exit(1))}if(!n||n.length===0)return process.nextTick(s);R1(n,(u,d)=>{let h=I1(d),y=u.transport||u;function b(_){return()=>{$o(_),h()}}y._ending=!0,y.once("finish",b("finished")),y.once("error",b("error"))},()=>i&&s()),this.logger.log(t),i&&(a=setTimeout(s,3e3))}_getExceptionHandlers(){return this.logger.transports.filter(r=>(r.transport||r).handleExceptions)}}});var $d=m((TO,qd)=>{"use strict";var{Writable:C1}=Cr();qd.exports=class extends C1{constructor(r){if(super({objectMode:!0}),!r)throw new Error("RejectionStream requires a TransportStream instance.");this.handleRejections=!0,this.transport=r}_write(r,t,n){return r.rejection?this.transport.log(r,n):(n(),!0)}}});var Fo=m((xO,Fd)=>{"use strict";var Ud=require("os"),L1=bi(),jo=kt()("winston:rejection"),q1=Lo(),jd=qo(),$1=$d();Fd.exports=class{constructor(r){if(!r)throw new Error("Logger is required to handle rejections");this.logger=r,this.handlers=new Map}handle(...r){r.forEach(t=>{if(Array.isArray(t))return t.forEach(n=>this._addHandler(n));this._addHandler(t)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),process.on("unhandledRejection",this.catcher))}unhandle(){this.catcher&&(process.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(r=>this.logger.unpipe(r)))}getAllInfo(r){let t=null;return r&&(t=typeof r=="string"?r:r.message),{error:r,level:"error",message:[`unhandledRejection: ${t||"(no error message)"}`,r&&r.stack||" No stack trace"].join(`
|
|
54
|
+
`),stack:r&&r.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}getProcessInfo(){return{pid:process.pid,uid:process.getuid?process.getuid():null,gid:process.getgid?process.getgid():null,cwd:process.cwd(),execPath:process.execPath,version:process.version,argv:process.argv,memoryUsage:process.memoryUsage()}}getOsInfo(){return{loadavg:Ud.loadavg(),uptime:Ud.uptime()}}getTrace(r){return(r?jd.parse(r):jd.get()).map(n=>({column:n.getColumnNumber(),file:n.getFileName(),function:n.getFunctionName(),line:n.getLineNumber(),method:n.getMethodName(),native:n.isNative()}))}_addHandler(r){if(!this.handlers.has(r)){r.handleRejections=!0;let t=new $1(r);this.handlers.set(r,t),this.logger.pipe(t)}}_unhandledRejection(r){let t=this.getAllInfo(r),n=this._getRejectionHandlers(),i=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,a;!n.length&&i&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),i=!1);function s(){jo("doExit",i),jo("process._exiting",process._exiting),i&&!process._exiting&&(a&&clearTimeout(a),process.exit(1))}if(!n||n.length===0)return process.nextTick(s);L1(n,(u,d)=>{let h=q1(d),y=u.transport||u;function b(_){return()=>{jo(_),h()}}y._ending=!0,y.once("finish",b("finished")),y.once("error",b("error"))},()=>i&&s()),this.logger.log(t),i&&(a=setTimeout(s,3e3))}_getRejectionHandlers(){return this.logger.transports.filter(r=>(r.transport||r).handleRejections)}}});var zd=m((MO,kd)=>{"use strict";var ko=class{constructor(r){let t=_i();if(typeof r!="object"||Array.isArray(r)||!(r instanceof t))throw new Error("Logger is required for profiling");this.logger=r,this.start=Date.now()}done(...r){typeof r[r.length-1]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),r.pop());let t=typeof r[r.length-1]=="object"?r.pop():{};return t.level=t.level||"info",t.durationMs=Date.now()-this.start,this.logger.write(t)}};kd.exports=ko});var _i=m((RO,Wd)=>{"use strict";var{Stream:U1,Transform:j1}=Cr(),Bd=bi(),{LEVEL:ze,SPLAT:Hd}=ae(),Gd=Do(),F1=Uo(),k1=Fo(),z1=lo(),B1=zd(),{warn:H1}=Da(),G1=hi(),W1=/%[scdjifoO%]/g,wi=class extends j1{constructor(r){super({objectMode:!0}),this.configure(r)}child(r){let t=this;return Object.create(t,{write:{value:function(n){let i=Object.assign({},r,n);n instanceof Error&&(i.stack=n.stack,i.message=n.message),t.write(i)}}})}configure({silent:r,format:t,defaultMeta:n,levels:i,level:a="info",exitOnError:s=!0,transports:u,colors:d,emitErrs:h,formatters:y,padLevels:b,rewriters:_,stripColors:S,exceptionHandlers:g,rejectionHandlers:w}={}){if(this.transports.length&&this.clear(),this.silent=r,this.format=t||this.format||Ta()(),this.defaultMeta=n||null,this.levels=i||this.levels||G1.npm.levels,this.level=a,this.exceptions&&this.exceptions.unhandle(),this.rejections&&this.rejections.unhandle(),this.exceptions=new F1(this),this.rejections=new k1(this),this.profilers={},this.exitOnError=s,u&&(u=Array.isArray(u)?u:[u],u.forEach(T=>this.add(T))),d||h||y||b||_||S)throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.","Use a custom winston.format(function) instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
55
|
+
`));g&&this.exceptions.handle(g),w&&this.rejections.handle(w)}isLevelEnabled(r){let t=zo(this.levels,r);if(t===null)return!1;let n=zo(this.levels,this.level);return n===null?!1:!this.transports||this.transports.length===0?n>=t:this.transports.findIndex(a=>{let s=zo(this.levels,a.level);return s===null&&(s=n),s>=t})!==-1}log(r,t,...n){if(arguments.length===1)return r[ze]=r.level,this._addDefaultMeta(r),this.write(r),this;if(arguments.length===2)return t&&typeof t=="object"?(t[ze]=t.level=r,this._addDefaultMeta(t),this.write(t),this):(t={[ze]:r,level:r,message:t},this._addDefaultMeta(t),this.write(t),this);let[i]=n;if(typeof i=="object"&&i!==null&&!(t&&t.match&&t.match(W1))){let s=Object.assign({},this.defaultMeta,i,{[ze]:r,[Hd]:n,level:r,message:t});return i.message&&(s.message=`${s.message} ${i.message}`),i.stack&&(s.stack=i.stack),i.cause&&(s.cause=i.cause),this.write(s),this}return this.write(Object.assign({},this.defaultMeta,{[ze]:r,[Hd]:n,level:r,message:t})),this}_transform(r,t,n){if(this.silent)return n();r[ze]||(r[ze]=r.level),!this.levels[r[ze]]&&this.levels[r[ze]]!==0&&console.error("[winston] Unknown logger level: %s",r[ze]),this._readableState.pipes||console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j",r);try{this.push(this.format.transform(r,this.format.options))}finally{this._writableState.sync=!1,n()}}_final(r){let t=this.transports.slice();Bd(t,(n,i)=>{if(!n||n.finished)return setImmediate(i);n.once("finish",i),n.end()},r)}add(r){let t=!Gd(r)||r.log.length>2?new z1({transport:r}):r;if(!t._writableState||!t._writableState.objectMode)throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }.");return this._onEvent("error",t),this._onEvent("warn",t),this.pipe(t),r.handleExceptions&&this.exceptions.handle(),r.handleRejections&&this.rejections.handle(),this}remove(r){if(!r)return this;let t=r;return(!Gd(r)||r.log.length>2)&&(t=this.transports.filter(n=>n.transport===r)[0]),t&&this.unpipe(t),this}clear(){return this.unpipe(),this}close(){return this.exceptions.unhandle(),this.rejections.unhandle(),this.clear(),this.emit("close"),this}setLevels(){H1.deprecated("setLevels")}query(r,t){typeof r=="function"&&(t=r,r={}),r=r||{};let n={},i=Object.assign({},r.query||{});function a(u,d){r.query&&typeof u.formatQuery=="function"&&(r.query=u.formatQuery(i)),u.query(r,(h,y)=>{if(h)return d(h);typeof u.formatResults=="function"&&(y=u.formatResults(y,r.format)),d(null,y)})}function s(u,d){a(u,(h,y)=>{d&&(y=h||y,y&&(n[u.name]=y),d()),d=null})}Bd(this.transports.filter(u=>!!u.query),s,()=>t(null,n))}stream(r={}){let t=new U1,n=[];return t._streams=n,t.destroy=()=>{let i=n.length;for(;i--;)n[i].destroy()},this.transports.filter(i=>!!i.stream).forEach(i=>{let a=i.stream(r);a&&(n.push(a),a.on("log",s=>{s.transport=s.transport||[],s.transport.push(i.name),t.emit("log",s)}),a.on("error",s=>{s.transport=s.transport||[],s.transport.push(i.name),t.emit("error",s)}))}),t}startTimer(){return new B1(this)}profile(r,...t){let n=Date.now();if(this.profilers[r]){let i=this.profilers[r];delete this.profilers[r],typeof t[t.length-2]=="function"&&(console.warn("Callback function no longer supported as of winston@3.0.0"),t.pop());let a=typeof t[t.length-1]=="object"?t.pop():{};return a.level=a.level||"info",a.durationMs=n-i,a.message=a.message||r,this.write(a)}return this.profilers[r]=n,this}handleExceptions(...r){console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"),this.exceptions.handle(...r)}unhandleExceptions(...r){console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"),this.exceptions.unhandle(...r)}cli(){throw new Error(["Logger.cli() was removed in winston@3.0.0","Use a custom winston.formats.cli() instead.","See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(`
|
|
56
|
+
`))}_onEvent(r,t){function n(i){r==="error"&&!this.transports.includes(t)&&this.add(t),this.emit(r,i,t)}t["__winston"+r]||(t["__winston"+r]=n.bind(this),t.on(r,t["__winston"+r]))}_addDefaultMeta(r){this.defaultMeta&&Object.assign(r,this.defaultMeta)}};function zo(e,r){let t=e[r];return!t&&t!==0?null:t}Object.defineProperty(wi.prototype,"transports",{configurable:!1,enumerable:!0,get(){let{pipes:e}=this._readableState;return Array.isArray(e)?e:[e].filter(Boolean)}});Wd.exports=wi});var Bo=m((IO,Yd)=>{"use strict";var{LEVEL:Y1}=ae(),V1=hi(),K1=_i(),J1=kt()("winston:create-logger");function Z1(e){return"is"+e.charAt(0).toUpperCase()+e.slice(1)+"Enabled"}Yd.exports=function(e={}){e.levels=e.levels||V1.npm.levels;class r extends K1{constructor(i){super(i)}}let t=new r(e);return Object.keys(e.levels).forEach(function(n){if(J1('Define prototype method for "%s"',n),n==="log"){console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.');return}r.prototype[n]=function(...i){let a=this||t;if(i.length===1){let[s]=i,u=s&&s.message&&s||{message:s};return u.level=u[Y1]=n,a._addDefaultMeta(u),a.write(u),this||t}return i.length===0?(a.log(n,""),a):a.log(n,...i)},r.prototype[Z1(n)]=function(){return(this||t).isLevelEnabled(n)}}),t}});var Kd=m((CO,Vd)=>{"use strict";var X1=Bo();Vd.exports=class{constructor(r={}){this.loggers=new Map,this.options=r}add(r,t){if(!this.loggers.has(r)){t=Object.assign({},t||this.options);let n=t.transports||this.options.transports;n?t.transports=Array.isArray(n)?n.slice():[n]:t.transports=[];let i=X1(t);i.on("close",()=>this._delete(r)),this.loggers.set(r,i)}return this.loggers.get(r)}get(r,t){return this.add(r,t)}has(r){return!!this.loggers.has(r)}close(r){if(r)return this._removeLogger(r);this.loggers.forEach((t,n)=>this._removeLogger(n))}_removeLogger(r){if(!this.loggers.has(r))return;this.loggers.get(r).close(),this._delete(r)}_delete(r){this.loggers.delete(r)}}});var Zd=m(J=>{"use strict";var Jd=Ia(),{warn:Wt}=Da();J.version=wl().version;J.transports=Ed();J.config=hi();J.addColors=Jd.levels;J.format=Jd.format;J.createLogger=Bo();J.Logger=_i();J.ExceptionHandler=Uo();J.RejectionHandler=Fo();J.Container=Kd();J.Transport=ot();J.loggers=new J.Container;var Be=J.createLogger();Object.keys(J.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(e=>J[e]=(...r)=>Be[e](...r));Object.defineProperty(J,"level",{get(){return Be.level},set(e){Be.level=e}});Object.defineProperty(J,"exceptions",{get(){return Be.exceptions}});Object.defineProperty(J,"rejections",{get(){return Be.rejections}});["exitOnError"].forEach(e=>{Object.defineProperty(J,e,{get(){return Be[e]},set(r){Be[e]=r}})});Object.defineProperty(J,"default",{get(){return{exceptionHandlers:Be.exceptionHandlers,rejectionHandlers:Be.rejectionHandlers,transports:Be.transports}}});Wt.deprecated(J,"setLevels");Wt.forFunctions(J,"useFormat",["cli"]);Wt.forProperties(J,"useFormat",["padLevels","stripColors"]);Wt.forFunctions(J,"deprecated",["addRewriter","addFilter","clone","extend"]);Wt.forProperties(J,"deprecated",["emitErrs","levelLength"])});var $r=m(X=>{"use strict";var tp=X&&X.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(X,"__esModule",{value:!0});X.logger=X.processNestedErrors=X.DEFAULT_LOG_LEVEL=X.LOG_LEVELS=void 0;var mr=tp(Zd()),Q1=tp(require("util")),Xd=require("zod-validation-error");X.LOG_LEVELS=["debug","info","warn","error"];X.DEFAULT_LOG_LEVEL="info";function Qd(e,r){let{combine:t,printf:n,timestamp:i}=mr.default.format,a="\x1B[0m",s="\x1B[32m",u="\x1B[33m",d="\x1B[31m",h=n(y=>{let{level:b,message:_,timestamp:S,...g}=y,w,T;switch(b){case"debug":w="d",T=w;break;case"info":w="i",T=e?w:`${s}${w}${a}`;break;case"warn":w="warn",T=e?w:`${u}${w}${a}`;break;case"error":w="error",T=e?w:`${d}${w}${a}`;break;default:w=`${b}:`,T=w}let D=" ".repeat(w.length+1),$=rp(_,r),P=g[Symbol.for("splat")]||[],C="";P.length>0&&(C=`
|
|
57
|
+
${P.map(G=>rp(G,r)).join(`
|
|
58
|
+
`)}`);let z=$+C,Y=String(z).replace(/\n/g,`
|
|
59
|
+
${D}`);return e&&S?`${S} [${b.toUpperCase()}] ${Y}`:`${T} ${Y}
|
|
60
|
+
`});return e?t(i({format:"YYYY-MM-DD HH:mm:ss"}),h):t(h)}function ew(e){return mr.default.format.printf(r=>{let{level:t,message:n,timestamp:i,...a}=r,s=(0,X.processNestedErrors)(n,e),d=(a[Symbol.for("splat")]||[]).map(y=>(0,X.processNestedErrors)(y,e)),h={timestamp:i||new Date().toISOString(),level:t.toUpperCase(),message:s};return d.length>0&&(d.length===1?h.meta=d[0]:h.meta=d),JSON.stringify(h,null,0)})}function ep(e,r){let t=[];for(let n of e)n.mode==="console"?t.push(new mr.default.transports.Console({format:Qd(!1,n.showErrorStack)})):n.mode==="file"?r?t.push(new mr.default.transports.File({filename:r,format:Qd(!0,n.showErrorStack),maxsize:10*1024*1024,maxFiles:5,tailable:!0})):console.warn("File output mode requested but no filename provided. Skipping file transport."):n.mode==="json"&&t.push(new mr.default.transports.Console({format:mr.default.format.combine(mr.default.format.timestamp(),ew(n.showErrorStack))}));return t}var rw=(e,r)=>{if(e==null)return e;if(e instanceof Error){let t={message:e.message};return r&&e.stack&&(t.stack=e.stack),(0,Xd.isZodErrorLike)(e)&&(t.message=(0,Xd.fromError)(e).message),Object.keys(e).forEach(n=>{n!=="name"&&n!=="message"&&n!=="stack"&&(t[n]=(0,X.processNestedErrors)(e[n],r))}),t.context&&(t.context=(0,X.processNestedErrors)(t.context,r)),t}if(Array.isArray(e))return e.map(t=>(0,X.processNestedErrors)(t,r));if(typeof e=="object"){let t={};for(let[n,i]of Object.entries(e))t[n]=(0,X.processNestedErrors)(i,r);return t}return e};X.processNestedErrors=rw;var rp=(e,r)=>{try{if(typeof e=="string")return e;let t=(0,X.processNestedErrors)(e,r);return Q1.default.inspect(t,{colors:!1,depth:null,compact:!1,maxArrayLength:null,maxStringLength:null,customInspect:!0})}catch{return String(e)}},Ho=class e{constructor(){this.currentConfig=[],this.debug=(r,...t)=>{this.winstonLogger.debug(r,...t)},this.info=(r,...t)=>{this.winstonLogger.info(r,...t)},this.warn=(r,...t)=>{this.winstonLogger.warn(r,...t)},this.error=(r,...t)=>{this.winstonLogger.error(r,...t)},this.std=r=>{console.log(typeof r=="object"?JSON.stringify(r,null,2):r)},this.setLevel=r=>{X.LOG_LEVELS.includes(r)?this.winstonLogger.level=r:(this.winstonLogger.warn(`Invalid log level: ${r}. Using '${X.DEFAULT_LOG_LEVEL}' as default.`),this.winstonLogger.level=X.DEFAULT_LOG_LEVEL)},this.getLevel=()=>this.winstonLogger.level,this.setOutputModes=(r,t)=>{let n=r.filter(a=>a.mode==="console"||a.mode==="file"||a.mode==="json");n.length===0&&this.winstonLogger.warn("No valid output modes provided."),this.currentConfig=n,this.winstonLogger.clear(),ep(n,t).forEach(a=>this.winstonLogger.add(a))},this.getOutputModes=()=>this.currentConfig,this.currentConfig=[{mode:"console",showErrorStack:!1}],this.winstonLogger=e.createWinstonLogger(this.currentConfig)}static createWinstonLogger(r){let t=ep(r);return mr.default.createLogger({exitOnError:!0,level:X.DEFAULT_LOG_LEVEL,transports:t})}},tw=new Ho;X.logger=tw});var Go=m(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.getIntroductoryOfferGroupingKey=ip;Ur.getIntroductoryOfferGroupingDescription=ap;Ur.validateIntroductoryOffersGrouping=iw;Ur.validateIntroductoryOffers=aw;Ur.validateIntroductoryOfferAppleRestrictions=ow;var Ei=ua(),nw=$r(),np=bt();function ip(e){return e.type==="PAY_AS_YOU_GO"?`${e.type}_${e.numberOfPeriods}`:`${e.type}_${e.duration}`}function ap(e){return e.type==="PAY_AS_YOU_GO"?`type '${e.type}' with numberOfPeriods '${e.numberOfPeriods}'`:`type '${e.type}' with duration '${e.duration}'`}function iw(e,r){let t=new Map;for(let n=0;n<e.length;n++){let i=e[n],a=ip(i),s=ap(i);if(t.has(a)){let u=t.get(a);u.count++,u.indices.push(n);let d=u.indices;if(d.length<2){nw.logger.error(`Logic error: Expected at least 2 duplicate indices, but found ${d.length} for ${s} in subscription '${r||"unknown"}'`);continue}let h=d[0],y=d[1],b=r?` in subscription '${r}'`:"";return{success:!1,error:`Duplicate introductory offers found with ${s}${b}. Items at indices ${h} and ${y} have the same grouping criteria.`}}else t.set(a,{count:1,indices:[n]})}return{success:!0}}function aw(e,r,t){if(!t)return;let n=new Map;for(let i of t){if(i.type==="FREE_TRIAL"||i.type==="PAY_UP_FRONT"){if(!(0,Ei.isValidIntroductoryOfferDuration)(r,i.type,i.duration)){let a=(0,Ei.getValidIntroductoryOfferDurations)(r,i.type);throw new np.ContextualError(`Invalid duration '${i.duration}' for ${i.type} offer in subscription '${e}' with period '${r}'.`,{subscriptionProductId:e,subscriptionPeriod:r,offer:i,validDurations:a})}}else if(i.type==="PAY_AS_YOU_GO"&&!(0,Ei.isValidPayAsYouGoPeriods)(r,i.numberOfPeriods)){let a=(0,Ei.getValidPayAsYouGoPeriods)(r);throw new np.ContextualError(`Invalid numberOfPeriods '${i.numberOfPeriods}' for PAY_AS_YOU_GO offer in subscription '${e}' with period '${r}'.`,{subscriptionProductId:e,subscriptionPeriod:r,offer:i,validPeriods:a})}for(let a of i.availableTerritories){if(n.has(a))throw new Error(`Multiple introductory offers found for territory '${a}' in subscription '${e}'. Only one offer per territory is allowed.`);n.set(a,i)}}}function ow(e,r,t){if(!t||t.length===0)return;let n=r.availability&&r.availability.availableTerritories&&r.availability.availableTerritories.length>0,i=r.pricing&&r.pricing.prices&&r.pricing.prices.length>0;if(!n||!i)throw new Error(`Cannot create introductory offers for subscription '${e}'. Apple requires subscriptions to have both availability and pricing before introductory offers can be created.`)}});var Pi=m(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.validateSubscriptionTerritoryPricing=sw;Oi.validateSubscription=uw;var Si=require("zod"),op=Go();function sw(e,r){let t=e.pricing?.prices||[],n=e.availability,i=e.introductoryOffers||[];if(e.pricing&&!n){r.addIssue({code:Si.z.ZodIssueCode.custom,message:`Subscription '${e.productId}' has pricing defined but no availability. You need to set up availabilities first.`,path:["availability"]});return}if(i.length>0&&t.length===0){r.addIssue({code:Si.z.ZodIssueCode.custom,message:`Subscription '${e.productId}' has introductory offers but no pricing defined. Apple requires subscription pricing to be set up before any introductory offers can be created.`,path:["pricing"]});return}}function uw(e,r){if(e.introductoryOffers&&e.introductoryOffers.length>0){let t=(0,op.validateIntroductoryOffersGrouping)(e.introductoryOffers,e.productId);t.success||r.addIssue({code:Si.z.ZodIssueCode.custom,message:t.error||"Introductory offers must have unique type+duration or type+numberOfPeriods combinations",path:["introductoryOffers"]})}try{(0,op.validateIntroductoryOffers)(e.productId,e.subscriptionPeriod,e.introductoryOffers)}catch(t){r.addIssue({code:Si.z.ZodIssueCode.custom,message:t instanceof Error?t.message:"Introductory offers validation failed",path:["introductoryOffers"]})}}});var Ti=m(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.AppStoreModelSchema=N.AppStoreLocalizationSchema=N.AppStoreAppInfoLocalizationSchema=N.AppStoreVersionLocalizationSchema=N.InAppPurchaseSchema=N.SubscriptionGroupSchema=N.SubscriptionSchema=N.PromotionalOfferSchema=N.IntroductoryOfferSchema=N.SubscriptionGroupLocalizationSchema=N.AvailabilitySchema=N.LocalizationSchema=N.PriceScheduleSchema=N.PriceSchema=N.AvailableTerritoriesSchema=N.SubscriptionOfferDurationSchema=N.SubscriptionPeriodSchema=N.APP_STORE_SCHEMA_VERSION=N.WORLDWIDE_TERRITORY_CODE=N.LocaleCodeSchema=N.TerritoryCodeSchema=void 0;var A=require("zod"),Ai=pn();Object.defineProperty(N,"TerritoryCodeSchema",{enumerable:!0,get:function(){return Ai.TerritoryCodeSchema}});var Yt=aa();Object.defineProperty(N,"LocaleCodeSchema",{enumerable:!0,get:function(){return Yt.LocaleCodeSchema}});var Wo=gn(),lw=Pi(),Je=$r();N.WORLDWIDE_TERRITORY_CODE="worldwide";var Vt=64,Yo=100;N.APP_STORE_SCHEMA_VERSION="1.0.0";N.SubscriptionPeriodSchema=A.z.enum(["ONE_WEEK","ONE_MONTH","TWO_MONTHS","THREE_MONTHS","SIX_MONTHS","ONE_YEAR"]);N.SubscriptionOfferDurationSchema=A.z.enum(["THREE_DAYS","ONE_WEEK","TWO_WEEKS","ONE_MONTH","TWO_MONTHS","THREE_MONTHS","SIX_MONTHS","ONE_YEAR"]);N.AvailableTerritoriesSchema=A.z.union([A.z.array(Ai.TerritoryCodeSchema),A.z.literal(N.WORLDWIDE_TERRITORY_CODE)]);N.PriceSchema=A.z.object({price:A.z.string(),territory:Ai.TerritoryCodeSchema});N.PriceScheduleSchema=A.z.object({baseTerritory:Ai.TerritoryCodeSchema,prices:A.z.array(N.PriceSchema)}).refine(e=>e.prices.some(r=>r.territory===e.baseTerritory),{message:"The base territory must have a corresponding price in the prices array",path:["prices"]});N.LocalizationSchema=A.z.object({locale:Yt.LocaleCodeSchema,name:A.z.string(),description:A.z.string()});N.AvailabilitySchema=A.z.object({availableInNewTerritories:A.z.boolean(),availableTerritories:N.AvailableTerritoriesSchema});N.SubscriptionGroupLocalizationSchema=A.z.object({locale:Yt.LocaleCodeSchema,name:A.z.string(),customName:A.z.string().optional().nullable()}).superRefine((e,r)=>{e.customName&&e.customName.length>Vt&&Je.logger.warn(`Warning: customName '${e.customName}' is ${e.customName.length} characters long, but should be at most 30 characters for optimal App Store display.`)});var cw=A.z.object({type:A.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:A.z.number(),pricing:N.PriceScheduleSchema,availableTerritories:N.AvailableTerritoriesSchema}),fw=A.z.object({type:A.z.literal("PAY_UP_FRONT"),duration:N.SubscriptionOfferDurationSchema,pricing:N.PriceScheduleSchema,availableTerritories:N.AvailableTerritoriesSchema}),dw=A.z.object({type:A.z.literal("FREE_TRIAL"),duration:N.SubscriptionOfferDurationSchema,availableTerritories:N.AvailableTerritoriesSchema});N.IntroductoryOfferSchema=A.z.discriminatedUnion("type",[cw,fw,dw]);var pw=A.z.object({id:A.z.string(),referenceName:A.z.string(),type:A.z.literal("PAY_AS_YOU_GO"),numberOfPeriods:A.z.number(),pricing:N.PriceScheduleSchema}),hw=A.z.object({id:A.z.string(),referenceName:A.z.string(),type:A.z.literal("PAY_UP_FRONT"),duration:N.SubscriptionOfferDurationSchema,pricing:N.PriceScheduleSchema}),gw=A.z.object({id:A.z.string(),referenceName:A.z.string(),type:A.z.literal("FREE_TRIAL"),duration:N.SubscriptionOfferDurationSchema});N.PromotionalOfferSchema=A.z.discriminatedUnion("type",[pw,hw,gw]).superRefine((e,r)=>{e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`),e.id.length>Yo&&Je.logger.warn(`Warning: productId '${e.id}' is ${e.id.length} characters long, but should be at most 100 characters for optimal App Store display.`)});N.SubscriptionSchema=A.z.object({productId:A.z.string().refine(Wo.isValidProductId,{message:"Product ID can only contain alphanumeric characters, underscores, and periods"}),referenceName:A.z.string(),groupLevel:A.z.number(),subscriptionPeriod:N.SubscriptionPeriodSchema,familySharable:A.z.boolean(),reviewNote:A.z.string().optional(),pricing:N.PriceScheduleSchema.optional(),introductoryOffers:A.z.array(N.IntroductoryOfferSchema).optional(),promotionalOffers:A.z.array(N.PromotionalOfferSchema).optional(),availability:N.AvailabilitySchema.optional(),localizations:A.z.array(N.LocalizationSchema).optional()}).superRefine((e,r)=>{e.productId.length>Yo&&Je.logger.warn(`Warning: productId '${e.productId}' is ${e.productId.length} characters long, but should be at most 100 characters for optimal App Store display.`),e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)}).superRefine(lw.validateSubscription);N.SubscriptionGroupSchema=A.z.object({referenceName:A.z.string(),localizations:A.z.array(N.SubscriptionGroupLocalizationSchema),subscriptions:A.z.array(N.SubscriptionSchema)}).superRefine((e,r)=>{e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)});N.InAppPurchaseSchema=A.z.object({productId:A.z.string().refine(Wo.isValidProductId,{message:"Product ID can only contain alphanumeric characters, underscores, and periods"}),type:A.z.enum(["CONSUMABLE","NON_CONSUMABLE","NON_RENEWING_SUBSCRIPTION"]),referenceName:A.z.string(),familySharable:A.z.boolean(),reviewNote:A.z.string().optional(),pricing:N.PriceScheduleSchema.optional(),availability:N.AvailabilitySchema.optional(),localizations:A.z.array(N.LocalizationSchema).optional()}).superRefine((e,r)=>{e.productId.length>Yo&&Je.logger.warn(`Warning: productId '${e.productId}' is ${e.productId.length} characters long, but should be at most 30 characters for optimal App Store display.`),e.referenceName.length>Vt&&Je.logger.warn(`Warning: referenceName '${e.referenceName}' is ${e.referenceName.length} characters long, but should be at most 60 characters for optimal App Store display.`)});N.AppStoreVersionLocalizationSchema=A.z.object({description:A.z.string().optional(),keywords:A.z.string().optional(),marketingUrl:A.z.string().url().optional(),promotionalText:A.z.string().optional(),supportUrl:A.z.string().url().optional(),whatsNew:A.z.string().optional()});N.AppStoreAppInfoLocalizationSchema=A.z.object({name:A.z.string().optional(),subtitle:A.z.string().optional(),privacyPolicyUrl:A.z.string().url().optional(),privacyChoicesUrl:A.z.string().url().optional()});N.AppStoreLocalizationSchema=A.z.object({locale:Yt.LocaleCodeSchema}).and(N.AppStoreAppInfoLocalizationSchema).and(N.AppStoreVersionLocalizationSchema).superRefine((e,r)=>{e.description&&e.description.length<10&&Je.logger.warn(`Warning: description for locale '${e.locale}' is ${e.description.length} characters long, but should be at least 10 characters.`)});N.AppStoreModelSchema=A.z.object({schemaVersion:A.z.string(),appId:A.z.string(),versionString:A.z.string().optional(),pricing:N.PriceScheduleSchema.optional(),availableTerritories:N.AvailableTerritoriesSchema.optional(),inAppPurchases:A.z.array(N.InAppPurchaseSchema).optional(),subscriptionGroups:A.z.array(N.SubscriptionGroupSchema).optional(),primaryLocale:Yt.LocaleCodeSchema.optional(),localizations:A.z.array(N.AppStoreLocalizationSchema).optional(),copyright:A.z.string().optional()}).superRefine(Wo.validateAppStoreModelData)});var up=m(sp=>{"use strict";Object.defineProperty(sp,"__esModule",{value:!0})});var dp=m(He=>{"use strict";Object.defineProperty(He,"__esModule",{value:!0});He.PricingRequestSchema=He.PricingItemSchema=He.PricePointInfoSchema=He.PricingStrategySchema=void 0;var Ae=require("zod"),lp=Ae.z.enum(["apple","purchasingPower"]);He.PricingStrategySchema=lp;var cp=Ae.z.object({id:Ae.z.string(),price:Ae.z.string()});He.PricePointInfoSchema=cp;var fp=Ae.z.object({type:Ae.z.enum(["app","inAppPurchase","subscription","offer"]),id:Ae.z.string(),name:Ae.z.string(),offerType:Ae.z.string().optional(),parentName:Ae.z.string().optional()});He.PricingItemSchema=fp;var mw=Ae.z.object({appId:Ae.z.string(),selectedItem:fp,basePricePoint:cp,pricingStrategy:lp,minimumPrice:Ae.z.string().optional()});He.PricingRequestSchema=mw});var hp=m(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0})});var gp=m(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.validateAppStoreModel=Ew;var yw=require("zod"),vw=$r(),bw=Ti(),_w=Pi(),ww=bt();function Ew(e,r=!1,t="fetch"){let n=bw.AppStoreModelSchema.safeParse(e);if(n.success){if(t==="apply"&&n.data.subscriptionGroups)for(let i of n.data.subscriptionGroups)for(let a of i.subscriptions){let s=[],u={addIssue:d=>{s.push(d)},path:[],value:a,issues:s};if((0,_w.validateSubscriptionTerritoryPricing)(a,u),s.length>0)throw new yw.z.ZodError(s)}return r&&vw.logger.info("\u2705 Validation passed! The JSON file format and structure are valid."),n.data}else throw new ww.ContextualError(`\u274C Validation failed for '${t}'!`,n.error)}});var yp=m(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.useShortcuts=Ow;Mi.removeShortcuts=Tw;var Ni=pn(),Sw=gn(),mp=$r(),xi=Ti();function Ko(e){return e.toLowerCase()===xi.WORLDWIDE_TERRITORY_CODE.toLowerCase()}function Jo(e){return(0,Sw.deepEqualUnordered)(e,Ni.territoryCodes)}function Ow(e){if(!e||typeof e!="object")return e;let r=Zo(e);return r=Pw(r),r}function Zo(e){if(!e||typeof e!="object")return e;let r={...e};return r.availableTerritories&&Array.isArray(r.availableTerritories)&&Jo(r.availableTerritories)&&(r.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),r.availability&&typeof r.availability=="object"&&r.availability.availableTerritories&&Array.isArray(r.availability.availableTerritories)&&Jo(r.availability.availableTerritories)&&(r.availability.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),Array.isArray(r.introductoryOffers)&&(r.introductoryOffers=r.introductoryOffers.map(t=>{let n={...t};return n.availableTerritories&&Array.isArray(n.availableTerritories)&&Jo(n.availableTerritories)&&(n.availableTerritories=xi.WORLDWIDE_TERRITORY_CODE),n})),Array.isArray(r.inAppPurchases)&&(r.inAppPurchases=r.inAppPurchases.map(t=>Zo(t))),Array.isArray(r.subscriptionGroups)&&(r.subscriptionGroups=r.subscriptionGroups.map(t=>{let n={...t};return Array.isArray(n.subscriptions)&&(n.subscriptions=n.subscriptions.map(i=>Zo(i))),n})),r}function Pw(e){if(!e||typeof e!="object")return e;let r={...e};return Array.isArray(r.localizations)&&r.primaryLocale&&(r.localizations=Aw(r.localizations,r.primaryLocale)),r}function Aw(e,r){if(!r)return e;let t=e.find(i=>i.locale===r);if(!t)return e;let n=e.map(i=>{if(i.locale===r)return i;let a={locale:i.locale};return Object.keys(i).filter(u=>u!=="locale").forEach(u=>{let d=u;i[d]!==t[d]&&(a[d]=i[d])}),a});return mp.logger.debug(`Optimized ${e.length} localizations to avoid duplicates with primary locale: ${r}`),n}function Tw(e){if(!e||typeof e!="object")return e;let r=Nw(e);return r=Xo(r),r}function Xo(e){if(!e||typeof e!="object")return e;let r={...e};return r.availableTerritories&&typeof r.availableTerritories=="string"&&Ko(r.availableTerritories)&&(r.availableTerritories=[...Ni.territoryCodes]),r.availability&&typeof r.availability=="object"&&r.availability.availableTerritories&&typeof r.availability.availableTerritories=="string"&&Ko(r.availability.availableTerritories)&&(r.availability.availableTerritories=[...Ni.territoryCodes]),Array.isArray(r.introductoryOffers)&&(r.introductoryOffers=r.introductoryOffers.map(t=>{let n={...t};return n.availableTerritories&&typeof n.availableTerritories=="string"&&Ko(n.availableTerritories)&&(n.availableTerritories=[...Ni.territoryCodes]),n})),Array.isArray(r.inAppPurchases)&&(r.inAppPurchases=r.inAppPurchases.map(t=>Xo(t))),Array.isArray(r.subscriptionGroups)&&(r.subscriptionGroups=r.subscriptionGroups.map(t=>{let n={...t};return Array.isArray(n.subscriptions)&&(n.subscriptions=n.subscriptions.map(i=>Xo(i))),n})),r}function Nw(e){if(!e||typeof e!="object")return e;let r={...e};return Array.isArray(r.localizations)&&r.primaryLocale&&(r.localizations=xw(r.localizations,r.primaryLocale)),r}function xw(e,r){if(!r)return e;let t=e.find(i=>i.locale===r);if(!t)return e;let n=e.map(i=>{if(i.locale===r)return i;let a={...t,locale:i.locale};return Object.keys(i).forEach(s=>{if(s!=="locale"){let u=s;a[u]=i[u]}}),a});return mp.logger.debug(`Deoptimized ${e.length} localizations to restore full data with primary locale: ${r}`),n}});var Qo=m(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.DEFAULT_CONFIG_FILENAME=ft.BASE_TERRITORY=void 0;ft.BASE_TERRITORY="USA";ft.DEFAULT_CONFIG_FILENAME="storeconfig.json"});var vp=m(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.collectPricingItems=Mw;function Mw(e){let r=[];return r.push({type:"app",id:e.appId,name:"App"}),e.inAppPurchases&&e.inAppPurchases.forEach(t=>{r.push({type:"inAppPurchase",id:t.productId,name:t.referenceName})}),e.subscriptionGroups&&e.subscriptionGroups.forEach(t=>{t.subscriptions.forEach(n=>{r.push({type:"subscription",id:n.productId,name:n.referenceName}),n.introductoryOffers&&n.introductoryOffers.filter(i=>i.type!=="FREE_TRIAL").forEach(i=>{r.push({type:"offer",id:n.productId,name:`${i.type} Introductory Offer`,offerType:i.type,parentName:n.referenceName})}),n.promotionalOffers&&n.promotionalOffers.filter(i=>i.type!=="FREE_TRIAL").forEach(i=>{r.push({type:"offer",id:i.id,name:`${i.type} Promotional Offer`,offerType:i.type,parentName:n.referenceName})})})}),r}});var Ep=m(Ze=>{"use strict";var Rw=Ze&&Ze.__createBinding||(Object.create?(function(e,r,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(r,t);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,i)}):(function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]})),Iw=Ze&&Ze.__setModuleDefault||(Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r}),wp=Ze&&Ze.__importStar||(function(){var e=function(r){return e=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},e(r)};return function(r){if(r&&r.__esModule)return r;var t={};if(r!=null)for(var n=e(r),i=0;i<n.length;i++)n[i]!=="default"&&Rw(t,r,n[i]);return Iw(t,r),t}})();Object.defineProperty(Ze,"__esModule",{value:!0});Ze.validateFileExists=Lw;var Dw=wp(require("fs")),bp=wp(require("path")),_p=$r(),Cw=Qo();function Lw(e,r={}){let{defaultFilename:t=Cw.DEFAULT_CONFIG_FILENAME,fileDescription:n="JSON file",resolution:i=`Please either:
|
|
38
61
|
1. Create a ${t} file in the current directory, or
|
|
39
|
-
2. Specify a ${
|
|
40
|
-
`+
|
|
41
|
-
${t}`)}async function
|
|
42
|
-
${
|
|
62
|
+
2. Specify a ${n} using the --file or -f option`}=r,a;return e&&e.trim()!==""?a=bp.resolve(e):a=bp.resolve(process.cwd(),t),Dw.existsSync(a)||(_p.logger.error(`File not found: ${a}`),(!e||e.trim()==="")&&_p.logger.info(`No file specified and default file ${t} not found in current directory.
|
|
63
|
+
`+i),process.exit(1)),a}});var K=m(Q=>{"use strict";var qw=Q&&Q.__createBinding||(Object.create?(function(e,r,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(r,t);(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,i)}):(function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]})),me=Q&&Q.__exportStar||function(e,r){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t)&&qw(r,e,t)};Object.defineProperty(Q,"__esModule",{value:!0});me(Ti(),Q);me(pn(),Q);me(aa(),Q);me(up(),Q);me(dp(),Q);me(hp(),Q);me(gn(),Q);me(Pi(),Q);me(Go(),Q);me(ua(),Q);me(bt(),Q);me(gp(),Q);me(yp(),Q);me(Qo(),Q);me(vp(),Q);me(Ep(),Q);me($r(),Q)});var vm=ia();vm.start({apiKey:"9214ba2acdaeee4012c236461232c4f3",autoTrackSessions:!1,appType:"worker",logger:null});var Nh=L(ia()),xh=L(require("dotenv")),Mh=L(require("yargs")),Rh=require("yargs/helpers"),zr=L(K());var dt=L(K()),Sp=L(K()),Op=L(K()),$w={command:"validate-format",describe:"Validate the JSON file format and structure",builder:{file:{alias:"f",describe:`Path to the JSON file. Defaults to ${dt.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:e=>{let r=(0,dt.validateFileExists)(e.file,{fileDescription:"JSON file"});(0,Op.validateAppStoreModel)((0,Sp.removeShortcuts)((0,dt.readJsonFile)(r)),!0,"fetch")}},Pp=$w;var yr=L(K());var Ap=L(K()),Tp=L(K()),Ri=L(K());function pt(e){return e===Ri.WORLDWIDE_TERRITORY_CODE?!0:(0,Ri.deepEqualUnordered)(e,Tp.territoryCodes)}function jr(e){return e.map(r=>`${r.territory}: $${r.price}`).join(", ")}async function Uw(e){let r="",t="";switch(e.type){case"UPDATE_APP_AVAILABILITY":let n=e.payload.desiredTerritories,i=pt(n);r="Updating app availability",t=i?"worldwide":`${Array.isArray(n)?n.length:1} territories`;break;case"UPDATE_IN_APP_PURCHASE":let a=JSON.stringify(e.payload.changes);r=`Updating in-app purchase "${e.payload.productId}"`,t=a;break;case"UPDATE_IAP_AVAILABILITY":let s=e.payload.availability.availableTerritories,u=pt(s);r=`Updating IAP "${e.payload.productId}" availability`,t=u?"worldwide":`${Array.isArray(s)?s.length:1} territories`;break;case"UPDATE_IAP_PRICING":let d=e.payload.pricing,h=jr(d.prices);r=`Updating IAP "${e.payload.productId}" pricing`,t=h;break;case"CREATE_SUBSCRIPTION":let y=e.payload.subscription,b=y.pricing?jr(y.pricing.prices):"No pricing set",_=y.availability?.availableTerritories,g=(_?pt(_):!1)?"worldwide":_?`${Array.isArray(_)?_.length:1} territories`:"No territories set";r=`Creating subscription "${y.productId}" (${y.referenceName}) in group "${e.payload.groupReferenceName}"`,t=`Period: ${y.subscriptionPeriod}, Pricing: ${b}, Territories: ${g}`;break;case"UPDATE_SUBSCRIPTION_AVAILABILITY":let w=e.payload.availability.availableTerritories,T=pt(w);r=`Updating subscription "${e.payload.subscriptionProductId}" availability`,t=T?"worldwide":`${Array.isArray(w)?w.length:1} territories`;break;case"CREATE_SUBSCRIPTION_PRICE":let D=e.payload.desiredPriceSchedule,$=jr(D.prices);r=`Creating subscription price for "${e.payload.subscriptionProductId}"`,t=$;break;case"CREATE_INTRODUCTORY_OFFER":let P=e.payload.offer,C=P.type==="FREE_TRIAL"?"Free trial":jr(P.pricing.prices),z=P.availableTerritories,B=pt(z)?"worldwide":`${Array.isArray(z)?z.length:1} territories`;r=`Creating introductory offer for subscription "${e.payload.subscriptionProductId}"`,t=`Type: ${P.type}, Period: ${e.payload.subscriptionPeriod}, Pricing: ${C}, Territories: ${B}`;break;case"CREATE_IN_APP_PURCHASE":let G=e.payload.inAppPurchase,U=G.pricing?jr(G.pricing.prices):"No pricing set",Z=G.availability?.availableTerritories,te=(Z?pt(Z):!1)?"worldwide":Z?`${Array.isArray(Z)?Z.length:1} territories`:"No territories set";r=`Creating in-app purchase "${G.productId}" (${G.referenceName})"`,t=`Type: ${G.type}, Pricing: ${U}, Territories: ${te}`;break;case"UPDATE_APP_PRICING":let ce=e.payload.pricing,fe=jr(ce.prices);r="Updating app pricing",t=fe;break;case"UPDATE_APP_DETAILS":let $e=JSON.stringify(e.payload);r="Updating app details",t=$e;break;case"UPDATE_VERSION_METADATA":let O=JSON.stringify(e.payload);r="Updating version metadata",t=O;break;case"CREATE_APP_LOCALIZATION":let R=e.payload.localization;r="Creating app localization",t=R.locale;break;case"UPDATE_APP_LOCALIZATION":let V=e.payload;r="Updating app localization",t=V.locale;break;case"DELETE_APP_LOCALIZATION":r="Deleting app localization",t=e.payload.locale;break;case"CREATE_SUBSCRIPTION_GROUP":let ue=e.payload.group;r="Creating subscription group",t=`"${ue.referenceName}"`;break;case"UPDATE_SUBSCRIPTION_GROUP":let q=e.payload,_e=JSON.stringify(e.payload.changes||{});r=`Updating subscription group "${q.referenceName}"`,t=_e;break;case"CREATE_SUBSCRIPTION_GROUP_LOCALIZATION":let de=e.payload.localization;r="Creating subscription group localization",t=de.locale;break;case"UPDATE_SUBSCRIPTION_GROUP_LOCALIZATION":let Ne=e.payload,Ue=JSON.stringify(e.payload.changes||{});r=`Updating subscription group localization for ${Ne.locale}`,t=Ue;break;case"DELETE_SUBSCRIPTION_GROUP_LOCALIZATION":r="Deleting subscription group localization",t=e.payload.locale;break;case"UPDATE_SUBSCRIPTION":let Br=e.payload,er=JSON.stringify(e.payload.changes||{});r=`Updating subscription "${Br.productId}"`,t=er;break;case"CREATE_SUBSCRIPTION_LOCALIZATION":let Hr=e.payload.localization;r="Creating subscription localization",t=Hr.locale;break;case"UPDATE_SUBSCRIPTION_LOCALIZATION":let ie=e.payload,rr=JSON.stringify(e.payload.changes||{});r=`Updating subscription localization for ${ie.locale}`,t=rr;break;case"DELETE_SUBSCRIPTION_LOCALIZATION":r="Deleting subscription localization",t=e.payload.locale;break;case"CREATE_IAP_LOCALIZATION":let ht=e.payload.localization;r="Creating IAP localization",t=ht.locale;break;case"UPDATE_IAP_LOCALIZATION":let Se=e.payload,Gr=JSON.stringify(e.payload.changes||{});r=`Updating IAP localization for ${Se.locale}`,t=Gr;break;case"DELETE_IAP_LOCALIZATION":r="Deleting IAP localization",t=e.payload.locale;break;case"DELETE_INTRODUCTORY_OFFER":r="Deleting introductory offer",t=`subscription "${e.payload.subscriptionProductId}"`;break;case"CREATE_PROMOTIONAL_OFFER":let Re=e.payload.offer,tr=Re.type==="FREE_TRIAL"?"Free trial":jr(Re.pricing.prices);r=`Creating promotional offer "${Re.referenceName}" for subscription "${e.payload.subscriptionProductId}"`,t=`Type: ${Re.type}, Pricing: ${tr}`;break;case"DELETE_PROMOTIONAL_OFFER":r="Deleting promotional offer",t=`"${e.payload.offerId}" subscription "${e.payload.subscriptionProductId}"`;break;default:r="Unknown action type",t=e.type;break}Ap.logger.info(`${r}
|
|
64
|
+
${t}`)}async function Np(e){for(let r of e)await Uw(r)}var Lp=L(K()),qp=L(K()),$p=L(K());var ns=L(require("axios"));var Xe=L(require("fs")),rs=L(require("path")),xp=L(require("os")),Fr=L(K()),ts=class{constructor(r){this.keyPath=r??rs.default.join(xp.default.homedir(),".storeconfig","key")}getKeyPath(){return this.keyPath}saveKey(r){try{let t=rs.default.dirname(this.keyPath);Xe.default.existsSync(t)||Xe.default.mkdirSync(t,{recursive:!0}),Xe.default.writeFileSync(this.keyPath,r,"utf8"),Fr.logger.debug(`Secret key saved to ${this.keyPath}`)}catch(t){throw new Fr.ContextualError("Failed to save secret key",t)}}loadKey(){try{return Xe.default.existsSync(this.keyPath)?Xe.default.readFileSync(this.keyPath,"utf8").trim():null}catch(r){throw new Fr.ContextualError("Failed to load secret key file",r)}}hasKey(){return Xe.default.existsSync(this.keyPath)}deleteKey(){try{Xe.default.existsSync(this.keyPath)&&(Xe.default.unlinkSync(this.keyPath),Fr.logger.debug(`Secret key deleted from ${this.keyPath}`))}catch(r){throw new Fr.ContextualError("Failed to delete secret key",r)}}},Kt=new ts;var Mp=L(K()),oe=ns.default.create({baseURL:process.env.API_BASE_URL||"http://localhost:3000",timeout:3e4,headers:{"Content-Type":"application/json"}});oe.interceptors.request.use(e=>{let r=Kt.loadKey();return r&&(e.headers["X-StoreConfig-ApiKey"]=r),e},e=>Promise.reject(e));oe.interceptors.response.use(e=>e,e=>{if(ns.default.isAxiosError(e)&&e.response?.data&&e.response.status){let r=e.response.status,t=e.response.data?.message||`API request failed with status ${r}`,n=e.response.data?.details;throw new Mp.ContextualError(t,n)}throw e});var jw=()=>Kt.hasKey(),Rp=()=>{if(!jw())throw new Error("Authentication required. Please run 'storeconfig configure' first to set up your secret key")};var Fw=5e3,Ip=async(e,r,t)=>{let n=-1;for(;;){let{status:i,currentActionIndex:a,currentAction:s,totalActions:u,error:d}=(await kw(e)).data;if(a!==n){t&&a!==n+1&&n>=0&&await zw(t,n+1,a,r);let h=Dp(s),y=`Processing action [${a+1}/${u}] ${h}`;r.text=y,n=a}if(i==="completed"){r.succeed("Actions completed successfully");return}if(i==="failed"){let h=`Actions ID '${e}'`;throw d&&(h+=`
|
|
65
|
+
${d}`),new Error(h)}await new Promise(h=>setTimeout(h,Fw))}},kw=async e=>(await oe.get(`/status/${e}`)).data,Dp=e=>e?e.type:"Unknown Action",zw=async(e,r,t,n)=>{let i=Math.max(0,r),a=Math.min(e.length,t);for(let s=i;s<a;s++){let u=e[s],d=e.length;if(u){let h=Dp(u),y=`Processing action [${s+1}/${d}] ${h}`;n.text=y,await new Promise(b=>setTimeout(b,500))}}};var Di=L(K()),is=L(require("inquirer"));var Ii=async()=>(await oe.get("/info")).data.data;var Cp=async(e,r,t,n=!1,i)=>{let a=await Hw();if(a){let d=await Bw(a,i);if(d)return{jobId:d,newJobCreated:!1}}return await Yw()?(i.start("Processing actions..."),{jobId:(await oe.post("/apply",{plan:e,currentState:r,desiredState:t,dryRun:n})).data.data,newJobCreated:!0}):(Di.logger.warn("Operation cancelled by user"),null)},Bw=async(e,r)=>await Gw(e)?(r.start(`Tracking progress of ongoing actions with ID: ${e}`),e):(Di.logger.warn("Operation cancelled by user - cannot create new actions while already processing actions"),null),Hw=async()=>{let e=await Ii(),{currentJob:r}=e;return r&&(r.status==="pending"||r.status==="processing")?r.id:null},Gw=async e=>{let{watchOngoing:r}=await is.default.prompt([{type:"confirm",name:"watchOngoing",message:`You already have ongoing actions with ID: (${e}). No new actions will be created until the ongoing actions are completed. Would you like to track the ongoing actions?`,default:!0}]);return r},Ww=`
|
|
43
66
|
\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
|
|
44
67
|
\u2502 \u26A0\uFE0F CRITICAL WARNING \u2502
|
|
45
68
|
\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524
|
|
@@ -49,24 +72,23 @@ ${u}`),new Error(l)}await new Promise(l=>setTimeout(l,dv))}},pv=async r=>(await
|
|
|
49
72
|
\u2502 Some operations are inherently irreversible \u2014 even if \u2502
|
|
50
73
|
\u2502 performed manually through App Store Connect. \u2502
|
|
51
74
|
\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
|
|
52
|
-
`,
|
|
75
|
+
`,Yw=async()=>{Di.logger.std(Ww);let{confirmed:e}=await is.default.prompt([{type:"confirm",name:"confirmed",message:"Do you want to proceed with applying these changes?",default:!1}]);return e};var Up=L(require("ora")),Vw=`
|
|
53
76
|
\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510
|
|
54
77
|
\u2502 This may take up to 30 minutes depending on the changes. \u2502
|
|
55
78
|
\u2502 Processing continues on our servers even if CLI is closed. \u2502
|
|
56
79
|
\u2502 You can rerun the same command to check current status. \u2502
|
|
57
80
|
\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
|
|
58
81
|
|
|
59
|
-
`,
|
|
82
|
+
`,Kw={command:"apply",describe:"Apply the changes to App Store Connect",builder:{file:{alias:"f",describe:`Path to the desired state JSON file. Defaults to ${yr.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"},preview:{alias:"p",describe:"Show what changes would be made without applying them (i.e., perform a 'dry run' preview only).",type:"boolean",default:!1}},handler:async e=>{let r=e.preview,t=process.env.dryRun==="true",n=(0,yr.validateFileExists)(e.file,{fileDescription:"desired state JSON file"});yr.logger.debug(`Processing desired state from ${n}...`),t&&yr.logger.debug("Dry run mode enabled - no actual changes will be applied to App Store Connect");let i=(0,Up.default)("Generating actions...").start();try{let a=(0,qp.validateAppStoreModel)((0,$p.removeShortcuts)((0,Lp.readJsonFile)(n)),!1,"apply"),s=await oe.post("/diff",{desiredState:a}),{plan:u,currentState:d}=s.data.data;if(u.length===0){i.succeed("No changes to apply. Your configuration is up to date. Exiting...");return}if(i.stop(),await Np(u),r){yr.logger.info("Preview mode - no changes will be applied");return}let h=await Cp(u,d,a,t,i);if(h){let{jobId:y,newJobCreated:b}=h;i.prefixText=Vw,await Ip(y,i,b?u:void 0)}}catch(a){throw i.stop(),a}}},jp=Kw;var Jt=L(K()),Fp=L(require("fs")),kp=L(require("inquirer"));var zp=L(require("ora"));async function Jw(){return(await oe.get("/fetch-apps")).data.data}async function Zw(e){let r=e.map((n,i)=>({name:`${i+1}. ${n.name}`,value:n})),{selectedApp:t}=await kp.default.prompt([{type:"list",name:"selectedApp",message:"Select the app you want to fetch:",choices:r}]);return Jt.logger.info(`Selected: ${t.name} (ID: ${t.id})`),t.id}var Xw={command:"fetch",describe:"Fetches the app from App Store Connect.",builder:{id:{describe:"The App ID to fetch details for. If not provided, you'll be prompted to select from available apps.",demandOption:!1,type:"string"},file:{alias:"f",describe:`Path to the output JSON file. Defaults to ${Jt.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:async e=>{let r=e.id,t=e.file||Jt.DEFAULT_CONFIG_FILENAME,n=(0,zp.default)();try{if(!r){n.start("No app ID provided. Fetching available apps...");let s=await Jw();s.length===0&&(n.fail("No IOS apps found in your App Store Connect account"),process.exit(1)),n.stop(),r=await Zw(s)}n.start(`Fetching details for app ID: ${r} and writing to ${t}`);let a=(await oe.post("/fetch",{appId:r})).data.data;Fp.writeFileSync(t,JSON.stringify(a,null,2)),n.succeed(`Successfully fetched app: ${t}`)}catch(i){throw n.stop(),i}}},Bp=Xw;var ih=L(require("fs")),Qe=L(K()),ah=L(K()),oh=L(K());var Wp=L(require("inquirer")),Ci=L(K());function Hp(e){switch(e){case"inAppPurchase":return"In App Purchase";case"subscription":return"Subscription";case"offer":return"Offer";case"app":return"App"}}function Gp(e){if(e.type!=="offer"||!e.offerType)return`"${e.name}"`;let r=e.offerType.replace(/_/g," ").toLowerCase();return`"${r.charAt(0).toUpperCase()+r.slice(1)}" | belongs to "${e.parentName}"`}async function Qw(e){let r=e.map((i,a)=>{let s=`"${i.name}"`;return i.type==="offer"&&(s=Gp(i)),{name:`${Hp(i.type)}: ${s} (ID: ${i.id})`,value:i}}),{selectedItem:t}=await Wp.default.prompt([{type:"list",name:"selectedItem",message:"Select an item:",choices:r}]),n=t.type==="offer"?Gp(t):`"${t.name}"`;return Ci.logger.info(`\u2705 Selected: ${Hp(t.type)}: ${n} (ID: ${t.id})`),t}async function Yp(e,r=Ci.collectPricingItems,t=Qw){let n=r(e);if(n.length===0)throw new Error("No items available for pricing. Please ensure the app contains items with pricing information (app, in-app purchase, or subscription).");return await t(n)}var Kp=L(require("inquirer")),Jp=L(K());function Vp(e){let r=e.trim();if(!/^\d+(\.\d{1,2})?$/.test(r))return null;let t=Number(r);return!isFinite(t)||t<0?null:t}function eE(e,r,t){return r.map(i=>({price:i,diff:Math.abs(Number(i)-e)})).sort((i,a)=>i.diff-a.diff).slice(0,Math.max(0,t)).map(i=>i.price).sort((i,a)=>Number(i)-Number(a))}async function Zp(e,r,t){let n;n=await t(e,r.appId,Jp.BASE_TERRITORY);let i=Array.from(new Set((n||[]).map(b=>({id:b.id,price:Number(b.price)})).filter(b=>Number.isFinite(b.price)&&b.price>=0).map(b=>({id:b.id,price:b.price.toFixed(2)})))).sort((b,_)=>Number(b.price)-Number(_.price));if(!n.length)throw new Error("No available Apple price points found. This is unexpected. Please try again.");let a=b=>{let _=Vp(b);if(_===null)return"\u274C Invalid format. Please enter a non-negative number with up to 2 decimals (e.g., 5.99).";let S=_.toFixed(2);if(i.length&&!i.some(g=>g.price===S)){let g=eE(_,i.map(T=>T.price),20),w=`\u274C The price ${S} is not an available Apple price.`;return g.length&&(w+=`
|
|
60
83
|
Closest available prices:
|
|
61
|
-
${
|
|
84
|
+
${g.join(" | ")}`),w}return!0},{price:s}=await Kp.default.prompt([{type:"input",name:"price",message:"Enter base price in USD (e.g., 5.99):",validate:a}]),d=Vp(s).toFixed(2),h=i.find(b=>b.price===d),y=n.find(b=>b.id===h?.id);if(y)return y;throw new Error(`Price point not found for price ${d}`)}var Xp=L(require("inquirer"));async function Qp(){let{strategy:e}=await Xp.default.prompt([{type:"list",name:"strategy",message:"Select pricing strategy:",choices:[{name:"Apple (uses Apple's standard pricing tiers)",value:"apple"},{name:"Purchasing Power (uses local purchasing power parity for fair pricing)",value:"purchasingPower"}]}]);return e}var eh=L(require("inquirer")),rh=L(K());async function th(e,r){if(e==="apple")return;let t="=".repeat(50),n=["Enter optional Minimum Price in USD so that no price is below this threshold."];rh.logger.info(`
|
|
62
85
|
${t}
|
|
63
|
-
${
|
|
86
|
+
${n.join(`
|
|
64
87
|
`)}
|
|
65
|
-
${t}`);let
|
|
66
|
-
`);
|
|
67
|
-
Latest Actions \u2192 ID: ${
|
|
68
|
-
Error: ${
|
|
69
|
-
`+t.help()),process.exit(1)}).help().argv;
|
|
88
|
+
${t}`);let i=u=>{let d=u.trim();if(d==="")return!0;let h=parseFloat(d);if(isNaN(h)||h<0)return"\u274C Invalid price. Please enter a non-negative number or press Enter to skip.";let y=parseFloat(r);return h>=y?`\u274C Minimum price (${d}) must be less than base price (${r}). Please enter a lower value or press Enter to skip.`:!0},{minimumPrice:a}=await eh.default.prompt([{type:"input",name:"minimumPrice",message:"Minimum price in USD (optional, press Enter to skip):",validate:i}]),s=a.trim();return s===""?void 0:s}async function nh(e){let{appStoreState:r,fetchTerritoryPricePointsForSelectedItem:t}=e,n=await Yp(r),i=await Zp(n,r,t),a=await Qp(),s=await th(a,i.price);return{appId:r.appId,selectedItem:{type:n.type,id:n.id,name:n.name,offerType:n.offerType},basePricePoint:i,pricingStrategy:a,minimumPrice:s}}var Li=L(K());var sh=L(require("ora"));async function rE(e,r,t){return(await oe.post("/price-points",{selectedItem:e,appId:r,territoryId:t})).data.data.pricePoints}async function tE(e,r){return(await oe.post("/apply-pricing",{appStoreState:e,pricingRequest:r})).data.data.updatedState}var nE={command:"set-price",describe:"Set prices for apps, in-app purchases, and subscriptions using interactive prompts",builder:{file:{alias:"f",describe:`Path to the store config JSON file - will be updated in place. Defaults to ${Qe.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"}},handler:async e=>{Qe.logger.warn("this command will be available soon")}},uh=nE;var Te=L(K());var lh=L(require("fs"));function iE(e){return e.item.name}var aE=["Territory","Local Price","Local Currency","USD Price","Relative to USA (%)"];function oE(e,r){let t=[];t.push(["Name",...aE].join(",")),e.forEach(i=>{i.prices.forEach(a=>{t.push(`${iE(i)},${a.territory},${a.localPrice},${a.localCurrency},${a.usdPrice.toFixed(2)},${a.usdPercentage.toFixed(0)}`)})});let n=t.join(`
|
|
89
|
+
`);lh.writeFileSync(r,n,"utf8")}function ch(e,r){let t=r.toLowerCase().split(".").pop();if(!t||t!=="csv")throw new Error(`Unsupported file format. Please use ".csv" extension: "${r}"`);oE(e,r)}var sE={command:"compare-price",describe:"Compare prices across territories in USD",builder:{file:{alias:"f",describe:`Path to the input JSON file with app store data. Defaults to ${Te.DEFAULT_CONFIG_FILENAME} in current directory.`,demandOption:!1,type:"string"},output:{alias:"o",describe:"Path to the output file for price comparison analysis (.csv). Defaults to compare-price.csv in current directory.",demandOption:!1,type:"string"}},handler:async e=>{Te.logger.warn("this command will be available soon")}},fh=sE;var kr=L(K()),ph=L(require("inquirer")),hh=L(require("fs")),gh=L(require("path")),uE=[{key:"minimal",name:"Minimal App"},{key:"full",name:"Full App"},{key:"subscription",name:"Subscription"},{key:"in-app-purchase",name:"In-App Purchase"}];function dh(e){let r=gh.parse(e),t=r.ext,n=r.name;return t?`${n}_example${t}`:`${e}_example`}async function lE(){let e=uE.map((t,n)=>({name:`${n+1}. ${t.name}`,value:t.key})),{selectedType:r}=await ph.default.prompt([{type:"list",name:"selectedType",message:"Select the example type you want to generate:",choices:e}]);return r}var mh=[{productId:"com.mycompany.myapp.premium.monthly",referenceName:"Monthly Premium",groupLevel:2,subscriptionPeriod:"ONE_MONTH",familySharable:!1,reviewNote:"Monthly premium subscription with free trial",pricing:{baseTerritory:"USA",prices:[{price:"3.99",territory:"USA"}]},introductoryOffers:[{type:"FREE_TRIAL",duration:"ONE_WEEK",availableTerritories:"worldwide"}],availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Monthly Premium",description:"Monthly access to premium features"},{locale:"es-ES",name:"Premium Mensual",description:"Acceso mensual a funciones premium"}]},{productId:"com.mycompany.myapp.premium.yearly",referenceName:"Yearly Premium",groupLevel:1,subscriptionPeriod:"ONE_YEAR",familySharable:!1,reviewNote:"Yearly premium subscription with pay as you go",pricing:{baseTerritory:"USA",prices:[{price:"20.99",territory:"USA"}]},introductoryOffers:[{type:"PAY_AS_YOU_GO",numberOfPeriods:1,pricing:{baseTerritory:"USA",prices:[{price:"10.99",territory:"USA"}]},availableTerritories:"worldwide"}],availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Yearly Premium",description:"Yearly access to premium features"},{locale:"es-ES",name:"Premium Anual",description:"Acceso anual a funciones premium"}]}],cE={referenceName:"Premium Subscriptions",localizations:[{locale:"en-US",name:"Premium Subscriptions"},{locale:"es-ES",name:"Suscripciones Premium"}],subscriptions:mh},as=[{productId:"com.mycompany.myapp.premium",type:"NON_CONSUMABLE",referenceName:"Premium",familySharable:!1,reviewNote:"Premium features unlock",pricing:{baseTerritory:"USA",prices:[{price:"49.99",territory:"USA"}]},availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Premium Upgrade",description:"Unlock all premium features"},{locale:"es-ES",name:"Premium",description:"Acceso a todas las funciones premium"}]},{productId:"com.mycompany.myapp.consumable",type:"CONSUMABLE",referenceName:"Coins",familySharable:!1,reviewNote:"Coins",pricing:{baseTerritory:"USA",prices:[{price:"2.99",territory:"USA"}]},availability:{availableInNewTerritories:!0,availableTerritories:"worldwide"},localizations:[{locale:"en-US",name:"Coins",description:"Coins to spend in the app"}]}],yh={schemaVersion:"1.0.0",appId:"1234567890",versionString:"2.1.17",pricing:{baseTerritory:"USA",prices:[{price:"0.99",territory:"USA"}]},availableTerritories:"worldwide",inAppPurchases:as,subscriptionGroups:[cE],primaryLocale:"en-US",localizations:[{locale:"en-US",name:"My App",subtitle:"The best app ever",description:"The best app ever in the whole world",keywords:"best,app,ever",promotionalText:"The best app ever in the whole world",privacyPolicyUrl:"https://mycompany.com/privacy",privacyChoicesUrl:"https://mycompany.com/privacy-choices",marketingUrl:"https://mycompany.com/marketing",supportUrl:"https://mycompany.com/support",whatsNew:"Bug fixes and improvements"}],copyright:"\xA9 2025 My Company"},fE={...yh,pricing:{baseTerritory:"USA",prices:[{price:"0.0",territory:"USA"}]},inAppPurchases:void 0,subscriptionGroups:void 0},dE={command:"example",describe:"Generate example JSON files for different data types",builder:{type:{alias:"t",describe:"Type of example to generate",choices:["minimal","full","subscription","iap","in-app-purchase"],type:"string"},file:{alias:"f",describe:`Path to the output JSON file. Defaults to ${dh(kr.DEFAULT_CONFIG_FILENAME)} in current directory.`,demandOption:!1,type:"string"}},handler:async e=>{let r=e.type,t=e.file||dh(kr.DEFAULT_CONFIG_FILENAME);r||(r=await lE());let i={minimal:fE,full:yh,subscription:mh,iap:as,"in-app-purchase":as}[r];if(!i)throw new Error(`Unknown example type: ${r}`);try{hh.writeFileSync(t,JSON.stringify(i,null,2)),kr.logger.info(`Successfully generated example and wrote to ${t}`)}catch(a){throw new kr.ContextualError("Failed to write example file",a)}}},vh=dE;var wh=L(K());var bh=L(require("inquirer"));async function _h(){let{secretKey:e}=await bh.default.prompt([{type:"password",name:"secretKey",message:"Enter your StoreConfig Secret Key:",mask:"*"}]);return e.trim()}var pE={command:"configure",describe:"Configure StoreConfig with the Secret Key",handler:async e=>{let r=await _h();if(!r)throw new Error("Secret key cannot be empty");Kt.saveKey(r),wh.logger.info("\u2705 Secret key saved successfully! Add Apple credentials now (storeconfig apple) if you haven't already.")}},Eh=pE;var Sh=L(require("fs")),vr=L(K());var os=class{constructor(){}async configureAppleCredentials(r,t,n){(0,vr.validateFileExists)(n,{fileDescription:"Apple private key (.p8 file)"});let i=this.readPrivateKeyFile(n);this.validatePrivateKey(i),vr.logger.info("Sending Apple credentials to backend..."),await this.sendCredentialsToBackend(r,t,i),vr.logger.info("\u2705 Apple credentials stored successfully!")}readPrivateKeyFile(r){try{return Sh.default.readFileSync(r,"utf8")}catch(t){throw new vr.ContextualError(`Failed to read private key file at ${r}`,t)}}validatePrivateKey(r){if(!r.includes("BEGIN PRIVATE KEY")&&!r.includes("BEGIN RSA PRIVATE KEY"))throw new Error("Invalid private key file, the file does not appear to be a valid Apple private key (.p8 file)")}async sendCredentialsToBackend(r,t,n){let i=await oe.post("/auth",{keyId:t,issuerId:r,privateKey:n});i.data.message&&vr.logger.info(i.data.message)}},Oh=new os;var hE={command:"apple",describe:"Add Apple credentials",builder:{"issuer-id":{describe:"Apple App Store Connect Issuer ID",demandOption:!0,type:"string"},"key-id":{describe:"Apple App Store Connect Key ID",demandOption:!0,type:"string"},"key-path":{describe:"Path to Apple private key (.p8 file)",demandOption:!0,type:"string"}},handler:async e=>{let r=e["issuer-id"],t=e["key-id"],n=e["key-path"];await Oh.configureAppleCredentials(r,t,n)}},Ph=hE;var Ah=L(K());var gE={command:"user",describe:"Display current user information and latest job status",builder:{},handler:async()=>{let e=await Ii(),r="";r+=`Email \u2192 ${e.user.email}`,e.currentJob&&(r+=`
|
|
90
|
+
Latest Actions \u2192 ID: ${e.currentJob.id}, Status: ${e.currentJob.status}`,e.currentJob.error&&(r+=`
|
|
91
|
+
Error: ${e.currentJob.error}`)),Ah.logger.std(r)}},Th=gE;process.env.DOTENV_CONFIG_SILENT="true";xh.default.config();zr.logger.setOutputModes([{mode:"console",showErrorStack:!1}]);zr.logger.setLevel("info");async function mE(){await(0,Mh.default)((0,Rh.hideBin)(process.argv)).middleware(r=>{let t=["fetch","apply","set-price","compare-price","apple","user"],n=r._[0];t.includes(n)&&Rp()}).command(Pp).command(jp).command(Bp).command(uh).command(fh).command(vh).command(Eh).command(Ph).command(Th).demandCommand(1,"Please specify a command").strict().fail(async(r,t,n)=>{r&&(zr.logger.error(r,"Use 'storeconfig --help' to see available commands and options."),process.exit(1))}).help().parseAsync()}mE().catch(e=>{let r="unknown";try{r=(process.argv?.slice(2)||[])[0]||"unknown"}catch{r="unknown"}let t=(0,zr.processNestedErrors)(e,!1);zr.logger.error(`Command '${r}' failed`,t),Nh.default.notify(e,n=>{n.addMetadata("metadata",{command:r,context:t})}),process.exitCode=1});
|
|
70
92
|
/*! Bundled license information:
|
|
71
93
|
|
|
72
94
|
safe-buffer/index.js:
|