apify-client 3.0.0-beta.24 → 3.0.0-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js
CHANGED
|
@@ -55,7 +55,7 @@ ${JSON.stringify(e,null,2)}`}_parseLoggerException(e,t=1){let r=[];e.type&&r.pus
|
|
|
55
55
|
${o.map(e=>`${" ".repeat(2*t)}${e}`).join("\n")}`}};let Log=class Log{LEVELS=I;options;preferredFieldsMap;warningsOnceLogged=new Set;constructor(e={}){let t;if(this.options={...{level:(t=iG.env.APIFY_LOG_LEVEL)?Number.isFinite(+t)?+t:I[t]?I[t]:+t:I.INFO,maxDepth:4,gradualLimitFactor:.5,maxStringLength:1e3,maxArrayLength:500,maxFields:20,preferredFields:[...iJ],prefix:null,suffix:null,truncationSuffix:iV,truncationFlagKey:iK,logger:(e=>{switch(e){case z.JSON:return new logger_json_LoggerJson;case z.TEXT:default:return new LoggerText}})(function(){let e=iG.env[i$]||z.TEXT;switch(e.toLowerCase()){case z.JSON.toLowerCase():return z.JSON;case z.TEXT.toLowerCase():return z.TEXT;default:return console.warn(`Unknown value for environment variable ${i$}: ${e}`),z.TEXT}}()),data:{}},...e},!I[this.options.level])throw Error('Options "level" must be one of log.LEVELS enum!');if("number"!=typeof this.options.maxDepth)throw Error('Options "maxDepth" must be a number!');if("number"!=typeof this.options.gradualLimitFactor)throw Error('Options "gradualLimitFactor" must be a number!');if("number"!=typeof this.options.maxStringLength)throw Error('Options "maxStringLength" must be a number!');if("number"!=typeof this.options.maxArrayLength)throw Error('Options "maxArrayLength" must be a number!');if("number"!=typeof this.options.maxFields)throw Error('Options "maxFields" must be a number!');if(!Array.isArray(this.options.preferredFields))throw Error('Options "preferredFields" must be an array!');if(this.options.prefix&&"string"!=typeof this.options.prefix)throw Error('Options "prefix" must be a string!');if(this.options.suffix&&"string"!=typeof this.options.suffix)throw Error('Options "suffix" must be a string!');if("string"!=typeof this.options.truncationSuffix)throw Error('Options "truncationSuffix" must be a string!');if("string"!=typeof this.options.truncationFlagKey)throw Error('Options "truncationFlagKey" must be a string!');if("object"!=typeof this.options.logger)throw Error('Options "logger" must be an object!');if("object"!=typeof this.options.data)throw Error('Options "data" must be an object!');this.preferredFieldsMap=Object.fromEntries(this.options.preferredFields.map((e,t)=>[e,t]))}_sanitizeData(e){return function e(t,r){let{maxDepth:n=1/0,gradualLimitFactor:i=1,maxStringLength:o=1/0,maxArrayLength:a=1/0,maxFields:s=1/0,preferredFieldsMap:l={},truncationSuffix:u=iV,truncationFlagKey:c=iK}=r;if("string"==typeof t)return t.length>o?function(e,t,r=iV){if(t=Math.floor(t),r.length>t)throw Error("suffix string cannot be longer than maxLength");return"string"==typeof e&&e.length>t&&(e=e.substr(0,t-r.length)+r),e}(t,o,u):t;if(["number","boolean","symbol","bigint"].includes(typeof t)||null==t||t instanceof Date)return t;if(t instanceof Error){let{name:e,message:r,stack:n,cause:i,...o}=t;t={name:e,message:r,stack:n,cause:i,...o,[iH]:!0}}let p=t=>e(t,{...r,maxDepth:n-1,maxStringLength:Math.max(Math.floor(o*i),u.length),maxArrayLength:Math.floor(a*i),maxFields:Math.floor(s*i)});if(Array.isArray(t)){if(n<=0)return"[array]";let e=t.slice(0,a).map(p);return t.length>a&&e.push(u),e}if("object"==typeof t&&null!==t){if(n<=0)return"[object]";let e=Reflect.ownKeys(t);e.sort((e,t)=>{let r=l[String(e)]??-1,n=l[String(t)]??-1;return -1===r&&-1===n?0:-1===r?1:-1===n?-1:r-n});let r={};return e.slice(0,s).forEach(e=>{r[e]=p(t[e])}),e.length>s&&(r[c]=!0),r}if("function"==typeof t)return"[function]";console.log(`WARNING: Object cannot be logged: ${t}`)}(e,{maxDepth:this.options.maxDepth,gradualLimitFactor:this.options.gradualLimitFactor,maxStringLength:this.options.maxStringLength,maxArrayLength:this.options.maxArrayLength,maxFields:this.options.maxFields,preferredFieldsMap:this.preferredFieldsMap,truncationSuffix:this.options.truncationSuffix,truncationFlagKey:this.options.truncationFlagKey})}getLevel(){return this.options.level}setLevel(e){if(!I[e])throw Error('Options "level" must be one of log.LEVELS enum!');this.options.level=e}internal(e,t,r,n){e>this.options.level||(r=Reflect.ownKeys(r={...this.options.data,...r}).length>0?this._sanitizeData(r):void 0,n=this._sanitizeData(n),this.options.logger.log(e,t,r,n,{prefix:this.options.prefix,suffix:this.options.suffix}))}setOptions(e){this.options={...this.options,...e}}getOptions(){return{...this.options}}child(e){let{prefix:t}=this.options;e.prefix&&(t=t?`${t}:${e.prefix}`:e.prefix);let r=e.data?{...this.options.data,...e.data}:this.options.data;return new Log({...this.options,...e,prefix:t,data:r})}error(e,t){this.internal(I.ERROR,e,t)}exception(e,t,r){this.internal(I.ERROR,t,r,e)}softFail(e,t){this.internal(I.SOFT_FAIL,e,t)}warning(e,t){this.internal(I.WARNING,e,t)}info(e,t){this.internal(I.INFO,e,t)}debug(e,t){this.internal(I.DEBUG,e,t)}perf(e,t){this.internal(I.PERF,e,t)}warningOnce(e){this.warningsOnceLogged.has(e)||(this.warningsOnceLogged.add(e),this.warning(e))}deprecated(e){this.warningOnce(e)}};let i9=new Log;function i8(e,t){return function(){return e.apply(t,arguments)}}var i5=r(606);let{toString:i7}=Object.prototype,{getPrototypeOf:oe}=Object,{iterator:ot,toStringTag:or}=Symbol,on=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),oi=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),oo=(e,t,r)=>e===Object.prototype||!r&&null===t,oa=(e,t)=>{let r=e,n=[];for(;null!=r&&-1===n.indexOf(r);){n.push(r);let i=oe(r);if(oo(r,i,r===e))break;if(on(r,t))return!0;r=i}return!1},os=(f=Object.create(null),e=>{let t=i7.call(e);return f[t]||(f[t]=t.slice(8,-1).toLowerCase())}),ol=e=>(e=e.toLowerCase(),t=>os(t)===e),ou=e=>t=>typeof t===e,{isArray:oc}=Array,op=ou("undefined");function od(e){return null!==e&&!op(e)&&null!==e.constructor&&!op(e.constructor)&&om(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let of=ol("ArrayBuffer"),oh=ou("string"),om=ou("function"),og=ou("number"),oy=e=>null!==e&&"object"==typeof e,ob=e=>{if(!oy(e))return!1;let t=oe(e);return(null===t||t===Object.prototype||null===oe(t))&&!oa(e,or)&&!oa(e,ot)},ov=ol("Date"),ow=ol("File"),o_=ol("Blob"),oE=ol("FileList"),oS=ol("Set"),oR="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},oO=void 0!==oR.FormData?oR.FormData:void 0,oC=ol("URLSearchParams"),[oA,oT,ox,ok]=["ReadableStream","Request","Response","Headers"].map(ol);function oP(e,t,{allOwnKeys:r=!1}={}){let n,i;if(null!=e)if("object"!=typeof e&&(e=[e]),oc(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{let i;if(od(e))return;let o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;for(n=0;n<a;n++)i=o[n],t.call(null,e[i],i,e)}}function oU(e,t){let r;if(od(e))return null;t=t.toLowerCase();let n=Object.keys(e),i=n.length;for(;i-- >0;)if(t===(r=n[i]).toLowerCase())return r;return null}let oL="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,oI=e=>!op(e)&&e!==oL,oz=(h="u">typeof Uint8Array&&oe(Uint8Array),e=>h&&e instanceof h),oN=ol("HTMLFormElement"),{propertyIsEnumerable:oj}=Object.prototype,oD=ol("RegExp"),o$=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};oP(r,(r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)}),Object.defineProperties(e,n)},oM=ol("AsyncFunction"),oB=(y="function"==typeof setImmediate,b=om(oL.postMessage),y?setImmediate:b?(v=`axios@${Math.random()}`,w=[],oL.addEventListener("message",({source:e,data:t})=>{e===oL&&t===v&&w.length&&w.shift()()},!1),e=>{w.push(e),oL.postMessage(v,"*")}):e=>setTimeout(e)),oF="u">typeof queueMicrotask?queueMicrotask.bind(oL):void 0!==i5&&i5.nextTick||oB,oq=e=>null!=e&&om(e[ot]);var oW={isArray:oc,isArrayBuffer:of,isBuffer:od,isFormData:e=>{if(!e)return!1;if(oO&&e instanceof oO)return!0;let t=oe(e);if(!t||t===Object.prototype||!om(e.append))return!1;let r=os(e);return"formdata"===r||"object"===r&&om(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&of(e.buffer)},isString:oh,isNumber:og,isBoolean:e=>!0===e||!1===e,isObject:oy,isPlainObject:ob,isEmptyObject:e=>{if(!oy(e)||od(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:oA,isRequest:oT,isResponse:ox,isHeaders:ok,isUndefined:op,isDate:ov,isFile:ow,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:o_,isRegExp:oD,isFunction:om,isStream:e=>oy(e)&&om(e.pipe),isURLSearchParams:oC,isTypedArray:oz,isFileList:oE,forEach:oP,merge:function e(...t){let{caseless:r,skipUndefined:n}=oI(this)&&this||{},i={},o=(t,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;let a=r&&"string"==typeof o&&oU(i,o)||o,s=on(i,a)?i[a]:void 0;ob(s)&&ob(t)?i[a]=e(s,t):ob(t)?i[a]=e({},t):oc(t)?i[a]=t.slice():n&&op(t)||(i[a]=t)};for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!r||od(r)||(oP(r,o),"object"!=typeof r||oc(r)))continue;let n=Object.getOwnPropertySymbols(r);for(let e=0;e<n.length;e++){let t=n[e];oj.call(r,t)&&o(r[t],t)}}return i},extend:(e,t,r,{allOwnKeys:n}={})=>(oP(t,(t,n)=>{r&&om(t)?Object.defineProperty(e,n,{__proto__:null,value:i8(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 i,o,a,s={};if(t=t||{},null==e)return t;do{for(o=(i=Object.getOwnPropertyNames(e)).length;o-- >0;)a=i[o],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==r&&oe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype)return t},kindOf:os,kindOfTest:ol,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return -1!==n&&n===r},toArray:e=>{if(!e)return null;if(oc(e))return e;let t=e.length;if(!og(t))return null;let r=Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{let r,n=(e&&e[ot]).call(e);for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let r,n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:oN,hasOwnProperty:on,hasOwnProp:on,hasOwnInPrototypeChain:oa,getSafeProp:(e,t)=>null!=e&&oa(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;let t=oe(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;let t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(oi(t))return!1;let r=Object.getOwnPropertyDescriptor(e,t);return!!r&&r.configurable&&!0===r.writable})})(e))return e;let r=Object.create(null),n=Object.create(null),i=[],o=e;for(;null!=o&&-1===i.indexOf(o);){i.push(o);let a=o===e?t:oe(o);if(oo(o,a,o===e))break;let s=Object.getOwnPropertyNames(o);for(let t of(Object.getOwnPropertySymbols&&s.push(...Object.getOwnPropertySymbols(o)),s))!oi(t)&&(on(n,t)||(r[t]=e[t],n[t]=!0));o=a}return r},reduceDescriptors:o$,freezeMethods:e=>{o$(e,(t,r)=>{if(om(e)&&["arguments","caller","callee"].includes(r))return!1;if(om(e[r])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(e,t)=>{let r={};return(oc(e)?e:String(e).split(t)).forEach(e=>{r[e]=!0}),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*=1)?e:t,findKey:oU,global:oL,isContextDefined:oI,isSpecCompliantForm:function(e){return!!(e&&om(e.append)&&"FormData"===e[or]&&e[ot])},toJSONObject:e=>{let t=new WeakSet,r=e=>{if(oy(e)){if(t.has(e))return;if(od(e))return e;if(!("toJSON"in e)){let n;if(t.add(e),oS(e))for(let t of(n=[],e)){let e=r(t);op(e)||n.push(e)}else n=oc(e)?[]:{},oP(e,(e,t)=>{let i=r(e);op(i)||(n[t]=i)});return t.delete(e),n}}return e};return r(e)},isAsyncFn:oM,isThenable:e=>e&&(oy(e)||om(e))&&om(e.then)&&om(e.catch),setImmediate:oB,asap:oF,isIterable:oq,isSafeIterable:e=>null!=e&&oa(e,ot)&&oq(e)};let oZ=oW.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"]),oH=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),oK=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function oV(e,t){return oW.isArray(e)?e.map(e=>oV(e,t)):function(e){let t=0,r=e.length;for(;t<r;){let r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;r>t;){let 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 oJ(e){let t=Object.create(null);return oW.forEach(e.toJSON(),(e,r)=>{t[r]=oV(e,oK)}),t}let oG=Symbol("internals");function oY(e){return e&&String(e).trim().toLowerCase()}function oQ(e){return!1===e||null==e?e:oW.isArray(e)?e.map(oQ):oV(String(e),oH)}let oX=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function o0(e){let t=0,r=e.length;for(;t<r;){let r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;r>t;){let t=e.charCodeAt(r-1);if(9!==t&&32!==t)break;r-=1}return 0===t&&r===e.length?e:e.slice(t,r)}function o1(e,t,r,n,i){if(oW.isFunction(n))return n.call(this,t,r);if(i&&(t=r),oW.isString(t)){if(oW.isString(n))return -1!==t.indexOf(n);if(oW.isRegExp(n))return n.test(t)}}let AxiosHeaders=class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,r){let n=this;function i(e,t,r){let i=oY(t);if(!i)return;let o=oW.findKey(n,i);o&&void 0!==n[o]&&!0!==r&&(void 0!==r||!1===n[o])||(n[o||t]=oQ(e))}let o=(e,t)=>oW.forEach(e,(e,r)=>i(e,r,t));if(oW.isPlainObject(e)||e instanceof this.constructor)o(e,t);else{let n;if(oW.isString(e)&&(e=e.trim())&&(n=e,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim()))){var a;let r,n,i,s;o((s={},(a=e)&&a.split("\n").forEach(function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim();let t=oW.hasOwnProp(s,r);!r||t&&oW.hasOwnProp(oZ,r)||("set-cookie"===r?t?s[r].push(n):s[r]=[n]:s[r]=t?s[r]+", "+n:n)}),s),t)}else if(oW.isObject(e)&&oW.isSafeIterable(e)){let r=Object.create(null),n,i;for(let t of e){if(!oW.isArray(t))throw TypeError("Object iterator must return a key-value pair");i=t[0],oW.hasOwnProp(r,i)?(n=r[i],r[i]=oW.isArray(n)?[...n,t[1]]:[n,t[1]]):r[i]=t[1]}o(r,t)}else null!=e&&i(t,e,r)}return this}get(e,t){if(e=oY(e)){let r=oW.findKey(this,e);if(r){let e=this[r];if(!t)return e;if(!0===t){let t,r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=n.exec(e);)r[t[1]]=t[2];return r}if(oW.isFunction(t))return t.call(this,e,r);if(oW.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=oY(e)){let r=oW.findKey(this,e);return!!(r&&void 0!==this[r]&&(!t||o1(this,this[r],r,t)))}return!1}delete(e,t){let r=this,n=!1;function i(e){if(e=oY(e)){let i=oW.findKey(r,e);i&&(!t||o1(r,r[i],i,t))&&(delete r[i],n=!0)}}return oW.isArray(e)?e.forEach(i):i(e),n}clear(e){let t=Object.keys(this),r=t.length,n=!1;for(;r--;){let i=t[r];(!e||o1(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){let t=this,r={};return oW.forEach(this,(n,i)=>{let o=oW.findKey(r,i);if(o){t[o]=oQ(n),delete t[i];return}let a=e?i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r):String(i).trim();a!==i&&delete t[i],t[a]=oQ(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return oW.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&oW.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(){let e=this.get("set-cookie");return oW.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){let t=Object.create(null),r=String(e),n=0,i=!1,o=!1;function a(e){let i=o0(r.slice(n,e)),o=i.indexOf("=");if(o<1)return;let a=o0(i.slice(0,o));if(!oX.test(a))return;let s=a.toLowerCase();if("__proto__"===s||"constructor"===s||"prototype"===s)return;let l=o0(i.slice(o+1));t[s]=function(e){let t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let r="";for(let n=1;n<t;n++){let i=e.charCodeAt(n);if(34===i||92===i&&(n+=1)>=t)return e;r+=e[n]}return r}(l)}for(let e=0;e<r.length;e++){let t=r.charCodeAt(e);i?o?o=!1:92===t?o=!0:34===t&&(i=!1):34===t?i=!0:(44===t||59===t)&&(a(e),n=e+1)}return a(r.length),t}(e)}static concat(e,...t){let r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){let t=(this[oG]=this[oG]={accessors:{}}).accessors,r=this.prototype;function n(e){let n=oY(e);if(!t[n]){let i;i=oW.toCamelCase(" "+e),["get","set","has"].forEach(t=>{Object.defineProperty(r,t+i,{__proto__:null,value:function(r,n,i){return this[t].call(this,e,r,n,i)},configurable:!0})}),t[n]=!0}}return oW.isArray(e)?e.forEach(n):n(e),this}};AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),oW.reduceDescriptors(AxiosHeaders.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),oW.freezeMethods(AxiosHeaders);let o2="[REDACTED ****]";function o4(e){try{return String(e)}catch(e){return""}}let AxiosError=class AxiosError extends Error{static from(e,t,r,n,i,o){let a=e.message;!a&&oW.isArray(e.errors)&&e.errors.length&&(a=e.errors.map(e=>{try{return e&&e.message?o4(e.message):o4(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError");let s=new AxiosError(a,t||e.code,r,n,i);return Object.defineProperty(s,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),s.name=e.name,null!=e.status&&null==s.status&&(s.status=e.status),o&&Object.assign(s,o),s}constructor(e,t,r,n,i){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),i&&(this.response=i,this.status=i.status)}toJSON(){let e,t,r,n=this.config,i=n&&oW.hasOwnProp(n,"redact")?n.redact:void 0,o=oW.isArray(i)&&i.length>0?(e=new Set(i.map(e=>String(e).toLowerCase())),t=[],(r=n=>{let i;if(null===n||"object"!=typeof n||oW.isBuffer(n))return n;if(-1===t.indexOf(n)){if(n instanceof AxiosHeaders&&(n=n.toJSON()),t.push(n),oW.isArray(n))i=[],n.forEach((e,t)=>{let n=r(e);oW.isUndefined(n)||(i[t]=n)});else{if(!oW.isPlainObject(n)&&function(e){if(oW.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(oW.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(n))return t.pop(),n;for(let[t,o]of(i=Object.create(null),Object.entries(n))){let n=e.has(t.toLowerCase())?o2:r(o);oW.isUndefined(n)||(i[t]=n)}}return t.pop(),i}})(n)):oW.toJSONObject(n);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:o,code:this.code,status:this.status}}};AxiosError.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",AxiosError.ERR_BAD_OPTION="ERR_BAD_OPTION",AxiosError.ECONNABORTED="ECONNABORTED",AxiosError.ETIMEDOUT="ETIMEDOUT",AxiosError.ECONNREFUSED="ECONNREFUSED",AxiosError.ERR_NETWORK="ERR_NETWORK",AxiosError.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",AxiosError.ERR_DEPRECATED="ERR_DEPRECATED",AxiosError.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",AxiosError.ERR_BAD_REQUEST="ERR_BAD_REQUEST",AxiosError.ERR_CANCELED="ERR_CANCELED",AxiosError.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",AxiosError.ERR_INVALID_URL="ERR_INVALID_URL",AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var o6=AxiosError;function o3(e){return oW.isPlainObject(e)||oW.isArray(e)}function o9(e){return oW.endsWith(e,"[]")?e.slice(0,-2):e}function o8(e,t,r){return e?e.concat(t).map(function(e,t){return e=o9(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}let o5=oW.toFlatObject(oW,{},null,function(e){return/^is[A-Z]/.test(e)});var o7=function(e,t,r){if(!oW.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(e,t)=>{let n=oW.getSafeProp(r,e);return oW.isUndefined(n)?t:n},i=n("metaTokens",!0),o=n("visitor")||h,a=n("dots",!1),s=n("indexes",!1),l=n("Blob")||"u">typeof Blob&&Blob,u=n("maxDepth",100),c=l&&oW.isSpecCompliantForm(t),p=[];if(!oW.isFunction(o))throw TypeError("visitor must be a function");function d(e){if(null===e)return"";if(oW.isDate(e))return e.toISOString();if(oW.isBoolean(e))return e.toString();if(!c&&oW.isBlob(e))throw new o6("Blob is not supported. Use a Buffer instead.");if(oW.isArrayBuffer(e)||oW.isTypedArray(e)){if(c&&"function"==typeof l)return new l([e]);throw new o6("Blob is not supported. Use a Buffer instead.",o6.ERR_NOT_SUPPORT)}return e}function f(e){if(e>u)throw new o6("Object is too deeply nested ("+e+" levels). Max depth: "+u,o6.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,r,n){let o=e;if(oW.isReactNative(t)&&oW.isReactNativeBlob(e))return t.append(o8(n,r,a),d(e)),!1;if(e&&!n&&"object"==typeof e)if(oW.endsWith(r,"{}"))r=i?r:r.slice(0,-2),e=function(e){if(1/0===u)return JSON.stringify(e);let t=[];return JSON.stringify(e,function(e,r){if(!oW.isObject(r))return r;for(;t.length&&t[t.length-1]!==this;)t.pop();return t.push(r),f(1+t.length-1),r})}(e);else{var l;if(oW.isArray(e)&&(l=e,oW.isArray(l)&&!l.some(o3))||(oW.isFileList(e)||oW.endsWith(r,"[]"))&&(o=oW.toArray(e)))return r=o9(r),o.forEach(function(e,n){oW.isUndefined(e)||null===e||t.append(!0===s?o8([r],n,a):null===s?r:r+"[]",d(e))}),!1}return!!o3(e)||(t.append(o8(n,r,a),d(e)),!1)}let m=Object.assign(o5,{defaultVisitor:h,convertValue:d,isVisitable:o3});if(!oW.isObject(e))throw TypeError("data must be an object");return!function e(r,n,i=0){if(!oW.isUndefined(r)){if(f(i),-1!==p.indexOf(r))throw Error("Circular reference detected in "+n.join("."));p.push(r),oW.forEach(r,function(r,a){!0===(!(oW.isUndefined(r)||null===r)&&o.call(t,r,oW.isString(a)?a.trim():a,n,m))&&e(r,n?n.concat(a):[a],i+1)}),p.pop()}}(e),t};function ae(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function at(e,t){this._pairs=[],e&&o7(e,this,t)}let ar=at.prototype;function an(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ai(e,t,r){let n;if(!t)return e;e=e||"";let i=oW.isFunction(r)?{serialize:r}:r,o=oW.getSafeProp(i,"encode")||an,a=oW.getSafeProp(i,"serialize");if(n=a?a(t,i):oW.isURLSearchParams(t)?t.toString():new at(t,i).toString(o)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}ar.append=function(e,t){this._pairs.push([e,t])},ar.toString=function(e){let t=e?t=>e.call(this,t,ae):ae;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let ao=Symbol("internals");function aa(e){return e?e.length:0}function as(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function al(e,t){let r=e.handlers,n=aa(r);r!==t.handlersRef?(t.handlersRef=r,t.handlerEntries.clear()):n!==t.handlersLength&&(n?t.handlerEntries.forEach(function(e,n){r[e.index]!==e.handler&&t.handlerEntries.delete(n)}):t.handlerEntries.clear()),t.handlersLength=n}let InterceptorManager=class InterceptorManager{constructor(){this.handlers=[],this[ao]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,r){let n={fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null},i=this[ao];null==this.handlers&&(this.handlers=[]),al(this,i);let o=i.nextId++;return this.handlers.push(n),i.handlerEntries.set(o,{handler:n,index:this.handlers.length-1}),i.handlersLength=this.handlers.length,o}eject(e){let t=this[ao];al(this,t);let r=t.handlerEntries.get(e);if(r){if(t.handlerEntries.delete(e),this.handlers[r.index]!==r.handler)return;this.handlers[r.index]=null,t.iterationDepth||(as(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],al(this,this[ao]))}forEach(e){let t=this[ao];al(this,t),t.iterationDepth++;try{oW.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(al(this,t),as(this.handlers),t.handlersLength=aa(this.handlers))}}};var au={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},ac="u">typeof URLSearchParams?URLSearchParams:at,ap="u">typeof FormData?FormData:null,ad="u">typeof Blob?Blob:null;let af="u">typeof window&&"u">typeof document,ah="object"==typeof navigator&&navigator||void 0,am=af&&(!ah||0>["ReactNative","NativeScript","NS"].indexOf(ah.product)),ag="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ay=af&&window.location.href||"http://localhost";var ab={...D,isBrowser:!0,classes:{URLSearchParams:ac,FormData:ap,Blob:ad},protocols:["http","https","file","blob","url","data"]};function av(e){if(e>100)throw new o6("FormData field is too deeply nested ("+e+" levels). Max depth: 100",o6.ERR_FORM_DATA_DEPTH_EXCEEDED)}var aw=function(e){if(oW.isFormData(e)&&oW.isFunction(e.entries)){let t={};return oW.forEachEntry(e,(e,r)=>{!function e(t,r,n,i){av(i);let o=t[i++];if("__proto__"===o)return!0;let a=Number.isFinite(+o),s=i>=t.length;return(o=!o&&oW.isArray(n)?n.length:o,s)?oW.hasOwnProp(n,o)?n[o]=oW.isArray(n[o])?n[o].concat(r):[n[o],r]:n[o]=r:(oW.hasOwnProp(n,o)&&oW.isObject(n[o])||(n[o]=[]),e(t,r,n[o],i)&&oW.isArray(n[o])&&(n[o]=function(e){let t,r,n={},i=Object.keys(e),o=i.length;for(t=0;t<o;t++)n[r=i[t]]=e[r];return n}(n[o]))),!a}(function(e){let t,r=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;for(;null!==(t=n.exec(e));)av(r.length),r.push("[]"===t[0]?"":t[1]||t[0]);return r}(e),r,t,0)}),t}return null};let a_=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),aE=(e,t)=>null!=e&&oW.hasOwnProp(e,t)?e[t]:void 0,aS={transitional:au,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r,n=t.getContentType()||"",i=n.indexOf("application/json")>-1,o=oW.isObject(e);if(o&&oW.isHTMLForm(e)&&(e=new FormData(e)),oW.isFormData(e))return i?JSON.stringify(aw(e)):e;if(oW.isArrayBuffer(e)||oW.isBuffer(e)||oW.isStream(e)||oW.isFile(e)||oW.isBlob(e)||oW.isReadableStream(e))return e;if(oW.isArrayBufferView(e))return e.buffer;if(oW.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(o){let t=aE(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return o7(e,new ab.classes.URLSearchParams,{visitor:function(e,t,r,n){return ab.isNode&&oW.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t}).toString();if((r=oW.isFileList(e))||n.indexOf("multipart/form-data")>-1){let n=aE(this,"env"),i=n&&n.FormData;return o7(r?{"files[]":e}:e,i&&new i,t)}}if(o||i){t.setContentType("application/json",!1);var a=e;if(oW.isString(a))try{return(0,JSON.parse)(a),oW.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=aE(this,"transitional")||aS.transitional,r=t&&t.forcedJSONParsing,n=aE(this,"responseType"),i="json"===n;if(oW.isResponse(e)||oW.isReadableStream(e))return e;if(e&&oW.isString(e)&&(r&&!n||i)){let r=t&&t.silentJSONParsing;try{return JSON.parse(e,aE(this,"parseReviver"))}catch(e){if(!r&&i){if("SyntaxError"===e.name)throw o6.from(e,o6.ERR_BAD_RESPONSE,this,null,aE(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ab.classes.FormData,Blob:ab.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function aR(e,t){let r=this||aS,n=t||r,i=AxiosHeaders.from(n.headers),o=n.data;return oW.forEach(e,function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function aO(e){return!!(e&&e.__CANCEL__)}oW.forEach(a_,e=>{aS.headers[e]={}});let CanceledError=class CanceledError extends o6{constructor(e,t,r){super(null==e?"canceled":e,o6.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function aC(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new o6("Request failed with status code "+r.status,r.status>=400&&r.status<500?o6.ERR_BAD_REQUEST:o6.ERR_BAD_RESPONSE,r.config,r.request,r))}let aA=/[\t\n\r]/g;function aT(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t).replace(aA,"")}function ax(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}var ak=function(e,t){let r,n=Array(e=e||10),i=Array(e),o=0,a=0;return t=void 0!==t?t:1e3,function(s){let l=Date.now(),u=i[a];r||(r=l),n[o]=s,i[o]=l;let c=a,p=0;for(;c!==o;)p+=n[c++],c%=e;if((o=(o+1)%e)===a&&(a=(a+1)%e),l-r<t)return;let d=u&&l-u;return d?Math.round(1e3*p/d):void 0}},aP=function(e,t){let r,n,i=0,o=1e3/t,a=(t,o=Date.now())=>{i=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-i;s>=o?a(e,t):(r=e,n||(n=setTimeout(()=>{n=null,a(r)},o-s)))},()=>r&&a(r),(...e)=>a(e)]};let aU=(e,t,r=3)=>{let n=0,i=ak(50,250);return aP(r=>{if(!r||!oW.isNumber(r.loaded))return;let o=r.loaded,a=r.lengthComputable?r.total:void 0,s=Math.max(0,null!=a?Math.min(o,a):o),l=Math.max(0,s-n),u=i(l);n=Math.max(n,s),e({loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a?(a-s)/u:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})},r)},aL=(e,t)=>{let r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},aI=(e,t=oW.asap)=>(...r)=>t(()=>e(...r));var az=ab.hasStandardBrowserEnv?(m=new URL(ab.origin),g=ab.navigator&&/(msie|trident)/i.test(ab.navigator.userAgent),e=>(e=new URL(e,ab.origin),m.protocol===e.protocol&&m.host===e.host&&(g||m.port===e.port))):()=>!0,aN=ab.hasStandardBrowserEnv?{write(e,t,r,n,i,o,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];oW.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),oW.isString(n)&&s.push(`path=${n}`),oW.isString(i)&&s.push(`domain=${i}`),!0===o&&s.push("secure"),oW.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if("u"<typeof document)return null;let t=document.cookie.split(";");for(let r=0;r<t.length;r++){let n=t[r].replace(/^\s+/,""),i=n.indexOf("=");if(-1!==i&&n.slice(0,i)===e)try{return decodeURIComponent(n.slice(i+1))}catch(e){return n.slice(i+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};let aj=/^https?:(?!\/\/)/i;function aD(e,t){if("string"==typeof e){let n=aT(e);if(aj.test(n)){var r;let e,i,o;throw new o6(`Invalid URL ${JSON.stringify((o=(-1===(i=(e=n.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${o2}@`)).indexOf("#"))?e:e.slice(0,i)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${o2}`),-1===i?o:`${o}#${!(r=e.slice(i+1))?r:r.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,r="")=>`${t}${r}${o2}`)}`))}: missing "//" after protocol`,o6.ERR_INVALID_URL,t)}}}function a$(e,t,r,n){aD(t,n);let i=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));if(e&&(i||!1===r)){aD(e,n);if(!t)return e;let r=e.length;for(;r>0&&47===e.charCodeAt(r-1);)r--;return e.slice(0,r)+"/"+t.replace(/^\/+/,"")}return t}let aM=e=>e instanceof AxiosHeaders?{...e}:e;function aB(e,t){var r;e=e||{},t=t||{};let n=Object.create(null);function i(e,t,r,n){return oW.isPlainObject(e)&&oW.isPlainObject(t)?oW.merge.call({caseless:n},e,t):oW.isPlainObject(t)?oW.merge({},t):oW.isArray(t)?t.slice():t}function o(e,t,r,n){return oW.isUndefined(t)?oW.isUndefined(e)?void 0:i(void 0,e,r,n):i(e,t,r,n)}function a(e,t){if(!oW.isUndefined(t))return i(void 0,t)}function s(e,t){return oW.isUndefined(t)?oW.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function l(r,n,o){return oW.hasOwnProp(t,o)?i(r,n):oW.hasOwnProp(e,o)?i(void 0,r):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let u={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutErrorMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:l,headers:(e,t,r)=>o(aM(e),aM(t),r,!0)};return oW.forEach((r={...e,...t},Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(r).concat(Object.getOwnPropertySymbols(r).filter(e=>Object.getOwnPropertyDescriptor(r,e).enumerable)):Object.keys(r)),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;let i=oW.hasOwnProp(u,r)?u[r]:o,a=i(oW.hasOwnProp(e,r)?e[r]:void 0,oW.hasOwnProp(t,r)?t[r]:void 0,r);oW.isUndefined(a)&&i!==l||(n[r]=a)}),oW.hasOwnProp(t,"validateStatus")&&oW.isUndefined(t.validateStatus)&&!1===function(r){let n=oW.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!oW.isUndefined(n)){if(!oW.isPlainObject(n))return;else if(oW.hasOwnProp(n,r))return n[r]}let i=oW.hasOwnProp(e,"transitional")?e.transitional:void 0;if(oW.isPlainObject(i)&&oW.hasOwnProp(i,r))return i[r]}("validateStatusUndefinedResolves")&&(oW.hasOwnProp(e,"validateStatus")?n.validateStatus=i(void 0,e.validateStatus):delete n.validateStatus),n}let aF=["content-type","content-length"];var aq=function(e){let t=aB({},e),r=e=>oW.hasOwnProp(t,e)?t[e]:void 0,n=r("data"),i=r("withXSRFToken"),o=r("xsrfHeaderName"),a=r("xsrfCookieName"),s=r("headers"),l=r("auth"),u=r("baseURL"),c=r("allowAbsoluteUrls"),p=r("url");if(t.headers=s=AxiosHeaders.from(s),t.url=ai(a$(u,p,c,t),r("params"),r("paramsSerializer")),l){let t=oW.getSafeProp(l,"username")||"",r=oW.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(t+":"+(r?encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))):"")))}catch(t){throw o6.from(t,o6.ERR_BAD_OPTION_VALUE,e)}}if(oW.isFormData(n)){let e=oW.getSafeProp(n,"getHeaders");if(ab.hasStandardBrowserEnv||ab.hasStandardBrowserWebWorkerEnv||oW.isReactNative(n))s.setContentType(void 0);else{var d,f;oW.isFunction(e)&&(d=s,f=e.call(n),"content-only"!==r("formDataHeaderPolicy")?d.set(f):Object.entries(f||{}).forEach(([e,t])=>{aF.includes(e.toLowerCase())&&d.set(e,t)}))}}if(ab.hasStandardBrowserEnv&&(oW.isFunction(i)&&(i=i(t)),!0===i||null==i&&az(t.url))){let e=o&&a&&aN.read(a);e&&s.set(o,e)}return t},aW="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){let n,i,o,a,s,l,u=aq(e),c=u.data,p=AxiosHeaders.from(u.headers).normalize(),{responseType:d,onUploadProgress:f,onDownloadProgress:h}=u;function m(){a&&a(),s&&s(),u.cancelToken&&u.cancelToken.unsubscribe(n),u.signal&&u.signal.removeEventListener("abort",n)}let g=new XMLHttpRequest;function y(n){if(!g)return;if(0===g.status&&"file"!==(ax(aT(u.url))||ax(ab.origin))&&!(g.responseURL&&g.responseURL.startsWith("file:"))){r(new o6("Request aborted",o6.ECONNABORTED,e,g)),m(),g=null;return}try{n?l&&l(n):s&&s()}catch(e){setTimeout(()=>{throw e})}if(!g)return;let i=AxiosHeaders.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());aC(function(e){t(e),m()},function(e){r(e),m()},{data:d&&"text"!==d&&"json"!==d?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:i,config:e,request:g}),g=null}g.open(u.method.toUpperCase(),u.url,!0),g.timeout=u.timeout,"onloadend"in g?g.onloadend=y:g.onreadystatechange=function(){!g||4!==g.readyState||(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(y)},g.onabort=function(){g&&(r(new o6("Request aborted",o6.ECONNABORTED,e,g)),m(),g=null)},g.onerror=function(t){let n=new o6(t&&t.message?t.message:"Network Error",o6.ERR_NETWORK,e,g);n.event=t||null,r(n),m(),g=null},g.ontimeout=function(){let t=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",n=u.transitional||au;u.timeoutErrorMessage&&(t=u.timeoutErrorMessage),r(new o6(t,n.clarifyTimeoutError?o6.ETIMEDOUT:o6.ECONNABORTED,e,g)),m(),g=null},void 0===c&&p.setContentType(null),"setRequestHeader"in g&&oW.forEach(oJ(p),function(e,t){g.setRequestHeader(t,e)}),oW.isUndefined(u.withCredentials)||(g.withCredentials=!!u.withCredentials),d&&"json"!==d&&(g.responseType=u.responseType),h&&([o,s,l]=aU(h,!0),g.addEventListener("progress",o)),f&&g.upload&&([i,a]=aU(f),g.upload.addEventListener("progress",i),g.upload.addEventListener("loadend",a)),(u.cancelToken||u.signal)&&(n=t=>{g&&(r(!t||t.type?new CanceledError(null,e,g):t),g.abort(),m(),g=null)},u.cancelToken&&u.cancelToken.subscribe(n),u.signal&&(u.signal.aborted?n():u.signal.addEventListener("abort",n)));let b=ax(u.url);if(b&&!ab.protocols.includes(b)){r(new o6("Unsupported protocol "+b+":",o6.ERR_BAD_REQUEST,e)),m();return}g.send(c||null)})};let aZ=function*(e,t){let r,n=e.byteLength;if(!t||n<t)return void(yield e);let i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},aH=async function*(e,t){for await(let r of aK(e))yield*aZ(r,t)},aK=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);let t=e.getReader();try{for(;;){let{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},aV=(e,t,r,n)=>{let i,o=aH(e,t),a=0,s=e=>{!i&&(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{let{done:t,value:n}=await o.next();if(t){s(),e.close();return}let i=n.byteLength;if(r){let e=a+=i;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},aJ=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,aG=(e,t,r)=>t+2<r&&aJ(e.charCodeAt(t+1))&&aJ(e.charCodeAt(t+2)),aY=e=>e<=57?e-48:(223&e)-55,aQ=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,aX=e=>9===e||10===e||12===e||13===e||32===e,a0=e=>{var t;let r,n,i=e.length,o=0,a=0,s=!1;for(let t=0;t<i;t++){let r=e.charCodeAt(t);if(37===r&&aG(e,t,i)&&(r=16*aY(e.charCodeAt(t+1))+aY(e.charCodeAt(t+2)),t+=2),!aX(r)){if(61===r){a++;continue}if(!aQ(r)||a>0){s=!0;continue}o++}}if(s||a>2||a>0&&(o+a)%4!=0||o%4==1){let t,r;return t=e.length,r=0,t>0&&61===e.charCodeAt(t-1)&&(r++,t>1&&61===e.charCodeAt(t-2)&&r++),Math.floor((t-r)*3/4)}return r=Math.floor((t=o)/4),3*r+(2==(n=t%4)?1:2*(3===n))},a1={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:a2}=oW,a4=e=>{if(!oW.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},a6=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},a3=e=>{let t,r=void 0!==oW.global&&null!==oW.global?oW.global:globalThis,{ReadableStream:n,TextEncoder:i}=r,{fetch:o,Request:a,Response:s}=e=oW.merge.call({skipUndefined:!0},{Request:r.Request,Response:r.Response},e),l=o?a2(o):"function"==typeof fetch,u=a2(a),c=a2(s);if(!l)return!1;let p=l&&a2(n),d=l&&("function"==typeof i?(t=new i,e=>t.encode(e)):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=u&&p&&a6(()=>{let e=!1,t=new a(ab.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r}),h=c&&p&&a6(()=>oW.isReadableStream(new s("").body)),m={stream:h&&(e=>e.body)};l&&["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 o6(`Response type '${e}' is not supported`,o6.ERR_NOT_SUPPORT,r)})});let g=async e=>{if(null==e)return 0;if(oW.isBlob(e))return e.size;if(oW.isSpecCompliantForm(e)){let t=new a(ab.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return oW.isArrayBufferView(e)||oW.isArrayBuffer(e)?e.byteLength:(oW.isURLSearchParams(e)&&(e+=""),oW.isString(e))?(await d(e)).byteLength:void 0},y=async(e,t)=>{let r=oW.toFiniteNumber(e.getContentLength());return null==r?g(t):r};return async e=>{let t,{url:r,method:n,data:l,signal:c,cancelToken:d,timeout:b,onDownloadProgress:v,onUploadProgress:w,responseType:_,headers:E,withCredentials:S="same-origin",fetchOptions:R,maxContentLength:O,maxBodyLength:C,maxRedirects:A}=aq(e),T=oW.isNumber(O)&&O>-1,x=oW.isNumber(C)&&C>-1,k=o||fetch;_=_?(_+"").toLowerCase():"text";let P=((e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let r=new AbortController,n=!1,i=function(e){if(!n){n=!0,a();let t=e instanceof Error?e:this.reason;r.abort(t instanceof o6?t:new CanceledError(t instanceof Error?t.message:t))}},o=t&&setTimeout(()=>{o=null,i(new o6(`timeout of ${t}ms exceeded`,o6.ETIMEDOUT))},t),a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>{if(!n){if(e.aborted)return void i.call(e);e.addEventListener("abort",i,{once:!0})}});let{signal:s}=r;return s.unsubscribe=()=>oW.asap(a),s})([c,d&&d.toAbortSignal()],b),U=null,L=P&&P.unsubscribe&&(()=>{P.unsubscribe()}),I=null,z=()=>new o6("Request body larger than maxBodyLength limit",o6.ERR_BAD_REQUEST,e,U);try{var N,j;let o,c,d,b,D=(c="auth",oW.hasOwnProp(e,c)?e[c]:void 0);if(D){let e=oW.getSafeProp(D,"username")||"",t=oW.getSafeProp(D,"password")||"";o={username:e,password:t}}if(d=(N=r).indexOf("://"),b=N,-1!==d&&(b=b.slice(d+3)),b.includes("@")||b.includes(":")){let e=new URL(r,ab.origin);if(!o&&(e.username||e.password)){let t=a4(e.username),r=a4(e.password);o={username:t,password:r}}(e.username||e.password)&&(e.username="",e.password="",r=e.href)}if(o){let e;E.delete("authorization"),E.set("Authorization","Basic "+btoa((e=(o.username||"")+":"+(o.password||""),encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))}if(T&&"string"==typeof r&&r.startsWith("data:")){let t;if(j=r,t="string"==typeof j?j.indexOf("#"):-1,((e,t)=>{if(!e||"string"!=typeof e||!e.startsWith("data:"))return 0;let r=e.indexOf(",");if(r<0)return 0;let n=e.slice(5,r),i=e.slice(r+1);if(/;base64/i.test(n))return t(i);let o=0;for(let e=0,t=i.length;e<t;e++){let r=i.charCodeAt(e);if(37===r&&aG(i,e,t))o+=1,e+=2;else if(r<128)o+=1;else if(r<2048)o+=2;else if(r>=55296&&r<=56319&&e+1<t){let t=i.charCodeAt(e+1);t>=56320&&t<=57343?(o+=4,e++):o+=3}else o+=3}return o})(-1===t?j:j.slice(0,t),a0)>O)throw new o6("maxContentLength size of "+O+" exceeded",o6.ERR_BAD_RESPONSE,e,U)}if(x&&"get"!==n&&"head"!==n){let e=await g(l);if("number"==typeof e&&isFinite(e)&&(t=e,e>C))throw z()}let $=x&&(oW.isReadableStream(l)||oW.isStream(l)),M=(e,t,r)=>aV(e,65536,e=>{if(x&&e>C)throw I=z();t&&t(e)},r);if(f&&"get"!==n&&"head"!==n&&(w||$)){if(t=null==t?await y(E,l):t,0!==t||$){let e,n=new a(r,{method:"POST",body:l,duplex:"half"});if(oW.isFormData(l)&&(e=n.headers.get("content-type"))&&E.setContentType(e),n.body){let[e,r]=w&&aL(t,aU(aI(w)))||[];l=M(n.body,e,r)}}}else if($&&!u&&p&&"get"!==n&&"head"!==n)l=M(l);else if($&&u&&!f&&"get"!==n&&"head"!==n)throw new o6("Stream request bodies are not supported by the current fetch implementation",o6.ERR_NOT_SUPPORT,e,U);oW.isString(S)||(S=S?"include":"omit");let B=u&&"credentials"in a.prototype;if(oW.isFormData(l)){let e=E.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&E.delete("content-type")}E.set("User-Agent","axios/1.20.0",!1);let F=null==R?R:Object.assign(Object.create(null),R);F&&(delete F.body,delete F.headers,delete F.method,delete F.signal,delete F.duplex,delete F.credentials);let q=Object.assign(Object.create(null),F,{signal:P,method:n.toUpperCase(),headers:oJ(E.normalize()),body:l,duplex:"half",credentials:B?S:void 0});u&&(oW.forEach(a1,(e,t)=>{void 0===q[t]&&(q[t]=e)}),void 0===q.signal&&(q.signal=null),void 0===q.body&&(q.body=null)),0===A&&(q.redirect="manual",F&&(F.redirect="manual")),U=u&&new a(r,q);let W=await (u?k(U,F):k(r,q)),Z=AxiosHeaders.from(W.headers);if(T){let t=oW.toFiniteNumber(Z.getContentLength());if(null!=t&&t>O)throw new o6("maxContentLength size of "+O+" exceeded",o6.ERR_BAD_RESPONSE,e,U)}let H=h&&("stream"===_||"response"===_);if(h&&W.body&&(v||T||H&&L)){let t={};["status","statusText","headers"].forEach(e=>{t[e]=W[e]});let r=oW.toFiniteNumber(Z.getContentLength()),[n,i]=v&&aL(r,aU(aI(v),!0))||[];W=new s(aV(W.body,65536,t=>{if(T&&t>O)throw new o6("maxContentLength size of "+O+" exceeded",o6.ERR_BAD_RESPONSE,e,U);n&&n(t)},()=>{i&&i(),L&&L()}),t)}_=_||"text";let K=await m[oW.findKey(m,_)||"text"](W,e);if(T&&!h&&!H){let t;if(null!=K&&("number"==typeof K.byteLength?t=K.byteLength:"number"==typeof K.size?t=K.size:"string"==typeof K&&(t="function"==typeof i?new i().encode(K).byteLength:K.length)),"number"==typeof t&&t>O)throw new o6("maxContentLength size of "+O+" exceeded",o6.ERR_BAD_RESPONSE,e,U)}return!H&&L&&L(),await new Promise((t,r)=>{aC(t,r,{data:K,headers:AxiosHeaders.from(W.headers),status:W.status,statusText:W.statusText,config:e,request:U})})}catch(t){if(L&&L(),P&&P.aborted&&P.reason instanceof o6){let r=P.reason;throw r.config=e,U&&(r.request=U),t!==r&&Object.defineProperty(r,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),r}if(I)throw U&&!I.request&&(I.request=U),I;if(t instanceof o6)throw U&&!t.request&&(t.request=U),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let r=new o6("Network Error",o6.ERR_NETWORK,e,U,t&&t.response);throw Object.defineProperty(r,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),r}throw o6.from(t,t&&t.code,e,U,t&&t.response)}}},a9=new Map,a8=e=>{let t=e&&e.env||{},{fetch:r,Request:n,Response:i}=t,o=[n,i,r],a=o.length,s,l,u=a9;for(;a--;)s=o[a],void 0===(l=u.get(s))&&u.set(s,l=a?new Map:a3(t)),u=l;return l};a8();let a5={http:null,xhr:aW,fetch:{get:a8}};oW.forEach(a5,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let a7=e=>`- ${e}`,se=e=>oW.isFunction(e)||null===e||!1===e;var st=function(e,t){let r,n,{length:i}=e=oW.isArray(e)?e:[e],o={};for(let a=0;a<i;a++){let i;if(n=r=e[a],!se(r)&&void 0===(n=a5[(i=String(r)).toLowerCase()]))throw new o6(`Unknown adapter '${i}'`);if(n&&(oW.isFunction(n)||(n=n.get(t))))break;o[i||"#"+a]=n}if(!n){let e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new o6("There is no suitable adapter to dispatch the request "+(i?e.length>1?"since :\n"+e.map(a7).join("\n"):" "+a7(e[0]):"as no adapter specified"),o6.ERR_NOT_SUPPORT)}return n};function sr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError(null,e)}function sn(e){let t=oW.toSafeFlatObject(e);return sr(t),t.headers=AxiosHeaders.from(oW.getSafeProp(t,"headers")),t.data=aR.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),st(t.adapter||aS.adapter,t)(t).then(function(e){sr(t),t.response=e;try{e.data=aR.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=AxiosHeaders.from(e.headers),e},function(e){if(!aO(e)&&(sr(t),e&&e.response)){t.response=e.response;try{e.response.data=aR.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=AxiosHeaders.from(e.response.headers)}return Promise.reject(e)})}let si={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{si[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});let so={};si.transitional=function(e,t,r){function n(e,t){return"[Axios v1.20.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,o)=>{if(!1===e)throw new o6(n(i," has been removed"+(t?" in "+t:"")),o6.ERR_DEPRECATED);return t&&!so[i]&&(so[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,o)}},si.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var sa=function(e,t,r){if("object"!=typeof e||null===e)throw new o6("options must be an object",o6.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),i=n.length;for(;i-- >0;){let o=n[i],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){let t=e[o],r=void 0===t||a(t,o,e);if(!0!==r)throw new o6("option "+o+" must be "+r,o6.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new o6("Unknown option "+o,o6.ERR_BAD_OPTION)}};let Axios=class Axios{constructor(e){this.defaults=e||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let r=t.stack,n="";if("string"==typeof r){let e=r.indexOf("\n");n=-1===e?"":r.slice(e+1)}if(e.stack){if(n){let t=n.indexOf("\n"),r=-1===t?-1:n.indexOf("\n",t+1),i=-1===r?"":n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+="\n"+n)}}else e.stack=n}catch(e){}throw e}}_request(e,t){let r,n;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:i,paramsSerializer:o,headers:a}=t=aB(this.defaults,t);void 0!==i&&sa(i,{silentJSONParsing:si.transitional(si.boolean),forcedJSONParsing:si.transitional(si.boolean),clarifyTimeoutError:si.transitional(si.boolean),legacyInterceptorReqResOrdering:si.transitional(si.boolean),advertiseZstdAcceptEncoding:si.transitional(si.boolean),validateStatusUndefinedResolves:si.transitional(si.boolean)},!1),null!=o&&(oW.isFunction(o)?t.paramsSerializer={serialize:o}:sa(o,{encode:si.function,serialize:si.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),sa(t,{baseUrl:si.spelling("baseURL"),withXsrfToken:si.spelling("withXSRFToken")},!0),t.method=(oW.getSafeProp(t,"method")||oW.getSafeProp(this.defaults,"method")||"get").toLowerCase();let s=a&&oW.merge(a.common,a[t.method]);a&&oW.forEach(a_.concat("common"),e=>{delete a[e]}),t.headers=AxiosHeaders.concat(s,a);let l=[],u=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;u=u&&e.synchronous;let r=t.transitional||au;r&&r.legacyInterceptorReqResOrdering?l.unshift(e.fulfilled,e.rejected):l.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let p=0;if(!u){let e=[sn.bind(this),void 0];for(e.unshift(...l),e.push(...c),n=e.length,r=Promise.resolve(t);p<n;)r=r.then(e[p++],e[p++]);return r}n=l.length;let d=t;for(;p<n;){let e=l[p++],t=l[p++];try{d=e?e(d):d}catch(e){if(!t){r=Promise.reject(e);break}try{let n=t.call(this,e);oW.isThenable(n)&&(r=Promise.resolve(n).then(()=>sn.call(this,d)))}catch(e){r=Promise.reject(e)}break}}if(!r)try{r=sn.call(this,d)}catch(e){r=Promise.reject(e)}for(p=0,n=c.length;p<n;)r=r.then(c[p++],c[p++]);return r}getUri(e){return ai(a$((e=aB(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};oW.forEach(["delete","get","head","options"],function(e){Axios.prototype[e]=function(t,r){return this.request(aB(r||{},{method:e,url:t,data:r&&oW.hasOwnProp(r,"data")?r.data:void 0}))}}),oW.forEach(["post","put","patch","query"],function(e){function t(t){return function(r,n,i){return this.request(aB(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Axios.prototype[e]=t(),"query"!==e&&(Axios.prototype[e+"Form"]=t(!0))});let CancelToken=class CancelToken{constructor(e){let t;if("function"!=typeof e)throw TypeError("executor must be a function.");this.promise=new Promise(function(e){t=e});let 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,n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,i){r.reason||(r.reason=new CanceledError(e,n,i),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;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new CancelToken(function(t){e=t}),cancel:e}}};let ss={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ss).forEach(([e,t])=>{void 0===ss[t]&&(ss[t]=e)});let sl=function e(t){let r=new Axios(t),n=i8(Axios.prototype.request,r);return oW.extend(n,Axios.prototype,r,{allOwnKeys:!0}),oW.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(aB(t,r))},n}(aS);sl.Axios=Axios,sl.CanceledError=CanceledError,sl.CancelToken=CancelToken,sl.isCancel=aO,sl.VERSION="1.20.0",sl.toFormData=o7,sl.AxiosError=o6,sl.Cancel=sl.CanceledError,sl.all=function(e){return Promise.all(e)},sl.spread=function(e){return function(t){return e.apply(null,t)}},sl.isAxiosError=function(e){return oW.isObject(e)&&!0===e.isAxiosError},sl.mergeConfig=aB,sl.AxiosHeaders=AxiosHeaders,sl.formToJSON=e=>aw(oW.isHTMLForm(e)?new FormData(e):e),sl.getAdapter=st,sl.HttpStatusCode=ss,sl.default=sl;let{Axios:su,AxiosError:sc,CanceledError:sp,isCancel:sd,CancelToken:sf,VERSION:sh,all:sm,Cancel:sg,isAxiosError:sy,spread:sb,toFormData:sv,AxiosHeaders:sw,HttpStatusCode:s_,formToJSON:sE,getAdapter:sS,mergeConfig:sR,create:sO}=sl,sC={isNode:!1,platform:void 0,async compress(){throw Error("Request body compression is only available in Node.js.")},async createHttpAgents(){}};function sA(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}let sT=/at( async)? (?![A-Za-z]*HttpClient\.)([A-Za-z]+(Collection)?Client)\.(?!call \()([A-Za-z]+) \(/;let ApifyApiError=class ApifyApiError extends Error{name;clientMethod;statusCode;type;attempt;httpMethod;path;originalStack;data;constructor(e,t){let r,n,i,o=e.data;if(sQ(o)){let t=new TextDecoder().decode(e.data);try{o=JSON.parse(t)}catch{o=t}}if(o&&o.error){let{error:e}=o;r=e.message,n=e.type,i=e.data}else if(o){let e;try{e=JSON.stringify(o,null,2)}catch{e=`${o}`}r=`Unexpected error: ${e}`}super(r),this.name=this.constructor.name,this.clientMethod=this.#e(),this.statusCode=e.status,this.type=n,this.attempt=t,this.httpMethod=e.config?.method,this.path=this.#t(e);let a=this.stack;this.originalStack=a.slice(a.indexOf("\n")),this.stack=this.#r(),this.data=i}static fromResponse(e,t){return new(sx[e.status]??(e.status>=500?ServerError:ApifyApiError))(e,t)}#t(e){let t,r=e.config?.url;try{t=new URL(r)}catch{return r}return t.pathname+t.search}#e(){let e=this.stack.match(sT);return e?`${e[2]}.${e[4]}`:"unknown"}#r(){let{name:e,...t}=this,r=Object.entries(t).map(e=>{let[t,r]=e;return"originalStack"===t&&(t="stack"),` ${t}: ${r}`}).join("\n");return`${e}: ${this.message}
|
|
56
56
|
${r}`}};let InvalidRequestError=class InvalidRequestError extends ApifyApiError{};let UnauthorizedError=class UnauthorizedError extends ApifyApiError{};let ForbiddenError=class ForbiddenError extends ApifyApiError{};let NotFoundError=class NotFoundError extends ApifyApiError{};let ConflictError=class ConflictError extends ApifyApiError{};let RateLimitError=class RateLimitError extends ApifyApiError{};let ServerError=class ServerError extends ApifyApiError{};let sx={400:InvalidRequestError,401:UnauthorizedError,403:ForbiddenError,404:NotFoundError,409:ConflictError,429:RateLimitError},{localeError:sk}=ne();function sP(e){return null===e?"null":Array.isArray(e)?"array":typeof e}let sU=/^Invalid input: expected (an array of .+|a typed array|an object|object|array|function|number|string|boolean)$/;function sL(e){switch(typeof e){case"string":if(""===e)return"''";return e.length>200?`${e.slice(0,200)}… (${e.length-200} more characters)`:e;case"number":case"boolean":return String(e);case"bigint":return`${e}n`;default:return}}function sI(e){if("number"==typeof e&&Number.isNaN(e))return"received NaN";if(""===e)return"received an empty string";let t=sL(e);return void 0===t?`received ${sP(e)}`:`received the ${sP(e)} \`${t}\``}let ArgumentValidationError=class ArgumentValidationError extends Error{issues;cause;constructor(e,t,r){super(function(e,t,r){let n=[],i={total:0};for(let r of e.issues)!function e(t,r,n,i,o){let a=[...n,...t.path];if("invalid_union"===t.code){let n=t.errors.map(e=>e.reduce((e,t)=>Math.max(e,function e(t,r){let n=r+t.path.length;if("invalid_union"===t.code){let r=-1;for(let i of t.errors)for(let t of i)r=Math.max(r,e(t,n));return r}return n}(t,a.length)),-1)),s=Math.max(...n);for(let[l,u]of t.errors.entries())if(n[l]===s)for(let t of u)e(t,r,a,i,o);return}if(o.total+=1,i.length>=10)return;let s=a.length?` at \`${function(e){let t="";for(let r of e)"number"==typeof r?t+=`[${r}]`:t+=t?`.${String(r)}`:String(r);return t}(a)}\``:"",l=function(e,t){let r=e;for(let e of t){if(null===r||"object"!=typeof r)return;r=r[e]}return r}(r,a),u=sL(l),c=function(e,t){if("invalid_type"===e.code){if("number"===e.expected&&"number"==typeof t)return"Invalid input: expected a finite number";if("date"===e.expected&&"[object Date]"===Object.prototype.toString.call(t))return"Invalid input: expected a valid date"}return e.message}(t,l),p="",d=sU.exec(c),f=/, received (\S+)$/.exec(c),h=d?.[1].startsWith("an array of")?"array":d?.[1];d&&h!==(Number.isNaN(l)?"NaN":sP(l))?c+=`, ${sI(l)}`:f&&f[1]===sP(l)&&void 0!==u?c=`${c.slice(0,f.index)}, ${sI(l)}`:void 0===u||c.endsWith(`received ${u}`)||(p=`, got \`${u}\``),i.push(`${c}${s}${p}`)}(r,t,[],n,i);let o=r?n.map(e=>`${e} in \`${r}\``):[...n],a=i.total-n.length;return a>0&&o.push(`... and ${a} more problem${1===a?"":"s"}`),o.join("\n")}(e,t,r),{cause:e}),this.name="ArgumentValidationError",this.issues=e.issues,this.cause=e}};function sz(e,t,r){let n=t.safeParse(e,{error:sk});if(!n.success)throw new ArgumentValidationError(n.error,e,r);return n.data}iA(e=>"object"==typeof e&&null!==e,{error:"Invalid input: expected object"});let ResponseValidationError=class ResponseValidationError extends Error{issues;method;url;constructor(e,t,r){let n=r.method.toUpperCase(),i=new ArgumentValidationError(e,t).message;super(`Response from ${n} ${r.url} does not match the API schema:
|
|
57
57
|
${i}
|
|
58
|
-
The API returned something its OpenAPI specification does not describe. Please report this at https://github.com/apify/apify-client-js/issues.`,{cause:e}),this.name="ResponseValidationError",this.issues=e.issues,this.method=n,this.url=r.url}};var sN=JSON.parse('{"rE":"3.0.0-beta.24"}'),sj=r(606);let sD=new TextEncoder,{rE:s$}=sN,sM=["audio/","image/","video/"],sB=new Set(["application/epub+zip","application/gzip","application/java-archive","application/vnd.android.package-archive","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.rar","application/x-7z-compressed","application/x-bzip","application/x-bzip2","application/x-gzip","application/x-rar-compressed","application/x-xz","application/x-zip-compressed","application/zip","application/zstd","font/woff","font/woff2"]),sF=new Set(["audio/aiff","audio/basic","audio/l16","audio/l24","audio/midi","audio/vnd.wave","audio/wav","audio/wave","audio/x-aiff","audio/x-wav","image/bmp","image/tiff","image/vnd.adobe.photoshop","image/vnd.microsoft.icon","image/x-icon","image/x-ms-bmp"]),sq=["+json","+xml"];function sW(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let sZ=iA(sW,{error:"Invalid input: expected an object"}),{localeError:sH}=ne();function sK(e,t){let r=function(e){if("object"==typeof e&&e&&void 0!==e.data)return e.data;throw Error(`Expected response object with a "data" property, but received: ${e}`)}(e.data),n=t.safeParse(r,{error:sH});if(!n.success){let{method:t="GET",url:i=""}=e.config;throw new ResponseValidationError(n.error,r,{method:t,url:i})}return n.data}function sV(e){if(!(e instanceof NotFoundError))throw e}function sJ(e,t){if(!t)throw e;sV(e)}function sG(e){if(e){var t=sD.encode(JSON.stringify(e));let r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r)}}function sY(e){return void 0!==sj?sj.env?.[e]:void 0}function sQ(e){return ArrayBuffer.isView(e)?!sX(e,"DataView"):sX(e,"ArrayBuffer")}function sX(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function s0(e){if(null===e||"object"!=typeof e)return!1;let{on:t,pipe:r}=e;return"function"==typeof t&&"function"==typeof r}S=function(e,t){if("object"!==sA(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==sA(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(Symbol.asyncIterator,"string"),i="symbol"===sA(S)?S:String(S);let RequestQueuePaginationIterator=class RequestQueuePaginationIterator{#n;#i;#o;#a;constructor(e){this.#n=e.maxPageLimit,this.#o=e.limit,this.#a=e.cursor,this.#i=e.getPage}async *[i](){let e=this.#a,t=0;for(;;){let r=this.#o?Math.min(this.#n,this.#o-t):this.#n,n=await this.#i({limit:r,cursor:e});if(0===n.items.length||(yield n,t+=n.items.length,this.#o&&t>=this.#o||!n.nextCursor))return;e=n.nextCursor}}};let s1={limit:nK().min(0).optional(),offset:nK().min(0).optional(),chunkSize:nK().positive().optional()},s2=Symbol("scannedCount");function s4(e,t){for(let[r,n]of Object.entries(t??{}))if(void 0!==n){if(Array.isArray(n)){e.searchParams.set(r,n.join(","));continue}e.searchParams.set(r,String(n))}return e}let s6=nw().nonempty().refine(e=>"."!==e&&".."!==e,{error:"URL path must not contain dot segments"});function s3(e){return encodeURIComponent(sz(e,s6))}function s9(e){return Array.isArray(e)?e.map(s3).join("/"):e}let s8="toBSON",s5="toString",s7="_bsontype";RegExp(`(\uFF0E|^\uFF04|^${s8}$|^${s7}|^${s5}$)`),RegExp(".","g"),RegExp("^$"),RegExp(`^${s8}$`),RegExp(`^${s5}$`),RegExp(`^${s7}$`),RegExp("^(anonymous|page-not-found|docs|terms-of-use|about|pricing|privacy-policy|customers|request-form|request-solution|release-notes|jobs|api-reference|video-tutorials|acts|key-value-stores|schedules|account|sign-up|sign-in-discourse|admin|documentation|change-password|enroll-account|forgot-password|reset-password|sign-in|verify-email|live-status|browser-info|webhooks|health-check|api|change-log|dashboard|community|crawlers|ext|schemas|admin|administration|crawler|act|library|lib|apifier|team|contact|doc|documentation|for-business|for-developers|developers|business|integrations|job|setting|settings|privacy|policy|assets|help|config|configuration|terms|hiring|hire|status|status-page|solutions|support|market|marketplace|download|downloads|username|users|user|login|logout|signin|sign|signup|sign-out|signout|plugins|plug-ins|reset|password|passwords|square|profile-photos|profiles|true|false|js|css|img|images|image|partials|fonts|font|dynamic_templates|app|schedules|community|storage|storages|account|node_modules|bower_components|video|knowledgebase|forum|customers|blog|health-check|health|anim|forum_topics.json|forum_categories.json|me|you|him|she|it|external|actor|crawler|scheduler|api|sdk|puppeteer|webdriver|selenium|(selenium.*webdriver)|undefined|page-analyzer|wp-login.php|welcome.action|echo|proxy|super-proxy|gdpr|case-studies|use-cases|how-to|kb|cookies|cookie-policy|cookies-policy|powered-by|run|runs|actor|actors|act|acts|success-stories|roadmap|join-marketplace|presskit|press-kit|covid-19|covid|covid19|matfyz|ideas|public-actors|resources|partners|affiliate|industries|web-scraping|custom-solutions|solution-provider|alternatives|platform|freelancers|freelancer|partner|preview|templates|data-for-generative-ai|discord|praguecrawl|prague-crawl|bob|ai-agents|reel|video-reel|mcp|mcpc|model-context-protocol|modelcontextprotocol|apify.com|design-kit|press-kit|scrapers|professional-services|challenge|challange|1m-challenge|1m-usd-challenge|contact-sales|creator|creators|creator-plan|request-an-integration|whitepaper|adviser|crawlee|ultimate-scraper|agent-skills|key-value-store|request-queue|request-queues|build|builds|dataset|datasets|schedule|standby|pay-per-event|pay-per-result|pay-per-usage|ppe|ppr|compute-unit|compute-units|agent|agents|agentic|llms|llm|openai|anthropic|claude|copilot|mistral|gemini|llama|chatbot|chatgpt|prompt|prompts|embeddings|vectors|rag|agentic-commerce|agentic-economy|agentic-payments|a2a|a2b|a2p|ap2|b2a|acp|ucp|mpp|x402|l402|anp|agp|erc-8004|kya|kyapay|official|verified|certified|authorized|partner-official|gold-partner|premium-partner|staff|moderator|apify-admin|console|cli|studio|gateway|workbench|agents-marketplace|agents-store|mcp-server|mcp-servers|mcp-gateway|asia|latam|emea|apac|i18n|l10n|localization|localisation|usd|eur|gbp|jpy|cny|usdc|usdt|btc|eth|sol|crypto|fiat|stablecoin|stablecoins|payment|payments|payout|payouts|invoice|invoices|wallet|soc|soc2|iso|iso-27001|hipaa|ccpa|pci|pci-dss|dpa|dpia|dmca|sla|eula|aml|kyc|contributor|contributors|maintainer|maintainers|core-team|oss|open-source|opensource|open-source-software|spam|scam|phishing|malware|hack|hacked|giveaway|airdrop|bitcoin-giveaway|free-credits|free-money|launch|launches|webinar|webinars|meetup|meetups|summit|conference|conferences|org|orgs|organisation|workspace|workspaces|tenant|tenants|role|roles|permission|permissions|saml|scim|token|tokens|apikey|api-key|api-keys|keys|secret|secrets|coupon|coupons|discount|discounts|promos|refund|refunds|credit|credits|billing-portal|production|prod|canary|internal|restricted|conversations|reactions|mentions|channel|channels|inbox|no-reply|noreply|accessibility|imprint|impressum|trust|trust-center|security-center|brand|branding|support-team|abuse|outage|incident|incidents|what-is-new|whatsnew|index|index\\.html|(favicon\\.[a-z]+)|BingSiteAuth.xml|(google.+\\.html)|robots\\.txt|(sitemap\\.[a-z]+)|(apple-touch-icon.*)|security-whitepaper\\.pdf|security\\.txt|llms\\.txt|llms-full\\.txt|AGENTS\\.md|CLAUDE\\.md|auth\\.md|(\\..*)|(xxx-.*)|((.+[^a-z]|)porn([^a-z].+|))|((.+[^a-z]|)vagina([^a-z].+|))|((.+[^a-z]|)dildo([^a-z].+|))|((.+[^a-z]|)nsfw([^a-z].+|))|((.+[^a-z]|)hentai([^a-z].+|))|((.+[^a-z]|)cunt([^a-z].+|))|((.+[^a-z]|)fuck([^a-z].+|))|((.+[^a-z]|)shit([^a-z].+|))|((.+[^a-z]|)bitch([^a-z].+|))|((.+[^a-z]|)slut([^a-z].+|))|((.+[^a-z]|)whore([^a-z].+|))|((.+[^a-z]|)boob([^a-z].+|))|((.+[^a-z]|)tits([^a-z].+|))|((.+[^a-z]|)cock([^a-z].+|))|((.+[^a-z]|)anus([^a-z].+|))|((.+[^a-z]|)pussy([^a-z].+|))|((.+[^a-z]|)nude([^a-z].+|))|((.+[^a-z]|)penis([^a-z].+|))|((.+[^a-z]|)naked([^a-z].+|))|(install-cli\\..*)|([^0-9a-z].*)|(.*[^0-9a-z])|(.*[_.\\-]{2}.*)|0|about|access|account|accounts|activate|activities|activity|ad|add|address|adm|admin|administration|administrator|ads|adult|advertising|affiliate|affiliates|ajax|all|alpha|analysis|analytics|android|anon|anonymous|api|app|apps|archive|archives|article|asct|asset|atom|auth|authentication|avatar|backup|balancer-manager|banner|banners|beta|billing|bin|blog|blogs|board|book|bookmark|bot|bots|bug|business|cache|cadastro|calendar|call|campaign|cancel|captcha|career|careers|cart|categories|category|cgi|cgi-bin|changelog|chat|check|checking|checkout|client|cliente|clients|code|codereview|comercial|comment|comments|communities|community|company|compare|compras|config|configuration|connect|contact|contact-us|contact_us|contactus|contest|contribute|corp|create|css|dashboard|data|db|default|delete|demo|design|designer|destroy|dev|devel|developer|developers|diagram|diary|dict|dictionary|die|dir|direct_messages|directory|dist|doc|docs|documentation|domain|download|downloads|ecommerce|edit|editor|edu|education|email|employment|empty|end|enterprise|entries|entry|error|errors|eval|event|events|exit|explore|facebook|faq|favorite|favorites|feature|features|feed|feedback|feeds|file|files|first|flash|fleet|fleets|flog|follow|followers|following|forgot|form|forum|forums|founder|free|friend|friends|ftp|gadget|gadgets|game|games|get|gift|gifts|gist|github|graph|group|groups|guest|guests|help|home|homepage|host|hosting|hostmaster|hostname|howto|hpg|html|http|httpd|https|i|iamges|icon|icons|id|idea|ideas|image|images|imap|img|index|indice|info|information|inquiry|instagram|intranet|invitations|invite|ipad|iphone|irc|is|issue|issues|it|item|items|java|javascript|job|jobs|join|js|json|jump|knowledgebase|language|languages|last|ldap-status|legal|license|link|links|linux|list|lists|log|log-in|log-out|log_in|log_out|login|logout|logs|m|mac|mail|mail1|mail2|mail3|mail4|mail5|mailer|mailing|maintenance|manager|manual|map|maps|marketing|master|me|media|member|members|message|messages|messenger|microblog|microblogs|mine|mis|mob|mobile|movie|movies|mp3|msg|msn|music|musicas|mx|my|mysql|name|named|nan|navi|navigation|net|network|new|news|newsletter|nick|nickname|notes|noticias|notification|notifications|notify|ns|ns1|ns10|ns2|ns3|ns4|ns5|ns6|ns7|ns8|ns9|null|oauth|oauth_clients|offer|offers|official|old|online|openid|operator|order|orders|organization|organizations|overview|owner|owners|page|pager|pages|panel|password|payment|perl|phone|photo|photoalbum|photos|php|phpmyadmin|phppgadmin|phpredisadmin|pic|pics|ping|plan|plans|plugin|plugins|policy|pop|pop3|popular|portal|post|postfix|postmaster|posts|pr|premium|press|price|pricing|privacy|privacy-policy|privacy_policy|privacypolicy|private|product|products|profile|project|projects|promo|pub|public|purpose|put|python|query|random|ranking|read|readme|recent|recruit|recruitment|register|registration|release|remove|replies|report|reports|repositories|repository|req|request|requests|reset|roc|root|rss|ruby|rule|sag|sale|sales|sample|samples|save|school|script|scripts|search|secure|security|self|send|server|server-info|server-status|service|services|session|sessions|setting|settings|setup|share|shop|show|sign-in|sign-up|sign_in|sign_up|signin|signout|signup|site|sitemap|sites|smartphone|smtp|soporte|source|spec|special|sql|src|ssh|ssl|ssladmin|ssladministrator|sslwebmaster|staff|stage|staging|start|stat|state|static|stats|status|store|stores|stories|style|styleguide|stylesheet|stylesheets|subdomain|subscribe|subscription|subscriptions|suporte|support|svn|swf|sys|sysadmin|sysadministrator|system|tablet|tablets|tag|talk|task|tasks|team|teams|tech|telnet|term|terms|terms-of-service|terms_of_service|termsofservice|test|test1|test2|test3|teste|testing|tests|theme|themes|thread|threads|tmp|todo|tool|tools|top|topic|topics|tos|tour|translations|trends|tutorial|tux|tv|twitter|undef|unfollow|unsubscribe|update|upload|uploads|url|usage|user|username|users|usuario|vendas|ver|version|video|videos|visitor|watch|weather|web|webhook|webhooks|webmail|webmaster|website|websites|welcome|widget|widgets|wiki|win|windows|word|work|works|workshop|ww|wws|www|www1|www2|www3|www4|www5|www6|www7|wwws|wwww|xfn|xml|xmpp|xpg|xxx|yaml|year|yml|you|yourdomain|yourname|yoursite|yourusername)$","i"),(R=N||(N={})).MONGODB_PING="MONGODB_PING",R.MONGODB_READ="MONGODB_READ",R.MONGODB_WRITE="MONGODB_WRITE",R.REDIS="REDIS",R.REDIS_PING="REDIS_PING",R.REDIS_WRITE="REDIS_WRITE",r(310);var le=r(287).Buffer;async function lt(e){return new Promise((t,r)=>{let n=[];e.on("data",e=>{n.push(e)}).on("error",e=>r(e)).on("end",()=>t(le.concat(n)))})}r(287).Buffer,r(287).Buffer,(O=j||(j={})).VERSION="v",O.USER="u";let lr="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),ln=globalThis.crypto?.subtle;async function li(e,t){if(!ln)throw Error(`SubtleCrypto is not available in this environment.
|
|
58
|
+
The API returned something its OpenAPI specification does not describe. Please report this at https://github.com/apify/apify-client-js/issues.`,{cause:e}),this.name="ResponseValidationError",this.issues=e.issues,this.method=n,this.url=r.url}};var sN=JSON.parse('{"rE":"3.0.0-beta.26"}'),sj=r(606);let sD=new TextEncoder,{rE:s$}=sN,sM=["audio/","image/","video/"],sB=new Set(["application/epub+zip","application/gzip","application/java-archive","application/vnd.android.package-archive","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.rar","application/x-7z-compressed","application/x-bzip","application/x-bzip2","application/x-gzip","application/x-rar-compressed","application/x-xz","application/x-zip-compressed","application/zip","application/zstd","font/woff","font/woff2"]),sF=new Set(["audio/aiff","audio/basic","audio/l16","audio/l24","audio/midi","audio/vnd.wave","audio/wav","audio/wave","audio/x-aiff","audio/x-wav","image/bmp","image/tiff","image/vnd.adobe.photoshop","image/vnd.microsoft.icon","image/x-icon","image/x-ms-bmp"]),sq=["+json","+xml"];function sW(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let sZ=iA(sW,{error:"Invalid input: expected an object"}),{localeError:sH}=ne();function sK(e,t){let r=function(e){if("object"==typeof e&&e&&void 0!==e.data)return e.data;throw Error(`Expected response object with a "data" property, but received: ${e}`)}(e.data),n=t.safeParse(r,{error:sH});if(!n.success){let{method:t="GET",url:i=""}=e.config;throw new ResponseValidationError(n.error,r,{method:t,url:i})}return n.data}function sV(e){if(!(e instanceof NotFoundError))throw e}function sJ(e,t){if(!t)throw e;sV(e)}function sG(e){if(e){var t=sD.encode(JSON.stringify(e));let r="";for(let e=0;e<t.length;e+=32768)r+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(r)}}function sY(e){return void 0!==sj?sj.env?.[e]:void 0}function sQ(e){return ArrayBuffer.isView(e)?!sX(e,"DataView"):sX(e,"ArrayBuffer")}function sX(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function s0(e){if(null===e||"object"!=typeof e)return!1;let{on:t,pipe:r}=e;return"function"==typeof t&&"function"==typeof r}S=function(e,t){if("object"!==sA(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==sA(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(Symbol.asyncIterator,"string"),i="symbol"===sA(S)?S:String(S);let RequestQueuePaginationIterator=class RequestQueuePaginationIterator{#n;#i;#o;#a;constructor(e){this.#n=e.maxPageLimit,this.#o=e.limit,this.#a=e.cursor,this.#i=e.getPage}async *[i](){let e=this.#a,t=0;for(;;){let r=this.#o?Math.min(this.#n,this.#o-t):this.#n,n=await this.#i({limit:r,cursor:e});if(0===n.items.length||(yield n,t+=n.items.length,this.#o&&t>=this.#o||!n.nextCursor))return;e=n.nextCursor}}};let s1={limit:nK().min(0).optional(),offset:nK().min(0).optional(),chunkSize:nK().positive().optional()},s2=Symbol("scannedCount");function s4(e,t){for(let[r,n]of Object.entries(t??{}))if(void 0!==n){if(Array.isArray(n)){e.searchParams.set(r,n.join(","));continue}e.searchParams.set(r,String(n))}return e}let s6=nw().nonempty().refine(e=>"."!==e&&".."!==e,{error:"URL path must not contain dot segments"});function s3(e){return encodeURIComponent(sz(e,s6))}function s9(e){return Array.isArray(e)?e.map(s3).join("/"):e}let s8="toBSON",s5="toString",s7="_bsontype";RegExp(`(\uFF0E|^\uFF04|^${s8}$|^${s7}|^${s5}$)`),RegExp(".","g"),RegExp("^$"),RegExp(`^${s8}$`),RegExp(`^${s5}$`),RegExp(`^${s7}$`),RegExp("^(anonymous|page-not-found|docs|terms-of-use|about|pricing|privacy-policy|customers|request-form|request-solution|release-notes|jobs|api-reference|video-tutorials|acts|key-value-stores|schedules|account|sign-up|sign-in-discourse|admin|documentation|change-password|enroll-account|forgot-password|reset-password|sign-in|verify-email|live-status|browser-info|webhooks|health-check|api|change-log|dashboard|community|crawlers|ext|schemas|admin|administration|crawler|act|library|lib|apifier|team|contact|doc|documentation|for-business|for-developers|developers|business|integrations|job|setting|settings|privacy|policy|assets|help|config|configuration|terms|hiring|hire|status|status-page|solutions|support|market|marketplace|download|downloads|username|users|user|login|logout|signin|sign|signup|sign-out|signout|plugins|plug-ins|reset|password|passwords|square|profile-photos|profiles|true|false|js|css|img|images|image|partials|fonts|font|dynamic_templates|app|schedules|community|storage|storages|account|node_modules|bower_components|video|knowledgebase|forum|customers|blog|health-check|health|anim|forum_topics.json|forum_categories.json|me|you|him|she|it|external|actor|crawler|scheduler|api|sdk|puppeteer|webdriver|selenium|(selenium.*webdriver)|undefined|page-analyzer|wp-login.php|welcome.action|echo|proxy|super-proxy|gdpr|case-studies|use-cases|how-to|kb|cookies|cookie-policy|cookies-policy|powered-by|run|runs|actor|actors|act|acts|success-stories|roadmap|join-marketplace|presskit|press-kit|covid-19|covid|covid19|matfyz|ideas|public-actors|resources|partners|affiliate|industries|web-scraping|custom-solutions|solution-provider|alternatives|platform|freelancers|freelancer|partner|preview|templates|data-for-generative-ai|discord|praguecrawl|prague-crawl|bob|ai-agents|reel|video-reel|mcp|mcpc|model-context-protocol|modelcontextprotocol|apify.com|design-kit|press-kit|scrapers|professional-services|challenge|challange|1m-challenge|1m-usd-challenge|contact-sales|creator|creators|creator-plan|request-an-integration|whitepaper|adviser|crawlee|ultimate-scraper|agent-skills|key-value-store|request-queue|request-queues|build|builds|dataset|datasets|schedule|standby|pay-per-event|pay-per-result|pay-per-usage|ppe|ppr|compute-unit|compute-units|agent|agents|agentic|llms|llm|openai|anthropic|claude|copilot|mistral|gemini|llama|chatbot|chatgpt|prompt|prompts|embeddings|vectors|rag|agentic-commerce|agentic-economy|agentic-payments|a2a|a2b|a2p|ap2|b2a|acp|ucp|mpp|x402|l402|anp|agp|erc-8004|kya|kyapay|official|verified|certified|authorized|partner-official|gold-partner|premium-partner|staff|moderator|apify-admin|console|cli|studio|gateway|workbench|agents-marketplace|agents-store|mcp-server|mcp-servers|mcp-gateway|asia|latam|emea|apac|i18n|l10n|localization|localisation|usd|eur|gbp|jpy|cny|usdc|usdt|btc|eth|sol|crypto|fiat|stablecoin|stablecoins|payment|payments|payout|payouts|invoice|invoices|wallet|soc|soc2|iso|iso-27001|hipaa|ccpa|pci|pci-dss|dpa|dpia|dmca|sla|eula|aml|kyc|contributor|contributors|maintainer|maintainers|core-team|oss|open-source|opensource|open-source-software|spam|scam|phishing|malware|hack|hacked|giveaway|airdrop|bitcoin-giveaway|free-credits|free-money|launch|launches|webinar|webinars|meetup|meetups|summit|conference|conferences|org|orgs|organisation|workspace|workspaces|tenant|tenants|role|roles|permission|permissions|saml|scim|token|tokens|apikey|api-key|api-keys|keys|secret|secrets|coupon|coupons|discount|discounts|promos|refund|refunds|credit|credits|billing-portal|production|prod|canary|internal|restricted|conversations|reactions|mentions|channel|channels|inbox|no-reply|noreply|accessibility|imprint|impressum|trust|trust-center|security-center|brand|branding|support-team|abuse|outage|incident|incidents|what-is-new|whatsnew|index|index\\.html|(favicon\\.[a-z]+)|BingSiteAuth.xml|(google.+\\.html)|robots\\.txt|(sitemap\\.[a-z]+)|(apple-touch-icon.*)|security-whitepaper\\.pdf|security\\.txt|llms\\.txt|llms-full\\.txt|AGENTS\\.md|CLAUDE\\.md|auth\\.md|(\\..*)|(xxx-.*)|((.+[^a-z]|)porn([^a-z].+|))|((.+[^a-z]|)vagina([^a-z].+|))|((.+[^a-z]|)dildo([^a-z].+|))|((.+[^a-z]|)nsfw([^a-z].+|))|((.+[^a-z]|)hentai([^a-z].+|))|((.+[^a-z]|)cunt([^a-z].+|))|((.+[^a-z]|)fuck([^a-z].+|))|((.+[^a-z]|)shit([^a-z].+|))|((.+[^a-z]|)bitch([^a-z].+|))|((.+[^a-z]|)slut([^a-z].+|))|((.+[^a-z]|)whore([^a-z].+|))|((.+[^a-z]|)boob([^a-z].+|))|((.+[^a-z]|)tits([^a-z].+|))|((.+[^a-z]|)cock([^a-z].+|))|((.+[^a-z]|)anus([^a-z].+|))|((.+[^a-z]|)pussy([^a-z].+|))|((.+[^a-z]|)nude([^a-z].+|))|((.+[^a-z]|)penis([^a-z].+|))|((.+[^a-z]|)naked([^a-z].+|))|(install-cli\\..*)|([^0-9a-z].*)|(.*[^0-9a-z])|(.*[_.\\-]{2}.*)|0|about|access|account|accounts|activate|activities|activity|ad|add|address|adm|admin|administration|administrator|ads|adult|advertising|affiliate|affiliates|ajax|all|alpha|analysis|analytics|android|anon|anonymous|api|app|apps|archive|archives|article|asct|asset|atom|auth|authentication|avatar|backup|balancer-manager|banner|banners|beta|billing|bin|blog|blogs|board|book|bookmark|bot|bots|bug|business|cache|cadastro|calendar|call|campaign|cancel|captcha|career|careers|cart|categories|category|cgi|cgi-bin|changelog|chat|check|checking|checkout|client|cliente|clients|code|codereview|comercial|comment|comments|communities|community|company|compare|compras|config|configuration|connect|contact|contact-us|contact_us|contactus|contest|contribute|corp|create|css|dashboard|data|db|default|delete|demo|design|designer|destroy|dev|devel|developer|developers|diagram|diary|dict|dictionary|die|dir|direct_messages|directory|dist|doc|docs|documentation|domain|download|downloads|ecommerce|edit|editor|edu|education|email|employment|empty|end|enterprise|entries|entry|error|errors|eval|event|events|exit|explore|facebook|faq|favorite|favorites|feature|features|feed|feedback|feeds|file|files|first|flash|fleet|fleets|flog|follow|followers|following|forgot|form|forum|forums|founder|free|friend|friends|ftp|gadget|gadgets|game|games|get|gift|gifts|gist|github|graph|group|groups|guest|guests|help|home|homepage|host|hosting|hostmaster|hostname|howto|hpg|html|http|httpd|https|i|iamges|icon|icons|id|idea|ideas|image|images|imap|img|index|indice|info|information|inquiry|instagram|intranet|invitations|invite|ipad|iphone|irc|is|issue|issues|it|item|items|java|javascript|job|jobs|join|js|json|jump|knowledgebase|language|languages|last|ldap-status|legal|license|link|links|linux|list|lists|log|log-in|log-out|log_in|log_out|login|logout|logs|m|mac|mail|mail1|mail2|mail3|mail4|mail5|mailer|mailing|maintenance|manager|manual|map|maps|marketing|master|me|media|member|members|message|messages|messenger|microblog|microblogs|mine|mis|mob|mobile|movie|movies|mp3|msg|msn|music|musicas|mx|my|mysql|name|named|nan|navi|navigation|net|network|new|news|newsletter|nick|nickname|notes|noticias|notification|notifications|notify|ns|ns1|ns10|ns2|ns3|ns4|ns5|ns6|ns7|ns8|ns9|null|oauth|oauth_clients|offer|offers|official|old|online|openid|operator|order|orders|organization|organizations|overview|owner|owners|page|pager|pages|panel|password|payment|perl|phone|photo|photoalbum|photos|php|phpmyadmin|phppgadmin|phpredisadmin|pic|pics|ping|plan|plans|plugin|plugins|policy|pop|pop3|popular|portal|post|postfix|postmaster|posts|pr|premium|press|price|pricing|privacy|privacy-policy|privacy_policy|privacypolicy|private|product|products|profile|project|projects|promo|pub|public|purpose|put|python|query|random|ranking|read|readme|recent|recruit|recruitment|register|registration|release|remove|replies|report|reports|repositories|repository|req|request|requests|reset|roc|root|rss|ruby|rule|sag|sale|sales|sample|samples|save|school|script|scripts|search|secure|security|self|send|server|server-info|server-status|service|services|session|sessions|setting|settings|setup|share|shop|show|sign-in|sign-up|sign_in|sign_up|signin|signout|signup|site|sitemap|sites|smartphone|smtp|soporte|source|spec|special|sql|src|ssh|ssl|ssladmin|ssladministrator|sslwebmaster|staff|stage|staging|start|stat|state|static|stats|status|store|stores|stories|style|styleguide|stylesheet|stylesheets|subdomain|subscribe|subscription|subscriptions|suporte|support|svn|swf|sys|sysadmin|sysadministrator|system|tablet|tablets|tag|talk|task|tasks|team|teams|tech|telnet|term|terms|terms-of-service|terms_of_service|termsofservice|test|test1|test2|test3|teste|testing|tests|theme|themes|thread|threads|tmp|todo|tool|tools|top|topic|topics|tos|tour|translations|trends|tutorial|tux|tv|twitter|undef|unfollow|unsubscribe|update|upload|uploads|url|usage|user|username|users|usuario|vendas|ver|version|video|videos|visitor|watch|weather|web|webhook|webhooks|webmail|webmaster|website|websites|welcome|widget|widgets|wiki|win|windows|word|work|works|workshop|ww|wws|www|www1|www2|www3|www4|www5|www6|www7|wwws|wwww|xfn|xml|xmpp|xpg|xxx|yaml|year|yml|you|yourdomain|yourname|yoursite|yourusername)$","i"),(R=N||(N={})).MONGODB_PING="MONGODB_PING",R.MONGODB_READ="MONGODB_READ",R.MONGODB_WRITE="MONGODB_WRITE",R.REDIS="REDIS",R.REDIS_PING="REDIS_PING",R.REDIS_WRITE="REDIS_WRITE",r(310);var le=r(287).Buffer;async function lt(e){return new Promise((t,r)=>{let n=[];e.on("data",e=>{n.push(e)}).on("error",e=>r(e)).on("end",()=>t(le.concat(n)))})}r(287).Buffer,r(287).Buffer,(O=j||(j={})).VERSION="v",O.USER="u";let lr="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),ln=globalThis.crypto?.subtle;async function li(e,t){if(!ln)throw Error(`SubtleCrypto is not available in this environment.
|
|
59
59
|
Please ensure you're running in an environment that supports Web Crypto API,
|
|
60
60
|
or submit an issue to https://github.com/apify/apify-shared-js so we can help you further.`);let r=new TextEncoder,n=await ln.importKey("raw",r.encode(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),i=Array.from(new Uint8Array(await ln.sign("HMAC",n,r.encode(t)))).map(e=>e.toString(16).padStart(2,"0")).join("").substring(0,30);var o=BigInt(`0x${i}`);if(0n===o)return lr[0];let a="";for(;o>0n;)a=lr[Number(o%62n)]+a,o/=62n;return a}async function lo({resourceId:e,urlSigningSecretKey:t,expiresInMillis:r,version:n=0}){let i=r?new Date().getTime()+r:0,o=await li(t,`${n}.${i}.${e}`);var a=new TextEncoder().encode(`${n}.${i}.${o}`);let s="";for(let e=0;e<a.length;e++)s+=String.fromCharCode(a[e]);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}r(287).Buffer;var la=r(597);let ls="application/json",ll=[RegExp(`^${ls}`,"i"),/^application\/.*xml$/i,/^text\//i],lu=iA(e=>"object"==typeof e&&null!==e&&"string"==typeof e.contentEncoding&&"function"==typeof e.compress,{error:"Invalid input: expected an HttpCompressor"}),lc=n5({quality:nJ().min(0).max(11).default(6)});let BrotliHttpCompressor=class BrotliHttpCompressor{contentEncoding="br";#s;constructor(e={}){let{quality:t}=sz(e,lc,"BrotliHttpCompressorOptions");this.#s=t}async compress(e){return sC.compress(e,{algorithm:"br",quality:this.#s})}};let lp=n5({quality:nJ().min(1).max(9).default(6)});let GzipHttpCompressor=class GzipHttpCompressor{contentEncoding="gzip";#s;constructor(e={}){let{quality:t}=sz(e,lp,"GzipHttpCompressorOptions");this.#s=t}async compress(e){return sC.compress(e,{algorithm:"gzip",quality:this.#s})}};let ld=it([iu(["brotli","gzip"]),lu]);let InvalidResponseBodyError=class InvalidResponseBodyError extends Error{code;response;constructor(e,t){super(`Response body could not be parsed.
|
|
61
61
|
Cause:${t.message}`),this.name=this.constructor.name,this.code="invalid-response-body",this.response=e,this.cause=t}};let lf=nK().gt(0);let Statistics=class Statistics{calls=0;requests=0;rateLimitErrors=[];addRateLimitError(e){sz(e,lf);let t=e-1;this.#l(t),this.rateLimitErrors[t]++}#l(e){if(this.rateLimitErrors.length<=e)for(let t=0;t<=e;t++)"number"!=typeof this.rateLimitErrors[t]&&(this.rateLimitErrors[t]=0)}};let lh=it([iu(["short","medium","long","noTimeout"]),nK().positive()]).optional(),lm={timeoutSecs:lh},lg=n5(lm);var ly=r(287).Buffer;let lb="application/json",lv="application/x-www-form-urlencoded",lw={maxRetries:nK().int().nonnegative(),minDelayBetweenRetriesMillis:nK().nonnegative(),timeoutShortSecs:nK().positive(),timeoutMediumSecs:nK().positive(),timeoutLongSecs:nK().positive(),timeoutMaxSecs:nK().positive()},l_=n7(lw).partial(),lE=new Set(["Blob","File","FormData","ReadableStream"]);let HttpClient=class HttpClient{stats;logger;maxRetries;minDelayBetweenRetriesMillis;timeoutMillis;timeoutMaxMillis;httpCompressor;defaultHeaders;constructor(e={}){sz(e,l_,"HttpClientOptions"),this.stats=e.stats??new Statistics,this.logger=e.logger??i9.child({prefix:"ApifyClient"}),this.maxRetries=e.maxRetries??8,this.minDelayBetweenRetriesMillis=e.minDelayBetweenRetriesMillis??500,this.timeoutMillis={short:(e.timeoutShortSecs??5)*1e3,medium:(e.timeoutMediumSecs??30)*1e3,long:(e.timeoutLongSecs??360)*1e3},this.timeoutMaxMillis=(e.timeoutMaxSecs??360)*1e3,this.httpCompressor=function(e){if("string"!=typeof e)return e;switch(e){case"gzip":return new GzipHttpCompressor;case"brotli":return new BrotliHttpCompressor}}(e.compression??"brotli");let t={},r=e.workflowKey||sY("APIFY_WORKFLOW_KEY");if(r&&(t["X-Apify-Workflow-Key"]=r),sC.platform){var n;let r=!!sY("APIFY_IS_AT_HOME"),i=`ApifyClient/${s$} (${sC.platform}); isAtHome/${r}`;e.userAgentSuffix&&(i+=`; ${(Array.isArray(n=e.userAgentSuffix)?n:[n]).join("; ")}`),t["User-Agent"]=i}e.token&&(t.Authorization=`Bearer ${e.token}`),this.defaultHeaders=lO(t,e.headers)}setDefaultAuthorization(e){void 0===lR(this.defaultHeaders,"authorization")&&(this.defaultHeaders.Authorization=`Bearer ${e}`)}isTimeoutError(e){return e instanceof Error&&"TimeoutError"===e.name}isRetryableTransportError(e){return!1}async close(){}async sendRequest(e){throw Error(`Implement sendRequest() to send ${e.method} ${e.url}, or override call() entirely.`)}async call(e){e.signal?.throwIfAborted(),this.stats.calls++;let{headers:t,body:r}=await this.prepareRequest(e),n=this.buildUrl(e.url,e.params);return this.#u(async(i,o)=>this.#c({config:e,url:n,headers:t,body:r,attempt:o,stopRetrying:i}),e.signal)}async prepareRequest(e){let t=lO(this.defaultHeaders,e.headers),r=function(e,t,r){if(null!=e){if(s0(e))return e;if(sQ(e))return!sC.isNode||ly.isBuffer(e)?e:ArrayBuffer.isView(e)?ly.from(e.buffer,e.byteOffset,e.byteLength):ly.from(e);if("string"==typeof e)return e;if("object"==typeof e){var n,i;if(e instanceof URLSearchParams)return void 0===lR(t,"content-type")&&(t["Content-Type"]=`${lv};charset=utf-8`),e.toString();let o=(n=e,Object.prototype.toString.call(n).slice(8,-1));if(lE.has(o))throw TypeError(`Unsupported request body type: ${o}`);void 0===lR(t,"content-type")&&(t["Content-Type"]=lb);let a=lR(t,"content-type");if(lC(a)===lv){let t,r;return i=e,t=new URLSearchParams,r=(e,n)=>{if(null!=n)if(n instanceof Date)t.append(e,n.toISOString());else if(sQ(n)){var i;t.append(e,(ArrayBuffer.isView(i=n)?ly.from(i.buffer,i.byteOffset,i.byteLength):ly.from(i)).toString("base64"))}else if(Array.isArray(n)){let t=n.some(lT);n.forEach((n,i)=>r(t?`${e}[${i}]`:`${e}[]`,n))}else"object"==typeof n?Object.entries(n).forEach(t=>{let[n,i]=t;return r(`${e}[${n}]`,i)}):t.append(e,String(n))},Object.entries(i).forEach(e=>{let[t,n]=e;return r(t,n)}),t.toString()}return JSON.stringify(e,r&&lC(a)===lb?lA:void 0)}throw TypeError(`Unsupported request body type: ${typeof e}`)}}(e.data,t,e.stringifyFunctions),n=function(e,t){if(void 0===e||!sC.isNode||void 0!==lR(t,"content-encoding")||!function(e){if(!e)return!0;let t=e.split(";",1)[0].trim().toLowerCase();return!!(sF.has(t)||sq.some(e=>t.endsWith(e)))||!sB.has(t)&&!sM.some(e=>t.startsWith(e))}(lR(t,"content-type")))return;let r="string"==typeof e?sD.encode(e):sQ(e)?ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e):void 0;return r&&r.byteLength>=1024?r:void 0}(r,t);return n&&(r=await this.httpCompressor.compress(ly.from(n.buffer,n.byteOffset,n.byteLength)),function(e,t){let r=t.toLowerCase();for(let t of Object.keys(e))t.toLowerCase()===r&&delete e[t]}(t=lO(t,{"Content-Encoding":this.httpCompressor.contentEncoding}),"content-length")),{headers:t,body:r}}buildUrl(e,t){let r=[];for(let[e,n]of Object.entries(t??{}))void 0!==n&&(n instanceof Date?r.push([e,n.toISOString()]):"boolean"==typeof n?r.push([e,String(Number(n))]):r.push([e,String(n)]));if(0===r.length)return e;let n=new URLSearchParams(r).toString();return`${e}${e.includes("?")?"&":"?"}${n}`}computeTimeoutMillis(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"medium";if("noTimeout"===t)return;let r="number"==typeof t?1e3*t:this.timeoutMillis[t];return r>this.timeoutMaxMillis&&this.logger.warningOnce(`The requested timeout of ${r/1e3}s exceeds timeoutMaxSecs (${this.timeoutMaxMillis/1e3}s) and is capped at it. Raise timeoutMaxSecs on the client to allow longer request timeouts.`),Math.min(r*2**(e-1),this.timeoutMaxMillis)}async #u(e,t){let r=!0,n=()=>{r=!1};for(let i=1;i<=this.maxRetries;i++){t?.throwIfAborted();try{return await e(n,i)}catch(e){if(t?.throwIfAborted(),!r)throw e;this.#p(e,i)}let o=this.minDelayBetweenRetriesMillis*2**(i-1)*(1+Math.random());await lS(o,t)}return t?.throwIfAborted(),e(n,this.maxRetries+1)}async #c(e){let t,r,{config:n,url:i,headers:o,body:a,attempt:s,stopRetrying:l}=e;this.stats.requests++;let u=s0(n.data);try{t=await this.sendRequest({method:n.method,url:i,headers:o,body:a,timeoutMillis:this.computeTimeoutMillis(s,n.timeoutSecs),stream:"stream"===n.responseType,signal:n.signal})}catch(e){throw n.signal?.throwIfAborted(),this.#d(e,n,l),e}t.status>=300&&s0(t.body)&&(t.body=await lt(t.body).catch(()=>void 0));try{r=this.#f(t,n)}catch(e){throw u&&(this.#h(),l()),e}let c={status:t.status,headers:t.headers,data:r,config:n};if(t.status<300)return c;429===t.status&&this.stats.addRateLimitError(s);let p=ApifyApiError.fromResponse(c,s);throw this.#m(t.status)?u&&(this.#h(),l()):l(),p}#f(e,t){let{body:r}=e;if("stream"===t.responseType||"buffer"===t.responseType||void 0===r||s0(r))return r;if(0!==r.byteLength)try{var n;return function(e,t){var r;let n,i;try{let e=la.q(t);n=e.type,i=e.parameters.charset}catch{return e}if(!((r=n)&&ll.some(e=>e.test(r))))return e;let o=function(e){try{return new TextDecoder(e,{ignoreBOM:!0})}catch{return}}(i);if(!o)return e;let a=o.decode(e);return n===ls?JSON.parse(a):a}(r,(n=e.headers["content-type"],(Array.isArray(n)?n[0]:n)??""))}catch(t){throw new InvalidResponseBodyError(e,t)}}#d(e,t,r){t.doNotRetryTimeouts&&this.isTimeoutError(e)||!this.isRetryableTransportError(e)?r():s0(t.data)&&(this.#h(),r())}#m(e){return 429===e||e>=500}#h(){this.logger.warningOnce("Request body was a stream - retrying will not work, as part of it was already consumed."),this.logger.warningOnce("If you want Apify client to handle retries for you, collect the stream into a buffer before sending it.")}#p(e,t){t===Math.round(this.maxRetries/2)&&this.logger.warning(`API request failed ${t} times. Max attempts: ${this.maxRetries+1}.
|