@coze/cli 0.3.3-alpha.471664 → 0.3.3-alpha.f035aa
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/lib/cli.js +1 -1
- package/lib/fetch-client-DmaLBNmf.js +1 -0
- package/lib/{index-DuCvbCp4.js → index-CEfCTKR1.js} +1 -1
- package/lib/send-message.worker.js +1 -1
- package/lib/session-task-refresh.worker.js +1 -1
- package/lib/{task-worker-DydgmGrB.js → task-worker-DXd41LkV.js} +1 -1
- package/package.json +1 -1
- package/skills/manifest.json +6 -6
- package/skills/using-coze-cli/SKILL.md +1 -2
- package/skills/using-coze-cli/coze-claw/MODULE.md +1 -1
- package/skills/using-coze-cli/coze-code/MODULE.md +1 -1
- package/skills/using-coze-cli/coze-file/MODULE.md +1 -1
- package/skills/using-coze-cli/coze-generate/MODULE.md +1 -1
- package/lib/fetch-client-DtaPMDxl.js +0 -1
package/lib/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";const e=require("./fetch-client-DtaPMDxl.js"),t=require("./index-DuCvbCp4.js"),o=require("chalk"),i=require("node:child_process"),s=require("./task-worker-DydgmGrB.js"),n=require("node:path"),r=require("node:fs/promises"),a=require("node:fs"),c=require("node:crypto"),l=require("node:http"),d=require("node:https"),p=require("node:buffer"),u=require("undici"),m=require("ws"),g=require("node:os"),h=require("path"),f=require("fs/promises"),_=require("fs"),y=require("form-data"),b=require("omelette"),v=require("child_process"),w=require("lodash"),E=require("commander");function C(e){const t=Object.create(null);if(e)for(const o in e)if("default"!==o){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:function(){return e[o]}})}return t.default=e,Object.freeze(t)}require("crypto"),require("url"),require("net"),require("tls"),require("assert"),require("tty"),require("util"),require("events"),require("http"),require("https"),require("http2"),require("stream"),require("zlib"),require("mitt"),require("process");const I=C(n),A=C(r);function S(e,t){return null!=e?e:t()}class k{format(e){const t=JSON.stringify(e,null,2);return t.endsWith("\n")?t:`${t}\n`}formatError(e){const t={code:e.code,errorName:S(e.errorName,(()=>"UNKNOWN_ERROR")),desc:S(e.desc,(()=>e.message)),trigger:S(e.trigger,(()=>null)),fix:S(e.fix,(()=>null)),example:S(e.example,(()=>null))},o=JSON.stringify(t,null,2);return o.endsWith("\n")?o:`${o}\n`}}function j(e,t){return null!=e?e:t()}function P(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}function z(e){const t=String.fromCharCode(27),o=new RegExp(`${t}(?:[@-Z\\\\-_]|\\[[0-?]*[ -/]*[@-~])`,"g");return e.replace(o,"")}function T(e){return e>=4352&&e<=4447||(9001===e||9002===e||(e>=11904&&e<=12350||(e>=12352&&e<=42191||(e>=44032&&e<=55203||(e>=63744&&e<=64255||(e>=65040&&e<=65049||(e>=65072&&e<=65135||(e>=65280&&e<=65376||(e>=65504&&e<=65510||(e>=127744&&e<=129695||e>=131072&&e<=262141))))))))))}function R(e){const t=z(e);if(!t)return 0;const o=/[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/u;let i=0;const s=Array.from(t);for(let e=0;e<s.length;e+=1){const t=j(s[e],(()=>""));if(o.test(t))continue;const n=t.codePointAt(0);void 0!==n&&(i+=T(n)?2:1)}return i}function x(e,t){const o=R(e);return o>=t?e:`${e}${" ".repeat(t-o)}`}function L(e,t){if(t<=0)return"";if(R(e)<=t)return e;if(1===t)return"…";const o=z(e),i=Array.from(o),s=Math.max(0,t-R("…"));let n="",r=0;for(let e=0;e<i.length;e+=1){const t=j(i[e],(()=>"")),o=R(t);if(r+o>s)break;n+=t,r+=o}return`${n}…`}function O(e,t={}){if(0===e.length)return"";const o=function(e,t){if(0===e.length)return[];const o=new Set,i=[],s=j(e[0],(()=>({})));for(const e of Object.keys(s))o.has(e)||(o.add(e),i.push(e));for(const t of e)for(const e of Object.keys(t))o.has(e)||(o.add(e),i.push(e));const n=[];for(const t of i){let o=R(t);for(const i of e){const e=i[t],s=void 0===e?"":String(e);o=Math.max(o,R(s))}n.push({key:t,width:o})}const r=j(t.columnGap,(()=>2)),a=j(j(t.maxWidth,(()=>process.stdout.columns)),(()=>120)),c=Math.max(1,Math.floor((a+r)/(6+r))),l=Math.min(j(t.maxColumns,(()=>c)),c);n.length>l&&n.splice(l);const d=Math.max(0,a-r*Math.max(0,n.length-1));for(;n.reduce(((e,t)=>e+t.width),0)>d;){let e=-1,t=-1;for(let o=0;o<n.length;o+=1){const i=j(P([n,"access",e=>e[o],"optionalAccess",e=>e.width]),(()=>0));i>t&&(t=i,e=o)}if(-1===e)break;const o=j(P([n,"access",t=>t[e],"optionalAccess",e=>e.width]),(()=>0));if(o<=6)break;n[e]={...n[e],width:o-1}}for(let e=0;e<n.length;e+=1){const t=n[e];t&&(n[e]={...t,width:Math.max(6,t.width)})}return n}(e,t);if(0===o.length)return"";const i=j(t.columnGap,(()=>2)),s=" ".repeat(i),n=o.map((e=>x(L(e.key,e.width),e.width))).join(s),r=o.map((e=>"-".repeat(e.width))).join(s),a=[];for(const t of e){const e=o.map((e=>{const o=t[e.key];return x(L(void 0===o?"":String(o),e.width),e.width)}));a.push(e.join(s))}return`${[n,r,...a].join("\n")}\n`}function D(e,t={}){const o=Object.entries(e);if(0===o.length)return"";let i=0;for(const[e]of o)i=Math.max(i,R(e));const s=j(j(t.maxWidth,(()=>process.stdout.columns)),(()=>120)),n=j(t.columnGap,(()=>2)),r=j(t.minValueWidth,(()=>12));let a=Math.min(i,j(t.keyMaxWidth,(()=>32)));const c=Math.max(6,s-n-r);a=Math.min(a,c);const l=Math.max(0,s-a-n),d=" ".repeat(n);return`${o.map((([e,t])=>{const o=x(L(e,a),a),i=(void 0===t?"undefined":null===t?"null":String(t)).replace(/\s*\n\s*/g," "),s=l>0?L(i,l):"";return`${o}${d}${s}`})).join("\n")}\n`}function U(e,t="",o=0){const i={};if(null==e)return i;if("object"!=typeof(s=e)||null===s||Array.isArray(s))return i;var s;for(const[s,n]of Object.entries(e)){const e=t?`${t}.${s}`:s;if(null!=n)if(Array.isArray(n))o>=5?i[e]="[Array]":0===n.length?i[e]="[]":n.every((e=>"object"!=typeof e||null===e))?i[e]=n.map((e=>{return String((o=()=>"null",null!=(t=e)?t:o()));var t,o})).join(", "):i[e]="[Array]";else if("object"!=typeof n)i[e]=n;else if(o>=5)i[e]="[Object]";else{const t=U(n,e,o+1);Object.assign(i,t)}else i[e]=n}return i}function q(e,t){return null!=e?e:t()}function B(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}class M{format(e){if(null===e)return"null\n";if(void 0===e)return"undefined\n";if(Array.isArray(e)){if(0===e.length)return"\n";if(t=e,Array.isArray(t)&&t.length>0&&t.every(B)){return O(e.map((e=>U(e))))}return function(e){return Array.isArray(e)&&e.length>0&&e.every((e=>null==e||"object"!=typeof e))}(e)?`${e.map((e=>String(q(e,(()=>"null"))))).join("\n")}\n`:"[Array]\n"}var t;if(B(e)){const t=U(e);return 0===Object.keys(t).length?"{}\n":D(t)}return`${String(e)}\n`}formatError(e){const t=[],o=q(e.errorName,(()=>"UNKNOWN_ERROR")),i=q(e.desc,(()=>e.message));return t.push(`ERROR [${e.code}] ${o}: ${i}`),e.trigger&&t.push(` Trigger: ${e.trigger}`),e.fix&&t.push(` Fix: ${e.fix}`),e.example&&t.push(` Example: ${e.example}`),e.details&&(t.push(" Error Details:"),t.push(`${function(e,t){if(null==e)return"";if("string"==typeof e)return`${t}${e}\n`;if(Array.isArray(e))return 0===e.length?"":`${e.map((e=>"object"==typeof e&&null!==e?D(U(e)):String(e))).map((e=>`${t}- ${e.trim()}`)).join("\n")}\n`;if(B(e)){const o=U(e);return 0===Object.keys(o).length?"":`${D(o).split("\n").filter((e=>e.trim())).map((e=>`${t}${e}`)).join("\n")}\n`}return`${t}${String(e)}\n`}(e.details," ")}`)),`${t.join("\n")}\n`}}function N(e,t){return null!=e?e:t()}function $(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}function G(e,t){if(null==e)return;const o=String(e).replace(/\s*\n\s*/g," ").replace(/\s+/g," ").trim();return o?o.length<=t?o:`${o.slice(0,Math.max(0,t-3))}...`:void 0}function F(e){const t=$([e,"optionalAccess",e=>e.help,"optionalAccess",e=>e.errors]);if(t&&t.length>0)return t;const o=$([e,"optionalAccess",e=>e.errors]);return Array.isArray(o)?o:void 0}function V(t,o){const i=N(t.trigger,(()=>function(e){if(!e||0===e.length)return;return G(("coze"===e[0]?e:["coze",...e]).join(" "),150)}($([o,"optionalAccess",e=>e.argv])))),s=$([F,"call",e=>e($([o,"optionalAccess",e=>e.commandConfig])),"optionalAccess",e=>e.find,"call",e=>e((e=>e.code===t.code))]),n=N($([s,"optionalAccess",e=>e.name]),(()=>e.ErrorNameByCode[t.code])),r=N(G(n,80),(()=>"UNKNOWN_ERROR"));let a=n;t.isMessageExplicit&&t.message.trim()?a=t.message:$([s,"optionalAccess",e=>e.desc])&&(a=s.desc);const c=N(G(a,200),(()=>"An unexpected error occurred")),l=N(G(t.fix,150),(()=>G($([s,"optionalAccess",e=>e.fix]),150))),d=N(G(t.example,150),(()=>G($([s,"optionalAccess",e=>e.example]),150)));return{code:t.code,errorName:r,desc:c,trigger:i,fix:l,example:d}}function W(e,t){const o=V(e,t);return e.errorName=o.errorName,e.desc=o.desc,e.message=o.desc,e.trigger=o.trigger,e.fix=o.fix,e.example=o.example,e}function H(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}var J;function K(o,i,s,n){if(o instanceof e.CozeError)throw o;if(e.isHttpError(o)){const e=H([o,"access",e=>e.response,"optionalAccess",e=>e.status]);if("ECONNREFUSED"===o.code||"ETIMEDOUT"===o.code||"number"==typeof e&&e>=500)throw o}if(o instanceof t.ChatCoreError&&"number"==typeof H([o,"access",e=>e.ext,"optionalAccess",e=>e.code])&&o.ext.code>=500)throw o;throw new e.CozeError(i,s,{...n,cause:o instanceof Error?o.message:String(o)})}!function(e){e[e.NOT_LOGIN=700012006]="NOT_LOGIN"}(J||(J={}));const Q=(o,i)=>{const s=W(function(o){if(o instanceof e.CozeError)return o;if(o instanceof t.ChatCoreError){const{ext:t}=o;let i=e.ErrorCode.E5000;"number"==typeof t.code&&(t.code===J.NOT_LOGIN?i=e.ErrorCode.E2001:t.code>=500&&(i=e.ErrorCode.E5002));const{message:s}=o;return new e.CozeError(i,s,t)}if(e.isHttpError(o)){const t=o.toJSON();let i=e.ErrorCode.E5000;const s=H([o,"access",e=>e.response,"optionalAccess",e=>e.status]);o.code===J.NOT_LOGIN||401===s?i=e.ErrorCode.E2001:"ECONNREFUSED"===o.code||"ETIMEDOUT"===o.code?i=e.ErrorCode.E5001:403===s?i=e.ErrorCode.E2003:404===s?i=e.ErrorCode.E3000:429===s?i=e.ErrorCode.E4001:s&&s>=500&&(i=e.ErrorCode.E5002);const n=H([o,"access",e=>e.response,"optionalAccess",e=>e.headers,"optionalAccess",e=>e["x-tt-logid"]]),{message:r}=o;return new e.CozeError(i,r,{logId:n,...t})}return o instanceof Error?new e.CozeError(e.ErrorCode.E5000,o.message,o.stack):"string"==typeof o?new e.CozeError(e.ErrorCode.E5000,o):new e.CozeError(e.ErrorCode.E5000,"An unexpected error occurred")}(o),i?{argv:i.argv,commandConfig:i.commandConfig}:void 0);var n,r;if(s.code===e.ErrorCode.E2001&&process.stdout.write(`${n=s.desc,r=()=>s.message,null!=n?n:r()}\n`),i)i.response.eprint(s);else{const e=new M;process.stderr.write(e.formatError(s))}process.exit(e.exitCodeForError(s.code))};const Y="@coze/cli",Z="0.3.3-alpha.471664",X=Y;function ee(){const e=[{pm:"npm",cmd:`npm ls -g ${X} --json 2>/dev/null`},{pm:"pnpm",cmd:`pnpm ls -g ${X} --json 2>/dev/null`},{pm:"yarn",cmd:"yarn global list --json 2>/dev/null"}];for(const{pm:t,cmd:o}of e)try{if(i.execSync(o,{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).includes(X))return t}catch(e){}return"npm"}function te(e,t){return null!=e?e:t()}function oe(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}const ie=Y,se=6e5;function ne(){return Z}function re(e){const t=e.trim().replace(/^v/,"").split("+")[0],o=t.indexOf("-"),i=-1===o?t:t.slice(0,o),s=-1===o?"":t.slice(o+1),n=i.split(".");return{major:parseInt(n[0]||"0",10),minor:parseInt(n[1]||"0",10),patch:parseInt(n[2]||"0",10),prerelease:""===s?[]:s.split(".")}}function ae(e,t){const o=/^\d+$/.test(e),i=/^\d+$/.test(t);if(o&&i){const o=parseInt(e,10)-parseInt(t,10);return 0===o?0:o>0?1:-1}return o?-1:i?1:e===t?0:e>t?1:-1}function ce(e,t){const o=re(e),i=re(t);return o.major!==i.major?o.major>i.major?1:-1:o.minor!==i.minor?o.minor>i.minor?1:-1:o.patch!==i.patch?o.patch>i.patch?1:-1:function(e,t){if(0===e.length&&0===t.length)return 0;if(0===e.length)return 1;if(0===t.length)return-1;const o=Math.max(e.length,t.length);for(let i=0;i<o;i++){const o=e[i],s=t[i];if(void 0===o)return-1;if(void 0===s)return 1;const n=ae(o,s);if(0!==n)return n}return 0}(o.prerelease,i.prerelease)}function le(e,t){return ce(t,e)>0}function de(e,t){return re(t).major>re(e).major}function pe(){if(process.env.COZE_CLI_NO_UPDATE_NOTIFIER)return!0;const e=te(process.env.CI,(()=>"")).toLowerCase();return""!==e&&"false"!==e&&"0"!==e||function(e){return!e||"0.0.0"===e||/dev/i.test(e)}(ne())}function ue(e){const t=oe([e,"access",e=>e.upgrade,"optionalAccess",e=>e.mode]);return"auto"===t||"notify"===t||"off"===t?t:"auto"}function me(e){return oe([e,"access",e=>e.upgrade,"optionalAccess",e=>e.channel])||"latest"}async function ge(t,o=!1,n="latest"){const r=ne(),{config:a}=t,c=oe([a,"access",e=>e.upgrade,"optionalAccess",e=>e.cache]);if(!o&&oe([c,"optionalAccess",e=>e.latestVersion])&&c.checkedAt&&Date.now()-c.checkedAt<144e5&&te(c.channel,(()=>"latest"))===n)return{currentVersion:r,latestVersion:c.latestVersion,hasUpdate:le(r,c.latestVersion)};const l=function(){try{return i.execSync("npm config get registry",{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim().replace(/\/+$/,"")}catch(e){return"https://registry.npmjs.org"}}(),d=await async function(t,o="latest"){const i=`${t}/${ie}/${o}`,s=await e.customFetch.fetch(i,{headers:{accept:"application/json"}});if(!s.ok)throw new Error(`Failed to fetch latest version: ${s.status} ${s.statusText}`);return(await s.json()).version}(l,n);return await s.saveConfig({upgrade:{cache:{latestVersion:d,checkedAt:Date.now(),channel:n}}},a.configScope),{currentVersion:r,latestVersion:d,hasUpdate:le(r,d)}}async function he(e,t){const o=function(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}([e,"access",e=>e.config,"access",e=>e.upgrade,"optionalAccess",e=>e.cache,"optionalAccess",e=>e.lastAttempt]);if(o&&Date.now()-o<se)return;try{await s.saveConfig({upgrade:{cache:{lastAttempt:Date.now()}}},e.config.configScope)}catch(e){}const n=ee(),{command:r,args:a}=function(e,t){const o=`${X}@${t}`;switch(e){case"pnpm":return{command:"pnpm",args:["add","-g",o]};case"yarn":return{command:"yarn",args:["global","add",o]};default:return{command:"npm",args:["install","-g",o]}}}(n,t);try{i.spawn(r,a,{detached:!0,stdio:"ignore",shell:"win32"===process.platform}).unref()}catch(e){}}function fe(e,t){return null!=e?e:t()}function _e(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}const ye={claude:"claude-code"};let be=null;function ve(){if(be)return be;const t=function(){let e=__dirname;for(let t=0;t<12;t++){const t=n.join(e,"node_modules","skills","package.json");if(a.existsSync(t))return n.dirname(t);const o=n.dirname(e);if(o===e)break;e=o}}();if(t){const o=e.safeJsonParse(a.readFileSync(n.join(t,"package.json"),"utf8")),i="string"==typeof _e([o,"optionalAccess",e=>e.bin])?o.bin:_e([o,"optionalAccess",e=>e.bin,"optionalAccess",e=>e.skills]);if(i)return be={cmd:process.execPath,prefix:[n.join(t,i)]},be}return be={cmd:"skills",prefix:[]},be}function we(e){const{cmd:t,prefix:o}=ve(),s=i.spawnSync(t,[...o,...e],{encoding:"utf8"});return{ok:0===s.status,stdout:fe(s.stdout,(()=>"")),stderr:fe(s.stderr,(()=>"")),code:s.status}}function Ee(e,t={}){const o=["add",e];return t.global&&o.push("-g"),t.yes&&o.push("-y"),t.agents&&t.agents.length>0&&o.push("-a",...t.agents),we(o)}function Ce(e,t={}){const o=["remove",e];return t.global&&o.push("-g"),o.push("-y"),we(o)}function Ie(t={}){const o=["ls","--json"];t.global&&o.push("-g");const i=we(o);if(!i.ok)return[];const s=e.safeJsonParse(i.stdout);return Array.isArray(s)?s:[]}function Ae(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}function Se(){return s.getGlobalSkillLockFile()}async function ke(e){try{return await r.access(e),!0}catch(e){return!1}}async function je(){let t=__dirname;for(let o=0;o<12;o++){const o=n.join(t,"package.json");if(await ke(o)){if("@coze/cli"===Ae([e.safeJsonParse(await r.readFile(o,"utf8")),"optionalAccess",e=>e.name]))return t}const i=n.dirname(t);if(i===t)break;t=i}return n.resolve(__dirname,"..")}async function Pe(){return n.join(await je(),"skills")}async function ze(){return n.join(await je(),"docs","skills")}const Te=new Set(["SKILL.md","MODULE.md"]);function Re(e){return`sha256:${c.createHash("sha256").update(e,"utf8").digest("hex")}`}function xe(e){return Te.has(n.basename(e))}async function Le(e,t=e){const o=await r.readdir(e,{withFileTypes:!0}),i=[];for(const s of o){if(s.name.startsWith("."))continue;const o=n.join(e,s.name);s.isDirectory()?i.push(...await Le(o,t)):s.isFile()&&i.push(n.relative(t,o).split(n.sep).join("/"))}return i.sort()}function Oe(e,t){const o=Ue(e);if(void 0===o)return;const i=new RegExp(`^${t}:\\s*(.+?)\\s*$`,"m"),s=o.match(i);return s?s[1].replace(/^['"]|['"]$/g,"").trim():void 0}function De(e,t){const o=Ue(e);if(void 0===o)return e;const i=`version: ${t}`;let s;return s=/^version:\s*.+$/m.test(o)?o.replace(/^version:\s*.+$/m,i):/^name:\s*.+$/m.test(o)?o.replace(/^(name:\s*.+)$/m,`$1\n${i}`):`${i}\n${o}`,e.replace(o,s)}function Ue(e){if(!e.startsWith("---"))return;const t=e.match(/^---\n([\s\S]*?)\n---/);return t?t[1]:void 0}function qe(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}async function Be(){const e=await Pe();if(await ke(n.join(e,"manifest.json")))return{root:e,source:"bundled"};const t=await ze();if(await ke(t))return{root:t,source:"docs"};throw new Error(`未找到 skill 来源:既无包内 ${e}/manifest.json,也无开发态 ${t}。`)}async function Me(){const t=n.join(await je(),"package.json"),o=e.safeJsonParse(await r.readFile(t,"utf8"));return i=qe([o,"optionalAccess",e=>e.version]),s=()=>"0.0.0",null!=i?i:s();var i,s}async function Ne(){const t=await Pe(),o=n.join(t,"manifest.json");if(await ke(o)){const i=e.safeJsonParse(await r.readFile(o,"utf8")),s=(await Le(t)).filter((e=>"manifest.json"!==e)),a=[];for(const e of s)a.push({rel:e,content:await r.readFile(n.join(t,e),"utf8")});return{manifest:i,files:a,source:"bundled"}}const i=await ze();if(!await ke(i))throw new Error(`未找到 skill 来源:既无包内 ${o},也无开发态 ${i}。`);const s=await Me(),{manifest:a,files:c}=await async function(e,t){const o=await Le(e),i=[],s={};for(const l of o){const o=await r.readFile(n.join(e,l),"utf8"),d=xe(l),p=d?De(o,t):o;i.push({rel:l,content:p}),d&&(s[(a=Oe(p,"name"),c=()=>l,null!=a?a:c())]={path:l,hash:Re(p)})}var a,c;return{manifest:{cliVersion:t,skills:s},files:i}}(i,s);return{manifest:a,files:c,source:"docs"}}async function $e(){try{const t=await r.readFile(Se(),"utf8");return e.safeJsonParse(t)}catch(e){return}}function Ge(e,t){return null!=e?e:t()}function Fe(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}async function Ve(e){try{return Re(await r.readFile(e,"utf8"))}catch(e){return}}function We(e){return[...new Set(Object.values(e.skills).map((e=>e.path.split("/")[0])))]}function He(e){return e[0]?n.dirname(e[0].path):void 0}async function Je(e={}){const{manifest:t}=await Ne(),{root:o}=await Be(),i=We(t),s=await $e(),a=Ie({global:!0}),c=await async function(e,t,o){const i=He(t);if(!i)return[];const s=new Set(t.map((e=>e.name))),r=[];for(const[t,a]of Object.entries(e.skills)){const e=a.path.split("/")[0];if(!s.has(e))continue;const c=await Ve(n.join(i,a.path));if(void 0===c)continue;if(c===a.hash)continue;const l=Fe([o,"optionalAccess",e=>e.skills,"access",e=>e[t],"optionalAccess",e=>e.hash]);void 0!==l&&c===l||r.push(t)}return r}(t,a,s);if(c.length>0&&!e.force)return{blocked:!0,cliVersion:t.cliVersion,sourceRoot:o,linkedTargets:[],skillsOk:!1,unknownTargets:[],modifiedSkills:c};const l=e.targets&&e.targets.length>0&&!e.targets.includes("all")?Ge(e.targets,(()=>[])).map((e=>fe(ye[e],(()=>e)))):void 0;let d=!0;for(const e of i){Ee(n.join(o,e),{global:!0,yes:!0,agents:l}).ok||(d=!1)}const p=Ie({global:!0}),u=p.filter((e=>i.includes(e.name))),m=Fe([u,"access",e=>e[0],"optionalAccess",e=>e.path]),g=[...new Set(u.flatMap((e=>e.agents)))],h=(new Date).toISOString(),f=He(p),_={};for(const[e,o]of Object.entries(t.skills)){const t=f?await Ve(n.join(f,o.path)):void 0;_[e]={hash:Ge(t,(()=>o.hash)),expectedHash:o.hash,installedAt:h}}return await async function(e){const t=Se();await r.mkdir(n.dirname(t),{recursive:!0}),await r.writeFile(t,`${JSON.stringify(e,null,2)}\n`,"utf8")}({version:1,cliVersion:t.cliVersion,installedBin:Ge(process.argv[1],(()=>process.execPath)),poolPath:m,targets:g,skills:_}),{blocked:!1,cliVersion:t.cliVersion,sourceRoot:o,poolPath:m,linkedTargets:g,skillsOk:d,unknownTargets:[],modifiedSkills:[]}}function Ke(e,t,o){return void 0===e?"missing":e===t?"ok":o===e?"drift":"modified"}async function Qe(){const{manifest:e}=await Ne(),t=await $e(),o=Ge(process.argv[1],(()=>process.execPath)),i=Ie({global:!0}),s=He(i),r=new Set(i.map((e=>e.name))),a=[];for(const[o,i]of Object.entries(e.skills)){const e=i.path.split("/")[0],c=Boolean(s)&&r.has(e),l=c?await Ve(n.join(s,i.path)):void 0,d=c?Ke(l,i.hash,Fe([t,"optionalAccess",e=>e.skills,"access",e=>e[o],"optionalAccess",e=>e.hash])):"missing";a.push({name:o,path:i.path,state:d})}const c=Fe([i,"access",e=>e.find,"call",e=>e((e=>r.has(e.name))),"optionalAccess",e=>e.path]);return{lockExists:Boolean(t),cliVersion:e.cliVersion,installedVersion:Fe([t,"optionalAccess",e=>e.cliVersion]),versionMatch:Boolean(t)&&Fe([t,"optionalAccess",e=>e.cliVersion])===e.cliVersion,installedBin:Fe([t,"optionalAccess",e=>e.installedBin]),currentBin:o,binMatch:!Fe([t,"optionalAccess",e=>e.installedBin])||t.installedBin===o,poolPath:c,targets:Ge(Fe([t,"optionalAccess",e=>e.targets]),(()=>[])),skills:a}}async function Ye(){const{manifest:e}=await Ne(),t=We(e),o=Ie({global:!0}),i=[];for(const e of t){const t=o.find((t=>t.name===e));if(!t)continue;Ce(e,{global:!0}).ok&&i.push({name:e,agents:t.agents})}return await async function(){await r.rm(Se(),{force:!0})}(),{removed:i}}async function Ze(){const t=await async function(){const t=n.join(await Pe(),"manifest.json");if(await ke(t)){const o=e.safeJsonParse(await r.readFile(t,"utf8"));if(qe([o,"optionalAccess",e=>e.cliVersion]))return o.cliVersion}return Me()}(),o=await $e();return o?o.cliVersion!==t?{state:"mismatch",cliVersion:t,installedVersion:o.cliVersion,message:`Skills (${o.cliVersion}) are out of sync with CLI (${t}). Run \`coze self skill install\`.`}:{state:"ok",cliVersion:t,installedVersion:o.cliVersion}:{state:"missing",cliVersion:t,message:"Bundled skills not installed yet. Run `coze self skill install` to sync them to your AI tools."}}function Xe(e){const t={};let o;const i=[];let s=!1;for(let n=0;n<e.length;n++){const r=e[n];if("--help"!==r&&"-h"!==r)if("--version"!==r&&"-v"!==r)if("--output"!==r)if("--format"!==r)"--no-color"!==r?"--config"!==r?"--org-id"!==r?"--space-id"!==r?"--verbose"!==r?"--debug"!==r?"--log-file"!==r?"--print-logs"!==r?s||r.startsWith("-")?i.push(r):(o=r,s=!0):t.printLogs=!0:t.logFile=e[++n]:t.debug=!0:t.verbose=!0:t.spaceId=e[++n]:t.orgId=e[++n]:t.config=e[++n]:t.noColor=!0;else{const o=e[++n];"json"!==o&&"text"!==o||(t.format=o)}else t.output=e[++n];else t.version=!0;else t.help=!0}return{globalOptions:t,commandName:o,commandArgs:i}}function et(e,t){return null!=e?e:t()}function ot(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}async function it(e,t){const i=await async function(e){if("self"===Xe(e.argv).commandName)return;const t=function(e){const t=function(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}([e,"access",e=>e.skill,"optionalAccess",e=>e.mode]);return"auto"===t||"notify"===t||"off"===t?t:"auto"}(e.config);if("off"===t)return;if(function(){const e=et(process.env.CI,(()=>"")).toLowerCase();return""!==e&&"false"!==e&&"0"!==e||Boolean(process.env.COZE_CLI_NO_SKILL_NOTIFIER)}())return;try{const o=await Ze();if("ok"===o.state)return;if("auto"===t&&await async function(e){if("mismatch"!==e.state&&"missing"!==e.state)return!1;try{return!(await Je({})).blocked}catch(e){return!1}}(o))return;return"json"===e.format&&e.response.setNotice({skill:{state:o.state,cliVersion:o.cliVersion,installedVersion:o.installedVersion,message:o.message,command:"coze self skill install"}}),o}catch(e){return}}(e),s=await async function(e){if("upgrade"===Xe(e.argv).commandName)return;if(pe())return;const t=ue(e.config);if("off"===t)return;const o=ot([e,"access",e=>e.config,"access",e=>e.upgrade,"optionalAccess",e=>e.cache]),i=ot([o,"optionalAccess",e=>e.latestVersion]);if(!i)return;if(et(o.channel,(()=>"latest"))!==me(e.config))return;const s=ne();if(!le(s,i))return;const n=o.lastAttempt,r="number"==typeof n&&Date.now()-n<se;let a;"auto"===("auto"===t&&de(s,i)?"notify":t)?r?a=`Auto-upgrade to ${i} did not take effect (current ${s}). Run \`coze upgrade\` manually; on an internal network verify your npm registry.`:(a=`Coze CLI ${i} available (current ${s}). Upgrading in the background; it will take effect on next run.`,he(e,i)):a=`Coze CLI ${i} available (current ${s}). Run \`coze upgrade\` to update.`;"json"===e.format&&e.response.setNotice({update:{current:s,latest:i,message:a,command:"coze upgrade"}});return{current:s,latest:i,message:a}}(e);await t(),function(e,t){if(!ot([t,"optionalAccess",e=>e.message]))return;if("json"===e.format)return void(e.response.hasPendingNotice()&&process.stderr.write(`${t.message}\n`));e.ui.info(`\n${t.message}\n`)}(e,i),function(e,t){if(!t)return;if("json"===e.format)return void(e.response.hasPendingNotice()&&process.stderr.write(`${t.message}\n`));e.ui.info(`\n${o.gray(t.current)} → ${o.green(t.latest)} ${t.message}\n`)}(e,s),async function(e){if("upgrade"===Xe(e.argv).commandName)return;if(pe())return;const t=ue(e.config);if("off"===t)return;try{const o=await ge(e,!1,me(e.config));o.hasUpdate&&"auto"===t&&!de(o.currentVersion,o.latestVersion)&&await he(e,o.latestVersion)}catch(e){}}(e)}var st=e.requireSrc();const nt=e.getDefaultExportFromCjs(st);function rt(e){var t,o,i=e.transport,s=e.endpoint,n=e.size,r=void 0===n?10:n,a=e.wait,c=void 0===a?1e3:a,l=[],d=0;function p(){if(l.length){var e=this.getBatchData();i.post({url:s,data:e,fail:function(o){t&&t(o,e)},success:function(){o&&o(e)}}),l=[]}}return{getSize:function(){return r},getWait:function(){return c},setSize:function(e){r=e},setWait:function(e){c=e},getEndpoint:function(){return s},setEndpoint:function(e){s=e},send:function(e){l.push(e),l.length>=r&&p.call(this),clearTimeout(d),d=setTimeout(p.bind(this),c)},flush:function(){clearTimeout(d),p.call(this)},getBatchData:function(){return l.length?(e=l,JSON.stringify({ev_type:"batch",list:e})):"";var e},clear:function(){clearTimeout(d),l=[]},fail:function(e){t=e},success:function(e){o=e}}}
|
|
2
|
+
"use strict";const e=require("./fetch-client-DmaLBNmf.js"),t=require("./index-CEfCTKR1.js"),o=require("chalk"),i=require("node:child_process"),s=require("./task-worker-DXd41LkV.js"),n=require("node:path"),r=require("node:fs/promises"),a=require("node:fs"),c=require("node:crypto"),l=require("node:http"),d=require("node:https"),p=require("node:buffer"),u=require("undici"),m=require("ws"),g=require("node:os"),h=require("path"),f=require("fs/promises"),_=require("fs"),y=require("form-data"),b=require("omelette"),v=require("child_process"),w=require("lodash"),E=require("commander");function C(e){const t=Object.create(null);if(e)for(const o in e)if("default"!==o){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:function(){return e[o]}})}return t.default=e,Object.freeze(t)}require("crypto"),require("url"),require("net"),require("tls"),require("assert"),require("tty"),require("util"),require("events"),require("http"),require("https"),require("http2"),require("stream"),require("zlib"),require("mitt"),require("process");const I=C(n),A=C(r);function S(e,t){return null!=e?e:t()}class k{format(e){const t=JSON.stringify(e,null,2);return t.endsWith("\n")?t:`${t}\n`}formatError(e){const t={code:e.code,errorName:S(e.errorName,(()=>"UNKNOWN_ERROR")),desc:S(e.desc,(()=>e.message)),trigger:S(e.trigger,(()=>null)),fix:S(e.fix,(()=>null)),example:S(e.example,(()=>null))},o=JSON.stringify(t,null,2);return o.endsWith("\n")?o:`${o}\n`}}function j(e,t){return null!=e?e:t()}function P(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}function z(e){const t=String.fromCharCode(27),o=new RegExp(`${t}(?:[@-Z\\\\-_]|\\[[0-?]*[ -/]*[@-~])`,"g");return e.replace(o,"")}function T(e){return e>=4352&&e<=4447||(9001===e||9002===e||(e>=11904&&e<=12350||(e>=12352&&e<=42191||(e>=44032&&e<=55203||(e>=63744&&e<=64255||(e>=65040&&e<=65049||(e>=65072&&e<=65135||(e>=65280&&e<=65376||(e>=65504&&e<=65510||(e>=127744&&e<=129695||e>=131072&&e<=262141))))))))))}function R(e){const t=z(e);if(!t)return 0;const o=/[\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/u;let i=0;const s=Array.from(t);for(let e=0;e<s.length;e+=1){const t=j(s[e],(()=>""));if(o.test(t))continue;const n=t.codePointAt(0);void 0!==n&&(i+=T(n)?2:1)}return i}function x(e,t){const o=R(e);return o>=t?e:`${e}${" ".repeat(t-o)}`}function L(e,t){if(t<=0)return"";if(R(e)<=t)return e;if(1===t)return"…";const o=z(e),i=Array.from(o),s=Math.max(0,t-R("…"));let n="",r=0;for(let e=0;e<i.length;e+=1){const t=j(i[e],(()=>"")),o=R(t);if(r+o>s)break;n+=t,r+=o}return`${n}…`}function O(e,t={}){if(0===e.length)return"";const o=function(e,t){if(0===e.length)return[];const o=new Set,i=[],s=j(e[0],(()=>({})));for(const e of Object.keys(s))o.has(e)||(o.add(e),i.push(e));for(const t of e)for(const e of Object.keys(t))o.has(e)||(o.add(e),i.push(e));const n=[];for(const t of i){let o=R(t);for(const i of e){const e=i[t],s=void 0===e?"":String(e);o=Math.max(o,R(s))}n.push({key:t,width:o})}const r=j(t.columnGap,(()=>2)),a=j(j(t.maxWidth,(()=>process.stdout.columns)),(()=>120)),c=Math.max(1,Math.floor((a+r)/(6+r))),l=Math.min(j(t.maxColumns,(()=>c)),c);n.length>l&&n.splice(l);const d=Math.max(0,a-r*Math.max(0,n.length-1));for(;n.reduce(((e,t)=>e+t.width),0)>d;){let e=-1,t=-1;for(let o=0;o<n.length;o+=1){const i=j(P([n,"access",e=>e[o],"optionalAccess",e=>e.width]),(()=>0));i>t&&(t=i,e=o)}if(-1===e)break;const o=j(P([n,"access",t=>t[e],"optionalAccess",e=>e.width]),(()=>0));if(o<=6)break;n[e]={...n[e],width:o-1}}for(let e=0;e<n.length;e+=1){const t=n[e];t&&(n[e]={...t,width:Math.max(6,t.width)})}return n}(e,t);if(0===o.length)return"";const i=j(t.columnGap,(()=>2)),s=" ".repeat(i),n=o.map((e=>x(L(e.key,e.width),e.width))).join(s),r=o.map((e=>"-".repeat(e.width))).join(s),a=[];for(const t of e){const e=o.map((e=>{const o=t[e.key];return x(L(void 0===o?"":String(o),e.width),e.width)}));a.push(e.join(s))}return`${[n,r,...a].join("\n")}\n`}function D(e,t={}){const o=Object.entries(e);if(0===o.length)return"";let i=0;for(const[e]of o)i=Math.max(i,R(e));const s=j(j(t.maxWidth,(()=>process.stdout.columns)),(()=>120)),n=j(t.columnGap,(()=>2)),r=j(t.minValueWidth,(()=>12));let a=Math.min(i,j(t.keyMaxWidth,(()=>32)));const c=Math.max(6,s-n-r);a=Math.min(a,c);const l=Math.max(0,s-a-n),d=" ".repeat(n);return`${o.map((([e,t])=>{const o=x(L(e,a),a),i=(void 0===t?"undefined":null===t?"null":String(t)).replace(/\s*\n\s*/g," "),s=l>0?L(i,l):"";return`${o}${d}${s}`})).join("\n")}\n`}function U(e,t="",o=0){const i={};if(null==e)return i;if("object"!=typeof(s=e)||null===s||Array.isArray(s))return i;var s;for(const[s,n]of Object.entries(e)){const e=t?`${t}.${s}`:s;if(null!=n)if(Array.isArray(n))o>=5?i[e]="[Array]":0===n.length?i[e]="[]":n.every((e=>"object"!=typeof e||null===e))?i[e]=n.map((e=>{return String((o=()=>"null",null!=(t=e)?t:o()));var t,o})).join(", "):i[e]="[Array]";else if("object"!=typeof n)i[e]=n;else if(o>=5)i[e]="[Object]";else{const t=U(n,e,o+1);Object.assign(i,t)}else i[e]=n}return i}function q(e,t){return null!=e?e:t()}function B(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}class M{format(e){if(null===e)return"null\n";if(void 0===e)return"undefined\n";if(Array.isArray(e)){if(0===e.length)return"\n";if(t=e,Array.isArray(t)&&t.length>0&&t.every(B)){return O(e.map((e=>U(e))))}return function(e){return Array.isArray(e)&&e.length>0&&e.every((e=>null==e||"object"!=typeof e))}(e)?`${e.map((e=>String(q(e,(()=>"null"))))).join("\n")}\n`:"[Array]\n"}var t;if(B(e)){const t=U(e);return 0===Object.keys(t).length?"{}\n":D(t)}return`${String(e)}\n`}formatError(e){const t=[],o=q(e.errorName,(()=>"UNKNOWN_ERROR")),i=q(e.desc,(()=>e.message));return t.push(`ERROR [${e.code}] ${o}: ${i}`),e.trigger&&t.push(` Trigger: ${e.trigger}`),e.fix&&t.push(` Fix: ${e.fix}`),e.example&&t.push(` Example: ${e.example}`),e.details&&(t.push(" Error Details:"),t.push(`${function(e,t){if(null==e)return"";if("string"==typeof e)return`${t}${e}\n`;if(Array.isArray(e))return 0===e.length?"":`${e.map((e=>"object"==typeof e&&null!==e?D(U(e)):String(e))).map((e=>`${t}- ${e.trim()}`)).join("\n")}\n`;if(B(e)){const o=U(e);return 0===Object.keys(o).length?"":`${D(o).split("\n").filter((e=>e.trim())).map((e=>`${t}${e}`)).join("\n")}\n`}return`${t}${String(e)}\n`}(e.details," ")}`)),`${t.join("\n")}\n`}}function N(e,t){return null!=e?e:t()}function $(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}function G(e,t){if(null==e)return;const o=String(e).replace(/\s*\n\s*/g," ").replace(/\s+/g," ").trim();return o?o.length<=t?o:`${o.slice(0,Math.max(0,t-3))}...`:void 0}function F(e){const t=$([e,"optionalAccess",e=>e.help,"optionalAccess",e=>e.errors]);if(t&&t.length>0)return t;const o=$([e,"optionalAccess",e=>e.errors]);return Array.isArray(o)?o:void 0}function V(t,o){const i=N(t.trigger,(()=>function(e){if(!e||0===e.length)return;return G(("coze"===e[0]?e:["coze",...e]).join(" "),150)}($([o,"optionalAccess",e=>e.argv])))),s=$([F,"call",e=>e($([o,"optionalAccess",e=>e.commandConfig])),"optionalAccess",e=>e.find,"call",e=>e((e=>e.code===t.code))]),n=N($([s,"optionalAccess",e=>e.name]),(()=>e.ErrorNameByCode[t.code])),r=N(G(n,80),(()=>"UNKNOWN_ERROR"));let a=n;t.isMessageExplicit&&t.message.trim()?a=t.message:$([s,"optionalAccess",e=>e.desc])&&(a=s.desc);const c=N(G(a,200),(()=>"An unexpected error occurred")),l=N(G(t.fix,150),(()=>G($([s,"optionalAccess",e=>e.fix]),150))),d=N(G(t.example,150),(()=>G($([s,"optionalAccess",e=>e.example]),150)));return{code:t.code,errorName:r,desc:c,trigger:i,fix:l,example:d}}function W(e,t){const o=V(e,t);return e.errorName=o.errorName,e.desc=o.desc,e.message=o.desc,e.trigger=o.trigger,e.fix=o.fix,e.example=o.example,e}function H(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}var J;function K(o,i,s,n){if(o instanceof e.CozeError)throw o;if(e.isHttpError(o)){const e=H([o,"access",e=>e.response,"optionalAccess",e=>e.status]);if("ECONNREFUSED"===o.code||"ETIMEDOUT"===o.code||"number"==typeof e&&e>=500)throw o}if(o instanceof t.ChatCoreError&&"number"==typeof H([o,"access",e=>e.ext,"optionalAccess",e=>e.code])&&o.ext.code>=500)throw o;throw new e.CozeError(i,s,{...n,cause:o instanceof Error?o.message:String(o)})}!function(e){e[e.NOT_LOGIN=700012006]="NOT_LOGIN"}(J||(J={}));const Q=(o,i)=>{const s=W(function(o){if(o instanceof e.CozeError)return o;if(o instanceof t.ChatCoreError){const{ext:t}=o;let i=e.ErrorCode.E5000;"number"==typeof t.code&&(t.code===J.NOT_LOGIN?i=e.ErrorCode.E2001:t.code>=500&&(i=e.ErrorCode.E5002));const{message:s}=o;return new e.CozeError(i,s,t)}if(e.isHttpError(o)){const t=o.toJSON();let i=e.ErrorCode.E5000;const s=H([o,"access",e=>e.response,"optionalAccess",e=>e.status]);o.code===J.NOT_LOGIN||401===s?i=e.ErrorCode.E2001:"ECONNREFUSED"===o.code||"ETIMEDOUT"===o.code?i=e.ErrorCode.E5001:403===s?i=e.ErrorCode.E2003:404===s?i=e.ErrorCode.E3000:429===s?i=e.ErrorCode.E4001:s&&s>=500&&(i=e.ErrorCode.E5002);const n=H([o,"access",e=>e.response,"optionalAccess",e=>e.headers,"optionalAccess",e=>e["x-tt-logid"]]),{message:r}=o;return new e.CozeError(i,r,{logId:n,...t})}return o instanceof Error?new e.CozeError(e.ErrorCode.E5000,o.message,o.stack):"string"==typeof o?new e.CozeError(e.ErrorCode.E5000,o):new e.CozeError(e.ErrorCode.E5000,"An unexpected error occurred")}(o),i?{argv:i.argv,commandConfig:i.commandConfig}:void 0);var n,r;if(s.code===e.ErrorCode.E2001&&process.stdout.write(`${n=s.desc,r=()=>s.message,null!=n?n:r()}\n`),i)i.response.eprint(s);else{const e=new M;process.stderr.write(e.formatError(s))}process.exit(e.exitCodeForError(s.code))};const Y="@coze/cli",Z="0.3.3-alpha.f035aa",X=Y;function ee(){const e=[{pm:"npm",cmd:`npm ls -g ${X} --json 2>/dev/null`},{pm:"pnpm",cmd:`pnpm ls -g ${X} --json 2>/dev/null`},{pm:"yarn",cmd:"yarn global list --json 2>/dev/null"}];for(const{pm:t,cmd:o}of e)try{if(i.execSync(o,{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).includes(X))return t}catch(e){}return"npm"}function te(e,t){return null!=e?e:t()}function oe(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}const ie=Y,se=6e5;function ne(){return Z}function re(e){const t=e.trim().replace(/^v/,"").split("+")[0],o=t.indexOf("-"),i=-1===o?t:t.slice(0,o),s=-1===o?"":t.slice(o+1),n=i.split(".");return{major:parseInt(n[0]||"0",10),minor:parseInt(n[1]||"0",10),patch:parseInt(n[2]||"0",10),prerelease:""===s?[]:s.split(".")}}function ae(e,t){const o=/^\d+$/.test(e),i=/^\d+$/.test(t);if(o&&i){const o=parseInt(e,10)-parseInt(t,10);return 0===o?0:o>0?1:-1}return o?-1:i?1:e===t?0:e>t?1:-1}function ce(e,t){const o=re(e),i=re(t);return o.major!==i.major?o.major>i.major?1:-1:o.minor!==i.minor?o.minor>i.minor?1:-1:o.patch!==i.patch?o.patch>i.patch?1:-1:function(e,t){if(0===e.length&&0===t.length)return 0;if(0===e.length)return 1;if(0===t.length)return-1;const o=Math.max(e.length,t.length);for(let i=0;i<o;i++){const o=e[i],s=t[i];if(void 0===o)return-1;if(void 0===s)return 1;const n=ae(o,s);if(0!==n)return n}return 0}(o.prerelease,i.prerelease)}function le(e,t){return ce(t,e)>0}function de(e,t){return re(t).major>re(e).major}function pe(){if(process.env.COZE_CLI_NO_UPDATE_NOTIFIER)return!0;const e=te(process.env.CI,(()=>"")).toLowerCase();return""!==e&&"false"!==e&&"0"!==e||function(e){return!e||"0.0.0"===e||/dev/i.test(e)}(ne())}function ue(e){const t=oe([e,"access",e=>e.upgrade,"optionalAccess",e=>e.mode]);return"auto"===t||"notify"===t||"off"===t?t:"auto"}function me(e){return oe([e,"access",e=>e.upgrade,"optionalAccess",e=>e.channel])||"latest"}async function ge(t,o=!1,n="latest"){const r=ne(),{config:a}=t,c=oe([a,"access",e=>e.upgrade,"optionalAccess",e=>e.cache]);if(!o&&oe([c,"optionalAccess",e=>e.latestVersion])&&c.checkedAt&&Date.now()-c.checkedAt<144e5&&te(c.channel,(()=>"latest"))===n)return{currentVersion:r,latestVersion:c.latestVersion,hasUpdate:le(r,c.latestVersion)};const l=function(){try{return i.execSync("npm config get registry",{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim().replace(/\/+$/,"")}catch(e){return"https://registry.npmjs.org"}}(),d=await async function(t,o="latest"){const i=`${t}/${ie}/${o}`,s=await e.customFetch.fetch(i,{headers:{accept:"application/json"}});if(!s.ok)throw new Error(`Failed to fetch latest version: ${s.status} ${s.statusText}`);return(await s.json()).version}(l,n);return await s.saveConfig({upgrade:{cache:{latestVersion:d,checkedAt:Date.now(),channel:n}}},a.configScope),{currentVersion:r,latestVersion:d,hasUpdate:le(r,d)}}async function he(e,t){const o=function(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}([e,"access",e=>e.config,"access",e=>e.upgrade,"optionalAccess",e=>e.cache,"optionalAccess",e=>e.lastAttempt]);if(o&&Date.now()-o<se)return;try{await s.saveConfig({upgrade:{cache:{lastAttempt:Date.now()}}},e.config.configScope)}catch(e){}const n=ee(),{command:r,args:a}=function(e,t){const o=`${X}@${t}`;switch(e){case"pnpm":return{command:"pnpm",args:["add","-g",o]};case"yarn":return{command:"yarn",args:["global","add",o]};default:return{command:"npm",args:["install","-g",o]}}}(n,t);try{i.spawn(r,a,{detached:!0,stdio:"ignore",shell:"win32"===process.platform}).unref()}catch(e){}}function fe(e,t){return null!=e?e:t()}function _e(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}const ye={claude:"claude-code"};let be=null;function ve(){if(be)return be;const t=function(){let e=__dirname;for(let t=0;t<12;t++){const t=n.join(e,"node_modules","skills","package.json");if(a.existsSync(t))return n.dirname(t);const o=n.dirname(e);if(o===e)break;e=o}}();if(t){const o=e.safeJsonParse(a.readFileSync(n.join(t,"package.json"),"utf8")),i="string"==typeof _e([o,"optionalAccess",e=>e.bin])?o.bin:_e([o,"optionalAccess",e=>e.bin,"optionalAccess",e=>e.skills]);if(i)return be={cmd:process.execPath,prefix:[n.join(t,i)]},be}return be={cmd:"skills",prefix:[]},be}function we(e){const{cmd:t,prefix:o}=ve(),s=i.spawnSync(t,[...o,...e],{encoding:"utf8"});return{ok:0===s.status,stdout:fe(s.stdout,(()=>"")),stderr:fe(s.stderr,(()=>"")),code:s.status}}function Ee(e,t={}){const o=["add",e];return t.global&&o.push("-g"),t.yes&&o.push("-y"),t.agents&&t.agents.length>0&&o.push("-a",...t.agents),we(o)}function Ce(e,t={}){const o=["remove",e];return t.global&&o.push("-g"),o.push("-y"),we(o)}function Ie(t={}){const o=["ls","--json"];t.global&&o.push("-g");const i=we(o);if(!i.ok)return[];const s=e.safeJsonParse(i.stdout);return Array.isArray(s)?s:[]}function Ae(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}function Se(){return s.getGlobalSkillLockFile()}async function ke(e){try{return await r.access(e),!0}catch(e){return!1}}async function je(){let t=__dirname;for(let o=0;o<12;o++){const o=n.join(t,"package.json");if(await ke(o)){if("@coze/cli"===Ae([e.safeJsonParse(await r.readFile(o,"utf8")),"optionalAccess",e=>e.name]))return t}const i=n.dirname(t);if(i===t)break;t=i}return n.resolve(__dirname,"..")}async function Pe(){return n.join(await je(),"skills")}async function ze(){return n.join(await je(),"docs","skills")}const Te=new Set(["SKILL.md","MODULE.md"]);function Re(e){return`sha256:${c.createHash("sha256").update(e,"utf8").digest("hex")}`}function xe(e){return Te.has(n.basename(e))}async function Le(e,t=e){const o=await r.readdir(e,{withFileTypes:!0}),i=[];for(const s of o){if(s.name.startsWith("."))continue;const o=n.join(e,s.name);s.isDirectory()?i.push(...await Le(o,t)):s.isFile()&&i.push(n.relative(t,o).split(n.sep).join("/"))}return i.sort()}function Oe(e,t){const o=Ue(e);if(void 0===o)return;const i=new RegExp(`^${t}:\\s*(.+?)\\s*$`,"m"),s=o.match(i);return s?s[1].replace(/^['"]|['"]$/g,"").trim():void 0}function De(e,t){const o=Ue(e);if(void 0===o)return e;const i=`version: ${t}`;let s;return s=/^version:\s*.+$/m.test(o)?o.replace(/^version:\s*.+$/m,i):/^name:\s*.+$/m.test(o)?o.replace(/^(name:\s*.+)$/m,`$1\n${i}`):`${i}\n${o}`,e.replace(o,s)}function Ue(e){if(!e.startsWith("---"))return;const t=e.match(/^---\n([\s\S]*?)\n---/);return t?t[1]:void 0}function qe(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}async function Be(){const e=await Pe();if(await ke(n.join(e,"manifest.json")))return{root:e,source:"bundled"};const t=await ze();if(await ke(t))return{root:t,source:"docs"};throw new Error(`未找到 skill 来源:既无包内 ${e}/manifest.json,也无开发态 ${t}。`)}async function Me(){const t=n.join(await je(),"package.json"),o=e.safeJsonParse(await r.readFile(t,"utf8"));return i=qe([o,"optionalAccess",e=>e.version]),s=()=>"0.0.0",null!=i?i:s();var i,s}async function Ne(){const t=await Pe(),o=n.join(t,"manifest.json");if(await ke(o)){const i=e.safeJsonParse(await r.readFile(o,"utf8")),s=(await Le(t)).filter((e=>"manifest.json"!==e)),a=[];for(const e of s)a.push({rel:e,content:await r.readFile(n.join(t,e),"utf8")});return{manifest:i,files:a,source:"bundled"}}const i=await ze();if(!await ke(i))throw new Error(`未找到 skill 来源:既无包内 ${o},也无开发态 ${i}。`);const s=await Me(),{manifest:a,files:c}=await async function(e,t){const o=await Le(e),i=[],s={};for(const l of o){const o=await r.readFile(n.join(e,l),"utf8"),d=xe(l),p=d?De(o,t):o;i.push({rel:l,content:p}),d&&(s[(a=Oe(p,"name"),c=()=>l,null!=a?a:c())]={path:l,hash:Re(p)})}var a,c;return{manifest:{cliVersion:t,skills:s},files:i}}(i,s);return{manifest:a,files:c,source:"docs"}}async function $e(){try{const t=await r.readFile(Se(),"utf8");return e.safeJsonParse(t)}catch(e){return}}function Ge(e,t){return null!=e?e:t()}function Fe(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}async function Ve(e){try{return Re(await r.readFile(e,"utf8"))}catch(e){return}}function We(e){return[...new Set(Object.values(e.skills).map((e=>e.path.split("/")[0])))]}function He(e){return e[0]?n.dirname(e[0].path):void 0}async function Je(e={}){const{manifest:t}=await Ne(),{root:o}=await Be(),i=We(t),s=await $e(),a=Ie({global:!0}),c=await async function(e,t,o){const i=He(t);if(!i)return[];const s=new Set(t.map((e=>e.name))),r=[];for(const[t,a]of Object.entries(e.skills)){const e=a.path.split("/")[0];if(!s.has(e))continue;const c=await Ve(n.join(i,a.path));if(void 0===c)continue;if(c===a.hash)continue;const l=Fe([o,"optionalAccess",e=>e.skills,"access",e=>e[t],"optionalAccess",e=>e.hash]);void 0!==l&&c===l||r.push(t)}return r}(t,a,s);if(c.length>0&&!e.force)return{blocked:!0,cliVersion:t.cliVersion,sourceRoot:o,linkedTargets:[],skillsOk:!1,unknownTargets:[],modifiedSkills:c};const l=e.targets&&e.targets.length>0&&!e.targets.includes("all")?Ge(e.targets,(()=>[])).map((e=>fe(ye[e],(()=>e)))):void 0;let d=!0;for(const e of i){Ee(n.join(o,e),{global:!0,yes:!0,agents:l}).ok||(d=!1)}const p=Ie({global:!0}),u=p.filter((e=>i.includes(e.name))),m=Fe([u,"access",e=>e[0],"optionalAccess",e=>e.path]),g=[...new Set(u.flatMap((e=>e.agents)))],h=(new Date).toISOString(),f=He(p),_={};for(const[e,o]of Object.entries(t.skills)){const t=f?await Ve(n.join(f,o.path)):void 0;_[e]={hash:Ge(t,(()=>o.hash)),expectedHash:o.hash,installedAt:h}}return await async function(e){const t=Se();await r.mkdir(n.dirname(t),{recursive:!0}),await r.writeFile(t,`${JSON.stringify(e,null,2)}\n`,"utf8")}({version:1,cliVersion:t.cliVersion,installedBin:Ge(process.argv[1],(()=>process.execPath)),poolPath:m,targets:g,skills:_}),{blocked:!1,cliVersion:t.cliVersion,sourceRoot:o,poolPath:m,linkedTargets:g,skillsOk:d,unknownTargets:[],modifiedSkills:[]}}function Ke(e,t,o){return void 0===e?"missing":e===t?"ok":o===e?"drift":"modified"}async function Qe(){const{manifest:e}=await Ne(),t=await $e(),o=Ge(process.argv[1],(()=>process.execPath)),i=Ie({global:!0}),s=He(i),r=new Set(i.map((e=>e.name))),a=[];for(const[o,i]of Object.entries(e.skills)){const e=i.path.split("/")[0],c=Boolean(s)&&r.has(e),l=c?await Ve(n.join(s,i.path)):void 0,d=c?Ke(l,i.hash,Fe([t,"optionalAccess",e=>e.skills,"access",e=>e[o],"optionalAccess",e=>e.hash])):"missing";a.push({name:o,path:i.path,state:d})}const c=Fe([i,"access",e=>e.find,"call",e=>e((e=>r.has(e.name))),"optionalAccess",e=>e.path]);return{lockExists:Boolean(t),cliVersion:e.cliVersion,installedVersion:Fe([t,"optionalAccess",e=>e.cliVersion]),versionMatch:Boolean(t)&&Fe([t,"optionalAccess",e=>e.cliVersion])===e.cliVersion,installedBin:Fe([t,"optionalAccess",e=>e.installedBin]),currentBin:o,binMatch:!Fe([t,"optionalAccess",e=>e.installedBin])||t.installedBin===o,poolPath:c,targets:Ge(Fe([t,"optionalAccess",e=>e.targets]),(()=>[])),skills:a}}async function Ye(){const{manifest:e}=await Ne(),t=We(e),o=Ie({global:!0}),i=[];for(const e of t){const t=o.find((t=>t.name===e));if(!t)continue;Ce(e,{global:!0}).ok&&i.push({name:e,agents:t.agents})}return await async function(){await r.rm(Se(),{force:!0})}(),{removed:i}}async function Ze(){const t=await async function(){const t=n.join(await Pe(),"manifest.json");if(await ke(t)){const o=e.safeJsonParse(await r.readFile(t,"utf8"));if(qe([o,"optionalAccess",e=>e.cliVersion]))return o.cliVersion}return Me()}(),o=await $e();return o?o.cliVersion!==t?{state:"mismatch",cliVersion:t,installedVersion:o.cliVersion,message:`Skills (${o.cliVersion}) are out of sync with CLI (${t}). Run \`coze self skill install\`.`}:{state:"ok",cliVersion:t,installedVersion:o.cliVersion}:{state:"missing",cliVersion:t,message:"Bundled skills not installed yet. Run `coze self skill install` to sync them to your AI tools."}}function Xe(e){const t={};let o;const i=[];let s=!1;for(let n=0;n<e.length;n++){const r=e[n];if("--help"!==r&&"-h"!==r)if("--version"!==r&&"-v"!==r)if("--output"!==r)if("--format"!==r)"--no-color"!==r?"--config"!==r?"--org-id"!==r?"--space-id"!==r?"--verbose"!==r?"--debug"!==r?"--log-file"!==r?"--print-logs"!==r?s||r.startsWith("-")?i.push(r):(o=r,s=!0):t.printLogs=!0:t.logFile=e[++n]:t.debug=!0:t.verbose=!0:t.spaceId=e[++n]:t.orgId=e[++n]:t.config=e[++n]:t.noColor=!0;else{const o=e[++n];"json"!==o&&"text"!==o||(t.format=o)}else t.output=e[++n];else t.version=!0;else t.help=!0}return{globalOptions:t,commandName:o,commandArgs:i}}function et(e,t){return null!=e?e:t()}function ot(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}async function it(e,t){const i=await async function(e){if("self"===Xe(e.argv).commandName)return;const t=function(e){const t=function(e){let t,o=e[0],i=1;for(;i<e.length;){const s=e[i],n=e[i+1];if(i+=2,("optionalAccess"===s||"optionalCall"===s)&&null==o)return;"access"===s||"optionalAccess"===s?(t=o,o=n(o)):"call"!==s&&"optionalCall"!==s||(o=n(((...e)=>o.call(t,...e))),t=void 0)}return o}([e,"access",e=>e.skill,"optionalAccess",e=>e.mode]);return"auto"===t||"notify"===t||"off"===t?t:"auto"}(e.config);if("off"===t)return;if(function(){const e=et(process.env.CI,(()=>"")).toLowerCase();return""!==e&&"false"!==e&&"0"!==e||Boolean(process.env.COZE_CLI_NO_SKILL_NOTIFIER)}())return;try{const o=await Ze();if("ok"===o.state)return;if("auto"===t&&await async function(e){if("mismatch"!==e.state&&"missing"!==e.state)return!1;try{return!(await Je({})).blocked}catch(e){return!1}}(o))return;return"json"===e.format&&e.response.setNotice({skill:{state:o.state,cliVersion:o.cliVersion,installedVersion:o.installedVersion,message:o.message,command:"coze self skill install"}}),o}catch(e){return}}(e),s=await async function(e){if("upgrade"===Xe(e.argv).commandName)return;if(pe())return;const t=ue(e.config);if("off"===t)return;const o=ot([e,"access",e=>e.config,"access",e=>e.upgrade,"optionalAccess",e=>e.cache]),i=ot([o,"optionalAccess",e=>e.latestVersion]);if(!i)return;if(et(o.channel,(()=>"latest"))!==me(e.config))return;const s=ne();if(!le(s,i))return;const n=o.lastAttempt,r="number"==typeof n&&Date.now()-n<se;let a;"auto"===("auto"===t&&de(s,i)?"notify":t)?r?a=`Auto-upgrade to ${i} did not take effect (current ${s}). Run \`coze upgrade\` manually; on an internal network verify your npm registry.`:(a=`Coze CLI ${i} available (current ${s}). Upgrading in the background; it will take effect on next run.`,he(e,i)):a=`Coze CLI ${i} available (current ${s}). Run \`coze upgrade\` to update.`;"json"===e.format&&e.response.setNotice({update:{current:s,latest:i,message:a,command:"coze upgrade"}});return{current:s,latest:i,message:a}}(e);await t(),function(e,t){if(!ot([t,"optionalAccess",e=>e.message]))return;if("json"===e.format)return void(e.response.hasPendingNotice()&&process.stderr.write(`${t.message}\n`));e.ui.info(`\n${t.message}\n`)}(e,i),function(e,t){if(!t)return;if("json"===e.format)return void(e.response.hasPendingNotice()&&process.stderr.write(`${t.message}\n`));e.ui.info(`\n${o.gray(t.current)} → ${o.green(t.latest)} ${t.message}\n`)}(e,s),async function(e){if("upgrade"===Xe(e.argv).commandName)return;if(pe())return;const t=ue(e.config);if("off"===t)return;try{const o=await ge(e,!1,me(e.config));o.hasUpdate&&"auto"===t&&!de(o.currentVersion,o.latestVersion)&&await he(e,o.latestVersion)}catch(e){}}(e)}var st=e.requireSrc();const nt=e.getDefaultExportFromCjs(st);function rt(e){var t,o,i=e.transport,s=e.endpoint,n=e.size,r=void 0===n?10:n,a=e.wait,c=void 0===a?1e3:a,l=[],d=0;function p(){if(l.length){var e=this.getBatchData();i.post({url:s,data:e,fail:function(o){t&&t(o,e)},success:function(){o&&o(e)}}),l=[]}}return{getSize:function(){return r},getWait:function(){return c},setSize:function(e){r=e},setWait:function(e){c=e},getEndpoint:function(){return s},setEndpoint:function(e){s=e},send:function(e){l.push(e),l.length>=r&&p.call(this),clearTimeout(d),d=setTimeout(p.bind(this),c)},flush:function(){clearTimeout(d),p.call(this)},getBatchData:function(){return l.length?(e=l,JSON.stringify({ev_type:"batch",list:e})):"";var e},clear:function(){clearTimeout(d),l=[]},fail:function(e){t=e},success:function(e){o=e}}}
|
|
3
3
|
/*! *****************************************************************************
|
|
4
4
|
Copyright (c) Microsoft Corporation.
|
|
5
5
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("form-data"),t=require("crypto"),r=require("url"),n=require("net"),o=require("tls"),s=require("assert"),i=require("tty"),a=require("util"),c=require("events"),u=require("http"),l=require("https"),f=require("http2"),p=require("path"),d=require("stream"),h=require("zlib"),m=require("undici"),y=require("lodash");var g="object"==typeof global&&global&&global.Object===Object&&global,b="object"==typeof self&&self&&self.Object===Object&&self,E=g||b||Function("return this")(),_=E.Symbol,w=Object.prototype,O=w.hasOwnProperty,v=w.toString,R=_?_.toStringTag:void 0;var A=Object.prototype.toString;var C=_?_.toStringTag:void 0;function S(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":C&&C in Object(e)?function(e){var t=O.call(e,R),r=e[R];try{e[R]=void 0;var n=!0}catch(e){}var o=v.call(e);return n&&(t?e[R]=r:delete e[R]),o}(e):function(e){return A.call(e)}(e)}function x(e){return null!=e&&"object"==typeof e}function T(e){return"symbol"==typeof e||x(e)&&"[object Symbol]"==S(e)}function j(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var P=Array.isArray,N=_?_.prototype:void 0,D=N?N.toString:void 0;function L(e){if("string"==typeof e)return e;if(P(e))return j(e,L)+"";if(T(e))return D?D.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function U(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function F(e){if(!U(e))return!1;var t=S(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var I,k=E["__core-js_shared__"],B=(I=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"";var q=Function.prototype.toString;function M(e){if(null!=e){try{return q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var H=/^\[object .+?Constructor\]$/,z=Function.prototype,$=Object.prototype,W=z.toString,V=$.hasOwnProperty,G=RegExp("^"+W.call(V).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function J(e){return!(!U(e)||(t=e,B&&B in t))&&(F(e)?G:H).test(M(e));var t}function K(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return J(r)?r:void 0}var X=K(E,"WeakMap"),Z=Object.create,Q=function(){function e(){}return function(t){if(!U(t))return{};if(Z)return Z(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Y=function(){try{var e=K(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var ee=/^(?:0|[1-9]\d*)$/;function te(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&ee.test(e))&&e>-1&&e%1==0&&e<t}function re(e,t,r){"__proto__"==t&&Y?Y(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function ne(e,t){return e===t||e!=e&&t!=t}var oe=Object.prototype.hasOwnProperty;function se(e,t,r){var n=e[t];oe.call(e,t)&&ne(n,r)&&(void 0!==r||t in e)||re(e,t,r)}function ie(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ae(e){return null!=e&&ie(e.length)&&!F(e)}var ce=Object.prototype;function ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ce)}function le(e){return x(e)&&"[object Arguments]"==S(e)}var fe=Object.prototype,pe=fe.hasOwnProperty,de=fe.propertyIsEnumerable,he=le(function(){return arguments}())?le:function(e){return x(e)&&pe.call(e,"callee")&&!de.call(e,"callee")};var me="object"==typeof exports&&exports&&!exports.nodeType&&exports,ye=me&&"object"==typeof module&&module&&!module.nodeType&&module,ge=ye&&ye.exports===me?E.Buffer:void 0,be=(ge?ge.isBuffer:void 0)||function(){return!1},Ee={};function _e(e){return function(t){return e(t)}}Ee["[object Float32Array]"]=Ee["[object Float64Array]"]=Ee["[object Int8Array]"]=Ee["[object Int16Array]"]=Ee["[object Int32Array]"]=Ee["[object Uint8Array]"]=Ee["[object Uint8ClampedArray]"]=Ee["[object Uint16Array]"]=Ee["[object Uint32Array]"]=!0,Ee["[object Arguments]"]=Ee["[object Array]"]=Ee["[object ArrayBuffer]"]=Ee["[object Boolean]"]=Ee["[object DataView]"]=Ee["[object Date]"]=Ee["[object Error]"]=Ee["[object Function]"]=Ee["[object Map]"]=Ee["[object Number]"]=Ee["[object Object]"]=Ee["[object RegExp]"]=Ee["[object Set]"]=Ee["[object String]"]=Ee["[object WeakMap]"]=!1;var we="object"==typeof exports&&exports&&!exports.nodeType&&exports,Oe=we&&"object"==typeof module&&module&&!module.nodeType&&module,ve=Oe&&Oe.exports===we&&g.process,Re=function(){try{var e=Oe&&Oe.require&&Oe.require("util").types;return e||ve&&ve.binding&&ve.binding("util")}catch(e){}}(),Ae=Re&&Re.isTypedArray,Ce=Ae?_e(Ae):function(e){return x(e)&&ie(e.length)&&!!Ee[S(e)]},Se=Object.prototype.hasOwnProperty;function xe(e,t){var r=P(e),n=!r&&he(e),o=!r&&!n&&be(e),s=!r&&!n&&!o&&Ce(e),i=r||n||o||s,a=i?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=a.length;for(var u in e)!t&&!Se.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||te(u,c))||a.push(u);return a}function Te(e,t){return function(r){return e(t(r))}}var je=Te(Object.keys,Object),Pe=Object.prototype.hasOwnProperty;function Ne(e){return ae(e)?xe(e):function(e){if(!ue(e))return je(e);var t=[];for(var r in Object(e))Pe.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}var De=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Le=/^\w*$/;function Ue(e,t){if(P(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!T(e))||(Le.test(e)||!De.test(e)||null!=t&&e in Object(t))}var Fe=K(Object,"create");var Ie=Object.prototype.hasOwnProperty;var ke=Object.prototype.hasOwnProperty;function Be(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function qe(e,t){for(var r=e.length;r--;)if(ne(e[r][0],t))return r;return-1}Be.prototype.clear=function(){this.__data__=Fe?Fe(null):{},this.size=0},Be.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Be.prototype.get=function(e){var t=this.__data__;if(Fe){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return Ie.call(t,e)?t[e]:void 0},Be.prototype.has=function(e){var t=this.__data__;return Fe?void 0!==t[e]:ke.call(t,e)},Be.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Fe&&void 0===t?"__lodash_hash_undefined__":t,this};var Me=Array.prototype.splice;function He(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}He.prototype.clear=function(){this.__data__=[],this.size=0},He.prototype.delete=function(e){var t=this.__data__,r=qe(t,e);return!(r<0)&&(r==t.length-1?t.pop():Me.call(t,r,1),--this.size,!0)},He.prototype.get=function(e){var t=this.__data__,r=qe(t,e);return r<0?void 0:t[r][1]},He.prototype.has=function(e){return qe(this.__data__,e)>-1},He.prototype.set=function(e,t){var r=this.__data__,n=qe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var ze=K(E,"Map");function $e(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function We(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}We.prototype.clear=function(){this.size=0,this.__data__={hash:new Be,map:new(ze||He),string:new Be}},We.prototype.delete=function(e){var t=$e(this,e).delete(e);return this.size-=t?1:0,t},We.prototype.get=function(e){return $e(this,e).get(e)},We.prototype.has=function(e){return $e(this,e).has(e)},We.prototype.set=function(e,t){var r=$e(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function Ve(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],s=r.cache;if(s.has(o))return s.get(o);var i=e.apply(this,n);return r.cache=s.set(o,i)||s,i};return r.cache=new(Ve.Cache||We),r}Ve.Cache=We;var Ge,Je,Ke,Xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ze=/\\(\\)?/g,Qe=(Ge=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Xe,(function(e,r,n,o){t.push(n?o.replace(Ze,"$1"):r||e)})),t},Je=Ve(Ge,(function(e){return 500===Ke.size&&Ke.clear(),e})),Ke=Je.cache,Je);function Ye(e,t){return P(e)?e:Ue(e,t)?[e]:Qe(function(e){return null==e?"":L(e)}(e))}function et(e){if("string"==typeof e||T(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function tt(e,t){for(var r=0,n=(t=Ye(t,e)).length;null!=e&&r<n;)e=e[et(t[r++])];return r&&r==n?e:void 0}function rt(e,t,r){var n=null==e?void 0:tt(e,t);return void 0===n?r:n}function nt(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}var ot=Te(Object.getPrototypeOf,Object);function st(e){var t=this.__data__=new He(e);this.size=t.size}st.prototype.clear=function(){this.__data__=new He,this.size=0},st.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},st.prototype.get=function(e){return this.__data__.get(e)},st.prototype.has=function(e){return this.__data__.has(e)},st.prototype.set=function(e,t){var r=this.__data__;if(r instanceof He){var n=r.__data__;if(!ze||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new We(n)}return r.set(e,t),this.size=r.size,this};var it="object"==typeof exports&&exports&&!exports.nodeType&&exports,at=it&&"object"==typeof module&&module&&!module.nodeType&&module,ct=at&&at.exports===it?E.Buffer:void 0,ut=ct?ct.allocUnsafe:void 0;function lt(e,t){if(t)return e.slice();var r=e.length,n=ut?ut(r):new e.constructor(r);return e.copy(n),n}function ft(){return[]}var pt=Object.prototype.propertyIsEnumerable,dt=Object.getOwnPropertySymbols,ht=dt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,s=[];++r<n;){var i=e[r];t(i,r,e)&&(s[o++]=i)}return s}(dt(e),(function(t){return pt.call(e,t)})))}:ft;function mt(e,t,r){var n=t(e);return P(e)?n:nt(n,r(e))}function yt(e){return mt(e,Ne,ht)}var gt=K(E,"DataView"),bt=K(E,"Promise"),Et=K(E,"Set"),_t="[object Map]",wt="[object Promise]",Ot="[object Set]",vt="[object WeakMap]",Rt="[object DataView]",At=M(gt),Ct=M(ze),St=M(bt),xt=M(Et),Tt=M(X);exports.getTag=S,(gt&&exports.getTag(new gt(new ArrayBuffer(1)))!=Rt||ze&&exports.getTag(new ze)!=_t||bt&&exports.getTag(bt.resolve())!=wt||Et&&exports.getTag(new Et)!=Ot||X&&exports.getTag(new X)!=vt)&&(exports.getTag=function(e){var t=S(e),r="[object Object]"==t?e.constructor:void 0,n=r?M(r):"";if(n)switch(n){case At:return Rt;case Ct:return _t;case St:return wt;case xt:return Ot;case Tt:return vt}return t});var jt=Object.prototype.hasOwnProperty;var Pt=E.Uint8Array;function Nt(e){var t=new e.constructor(e.byteLength);return new Pt(t).set(new Pt(e)),t}var Dt=/\w*$/;var Lt=_?_.prototype:void 0,Ut=Lt?Lt.valueOf:void 0;function Ft(e,t){var r=t?Nt(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function It(e,t,r){var n,o,s,i=e.constructor;switch(t){case"[object ArrayBuffer]":return Nt(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return s=Nt((o=e).buffer),new o.constructor(s,o.byteOffset,o.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Ft(e,r);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,Dt.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return n=e,Ut?Object(Ut.call(n)):{}}}function kt(e){return"function"!=typeof e.constructor||ue(e)?{}:Q(ot(e))}var Bt=Re&&Re.isMap,qt=Bt?_e(Bt):function(e){return x(e)&&"[object Map]"==exports.getTag(e)};var Mt=Re&&Re.isSet,Ht=Mt?_e(Mt):function(e){return x(e)&&"[object Set]"==exports.getTag(e)},zt="[object Arguments]",$t="[object Function]",Wt="[object Object]",Vt={};function Gt(e,t,r,n,o,s){var i,a=1&t;if(void 0!==i)return i;if(!U(e))return e;var c=P(e);if(c)i=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&jt.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e);else{var u=exports.getTag(e),l=u==$t||"[object GeneratorFunction]"==u;if(be(e))return lt(e,a);if(u==Wt||u==zt||l&&!o)i=l?{}:kt(e);else{if(!Vt[u])return o?e:{};i=It(e,u,a)}}s||(s=new st);var f=s.get(e);if(f)return f;s.set(e,i),Ht(e)?e.forEach((function(n){i.add(Gt(n,t,r,n,e,s))})):qt(e)&&e.forEach((function(n,o){i.set(o,Gt(n,t,r,o,e,s))}));var p=c?void 0:yt(e);return function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););}(p||e,(function(n,o){p&&(n=e[o=n]),se(i,o,Gt(n,t,r,o,e,s))})),i}Vt[zt]=Vt["[object Array]"]=Vt["[object ArrayBuffer]"]=Vt["[object DataView]"]=Vt["[object Boolean]"]=Vt["[object Date]"]=Vt["[object Float32Array]"]=Vt["[object Float64Array]"]=Vt["[object Int8Array]"]=Vt["[object Int16Array]"]=Vt["[object Int32Array]"]=Vt["[object Map]"]=Vt["[object Number]"]=Vt[Wt]=Vt["[object RegExp]"]=Vt["[object Set]"]=Vt["[object String]"]=Vt["[object Symbol]"]=Vt["[object Uint8Array]"]=Vt["[object Uint8ClampedArray]"]=Vt["[object Uint16Array]"]=Vt["[object Uint32Array]"]=!0,Vt["[object Error]"]=Vt[$t]=Vt["[object WeakMap]"]=!1;function Jt(e){return Gt(e,5)}function Kt(e,t,r,n){if(!U(e))return e;for(var o=-1,s=(t=Ye(t,e)).length,i=s-1,a=e;null!=a&&++o<s;){var c=et(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=i){var l=a[c];void 0===(u=void 0)&&(u=U(l)?l:te(t[o+1])?[]:{})}se(a,c,u),a=a[c]}return e}function Xt(e,t,r){return null==e?e:Kt(e,t,r)}function Zt(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],s=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=s(r)):"call"!==o&&"optionalCall"!==o||(r=s(((...e)=>r.call(t,...e))),t=void 0)}return r}class Qt extends Error{constructor(e,t={}){super(e),this.name="HttpError",this.status=t.status,this.code=t.code,this.config=t.config,this.response=t.response,this.data=t.data,Error.captureStackTrace&&Error.captureStackTrace(this,Qt)}toString(){const e=[];let t=this.name;if(this.status||this.code){const e=[];this.status&&e.push(String(this.status)),this.code&&e.push(String(this.code)),t+=` [${e.join(" ")}]`}if(t+=`: ${this.message}`,e.push(t),this.config){const t=Zt([this,"access",e=>e.config,"access",e=>e.method,"optionalAccess",e=>e.toUpperCase,"call",e=>e()])||"GET",r=this.config.url||"unknown",n=(this.config.baseURL?`${this.config.baseURL}`:"")+r;e.push(` URL: ${t} ${n}`)}if(this.data)try{const t=JSON.stringify(this.data);t.length<200?e.push(` Data: ${t}`):e.push(` Data: [${t.length} bytes]`)}catch(t){const r=t instanceof Error?t.constructor.name:"unknown";e.push(` Data: [non-serializable: ${r}]`)}return e.join("\n")}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code,data:this.data,url:Zt([this,"access",e=>e.config,"optionalAccess",e=>e.url]),method:Zt([this,"access",e=>e.config,"optionalAccess",e=>e.method]),baseURL:Zt([this,"access",e=>e.config,"optionalAccess",e=>e.baseURL])}}}function Yt(e,t){return function(){return e.apply(t,arguments)}}const{toString:er}=Object.prototype,{getPrototypeOf:tr}=Object,{iterator:rr,toStringTag:nr}=Symbol,or=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),sr=(e,t)=>{let r=e;const n=[];for(;null!=r&&r!==Object.prototype;){if(-1!==n.indexOf(r))return!1;if(n.push(r),or(r,t))return!0;r=tr(r)}return!1},ir=(e=>t=>{const r=er.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ar=e=>(e=e.toLowerCase(),t=>ir(t)===e),cr=e=>t=>typeof t===e,{isArray:ur}=Array,lr=cr("undefined");function fr(e){return null!==e&&!lr(e)&&null!==e.constructor&&!lr(e.constructor)&&hr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const pr=ar("ArrayBuffer");const dr=cr("string"),hr=cr("function"),mr=cr("number"),yr=e=>null!==e&&"object"==typeof e,gr=e=>{if(!yr(e))return!1;const t=tr(e);return!(null!==t&&t!==Object.prototype&&null!==tr(t)||sr(e,nr)||sr(e,rr))},br=ar("Date"),Er=ar("File"),_r=ar("Blob"),wr=ar("FileList");const Or="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},vr=void 0!==Or.FormData?Or.FormData:void 0,Rr=ar("URLSearchParams"),[Ar,Cr,Sr,xr]=["ReadableStream","Request","Response","Headers"].map(ar);function Tr(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),ur(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(fr(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(n=0;n<s;n++)i=o[n],t.call(null,e[i],i,e)}}function jr(e,t){if(fr(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const Pr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Nr=e=>!lr(e)&&e!==Pr;const Dr=(Lr="undefined"!=typeof Uint8Array&&tr(Uint8Array),e=>Lr&&e instanceof Lr);var Lr;const Ur=ar("HTMLFormElement"),{propertyIsEnumerable:Fr}=Object.prototype,Ir=ar("RegExp"),kr=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Tr(r,((r,o)=>{let s;!1!==(s=t(r,o,e))&&(n[o]=s||r)})),Object.defineProperties(e,n)};const Br=ar("AsyncFunction"),qr=(Mr="function"==typeof setImmediate,Hr=hr(Pr.postMessage),Mr?setImmediate:Hr?(zr=`axios@${Math.random()}`,$r=[],Pr.addEventListener("message",(({source:e,data:t})=>{e===Pr&&t===zr&&$r.length&&$r.shift()()}),!1),e=>{$r.push(e),Pr.postMessage(zr,"*")}):e=>setTimeout(e));var Mr,Hr,zr,$r;const Wr="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Pr):"undefined"!=typeof process&&process.nextTick||qr,Vr=e=>null!=e&&hr(e[rr]),Gr={isArray:ur,isArrayBuffer:pr,isBuffer:fr,isFormData:e=>{if(!e)return!1;if(vr&&e instanceof vr)return!0;const t=tr(e);if(!t||t===Object.prototype)return!1;if(!hr(e.append))return!1;const r=ir(e);return"formdata"===r||"object"===r&&hr(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&pr(e.buffer),t},isString:dr,isNumber:mr,isBoolean:e=>!0===e||!1===e,isObject:yr,isPlainObject:gr,isEmptyObject:e=>{if(!yr(e)||fr(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Ar,isRequest:Cr,isResponse:Sr,isHeaders:xr,isUndefined:lr,isDate:br,isFile:Er,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:_r,isRegExp:Ir,isFunction:hr,isStream:e=>yr(e)&&hr(e.pipe),isURLSearchParams:Rr,isTypedArray:Dr,isFileList:wr,forEach:Tr,merge:function e(...t){const{caseless:r,skipUndefined:n}=Nr(this)&&this||{},o={},s=(t,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=r&&"string"==typeof s&&jr(o,s)||s,a=or(o,i)?o[i]:void 0;gr(a)&&gr(t)?o[i]=e(a,t):gr(t)?o[i]=e({},t):ur(t)?o[i]=t.slice():n&&lr(t)||(o[i]=t)};for(let e=0,r=t.length;e<r;e++){const r=t[e];if(!r||fr(r))continue;if(Tr(r,s),"object"!=typeof r||ur(r))continue;const n=Object.getOwnPropertySymbols(r);for(let e=0;e<n.length;e++){const t=n[e];Fr.call(r,t)&&s(r[t],t)}}return o},extend:(e,t,r,{allOwnKeys:n}={})=>(Tr(t,((t,n)=>{r&&hr(t)?Object.defineProperty(e,n,{__proto__:null,value:Yt(t,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,n,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&tr(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:ir,kindOfTest:ar,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(ur(e))return e;let t=e.length;if(!mr(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[rr]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:Ur,hasOwnProperty:or,hasOwnProp:or,hasOwnInPrototypeChain:sr,getSafeProp:(e,t)=>null!=e&&sr(e,t)?e[t]:void 0,reduceDescriptors:kr,freezeMethods:e=>{kr(e,((t,r)=>{if(hr(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];hr(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return ur(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:jr,global:Pr,isContextDefined:Nr,isSpecCompliantForm:function(e){return!!(e&&hr(e.append)&&"FormData"===e[nr]&&e[rr])},toJSONObject:e=>{const t=new WeakSet,r=e=>{if(yr(e)){if(t.has(e))return;if(fr(e))return e;if(!("toJSON"in e)){t.add(e);const n=ur(e)?[]:{};return Tr(e,((e,t)=>{const o=r(e);!lr(o)&&(n[t]=o)})),t.delete(e),n}}return e};return r(e)},isAsyncFn:Br,isThenable:e=>e&&(yr(e)||hr(e))&&hr(e.then)&&hr(e.catch),setImmediate:qr,asap:Wr,isIterable:Vr,isSafeIterable:e=>null!=e&&sr(e,rr)&&Vr(e)},Jr=Gr.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Kr=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Xr=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Zr(e,t){return Gr.isArray(e)?e.map((e=>Zr(e,t))):function(e){let t=0,r=e.length;for(;t<r;){const r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;r>t;){const t=e.charCodeAt(r-1);if(9!==t&&32!==t)break;r-=1}return 0===t&&r===e.length?e:e.slice(t,r)}(String(e).replace(t,""))}function Qr(e){const t=Object.create(null);return Gr.forEach(e.toJSON(),((e,r)=>{t[r]=(e=>Zr(e,Xr))(e)})),t}const Yr=Symbol("internals");function en(e){return e&&String(e).trim().toLowerCase()}function tn(e){return!1===e||null==e?e:Gr.isArray(e)?e.map(tn):(e=>Zr(e,Kr))(String(e))}function rn(e,t,r,n,o){return Gr.isFunction(n)?n.call(this,t,r):(o&&(t=r),Gr.isString(t)?Gr.isString(n)?-1!==t.indexOf(n):Gr.isRegExp(n)?n.test(t):void 0:void 0)}let nn=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=en(t);if(!o)return;const s=Gr.findKey(n,o);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||t]=tn(e))}const s=(e,t)=>Gr.forEach(e,((e,r)=>o(e,r,t)));if(Gr.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(Gr.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&Jr[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t);else if(Gr.isObject(e)&&Gr.isSafeIterable(e)){let r,n,o=Object.create(null);for(const t of e){if(!Gr.isArray(t))throw new TypeError("Object iterator must return a key-value pair");n=t[0],Gr.hasOwnProp(o,n)?(r=o[n],o[n]=Gr.isArray(r)?[...r,t[1]]:[r,t[1]]):o[n]=t[1]}s(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=en(e)){const r=Gr.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Gr.isFunction(t))return t.call(this,e,r);if(Gr.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=en(e)){const r=Gr.findKey(this,e);return!(!r||void 0===this[r]||t&&!rn(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=en(e)){const o=Gr.findKey(r,e);!o||t&&!rn(0,r[o],o,t)||(delete r[o],n=!0)}}return Gr.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!rn(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return Gr.forEach(this,((n,o)=>{const s=Gr.findKey(r,o);if(s)return t[s]=tn(n),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();i!==o&&delete t[o],t[i]=tn(n),r[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Gr.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Gr.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[Yr]=this[Yr]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=en(e);t[n]||(!function(e,t){const r=Gr.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return Gr.isArray(e)?e.forEach(n):n(e),this}};nn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Gr.reduceDescriptors(nn.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),Gr.freezeMethods(nn);function on(e,t){const r=new Set(t.map((e=>String(e).toLowerCase()))),n=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(Gr.isBuffer(e))return e;if(-1!==n.indexOf(e))return;let t;if(e instanceof nn&&(e=e.toJSON()),n.push(e),Gr.isArray(e))t=[],e.forEach(((e,r)=>{const n=o(e);Gr.isUndefined(n)||(t[r]=n)}));else{if(!Gr.isPlainObject(e)&&function(e){if(Gr.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(Gr.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return n.pop(),e;t=Object.create(null);for(const[n,s]of Object.entries(e)){const e=r.has(n.toLowerCase())?"[REDACTED ****]":o(s);Gr.isUndefined(e)||(t[n]=e)}}return n.pop(),t};return o(e)}let sn=class e extends Error{static from(t,r,n,o,s,i){const a=new e(t.message,r||t.code,n,o,s);return Object.defineProperty(a,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),a.name=t.name,null!=t.status&&null==a.status&&(a.status=t.status),i&&Object.assign(a,i),a}constructor(e,t,r,n,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&Gr.hasOwnProp(e,"redact")?e.redact:void 0,r=Gr.isArray(t)&&t.length>0?on(e,t):Gr.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};sn.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",sn.ERR_BAD_OPTION="ERR_BAD_OPTION",sn.ECONNABORTED="ECONNABORTED",sn.ETIMEDOUT="ETIMEDOUT",sn.ECONNREFUSED="ECONNREFUSED",sn.ERR_NETWORK="ERR_NETWORK",sn.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",sn.ERR_DEPRECATED="ERR_DEPRECATED",sn.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",sn.ERR_BAD_REQUEST="ERR_BAD_REQUEST",sn.ERR_CANCELED="ERR_CANCELED",sn.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",sn.ERR_INVALID_URL="ERR_INVALID_URL",sn.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";function an(e){return Gr.isPlainObject(e)||Gr.isArray(e)}function cn(e){return Gr.endsWith(e,"[]")?e.slice(0,-2):e}function un(e,t,r){return e?e.concat(t).map((function(e,t){return e=cn(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const ln=Gr.toFlatObject(Gr,{},null,(function(e){return/^is[A-Z]/.test(e)}));function fn(t,r,n){if(!Gr.isObject(t))throw new TypeError("target must be an object");r=r||new(e||FormData);const o=(n=Gr.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Gr.isUndefined(t[e])}))).metaTokens,s=n.visitor||h,i=n.dots,a=n.indexes,c=n.Blob||"undefined"!=typeof Blob&&Blob,u=void 0===n.maxDepth?100:n.maxDepth,l=c&&Gr.isSpecCompliantForm(r),f=[];if(!Gr.isFunction(s))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(Gr.isDate(e))return e.toISOString();if(Gr.isBoolean(e))return e.toString();if(!l&&Gr.isBlob(e))throw new sn("Blob is not supported. Use a Buffer instead.");if(Gr.isArrayBuffer(e)||Gr.isTypedArray(e)){if(l&&"function"==typeof c)return new c([e]);if("undefined"!=typeof Buffer)return Buffer.from(e);throw new sn("Blob is not supported. Use a Buffer instead.",sn.ERR_NOT_SUPPORT)}return e}function d(e){if(e>u)throw new sn("Object is too deeply nested ("+e+" levels). Max depth: "+u,sn.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,t,n){let s=e;if(Gr.isReactNative(r)&&Gr.isReactNativeBlob(e))return r.append(un(n,t,i),p(e)),!1;if(e&&!n&&"object"==typeof e)if(Gr.endsWith(t,"{}"))t=o?t:t.slice(0,-2),e=function(e,t){if(u===1/0)return JSON.stringify(e);const r=[];return JSON.stringify(e,(function(e,n){if(!Gr.isObject(n))return n;for(;r.length&&r[r.length-1]!==this;)r.pop();return r.push(n),d(t+r.length-1),n}))}(e,1);else if(Gr.isArray(e)&&function(e){return Gr.isArray(e)&&!e.some(an)}(e)||(Gr.isFileList(e)||Gr.endsWith(t,"[]"))&&(s=Gr.toArray(e)))return t=cn(t),s.forEach((function(e,n){!Gr.isUndefined(e)&&null!==e&&r.append(!0===a?un([t],n,i):null===a?t:t+"[]",p(e))})),!1;return!!an(e)||(r.append(un(n,t,i),p(e)),!1)}const m=Object.assign(ln,{defaultVisitor:h,convertValue:p,isVisitable:an});if(!Gr.isObject(t))throw new TypeError("data must be an object");return function e(t,n,o=0){if(!Gr.isUndefined(t)){if(d(o),-1!==f.indexOf(t))throw new Error("Circular reference detected in "+n.join("."));f.push(t),Gr.forEach(t,(function(t,i){!0===(!(Gr.isUndefined(t)||null===t)&&s.call(r,t,Gr.isString(i)?i.trim():i,n,m))&&e(t,n?n.concat(i):[i],o+1)})),f.pop()}}(t),r}function pn(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function dn(e,t){this._pairs=[],e&&fn(e,this,t)}const hn=dn.prototype;function mn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function yn(e,t,r){if(!t)return e;e=e||"";const n=Gr.isFunction(r)?{serialize:r}:r,o=Gr.getSafeProp(n,"encode")||mn,s=Gr.getSafeProp(n,"serialize");let i;if(i=s?s(t,n):Gr.isURLSearchParams(t)?t.toString():new dn(t,n).toString(o),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}hn.append=function(e,t){this._pairs.push([e,t])},hn.toString=function(e){const t=e?t=>e.call(this,t,pn):pn;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class gn{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Gr.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}const bn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},En=r.URLSearchParams,_n="abcdefghijklmnopqrstuvwxyz",wn="0123456789",On={DIGIT:wn,ALPHA:_n,ALPHA_DIGIT:_n+_n.toUpperCase()+wn},vn={isNode:!0,classes:{URLSearchParams:En,FormData:e,Blob:"undefined"!=typeof Blob&&Blob||null},ALPHABET:On,generateString:(e=16,r=On.ALPHA_DIGIT)=>{let n="";const{length:o}=r,s=new Uint32Array(e);t.randomFillSync(s);for(let t=0;t<e;t++)n+=r[s[t]%o];return n},protocols:["http","https","file","data"]},Rn="undefined"!=typeof window&&"undefined"!=typeof document,An="object"==typeof navigator&&navigator||void 0,Cn=Rn&&(!An||["ReactNative","NativeScript","NS"].indexOf(An.product)<0),Sn="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,xn=Rn&&window.location.href||"http://localhost",Tn={...Object.freeze({__proto__:null,hasBrowserEnv:Rn,hasStandardBrowserEnv:Cn,hasStandardBrowserWebWorkerEnv:Sn,navigator:An,origin:xn}),...vn};function jn(e){if(e>100)throw new sn("FormData field is too deeply nested ("+e+" levels). Max depth: 100",sn.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Pn(e){function t(e,r,n,o){jn(o);let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&Gr.isArray(n)?n.length:s,a)return Gr.hasOwnProp(n,s)?n[s]=Gr.isArray(n[s])?n[s].concat(r):[n[s],r]:n[s]=r,!i;Gr.hasOwnProp(n,s)&&Gr.isObject(n[s])||(n[s]=[]);return t(e,r,n[s],o)&&Gr.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}(n[s])),!i}if(Gr.isFormData(e)&&Gr.isFunction(e.entries)){const r={};return Gr.forEachEntry(e,((e,n)=>{t(function(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;null!==(n=r.exec(e));)jn(t.length),t.push("[]"===n[0]?"":n[1]||n[0]);return t}(e),n,r,0)})),r}return null}const Nn=(e,t)=>null!=e&&Gr.hasOwnProp(e,t)?e[t]:void 0;const Dn={transitional:bn,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=Gr.isObject(e);o&&Gr.isHTMLForm(e)&&(e=new FormData(e));if(Gr.isFormData(e))return n?JSON.stringify(Pn(e)):e;if(Gr.isArrayBuffer(e)||Gr.isBuffer(e)||Gr.isStream(e)||Gr.isFile(e)||Gr.isBlob(e)||Gr.isReadableStream(e))return e;if(Gr.isArrayBufferView(e))return e.buffer;if(Gr.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){const t=Nn(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return fn(e,new Tn.classes.URLSearchParams,{visitor:function(e,t,r,n){return Tn.isNode&&Gr.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((s=Gr.isFileList(e))||r.indexOf("multipart/form-data")>-1){const r=Nn(this,"env"),n=r&&r.FormData;return fn(s?{"files[]":e}:e,n&&new n,t)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(Gr.isString(e))try{return(t||JSON.parse)(e),Gr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Nn(this,"transitional")||Dn.transitional,r=t&&t.forcedJSONParsing,n=Nn(this,"responseType"),o="json"===n;if(Gr.isResponse(e)||Gr.isReadableStream(e))return e;if(e&&Gr.isString(e)&&(r&&!n||o)){const r=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Nn(this,"parseReviver"))}catch(e){if(r){if("SyntaxError"===e.name)throw sn.from(e,sn.ERR_BAD_RESPONSE,this,null,Nn(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Tn.classes.FormData,Blob:Tn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function Ln(e,t){const r=this||Dn,n=t||r,o=nn.from(n.headers);let s=n.data;return Gr.forEach(e,(function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Un(e){return!(!e||!e.__CANCEL__)}Gr.forEach(["delete","get","head","post","put","patch","query"],(e=>{Dn.headers[e]={}}));let Fn=class extends sn{constructor(e,t,r){super(null==e?"canceled":e,sn.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function In(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new sn("Request failed with status code "+r.status,r.status>=400&&r.status<500?sn.ERR_BAD_REQUEST:sn.ERR_BAD_RESPONSE,r.config,r.request,r)):e(r)}const kn=/^https?:(?!\/\/)/i,Bn=/[\t\n\r]/g;function qn(e,t){if("string"==typeof e&&kn.test(function(e){return function(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}(e).replace(Bn,"")}(e)))throw new sn('Invalid URL: missing "//" after protocol',sn.ERR_INVALID_URL,t)}function Mn(e,t,r,n){qn(t,n);let o=!function(e){return"string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(o||!1===r)?(qn(e,n),function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t)):t}var Hn={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function zn(e){var t=("string"==typeof e?function(e){try{return new URL(e)}catch(e){return null}}(e):e)||{},r=t.protocol,n=t.host,o=t.port;if("string"!=typeof n||!n||"string"!=typeof r)return"";if(r=r.split(":",1)[0],!function(e,t){var r=$n("no_proxy").toLowerCase();if(!r)return!0;if("*"===r)return!1;return r.split(/[,\s]/).every((function(r){if(!r)return!0;var n=r.match(/^(.+):(\d+)$/),o=n?n[1]:r,s=n?parseInt(n[2]):0;return!(!s||s===t)||(/^[.*]/.test(o)?("*"===o.charAt(0)&&(o=o.slice(1)),!e.endsWith(o)):e!==o)}))}(n=n.replace(/:\d*$/,""),o=parseInt(o)||Hn[r]||0))return"";var s=$n(r+"_proxy")||$n("all_proxy");return s&&-1===s.indexOf("://")&&(s=r+"://"+s),s}function $n(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}function Wn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vn(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var Gn,Jn,Kn,Xn,Zn,Qn={},Yn={exports:{}},eo={exports:{}};function to(){if(Jn)return Gn;Jn=1;var e=1e3,t=60*e,r=60*t,n=24*r,o=7*n,s=365.25*n;function i(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}return Gn=function(a,c){c=c||{};var u=typeof a;if("string"===u&&a.length>0)return function(i){if((i=String(i)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*n;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(a);if("number"===u&&isFinite(a))return c.long?function(o){var s=Math.abs(o);if(s>=n)return i(o,s,n,"day");if(s>=r)return i(o,s,r,"hour");if(s>=t)return i(o,s,t,"minute");if(s>=e)return i(o,s,e,"second");return o+" ms"}(a):function(o){var s=Math.abs(o);if(s>=n)return Math.round(o/n)+"d";if(s>=r)return Math.round(o/r)+"h";if(s>=t)return Math.round(o/t)+"m";if(s>=e)return Math.round(o/e)+"s";return o+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}}function ro(){if(Xn)return Kn;return Xn=1,Kn=function(e){function t(e){let n,o,s,i=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),s=o-(n||o);r.diff=s,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";i++;const s=t.formatters[o];if("function"==typeof s){const t=e[i];n=s.call(r,t),e.splice(i,1),i--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(o!==t.namespaces&&(o=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,o=-1,s=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(o=n,s=r,n++):(r++,n++);else{if(-1===o)return!1;n=o+1,s++,r=s}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(n(e,r))return!1;for(const r of t.names)if(n(e,r))return!0;return!1},t.humanize=to(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t},Kn}var no={exports:{}};const oo=(()=>{if(navigator.userAgentData){if(function(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],s=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=s(r)):"call"!==o&&"optionalCall"!==o||(r=s(((...e)=>r.call(t,...e))),t=void 0)}return r}([navigator.userAgentData.brands.find((({brand:e})=>"Chromium"===e)),"optionalAccess",e=>e.version])>93)return 3}return/\b(Chrome|Chromium)\//.test(navigator.userAgent)?1:0})(),so=0!==oo&&{level:oo,hasBasic:!0,has256:oo>=2,has16m:oo>=3},io={stdout:so,stderr:so},ao=Vn(Object.freeze({__proto__:null,default:io}));var co,uo;function lo(){return co||(co=1,function(e,t){const r=i,n=a;t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return process.stderr.write(n.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),s=` ${o};1m${n} [0m`;r[0]=s+r[0].split("\n").join("\n"+s),r.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}else r[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+r[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=n.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ao;e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let n=process.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e}),{}),e.exports=ro()(t);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,n.inspect(e,this.inspectOpts)}}(no,no.exports)),no.exports}function fo(){return uo||(uo=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Yn.exports=(Zn||(Zn=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))})),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=ro()(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(eo,eo.exports)),eo.exports):Yn.exports=lo()),Yn.exports}var po,ho,mo,yo={};function go(){if(mo)return ho;mo=1;var e=ho&&ho.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const t=c,r=e(fo()),n=e((po||(po=1,Object.defineProperty(yo,"__esModule",{value:!0}),yo.default=function(e){return function(t,r){return new Promise(((n,o)=>{e.call(this,t,r,((e,t)=>{e?o(e):n(t)}))}))}}),yo)),o=r.default("agent-base");function s(){const{stack:e}=new Error;return"string"==typeof e&&e.split("\n").some((e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:")))}function i(e,t){return new i.Agent(e,t)}return function(e){class r extends t.EventEmitter{constructor(e,t){super();let r=t;"function"==typeof e?this.callback=e:e&&(r=e),this.timeout=null,r&&"number"==typeof r.timeout&&(this.timeout=r.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return"number"==typeof this.explicitDefaultPort?this.explicitDefaultPort:s()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return"string"==typeof this.explicitProtocol?this.explicitProtocol:s()?"https:":"http:"}set protocol(e){this.explicitProtocol=e}callback(e,t,r){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,t){const r=Object.assign({},t);"boolean"!=typeof r.secureEndpoint&&(r.secureEndpoint=s()),null==r.host&&(r.host="localhost"),null==r.port&&(r.port=r.secureEndpoint?443:80),null==r.protocol&&(r.protocol=r.secureEndpoint?"https:":"http:"),r.host&&r.path&&delete r.path,delete r.agent,delete r.hostname,delete r._defaultAgent,delete r.defaultPort,delete r.createConnection,e._last=!0,e.shouldKeepAlive=!1;let i=!1,a=null;const c=r.timeout||this.timeout,u=t=>{e._hadError||(e.emit("error",t),e._hadError=!0)},l=()=>{a=null,i=!0;const e=new Error(`A "socket" was not created for HTTP request before ${c}ms`);e.code="ETIMEOUT",u(e)},f=e=>{i||(null!==a&&(clearTimeout(a),a=null),u(e))},p=t=>{if(i)return;if(null!=a&&(clearTimeout(a),a=null),n=t,Boolean(n)&&"function"==typeof n.addRequest)return o("Callback returned another Agent instance %o",t.constructor.name),void t.addRequest(e,r);var n;if(t)return t.once("free",(()=>{this.freeSocket(t,r)})),void e.onSocket(t);const s=new Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``);u(s)};if("function"==typeof this.callback){this.promisifiedCallback||(this.callback.length>=3?(o("Converting legacy callback function to promise"),this.promisifiedCallback=n.default(this.callback)):this.promisifiedCallback=this.callback),"number"==typeof c&&c>0&&(a=setTimeout(l,c)),"port"in r&&"number"!=typeof r.port&&(r.port=Number(r.port));try{o("Resolving socket for %o request: %o",r.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,r)).then(p,f)}catch(e){Promise.reject(e).catch(f)}}else u(new Error("`callback` is not defined"))}freeSocket(e,t){o("Freeing socket %o %o",e.constructor.name,t),e.destroy()}destroy(){o("Destroying agent %o",this.constructor.name)}}e.Agent=r,e.prototype=e.Agent.prototype}(i||(i={})),ho=i}var bo,Eo,_o,wo,Oo={};function vo(){if(bo)return Oo;bo=1;var e=Oo&&Oo.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Oo,"__esModule",{value:!0});const t=e(fo()).default("https-proxy-agent:parse-proxy-response");return Oo.default=function(e){return new Promise(((r,n)=>{let o=0;const s=[];function i(){const n=e.read();n?function(e){s.push(e),o+=e.length;const n=Buffer.concat(s,o);if(-1===n.indexOf("\r\n\r\n"))return t("have not received end of HTTP headers yet..."),void i();const a=n.toString("ascii",0,n.indexOf("\r\n")),c=+a.split(" ")[1];t("got proxy server response: %o",a),r({statusCode:c,buffered:n})}(n):e.once("readable",i)}function a(e){t("onclose had error %o",e)}function c(){t("onend")}function u(r){e.removeListener("end",c),e.removeListener("error",u),e.removeListener("close",a),e.removeListener("readable",i),t("onerror %o",r),n(r)}e.on("error",u),e.on("close",a),e.on("end",c),i()}))},Oo}function Ro(){if(Eo)return Qn;Eo=1;var e=Qn&&Qn.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))},t=Qn&&Qn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qn,"__esModule",{value:!0});const i=t(n),a=t(o),c=t(r),u=t(s),l=t(fo()),f=go(),p=t(vo()),d=l.default("https-proxy-agent:agent");class h extends f.Agent{constructor(e){let t;if(t="string"==typeof e?c.default.parse(e):e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");d("creating new HttpsProxyAgent instance: %o",t),super(t);const r=Object.assign({},t);var n;this.secureProxy=t.secureProxy||"string"==typeof(n=r.protocol)&&/^https:?$/i.test(n),r.host=r.hostname||r.host,"string"==typeof r.port&&(r.port=parseInt(r.port,10)),!r.port&&r.host&&(r.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in r)&&(r.ALPNProtocols=["http 1.1"]),r.host&&r.path&&(delete r.path,delete r.pathname),this.proxy=r}callback(t,r){return e(this,void 0,void 0,(function*(){const{proxy:e,secureProxy:n}=this;let o;n?(d("Creating `tls.Socket`: %o",e),o=a.default.connect(e)):(d("Creating `net.Socket`: %o",e),o=i.default.connect(e));const s=Object.assign({},e.headers);let c=`CONNECT ${`${r.host}:${r.port}`} HTTP/1.1\r\n`;e.auth&&(s["Proxy-Authorization"]=`Basic ${Buffer.from(e.auth).toString("base64")}`);let{host:l,port:f,secureEndpoint:h}=r;(function(e,t){return Boolean(!t&&80===e||t&&443===e)})(f,h)||(l+=`:${f}`),s.Host=l,s.Connection="close";for(const e of Object.keys(s))c+=`${e}: ${s[e]}\r\n`;const y=p.default(o);o.write(`${c}\r\n`);const{statusCode:g,buffered:b}=yield y;if(200===g){if(t.once("socket",m),r.secureEndpoint){d("Upgrading socket connection to TLS");const e=r.servername||r.host;return a.default.connect(Object.assign(Object.assign({},function(e,...t){const r={};let n;for(n in e)t.includes(n)||(r[n]=e[n]);return r}(r,"host","hostname","path","port")),{socket:o,servername:e}))}return o}o.destroy();const E=new i.default.Socket({writable:!1});return E.readable=!0,t.once("socket",(e=>{d("replaying proxy buffer for failed request"),u.default(e.listenerCount("data")>0),e.push(b),e.push(null)})),E}))}}function m(e){e.resume()}return Qn.default=h,Qn}const Ao=Wn(function(){if(wo)return _o;wo=1;const e=(_o&&_o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ro());function t(t){return new e.default(t)}return function(t){t.HttpsProxyAgent=e.default,t.prototype=e.default.prototype}(t||(t={})),_o=t}());var Co,So,xo,To={exports:{}};var jo=function(){if(xo)return To.exports;xo=1;var e,t,n,o=r,i=o.URL,a=u,c=l,f=d.Writable,p=s,h=function(){return So||(So=1,Co=function(){if(!e){try{e=fo()("follow-redirects")}catch(e){}"function"!=typeof e&&(e=function(){})}e.apply(null,arguments)}),Co;var e}();e="undefined"!=typeof process,t="undefined"!=typeof window&&"undefined"!=typeof document,n=F(Error.captureStackTrace),e||!t&&n||console.warn("The follow-redirects package should be excluded from browser builds.");var m=!1;try{p(new i(""))}catch(e){m="ERR_INVALID_URL"===e.code}var y=["Authorization","Proxy-Authorization","Cookie"],g=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],b=["abort","aborted","connect","error","socket","timeout"],E=Object.create(null);b.forEach((function(e){E[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}}));var _=D("ERR_INVALID_URL","Invalid URL",TypeError),w=D("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),O=D("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",w),v=D("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),R=D("ERR_STREAM_WRITE_AFTER_END","write after end"),A=f.prototype.destroy||x;function C(e,t){f.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(e){try{r._processResponse(e)}catch(e){r.emit("error",e instanceof w?e:new w({cause:e}))}},this._headerFilter=new RegExp("^(?:"+y.concat(e.sensitiveHeaders).map(I).join("|")+")$","i"),this._performRequest()}function S(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach((function(n){var o=n+":",s=r[o]=e[n],a=t[n]=Object.create(s);Object.defineProperties(a,{request:{value:function(e,n,s){var a;return a=e,i&&a instanceof i?e=P(e):U(e)?e=P(T(e)):(s=n,n=j(e),e={protocol:o}),F(n)&&(s=n,n=null),(n=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,n)).nativeProtocols=r,U(n.host)||U(n.hostname)||(n.hostname="::1"),p.equal(n.protocol,o,"protocol mismatch"),h("options",n),new C(n,s)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,r){var n=a.request(e,t,r);return n.end(),n},configurable:!0,enumerable:!0,writable:!0}})})),t}function x(){}function T(e){var t;if(m)t=new i(e);else if(!U((t=j(o.parse(e))).protocol))throw new _({input:e});return t}function j(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new _({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new _({input:e.href||e});return e}function P(e,t){var r=t||{};for(var n of g)r[n]=e[n];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),""!==r.port&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function N(e,t){var r;for(var n in t)e.test(n)&&(r=t[n],delete t[n]);return null==r?void 0:String(r).trim()}function D(e,t,r){function n(r){F(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,r||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return n.prototype=new(r||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),n}function L(e,t){for(var r of b)e.removeListener(r,E[r]);e.on("error",x),e.destroy(t)}function U(e){return"string"==typeof e||e instanceof String}function F(e){return"function"==typeof e}function I(e){return e.replace(/[\]\\/()*+?.$]/g,"\\$&")}return C.prototype=Object.create(f.prototype),C.prototype.abort=function(){L(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},C.prototype.destroy=function(e){return L(this._currentRequest,e),A.call(this,e),this},C.prototype.write=function(e,t,r){if(this._ending)throw new R;if(!U(e)&&("object"!=typeof(n=e)||!("length"in n)))throw new TypeError("data should be a string, Buffer or Uint8Array");var n;F(t)&&(r=t,t=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new v),this.abort()):r&&r()},C.prototype.end=function(e,t,r){if(F(e)?(r=e,e=t=null):F(t)&&(r=t,t=null),e){var n=this,o=this._currentRequest;this.write(e,t,(function(){n._ended=!0,o.end(null,null,r)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,r)},C.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},C.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},C.prototype.setTimeout=function(e,t){var r=this;function n(t){t.setTimeout(e),t.removeListener("timeout",t.destroy),t.addListener("timeout",t.destroy)}function o(t){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout((function(){r.emit("timeout"),s()}),e),n(t)}function s(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",s),r.removeListener("error",s),r.removeListener("response",s),r.removeListener("close",s),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",o)}return t&&this.on("timeout",t),this.socket?o(this.socket):this._currentRequest.once("socket",o),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){C.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(C.prototype,e,{get:function(){return this._currentRequest[e]}})})),C.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.sensitiveHeaders instanceof Array||(e.sensitiveHeaders=[]),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}},C.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);for(var s of(n._redirectable=this,b))n.on(s,E[s]);if(this._currentUrl=/^\//.test(this._options.path)?o.format(this._options):this._options.path,this._isRedirect){var i=0,a=this,c=this._requestBodyBuffers;!function e(t){if(n===a._currentRequest)if(t)a.emit("error",t);else if(i<c.length){var r=c[i++];n.finished||n.write(r.data,r.encoding,e)}else a._ended&&n.end()}()}},C.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r,n=e.headers.location;if(!n||!1===this._options.followRedirects||t<300||t>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(L(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new O;var s=this._options.beforeRedirect;s&&(r=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var a=this._options.method;((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],N(/^content-/i,this._options.headers));var c,u,l=N(/^host$/i,this._options.headers),f=T(this._currentUrl),d=l||f.host,y=/^\w+:/.test(n)?this._currentUrl:o.format(Object.assign(f,{host:d})),g=(c=n,u=y,m?new i(c,u):T(o.resolve(u,c)));if(h("redirecting to",g.href),this._isRedirect=!0,P(g,this._options),(g.protocol!==f.protocol&&"https:"!==g.protocol||g.host!==d&&!function(e,t){p(U(e)&&U(t));var r=e.length-t.length-1;return r>0&&"."===e[r]&&e.endsWith(t)}(g.host,d))&&N(this._headerFilter,this._options.headers),F(s)){var b={headers:e.headers,statusCode:t},E={url:y,method:a,headers:r};s(this._options,b,E),this._sanitizeOptions(this._options)}this._performRequest()},To.exports=S({http:a,https:c}),To.exports.wrap=S,To.exports}();const Po=Wn(jo),No="1.18.1";function Do(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const Lo=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;const Uo=Symbol("internals");class Fo extends d.Transform{constructor(e){super({readableHighWaterMark:(e=Gr.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,t)=>!Gr.isUndefined(t[e])))).chunkSize});const t=this[Uo]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",(e=>{"progress"===e&&(t.isCaptured||(t.isCaptured=!0))}))}_read(e){const t=this[Uo];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,r){const n=this[Uo],o=n.maxRate,s=this.readableHighWaterMark,i=n.timeWindow,a=o/(1e3/i),c=!1!==n.minChunkSize?Math.max(n.minChunkSize,.01*a):0,u=(e,t)=>{const r=Buffer.byteLength(e);n.bytesSeen+=r,n.bytes+=r,n.isCaptured&&this.emit("progress",n.bytesSeen),this.push(e)?process.nextTick(t):n.onReadCallback=()=>{n.onReadCallback=null,process.nextTick(t)}},l=(e,t)=>{const r=Buffer.byteLength(e);let l,f=null,p=s,d=0;if(o){const e=Date.now();(!n.ts||(d=e-n.ts)>=i)&&(n.ts=e,l=a-n.bytes,n.bytes=l<0?-l:0,d=0),l=a-n.bytes}if(o){if(l<=0)return setTimeout((()=>{t(null,e)}),i-d);l<p&&(p=l)}p&&r>p&&r-p>c&&(f=e.subarray(p),e=e.subarray(0,p)),u(e,f?()=>{process.nextTick(t,null,f)}:t)};l(e,(function e(t,n){if(t)return r(t);n?l(n,e):r(null)}))}}const{asyncIterator:Io}=Symbol,ko=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[Io]?yield*e[Io]():yield e},Bo=Tn.ALPHABET.ALPHA_DIGIT+"-_",qo="function"==typeof TextEncoder?new TextEncoder:new a.TextEncoder,Mo="\r\n",Ho=qo.encode(Mo);class zo{constructor(e,t){const{escapeName:r}=this.constructor,n=Gr.isString(t);let o=`Content-Disposition: form-data; name="${r(e)}"${!n&&t.name?`; filename="${r(t.name)}"`:""}${Mo}`;if(n)t=qo.encode(String(t).replace(/\r?\n|\r\n?/g,Mo));else{o+=`Content-Type: ${String(t.type||"application/octet-stream").replace(/[\r\n]/g,"")}${Mo}`}this.headers=qo.encode(o+Mo),this.contentLength=n?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=t}async*encode(){yield this.headers;const{value:e}=this;Gr.isTypedArray(e)?yield e:yield*ko(e),yield Ho}static escapeName(e){return String(e).replace(/[\r\n"]/g,(e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e])))}}class $o extends d.Transform{__transform(e,t,r){this.push(e),r()}_transform(e,t,r){if(0!==e.length&&(this._transform=this.__transform,120!==e[0])){const e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,t)}this.__transform(e,t,r)}}const Wo=(e,t)=>Gr.isAsyncFn(e)?function(...r){const n=r.pop();e.apply(this,r).then((e=>{try{t?n(null,...t(e)):n(null,e)}catch(e){n(e)}}),n)}:e,Vo=new Set(["localhost","0.0.0.0"]),Go=e=>{const t=e.split(".");return 4===t.length&&("127"===t[0]&&t.every((e=>/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255)))},Jo=e=>/^0{1,4}$/.test(e),Ko=e=>!!e&&(!!Vo.has(e)||(!!Go(e)||(!!(e=>{if("::"===e)return!0;const t=e.indexOf("::");if(-1!==t){if(t!==e.lastIndexOf("::"))return!1;const r=e.slice(0,t),n=e.slice(t+2),o=r?r.split(":"):[],s=n?n.split(":"):[];return o.length+s.length<8&&o.every(Jo)&&s.every(Jo)}const r=e.split(":");return 8===r.length&&r.every(Jo)})(e)||(e=>{if("::1"===e)return!0;const t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return Go(t[1]);const r=e.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(r){const e=parseInt(r[1],16);return e>=32512&&e<=32767}const n=e.split(":");if(8===n.length){for(let e=0;e<7;e++)if(!/^0+$/.test(n[e]))return!1;return/^0*1$/.test(n[7])}return!1})(e)))),Xo={http:80,https:443,ws:80,wss:443,ftp:21},Zo=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,Qo=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,Yo=e=>e?("["===e.charAt(0)&&"]"===e.charAt(e.length-1)&&(e=e.slice(1,-1)),(e=>{if("string"!=typeof e||-1===e.indexOf(":"))return e;const t=e.match(Zo);if(t)return t[1];const r=e.match(Qo);if(r){const e=parseInt(r[1],16),t=parseInt(r[2],16);return`${e>>8}.${255&e}.${t>>8}.${255&t}`}return e})(e.replace(/\.+$/,""))):e;function es(e){let t;try{t=new URL(e)}catch(e){return!1}const r=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!r)return!1;if("*"===r)return!0;const n=Number.parseInt(t.port,10)||Xo[t.protocol.split(":",1)[0]]||0,o=Yo(t.hostname.toLowerCase());return r.split(/[\s,]+/).some((e=>{if(!e)return!1;let[t,r]=(e=>{let t=e,r=0;if("["===t.charAt(0)){const e=t.indexOf("]");if(-1!==e){const n=t.slice(1,e),o=t.slice(e+1);return":"===o.charAt(0)&&/^\d+$/.test(o.slice(1))&&(r=Number.parseInt(o.slice(1),10)),[n,r]}}const n=t.indexOf(":"),o=t.lastIndexOf(":");return-1!==n&&n===o&&/^\d+$/.test(t.slice(o+1))&&(r=Number.parseInt(t.slice(o+1),10),t=t.slice(0,o)),[t,r]})(e);return t=Yo(t),!!t&&((!r||r===n)&&("*"===t.charAt(0)&&(t=t.slice(1)),"."===t.charAt(0)?o.endsWith(t):o===t||Ko(o)&&Ko(t)))}))}const ts=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=n[i];o||(o=c),r[s]=a,n[s]=c;let l=i,f=0;for(;l!==s;)f+=r[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const p=u&&c-u;return p?Math.round(1e3*f/p):void 0}}(50,250);return function(e,t){let r,n,o=0,s=1e3/t;const i=(t,s=Date.now())=>{o=s,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(r=e,n||(n=setTimeout((()=>{n=null,i(r)}),s-a)))},()=>r&&i(r)]}((r=>{if(!r||"number"!=typeof r.loaded)return;const s=r.loaded,i=r.lengthComputable?r.total:void 0,a=null!=i?Math.min(s,i):s,c=Math.max(0,a-n),u=o(c);n=Math.max(n,a);e({loaded:a,total:i,progress:i?a/i:void 0,bytes:c,rate:u||void 0,estimated:u&&i?(i-a)/u:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})}),r)},rs=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},ns=e=>(...t)=>Gr.asap((()=>e(...t))),os=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,ss=(e,t,r)=>t+2<r&&os(e.charCodeAt(t+1))&&os(e.charCodeAt(t+2));function is(e){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let e=n.length;const t=n.length;for(let r=0;r<t;r++)if(37===n.charCodeAt(r)&&r+2<t){const t=n.charCodeAt(r+1),o=n.charCodeAt(r+2);os(t)&&os(o)&&(e-=2,r+=2)}let r=0,o=t-1;const s=e=>e>=2&&37===n.charCodeAt(e-2)&&51===n.charCodeAt(e-1)&&(68===n.charCodeAt(e)||100===n.charCodeAt(e));o>=0&&(61===n.charCodeAt(o)?(r++,o--):s(o)&&(r++,o-=3)),1===r&&o>=0&&(61===n.charCodeAt(o)||s(o))&&r++;const i=3*Math.floor(e/4)-(r||0);return i>0?i:0}let o=0;for(let e=0,t=n.length;e<t;e++){const r=n.charCodeAt(e);if(37===r&&ss(n,e,t))o+=1,e+=2;else if(r<128)o+=1;else if(r<2048)o+=2;else if(r>=55296&&r<=56319&&e+1<t){const t=n.charCodeAt(e+1);t>=56320&&t<=57343?(o+=4,e++):o+=3}else o+=3}return o}const as={flush:h.constants.Z_SYNC_FLUSH,finishFlush:h.constants.Z_SYNC_FLUSH},cs={flush:h.constants.BROTLI_OPERATION_FLUSH,finishFlush:h.constants.BROTLI_OPERATION_FLUSH},us={flush:h.constants.ZSTD_e_flush,finishFlush:h.constants.ZSTD_e_flush},ls=Gr.isFunction(h.createBrotliDecompress),fs=Gr.isFunction(h.createZstdDecompress),ps="gzip, compress, deflate"+(ls?", br":""),ds=ps+(fs?", zstd":""),{http:hs,https:ms}=Po,ys=/https:?/,gs=["content-type","content-length"];const bs=Symbol("axios.http.socketListener"),Es=Symbol("axios.http.currentReq"),_s=Symbol("axios.http.installedTunnel"),ws=new Map,Os=new WeakMap,vs={22:21,24:5};function Rs(e,t=process.versions&&process.versions.node){if(!function(e=process.versions&&process.versions.node){if(!e)return!1;const[t,r]=e.split(".").map((e=>Number(e)));return!(!Number.isInteger(t)||!Number.isInteger(r))&&(t>24||null!=vs[t]&&r>=vs[t])}(t))return!1;const r=e&&e.options;return Boolean(r&&Gr.hasOwnProp(r,"proxyEnv")&&null!=r.proxyEnv)}const As=Tn.protocols.map((e=>e+":")),Cs=e=>{if(!Gr.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},Ss=(e,[t,r])=>(e.on("end",r).on("error",r),t),xs=new class{constructor(){this.sessions=Object.create(null)}getSession(e,t){t=Object.assign({sessionTimeout:1e3},t);let r=this.sessions[e];if(r){let e=r.length;for(let n=0;n<e;n++){const[e,o]=r[n];if(!e.destroyed&&!e.closed&&a.isDeepStrictEqual(o,t))return e}}const n=f.connect(e,t);let o,s;const i=()=>{if(o)return;o=!0,s&&(clearTimeout(s),s=null);let t=r,i=t.length,a=i;for(;a--;)if(t[a][0]===n)return 1===i?delete this.sessions[e]:t.splice(a,1),void(n.closed||n.close())},c=n.request,{sessionTimeout:u}=t;if(null!=u){let e=0;n.request=function(){const t=c.apply(this,arguments);return e++,s&&(clearTimeout(s),s=null),t.once("close",(()=>{--e||(s=setTimeout((()=>{s=null,i()}),u))})),t}}n.once("close",i);let l=[n,t];return r?r.push(l):r=this.sessions[e]=[l],n}};function Ts(e,t,r){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.auth&&e.beforeRedirects.auth(e),e.beforeRedirects.sensitiveHeaders&&e.beforeRedirects.sensitiveHeaders(e,r),e.beforeRedirects.config&&e.beforeRedirects.config(e,t,r)}function js(e,t,r,n,o,s){let i=t;const a=function(e,t,r){return ys.test(e.protocol)?r||l.globalAgent:t||u.globalAgent}(e,s,o);if(!i&&!1!==i&&!Rs(a)){const e=zn(r);e&&(es(r)||(i=new URL(e)))}if(n&&e.headers)for(const t of Object.keys(e.headers))"proxy-authorization"===t.toLowerCase()&&delete e.headers[t];if(n&&e.agent&&e.agent[_s]&&(e.agent=void 0),i){const t=i instanceof URL,n=e=>t||Gr.hasOwnProp(i,e)?i[e]:void 0,s=n("username"),a=n("password");let c=Gr.hasOwnProp(i,"auth")?i.auth:void 0;if(s&&(c=(s||"")+":"+(a||"")),c){const e="object"==typeof c,t=e&&Gr.hasOwnProp(c,"username")?c.username:void 0,r=e&&Gr.hasOwnProp(c,"password")?c.password:void 0;if(Boolean(t||r))c=(t||"")+":"+(r||"");else if(e)throw new sn("Invalid proxy authorization",sn.ERR_BAD_OPTION,{proxy:i})}if(ys.test(e.protocol)){if(!(o instanceof Ao)){const t=n("hostname")||n("host"),r=n("port"),s=n("protocol"),i=s?s.includes(":")?s:`${s}:`:"http:",a=t&&t.includes(":")&&!t.startsWith("[")?`[${t}]`:t,u=new URL(`${i}//${a}${r?":"+r:""}`),l={protocol:u.protocol,hostname:u.hostname.replace(/^\[|\]$/g,""),port:u.port,auth:c&&"string"==typeof c?c:void 0};"https:"===u.protocol&&(l.ALPNProtocols=["http/1.1"]);const f=function(e,t){const r=e.protocol+"//"+e.hostname+":"+(e.port||"")+"#"+(e.auth||""),n=t?Os.get(t)||Os.set(t,new Map).get(t):ws;let o=n.get(r);if(o)return o;const s=t&&t.options?{...t.options,...e}:e;if(o=new Ao(s),t&&t.options){const e={...t.options},r=o.callback;o.callback=function(t,n){return r.call(this,t,{...e,...n})}}return o[_s]=!0,n.set(r,o),o}(l,o);e.agent=f,e.agents&&(e.agents.https=f)}}else{if(c){const t=Buffer.from(c,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+t}let t=!1;for(const r of Object.keys(e.headers))if("host"===r.toLowerCase()){t=!0;break}t||(e.headers.host=e.hostname+(e.port?":"+e.port:""));const o=n("hostname")||n("host");e.hostname=o,e.host=o,e.port=n("port"),e.path=r;const s=n("protocol");s&&(e.protocol=s.includes(":")?s:`${s}:`)}}e.beforeRedirects.proxy=function(e){js(e,t,e.href,!0,o,s)}}const Ps="undefined"!=typeof process&&"process"===Gr.kindOf(process),Ns=(e,t)=>(({address:e,family:t})=>{if(!Gr.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}})(Gr.isObject(e)?e:{address:e,family:t}),Ds={request(e,t){const r=e.protocol+"//"+e.hostname+":"+(e.port||("https:"===e.protocol?443:80)),{http2Options:n,headers:o}=e,s=xs.getSession(r,n),{HTTP2_HEADER_SCHEME:i,HTTP2_HEADER_METHOD:a,HTTP2_HEADER_PATH:c,HTTP2_HEADER_STATUS:u}=f.constants,l={[i]:e.protocol.replace(":",""),[a]:e.method,[c]:e.path};Gr.forEach(o,((e,t)=>{":"!==t.charAt(0)&&(l[t]=e)}));const p=s.request(l);return p.once("response",(e=>{const r=p,n=(e=Object.assign({},e))[u];delete e[u],r.headers=e,r.statusCode=+n,t(r)})),p}},Ls=Ps&&function(e){return t=async function(t,r,n){const o=t=>Gr.getSafeProp(e,t),s=o("transitional")||bn;let i=o("data"),f=o("lookup"),m=o("family"),y=o("httpVersion");void 0===y&&(y=1);let g=o("http2Options");const b=o("httpAgent"),E=o("httpsAgent"),_=o("proxy"),w=o("responseType"),O=o("responseEncoding"),v=o("socketPath"),R=o("method").toUpperCase(),A=o("maxRedirects"),C=o("maxBodyLength"),S=o("maxContentLength"),x=o("decompress");let T,j,P,N=!1;if(y=+y,Number.isNaN(y))throw TypeError(`Invalid protocol version: '${e.httpVersion}' is not a number`);if(1!==y&&2!==y)throw TypeError(`Unsupported protocol version '${y}'`);const D=2===y;if(f){const e=Wo(f,(e=>Gr.isArray(e)?e:[e]));f=(t,r,n)=>{e(t,r,((e,t,o)=>{if(e)return n(e);const s=Gr.isArray(t)?t.map((e=>Ns(e))):[Ns(t,o)];r.all?n(e,s):n(e,s[0].address,s[0].family)}))}}const L=new c.EventEmitter;function U(t){try{L.emit("abort",!t||t.type?new Fn(null,e,j):t)}catch(e){}}function F(){P&&(clearTimeout(P),P=null)}L.once("abort",r);const I=()=>{F(),e.cancelToken&&e.cancelToken.unsubscribe(U),e.signal&&e.signal.removeEventListener("abort",U),L.removeAllListeners()};(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(U),e.signal&&(e.signal.aborted?U():e.signal.addEventListener("abort",U))),n(((e,t)=>{if(T=!0,F(),t)return N=!0,void I();const{data:r}=e;if(r instanceof d.Readable||r instanceof d.Duplex){const e=d.finished(r,(()=>{e(),I()}))}else I()}));const k=Mn(o("baseURL"),o("url"),o("allowAbsoluteUrls"),e),B=v?"http://localhost":Tn.hasBrowserEnv?Tn.origin:void 0,q=new URL(k,B),M=q.protocol||As[0];if("data:"===M){if(S>-1&&is(String(o("url")||k||""))>S)return r(new sn("maxContentLength size of "+S+" exceeded",sn.ERR_BAD_RESPONSE,e));let n;if("GET"!==R)return In(t,r,{status:405,statusText:"method not allowed",headers:{},config:e});try{n=function(e,t,r){const n=r&&r.Blob||Tn.classes.Blob,o=Do(e);if(void 0===t&&n&&(t=!0),"data"===o){e=o.length?e.slice(o.length+1):e;const r=Lo.exec(e);if(!r)throw new sn("Invalid URL",sn.ERR_INVALID_URL);const s=r[1],i=r[2],a=r[3]?"base64":"utf8",c=r[4];let u="";s?u=i?s+i:s:i&&(u="text/plain"+i);const l="base64"===a?Buffer.from(c,"base64"):Buffer.from(decodeURIComponent(c),a);if(t){if(!n)throw new sn("Blob is not supported",sn.ERR_NOT_SUPPORT);return new n([l],{type:u})}return l}throw new sn("Unsupported protocol "+o,sn.ERR_NOT_SUPPORT)}(o("url"),"blob"===w,{Blob:e.env&&e.env.Blob})}catch(t){throw sn.from(t,sn.ERR_BAD_REQUEST,e)}return"text"===w?(n=n.toString(O),O&&"utf8"!==O||(n=Gr.stripBOM(n))):"stream"===w&&(n=d.Readable.from(n)),In(t,r,{data:n,status:200,statusText:"OK",headers:new nn,config:e})}if(-1===As.indexOf(M))return r(new sn("Unsupported protocol "+M,sn.ERR_BAD_REQUEST,e));const H=nn.from(e.headers).normalize();H.set("User-Agent","axios/"+No,!1);const{onUploadProgress:z,onDownloadProgress:$}=e,W=e.maxRate;let V,G;if(Gr.isSpecCompliantForm(i)){const e=H.getContentType(/boundary=([-_\w\d]{10,70})/i);i=((e,t,r)=>{const{tag:n="form-data-boundary",size:o=25,boundary:s=n+"-"+Tn.generateString(o,Bo)}=r||{};if(!Gr.isFormData(e))throw new TypeError("FormData instance required");if(s.length<1||s.length>70)throw new Error("boundary must be 1-70 characters long");const i=qo.encode("--"+s+Mo),a=qo.encode("--"+s+"--"+Mo);let c=a.byteLength;const u=Array.from(e.entries()).map((([e,t])=>{const r=new zo(e,t);return c+=r.size,r}));c+=i.byteLength*u.length,c=Gr.toFiniteNumber(c);const l={"Content-Type":`multipart/form-data; boundary=${s}`};return Number.isFinite(c)&&(l["Content-Length"]=c),t&&t(l),d.Readable.from(async function*(){for(const e of u)yield i,yield*e.encode();yield a}())})(i,(e=>{H.set(e)}),{tag:`axios-${No}-boundary`,boundary:e&&e[1]||void 0})}else if(Gr.isFormData(i)&&Gr.isFunction(i.getHeaders)&&i.getHeaders!==Object.prototype.getHeaders){if(function(e,t,r){"content-only"===r?Object.entries(t).forEach((([t,r])=>{gs.includes(t.toLowerCase())&&e.set(t,r)})):e.set(t)}(H,i.getHeaders(),o("formDataHeaderPolicy")),!H.hasContentLength())try{const e=await a.promisify(i.getLength).call(i);Number.isFinite(e)&&e>=0&&H.setContentLength(e)}catch(e){}}else if(Gr.isBlob(i)||Gr.isFile(i))i.size&&H.setContentType(i.type||"application/octet-stream"),H.setContentLength(i.size||0),i=d.Readable.from(ko(i));else if(i&&!Gr.isStream(i)){if(Buffer.isBuffer(i));else if(Gr.isArrayBuffer(i))i=Buffer.from(new Uint8Array(i));else{if(!Gr.isString(i))return r(new sn("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",sn.ERR_BAD_REQUEST,e));i=Buffer.from(i,"utf-8")}if(H.setContentLength(i.length,!1),C>-1&&i.length>C)return r(new sn("Request body larger than maxBodyLength limit",sn.ERR_BAD_REQUEST,e))}const J=Gr.toFiniteNumber(H.getContentLength());let K;Gr.isArray(W)?(V=W[0],G=W[1]):V=G=W,i&&(z||V)&&(Gr.isStream(i)||(i=d.Readable.from(i,{objectMode:!1})),i=d.pipeline([i,new Fo({maxRate:Gr.toFiniteNumber(V)})],Gr.noop),z&&i.on("progress",Ss(i,rs(J,ts(ns(z),!1,3)))));const X=o("auth");let Z;X&&(K=(Gr.getSafeProp(X,"username")||"")+":"+(Gr.getSafeProp(X,"password")||"")),K||!q.username&&!q.password||(K=Cs(q.username)+":"+Cs(q.password)),K&&H.delete("authorization");try{Z=yn(q.pathname+q.search,o("params"),o("paramsSerializer")).replace(/^\?/,"")}catch(t){return r(sn.from(t,sn.ERR_BAD_REQUEST,e,null,null,{url:o("url"),exists:!0}))}H.set("Accept-Encoding",Gr.hasOwnProp(s,"advertiseZstdAcceptEncoding")&&!0===s.advertiseZstdAcceptEncoding?ds:ps,!1);const Q=Object.assign(Object.create(null),{path:Z,method:R,headers:Qr(H),agents:{http:b,https:E},auth:K,protocol:M,family:m,beforeRedirect:Ts,beforeRedirects:Object.create(null),http2Options:g});if(!Gr.isUndefined(f)&&(Q.lookup=f),v){if("string"!=typeof v)return r(new sn("socketPath must be a string",sn.ERR_BAD_OPTION_VALUE,e));const t=o("allowedSocketPaths");if(null!=t){const n=Array.isArray(t)?t:[t],o=p.resolve(v);if(!n.some((e=>"string"==typeof e&&p.resolve(e)===o)))return r(new sn(`socketPath "${v}" is not permitted by allowedSocketPaths`,sn.ERR_BAD_OPTION_VALUE,e))}Q.socketPath=v}else Q.hostname=q.hostname.startsWith("[")?q.hostname.slice(1,-1):q.hostname,Q.port=q.port,js(Q,_,M+"//"+q.hostname+(q.port?":"+q.port:"")+Q.path,!1,E,b);let Y,ee=!1,te=!1;const re=ys.test(Q.protocol);if(null==Q.agent&&(Q.agent=re?E:b),D)Y=Ds;else{const t=o("transport");if(t)Y=t;else if(0===A)Y=re?l:u,ee=!0;else{te=!0,Q.sensitiveHeaders=[],A&&(Q.maxRedirects=A);const t=o("beforeRedirect");if(t&&(Q.beforeRedirects.config=t),K){const e=q.origin,t=K;Q.beforeRedirects.auth=function(r){try{new URL(r.href).origin===e&&(r.auth=t)}catch(e){}}}const n=o("sensitiveHeaders");if(null!=n){if(!Gr.isArray(n))return r(new sn("sensitiveHeaders must be an array of strings",sn.ERR_BAD_OPTION_VALUE,e));const t=new Set;for(const o of n){if(!Gr.isString(o))return r(new sn("sensitiveHeaders must be an array of strings",sn.ERR_BAD_OPTION_VALUE,e));t.add(o.toLowerCase())}t.size&&(Q.sensitiveHeaders=Array.from(t),Q.beforeRedirects.sensitiveHeaders=function(e,r){(function(e,t){if(!t)return!1;try{return new URL(t.url).origin===new URL(e.href).origin}catch(e){return!1}})(e,r)||function(e,t){e&&Object.keys(e).forEach((r=>{t.has(r.toLowerCase())&&delete e[r]}))}(e.headers,t)})}Y=re?ms:hs}}Q.maxBodyLength=C>-1?C:1/0,Q.insecureHTTPParser=Boolean(o("insecureHTTPParser")),j=Y.request(Q,(function(n){if(F(),j.destroyed)return;const o=[n],s=Gr.toFiniteNumber(n.headers["content-length"]);if($||G){const u=new Fo({maxRate:Gr.toFiniteNumber(G)});$&&u.on("progress",Ss(u,rs(s,ts(ns($),!0,3)))),o.push(u)}let i=n;const a=n.req||j;if(!1!==x&&n.headers["content-encoding"])switch("HEAD"!==R&&204!==n.statusCode||delete n.headers["content-encoding"],(n.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":o.push(h.createUnzip(as)),delete n.headers["content-encoding"];break;case"deflate":o.push(new $o),o.push(h.createUnzip(as)),delete n.headers["content-encoding"];break;case"br":ls&&(o.push(h.createBrotliDecompress(cs)),delete n.headers["content-encoding"]);break;case"zstd":fs&&(o.push(h.createZstdDecompress(us)),delete n.headers["content-encoding"])}i=o.length>1?d.pipeline(o,Gr.noop):o[0];const c={status:n.statusCode,statusText:n.statusMessage,headers:new nn(n.headers),config:e,request:a};if("stream"===w){if(S>-1){const l=S,f=i;async function*p(){let t=0;for await(const r of f){if(t+=r.length,t>l)throw new sn("maxContentLength size of "+l+" exceeded",sn.ERR_BAD_RESPONSE,e,a);yield r}}i=d.Readable.from(p(),{objectMode:!1})}c.data=i,In(t,r,c)}else{const m=[];let y=0;i.on("data",(function(t){m.push(t),y+=t.length,S>-1&&y>S&&(N=!0,i.destroy(),U(new sn("maxContentLength size of "+S+" exceeded",sn.ERR_BAD_RESPONSE,e,a)))})),i.on("aborted",(function(){if(N)return;const t=new sn("stream has been aborted",sn.ERR_BAD_RESPONSE,e,a,c);i.destroy(t),r(t)})),i.on("error",(function(t){N||r(sn.from(t,null,e,a,c))})),i.on("end",(function(){try{let e=1===m.length?m[0]:Buffer.concat(m);"arraybuffer"!==w&&(e=e.toString(O),O&&"utf8"!==O||(e=Gr.stripBOM(e))),c.data=e}catch(t){return r(sn.from(t,null,e,c.request,c))}In(t,r,c)}))}L.once("abort",(e=>{i.destroyed||(i.emit("error",e),i.destroy())}))})),L.once("abort",(e=>{j.close?j.close():j.destroy(e)})),j.on("error",(function(t){r(sn.from(t,null,e,j))}));const ne=new Set;if(j.on("socket",(function(e){"function"==typeof e.setKeepAlive&&e.setKeepAlive(!0,6e4),e[bs]||(e.on("error",(function(t){const r=e[Es];r&&!r.destroyed&&r.destroy(t)})),e[bs]=!0),e[Es]=j,ne.add(e)})),j.once("close",(function(){F();for(const e of ne)e[Es]===j&&(e[Es]=null);ne.clear()})),o("timeout")){const t=parseInt(o("timeout"),10);if(Number.isNaN(t))return void U(new sn("error trying to parse `config.timeout` to int",sn.ERR_BAD_OPTION_VALUE,e,j));const r=function(){T||U(function(){const t=o("timeout");let r=t?"timeout of "+t+"ms exceeded":"timeout exceeded";const n=o("timeoutErrorMessage");return n&&(r=n),new sn(r,s.clarifyTimeoutError?sn.ETIMEDOUT:sn.ECONNABORTED,e,j)}())};ee&&t>0&&(P=setTimeout(r,t)),j.setTimeout(t,r)}else j.setTimeout(0);if(Gr.isStream(i)){let t=!1,r=!1;i.on("end",(()=>{t=!0})),i.once("error",(e=>{r=!0,j.destroy(e)})),i.on("close",(()=>{t||r||U(new Fn("Request stream has been aborted",e,j))}));let n=i;if(C>-1&&!te){const t=C;let r=0;n=d.pipeline([i,new d.Transform({transform(n,o,s){if(r+=n.length,r>t)return s(new sn("Request body larger than maxBodyLength limit",sn.ERR_BAD_REQUEST,e,j));s(null,n)}})],Gr.noop),n.on("error",(e=>{j.destroyed||j.destroy(e)}))}n.pipe(j)}else i&&j.write(i),j.end()},new Promise(((e,r)=>{let n,o;const s=(e,t)=>{o||(o=!0,n&&n(e,t))},i=e=>{s(e,!0),r(e)};t((t=>{s(t),e(t)}),i,(e=>n=e)).catch(i)}));var t},Us=Tn.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Tn.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Tn.origin),Tn.navigator&&/(msie|trident)/i.test(Tn.navigator.userAgent)):()=>!0,Fs=Tn.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];Gr.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),Gr.isString(n)&&a.push(`path=${n}`),Gr.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),Gr.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),o=n.indexOf("=");if(-1!==o&&n.slice(0,o)===e)try{return decodeURIComponent(n.slice(o+1))}catch(e){return n.slice(o+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},Is=e=>e instanceof nn?{...e}:e;function ks(e,t){e=e||{},t=t||{};const r=Object.create(null);function n(e,t,r,n){return Gr.isPlainObject(e)&&Gr.isPlainObject(t)?Gr.merge.call({caseless:n},e,t):Gr.isPlainObject(t)?Gr.merge({},t):Gr.isArray(t)?t.slice():t}function o(e,t,r,o){return Gr.isUndefined(t)?Gr.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function s(e,t){if(!Gr.isUndefined(t))return n(void 0,t)}function i(e,t){return Gr.isUndefined(t)?Gr.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,o,s){return Gr.hasOwnProp(t,s)?n(r,o):Gr.hasOwnProp(e,s)?n(void 0,r):void 0}Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:a,headers:(e,t,r)=>o(Is(e),Is(t),0,!0)};return Gr.forEach(Object.keys({...e,...t}),(function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;const s=Gr.hasOwnProp(c,n)?c[n]:o,i=s(Gr.hasOwnProp(e,n)?e[n]:void 0,Gr.hasOwnProp(t,n)?t[n]:void 0,n);Gr.isUndefined(i)&&s!==a||(r[n]=i)})),Gr.hasOwnProp(t,"validateStatus")&&Gr.isUndefined(t.validateStatus)&&!1===function(r){const n=Gr.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Gr.isUndefined(n)){if(!Gr.isPlainObject(n))return;if(Gr.hasOwnProp(n,r))return n[r]}const o=Gr.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Gr.isPlainObject(o)&&Gr.hasOwnProp(o,r))return o[r]}("validateStatusUndefinedResolves")&&(Gr.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const Bs=["content-type","content-length"];function qs(e){const t=ks({},e),r=e=>Gr.hasOwnProp(t,e)?t[e]:void 0,n=r("data");let o=r("withXSRFToken");const s=r("xsrfHeaderName"),i=r("xsrfCookieName");let a=r("headers");const c=r("auth"),u=r("baseURL"),l=r("allowAbsoluteUrls"),f=r("url");if(t.headers=a=nn.from(a),t.url=yn(Mn(u,f,l,t),r("params"),r("paramsSerializer")),c){const t=Gr.getSafeProp(c,"username")||"",r=Gr.getSafeProp(c,"password")||"";try{a.set("Authorization","Basic "+btoa(t+":"+(r?encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))):"")))}catch(t){throw sn.from(t,sn.ERR_BAD_OPTION_VALUE,e)}}if(Gr.isFormData(n)&&(Tn.hasStandardBrowserEnv||Tn.hasStandardBrowserWebWorkerEnv||Gr.isReactNative(n)?a.setContentType(void 0):Gr.isFunction(n.getHeaders)&&function(e,t,r){"content-only"===r?Object.entries(t||{}).forEach((([t,r])=>{Bs.includes(t.toLowerCase())&&e.set(t,r)})):e.set(t)}(a,n.getHeaders(),r("formDataHeaderPolicy"))),Tn.hasStandardBrowserEnv){Gr.isFunction(o)&&(o=o(t));if(!0===o||null==o&&Us(t.url)){const e=s&&i&&Fs.read(i);e&&a.set(s,e)}}return t}const Ms="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const n=qs(e);let o=n.data;const s=nn.from(n.headers).normalize();let i,a,c,u,l,{responseType:f,onUploadProgress:p,onDownloadProgress:d}=n;function h(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function y(){if(!m)return;const n=nn.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());In((function(e){t(e),h()}),(function(e){r(e),h()}),{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m}),m=null}m.open(n.method.toUpperCase(),n.url,!0),m.timeout=n.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&m.responseURL.startsWith("file:"))&&setTimeout(y)},m.onabort=function(){m&&(r(new sn("Request aborted",sn.ECONNABORTED,e,m)),h(),m=null)},m.onerror=function(t){const n=t&&t.message?t.message:"Network Error",o=new sn(n,sn.ERR_NETWORK,e,m);o.event=t||null,r(o),h(),m=null},m.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||bn;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new sn(t,o.clarifyTimeoutError?sn.ETIMEDOUT:sn.ECONNABORTED,e,m)),h(),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&Gr.forEach(Qr(s),(function(e,t){m.setRequestHeader(t,e)})),Gr.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),f&&"json"!==f&&(m.responseType=n.responseType),d&&([c,l]=ts(d,!0),m.addEventListener("progress",c)),p&&m.upload&&([a,u]=ts(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(i=t=>{m&&(r(!t||t.type?new Fn(null,e,m):t),m.abort(),h(),m=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const g=Do(n.url);if(g&&!Tn.protocols.includes(g))return r(new sn("Unsupported protocol "+g+":",sn.ERR_BAD_REQUEST,e)),void h();m.send(o||null)}))},Hs=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof sn?t:new Fn(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,o(new sn(`timeout of ${t}ms exceeded`,sn.ETIMEDOUT))}),t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o,{once:!0})));const{signal:a}=r;return a.unsubscribe=()=>Gr.asap(i),a},zs=function*(e,t){let r=e.byteLength;if(r<t)return void(yield e);let n,o=0;for(;o<r;)n=o+t,yield e.slice(o,n),o=n},$s=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},Ws=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of $s(e))yield*zs(r,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return a(),void e.close();let s=n.byteLength;if(r){let e=i+=s;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Vs}=Gr,Gs=e=>{if(!Gr.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},Js=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ks=e=>{const t=void 0!==Gr.global&&null!==Gr.global?Gr.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=Gr.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:i}=e,a=o?Vs(o):"function"==typeof fetch,c=Vs(s),u=Vs(i);if(!a)return!1;const l=a&&Vs(r),f=a&&("function"==typeof n?(p=new n,e=>p.encode(e)):async e=>new Uint8Array(await new s(e).arrayBuffer()));var p;const d=c&&l&&Js((()=>{let e=!1;const t=new s(Tn.origin,{body:new r,method:"POST",get duplex(){return e=!0,"half"}}),n=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!n})),h=u&&l&&Js((()=>Gr.isReadableStream(new i("").body))),m={stream:h&&(e=>e.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!m[e]&&(m[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new sn(`Response type '${e}' is not supported`,sn.ERR_NOT_SUPPORT,r)})}));const y=async e=>{if(null==e)return 0;if(Gr.isBlob(e))return e.size;if(Gr.isSpecCompliantForm(e)){const t=new s(Tn.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Gr.isArrayBufferView(e)||Gr.isArrayBuffer(e)?e.byteLength:(Gr.isURLSearchParams(e)&&(e+=""),Gr.isString(e)?(await f(e)).byteLength:void 0)};return async e=>{let{url:t,method:r,data:a,signal:u,cancelToken:f,timeout:p,onDownloadProgress:g,onUploadProgress:b,responseType:E,headers:_,withCredentials:w="same-origin",fetchOptions:O,maxContentLength:v,maxBodyLength:R}=qs(e);const A=Gr.isNumber(v)&&v>-1,C=Gr.isNumber(R)&&R>-1;let S=o||fetch;E=E?(E+"").toLowerCase():"text";let x=Hs([u,f&&f.toAbortSignal()],p),T=null;const j=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let P,N=null;const D=()=>new sn("Request body larger than maxBodyLength limit",sn.ERR_BAD_REQUEST,e,T);try{let o;const u=(U="auth",Gr.hasOwnProp(e,U)?e[U]:void 0);if(u){const e=Gr.getSafeProp(u,"username")||"";o={username:e,password:Gr.getSafeProp(u,"password")||""}}if((e=>{const t=e.indexOf("://");let r=e;return-1!==t&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")})(t)){const e=new URL(t,Tn.origin);if(!o&&(e.username||e.password)){const t=Gs(e.username);o={username:t,password:Gs(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(o&&(_.delete("authorization"),_.set("Authorization","Basic "+btoa((L=(o.username||"")+":"+(o.password||""),encodeURIComponent(L).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))))))),A&&"string"==typeof t&&t.startsWith("data:")){if(is(t)>v)throw new sn("maxContentLength size of "+v+" exceeded",sn.ERR_BAD_RESPONSE,e,T)}if(C&&"get"!==r&&"head"!==r){const e=await y(a);if("number"==typeof e&&isFinite(e)&&(P=e,e>R))throw D()}const f=C&&(Gr.isReadableStream(a)||Gr.isStream(a)),p=(e,t,r)=>Ws(e,65536,(e=>{if(C&&e>R)throw N=D();t&&t(e)}),r);if(d&&"get"!==r&&"head"!==r&&(b||f)){if(P=null==P?await(async(e,t)=>{const r=Gr.toFiniteNumber(e.getContentLength());return null==r?y(t):r})(_,a):P,0!==P||f){let e,r=new s(t,{method:"POST",body:a,duplex:"half"});if(Gr.isFormData(a)&&(e=r.headers.get("content-type"))&&_.setContentType(e),r.body){const[e,t]=b&&rs(P,ts(ns(b)))||[];a=p(r.body,e,t)}}}else if(f&&!c&&l&&"get"!==r&&"head"!==r)a=p(a);else if(f&&c&&!d&&"get"!==r&&"head"!==r)throw new sn("Stream request bodies are not supported by the current fetch implementation",sn.ERR_NOT_SUPPORT,e,T);Gr.isString(w)||(w=w?"include":"omit");const F=c&&"credentials"in s.prototype;if(Gr.isFormData(a)){const e=_.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&_.delete("content-type")}_.set("User-Agent","axios/"+No,!1);const I={...O,signal:x,method:r.toUpperCase(),headers:Qr(_.normalize()),body:a,duplex:"half",credentials:F?w:void 0};T=c&&new s(t,I);let k=await(c?S(T,O):S(t,I));const B=nn.from(k.headers);if(A){const t=Gr.toFiniteNumber(B.getContentLength());if(null!=t&&t>v)throw new sn("maxContentLength size of "+v+" exceeded",sn.ERR_BAD_RESPONSE,e,T)}const q=h&&("stream"===E||"response"===E);if(h&&k.body&&(g||A||q&&j)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=k[e]}));const r=Gr.toFiniteNumber(B.getContentLength()),[n,o]=g&&rs(r,ts(ns(g),!0))||[];let s=0;const a=t=>{if(A&&(s=t,s>v))throw new sn("maxContentLength size of "+v+" exceeded",sn.ERR_BAD_RESPONSE,e,T);n&&n(t)};k=new i(Ws(k.body,65536,a,(()=>{o&&o(),j&&j()})),t)}E=E||"text";let M=await m[Gr.findKey(m,E)||"text"](k,e);if(A&&!h&&!q){let t;if(null!=M&&("number"==typeof M.byteLength?t=M.byteLength:"number"==typeof M.size?t=M.size:"string"==typeof M&&(t="function"==typeof n?(new n).encode(M).byteLength:M.length)),"number"==typeof t&&t>v)throw new sn("maxContentLength size of "+v+" exceeded",sn.ERR_BAD_RESPONSE,e,T)}return!q&&j&&j(),await new Promise(((t,r)=>{In(t,r,{data:M,headers:nn.from(k.headers),status:k.status,statusText:k.statusText,config:e,request:T})}))}catch(t){if(j&&j(),x&&x.aborted&&x.reason instanceof sn){const r=x.reason;throw r.config=e,T&&(r.request=T),t!==r&&Object.defineProperty(r,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),r}if(N)throw T&&!N.request&&(N.request=T),N;if(t instanceof sn)throw T&&!t.request&&(t.request=T),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const r=new sn("Network Error",sn.ERR_NETWORK,e,T,t&&t.response);throw Object.defineProperty(r,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),r}throw sn.from(t,t&&t.code,e,T,t&&t.response)}var L,U}},Xs=new Map,Zs=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let i,a,c=s.length,u=Xs;for(;c--;)i=s[c],a=u.get(i),void 0===a&&u.set(i,a=c?new Map:Ks(t)),u=a;return a};Zs();const Qs={http:Ls,xhr:Ms,fetch:{get:Zs}};Gr.forEach(Qs,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const Ys=e=>`- ${e}`,ei=e=>Gr.isFunction(e)||null===e||!1===e;const ti={getAdapter:function(e,t){e=Gr.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let i=0;i<r;i++){let r;if(n=e[i],o=n,!ei(n)&&(o=Qs[(r=String(n)).toLowerCase()],void 0===o))throw new sn(`Unknown adapter '${r}'`);if(o&&(Gr.isFunction(o)||(o=o.get(t))))break;s[r||"#"+i]=o}if(!o){const e=Object.entries(s).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let t=r?e.length>1?"since :\n"+e.map(Ys).join("\n"):" "+Ys(e[0]):"as no adapter specified";throw new sn("There is no suitable adapter to dispatch the request "+t,sn.ERR_NOT_SUPPORT)}return o},adapters:Qs};function ri(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fn(null,e)}function ni(e){ri(e),e.headers=nn.from(e.headers),e.data=Ln.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ti.getAdapter(e.adapter||Dn.adapter,e)(e).then((function(t){ri(e),e.response=t;try{t.data=Ln.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=nn.from(t.headers),t}),(function(t){if(!Un(t)&&(ri(e),t&&t.response)){e.response=t.response;try{t.response.data=Ln.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=nn.from(t.response.headers)}return Promise.reject(t)}))}const oi={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{oi[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const si={};oi.transitional=function(e,t,r){function n(e,t){return"[Axios v"+No+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new sn(n(o," has been removed"+(t?" in "+t:"")),sn.ERR_DEPRECATED);return t&&!si[o]&&(si[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,s)}},oi.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const ii={assertOptions:function(e,t,r){if("object"!=typeof e||null===e)throw new sn("options must be an object",sn.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;if(i){const t=e[s],r=void 0===t||i(t,s,e);if(!0!==r)throw new sn("option "+s+" must be "+r,sn.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new sn("Unknown option "+s,sn.ERR_BAD_OPTION)}},validators:oi},ai=ii.validators;let ci=class{constructor(e){this.defaults=e||{},this.interceptors={request:new gn,response:new gn}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=(()=>{if(!t.stack)return"";const e=t.stack.indexOf("\n");return-1===e?"":t.stack.slice(e+1)})();try{if(e.stack){if(r){const t=r.indexOf("\n"),n=-1===t?-1:r.indexOf("\n",t+1),o=-1===n?"":r.slice(n+1);String(e.stack).endsWith(o)||(e.stack+="\n"+r)}}else e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ks(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&ii.assertOptions(r,{silentJSONParsing:ai.transitional(ai.boolean),forcedJSONParsing:ai.transitional(ai.boolean),clarifyTimeoutError:ai.transitional(ai.boolean),legacyInterceptorReqResOrdering:ai.transitional(ai.boolean),advertiseZstdAcceptEncoding:ai.transitional(ai.boolean),validateStatusUndefinedResolves:ai.transitional(ai.boolean)},!1),null!=n&&(Gr.isFunction(n)?t.paramsSerializer={serialize:n}:ii.assertOptions(n,{encode:ai.function,serialize:ai.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ii.assertOptions(t,{baseUrl:ai.spelling("baseURL"),withXsrfToken:ai.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&Gr.merge(o.common,o[t.method]);o&&Gr.forEach(["delete","get","head","post","put","patch","query","common"],(e=>{delete o[e]})),t.headers=nn.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;a=a&&e.synchronous;const r=t.transitional||bn;r&&r.legacyInterceptorReqResOrdering?i.unshift(e.fulfilled,e.rejected):i.push(e.fulfilled,e.rejected)}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[ni.bind(this),void 0];for(e.unshift(...i),e.push(...c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=i.length;let p=t;for(;f<l;){const e=i[f++],t=i[f++];try{p=e(p)}catch(e){t.call(this,e);break}}try{u=ni.call(this,p)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return yn(Mn((e=ks(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};Gr.forEach(["delete","get","head","options"],(function(e){ci.prototype[e]=function(t,r){return this.request(ks(r||{},{method:e,url:t,data:r&&Gr.hasOwnProp(r,"data")?r.data:void 0}))}})),Gr.forEach(["post","put","patch","query"],(function(e){function t(t){return function(r,n,o){return this.request(ks(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}ci.prototype[e]=t(),"query"!==e&&(ci.prototype[e+"Form"]=t(!0))}));const ui={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ui).forEach((([e,t])=>{ui[t]=e}));const li=function e(t){const r=new ci(t),n=Yt(ci.prototype.request,r);return Gr.extend(n,ci.prototype,r,{allOwnKeys:!0}),Gr.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(ks(t,r))},n}(Dn);li.Axios=ci,li.CanceledError=Fn,li.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new Fn(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e((function(e){t=e})),cancel:t}}},li.isCancel=Un,li.VERSION=No,li.toFormData=fn,li.AxiosError=sn,li.Cancel=li.CanceledError,li.all=function(e){return Promise.all(e)},li.spread=function(e){return function(t){return e.apply(null,t)}},li.isAxiosError=function(e){return Gr.isObject(e)&&!0===e.isAxiosError},li.mergeConfig=ks,li.AxiosHeaders=nn,li.formToJSON=e=>Pn(Gr.isHTMLForm(e)?new FormData(e):e),li.getAdapter=ti.getAdapter,li.HttpStatusCode=ui,li.default=li;const{Axios:fi,AxiosError:pi,CanceledError:di,isCancel:hi,CancelToken:mi,VERSION:yi,all:gi,Cancel:bi,isAxiosError:Ei,spread:_i,toFormData:wi,AxiosHeaders:Oi,HttpStatusCode:vi,formToJSON:Ri,getAdapter:Ai,mergeConfig:Ci,create:Si}=li;function xi(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],s=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=s(r)):"call"!==o&&"optionalCall"!==o||(r=s(((...e)=>r.call(t,...e))),t=void 0)}return r}function Ti(){return function(e={}){const{isSuccess:t=e=>0===e,getCode:r=e=>xi([e,"access",e=>e.data,"optionalAccess",e=>e.code]),getMessage:n=e=>xi([e,"access",e=>e.data,"optionalAccess",e=>e.message])||xi([e,"access",e=>e.data,"optionalAccess",e=>e.msg]),getData:o=e=>xi([e,"access",e=>e.data,"optionalAccess",e=>e.data]),throwOnError:s=!0,onError:i}=e;return{name:"response-validator",onResponse:e=>{const a=r(e);if(void 0===a)return e;if(t(a))return o(e);const c=n(e)||"Request failed";if(i&&!1===i(a,c,e))return e;if(s)throw new Qt(c,{status:e.status,code:a,config:e.config,response:e,data:e.data});return e}}}({isSuccess:e=>0===e,getCode:e=>xi([e,"access",e=>e.data,"optionalAccess",e=>e.code]),getMessage:e=>xi([e,"access",e=>e.data,"optionalAccess",e=>e.message])||xi([e,"access",e=>e.data,"optionalAccess",e=>e.msg]),getData:e=>e.data})}function ji(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],s=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=s(r)):"call"!==o&&"optionalCall"!==o||(r=s(((...e)=>r.call(t,...e))),t=void 0)}return r}const Pi={"/api/marketplace/trade/benefit/user/extra/create":{fields:["extra_benefit.item_info.start_at","extra_benefit.item_info.end_at"]},"/api/memory/volcano_database/list_instance":{fields:["page_num","page_size"]},"/api/memory/volcano_database/list_database":{fields:["page_num","page_size"]},"/api/memory/volcano_database/list_table":{fields:["page_num","page_size"]}};function Ni(e){const{config:t}=e;return{name:"i64-transform",onRequest:e=>{const r=function(e,t){return r=t[e],n=()=>null,null!=r?r:n();var r,n}(e.url||"",t);return r?(e.data&&(e.data=function(e,t){if(null==e)return e;const r=Jt(e);for(const e of t){const t=rt(r,e);if("string"==typeof t){const n=Number(t);Number.isInteger(n)&&Xt(r,e,n)}else Array.isArray(t)&&Xt(r,e,t.map((e=>{if("string"==typeof e){const t=Number(e);if(Number.isInteger(t))return t}return e})))}return r}(e.data,r.fields)),e):e}}}function Di(e={}){const t=li.create({baseURL:e.baseURL,timeout:e.timeout,headers:e.headers,...e.axiosConfig}),r=[];return!1!==e.useDefaultPlugins&&r.push(function(e={}){const{xRequestedWith:t="XMLHttpRequest",autoContentTypeMethods:r=["post","get"],contentType:n="application/json",setEmptyDataForContentType:o=!0}=e;return{name:"request-headers",onRequest:e=>{const s=(t,r)=>{"function"==typeof ji([e,"access",e=>e.headers,"optionalAccess",e=>e.set])?e.headers.set(t,r):e.headers&&(e.headers[t]=r)};!1!==t&&s("x-requested-with",t);const i=ji([e,"access",e=>e.method,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])||"get";var a;return r.includes(i)&&(a="content-type",!("function"==typeof ji([e,"access",e=>e.headers,"optionalAccess",e=>e.get])?e.headers.get(a):ji([e,"access",e=>e.headers,"optionalAccess",e=>e[a]])))&&(s("content-type",n),o&&!e.data&&(e.data={})),e}}}(),Ni({config:Pi}),Ti(),function(e={}){const t=new Set(e.interceptors||[]),r={name:"interceptor-chain",onResponse:e=>{let r=e;for(const e of t)r=e(r);return r}};return{plugin:r,add:e=>(t.add(e),()=>{t.delete(e)}),remove:e=>{t.delete(e)},clear:()=>{t.clear()},size:()=>t.size}}().plugin),e.plugins&&e.plugins.length>0&&r.push(...e.plugins),r.forEach((e=>{e.onRequest&&t.interceptors.request.use(e.onRequest,e.onError),(e.onResponse||e.onError)&&t.interceptors.response.use(e.onResponse,e.onError)})),t}const Li=Di({baseURL:"/",headers:{"Agw-Js-Conv":"str"}}),Ui=Li;function Fi(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],s=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=s(r)):"call"!==o&&"optionalCall"!==o||(r=s(((...e)=>r.call(t,...e))),t=void 0)}return r}const Ii={E1000:"INVALID_ARGUMENT",E1001:"MISSING_PROJECT_ID",E1002:"MISSING_MESSAGE",E1003:"MISSING_SPACE_ID",E1004:"INVALID_DOMAIN",E1005:"INVALID_PROJECT_TYPE",E1006:"UNSUPPORTED_PROJECT_TYPE",E1007:"DB_SQL_DANGEROUS",E1008:"MISSING_IMPORT_SOURCE",E1009:"MISSING_REPO",E1010:"MISSING_FILE",E1011:"INVALID_FILE_FORMAT",E1012:"FILE_TOO_LARGE",E1013:"MISSING_REPO_NAME",E1014:"MISSING_REPO_CREATION_NAME",E1015:"INVALID_PROVIDER",E1100:"UNKNOWN_OPTION",E1101:"UNKNOWN_COMMAND",E1102:"MISSING_ARGUMENT",E1103:"MISSING_OPTION",E2001:"AUTH_FAILED",E2002:"MINIPROGRAM_NOT_AUTHORIZED",E2003:"PERMISSION_DENIED",E2004:"GIT_NOT_AUTHORIZED",E2005:"OAUTH_TIMEOUT",E2006:"OAUTH_CANCELLED",E2007:"NOT_AUTHORIZED",E3000:"RESOURCE_NOT_FOUND",E3001:"PROJECT_NOT_FOUND",E3002:"SKILL_NOT_FOUND",E3003:"SECRET_NOT_FOUND",E3004:"SKILL_NOT_INSTALLED",E3005:"DELETE_FAILED",E3006:"NO_DEPLOYMENT_HISTORY",E3007:"MISSING_COMMIT_HASH",E3008:"SKILL_PROJECT_NOT_SUPPORTED",E3009:"CONFLICT",E3010:"DB_NOT_FOUND",E3011:"DB_CREATING",E3012:"DB_RESTORE_WINDOW_EXCEEDED",E3013:"DB_RESTORE_IN_PROGRESS",E3014:"REPO_NOT_BOUND",E3015:"REPO_NOT_EMPTY",E3016:"REPO_ALREADY_BOUND",E3017:"NOTHING_TO_PUSH",E3018:"REMOTE_HAS_UPDATES",E3019:"MERGE_CONFLICT",E3020:"WOULD_OVERWRITE",E4001:"QUOTA_EXCEEDED",E4002:"DB_QUOTA_EXCEEDED",E5000:"UNEXPECTED_ERROR",E5001:"NETWORK_ERROR",E5002:"SERVER_ERROR",E5003:"TIMEOUT",E5004:"DB_SQL_EXECUTION_FAILED",E5005:"DB_CONNECTION_FAILED",E5006:"DB_GEN_TYPES_FAILED",E5007:"DB_DUMP_FAILED"};function ki(e,t){return null!=e?e:t()}function Bi(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],s=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=s(r)):"call"!==o&&"optionalCall"!==o||(r=s(((...e)=>r.call(t,...e))),t=void 0)}return r}exports.ExitCode=void 0,function(e){e[e.SUCCESS=0]="SUCCESS";e[e.FAILURE=1]="FAILURE";e[e.AUTH_ERROR=2]="AUTH_ERROR";e[e.INPUT_ERROR=4]="INPUT_ERROR"}(exports.ExitCode||(exports.ExitCode={}));class qi extends Error{constructor(e,t,r,n){const o=ki(Ii[e],(()=>"UNKNOWN_ERROR")),s=ki(t,(()=>o));super(s),this.name="CozeError",this.code=e,this.errorName=o,this.desc=s,this.details=r,this.trigger=Bi([n,"optionalAccess",e=>e.trigger]),this.fix=Bi([n,"optionalAccess",e=>e.fix]),this.example=Bi([n,"optionalAccess",e=>e.example]),this.isMessageExplicit=void 0!==t,Object.setPrototypeOf(this,qi.prototype)}}class Mi{constructor(){Mi.prototype.__init.call(this),Mi.prototype.__init2.call(this)}__init(){this.headers={}}__init2(){this.scopedHeadersProviders=new Map}setHeaders(e){this.headers=y.merge({},this.headers,e)}getHeaders(){return this.headers}setScopedHeadersProvider(e,t){this.scopedHeadersProviders.set(e,t)}removeScopedHeadersProvider(e){this.scopedHeadersProviders.delete(e)}getRequestHeaders(e,t){const r={};return[...this.scopedHeadersProviders.values()].forEach((n=>{y.merge(r,n(e,t))})),y.merge({},this.headers,function(e){let t,r=e[0],n=1;for(;n<e.length;){const o=e[n],s=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==r)return;"access"===o||"optionalAccess"===o?(t=r,r=s(r)):"call"!==o&&"optionalCall"!==o||(r=s(((...e)=>r.call(t,...e))),t=void 0)}return r}([t,"optionalAccess",e=>e.headers]),r)}resetHeaders(){this.headers={}}setDispatcher(e){this.dispatcher=e}clearDispatcher(){this.dispatcher=void 0}async fetch(e,t){return m.fetch(e,{...t,headers:this.getRequestHeaders(e,t),dispatcher:this.dispatcher})}}const Hi=new Mi;exports.CozeError=qi,exports.ErrorCode={E1000:"E1000",E1001:"E1001",E1002:"E1002",E1003:"E1003",E1004:"E1004",E1005:"E1005",E1006:"E1006",E1007:"E1007",E1008:"E1008",E1009:"E1009",E1010:"E1010",E1011:"E1011",E1012:"E1012",E1013:"E1013",E1014:"E1014",E1015:"E1015",E1100:"E1100",E1101:"E1101",E1102:"E1102",E1103:"E1103",E2001:"E2001",E2002:"E2002",E2003:"E2003",E2004:"E2004",E2005:"E2005",E2006:"E2006",E2007:"E2007",E3000:"E3000",E3001:"E3001",E3002:"E3002",E3003:"E3003",E3004:"E3004",E3005:"E3005",E3006:"E3006",E3007:"E3007",E3008:"E3008",E3009:"E3009",E3010:"E3010",E3011:"E3011",E3012:"E3012",E3013:"E3013",E3014:"E3014",E3015:"E3015",E3016:"E3016",E3017:"E3017",E3018:"E3018",E3019:"E3019",E3020:"E3020",E4001:"E4001",E4002:"E4002",E5000:"E5000",E5001:"E5001",E5002:"E5002",E5003:"E5003",E5004:"E5004",E5005:"E5005",E5006:"E5006",E5007:"E5007"},exports.ErrorNameByCode=Ii,exports.HttpError=Qt,exports.MapCache=We,exports.Stack=st,exports.Symbol=_,exports.Uint8Array=Pt,exports.arrayLikeKeys=xe,exports.arrayMap=j,exports.arrayPush=nt,exports.assignValue=se,exports.axiosInstance=Ui,exports.axiosInstance$1=Li,exports.baseAssignValue=re,exports.baseGet=tt,exports.baseGetAllKeys=mt,exports.baseGetTag=S,exports.baseSet=Kt,exports.castPath=Ye,exports.cloneBuffer=lt,exports.cloneDeep=Jt,exports.cloneTypedArray=Ft,exports.createRequestClient=Di,exports.customFetch=Hi,exports.defineProperty=Y,exports.eq=ne,exports.exitCodeForError=function(e){const t=Number.parseInt(e.slice(1),10);return t>=1e3&&t<2e3?exports.ExitCode.INPUT_ERROR:t>=2e3&&t<3e3?exports.ExitCode.AUTH_ERROR:exports.ExitCode.FAILURE},exports.get=rt,exports.getAllKeys=yt,exports.getDefaultExportFromCjs=Wn,exports.getPrototype=ot,exports.getSymbols=ht,exports.initCloneObject=kt,exports.isArguments=he,exports.isArray=P,exports.isArrayLike=ae,exports.isBuffer=be,exports.isFunction=F,exports.isHttpError=function(e){return e instanceof Qt},exports.isIndex=te,exports.isKey=Ue,exports.isLength=ie,exports.isObject=U,exports.isObjectLike=x,exports.isPrototype=ue,exports.isTypedArray=Ce,exports.keys=Ne,exports.request=(e,t)=>Ui({...e,...t}),exports.requireSrc=fo,exports.safeJsonParse=function(e,t,r){let n,o;if(2===arguments.length?t&&"object"==typeof t&&("onError"in t||"validate"in t||"throwOnValidationError"in t)?(o=t,n=void 0):(n=t,o=void 0):3===arguments.length&&(n=t,o=r),"object"==typeof e&&null!==e)return e;try{const t=JSON.parse(String(e));if(Fi([o,"optionalAccess",e=>e.validate])){if(o.validate(t))return t;{const t=new Error("JSON validation failed");if(Fi([o,"access",e=>e.onError,"optionalCall",r=>r(t,e)]),o.throwOnValidationError)throw t;return n}}return t}catch(t){if(t instanceof Error&&"JSON validation failed"===t.message&&Fi([o,"optionalAccess",e=>e.throwOnValidationError]))throw t;return Fi([o,"optionalAccess",e=>e.onError,"optionalCall",r=>r(t,e)]),n}},exports.stubArray=ft,exports.toKey=et;
|