apify-client 3.0.0-beta.55 → 3.0.0-beta.56
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 +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -60,7 +60,7 @@ ${JSON.stringify(e,null,2)}`}_parseLoggerException(e,t=1){let r=[];e.type&&r.pus
|
|
|
60
60
|
${o.map(e=>`${" ".repeat(2*t)}${e}`).join("\n")}`}};let Log=class Log{LEVELS=z;options;preferredFieldsMap;warningsOnceLogged=new Set;constructor(e={}){let t;if(this.options={...{level:(t=ob.env.APIFY_LOG_LEVEL)?Number.isFinite(+t)?+t:z[t]?z[t]:+t:z.INFO,maxDepth:4,gradualLimitFactor:.5,maxStringLength:1e3,maxArrayLength:500,maxFields:20,preferredFields:[...oy],prefix:null,suffix:null,truncationSuffix:og,truncationFlagKey:om,logger:(e=>{switch(e){case N.JSON:return new logger_json_LoggerJson;case N.TEXT:default:return new LoggerText}})(function(){let e=ob.env[os]||N.TEXT;switch(e.toLowerCase()){case N.JSON.toLowerCase():return N.JSON;case N.TEXT.toLowerCase():return N.TEXT;default:return console.warn(`Unknown value for environment variable ${os}: ${e}`),N.TEXT}}()),data:{}},...e},!z[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=og,truncationFlagKey:c=om}=r;if("string"==typeof t)return t.length>o?function(e,t,r=og){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,[oh]:!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(!z[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(z.ERROR,e,t)}exception(e,t,r){this.internal(z.ERROR,t,r,e)}softFail(e,t){this.internal(z.SOFT_FAIL,e,t)}warning(e,t){this.internal(z.WARNING,e,t)}info(e,t){this.internal(z.INFO,e,t)}debug(e,t){this.internal(z.DEBUG,e,t)}perf(e,t){this.internal(z.PERF,e,t)}warningOnce(e){this.warningsOnceLogged.has(e)||(this.warningsOnceLogged.add(e),this.warning(e))}deprecated(e){this.warningOnce(e)}};let oT=new Log;function ox(e,t){return function(){return e.apply(t,arguments)}}var ok=r("z");let{toString:oP}=Object.prototype,{getPrototypeOf:oU}=Object,{iterator:oI,toStringTag:oL}=Symbol,oz=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),oN=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),oj=(e,t,r)=>e===Object.prototype||!r&&null===t,oD=(e,t)=>{let r=e,n=[];for(;null!=r&&-1===n.indexOf(r);){n.push(r);let i=oU(r);if(oj(r,i,r===e))break;if(oz(r,t))return!0;r=i}return!1},o$=(f=Object.create(null),e=>{let t=oP.call(e);return f[t]||(f[t]=t.slice(8,-1).toLowerCase())}),oM=e=>(e=e.toLowerCase(),t=>o$(t)===e),oB=e=>t=>typeof t===e,{isArray:oF}=Array,oq=oB("undefined");function oW(e){return null!==e&&!oq(e)&&null!==e.constructor&&!oq(e.constructor)&&oH(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let oZ=oM("ArrayBuffer"),oK=oB("string"),oH=oB("function"),oV=oB("number"),oJ=e=>null!==e&&"object"==typeof e,oG=e=>{if(!oJ(e))return!1;let t=oU(e);return(null===t||t===Object.prototype||null===oU(t))&&!oD(e,oL)&&!oD(e,oI)},oY=oM("Date"),oQ=oM("File"),oX=oM("Blob"),o0=oM("FileList"),o1=oM("Set"),o2="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},o4=void 0!==o2.FormData?o2.FormData:void 0,o3=oM("URLSearchParams"),[o9,o6,o5,o8]=["ReadableStream","Request","Response","Headers"].map(oM);function o7(e,t,{allOwnKeys:r=!1}={}){let n,i;if(null!=e)if("object"!=typeof e&&(e=[e]),oF(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{let i;if(oW(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 ae(e,t){let r;if(oW(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 at="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,ar=e=>!oq(e)&&e!==at,an=(h="u">typeof Uint8Array&&oU(Uint8Array),e=>h&&e instanceof h),ai=oM("HTMLFormElement"),{propertyIsEnumerable:ao}=Object.prototype,aa=oM("RegExp"),as=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};o7(r,(r,i)=>{let o;!1!==(o=t(r,i,e))&&(n[i]=o||r)}),Object.defineProperties(e,n)},al=oM("AsyncFunction"),au=(b="function"==typeof setImmediate,v=oH(at.postMessage),b?setImmediate:v?(w=`axios@${Math.random()}`,_=[],at.addEventListener("message",({source:e,data:t})=>{e===at&&t===w&&_.length&&_.shift()()},!1),e=>{_.push(e),at.postMessage(w,"*")}):e=>setTimeout(e)),ac="u">typeof queueMicrotask?queueMicrotask.bind(at):void 0!==ok&&ok.nextTick||au,ap=e=>null!=e&&oH(e[oI]);var ad={isArray:oF,isArrayBuffer:oZ,isBuffer:oW,isFormData:e=>{if(!e)return!1;if(o4&&e instanceof o4)return!0;let t=oU(e);if(!t||t===Object.prototype||!oH(e.append))return!1;let r=o$(e);return"formdata"===r||"object"===r&&oH(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&oZ(e.buffer)},isString:oK,isNumber:oV,isBoolean:e=>!0===e||!1===e,isObject:oJ,isPlainObject:oG,isEmptyObject:e=>{if(!oJ(e)||oW(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:o9,isRequest:o6,isResponse:o5,isHeaders:o8,isUndefined:oq,isDate:oY,isFile:oQ,isReactNativeBlob:e=>!!(e&&void 0!==e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:oX,isRegExp:aa,isFunction:oH,isStream:e=>oJ(e)&&oH(e.pipe),isURLSearchParams:o3,isTypedArray:an,isFileList:o0,forEach:o7,merge:function e(...t){let{caseless:r,skipUndefined:n}=ar(this)&&this||{},i={},o=(t,o)=>{if("__proto__"===o||"constructor"===o||"prototype"===o)return;let a=r&&"string"==typeof o&&ae(i,o)||o,s=oz(i,a)?i[a]:void 0;oG(s)&&oG(t)?i[a]=e(s,t):oG(t)?i[a]=e({},t):oF(t)?i[a]=t.slice():n&&oq(t)||(i[a]=t)};for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!r||oW(r)||(o7(r,o),"object"!=typeof r||oF(r)))continue;let n=Object.getOwnPropertySymbols(r);for(let e=0;e<n.length;e++){let t=n[e];ao.call(r,t)&&o(r[t],t)}}return i},extend:(e,t,r,{allOwnKeys:n}={})=>(o7(t,(t,n)=>{r&&oH(t)?Object.defineProperty(e,n,{__proto__:null,value:ox(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&&oU(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype)return t},kindOf:o$,kindOfTest:oM,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(oF(e))return e;let t=e.length;if(!oV(t))return null;let r=Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{let r,n=(e&&e[oI]).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:ai,hasOwnProperty:oz,hasOwnProp:oz,hasOwnInPrototypeChain:oD,getSafeProp:(e,t)=>null!=e&&oD(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;let t=oU(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(oN(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:oU(o);if(oj(o,a,o===e))break;let s=Object.getOwnPropertyNames(o);for(let t of(Object.getOwnPropertySymbols&&s.push(...Object.getOwnPropertySymbols(o)),s))!oN(t)&&(oz(n,t)||(r[t]=e[t],n[t]=!0));o=a}return r},reduceDescriptors:as,freezeMethods:e=>{as(e,(t,r)=>{if(oH(e)&&["arguments","caller","callee"].includes(r))return!1;if(oH(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(oF(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:ae,global:at,isContextDefined:ar,isSpecCompliantForm:function(e){return!!(e&&oH(e.append)&&"FormData"===e[oL]&&e[oI])},toJSONObject:e=>{let t=new WeakSet,r=e=>{if(oJ(e)){if(t.has(e))return;if(oW(e))return e;if(!("toJSON"in e)){let n;if(t.add(e),o1(e))for(let t of(n=[],e)){let e=r(t);oq(e)||n.push(e)}else n=oF(e)?[]:{},o7(e,(e,t)=>{let i=r(e);oq(i)||(n[t]=i)});return t.delete(e),n}}return e};return r(e)},isAsyncFn:al,isThenable:e=>e&&(oJ(e)||oH(e))&&oH(e.then)&&oH(e.catch),setImmediate:au,asap:ac,isIterable:ap,isSafeIterable:e=>null!=e&&oD(e,oI)&&ap(e)};let af=ad.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"]),ah=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),am=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ag(e,t){return ad.isArray(e)?e.map(e=>ag(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 ay(e){let t=Object.create(null);return ad.forEach(e.toJSON(),(e,r)=>{t[r]=ag(e,am)}),t}let ab=Symbol("internals");function av(e){return e&&String(e).trim().toLowerCase()}function aw(e){return!1===e||null==e?e:ad.isArray(e)?e.map(aw):ag(String(e),ah)}let a_=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function aE(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 aS(e,t,r,n,i){if(ad.isFunction(n))return n.call(this,t,r);if(i&&(t=r),ad.isString(t)){if(ad.isString(n))return -1!==t.indexOf(n);if(ad.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=av(t);if(!i)return;let o=ad.findKey(n,i);o&&void 0!==n[o]&&!0!==r&&(void 0!==r||!1===n[o])||(n[o||t]=aw(e))}let o=(e,t)=>ad.forEach(e,(e,r)=>i(e,r,t));if(ad.isPlainObject(e)||e instanceof this.constructor)o(e,t);else{let n;if(ad.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=ad.hasOwnProp(s,r);!r||t&&ad.hasOwnProp(af,r)||("set-cookie"===r?t?s[r].push(n):s[r]=[n]:s[r]=t?s[r]+", "+n:n)}),s),t)}else if(ad.isObject(e)&&ad.isSafeIterable(e)){let r=Object.create(null),n,i;for(let t of e){if(!ad.isArray(t))throw TypeError("Object iterator must return a key-value pair");i=t[0],ad.hasOwnProp(r,i)?(n=r[i],r[i]=ad.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=av(e)){let r=ad.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(ad.isFunction(t))return t.call(this,e,r);if(ad.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=av(e)){let r=ad.findKey(this,e);return!!(r&&void 0!==this[r]&&(!t||aS(this,this[r],r,t)))}return!1}delete(e,t){let r=this,n=!1;function i(e){if(e=av(e)){let i=ad.findKey(r,e);i&&(!t||aS(r,r[i],i,t))&&(delete r[i],n=!0)}}return ad.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||aS(this,this[i],i,e,!0))&&(delete this[i],n=!0)}return n}normalize(e){let t=this,r={};return ad.forEach(this,(n,i)=>{let o=ad.findKey(r,i);if(o){t[o]=aw(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]=aw(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return ad.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&ad.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 ad.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=aE(r.slice(n,e)),o=i.indexOf("=");if(o<1)return;let a=aE(i.slice(0,o));if(!a_.test(a))return;let s=a.toLowerCase();if("__proto__"===s||"constructor"===s||"prototype"===s)return;let l=aE(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[ab]=this[ab]={accessors:{}}).accessors,r=this.prototype;function n(e){let n=av(e);if(!t[n]){let i;i=ad.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 ad.isArray(e)?e.forEach(n):n(e),this}};AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ad.reduceDescriptors(AxiosHeaders.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),ad.freezeMethods(AxiosHeaders);let aR="[REDACTED ****]";function aO(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&&ad.isArray(e.errors)&&e.errors.length&&(a=e.errors.map(e=>{try{return e&&e.message?aO(e.message):aO(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&&ad.hasOwnProp(n,"redact")?n.redact:void 0,o=ad.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||ad.isBuffer(n))return n;if(-1===t.indexOf(n)){if(n instanceof AxiosHeaders&&(n=n.toJSON()),t.push(n),ad.isArray(n))i=[],n.forEach((e,t)=>{let n=r(e);ad.isUndefined(n)||(i[t]=n)});else{if(!ad.isPlainObject(n)&&function(e){if(ad.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(ad.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())?aR:r(o);ad.isUndefined(n)||(i[t]=n)}}return t.pop(),i}})(n)):ad.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 aC=AxiosError;function aA(e){return ad.isPlainObject(e)||ad.isArray(e)}function aT(e){return ad.endsWith(e,"[]")?e.slice(0,-2):e}function ax(e,t,r){return e?e.concat(t).map(function(e,t){return e=aT(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}let ak=ad.toFlatObject(ad,{},null,function(e){return/^is[A-Z]/.test(e)});var aP=function(e,t,r){if(!ad.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(e,t)=>{let n=ad.getSafeProp(r,e);return ad.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&&ad.isSpecCompliantForm(t),p=[];if(!ad.isFunction(o))throw TypeError("visitor must be a function");function d(e){if(null===e)return"";if(ad.isDate(e))return e.toISOString();if(ad.isBoolean(e))return e.toString();if(!c&&ad.isBlob(e))throw new aC("Blob is not supported. Use a Buffer instead.");if(ad.isArrayBuffer(e)||ad.isTypedArray(e)){if(c&&"function"==typeof l)return new l([e]);throw new aC("Blob is not supported. Use a Buffer instead.",aC.ERR_NOT_SUPPORT)}return e}function f(e){if(e>u)throw new aC("Object is too deeply nested ("+e+" levels). Max depth: "+u,aC.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(e,r,n){let o=e;if(ad.isReactNative(t)&&ad.isReactNativeBlob(e))return t.append(ax(n,r,a),d(e)),!1;if(e&&!n&&"object"==typeof e)if(ad.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(!ad.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(ad.isArray(e)&&(l=e,ad.isArray(l)&&!l.some(aA))||(ad.isFileList(e)||ad.endsWith(r,"[]"))&&(o=ad.toArray(e)))return r=aT(r),o.forEach(function(e,n){ad.isUndefined(e)||null===e||t.append(!0===s?ax([r],n,a):null===s?r:r+"[]",d(e))}),!1}return!!aA(e)||(t.append(ax(n,r,a),d(e)),!1)}let m=Object.assign(ak,{defaultVisitor:h,convertValue:d,isVisitable:aA});if(!ad.isObject(e))throw TypeError("data must be an object");return!function e(r,n,i=0){if(!ad.isUndefined(r)){if(f(i),-1!==p.indexOf(r))throw Error("Circular reference detected in "+n.join("."));p.push(r),ad.forEach(r,function(r,a){!0===(!(ad.isUndefined(r)||null===r)&&o.call(t,r,ad.isString(a)?a.trim():a,n,m))&&e(r,n?n.concat(a):[a],i+1)}),p.pop()}}(e),t};function aU(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function aI(e,t){this._pairs=[],e&&aP(e,this,t)}let aL=aI.prototype;function az(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aN(e,t,r){let n;if(!t)return e;e=e||"";let i=ad.isFunction(r)?{serialize:r}:r,o=ad.getSafeProp(i,"encode")||az,a=ad.getSafeProp(i,"serialize");if(n=a?a(t,i):ad.isURLSearchParams(t)?t.toString():new aI(t,i).toString(o)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}aL.append=function(e,t){this._pairs.push([e,t])},aL.toString=function(e){let t=e?t=>e.call(this,t,aU):aU;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};let aj=Symbol("internals");function aD(e){return e?e.length:0}function a$(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function aM(e,t){let r=e.handlers,n=aD(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[aj]={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[aj];null==this.handlers&&(this.handlers=[]),aM(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[aj];aM(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||(a$(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],aM(this,this[aj]))}forEach(e){let t=this[aj];aM(this,t),t.iterationDepth++;try{ad.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(aM(this,t),a$(this.handlers),t.handlersLength=aD(this.handlers))}}};var aB={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},aF="u">typeof URLSearchParams?URLSearchParams:aI,aq="u">typeof FormData?FormData:null,aW="u">typeof Blob?Blob:null;let aZ="u">typeof window&&"u">typeof document,aK="object"==typeof navigator&&navigator||void 0,aH=aZ&&(!aK||0>["ReactNative","NativeScript","NS"].indexOf(aK.product)),aV="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,aJ=aZ&&window.location.href||"http://localhost";var aG={...$,isBrowser:!0,classes:{URLSearchParams:aF,FormData:aq,Blob:aW},protocols:["http","https","file","blob","url","data"]};function aY(e){if(e>100)throw new aC("FormData field is too deeply nested ("+e+" levels). Max depth: 100",aC.ERR_FORM_DATA_DEPTH_EXCEEDED)}var aQ=function(e){if(ad.isFormData(e)&&ad.isFunction(e.entries)){let t={};return ad.forEachEntry(e,(e,r)=>{!function e(t,r,n,i){aY(i);let o=t[i++];if("__proto__"===o)return!0;let a=Number.isFinite(+o),s=i>=t.length;return(o=!o&&ad.isArray(n)?n.length:o,s)?ad.hasOwnProp(n,o)?n[o]=ad.isArray(n[o])?n[o].concat(r):[n[o],r]:n[o]=r:(ad.hasOwnProp(n,o)&&ad.isObject(n[o])||(n[o]=[]),e(t,r,n[o],i)&&ad.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));)aY(r.length),r.push("[]"===t[0]?"":t[1]||t[0]);return r}(e),r,t,0)}),t}return null};let aX=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),a0=(e,t)=>null!=e&&ad.hasOwnProp(e,t)?e[t]:void 0,a1={transitional:aB,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r,n=t.getContentType()||"",i=n.indexOf("application/json")>-1,o=ad.isObject(e);if(o&&ad.isHTMLForm(e)&&(e=new FormData(e)),ad.isFormData(e))return i?JSON.stringify(aQ(e)):e;if(ad.isArrayBuffer(e)||ad.isBuffer(e)||ad.isStream(e)||ad.isFile(e)||ad.isBlob(e)||ad.isReadableStream(e))return e;if(ad.isArrayBufferView(e))return e.buffer;if(ad.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(o){let t=a0(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return aP(e,new aG.classes.URLSearchParams,{visitor:function(e,t,r,n){return aG.isNode&&ad.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t}).toString();if((r=ad.isFileList(e))||n.indexOf("multipart/form-data")>-1){let n=a0(this,"env"),i=n&&n.FormData;return aP(r?{"files[]":e}:e,i&&new i,t)}}if(o||i){t.setContentType("application/json",!1);var a=e;if(ad.isString(a))try{return(0,JSON.parse)(a),ad.trim(a)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(a)}return e}],transformResponse:[function(e){let t=a0(this,"transitional")||a1.transitional,r=t&&t.forcedJSONParsing,n=a0(this,"responseType"),i="json"===n;if(ad.isResponse(e)||ad.isReadableStream(e))return e;if(e&&ad.isString(e)&&(r&&!n||i)){let r=t&&t.silentJSONParsing;try{return JSON.parse(e,a0(this,"parseReviver"))}catch(e){if(!r&&i){if("SyntaxError"===e.name)throw aC.from(e,aC.ERR_BAD_RESPONSE,this,null,a0(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:aG.classes.FormData,Blob:aG.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function a2(e,t){let r=this||a1,n=t||r,i=AxiosHeaders.from(n.headers),o=n.data;return ad.forEach(e,function(e){o=e.call(r,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function a4(e){return!!(e&&e.__CANCEL__)}ad.forEach(aX,e=>{a1.headers[e]={}});let CanceledError=class CanceledError extends aC{constructor(e,t,r){super(null==e?"canceled":e,aC.ERR_CANCELED,t,r),this.name="CanceledError",this.__CANCEL__=!0}};function a3(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new aC("Request failed with status code "+r.status,r.status>=400&&r.status<500?aC.ERR_BAD_REQUEST:aC.ERR_BAD_RESPONSE,r.config,r.request,r))}let a9=/[\t\n\r]/g;function a6(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&32>=e.charCodeAt(t);)t++;return e.slice(t).replace(a9,"")}function a5(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}var a8=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}},a7=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 se=(e,t,r=3)=>{let n=0,i=a8(50,250);return a7(r=>{if(!r||!ad.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)},st=(e,t)=>{let r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},sr=(e,t=ad.asap)=>(...r)=>t(()=>e(...r));var sn=aG.hasStandardBrowserEnv?(m=new URL(aG.origin),g=aG.navigator&&/(msie|trident)/i.test(aG.navigator.userAgent),e=>(e=new URL(e,aG.origin),m.protocol===e.protocol&&m.host===e.host&&(g||m.port===e.port))):()=>!0,si=aG.hasStandardBrowserEnv?{write(e,t,r,n,i,o,a){if("u"<typeof document)return;let s=[`${e}=${encodeURIComponent(t)}`];ad.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),ad.isString(n)&&s.push(`path=${n}`),ad.isString(i)&&s.push(`domain=${i}`),!0===o&&s.push("secure"),ad.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 so=/^https?:(?!\/\/)/i;function sa(e,t){if("string"==typeof e){let n=a6(e);if(so.test(n)){var r;let e,i,o;throw new aC(`Invalid URL ${JSON.stringify((o=(-1===(i=(e=n.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${aR}@`)).indexOf("#"))?e:e.slice(0,i)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${aR}`),-1===i?o:`${o}#${!(r=e.slice(i+1))?r:r.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,r="")=>`${t}${r}${aR}`)}`))}: missing "//" after protocol`,aC.ERR_INVALID_URL,t)}}}function ss(e,t,r,n){sa(t,n);let i=!("string"==typeof t&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t));if(e&&(i||!1===r)){sa(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 sl=e=>e instanceof AxiosHeaders?{...e}:e;function su(e,t){var r;e=e||{},t=t||{};let n=Object.create(null);function i(e,t,r,n){return ad.isPlainObject(e)&&ad.isPlainObject(t)?ad.merge.call({caseless:n},e,t):ad.isPlainObject(t)?ad.merge({},t):ad.isArray(t)?t.slice():t}function o(e,t,r,n){return ad.isUndefined(t)?ad.isUndefined(e)?void 0:i(void 0,e,r,n):i(e,t,r,n)}function a(e,t){if(!ad.isUndefined(t))return i(void 0,t)}function s(e,t){return ad.isUndefined(t)?ad.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function l(r,n,o){return ad.hasOwnProp(t,o)?i(r,n):ad.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(sl(e),sl(t),r,!0)};return ad.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=ad.hasOwnProp(u,r)?u[r]:o,a=i(ad.hasOwnProp(e,r)?e[r]:void 0,ad.hasOwnProp(t,r)?t[r]:void 0,r);ad.isUndefined(a)&&i!==l||(n[r]=a)}),ad.hasOwnProp(t,"validateStatus")&&ad.isUndefined(t.validateStatus)&&!1===function(r){let n=ad.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!ad.isUndefined(n)){if(!ad.isPlainObject(n))return;else if(ad.hasOwnProp(n,r))return n[r]}let i=ad.hasOwnProp(e,"transitional")?e.transitional:void 0;if(ad.isPlainObject(i)&&ad.hasOwnProp(i,r))return i[r]}("validateStatusUndefinedResolves")&&(ad.hasOwnProp(e,"validateStatus")?n.validateStatus=i(void 0,e.validateStatus):delete n.validateStatus),n}let sc=["content-type","content-length"];var sp=function(e){let t=su({},e),r=e=>ad.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=aN(ss(u,p,c,t),r("params"),r("paramsSerializer")),l){let t=ad.getSafeProp(l,"username")||"",r=ad.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 aC.from(t,aC.ERR_BAD_OPTION_VALUE,e)}}if(ad.isFormData(n)){let e=ad.getSafeProp(n,"getHeaders");if(aG.hasStandardBrowserEnv||aG.hasStandardBrowserWebWorkerEnv||ad.isReactNative(n))s.setContentType(void 0);else{var d,f;ad.isFunction(e)&&(d=s,f=e.call(n),"content-only"!==r("formDataHeaderPolicy")?d.set(f):Object.entries(f||{}).forEach(([e,t])=>{sc.includes(e.toLowerCase())&&d.set(e,t)}))}}if(aG.hasStandardBrowserEnv&&(ad.isFunction(i)&&(i=i(t)),!0===i||null==i&&sn(t.url))){let e=o&&a&&si.read(a);e&&s.set(o,e)}return t},sd="u">typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){let n,i,o,a,s,l,u=sp(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"!==(a5(a6(u.url))||a5(aG.origin))&&!(g.responseURL&&g.responseURL.startsWith("file:"))){r(new aC("Request aborted",aC.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());a3(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 aC("Request aborted",aC.ECONNABORTED,e,g)),m(),g=null)},g.onerror=function(t){let n=new aC(t&&t.message?t.message:"Network Error",aC.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||aB;u.timeoutErrorMessage&&(t=u.timeoutErrorMessage),r(new aC(t,n.clarifyTimeoutError?aC.ETIMEDOUT:aC.ECONNABORTED,e,g)),m(),g=null},void 0===c&&p.setContentType(null),"setRequestHeader"in g&&ad.forEach(ay(p),function(e,t){g.setRequestHeader(t,e)}),ad.isUndefined(u.withCredentials)||(g.withCredentials=!!u.withCredentials),d&&"json"!==d&&(g.responseType=u.responseType),h&&([o,s,l]=se(h,!0),g.addEventListener("progress",o)),f&&g.upload&&([i,a]=se(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=a5(u.url);if(b&&!aG.protocols.includes(b)){r(new aC("Unsupported protocol "+b+":",aC.ERR_BAD_REQUEST,e)),m();return}g.send(c||null)})};let sf=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},sh=async function*(e,t){for await(let r of sm(e))yield*sf(r,t)},sm=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()}},sg=(e,t,r,n)=>{let i,o=sh(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})},sy=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,sb=(e,t,r)=>t+2<r&&sy(e.charCodeAt(t+1))&&sy(e.charCodeAt(t+2)),sv=e=>e<=57?e-48:(223&e)-55,sw=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,s_=e=>9===e||10===e||12===e||13===e||32===e,sE=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&&sb(e,t,i)&&(r=16*sv(e.charCodeAt(t+1))+sv(e.charCodeAt(t+2)),t+=2),!s_(r)){if(61===r){a++;continue}if(!sw(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))},sS={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:sR}=ad,sO=e=>{if(!ad.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},sC=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},sA=e=>{let t,r=void 0!==ad.global&&null!==ad.global?ad.global:globalThis,{ReadableStream:n,TextEncoder:i}=r,{fetch:o,Request:a,Response:s}=e=ad.merge.call({skipUndefined:!0},{Request:r.Request,Response:r.Response},e),l=o?sR(o):"function"==typeof fetch,u=sR(a),c=sR(s);if(!l)return!1;let p=l&&sR(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&&sC(()=>{let e=!1,t=new a(aG.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&&sC(()=>ad.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 aC(`Response type '${e}' is not supported`,aC.ERR_NOT_SUPPORT,r)})});let g=async e=>{if(null==e)return 0;if(ad.isBlob(e))return e.size;if(ad.isSpecCompliantForm(e)){let t=new a(aG.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ad.isArrayBufferView(e)||ad.isArrayBuffer(e)?e.byteLength:(ad.isURLSearchParams(e)&&(e+=""),ad.isString(e))?(await d(e)).byteLength:void 0},y=async(e,t)=>{let r=ad.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}=sp(e),T=ad.isNumber(O)&&O>-1,x=ad.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 aC?t:new CanceledError(t instanceof Error?t.message:t))}},o=t&&setTimeout(()=>{o=null,i(new aC(`timeout of ${t}ms exceeded`,aC.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=()=>ad.asap(a),s})([c,d&&d.toAbortSignal()],b),U=null,I=P&&P.unsubscribe&&(()=>{P.unsubscribe()}),L=null,z=()=>new aC("Request body larger than maxBodyLength limit",aC.ERR_BAD_REQUEST,e,U);try{var N,j;let o,c,d,b,D=(c="auth",ad.hasOwnProp(e,c)?e[c]:void 0);if(D){let e=ad.getSafeProp(D,"username")||"",t=ad.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,aG.origin);if(!o&&(e.username||e.password)){let t=sO(e.username),r=sO(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&&sb(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),sE)>O)throw new aC("maxContentLength size of "+O+" exceeded",aC.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&&(ad.isReadableStream(l)||ad.isStream(l)),M=(e,t,r)=>sg(e,65536,e=>{if(x&&e>C)throw L=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(ad.isFormData(l)&&(e=n.headers.get("content-type"))&&E.setContentType(e),n.body){let[e,r]=w&&st(t,se(sr(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 aC("Stream request bodies are not supported by the current fetch implementation",aC.ERR_NOT_SUPPORT,e,U);ad.isString(S)||(S=S?"include":"omit");let B=u&&"credentials"in a.prototype;if(ad.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:ay(E.normalize()),body:l,duplex:"half",credentials:B?S:void 0});u&&(ad.forEach(sS,(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=ad.toFiniteNumber(Z.getContentLength());if(null!=t&&t>O)throw new aC("maxContentLength size of "+O+" exceeded",aC.ERR_BAD_RESPONSE,e,U)}let K=h&&("stream"===_||"response"===_);if(h&&W.body&&(v||T||K&&I)){let t={};["status","statusText","headers"].forEach(e=>{t[e]=W[e]});let r=ad.toFiniteNumber(Z.getContentLength()),[n,i]=v&&st(r,se(sr(v),!0))||[];W=new s(sg(W.body,65536,t=>{if(T&&t>O)throw new aC("maxContentLength size of "+O+" exceeded",aC.ERR_BAD_RESPONSE,e,U);n&&n(t)},()=>{i&&i(),I&&I()}),t)}_=_||"text";let H=await m[ad.findKey(m,_)||"text"](W,e);if(T&&!h&&!K){let t;if(null!=H&&("number"==typeof H.byteLength?t=H.byteLength:"number"==typeof H.size?t=H.size:"string"==typeof H&&(t="function"==typeof i?new i().encode(H).byteLength:H.length)),"number"==typeof t&&t>O)throw new aC("maxContentLength size of "+O+" exceeded",aC.ERR_BAD_RESPONSE,e,U)}return!K&&I&&I(),await new Promise((t,r)=>{a3(t,r,{data:H,headers:AxiosHeaders.from(W.headers),status:W.status,statusText:W.statusText,config:e,request:U})})}catch(t){if(I&&I(),P&&P.aborted&&P.reason instanceof aC){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(L)throw U&&!L.request&&(L.request=U),L;if(t instanceof aC)throw U&&!t.request&&(t.request=U),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let r=new aC("Network Error",aC.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 aC.from(t,t&&t.code,e,U,t&&t.response)}}},sT=new Map,sx=e=>{let t=e&&e.env||{},{fetch:r,Request:n,Response:i}=t,o=[n,i,r],a=o.length,s,l,u=sT;for(;a--;)s=o[a],void 0===(l=u.get(s))&&u.set(s,l=a?new Map:sA(t)),u=l;return l};sx();let sk={http:null,xhr:sd,fetch:{get:sx}};ad.forEach(sk,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});let sP=e=>`- ${e}`,sU=e=>ad.isFunction(e)||null===e||!1===e;var sI=function(e,t){let r,n,{length:i}=e=ad.isArray(e)?e:[e],o={};for(let a=0;a<i;a++){let i;if(n=r=e[a],!sU(r)&&void 0===(n=sk[(i=String(r)).toLowerCase()]))throw new aC(`Unknown adapter '${i}'`);if(n&&(ad.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 aC("There is no suitable adapter to dispatch the request "+(i?e.length>1?"since :\n"+e.map(sP).join("\n"):" "+sP(e[0]):"as no adapter specified"),aC.ERR_NOT_SUPPORT)}return n};function sL(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError(null,e)}function sz(e){let t=ad.toSafeFlatObject(e);return sL(t),t.headers=AxiosHeaders.from(ad.getSafeProp(t,"headers")),t.data=a2.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),sI(t.adapter||a1.adapter,t)(t).then(function(e){sL(t),t.response=e;try{e.data=a2.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=AxiosHeaders.from(e.headers),e},function(e){if(!a4(e)&&(sL(t),e&&e.response)){t.response=e.response;try{e.response.data=a2.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=AxiosHeaders.from(e.response.headers)}return Promise.reject(e)})}let sN={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{sN[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});let sj={};sN.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 aC(n(i," has been removed"+(t?" in "+t:"")),aC.ERR_DEPRECATED);return t&&!sj[i]&&(sj[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)}},sN.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var sD=function(e,t,r){if("object"!=typeof e||null===e)throw new aC("options must be an object",aC.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 aC("option "+o+" must be "+r,aC.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new aC("Unknown option "+o,aC.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=su(this.defaults,t);void 0!==i&&sD(i,{silentJSONParsing:sN.transitional(sN.boolean),forcedJSONParsing:sN.transitional(sN.boolean),clarifyTimeoutError:sN.transitional(sN.boolean),legacyInterceptorReqResOrdering:sN.transitional(sN.boolean),advertiseZstdAcceptEncoding:sN.transitional(sN.boolean),validateStatusUndefinedResolves:sN.transitional(sN.boolean)},!1),null!=o&&(ad.isFunction(o)?t.paramsSerializer={serialize:o}:sD(o,{encode:sN.function,serialize:sN.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),sD(t,{baseUrl:sN.spelling("baseURL"),withXsrfToken:sN.spelling("withXSRFToken")},!0),t.method=(ad.getSafeProp(t,"method")||ad.getSafeProp(this.defaults,"method")||"get").toLowerCase();let s=a&&ad.merge(a.common,a[t.method]);a&&ad.forEach(aX.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||aB;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=[sz.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);ad.isThenable(n)&&(r=Promise.resolve(n).then(()=>sz.call(this,d)))}catch(e){r=Promise.reject(e)}break}}if(!r)try{r=sz.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 aN(ss((e=su(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};ad.forEach(["delete","get","head","options"],function(e){Axios.prototype[e]=function(t,r){return this.request(su(r||{},{method:e,url:t,data:r&&ad.hasOwnProp(r,"data")?r.data:void 0}))}}),ad.forEach(["post","put","patch","query"],function(e){function t(t){return function(r,n,i){return this.request(su(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 s$={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(s$).forEach(([e,t])=>{void 0===s$[t]&&(s$[t]=e)});let sM=function e(t){let r=new Axios(t),n=ox(Axios.prototype.request,r);return ad.extend(n,Axios.prototype,r,{allOwnKeys:!0}),ad.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(su(t,r))},n}(a1);sM.Axios=Axios,sM.CanceledError=CanceledError,sM.CancelToken=CancelToken,sM.isCancel=a4,sM.VERSION="1.20.0",sM.toFormData=aP,sM.AxiosError=aC,sM.Cancel=sM.CanceledError,sM.all=function(e){return Promise.all(e)},sM.spread=function(e){return function(t){return e.apply(null,t)}},sM.isAxiosError=function(e){return ad.isObject(e)&&!0===e.isAxiosError},sM.mergeConfig=su,sM.AxiosHeaders=AxiosHeaders,sM.formToJSON=e=>aQ(ad.isHTMLForm(e)?new FormData(e):e),sM.getAdapter=sI,sM.HttpStatusCode=s$,sM.default=sM;let{Axios:sB,AxiosError:sF,CanceledError:sq,isCancel:sW,CancelToken:sZ,VERSION:sK,all:sH,Cancel:sV,isAxiosError:sJ,spread:sG,toFormData:sY,AxiosHeaders:sQ,HttpStatusCode:sX,formToJSON:s0,getAdapter:s1,mergeConfig:s2,create:s4}=sM,s3={isNode:!1,platform:void 0,async compress(){throw Error("Request body compression is only available in Node.js.")},async createHttpAgents(){}};function s9(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}let s6=/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(lw(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(s5[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(s6);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}
|
|
61
61
|
${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 s5={400:InvalidRequestError,401:UnauthorizedError,403:ForbiddenError,404:NotFoundError,409:ConflictError,429:RateLimitError},{localeError:s8}=ny();function s7(e){return null===e?"null":Array.isArray(e)?"array":typeof e}let le=/^Invalid input: expected (an array of .+|a typed array|an object|object|array|function|number|string|boolean)$/;function lt(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 lr(e){if("number"==typeof e&&Number.isNaN(e))return"received NaN";if(""===e)return"received an empty string";let t=lt(e);return void 0===t?`received ${s7(e)}`:`received the ${s7(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=lt(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=le.exec(c),f=/, received (\S+)$/.exec(c),h=d?.[1].startsWith("an array of")?"array":d?.[1];d&&h!==(Number.isNaN(l)?"NaN":s7(l))?c+=`, ${lr(l)}`:f&&f[1]===s7(l)&&void 0!==u?c=`${c.slice(0,f.index)}, ${lr(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 ln(e,t,r){let n=t.safeParse(e,{error:s8});if(!n.success)throw new ArgumentValidationError(n.error,e,r);return n.data}i3(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:
|
|
62
62
|
${i}
|
|
63
|
-
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 li=JSON.parse('{"rE":"3.0.0-beta.55"}'),lo=r("z");let la=new TextEncoder,{rE:ls}=li,ll=["audio/","image/","video/"],lu=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"]),lc=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"]),lp=["+json","+xml"];function ld(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let lf=i3(ld,{error:"Invalid input: expected an object"}),{localeError:lh}=ny();function lm(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:lh});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 lg(e){if(!(e instanceof NotFoundError))throw e}function ly(e,t){if(!t)throw e;lg(e)}function lb(e){if(e){var t=la.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 lv(e){return void 0!==lo?lo.env?.[e]:void 0}function lw(e){return ArrayBuffer.isView(e)?!l_(e,"DataView"):l_(e,"ArrayBuffer")}function l_(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function lE(e){if(null===e||"object"!=typeof e)return!1;let{on:t,pipe:r}=e;return"function"==typeof t&&"function"==typeof r}R=function(e,t){if("object"!==s9(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==s9(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(Symbol.asyncIterator,"string"),i="symbol"===s9(R)?R:String(R);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 lS={limit:ig().min(0).optional(),offset:ig().min(0).optional(),chunkSize:ig().positive().optional()},lR=Symbol("scannedCount");function lO(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 lC=nY().nonempty().refine(e=>"."!==e&&".."!==e,{error:"URL path must not contain dot segments"});function lA(e){return encodeURIComponent(ln(e,lC))}function lT(e){return Array.isArray(e)?e.map(lA).join("/"):e}async function lx(e,t){return new Promise(r=>{if(t?.aborted)return void r();let n=()=>{clearTimeout(i),r()},i=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e);t?.addEventListener("abort",n,{once:!0})})}let lk="toBSON",lP="toString",lU="_bsontype";RegExp(`(.|^$|^${lk}$|^${lU}|^${lP}$)`),RegExp(".","g"),RegExp("^$"),RegExp(`^${lk}$`),RegExp(`^${lP}$`),RegExp(`^${lU}$`),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|(.*\\.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"),(O=j||(j={})).MONGODB_PING="MONGODB_PING",O.MONGODB_READ="MONGODB_READ",O.MONGODB_WRITE="MONGODB_WRITE",O.REDIS="REDIS",O.REDIS_PING="REDIS_PING",O.REDIS_WRITE="REDIS_WRITE",r("c");var lI=r("d").Buffer;async function lL(e){return new Promise((t,r)=>{let n=[];e.on("data",e=>{n.push(e)}).on("error",e=>r(e)).on("end",()=>t(lI.concat(n)))})}r("d").Buffer,r("d").Buffer,(C=D||(D={})).VERSION="v",C.USER="u";let lz="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),lN=globalThis.crypto?.subtle;async function lj(e,t){if(!lN)throw Error(`SubtleCrypto is not available in this environment.
|
|
63
|
+
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 li=JSON.parse('{"rE":"3.0.0-beta.56"}'),lo=r("z");let la=new TextEncoder,{rE:ls}=li,ll=["audio/","image/","video/"],lu=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"]),lc=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"]),lp=["+json","+xml"];function ld(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let lf=i3(ld,{error:"Invalid input: expected an object"}),{localeError:lh}=ny();function lm(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:lh});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 lg(e){if(!(e instanceof NotFoundError))throw e}function ly(e,t){if(!t)throw e;lg(e)}function lb(e){if(e){var t=la.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 lv(e){return void 0!==lo?lo.env?.[e]:void 0}function lw(e){return ArrayBuffer.isView(e)?!l_(e,"DataView"):l_(e,"ArrayBuffer")}function l_(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function lE(e){if(null===e||"object"!=typeof e)return!1;let{on:t,pipe:r}=e;return"function"==typeof t&&"function"==typeof r}R=function(e,t){if("object"!==s9(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==s9(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(Symbol.asyncIterator,"string"),i="symbol"===s9(R)?R:String(R);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 lS={limit:ig().min(0).optional(),offset:ig().min(0).optional(),chunkSize:ig().positive().optional()},lR=Symbol("scannedCount");function lO(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 lC=nY().nonempty().refine(e=>"."!==e&&".."!==e,{error:"URL path must not contain dot segments"});function lA(e){return encodeURIComponent(ln(e,lC))}function lT(e){return Array.isArray(e)?e.map(lA).join("/"):e}async function lx(e,t){return new Promise(r=>{if(t?.aborted)return void r();let n=()=>{clearTimeout(i),r()},i=setTimeout(()=>{t?.removeEventListener("abort",n),r()},e);t?.addEventListener("abort",n,{once:!0})})}let lk="toBSON",lP="toString",lU="_bsontype";RegExp(`(.|^$|^${lk}$|^${lU}|^${lP}$)`),RegExp(".","g"),RegExp("^$"),RegExp(`^${lk}$`),RegExp(`^${lP}$`),RegExp(`^${lU}$`),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|(.*\\.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"),(O=j||(j={})).MONGODB_PING="MONGODB_PING",O.MONGODB_READ="MONGODB_READ",O.MONGODB_WRITE="MONGODB_WRITE",O.REDIS="REDIS",O.REDIS_PING="REDIS_PING",O.REDIS_WRITE="REDIS_WRITE",r("c");var lI=r("d").Buffer;async function lL(e){return new Promise((t,r)=>{let n=[];e.on("data",e=>{n.push(e)}).on("error",e=>r(e)).on("end",()=>t(lI.concat(n)))})}r("d").Buffer,r("d").Buffer,(C=D||(D={})).VERSION="v",C.USER="u";let lz="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),lN=globalThis.crypto?.subtle;async function lj(e,t){if(!lN)throw Error(`SubtleCrypto is not available in this environment.
|
|
64
64
|
Please ensure you're running in an environment that supports Web Crypto API,
|
|
65
65
|
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 lz[0];let a="";for(;o>0n;)a=lz[Number(o%62n)]+a,o/=62n;return a}async function lD({resourceId:e,urlSigningSecretKey:t,expiresInMillis:r,version:n=0}){let i=r?new Date().getTime()+r:0,o=await lj(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("d").Buffer;let l$=new Uint8Array(256);l$[9]|=2,l$[32]|=2,l$[59]|=4,l$[44]|=8;for(let e=128;e<=255;e++)l$[e]|=1;for(let e of"!#$%&'*+-.^_`|~")l$[e.charCodeAt(0)]|=16;for(let e=48;e<=57;e++)l$[e]|=16;for(let e=65;e<=90;e++)l$[e]|=17;for(let e=97;e<=122;e++)l$[e]|=16;let lM=((y=function(){}).prototype=Object.create(null),y),lB="application/json",lF=[RegExp(`^${lB}`,"i"),/^application\/.*xml$/i,/^text\//i],lq=i3(e=>"object"==typeof e&&null!==e&&"string"==typeof e.contentEncoding&&"function"==typeof e.compress,{error:"Invalid input: expected an HttpCompressor"}),lW=iP({quality:ib().min(0).max(11).default(6)});let BrotliHttpCompressor=class BrotliHttpCompressor{contentEncoding="br";#s;constructor(e={}){let{quality:t}=ln(e,lW,"BrotliHttpCompressorOptions");this.#s=t}async compress(e){return s3.compress(e,{algorithm:"br",quality:this.#s})}};let lZ=iP({quality:ib().min(1).max(9).default(6)});let GzipHttpCompressor=class GzipHttpCompressor{contentEncoding="gzip";#s;constructor(e={}){let{quality:t}=ln(e,lZ,"GzipHttpCompressorOptions");this.#s=t}async compress(e){return s3.compress(e,{algorithm:"gzip",quality:this.#s})}};let lK=iL([iB(["brotli","gzip"]),lq]);let InvalidResponseBodyError=class InvalidResponseBodyError extends Error{code;response;constructor(e,t){super(`Response body could not be parsed.
|
|
66
66
|
Cause:${t.message}`),this.name=this.constructor.name,this.code="invalid-response-body",this.response=e,this.cause=t}};let lH=ig().gt(0);let Statistics=class Statistics{calls=0;requests=0;rateLimitErrors=[];addRateLimitError(e){ln(e,lH);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 lV=iL([iB(["short","medium","long","noTimeout"]),ig().positive()]).optional(),lJ=i6(AbortSignal).optional(),lG={timeoutSecs:lV,signal:lJ},lY=iP(lG);var lQ=r("d").Buffer;let lX="application/json",l0="application/x-www-form-urlencoded",l1={maxRetries:ig().int().nonnegative(),minDelayBetweenRetriesMillis:ig().nonnegative(),timeoutShortSecs:ig().positive(),timeoutMediumSecs:ig().positive(),timeoutLongSecs:ig().positive(),timeoutMaxSecs:ig().positive()},l2=iU(l1).partial(),l4=new Set(["Blob","File","FormData","ReadableStream"]);let HttpClient=class HttpClient{stats;logger;maxRetries;minDelayBetweenRetriesMillis;timeoutMillis;timeoutMaxMillis;httpCompressor;defaultHeaders;constructor(e={}){ln(e,l2,"HttpClientOptions"),this.stats=e.stats??new Statistics,this.logger=e.logger??oT.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||lv("APIFY_WORKFLOW_KEY");if(r&&(t["X-Apify-Workflow-Key"]=r),s3.platform){var n;let r=!!lv("APIFY_IS_AT_HOME"),i=`ApifyClient/${ls} (${s3.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=l9(t,e.headers)}setDefaultAuthorization(e){void 0===l3(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=l9(this.defaultHeaders,e.headers),r=function(e,t,r){if(null!=e){if(lE(e))return e;if(lw(e))return!s3.isNode||lQ.isBuffer(e)?e:ArrayBuffer.isView(e)?lQ.from(e.buffer,e.byteOffset,e.byteLength):lQ.from(e);if("string"==typeof e)return e;if("object"==typeof e){var n,i;if(e instanceof URLSearchParams)return void 0===l3(t,"content-type")&&(t["Content-Type"]=`${l0};charset=utf-8`),e.toString();let o=(n=e,Object.prototype.toString.call(n).slice(8,-1));if(l4.has(o))throw TypeError(`Unsupported request body type: ${o}`);void 0===l3(t,"content-type")&&(t["Content-Type"]=lX);let a=l3(t,"content-type");if(l6(a)===l0){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(lw(n)){var i;t.append(e,(ArrayBuffer.isView(i=n)?lQ.from(i.buffer,i.byteOffset,i.byteLength):lQ.from(i)).toString("base64"))}else if(Array.isArray(n)){let t=n.some(l8);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&&l6(a)===lX?l5:void 0)}throw TypeError(`Unsupported request body type: ${typeof e}`)}}(e.data,t,e.stringifyFunctions),n=function(e,t){if(void 0===e||!s3.isNode||void 0!==l3(t,"content-encoding")||!function(e){if(!e)return!0;let t=e.split(";",1)[0].trim().toLowerCase();return!!(lc.has(t)||lp.some(e=>t.endsWith(e)))||!lu.has(t)&&!ll.some(e=>t.startsWith(e))}(l3(t,"content-type")))return;let r="string"==typeof e?la.encode(e):lw(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(lQ.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=l9(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 lx(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=lE(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&&lE(t.body)&&(t.body=await lL(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||lE(r))return r;if(0!==r.byteLength)try{var n;return function(e,t){var r;let n,i;try{let e=function(e){let t=e.length,r=(void 0)??0;for(;(2&l$[e.charCodeAt(r)])!=0;)r++;let n=r,i=0,o=-1,a=0;for(;n<t;){let t=e.charCodeAt(n),r=l$[t];if((4&r)!=0){a|=8&r;break}(2&r)!=0?-1===o&&(o=n):o=-1,i|=65280&t|r,n++}let s=-1===o?n:o,l=e.slice(r,s),u=(65281&i)==0?l:l.toLowerCase();return n===t||0!==a?{type:u,index:n,parameters:new lM}:function(e,t,r,n){let i=new lM;e:for(;r<n;){for(r++;(2&l$[e.charCodeAt(r)])!=0;)r++;let t=r,o=0,a=-1;for(;r<n;){let s=e.charCodeAt(r),l=l$[s];if((4&l)!=0){if((8&l)!=0)break e;continue e}if(61===s){let s=-1===a?r:a,l=e.slice(t,s),u=(65281&o)==0?l:l.toLowerCase();for(r++;(2&l$[e.charCodeAt(r)])!=0;)r++;if(r<n&&34===e.charCodeAt(r)){let t=++r,o=!1;for(;r<n;){let a=e.charCodeAt(r);if(34===a){void 0===i[u]&&(i[u]=o?function(e,t,r){let n="";for(let i=t;i<r;i++)92===e.charCodeAt(i)&&(n+=e.slice(t,i),t=++i);return n+e.slice(t,r)}(e,t,r):e.slice(t,r)),r++;let a=0;for(;r<n;){let t=l$[e.charCodeAt(r)];if((4&t)!=0){a=8&t;break}r++}if(0!==a)break e;continue e}if(92===a&&r+1<n){o=!0,r+=2;continue}r++}continue e}let c=r,p=0,d=-1;for(;r<n;){let t=l$[e.charCodeAt(r)];if((4&t)!=0){p=8&t;break}(2&t)!=0?-1===d&&(d=r):d=-1,r++}if(void 0===i[u]){let t=-1===d?r:d;i[u]=e.slice(c,t)}if(0!==p)break e;continue e}(2&l)!=0?-1===a&&(a=r):a=-1,o|=65280&s|l,r++}}return{type:t,index:r,parameters:i}}(e,u,n,t)}(t);n=e.type,i=e.parameters.charset}catch{return e}if(!((r=n)&&lF.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===lB?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():lE(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}.
|