@coze/cli 0.3.2-alpha.77ac1a → 0.3.3-alpha.b7c03e
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 +3 -3
- package/lib/fetch-client-DtaPMDxl.js +1 -0
- package/lib/{index-JxWKC7px.js → index-BL2IXR_e.js} +1 -1
- package/lib/send-message.worker.js +1 -1
- package/lib/session-task-refresh.worker.js +1 -1
- package/lib/task-worker-CkGDGYoW.js +1 -0
- package/package.json +4 -5
- package/skills/manifest.json +6 -6
- package/skills/using-coze-cli/SKILL.md +11 -2
- package/skills/using-coze-cli/coze-claw/MODULE.md +1 -1
- package/skills/using-coze-cli/coze-code/MODULE.md +60 -8
- package/skills/using-coze-cli/coze-code/references/coze-code-message.md +26 -12
- package/skills/using-coze-cli/coze-code/references/coze-code-project.md +1 -0
- 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-CgQGE-CR.js +0 -1
- package/lib/task-worker-BJO9Ixaq.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("form-data"),t=require("crypto"),r=require("url"),n=require("https-proxy-agent"),o=require("http"),s=require("https"),i=require("http2"),a=require("util"),c=require("path"),u=require("stream"),l=require("assert"),f=require("tty"),p=require("zlib"),d=require("events"),h=require("undici"),m=require("lodash");var y="object"==typeof global&&global&&global.Object===Object&&global,g="object"==typeof self&&self&&self.Object===Object&&self,b=y||g||Function("return this")(),E=b.Symbol,_=Object.prototype,w=_.hasOwnProperty,R=_.toString,O=E?E.toStringTag:void 0;var v=Object.prototype.toString;var C=E?E.toStringTag:void 0;function A(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":C&&C in Object(e)?function(e){var t=w.call(e,O),r=e[O];try{e[O]=void 0;var n=!0}catch(e){}var o=R.call(e);return n&&(t?e[O]=r:delete e[O]),o}(e):function(e){return v.call(e)}(e)}function x(e){return null!=e&&"object"==typeof e}function S(e){return"symbol"==typeof e||x(e)&&"[object Symbol]"==A(e)}function T(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 j=Array.isArray,N=E?E.prototype:void 0,L=N?N.toString:void 0;function P(e){if("string"==typeof e)return e;if(j(e))return T(e,P)+"";if(S(e))return L?L.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function D(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function F(e){if(!D(e))return!1;var t=A(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var U,I=b["__core-js_shared__"],B=(U=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var k=Function.prototype.toString;function q(e){if(null!=e){try{return k.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var M=/^\[object .+?Constructor\]$/,z=Function.prototype,H=Object.prototype,$=z.toString,W=H.hasOwnProperty,G=RegExp("^"+$.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function V(e){return!(!D(e)||(t=e,B&&B in t))&&(F(e)?G:M).test(q(e));var t}function J(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return V(r)?r:void 0}var K=J(b,"WeakMap"),X=Object.create,Z=function(){function e(){}return function(t){if(!D(t))return{};if(X)return X(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Q=function(){try{var e=J(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();var Y=/^(?:0|[1-9]\d*)$/;function ee(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&Y.test(e))&&e>-1&&e%1==0&&e<t}function te(e,t,r){"__proto__"==t&&Q?Q(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function re(e,t){return e===t||e!=e&&t!=t}var ne=Object.prototype.hasOwnProperty;function oe(e,t,r){var n=e[t];ne.call(e,t)&&re(n,r)&&(void 0!==r||t in e)||te(e,t,r)}function se(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ie(e){return null!=e&&se(e.length)&&!F(e)}var ae=Object.prototype;function ce(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ae)}function ue(e){return x(e)&&"[object Arguments]"==A(e)}var le=Object.prototype,fe=le.hasOwnProperty,pe=le.propertyIsEnumerable,de=ue(function(){return arguments}())?ue:function(e){return x(e)&&fe.call(e,"callee")&&!pe.call(e,"callee")};var he="object"==typeof exports&&exports&&!exports.nodeType&&exports,me=he&&"object"==typeof module&&module&&!module.nodeType&&module,ye=me&&me.exports===he?b.Buffer:void 0,ge=(ye?ye.isBuffer:void 0)||function(){return!1},be={};function Ee(e){return function(t){return e(t)}}be["[object Float32Array]"]=be["[object Float64Array]"]=be["[object Int8Array]"]=be["[object Int16Array]"]=be["[object Int32Array]"]=be["[object Uint8Array]"]=be["[object Uint8ClampedArray]"]=be["[object Uint16Array]"]=be["[object Uint32Array]"]=!0,be["[object Arguments]"]=be["[object Array]"]=be["[object ArrayBuffer]"]=be["[object Boolean]"]=be["[object DataView]"]=be["[object Date]"]=be["[object Error]"]=be["[object Function]"]=be["[object Map]"]=be["[object Number]"]=be["[object Object]"]=be["[object RegExp]"]=be["[object Set]"]=be["[object String]"]=be["[object WeakMap]"]=!1;var _e="object"==typeof exports&&exports&&!exports.nodeType&&exports,we=_e&&"object"==typeof module&&module&&!module.nodeType&&module,Re=we&&we.exports===_e&&y.process,Oe=function(){try{var e=we&&we.require&&we.require("util").types;return e||Re&&Re.binding&&Re.binding("util")}catch(e){}}(),ve=Oe&&Oe.isTypedArray,Ce=ve?Ee(ve):function(e){return x(e)&&se(e.length)&&!!be[A(e)]},Ae=Object.prototype.hasOwnProperty;function xe(e,t){var r=j(e),n=!r&&de(e),o=!r&&!n&&ge(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&&!Ae.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ee(u,c))||a.push(u);return a}function Se(e,t){return function(r){return e(t(r))}}var Te=Se(Object.keys,Object),je=Object.prototype.hasOwnProperty;function Ne(e){return ie(e)?xe(e):function(e){if(!ce(e))return Te(e);var t=[];for(var r in Object(e))je.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}var Le=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pe=/^\w*$/;function De(e,t){if(j(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!S(e))||(Pe.test(e)||!Le.test(e)||null!=t&&e in Object(t))}var Fe=J(Object,"create");var Ue=Object.prototype.hasOwnProperty;var Ie=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 ke(e,t){for(var r=e.length;r--;)if(re(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 Ue.call(t,e)?t[e]:void 0},Be.prototype.has=function(e){var t=this.__data__;return Fe?void 0!==t[e]:Ie.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 qe=Array.prototype.splice;function Me(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])}}Me.prototype.clear=function(){this.__data__=[],this.size=0},Me.prototype.delete=function(e){var t=this.__data__,r=ke(t,e);return!(r<0)&&(r==t.length-1?t.pop():qe.call(t,r,1),--this.size,!0)},Me.prototype.get=function(e){var t=this.__data__,r=ke(t,e);return r<0?void 0:t[r][1]},Me.prototype.has=function(e){return ke(this.__data__,e)>-1},Me.prototype.set=function(e,t){var r=this.__data__,n=ke(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};var ze=J(b,"Map");function He(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 $e(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])}}$e.prototype.clear=function(){this.size=0,this.__data__={hash:new Be,map:new(ze||Me),string:new Be}},$e.prototype.delete=function(e){var t=He(this,e).delete(e);return this.size-=t?1:0,t},$e.prototype.get=function(e){return He(this,e).get(e)},$e.prototype.has=function(e){return He(this,e).has(e)},$e.prototype.set=function(e,t){var r=He(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function We(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(We.Cache||$e),r}We.Cache=$e;var Ge,Ve,Je,Ke=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xe=/\\(\\)?/g,Ze=(Ge=function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ke,(function(e,r,n,o){t.push(n?o.replace(Xe,"$1"):r||e)})),t},Ve=We(Ge,(function(e){return 500===Je.size&&Je.clear(),e})),Je=Ve.cache,Ve);function Qe(e,t){return j(e)?e:De(e,t)?[e]:Ze(function(e){return null==e?"":P(e)}(e))}function Ye(e){if("string"==typeof e||S(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function et(e,t){for(var r=0,n=(t=Qe(t,e)).length;null!=e&&r<n;)e=e[Ye(t[r++])];return r&&r==n?e:void 0}function tt(e,t,r){var n=null==e?void 0:et(e,t);return void 0===n?r:n}function rt(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}var nt=Se(Object.getPrototypeOf,Object);function ot(e){var t=this.__data__=new Me(e);this.size=t.size}ot.prototype.clear=function(){this.__data__=new Me,this.size=0},ot.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ot.prototype.get=function(e){return this.__data__.get(e)},ot.prototype.has=function(e){return this.__data__.has(e)},ot.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Me){var n=r.__data__;if(!ze||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $e(n)}return r.set(e,t),this.size=r.size,this};var st="object"==typeof exports&&exports&&!exports.nodeType&&exports,it=st&&"object"==typeof module&&module&&!module.nodeType&&module,at=it&&it.exports===st?b.Buffer:void 0,ct=at?at.allocUnsafe:void 0;function ut(e,t){if(t)return e.slice();var r=e.length,n=ct?ct(r):new e.constructor(r);return e.copy(n),n}function lt(){return[]}var ft=Object.prototype.propertyIsEnumerable,pt=Object.getOwnPropertySymbols,dt=pt?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}(pt(e),(function(t){return ft.call(e,t)})))}:lt;function ht(e,t,r){var n=t(e);return j(e)?n:rt(n,r(e))}function mt(e){return ht(e,Ne,dt)}var yt=J(b,"DataView"),gt=J(b,"Promise"),bt=J(b,"Set"),Et="[object Map]",_t="[object Promise]",wt="[object Set]",Rt="[object WeakMap]",Ot="[object DataView]",vt=q(yt),Ct=q(ze),At=q(gt),xt=q(bt),St=q(K);exports.getTag=A,(yt&&exports.getTag(new yt(new ArrayBuffer(1)))!=Ot||ze&&exports.getTag(new ze)!=Et||gt&&exports.getTag(gt.resolve())!=_t||bt&&exports.getTag(new bt)!=wt||K&&exports.getTag(new K)!=Rt)&&(exports.getTag=function(e){var t=A(e),r="[object Object]"==t?e.constructor:void 0,n=r?q(r):"";if(n)switch(n){case vt:return Ot;case Ct:return Et;case At:return _t;case xt:return wt;case St:return Rt}return t});var Tt=Object.prototype.hasOwnProperty;var jt=b.Uint8Array;function Nt(e){var t=new e.constructor(e.byteLength);return new jt(t).set(new jt(e)),t}var Lt=/\w*$/;var Pt=E?E.prototype:void 0,Dt=Pt?Pt.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 Ut(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,Lt.exec(e));return t.lastIndex=e.lastIndex,t}(e);case"[object Symbol]":return n=e,Dt?Object(Dt.call(n)):{}}}function It(e){return"function"!=typeof e.constructor||ce(e)?{}:Z(nt(e))}var Bt=Oe&&Oe.isMap,kt=Bt?Ee(Bt):function(e){return x(e)&&"[object Map]"==exports.getTag(e)};var qt=Oe&&Oe.isSet,Mt=qt?Ee(qt):function(e){return x(e)&&"[object Set]"==exports.getTag(e)},zt="[object Arguments]",Ht="[object Function]",$t="[object Object]",Wt={};function Gt(e,t,r,n,o,s){var i,a=1&t;if(void 0!==i)return i;if(!D(e))return e;var c=j(e);if(c)i=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Tt.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e);else{var u=exports.getTag(e),l=u==Ht||"[object GeneratorFunction]"==u;if(ge(e))return ut(e,a);if(u==$t||u==zt||l&&!o)i=l?{}:It(e);else{if(!Wt[u])return o?e:{};i=Ut(e,u,a)}}s||(s=new ot);var f=s.get(e);if(f)return f;s.set(e,i),Mt(e)?e.forEach((function(n){i.add(Gt(n,t,r,n,e,s))})):kt(e)&&e.forEach((function(n,o){i.set(o,Gt(n,t,r,o,e,s))}));var p=c?void 0:mt(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]),oe(i,o,Gt(n,t,r,o,e,s))})),i}Wt[zt]=Wt["[object Array]"]=Wt["[object ArrayBuffer]"]=Wt["[object DataView]"]=Wt["[object Boolean]"]=Wt["[object Date]"]=Wt["[object Float32Array]"]=Wt["[object Float64Array]"]=Wt["[object Int8Array]"]=Wt["[object Int16Array]"]=Wt["[object Int32Array]"]=Wt["[object Map]"]=Wt["[object Number]"]=Wt[$t]=Wt["[object RegExp]"]=Wt["[object Set]"]=Wt["[object String]"]=Wt["[object Symbol]"]=Wt["[object Uint8Array]"]=Wt["[object Uint8ClampedArray]"]=Wt["[object Uint16Array]"]=Wt["[object Uint32Array]"]=!0,Wt["[object Error]"]=Wt[Ht]=Wt["[object WeakMap]"]=!1;function Vt(e){return Gt(e,5)}function Jt(e,t,r,n){if(!D(e))return e;for(var o=-1,s=(t=Qe(t,e)).length,i=s-1,a=e;null!=a&&++o<s;){var c=Ye(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=D(l)?l:ee(t[o+1])?[]:{})}oe(a,c,u),a=a[c]}return e}function Kt(e,t,r){return null==e?e:Jt(e,t,r)}function Xt(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 Zt 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,Zt)}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=Xt([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:Xt([this,"access",e=>e.config,"optionalAccess",e=>e.url]),method:Xt([this,"access",e=>e.config,"optionalAccess",e=>e.method]),baseURL:Xt([this,"access",e=>e.config,"optionalAccess",e=>e.baseURL])}}}function Qt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Yt}=Object.prototype,{getPrototypeOf:er}=Object,{iterator:tr,toStringTag:rr}=Symbol,nr=(e=>t=>{const r=Yt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),or=e=>(e=e.toLowerCase(),t=>nr(t)===e),sr=e=>t=>typeof t===e,{isArray:ir}=Array,ar=sr("undefined");function cr(e){return null!==e&&!ar(e)&&null!==e.constructor&&!ar(e.constructor)&&fr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ur=or("ArrayBuffer");const lr=sr("string"),fr=sr("function"),pr=sr("number"),dr=e=>null!==e&&"object"==typeof e,hr=e=>{if("object"!==nr(e))return!1;const t=er(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||rr in e||tr in e)},mr=or("Date"),yr=or("File"),gr=or("Blob"),br=or("FileList");const Er="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},_r=void 0!==Er.FormData?Er.FormData:void 0,wr=or("URLSearchParams"),[Rr,Or,vr,Cr]=["ReadableStream","Request","Response","Headers"].map(or);function Ar(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),ir(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(cr(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 xr(e,t){if(cr(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 Sr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Tr=e=>!ar(e)&&e!==Sr;const jr=(Nr="undefined"!=typeof Uint8Array&&er(Uint8Array),e=>Nr&&e instanceof Nr);var Nr;const Lr=or("HTMLFormElement"),Pr=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),{propertyIsEnumerable:Dr}=Object.prototype,Fr=or("RegExp"),Ur=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};Ar(r,((r,o)=>{let s;!1!==(s=t(r,o,e))&&(n[o]=s||r)})),Object.defineProperties(e,n)};const Ir=or("AsyncFunction"),Br=(kr="function"==typeof setImmediate,qr=fr(Sr.postMessage),kr?setImmediate:qr?(Mr=`axios@${Math.random()}`,zr=[],Sr.addEventListener("message",(({source:e,data:t})=>{e===Sr&&t===Mr&&zr.length&&zr.shift()()}),!1),e=>{zr.push(e),Sr.postMessage(Mr,"*")}):e=>setTimeout(e));var kr,qr,Mr,zr;const Hr="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Sr):"undefined"!=typeof process&&process.nextTick||Br,$r={isArray:ir,isArrayBuffer:ur,isBuffer:cr,isFormData:e=>{if(!e)return!1;if(_r&&e instanceof _r)return!0;const t=er(e);if(!t||t===Object.prototype)return!1;if(!fr(e.append))return!1;const r=nr(e);return"formdata"===r||"object"===r&&fr(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&ur(e.buffer),t},isString:lr,isNumber:pr,isBoolean:e=>!0===e||!1===e,isObject:dr,isPlainObject:hr,isEmptyObject:e=>{if(!dr(e)||cr(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Rr,isRequest:Or,isResponse:vr,isHeaders:Cr,isUndefined:ar,isDate:mr,isFile:yr,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:gr,isRegExp:Fr,isFunction:fr,isStream:e=>dr(e)&&fr(e.pipe),isURLSearchParams:wr,isTypedArray:jr,isFileList:br,forEach:Ar,merge:function e(...t){const{caseless:r,skipUndefined:n}=Tr(this)&&this||{},o={},s=(t,s)=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const i=r&&"string"==typeof s&&xr(o,s)||s,a=Pr(o,i)?o[i]:void 0;hr(a)&&hr(t)?o[i]=e(a,t):hr(t)?o[i]=e({},t):ir(t)?o[i]=t.slice():n&&ar(t)||(o[i]=t)};for(let e=0,r=t.length;e<r;e++){const r=t[e];if(!r||cr(r))continue;if(Ar(r,s),"object"!=typeof r||ir(r))continue;const n=Object.getOwnPropertySymbols(r);for(let e=0;e<n.length;e++){const t=n[e];Dr.call(r,t)&&s(r[t],t)}}return o},extend:(e,t,r,{allOwnKeys:n}={})=>(Ar(t,((t,n)=>{r&&fr(t)?Object.defineProperty(e,n,{__proto__:null,value:Qt(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&&er(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:nr,kindOfTest:or,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(ir(e))return e;let t=e.length;if(!pr(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[tr]).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:Lr,hasOwnProperty:Pr,hasOwnProp:Pr,reduceDescriptors:Ur,freezeMethods:e=>{Ur(e,((t,r)=>{if(fr(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];fr(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 ir(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:xr,global:Sr,isContextDefined:Tr,isSpecCompliantForm:function(e){return!!(e&&fr(e.append)&&"FormData"===e[rr]&&e[tr])},toJSONObject:e=>{const t=new WeakSet,r=e=>{if(dr(e)){if(t.has(e))return;if(cr(e))return e;if(!("toJSON"in e)){t.add(e);const n=ir(e)?[]:{};return Ar(e,((e,t)=>{const o=r(e);!ar(o)&&(n[t]=o)})),t.delete(e),n}}return e};return r(e)},isAsyncFn:Ir,isThenable:e=>e&&(dr(e)||fr(e))&&fr(e.then)&&fr(e.catch),setImmediate:Br,asap:Hr,isIterable:e=>null!=e&&fr(e[tr])},Wr=$r.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 Gr=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Vr=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Jr(e,t){return $r.isArray(e)?e.map((e=>Jr(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 Kr(e){const t=Object.create(null);return $r.forEach(e.toJSON(),((e,r)=>{t[r]=(e=>Jr(e,Vr))(e)})),t}const Xr=Symbol("internals");function Zr(e){return e&&String(e).trim().toLowerCase()}function Qr(e){return!1===e||null==e?e:$r.isArray(e)?e.map(Qr):(e=>Jr(e,Gr))(String(e))}function Yr(e,t,r,n,o){return $r.isFunction(n)?n.call(this,t,r):(o&&(t=r),$r.isString(t)?$r.isString(n)?-1!==t.indexOf(n):$r.isRegExp(n)?n.test(t):void 0:void 0)}let en=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=Zr(t);if(!o)return;const s=$r.findKey(n,o);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||t]=Qr(e))}const s=(e,t)=>$r.forEach(e,((e,r)=>o(e,r,t)));if($r.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if($r.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]&&Wr[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($r.isObject(e)&&$r.isIterable(e)){let r,n,o={};for(const t of e){if(!$r.isArray(t))throw new TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?$r.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=Zr(e)){const r=$r.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($r.isFunction(t))return t.call(this,e,r);if($r.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Zr(e)){const r=$r.findKey(this,e);return!(!r||void 0===this[r]||t&&!Yr(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=Zr(e)){const o=$r.findKey(r,e);!o||t&&!Yr(0,r[o],o,t)||(delete r[o],n=!0)}}return $r.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&&!Yr(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return $r.forEach(this,((n,o)=>{const s=$r.findKey(r,o);if(s)return t[s]=Qr(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]=Qr(n),r[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $r.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&$r.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[Xr]=this[Xr]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Zr(e);t[n]||(!function(e,t){const r=$r.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 $r.isArray(e)?e.forEach(n):n(e),this}};en.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$r.reduceDescriptors(en.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),$r.freezeMethods(en);function tn(e,t){const r=new Set(t.map((e=>String(e).toLowerCase()))),n=[],o=e=>{if(null===e||"object"!=typeof e)return e;if($r.isBuffer(e))return e;if(-1!==n.indexOf(e))return;let t;if(e instanceof en&&(e=e.toJSON()),n.push(e),$r.isArray(e))t=[],e.forEach(((e,r)=>{const n=o(e);$r.isUndefined(n)||(t[r]=n)}));else{if(!$r.isPlainObject(e)&&function(e){if($r.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if($r.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);$r.isUndefined(e)||(t[n]=e)}}return n.pop(),t};return o(e)}let rn=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 a.cause=t,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&&$r.hasOwnProp(e,"redact")?e.redact:void 0,r=$r.isArray(t)&&t.length>0?tn(e,t):$r.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}}};function nn(e){return $r.isPlainObject(e)||$r.isArray(e)}function on(e){return $r.endsWith(e,"[]")?e.slice(0,-2):e}function sn(e,t,r){return e?e.concat(t).map((function(e,t){return e=on(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}rn.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",rn.ERR_BAD_OPTION="ERR_BAD_OPTION",rn.ECONNABORTED="ECONNABORTED",rn.ETIMEDOUT="ETIMEDOUT",rn.ECONNREFUSED="ECONNREFUSED",rn.ERR_NETWORK="ERR_NETWORK",rn.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",rn.ERR_DEPRECATED="ERR_DEPRECATED",rn.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",rn.ERR_BAD_REQUEST="ERR_BAD_REQUEST",rn.ERR_CANCELED="ERR_CANCELED",rn.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",rn.ERR_INVALID_URL="ERR_INVALID_URL",rn.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const an=$r.toFlatObject($r,{},null,(function(e){return/^is[A-Z]/.test(e)}));function cn(t,r,n){if(!$r.isObject(t))throw new TypeError("target must be an object");r=r||new(e||FormData);const o=(n=$r.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$r.isUndefined(t[e])}))).metaTokens,s=n.visitor||p,i=n.dots,a=n.indexes,c=n.Blob||"undefined"!=typeof Blob&&Blob,u=void 0===n.maxDepth?100:n.maxDepth,l=c&&$r.isSpecCompliantForm(r);if(!$r.isFunction(s))throw new TypeError("visitor must be a function");function f(e){if(null===e)return"";if($r.isDate(e))return e.toISOString();if($r.isBoolean(e))return e.toString();if(!l&&$r.isBlob(e))throw new rn("Blob is not supported. Use a Buffer instead.");return $r.isArrayBuffer(e)||$r.isTypedArray(e)?l&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function p(e,t,n){let s=e;if($r.isReactNative(r)&&$r.isReactNativeBlob(e))return r.append(sn(n,t,i),f(e)),!1;if(e&&!n&&"object"==typeof e)if($r.endsWith(t,"{}"))t=o?t:t.slice(0,-2),e=JSON.stringify(e);else if($r.isArray(e)&&function(e){return $r.isArray(e)&&!e.some(nn)}(e)||($r.isFileList(e)||$r.endsWith(t,"[]"))&&(s=$r.toArray(e)))return t=on(t),s.forEach((function(e,n){!$r.isUndefined(e)&&null!==e&&r.append(!0===a?sn([t],n,i):null===a?t:t+"[]",f(e))})),!1;return!!nn(e)||(r.append(sn(n,t,i),f(e)),!1)}const d=[],h=Object.assign(an,{defaultVisitor:p,convertValue:f,isVisitable:nn});if(!$r.isObject(t))throw new TypeError("data must be an object");return function e(t,n,o=0){if(!$r.isUndefined(t)){if(o>u)throw new rn("Object is too deeply nested ("+o+" levels). Max depth: "+u,rn.ERR_FORM_DATA_DEPTH_EXCEEDED);if(-1!==d.indexOf(t))throw new Error("Circular reference detected in "+n.join("."));d.push(t),$r.forEach(t,(function(t,i){!0===(!($r.isUndefined(t)||null===t)&&s.call(r,t,$r.isString(i)?i.trim():i,n,h))&&e(t,n?n.concat(i):[i],o+1)})),d.pop()}}(t),r}function un(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function ln(e,t){this._pairs=[],e&&cn(e,this,t)}const fn=ln.prototype;function pn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function dn(e,t,r){if(!t)return e;const n=r&&r.encode||pn,o=$r.isFunction(r)?{serialize:r}:r,s=o&&o.serialize;let i;if(i=s?s(t,o):$r.isURLSearchParams(t)?t.toString():new ln(t,o).toString(n),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}fn.append=function(e,t){this._pairs.push([e,t])},fn.toString=function(e){const t=e?function(t){return e.call(this,t,un)}:un;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class hn{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){$r.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}const mn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1},yn=r.URLSearchParams,gn="abcdefghijklmnopqrstuvwxyz",bn="0123456789",En={DIGIT:bn,ALPHA:gn,ALPHA_DIGIT:gn+gn.toUpperCase()+bn},_n={isNode:!0,classes:{URLSearchParams:yn,FormData:e,Blob:"undefined"!=typeof Blob&&Blob||null},ALPHABET:En,generateString:(e=16,r=En.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"]},wn="undefined"!=typeof window&&"undefined"!=typeof document,Rn="object"==typeof navigator&&navigator||void 0,On=wn&&(!Rn||["ReactNative","NativeScript","NS"].indexOf(Rn.product)<0),vn="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Cn=wn&&window.location.href||"http://localhost",An={...Object.freeze({__proto__:null,hasBrowserEnv:wn,hasStandardBrowserEnv:On,hasStandardBrowserWebWorkerEnv:vn,navigator:Rn,origin:Cn}),..._n};function xn(e){function t(e,r,n,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&$r.isArray(n)?n.length:s,a)return $r.hasOwnProp(n,s)?n[s]=$r.isArray(n[s])?n[s].concat(r):[n[s],r]:n[s]=r,!i;$r.hasOwnProp(n,s)&&$r.isObject(n[s])||(n[s]=[]);return t(e,r,n[s],o)&&$r.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($r.isFormData(e)&&$r.isFunction(e.entries)){const r={};return $r.forEachEntry(e,((e,n)=>{t(function(e){return $r.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const Sn=(e,t)=>null!=e&&$r.hasOwnProp(e,t)?e[t]:void 0;const Tn={transitional:mn,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=$r.isObject(e);o&&$r.isHTMLForm(e)&&(e=new FormData(e));if($r.isFormData(e))return n?JSON.stringify(xn(e)):e;if($r.isArrayBuffer(e)||$r.isBuffer(e)||$r.isStream(e)||$r.isFile(e)||$r.isBlob(e)||$r.isReadableStream(e))return e;if($r.isArrayBufferView(e))return e.buffer;if($r.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){const t=Sn(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return cn(e,new An.classes.URLSearchParams,{visitor:function(e,t,r,n){return An.isNode&&$r.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((s=$r.isFileList(e))||r.indexOf("multipart/form-data")>-1){const r=Sn(this,"env"),n=r&&r.FormData;return cn(s?{"files[]":e}:e,n&&new n,t)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if($r.isString(e))try{return(t||JSON.parse)(e),$r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Sn(this,"transitional")||Tn.transitional,r=t&&t.forcedJSONParsing,n=Sn(this,"responseType"),o="json"===n;if($r.isResponse(e)||$r.isReadableStream(e))return e;if(e&&$r.isString(e)&&(r&&!n||o)){const r=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Sn(this,"parseReviver"))}catch(e){if(r){if("SyntaxError"===e.name)throw rn.from(e,rn.ERR_BAD_RESPONSE,this,null,Sn(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:An.classes.FormData,Blob:An.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function jn(e,t){const r=this||Tn,n=t||r,o=en.from(n.headers);let s=n.data;return $r.forEach(e,(function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Nn(e){return!(!e||!e.__CANCEL__)}$r.forEach(["delete","get","head","post","put","patch","query"],(e=>{Tn.headers[e]={}}));let Ln=class extends rn{constructor(e,t,r){super(null==e?"canceled":e,rn.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function Pn(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new rn("Request failed with status code "+r.status,r.status>=400&&r.status<500?rn.ERR_BAD_REQUEST:rn.ERR_BAD_RESPONSE,r.config,r.request,r)):e(r)}function Dn(e,t,r){let n=!function(e){return"string"==typeof e&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(n||!1===r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Fn={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function Un(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=In("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)||Fn[r]||0))return"";var s=In(r+"_proxy")||In("all_proxy");return s&&-1===s.indexOf("://")&&(s=r+"://"+s),s}function In(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}function Bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function kn(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 qn,Mn,zn,Hn,$n,Wn={exports:{}},Gn={exports:{}},Vn={exports:{}};function Jn(){if(Mn)return qn;Mn=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 qn=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 Kn(){if(Hn)return zn;return Hn=1,zn=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=Jn(),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},zn}var Xn={exports:{}};const Zn=(()=>{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})(),Qn=0!==Zn&&{level:Zn,hasBasic:!0,has256:Zn>=2,has16m:Zn>=3},Yn={stdout:Qn,stderr:Qn},eo=kn(Object.freeze({__proto__:null,default:Yn}));var to,ro,no,oo,so;function io(){return to||(to=1,function(e,t){const r=f,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=eo;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=Kn()(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)}}(Xn,Xn.exports)),Xn.exports}function ao(){return ro||(ro=1,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Gn.exports=($n||($n=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=Kn()(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Vn,Vn.exports)),Vn.exports):Gn.exports=io()),Gn.exports}var co=function(){if(so)return Wn.exports;so=1;var e,t,n,i=r,a=i.URL,c=o,f=s,p=u.Writable,d=l,h=function(){return oo||(oo=1,no=function(){if(!e){try{e=ao()("follow-redirects")}catch(e){}"function"!=typeof e&&(e=function(){})}e.apply(null,arguments)}),no;var e}();e="undefined"!=typeof process,t="undefined"!=typeof window&&"undefined"!=typeof document,n=U(Error.captureStackTrace),e||!t&&n||console.warn("The follow-redirects package should be excluded from browser builds.");var m=!1;try{d(new a(""))}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 _=P("ERR_INVALID_URL","Invalid URL",TypeError),w=P("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),R=P("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",w),O=P("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),v=P("ERR_STREAM_WRITE_AFTER_END","write after end"),C=p.prototype.destroy||S;function A(e,t){p.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 x(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach((function(n){var o=n+":",s=r[o]=e[n],i=t[n]=Object.create(s);Object.defineProperties(i,{request:{value:function(e,n,s){var i;return i=e,a&&i instanceof a?e=N(e):F(e)?e=N(T(e)):(s=n,n=j(e),e={protocol:o}),U(n)&&(s=n,n=null),(n=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,n)).nativeProtocols=r,F(n.host)||F(n.hostname)||(n.hostname="::1"),d.equal(n.protocol,o,"protocol mismatch"),h("options",n),new A(n,s)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,r){var n=i.request(e,t,r);return n.end(),n},configurable:!0,enumerable:!0,writable:!0}})})),t}function S(){}function T(e){var t;if(m)t=new a(e);else if(!F((t=j(i.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 N(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 L(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 P(e,t,r){function n(r){U(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 D(e,t){for(var r of b)e.removeListener(r,E[r]);e.on("error",S),e.destroy(t)}function F(e){return"string"==typeof e||e instanceof String}function U(e){return"function"==typeof e}function I(e){return e.replace(/[\]\\/()*+?.$]/g,"\\$&")}return A.prototype=Object.create(p.prototype),A.prototype.abort=function(){D(this._currentRequest),this._currentRequest.abort(),this.emit("abort")},A.prototype.destroy=function(e){return D(this._currentRequest,e),C.call(this,e),this},A.prototype.write=function(e,t,r){if(this._ending)throw new v;if(!F(e)&&("object"!=typeof(n=e)||!("length"in n)))throw new TypeError("data should be a string, Buffer or Uint8Array");var n;U(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 O),this.abort()):r&&r()},A.prototype.end=function(e,t,r){if(U(e)?(r=e,e=t=null):U(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)},A.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)},A.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},A.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){A.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(A.prototype,e,{get:function(){return this._currentRequest[e]}})})),A.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))}},A.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 o of(n._redirectable=this,b))n.on(o,E[o]);if(this._currentUrl=/^\//.test(this._options.path)?i.format(this._options):this._options.path,this._isRedirect){var s=0,a=this,c=this._requestBodyBuffers;!function e(t){if(n===a._currentRequest)if(t)a.emit("error",t);else if(s<c.length){var r=c[s++];n.finished||n.write(r.data,r.encoding,e)}else a._ended&&n.end()}()}},A.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(D(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new R;var o=this._options.beforeRedirect;o&&(r=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var s=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=[],L(/^content-/i,this._options.headers));var c,u,l=L(/^host$/i,this._options.headers),f=T(this._currentUrl),p=l||f.host,y=/^\w+:/.test(n)?this._currentUrl:i.format(Object.assign(f,{host:p})),g=(c=n,u=y,m?new a(c,u):T(i.resolve(u,c)));if(h("redirecting to",g.href),this._isRedirect=!0,N(g,this._options),(g.protocol!==f.protocol&&"https:"!==g.protocol||g.host!==p&&!function(e,t){d(F(e)&&F(t));var r=e.length-t.length-1;return r>0&&"."===e[r]&&e.endsWith(t)}(g.host,p))&&L(this._headerFilter,this._options.headers),U(o)){var b={headers:e.headers,statusCode:t},E={url:y,method:s,headers:r};o(this._options,b,E),this._sanitizeOptions(this._options)}this._performRequest()},Wn.exports=x({http:c,https:f}),Wn.exports.wrap=x,Wn.exports}();const uo=Bn(co),lo="1.17.0";function fo(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}const po=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;const ho=Symbol("internals");class mo extends u.Transform{constructor(e){super({readableHighWaterMark:(e=$r.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,t)=>!$r.isUndefined(t[e])))).chunkSize});const t=this[ho]={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[ho];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,r){const n=this[ho],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:yo}=Symbol,go=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[yo]?yield*e[yo]():yield e},bo=An.ALPHABET.ALPHA_DIGIT+"-_",Eo="function"==typeof TextEncoder?new TextEncoder:new a.TextEncoder,_o="\r\n",wo=Eo.encode(_o);class Ro{constructor(e,t){const{escapeName:r}=this.constructor,n=$r.isString(t);let o=`Content-Disposition: form-data; name="${r(e)}"${!n&&t.name?`; filename="${r(t.name)}"`:""}${_o}`;if(n)t=Eo.encode(String(t).replace(/\r?\n|\r\n?/g,_o));else{o+=`Content-Type: ${String(t.type||"application/octet-stream").replace(/[\r\n]/g,"")}${_o}`}this.headers=Eo.encode(o+_o),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;$r.isTypedArray(e)?yield e:yield*go(e),yield wo}static escapeName(e){return String(e).replace(/[\r\n"]/g,(e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e])))}}class Oo extends u.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 vo=(e,t)=>$r.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,Co=new Set(["localhost"]),Ao=e=>{const t=e.split(".");return 4===t.length&&("127"===t[0]&&t.every((e=>/^\d+$/.test(e)&&Number(e)>=0&&Number(e)<=255)))},xo=e=>!!e&&(!!Co.has(e)||(!!Ao(e)||(e=>{if("::1"===e)return!0;const t=e.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return Ao(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))),So={http:80,https:443,ws:80,wss:443,ftp:21},To=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,jo=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,No=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(To);if(t)return t[1];const r=e.match(jo);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 Lo(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)||So[t.protocol.split(":",1)[0]]||0,o=No(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=No(t),!!t&&((!r||r===n)&&("*"===t.charAt(0)&&(t=t.slice(1)),"."===t.charAt(0)?o.endsWith(t):o===t||xo(o)&&xo(t)))}))}const Po=(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)},Do=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Fo=e=>(...t)=>$r.asap((()=>e(...t)));function Uo(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);(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102)&&(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}if("undefined"!=typeof Buffer&&"function"==typeof Buffer.byteLength)return Buffer.byteLength(n,"utf8");let o=0;for(let e=0,t=n.length;e<t;e++){const r=n.charCodeAt(e);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 Io={flush:p.constants.Z_SYNC_FLUSH,finishFlush:p.constants.Z_SYNC_FLUSH},Bo={flush:p.constants.BROTLI_OPERATION_FLUSH,finishFlush:p.constants.BROTLI_OPERATION_FLUSH},ko={flush:p.constants.ZSTD_e_flush,finishFlush:p.constants.ZSTD_e_flush},qo=$r.isFunction(p.createBrotliDecompress),Mo=$r.isFunction(p.createZstdDecompress),zo="gzip, compress, deflate"+(qo?", br":""),Ho=zo+(Mo?", zstd":""),{http:$o,https:Wo}=uo,Go=/https:?/,Vo=["content-type","content-length"];const Jo=Symbol("axios.http.socketListener"),Ko=Symbol("axios.http.currentReq"),Xo=Symbol("axios.http.installedTunnel"),Zo=new Map,Qo=new WeakMap;const Yo=An.protocols.map((e=>e+":")),es=e=>{if(!$r.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},ts=(e,[t,r])=>(e.on("end",r).on("error",r),t),rs=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=i.connect(e,t);let o,s;const c=()=>{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())},u=n.request,{sessionTimeout:l}=t;if(null!=l){let e=0;n.request=function(){const t=u.apply(this,arguments);return e++,s&&(clearTimeout(s),s=null),t.once("close",(()=>{--e||(s=setTimeout((()=>{s=null,c()}),l))})),t}}n.once("close",c);let f=[n,t];return r?r.push(f):r=this.sessions[e]=[f],n}};function ns(e,t,r){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.auth&&e.beforeRedirects.auth(e),e.beforeRedirects.config&&e.beforeRedirects.config(e,t,r)}function os(e,t,r,o,s){let i=t;if(!i&&!1!==i){const e=Un(r);e&&(Lo(r)||(i=new URL(e)))}if(o&&e.headers)for(const t of Object.keys(e.headers))"proxy-authorization"===t.toLowerCase()&&delete e.headers[t];if(o&&e.agent&&e.agent[Xo]&&(e.agent=void 0),i){const t=i instanceof URL,o=e=>t||$r.hasOwnProp(i,e)?i[e]:void 0,a=o("username"),c=o("password");let u=$r.hasOwnProp(i,"auth")?i.auth:void 0;if(a&&(u=(a||"")+":"+(c||"")),u){const e="object"==typeof u,t=e&&$r.hasOwnProp(u,"username")?u.username:void 0,r=e&&$r.hasOwnProp(u,"password")?u.password:void 0;if(Boolean(t||r))u=(t||"")+":"+(r||"");else if(e)throw new rn("Invalid proxy authorization",rn.ERR_BAD_OPTION,{proxy:i})}if(Go.test(e.protocol)){if(!(s instanceof n)){const t=o("hostname")||o("host"),r=o("port"),i=o("protocol"),a=i?i.includes(":")?i:`${i}:`:"http:",c=t&&t.includes(":")&&!t.startsWith("[")?`[${t}]`:t,l=new URL(`${a}//${c}${r?":"+r:""}`),f={protocol:l.protocol,hostname:l.hostname.replace(/^\[|\]$/g,""),port:l.port,auth:u&&"string"==typeof u?u:void 0};"https:"===l.protocol&&(f.ALPNProtocols=["http/1.1"]);const p=function(e,t){const r=e.protocol+"//"+e.hostname+":"+(e.port||"")+"#"+(e.auth||""),o=t?Qo.get(t)||Qo.set(t,new Map).get(t):Zo;let s=o.get(r);if(s)return s;const i=t&&t.options?{...t.options,...e}:e;if(s=new n(i),t&&t.options){const e={...t.options},r=s.callback;s.callback=function(t,n){return r.call(this,t,{...e,...n})}}return s[Xo]=!0,o.set(r,s),s}(f,s);e.agent=p,e.agents&&(e.agents.https=p)}}else{if(u){const t=Buffer.from(u,"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 n=o("hostname")||o("host");e.hostname=n,e.host=n,e.port=o("port"),e.path=r;const s=o("protocol");s&&(e.protocol=s.includes(":")?s:`${s}:`)}}e.beforeRedirects.proxy=function(e){os(e,t,e.href,!0,s)}}const ss="undefined"!=typeof process&&"process"===$r.kindOf(process),is=(e,t)=>(({address:e,family:t})=>{if(!$r.isString(e))throw TypeError("address must be a string");return{address:e,family:t||(e.indexOf(".")<0?6:4)}})($r.isObject(e)?e:{address:e,family:t}),as={request(e,t){const r=e.protocol+"//"+e.hostname+":"+(e.port||("https:"===e.protocol?443:80)),{http2Options:n,headers:o}=e,s=rs.getSession(r,n),{HTTP2_HEADER_SCHEME:a,HTTP2_HEADER_METHOD:c,HTTP2_HEADER_PATH:u,HTTP2_HEADER_STATUS:l}=i.constants,f={[a]:e.protocol.replace(":",""),[c]:e.method,[u]:e.path};$r.forEach(o,((e,t)=>{":"!==t.charAt(0)&&(f[t]=e)}));const p=s.request(f);return p.once("response",(e=>{const r=p,n=(e=Object.assign({},e))[l];delete e[l],r.headers=e,r.statusCode=+n,t(r)})),p}},cs=ss&&function(e){return t=async function(t,r,n){const i=t=>$r.hasOwnProp(e,t)?e[t]:void 0,l=i("transitional")||mn;let f=i("data"),h=i("lookup"),m=i("family"),y=i("httpVersion");void 0===y&&(y=1);let g=i("http2Options");const b=i("responseType"),E=i("responseEncoding"),_=e.method.toUpperCase();let w,R,O,v=!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 C=2===y;if(h){const e=vo(h,(e=>$r.isArray(e)?e:[e]));h=(t,r,n)=>{e(t,r,((e,t,o)=>{if(e)return n(e);const s=$r.isArray(t)?t.map((e=>is(e))):[is(t,o)];r.all?n(e,s):n(e,s[0].address,s[0].family)}))}}const A=new d.EventEmitter;function x(t){try{A.emit("abort",!t||t.type?new Ln(null,e,R):t)}catch(e){}}function S(){O&&(clearTimeout(O),O=null)}A.once("abort",r);const T=()=>{S(),e.cancelToken&&e.cancelToken.unsubscribe(x),e.signal&&e.signal.removeEventListener("abort",x),A.removeAllListeners()};(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(x),e.signal&&(e.signal.aborted?x():e.signal.addEventListener("abort",x))),n(((e,t)=>{if(w=!0,S(),t)return v=!0,void T();const{data:r}=e;if(r instanceof u.Readable||r instanceof u.Duplex){const e=u.finished(r,(()=>{e(),T()}))}else T()}));const j=Dn(e.baseURL,e.url,e.allowAbsoluteUrls),N=new URL(j,An.hasBrowserEnv?An.origin:void 0),L=N.protocol||Yo[0];if("data:"===L){if(e.maxContentLength>-1&&Uo(String(e.url||j||""))>e.maxContentLength)return r(new rn("maxContentLength size of "+e.maxContentLength+" exceeded",rn.ERR_BAD_RESPONSE,e));let n;if("GET"!==_)return Pn(t,r,{status:405,statusText:"method not allowed",headers:{},config:e});try{n=function(e,t,r){const n=r&&r.Blob||An.classes.Blob,o=fo(e);if(void 0===t&&n&&(t=!0),"data"===o){e=o.length?e.slice(o.length+1):e;const r=po.exec(e);if(!r)throw new rn("Invalid URL",rn.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=Buffer.from(decodeURIComponent(c),a);if(t){if(!n)throw new rn("Blob is not supported",rn.ERR_NOT_SUPPORT);return new n([l],{type:u})}return l}throw new rn("Unsupported protocol "+o,rn.ERR_NOT_SUPPORT)}(e.url,"blob"===b,{Blob:e.env&&e.env.Blob})}catch(t){throw rn.from(t,rn.ERR_BAD_REQUEST,e)}return"text"===b?(n=n.toString(E),E&&"utf8"!==E||(n=$r.stripBOM(n))):"stream"===b&&(n=u.Readable.from(n)),Pn(t,r,{data:n,status:200,statusText:"OK",headers:new en,config:e})}if(-1===Yo.indexOf(L))return r(new rn("Unsupported protocol "+L,rn.ERR_BAD_REQUEST,e));const P=en.from(e.headers).normalize();P.set("User-Agent","axios/"+lo,!1);const{onUploadProgress:D,onDownloadProgress:F}=e,U=e.maxRate;let I,B;if($r.isSpecCompliantForm(f)){const e=P.getContentType(/boundary=([-_\w\d]{10,70})/i);f=((e,t,r)=>{const{tag:n="form-data-boundary",size:o=25,boundary:s=n+"-"+An.generateString(o,bo)}=r||{};if(!$r.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=Eo.encode("--"+s+_o),a=Eo.encode("--"+s+"--"+_o);let c=a.byteLength;const l=Array.from(e.entries()).map((([e,t])=>{const r=new Ro(e,t);return c+=r.size,r}));c+=i.byteLength*l.length,c=$r.toFiniteNumber(c);const f={"Content-Type":`multipart/form-data; boundary=${s}`};return Number.isFinite(c)&&(f["Content-Length"]=c),t&&t(f),u.Readable.from(async function*(){for(const e of l)yield i,yield*e.encode();yield a}())})(f,(e=>{P.set(e)}),{tag:`axios-${lo}-boundary`,boundary:e&&e[1]||void 0})}else if($r.isFormData(f)&&$r.isFunction(f.getHeaders)&&f.getHeaders!==Object.prototype.getHeaders){if(function(e,t,r){"content-only"===r?Object.entries(t).forEach((([t,r])=>{Vo.includes(t.toLowerCase())&&e.set(t,r)})):e.set(t)}(P,f.getHeaders(),i("formDataHeaderPolicy")),!P.hasContentLength())try{const e=await a.promisify(f.getLength).call(f);Number.isFinite(e)&&e>=0&&P.setContentLength(e)}catch(e){}}else if($r.isBlob(f)||$r.isFile(f))f.size&&P.setContentType(f.type||"application/octet-stream"),P.setContentLength(f.size||0),f=u.Readable.from(go(f));else if(f&&!$r.isStream(f)){if(Buffer.isBuffer(f));else if($r.isArrayBuffer(f))f=Buffer.from(new Uint8Array(f));else{if(!$r.isString(f))return r(new rn("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",rn.ERR_BAD_REQUEST,e));f=Buffer.from(f,"utf-8")}if(P.setContentLength(f.length,!1),e.maxBodyLength>-1&&f.length>e.maxBodyLength)return r(new rn("Request body larger than maxBodyLength limit",rn.ERR_BAD_REQUEST,e))}const k=$r.toFiniteNumber(P.getContentLength());let q;$r.isArray(U)?(I=U[0],B=U[1]):I=B=U,f&&(D||I)&&($r.isStream(f)||(f=u.Readable.from(f,{objectMode:!1})),f=u.pipeline([f,new mo({maxRate:$r.toFiniteNumber(I)})],$r.noop),D&&f.on("progress",ts(f,Do(k,Po(Fo(D),!1,3)))));const M=i("auth");let z;M&&(q=(M.username||"")+":"+(M.password||"")),q||!N.username&&!N.password||(q=es(N.username)+":"+es(N.password)),q&&P.delete("authorization");try{z=dn(N.pathname+N.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(t){const n=new Error(t.message);return n.config=e,n.url=e.url,n.exists=!0,r(n)}P.set("Accept-Encoding",$r.hasOwnProp(l,"advertiseZstdAcceptEncoding")&&!0===l.advertiseZstdAcceptEncoding?Ho:zo,!1);const H=Object.assign(Object.create(null),{path:z,method:_,headers:Kr(P),agents:{http:e.httpAgent,https:e.httpsAgent},auth:q,protocol:L,family:m,beforeRedirect:ns,beforeRedirects:Object.create(null),http2Options:g});!$r.isUndefined(h)&&(H.lookup=h);const $=i("socketPath");if($){if("string"!=typeof $)return r(new rn("socketPath must be a string",rn.ERR_BAD_OPTION_VALUE,e));const t=i("allowedSocketPaths");if(null!=t){const n=Array.isArray(t)?t:[t],o=c.resolve($);if(!n.some((e=>"string"==typeof e&&c.resolve(e)===o)))return r(new rn(`socketPath "${$}" is not permitted by allowedSocketPaths`,rn.ERR_BAD_OPTION_VALUE,e))}H.socketPath=$}else H.hostname=N.hostname.startsWith("[")?N.hostname.slice(1,-1):N.hostname,H.port=N.port,os(H,e.proxy,L+"//"+N.hostname+(N.port?":"+N.port:"")+H.path,!1,e.httpsAgent);let W,G=!1;const V=Go.test(H.protocol);if(null==H.agent&&(H.agent=V?e.httpsAgent:e.httpAgent),C)W=as;else{const t=i("transport");if(t)W=t;else if(0===e.maxRedirects)W=V?s:o,G=!0;else{e.maxRedirects&&(H.maxRedirects=e.maxRedirects);const t=i("beforeRedirect");if(t&&(H.beforeRedirects.config=t),q){const e=N.origin,t=q;H.beforeRedirects.auth=function(r){try{new URL(r.href).origin===e&&(r.auth=t)}catch(e){}}}W=V?Wo:$o}}e.maxBodyLength>-1?H.maxBodyLength=e.maxBodyLength:H.maxBodyLength=1/0,H.insecureHTTPParser=Boolean(i("insecureHTTPParser")),R=W.request(H,(function(n){if(S(),R.destroyed)return;const o=[n],s=$r.toFiniteNumber(n.headers["content-length"]);if(F||B){const l=new mo({maxRate:$r.toFiniteNumber(B)});F&&l.on("progress",ts(l,Do(s,Po(Fo(F),!0,3)))),o.push(l)}let i=n;const a=n.req||R;if(!1!==e.decompress&&n.headers["content-encoding"])switch("HEAD"!==_&&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(p.createUnzip(Io)),delete n.headers["content-encoding"];break;case"deflate":o.push(new Oo),o.push(p.createUnzip(Io)),delete n.headers["content-encoding"];break;case"br":qo&&(o.push(p.createBrotliDecompress(Bo)),delete n.headers["content-encoding"]);break;case"zstd":Mo&&(o.push(p.createZstdDecompress(ko)),delete n.headers["content-encoding"])}i=o.length>1?u.pipeline(o,$r.noop):o[0];const c={status:n.statusCode,statusText:n.statusMessage,headers:new en(n.headers),config:e,request:a};if("stream"===b){if(e.maxContentLength>-1){const f=e.maxContentLength,d=i;async function*h(){let t=0;for await(const r of d){if(t+=r.length,t>f)throw new rn("maxContentLength size of "+f+" exceeded",rn.ERR_BAD_RESPONSE,e,a);yield r}}i=u.Readable.from(h(),{objectMode:!1})}c.data=i,Pn(t,r,c)}else{const m=[];let y=0;i.on("data",(function(t){m.push(t),y+=t.length,e.maxContentLength>-1&&y>e.maxContentLength&&(v=!0,i.destroy(),x(new rn("maxContentLength size of "+e.maxContentLength+" exceeded",rn.ERR_BAD_RESPONSE,e,a)))})),i.on("aborted",(function(){if(v)return;const t=new rn("stream has been aborted",rn.ERR_BAD_RESPONSE,e,a,c);i.destroy(t),r(t)})),i.on("error",(function(t){v||r(rn.from(t,null,e,a,c))})),i.on("end",(function(){try{let e=1===m.length?m[0]:Buffer.concat(m);"arraybuffer"!==b&&(e=e.toString(E),E&&"utf8"!==E||(e=$r.stripBOM(e))),c.data=e}catch(t){return r(rn.from(t,null,e,c.request,c))}Pn(t,r,c)}))}A.once("abort",(e=>{i.destroyed||(i.emit("error",e),i.destroy())}))})),A.once("abort",(e=>{R.close?R.close():R.destroy(e)})),R.on("error",(function(t){r(rn.from(t,null,e,R))}));const J=new Set;if(R.on("socket",(function(e){e.setKeepAlive(!0,6e4),e[Jo]||(e.on("error",(function(t){const r=e[Ko];r&&!r.destroyed&&r.destroy(t)})),e[Jo]=!0),e[Ko]=R,J.add(e)})),R.once("close",(function(){S();for(const e of J)e[Ko]===R&&(e[Ko]=null);J.clear()})),e.timeout){const t=parseInt(e.timeout,10);if(Number.isNaN(t))return void x(new rn("error trying to parse `config.timeout` to int",rn.ERR_BAD_OPTION_VALUE,e,R));const r=function(){w||x(function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";return e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),new rn(t,l.clarifyTimeoutError?rn.ETIMEDOUT:rn.ECONNABORTED,e,R)}())};G&&t>0&&(O=setTimeout(r,t)),R.setTimeout(t,r)}else R.setTimeout(0);if($r.isStream(f)){let t=!1,r=!1;f.on("end",(()=>{t=!0})),f.once("error",(e=>{r=!0,R.destroy(e)})),f.on("close",(()=>{t||r||x(new Ln("Request stream has been aborted",e,R))}));let n=f;if(e.maxBodyLength>-1&&0===e.maxRedirects){const t=e.maxBodyLength;let r=0;n=u.pipeline([f,new u.Transform({transform(n,o,s){if(r+=n.length,r>t)return s(new rn("Request body larger than maxBodyLength limit",rn.ERR_BAD_REQUEST,e,R));s(null,n)}})],$r.noop),n.on("error",(e=>{R.destroyed||R.destroy(e)}))}n.pipe(R)}else f&&R.write(f),R.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=An.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,An.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(An.origin),An.navigator&&/(msie|trident)/i.test(An.navigator.userAgent)):()=>!0,ls=An.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];$r.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),$r.isString(n)&&a.push(`path=${n}`),$r.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),$r.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)return decodeURIComponent(n.slice(o+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},fs=e=>e instanceof en?{...e}:e;function ps(e,t){t=t||{};const r=Object.create(null);function n(e,t,r,n){return $r.isPlainObject(e)&&$r.isPlainObject(t)?$r.merge.call({caseless:n},e,t):$r.isPlainObject(t)?$r.merge({},t):$r.isArray(t)?t.slice():t}function o(e,t,r,o){return $r.isUndefined(t)?$r.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function s(e,t){if(!$r.isUndefined(t))return n(void 0,t)}function i(e,t){return $r.isUndefined(t)?$r.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,o,s){return $r.hasOwnProp(t,s)?n(r,o):$r.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(fs(e),fs(t),0,!0)};return $r.forEach(Object.keys({...e,...t}),(function(n){if("__proto__"===n||"constructor"===n||"prototype"===n)return;const s=$r.hasOwnProp(c,n)?c[n]:o,i=s($r.hasOwnProp(e,n)?e[n]:void 0,$r.hasOwnProp(t,n)?t[n]:void 0,n);$r.isUndefined(i)&&s!==a||(r[n]=i)})),r}const ds=["content-type","content-length"];function hs(e){const t=ps({},e),r=e=>$r.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");var p;if(t.headers=a=en.from(a),t.url=dn(Dn(u,f,l),r("params"),r("paramsSerializer")),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?(p=c.password,encodeURIComponent(p).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))):""))),$r.isFormData(n)&&(An.hasStandardBrowserEnv||An.hasStandardBrowserWebWorkerEnv||$r.isReactNative(n)?a.setContentType(void 0):$r.isFunction(n.getHeaders)&&function(e,t,r){"content-only"===r?Object.entries(t).forEach((([t,r])=>{ds.includes(t.toLowerCase())&&e.set(t,r)})):e.set(t)}(a,n.getHeaders(),r("formDataHeaderPolicy"))),An.hasStandardBrowserEnv){$r.isFunction(o)&&(o=o(t));if(!0===o||null==o&&us(t.url)){const e=s&&i&&ls.read(i);e&&a.set(s,e)}}return t}const ms="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const n=hs(e);let o=n.data;const s=en.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=en.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Pn((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 rn("Request aborted",rn.ECONNABORTED,e,m)),h(),m=null)},m.onerror=function(t){const n=t&&t.message?t.message:"Network Error",o=new rn(n,rn.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||mn;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new rn(t,o.clarifyTimeoutError?rn.ETIMEDOUT:rn.ECONNABORTED,e,m)),h(),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&$r.forEach(Kr(s),(function(e,t){m.setRequestHeader(t,e)})),$r.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),f&&"json"!==f&&(m.responseType=n.responseType),d&&([c,l]=Po(d,!0),m.addEventListener("progress",c)),p&&m.upload&&([a,u]=Po(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(i=t=>{m&&(r(!t||t.type?new Ln(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=fo(n.url);!g||An.protocols.includes(g)?m.send(o||null):r(new rn("Unsupported protocol "+g+":",rn.ERR_BAD_REQUEST,e))}))},ys=(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 rn?t:new Ln(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,o(new rn(`timeout of ${t}ms exceeded`,rn.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)));const{signal:a}=r;return a.unsubscribe=()=>$r.asap(i),a},gs=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},bs=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()}},Es=(e,t,r,n)=>{const o=async function*(e,t){for await(const r of bs(e))yield*gs(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:_s}=$r,ws=e=>{if(!$r.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},Rs=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Os=e=>{const t=void 0!==$r.global&&null!==$r.global?$r.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=$r.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:s,Response:i}=e,a=o?_s(o):"function"==typeof fetch,c=_s(s),u=_s(i);if(!a)return!1;const l=a&&_s(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&&Rs((()=>{let e=!1;const t=new s(An.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&&Rs((()=>$r.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 rn(`Response type '${e}' is not supported`,rn.ERR_NOT_SUPPORT,r)})}));const y=async(e,t)=>{const r=$r.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if($r.isBlob(e))return e.size;if($r.isSpecCompliantForm(e)){const t=new s(An.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return $r.isArrayBufferView(e)||$r.isArrayBuffer(e)?e.byteLength:($r.isURLSearchParams(e)&&(e+=""),$r.isString(e)?(await f(e)).byteLength:void 0)})(t):r};return async e=>{let{url:t,method:r,data:a,signal:u,cancelToken:l,timeout:f,onDownloadProgress:p,onUploadProgress:g,responseType:b,headers:E,withCredentials:_="same-origin",fetchOptions:w,maxContentLength:R,maxBodyLength:O}=hs(e);const v=$r.isNumber(R)&&R>-1,C=$r.isNumber(O)&&O>-1;let A=o||fetch;b=b?(b+"").toLowerCase():"text";let x=ys([u,l&&l.toAbortSignal()],f),S=null;const T=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let j;try{let o;const u=(L="auth",$r.hasOwnProp(e,L)?e[L]:void 0);if(u){const e=u.username||"";o={username:e,password: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,An.origin);if(!o&&(e.username||e.password)){const t=ws(e.username);o={username:t,password:ws(e.password)}}(e.username||e.password)&&(e.username="",e.password="",t=e.href)}if(o&&(E.delete("authorization"),E.set("Authorization","Basic "+btoa((N=(o.username||"")+":"+(o.password||""),encodeURIComponent(N).replace(/%([0-9A-F]{2})/gi,((e,t)=>String.fromCharCode(parseInt(t,16)))))))),v&&"string"==typeof t&&t.startsWith("data:")){if(Uo(t)>R)throw new rn("maxContentLength size of "+R+" exceeded",rn.ERR_BAD_RESPONSE,e,S)}if(C&&"get"!==r&&"head"!==r){const t=await y(E,a);if("number"==typeof t&&isFinite(t)&&t>O)throw new rn("Request body larger than maxBodyLength limit",rn.ERR_BAD_REQUEST,e,S)}if(g&&d&&"get"!==r&&"head"!==r&&0!==(j=await y(E,a))){let e,r=new s(t,{method:"POST",body:a,duplex:"half"});if($r.isFormData(a)&&(e=r.headers.get("content-type"))&&E.setContentType(e),r.body){const[e,t]=Do(j,Po(Fo(g)));a=Es(r.body,65536,e,t)}}$r.isString(_)||(_=_?"include":"omit");const l=c&&"credentials"in s.prototype;if($r.isFormData(a)){const e=E.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&E.delete("content-type")}E.set("User-Agent","axios/"+lo,!1);const f={...w,signal:x,method:r.toUpperCase(),headers:Kr(E.normalize()),body:a,duplex:"half",credentials:l?_:void 0};S=c&&new s(t,f);let P=await(c?A(S,w):A(t,f));if(v){const t=$r.toFiniteNumber(P.headers.get("content-length"));if(null!=t&&t>R)throw new rn("maxContentLength size of "+R+" exceeded",rn.ERR_BAD_RESPONSE,e,S)}const D=h&&("stream"===b||"response"===b);if(h&&P.body&&(p||v||D&&T)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=P[e]}));const r=$r.toFiniteNumber(P.headers.get("content-length")),[n,o]=p&&Do(r,Po(Fo(p),!0))||[];let s=0;const a=t=>{if(v&&(s=t,s>R))throw new rn("maxContentLength size of "+R+" exceeded",rn.ERR_BAD_RESPONSE,e,S);n&&n(t)};P=new i(Es(P.body,65536,a,(()=>{o&&o(),T&&T()})),t)}b=b||"text";let F=await m[$r.findKey(m,b)||"text"](P,e);if(v&&!h&&!D){let t;if(null!=F&&("number"==typeof F.byteLength?t=F.byteLength:"number"==typeof F.size?t=F.size:"string"==typeof F&&(t="function"==typeof n?(new n).encode(F).byteLength:F.length)),"number"==typeof t&&t>R)throw new rn("maxContentLength size of "+R+" exceeded",rn.ERR_BAD_RESPONSE,e,S)}return!D&&T&&T(),await new Promise(((t,r)=>{Pn(t,r,{data:F,headers:en.from(P.headers),status:P.status,statusText:P.statusText,config:e,request:S})}))}catch(t){if(T&&T(),x&&x.aborted&&x.reason instanceof rn){const r=x.reason;throw r.config=e,S&&(r.request=S),t!==r&&(r.cause=t),r}if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new rn("Network Error",rn.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t});throw rn.from(t,t&&t.code,e,S,t&&t.response)}var N,L}},vs=new Map,Cs=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=vs;for(;c--;)i=s[c],a=u.get(i),void 0===a&&u.set(i,a=c?new Map:Os(t)),u=a;return a};Cs();const As={http:cs,xhr:ms,fetch:{get:Cs}};$r.forEach(As,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));const xs=e=>`- ${e}`,Ss=e=>$r.isFunction(e)||null===e||!1===e;const Ts={getAdapter:function(e,t){e=$r.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,!Ss(n)&&(o=As[(r=String(n)).toLowerCase()],void 0===o))throw new rn(`Unknown adapter '${r}'`);if(o&&($r.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(xs).join("\n"):" "+xs(e[0]):"as no adapter specified";throw new rn("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o},adapters:As};function js(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ln(null,e)}function Ns(e){js(e),e.headers=en.from(e.headers),e.data=jn.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Ts.getAdapter(e.adapter||Tn.adapter,e)(e).then((function(t){js(e),e.response=t;try{t.data=jn.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=en.from(t.headers),t}),(function(t){if(!Nn(t)&&(js(e),t&&t.response)){e.response=t.response;try{t.response.data=jn.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=en.from(t.response.headers)}return Promise.reject(t)}))}const Ls={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ls[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Ps={};Ls.transitional=function(e,t,r){function n(e,t){return"[Axios v"+lo+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new rn(n(o," has been removed"+(t?" in "+t:"")),rn.ERR_DEPRECATED);return t&&!Ps[o]&&(Ps[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)}},Ls.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const Ds={assertOptions:function(e,t,r){if("object"!=typeof e)throw new rn("options must be an object",rn.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 rn("option "+s+" must be "+r,rn.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new rn("Unknown option "+s,rn.ERR_BAD_OPTION)}},validators:Ls},Fs=Ds.validators;let Us=class{constructor(e){this.defaults=e||{},this.interceptors={request:new hn,response:new hn}}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=ps(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Ds.assertOptions(r,{silentJSONParsing:Fs.transitional(Fs.boolean),forcedJSONParsing:Fs.transitional(Fs.boolean),clarifyTimeoutError:Fs.transitional(Fs.boolean),legacyInterceptorReqResOrdering:Fs.transitional(Fs.boolean),advertiseZstdAcceptEncoding:Fs.transitional(Fs.boolean)},!1),null!=n&&($r.isFunction(n)?t.paramsSerializer={serialize:n}:Ds.assertOptions(n,{encode:Fs.function,serialize:Fs.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Ds.assertOptions(t,{baseUrl:Fs.spelling("baseURL"),withXsrfToken:Fs.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&$r.merge(o.common,o[t.method]);o&&$r.forEach(["delete","get","head","post","put","patch","query","common"],(e=>{delete o[e]})),t.headers=en.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||mn;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=[Ns.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=Ns.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 dn(Dn((e=ps(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};$r.forEach(["delete","get","head","options"],(function(e){Us.prototype[e]=function(t,r){return this.request(ps(r||{},{method:e,url:t,data:(r||{}).data}))}})),$r.forEach(["post","put","patch","query"],(function(e){function t(t){return function(r,n,o){return this.request(ps(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Us.prototype[e]=t(),"query"!==e&&(Us.prototype[e+"Form"]=t(!0))}));const Is={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(Is).forEach((([e,t])=>{Is[t]=e}));const Bs=function e(t){const r=new Us(t),n=Qt(Us.prototype.request,r);return $r.extend(n,Us.prototype,r,{allOwnKeys:!0}),$r.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(ps(t,r))},n}(Tn);Bs.Axios=Us,Bs.CanceledError=Ln,Bs.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 Ln(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}}},Bs.isCancel=Nn,Bs.VERSION=lo,Bs.toFormData=cn,Bs.AxiosError=rn,Bs.Cancel=Bs.CanceledError,Bs.all=function(e){return Promise.all(e)},Bs.spread=function(e){return function(t){return e.apply(null,t)}},Bs.isAxiosError=function(e){return $r.isObject(e)&&!0===e.isAxiosError},Bs.mergeConfig=ps,Bs.AxiosHeaders=en,Bs.formToJSON=e=>xn($r.isHTMLForm(e)?new FormData(e):e),Bs.getAdapter=Ts.getAdapter,Bs.HttpStatusCode=Is,Bs.default=Bs;const{Axios:ks,AxiosError:qs,CanceledError:Ms,isCancel:zs,CancelToken:Hs,VERSION:$s,all:Ws,Cancel:Gs,isAxiosError:Vs,spread:Js,toFormData:Ks,AxiosHeaders:Xs,HttpStatusCode:Zs,formToJSON:Qs,getAdapter:Ys,mergeConfig:ei,create:ti}=Bs;function ri(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 ni(){return function(e={}){const{isSuccess:t=e=>0===e,getCode:r=e=>ri([e,"access",e=>e.data,"optionalAccess",e=>e.code]),getMessage:n=e=>ri([e,"access",e=>e.data,"optionalAccess",e=>e.message])||ri([e,"access",e=>e.data,"optionalAccess",e=>e.msg]),getData:o=e=>ri([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 Zt(c,{status:e.status,code:a,config:e.config,response:e,data:e.data});return e}}}({isSuccess:e=>0===e,getCode:e=>ri([e,"access",e=>e.data,"optionalAccess",e=>e.code]),getMessage:e=>ri([e,"access",e=>e.data,"optionalAccess",e=>e.message])||ri([e,"access",e=>e.data,"optionalAccess",e=>e.msg]),getData:e=>e.data})}function oi(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 si={"/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 ii(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=Vt(e);for(const e of t){const t=tt(r,e);if("string"==typeof t){const n=Number(t);Number.isInteger(n)&&Kt(r,e,n)}else Array.isArray(t)&&Kt(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 ai(e={}){const t=Bs.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 oi([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=oi([e,"access",e=>e.method,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])||"get";var a;return r.includes(i)&&(a="content-type",!("function"==typeof oi([e,"access",e=>e.headers,"optionalAccess",e=>e.get])?e.headers.get(a):oi([e,"access",e=>e.headers,"optionalAccess",e=>e[a]])))&&(s("content-type",n),o&&!e.data&&(e.data={})),e}}}(),ii({config:si}),ni(),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 ci=ai({baseURL:"/",headers:{"Agw-Js-Conv":"str"}}),ui=ci;function li(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 fi={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 pi(e,t){return null!=e?e:t()}function di(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 hi extends Error{constructor(e,t,r,n){const o=pi(fi[e],(()=>"UNKNOWN_ERROR")),s=pi(t,(()=>o));super(s),this.name="CozeError",this.code=e,this.errorName=o,this.desc=s,this.details=r,this.trigger=di([n,"optionalAccess",e=>e.trigger]),this.fix=di([n,"optionalAccess",e=>e.fix]),this.example=di([n,"optionalAccess",e=>e.example]),this.isMessageExplicit=void 0!==t,Object.setPrototypeOf(this,hi.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=m.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=>{m.merge(r,n(e,t))})),m.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 h.fetch(e,{...t,headers:this.getRequestHeaders(e,t),dispatcher:this.dispatcher})}}const yi=new mi;exports.CozeError=hi,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=fi,exports.HttpError=Zt,exports.MapCache=$e,exports.Stack=ot,exports.Symbol=E,exports.Uint8Array=jt,exports.arrayLikeKeys=xe,exports.arrayMap=T,exports.arrayPush=rt,exports.assignValue=oe,exports.axiosInstance=ui,exports.axiosInstance$1=ci,exports.baseAssignValue=te,exports.baseGet=et,exports.baseGetAllKeys=ht,exports.baseGetTag=A,exports.baseSet=Jt,exports.castPath=Qe,exports.cloneBuffer=ut,exports.cloneDeep=Vt,exports.cloneTypedArray=Ft,exports.createRequestClient=ai,exports.customFetch=yi,exports.defineProperty=Q,exports.eq=re,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=tt,exports.getAllKeys=mt,exports.getDefaultExportFromCjs=Bn,exports.getPrototype=nt,exports.getSymbols=dt,exports.initCloneObject=It,exports.isArguments=de,exports.isArray=j,exports.isArrayLike=ie,exports.isBuffer=ge,exports.isFunction=F,exports.isHttpError=function(e){return e instanceof Zt},exports.isIndex=ee,exports.isKey=De,exports.isLength=se,exports.isObject=D,exports.isObjectLike=x,exports.isPrototype=ce,exports.isTypedArray=Ce,exports.keys=Ne,exports.request=(e,t)=>ui({...e,...t}),exports.requireSrc=ao,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(li([o,"optionalAccess",e=>e.validate])){if(o.validate(t))return t;{const t=new Error("JSON validation failed");if(li([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&&li([o,"optionalAccess",e=>e.throwOnValidationError]))throw t;return li([o,"optionalAccess",e=>e.onError,"optionalCall",r=>r(t,e)]),n}},exports.stubArray=lt,exports.toKey=Ye;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("process"),t=require("path"),s=require("child_process"),i=require("undici"),a=require("./fetch-client-CgQGE-CR.js"),r=require("node:path"),n=require("node:fs/promises"),o=require("node:os");function c(e){const t=Object.create(null);if(e)for(const s in e)if("default"!==s){const i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}return t.default=e,Object.freeze(t)}require("node:fs");const l=c(r),d=c(n),_=c(o),u=()=>l.join(_.homedir(),".coze"),p=()=>l.join(u(),"cli"),h=()=>u();const m=["upgrade.cache"];function g(e){return m.some((t=>e===t||e.startsWith(`${t}.`)))}const E=l.join(p(),"config.json"),w=l.join(h(),"config.json"),f=l.join(process.cwd(),".cozerc.json"),T={apiBaseUrl:"https://code.coze.cn/",sessionApiBaseUrl:"https://www.coze.cn/",openApiBaseUrl:"https://api.coze.cn",integrationApiBaseUrl:"https://integration.coze.cn",clientId:"95438868623436343239609434490626.app.coze",defaultOutputFormat:"json",upgrade:{mode:"auto",channel:"latest"},skill:{mode:"auto"}};function S(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function R(e,t){return t.split(".").reduce(((e,t)=>{if(S(e))return e[t]}),e)}function P(e,t){const s={...e};for(const[e,i]of Object.entries(t)){const t=s[e];S(t)&&S(i)?s[e]=P(t,i):s[e]=i}return s}function A(e,t){const s=t.split("."),i=[];let a=e;for(let e=0;e<s.length-1;e++){if(!S(a))return!1;i.push(a),a=a[s[e]]}if(!S(a))return!1;const r=s[s.length-1];if(!(r in a))return!1;delete a[r],i.push(a);for(let e=s.length-2;e>=0;e--){const t=i[e+1];if(!S(t)||0!==Object.keys(t).length)break;delete i[e][s[e]]}return!0}function I(e,t=""){const s={};if(!S(e))return s;for(const[i,a]of Object.entries(e)){const e=t?`${t}.${i}`:i;S(a)?Object.assign(s,I(a,e)):s[e]=a}return s}async function U(e){try{const t=await d.readFile(e,"utf8");return JSON.parse(t)}catch(e){return}}async function L(){return await async function(e,t){return null!=e?e:await t()}(await U(E),(async()=>await U(w)))}function C(){const e={};return process.env.COZE_API_TOKEN&&(e.accessToken=process.env.COZE_API_TOKEN),process.env.COZE_ORG_ID&&(e.organizationId=process.env.COZE_ORG_ID),process.env.COZE_ENTERPRISE_ID&&(e.enterpriseId=process.env.COZE_ENTERPRISE_ID),process.env.COZE_SPACE_ID&&(e.spaceId=process.env.COZE_SPACE_ID),process.env.COZE_SESSION_SPACE_WEB_ID&&(e.sessionSpaceWebId=process.env.COZE_SESSION_SPACE_WEB_ID),"global"!==process.env.COZE_CONFIG_SCOPE&&"local"!==process.env.COZE_CONFIG_SCOPE||(e.configScope=process.env.COZE_CONFIG_SCOPE),process.env.COZE_DISABLE_TELEMETRY&&(e.disableTelemetry="true"===process.env.COZE_DISABLE_TELEMETRY),e}async function O(e){const t=process.env.COZE_CONFIG_FILE,[s,i,a,r]=await Promise.all([L(),U(f),t?U(t):void 0,e?U(e):void 0]),n=C();return{...T,...s,...i,...a,...r,...n}}async function v(e,t=function(e,t){return null!=e?e:t()}(C().configScope,(()=>"global"))){const s=process.env.COZE_CONFIG_FILE,i=s||("global"===t?E:f),a=l.dirname(i);try{await d.mkdir(a,{recursive:!0});const t=P(await U(i)||{},e);await d.writeFile(i,JSON.stringify(t,null,2),"utf8")}catch(e){throw new Error(`Failed to save config to ${i}: ${e}`)}}function y(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}const B=e=>e.endsWith("/")?e:`${e}/`,b=(e,t)=>{t&&Object.entries(t).forEach((([t,s])=>{null!=s&&e.searchParams.set(t,String(s))}))},z=async(e,t)=>{const s=await e.text();return s?a.safeJsonParse(s,t):t},D=(e,t,s={})=>{if(e.ok)return;const i=s.serviceName||"Service";throw new Error(y([t,"optionalAccess",e=>e.msg])||`${i} API request failed: ${e.status} ${e.statusText}`)},N=e=>e.headers.get("x-tt-logid")||void 0,q=e=>e?{"x-use-ppe":"1","x-tt-env":e}:{},k=e=>{const t=y([e,"optionalAccess",e=>e.trim,"call",e=>e()]);return t?{"x-coze-account":t}:{}},F=e=>{try{return"www.coze.cn"===new URL(e).hostname}catch(e){return!1}},G="coze-account",j=({getOrganizationId:e,organizationId:t})=>{if(!e&&!y([t,"optionalAccess",e=>e.trim,"call",e=>e()]))return void a.customFetch.removeScopedHeadersProvider(G);const s=e||(()=>t);a.customFetch.setScopedHeadersProvider(G,((e,t)=>{const i=(e=>"string"==typeof e?e:e instanceof URL?e.toString():"object"==typeof e&&e&&"url"in e?String(e.url):void 0)(e);return i&&F(i)?k(s()):{}}))};const x=async({url:e,api:t})=>{if(!e||!t.getWebUrl)return e;try{return function(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}([await t.getWebUrl({original_url:e,exchange_for_short_url:!0}),"access",e=>e.data,"optionalAccess",e=>e.short_url])||e}catch(t){return e}},M=({api:e})=>async({url:t})=>await x({url:t,api:e})||t;const H=({accountId:e,authConfigured:t})=>({authConfigured:t,authValid:!1,clawId:void 0,accountId:e,updatedAt:void 0});function W(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}const V=({api:e,resolveClawId:t})=>async(s={})=>{const i=s.clawId||await t();return(W([await e.listProcess({claw_id:i,size:s.size||100}),"access",e=>e.data,"optionalAccess",e=>e.processes])||[]).map((e=>(e=>{const t=String(e.id||"");if(!t)return null;const s=e;return{progressId:t,name:"string"==typeof e.name?e.name:void 0,type:"string"==typeof s.type?s.type:void 0,progressStatus:"running",raw:e}})(e))).filter((e=>null!==e))},$=e=>async({progressId:t,clawId:s})=>(await e({clawId:s})).find((e=>e.progressId===t))||null,Y=({listProgresses:e,runtimeStatusStore:t})=>async({sessionId:s,clawId:i})=>{const a=await e({clawId:i}),r=t.getLive(s),n=W([r,"optionalAccess",e=>e.status])||"idle",o=a.length;return{sessionId:s,displayStatus:"working"===n?"working":"idle",clawBusy:o>0,clawProgressCount:o,runtimeStatus:n,updatedAt:W([r,"optionalAccess",e=>e.updatedAt])}};class Z extends Error{constructor(e,t){super(e),this.code=t,this.name="SessionServiceError"}}const J=()=>new Z("Session token is missing or invalid","SESSION_AUTH_INVALID");function K(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}const X=({api:e,resolveClawId:t})=>async()=>{const s=await t(),i=await e.createSession({claw_id:s}),a=K([i,"access",e=>e.data,"optionalAccess",e=>e.session,"optionalAccess",e=>e.id]);if(!a)throw new Z(i.msg||"Failed to create session","SESSION_CREATE_FAILED");return{clawId:s,sessionId:String(a)}},Q=({api:e,resolveClawId:t})=>async(s={})=>{const i=await t(),a=await e.listSession({claw_id:i,offset:s.offset,limit:s.limit});if(0!==a.code&&void 0!==a.code)throw new Z(a.msg||"Failed to list sessions","SESSION_LIST_FAILED");const r=K([a,"access",e=>e.data,"optionalAccess",e=>e.session_list])||[],n=K([a,"access",e=>e.data,"optionalAccess",e=>e.next_offset]);return{items:r,nextOffset:n,hasMore:Boolean(n)}},ee=({api:e,updateSessionRuntimeStatus:t})=>async({sessionId:s,content:i,files:a})=>{const r=await e.chat({session_id:s,content:i,files:a}),n=K([r,"access",e=>e.data,"optionalAccess",e=>e.message_id]);if(!n)throw new Z(r.msg||"Failed to send session message","SESSION_MESSAGE_FAILED");return await t({sessionId:s,status:"working"}),{sessionId:s,messageId:n,status:"accepted"}};var te,se,ie,ae,re,ne,oe,ce,le,de,_e,ue,pe,he,me,ge,Ee,we,fe,Te,Se,Re,Pe,Ae,Ie,Ue,Le,Ce,Oe,ve,ye,Be,be,ze,De,Ne,qe,ke,Fe,Ge,je,xe,Me,He,We,Ve,$e,Ye,Ze,Je,Ke,Xe,Qe,et,tt,st,it;function at(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}!function(e){e[e.Free=0]="Free";e[e.PremiumLite=10]="PremiumLite";e[e.Premium=15]="Premium";e[e.PremiumPlus=20]="PremiumPlus";e[e.V1ProInstance=100]="V1ProInstance";e[e.ProPersonal=110]="ProPersonal";e[e.CozePersonalPlus=112]="CozePersonalPlus";e[e.CozePersonalAdvanced=114]="CozePersonalAdvanced";e[e.CozePersonalPro=116]="CozePersonalPro";e[e.CozePersonalUltra=118]="CozePersonalUltra";e[e.Team=120]="Team";e[e.EnterpriseBasic=125]="EnterpriseBasic";e[e.Enterprise=130]="Enterprise";e[e.EnterprisePro=135]="EnterprisePro"}(te||(te={})),function(e){e[e.Resume=1]="Resume";e[e.Terminate=2]="Terminate"}(se||(se={})),function(e){e[e.CAL_TYPE_UNSPECIFIED=0]="CAL_TYPE_UNSPECIFIED";e[e.CAL_TYPE_CRON=1]="CAL_TYPE_CRON";e[e.CAL_TYPE_HEARTBEAT=2]="CAL_TYPE_HEARTBEAT";e[e.CAL_TYPE_ONCE=3]="CAL_TYPE_ONCE";e[e.CAL_TYPE_DEFAULT=4]="CAL_TYPE_DEFAULT"}(ie||(ie={})),function(e){e[e.EVENT_STATUS_UNSPECIFIED=0]="EVENT_STATUS_UNSPECIFIED";e[e.EVENT_STATUS_PENDING=1]="EVENT_STATUS_PENDING";e[e.EVENT_STATUS_RUNNING=2]="EVENT_STATUS_RUNNING";e[e.EVENT_STATUS_COMPLETED=3]="EVENT_STATUS_COMPLETED";e[e.EVENT_STATUS_PAUSED=4]="EVENT_STATUS_PAUSED";e[e.EVENT_STATUS_FAILED=5]="EVENT_STATUS_FAILED"}(ae||(ae={})),function(e){e[e.UnknownTask=0]="UnknownTask";e[e.SubagentTask=1]="SubagentTask";e[e.CronTask=2]="CronTask";e[e.MobileUseTask=3]="MobileUseTask";e[e.BrowserUseTask=4]="BrowserUseTask";e[e.ComputerUseTask=5]="ComputerUseTask"}(re||(re={})),function(e){e[e.Owner=1]="Owner";e[e.Member=10]="Member"}(ne||(ne={})),function(e){e[e.User=1]="User";e[e.Agent=2]="Agent"}(oe||(oe={})),function(e){e[e.Unread=1]="Unread";e[e.Read=2]="Read";e[e.Overdue=3]="Overdue"}(ce||(ce={})),function(e){e[e.Chat=1]="Chat"}(le||(le={})),function(e){e[e.All=0]="All";e[e.Private=1]="Private";e[e.NormalProject=2]="NormalProject";e[e.VideoProject=3]="VideoProject"}(de||(de={})),function(e){e[e.Common=1]="Common";e[e.Video=2]="Video"}(_e||(_e={})),function(e){e[e.History=0]="History";e[e.Private=1]="Private";e[e.Project=2]="Project"}(ue||(ue={})),function(e){e[e.Asset=1]="Asset";e[e.Material=2]="Material"}(pe||(pe={})),function(e){e[e.Running=1]="Running";e[e.Waiting=2]="Waiting";e[e.Terminated=3]="Terminated";e[e.Finish=4]="Finish"}(he||(he={})),function(e){e[e.PENDING=0]="PENDING";e[e.RUNNING=1]="RUNNING";e[e.COMPLETED=2]="COMPLETED";e[e.FAILED=3]="FAILED";e[e.INTERRUPTED=4]="INTERRUPTED";e[e.CANCELLED=5]="CANCELLED";e[e.TIMEOUT=6]="TIMEOUT";e[e.RESUMED=7]="RESUMED"}(me||(me={})),function(e){e[e.PENDING=0]="PENDING";e[e.RUNNING=1]="RUNNING";e[e.COMPLETED=2]="COMPLETED";e[e.FAILED=3]="FAILED";e[e.INTERRUPTED=4]="INTERRUPTED";e[e.RESUMED=5]="RESUMED";e[e.CANCELLED=6]="CANCELLED"}(ge||(ge={})),function(e){e[e.Managed=1]="Managed";e[e.Cloud=2]="Cloud";e[e.Local=3]="Local"}(Ee||(Ee={})),function(e){e[e.AgentFrameworkCozeClaw=0]="AgentFrameworkCozeClaw";e[e.AgentFrameworkClaudeCode=1]="AgentFrameworkClaudeCode";e[e.AgentFrameworkCodex=2]="AgentFrameworkCodex";e[e.AgentFrameworkOpenClaw=3]="AgentFrameworkOpenClaw"}(we||(we={})),function(e){e[e.Offline=0]="Offline";e[e.Online=1]="Online";e[e.Busy=2]="Busy";e[e.Starting=3]="Starting";e[e.Error=4]="Error"}(fe||(fe={})),function(e){e[e.CreateModeTemplate=1]="CreateModeTemplate";e[e.CreateModeCloudThirdParty=2]="CreateModeCloudThirdParty";e[e.CreateModeLocalThirdParty=3]="CreateModeLocalThirdParty"}(Te||(Te={})),function(e){e[e.ACCOUNT_QUOTA_ZERO=1]="ACCOUNT_QUOTA_ZERO";e[e.MOBILE_LIMIT_EXCEEDED=2]="MOBILE_LIMIT_EXCEEDED"}(Se||(Se={})),function(e){e[e.Terminate=1]="Terminate"}(Re||(Re={})),function(e){e[e.CANCEL=1]="CANCEL"}(Pe||(Pe={})),function(e){e[e.Success=1]="Success";e[e.Failed=2]="Failed";e[e.Timeout=3]="Timeout"}(Ae||(Ae={})),function(e){e[e.Init=1]="Init";e[e.Online=2]="Online";e[e.Busy=3]="Busy";e[e.Offline=4]="Offline";e[e.Error=5]="Error"}(Ie||(Ie={})),function(e){e[e.Unset=0]="Unset";e[e.Disabled=1]="Disabled";e[e.Enabled=2]="Enabled"}(Ue||(Ue={})),function(e){e[e.PENDING=0]="PENDING";e[e.APPROVED=1]="APPROVED";e[e.REJECTED=2]="REJECTED"}(Le||(Le={})),function(e){e[e.IDLE=1]="IDLE";e[e.INTERRUPTED=2]="INTERRUPTED";e[e.REBOOTING=3]="REBOOTING";e[e.INITIALIZING=4]="INITIALIZING";e[e.ARREARS=5]="ARREARS";e[e.RUNNING=6]="RUNNING";e[e.RESERVED=7]="RESERVED";e[e.SCALING=8]="SCALING";e[e.ASSIGN_FAILED=9]="ASSIGN_FAILED";e[e.BUSY=10]="BUSY"}(Ce||(Ce={})),function(e){e[e.PHONE_8C24G=1]="PHONE_8C24G";e[e.PHONE_4C12G=2]="PHONE_4C12G";e[e.PHONE_2C6G=3]="PHONE_2C6G";e[e.PC_2C4G=101]="PC_2C4G";e[e.PC_4C8G=102]="PC_4C8G";e[e.PC_8C16G=103]="PC_8C16G";e[e.PC_16C32G=104]="PC_16C32G";e[e.PC_32C64G=105]="PC_32C64G"}(Oe||(Oe={})),function(e){e[e.MOBILE=1]="MOBILE";e[e.COMPUTER=2]="COMPUTER"}(ve||(ve={})),function(e){e[e.SUBSCRIBING=0]="SUBSCRIBING";e[e.BOOTING=1]="BOOTING";e[e.REBOOTING=2]="REBOOTING";e[e.IDLE=3]="IDLE";e[e.BUSY=4]="BUSY";e[e.INTERRUPTED=5]="INTERRUPTED";e[e.RELEASING=6]="RELEASING";e[e.RELEASED=7]="RELEASED";e[e.OFFLINE=8]="OFFLINE";e[e.ARREARS=9]="ARREARS";e[e.RESERVED=10]="RESERVED";e[e.SCALING=11]="SCALING";e[e.ASSIGN_FAILED=12]="ASSIGN_FAILED"}(ye||(ye={})),function(e){e[e.HEALTHY=1]="HEALTHY";e[e.WARNING=2]="WARNING";e[e.CRITICAL=3]="CRITICAL"}(Be||(Be={})),function(e){e[e.AVAILABLE=1]="AVAILABLE";e[e.NEED_UPGRADE_PLAN=2]="NEED_UPGRADE_PLAN";e[e.NOT_ALLOWED_DOWNGRADE=3]="NOT_ALLOWED_DOWNGRADE";e[e.CURRENT_SPEC=4]="CURRENT_SPEC"}(be||(be={})),function(e){e[e.Send=1]="Send";e[e.Received=2]="Received";e[e.Spam=3]="Spam"}(ze||(ze={})),function(e){e[e.Normal=0]="Normal";e[e.Spoof=1]="Spoof";e[e.Phishing=2]="Phishing";e[e.Spam=3]="Spam";e[e.Malicious=4]="Malicious"}(De||(De={})),function(e){e[e.Normal=0]="Normal";e[e.Sending=1]="Sending";e[e.Failed=2]="Failed"}(Ne||(Ne={})),function(e){e[e.FILE_PARTITION_UNSPECIFIED=0]="FILE_PARTITION_UNSPECIFIED";e[e.FILE_PARTITION_USER_MEMORY=1]="FILE_PARTITION_USER_MEMORY";e[e.FILE_PARTITION_AGENT_ALL=2]="FILE_PARTITION_AGENT_ALL";e[e.FILE_PARTITION_USER_ALL=3]="FILE_PARTITION_USER_ALL";e[e.FILE_PARTITION_TRASH=9]="FILE_PARTITION_TRASH"}(qe||(qe={})),function(e){e[e.FILE_TAG_UNSPECIFIED=0]="FILE_TAG_UNSPECIFIED";e[e.FILE_TAG_FAVORITE=1]="FILE_TAG_FAVORITE";e[e.FILE_TAG_MEMORY=2]="FILE_TAG_MEMORY";e[e.FILE_TAG_TRASH=3]="FILE_TAG_TRASH"}(ke||(ke={})),function(e){e[e.FILE_TYPE_UNSPECIFIED=0]="FILE_TYPE_UNSPECIFIED";e[e.FILE_TYPE_FAVORITE=1]="FILE_TYPE_FAVORITE";e[e.FILE_TYPE_TEMPLATE=2]="FILE_TYPE_TEMPLATE";e[e.FILE_TYPE_TEMPLATE_COVER=3]="FILE_TYPE_TEMPLATE_COVER";e[e.FILE_TYPE_PLAN_TEMPLATE=4]="FILE_TYPE_PLAN_TEMPLATE";e[e.FILE_TYPE_ARTICLE=5]="FILE_TYPE_ARTICLE"}(Fe||(Fe={})),function(e){e[e.FOLDER_ARCHIVE_STATUS_UNSPECIFIED=0]="FOLDER_ARCHIVE_STATUS_UNSPECIFIED";e[e.FOLDER_ARCHIVE_STATUS_PENDING=1]="FOLDER_ARCHIVE_STATUS_PENDING";e[e.FOLDER_ARCHIVE_STATUS_RUNNING=2]="FOLDER_ARCHIVE_STATUS_RUNNING";e[e.FOLDER_ARCHIVE_STATUS_SUCCEEDED=3]="FOLDER_ARCHIVE_STATUS_SUCCEEDED";e[e.FOLDER_ARCHIVE_STATUS_FAILED=4]="FOLDER_ARCHIVE_STATUS_FAILED";e[e.FOLDER_ARCHIVE_STATUS_REJECTED=5]="FOLDER_ARCHIVE_STATUS_REJECTED";e[e.FOLDER_ARCHIVE_STATUS_EXPIRED=6]="FOLDER_ARCHIVE_STATUS_EXPIRED"}(Ge||(Ge={})),function(e){e[e.WORKSPACE_SEARCH_TAB_UNSPECIFIED=0]="WORKSPACE_SEARCH_TAB_UNSPECIFIED";e[e.WORKSPACE_SEARCH_TAB_ALL=1]="WORKSPACE_SEARCH_TAB_ALL";e[e.WORKSPACE_SEARCH_TAB_DOC=2]="WORKSPACE_SEARCH_TAB_DOC";e[e.WORKSPACE_SEARCH_TAB_SHEET=3]="WORKSPACE_SEARCH_TAB_SHEET";e[e.WORKSPACE_SEARCH_TAB_PPT=4]="WORKSPACE_SEARCH_TAB_PPT";e[e.WORKSPACE_SEARCH_TAB_IMAGE=5]="WORKSPACE_SEARCH_TAB_IMAGE";e[e.WORKSPACE_SEARCH_TAB_WEB=6]="WORKSPACE_SEARCH_TAB_WEB";e[e.WORKSPACE_SEARCH_TAB_VIDEO=7]="WORKSPACE_SEARCH_TAB_VIDEO";e[e.WORKSPACE_SEARCH_TAB_PODCAST=8]="WORKSPACE_SEARCH_TAB_PODCAST"}(je||(je={})),function(e){e[e.Chat=1]="Chat";e[e.ApiTemplate=2]="ApiTemplate"}(xe||(xe={})),function(e){e[e.User=1]="User";e[e.Agent=2]="Agent";e[e.Project=3]="Project"}(Me||(Me={})),function(e){e[e.Grant=1]="Grant";e[e.Revoke=2]="Revoke";e[e.UpdateScope=3]="UpdateScope"}(He||(He={})),function(e){e[e.Single=1]="Single";e[e.Desktop=2]="Desktop";e[e.All=3]="All"}(We||(We={})),function(e){e[e.Session=1]="Session";e[e.Agent=2]="Agent"}(Ve||(Ve={})),function(e){e[e.PDF=1]="PDF";e[e.PPT=2]="PPT";e[e.ImageEditablePpt=3]="ImageEditablePpt"}($e||($e={})),function(e){e[e.PDF=1]="PDF";e[e.DOCX=2]="DOCX"}(Ye||(Ye={})),function(e){e[e.POSITION=0]="POSITION";e[e.ELEMENT=1]="ELEMENT"}(Ze||(Ze={})),function(e){e[e.STORAGE_RESOURCE_TYPE_UNSPECIFIED=0]="STORAGE_RESOURCE_TYPE_UNSPECIFIED";e[e.STORAGE_RESOURCE_TYPE_AGENT=1]="STORAGE_RESOURCE_TYPE_AGENT";e[e.STORAGE_RESOURCE_TYPE_PROJECT=2]="STORAGE_RESOURCE_TYPE_PROJECT";e[e.STORAGE_RESOURCE_TYPE_VIDEO_PROJECT=3]="STORAGE_RESOURCE_TYPE_VIDEO_PROJECT";e[e.STORAGE_RESOURCE_TYPE_CODING_PROJECT=4]="STORAGE_RESOURCE_TYPE_CODING_PROJECT"}(Je||(Je={})),function(e){e[e.ACCOUNT_QUOTA_ZERO=1]="ACCOUNT_QUOTA_ZERO";e[e.RESOURCE_LIMIT_EXCEEDED=2]="RESOURCE_LIMIT_EXCEEDED"}(Ke||(Ke={})),function(e){e[e.MOBILE=1]="MOBILE";e[e.COMPUTER=2]="COMPUTER"}(Xe||(Xe={})),function(e){e[e.Delete=1]="Delete";e[e.Read=2]="Read";e[e.ClearAt=3]="ClearAt";e[e.Hide=4]="Hide"}(Qe||(Qe={})),function(e){e[e.Delete=0]="Delete";e[e.Running=1]="Running";e[e.Idle=2]="Idle"}(et||(et={})),function(e){e[e.Pin=1]="Pin";e[e.Unpin=2]="Unpin";e[e.Delete=3]="Delete"}(tt||(tt={})),function(e){e[e.Running=1]="Running";e[e.Idle=2]="Idle"}(st||(st={})),function(e){e[e.Valid=1]="Valid";e[e.Delete=2]="Delete"}(it||(it={}));class rt{__init(){this.request=a.request}__init2(){this.baseURL=""}constructor(e){rt.prototype.__init.call(this),rt.prototype.__init2.call(this),this.request=at([e,"optionalAccess",e=>e.request])||this.request,this.baseURL=at([e,"optionalAccess",e=>e.baseURL])||this.baseURL}genBaseURL(e){return"string"==typeof this.baseURL?this.baseURL+e:this.baseURL(e)}ListMessage(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/message/list"),a={session_id:s.session_id,cursor:s.cursor,size:s.size,asc_mode:s.asc_mode,need_reference:s.need_reference,conversation_id:s.conversation_id};return this.request({url:i,method:"POST",data:a},t)}ListSession(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/session/list"),a={claw_id:s.claw_id,limit:s.limit,offset:s.offset,is_pin:s.is_pin,order_by:s.order_by};return this.request({url:i,method:"POST",data:a},t)}ListProcess(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/process/list"),a={claw_id:s.claw_id,size:s.size,cursor:s.cursor};return this.request({url:i,method:"POST",data:a},t)}OperateSession(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/session/operate"),a={session_id:s.session_id,operate_type:s.operate_type,conversation_id:s.conversation_id};return this.request({url:i,method:"POST",data:a},t)}UpdateSession(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/session/update"),a={session_id:s.session_id,name:s.name,is_pin:s.is_pin};return this.request({url:i,method:"POST",data:a},t)}Chat(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/message/chat"),a={session_id:s.session_id,content:s.content,files:s.files,skill_ids:s.skill_ids,reference_message_id:s.reference_message_id,at_members:s.at_members,conversation_id:s.conversation_id,video_option:s.video_option};return this.request({url:i,method:"POST",data:a},t)}CreateMessageShare(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/message/create_share"),a={session_id:s.session_id,message_ids:s.message_ids,share_file:s.share_file};return this.request({url:i,method:"POST",data:a},t)}CreateSession(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/session/create"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}GetMainSession(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/session/get_main"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}EmailList(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/email/list"),a={claw_id:s.claw_id,email_type:s.email_type,contact_address:s.contact_address,size:s.size,cursor:s.cursor};return this.request({url:i,method:"POST",data:a},t)}CreateMailAddress(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/email/create_address"),a={claw_id:s.claw_id,address:s.address};return this.request({url:i,method:"POST",data:a},t)}BatchGetEmails(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/email/batch"),a={claw_id:s.claw_id,email_ids:s.email_ids};return this.request({url:i,method:"POST",data:a},t)}GetMailAddressInfo(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/email/get_address"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}UpdateUserClawInfo(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/claw/update_info"),a={claw_id:s.claw_id,file_name:s.file_name,file_content:s.file_content,model_name:s.model_name};return this.request({url:i,method:"POST",data:a},t)}ReceivedCallback(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/email/received_callback"),a={app_id:s.app_id,app_email:s.app_email,mail_id:s.mail_id,ouid:s.ouid,mail_message:s.mail_message,create_time:s.create_time};return this.request({url:i,method:"POST",data:a},t)}ListChannel(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/channel/list"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}GetUrl(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/resource/get_url"),a={uris:s.uris,share_id:s.share_id};return this.request({url:i,method:"POST",data:a},t)}GetUserClawInfo(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/claw/info"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}CalendarQueryRange(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/calendar/query_range"),a={start_date:s.start_date,end_date:s.end_date,timezone:s.timezone,claw_id:s.claw_id};return this.request({url:i,method:"GET",params:a},t)}GetRecentFiles(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/recent"),a={limit:s.limit,claw_id:s.claw_id,project_id:s.project_id};return this.request({url:i,method:"GET",params:a},t)}FileUpload(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/upload"),a={file_name:s.file_name,file_content:s.file_content,file_type:s.file_type,tags:s.tags,claw_id:s.claw_id,session_id:s.session_id,project_id:s.project_id,project_dir:s.project_dir};return this.request({url:i,method:"POST",data:a},t)}GetFileTree(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/tree"),a={partition:s.partition,depth:s.depth,claw_id:s.claw_id};return this.request({url:i,method:"GET",params:a},t)}ListFiles(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/list"),a={tag:s.tag,limit:s.limit,offset:s.offset,sort_by:s.sort_by,sort_order:s.sort_order,claw_id:s.claw_id,project_id:s.project_id};return this.request({url:i,method:"GET",params:a},t)}GetFrontierKey(e,t){const s=this.genBaseURL("/api/coze_claw/resource/get_frontier_key");return this.request({url:s,method:"GET"},t)}GetContacts(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/email/get_contacts"),a={claw_id:s.claw_id,size:s.size,cursor:s.cursor};return this.request({url:i,method:"POST",data:a},t)}CalendarBatchGetEvents(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/calendar/batch_get_events"),a={uids:s.uids,claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}UpdateFile(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/update"),a={file_path:s.file_path,file_content:s.file_content,claw_id:s.claw_id,file_uri:s.file_uri,project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}GetFileVersions(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/versions"),a={file_path:s.file_path,claw_id:s.claw_id,file_uri:s.file_uri};return this.request({url:i,method:"GET",params:a},t)}GetSessionInfo(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/session/get_info"),a={session_id:s.session_id};return this.request({url:i,method:"POST",data:a},t)}GetMobileSTSCredentials(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/mobile/sts_credentials"),a={pod_id:s.pod_id};return this.request({url:i,method:"GET",params:a},t)}ListMobileTask(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/mobile/list_task"),a={size:s.size,cursor:s.cursor};return this.request({url:i,method:"POST",data:a},t)}FileSearch(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/search"),a={keyword:s.keyword,file_type:s.file_type,tags:s.tags,trash_only:s.trash_only,partition:s.partition,sort_by:s.sort_by,sort_order:s.sort_order,page_size:s.page_size,page_token:s.page_token,claw_id:s.claw_id,project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}OperateMobileTask(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/mobile/operate_task"),a={mobile_task_id:s.mobile_task_id,action:s.action,reason:s.reason};return this.request({url:i,method:"POST",data:a},t)}Reset(e,t){const s=this.genBaseURL("/api/coze_claw/resource/reset");return this.request({url:s,method:"POST"},t)}ListMobile(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/mobile/list"),a={mobile_ids:s.mobile_ids};return this.request({url:i,method:"GET",params:a},t)}EmailSendCallback(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/email/send_callback"),a={otid:s.otid,ouid:s.ouid,mail_id:s.mail_id,message_id:s.message_id,time_stamp:s.time_stamp,from_address:s.from_address,recipient_address:s.recipient_address,event:s.event,src_ip:s.src_ip,return_code:s.return_code,return_msg:s.return_msg,last_update_time_stamp:s.last_update_time_stamp,delivery_error_classify:s.delivery_error_classify};return this.request({url:i,method:"POST",data:a},t)}UnsubscribeMobile(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/mobile/unsubscribe"),a={mobile_id:s.mobile_id};return this.request({url:i,method:"POST",data:a},t)}SubscribeMobile(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/mobile/subscribe"),a={name:s.name};return this.request({url:i,method:"POST",data:a},t)}OperateMobile(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/mobile/operate"),a={mobile_id:s.mobile_id,action:s.action,reason:s.reason,new_name:s.new_name};return this.request({url:i,method:"POST",data:a},t)}CalendarListRecurringEvents(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/calendar/list_recurring_events"),a={claw_id:s.claw_id};return this.request({url:i,method:"GET",params:a},t)}CalendarGetEventDebugURL(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/calendar/get_event_debug_url"),a={calendar_event_uid:s.calendar_event_uid,instance_start:s.instance_start};return this.request({url:i,method:"GET",params:a},t)}GetFeishuAuthInfo(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/channel/feishu/auth_info"),a={claw_id:s.claw_id,bot_name:s.bot_name,redirect_url:s.redirect_url};return this.request({url:i,method:"POST",data:a},t)}ExchangeFeishuAuthCode(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/channel/feishu/exchange_code"),a={code:s.code,verify_state:s.verify_state};return this.request({url:i,method:"POST",data:a},t)}FeishuAuthCallback(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/channel/feishu/auth_callback"),a={code:s.code,verify_state:s.verify_state};return this.request({url:i,method:"POST",data:a},t)}CancelFeishuAuth(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/channel/feishu/cancel_auth"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}ApiTemplate(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/image/api_template"),a={session_id:s.session_id,prompt:s.prompt,files:s.files,type:s.type};return this.request({url:i,method:"POST",data:a},t)}CreateFeishuApp(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/channel/feishu/create_app"),a={claw_id:s.claw_id,bot_name:s.bot_name,recreate:s.recreate};return this.request({url:i,method:"POST",data:a},t)}GetWebUrl(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/resource/get_web_url"),a={original_url:s.original_url,exchange_for_short_url:s.exchange_for_short_url,exchange_for_qr_code:s.exchange_for_qr_code,exchange_for_long_url:s.exchange_for_long_url};return this.request({url:i,method:"GET",params:a},t)}CalendarDelete(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/calendar/delete"),a={uid:s.uid,instance_start:s.instance_start,claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}CalendarResume(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/calendar/resume"),a={uid:s.uid,instance_start:s.instance_start,claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}CalendarPause(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/calendar/pause"),a={uid:s.uid,instance_start:s.instance_start,claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}DetailMobile(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/mobile/detail"),a={mobile_id:s.mobile_id};return this.request({url:i,method:"GET",params:a},t)}MGetMessage(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/message/mget"),a={session_id:s.session_id,message_ids:s.message_ids};return this.request({url:i,method:"POST",data:a},t)}GenCover(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/resource/gen_cover"),a={original_file_uri:s.original_file_uri,resolution:s.resolution,mode:s.mode,selector_str:s.selector_str,claw_id:s.claw_id,project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}GenDoc(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/resource/gen_doc"),a={target_file_type:s.target_file_type,original_file_uri:s.original_file_uri,resource_map:s.resource_map,claw_id:s.claw_id,project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}ShareDocs(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/message/share_docs"),a={uris:s.uris};return this.request({url:i,method:"POST",data:a},t)}TerminateProcess(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/process/terminate"),a={claw_id:s.claw_id,process_id:s.process_id};return this.request({url:i,method:"POST",data:a},t)}SearchMessage(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/message/search_message"),a={session_id:s.session_id,query:s.query,limit:s.limit};return this.request({url:i,method:"POST",data:a},t)}WorkspaceSearch(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/workspace_search"),a={keyword:s.keyword,tab:s.tab,page_size:s.page_size,page_token:s.page_token,session_id:s.session_id,claw_id:s.claw_id,project_id:s.project_id};return this.request({url:i,method:"GET",params:a},t)}ExportPPT(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/resource/export_ppt"),a={source_uri:s.source_uri,export_type:s.export_type};return this.request({url:i,method:"POST",data:a},t)}CreateFolderArchive(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/archive/create"),a={claw_id:s.claw_id,file_path:s.file_path,partition:s.partition,project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}GetFolderArchiveStatus(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/archive/status"),a={claw_id:s.claw_id,job_id:s.job_id,project_id:s.project_id};return this.request({url:i,method:"GET",params:a},t)}GetSandboxToken(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/browser_use/get_sandbox_token"),a={session_id:s.session_id,claw_id:s.claw_id,session_key:s.session_key,computer_id:s.computer_id};return this.request({url:i,method:"POST",data:a},t)}OperateBrowserUse(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/browser_use/operate"),a={session_id:s.session_id,claw_id:s.claw_id,action:s.action};return this.request({url:i,method:"POST",data:a},t)}ListBrowserUseMessage(e,t){const s=this.genBaseURL("/api/coze_claw/browser_use/list_message");return this.request({url:s,method:"GET"},t)}IntentRecognition(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/image/intent_recognition"),a={session_id:s.session_id,files:s.files,query:s.query};return this.request({url:i,method:"POST",data:a},t)}RestoreFileVersion(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/versions/restore"),a={file_path:s.file_path,claw_id:s.claw_id,file_uri:s.file_uri,version_id:s.version_id};return this.request({url:i,method:"POST",data:a},t)}GetFileVersionURL(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/versions/url"),a={file_path:s.file_path,claw_id:s.claw_id,file_uri:s.file_uri,version_id:s.version_id};return this.request({url:i,method:"GET",params:a},t)}ExportPPTSandbox(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/resource/export_ppt_sandbox"),a={sandbox_identity_ticket:s.sandbox_identity_ticket,html_content:s.html_content,title:s.title,export_type:s.export_type};return this.request({url:i,method:"POST",data:a},t)}CheckSubscribe(e,t){const s=this.genBaseURL("/api/coze_claw/mobile/check_subscribe");return this.request({url:s,method:"GET"},t)}GetMessageShare(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/message/get_share"),a={share_id:s.share_id,need_reference:s.need_reference};return this.request({url:i,method:"POST",data:a},t)}GetModelConfig(e,t){const s=this.genBaseURL("/api/coze_claw/resource/get_model_config");return this.request({url:s,method:"POST"},t)}CheckResourceSubscribe(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/resource/check_subscribe"),a={resource_types:s.resource_types};return this.request({url:i,method:"GET",params:a},t)}UnsubscribeComputer(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/computer/unsubscribe"),a={computer_id:s.computer_id};return this.request({url:i,method:"POST",data:a},t)}ListComputer(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/computer/list"),a={computer_ids:s.computer_ids};return this.request({url:i,method:"GET",params:a},t)}SubscribeComputer(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/computer/subscribe"),a={name:s.name};return this.request({url:i,method:"POST",data:a},t)}OperateComputer(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/computer/operate"),a={computer_id:s.computer_id,action:s.action,new_name:s.new_name};return this.request({url:i,method:"POST",data:a},t)}WechatBindWait(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/channel/wechat/bind_wait"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}WechatWebhook(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/wechat/webhook"),a={app_id:s.app_id,wechat_messages:s.wechat_messages};return this.request({url:i,method:"POST",data:a},t)}WechatBindStart(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/channel/wechat/bind_start"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}WechatUnbind(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/channel/wechat/unbind"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}OperateVideoTask(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/video/operate_task"),a={video_task_id:s.video_task_id,action:s.action,claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}ListVideoTask(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/video/list_task"),a={size:s.size,cursor:s.cursor,claw_id:s.claw_id};return this.request({url:i,method:"GET",params:a},t)}WechatUnbindInternal(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/channel/wechat/unbind_internal"),a={app_id:s.app_id};return this.request({url:i,method:"POST",data:a},t)}GetEmailSettings(e,t){const s=this.genBaseURL("/api/coze_claw/email/get_settings");return this.request({url:s,method:"POST"},t)}GetFileTreeV2(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/tree_v2"),a={partition:s.partition,depth:s.depth,claw_id:s.claw_id,file_path:s.file_path,project_id:s.project_id};return this.request({url:i,method:"GET",params:a},t)}SandboxSkillHubAdd(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/skill/skill_hub_add"),a={sandbox_identity_ticket:s.sandbox_identity_ticket,skill_id:s.skill_id,agent_id:s.agent_id};return this.request({url:i,method:"POST",data:a},t)}SandboxSkillHubShopSearch(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/skill/skill_hub_shop_search"),a={sandbox_identity_ticket:s.sandbox_identity_ticket,keyword:s.keyword};return this.request({url:i,method:"POST",data:a},t)}GetStorageUsage(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/resource/storage_usage"),a={claw_id:s.claw_id,project_id:s.project_id};return this.request({url:i,method:"GET",params:a},t)}MobileScreenShot(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/mobile/screenshot"),a={mobile_id:s.mobile_id};return this.request({url:i,method:"GET",params:a},t)}OperateComputerTask(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/computer/operate_task"),a={run_id:s.run_id,action:s.action};return this.request({url:i,method:"POST",data:a},t)}ListComputerTask(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/computer/list_task"),a={size:s.size,cursor:s.cursor};return this.request({url:i,method:"POST",data:a},t)}ListClaw(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project/list_claw"),a={project_id:s.project_id,limit:s.limit,cursor:s.cursor};return this.request({url:i,method:"POST",data:a},t)}ListProject(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project/list"),a={type:s.type,limit:s.limit,offset:s.offset,is_pin:s.is_pin};return this.request({url:i,method:"POST",data:a},t)}RemoveProjectMember(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project_member/remove"),a={project_id:s.project_id,project_member:s.project_member};return this.request({url:i,method:"POST",data:a},t)}UpdateInviteProjectUser(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project_invite/update"),a={project_id:s.project_id,is_accept:s.is_accept};return this.request({url:i,method:"POST",data:a},t)}CreateProject(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project/create"),a={claw_ids:s.claw_ids,name:s.name,source_message_ids:s.source_message_ids,source_msg_id:s.source_msg_id,sub_type:s.sub_type};return this.request({url:i,method:"POST",data:a},t)}InviteProjectUser(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project_invite/invite"),a={project_id:s.project_id,invite_member:s.invite_member,invite_agent:s.invite_agent};return this.request({url:i,method:"POST",data:a},t)}DeleteProject(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project/delete"),a={project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}AddProjectMember(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project_member/add"),a={project_id:s.project_id,members:s.members};return this.request({url:i,method:"POST",data:a},t)}CreateClaw(e,t){const s=this.genBaseURL("/api/coze_claw/project/create_claw");return this.request({url:s,method:"POST"},t)}UpdateProject(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project/update"),a={project_id:s.project_id,name:s.name,description:s.description,is_pin:s.is_pin};return this.request({url:i,method:"POST",data:a},t)}LeaveProject(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project_member/leave"),a={project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}GetDeviceCreatePreflight(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/device/create/preflight"),a={cloud_device_type:s.cloud_device_type,cloud_device_id:s.cloud_device_id,enterprise_id:s.enterprise_id};return this.request({url:i,method:"GET",params:a},t)}ListInvitedProject(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project_invite/list_project"),a={limit:s.limit,offset:s.offset};return this.request({url:i,method:"POST",data:a},t)}ListProjectInvitee(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project_invite/list_invitee"),a={project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}GetGlobalFileTree(e,t){const s=this.genBaseURL("/api/coze_claw/file/global_tree");return this.request({url:s,method:"GET"},t)}EnterpriseGetDeviceStats(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/stats"),a={enterprise_id:s.enterprise_id};return this.request({url:i,method:"GET",params:a},t)}ListBackgroundSession(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/session/list_background"),a={session_id:s.session_id,filter_running:s.filter_running,cursor:s.cursor,size:s.size};return this.request({url:i,method:"POST",data:a},t)}EnterpriseListMyDevice(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/my"),a={cursor:s.cursor,page_size:s.page_size,enterprise_id:s.enterprise_id};return this.request({url:i,method:"GET",params:a},t)}EnterpriseGetAutoApprove(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/auto_approve"),a={enterprise_id:s.enterprise_id};return this.request({url:i,method:"GET",params:a},t)}EnterpriseAssignDevice(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/assign"),a={cloud_device_id:s.cloud_device_id,target_user_uid:s.target_user_uid,organization_id:s.organization_id,cloud_device_type:s.cloud_device_type,enterprise_id:s.enterprise_id};return this.request({url:i,method:"POST",data:a},t)}GetPairResult(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/get_pair_result"),a={pair_code:s.pair_code};return this.request({url:i,method:"POST",data:a},t)}GetAgentStatus(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/get_status"),a={agent_ids:s.agent_ids};return this.request({url:i,method:"POST",data:a},t)}GetGlobalStorageUsage(e,t){const s=this.genBaseURL("/api/coze_claw/resource/global_storage_usage");return this.request({url:s,method:"GET"},t)}EnterpriseClaimDevice(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/claim"),a={devices:s.devices,enterprise_id:s.enterprise_id};return this.request({url:i,method:"POST",data:a},t)}EnterpriseEditDevice(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/edit"),a={cloud_device_id:s.cloud_device_id,device_name:s.device_name,spec:s.spec,confirm_price_change:s.confirm_price_change,cloud_device_type:s.cloud_device_type,enterprise_id:s.enterprise_id};return this.request({url:i,method:"POST",data:a},t)}SubscribeDevice(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/device/subscribe"),a={cloud_device_type:s.cloud_device_type,spec:s.spec,name:s.name};return this.request({url:i,method:"POST",data:a},t)}ChangeDeviceSpec(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/device/change_spec"),a={cloud_device_type:s.cloud_device_type,cloud_device_id:s.cloud_device_id,target_spec:s.target_spec,name:s.name};return this.request({url:i,method:"POST",data:a},t)}EnterpriseListDeviceClaimRecord(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/claim/list"),a={cursor:s.cursor,page_size:s.page_size,status:s.status,keyword:s.keyword,enterprise_id:s.enterprise_id};return this.request({url:i,method:"GET",params:a},t)}GeneratePairCode(e,t){const s=this.genBaseURL("/api/coze_claw/agent/generate_pair_code");return this.request({url:s,method:"POST"},t)}EnterpriseRejectDeviceClaim(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/claim/reject"),a={claim_record_id:s.claim_record_id,reason:s.reason,enterprise_id:s.enterprise_id};return this.request({url:i,method:"POST",data:a},t)}EnterpriseDeleteDevice(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/delete"),a={cloud_device_id:s.cloud_device_id,cloud_device_type:s.cloud_device_type,enterprise_id:s.enterprise_id};return this.request({url:i,method:"POST",data:a},t)}EnterpriseApproveDeviceClaim(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/claim/approve"),a={claim_record_id:s.claim_record_id,enterprise_id:s.enterprise_id};return this.request({url:i,method:"POST",data:a},t)}EnterpriseListDevice(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/list"),a={cursor:s.cursor,page_size:s.page_size,keyword:s.keyword,cloud_device_type:s.cloud_device_type,status:s.status,enterprise_id:s.enterprise_id};return this.request({url:i,method:"GET",params:a},t)}EnterpriseListAvailableDevice(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/available"),a={cursor:s.cursor,page_size:s.page_size,enterprise_id:s.enterprise_id};return this.request({url:i,method:"GET",params:a},t)}CreateAgent(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/create"),a={agent_name:s.agent_name,create_mode:s.create_mode,template_id:s.template_id,target_device_id:s.target_device_id,framework:s.framework,pair_code:s.pair_code,local_agents:s.local_agents,description:s.description,icon:s.icon};return this.request({url:i,method:"POST",data:a},t)}ListDeviceAgents(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/agent/device/binding/list_by_device"),a={cloud_device_id:s.cloud_device_id,cloud_device_type:s.cloud_device_type,cursor:s.cursor,page_size:s.page_size};return this.request({url:i,method:"GET",params:a},t)}EnterpriseReassignDevice(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/reassign"),a={cloud_device_id:s.cloud_device_id,new_user_uid:s.new_user_uid,new_organization_id:s.new_organization_id,cloud_device_type:s.cloud_device_type,enterprise_id:s.enterprise_id};return this.request({url:i,method:"POST",data:a},t)}EnterpriseSetAutoApprove(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/auto_approve"),a={enabled:s.enabled,enterprise_id:s.enterprise_id};return this.request({url:i,method:"POST",data:a},t)}GetHotWords(e,t){const s=this.genBaseURL("/api/coze_claw/asr/get_hot_words");return this.request({url:s,method:"GET"},t)}GetModelList(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/resource/get_model_list"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}SelectModel(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/resource/select_model"),a={claw_id:s.claw_id,name:s.name};return this.request({url:i,method:"POST",data:a},t)}CreateSessionConversation(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/session_conversation/create"),a={session_id:s.session_id,name:s.name,description:s.description};return this.request({url:i,method:"POST",data:a},t)}OperateSessionConversation(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/session_conversation/operate"),a={session_conversation_id:s.session_conversation_id,operate_type:s.operate_type};return this.request({url:i,method:"POST",data:a},t)}MessageCardAction(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/message_card/action"),a={name:s.name,surface_id:s.surface_id,source_component_id:s.source_component_id,timestamp:s.timestamp,context:s.context,message_id:s.message_id,claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}UpdateSessionConversation(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/session_conversation/update"),a={session_conversation_id:s.session_conversation_id,name:s.name,description:s.description};return this.request({url:i,method:"POST",data:a},t)}ListConversation(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/conversation/list"),a={type:s.type,is_pin:s.is_pin,limit:s.limit,offset:s.offset,top_claw_id:s.top_claw_id};return this.request({url:i,method:"POST",data:a},t)}EnterpriseBatchCreateDevice(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/enterprise/device/batch_create"),a={cloud_device_type:s.cloud_device_type,device_name:s.device_name,spec:s.spec,quantity:s.quantity,enterprise_id:s.enterprise_id};return this.request({url:i,method:"POST",data:a},t)}ListSessionConversation(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/session_conversation/list"),a={session_id:s.session_id,limit:s.limit,offset:s.offset};return this.request({url:i,method:"POST",data:a},t)}GetAgentFileContent(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/file/content"),a={agent_id:s.agent_id,file_path:s.file_path,file_token:s.file_token};return this.request({url:i,method:"GET",params:a},t)}GetProjectInfo(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project/info"),a={project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}OperateDesktop(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/desktop/operate"),a={device_id:s.device_id,action:s.action,new_name:s.new_name};return this.request({url:i,method:"POST",data:a},t)}DesktopHeartbeat(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/desktop/heartbeat"),a={device_id:s.device_id,version:s.version,status:s.status,os:s.os,desktop_name:s.desktop_name};return this.request({url:i,method:"POST",data:a},t)}ReportDesktopCommandResult(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/desktop/report_command_result"),a={command_id:s.command_id,status:s.status,data:s.data,upload_file:s.upload_file};return this.request({url:i,method:"POST",data:a},t)}ListDesktop(e,t){const s=this.genBaseURL("/api/coze_claw/desktop/list");return this.request({url:s,method:"GET"},t)}SearchProject(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project/search"),a={type:s.type,keyword:s.keyword,limit:s.limit,cursor:s.cursor};return this.request({url:i,method:"GET",params:a},t)}GetProjectMembers(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project_member/list"),a={project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}UpdateAgent(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/update"),a={agent_id:s.agent_id,agent_name:s.agent_name,description:s.description,file_name:s.file_name,file_content:s.file_content};return this.request({url:i,method:"POST",data:a},t)}ListAgents(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/agent/list"),a={page_size:s.page_size,cursor:s.cursor,deploy_types:s.deploy_types,order_by:s.order_by};return this.request({url:i,method:"POST",data:a},t)}GetAgentDetail(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/detail"),a={agent_id:s.agent_id};return this.request({url:i,method:"POST",data:a},t)}ReconnectAgent(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/reconnect"),a={agent_id:s.agent_id,reason:s.reason};return this.request({url:i,method:"POST",data:a},t)}DisconnectAgent(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/disconnect"),a={agent_id:s.agent_id,reason:s.reason,force:s.force};return this.request({url:i,method:"POST",data:a},t)}GetCozeClawUserInfo(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/user/info"),a={need_onboarding_status:s.need_onboarding_status};return this.request({url:i,method:"POST",data:a},t)}SetCozeClawUserOnboardingStatus(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/user/set_onboarding_status"),a={onboarding_status:s.onboarding_status};return this.request({url:i,method:"POST",data:a},t)}GetGlobalUnread(e,t){const s=this.genBaseURL("/api/coze_claw/unread/get_total");return this.request({url:s,method:"POST"},t)}GenerateAgentName(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/agent/generate_name"),a={create_mode:s.create_mode,template_id:s.template_id,framework:s.framework};return this.request({url:i,method:"POST",data:a},t)}ListProjectFiles(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/project/file/list"),a={project_id:s.project_id,file_path:s.file_path,depth:s.depth};return this.request({url:i,method:"POST",data:a},t)}WriteProjectFile(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/project/file/write"),a={project_id:s.project_id,file_path:s.file_path,content:s.content};return this.request({url:i,method:"POST",data:a},t)}ReadProjectFile(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/project/file/read"),a={project_id:s.project_id,file_path:s.file_path,offset:s.offset,limit:s.limit};return this.request({url:i,method:"POST",data:a},t)}EditProjectFile(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/project/file/edit"),a={project_id:s.project_id,file_path:s.file_path,mode:s.mode,old_string:s.old_string,new_string:s.new_string,append_content:s.append_content};return this.request({url:i,method:"POST",data:a},t)}ComputerScreenShot(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/computer/screenshot"),a={computer_id:s.computer_id};return this.request({url:i,method:"GET",params:a},t)}CancelProjectInvite(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project_invite/cancel"),a={project_id:s.project_id,invite_member:s.invite_member};return this.request({url:i,method:"POST",data:a},t)}GenerateAgentIcon(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/generate_icon"),a={agent_name:s.agent_name,description:s.description};return this.request({url:i,method:"POST",data:a},t)}ListPermission(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/permission/list"),a={session_id:s.session_id};return this.request({url:i,method:"GET",params:a},t)}OperatePermission(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/permission/operate"),a={session_id:s.session_id,action:s.action,target:s.target,permission_id:s.permission_id,desktop_id:s.desktop_id,scope:s.scope,claw_id:s.claw_id,file_path:s.file_path};return this.request({url:i,method:"POST",data:a},t)}RepairAgent(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/repair"),a={agent_id:s.agent_id,reason:s.reason};return this.request({url:i,method:"POST",data:a},t)}ResetAgent(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/reset"),a={agent_id:s.agent_id,reason:s.reason};return this.request({url:i,method:"POST",data:a},t)}MGetConversation(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/conversation/mget"),a={session_ids:s.session_ids,option:s.option,claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}GetProjectByClawID(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project/get_by_claw_id"),a={claw_id:s.claw_id};return this.request({url:i,method:"POST",data:a},t)}GetDesktopCommand(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/desktop/get_command"),a={command_id:s.command_id};return this.request({url:i,method:"GET",params:a},t)}OperateVideoConversation(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/video/operate_conversation"),a={session_id:s.session_id,conversation_id:s.conversation_id,action:s.action};return this.request({url:i,method:"POST",data:a},t)}ValidateAgentName(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/validate_name"),a={agent_name:s.agent_name};return this.request({url:i,method:"POST",data:a},t)}GetLocalFileAccess(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/desktop/local_file_access"),a={device_id:s.device_id};return this.request({url:i,method:"GET",params:a},t)}UpdateLocalFileAccess(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/desktop/update_local_file_access"),a={device_id:s.device_id,status:s.status};return this.request({url:i,method:"POST",data:a},t)}AgentFileUpload(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/agent_upload"),a={file_name:s.file_name,file_content:s.file_content,file_type:s.file_type,tags:s.tags,agent_id:s.agent_id,session_id:s.session_id};return this.request({url:i,method:"POST",data:a},t)}SetNewFeaturePopupStatus(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/user/set_new_feature_popup_status"),a={new_feature_popup_status:s.new_feature_popup_status};return this.request({url:i,method:"POST",data:a},t)}DownloadFile(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/file/download"),a={file_url:s.file_url};return this.request({url:i,method:"GET",params:a},t)}DownloadImage(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/file/download_image"),a={file_content:s.file_content,file_name:s.file_name,file_uri:s.file_uri};return this.request({url:i,method:"POST",data:a},t)}ResetV2(e,t){const s=this.genBaseURL("/api/coze_claw/resource/reset_v2");return this.request({url:s,method:"POST"},t)}AgentWebSearch(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/web_search"),a={agent_id:s.agent_id,query_list:s.query_list,project_id:s.project_id};return this.request({url:i,method:"POST",data:a},t)}AgentWebFetch(e,t){const s=e,i=this.genBaseURL("/api/coze_claw/agent/web_fetch"),a={agent_id:s.agent_id,url:s.url,project_id:s.project_id,response_length:s.response_length};return this.request({url:i,method:"POST",data:a},t)}ListRecentInvitees(e,t){const s=e||{},i=this.genBaseURL("/api/coze_claw/project_invite/list_recent"),a={project_id:s.project_id,limit:s.limit,offset:s.offset};return this.request({url:i,method:"POST",data:a},t)}}const nt=new rt({});function ot(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}const ct=$e.PPT,lt=$e.ImageEditablePpt,dt=e=>e.replace(/\s+/g," ").trim(),_t=e=>dt(e.replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")),ut=e=>{const t=e.match(/<title[^>]*>([\s\S]*?)<\/title>/i),s=ot([t,"optionalAccess",e=>e[1]])?_t(t[1]):"";if(s)return s;const i=_t(e);return i?i.split(" ")[0]:void 0},pt=e=>{const t=(e=>{if(e.includes("\x3c!--SPLIT_HTML--\x3e"))return e.split("\x3c!--SPLIT_HTML--\x3e").map((e=>e.trim())).filter(Boolean);const t=e.match(/<html[\s\S]*?<\/html>/gi);return ot([t,"optionalAccess",e=>e.length])?t.map((e=>e.trim())).filter(Boolean):[e.trim()].filter(Boolean)})(e).map(((e,t)=>({page:t+1,title:ut(e),previewText:_t(e)})));return{type:"html",pageCount:t.length,pages:t}},ht=(e,t)=>{if(!(t.length>=80||void 0===e))if("string"!=typeof e)Array.isArray(e)?e.forEach((e=>ht(e,t))):e&&"object"==typeof e&&Object.entries(e).forEach((([e,s])=>{(["title","text","content","description","name"].includes(e)||Array.isArray(s)||s&&"object"==typeof s)&&ht(s,t)}));else{const s=dt(e);s&&t.push(s)}},mt=({api:e})=>async({fileUri:t,exportType:s="ppt"})=>{const i=await e.exportPPT({source_uri:t,export_type:"editable"===s?lt:ct});if(void 0!==i.code&&0!==i.code&&"0"!==i.code)throw new Z(i.msg||"Failed to export PPT","SESSION_PPT_EXPORT_FAILED");const a=ot([i,"access",e=>e.data,"optionalAccess",e=>e.url]);if(!a)throw new Z(i.msg||"PPT export response missing download URL","SESSION_PPT_EXPORT_FAILED");return{uri:ot([i,"access",e=>e.data,"optionalAccess",e=>e.uri]),url:a,exportType:s}};function gt(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}const Et=e=>{const t=String(e.id||"");if(!t)return null;const s="string"==typeof e.content?e.content:"",i=(r=s,a.safeJsonParse(r,void 0));var r;const n=gt([i,"optionalAccess",e=>e.message_data,"optionalAccess",e=>e.reply]),o=void 0===gt([i,"optionalAccess",e=>e.create_time_ms])?void 0:String(i.create_time_ms);return{messageId:t,sessionId:"string"==typeof gt([i,"optionalAccess",e=>e.session_id])?i.session_id:void 0,source:(c=e.source,1===Number(c)?"user":2===Number(c)?"agent":"unknown"),content:"string"==typeof gt([n,"optionalAccess",e=>e.content])&&n.content?n.content:s,files:Array.isArray(e.files)?e.files:void 0,createTime:"string"==typeof e.create_time?e.create_time:o,messageType:"string"==typeof gt([i,"optionalAccess",e=>e.message_type])?i.message_type:void 0,replyToMessageId:"string"==typeof gt([n,"optionalAccess",e=>e.reply_to_message_id])?n.reply_to_message_id:void 0,raw:e};var c};const wt=({api:e})=>async({fileUri:t})=>{const s=await e.getUrl({uris:[t]}),i=function(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}([s,"access",e=>e.data,"optionalAccess",e=>e.urls,"optionalAccess",e=>e[0]]);if(!i)throw new Z(s.msg||"Failed to resolve session file URL","SESSION_FILE_URL_FAILED");return i};const ft=async({formData:e,request:t})=>{e.append("file_name",t.fileName);const s=await(async e=>{if(e instanceof Blob)return e;if(Buffer.isBuffer(e))return new Blob([e]);if(e instanceof Uint8Array)return new Blob([e]);if(e instanceof ArrayBuffer)return new Blob([e]);if("string"==typeof e)return new Blob([e]);throw new TypeError("Unsupported session upload file content type")})(t.fileContent),i=(a=t.fileContent)instanceof Blob&&a.type?a.type:void 0;var a;const r=i&&s.type!==i?new Blob([s],{type:i}):s;e.append("file_content",r,t.fileName),e.append("claw_id",t.clawId),t.projectId&&e.append("project_id",t.projectId),t.projectDir&&e.append("project_dir",t.projectDir),t.sessionId&&e.append("session_id",t.sessionId)},Tt=({options:e,requestOptions:t})=>{const s={...(i=t.headers,a=()=>({}),null!=i?i:a())};var i,a;const r=(({baseUrl:e,webOrigin:t})=>{if(t)return t;try{return new URL(B(e)).origin}catch(e){return}})({baseUrl:e.baseUrl,webOrigin:e.webOrigin});return r&&(s.Origin=r),s.Referer=(({baseUrl:e,webOrigin:t})=>t?t.endsWith("/")?t:`${t}/`:B(e))({baseUrl:e.baseUrl,webOrigin:e.webOrigin}),e.xSpaceWebId&&(s["x-space-webid"]=e.xSpaceWebId),Object.assign(s,q(e.xTTEnv)),s},St=e=>async(t,s={})=>{const i=new URL("/api/coze_claw/file/upload",B(e.baseUrl)),r=new FormData;await ft({formData:r,request:t});const n=Tt({options:e,requestOptions:s}),o=a.customFetch.getRequestHeaders(i.toString(),{headers:n}),c=await globalThis.fetch(i.toString(),{method:"POST",headers:o,body:r});!function(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}}([s,"access",e=>e.onGetLogId,"optionalCall",e=>e(c.headers.get("x-tt-logid")||"")]);const l=await z(c,{});return D(c,l,{serviceName:"Session"}),l};const Rt=async({baseUrl:e,params:t,requestOptions:s={},responseFallback:i,xTTEnv:r})=>{const n=new URL(t.url,B(e));b(n,t.params);const o={"Content-Type":"application/json",...(c=s.headers,l=()=>({}),null!=c?c:l()),...q(r)};var c,l;const d=t.method.toUpperCase(),_="GET"===d?void 0:JSON.stringify(void 0===t.data?{}:t.data),u=await a.customFetch.fetch(n.toString(),{method:d,headers:o,body:_});!function(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}}([s,"access",e=>e.onGetLogId,"optionalCall",e=>e(N(u)||"")]);const p=await z(u,i);return D(u,p,{serviceName:"Session"}),p},Pt=e=>{const t=async(t,s={})=>await Rt({baseUrl:e.baseUrl,params:t,requestOptions:s,responseFallback:{},xTTEnv:e.xTTEnv}),s=new rt({baseURL:B(e.baseUrl),request:(e,s={})=>t(e,s)}),i=new rt({baseURL:B(e.baseUrl),request:(e,s={})=>t(e,s)});return{getUserClawInfo:(t,s)=>Rt({baseUrl:e.baseUrl,params:{url:"/api/coze_claw/claw/info",method:"POST",data:t},requestOptions:s,responseFallback:{},xTTEnv:e.xTTEnv}),createSession:(e,t)=>s.CreateSession(e,t),listSession:(e,t)=>s.ListSession(e,t),listMessage:(e,t)=>s.ListMessage(e,t),uploadFile:St(e),getWebUrl:(e,t)=>i.GetWebUrl(e,t),getUrl:(e,t)=>i.GetUrl(e,t),exportPPT:(e,t)=>i.ExportPPT(e,t),chat:(e,t)=>s.Chat(e,t),listProcess:(e,t)=>s.ListProcess(e,t)}},At=e=>{const t=Pt({baseUrl:e.sessionApiBaseUrl||e.apiBaseUrl,webOrigin:e.sessionApiBaseUrl||e.apiBaseUrl,xSpaceWebId:e.sessionSpaceWebId,xTTEnv:e.xTTEnv});return{getUserClawInfo:(e,s)=>t.getUserClawInfo(e,s),createSession:(e,s)=>t.createSession(e,s),listSession:(e,s)=>t.listSession(e,s),listMessage:(e,s)=>t.listMessage(e,s),uploadFile:(e,s)=>t.uploadFile(e,s),getWebUrl:(e,s)=>t.getWebUrl(e,s),getUrl:(e,s)=>t.getUrl(e,s),exportPPT:(e,s)=>t.exportPPT(e,s),chat:(e,s)=>t.chat(e,s),listProcess:(e,s)=>t.listProcess(e,s)}},It=()=>({async get(){const e=await O();return{sessionId:e.sessionId,sessionClawId:e.sessionClawId}},async save(e){await v(e)}});function Ut(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}const Lt=[".report.html",".podcast.html",".webdoc.html",".socmed.html",".pptx.html",".poster.html",".resume.html",".chart.html"],Ct=({file:e,fileIndex:t,clawId:s,webOrigin:i})=>{const a=e.file_uri;if(!a||!s)return;const r=new URL(i).origin;const n=e.file_name||a.split("/").pop()||"";return(e=>e.endsWith(".html")&&!Lt.some((t=>e.endsWith(t))))(n||a)?`${r}/web?is_shared=1&uri=${encodeURIComponent(a)}&is_claw=1`:`${r}/share-product/${s}?index=${t}&uri=${encodeURIComponent(a)}&filename=${encodeURIComponent(n)}&only_content=1&is_claw=1`},Ot=async({files:e,clawId:t,webOrigin:s,api:i})=>e&&0!==e.length?await Promise.all(e.map((async(e,a)=>{const r=Ct({file:e,fileIndex:a,clawId:t,webOrigin:s});return{...e,preview_url:await x({url:r,api:i})}}))):[],vt=async({files:e,clawId:t,apiBaseUrl:s,sessionApiBaseUrl:i,xTTEnv:a,service:r,deps:n})=>{if(!e||0===e.length)return e;const o=Ut([n,"optionalAccess",e=>e.store])||It(),{sessionClawId:c}=await o.get(),l=t||c||(await r.getStatus()).clawId,d=(Ut([n,"optionalAccess",e=>e.createApi])||Pt)({baseUrl:i||s,xTTEnv:a}),_=Ut([n,"optionalAccess",e=>e.resolveFiles])||Ot;return await _({files:e,clawId:l,webOrigin:i||s,api:{getWebUrl:e=>d.getWebUrl(e)}})},yt=e=>"running"!==e,Bt=e=>{if(e&&0!==e.length)return e.map((e=>({fileName:e.file_name,fileUrl:e.file_url,previewUrl:e.preview_url,fileUri:e.file_uri})))};const bt=l.join(p(),"tasks","session-progress-tasks.json");class zt extends Error{constructor(e){super(e),this.name="SessionTaskStoreError"}}class Dt extends Error{constructor(e){super(`Session task expired: ${e}`),this.taskId=e,this.name="SessionTaskExpiredError"}}class Nt extends Error{constructor(e){super(`Session task not found: ${e}`),this.taskId=e,this.name="SessionTaskNotFoundError"}}const qt=(e,t)=>Object.entries(t).reduce(((e,[t,s])=>void 0===s?e:{...e,[t]:s}),{...e}),kt=e=>{const t=a.safeJsonParse(e,void 0);if(void 0===t)throw new zt("Failed to parse session task store");if(s=t,!Boolean(s)||"object"!=typeof s||Array.isArray(s)||!Array.isArray(t.items))throw new zt("Failed to parse session task store");var s;return{version:1,items:t.items}},Ft=({filePath:e=bt,now:t=Date.now,retentionMs:s=6048e5,writeDocument:i=async(e,t)=>{await(async({content:e,filePath:t})=>{await n.mkdir(r.dirname(t),{recursive:!0});const s=`${t}.tmp.${Date.now()}.${process.pid}`,i=await n.open(s,"w");try{await i.writeFile(e,"utf8"),await i.sync()}finally{await i.close()}try{await n.rename(s,t)}catch(e){throw await n.rm(s,{force:!0}).catch((()=>{})),e}})({content:t,filePath:e})}}={})=>{const a=(e=>async()=>{try{const t=await n.readFile(e,"utf8");return kt(t)}catch(e){if("ENOENT"===function(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}([e,"optionalAccess",e=>e.code]))return{version:1,items:[]};if(e instanceof zt)throw e;throw new zt(`Failed to read session task store: ${String(e)}`)}})(e),o=(({filePath:e,writeDocument:t})=>async s=>{await t(e,JSON.stringify(s,null,2))})({filePath:e,writeDocument:i}),c=e=>{if(!yt(e.status))return!1;const i=(a=e.finishedAt,r=()=>e.updatedAt,null!=a?a:r());var a,r;return t()-i>s},l=(({isExpired:e,readDocument:t})=>async({includeExpired:s,taskId:i})=>{const a=(await t()).items.find((e=>e.taskId===i));if(!a)throw new Nt(i);if(!s&&e(a))throw new Dt(i);return a})({isExpired:c,readDocument:a});return{list:async(e={})=>(await a()).items.filter((t=>!(!e.includeExpired&&c(t))&&((!e.sessionId||t.sessionId===e.sessionId)&&(!e.status||t.status===e.status)))).sort(((e,t)=>t.updatedAt-e.updatedAt)),get:async(e,t={})=>await l({includeExpired:t.includeExpired,taskId:e}),async upsert(e){const t=await a(),s=t.items.findIndex((t=>t.taskId===e.taskId));if(s>=0){const[i]=t.items.slice(s,s+1),a=qt(i,e);t.items.splice(s,1,a)}else t.items.push(e);return await o(t),await l({includeExpired:!0,taskId:e.taskId})},async patch(e,t){const s=await a(),i=s.items.findIndex((t=>t.taskId===e));if(i<0)throw new Nt(e);const[r]=s.items.slice(i,i+1),n=qt(r,t);return s.items.splice(i,1,n),await o(s),await l({includeExpired:!0,taskId:e})},async remove(e){const t=await a();t.items=t.items.filter((t=>t.taskId!==e)),await o(t)},async gc(){const e=await a(),t=e.items.filter(c);return e.items=e.items.filter((e=>!c(e))),await o(e),t},isExpired:c}},Gt=({api:e,store:t,authConfigured:s=()=>!0,fallbackAccountId:i})=>{const a=(({now:e=Date.now,workingTtlMs:t=3e4}={})=>{const s=new Map;return{clear(){s.clear()},getLive(i){const a=s.get(i);if(a){if(!(e()-a.updatedAt>t))return a;s.delete(i)}},markIdle(e){s.delete(e)},markWorking(t){s.set(t,{status:"working",updatedAt:e()})}}})(),r=(e=>async({sessionId:t,status:s})=>{"idle"!==s?e.markWorking(t):e.markIdle(t)})(a),n=(({api:e,authConfigured:t,fallbackAccountId:s,store:i})=>async()=>{const a=s;if(!t())return H({accountId:a,authConfigured:!1});try{const t=a?{account_id:a}:{},s=function(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}([await e.getUserClawInfo(t),"access",e=>e.data,"optionalAccess",e=>e.user_claw_info,"optionalAccess",e=>e.claw_id]);return s?(await i.save({sessionClawId:s}),{authConfigured:!0,authValid:!0,clawId:s,accountId:a,updatedAt:void 0}):H({accountId:a,authConfigured:!0})}catch(e){return H({accountId:a,authConfigured:!0})}})({api:e,authConfigured:s,fallbackAccountId:i,store:t}),o=(({createAuthInvalidError:e,getStatus:t,getStoredConfig:s})=>async()=>{const i=await s();if(i.sessionClawId)return i.sessionClawId;const a=await t();if(!a.authValid||!a.clawId)throw e();return a.clawId})({createAuthInvalidError:J,getStatus:n,getStoredConfig:async()=>t.get()}),c=V({api:e,resolveClawId:o}),{listMessages:l,listRepliesByMessage:d}=(({api:e,createListError:t})=>{const s=async({sessionId:s,cursor:i,size:a=10,ascMode:r})=>{const n=await e.listMessage({session_id:s,cursor:i,size:a,asc_mode:r});if(0!==n.code&&void 0!==n.code)throw t(n.msg||"Failed to list session messages");const o=(gt([n,"access",e=>e.data,"optionalAccess",e=>e.messages])||[]).map((e=>Et(e))).filter((e=>null!==e)),c=gt([n,"access",e=>e.data,"optionalAccess",e=>e.next_cursor]);return{items:o,nextCursor:c,hasMore:Boolean(c)}};return{listMessages:s,listRepliesByMessage:async({sessionId:e,messageId:t,size:i=10,maxPages:a=100})=>{let r,n=!1;const o=[];for(let c=0;c<a;c+=1){const a=await s({sessionId:e,cursor:r,size:i});if(a.items.forEach((e=>{e.messageId===t&&(n=!0),e.replyToMessageId===t&&o.push(e)})),n||!a.hasMore||!a.nextCursor)break;r=a.nextCursor}return{sessionId:e,requestMessageId:t,requestMessageFound:n,items:o.reverse()}}}})({api:e,createListError:e=>new Z(e,"SESSION_MESSAGE_LIST_FAILED")});return{getStatus:n,createSession:X({api:e,resolveClawId:o}),listSessions:Q({api:e,resolveClawId:o}),listMessages:l,listRepliesByMessage:d,sendMessage:ee({api:e,updateSessionRuntimeStatus:r}),listProgresses:c,getProgress:$(c),getSessionDisplayStatus:Y({listProgresses:c,runtimeStatusStore:a}),resolveFileUrl:wt({api:e}),exportPpt:mt({api:e}),shortenWebUrl:M({api:e}),updateSessionRuntimeStatus:r}},jt=e=>{const t=It();return Gt({api:At(e),store:t,authConfigured:()=>Boolean(e.accessToken),fallbackAccountId:e.organizationId})};function xt(e){let t,s=e[0],i=1;for(;i<e.length;){const a=e[i],r=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==s)return;"access"===a||"optionalAccess"===a?(t=s,s=r(s)):"call"!==a&&"optionalCall"!==a||(s=r(((...e)=>s.call(t,...e))),t=void 0)}return s}const Mt=e=>{if(!e)return;const t=(e=>e.replace(/\s+/g," ").trim())(e);return t?t.length>120?`${t.slice(0,117)}...`:t:void 0},Ht=e=>{if(!e)return;const t=e.trim();return t?t.length>200?`${t.slice(0,197)}...`:t:void 0},Wt=({apiBaseUrl:e,now:t=Date.now,resolveReplyFiles:s,service:i,sessionApiBaseUrl:a,store:r=Ft(),xTTEnv:n})=>({async createOrUpdateTaskFromMessageWait({answerMessageId:e,content:s,files:i,messageId:a,progress:n,sessionId:o}){const c=t(),l=s,d=Mt(l),_="running"!==n.progressStatus,u=_?Ht(l):void 0;return await r.upsert({taskId:(p=n.progressId,`stp_${p}`),kind:"session_progress",sessionId:o,messageId:a,progressId:n.progressId,status:_?"finished":"running",contentPreview:d,answerMessageId:e,replyContent:l,resultSummary:u,artifacts:Bt(i),lastProgressStatus:n.progressStatus,createdAt:c,updatedAt:c,finishedAt:_?c:void 0});var p},getTask:async(e,t)=>await r.get(e,t),patchTask:async(e,t)=>await r.patch(e,t),listTasks:async e=>await r.list(e),async refreshTask(o,c){const l=await r.get(o,c);if(yt(l.status))return l;try{const c=await i.getProgress({progressId:l.progressId}),d=t();if(c)return await r.patch(o,{contentPreview:Mt(l.replyContent),lastProgressStatus:c.progressStatus,lastRefreshError:void 0,resultSummary:void 0,status:"running"===c.progressStatus?"running":"finished",updatedAt:d});const _=await(async({apiBaseUrl:e,resolveReplyFiles:t=vt,service:s,sessionApiBaseUrl:i,task:a,xTTEnv:r})=>{const n=await s.listRepliesByMessage({sessionId:a.sessionId,messageId:a.messageId}),o=n.items[n.items.length-1];if(!o)return null;const c=o.files&&o.files.length>0?await t({files:o.files,apiBaseUrl:e,sessionApiBaseUrl:i,service:s,xTTEnv:r}):o.files;return{answerMessageId:o.messageId,files:c,replyContent:o.content,resultSummary:Ht(o.content)}})({apiBaseUrl:e,resolveReplyFiles:s,service:i,sessionApiBaseUrl:a,task:l,xTTEnv:n});return await r.patch(o,{answerMessageId:xt([_,"optionalAccess",e=>e.answerMessageId]),artifacts:xt([_,"optionalAccess",e=>e.files])?Bt(_.files):void 0,contentPreview:Mt(xt([_,"optionalAccess",e=>e.replyContent])),finishedAt:d,lastProgressStatus:"finished",lastRefreshError:void 0,replyContent:xt([_,"optionalAccess",e=>e.replyContent]),resultSummary:xt([_,"optionalAccess",e=>e.resultSummary]),status:"finished",updatedAt:d})}catch(e){return await r.patch(o,{lastRefreshError:e instanceof Error?e.message:String(e),updatedAt:t()})}},gcTasks:async()=>await r.gc()});function Vt(e,t){return null!=e?e:t()}const $t=({elapsedMs:e})=>e>=3e5?3e4:1e4;exports.Claw=nt,exports.DEFAULT_CONFIG=T,exports.SessionServiceError=Z,exports.SessionTaskExpiredError=Dt,exports.SessionTaskNotFoundError=Nt,exports.SessionTaskStoreError=zt,exports.appendSearchParams=b,exports.buildPatchByPath=function(e,t){const s=e.split("."),i={};let a=i;return s.forEach(((e,i)=>{if(i===s.length-1)a[e]=t;else{const t={};a[e]=t,a=t}})),i},exports.buildSessionPptSlideUrl=({origin:e,fileUri:t,taskId:s,baseHeight:i=720,baseWidth:a=1280})=>{const r=s||(e=>e.split("/").filter(Boolean)[0])(t);if(!r)throw new Z("Missing PPT task id for share URL","SESSION_PPT_SHARE_FAILED");const n=new URL(`/slide/${encodeURIComponent(r)}`,(e=>e.endsWith("/")?e.slice(0,-1):e)(e));return n.searchParams.set("uri",t),n.searchParams.set("baseHeight",String(i)),n.searchParams.set("baseWidth",String(a)),n.searchParams.set("is_claw","1"),n.toString()},exports.createDefaultSessionService=jt,exports.createSessionApiClient=Pt,exports.createSessionConfigStore=It,exports.createSessionTaskService=Wt,exports.createSessionUploadFile=St,exports.deleteConfig=async function(e){const t=process.env.COZE_CONFIG_FILE;if(t){const s=await U(t);if(s&&void 0!==R(s,e)){A(s,e);try{await d.writeFile(t,JSON.stringify(s,null,2),"utf8")}catch(e){throw new Error(`Failed to delete config from ${t}: ${e}`)}return}}let s=f,i=await U(s);if(i&&void 0!==R(i,e)||(s=E,i=await L()),i&&void 0!==R(i,e)){A(i,e);try{await d.writeFile(s,JSON.stringify(i,null,2),"utf8")}catch(e){throw new Error(`Failed to delete config from ${s}: ${e}`)}}},exports.fetchSessionPptContent=async({url:e,fetchImpl:t=e=>a.customFetch.fetch(e),maxBytes:s=10485760})=>{const i=await t(e);if(!i.ok)throw new Z(`Failed to fetch PPT content: ${i.status} ${i.statusText}`,"SESSION_PPT_FETCH_FAILED");const r=i.headers.get("content-length");if(r){const e=Number.parseInt(r,10);if(Number.isFinite(e)&&e>s)throw new Z(`PPT content is too large: ${e} bytes exceeds ${s} bytes`,"SESSION_PPT_FETCH_FAILED")}const n=await i.text(),o=Buffer.byteLength(n,"utf8");if(o>s)throw new Z(`PPT content is too large: ${o} bytes exceeds ${s} bytes`,"SESSION_PPT_FETCH_FAILED");return n},exports.formatServiceErrorWithLogId=({fallback:e,logId:t,message:s})=>{const i=s||e;return t?`${i}\n LogID: ${t}`:i},exports.formatSessionPptEditQuery=({pages:e,query:t})=>{const s=[...new Set(e)].sort(((e,t)=>e-t));return 1===s.length?`对第${s[0]}页进行变更:<${t}>`:`对第${s.join("、")}页进行变更:<${t}>`},exports.getCozeAccountHeaders=k,exports.getGlobalCompletionFile=()=>l.join(p(),"completion.sh"),exports.getGlobalConfigDir=p,exports.getGlobalLogsDir=()=>l.join(p(),"logs"),exports.getGlobalSkillLockFile=()=>l.join(p(),".skill-lock.json"),exports.getLegacyGlobalConfigDir=h,exports.getPpeHeaders=q,exports.getServiceResponseLogId=N,exports.installScopedCozeAccountFetchHeader=j,exports.isInternalConfigPath=g,exports.isSessionTaskTerminal=yt,exports.listConfigs=async function(){const e=process.env.COZE_CONFIG_FILE,[t,s,i]=await Promise.all([L(),U(f),e?U(e):void 0]),a=[{name:"env",flat:I(C())},{name:"env-file",flat:I(i)},{name:"local",flat:I(s)},{name:"global",flat:I(t)},{name:"default",flat:I(T)}],r=new Set;for(const{flat:e}of a)Object.keys(e).forEach((e=>r.add(e)));const n=[];for(const e of Array.from(r)){if(g(e))continue;let t,s="default";for(const{name:i,flat:r}of a)if(e in r&&void 0!==r[e]){t="env"===i?r[e]:String(r[e]),s=i;break}n.push({key:e,value:t,source:s})}return n},exports.loadConfig=O,exports.normalizeBaseUrl=B,exports.parseServiceResponseBody=z,exports.parseSessionPptContent=e=>{const t=e.trim(),s=(e=>{const t=a.safeJsonParse(e,null),s=Array.isArray(ot([t,"optionalAccess",e=>e.pages]))?t.pages:Array.isArray(ot([t,"optionalAccess",e=>e.data,"optionalAccess",e=>e.pages]))?t.data.pages:null;return s?{type:"json",pageCount:s.length,pages:s.map(((e,t)=>{const s=[];ht(e,s);const i=((e,t)=>{if(!e||"object"!=typeof e)return;const s=e;for(const e of t){const t=s[e];if("string"==typeof t&&t.trim())return t}})(e,["image_url","export_image_url","preview_url","thumbnail_url"]);return{page:t+1,title:s[0]||`第${t+1}页`,previewUrl:i,previewText:dt(s.join(" "))||(i?`preview_url: ${i}`:"")}}))}:null})(t);return s||(/<html[\s>]/i.test(t)||t.includes("\x3c!--SPLIT_HTML--\x3e")?pt(t):{type:"unknown",pageCount:0,pages:[]})},exports.resolveStoredSessionReplyFiles=vt,exports.runSessionTaskRefreshWorkerCli=async()=>{const t=e.argv[2];if(!t)throw new Error("No payload provided");const s=a.safeJsonParse(t,void 0);if(!s)throw new Error("Invalid payload");await(async({now:e=Date.now,payload:t,sleep:s=async e=>await new Promise((t=>setTimeout(t,e))),taskService:r=Wt({apiBaseUrl:t.apiBaseUrl,service:jt({accessToken:t.accessToken,apiBaseUrl:t.apiBaseUrl,organizationId:t.organizationId,sessionApiBaseUrl:Vt(t.sessionApiBaseUrl,(()=>"")),xTTEnv:t.xTTEnv}),sessionApiBaseUrl:t.sessionApiBaseUrl,store:Ft(),xTTEnv:t.xTTEnv})})=>{const n=new i.EnvHttpProxyAgent;a.customFetch.setDispatcher(n),a.customFetch.setHeaders({Authorization:`Bearer ${t.accessToken}`}),j({organizationId:t.organizationId}),t.xTTEnv&&a.customFetch.setHeaders({"x-use-ppe":"1","x-tt-env":t.xTTEnv});const o=e();let c=3e3;try{for(;;){await s(c);const i=await r.refreshTask(t.taskId,{includeExpired:!0});if(yt(i.status))return;c=$t({elapsedMs:e()-o})}}finally{await r.patchTask(t.taskId,{workerPid:void 0})}})({payload:s})},exports.saveConfig=v,exports.shouldInjectCozeAccountHeader=F,exports.startDetachedSessionTaskRefreshWorker=async({payload:i,spawnImpl:a=s.spawn})=>{const r=a(e.execPath,[t.resolve(__dirname,"./session-task-refresh.worker.js"),JSON.stringify(i)],{detached:!0,stdio:"ignore"});return r.unref(),r.pid};
|