apify-client 3.0.0-beta.47 → 3.0.0-beta.49
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/base/api_client.js +21 -17
- package/dist/base/resource_collection_client.d.ts +5 -0
- package/dist/base/resource_collection_client.js +12 -0
- package/dist/bundle.js +9 -9
- package/dist/bundle.js.map +1 -1
- package/dist/resource_clients/actor.d.ts +1 -1
- package/dist/resource_clients/actor_env_var_collection.js +1 -1
- package/dist/resource_clients/actor_version_collection.js +1 -1
- package/package.json +1 -1
package/dist/bundle.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! LICENSE: bundle.js.LICENSE.txt */
|
|
2
|
-
var e={v(e,t,r){var n=r("z");let i=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,o=()=>{let e={enabled:void 0!==n&&"0"!==n.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},t=(e,t,r)=>"function"==typeof e?e(t):e.wrap(t,r),o=(r,n)=>{if(""===r||null==r)return"";if(!1===e.enabled)return r;if(!1===e.visible)return"";let i=""+r,o=i.includes("\n"),a=n.length;for(a>0&&n.includes("unstyle")&&(n=[...new Set(["unstyle",...n])].reverse());a-- >0;)i=t(e.styles[n[a]],i,o);return i},a=(t,r,n)=>{var i;let a,s,l;e.styles[t]=(a=(i={name:t,codes:r}).open=`\x1b[${i.codes[0]}m`,s=i.close=`\x1b[${i.codes[1]}m`,l=i.regex=RegExp(`\\u001b\\[${i.codes[1]}m`,"g"),i.wrap=(e,t)=>{e.includes(s)&&(e=e.replace(l,s+a));let r=a+e+s;return t?r.replace(/\r*\n/g,`${s}$&${a}`):r},i),(e.keys[n]||(e.keys[n]=[])).push(t),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(r){e.alias(t,r)},get(){let r=e=>o(e,r.stack);return Reflect.setPrototypeOf(r,e),r.stack=this.stack?this.stack.concat(t):[t],r}})};return a("reset",[0,0],"modifier"),a("bold",[1,22],"modifier"),a("dim",[2,22],"modifier"),a("italic",[3,23],"modifier"),a("underline",[4,24],"modifier"),a("inverse",[7,27],"modifier"),a("hidden",[8,28],"modifier"),a("strikethrough",[9,29],"modifier"),a("black",[30,39],"color"),a("red",[31,39],"color"),a("green",[32,39],"color"),a("yellow",[33,39],"color"),a("blue",[34,39],"color"),a("magenta",[35,39],"color"),a("cyan",[36,39],"color"),a("white",[37,39],"color"),a("gray",[90,39],"color"),a("grey",[90,39],"color"),a("bgBlack",[40,49],"bg"),a("bgRed",[41,49],"bg"),a("bgGreen",[42,49],"bg"),a("bgYellow",[43,49],"bg"),a("bgBlue",[44,49],"bg"),a("bgMagenta",[45,49],"bg"),a("bgCyan",[46,49],"bg"),a("bgWhite",[47,49],"bg"),a("blackBright",[90,39],"bright"),a("redBright",[91,39],"bright"),a("greenBright",[92,39],"bright"),a("yellowBright",[93,39],"bright"),a("blueBright",[94,39],"bright"),a("magentaBright",[95,39],"bright"),a("cyanBright",[96,39],"bright"),a("whiteBright",[97,39],"bright"),a("bgBlackBright",[100,49],"bgBright"),a("bgRedBright",[101,49],"bgBright"),a("bgGreenBright",[102,49],"bgBright"),a("bgYellowBright",[103,49],"bgBright"),a("bgBlueBright",[104,49],"bgBright"),a("bgMagentaBright",[105,49],"bgBright"),a("bgCyanBright",[106,49],"bgBright"),a("bgWhiteBright",[107,49],"bgBright"),e.ansiRegex=i,e.hasColor=e.hasAnsi=t=>(e.ansiRegex.lastIndex=0,"string"==typeof t&&""!==t&&e.ansiRegex.test(t)),e.alias=(t,r)=>{let n="string"==typeof r?e[r]:r;if("function"!=typeof n)throw TypeError("Expected alias to be the name of an existing color (string) or a function");n.stack||(Reflect.defineProperty(n,"name",{value:t}),e.styles[t]=n,n.stack=[t]),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(r){e.alias(t,r)},get(){let t=e=>o(e,t.stack);return Reflect.setPrototypeOf(t,e),t.stack=this.stack?this.stack.concat(n.stack):n.stack,t}})},e.theme=t=>{if(!(null!==t&&"object"==typeof t&&!Array.isArray(t)))throw TypeError("Expected theme to be an object");for(let r of Object.keys(t))e.alias(r,t[r]);return e},e.alias("unstyle",t=>"string"==typeof t&&""!==t?(e.ansiRegex.lastIndex=0,t.replace(e.ansiRegex,"")):""),e.alias("noop",e=>e),e.none=e.clear=e.noop,e.stripColor=e.unstyle,e.symbols=r("L"),e.define=a,e};e.exports=o(),e.exports.create=o},L(e,t,r){var n=r("z");let i=void 0!==n&&"Hyper"===n.env.TERM_PROGRAM,o=void 0!==n&&"win32"===n.platform,a=void 0!==n&&"linux"===n.platform,s={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},l=Object.assign({},s,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),u=Object.assign({},s,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:a?"▸":"❯",pointerSmall:a?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});e.exports=o&&!i?l:u,Reflect.defineProperty(e.exports,"common",{enumerable:!1,value:s}),Reflect.defineProperty(e.exports,"windows",{enumerable:!1,value:l}),Reflect.defineProperty(e.exports,"other",{enumerable:!1,value:u})},JO(e,t){t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,o=l(e),a=o[0],s=o[1],u=new i((a+s)*3/4-s),c=0,p=s>0?a-4:a;for(r=0;r<p;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;a<s;a+=16383)o.push(function(e,t,n){for(var i,o=[],a=t;a<n;a+=3)i=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(e,a,a+16383>s?s:a+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},d(e,t,r){var n=r("JO"),i=r("r"),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!s.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|h(n,i),l=a(o),u=l.write(n,i);return u!==o&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e)){var c=e;if(x(c,Uint8Array)){var m=new Uint8Array(c);return d(m.buffer,m.byteOffset,m.byteLength)}return p(c)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(x(e,ArrayBuffer)||e&&x(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(x(e,SharedArrayBuffer)||e&&x(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var g=e.valueOf&&e.valueOf();if(null!=g&&g!==e)return s.from(g,t,r);var y=function(e){if(s.isBuffer(e)){var t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(y)return y;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),a(e<0?0:0|f(e))}function p(e){for(var t=e.length<0?0:0|f(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),s.prototype),n}function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||x(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return C(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return A(e).length;default:if(i)return n?-1:C(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var i,o,a,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=k[e[o]];return i}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,o=t,a=r,0===o&&a===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,t,r);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){var o;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else -1!==c&&(o-=o-c),c=-1}else for(r+l>s&&(r=s-l),o=r;o>=0;o--){for(var p=!0,d=0;d<l;d++)if(u(e,o+d)!==u(t,d)){p=!1;break}if(p)return o}return -1}function v(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,l,u=e[i],c=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p<=r)switch(p){case 1:u<128&&(c=u);break;case 2:(192&(o=e[i+1]))==128&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],a=e[i+2],(192&o)==128&&(192&a)==128&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=p}var d=n,f=d.length;if(f<=4096)return String.fromCharCode.apply(String,d);for(var h="",m=0;m<f;)h+=String.fromCharCode.apply(String,d.slice(m,m+=4096));return h}function w(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function _(e,t,r,n,i,o){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function E(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function S(e,t,r,n,o){return t*=1,r>>>=0,o||E(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function R(e,t,r,n,o){return t*=1,r>>>=0,o||E(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(x(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),x(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=s.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(x(o,Uint8Array))i+o.length>n.length?s.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else if(s.isBuffer(o))o.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):m.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,i){if(x(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,a=r-t,l=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),p=0;p<l;++p)if(u[p]!==c[p]){o=u[p],a=c[p];break}return o<a?-1:+(a<o)},s.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},s.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,a,s,l,u,c,p,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var f=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s,l=parseInt(t.substr(2*a,2),16);if((s=l)!=s)break;e[r+a]=l}return a}(this,e,t,r);case"utf8":case"utf-8":return i=t,o=r,T(C(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return a=t,s=r,T(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,a,s);case"base64":return l=t,u=r,T(A(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,p=r,T(function(e,t){for(var r,n,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,p);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;_(this,e,t,r,i,0)}var o=1,a=0;for(this[t]=255&e;++a<r&&(o*=256);)this[t+a]=e/o&255;return t+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;_(this,e,t,r,i,0)}var o=r-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,r){return S(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return S(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},s.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=s.isBuffer(e)?e:s.from(e,n),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%l]}return this};var O=/[^+/0-9A-Za-z-_]/g;function C(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319||a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function A(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function x(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var k=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},q(e){var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(r,n){var i,o,a;function s(r){e.removeListener(t,l),n(r)}function l(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}m(e,t,l,{once:!0}),"error"!==t&&(i=e,o=s,a={once:!0},"function"==typeof i.on&&m(i,"error",o,a))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var i,o,a,u=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):h(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else for(var u=l.length,c=h(l,u),r=0;r<u;++r)n(c[r],this,t);return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},r(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,p=r?i-1:0,d=r?-1:1,f=e[t+p];for(p+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+p],p+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?0/0:(f?-1:1)*2e308;a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,p=c>>1,d=5960464477539062e-23*(23===i),f=n?0:o-1,h=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(s=+!!isNaN(t),a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?t+=d/l:t+=d*Math.pow(2,1-p),t*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*l-1)*Math.pow(2,i),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&s,f+=h,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[r+f]=255&a,f+=h,a/=256,u-=8);e[r+f-h]|=128*m}},c5(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},z(e){var t,r,n,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var l=[],u=!1,c=-1;function p(){u&&n&&(u=!1,n.length?l=n.concat(l):c=-1,l.length&&d())}function d(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(n=l,l=[];++c<t;)n&&n[c].run();c=-1,t=l.length}n=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new f(e,t)),1!==l.length||u||s(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}},K(e,t,r){var n=r("d"),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},c(e,t,r){e.exports=i;var n=r("q").EventEmitter;function i(){n.call(this)}r("c5")(i,n),i.Readable=r("e"),i.Writable=r("ep"),i.Duplex=r("F"),i.Transform=r("h"),i.PassThrough=r("zM"),i.finished=r("n"),i.pipeline=r("Kx"),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var a=!1;function s(){a||(a=!0,e.end())}function l(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},x(e){var t={};function r(e,r,n){n||(n=Error);var i=function(e){function t(t,n,i){return e.call(this,"string"==typeof r?r:r(t,n,i))||this}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e,t}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(!Array.isArray(e))return"of ".concat(t," ").concat(String(e));var r=e.length;return(e=e.map(function(e){return String(e)}),r>2)?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(l="must not be",t=t.replace(/^not /,"")):l="must be",o=" argument",(void 0===a||a>e.length)&&(a=e.length),e.substring(a-o.length,a)===o)u="The ".concat(e," ").concat(l," ").concat(n(t,"type"));else{var i,o,a,s,l,u,c=("number"!=typeof s&&(s=0),s+1>e.length||-1===e.indexOf(".",s))?"argument":"property";u='The "'.concat(e,'" ').concat(c," ").concat(l," ").concat(n(t,"type"))}return u+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},F(e,t,r){var n=r("z"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var o=r("e"),a=r("ep");r("c5")(c,o);for(var s=i(a.prototype),l=0;l<s.length;l++){var u=s[l];c.prototype[u]||(c.prototype[u]=a.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",p)))}function p(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},zM(e,t,r){e.exports=i;var n=r("h");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r("c5")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},e(e,t,r){var n,i,o,a,s,l=r("z");e.exports=O,O.ReadableState=R,r("q").EventEmitter;var u=function(e,t){return e.listeners(t).length},c=r("Js"),p=r("d").Buffer,d=(void 0!==r.g?r.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},f=r("b");i=f&&f.debuglog?f.debuglog("stream"):function(){};var h=r("LP"),m=r("w"),g=r("G").getHighWaterMark,y=r("x").F,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,_=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r("c5")(O,c);var E=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function R(e,t,i){n=n||r("F"),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=r("t").I),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function O(e){if(n=n||r("F"),!(this instanceof O))return new O(e);var t=this instanceof n;this._readableState=new R(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function C(e,t,r,n,o){i("readableAddChunk",t);var a,s,l=e._readableState;if(null===t)l.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,k(e)))}}(e,l);else if(o||(s=function(e,t){var r;return p.isBuffer(t)||t instanceof d||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t)),r}(l,t)),s)E(e,s);else if(l.objectMode||t&&t.length>0)if("string"==typeof t||l.objectMode||Object.getPrototypeOf(t)===p.prototype||(a=t,t=p.from(a)),n)l.endEmitted?E(e,new _):A(e,l,t,!0);else if(l.ended)E(e,new v);else{if(l.destroyed)return!1;l.reading=!1,l.decoder&&!r?(t=l.decoder.write(t),l.objectMode||0!==t.length?A(e,l,t,!1):P(e,l)):A(e,l,t,!1)}else n||(l.reading=!1,P(e,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function A(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&x(e)),P(e,t)}function T(e,t){var r;if(e<=0||0===t.length&&t.ended)return 0;if(t.objectMode)return 1;if(e!=e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;return(e>t.highWaterMark&&((r=e)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),t.highWaterMark=r),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function x(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,l.nextTick(k,e))}function k(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,l.nextTick(I,e,t))}function I(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function U(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){i("readable nexttick read 0"),e.read(0)}function z(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function D(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,l.nextTick($,t,e))}function $(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function M(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=m.destroy,O.prototype._undestroy=m.undestroy,O.prototype._destroy=function(e,t){t(e)},O.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=p.from(e,t),t=""),r=!0),C(this,e,t,!1,r)},O.prototype.unshift=function(e){return C(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.prototype.setEncoding=function(e){o||(o=r("t").I);var t=new o(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},O.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t,r=this._readableState,n=e;if(0!==e&&(r.emittedReadable=!1),0===e&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return i("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?D(this):x(this),null;if(0===(e=T(e,r))&&r.ended)return 0===r.length&&D(this),null;var o=r.needReadable;return i("need readable",o),(0===r.length||r.length-e<r.highWaterMark)&&i("length less than watermark",o=!0),r.ended||r.reading?i("reading or ended",o=!1):o&&(i("do read"),r.reading=!0,r.sync=!0,0===r.length&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(e=T(n,r))),null===(t=e>0?j(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&D(this)),null!==t&&this.emit("data",t),t},O.prototype._read=function(e){E(this,new w("_read()"))},O.prototype.pipe=function(e,t){var r,n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,i("pipe count=%d opts=%j",o.pipesCount,t);var a=t&&!1===t.end||e===l.stdout||e===l.stderr?g:s;function s(){i("onend"),e.end()}o.endEmitted?l.nextTick(a):n.once("end",a),e.on("unpipe",function t(r,a){i("onunpipe"),r===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",g),n.removeListener("data",d),p=!0,o.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c())});var c=(r=n,function(){var e=r._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&u(r,"data")&&(e.flowing=!0,N(r))});e.on("drain",c);var p=!1;function d(t){i("ondata");var r=e.write(t);i("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==M(o.pipes,e))&&!p&&(i("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function f(t){i("onerror",t),g(),e.removeListener("error",f),0===u(e,"error")&&E(e,t)}function h(){e.removeListener("finish",m),g()}function m(){i("onfinish"),e.removeListener("close",h),g()}function g(){i("unpipe"),n.unpipe(e)}return n.on("data",d),!function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",h),e.once("finish",m),e.emit("pipe",n),o.flowing||(i("pipe resume"),n.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=M(t.pipes,e);return -1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},O.prototype.on=function(e,t){var r=c.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?x(this):n.reading||l.nextTick(L,this)),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var r=c.prototype.removeListener.call(this,e,t);return"readable"===e&&l.nextTick(U,this),r},O.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&l.nextTick(U,this),t},O.prototype.resume=function(){var e,t,r=this._readableState;return r.flowing||(i("resume"),r.flowing=!r.readableListening,e=this,(t=r).resumeScheduled||(t.resumeScheduled=!0,l.nextTick(z,e,t))),r.paused=!1,this},O.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<S.length;a++)e.on(S[a],this.emit.bind(this,S[a]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===a&&(a=r("tm")),a(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=j,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(e,t){return void 0===s&&(s=r("s")),s(O,e,t)})},h(e,t,r){e.exports=c;var n=r("x").F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,l=r("F");function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",p)}function p(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,r){d(e,t,r)})}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r("c5")(c,l),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,function(e){t(e)})}},ep(e,t,r){var n,i,o=r("z");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){var r=t,n=e,i=r.entry;for(r.entry=null;i;){var o=i.callback;n.pendingcb--,o(void 0),i=i.next}n.corkedRequestsFree.next=r}}e.exports=O,O.WritableState=R;var s={deprecate:r("N")},l=r("Js"),u=r("d").Buffer,c=(void 0!==r.g?r.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},p=r("w"),d=r("G").getHighWaterMark,f=r("x").F,h=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,y=f.ERR_STREAM_CANNOT_PIPE,b=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,E=p.errorOrDestroy;function S(){}function R(e,t,i){n=n||r("F"),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t)--r.pendingcb,n?(o.nextTick(i,t),o.nextTick(P,e,r),e._writableState.errorEmitted=!0,E(e,t)):(i(t),e._writableState.errorEmitted=!0,E(e,t),P(e,r));else{var a=x(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?o.nextTick(A,e,r,a,i):A(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}r("c5")(O,l),R.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};try{Object.defineProperty(R.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}function O(e){var t=this instanceof(n=n||r("F"));if(!t&&!i.call(O,this))return new O(e);this._writableState=new R(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function C(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){var i,o;r||(i=e,0===(o=t).length&&o.needDrain&&(o.needDrain=!1,i.emit("drain"))),t.pendingcb--,n(),P(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var o=0,s=!0;r;)n[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,C(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,c=r.callback,p=t.objectMode?1:l.length;if(C(e,t,!1,p,l,u,c),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),P(e,t)})}function P(e,t){var r=x(t);if(r&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===O&&e&&e._writableState instanceof R}})):i=function(e){return e instanceof this},O.prototype.pipe=function(){E(this,new y)},O.prototype.write=function(e,t,r){var n,i,a,s,l,p,d,f=this._writableState,m=!1,g=!f.objectMode&&(n=e,u.isBuffer(n)||n instanceof c);return(g&&!u.isBuffer(e)&&(i=e,e=u.from(i)),"function"==typeof t&&(r=t,t=null),g?t="buffer":t||(t=f.defaultEncoding),"function"!=typeof r&&(r=S),f.ending)?(a=r,E(this,s=new w),o.nextTick(a,s)):(g||(l=e,p=r,null===l?d=new v:"string"==typeof l||f.objectMode||(d=new h("chunk",["string","Buffer"],l)),!d||(E(this,d),o.nextTick(p,d),0)))&&(f.pendingcb++,m=function(e,t,r,n,i,o){if(!r){var a,s,l=(a=n,s=i,t.objectMode||!1===t.decodeStrings||"string"!=typeof a||(a=u.from(a,s)),a);n!==l&&(r=!0,i="buffer",n=l)}var c=t.objectMode?1:n.length;t.length+=c;var p=t.length<t.highWaterMark;if(p||(t.needDrain=!0),t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,c,n,i,o);return p}(this,f,g,e,t,r)),m},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},O.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new m("_write()"))},O.prototype._writev=null,O.prototype.end=function(e,t,r){var n,i,a,s=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||(n=this,i=s,a=r,i.ending=!0,P(n,i),a&&(i.finished?o.nextTick(a):n.once("finish",a)),i.ended=!0,n.writable=!1),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=p.destroy,O.prototype._undestroy=p.undestroy,O.prototype._destroy=function(e,t){t(e)}},tm(e,t,r){var n,i=r("z");function o(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r("n"),s=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),p=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function m(e){var t=e[s];if(null!==t){var r=e[f].read();null!==r&&(e[p]=null,e[s]=null,e[l]=null,t(h(r,!1)))}}function g(e){i.nextTick(m,e)}var y=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((o(n={get stream(){return this[f]},next:function(){var e,t,r=this,n=this[u];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(e,t){i.nextTick(function(){r[u]?t(r[u]):e(h(void 0,!0))})});var o=this[p];if(o)t=new Promise((e=this,function(t,r){o.then(function(){e[c]?t(h(void 0,!0)):e[d](t,r)},r)}));else{var a=this[f].read();if(null!==a)return Promise.resolve(h(a,!1));t=new Promise(this[d])}return this[p]=t,t}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[f].destroy(null,function(e){e?r(e):t(h(void 0,!0))})})}),n),y);e.exports=function(e){var t,r=Object.create(b,(o(t={},f,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:e._readableState.endEmitted,writable:!0}),o(t,d,{value:function(e,t){var n=r[f].read();n?(r[p]=null,r[s]=null,r[l]=null,e(h(n,!1))):(r[s]=e,r[l]=t)},writable:!0}),t));return r[p]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];null!==t&&(r[p]=null,r[s]=null,r[l]=null,t(e)),r[u]=e;return}var n=r[s];null!==n&&(r[p]=null,r[s]=null,r[l]=null,n(h(void 0,!0))),r[c]=!0}),e.on("readable",g.bind(null,r)),r}},LP(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=o(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var a=r("d").Buffer,s=r("o").inspect,l=s&&s.custom||"inspect";e.exports=function(){var e;function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return e=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n=a.allocUnsafe(e>>>0),i=this.head,o=0;i;)t=i.data,r=o,a.prototype.copy.call(t,n,r),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return s(this,i(i({},t),{},{depth:0,customInspect:!1}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}()},w(e,t,r){var n=r("z");function i(e,t){a(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},n(e,t,r){var n=r("x").F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),a=o||i,s=!1,o=function(){if(!s){s=!0;for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t)}};var a,s,l=r.readable||!1!==r.readable&&t.readable,u=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||d()},p=t._writableState&&t._writableState.finished,d=function(){u=!1,p=!0,l||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){l=!1,f=!0,u||o.call(t)},m=function(e){o.call(t,e)},g=function(){var e;return l&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):u&&!p?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on("finish",d)};return t.setHeader&&"function"==typeof t.abort?(t.on("complete",d),t.on("abort",g),t.req?y():t.on("request",y)):u&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",h),t.on("finish",d),!1!==r.error&&t.on("error",m),t.on("close",g),function(){t.removeListener("complete",d),t.removeListener("abort",g),t.removeListener("request",y),t.req&&t.req.removeListener("finish",d),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",d),t.removeListener("end",h),t.removeListener("error",m),t.removeListener("close",g)}}},s(e){e.exports=function(){throw Error("Readable.from is not available in the browser")}},Kx(e,t,r){var n,i=r("x").F,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function l(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e,t,i=arguments.length,c=Array(i),p=0;p<i;p++)c[p]=arguments[p];var d=(e=c).length&&"function"==typeof e[e.length-1]?e.pop():s;if(Array.isArray(c[0])&&(c=c[0]),c.length<2)throw new o("streams");var f=c.map(function(e,i){var o,s,u,p,h,m,g=i<c.length-1;return o=i>0,u=s=function(e){t||(t=e),e&&f.forEach(l),g||(f.forEach(l),d(t))},p=!1,s=function(){p||(p=!0,u.apply(void 0,arguments))},h=!1,e.on("close",function(){h=!0}),void 0===n&&(n=r("n")),n(e,{readable:g,writable:o},function(e){if(e)return s(e);h=!0,s()}),m=!1,function(t){if(!h&&!m){if(m=!0,e.setHeader&&"function"==typeof e.abort)return e.abort();if("function"==typeof e.destroy)return e.destroy();s(t||new a("pipe"))}}});return c.reduce(u)}},G(e,t,r){var n=r("x").F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=null!=t.highWaterMark?t.highWaterMark:i?t[r]:null;if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},Js(e,t,r){e.exports=r("q").EventEmitter},t(e,t,r){var n=r("K").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=p,t=3;break;default:this.write=d,this.end=f;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},N(e,t,r){e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}};function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}},o(){},b(){}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t,n)=>{var i=(t,n)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,[n]:t[i]})};i(t,"get"),i(n,"value")},r.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{let e,t,i,o,a,s,l,u,c,p,d,f,h,m,g,y;r.d(n,{TD:()=>ActorClient,B:()=>ActorCollectionClient,h0:()=>ActorEnvVarClient,XP:()=>ActorEnvVarCollectionClient,v8:()=>dA,Lu:()=>pU,vp:()=>ActorVersionClient,Jo:()=>ActorVersionCollectionClient,UP:()=>ApifyApiError,rj:()=>ApifyClient,Ns:()=>ArgumentValidationError,yD:()=>AxiosHttpClient,Ip:()=>BrotliHttpCompressor,kt:()=>BuildClient,KW:()=>BuildCollectionClient,fK:()=>ConflictError,wb:()=>DatasetClient,wv:()=>DatasetCollectionClient,yY:()=>pF,qQ:()=>ForbiddenError,_:()=>GzipHttpCompressor,Qq:()=>HttpClient,tY:()=>InvalidRequestError,rE:()=>InvalidResponseBodyError,PD:()=>KeyValueStoreClient,lE:()=>KeyValueStoreCollectionClient,ss:()=>LogClient,kq:()=>LoggerActorRedirect,m_:()=>NotFoundError,O_:()=>pz,OE:()=>RateLimitError,oc:()=>RequestQueueClient,oW:()=>RequestQueueCollectionClient,dK:()=>ResponseValidationError,Ry:()=>RunClient,Ng:()=>RunCollectionClient,Hg:()=>pL,L6:()=>ScheduleClient,Ty:()=>ScheduleCollectionClient,gP:()=>ServerError,py:()=>StoreCollectionClient,YS:()=>StreamedLog,t1:()=>TaskClient,jE:()=>TaskCollectionClient,D_:()=>UnauthorizedError,jx:()=>UserClient,F:()=>WebhookClient,J_:()=>WebhookCollectionClient,hH:()=>WebhookDispatchClient,zC:()=>WebhookDispatchCollectionClient,_l:()=>pI});var b,v,w,_,E,S,R,O,C,A,T,x,k,P,I,U,L,z,N,j,D,$={};function M(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function B(e,t="|"){return e.map(e=>es(e)).join(t)}function F(e,t){return"bigint"==typeof t?t.toString():t}r.r($),r.d($,{hasBrowserEnv:()=>aZ,hasStandardBrowserEnv:()=>aH,hasStandardBrowserWebWorkerEnv:()=>aV,navigator:()=>aK,origin:()=>aJ});let Cached=class Cached{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}};function q(e){return new Cached(e)}function W(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Z(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function K(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function H(e){return K(e._zod.def)??e._zod.def.shape}function V(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return Z(this,t,e),e},enumerable:!0,configurable:!0})}function J(e,t,r){t in e?Z(e,t,r):e[t]=r}function G(e,t,r,n){let i=H(t);for(let o of r){let r=Object.getOwnPropertyDescriptor(i,o);r.enumerable&&(r.get?V(e,o,()=>{let e=t._zod.def.shape[o];return n?n(e,o):e}):J(e,o,n?n(r.value,o):r.value))}}function Y(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}let Q="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function X(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ee=q(()=>{if(ek.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function et(e){if(!1===X(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==X(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function er(e){return et(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let en=new Set(["string","number","symbol"]);function ei(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eo(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function ea(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function es(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let el={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ec(e,t){let r=H(e),n=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&n.push(e)}return n}function ep(e,t){let r={};G(r,e,Reflect.ownKeys(H(e)));for(let e of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,e);n.enumerable&&(n.get?V(r,e,()=>t[e]):J(r,e,n.value))}return r}function ed(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let o=r?new Set(ec(t,r)):void 0,a={};return G(a,t,Reflect.ownKeys(H(t)),e&&((t,r)=>o&&!o.has(r)?t:new e({type:"optional",innerType:t}))),eo(t,Y(t._zod.def,{shape:a,checks:[]}))}function ef(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function eh(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function em(e){return"string"==typeof e?e:e?.message}function eg(e,t,r){var n;for(let i=t;i<e.length;i++)(n=e[i]).schema??(n.schema=r)}function ey(e,t,r){let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,o=e.message?e.message:em(e.inst?._zod.def?.error?.(e))??em(i?.(e))??em(t?.error?.(e))??em(r.customError?.(e))??em(r.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=e.input),a}let eb=/[\uD800-\uDBFF]/;function ev(e){let t=e.length;if(!eb.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(64512&e.charCodeAt(n))==55296&&(64512&e.charCodeAt(n+1))==56320&&(r--,n++);return r}function ew(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function e_(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function eE(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function eS(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return eE(this,r,n(this))},set(e){eE(this,r,e)}})}return t}let eR=!1,eO={configurable:!0,get(){eR=!0}};function eC(t,r,n){let i=Object.getPrototypeOf(t._zod);if(r in i&&e!==t._zod){e=void 0;return}e=t._zod,Object.defineProperty(i,r,{configurable:!0,get(){Object.defineProperty(this,r,eO);let e=eR;eR=!1;try{let t=n(this);return eR?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),eR=eR||e,t}catch(t){throw delete this[r],eR=eR||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}let eA={value:void 0,enumerable:!1},eT="captureStackTrace"in Error?Error:null;function ex(e,t,r,n){function i(e){this.def=e,this.constr=l,this.traits=new Set}i.prototype={};let o=r&&new WeakSet;function a(n,a){if(n._zod){if(n._zod.traits.has(e))return}else{eA.value=new i(a);try{Object.defineProperty(n,"_zod",eA)}finally{eA.value=void 0}}if(n._zod.traits.add(e),t(n,a),o){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let a=i??e;if(!o.has(a)){o.add(a);for(let e in r){let t=Object.getOwnPropertyDescriptor(r,e);t.get?Object.defineProperty(a,e,{...t,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:eE(this,t,r.bind(this))},set(e){eE(this,t,e)}})}(a,e,t.value)}}}let s=l.prototype;for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(e in n||(n[e]=s[e].bind(n)))}let s=n?.Parent??Object;let Definition=class Definition extends s{};function l(e){let t=n?.Parent?function(e){let t=eT;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return eT=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(Definition):this;a(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(Definition,"name",{value:e}),Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}let $ZodAsyncError=class $ZodAsyncError extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};let $ZodEncodeError=class $ZodEncodeError extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(U=globalThis).__zod_globalConfig??(U.__zod_globalConfig={});let ek=globalThis.__zod_globalConfig;function eP(e){return e&&Object.assign(ek,e),ek}let $ZodCyclicError=class $ZodCyclicError extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}};let eI="~memo",eU=[];function eL(e){return null!==e&&"object"==typeof e}function ez(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let eN=new WeakMap,ej=[],eD={alloc(e,r,n){let i=t;if(!i)return n;t=void 0;let o={value:n,issues:null};return i.set(r.value,o),ej.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var n,i;let o;if("backward"!==r.direction&&(n=r,i=e.value,void 0!==(o=n[eI]?.backEdges)&&eL(i)&&o.has(i)))throw new $ZodCyclicError;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var r;let n,i,o,a=!1;(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,s=(l,u)=>{let c;if(void 0===n){let t=function e(t,r,n){var i,o;let a=eN.get(t);if(void 0!==a)return 2*!!a;if(r.has(t))return 2;r.add(t);let s=0,l=t=>{if(2!==s&&t?._zod){let i=e(t,r,n);i>s&&(s=i)}},u=e=>{e>s&&(s=e)},c=t._zod.def;switch(c.type){case"object":{let t=K(c);u(t?((t,i)=>{let o=0;for(let a of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,a);if(i&&!s.enumerable)continue;let l=s.get?1:s.value?._zod?e(s.value,r,n):0;l>o&&(o=l)}return o})(t,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let e of c.items)l(e);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let e of c.options)l(e);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let i=c._cachedInner??(n?t._zod.innerType:void 0);u(i?e(i,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),i=t,1!==(o=s)&&eN.set(i,2===o),o}(e,new Set,!1);if(0===t)return e._zod.parse=r,e._zod.run===s&&(e._zod.run=r),r(l,u);2===t||a?n=!0:a=!0}let p=l.value;if(!eL(p))return r(l,u);let d=u[eI];if(d||(d={buckets:new WeakMap,backEdges:void 0},u[eI]=d),i===u)c=o;else{var f;let t;(t=(f=d).buckets.get(e))||(t=new WeakMap,f.buckets.set(e,t)),c=t,i=u,o=c}let h=c.get(p);if(h)return l.value=h.value,h.issues?h.issues.length&&l.issues.push(...ez(h.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value)),l;t=c;let m=ej.length,g=r(l,u);t=void 0;let y=ej.length>m?ej.pop():void 0;return g instanceof Promise?g.then(e=>(y&&(y.issues=e.issues.length?ez(e.issues):eU),e)):(y&&(y.issues=g.issues.length?ez(g.issues):eU),g)};e._zod.parse=s,e._zod.run===r&&(e._zod.run=s)})}},e$=/^[cC][0-9a-z]{6,}$/,eM=/^[0-9a-z]+$/,eB=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,eF=/^[0-9a-vA-V]{20}$/,eq=/^[A-Za-z0-9]{27}$/,eW=/^[a-zA-Z0-9_-]{21}$/,eZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eK=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,eH=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,eV=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,eY=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,eQ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eX=/^https?$/,e0=/^\+[1-9]\d{6,14}$/,e1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",e2=RegExp(`^${e1}$`);function e4(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let e3=/^[\s\S]{0,}$/,e9=/^-?\d+$/,e6=/^-?\d+(?:\.\d+)?$/,e5=/^(?:true|false)$/i,e8=/^null$/i,e7=/^[^A-Z]*$/,te=/^[^a-z]*$/,tt=ex("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tr=e=>{let t=e.value;return null!=t&&void 0!==t.length},tn={number:"number",bigint:"bigint",object:"date"},ti=ex("$ZodCheckLessThan",(e,t)=>{tt.init(e,t);let r=tn[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:tn[typeof n.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),to=ex("$ZodCheckGreaterThan",(e,t)=>{tt.init(e,t);let r=tn[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:tn[typeof n.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ta=ex("$ZodCheckMultipleOf",(e,t)=>{tt.init(e,t),e._zod.check=r=>{let n,i,o;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0==(i=Math.round(n=r.value/t.value),o=4*Number.EPSILON*Math.max(Math.abs(n),1),Math.abs(n-i)<o?0:n-i))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ts=ex("$ZodCheckNumberFormat",(e,t)=>{tt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,o]=el[t.format];e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s))return void a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}s<i&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),tl=ex("$ZodCheckMaxLength",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=tr),e._zod.check=r=>{let n=r.value,i=n.length;if(("string"==typeof n&&i>t.maximum?ev(n):i)<=t.maximum)return;let o=ew(n);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tu=ex("$ZodCheckMinLength",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=tr),e._zod.check=r=>{let n=r.value,i=n.length;if(("string"==typeof n&&i>=t.minimum&&i<2*t.minimum?ev(n):i)>=t.minimum)return;let o=ew(n);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tc=ex("$ZodCheckLengthEquals",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=tr),e._zod.check=r=>{let n=r.value,i=n.length,o="string"==typeof n&&i>=t.length&&i<=2*t.length?ev(n):i;if(o===t.length)return;let a=ew(n),s=o>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tp=ex("$ZodCheckStringFormat",(e,t)=>{var r,n;tt.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),td=ex("$ZodCheckRegex",(e,t)=>{tp.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),tf=ex("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=e7),tp.init(e,t)}),th=ex("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=te),tp.init(e,t)}),tm=ex("$ZodCheckIncludes",(e,t)=>{tt.init(e,t);let r=ei(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),tg=ex("$ZodCheckStartsWith",(e,t)=>{tt.init(e,t);let r=RegExp(`^${ei(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ty=ex("$ZodCheckEndsWith",(e,t)=>{tt.init(e,t);let r=RegExp(`.*${ei(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function tb(e,t,r){e.issues.length&&t.issues.push(...eh(r,e.issues))}let tv=ex("$ZodCheckProperties",(e,t)=>{let r;tt.init(e,t),eE(e,Symbol.iterator,function*(){yield e},!1),e._zod.check=n=>{let i;if(null==n.value)return void n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});r??(r=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let o=n.value;for(let[e,t]of r){let r=t._zod.run({value:o[e],issues:[]},{});r instanceof Promise?(i??(i=[]),i.push(r.then(t=>tb(t,n,e)))):tb(r,n,e)}if(i)return Promise.all(i).then(()=>void 0)}}),tw=ex("$ZodCheckOverwrite",(e,t)=>{tt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});let Doc=class Doc{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
2
|
+
var e={v(e,t,r){var n=r("z");let i=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,o=()=>{let e={enabled:void 0!==n&&"0"!==n.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},t=(e,t,r)=>"function"==typeof e?e(t):e.wrap(t,r),o=(r,n)=>{if(""===r||null==r)return"";if(!1===e.enabled)return r;if(!1===e.visible)return"";let i=""+r,o=i.includes("\n"),a=n.length;for(a>0&&n.includes("unstyle")&&(n=[...new Set(["unstyle",...n])].reverse());a-- >0;)i=t(e.styles[n[a]],i,o);return i},a=(t,r,n)=>{var i;let a,s,l;e.styles[t]=(a=(i={name:t,codes:r}).open=`\x1b[${i.codes[0]}m`,s=i.close=`\x1b[${i.codes[1]}m`,l=i.regex=RegExp(`\\u001b\\[${i.codes[1]}m`,"g"),i.wrap=(e,t)=>{e.includes(s)&&(e=e.replace(l,s+a));let r=a+e+s;return t?r.replace(/\r*\n/g,`${s}$&${a}`):r},i),(e.keys[n]||(e.keys[n]=[])).push(t),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(r){e.alias(t,r)},get(){let r=e=>o(e,r.stack);return Reflect.setPrototypeOf(r,e),r.stack=this.stack?this.stack.concat(t):[t],r}})};return a("reset",[0,0],"modifier"),a("bold",[1,22],"modifier"),a("dim",[2,22],"modifier"),a("italic",[3,23],"modifier"),a("underline",[4,24],"modifier"),a("inverse",[7,27],"modifier"),a("hidden",[8,28],"modifier"),a("strikethrough",[9,29],"modifier"),a("black",[30,39],"color"),a("red",[31,39],"color"),a("green",[32,39],"color"),a("yellow",[33,39],"color"),a("blue",[34,39],"color"),a("magenta",[35,39],"color"),a("cyan",[36,39],"color"),a("white",[37,39],"color"),a("gray",[90,39],"color"),a("grey",[90,39],"color"),a("bgBlack",[40,49],"bg"),a("bgRed",[41,49],"bg"),a("bgGreen",[42,49],"bg"),a("bgYellow",[43,49],"bg"),a("bgBlue",[44,49],"bg"),a("bgMagenta",[45,49],"bg"),a("bgCyan",[46,49],"bg"),a("bgWhite",[47,49],"bg"),a("blackBright",[90,39],"bright"),a("redBright",[91,39],"bright"),a("greenBright",[92,39],"bright"),a("yellowBright",[93,39],"bright"),a("blueBright",[94,39],"bright"),a("magentaBright",[95,39],"bright"),a("cyanBright",[96,39],"bright"),a("whiteBright",[97,39],"bright"),a("bgBlackBright",[100,49],"bgBright"),a("bgRedBright",[101,49],"bgBright"),a("bgGreenBright",[102,49],"bgBright"),a("bgYellowBright",[103,49],"bgBright"),a("bgBlueBright",[104,49],"bgBright"),a("bgMagentaBright",[105,49],"bgBright"),a("bgCyanBright",[106,49],"bgBright"),a("bgWhiteBright",[107,49],"bgBright"),e.ansiRegex=i,e.hasColor=e.hasAnsi=t=>(e.ansiRegex.lastIndex=0,"string"==typeof t&&""!==t&&e.ansiRegex.test(t)),e.alias=(t,r)=>{let n="string"==typeof r?e[r]:r;if("function"!=typeof n)throw TypeError("Expected alias to be the name of an existing color (string) or a function");n.stack||(Reflect.defineProperty(n,"name",{value:t}),e.styles[t]=n,n.stack=[t]),Reflect.defineProperty(e,t,{configurable:!0,enumerable:!0,set(r){e.alias(t,r)},get(){let t=e=>o(e,t.stack);return Reflect.setPrototypeOf(t,e),t.stack=this.stack?this.stack.concat(n.stack):n.stack,t}})},e.theme=t=>{if(!(null!==t&&"object"==typeof t&&!Array.isArray(t)))throw TypeError("Expected theme to be an object");for(let r of Object.keys(t))e.alias(r,t[r]);return e},e.alias("unstyle",t=>"string"==typeof t&&""!==t?(e.ansiRegex.lastIndex=0,t.replace(e.ansiRegex,"")):""),e.alias("noop",e=>e),e.none=e.clear=e.noop,e.stripColor=e.unstyle,e.symbols=r("L"),e.define=a,e};e.exports=o(),e.exports.create=o},L(e,t,r){var n=r("z");let i=void 0!==n&&"Hyper"===n.env.TERM_PROGRAM,o=void 0!==n&&"win32"===n.platform,a=void 0!==n&&"linux"===n.platform,s={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},l=Object.assign({},s,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),u=Object.assign({},s,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:a?"▸":"❯",pointerSmall:a?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});e.exports=o&&!i?l:u,Reflect.defineProperty(e.exports,"common",{enumerable:!1,value:s}),Reflect.defineProperty(e.exports,"windows",{enumerable:!1,value:l}),Reflect.defineProperty(e.exports,"other",{enumerable:!1,value:u})},JO(e,t){t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,o=l(e),a=o[0],s=o[1],u=new i((a+s)*3/4-s),c=0,p=s>0?a-4:a;for(r=0;r<p;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;a<s;a+=16383)o.push(function(e,t,n){for(var i,o=[],a=t;a<n;a+=3)i=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}(e,a,a+16383>s?s:a+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},d(e,t,r){var n=r("JO"),i=r("r"),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!s.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|h(n,i),l=a(o),u=l.write(n,i);return u!==o&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e)){var c=e;if(x(c,Uint8Array)){var m=new Uint8Array(c);return d(m.buffer,m.byteOffset,m.byteLength)}return p(c)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(x(e,ArrayBuffer)||e&&x(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(x(e,SharedArrayBuffer)||e&&x(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var g=e.valueOf&&e.valueOf();if(null!=g&&g!==e)return s.from(g,t,r);var y=function(e){if(s.isBuffer(e)){var t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(y)return y;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),a(e<0?0:0|f(e))}function p(e){for(var t=e.length<0?0:0|f(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),s.prototype),n}function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||x(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return C(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return A(e).length;default:if(i)return n?-1:C(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){var i,o,a,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=k[e[o]];return i}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,o=t,a=r,0===o&&a===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}(this,t,r);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){var o;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(o=r*=1)!=o&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var o,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else -1!==c&&(o-=o-c),c=-1}else for(r+l>s&&(r=s-l),o=r;o>=0;o--){for(var p=!0,d=0;d<l;d++)if(u(e,o+d)!==u(t,d)){p=!1;break}if(p)return o}return -1}function v(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,l,u=e[i],c=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p<=r)switch(p){case 1:u<128&&(c=u);break;case 2:(192&(o=e[i+1]))==128&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],a=e[i+2],(192&o)==128&&(192&a)==128&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=p}var d=n,f=d.length;if(f<=4096)return String.fromCharCode.apply(String,d);for(var h="",m=0;m<f;)h+=String.fromCharCode.apply(String,d.slice(m,m+=4096));return h}function w(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function _(e,t,r,n,i,o){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function E(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function S(e,t,r,n,o){return t*=1,r>>>=0,o||E(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function R(e,t,r,n,o){return t*=1,r>>>=0,o||E(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(x(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),x(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=s.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(x(o,Uint8Array))i+o.length>n.length?s.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else if(s.isBuffer(o))o.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):m.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,i){if(x(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,a=r-t,l=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),p=0;p<l;++p)if(u[p]!==c[p]){o=u[p],a=c[p];break}return o<a?-1:+(a<o)},s.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},s.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,o,a,s,l,u,c,p,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var f=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s,l=parseInt(t.substr(2*a,2),16);if((s=l)!=s)break;e[r+a]=l}return a}(this,e,t,r);case"utf8":case"utf-8":return i=t,o=r,T(C(e,this.length-i),this,i,o);case"ascii":case"latin1":case"binary":return a=t,s=r,T(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(e),this,a,s);case"base64":return l=t,u=r,T(A(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,p=r,T(function(e,t){for(var r,n,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,p);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;_(this,e,t,r,i,0)}var o=1,a=0;for(this[t]=255&e;++a<r&&(o*=256);)this[t+a]=e/o&255;return t+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;_(this,e,t,r,i,0)}var o=r-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);_(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,r){return S(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return S(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},s.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=s.isBuffer(e)?e:s.from(e,n),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%l]}return this};var O=/[^+/0-9A-Za-z-_]/g;function C(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319||a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function A(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function x(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var k=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},q(e){var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(r,n){var i,o,a;function s(r){e.removeListener(t,l),n(r)}function l(){"function"==typeof e.removeListener&&e.removeListener("error",s),r([].slice.call(arguments))}m(e,t,l,{once:!0}),"error"!==t&&(i=e,o=s,a={once:!0},"function"==typeof i.on&&m(i,"error",o,a))})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=l(e))>0&&a.length>i&&!a.warned){a.warned=!0;var i,o,a,u=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):h(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var a,s=Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else for(var u=l.length,c=h(l,u),r=0;r<u;++r)n(c[r],this,t);return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},r(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,p=r?i-1:0,d=r?-1:1,f=e[t+p];for(p+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=256*o+e[t+p],p+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+p],p+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return a?0/0:(f?-1:1)*2e308;a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,p=c>>1,d=5960464477539062e-23*(23===i),f=n?0:o-1,h=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(s=+!!isNaN(t),a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?t+=d/l:t+=d*Math.pow(2,1-p),t*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*l-1)*Math.pow(2,i),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[r+f]=255&s,f+=h,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[r+f]=255&a,f+=h,a/=256,u-=8);e[r+f-h]|=128*m}},c5(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},z(e){var t,r,n,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var l=[],u=!1,c=-1;function p(){u&&n&&(u=!1,n.length?l=n.concat(l):c=-1,l.length&&d())}function d(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(n=l,l=[];++c<t;)n&&n[c].run();c=-1,t=l.length}n=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function h(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new f(e,t)),1!==l.length||u||s(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}},K(e,t,r){var n=r("d"),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},c(e,t,r){e.exports=i;var n=r("q").EventEmitter;function i(){n.call(this)}r("c5")(i,n),i.Readable=r("e"),i.Writable=r("ep"),i.Duplex=r("F"),i.Transform=r("h"),i.PassThrough=r("zM"),i.finished=r("n"),i.pipeline=r("Kx"),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var a=!1;function s(){a||(a=!0,e.end())}function l(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},x(e){var t={};function r(e,r,n){n||(n=Error);var i=function(e){function t(t,n,i){return e.call(this,"string"==typeof r?r:r(t,n,i))||this}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e,t}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(!Array.isArray(e))return"of ".concat(t," ").concat(String(e));var r=e.length;return(e=e.map(function(e){return String(e)}),r>2)?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(l="must not be",t=t.replace(/^not /,"")):l="must be",o=" argument",(void 0===a||a>e.length)&&(a=e.length),e.substring(a-o.length,a)===o)u="The ".concat(e," ").concat(l," ").concat(n(t,"type"));else{var i,o,a,s,l,u,c=("number"!=typeof s&&(s=0),s+1>e.length||-1===e.indexOf(".",s))?"argument":"property";u='The "'.concat(e,'" ').concat(c," ").concat(l," ").concat(n(t,"type"))}return u+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},F(e,t,r){var n=r("z"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var o=r("e"),a=r("ep");r("c5")(c,o);for(var s=i(a.prototype),l=0;l<s.length;l++){var u=s[l];c.prototype[u]||(c.prototype[u]=a.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",p)))}function p(){this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},zM(e,t,r){e.exports=i;var n=r("h");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r("c5")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},e(e,t,r){var n,i,o,a,s,l=r("z");e.exports=O,O.ReadableState=R,r("q").EventEmitter;var u=function(e,t){return e.listeners(t).length},c=r("Js"),p=r("d").Buffer,d=(void 0!==r.g?r.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},f=r("b");i=f&&f.debuglog?f.debuglog("stream"):function(){};var h=r("LP"),m=r("w"),g=r("G").getHighWaterMark,y=r("x").F,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,_=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r("c5")(O,c);var E=m.errorOrDestroy,S=["error","close","destroy","pause","resume"];function R(e,t,i){n=n||r("F"),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(o||(o=r("t").I),this.decoder=new o(e.encoding),this.encoding=e.encoding)}function O(e){if(n=n||r("F"),!(this instanceof O))return new O(e);var t=this instanceof n;this._readableState=new R(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function C(e,t,r,n,o){i("readableAddChunk",t);var a,s,l=e._readableState;if(null===t)l.reading=!1,function(e,t){if(i("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,k(e)))}}(e,l);else if(o||(s=function(e,t){var r;return p.isBuffer(t)||t instanceof d||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t)),r}(l,t)),s)E(e,s);else if(l.objectMode||t&&t.length>0)if("string"==typeof t||l.objectMode||Object.getPrototypeOf(t)===p.prototype||(a=t,t=p.from(a)),n)l.endEmitted?E(e,new _):A(e,l,t,!0);else if(l.ended)E(e,new v);else{if(l.destroyed)return!1;l.reading=!1,l.decoder&&!r?(t=l.decoder.write(t),l.objectMode||0!==t.length?A(e,l,t,!1):P(e,l)):A(e,l,t,!1)}else n||(l.reading=!1,P(e,l));return!l.ended&&(l.length<l.highWaterMark||0===l.length)}function A(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&x(e)),P(e,t)}function T(e,t){var r;if(e<=0||0===t.length&&t.ended)return 0;if(t.objectMode)return 1;if(e!=e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;return(e>t.highWaterMark&&((r=e)>=0x40000000?r=0x40000000:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),t.highWaterMark=r),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function x(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,l.nextTick(k,e))}function k(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,l.nextTick(U,e,t))}function U(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(i("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){i("readable nexttick read 0"),e.read(0)}function z(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function D(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,l.nextTick($,t,e))}function $(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function M(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=m.destroy,O.prototype._undestroy=m.undestroy,O.prototype._destroy=function(e,t){t(e)},O.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=p.from(e,t),t=""),r=!0),C(this,e,t,!1,r)},O.prototype.unshift=function(e){return C(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.prototype.setEncoding=function(e){o||(o=r("t").I);var t=new o(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},O.prototype.read=function(e){i("read",e),e=parseInt(e,10);var t,r=this._readableState,n=e;if(0!==e&&(r.emittedReadable=!1),0===e&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return i("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?D(this):x(this),null;if(0===(e=T(e,r))&&r.ended)return 0===r.length&&D(this),null;var o=r.needReadable;return i("need readable",o),(0===r.length||r.length-e<r.highWaterMark)&&i("length less than watermark",o=!0),r.ended||r.reading?i("reading or ended",o=!1):o&&(i("do read"),r.reading=!0,r.sync=!0,0===r.length&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(e=T(n,r))),null===(t=e>0?j(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&D(this)),null!==t&&this.emit("data",t),t},O.prototype._read=function(e){E(this,new w("_read()"))},O.prototype.pipe=function(e,t){var r,n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,i("pipe count=%d opts=%j",o.pipesCount,t);var a=t&&!1===t.end||e===l.stdout||e===l.stderr?g:s;function s(){i("onend"),e.end()}o.endEmitted?l.nextTick(a):n.once("end",a),e.on("unpipe",function t(r,a){i("onunpipe"),r===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",f),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",g),n.removeListener("data",d),p=!0,o.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&c())});var c=(r=n,function(){var e=r._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&u(r,"data")&&(e.flowing=!0,N(r))});e.on("drain",c);var p=!1;function d(t){i("ondata");var r=e.write(t);i("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==M(o.pipes,e))&&!p&&(i("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function f(t){i("onerror",t),g(),e.removeListener("error",f),0===u(e,"error")&&E(e,t)}function h(){e.removeListener("finish",m),g()}function m(){i("onfinish"),e.removeListener("close",h),g()}function g(){i("unpipe"),n.unpipe(e)}return n.on("data",d),!function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",h),e.once("finish",m),e.emit("pipe",n),o.flowing||(i("pipe resume"),n.resume()),e},O.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=M(t.pipes,e);return -1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},O.prototype.on=function(e,t){var r=c.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?x(this):n.reading||l.nextTick(L,this)),r},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var r=c.prototype.removeListener.call(this,e,t);return"readable"===e&&l.nextTick(I,this),r},O.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&l.nextTick(I,this),t},O.prototype.resume=function(){var e,t,r=this._readableState;return r.flowing||(i("resume"),r.flowing=!r.readableListening,e=this,(t=r).resumeScheduled||(t.resumeScheduled=!0,l.nextTick(z,e,t))),r.paused=!1,this},O.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},O.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<S.length;a++)e.on(S[a],this.emit.bind(this,S[a]));return this._read=function(t){i("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===a&&(a=r("tm")),a(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=j,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(e,t){return void 0===s&&(s=r("s")),s(O,e,t)})},h(e,t,r){e.exports=c;var n=r("x").F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,l=r("F");function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);l.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",p)}function p(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,r){d(e,t,r)})}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r("c5")(c,l),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,function(e){t(e)})}},ep(e,t,r){var n,i,o=r("z");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){var r=t,n=e,i=r.entry;for(r.entry=null;i;){var o=i.callback;n.pendingcb--,o(void 0),i=i.next}n.corkedRequestsFree.next=r}}e.exports=O,O.WritableState=R;var s={deprecate:r("N")},l=r("Js"),u=r("d").Buffer,c=(void 0!==r.g?r.g:"u">typeof window?window:"u">typeof self?self:{}).Uint8Array||function(){},p=r("w"),d=r("G").getHighWaterMark,f=r("x").F,h=f.ERR_INVALID_ARG_TYPE,m=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,y=f.ERR_STREAM_CANNOT_PIPE,b=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,E=p.errorOrDestroy;function S(){}function R(e,t,i){n=n||r("F"),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t)--r.pendingcb,n?(o.nextTick(i,t),o.nextTick(P,e,r),e._writableState.errorEmitted=!0,E(e,t)):(i(t),e._writableState.errorEmitted=!0,E(e,t),P(e,r));else{var a=x(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?o.nextTick(A,e,r,a,i):A(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}r("c5")(O,l),R.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};try{Object.defineProperty(R.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}function O(e){var t=this instanceof(n=n||r("F"));if(!t&&!i.call(O,this))return new O(e);this._writableState=new R(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function C(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){var i,o;r||(i=e,0===(o=t).length&&o.needDrain&&(o.needDrain=!1,i.emit("drain"))),t.pendingcb--,n(),P(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var o=0,s=!0;r;)n[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,C(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,c=r.callback,p=t.objectMode?1:l.length;if(C(e,t,!1,p,l,u,c),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final(function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),P(e,t)})}function P(e,t){var r=x(t);if(r&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===O&&e&&e._writableState instanceof R}})):i=function(e){return e instanceof this},O.prototype.pipe=function(){E(this,new y)},O.prototype.write=function(e,t,r){var n,i,a,s,l,p,d,f=this._writableState,m=!1,g=!f.objectMode&&(n=e,u.isBuffer(n)||n instanceof c);return(g&&!u.isBuffer(e)&&(i=e,e=u.from(i)),"function"==typeof t&&(r=t,t=null),g?t="buffer":t||(t=f.defaultEncoding),"function"!=typeof r&&(r=S),f.ending)?(a=r,E(this,s=new w),o.nextTick(a,s)):(g||(l=e,p=r,null===l?d=new v:"string"==typeof l||f.objectMode||(d=new h("chunk",["string","Buffer"],l)),!d||(E(this,d),o.nextTick(p,d),0)))&&(f.pendingcb++,m=function(e,t,r,n,i,o){if(!r){var a,s,l=(a=n,s=i,t.objectMode||!1===t.decodeStrings||"string"!=typeof a||(a=u.from(a,s)),a);n!==l&&(r=!0,i="buffer",n=l)}var c=t.objectMode?1:n.length;t.length+=c;var p=t.length<t.highWaterMark;if(p||(t.needDrain=!0),t.writing||t.corked){var d=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},d?d.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,c,n,i,o);return p}(this,f,g,e,t,r)),m},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||T(this,e))},O.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new m("_write()"))},O.prototype._writev=null,O.prototype.end=function(e,t,r){var n,i,a,s=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),s.corked&&(s.corked=1,this.uncork()),s.ending||(n=this,i=s,a=r,i.ending=!0,P(n,i),a&&(i.finished?o.nextTick(a):n.once("finish",a)),i.ended=!0,n.writable=!1),this},Object.defineProperty(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=p.destroy,O.prototype._undestroy=p.undestroy,O.prototype._destroy=function(e,t){t(e)}},tm(e,t,r){var n,i=r("z");function o(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=r("n"),s=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),p=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function h(e,t){return{value:e,done:t}}function m(e){var t=e[s];if(null!==t){var r=e[f].read();null!==r&&(e[p]=null,e[s]=null,e[l]=null,t(h(r,!1)))}}function g(e){i.nextTick(m,e)}var y=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((o(n={get stream(){return this[f]},next:function(){var e,t,r=this,n=this[u];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(h(void 0,!0));if(this[f].destroyed)return new Promise(function(e,t){i.nextTick(function(){r[u]?t(r[u]):e(h(void 0,!0))})});var o=this[p];if(o)t=new Promise((e=this,function(t,r){o.then(function(){e[c]?t(h(void 0,!0)):e[d](t,r)},r)}));else{var a=this[f].read();if(null!==a)return Promise.resolve(h(a,!1));t=new Promise(this[d])}return this[p]=t,t}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[f].destroy(null,function(e){e?r(e):t(h(void 0,!0))})})}),n),y);e.exports=function(e){var t,r=Object.create(b,(o(t={},f,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:e._readableState.endEmitted,writable:!0}),o(t,d,{value:function(e,t){var n=r[f].read();n?(r[p]=null,r[s]=null,r[l]=null,e(h(n,!1))):(r[s]=e,r[l]=t)},writable:!0}),t));return r[p]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];null!==t&&(r[p]=null,r[s]=null,r[l]=null,t(e)),r[u]=e;return}var n=r[s];null!==n&&(r[p]=null,r[s]=null,r[l]=null,n(h(void 0,!0))),r[c]=!0}),e.on("readable",g.bind(null,r)),r}},LP(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){var n,i,a;n=e,i=t,a=r[t],(i=o(i))in n?Object.defineProperty(n,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[i]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var a=r("d").Buffer,s=r("o").inspect,l=s&&s.custom||"inspect";e.exports=function(){var e;function t(){if(!(this instanceof t))throw TypeError("Cannot call a class as a function");this.head=null,this.tail=null,this.length=0}return e=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n=a.allocUnsafe(e>>>0),i=this.head,o=0;i;)t=i.data,r=o,a.prototype.copy.call(t,n,r),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return s(this,i(i({},t),{},{depth:0,customInspect:!1}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}()},w(e,t,r){var n=r("z");function i(e,t){a(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return s||l?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},n(e,t,r){var n=r("x").F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),a=o||i,s=!1,o=function(){if(!s){s=!0;for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];a.apply(this,t)}};var a,s,l=r.readable||!1!==r.readable&&t.readable,u=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||d()},p=t._writableState&&t._writableState.finished,d=function(){u=!1,p=!0,l||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){l=!1,f=!0,u||o.call(t)},m=function(e){o.call(t,e)},g=function(){var e;return l&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):u&&!p?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},y=function(){t.req.on("finish",d)};return t.setHeader&&"function"==typeof t.abort?(t.on("complete",d),t.on("abort",g),t.req?y():t.on("request",y)):u&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",h),t.on("finish",d),!1!==r.error&&t.on("error",m),t.on("close",g),function(){t.removeListener("complete",d),t.removeListener("abort",g),t.removeListener("request",y),t.req&&t.req.removeListener("finish",d),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",d),t.removeListener("end",h),t.removeListener("error",m),t.removeListener("close",g)}}},s(e){e.exports=function(){throw Error("Readable.from is not available in the browser")}},Kx(e,t,r){var n,i=r("x").F,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function l(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e,t,i=arguments.length,c=Array(i),p=0;p<i;p++)c[p]=arguments[p];var d=(e=c).length&&"function"==typeof e[e.length-1]?e.pop():s;if(Array.isArray(c[0])&&(c=c[0]),c.length<2)throw new o("streams");var f=c.map(function(e,i){var o,s,u,p,h,m,g=i<c.length-1;return o=i>0,u=s=function(e){t||(t=e),e&&f.forEach(l),g||(f.forEach(l),d(t))},p=!1,s=function(){p||(p=!0,u.apply(void 0,arguments))},h=!1,e.on("close",function(){h=!0}),void 0===n&&(n=r("n")),n(e,{readable:g,writable:o},function(e){if(e)return s(e);h=!0,s()}),m=!1,function(t){if(!h&&!m){if(m=!0,e.setHeader&&"function"==typeof e.abort)return e.abort();if("function"==typeof e.destroy)return e.destroy();s(t||new a("pipe"))}}});return c.reduce(u)}},G(e,t,r){var n=r("x").F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=null!=t.highWaterMark?t.highWaterMark:i?t[r]:null;if(null!=o){if(!(isFinite(o)&&Math.floor(o)===o)||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},Js(e,t,r){e.exports=r("q").EventEmitter},t(e,t,r){var n=r("K").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=p,t=3;break;default:this.write=d,this.end=f;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},N(e,t,r){e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}};function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}},o(){},b(){}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t,n)=>{var i=(t,n)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,[n]:t[i]})};i(t,"get"),i(n,"value")},r.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{let e,t,i,o,a,s,l,u,c,p,d,f,h,m,g,y;r.d(n,{TD:()=>ActorClient,B:()=>ActorCollectionClient,h0:()=>ActorEnvVarClient,XP:()=>ActorEnvVarCollectionClient,v8:()=>dA,Lu:()=>pI,vp:()=>ActorVersionClient,Jo:()=>ActorVersionCollectionClient,UP:()=>ApifyApiError,rj:()=>ApifyClient,Ns:()=>ArgumentValidationError,yD:()=>AxiosHttpClient,Ip:()=>BrotliHttpCompressor,kt:()=>BuildClient,KW:()=>BuildCollectionClient,fK:()=>ConflictError,wb:()=>DatasetClient,wv:()=>DatasetCollectionClient,yY:()=>pF,qQ:()=>ForbiddenError,_:()=>GzipHttpCompressor,Qq:()=>HttpClient,tY:()=>InvalidRequestError,rE:()=>InvalidResponseBodyError,PD:()=>KeyValueStoreClient,lE:()=>KeyValueStoreCollectionClient,ss:()=>LogClient,kq:()=>LoggerActorRedirect,m_:()=>NotFoundError,O_:()=>pz,OE:()=>RateLimitError,oc:()=>RequestQueueClient,oW:()=>RequestQueueCollectionClient,dK:()=>ResponseValidationError,Ry:()=>RunClient,Ng:()=>RunCollectionClient,Hg:()=>pL,L6:()=>ScheduleClient,Ty:()=>ScheduleCollectionClient,gP:()=>ServerError,py:()=>StoreCollectionClient,YS:()=>StreamedLog,t1:()=>TaskClient,jE:()=>TaskCollectionClient,D_:()=>UnauthorizedError,jx:()=>UserClient,F:()=>WebhookClient,J_:()=>WebhookCollectionClient,hH:()=>WebhookDispatchClient,zC:()=>WebhookDispatchCollectionClient,_l:()=>pU});var b,v,w,_,E,S,R,O,C,A,T,x,k,P,U,I,L,z,N,j,D,$={};function M(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function B(e,t="|"){return e.map(e=>es(e)).join(t)}function F(e,t){return"bigint"==typeof t?t.toString():t}r.r($),r.d($,{hasBrowserEnv:()=>aZ,hasStandardBrowserEnv:()=>aH,hasStandardBrowserWebWorkerEnv:()=>aV,navigator:()=>aK,origin:()=>aJ});let Cached=class Cached{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}};function q(e){return new Cached(e)}function W(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Z(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function K(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function H(e){return K(e._zod.def)??e._zod.def.shape}function V(e,t,r){Object.defineProperty(e,t,{get(){let e=r();return Z(this,t,e),e},enumerable:!0,configurable:!0})}function J(e,t,r){t in e?Z(e,t,r):e[t]=r}function G(e,t,r,n){let i=H(t);for(let o of r){let r=Object.getOwnPropertyDescriptor(i,o);r.enumerable&&(r.get?V(e,o,()=>{let e=t._zod.def.shape[o];return n?n(e,o):e}):J(e,o,n?n(r.value,o):r.value))}}function Y(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}let Q="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function X(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let ee=q(()=>{if(ek.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function et(e){if(!1===X(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==X(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function er(e){return et(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let en=new Set(["string","number","symbol"]);function ei(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eo(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function ea(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function es(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}let el={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ec(e,t){let r=H(e),n=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&n.push(e)}return n}function ep(e,t){let r={};G(r,e,Reflect.ownKeys(H(e)));for(let e of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,e);n.enumerable&&(n.get?V(r,e,()=>t[e]):J(r,e,n.value))}return r}function ed(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let o=r?new Set(ec(t,r)):void 0,a={};return G(a,t,Reflect.ownKeys(H(t)),e&&((t,r)=>o&&!o.has(r)?t:new e({type:"optional",innerType:t}))),eo(t,Y(t._zod.def,{shape:a,checks:[]}))}function ef(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function eh(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function em(e){return"string"==typeof e?e:e?.message}function eg(e,t,r){var n;for(let i=t;i<e.length;i++)(n=e[i]).schema??(n.schema=r)}function ey(e,t,r){let n=e.inst?._zod?.traits;n?.has("$ZodType")&&(n.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,o=e.message?e.message:em(e.inst?._zod.def?.error?.(e))??em(i?.(e))??em(t?.error?.(e))??em(r.customError?.(e))??em(r.localeError?.(e))??"Invalid input",a={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(a[t]=e[t]);return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=e.input),a}let eb=/[\uD800-\uDBFF]/;function ev(e){let t=e.length;if(!eb.test(e))return t;let r=t;for(let n=0;n<t-1;n++)(64512&e.charCodeAt(n))==55296&&(64512&e.charCodeAt(n+1))==56320&&(r--,n++);return r}function ew(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function e_(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}function eE(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function eS(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return eE(this,r,n(this))},set(e){eE(this,r,e)}})}return t}let eR=!1,eO={configurable:!0,get(){eR=!0}};function eC(t,r,n){let i=Object.getPrototypeOf(t._zod);if(r in i&&e!==t._zod){e=void 0;return}e=t._zod,Object.defineProperty(i,r,{configurable:!0,get(){Object.defineProperty(this,r,eO);let e=eR;eR=!1;try{let t=n(this);return eR?delete this[r]:Object.defineProperty(this,r,{configurable:!0,writable:!0,value:t}),eR=eR||e,t}catch(t){throw delete this[r],eR=eR||e,t}},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})}})}let eA={value:void 0,enumerable:!1},eT="captureStackTrace"in Error?Error:null;function ex(e,t,r,n){function i(e){this.def=e,this.constr=l,this.traits=new Set}i.prototype={};let o=r&&new WeakSet;function a(n,a){if(n._zod){if(n._zod.traits.has(e))return}else{eA.value=new i(a);try{Object.defineProperty(n,"_zod",eA)}finally{eA.value=void 0}}if(n._zod.traits.add(e),t(n,a),o){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let a=i??e;if(!o.has(a)){o.add(a);for(let e in r){let t=Object.getOwnPropertyDescriptor(r,e);t.get?Object.defineProperty(a,e,{...t,enumerable:!1}):function(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:eE(this,t,r.bind(this))},set(e){eE(this,t,e)}})}(a,e,t.value)}}}let s=l.prototype;for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(e in n||(n[e]=s[e].bind(n)))}let s=n?.Parent??Object;let Definition=class Definition extends s{};function l(e){let t=n?.Parent?function(e){let t=eT;if(t){let r=t.stackTraceLimit;if("number"==typeof r){try{t.stackTraceLimit=0}catch{return eT=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}(Definition):this;a(t,e);let r=t._zod.deferred;if(r){for(let e of r)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(Definition,"name",{value:e}),Object.defineProperty(l,"init",{value:a}),Object.defineProperty(l,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}let $ZodAsyncError=class $ZodAsyncError extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};let $ZodEncodeError=class $ZodEncodeError extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(I=globalThis).__zod_globalConfig??(I.__zod_globalConfig={});let ek=globalThis.__zod_globalConfig;function eP(e){return e&&Object.assign(ek,e),ek}let $ZodCyclicError=class $ZodCyclicError extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}};let eU="~memo",eI=[];function eL(e){return null!==e&&"object"==typeof e}function ez(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let eN=new WeakMap,ej=[],eD={alloc(e,r,n){let i=t;if(!i)return n;t=void 0;let o={value:n,issues:null};return i.set(r.value,o),ej.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,r=(e,r)=>{var n,i;let o;if("backward"!==r.direction&&(n=r,i=e.value,void 0!==(o=n[eU]?.backEdges)&&eL(i)&&o.has(i)))throw new $ZodCyclicError;return t(e,r)};e._zod.parse=r,e._zod.run===t&&(e._zod.run=r)})},attach(e){var r;let n,i,o,a=!1;(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,s=(l,u)=>{let c;if(void 0===n){let t=function e(t,r,n){var i,o;let a=eN.get(t);if(void 0!==a)return 2*!!a;if(r.has(t))return 2;r.add(t);let s=0,l=t=>{if(2!==s&&t?._zod){let i=e(t,r,n);i>s&&(s=i)}},u=e=>{e>s&&(s=e)},c=t._zod.def;switch(c.type){case"object":{let t=K(c);u(t?((t,i)=>{let o=0;for(let a of Reflect.ownKeys(t)){let s=Object.getOwnPropertyDescriptor(t,a);if(i&&!s.enumerable)continue;let l=s.get?1:s.value?._zod?e(s.value,r,n):0;l>o&&(o=l)}return o})(t,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let e of c.items)l(e);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let e of c.options)l(e);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let i=c._cachedInner??(n?t._zod.innerType:void 0);u(i?e(i,r,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let r=t.value;if(r&&"object"==typeof r){if(r._zod)l(r);else if(Array.isArray(r))for(let e of r)l(e)}}}return r.delete(t),i=t,1!==(o=s)&&eN.set(i,2===o),o}(e,new Set,!1);if(0===t)return e._zod.parse=r,e._zod.run===s&&(e._zod.run=r),r(l,u);2===t||a?n=!0:a=!0}let p=l.value;if(!eL(p))return r(l,u);let d=u[eU];if(d||(d={buckets:new WeakMap,backEdges:void 0},u[eU]=d),i===u)c=o;else{var f;let t;(t=(f=d).buckets.get(e))||(t=new WeakMap,f.buckets.set(e,t)),c=t,i=u,o=c}let h=c.get(p);if(h)return l.value=h.value,h.issues?h.issues.length&&l.issues.push(...ez(h.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value)),l;t=c;let m=ej.length,g=r(l,u);t=void 0;let y=ej.length>m?ej.pop():void 0;return g instanceof Promise?g.then(e=>(y&&(y.issues=e.issues.length?ez(e.issues):eI),e)):(y&&(y.issues=g.issues.length?ez(g.issues):eI),g)};e._zod.parse=s,e._zod.run===r&&(e._zod.run=s)})}},e$=/^[cC][0-9a-z]{6,}$/,eM=/^[0-9a-z]+$/,eB=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,eF=/^[0-9a-vA-V]{20}$/,eq=/^[A-Za-z0-9]{27}$/,eW=/^[a-zA-Z0-9_-]{21}$/,eZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,eK=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,eH=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,eV=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,eJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,eY=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,eQ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eX=/^https?$/,e0=/^\+[1-9]\d{6,14}$/,e1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",e2=RegExp(`^${e1}$`);function e4(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}let e3=/^[\s\S]{0,}$/,e9=/^-?\d+$/,e6=/^-?\d+(?:\.\d+)?$/,e5=/^(?:true|false)$/i,e8=/^null$/i,e7=/^[^A-Z]*$/,te=/^[^a-z]*$/,tt=ex("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tr=e=>{let t=e.value;return null!=t&&void 0!==t.length},tn={number:"number",bigint:"bigint",object:"date"},ti=ex("$ZodCheckLessThan",(e,t)=>{tt.init(e,t);let r=tn[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:tn[typeof n.value]??r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),to=ex("$ZodCheckGreaterThan",(e,t)=>{tt.init(e,t);let r=tn[typeof t.value];e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:tn[typeof n.value]??r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ta=ex("$ZodCheckMultipleOf",(e,t)=>{tt.init(e,t),e._zod.check=r=>{let n,i,o;if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):0==(i=Math.round(n=r.value/t.value),o=4*Number.EPSILON*Math.max(Math.abs(n),1),Math.abs(n-i)<o?0:n-i))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ts=ex("$ZodCheckNumberFormat",(e,t)=>{tt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,o]=el[t.format];e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s))return void a.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}))}s<i&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),tl=ex("$ZodCheckMaxLength",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=tr),e._zod.check=r=>{let n=r.value,i=n.length;if(("string"==typeof n&&i>t.maximum?ev(n):i)<=t.maximum)return;let o=ew(n);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tu=ex("$ZodCheckMinLength",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=tr),e._zod.check=r=>{let n=r.value,i=n.length;if(("string"==typeof n&&i>=t.minimum&&i<2*t.minimum?ev(n):i)>=t.minimum)return;let o=ew(n);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tc=ex("$ZodCheckLengthEquals",(e,t)=>{var r;tt.init(e,t),(r=e._zod.def).when??(r.when=tr),e._zod.check=r=>{let n=r.value,i=n.length,o="string"==typeof n&&i>=t.length&&i<=2*t.length?ev(n):i;if(o===t.length)return;let a=ew(n),s=o>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),tp=ex("$ZodCheckStringFormat",(e,t)=>{var r,n;tt.init(e,t),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),td=ex("$ZodCheckRegex",(e,t)=>{tp.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),tf=ex("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=e7),tp.init(e,t)}),th=ex("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=te),tp.init(e,t)}),tm=ex("$ZodCheckIncludes",(e,t)=>{tt.init(e,t);let r=ei(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),tg=ex("$ZodCheckStartsWith",(e,t)=>{tt.init(e,t);let r=RegExp(`^${ei(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),ty=ex("$ZodCheckEndsWith",(e,t)=>{tt.init(e,t);let r=RegExp(`.*${ei(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function tb(e,t,r){e.issues.length&&t.issues.push(...eh(r,e.issues))}let tv=ex("$ZodCheckProperties",(e,t)=>{let r;tt.init(e,t),eE(e,Symbol.iterator,function*(){yield e},!1),e._zod.check=n=>{let i;if(null==n.value)return void n.issues.push({expected:"object",code:"invalid_type",input:n.value,inst:e});r??(r=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let o=n.value;for(let[e,t]of r){let r=t._zod.run({value:o[e],issues:[]},{});r instanceof Promise?(i??(i=[]),i.push(r.then(t=>tb(t,n,e)))):tb(r,n,e)}if(i)return Promise.all(i).then(()=>void 0)}}),tw=ex("$ZodCheckOverwrite",(e,t)=>{tt.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});let Doc=class Doc{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
3
3
|
${t.join("\n")}
|
|
4
|
-
};`)(...Object.values(this.closed))}};let t_={major:4,minor:6,patch:5},tE=ex("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=t_;let n=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let t of i)for(let r of t._zod.onattach)r(e);if(0===i.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,n)=>{let i;if(t.memo)return t;let o=ef(t);for(let a of r){if(a._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}(t)||!a._zod.def.when(t))continue}else if(o)continue;let r=t.issues.length,s=a._zod.check(t);if(s instanceof Promise&&n?.async===!1)throw new $ZodAsyncError;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,t.issues.length!==r&&(eg(t.issues,r,e),o||(o=ef(t,r)))});else{if(t.issues.length===r)continue;eg(t.issues,r,e),o||(o=ef(t,r))}}return i?i.then(()=>t):t},r=(r,n,o)=>{if(ef(r))return r.aborted=!0,r;let a=t(n,i,o);if(a instanceof Promise){if(!1===o.async)throw new $ZodAsyncError;return a.then(t=>e._zod.parse(t,o))}return e._zod.parse(a,o)};e._zod.run=(n,o)=>{if(o.skipChecks)return e._zod.parse(n,o);if("backward"===o.direction){let t=e._zod.parse({value:n.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,n,o)):r(t,n,o)}let a=e._zod.parse(n,o);if(a instanceof Promise){if(!1===o.async)throw new $ZodAsyncError;return a.then(e=>t(e,i,o))}return t(a,i,o)}}},{get"~standard"(){return eE(this,"~standard",tO(this),!1)},set"~standard"(e){eE(this,"~standard",e)}}),tS=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ey(e,t,eP()))}:{value:e.value};async function tR(e,t){let r={async:!0};return tS(await e._zod.run({value:t,issues:[]},r),r)}function tO(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return tS(n,r)}catch(e){}return tR(e,t)},vendor:"zod",version:1}}let tC=ex("$ZodString",(e,t)=>{tE.init(e,t),e._zod.pattern=t.pattern??e3,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),tA=ex("$ZodStringFormat",(e,t)=>{tp.init(e,t),tC.init(e,t)}),tT=ex("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=eK),tA.init(e,t)}),tx=ex("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=eH(e))}else t.pattern??(t.pattern=eH());tA.init(e,t)}),tk=ex("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=eV),tA.init(e,t)});function tP(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let tI=/[\t\n\r]/g;function tU(e){return e.replace(tI,"")}let tL=ex("$ZodURL",(e,t)=>{tA.init(e,t),e._zod.check=r=>{try{var n,i;let o=r.value.trim(),a="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===eX.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(o,t):tP(o)||2;if(1===a)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===a)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===a){r.value=tU(o);return}t.hostname&&((n=t.hostname).lastIndex=0,!n.test(a.hostname))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&((i=t.protocol).lastIndex=0,!i.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?a.href:tU(o);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),tz=ex("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),tA.init(e,t)}),tN=ex("$ZodNanoID",(e,t)=>{var r;if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?eW:(r=t.length,RegExp(`^[a-zA-Z0-9_-]{${r}}$`))),tA.init(e,t)}),tj=ex("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=e$),tA.init(e,t)}),tD=ex("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eM),tA.init(e,t)}),t$=ex("$ZodULID",(e,t)=>{t.pattern??(t.pattern=eB),tA.init(e,t)}),tM=ex("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eF),tA.init(e,t)}),tB=ex("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eq),tA.init(e,t)}),tF=ex("$ZodISODateTime",(e,t)=>{let r,n,i;t.pattern??(r=["Z"],t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),n=`${e4({precision:t.precision,seconds:!0})}(?:${r.join("|")})`,i=t.local?`${n}|${e4({precision:t.precision})}`:n,t.pattern=RegExp(`^${e1}T(?:${i})$`)),tA.init(e,t)}),tq=ex("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=e2),tA.init(e,t)}),tW=ex("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${e4(t)}$`)),tA.init(e,t)}),tZ=ex("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eZ),tA.init(e,t)}),tK=ex("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=eJ),tA.init(e,t)}),tH=/^[0-9a-fA-F:.]+$/;function tV(e){return!!tH.test(e)&&tP(`http://[${e}]`)}let tJ=ex("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=eG),tA.init(e,t),e._zod.check=r=>{tV(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),tG=ex("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=eY),tA.init(e,t)}),tY=ex("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eQ),tA.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,n]=t;if(!n)return!1;let i=Number(n);return`${i}`===n&&!(i<0)&&!(i>128)&&tV(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function tQ(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let tX=/^[0-9a-zA-Z+/]*={0,2}$/,t0=ex("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tX),tA.init(e,t),e._zod.check=r=>{tQ(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),t1=/^[A-Za-z0-9_-]*$/,t2=ex("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=t1),tA.init(e,t),e._zod.check=r=>{!function(e){if(!t1.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tQ(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),t4=ex("$ZodE164",(e,t)=>{t.pattern??(t.pattern=e0),tA.init(e,t)}),t3=ex("$ZodJWT",(e,t)=>{tA.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),t9=ex("$ZodNumber",(e,t)=>{tE.init(e,t),e._zod.pattern=e6,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),r}}),t6=ex("$ZodNumberFormat",(e,t)=>{ts.init(e,t),t9.init(e,t)}),t5=ex("$ZodBoolean",(e,t)=>{tE.init(e,t),e._zod.pattern=e5,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),t8=ex("$ZodNull",(e,t)=>{tE.init(e,t),e._zod.pattern=e8,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),t7=ex("$ZodUnknown",(e,t)=>{tE.init(e,t),e._zod.parse=e=>e}),re=ex("$ZodNever",(e,t)=>{tE.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),rt=ex("$ZodDate",(e,t)=>{tE.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),r}});function rr(e,t,r){e.issues.length&&t.issues.push(...eh(r,e.issues)),t.value[r]=e.value}let rn=ex("$ZodArray",(e,t)=>{tE.init(e,t);let r=ek.memoizer;r?.attach(e),e._zod.parse=(n,i)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=r?r.alloc(e,n,Array(o.length),i):Array(o.length);let a=[],s=i?.abortEarly;for(let e=0;e<o.length;e++){let r=o[e],l=t.element._zod.run({value:r,issues:[]},i);if(l instanceof Promise)a.push(l.then(t=>rr(t,n,e)));else if(rr(l,n,e),s&&0!==l.issues.length&&ef(l))break}return a.length?Promise.all(a).then(()=>n):n}});function ri(e,t,r,n,i,o){let a=r in n,s="optional"===o;if(a||!s||"optional"!==i){if(e.issues.length){if(void 0!==i&&s&&!a)return;t.issues.push(...eh(r,e.issues))}if(!a&&void 0===i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(a||"defaulted"===i&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}let ro=[];function ra(e){var t;let r=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),i=n.length?n:ro,o=i.length?[...r,...i]:r;for(let t of o)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Object.keys(t=e.shape).filter(e=>void 0!==t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,allKeys:o,symbolKeys:i,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function rs(e,t,r,n,i,o,a){let s=[],l=i.keySet,u=i.catchall._zod,c=u.def.type,p=u.optin,d=u.optout,f=0;for(let i in t){if(a&&r.issues.length!==f){if(ef(r,f))break;f=r.issues.length}if(l.has(i))continue;if("__proto__"===i){"never"===c&&s.push(i);continue}if("never"===c){s.push(i);continue}let o=u.run({value:t[i],issues:[]},n);o instanceof Promise?e.push(o.then(e=>ri(e,r,i,t,p,d))):ri(o,r,i,t,p,d)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let rl=ex("$ZodObject",(e,t)=>{let r;tE.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),i=n?.get?n.get.raw:t.shape??{};if(i){let e=()=>{let r={...i};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=i,Object.defineProperty(t,"shape",{get:e})}let o=q(()=>ra(t));eC(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let n=t[e]._zod;if(n.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||Z(r,e,new Set),n.values))r[e].add(t);void 0!==n.optin&&r[e].add(void 0)}}return r});let a=t.catchall,s=ek.memoizer;s?.attach(e),e._zod.parse=(t,n)=>{r??(r=o.value);let i=t.value;if(!X(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value=s?s.alloc(e,t,{},n):{};let l=[],u=r.shape,c=n?.abortEarly,p=t.issues.length;for(let e of r.allKeys){if(c&&t.issues.length!==p){if(ef(t,p))break;p=t.issues.length}if("__proto__"===e)continue;let r=u[e],o=r._zod.optin,a=r._zod.optout,s=r._zod.run({value:i[e],issues:[]},n);s instanceof Promise?l.push(s.then(r=>ri(r,t,e,i,o,a))):ri(s,t,e,i,o,a)}return a?rs(l,i,t,n,o.value,e,!0===c):l.length?Promise.all(l).then(()=>t):t}}),ru=ex("$ZodObjectJIT",(e,t)=>{let r,n;rl.init(e,t);let i=e._zod.parse,o=q(()=>ra(t)),a=ek.memoizer,s=!ek.jitless,l=s&&ee.value,u=t.catchall;e._zod.parse=(c,p)=>{n??(n=o.value);let d=c.value;return X(d)?s&&l&&p?.async===!1&&!0!==p.jitless?(r||(r=(t=>{let r=o.value,n=r.symbolKeys,i=new Doc(["payload","ctx"],{shape:t,inst:e,memo:a,syms:n}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
4
|
+
};`)(...Object.values(this.closed))}};let t_={major:4,minor:6,patch:5},tE=ex("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=t_;let n=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let t of i)for(let r of t._zod.onattach)r(e);if(0===i.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,r,n)=>{let i;if(t.memo)return t;let o=ef(t);for(let a of r){if(a._zod.def.when){if(function(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}(t)||!a._zod.def.when(t))continue}else if(o)continue;let r=t.issues.length,s=a._zod.check(t);if(s instanceof Promise&&n?.async===!1)throw new $ZodAsyncError;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s,t.issues.length!==r&&(eg(t.issues,r,e),o||(o=ef(t,r)))});else{if(t.issues.length===r)continue;eg(t.issues,r,e),o||(o=ef(t,r))}}return i?i.then(()=>t):t},r=(r,n,o)=>{if(ef(r))return r.aborted=!0,r;let a=t(n,i,o);if(a instanceof Promise){if(!1===o.async)throw new $ZodAsyncError;return a.then(t=>e._zod.parse(t,o))}return e._zod.parse(a,o)};e._zod.run=(n,o)=>{if(o.skipChecks)return e._zod.parse(n,o);if("backward"===o.direction){let t=e._zod.parse({value:n.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,n,o)):r(t,n,o)}let a=e._zod.parse(n,o);if(a instanceof Promise){if(!1===o.async)throw new $ZodAsyncError;return a.then(e=>t(e,i,o))}return t(a,i,o)}}},{get"~standard"(){return eE(this,"~standard",tO(this),!1)},set"~standard"(e){eE(this,"~standard",e)}}),tS=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ey(e,t,eP()))}:{value:e.value};async function tR(e,t){let r={async:!0};return tS(await e._zod.run({value:t,issues:[]},r),r)}function tO(e){return{validate:t=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return tS(n,r)}catch(e){}return tR(e,t)},vendor:"zod",version:1}}let tC=ex("$ZodString",(e,t)=>{tE.init(e,t),e._zod.pattern=t.pattern??e3,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),tA=ex("$ZodStringFormat",(e,t)=>{tp.init(e,t),tC.init(e,t)}),tT=ex("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=eK),tA.init(e,t)}),tx=ex("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=eH(e))}else t.pattern??(t.pattern=eH());tA.init(e,t)}),tk=ex("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=eV),tA.init(e,t)});function tP(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let tU=/[\t\n\r]/g;function tI(e){return e.replace(tU,"")}let tL=ex("$ZodURL",(e,t)=>{tA.init(e,t),e._zod.check=r=>{try{var n,i;let o=r.value.trim(),a="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===eX.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(o,t):tP(o)||2;if(1===a)return void r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});if(2===a)return void r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});if(!0===a){r.value=tI(o);return}t.hostname&&((n=t.hostname).lastIndex=0,!n.test(a.hostname))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&((i=t.protocol).lastIndex=0,!i.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol))&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?a.href:tI(o);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),tz=ex("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")),tA.init(e,t)}),tN=ex("$ZodNanoID",(e,t)=>{var r;if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?eW:(r=t.length,RegExp(`^[a-zA-Z0-9_-]{${r}}$`))),tA.init(e,t)}),tj=ex("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=e$),tA.init(e,t)}),tD=ex("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=eM),tA.init(e,t)}),t$=ex("$ZodULID",(e,t)=>{t.pattern??(t.pattern=eB),tA.init(e,t)}),tM=ex("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eF),tA.init(e,t)}),tB=ex("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=eq),tA.init(e,t)}),tF=ex("$ZodISODateTime",(e,t)=>{let r,n,i;t.pattern??(r=["Z"],t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"),n=`${e4({precision:t.precision,seconds:!0})}(?:${r.join("|")})`,i=t.local?`${n}|${e4({precision:t.precision})}`:n,t.pattern=RegExp(`^${e1}T(?:${i})$`)),tA.init(e,t)}),tq=ex("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=e2),tA.init(e,t)}),tW=ex("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${e4(t)}$`)),tA.init(e,t)}),tZ=ex("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eZ),tA.init(e,t)}),tK=ex("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=eJ),tA.init(e,t)}),tH=/^[0-9a-fA-F:.]+$/;function tV(e){return!!tH.test(e)&&tP(`http://[${e}]`)}let tJ=ex("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=eG),tA.init(e,t),e._zod.check=r=>{tV(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),tG=ex("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=eY),tA.init(e,t)}),tY=ex("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eQ),tA.init(e,t),e._zod.check=r=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[r,n]=t;if(!n)return!1;let i=Number(n);return`${i}`===n&&!(i<0)&&!(i>128)&&tV(r)}(r.value)&&r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function tQ(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let tX=/^[0-9a-zA-Z+/]*={0,2}$/,t0=ex("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tX),tA.init(e,t),e._zod.check=r=>{tQ(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),t1=/^[A-Za-z0-9_-]*$/,t2=ex("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=t1),tA.init(e,t),e._zod.check=r=>{!function(e){if(!t1.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return tQ(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),t4=ex("$ZodE164",(e,t)=>{t.pattern??(t.pattern=e0),tA.init(e,t)}),t3=ex("$ZodJWT",(e,t)=>{tA.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),t9=ex("$ZodNumber",(e,t)=>{tE.init(e,t),e._zod.pattern=e6,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),r}}),t6=ex("$ZodNumberFormat",(e,t)=>{ts.init(e,t),t9.init(e,t)}),t5=ex("$ZodBoolean",(e,t)=>{tE.init(e,t),e._zod.pattern=e5,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),t8=ex("$ZodNull",(e,t)=>{tE.init(e,t),e._zod.pattern=e8,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),t7=ex("$ZodUnknown",(e,t)=>{tE.init(e,t),e._zod.parse=e=>e}),re=ex("$ZodNever",(e,t)=>{tE.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),rt=ex("$ZodDate",(e,t)=>{tE.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),r}});function rr(e,t,r){e.issues.length&&t.issues.push(...eh(r,e.issues)),t.value[r]=e.value}let rn=ex("$ZodArray",(e,t)=>{tE.init(e,t);let r=ek.memoizer;r?.attach(e),e._zod.parse=(n,i)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=r?r.alloc(e,n,Array(o.length),i):Array(o.length);let a=[],s=i?.abortEarly;for(let e=0;e<o.length;e++){let r=o[e],l=t.element._zod.run({value:r,issues:[]},i);if(l instanceof Promise)a.push(l.then(t=>rr(t,n,e)));else if(rr(l,n,e),s&&0!==l.issues.length&&ef(l))break}return a.length?Promise.all(a).then(()=>n):n}});function ri(e,t,r,n,i,o){let a=r in n,s="optional"===o;if(a||!s||"optional"!==i){if(e.issues.length){if(void 0!==i&&s&&!a)return;t.issues.push(...eh(r,e.issues))}if(!a&&void 0===i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}void 0===e.value?(a||"defaulted"===i&&!s)&&(t.value[r]=void 0):t.value[r]=e.value}}let ro=[];function ra(e){var t;let r=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),i=n.length?n:ro,o=i.length?[...r,...i]:r;for(let t of o)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Object.keys(t=e.shape).filter(e=>void 0!==t[e]._zod.optin&&"optional"===t[e]._zod.optout);return{...e,allKeys:o,symbolKeys:i,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function rs(e,t,r,n,i,o,a){let s=[],l=i.keySet,u=i.catchall._zod,c=u.def.type,p=u.optin,d=u.optout,f=0;for(let i in t){if(a&&r.issues.length!==f){if(ef(r,f))break;f=r.issues.length}if(l.has(i))continue;if("__proto__"===i){"never"===c&&s.push(i);continue}if("never"===c){s.push(i);continue}let o=u.run({value:t[i],issues:[]},n);o instanceof Promise?e.push(o.then(e=>ri(e,r,i,t,p,d))):ri(o,r,i,t,p,d)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o,continue:!0}),e.length)?Promise.all(e).then(()=>r):r}let rl=ex("$ZodObject",(e,t)=>{let r;tE.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),i=n?.get?n.get.raw:t.shape??{};if(i){let e=()=>{let r={...i};return Object.defineProperty(t,"shape",{value:r}),e.raw=r,r};e.raw=i,Object.defineProperty(t,"shape",{get:e})}let o=q(()=>ra(t));eC(e,"propValues",e=>{let t=e.def.shape,r={};for(let e in t){let n=t[e]._zod;if(n.values){for(let t of(Object.prototype.hasOwnProperty.call(r,e)||Z(r,e,new Set),n.values))r[e].add(t);void 0!==n.optin&&r[e].add(void 0)}}return r});let a=t.catchall,s=ek.memoizer;s?.attach(e),e._zod.parse=(t,n)=>{r??(r=o.value);let i=t.value;if(!X(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value=s?s.alloc(e,t,{},n):{};let l=[],u=r.shape,c=n?.abortEarly,p=t.issues.length;for(let e of r.allKeys){if(c&&t.issues.length!==p){if(ef(t,p))break;p=t.issues.length}if("__proto__"===e)continue;let r=u[e],o=r._zod.optin,a=r._zod.optout,s=r._zod.run({value:i[e],issues:[]},n);s instanceof Promise?l.push(s.then(r=>ri(r,t,e,i,o,a))):ri(s,t,e,i,o,a)}return a?rs(l,i,t,n,o.value,e,!0===c):l.length?Promise.all(l).then(()=>t):t}}),ru=ex("$ZodObjectJIT",(e,t)=>{let r,n;rl.init(e,t);let i=e._zod.parse,o=q(()=>ra(t)),a=ek.memoizer,s=!ek.jitless,l=s&&ee.value,u=t.catchall;e._zod.parse=(c,p)=>{n??(n=o.value);let d=c.value;return X(d)?s&&l&&p?.async===!1&&!0!==p.jitless?(r||(r=(t=>{let r=o.value,n=r.symbolKeys,i=new Doc(["payload","ctx"],{shape:t,inst:e,memo:a,syms:n}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
5
5
|
let ${e}_ab = false;
|
|
6
6
|
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
7
7
|
const iss = ${e}.issues[i];
|
|
@@ -51,19 +51,19 @@ ${t.join("\n")}
|
|
|
51
51
|
newResult[${o}] = ${r}.value;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
`)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),c=r(c,p),u)?rs([],d,c,p,n,e,p?.abortEarly===!0):c:i(c,p):(c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c)}});function rc(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let i=e.filter(e=>!ef(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>ey(e,n,eP())))}),t)}let rp=ex("$ZodUnion",(e,t)=>{tE.init(e,t),eC(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),eC(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eC(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),eC(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>W(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let o=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>rc(t,n,e,i)):rc(a,n,e,i)}}),rd=ex("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,rp.init(e,t);let r=e._zod.parse;eC(e,"propValues",e=>{let t={},r=0;for(let n of e.def.options){let i=n._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[n,o]of(i[e.def.discriminator]?.has(void 0)&&r++,Object.entries(i)))for(let e of(Object.prototype.hasOwnProperty.call(t,n)||Z(t,n,new Set),o))t[n].add(e)}return!e.def.unionFallback&&r>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,r)=>{let n=K(e._zod.def);if(n&&!Object.prototype.hasOwnProperty.call(n,t.discriminator))throw Error(`Invalid discriminated union option at index "${r}"`)});let n=q(()=>(function(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||0===n.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let e of n)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,r)}return t})(t));e._zod.parse=(i,o)=>{let a=i.value;if(!X(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let s=a?.[t.discriminator],l=n.value.get(s);return l&&(void 0!==s||"backward"!==o.direction)?l._zod.run(i,o):t.unionFallback||"backward"===o.direction?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(e=>null!==n.value.get(e)),input:a,path:[t.discriminator],inst:e}),i)}}),rf=ex("$ZodIntersection",(e,t)=>{tE.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,i=t.left._zod.run({value:n,issues:[]},r),o=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,r])=>rh(e,t,r)):rh(e,i,o)}});function rh(e,t,r){let n,i=new Map,o=new Map,a=(e,t)=>{let r;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);o.has(t)||o.set(t,e),r=[t]}else n??(n=e),r=e.keys;for(let e of r)i.has(e)||i.set(e,{}),i.get(e)[t]=!0;return!0};for(let r of t.issues)a(r,"l")||e.issues.push(r);for(let t of r.issues)a(t,"r")||e.issues.push(t);let s=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=n?s.filter(e=>n.keys.includes(e)):[];for(let r of(t.length&&e.issues.push({...n,keys:t}),s))!t.includes(r)&&o.has(r)&&e.issues.push(o.get(r))}let l=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(et(t)&&et(r)){let n=Object.keys(r),i=Object.keys(t).filter(e=>-1!==n.indexOf(e)),o={...t,...r};for(let n of(Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__,i)){if("__proto__"===n)continue;let i=e(t[n],r[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let o=e(t[i],r[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!l.valid){if(ef(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let rm=ex("$ZodRecord",(e,t)=>{tE.init(e,t);let r=ek.memoizer;r?.attach(e),e._zod.parse=(n,i)=>{let o=n.value;if(!et(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;let a=[],s=t.keyType._zod.values;if(s&&!t.partial){let l;n.value=r?r.alloc(e,n,{},i):{};let u=new Set;for(let r of s)if("string"==typeof r||"number"==typeof r||"symbol"==typeof r){if(u.add("number"==typeof r?r.toString():r),"__proto__"===r)continue;let s=t.keyType._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>ey(e,i,eP())),input:r,path:[r],inst:e});continue}let l=s.value;if("__proto__"===l)continue;let c=t.valueType._zod.run({value:o[r],issues:[]},i);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...eh(r,e.issues)),n.value[l]=e.value})):(c.issues.length&&n.issues.push(...eh(r,c.issues)),n.value[l]=c.value)}for(let e in o)if(!u.has(e))if("loose"===t.mode){if("__proto__"===e)continue;n.value[e]=o[e]}else(l=l??[]).push(e);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{let l;for(let u of(n.value=r?r.alloc(e,n,{},i):{},Reflect.ownKeys(o))){if("__proto__"===u||!Object.prototype.propertyIsEnumerable.call(o,u))continue;let r=t.keyType._zod.run({value:u,issues:[]},i);if(r instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof u&&e6.test(u)&&r.issues.length){let e=t.keyType._zod.run({value:Number(u),issues:[]},i);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(r=e)}if(r.issues.length){"loose"===t.mode?n.value[u]=o[u]:s?(l=l??[]).push(u):n.issues.push({code:"invalid_key",origin:"record",issues:r.issues.map(e=>ey(e,i,eP())),input:u,path:[u],inst:e});continue}let c=r.value;if("__proto__"===c)continue;let p=t.valueType._zod.run({value:o[u],issues:[]},i);p instanceof Promise?a.push(p.then(e=>{e.issues.length&&n.issues.push(...eh(u,e.issues)),n.value[c]=e.value})):(p.issues.length&&n.issues.push(...eh(u,p.issues)),n.value[c]=p.value)}l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}return a.length?Promise.all(a).then(()=>n):n}}),rg=ex("$ZodEnum",(e,t)=>{tE.init(e,t);let r=M(t.entries),n=new Set(r);e._zod.values=n,eC(e,"pattern",e=>{let t=M(e.def.entries).filter(e=>en.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>ei(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,i)=>{let o=t.value;return n.has(o)||t.issues.push({code:"invalid_value",values:r,input:o,inst:e}),t}}),ry=ex("$ZodLiteral",(e,t)=>{tE.init(e,t);let r=new Set(t.values);e._zod.values=r,eC(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?ei(e):e?ei(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),rb=ex("$ZodTransform",(e,t)=>{tE.init(e,t),e._zod.optin="optional",ek.memoizer?.guard(e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new $ZodEncodeError(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(r.value=e,r));if(i instanceof Promise)throw new $ZodAsyncError;return r.value=i,r}});function rv(e,t){return e.value=t.issues.length?void 0:t.value,e}let rw=ex("$ZodOptional",(e,t)=>{tE.init(e,t),eC(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",eC(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),eC(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${W(t.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(t=>rv(e,t)):rv(e,n)}return t.innerType._zod.run(e,r)}}),r_=ex("$ZodExactOptional",(e,t)=>{rw.init(e,t),eC(e,"values",e=>e.def.innerType._zod.values),eC(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),rE=ex("$ZodNullable",(e,t)=>{tE.init(e,t),eC(e,"optin",e=>e.def.innerType._zod.optin),eC(e,"optout",e=>e.def.innerType._zod.optout),eC(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${W(t.source)}|null)$`):void 0}),eC(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),rS=ex("$ZodDefault",(e,t)=>{tE.init(e,t),e._zod.optin="defaulted",eC(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>rR(e,t)):rR(n,t)}});function rR(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let rO=ex("$ZodPrefault",(e,t)=>{tE.init(e,t),e._zod.optin="defaulted",eC(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),rC=ex("$ZodNonOptional",(e,t)=>{tE.init(e,t),eC(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(t=>rA(t,e)):rA(i,e)}});function rA(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function rT(e,t,r,n){return t.issues.length?e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ey(e,n,eP()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}let rx=ex("$ZodCatch",(e,t)=>{tE.init(e,t),eC(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),eC(e,"optout",e=>e.def.innerType._zod.optout),eC(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(n=>rT(e,n,t,r)):rT(e,n,t,r)}}),rk=ex("$ZodPipe",(e,t)=>{tE.init(e,t),eC(e,"values",e=>e.def.in._zod.values),eC(e,"optin",e=>e.def.in._zod.optin),eC(e,"optout",e=>e.def.out._zod.optout),eC(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>rP(e,t.in,r)):rP(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>rP(e,t.out,r)):rP(n,t.out,r)}});function rP(e,t,r){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}let rI=ex("$ZodReadonly",(e,t)=>{tE.init(e,t),eC(e,"propValues",e=>e.def.innerType._zod.propValues),eC(e,"values",e=>e.def.innerType._zod.values),eC(e,"optin",e=>e.def.innerType?._zod?.optin),eC(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(rU):rU(n)}});function rU(e){return e.memo||(e.value=Object.freeze(e.value)),e}let rL=ex("$ZodCustom",(e,t)=>{tt.init(e,t),tE.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(t=>rz(t,r,n,e));rz(i,r,n,e)}});function rz(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(e_(e))}}let $ZodRegistry=class $ZodRegistry{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(L=globalThis).__zod_globalRegistry??(L.__zod_globalRegistry=new $ZodRegistry);let rN=globalThis.__zod_globalRegistry;function rj(e){return e.checks&&(e.checks=[...e.checks]),e}function rD(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ea(t)})}function r$(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ea(t)})}function rM(e,t){return new ti({check:"less_than",...ea(t),value:e,inclusive:!1})}function rB(e,t){return new ti({check:"less_than",...ea(t),value:e,inclusive:!0})}function rF(e,t){return new to({check:"greater_than",...ea(t),value:e,inclusive:!1})}function rq(e,t){return new to({check:"greater_than",...ea(t),value:e,inclusive:!0})}function rW(e,t){return new ta({check:"multiple_of",...ea(t),value:e})}function rZ(e,t){return new tl({check:"max_length",...ea(t),maximum:e})}function rK(e,t){return new tu({check:"min_length",...ea(t),minimum:e})}function rH(e,t){return new tc({check:"length_equals",...ea(t),length:e})}function rV(e){return new tw({check:"overwrite",tx:e})}function rJ(e,...t){for(let r of t)for(let t of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,t)&&Z(e,t,r[t]);return e}function rG(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??rN,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function rY(e,t,r,n,i){let o="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:n.path,message:i}):t.unrepresentable;if("any"===o)return!1;if(void 0===o||"throw"===o)throw Error(i);return Object.assign(r,o),!0}function rQ(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,n);else{let r=a.schema,o=t.processors[i.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,r,n)}let o=e._zod.parent;o&&(a.ref||(a.ref=o),rQ(o,t,n),t.seen.get(o).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&rJ(a.schema,l),"input"===t.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,n);if("set"===i.type)return e(i.valueType,n);if("lazy"===i.type)return e(i.getter(),n);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return e(i.innerType,n);if("intersection"===i.type)return e(i.left,n)||e(i.right,n);if("record"===i.type||"map"===i.type)return e(i.keyType,n)||e(i.valueType,n);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,n)||e(i.out,n);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],n))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,n))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,n))return!0;if(i.rest&&e(i.rest,n))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function rX(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function r0(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=n.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let n=t[1],{ref:i,defId:o}=(t=>{let n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(r)return{ref:i(r)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${n}/${rX(o)}`}}let i=`#/${n}/`;if(t[1]===r&&!t[1].schema.id)return{ref:"#"};let o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:i+rX(o)}})(t);n.def={...n.schema},o&&(n.defId=o);let a=n.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
54
|
+
`)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),c=r(c,p),u)?rs([],d,c,p,n,e,p?.abortEarly===!0):c:i(c,p):(c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c)}});function rc(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let i=e.filter(e=>!ef(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>ey(e,n,eP())))}),t)}let rp=ex("$ZodUnion",(e,t)=>{tE.init(e,t),eC(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),eC(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eC(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),eC(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>W(e.source)).join("|")})$`)}});let r=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(n,i)=>{if(r)return r(n,i);let o=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},i);if(t instanceof Promise)a.push(t),o=!0;else{if(0===t.issues.length)return t;a.push(t)}}return o?Promise.all(a).then(t=>rc(t,n,e,i)):rc(a,n,e,i)}}),rd=ex("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,rp.init(e,t);let r=e._zod.parse;eC(e,"propValues",e=>{let t={},r=0;for(let n of e.def.options){let i=n._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[n,o]of(i[e.def.discriminator]?.has(void 0)&&r++,Object.entries(i)))for(let e of(Object.prototype.hasOwnProperty.call(t,n)||Z(t,n,new Set),o))t[n].add(e)}return!e.def.unionFallback&&r>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,r)=>{let n=K(e._zod.def);if(n&&!Object.prototype.hasOwnProperty.call(n,t.discriminator))throw Error(`Invalid discriminated union option at index "${r}"`)});let n=q(()=>(function(e){let t=new Map;for(let r of e.options){let n=r._zod.propValues?.[e.discriminator];if(!n||0===n.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let e of n)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,r)}return t})(t));e._zod.parse=(i,o)=>{let a=i.value;if(!X(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let s=a?.[t.discriminator],l=n.value.get(s);return l&&(void 0!==s||"backward"!==o.direction)?l._zod.run(i,o):t.unionFallback||"backward"===o.direction?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(n.value.keys()).filter(e=>null!==n.value.get(e)),input:a,path:[t.discriminator],inst:e}),i)}}),rf=ex("$ZodIntersection",(e,t)=>{tE.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,i=t.left._zod.run({value:n,issues:[]},r),o=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,r])=>rh(e,t,r)):rh(e,i,o)}});function rh(e,t,r){let n,i=new Map,o=new Map,a=(e,t)=>{let r;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);o.has(t)||o.set(t,e),r=[t]}else n??(n=e),r=e.keys;for(let e of r)i.has(e)||i.set(e,{}),i.get(e)[t]=!0;return!0};for(let r of t.issues)a(r,"l")||e.issues.push(r);for(let t of r.issues)a(t,"r")||e.issues.push(t);let s=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=n?s.filter(e=>n.keys.includes(e)):[];for(let r of(t.length&&e.issues.push({...n,keys:t}),s))!t.includes(r)&&o.has(r)&&e.issues.push(o.get(r))}let l=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(et(t)&&et(r)){let n=Object.keys(r),i=Object.keys(t).filter(e=>-1!==n.indexOf(e)),o={...t,...r};for(let n of(Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__,i)){if("__proto__"===n)continue;let i=e(t[n],r[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};o[n]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let o=e(t[i],r[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!l.valid){if(ef(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let rm=ex("$ZodRecord",(e,t)=>{tE.init(e,t);let r=ek.memoizer;r?.attach(e),e._zod.parse=(n,i)=>{let o=n.value;if(!et(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;let a=[],s=t.keyType._zod.values;if(s&&!t.partial){let l;n.value=r?r.alloc(e,n,{},i):{};let u=new Set;for(let r of s)if("string"==typeof r||"number"==typeof r||"symbol"==typeof r){if(u.add("number"==typeof r?r.toString():r),"__proto__"===r)continue;let s=t.keyType._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>ey(e,i,eP())),input:r,path:[r],inst:e});continue}let l=s.value;if("__proto__"===l)continue;let c=t.valueType._zod.run({value:o[r],issues:[]},i);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...eh(r,e.issues)),n.value[l]=e.value})):(c.issues.length&&n.issues.push(...eh(r,c.issues)),n.value[l]=c.value)}for(let e in o)if(!u.has(e))if("loose"===t.mode){if("__proto__"===e)continue;n.value[e]=o[e]}else(l=l??[]).push(e);l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}else{let l;for(let u of(n.value=r?r.alloc(e,n,{},i):{},Reflect.ownKeys(o))){if("__proto__"===u||!Object.prototype.propertyIsEnumerable.call(o,u))continue;let r=t.keyType._zod.run({value:u,issues:[]},i);if(r instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof u&&e6.test(u)&&r.issues.length){let e=t.keyType._zod.run({value:Number(u),issues:[]},i);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(r=e)}if(r.issues.length){"loose"===t.mode?n.value[u]=o[u]:s?(l=l??[]).push(u):n.issues.push({code:"invalid_key",origin:"record",issues:r.issues.map(e=>ey(e,i,eP())),input:u,path:[u],inst:e});continue}let c=r.value;if("__proto__"===c)continue;let p=t.valueType._zod.run({value:o[u],issues:[]},i);p instanceof Promise?a.push(p.then(e=>{e.issues.length&&n.issues.push(...eh(u,e.issues)),n.value[c]=e.value})):(p.issues.length&&n.issues.push(...eh(u,p.issues)),n.value[c]=p.value)}l&&l.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:l,continue:!0})}return a.length?Promise.all(a).then(()=>n):n}}),rg=ex("$ZodEnum",(e,t)=>{tE.init(e,t);let r=M(t.entries),n=new Set(r);e._zod.values=n,eC(e,"pattern",e=>{let t=M(e.def.entries).filter(e=>en.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>ei(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,i)=>{let o=t.value;return n.has(o)||t.issues.push({code:"invalid_value",values:r,input:o,inst:e}),t}}),ry=ex("$ZodLiteral",(e,t)=>{tE.init(e,t);let r=new Set(t.values);e._zod.values=r,eC(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?ei(e):e?ei(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),rb=ex("$ZodTransform",(e,t)=>{tE.init(e,t),e._zod.optin="optional",ek.memoizer?.guard(e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new $ZodEncodeError(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(r.value=e,r));if(i instanceof Promise)throw new $ZodAsyncError;return r.value=i,r}});function rv(e,t){return e.value=t.issues.length?void 0:t.value,e}let rw=ex("$ZodOptional",(e,t)=>{tE.init(e,t),eC(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",eC(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),eC(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${W(t.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(t=>rv(e,t)):rv(e,n)}return t.innerType._zod.run(e,r)}}),r_=ex("$ZodExactOptional",(e,t)=>{rw.init(e,t),eC(e,"values",e=>e.def.innerType._zod.values),eC(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),rE=ex("$ZodNullable",(e,t)=>{tE.init(e,t),eC(e,"optin",e=>e.def.innerType._zod.optin),eC(e,"optout",e=>e.def.innerType._zod.optout),eC(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${W(t.source)}|null)$`):void 0}),eC(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),rS=ex("$ZodDefault",(e,t)=>{tE.init(e,t),e._zod.optin="defaulted",eC(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>rR(e,t)):rR(n,t)}});function rR(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let rO=ex("$ZodPrefault",(e,t)=>{tE.init(e,t),e._zod.optin="defaulted",eC(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),rC=ex("$ZodNonOptional",(e,t)=>{tE.init(e,t),eC(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(t=>rA(t,e)):rA(i,e)}});function rA(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function rT(e,t,r,n){return t.issues.length?e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ey(e,n,eP()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}let rx=ex("$ZodCatch",(e,t)=>{tE.init(e,t),eC(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),eC(e,"optout",e=>e.def.innerType._zod.optout),eC(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run({value:e.value,issues:[]},r);return n instanceof Promise?n.then(n=>rT(e,n,t,r)):rT(e,n,t,r)}}),rk=ex("$ZodPipe",(e,t)=>{tE.init(e,t),eC(e,"values",e=>e.def.in._zod.values),eC(e,"optin",e=>e.def.in._zod.optin),eC(e,"optout",e=>e.def.out._zod.optout),eC(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>rP(e,t.in,r)):rP(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>rP(e,t.out,r)):rP(n,t.out,r)}});function rP(e,t,r){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}let rU=ex("$ZodReadonly",(e,t)=>{tE.init(e,t),eC(e,"propValues",e=>e.def.innerType._zod.propValues),eC(e,"values",e=>e.def.innerType._zod.values),eC(e,"optin",e=>e.def.innerType?._zod?.optin),eC(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(rI):rI(n)}});function rI(e){return e.memo||(e.value=Object.freeze(e.value)),e}let rL=ex("$ZodCustom",(e,t)=>{tt.init(e,t),tE.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(t=>rz(t,r,n,e));rz(i,r,n,e)}});function rz(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(e_(e))}}let $ZodRegistry=class $ZodRegistry{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(L=globalThis).__zod_globalRegistry??(L.__zod_globalRegistry=new $ZodRegistry);let rN=globalThis.__zod_globalRegistry;function rj(e){return e.checks&&(e.checks=[...e.checks]),e}function rD(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ea(t)})}function r$(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ea(t)})}function rM(e,t){return new ti({check:"less_than",...ea(t),value:e,inclusive:!1})}function rB(e,t){return new ti({check:"less_than",...ea(t),value:e,inclusive:!0})}function rF(e,t){return new to({check:"greater_than",...ea(t),value:e,inclusive:!1})}function rq(e,t){return new to({check:"greater_than",...ea(t),value:e,inclusive:!0})}function rW(e,t){return new ta({check:"multiple_of",...ea(t),value:e})}function rZ(e,t){return new tl({check:"max_length",...ea(t),maximum:e})}function rK(e,t){return new tu({check:"min_length",...ea(t),minimum:e})}function rH(e,t){return new tc({check:"length_equals",...ea(t),length:e})}function rV(e){return new tw({check:"overwrite",tx:e})}function rJ(e,...t){for(let r of t)for(let t of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,t)&&Z(e,t,r[t]);return e}function rG(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??rN,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function rY(e,t,r,n,i){let o="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:n.path,message:i}):t.unrepresentable;if("any"===o)return!1;if(void 0===o||"throw"===o)throw Error(i);return Object.assign(r,o),!0}function rQ(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)a.schema=s;else{let n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,n);else{let r=a.schema,o=t.processors[i.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,r,n)}let o=e._zod.parent;o&&(a.ref||(a.ref=o),rQ(o,t,n),t.seen.get(o).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&rJ(a.schema,l),"input"===t.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,n);if("set"===i.type)return e(i.valueType,n);if("lazy"===i.type)return e(i.getter(),n);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return e(i.innerType,n);if("intersection"===i.type)return e(i.left,n)||e(i.right,n);if("record"===i.type||"map"===i.type)return e(i.keyType,n)||e(i.valueType,n);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,n)||e(i.out,n);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],n))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,n))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,n))return!0;if(i.rest&&e(i.rest,n))return!0}return!1}(e)&&(delete a.schema.examples,delete a.schema.default),"input"===t.io&&"_prefault"in a.schema&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function rX(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function r0(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=n.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let n=t[1],{ref:i,defId:o}=(t=>{let n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(r)return{ref:i(r)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${n}/${rX(o)}`}}let i=`#/${n}/`;if(t[1]===r&&!t[1].schema.id)return{ref:"#"};let o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:i+rX(o)}})(t);n.def={...n.schema},o&&(n.defId=o);let a=n.schema;for(let e in a)delete a[e];a.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
55
55
|
|
|
56
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){i(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){i(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle){i(r);continue}n.count>1&&"ref"===e.reused&&i(r)}e.external&&(e.sharedDefsExtractedFor=e.external)}let r1=new Set(["type","properties","required","additionalProperties"]),r2=["oneOf","anyOf"];function r4(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function r3(e){let t=[];for(let r of e){if("object"!=typeof r||"object"!==r.type)return null;for(let e in r)if(!r1.has(e))return null;t.push(r)}let r={},n=new Set;for(let e of t){for(let n in e.properties){if(Object.prototype.hasOwnProperty.call(r,n))continue;let e=[];for(let r of t){let t=r.properties?.[n]??r4(r);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Z(r,n,1===e.length?e[0]:r3(e)??{allOf:e})}for(let t of e.required??[])n.add(t)}let i={type:"object",properties:r};if(n.size&&(i.required=[...n]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let r of t){let t=r4(r);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function r9(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let i=r.def??r.schema,o={...i},a=r.ref;if(r.ref=null,a){n(a);let r=e.seen.get(a),s=r.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(s)):rJ(i,s),rJ(i,o),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(s.$ref&&r.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(i[e])===JSON.stringify(r.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==a){n(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:r.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())n(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let r=t.anyOf;if(!Array.isArray(r)||0===r.length||void 0!==t.type)return;let n=[];for(let t of r){if(!t||"object"!=typeof t)return;e(t);let r=Object.keys(t);if(1!==r.length||"type"!==r[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;n.includes(e)||n.push(e)}}delete t.anyOf,t.type=1===n.length?n[0]:n}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let r of e.seen.values())for(let e of[r.schema,r.def]){let r=e?.allOf;if(!Array.isArray(r))continue;let n=t.get(r);n?n.push(e):t.set(r,[e])}for(let r of e.intersections)for(let e of t.get(r)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of r1)if(t in e)return;let r=t.filter(e=>r2.some(t=>Array.isArray(e[t]))),n=null;if(r.length){let e=r[0],i=r2.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let o=t.filter(t=>t!==e),a=e[i].map(e=>r3([...o,e]));if(a.some(e=>!e))return;n={[i]:a}}else n=r3(t);n&&(delete e.allOf,rJ(e,n))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(r)}rJ(i,r.defId?r.schema:r.def??r.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&i.id===o&&delete i.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Z(a,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let r=JSON.parse(JSON.stringify(i));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:r6(t,"input",e.processors),output:r6(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let r6=(e,t,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},a=rG({...i??{},target:o,io:t,processors:r});return rQ(e,a),r0(a,e),r9(a,e)},r5=(e,t,r)=>{(void 0===e[t]||r>e[t])&&(e[t]=r)},r8=(e,t,r)=>{(void 0===e[t]||r<e[t])&&(e[t]=r)},r7=(e,t)=>{r5(e,"minimum",t),r8(e,"maximum",t)},ne=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},nt=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},nr=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},nn=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},ni=(e,t)=>r5(e,"minimum",t.minimum),no=(e,t)=>r8(e,"maximum",t.maximum),na=e=>(t,r)=>{nn(t,r.format);let[n,i]=e[r.format];r5(t,"minimum",n),r8(t,"maximum",i)},ns={greater_than:(e,t)=>r5(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>r8(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>ne(e,t.value),number_format:na(el),bigint_format:na(eu),min_length:ni,max_length:no,length_equals:(e,t)=>r7(e,t.length),min_size:ni,max_size:no,size_equals:(e,t)=>r7(e,t.size),string_format:(e,t)=>{nn(e,t.format),t.pattern&&nt(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>nr(e,t.mime)};function nl(e){let t={},r=e._zod.def;for(let n of e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[])ns[n._zod.def.check]?.(t,n._zod.def);let n=e._zod.bag;for(let e of(void 0!==n.minimum&&r5(t,"minimum",n.minimum),void 0!==n.exclusiveMinimum&&r5(t,"exclusiveMinimum",n.exclusiveMinimum),void 0!==n.maximum&&r8(t,"maximum",n.maximum),void 0!==n.exclusiveMaximum&&r8(t,"exclusiveMaximum",n.exclusiveMaximum),void 0!==n.multipleOf&&ne(t,n.multipleOf),void 0!==n.format&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&nr(t,n.mime),n.patterns??[]))nt(t,e);return t}let nu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nc=new Map([[tX,/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/],[t1,/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/]]),np=e=>nc.get(e)??e;function nd(e){let t=e._zod.def;return"pipe"===t.type&&t.in._zod.traits.has("$ZodTransform")?nd(t.out):"catch"===t.type?nd(t.innerType):e._zod.optin}let nf=new WeakMap,nh=Symbol();function nm(e,t,r,n,i){let o=!1,a=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(o=!0,null));return o?(rY(t,r,n,i,"BigInt defaults cannot be represented in JSON Schema"),nh):JSON.parse(a)}let ng=(e,t,r,n)=>{let i=e._zod.def;rQ(i.innerType,t,n),t.seen.get(e).ref=i.innerType};function ny(){return{localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function n(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?r[e]??e:String(t)}return r=>{switch(r.code){case"invalid_type":{let e=n(r.expected),t=n(function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}(r.input),r.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${es(r.values[0])}`;return`Invalid option: expected one of ${B(r.values,"|")}`;case"too_big":{let t=r.exact?"exactly ":r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Too big: expected ${r.origin??"value"} to have ${t}${r.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${t}${r.maximum.toString()}`}case"too_small":{let t=r.exact?"exactly ":r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Too small: expected ${r.origin} to have ${t}${r.minimum.toString()} ${n.unit}`;return`Too small: expected ${r.origin} to be ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Invalid string: must start with "${r.prefix}"`;if("ends_with"===r.format)return`Invalid string: must end with "${r.suffix}"`;if("includes"===r.format)return`Invalid string: must include "${r.includes}"`;if("regex"===r.format)return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${B(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0){let e=r.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===r.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}})()}}let nb={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,F,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},nv={value:void 0,enumerable:!1},nw=new WeakSet([Object.prototype,Error.prototype]),n_=(e,t)=>{e.name="$ZodError",nv.value=t,Object.defineProperty(e,"issues",nv),nv.value=void 0,Object.defineProperty(e,"message",nb);let r=Object.getPrototypeOf(e);nw.has(r)||(nw.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},nE=ex("$ZodError",n_);function nS(e,t){return{callee:t?.callee??e,Err:t?.Err}}ex("$ZodError",n_,void 0,{Parent:Error});let nR=e=>{let t=(r,n,i,o)=>{let a=i?{...i,async:!1}:{async:!1},s=r._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new $ZodAsyncError;if(s.issues.length){let r=new(o?.Err??e)(s.issues.map(e=>ey(e,a,eP())));throw Q(r,o?.callee??t),r}return s.value};return t},nO=e=>{let t=async(r,n,i,o)=>{let a=i?{...i,async:!0}:{async:!0},s=r._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let r=new(o?.Err??e)(s.issues.map(e=>ey(e,a,eP())));throw Q(r,o?.callee??t),r}return s.value};return t},nC=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new $ZodAsyncError;return o.issues.length?nA(e,o.issues,i):{success:!0,data:o.value}};function nA(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(e=>ey(e,r,eP()))),t=void 0,r=void 0),n},set error(e){n=e,t=void 0,r=void 0}}}let nT=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?nA(e,o.issues,i):{success:!0,data:o.value}},nx=Symbol.for("zod.compile.invalid"),nk=Symbol.for("zod.compile.fallback"),nP=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},n);return i instanceof Promise&&(i=await i),0===i.issues.length},nI=new WeakSet([Object.prototype,Error.prototype]);function nU(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=r(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let nL=ex("ZodError",(e,t)=>{nE.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);nI.has(r)||(nI.add(r),nU(r,"format",e=>t=>(function(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>n({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)n({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)n({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length)r._errors.push(t(o));else{let n=r,i=0;for(;i<e.length;){let r=e[i],a=i===e.length-1;if("_errors"===r){a&&n._errors.push(t(o)),i++;continue}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=n[r];a&&s._errors.push(t(o)),n=s,i++}}}};return n(e),r})(e,t)),nU(r,"flatten",e=>t=>(function(e,t=e=>e.message){let r={},n=[];for(let a of e.issues)if(a.path.length>0){var i,o;(i=a.path[0],o=()=>[],!Object.prototype.hasOwnProperty.call(r,i)&&("__proto__"===i?Object.defineProperty(r,i,{value:o(),writable:!0,enumerable:!0,configurable:!0}):r[i]=o()),r[i]).push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}})(e,t)),nU(r,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,F,2)}),nU(r,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,F,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error}),nz=nR(nL),nN=nO(nL),nj=nC(nL),nD=nT(nL),n$=(o=nR(nL),a=(e,t,r,n)=>o(e,t,r?{...r,direction:"backward"}:{direction:"backward"},nS(a,n))),nM=(s=nR(nL),l=(e,t,r,n)=>s(e,t,r,nS(l,n))),nB=(u=nO(nL),c=async(e,t,r,n)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return await u(e,t,i,nS(c,n))}),nF=(p=nO(nL),d=async(e,t,r,n)=>await p(e,t,r,nS(d,n))),nq=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return nC(nL)(e,t,n)},nW=(e,t,r)=>nC(nL)(e,t,r),nZ=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return nT(nL)(e,t,n)},nK=async(e,t,r)=>nT(nL)(e,t,r);function nH(){ek.memoizer||eP({memoizer:eD})}let nV=ex("ZodType",(e,t)=>(ek.localeError||eP(ny()),tE.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Y(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return eo(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new i4({type:"custom",check:"custom",fn:e,...ea(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let n,i;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(e_(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(e_(e)))},e(t.value,t)),(i=new tt({check:"custom",...ea(t)}))._zod.check=r,n=i}(e,t))},overwrite(e){return this.check(rV(e))},optional(){return iK(this)},exactOptional(){var e;return e=this,new iH({type:"optional",innerType:e})},nullable(){return iJ(this)},nullish(){return iK(iJ(this))},nonoptional(e){var t;return t=this,new iQ({type:"nonoptional",innerType:t,...ea(e)})},array(){return ix(this)},or(e){return iL([this,e])},and(e){var t;return t=this,new ij({type:"intersection",left:t,right:e})},transform(e){return i1(this,new iW({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new iG({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():er(r)}})},prefault(e){var t,r;return t=this,r=e,new iY({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():er(r)}})},catch(e){return function(e,t){let r;return new iX({type:"catch",innerType:e,catchValue:"function"==typeof t?t:((r=()=>t)["~constantCatch"]=!0,r)})}(this,e)},pipe(e){return i1(this,e)},readonly(){var e;return e=this,new i2({type:"readonly",innerType:e})},describe(e){let t=this.clone();return rN.add(t,{description:e}),t},meta(...e){if(0===e.length)return rN.get(this);let t=this.clone();return rN.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return eE(this,"~standard",{...tO(this),jsonSchema:{input:r6(this,"input"),output:r6(this,"output")}},!1)},set"~standard"(e){eE(this,"~standard",e)},parse:function e(t,r){return nz(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await nN(this,t,r,{callee:e})},safeParse(e,t){return nj(this,e,t)},async safeParseAsync(e,t){return nD(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){eE(this,"spa",e)},validate(e,t){let r=this._zod.bag.validator;if(void 0!==r){if(r(e)!==nx)return!0;if(!0===r.definite&&void 0===t)return!1}return function(e,t,r){let n,i=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;if(o?(i[nk]=!0,n=o({value:t,issues:[]},i)):n=e._zod.run({value:t,issues:[]},i),n instanceof Promise)throw new $ZodAsyncError;return 0===n.issues.length}(this,e,t)},validateAsync(e,t){return nP(this,e,t)},encode:function e(t,r){return n$(this,t,r,{callee:e})},decode:function e(t,r){return nM(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await nB(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await nF(this,t,r,{callee:e})},safeEncode(e,t){return nq(this,e,t)},safeDecode(e,t){return nW(this,e,t)},async safeEncodeAsync(e,t){return nZ(this,e,t)},async safeDecodeAsync(e,t){return nK(this,e,t)},toJSONSchema(e){return((e,t={})=>r=>{let n=rG({...r,processors:t});return rQ(e,n),r0(n,e),r9(n,e)})(this,{})(e)},get description(){return rN.get(this)?.description},get _def(){return this._zod.def}}),nJ=ex("_ZodString",(e,t)=>{tC.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{r.type="string";let{minimum:n,maximum:i,format:o,patterns:a,contentEncoding:s,laxFormat:l}=nl(e);if("number"==typeof n&&(r.minLength=n),"number"==typeof i&&(r.maxLength=i),o&&(r.format=nu[o]??o,""===r.format&&delete r.format,("time"===o||l)&&delete r.format),s&&(r.contentEncoding=s),a&&a.size>0){let e=[...a].map(np);1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r)},eS({format:e=>nl(e).format??null,minLength:e=>nl(e).minimum??null,maxLength:e=>nl(e).maximum??null},{regex(...e){return this.check(function(e,t){return new td({check:"string_format",format:"regex",...ea(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new tm({check:"string_format",format:"includes",...ea(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new tg({check:"string_format",format:"starts_with",...ea(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new ty({check:"string_format",format:"ends_with",...ea(t),suffix:e})}(...e))},min(...e){return this.check(rK(...e))},max(...e){return this.check(rZ(...e))},length(...e){return this.check(rH(...e))},nonempty(...e){return this.check(rK(1,...e))},lowercase(e){return this.check(new tf({check:"string_format",format:"lowercase",...ea(e)}))},uppercase(e){return this.check(new th({check:"string_format",format:"uppercase",...ea(e)}))},trim(){return this.check(rV(e=>e.trim()))},normalize(...e){return this.check(function(e){return rV(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(rV(e=>e.toLowerCase()))},toUpperCase(){return this.check(rV(e=>e.toUpperCase()))},slugify(){return this.check(rV(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})),nG=ex("ZodString",(e,t)=>{tC.init(e,t),nJ.init(e,t)},{email(e){return this.check(new n4({type:"string",format:"email",check:"string_format",abort:!1,...ea(e)}))},url(e){return this.check(rD(n6,e))},jwt(e){return this.check(new ih({type:"string",format:"jwt",check:"string_format",abort:!1,...ea(e)}))},emoji(e){return this.check(new n8({type:"string",format:"emoji",check:"string_format",abort:!1,...ea(e)}))},guid(e){return this.check(new n3({type:"string",format:"guid",check:"string_format",abort:!1,...ea(e)}))},uuid(e){return this.check(new n9({type:"string",format:"uuid",check:"string_format",abort:!1,...ea(e)}))},uuidv4(e){return this.check(new n9({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ea(e)}))},uuidv6(e){return this.check(new n9({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ea(e)}))},uuidv7(e){return this.check(new n9({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ea(e)}))},nanoid(e){return this.check(new n7({type:"string",format:"nanoid",check:"string_format",abort:!1,...ea(e)}))},cuid(e){return this.check(new ie({type:"string",format:"cuid",check:"string_format",abort:!1,...ea(e)}))},cuid2(e){return this.check(new it({type:"string",format:"cuid2",check:"string_format",abort:!1,...ea(e)}))},ulid(e){return this.check(new ir({type:"string",format:"ulid",check:"string_format",abort:!1,...ea(e)}))},base64(e){return this.check(new ic({type:"string",format:"base64",check:"string_format",abort:!1,...ea(e)}))},base64url(e){return this.check(new ip({type:"string",format:"base64url",check:"string_format",abort:!1,...ea(e)}))},xid(e){return this.check(new ii({type:"string",format:"xid",check:"string_format",abort:!1,...ea(e)}))},ksuid(e){return this.check(new io({type:"string",format:"ksuid",check:"string_format",abort:!1,...ea(e)}))},ipv4(e){return this.check(new ia({type:"string",format:"ipv4",check:"string_format",abort:!1,...ea(e)}))},ipv6(e){return this.check(new is({type:"string",format:"ipv6",check:"string_format",abort:!1,...ea(e)}))},cidrv4(e){return this.check(new il({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ea(e)}))},cidrv6(e){return this.check(new iu({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ea(e)}))},e164(e){return this.check(new id({type:"string",format:"e164",check:"string_format",abort:!1,...ea(e)}))},datetime(e){return this.check(r$(nX,e))},date(e){return this.check(new n0({type:"string",format:"date",check:"string_format",...ea(e)}))},time(e){return this.check(new n1({type:"string",format:"time",check:"string_format",precision:null,...ea(e)}))},duration(e){return this.check(new n2({type:"string",format:"duration",check:"string_format",...ea(e)}))}});function nY(e){return new nG(rj({type:"string",...ea(e)}))}let nQ=ex("ZodStringFormat",(e,t)=>{tA.init(e,t),nJ.init(e,t)}),nX=ex("ZodISODateTime",(e,t)=>{tF.init(e,t),nQ.init(e,t)}),n0=ex("ZodISODate",(e,t)=>{tq.init(e,t),nQ.init(e,t)}),n1=ex("ZodISOTime",(e,t)=>{tW.init(e,t),nQ.init(e,t)}),n2=ex("ZodISODuration",(e,t)=>{tZ.init(e,t),nQ.init(e,t)}),n4=ex("ZodEmail",(e,t)=>{tk.init(e,t),nQ.init(e,t)}),n3=ex("ZodGUID",(e,t)=>{tT.init(e,t),nQ.init(e,t)}),n9=ex("ZodUUID",(e,t)=>{tx.init(e,t),nQ.init(e,t)}),n6=ex("ZodURL",(e,t)=>{tL.init(e,t),nQ.init(e,t)});function n5(e){return rD(n6,e)}let n8=ex("ZodEmoji",(e,t)=>{tz.init(e,t),nQ.init(e,t)}),n7=ex("ZodNanoID",(e,t)=>{tN.init(e,t),nQ.init(e,t)}),ie=ex("ZodCUID",(e,t)=>{tj.init(e,t),nQ.init(e,t)}),it=ex("ZodCUID2",(e,t)=>{tD.init(e,t),nQ.init(e,t)}),ir=ex("ZodULID",(e,t)=>{t$.init(e,t),nQ.init(e,t)}),ii=ex("ZodXID",(e,t)=>{tM.init(e,t),nQ.init(e,t)}),io=ex("ZodKSUID",(e,t)=>{tB.init(e,t),nQ.init(e,t)}),ia=ex("ZodIPv4",(e,t)=>{tK.init(e,t),nQ.init(e,t)}),is=ex("ZodIPv6",(e,t)=>{tJ.init(e,t),nQ.init(e,t)}),il=ex("ZodCIDRv4",(e,t)=>{tG.init(e,t),nQ.init(e,t)}),iu=ex("ZodCIDRv6",(e,t)=>{tY.init(e,t),nQ.init(e,t)}),ic=ex("ZodBase64",(e,t)=>{t0.init(e,t),nQ.init(e,t)}),ip=ex("ZodBase64URL",(e,t)=>{t2.init(e,t),nQ.init(e,t)}),id=ex("ZodE164",(e,t)=>{t4.init(e,t),nQ.init(e,t)}),ih=ex("ZodJWT",(e,t)=>{t3.init(e,t),nQ.init(e,t)}),im=ex("ZodNumber",(e,t)=>{t9.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let{minimum:i,maximum:o,multipleOf:a,exclusiveMaximum:s,exclusiveMinimum:l,isInt:u}=nl(e);r.type=u?"integer":"number";let c="number"==typeof l&&l>=(i??-1/0),p="number"==typeof s&&s<=(o??1/0),d="draft-04"===t.target||"openapi-3.0"===t.target;if(c?d?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof i&&(r.minimum=i),p?d?(r.maximum=s,r.exclusiveMaximum=!0):r.exclusiveMaximum=s:"number"==typeof o&&(r.maximum=o),a){let i=new Set;for(let o of a)Number.isFinite(o)&&0!==o?i.add(Math.abs(o)):rY(e,t,r,n,`A multipleOf divisor of ${o} cannot be represented in JSON Schema`);let[o,...s]=i;void 0!==o&&(r.multipleOf=o),s.length&&(r.allOf=[...r.allOf??[],...s.map(e=>({multipleOf:e}))])}})(e,t,r,n),e.isFinite=!0},eS({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=nl(e);return Math.max(t??-1/0,r??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=nl(e);return Math.min(t??1/0,r??1/0)},isInt:e=>{let{isInt:t,multipleOf:r}=nl(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>nl(e).format??null},{gt(e,t){return this.check(rF(e,t))},gte(e,t){return this.check(rq(e,t))},min(e,t){return this.check(rq(e,t))},lt(e,t){return this.check(rM(e,t))},lte(e,t){return this.check(rB(e,t))},max(e,t){return this.check(rB(e,t))},int(e){return this.check(ib(e))},safe(e){return this.check(ib(e))},positive(e){return this.check(rF(0,e))},nonnegative(e){return this.check(rq(0,e))},negative(e){return this.check(rM(0,e))},nonpositive(e){return this.check(rB(0,e))},multipleOf(e,t){return this.check(rW(e,t))},step(e,t){return this.check(rW(e,t))},finite(){return this}}));function ig(e){return new im(rj({type:"number",checks:[],...ea(e)}))}let iy=ex("ZodNumberFormat",(e,t)=>{t6.init(e,t),im.init(e,t)});function ib(e){return new iy({type:"number",check:"number_format",abort:!1,format:"safeint",...ea(e)})}let iv=ex("ZodBoolean",(e,t)=>{t5.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.type="boolean"}});function iw(e){return new iv({type:"boolean",...ea(e)})}let i_=ex("ZodNull",(e,t)=>{t8.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{"openapi-3.0"===e.target?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"}}),iE=ex("ZodUnknown",(e,t)=>{t7.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(e,t,r)=>void 0});function iS(){return new iE({type:"unknown"})}let iR=ex("ZodNever",(e,t)=>{re.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}});function iO(e){return new iR({type:"never",...ea(e)})}let iC=ex("ZodDate",(e,t)=>{rt.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{rY(e,t,r,n,"Date cannot be represented in JSON Schema")},e.min=(t,r)=>e.check(rq(t,r)),e.max=(t,r)=>e.check(rB(t,r))},eS({minDate:e=>{let{minimum:t}=nl(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=nl(e);return t?new Date(t):null}},{}));function iA(e){return new iC({type:"date",...ea(e)})}let iT=ex("ZodArray",(e,t)=>{nH(),rn.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,{minimum:o,maximum:a}=nl(e);"number"==typeof o&&(r.minItems=o),"number"==typeof a&&(r.maxItems=a),r.type="array",r.items=rQ(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element},{min(e,t){return this.check(rK(e,t))},nonempty(e){return this.check(rK(1,e))},max(e,t){return this.check(rZ(e,t))},length(e,t){return this.check(rH(e,t))},unwrap(){return this.element}});function ix(e,t){return new iT({type:"array",element:e,...ea(t)})}let ik=ex("ZodObject",(e,t)=>{var r;let n,i;nH(),ru.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&rY(e,t,r,n,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in r.type="object",r.properties={},o)Z(r.properties,e,rQ(o[e],t,{...n,path:[...n.path,"properties",e]}));let a=[];for(let e of Object.keys(o)){let r=i.shape[e];("input"===t.io?void 0===nd(r):void 0===r._zod.optout)&&a.push(e)}a.length>0&&(r.required=a),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=rQ(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),r="shape",(i=r in(n=Object.getPrototypeOf(e))?void 0:n)&&Object.defineProperty(i,r,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:!1,value:void 0};return Object.defineProperty(this,r,e),e.value=(e=>e._zod.def.shape)(this),Object.defineProperty(this,r,e),e.value},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!1,value:e})}})},{keyof(){return iB(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Y(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Y(this._zod.def,{catchall:iS()}))},loose(){return this.clone(Y(this._zod.def,{catchall:iS()}))},strict(){return this.clone(Y(this._zod.def,{catchall:iO()}))},strip(){return this.clone(Y(this._zod.def,{catchall:void 0}))},extend(e){if(!et(e))throw Error("Invalid input to extend: expected a plain object");let t=this._zod.def.checks;if(t&&t.length>0){let t=H(this);for(let r of Reflect.ownKeys(e))if(void 0!==Object.getOwnPropertyDescriptor(t,r))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return eo(this,Y(this._zod.def,{shape:ep(this,e)}))},safeExtend(e){if(!et(e))throw Error("Invalid input to safeExtend: expected a plain object");return eo(this,Y(this._zod.def,{shape:ep(this,e)}))},merge(e){if(!e?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(this._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let t={};return G(t,this,Reflect.ownKeys(H(this))),G(t,e,Reflect.ownKeys(H(e))),eo(this,Y(this._zod.def,{shape:t,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]}))},pick(e){return function(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return G(i,e,ec(e,t)),eo(e,Y(r,{shape:i,checks:[]}))}(this,e)},omit(e){return function(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ec(e,t)),o={};return G(o,e,Reflect.ownKeys(H(e)).filter(e=>!i.has(e))),eo(e,Y(r,{shape:o,checks:[]}))}(this,e)},partial(...e){return ed(iZ,this,e[0])},exactPartial(...e){return ed(iH,this,e[0],"exactPartial")},required(...e){var t;let r,n;return r=(t=e[0])?new Set(ec(this,t)):void 0,G(n={},this,Reflect.ownKeys(H(this)),(e,t)=>r&&!r.has(t)?e:new iQ({type:"nonoptional",innerType:e})),eo(this,Y(this._zod.def,{shape:n}))}});function iP(e,t){return new ik({type:"object",shape:e,catchall:iO(),...ea(t)})}function iI(e,t){return new ik({type:"object",shape:e,catchall:iS(),...ea(t)})}let iU=ex("ZodUnion",(e,t)=>{rp.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,o,a;return o=!1===(i=e._zod.def).inclusive,a=i.options.map((e,r)=>rQ(e,t,{...n,path:[...n.path,o?"oneOf":"anyOf",r]})),void(o?r.oneOf=a:r.anyOf=a)},e.options=t.options});function iL(e,t){return new iU({type:"union",options:e,...ea(t)})}let iz=ex("ZodDiscriminatedUnion",(e,t)=>{iU.init(e,t),rd.init(e,t)});function iN(e,t,r){return new iz({type:"union",options:t,discriminator:e,...ea(r)})}let ij=ex("ZodIntersection",(e,t)=>{rf.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,o,a,s,l;return o=rQ((i=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),a=rQ(i.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=l=[...(s=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...s(a)?a.allOf:[a]],t.intersections.push(l))}}),iD=ex("ZodRecord",(e,t)=>{nH(),rm.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;r.type="object";let o=i.keyType,a=nl(o).patterns;if("loose"===i.mode&&a&&a.size>0){let e=rQ(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});for(let t of(r.patternProperties={},a))Z(r.patternProperties,np(t).source,e)}else{if("draft-07"===t.target||"draft-2020-12"===t.target){r.propertyNames=rQ(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let o=nf.get(t);o||(o=[],nf.set(t,o),t.deferred.push(()=>(function(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let r=new Map;for(let n of nf.get(e)??[]){let i=e.seen.get(n),o=(i?.def??i?.schema)?.propertyNames;if(!o||!0===o||r.has(o))continue;let a=function e(t,r,n){if(r.$ref){if(n.has(r))return r;n.add(r);let i=t.get(r)?.def;if(!i)return r;let o=e(t,i,n);return o===i?r:o}for(let i of["anyOf","oneOf"]){let o=r[i];if(!Array.isArray(o))continue;let a=o.map(r=>e(t,r,n));a.some((e,t)=>e!==o[t])&&(r={...r,[i]:a})}let i=Array.isArray(r.type)?r.type:[r.type],o=!i.includes("string")&&i.some(e=>"number"===e||"integer"===e),a=r.enum??(void 0!==r.const?[r.const]:void 0);if(!o&&!a?.some(e=>"number"==typeof e))return r;let{minimum:s,maximum:l,exclusiveMinimum:u,exclusiveMaximum:c,multipleOf:p,format:d,id:f,...h}=r;return h.enum?h.enum=h.enum.map(e=>"number"==typeof e?String(e):e):"number"==typeof h.const&&(h.const=String(h.const)),o&&(h.type="string",a||(h.pattern=(i.includes("number")?e6:e9).source)),h}(t,o,new Set);a!==o&&r.set(o,a)}if(r.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&r.get(e.propertyNames);t&&(e.propertyNames=t)}})(t))),o.push(e)}r.additionalProperties=rQ(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let s=o._zod.values,l="input"===t.io&&void 0!==nd(i.valueType);if(s&&!i.partial&&!l){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e.map(String))}})(e,t,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function i$(e,t,r){return new iD(t&&t._zod?{type:"record",keyType:e,valueType:t,...ea(r)}:{type:"record",keyType:nY(),valueType:e,...ea(t)})}let iM=ex("ZodEnum",(e,t)=>{rg.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t)=>{let r=M(e._zod.def.entries);if(0===r.length){t.not={};return}r.every(e=>"number"==typeof e)&&(t.type="number"),r.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=r})(e,r),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new iM({...t,checks:[],...ea(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new iM({...t,checks:[],...ea(n),entries:i})}});function iB(e,t){return new iM({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ea(t)})}let iF=ex("ZodLiteral",(e,t)=>{ry.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;if(0===i.values.length){r.not={};return}let o=[];for(let a of i.values)if(void 0===a){if(rY(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof a){if(rY(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(0===o.length);else if(1===o.length){let e=o[0];r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else o.every(e=>"number"==typeof e)&&(r.type="number"),o.every(e=>"string"==typeof e)&&(r.type="string"),o.every(e=>"boolean"==typeof e)&&(r.type="boolean"),o.every(e=>null===e)&&(r.type="null"),r.enum=o})(e,t,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function iq(e,t){return new iF({type:"literal",values:Array.isArray(e)?e:[e],...ea(t)})}let iW=ex("ZodTransform",(e,t)=>{nH(),rb.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{rY(e,t,r,n,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new $ZodEncodeError(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(e_(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),"input"in n||(n.input=r.value),n.inst??(n.inst=e),r.issues.push(e_(n)))};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r)):(r.value=i,r)}}),iZ=ex("ZodOptional",(e,t)=>{rw.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ng(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function iK(e){return new iZ({type:"optional",innerType:e})}let iH=ex("ZodExactOptional",(e,t)=>{r_.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ng(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),iV=ex("ZodNullable",(e,t)=>{rE.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,o,a;return o=rQ((i=e._zod.def).innerType,t,n),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function iJ(e){return new iV({type:"nullable",innerType:e})}let iG=ex("ZodDefault",(e,t)=>{rS.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,o;return rQ((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,void((o=nm(i.defaultValue,e,t,r,n))!==nh&&(r.default=o))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),iY=ex("ZodPrefault",(e,t)=>{rO.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;if(rQ(i.innerType,t,n),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let o=nm(i.defaultValue,e,t,r,n);o!==nh&&(r._prefault=o)})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),iQ=ex("ZodNonOptional",(e,t)=>{rC.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;rQ((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),iX=ex("ZodCatch",(e,t)=>{rx.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i,o=e._zod.def;rQ(o.innerType,t,n),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{rY(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=i})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),i0=ex("ZodPipe",(e,t)=>{rk.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,o,a;return o=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(rQ(a="input"===t.io?o?i.out:i.in:i.out,t,n),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function i1(e,t){return new i0({type:"pipe",in:e,out:t})}let i2=ex("ZodReadonly",(e,t)=>{rI.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;rQ((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),i4=ex("ZodCustom",(e,t)=>{rL.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{rY(e,t,r,n,"Custom types cannot be represented in JSON Schema")}});function i3(e,t){var r;let n;return r=e??(()=>!0),(n=ea(t)).abort??(n.abort=!0),new i4({type:"custom",check:"custom",fn:r,...n})}let i9=ex("ZodInstanceOf",(e,t)=>{i4.init(e,t)},{properties(e,t){return this.check(new tv({check:"properties",shape:e,...ea(t)}))}});function i6(e,t={}){let r=new i9({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...ea(t)});return r._zod.bag.Class=e,r._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:r,path:[...r._zod.def.path??[]]})},r}let i5="[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+",i8=`${i5}(?:\\.${i5})*`,i7="[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?",oe=`${i7}(?:\\.${i7})+`,ot=`${i8}@${oe}`;RegExp(`^${ot}$`);let or=`(${ot})( *, *${ot})*`;RegExp(`^${or}$`);let on="[a-z\\d](?:[a-z\\d]|-(?=[a-z\\d])){0,38}";RegExp(`^${on}$`,"i"),RegExp("^(?:(?:(?:https?):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?|xn--[a-z0-9]+))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i"),RegExp(`^https:\\/\\/gist\\.github\\.com\\/${on}\\/[0-9a-f]{32}$`,"i");let oi={READY:"READY",RUNNING:"RUNNING",SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",TIMING_OUT:"TIMING-OUT",TIMED_OUT:"TIMED-OUT",ABORTING:"ABORTING",ABORTED:"ABORTED"},oo=[oi.SUCCEEDED,oi.FAILED,oi.TIMED_OUT,oi.ABORTED],oa={DEVELOPMENT:"DEVELOPMENT",WEB:"WEB",API:"API",SCHEDULER:"SCHEDULER",TEST:"TEST",WEBHOOK:"WEBHOOK",ACTOR:"ACTOR",CLI:"CLI",STANDBY:"STANDBY",CI:"CI",MCP:"MCP",APIFY_AI:"APIFY_AI"},os="APIFY_LOG_FORMAT",ol="ACTOR_RUN_ID",ou={ACTOR_STANDBY_PORT:"4321",ACTOR_DEFAULT_DATASET_ID:"default",ACTOR_DEFAULT_KEY_VALUE_STORE_ID:"default",ACTOR_DEFAULT_REQUEST_QUEUE_ID:"default",ACTOR_WEB_SERVER_PORT:"4321",ACTOR_WEB_SERVER_URL:"http://localhost:4321"};ou.ACTOR_WEB_SERVER_PORT,ou.ACTOR_WEB_SERVER_URL,ou.ACTOR_DEFAULT_DATASET_ID,ou.ACTOR_DEFAULT_KEY_VALUE_STORE_ID,ou.ACTOR_DEFAULT_REQUEST_QUEUE_ID;let oc={FULL_PERMISSIONS:"FULL_PERMISSIONS",LIMITED_PERMISSIONS:"LIMITED_PERMISSIONS"},op={OWNED_BY_ME:"ownedByMe",SHARED_WITH_ME:"sharedWithMe"};(E=z||(z={}))[E.OFF=0]="OFF",E[E.ERROR=1]="ERROR",E[E.SOFT_FAIL=2]="SOFT_FAIL",E[E.WARNING=3]="WARNING",E[E.INFO=4]="INFO",E[E.DEBUG=5]="DEBUG",E[E.PERF=6]="PERF";let od=z,of=Object.keys(z).filter(e=>Number.isNaN(+e));(S=N||(N={})).JSON="JSON",S.TEXT="TEXT";let oh=Symbol("apify.processed_error"),om="[TRUNCATED]",og="...[truncated]",oy=["_id","id","userId","impersonatedUserId","impersonatingUserId","adminUserId","actorId","actorTaskId","taskId","buildId","buildNumber","runId","name","message","stack","cause","url","method","code","status","statusCode","statusText","errorCode","errorMessage","errorResponse","response","request","data","payload","details","exception","config","headers"];var ob=r("z"),ov=r("q");let Logger=class Logger extends ov.EventEmitter{options;constructor(e){super(),this.options=e}setOptions(e){this.options={...this.options,...e}}getOptions(){return this.options}_outputWithConsole(e,t){switch(e){case z.ERROR:console.error(t);break;case z.WARNING:console.warn(t);break;case z.DEBUG:console.debug(t);break;default:console.log(t)}}_log(e,t,r,n,i={}){throw Error("log() method must be implemented!")}log(e,t,...r){let n=this._log(e,t,...r);this.emit("line",n)}};let ow={skipLevelInfo:!1,skipTime:!1};let logger_json_LoggerJson=class logger_json_LoggerJson extends Logger{constructor(e={}){super({...ow,...e})}_log(e,t,r,n,i={}){let{prefix:o,suffix:a}=i;n&&(r={...r,exception:n}),o&&(t=`${o}: ${t}`),a&&(t=`${t} ${a}`);let s=JSON.stringify({time:this.options.skipTime?void 0:new Date,level:this.options.skipLevelInfo&&e===z.INFO?void 0:z[e],msg:t,...r});return this._outputWithConsole(e,s),s}};var o_=r("v"),oE=r.n(o_);let oS={SOFT_FAIL:"SFAIL",WARNING:"WARN"},oR={[z.ERROR]:"red",[z.SOFT_FAIL]:"red",[z.WARNING]:"yellow",[z.INFO]:"green",[z.DEBUG]:"blue",[z.PERF]:"magenta"},oO=of.map(e=>oS[e]||e),oC=Math.max(...oO.map(e=>e.length)),oA={skipTime:!0};let LoggerText=class LoggerText extends Logger{constructor(e={}){super({...oA,...e})}_log(e,t,r,n,i={}){let{prefix:o,suffix:a}=i,s="";this.options.skipTime||(s=`${new Date().toISOString().replace("Z","").replace("T"," ")} `);let l=n?this._parseException(n):"",u=oR[e],c=oO[e],p=(e=>{let t="";for(let r=0;r<oC-e.length;r++)t+=" ";return t})(c),d=r?` ${JSON.stringify(r)}`:"";o=o?` ${o}:`:"",a=a?` ${a}`:"";let f=`${o_.gray(s)}${o_[u](c)}${p}${o_.yellow(o)} ${t||""}${o_.gray(d)}${o_.yellow(a)}${l}`;return this._outputWithConsole(e,f),f}_parseException(e,t=1){return["string","boolean","number","undefined","bigint"].includes(typeof e)?`
|
|
56
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){i(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){i(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle){i(r);continue}n.count>1&&"ref"===e.reused&&i(r)}e.external&&(e.sharedDefsExtractedFor=e.external)}let r1=new Set(["type","properties","required","additionalProperties"]),r2=["oneOf","anyOf"];function r4(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function r3(e){let t=[];for(let r of e){if("object"!=typeof r||"object"!==r.type)return null;for(let e in r)if(!r1.has(e))return null;t.push(r)}let r={},n=new Set;for(let e of t){for(let n in e.properties){if(Object.prototype.hasOwnProperty.call(r,n))continue;let e=[];for(let r of t){let t=r.properties?.[n]??r4(r);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Z(r,n,1===e.length?e[0]:r3(e)??{allOf:e})}for(let t of e.required??[])n.add(t)}let i={type:"object",properties:r};if(n.size&&(i.required=[...n]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let r of t){let t=r4(r);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function r9(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let i=r.def??r.schema,o={...i},a=r.ref;if(r.ref=null,a){n(a);let r=e.seen.get(a),s=r.schema;if(s.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(s)):rJ(i,s),rJ(i,o),t._zod.parent===a)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in o||delete i[e]);if(s.$ref&&r.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(i[e])===JSON.stringify(r.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==a){n(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:r.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())n(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let r=t.anyOf;if(!Array.isArray(r)||0===r.length||void 0!==t.type)return;let n=[];for(let t of r){if(!t||"object"!=typeof t)return;e(t);let r=Object.keys(t);if(1!==r.length||"type"!==r[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;n.includes(e)||n.push(e)}}delete t.anyOf,t.type=1===n.length?n[0]:n}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let r of e.seen.values())for(let e of[r.schema,r.def]){let r=e?.allOf;if(!Array.isArray(r))continue;let n=t.get(r);n?n.push(e):t.set(r,[e])}for(let r of e.intersections)for(let e of t.get(r)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of r1)if(t in e)return;let r=t.filter(e=>r2.some(t=>Array.isArray(e[t]))),n=null;if(r.length){let e=r[0],i=r2.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let o=t.filter(t=>t!==e),a=e[i].map(e=>r3([...o,e]));if(a.some(e=>!e))return;n={[i]:a}}else n=r3(t);n&&(delete e.allOf,rJ(e,n))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(r)}rJ(i,r.defId?r.schema:r.def??r.schema);let o=e.metadataRegistry.get(t)?.id;void 0!==o&&i.id===o&&delete i.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Z(a,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&("draft-2020-12"===e.target?i.$defs=a:i.definitions=a);try{let r=JSON.parse(JSON.stringify(i));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:r6(t,"input",e.processors),output:r6(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}let r6=(e,t,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},a=rG({...i??{},target:o,io:t,processors:r});return rQ(e,a),r0(a,e),r9(a,e)},r5=(e,t,r)=>{(void 0===e[t]||r>e[t])&&(e[t]=r)},r8=(e,t,r)=>{(void 0===e[t]||r<e[t])&&(e[t]=r)},r7=(e,t)=>{r5(e,"minimum",t),r8(e,"maximum",t)},ne=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},nt=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},nr=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},nn=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},ni=(e,t)=>r5(e,"minimum",t.minimum),no=(e,t)=>r8(e,"maximum",t.maximum),na=e=>(t,r)=>{nn(t,r.format);let[n,i]=e[r.format];r5(t,"minimum",n),r8(t,"maximum",i)},ns={greater_than:(e,t)=>r5(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>r8(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>ne(e,t.value),number_format:na(el),bigint_format:na(eu),min_length:ni,max_length:no,length_equals:(e,t)=>r7(e,t.length),min_size:ni,max_size:no,size_equals:(e,t)=>r7(e,t.size),string_format:(e,t)=>{nn(e,t.format),t.pattern&&nt(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>nr(e,t.mime)};function nl(e){let t={},r=e._zod.def;for(let n of e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[])ns[n._zod.def.check]?.(t,n._zod.def);let n=e._zod.bag;for(let e of(void 0!==n.minimum&&r5(t,"minimum",n.minimum),void 0!==n.exclusiveMinimum&&r5(t,"exclusiveMinimum",n.exclusiveMinimum),void 0!==n.maximum&&r8(t,"maximum",n.maximum),void 0!==n.exclusiveMaximum&&r8(t,"exclusiveMaximum",n.exclusiveMaximum),void 0!==n.multipleOf&&ne(t,n.multipleOf),void 0!==n.format&&(t.format??(t.format=n.format),n.format.includes("int")&&(t.isInt=!0)),n.mime&&nr(t,n.mime),n.patterns??[]))nt(t,e);return t}let nu={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nc=new Map([[tX,/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/],[t1,/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/]]),np=e=>nc.get(e)??e;function nd(e){let t=e._zod.def;return"pipe"===t.type&&t.in._zod.traits.has("$ZodTransform")?nd(t.out):"catch"===t.type?nd(t.innerType):e._zod.optin}let nf=new WeakMap,nh=Symbol();function nm(e,t,r,n,i){let o=!1,a=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(o=!0,null));return o?(rY(t,r,n,i,"BigInt defaults cannot be represented in JSON Schema"),nh):JSON.parse(a)}let ng=(e,t,r,n)=>{let i=e._zod.def;rQ(i.innerType,t,n),t.seen.get(e).ref=i.innerType};function ny(){return{localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function n(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?r[e]??e:String(t)}return r=>{switch(r.code){case"invalid_type":{let e=n(r.expected),t=n(function(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}(r.input),r.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${es(r.values[0])}`;return`Invalid option: expected one of ${B(r.values,"|")}`;case"too_big":{let t=r.exact?"exactly ":r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Too big: expected ${r.origin??"value"} to have ${t}${r.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${t}${r.maximum.toString()}`}case"too_small":{let t=r.exact?"exactly ":r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Too small: expected ${r.origin} to have ${t}${r.minimum.toString()} ${n.unit}`;return`Too small: expected ${r.origin} to be ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Invalid string: must start with "${r.prefix}"`;if("ends_with"===r.format)return`Invalid string: must end with "${r.suffix}"`;if("includes"===r.format)return`Invalid string: must include "${r.includes}"`;if("regex"===r.format)return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${B(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0){let e=r.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===r.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}})()}}let nb={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,F,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},nv={value:void 0,enumerable:!1},nw=new WeakSet([Object.prototype,Error.prototype]),n_=(e,t)=>{e.name="$ZodError",nv.value=t,Object.defineProperty(e,"issues",nv),nv.value=void 0,Object.defineProperty(e,"message",nb);let r=Object.getPrototypeOf(e);nw.has(r)||(nw.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},nE=ex("$ZodError",n_);function nS(e,t){return{callee:t?.callee??e,Err:t?.Err}}ex("$ZodError",n_,void 0,{Parent:Error});let nR=e=>{let t=(r,n,i,o)=>{let a=i?{...i,async:!1}:{async:!1},s=r._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new $ZodAsyncError;if(s.issues.length){let r=new(o?.Err??e)(s.issues.map(e=>ey(e,a,eP())));throw Q(r,o?.callee??t),r}return s.value};return t},nO=e=>{let t=async(r,n,i,o)=>{let a=i?{...i,async:!0}:{async:!0},s=r._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let r=new(o?.Err??e)(s.issues.map(e=>ey(e,a,eP())));throw Q(r,o?.callee??t),r}return s.value};return t},nC=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new $ZodAsyncError;return o.issues.length?nA(e,o.issues,i):{success:!0,data:o.value}};function nA(e,t,r){let n;return{success:!1,get error(){return n||(n=new e(t.map(e=>ey(e,r,eP()))),t=void 0,r=void 0),n},set error(e){n=e,t=void 0,r=void 0}}}let nT=e=>async(t,r,n)=>{let i=n?{...n,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?nA(e,o.issues,i):{success:!0,data:o.value}},nx=Symbol.for("zod.compile.invalid"),nk=Symbol.for("zod.compile.fallback"),nP=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},n);return i instanceof Promise&&(i=await i),0===i.issues.length},nU=new WeakSet([Object.prototype,Error.prototype]);function nI(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=r(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let nL=ex("ZodError",(e,t)=>{nE.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);nU.has(r)||(nU.add(r),nI(r,"format",e=>t=>(function(e,t=e=>e.message){let r={_errors:[]},n=(e,i=[])=>{for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>n({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)n({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)n({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length)r._errors.push(t(o));else{let n=r,i=0;for(;i<e.length;){let r=e[i],a=i===e.length-1;if("_errors"===r){a&&n._errors.push(t(o)),i++;continue}Object.prototype.hasOwnProperty.call(n,r)||Object.defineProperty(n,r,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=n[r];a&&s._errors.push(t(o)),n=s,i++}}}};return n(e),r})(e,t)),nI(r,"flatten",e=>t=>(function(e,t=e=>e.message){let r={},n=[];for(let a of e.issues)if(a.path.length>0){var i,o;(i=a.path[0],o=()=>[],!Object.prototype.hasOwnProperty.call(r,i)&&("__proto__"===i?Object.defineProperty(r,i,{value:o(),writable:!0,enumerable:!0,configurable:!0}):r[i]=o()),r[i]).push(t(a))}else n.push(t(a));return{formErrors:n,fieldErrors:r}})(e,t)),nI(r,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,F,2)}),nI(r,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,F,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error}),nz=nR(nL),nN=nO(nL),nj=nC(nL),nD=nT(nL),n$=(o=nR(nL),a=(e,t,r,n)=>o(e,t,r?{...r,direction:"backward"}:{direction:"backward"},nS(a,n))),nM=(s=nR(nL),l=(e,t,r,n)=>s(e,t,r,nS(l,n))),nB=(u=nO(nL),c=async(e,t,r,n)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return await u(e,t,i,nS(c,n))}),nF=(p=nO(nL),d=async(e,t,r,n)=>await p(e,t,r,nS(d,n))),nq=(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return nC(nL)(e,t,n)},nW=(e,t,r)=>nC(nL)(e,t,r),nZ=async(e,t,r)=>{let n=r?{...r,direction:"backward"}:{direction:"backward"};return nT(nL)(e,t,n)},nK=async(e,t,r)=>nT(nL)(e,t,r);function nH(){ek.memoizer||eP({memoizer:eD})}let nV=ex("ZodType",(e,t)=>(ek.localeError||eP(ny()),tE.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Y(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return eo(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new i4({type:"custom",check:"custom",fn:e,...ea(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var r;let n,i;return r=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(e_(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(e_(e)))},e(t.value,t)),(i=new tt({check:"custom",...ea(t)}))._zod.check=r,n=i}(e,t))},overwrite(e){return this.check(rV(e))},optional(){return iK(this)},exactOptional(){var e;return e=this,new iH({type:"optional",innerType:e})},nullable(){return iJ(this)},nullish(){return iK(iJ(this))},nonoptional(e){var t;return t=this,new iQ({type:"nonoptional",innerType:t,...ea(e)})},array(){return ix(this)},or(e){return iL([this,e])},and(e){var t;return t=this,new ij({type:"intersection",left:t,right:e})},transform(e){return i1(this,new iW({type:"transform",transform:e}))},default(e){var t,r;return t=this,r=e,new iG({type:"default",innerType:t,get defaultValue(){return"function"==typeof r?r():er(r)}})},prefault(e){var t,r;return t=this,r=e,new iY({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof r?r():er(r)}})},catch(e){return function(e,t){let r;return new iX({type:"catch",innerType:e,catchValue:"function"==typeof t?t:((r=()=>t)["~constantCatch"]=!0,r)})}(this,e)},pipe(e){return i1(this,e)},readonly(){var e;return e=this,new i2({type:"readonly",innerType:e})},describe(e){let t=this.clone();return rN.add(t,{description:e}),t},meta(...e){if(0===e.length)return rN.get(this);let t=this.clone();return rN.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return eE(this,"~standard",{...tO(this),jsonSchema:{input:r6(this,"input"),output:r6(this,"output")}},!1)},set"~standard"(e){eE(this,"~standard",e)},parse:function e(t,r){return nz(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await nN(this,t,r,{callee:e})},safeParse(e,t){return nj(this,e,t)},async safeParseAsync(e,t){return nD(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){eE(this,"spa",e)},validate(e,t){let r=this._zod.bag.validator;if(void 0!==r){if(r(e)!==nx)return!0;if(!0===r.definite&&void 0===t)return!1}return function(e,t,r){let n,i=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;if(o?(i[nk]=!0,n=o({value:t,issues:[]},i)):n=e._zod.run({value:t,issues:[]},i),n instanceof Promise)throw new $ZodAsyncError;return 0===n.issues.length}(this,e,t)},validateAsync(e,t){return nP(this,e,t)},encode:function e(t,r){return n$(this,t,r,{callee:e})},decode:function e(t,r){return nM(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await nB(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await nF(this,t,r,{callee:e})},safeEncode(e,t){return nq(this,e,t)},safeDecode(e,t){return nW(this,e,t)},async safeEncodeAsync(e,t){return nZ(this,e,t)},async safeDecodeAsync(e,t){return nK(this,e,t)},toJSONSchema(e){return((e,t={})=>r=>{let n=rG({...r,processors:t});return rQ(e,n),r0(n,e),r9(n,e)})(this,{})(e)},get description(){return rN.get(this)?.description},get _def(){return this._zod.def}}),nJ=ex("_ZodString",(e,t)=>{tC.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{r.type="string";let{minimum:n,maximum:i,format:o,patterns:a,contentEncoding:s,laxFormat:l}=nl(e);if("number"==typeof n&&(r.minLength=n),"number"==typeof i&&(r.maxLength=i),o&&(r.format=nu[o]??o,""===r.format&&delete r.format,("time"===o||l)&&delete r.format),s&&(r.contentEncoding=s),a&&a.size>0){let e=[...a].map(np);1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r)},eS({format:e=>nl(e).format??null,minLength:e=>nl(e).minimum??null,maxLength:e=>nl(e).maximum??null},{regex(...e){return this.check(function(e,t){return new td({check:"string_format",format:"regex",...ea(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new tm({check:"string_format",format:"includes",...ea(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new tg({check:"string_format",format:"starts_with",...ea(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new ty({check:"string_format",format:"ends_with",...ea(t),suffix:e})}(...e))},min(...e){return this.check(rK(...e))},max(...e){return this.check(rZ(...e))},length(...e){return this.check(rH(...e))},nonempty(...e){return this.check(rK(1,...e))},lowercase(e){return this.check(new tf({check:"string_format",format:"lowercase",...ea(e)}))},uppercase(e){return this.check(new th({check:"string_format",format:"uppercase",...ea(e)}))},trim(){return this.check(rV(e=>e.trim()))},normalize(...e){return this.check(function(e){return rV(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(rV(e=>e.toLowerCase()))},toUpperCase(){return this.check(rV(e=>e.toUpperCase()))},slugify(){return this.check(rV(e=>e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")))}})),nG=ex("ZodString",(e,t)=>{tC.init(e,t),nJ.init(e,t)},{email(e){return this.check(new n4({type:"string",format:"email",check:"string_format",abort:!1,...ea(e)}))},url(e){return this.check(rD(n6,e))},jwt(e){return this.check(new ih({type:"string",format:"jwt",check:"string_format",abort:!1,...ea(e)}))},emoji(e){return this.check(new n8({type:"string",format:"emoji",check:"string_format",abort:!1,...ea(e)}))},guid(e){return this.check(new n3({type:"string",format:"guid",check:"string_format",abort:!1,...ea(e)}))},uuid(e){return this.check(new n9({type:"string",format:"uuid",check:"string_format",abort:!1,...ea(e)}))},uuidv4(e){return this.check(new n9({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ea(e)}))},uuidv6(e){return this.check(new n9({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ea(e)}))},uuidv7(e){return this.check(new n9({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ea(e)}))},nanoid(e){return this.check(new n7({type:"string",format:"nanoid",check:"string_format",abort:!1,...ea(e)}))},cuid(e){return this.check(new ie({type:"string",format:"cuid",check:"string_format",abort:!1,...ea(e)}))},cuid2(e){return this.check(new it({type:"string",format:"cuid2",check:"string_format",abort:!1,...ea(e)}))},ulid(e){return this.check(new ir({type:"string",format:"ulid",check:"string_format",abort:!1,...ea(e)}))},base64(e){return this.check(new ic({type:"string",format:"base64",check:"string_format",abort:!1,...ea(e)}))},base64url(e){return this.check(new ip({type:"string",format:"base64url",check:"string_format",abort:!1,...ea(e)}))},xid(e){return this.check(new ii({type:"string",format:"xid",check:"string_format",abort:!1,...ea(e)}))},ksuid(e){return this.check(new io({type:"string",format:"ksuid",check:"string_format",abort:!1,...ea(e)}))},ipv4(e){return this.check(new ia({type:"string",format:"ipv4",check:"string_format",abort:!1,...ea(e)}))},ipv6(e){return this.check(new is({type:"string",format:"ipv6",check:"string_format",abort:!1,...ea(e)}))},cidrv4(e){return this.check(new il({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ea(e)}))},cidrv6(e){return this.check(new iu({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ea(e)}))},e164(e){return this.check(new id({type:"string",format:"e164",check:"string_format",abort:!1,...ea(e)}))},datetime(e){return this.check(r$(nX,e))},date(e){return this.check(new n0({type:"string",format:"date",check:"string_format",...ea(e)}))},time(e){return this.check(new n1({type:"string",format:"time",check:"string_format",precision:null,...ea(e)}))},duration(e){return this.check(new n2({type:"string",format:"duration",check:"string_format",...ea(e)}))}});function nY(e){return new nG(rj({type:"string",...ea(e)}))}let nQ=ex("ZodStringFormat",(e,t)=>{tA.init(e,t),nJ.init(e,t)}),nX=ex("ZodISODateTime",(e,t)=>{tF.init(e,t),nQ.init(e,t)}),n0=ex("ZodISODate",(e,t)=>{tq.init(e,t),nQ.init(e,t)}),n1=ex("ZodISOTime",(e,t)=>{tW.init(e,t),nQ.init(e,t)}),n2=ex("ZodISODuration",(e,t)=>{tZ.init(e,t),nQ.init(e,t)}),n4=ex("ZodEmail",(e,t)=>{tk.init(e,t),nQ.init(e,t)}),n3=ex("ZodGUID",(e,t)=>{tT.init(e,t),nQ.init(e,t)}),n9=ex("ZodUUID",(e,t)=>{tx.init(e,t),nQ.init(e,t)}),n6=ex("ZodURL",(e,t)=>{tL.init(e,t),nQ.init(e,t)});function n5(e){return rD(n6,e)}let n8=ex("ZodEmoji",(e,t)=>{tz.init(e,t),nQ.init(e,t)}),n7=ex("ZodNanoID",(e,t)=>{tN.init(e,t),nQ.init(e,t)}),ie=ex("ZodCUID",(e,t)=>{tj.init(e,t),nQ.init(e,t)}),it=ex("ZodCUID2",(e,t)=>{tD.init(e,t),nQ.init(e,t)}),ir=ex("ZodULID",(e,t)=>{t$.init(e,t),nQ.init(e,t)}),ii=ex("ZodXID",(e,t)=>{tM.init(e,t),nQ.init(e,t)}),io=ex("ZodKSUID",(e,t)=>{tB.init(e,t),nQ.init(e,t)}),ia=ex("ZodIPv4",(e,t)=>{tK.init(e,t),nQ.init(e,t)}),is=ex("ZodIPv6",(e,t)=>{tJ.init(e,t),nQ.init(e,t)}),il=ex("ZodCIDRv4",(e,t)=>{tG.init(e,t),nQ.init(e,t)}),iu=ex("ZodCIDRv6",(e,t)=>{tY.init(e,t),nQ.init(e,t)}),ic=ex("ZodBase64",(e,t)=>{t0.init(e,t),nQ.init(e,t)}),ip=ex("ZodBase64URL",(e,t)=>{t2.init(e,t),nQ.init(e,t)}),id=ex("ZodE164",(e,t)=>{t4.init(e,t),nQ.init(e,t)}),ih=ex("ZodJWT",(e,t)=>{t3.init(e,t),nQ.init(e,t)}),im=ex("ZodNumber",(e,t)=>{t9.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let{minimum:i,maximum:o,multipleOf:a,exclusiveMaximum:s,exclusiveMinimum:l,isInt:u}=nl(e);r.type=u?"integer":"number";let c="number"==typeof l&&l>=(i??-1/0),p="number"==typeof s&&s<=(o??1/0),d="draft-04"===t.target||"openapi-3.0"===t.target;if(c?d?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof i&&(r.minimum=i),p?d?(r.maximum=s,r.exclusiveMaximum=!0):r.exclusiveMaximum=s:"number"==typeof o&&(r.maximum=o),a){let i=new Set;for(let o of a)Number.isFinite(o)&&0!==o?i.add(Math.abs(o)):rY(e,t,r,n,`A multipleOf divisor of ${o} cannot be represented in JSON Schema`);let[o,...s]=i;void 0!==o&&(r.multipleOf=o),s.length&&(r.allOf=[...r.allOf??[],...s.map(e=>({multipleOf:e}))])}})(e,t,r,n),e.isFinite=!0},eS({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=nl(e);return Math.max(t??-1/0,r??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=nl(e);return Math.min(t??1/0,r??1/0)},isInt:e=>{let{isInt:t,multipleOf:r}=nl(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>nl(e).format??null},{gt(e,t){return this.check(rF(e,t))},gte(e,t){return this.check(rq(e,t))},min(e,t){return this.check(rq(e,t))},lt(e,t){return this.check(rM(e,t))},lte(e,t){return this.check(rB(e,t))},max(e,t){return this.check(rB(e,t))},int(e){return this.check(ib(e))},safe(e){return this.check(ib(e))},positive(e){return this.check(rF(0,e))},nonnegative(e){return this.check(rq(0,e))},negative(e){return this.check(rM(0,e))},nonpositive(e){return this.check(rB(0,e))},multipleOf(e,t){return this.check(rW(e,t))},step(e,t){return this.check(rW(e,t))},finite(){return this}}));function ig(e){return new im(rj({type:"number",checks:[],...ea(e)}))}let iy=ex("ZodNumberFormat",(e,t)=>{t6.init(e,t),im.init(e,t)});function ib(e){return new iy({type:"number",check:"number_format",abort:!1,format:"safeint",...ea(e)})}let iv=ex("ZodBoolean",(e,t)=>{t5.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.type="boolean"}});function iw(e){return new iv({type:"boolean",...ea(e)})}let i_=ex("ZodNull",(e,t)=>{t8.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{"openapi-3.0"===e.target?(t.type="string",t.nullable=!0,t.enum=[null]):t.type="null"}}),iE=ex("ZodUnknown",(e,t)=>{t7.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(e,t,r)=>void 0});function iS(){return new iE({type:"unknown"})}let iR=ex("ZodNever",(e,t)=>{re.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{t.not={}}});function iO(e){return new iR({type:"never",...ea(e)})}let iC=ex("ZodDate",(e,t)=>{rt.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{rY(e,t,r,n,"Date cannot be represented in JSON Schema")},e.min=(t,r)=>e.check(rq(t,r)),e.max=(t,r)=>e.check(rB(t,r))},eS({minDate:e=>{let{minimum:t}=nl(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=nl(e);return t?new Date(t):null}},{}));function iA(e){return new iC({type:"date",...ea(e)})}let iT=ex("ZodArray",(e,t)=>{nH(),rn.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,{minimum:o,maximum:a}=nl(e);"number"==typeof o&&(r.minItems=o),"number"==typeof a&&(r.maxItems=a),r.type="array",r.items=rQ(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element},{min(e,t){return this.check(rK(e,t))},nonempty(e){return this.check(rK(1,e))},max(e,t){return this.check(rZ(e,t))},length(e,t){return this.check(rH(e,t))},unwrap(){return this.element}});function ix(e,t){return new iT({type:"array",element:e,...ea(t)})}let ik=ex("ZodObject",(e,t)=>{var r;let n,i;nH(),ru.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&rY(e,t,r,n,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in r.type="object",r.properties={},o)Z(r.properties,e,rQ(o[e],t,{...n,path:[...n.path,"properties",e]}));let a=[];for(let e of Object.keys(o)){let r=i.shape[e];("input"===t.io?void 0===nd(r):void 0===r._zod.optout)&&a.push(e)}a.length>0&&(r.required=a),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=rQ(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,r,n),r="shape",(i=r in(n=Object.getPrototypeOf(e))?void 0:n)&&Object.defineProperty(i,r,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:!1,value:void 0};return Object.defineProperty(this,r,e),e.value=(e=>e._zod.def.shape)(this),Object.defineProperty(this,r,e),e.value},set(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,enumerable:!1,value:e})}})},{keyof(){return iB(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Y(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Y(this._zod.def,{catchall:iS()}))},loose(){return this.clone(Y(this._zod.def,{catchall:iS()}))},strict(){return this.clone(Y(this._zod.def,{catchall:iO()}))},strip(){return this.clone(Y(this._zod.def,{catchall:void 0}))},extend(e){if(!et(e))throw Error("Invalid input to extend: expected a plain object");let t=this._zod.def.checks;if(t&&t.length>0){let t=H(this);for(let r of Reflect.ownKeys(e))if(void 0!==Object.getOwnPropertyDescriptor(t,r))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return eo(this,Y(this._zod.def,{shape:ep(this,e)}))},safeExtend(e){if(!et(e))throw Error("Invalid input to safeExtend: expected a plain object");return eo(this,Y(this._zod.def,{shape:ep(this,e)}))},merge(e){if(!e?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(this._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let t={};return G(t,this,Reflect.ownKeys(H(this))),G(t,e,Reflect.ownKeys(H(e))),eo(this,Y(this._zod.def,{shape:t,get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]}))},pick(e){return function(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return G(i,e,ec(e,t)),eo(e,Y(r,{shape:i,checks:[]}))}(this,e)},omit(e){return function(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ec(e,t)),o={};return G(o,e,Reflect.ownKeys(H(e)).filter(e=>!i.has(e))),eo(e,Y(r,{shape:o,checks:[]}))}(this,e)},partial(...e){return ed(iZ,this,e[0])},exactPartial(...e){return ed(iH,this,e[0],"exactPartial")},required(...e){var t;let r,n;return r=(t=e[0])?new Set(ec(this,t)):void 0,G(n={},this,Reflect.ownKeys(H(this)),(e,t)=>r&&!r.has(t)?e:new iQ({type:"nonoptional",innerType:e})),eo(this,Y(this._zod.def,{shape:n}))}});function iP(e,t){return new ik({type:"object",shape:e,catchall:iO(),...ea(t)})}function iU(e,t){return new ik({type:"object",shape:e,catchall:iS(),...ea(t)})}let iI=ex("ZodUnion",(e,t)=>{rp.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,o,a;return o=!1===(i=e._zod.def).inclusive,a=i.options.map((e,r)=>rQ(e,t,{...n,path:[...n.path,o?"oneOf":"anyOf",r]})),void(o?r.oneOf=a:r.anyOf=a)},e.options=t.options});function iL(e,t){return new iI({type:"union",options:e,...ea(t)})}let iz=ex("ZodDiscriminatedUnion",(e,t)=>{iI.init(e,t),rd.init(e,t)});function iN(e,t,r){return new iz({type:"union",options:t,discriminator:e,...ea(r)})}let ij=ex("ZodIntersection",(e,t)=>{rf.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,o,a,s,l;return o=rQ((i=e._zod.def).left,t,{...n,path:[...n.path,"allOf",0]}),a=rQ(i.right,t,{...n,path:[...n.path,"allOf",1]}),void(r.allOf=l=[...(s=e=>"allOf"in e&&1===Object.keys(e).length)(o)?o.allOf:[o],...s(a)?a.allOf:[a]],t.intersections.push(l))}}),iD=ex("ZodRecord",(e,t)=>{nH(),rm.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;r.type="object";let o=i.keyType,a=nl(o).patterns;if("loose"===i.mode&&a&&a.size>0){let e=rQ(i.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});for(let t of(r.patternProperties={},a))Z(r.patternProperties,np(t).source,e)}else{if("draft-07"===t.target||"draft-2020-12"===t.target){r.propertyNames=rQ(i.keyType,t,{...n,path:[...n.path,"propertyNames"]});let o=nf.get(t);o||(o=[],nf.set(t,o),t.deferred.push(()=>(function(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let r=new Map;for(let n of nf.get(e)??[]){let i=e.seen.get(n),o=(i?.def??i?.schema)?.propertyNames;if(!o||!0===o||r.has(o))continue;let a=function e(t,r,n){if(r.$ref){if(n.has(r))return r;n.add(r);let i=t.get(r)?.def;if(!i)return r;let o=e(t,i,n);return o===i?r:o}for(let i of["anyOf","oneOf"]){let o=r[i];if(!Array.isArray(o))continue;let a=o.map(r=>e(t,r,n));a.some((e,t)=>e!==o[t])&&(r={...r,[i]:a})}let i=Array.isArray(r.type)?r.type:[r.type],o=!i.includes("string")&&i.some(e=>"number"===e||"integer"===e),a=r.enum??(void 0!==r.const?[r.const]:void 0);if(!o&&!a?.some(e=>"number"==typeof e))return r;let{minimum:s,maximum:l,exclusiveMinimum:u,exclusiveMaximum:c,multipleOf:p,format:d,id:f,...h}=r;return h.enum?h.enum=h.enum.map(e=>"number"==typeof e?String(e):e):"number"==typeof h.const&&(h.const=String(h.const)),o&&(h.type="string",a||(h.pattern=(i.includes("number")?e6:e9).source)),h}(t,o,new Set);a!==o&&r.set(o,a)}if(r.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&r.get(e.propertyNames);t&&(e.propertyNames=t)}})(t))),o.push(e)}r.additionalProperties=rQ(i.valueType,t,{...n,path:[...n.path,"additionalProperties"]})}let s=o._zod.values,l="input"===t.io&&void 0!==nd(i.valueType);if(s&&!i.partial&&!l){let e=[...s].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(r.required=e.map(String))}})(e,t,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function i$(e,t,r){return new iD(t&&t._zod?{type:"record",keyType:e,valueType:t,...ea(r)}:{type:"record",keyType:nY(),valueType:e,...ea(t)})}let iM=ex("ZodEnum",(e,t)=>{rg.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t)=>{let r=M(e._zod.def.entries);if(0===r.length){t.not={};return}r.every(e=>"number"==typeof e)&&(t.type="number"),r.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=r})(e,r),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new iM({...t,checks:[],...ea(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new iM({...t,checks:[],...ea(n),entries:i})}});function iB(e,t){return new iM({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ea(t)})}let iF=ex("ZodLiteral",(e,t)=>{ry.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;if(0===i.values.length){r.not={};return}let o=[];for(let a of i.values)if(void 0===a){if(rY(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof a){if(rY(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;o.push(Number(a))}else o.push(a);if(0===o.length);else if(1===o.length){let e=o[0];r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else o.every(e=>"number"==typeof e)&&(r.type="number"),o.every(e=>"string"==typeof e)&&(r.type="string"),o.every(e=>"boolean"==typeof e)&&(r.type="boolean"),o.every(e=>null===e)&&(r.type="null"),r.enum=o})(e,t,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function iq(e,t){return new iF({type:"literal",values:Array.isArray(e)?e:[e],...ea(t)})}let iW=ex("ZodTransform",(e,t)=>{nH(),rb.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{rY(e,t,r,n,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new $ZodEncodeError(e.constructor.name);r.addIssue=n=>{"string"==typeof n?r.issues.push(e_(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),"input"in n||(n.input=r.value),n.inst??(n.inst=e),r.issues.push(e_(n)))};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r)):(r.value=i,r)}}),iZ=ex("ZodOptional",(e,t)=>{rw.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ng(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function iK(e){return new iZ({type:"optional",innerType:e})}let iH=ex("ZodExactOptional",(e,t)=>{r_.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ng(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),iV=ex("ZodNullable",(e,t)=>{rE.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,o,a;return o=rQ((i=e._zod.def).innerType,t,n),a=t.seen.get(e),void("openapi-3.0"===t.target?(a.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function iJ(e){return new iV({type:"nullable",innerType:e})}let iG=ex("ZodDefault",(e,t)=>{rS.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,o;return rQ((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,void((o=nm(i.defaultValue,e,t,r,n))!==nh&&(r.default=o))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),iY=ex("ZodPrefault",(e,t)=>{rO.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i=e._zod.def;if(rQ(i.innerType,t,n),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let o=nm(i.defaultValue,e,t,r,n);o!==nh&&(r._prefault=o)})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType}),iQ=ex("ZodNonOptional",(e,t)=>{rC.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;rQ((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),iX=ex("ZodCatch",(e,t)=>{rx.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{let i,o=e._zod.def;rQ(o.innerType,t,n),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{rY(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=i})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),i0=ex("ZodPipe",(e,t)=>{rk.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i,o,a;return o=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(rQ(a="input"===t.io?o?i.out:i.in:i.out,t,n),t.seen.get(e).ref=a)},e.in=t.in,e.out=t.out});function i1(e,t){return new i0({type:"pipe",in:e,out:t})}let i2=ex("ZodReadonly",(e,t)=>{rU.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{let i;rQ((i=e._zod.def).innerType,t,n),t.seen.get(e).ref=i.innerType,r.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),i4=ex("ZodCustom",(e,t)=>{rL.init(e,t),nV.init(e,t),e._zod.processJSONSchema=(t,r,n)=>{rY(e,t,r,n,"Custom types cannot be represented in JSON Schema")}});function i3(e,t){var r;let n;return r=e??(()=>!0),(n=ea(t)).abort??(n.abort=!0),new i4({type:"custom",check:"custom",fn:r,...n})}let i9=ex("ZodInstanceOf",(e,t)=>{i4.init(e,t)},{properties(e,t){return this.check(new tv({check:"properties",shape:e,...ea(t)}))}});function i6(e,t={}){let r=new i9({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...ea(t)});return r._zod.bag.Class=e,r._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:r,path:[...r._zod.def.path??[]]})},r}let i5="[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+",i8=`${i5}(?:\\.${i5})*`,i7="[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?",oe=`${i7}(?:\\.${i7})+`,ot=`${i8}@${oe}`;RegExp(`^${ot}$`);let or=`(${ot})( *, *${ot})*`;RegExp(`^${or}$`);let on="[a-z\\d](?:[a-z\\d]|-(?=[a-z\\d])){0,38}";RegExp(`^${on}$`,"i"),RegExp("^(?:(?:(?:https?):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z0-9\\u00a1-\\uffff][a-z0-9\\u00a1-\\uffff_-]{0,62})?[a-z0-9\\u00a1-\\uffff]\\.)+(?:[a-z\\u00a1-\\uffff]{2,}\\.?|xn--[a-z0-9]+))(?::\\d{2,5})?(?:[/?#]\\S*)?$","i"),RegExp(`^https:\\/\\/gist\\.github\\.com\\/${on}\\/[0-9a-f]{32}$`,"i");let oi={READY:"READY",RUNNING:"RUNNING",SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",TIMING_OUT:"TIMING-OUT",TIMED_OUT:"TIMED-OUT",ABORTING:"ABORTING",ABORTED:"ABORTED"},oo=[oi.SUCCEEDED,oi.FAILED,oi.TIMED_OUT,oi.ABORTED],oa={DEVELOPMENT:"DEVELOPMENT",WEB:"WEB",API:"API",SCHEDULER:"SCHEDULER",TEST:"TEST",WEBHOOK:"WEBHOOK",ACTOR:"ACTOR",CLI:"CLI",STANDBY:"STANDBY",CI:"CI",MCP:"MCP",APIFY_AI:"APIFY_AI"},os="APIFY_LOG_FORMAT",ol="ACTOR_RUN_ID",ou={ACTOR_STANDBY_PORT:"4321",ACTOR_DEFAULT_DATASET_ID:"default",ACTOR_DEFAULT_KEY_VALUE_STORE_ID:"default",ACTOR_DEFAULT_REQUEST_QUEUE_ID:"default",ACTOR_WEB_SERVER_PORT:"4321",ACTOR_WEB_SERVER_URL:"http://localhost:4321"};ou.ACTOR_WEB_SERVER_PORT,ou.ACTOR_WEB_SERVER_URL,ou.ACTOR_DEFAULT_DATASET_ID,ou.ACTOR_DEFAULT_KEY_VALUE_STORE_ID,ou.ACTOR_DEFAULT_REQUEST_QUEUE_ID;let oc={FULL_PERMISSIONS:"FULL_PERMISSIONS",LIMITED_PERMISSIONS:"LIMITED_PERMISSIONS"},op={OWNED_BY_ME:"ownedByMe",SHARED_WITH_ME:"sharedWithMe"};(E=z||(z={}))[E.OFF=0]="OFF",E[E.ERROR=1]="ERROR",E[E.SOFT_FAIL=2]="SOFT_FAIL",E[E.WARNING=3]="WARNING",E[E.INFO=4]="INFO",E[E.DEBUG=5]="DEBUG",E[E.PERF=6]="PERF";let od=z,of=Object.keys(z).filter(e=>Number.isNaN(+e));(S=N||(N={})).JSON="JSON",S.TEXT="TEXT";let oh=Symbol("apify.processed_error"),om="[TRUNCATED]",og="...[truncated]",oy=["_id","id","userId","impersonatedUserId","impersonatingUserId","adminUserId","actorId","actorTaskId","taskId","buildId","buildNumber","runId","name","message","stack","cause","url","method","code","status","statusCode","statusText","errorCode","errorMessage","errorResponse","response","request","data","payload","details","exception","config","headers"];var ob=r("z"),ov=r("q");let Logger=class Logger extends ov.EventEmitter{options;constructor(e){super(),this.options=e}setOptions(e){this.options={...this.options,...e}}getOptions(){return this.options}_outputWithConsole(e,t){switch(e){case z.ERROR:console.error(t);break;case z.WARNING:console.warn(t);break;case z.DEBUG:console.debug(t);break;default:console.log(t)}}_log(e,t,r,n,i={}){throw Error("log() method must be implemented!")}log(e,t,...r){let n=this._log(e,t,...r);this.emit("line",n)}};let ow={skipLevelInfo:!1,skipTime:!1};let logger_json_LoggerJson=class logger_json_LoggerJson extends Logger{constructor(e={}){super({...ow,...e})}_log(e,t,r,n,i={}){let{prefix:o,suffix:a}=i;n&&(r={...r,exception:n}),o&&(t=`${o}: ${t}`),a&&(t=`${t} ${a}`);let s=JSON.stringify({time:this.options.skipTime?void 0:new Date,level:this.options.skipLevelInfo&&e===z.INFO?void 0:z[e],msg:t,...r});return this._outputWithConsole(e,s),s}};var o_=r("v"),oE=r.n(o_);let oS={SOFT_FAIL:"SFAIL",WARNING:"WARN"},oR={[z.ERROR]:"red",[z.SOFT_FAIL]:"red",[z.WARNING]:"yellow",[z.INFO]:"green",[z.DEBUG]:"blue",[z.PERF]:"magenta"},oO=of.map(e=>oS[e]||e),oC=Math.max(...oO.map(e=>e.length)),oA={skipTime:!0};let LoggerText=class LoggerText extends Logger{constructor(e={}){super({...oA,...e})}_log(e,t,r,n,i={}){let{prefix:o,suffix:a}=i,s="";this.options.skipTime||(s=`${new Date().toISOString().replace("Z","").replace("T"," ")} `);let l=n?this._parseException(n):"",u=oR[e],c=oO[e],p=(e=>{let t="";for(let r=0;r<oC-e.length;r++)t+=" ";return t})(c),d=r?` ${JSON.stringify(r)}`:"";o=o?` ${o}:`:"",a=a?` ${a}`:"";let f=`${o_.gray(s)}${o_[u](c)}${p}${o_.yellow(o)} ${t||""}${o_.gray(d)}${o_.yellow(a)}${l}`;return this._outputWithConsole(e,f),f}_parseException(e,t=1){return["string","boolean","number","undefined","bigint"].includes(typeof e)?`
|
|
57
57
|
${e}`:null===e?"\nnull":"symbol"==typeof e?`
|
|
58
58
|
${e.toString()}`:"object"==typeof e&&oh in e?this._parseLoggerException(e,t):`
|
|
59
59
|
${JSON.stringify(e,null,2)}`}_parseLoggerException(e,t=1){let r=[];e.type&&r.push(`type=${e.type}`),e.details&&Object.entries(e.details).map(([e,t])=>r.push(`${e}=${t}`));let n=e.stack||e.reason||e.message,i=n===e.stack,o=function(e,t){let r,n=t.split("\n");try{({cause:r}=e)}catch{}if(null!=r&&"object"==typeof r&&oh in r){var i;let e=(i=r).stack?String(i.stack):Error.prototype.toString.call(i),t=e.indexOf("\n at");if(-1!==t){let{len:r,offset:i}=function(e,t){for(let r=0;r<e.length-3;r++){let n=t.indexOf(e[r]);if(-1!==n){let i=t.length-n;if(i>3){let o=1,a=Math.min(e.length-r,i);for(;a>o&&e[r+o]===t[n+o];)o++;if(o>3)return{len:o,offset:r}}}}return{len:0,offset:0}}(n,e.slice(t+1).split("\n"));if(r>0){let e=r-2,t=` ... ${e} lines matching cause stack trace ...`;n.splice(i+1,e,o_.grey(t))}}}return n}(e,n);i&&(o[0]=e.message||o[0]),r.length&&(o[0]+=o_.gray(`(details: ${r.join(", ")})`));for(let e=1;e<o.length;e++)o[e]=o_.gray(o[e]);if(e.cause){let r=this._parseException(e.cause,t+1).trim().split("\n");o.push(o_.red(` CAUSE: ${o_.reset(r[0])}`),...r.slice(1))}return`
|
|
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:oI}=Object,{iterator:oU,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=oI(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=oI(e);return(null===t||t===Object.prototype||null===oI(t))&&!oD(e,oL)&&!oD(e,oU)},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&&oI(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[oU]);var ad={isArray:oF,isArrayBuffer:oZ,isBuffer:oW,isFormData:e=>{if(!e)return!1;if(o4&&e instanceof o4)return!0;let t=oI(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&&oI(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[oU]).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=oI(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:oI(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[oU])},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,oU)&&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 aI(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function aU(e,t){this._pairs=[],e&&aP(e,this,t)}let aL=aU.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 aU(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,aI):aI;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:aU,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),I=null,U=P&&P.unsubscribe&&(()=>{P.unsubscribe()}),L=null,z=()=>new aC("Request body larger than maxBodyLength limit",aC.ERR_BAD_REQUEST,e,I);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,I)}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,I);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")),I=u&&new a(r,q);let W=await (u?k(I,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,I)}let K=h&&("stream"===_||"response"===_);if(h&&W.body&&(v||T||K&&U)){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,I);n&&n(t)},()=>{i&&i(),U&&U()}),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,I)}return!K&&U&&U(),await new Promise((t,r)=>{a3(t,r,{data:H,headers:AxiosHeaders.from(W.headers),status:W.status,statusText:W.statusText,config:e,request:I})})}catch(t){if(U&&U(),P&&P.aborted&&P.reason instanceof aC){let r=P.reason;throw r.config=e,I&&(r.request=I),t!==r&&Object.defineProperty(r,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),r}if(L)throw I&&!L.request&&(L.request=I),L;if(t instanceof aC)throw I&&!t.request&&(t.request=I),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){let r=new aC("Network Error",aC.ERR_NETWORK,e,I,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,I,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}`,sI=e=>ad.isFunction(e)||null===e||!1===e;var sU=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],!sI(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),sU(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=sU,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}
|
|
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.47"}'),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",lI="_bsontype";RegExp(`(.|^$|^${lk}$|^${lI}|^${lP}$)`),RegExp(".","g"),RegExp("^$"),RegExp(`^${lk}$`),RegExp(`^${lP}$`),RegExp(`^${lI}$`),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 lU=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(lU.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.49"}'),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
|
-
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=
|
|
67
|
-
Cause:${e.stack}`)}};function l3(e,t){let r=t.toLowerCase(),n=Object.keys(e).find(e=>e.toLowerCase()===r);return void 0===n?void 0:e[n]}function l9(e,t){let r={...e};for(let[e,n]of Object.entries(t??{})){for(let t of Object.keys(r))t.toLowerCase()===e.toLowerCase()&&delete r[t];r[e]=n}return r}function l6(e){return e?.split(";",1)[0].trim().toLowerCase()}function l5(e,t){return"function"==typeof t?t.toString():t}function l8(e){return!!Array.isArray(e)||"object"==typeof e&&null!==e&&!(e instanceof Date)&&!lw(e)}let AxiosHttpClient=class AxiosHttpClient extends HttpClient{axios;httpAgent;httpsAgent;#g;constructor(e={}){for(let t of(super(e),this.axios=sM.create({proxy:!1,validateStatus:null,transformRequest:[],transformResponse:[],responseType:"arraybuffer",maxBodyLength:1/0,maxContentLength:-1}),this.axios.defaults.headers=new sQ,e.requestInterceptors??[]))this.axios.interceptors.request.use(t)}isTimeoutError(e){return!!super.isTimeoutError(e)||sM.isAxiosError(e)&&(e.code===sF.ECONNABORTED||e.code===sF.ETIMEDOUT)}isRetryableTransportError(e){return!!sM.isAxiosError(e)&&"object"==typeof e.request&&null!==e.request&&null!=e.config}async close(){await this.#g?.catch(()=>{}),this.httpAgent?.destroy(),this.httpsAgent?.destroy()}async sendRequest(e){await this.#y();let{method:t,url:r,headers:n,body:i,timeoutMillis:o,stream:a,signal:s}=e,l=await this.axios.request({method:t,url:r,headers:n,data:i,timeout:o??0,signal:s,responseType:a?"stream":"arraybuffer",...lE(i)?{maxRedirects:0}:{}});return{status:l.status,headers:sQ.from(l.headers).toJSON(),body:l.data}}async #y(){return this.#g??=this.#b(),this.#g}async #b(){let e=await s3.createHttpAgents({timeoutMillis:this.timeoutMaxMillis});e&&(this.httpAgent=e.httpAgent,this.httpsAgent=e.httpsAgent,this.axios.defaults.httpAgent=this.httpAgent,this.axios.defaults.httpsAgent=this.httpsAgent)}};let ApiClient=class ApiClient{id;safeId;baseUrl;publicBaseUrl;resourcePath;url;apifyClient;httpClient;params;constructor(e){let{baseUrl:t,publicBaseUrl:r,apifyClient:n,httpClient:i,resourcePath:o,id:a,params:s={}}=e;this.id=a,this.safeId=a&&this.toSafeId(a),this.baseUrl=t,this.publicBaseUrl=r,this.resourcePath=o,this.url=a?`${t}/${o}/${lA(this.safeId)}`:`${t}/${o}`,this.apifyClient=n,this.httpClient=i,this.params=s}subResourceOptions(e){return{...{baseUrl:this.buildUrl(),publicBaseUrl:this.publicBaseUrl,apifyClient:this.apifyClient,httpClient:this.httpClient,params:this.buildParams()},...e}}buildUrl(e){return e?`${this.url}/${lT(e)}`:this.url}buildPublicUrl(e){let t=this.id?`${this.publicBaseUrl}/${this.resourcePath}/${lA(this.safeId)}`:`${this.publicBaseUrl}/${this.resourcePath}`;return e?`${t}/${lT(e)}`:t}buildParams(e){return{...this.params,...e}}toSafeId(e){return e.replaceAll("/","~")}listPaginatedFromCallback(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(e,t)=>(0===e&&(e=void 0),0===t&&(t=void 0),void 0===e)?t:void 0===t?e:Math.min(e,t),{chunkSize:n,...i}=t,o=e({...i,limit:r(t.limit,n)}),a=e=>e[lR]??e.items.length;async function*s(){let s=await o;yield*s.items;let l=t.offset??0,u=Math.min(t.limit||s.total,s.total),c=a(s),p=l+c,d=Math.min(s.total-l,u)-c;for(;c>0&&d>0;){let t={...i,limit:r(d,n),offset:p};s=await e(t),yield*s.items,p+=c=a(s),d-=c}}return Object.defineProperty(o,Symbol.asyncIterator,{value:s})}};let ResourceClient=class ResourceClient extends ApiClient{timeoutForWaitForFinish(e,t,r){if(void 0!==e)return e;if(void 0===r)return t;let n=Math.min(r,60);return n<=0?t:n+this.httpClient.timeoutMillis[t]/1e3}async getResource(e,t,r,n){let i={url:this.buildUrl(),method:"GET",params:this.buildParams(t),timeoutSecs:r,signal:n};try{let t=await this.httpClient.call(i);return lm(t,e)}catch(e){ly(e,this.id)}}async updateResource(e,t,r,n){return lm(await this.httpClient.call({url:this.buildUrl(),method:"PUT",params:this.buildParams(),data:t,timeoutSecs:r,signal:n}),e)}async deleteResource(e,t){try{await this.httpClient.call({url:this.buildUrl(),method:"DELETE",params:this.buildParams(),timeoutSecs:e,signal:t})}catch(e){ly(e,this.id)}}async waitForJobFinish(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{waitSecs:n=999999,timeoutSecs:i="noTimeout",signal:o}=r,a=1e3*n,s=Date.now(),l=()=>!(Date.now()-s>=a)&&!(t&&oo.includes(t.status));do{let r=Math.max(0,Math.round((a-(Date.now()-s))/1e3)),n={url:this.buildUrl(),method:"GET",params:this.buildParams({waitForFinish:r}),timeoutSecs:i,signal:o};try{let r=await this.httpClient.call(n);t=lm(r,e)}catch(e){lg(e),t=void 0}t||(await lx(250,o),o?.throwIfAborted())}while(l())if(!t){let e=this.constructor.name.match(/(\w+)Client/)[1].toLowerCase();throw Error(`Waiting for ${e} to finish failed. Cannot fetch actor ${e} details from the server.`)}return t}};function l7(e){return r$(nX,e)}function ue(e){return new iC({type:"date",coerce:!0,...ea(e)})}function ut(e){let t;return()=>t??=e()}let ur=ut(()=>iI({total:ib().min(0),offset:ib().min(0),limit:ib().min(1),desc:iw(),count:ib().min(0)})),un=ut(()=>iI({totalBuilds:ib().optional(),totalRuns:ib().optional(),totalUsers:ib().optional(),totalUsers7Days:ib().optional(),totalUsers30Days:ib().optional(),totalUsers90Days:ib().optional(),totalMetamorphs:ib().optional(),lastRunStartedAt:l7({offset:!0}).pipe(ue()).optional(),actorReviewCount:ib().optional(),actorReviewRating:ig().optional(),bookmarkCount:ib().optional(),publicActorRunStats30Days:iI({ABORTED:ib().optional(),FAILED:ib().optional(),SUCCEEDED:ib().optional(),"TIMED-OUT":ib().optional(),TOTAL:ib().optional()}).optional()})),ui=ut(()=>iI({id:nY(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),name:nY(),username:nY(),title:nY().optional(),stats:un().nullable().optional()})),uo=ut(()=>ur().extend({items:ix(ui())})),ua=ut(()=>iB(["SOURCE_FILES","GIT_REPO","TARBALL","GITHUB_GIST","SOURCE_CODE"]).or(nY())),us=ut(()=>iI({name:nY(),value:nY().optional(),isSecret:iw().nullable().optional()})),ul=ut(()=>iB(["BASE64","TEXT"]).or(nY())),uu=ut(()=>iI({format:ul().optional(),content:nY().optional(),name:nY()})),uc=ut(()=>iI({name:nY(),folder:iw()})),up=ut(()=>ix(iL([uu(),uc()]))),ud=ut(()=>iI({versionNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/),sourceType:ua().nullable(),envVars:ix(us()).nullable().optional(),applyEnvVarsToBuild:iw().nullable().optional(),buildTag:nY().nullable().optional(),sourceFiles:up().optional(),gitRepoUrl:nY().nullable().optional(),tarballUrl:nY().nullable().optional(),gitHubGistUrl:nY().nullable().optional()})),uf=ut(()=>iB(["LIMITED_PERMISSIONS","FULL_PERMISSIONS"]).or(nY())),uh=ut(()=>iI({build:nY().optional(),timeoutSecs:ib().optional(),memoryMbytes:ib().optional(),restartOnError:iw().optional(),maxItems:ib().nullable().optional(),forcePermissionLevel:uf().nullable().optional()})),um=ut(()=>iI({isEnabled:iw().nullable().optional(),desiredRequestsPerActorRun:ib().nullable().optional(),maxRequestsPerActorRun:ib().nullable().optional(),idleTimeoutSecs:ib().nullable().optional(),build:nY().nullable().optional(),memoryMbytes:ib().nullable().optional(),disableStandbyFieldsOverride:iw().nullable().optional(),shouldPassActorInput:iw().nullable().optional()})),ug=ut(()=>iI({body:nY().optional(),contentType:nY().optional()})),uy=ut(()=>iI({apifyMarginPercentage:ig(),createdAt:l7({offset:!0}).pipe(ue()),startedAt:l7({offset:!0}).pipe(ue()),notifiedAboutFutureChangeAt:l7({offset:!0}).pipe(ue()).nullable().optional(),notifiedAboutChangeAt:l7({offset:!0}).pipe(ue()).nullable().optional(),reasonForChange:nY().nullable().optional(),isPriceChangeNotificationSuppressed:iw().optional(),forceContainsSignificantPriceChange:iw().optional()})),ub=ut(()=>iI({tieredEventPriceUsd:ig()})),uv=ut(()=>i$(nY(),ub())),uw=ut(()=>iI({eventTitle:nY(),eventDescription:nY(),eventPriceUsd:ig().optional(),eventTieredPricingUsd:uv().optional(),isPrimaryEvent:iw().optional(),isOneTimeEvent:iw().optional()})),u_=ut(()=>uy().extend({pricingModel:iq("PAY_PER_EVENT"),pricingPerEvent:iI({actorChargeEvents:i$(nY(),uw()).optional()}),minimalMaxTotalChargeUsd:ig().nullable().optional()})),uE=ut(()=>iI({tieredPricePerUnitUsd:ig()})),uS=ut(()=>i$(nY(),uE())),uR=ut(()=>uy().extend({pricingModel:iq("PRICE_PER_DATASET_ITEM"),unitName:nY(),pricePerUnitUsd:ig().optional(),tieredPricing:uS().optional()})),uO=ut(()=>uy().extend({pricingModel:iq("FLAT_PRICE_PER_MONTH"),trialMinutes:ib(),pricePerUnitUsd:ig()})),uC=ut(()=>uy().extend({pricingModel:iq("FREE")})),uA=ut(()=>iN("pricingModel",[u_(),uR(),uO(),uC()])),uT=ut(()=>iI({buildId:nY().optional(),buildNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).nullable().optional(),buildNumberInt:ib().optional(),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional()})),ux=ut(()=>i$(nY(),uT().nullable())),uk=ut(()=>iB(["NONE","RESIDENTIAL_PROXY_REQUIRED","UNDER_MAINTENANCE"]).or(nY()).nullable()),uP=ut(()=>iI({id:nY(),userId:nY(),name:nY(),username:nY(),description:nY().nullable().optional(),restartOnError:iw().optional(),isPublic:iw(),actorPermissionLevel:uf().optional(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),stats:un(),versions:ix(ud()),pricingInfos:ix(uA()).optional(),defaultRunOptions:uh(),exampleRunInput:ug().nullable().optional(),isDeprecated:iw().nullable().optional(),deploymentKey:nY().optional(),title:nY().nullable().optional(),taggedBuilds:ux().nullable().optional(),actorStandby:um().nullable().optional(),readmeSummary:nY().optional(),seoTitle:nY().nullable().optional(),seoDescription:nY().nullable().optional(),pictureUrl:nY().nullable().optional(),standbyUrl:nY().nullable().optional(),notice:uk().optional(),categories:ix(nY()).optional(),isCritical:iw().optional(),isGeneric:iw().optional(),isSourceCodeHidden:iw().optional(),hasNoDataset:iw().optional()})),uI=ut(()=>iI({total:ib(),items:ix(ud())})),uU=ut(()=>iI({total:ib(),items:ix(us())})),uL=ut(()=>iB(["ACTOR.BUILD.ABORTED","ACTOR.BUILD.CREATED","ACTOR.BUILD.FAILED","ACTOR.BUILD.SUCCEEDED","ACTOR.BUILD.TIMED_OUT","ACTOR.RUN.ABORTED","ACTOR.RUN.CREATED","ACTOR.RUN.FAILED","ACTOR.RUN.RESURRECTED","ACTOR.RUN.SUCCEEDED","ACTOR.RUN.TIMED_OUT","TEST"]).or(nY())),uz=ut(()=>iI({actorId:nY().nullable().optional(),actorTaskId:nY().nullable().optional(),actorRunId:nY().nullable().optional()})),uN=ut(()=>iB(["ACTIVE","SUCCEEDED","FAILED"]).or(nY())),uj=ut(()=>iI({status:uN(),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),removedAt:l7({offset:!0}).pipe(ue()).nullable().optional()})),uD=ut(()=>iI({totalDispatches:ib().optional()})),u$=ut(()=>iI({id:nY(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),userId:nY(),isAdHoc:iw().nullable().optional(),isApifyIntegration:iw().optional(),isEnabled:iw().optional(),actionType:nY().optional(),shouldInterpolateStrings:iw().nullable().optional(),eventTypes:ix(uL()),condition:uz(),ignoreSslErrors:iw(),doNotRetry:iw(),requestUrl:n5({normalize:!0}),lastDispatch:uj().nullable().optional(),stats:uD().nullable().optional()})),uM=ut(()=>ur().extend({items:ix(u$())})),uB=ut(()=>iB(["READY","RUNNING","SUCCEEDED","FAILED","TIMING-OUT","TIMED-OUT","ABORTING","ABORTED"]).or(nY())),uF=ut(()=>iB(["DEVELOPMENT","WEB","API","SCHEDULER","TEST","WEBHOOK","ACTOR","CLI","CI","STANDBY","MCP"]).or(nY())),uq=ut(()=>iI({origin:uF(),clientIp:nY().optional(),userAgent:nY().optional()})),uW=ut(()=>iI({id:nY(),actId:nY().optional(),userId:nY().optional(),status:uB(),startedAt:l7({offset:!0}).pipe(ue()),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),usageTotalUsd:ig(),buildNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/),buildNumberInt:ib().optional(),meta:uq().optional()})),uZ=ut(()=>ur().extend({items:ix(uW())})),uK=ut(()=>iI({durationMillis:ib().optional(),runTimeSecs:ig().optional(),computeUnits:ig().optional(),imageSizeBytes:ib().nullable().optional()})),uH=ut(()=>iI({useCache:iw().nullable().optional(),betaPackages:iw().nullable().optional(),memoryMbytes:ib().nullable().optional(),diskMbytes:ib().nullable().optional()})),uV=ut(()=>iI({ACTOR_COMPUTE_UNITS:ig().nullable().optional()})),uJ=ut(()=>iI({actorSpecification:iq(1).optional(),name:nY().optional(),version:nY().regex(/^[0-9]+(\.[0-9]+)+$/).optional(),buildTag:nY().optional(),environmentVariables:i$(nY(),nY()).optional(),dockerfile:nY().optional(),dockerContextDir:nY().optional(),readme:nY().nullable().optional(),input:i$(nY(),iS()).nullable().optional(),changelog:nY().nullable().optional(),storages:iI({dataset:i$(nY(),iS()).optional()}).optional(),defaultMemoryMbytes:iL([nY(),ib()]).optional(),minMemoryMbytes:ib().min(128).optional(),maxMemoryMbytes:ib().min(128).optional(),usesStandbyMode:iw().optional()})),uG=ut(()=>iI({id:nY(),actId:nY(),userId:nY(),startedAt:l7({offset:!0}).pipe(ue()),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),status:uB(),meta:uq(),stats:uK().nullable().optional(),options:uH().nullable().optional(),usage:uV().nullable().optional(),usageTotalUsd:ig().nullable().optional(),usageUsd:uV().nullable().optional(),inputSchema:nY().nullable().optional(),readme:nY().nullable().optional(),buildNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/),imageDigest:nY().nullable().optional(),actVersion:iI({sourceType:ua().optional(),buildTag:nY().optional(),versionNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/).optional(),gitRepoUrl:nY().optional(),sourceFiles:ix(uu()).optional()}).optional(),actorDefinition:uJ().nullable().optional()})),uY=ut(()=>iI({origin:uF(),clientIp:nY().nullable().optional(),userAgent:nY().nullable().optional(),scheduleId:nY().nullable().optional(),scheduledAt:l7({offset:!0}).pipe(ue()).nullable().optional()})),uQ=ut(()=>iI({id:nY(),actId:nY(),userId:nY().optional(),actorTaskId:nY().nullable().optional(),status:uB(),startedAt:l7({offset:!0}).pipe(ue()),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),buildId:nY(),buildNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).optional(),buildNumberInt:ib().optional(),meta:uY(),usageTotalUsd:ig(),defaultKeyValueStoreId:nY(),defaultDatasetId:nY(),defaultRequestQueueId:nY()})),uX=ut(()=>ur().extend({items:ix(uQ())})),u0=ut(()=>iI({inputBodyLen:ib().min(0).nullable().optional(),migrationCount:ib().min(0).optional(),rebootCount:ib().min(0).optional(),restartCount:ib().min(0).optional(),resurrectCount:ib().min(0).optional(),memAvgBytes:ig().optional(),memMaxBytes:ib().min(0).optional(),memCurrentBytes:ib().min(0).optional(),cpuAvgUsage:ig().optional(),cpuMaxUsage:ig().optional(),cpuCurrentUsage:ig().optional(),netRxBytes:ib().min(0).optional(),netTxBytes:ib().min(0).optional(),durationMillis:ib().min(0).optional(),runTimeSecs:ig().min(0).optional(),metamorph:ib().min(0).optional(),computeUnits:ig().min(0).optional()})),u1=ut(()=>iI({build:nY(),timeoutSecs:ib().min(0),memoryMbytes:ib().min(128).max(32768),diskMbytes:ib().min(0),maxItems:ib().min(0).nullable().optional(),maxTotalChargeUsd:ig().min(0).nullable().optional()})),u2=ut(()=>iB(["ANYONE_WITH_ID_CAN_READ","ANYONE_WITH_NAME_CAN_READ","FOLLOW_USER_SETTING","RESTRICTED"]).or(nY())),u4=ut(()=>iI({ACTOR_COMPUTE_UNITS:ig().nullable().optional(),DATASET_READS:ib().nullable().optional(),DATASET_WRITES:ib().nullable().optional(),KEY_VALUE_STORE_READS:ib().nullable().optional(),KEY_VALUE_STORE_WRITES:ib().nullable().optional(),KEY_VALUE_STORE_LISTS:ib().nullable().optional(),REQUEST_QUEUE_READS:ib().nullable().optional(),REQUEST_QUEUE_WRITES:ib().nullable().optional(),DATA_TRANSFER_INTERNAL_GBYTES:ig().nullable().optional(),DATA_TRANSFER_EXTERNAL_GBYTES:ig().nullable().optional(),PROXY_RESIDENTIAL_TRANSFER_GBYTES:ig().nullable().optional(),PROXY_SERPS:ib().nullable().optional()})),u3=ut(()=>iI({ACTOR_COMPUTE_UNITS:ig().nullable().optional(),DATASET_READS:ig().nullable().optional(),DATASET_WRITES:ig().nullable().optional(),KEY_VALUE_STORE_READS:ig().nullable().optional(),KEY_VALUE_STORE_WRITES:ig().nullable().optional(),KEY_VALUE_STORE_LISTS:ig().nullable().optional(),REQUEST_QUEUE_READS:ig().nullable().optional(),REQUEST_QUEUE_WRITES:ig().nullable().optional(),DATA_TRANSFER_INTERNAL_GBYTES:ig().nullable().optional(),DATA_TRANSFER_EXTERNAL_GBYTES:ig().nullable().optional(),PROXY_RESIDENTIAL_TRANSFER_GBYTES:ig().nullable().optional(),PROXY_SERPS:ig().nullable().optional()})),u9=ut(()=>iI({createdAt:l7({offset:!0}).pipe(ue()),actorId:nY(),buildId:nY(),inputKey:nY().nullable().optional()})),u6=ut(()=>iI({id:nY(),actId:nY(),userId:nY(),actorTaskId:nY().nullable().optional(),startedAt:l7({offset:!0}).pipe(ue()),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),status:uB(),statusMessage:nY().nullable().optional(),isStatusMessageTerminal:iw().nullable().optional(),meta:uY(),pricingInfo:uA().optional(),stats:u0(),chargedEventCounts:i$(nY(),ib()).optional(),options:u1(),buildId:nY(),exitCode:ib().nullable().optional(),generalAccess:u2().nullable().optional(),defaultKeyValueStoreId:nY(),defaultDatasetId:nY(),defaultRequestQueueId:nY(),storageIds:iI({datasets:iI({default:nY().optional()}).catchall(nY()).optional(),keyValueStores:iI({default:nY().optional()}).catchall(nY()).optional(),requestQueues:iI({default:nY().optional()}).catchall(nY()).optional()}).optional(),buildNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).nullable().optional(),containerUrl:n5({normalize:!0}).optional(),isContainerServerReady:iw().nullable().optional(),gitBranchName:nY().nullable().optional(),usage:u4().nullable().optional(),usageTotalUsd:ig().nullable().optional(),usageUsd:u3().nullable().optional(),metamorphs:ix(u9()).nullable().optional(),platformUsageBillingModel:nY().optional()})),u5=ut(()=>iI({readCount:ib().optional(),writeCount:ib().optional(),storageBytes:ib().optional(),inflatedBytes:ib().optional()})),u8=ut(()=>iI({id:nY(),name:nY().nullable().optional(),userId:nY(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),accessedAt:l7({offset:!0}).pipe(ue()),itemCount:ib().min(0),cleanItemCount:ib().min(0),actId:nY().nullable().optional(),actRunId:nY().nullable().optional(),fields:ix(nY()).nullable().optional(),schema:i$(nY(),iS()).nullable().optional(),consoleUrl:n5({normalize:!0}),itemsPublicUrl:n5({normalize:!0}).optional(),urlSigningSecretKey:nY().nullable().optional(),generalAccess:u2().nullable().optional(),stats:u5().optional()})),u7=ut(()=>iI({min:ig().nullable().optional(),max:ig().nullable().optional(),nullCount:ib().nullable().optional(),emptyCount:ib().nullable().optional()})),ce=ut(()=>iI({fieldStatistics:i$(nY(),u7()).nullable().optional()})),ct=ut(()=>iI({readCount:ib().optional(),writeCount:ib().optional(),deleteCount:ib().optional(),listCount:ib().optional(),s3StorageBytes:ib().optional(),storageBytes:ib().optional()})),cr=ut(()=>iI({id:nY(),name:nY().nullable().optional(),userId:nY().nullable().optional(),username:nY().nullable().optional(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),accessedAt:l7({offset:!0}).pipe(ue()),actId:nY().nullable().optional(),actRunId:nY().nullable().optional(),consoleUrl:n5({normalize:!0}).optional(),keysPublicUrl:n5({normalize:!0}).optional(),recordsPublicUrl:n5({normalize:!0}).optional(),schema:i$(nY(),iS()).nullable().optional(),urlSigningSecretKey:nY().nullable().optional(),generalAccess:u2().nullable().optional(),stats:ct().optional()})),cn=ut(()=>iI({key:nY(),size:ib(),recordPublicUrl:n5({normalize:!0})})),ci=ut(()=>iI({items:ix(cn()),count:ib(),limit:ib(),exclusiveStartKey:nY().nullable().optional(),isTruncated:iw(),nextExclusiveStartKey:nY().nullable().optional()})),co=ut(()=>nY()),ca=ut(()=>nY()),cs=ut(()=>l7({offset:!0}).pipe(ue())),cl=ut(()=>l7({offset:!0}).pipe(ue())),cu=ut(()=>l7({offset:!0}).pipe(ue())),cc=ut(()=>ib().min(0)),cp=ut(()=>ib().min(0)),cd=ut(()=>ib()),cf=ut(()=>iw()),ch=ut(()=>iI({deleteCount:ib().optional(),headItemReadCount:ib().optional(),readCount:ib().optional(),storageBytes:ib().optional(),writeCount:ib().optional()})),cm=ut(()=>iI({id:co(),name:nY().nullable().optional(),userId:ca(),actId:nY().nullable().optional(),actRunId:nY().nullable().optional(),createdAt:cs(),modifiedAt:cl(),accessedAt:cu(),totalRequestCount:cc(),handledRequestCount:cp(),pendingRequestCount:cd(),hadMultipleClients:cf(),consoleUrl:n5({normalize:!0}),stats:ch().optional(),generalAccess:u2().nullable().optional()})),cg=ut(()=>nY()),cy=ut(()=>nY()),cb=ut(()=>iB(["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]).or(nY())),cv=ut(()=>cb()),cw=ut(()=>ib()),c_=ut(()=>i$(nY(),iS())),cE=ut(()=>iI({uniqueKey:cg(),url:cy(),method:cv().optional(),retryCount:cw().optional(),loadedUrl:nY().nullable().optional(),payload:iL([nY(),i$(nY(),iS())]).nullable().optional(),headers:i$(nY(),iS()).nullable().optional(),userData:c_().optional(),noRetry:iw().nullable().optional(),errorMessages:ix(nY()).nullable().optional(),handledAt:l7({offset:!0}).pipe(ue()).nullable().optional()})),cS=ut(()=>nY()),cR=ut(()=>cE().extend({id:cS().optional()}).required({id:!0})),cO=ut(()=>iI({items:ix(cR()),limit:ib(),exclusiveStartId:nY().optional(),cursor:nY().optional(),nextCursor:nY().optional()})),cC=ut(()=>iw()),cA=ut(()=>iw()),cT=ut(()=>iI({requestId:cS(),wasAlreadyPresent:cC(),wasAlreadyHandled:cA()})),cx=ut(()=>iI({requestId:cS(),uniqueKey:cg(),wasAlreadyPresent:cC(),wasAlreadyHandled:cA()})),ck=ut(()=>iI({id:cS().optional(),uniqueKey:cg(),url:cy(),method:cv().optional()})),cP=ut(()=>iI({processedRequests:ix(cx()),unprocessedRequests:ix(ck())})),cI=ut(()=>iI({uniqueKey:cg().optional(),id:cS()})),cU=ut(()=>iI({uniqueKey:cg(),id:cS().optional()})),cL=ut(()=>iL([cI(),cU()])),cz=ut(()=>iI({processedRequests:ix(cL()),unprocessedRequests:ix(ck())})),cN=ut(()=>iI({unlockedCount:ib()})),cj=ut(()=>l7({offset:!0}).pipe(ue())),cD=ut(()=>iI({lockExpiresAt:cj()})),c$=ut(()=>ib()),cM=ut(()=>iI({id:cS(),uniqueKey:cg(),url:cy(),method:cv().optional(),retryCount:cw().optional()})),cB=ut(()=>iI({limit:c$(),queueModifiedAt:cl(),hadMultipleClients:cf(),items:ix(cM())})),cF=ut(()=>iI({id:cS(),uniqueKey:cg(),url:cy(),method:cv().optional(),retryCount:cw().optional(),lockExpiresAt:cj()})),cq=ut(()=>iI({limit:c$(),queueModifiedAt:cl(),queueHasLockedRequests:iw().optional(),clientKey:nY().optional(),hadMultipleClients:cf(),lockSecs:ib(),items:ix(cF())})),cW=ut(()=>iI({totalRuns:ib().optional()})),cZ=ut(()=>iI({id:nY(),userId:nY(),actId:nY(),actName:nY().nullable().optional(),name:nY(),username:nY().nullable().optional(),actUsername:nY().nullable().optional(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),stats:cW().nullable().optional()})),cK=ut(()=>ur().extend({items:ix(cZ())})),cH=ut(()=>iI({build:nY().nullable().optional(),timeoutSecs:ib().nullable().optional(),memoryMbytes:ib().nullable().optional(),maxItems:ib().nullable().optional(),maxTotalChargeUsd:ig().nullable().optional(),restartOnError:iw().nullable().optional()})),cV=ut(()=>i$(nY(),iS())),cJ=ut(()=>iI({publishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),seoTitle:nY().max(60).nullable().optional(),seoDescription:nY().max(160).nullable().optional(),inputSchemaFields:ix(nY()).nullable().optional(),datasetName:nY().nullable().optional(),datasetView:nY().nullable().optional()})),cG=ut(()=>iI({id:nY(),userId:nY(),actId:nY(),name:nY(),username:nY().nullable().optional(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),removedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),stats:cW().nullable().optional(),options:cH().nullable().optional(),input:iL([cV(),ix(cV())]).nullable().optional(),title:nY().nullable().optional(),description:nY().nullable().optional(),actorStandby:um().nullable().optional(),standbyUrl:n5({normalize:!0}).nullable().optional(),isPublic:iw().optional(),publicConfig:cJ().nullable().optional()})),cY=ut(()=>iI({id:nY(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),userId:nY(),isAdHoc:iw().nullable().optional(),shouldInterpolateStrings:iw().nullable().optional(),eventTypes:ix(uL()),condition:uz(),ignoreSslErrors:iw(),doNotRetry:iw().nullable().optional(),requestUrl:n5({normalize:!0}).nullable().optional(),payloadTemplate:nY().nullable().optional(),headersTemplate:nY().nullable().optional(),description:nY().nullable().optional(),lastDispatch:uj().nullable().optional(),stats:uD().nullable().optional()})),cQ=ut(()=>ur().extend({unnamed:iw().optional(),items:ix(cr())})),cX=ut(()=>iI({id:nY(),name:nY(),userId:nY(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),accessedAt:l7({offset:!0}).pipe(ue()),itemCount:ib(),cleanItemCount:ib(),actId:nY().nullable().optional(),actRunId:nY().nullable().optional(),title:nY().nullable().optional(),username:nY().optional(),generalAccess:u2().nullable().optional(),stats:u5().optional()})),c0=ut(()=>ur().extend({unnamed:iw().optional(),items:ix(cX())})),c1=ut(()=>iI({id:co(),name:nY(),userId:ca(),username:nY(),createdAt:cs(),modifiedAt:cl(),accessedAt:cu(),expireAt:l7({offset:!0}).pipe(ue()).optional(),totalRequestCount:cc(),handledRequestCount:cp(),pendingRequestCount:cd(),actId:nY().nullable().optional(),actRunId:nY().nullable().optional(),hadMultipleClients:cf(),generalAccess:u2().nullable().optional(),stats:ch().optional()})),c2=ut(()=>ur().extend({unnamed:iw().optional(),items:ix(c1())})),c4=ut(()=>iI({actionType:nY().optional(),condition:uz().optional(),requestUrl:n5({normalize:!0}).nullable().optional(),isAdHoc:iw().optional()})),c3=ut(()=>iI({id:nY(),userId:nY(),webhookId:nY(),createdAt:l7({offset:!0}).pipe(ue()),status:uN(),eventType:uL(),eventData:iI({actorId:nY(),actorRunId:nY().optional(),actorBuildId:nY().optional(),actorTaskId:nY().nullable().optional()}).nullable().optional(),webhook:c4().nullable().optional(),calls:ix(iI({startedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),errorMessage:nY().nullable().optional(),responseStatus:ib().nullable().optional(),responseBody:nY().nullable().optional()})).optional()})),c9=ut(()=>ur().extend({items:ix(c3())})),c6=ut(()=>iI({id:nY(),userId:nY(),name:nY(),cronExpression:nY(),timezone:nY(),isEnabled:iw(),isExclusive:iw(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),nextRunAt:l7({offset:!0}).pipe(ue()).nullable().optional(),lastRunAt:l7({offset:!0}).pipe(ue()).nullable().optional()})),c5=ut(()=>iI({id:nY(),type:iq("RUN_ACTOR"),actorId:nY()})),c8=ut(()=>iI({id:nY(),type:iq("RUN_ACTOR_TASK"),actorTaskId:nY()})),c7=ut(()=>iN("type",[c5(),c8()])),pe=ut(()=>c6().extend({actions:ix(c7())})),pt=ut(()=>ur().extend({items:ix(pe())})),pr=ut(()=>iI({body:nY().nullable().optional(),contentType:nY().nullable().optional()})),pn=ut(()=>iI({id:nY(),type:iq("RUN_ACTOR"),actorId:nY(),runInput:pr().nullable().optional(),runOptions:cH().nullable().optional()})),pi=ut(()=>iI({id:nY(),type:iq("RUN_ACTOR_TASK"),actorTaskId:nY(),input:i$(nY(),iS()).nullable().optional()})),po=ut(()=>iN("type",[pn(),pi()])),pa=ut(()=>c6().extend({description:nY().nullable().optional(),title:nY().nullable().optional(),notifications:iI({email:iw().optional()}).optional(),actions:ix(po())})),ps=ut(()=>iI({message:nY(),level:nY(),createdAt:l7({offset:!0}).pipe(ue())})),pl=ut(()=>iI({pricingModel:nY(),apifyMarginPercentage:ig().optional(),createdAt:l7({offset:!0}).pipe(ue()).optional(),startedAt:l7({offset:!0}).pipe(ue()).optional(),notifiedAboutChangeAt:l7({offset:!0}).pipe(ue()).nullable().optional(),notifiedAboutFutureChangeAt:l7({offset:!0}).pipe(ue()).nullable().optional(),isPriceChangeNotificationSuppressed:iw().optional(),forceContainsSignificantPriceChange:iw().optional(),isPPEPlatformUsagePaidByUser:iw().optional(),reasonForChange:nY().nullable().optional(),trialMinutes:ib().nullable().optional(),unitName:nY().nullable().optional(),pricePerUnitUsd:ig().nullable().optional(),minimalMaxTotalChargeUsd:ig().nullable().optional(),pricingPerEvent:i$(nY(),iS()).nullable().optional()})),pu=ut(()=>iI({id:nY(),title:nY(),name:nY(),username:nY(),userFullName:nY().nullable().optional(),description:nY().nullable().optional(),categories:ix(nY()).optional(),notice:uk().optional(),pictureUrl:nY().nullable().optional(),userPictureUrl:n5({normalize:!0}).nullable().optional(),url:n5({normalize:!0}).nullable().optional(),stats:un(),currentPricingInfo:pl().optional(),isWhiteListedForAgenticPayments:iw().nullable().optional(),actorReviewCount:ib().optional(),actorReviewRating:ig().optional(),bookmarkCount:ib().optional(),badge:nY().nullable().optional(),readmeSummary:nY().optional()})),pc=ut(()=>ur().extend({items:ix(pu())})),pp=ut(()=>iI({bio:nY().nullable().optional(),readme:nY().nullable().optional(),name:nY().optional(),pictureUrl:n5({normalize:!0}).nullable().optional(),githubUsername:nY().nullable().optional(),websiteUrl:n5({normalize:!0}).nullable().optional(),twitterUsername:nY().nullable().optional()})),pd=ut(()=>iI({name:nY(),description:nY().nullable(),availableCount:ib()})),pf=ut(()=>iI({password:nY(),groups:ix(pd())})),ph=ut(()=>i$(nY(),ib())),pm=ut(()=>iI({id:nY().optional(),description:nY().optional(),isEnabled:iw().optional(),monthlyBasePriceUsd:ig().optional(),monthlyUsageCreditsUsd:ig().optional(),usageDiscountPercent:ig().optional(),enabledPlatformFeatures:ix(nY()).optional(),maxMonthlyUsageUsd:ig().optional(),maxActorMemoryGbytes:ig().optional(),maxMonthlyActorComputeUnits:ig().optional(),maxMonthlyResidentialProxyGbytes:ig().optional(),maxMonthlyProxySerps:ib().optional(),maxMonthlyExternalDataTransferGbytes:ig().optional(),maxActorCount:ib().optional(),maxActorTaskCount:ib().optional(),dataRetentionDays:ib().optional(),availableProxyGroups:ph(),teamAccountSeatCount:ib().optional(),supportLevel:nY().optional(),availableAddOns:ix(nY()).optional(),tier:nY().optional(),apiRateLimitBoosts:ib().optional(),maxScheduleCount:ib().optional(),maxConcurrentActorRuns:ib().optional(),planPricing:i$(nY(),iS()).optional()})),pg=ut(()=>iI({isEnabled:iw(),disabledReason:nY().nullable(),disabledReasonType:nY().nullable(),isTrial:iw(),trialExpirationAt:l7({offset:!0}).pipe(ue()).nullable()})),py=ut(()=>iI({ACTORS:pg(),STORAGE:pg(),SCHEDULER:pg(),PROXY:pg(),PROXY_EXTERNAL_ACCESS:pg(),PROXY_RESIDENTIAL:pg(),PROXY_SERPS:pg(),WEBHOOKS:pg(),ACTORS_PUBLIC_ALL:pg(),ACTORS_PUBLIC_DEVELOPER:pg()})),pb=ut(()=>iI({id:nY().optional(),username:nY(),profile:pp().optional(),email:nY().optional(),proxy:pf().optional(),plan:pm().optional(),effectivePlatformFeatures:py().optional(),createdAt:l7({offset:!0}).pipe(ue()).optional(),isPaying:iw().optional()})),pv=ut(()=>iI({startAt:l7({offset:!0}).pipe(ue()),endAt:l7({offset:!0}).pipe(ue())})),pw=ut(()=>iI({quantityAbove:ig(),discountPercent:ig(),tierQuantity:ig(),unitPriceUsd:ig(),priceUsd:ig()})),p_=ut(()=>iI({quantity:ig(),baseAmountUsd:ig(),baseUnitPriceUsd:ig().optional(),amountAfterVolumeDiscountUsd:ig().optional(),priceTiers:ix(pw()).optional()})),pE=ut(()=>i$(nY(),p_())),pS=ut(()=>i$(nY(),p_())),pR=ut(()=>iI({date:l7({offset:!0}).pipe(ue()),serviceUsage:pS(),totalUsageCreditsUsd:ig()})),pO=ut(()=>iI({usageCycle:pv(),monthlyServiceUsage:pE(),dailyServiceUsages:ix(pR()),totalUsageCreditsUsdBeforeVolumeDiscount:ig(),totalUsageCreditsUsdAfterVolumeDiscount:ig()})),pC=ut(()=>iI({maxMonthlyUsageUsd:ig(),maxMonthlyActorComputeUnits:ig(),maxMonthlyExternalDataTransferGbytes:ig(),maxMonthlyProxySerps:ib(),maxMonthlyResidentialProxyGbytes:ig(),maxActorMemoryGbytes:ig(),maxActorCount:ib(),maxActorTaskCount:ib(),maxConcurrentActorJobs:ib(),maxTeamAccountSeatCount:ib(),dataRetentionDays:ib(),maxScheduleCount:ib().optional()})),pA=ut(()=>iI({monthlyUsageUsd:ig(),monthlyActorComputeUnits:ig(),monthlyExternalDataTransferGbytes:ig(),monthlyProxySerps:ib(),monthlyResidentialProxyGbytes:ig(),actorMemoryGbytes:ig(),actorCount:ib(),actorTaskCount:ib(),activeActorJobCount:ib(),teamAccountSeatCount:ib(),scheduleCount:ib().optional()})),pT=ut(()=>iI({monthlyUsageCycle:pv(),limits:pC(),current:pA()})),px=new Set(["actor-memory-limit-exceeded","concurrent-runs-limit-exceeded"]);async function pk(e,t,r,n){if(!t)return e();let i=!0===t?1/0:Date.now()+1e3*t;for(;;)try{return await e()}catch(o){if(!(o instanceof ApifyApiError)||!px.has(o.type??""))throw o;let e=i-Date.now();if(e<=0)throw o;let t=Math.min(1e4,e);r.info(`Not enough resources to start the run, retrying in ${Number((t/1e3).toPrecision(3))}s: ${o.message}`),await lx(t,n),n?.throwIfAborted()}}let ActorEnvVarClient=class ActorEnvVarClient extends ResourceClient{constructor(e){super({resourcePath:"env-vars",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(us(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(us(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}};let ResourceCollectionClient=class ResourceCollectionClient extends ApiClient{async listResources(e,t,r,n){return lm(await this.httpClient.call({url:this.buildUrl(),method:"GET",params:this.buildParams(t),timeoutSecs:r,signal:n}),e)}listResourcesPaginated(e,t,r){let{timeoutSecs:n=r,signal:i,...o}=t;return this.listPaginatedFromCallback(async t=>this.listResources(e,t,n,i),o)}async createResource(e,t,r,n){return lm(await this.httpClient.call({url:this.buildUrl(),method:"POST",params:this.buildParams(),data:t,timeoutSecs:r,signal:n}),e)}async getOrCreateResource(e,t,r,n,i){return lm(await this.httpClient.call({url:this.buildUrl(),method:"POST",params:this.buildParams({name:t}),data:r,timeoutSecs:n,signal:i}),e)}};let pP=lf.optional();let ActorEnvVarCollectionClient=class ActorEnvVarCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"env-vars",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.listResourcesPaginated(uU(),{signal:r},t)}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pP);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(us(),e,r,n)}};var pI=((A={}).Active="ACTIVE",A.Succeeded="SUCCEEDED",A.Failed="FAILED",A),pU=((T={}).SourceFiles="SOURCE_FILES",T.GitRepo="GIT_REPO",T.Tarball="TARBALL",T.GitHubGist="GITHUB_GIST",T.SourceCode="SOURCE_CODE",T),pL=((x={}).RunActor="RUN_ACTOR",x.RunActorTask="RUN_ACTOR_TASK",x),pz=((k={}).Actors="ACTORS",k.Storage="STORAGE",k.ProxySERPS="PROXY_SERPS",k.Scheduler="SCHEDULER",k.Webhooks="WEBHOOKS",k.Proxy="PROXY",k.ProxyExternalAccess="PROXY_EXTERNAL_ACCESS",k);let pN=nY().min(1);let ActorVersionClient=class ActorVersionClient extends ResourceClient{constructor(e){super({resourcePath:"versions",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(ud(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(ud(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}envVar(e){return ln(e,pN),new ActorEnvVarClient(this.subResourceOptions({id:e}))}envVars(){return new ActorEnvVarCollectionClient(this.subResourceOptions())}};let pj=lf.optional();let ActorVersionCollectionClient=class ActorVersionCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"versions",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.listResourcesPaginated(uI(),{signal:r},t)}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pj);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(ud(),e,r,n)}};let pD=iP({raw:iw().optional(),...lG});let LogClient=class LogClient extends ResourceClient{constructor(e){super({resourcePath:"logs",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:r,...n}=ln(e,pD,"LogOptions"),i={url:this.buildUrl(),method:"GET",params:this.buildParams(n),timeoutSecs:t,signal:r};try{return(await this.httpClient.call(i)).data}catch(e){ly(e,this.id)}}async stream(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:r,raw:n}=ln(e,pD,"LogOptions"),i={url:this.buildUrl(),method:"GET",params:this.buildParams({stream:!0,raw:n}),responseType:"stream",timeoutSecs:t,signal:r};try{return(await this.httpClient.call(i)).data}catch(e){ly(e,this.id)}}};let LoggerActorRedirect=class LoggerActorRedirect extends Logger{constructor(e={}){super({skipTime:!0,level:z.DEBUG,...e})}_log(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(e>this.options.level)return;if(r||n)throw Error("Redirect logger does not use other arguments than level and message");let{prefix:o}=i;o=o?`${o}`:"";let a="";this.options.skipTime||(a=`${new Date().toISOString().replace("Z","").replace("T"," ")} `);let s=`${oE().gray(a)}${oE().cyan(o)}${t||""}`;return this._outputWithConsole(z.INFO,s),s}};let StreamedLog=class StreamedLog{#v;#w=[];#_=new TextDecoder;#E=/(?:\n|^)(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)/g;#S;#R;#O;#C=null;#A=!1;constructor(e){let{toLog:t,logClient:r,fromStart:n=!0,signal:i}=e;this.#v=t,this.#R=r,this.#O=i,this.#S=n?null:new Date}start(){if(this.#C)throw Error("Streaming task already active");this.#A=!1,this.#C=this.#T()}async stop(){if(!this.#C)throw Error("Streaming task is not active");this.#A=!0;try{await this.#C}catch(e){if(!(e instanceof Error&&"AbortError"===e.name))throw e}finally{this.#C=null}}async #T(){try{let e=await this.#R.stream({raw:!0,signal:this.#O});if(!e)return;let t=await this.#x(e),r=this.#_.decode(t).trim();r.length&&this.#v.info(r)}catch(e){if(this.#O?.aborted)return;oT.warning("Log redirection stopped due to error",e)}}async #x(e){let t=new Uint8Array;for await(let r of e){let e=new Uint8Array(t.length+r.length);e.set(t,0),e.set(r,t.length);let n=e.lastIndexOf(10);if(t=e.slice(n),this.#w.push(e.slice(0,n)),this.#k(),this.#A)break}return t}#k(){let e=this.#_.decode(function(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(this.#w)).split(this.#E).slice(1),t=e.filter((e,t)=>t%2==0),r=e.filter((e,t)=>t%2!=0);this.#w=[],t.forEach((e,t)=>{let n=r[t];this.#S&&new Date(e)<this.#S||this.#v.info((e+n).trim())})}};let p$=iP({waitForFinish:ig().optional(),...lG}),pM=iP({waitSecs:ig().optional(),...lG});let BuildClient=class BuildClient extends ResourceClient{constructor(e){super({resourcePath:"actor-builds",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r,...n}=ln(e,p$,"BuildClientGetOptions");return this.getResource(uG(),n,this.timeoutForWaitForFinish(t,"short",n.waitForFinish),r)}async abort(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("abort"),method:"POST",params:this.buildParams(),timeoutSecs:t,signal:r}),uG())}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async getOpenApiDefinition(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r}=ln(e,lY,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("openapi.json"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r})).data}async waitForFinish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,pM,"BuildClientWaitForFinishOptions");return this.waitForJobFinish(uG(),t)}log(){return new LogClient(this.subResourceOptions({resourcePath:"log"}))}};let pB=iP({...lS,desc:iw().optional(),...lG});let BuildCollectionClient=class BuildCollectionClient extends ResourceCollectionClient{constructor(e){super({...e,resourcePath:e.resourcePath||"actor-builds"})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,pB,"BuildCollectionClientListOptions");return this.listResourcesPaginated(uZ(),t,"medium")}};var pF=((P={}).JSON="json",P.JSONL="jsonl",P.XML="xml",P.HTML="html",P.CSV="csv",P.XLSX="xlsx",P.RSS="rss",P);let pq=iB(pF),pW=i3(ld,"Expected an object"),pZ=iP({clean:iw().optional(),desc:iw().optional(),flatten:ix(nY()).optional(),fields:ix(nY()).optional(),omit:ix(nY()).optional(),...lS,skipEmpty:iw().optional(),skipHidden:iw().optional(),unwind:iL([nY(),ix(nY())]).optional(),view:nY().optional(),signature:nY().optional(),...lG}),pK=iP({attachment:iw().optional(),bom:iw().optional(),clean:iw().optional(),delimiter:nY().optional(),desc:iw().optional(),flatten:ix(nY()).optional(),fields:ix(nY()).optional(),omit:ix(nY()).optional(),limit:ig().min(0).optional(),offset:ig().min(0).optional(),skipEmpty:iw().optional(),skipHeaderRow:iw().optional(),skipHidden:iw().optional(),unwind:iL([nY(),ix(nY())]).optional(),view:nY().optional(),xmlRoot:nY().optional(),xmlRow:nY().optional(),signature:nY().optional(),...lG}),pH=iL([pW,nY(),ix(pW)]),pV=iP({clean:iw().optional(),desc:iw().optional(),flatten:ix(nY()).optional(),fields:ix(nY()).optional(),format:pq.optional(),omit:ix(nY()).optional(),limit:ig().min(0).optional(),offset:ig().min(0).optional(),skipEmpty:iw().optional(),skipHidden:iw().optional(),unwind:iL([nY(),ix(nY())]).optional(),view:nY().optional(),expiresInSecs:ig().optional(),...lG});let DatasetClient=class DatasetClient extends ResourceClient{constructor(e){super({resourcePath:"datasets",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(u8(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(u8(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}listItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{timeoutSecs:r="long",signal:n,...i}=ln(e,pZ,"DatasetClientListItemOptions"),o=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=await t.httpClient.call({url:t.buildUrl("items"),method:"GET",params:t.buildParams(e),timeoutSecs:r,signal:n});return t.#P(i,e.desc??!1)};return this.listPaginatedFromCallback(o,i)}async downloadItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pq);let{timeoutSecs:r="long",signal:n,...i}=ln(t,pK,"DatasetClientDownloadItemsOptions"),{data:o}=await this.httpClient.call({url:this.buildUrl("items"),method:"GET",params:this.buildParams({format:e,...i}),responseType:"buffer",timeoutSecs:r,signal:n});return o}async pushItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pH);let{timeoutSecs:r="medium",signal:n}=ln(t,lY,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl("items"),method:"POST",headers:{"content-type":"application/json; charset=utf-8"},data:e,params:this.buildParams(),doNotRetryTimeouts:!0,timeoutSecs:r,signal:n})}async getStatistics(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("statistics"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r}),ce())}async createItemsPublicUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:r,expiresInSecs:n,...i}=ln(e,pV,"DatasetClientCreateItemsUrlOptions"),o=await this.get({timeoutSecs:t,signal:r}),a=new URL(this.buildPublicUrl("items"));if(o?.urlSigningSecretKey){let e=await lD({resourceId:o.id,urlSigningSecretKey:o.urlSigningSecretKey,expiresInMillis:n?1e3*n:void 0});a.searchParams.set("signature",e)}return(a=lO(a,i)).toString()}#P(e,t){let r=e.headers["x-apify-pagination-desc"],n={items:e.data,total:Number(e.headers["x-apify-pagination-total"]),offset:Number(e.headers["x-apify-pagination-offset"]),count:e.data.length,limit:Number(e.headers["x-apify-pagination-limit"]),desc:"string"==typeof r?JSON.parse(r):t},i=e.headers["x-apify-pagination-count"];return void 0===i?n:Object.defineProperty(n,lR,{value:Number(i)})}};let pJ=iP({limit:ig().min(0).optional(),exclusiveStartKey:nY().optional(),collection:nY().optional(),prefix:nY().optional(),signature:nY().optional(),...lG}),pG=nY().min(1),pY=iP({limit:ig().min(0).optional(),exclusiveStartKey:nY().optional(),collection:nY().optional(),prefix:nY().optional(),expiresInSecs:ig().optional(),...lG}),pQ=nY(),pX=iP({buffer:iw().optional(),stream:iw().optional(),disableRedirect:iw().optional(),signature:nY().optional(),...lG}),p0=iP({key:nY(),value:i3(e=>void 0!==e&&"symbol"!=typeof e&&"bigint"!=typeof e&&"function"!=typeof e&&("number"!=typeof e||Number.isFinite(e)),"Expected a JSON-serializable value, binary data, or a stream"),contentType:nY().min(1).optional()}),p1=iP({...lG,doNotRetryTimeouts:iw().optional()});let KeyValueStoreClient=class KeyValueStoreClient extends ResourceClient{constructor(e){super({resourcePath:"key-value-stores",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(cr(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="long",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(cr(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}listKeys(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{timeoutSecs:r="medium",signal:n,...i}=ln(e,pJ,"KeyValueClientListKeysOptions"),o=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lm(await t.httpClient.call({url:t.buildUrl("keys"),method:"GET",params:t.buildParams(e),timeoutSecs:r,signal:n}),ci())},a=o(i);async function*s(){let e=await a;yield*e.items;let t=i.limit?i.limit-e.items.length:void 0;for(;e.items.length>0&&null!=e.nextExclusiveStartKey&&(void 0===t||t>0);){let r={...i,limit:t,exclusiveStartKey:e.nextExclusiveStartKey};e=await o(r),yield*e.items,t&&(t-=e.items.length)}}return Object.defineProperty(a,Symbol.asyncIterator,{value:s})}async getRecordPublicUrl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pG);let{timeoutSecs:r="long",signal:n}=ln(t,lY,"TimeoutOptions"),i=await this.get({timeoutSecs:r,signal:n}),o=new URL(this.buildPublicUrl(["records",e]));if(i?.urlSigningSecretKey){let t=await lj(i.urlSigningSecretKey,e);o.searchParams.append("signature",t)}return o.toString()}async createKeysPublicUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:r,expiresInSecs:n,...i}=ln(e,pY,"KeyValueClientCreateKeysUrlOptions"),o=await this.get({timeoutSecs:t,signal:r}),a=new URL(this.buildPublicUrl("keys"));if(o?.urlSigningSecretKey){let e=await lD({resourceId:o.id,urlSigningSecretKey:o.urlSigningSecretKey,expiresInMillis:n?1e3*n:void 0});a.searchParams.set("signature",e)}return(a=lO(a,i)).toString()}async recordExists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:r="long",signal:n}=ln(t,lY,"TimeoutOptions"),i={url:this.buildUrl(["records",e]),method:"HEAD",params:this.buildParams(),timeoutSecs:r,signal:n};try{return await this.httpClient.call(i),!0}catch(e){lg(e)}return!1}async getRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pQ);let r=ln(t,pX,"KeyValueClientGetRecordOptions");if(r.stream&&!s3.isNode)throw Error("The stream option can only be used in Node.js environment.");"disableRedirect"in r&&oT.deprecated("The disableRedirect option for getRecord() is deprecated. It has no effect and will be removed in the following major release.");let n={attachment:"true"};r.signature&&(n.signature=r.signature);let i={url:this.buildUrl(["records",e]),method:"GET",params:this.buildParams(n),timeoutSecs:r.timeoutSecs??"long",signal:r.signal};r.buffer&&(i.responseType="buffer"),r.stream&&(i.responseType="stream");try{let t=await this.httpClient.call(i);return{key:e,value:t.data,contentType:t.headers["content-type"]}}catch(e){lg(e)}}async setRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,p0);let r=ln(t,p1,"KeyValueStoreRecordOptions"),{key:n}=e,{value:i,contentType:o}=e,{timeoutSecs:a="long",signal:s,doNotRetryTimeouts:l}=r,u=lE(i)||lw(i);if(o||(o=u?"application/octet-stream":"string"==typeof i?"text/plain; charset=utf-8":"application/json; charset=utf-8"),o.startsWith("application/json")&&!u&&"string"!=typeof i)try{i=JSON.stringify(i,null,2)}catch(e){throw Error(`The record value cannot be stringified to JSON. Please provide other content type.
|
|
68
|
-
Cause: ${e.message}`)}let c={url:this.buildUrl(["records",n]),method:"PUT",params:this.buildParams(),data:i,headers:o?{"content-type":o}:void 0,doNotRetryTimeouts:l,timeoutSecs:a,signal:s};await this.httpClient.call(c)}async deleteRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pQ);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl(["records",e]),method:"DELETE",params:this.buildParams(),timeoutSecs:r,signal:n})}};let p2=iP({limit:ig().min(0).optional(),...lG}),p4=iP({lockSecs:ig(),limit:ig().min(0).optional(),...lG}),p3=i3(e=>ld(e)&&void 0===e.id,"Expected a request object without an `id`"),p9=iP({forefront:iw().optional(),...lG}),p6=ix(p3).min(1),p5=iw().optional(),p8=ig().optional(),p7=ix(i3(e=>ld(e)&&("string"==typeof e.id||"string"==typeof e.uniqueKey),"Expected a request object with an `id` or a `uniqueKey`")).min(1).max(25),de=nY(),dt=i3(e=>ld(e)&&"string"==typeof e.id,"Expected a request object with an `id`"),dr=iP({lockSecs:ig(),forefront:iw().optional(),...lG}),dn=ix(iB(["locked","pending"])).min(1),di=iP({limit:ig().min(0).optional(),cursor:nY().optional(),filter:dn.optional(),...lG}),da=iP({limit:ig().min(0).optional(),maxPageLimit:ig().default(1e3),cursor:nY().optional(),filter:dn.optional(),...lG});let RequestQueueClient=class RequestQueueClient extends ResourceClient{#I;#U;constructor(e,t={}){super({resourcePath:"request-queues",...e}),this.#I=t.clientKey,this.#U=t.timeoutSecs}#L(e,t){return void 0!==e?e:void 0===this.#U||this.httpClient.timeoutMillis[t]/1e3<=this.#U?t:this.#U}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(cm(),{},this.#L(t,"short"),r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r,signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(cm(),e,this.#L(r,"short"),n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(this.#L(t,"short"),r)}async listHead(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,p2,"RequestQueueClientListHeadOptions");return lm(await this.httpClient.call({url:this.buildUrl("head"),method:"GET",timeoutSecs:this.#L(t.timeoutSecs,"short"),signal:t.signal,params:this.buildParams({limit:t.limit,clientKey:this.#I})}),cB())}async listAndLockHead(e){let t=ln(e,p4,"RequestQueueClientListAndLockHeadOptions");return lm(await this.httpClient.call({url:this.buildUrl("head/lock"),method:"POST",timeoutSecs:this.#L(t.timeoutSecs,"medium"),signal:t.signal,params:this.buildParams({limit:t.limit,lockSecs:t.lockSecs,clientKey:this.#I})}),cq())}async addRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,p3);let r=ln(t,p9,"RequestQueueClientAddRequestOptions");return lm(await this.httpClient.call({url:this.buildUrl("requests"),method:"POST",timeoutSecs:this.#L(r.timeoutSecs,"short"),signal:r.signal,data:e,params:this.buildParams({forefront:r.forefront,clientKey:this.#I})}),cT())}async addRequestBatch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ln(t,p9,"RequestQueueClientAddRequestOptions");return lm(await this.httpClient.call({url:this.buildUrl("requests/batch"),method:"POST",timeoutSecs:this.#L(r.timeoutSecs,"medium"),signal:r.signal,headers:{"content-type":"application/json"},data:`[${e.map(e=>{let{json:t}=e;return t}).join(",")}]`,params:this.buildParams({forefront:r.forefront,clientKey:this.#I})}),cP())}async addRequestBatchWithRetries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{forefront:r,timeoutSecs:n,signal:i,maxUnprocessedRequestsRetries:o=3,minDelayBetweenUnprocessedRequestsRetriesMillis:a=500}=t,s=e,l=[],u=[];for(let t=0;t<1+o;t++){try{let o=await this.addRequestBatch(s,{forefront:r,timeoutSecs:n,signal:i});l.push(...o.processedRequests),u=o.unprocessedRequests,0!==u.length&&this.httpClient.stats.addRateLimitError(t+1);let a=l.map(e=>{let{uniqueKey:t}=e;return t});if(s=e.filter(e=>{let{request:t}=e;return!a.includes(t.uniqueKey)}),0===s.length)break}catch(r){if(i?.throwIfAborted(),r instanceof ResponseValidationError)throw r;oT.exception(r,"Request batch insert failed");let t=l.map(e=>{let{uniqueKey:t}=e;return t});u=e.filter(e=>{let{request:r}=e;return!t.includes(r.uniqueKey)}).map(e=>{let{request:{method:t,uniqueKey:r,url:n}}=e;return{method:t,uniqueKey:r,url:n}});break}let o=Math.floor((1+Math.random())*2**t*a);await lx(o,i),i?.throwIfAborted()}return{processedRequests:l,unprocessedRequests:u}}async batchAddRequests(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{forefront:r,timeoutSecs:n,signal:i,maxUnprocessedRequestsRetries:o=3,maxParallel:a=5,minDelayBetweenUnprocessedRequestsRetriesMillis:s=500}=t;ln(e,p6),ln(r,p5),ln(n,lV),ln(i,lJ),ln(o,p8),ln(a,p8),ln(s,p8);let l=new Set,u=[],c=9437184-Math.ceil(9437184*1e-4);for(let r of function(e,t){let{maxCount:r,maxByteLength:n}=t,i=[],o=[],a=1;for(let t of e)o.length>0&&(o.length>=r||a+t.byteLength+1>n)&&(i.push(o),o=[],a=1),o.push(t),a+=t.byteLength+1;return o.length>0&&i.push(o),i}(e.map((e,t)=>{let r=JSON.stringify(e),n=la.encode(r).byteLength;if(n+2>c)throw Error(`RequestQueueClient.batchAddRequests: The size of the request with index: ${t} exceeds the maximum allowed size (${c} bytes).`);return{request:e,json:r,byteLength:n}}),{maxCount:25,maxByteLength:c})){let e=this.addRequestBatchWithRetries(r,t);l.add(e),e.then(t=>{l.delete(e),u.push(t)},()=>void 0),l.size>=a&&await Promise.race(l)}await Promise.all(l);let p={processedRequests:[],unprocessedRequests:[]};return u.forEach(e=>{let{processedRequests:t,unprocessedRequests:r}=e;p.processedRequests.push(...t),p.unprocessedRequests.push(...r)}),p}async batchDeleteRequests(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,p7);let{timeoutSecs:r,signal:n}=ln(t,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("requests/batch"),method:"DELETE",timeoutSecs:this.#L(r,"short"),signal:n,data:e,params:this.buildParams({clientKey:this.#I})}),cz())}async getRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,de);let{timeoutSecs:r,signal:n}=ln(t,lY,"TimeoutOptions"),i={url:this.buildUrl(["requests",e]),method:"GET",timeoutSecs:this.#L(r,"short"),signal:n,params:this.buildParams()};try{let e=await this.httpClient.call(i);return lm(e,cR())}catch(e){lg(e)}}async updateRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dt);let r=ln(t,p9,"RequestQueueClientAddRequestOptions");return lm(await this.httpClient.call({url:this.buildUrl(["requests",e.id]),method:"PUT",timeoutSecs:this.#L(r.timeoutSecs,"medium"),signal:r.signal,data:e,params:this.buildParams({forefront:r.forefront,clientKey:this.#I})}),cT())}async deleteRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,de);let{timeoutSecs:r,signal:n}=ln(t,lY,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl(["requests",e]),method:"DELETE",timeoutSecs:this.#L(r,"short"),signal:n,params:this.buildParams({clientKey:this.#I})})}async prolongRequestLock(e,t){ln(e,de);let r=ln(t,dr,"RequestQueueClientProlongRequestLockOptions");return lm(await this.httpClient.call({url:this.buildUrl(["requests",e,"lock"]),method:"PUT",timeoutSecs:this.#L(r.timeoutSecs,"medium"),signal:r.signal,params:this.buildParams({forefront:r.forefront,lockSecs:r.lockSecs,clientKey:this.#I})}),cD())}async deleteRequestLock(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,de);let r=ln(t,p9,"RequestQueueClientDeleteRequestLockOptions");await this.httpClient.call({url:this.buildUrl(["requests",e,"lock"]),method:"DELETE",timeoutSecs:this.#L(r.timeoutSecs,"short"),signal:r.signal,params:this.buildParams({forefront:r.forefront,clientKey:this.#I})})}listRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{timeoutSecs:r,signal:n,...i}=ln(e,di,"RequestQueueClientListRequestsOptions"),o=this.#L(r,"medium"),a=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lm(await t.httpClient.call({url:t.buildUrl("requests"),method:"GET",timeoutSecs:o,signal:n,params:t.buildParams({...e,filter:e.filter?e.filter.join(","):void 0,clientKey:t.#I})}),cO())},s=a(i);async function*l(){let e=await s;yield*e.items;let t=i.limit?i.limit-e.items.length:void 0;for(;e.items.length>0&&e.nextCursor&&(void 0===t||t>0);){let r={...i,limit:t,cursor:e.nextCursor};e=await a(r),yield*e.items,t&&(t-=e.items.length)}}return Object.defineProperty(s,Symbol.asyncIterator,{value:l})}async unlockRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("requests/unlock"),method:"POST",timeoutSecs:this.#L(t,"long"),signal:r,params:this.buildParams({clientKey:this.#I})}),cN())}paginateRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{limit:t,cursor:r,filter:n,maxPageLimit:i,timeoutSecs:o,signal:a}=ln(e,da,"RequestQueueClientPaginateRequestsOptions");return new RequestQueuePaginationIterator({getPage:async e=>this.listRequests({...e,filter:n,timeoutSecs:o,signal:a}),limit:t,cursor:r,maxPageLimit:i})}};let ds=iP({waitForFinish:ig().optional(),...lG}),dl=iP({gracefully:iw().optional(),...lG}),du=nY(),dc=iP({contentType:nY().optional(),build:nY().optional(),...lG}),dp=iP({build:nY().optional(),memory:ig().optional(),runTimeoutSecs:ig().optional(),maxItems:ig().optional(),maxTotalChargeUsd:ig().optional(),restartOnError:iw().optional(),...lG}),dd=iP({eventName:nY(),count:ig().default(1),idempotencyKey:nY().optional(),...lG}),df=iP({waitSecs:ig().optional(),...lG}),dh=iP({clean:iw().optional(),fields:ix(nY()).optional(),omit:ix(nY()).optional(),...lS,skipEmpty:iw().optional(),skipHidden:iw().optional(),unwind:ix(nY()).optional(),pollIntervalSecs:ig().min(0).optional(),...lG});let RunClient=class RunClient extends ResourceClient{constructor(e){super({...e,resourcePath:e.resourcePath||"actor-runs"})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r,...n}=ln(e,ds,"RunGetOptions");return this.getResource(u6(),n,this.timeoutForWaitForFinish(t,"short",n.waitForFinish),r)}async abort(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r,...n}=ln(e,dl,"RunAbortOptions");return lm(await this.httpClient.call({url:this.buildUrl("abort"),method:"POST",params:this.buildParams(n),timeoutSecs:t,signal:r}),u6())}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async metamorph(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ln(e,du);let n=ln(r,dc,"RunMetamorphOptions"),i={targetActorId:this.toSafeId(e),build:n.build},o={url:this.buildUrl("metamorph"),method:"POST",data:t,params:this.buildParams(i),stringifyFunctions:!0,timeoutSecs:n.timeoutSecs??"medium",signal:n.signal};return n.contentType&&(o.headers={"content-type":n.contentType}),lm(await this.httpClient.call(o),u6())}async reboot(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r}=ln(e,lY,"TimeoutOptions"),n={url:this.buildUrl("reboot"),method:"POST",timeoutSecs:t,signal:r};return lm(await this.httpClient.call(n),u6())}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(u6(),e,r,n)}async resurrect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r,runTimeoutSecs:n,...i}=ln(e,dp,"RunResurrectOptions");return lm(await this.httpClient.call({url:this.buildUrl("resurrect"),method:"POST",params:this.buildParams({...i,timeout:n}),timeoutSecs:t,signal:r}),u6())}async charge(e){let{eventName:t,count:r,idempotencyKey:n,timeoutSecs:i="short",signal:o}=ln(e,dd,"RunChargeOptions"),a=(Math.random()+1).toString(36).slice(3,8),s=n??`${this.id}-${t}-${Date.now()}-${a}`,l={url:this.buildUrl("charge"),method:"POST",data:{eventName:t,count:r},headers:{"idempotency-key":s},timeoutSecs:i,signal:o};return await this.httpClient.call(l)}async waitForFinish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,df,"RunWaitForFinishOptions");return this.waitForJobFinish(u6(),t)}dataset(){return new DatasetClient(this.subResourceOptions({resourcePath:"dataset"}))}keyValueStore(){return new KeyValueStoreClient(this.subResourceOptions({resourcePath:"key-value-store"}))}requestQueue(){return new RequestQueueClient(this.subResourceOptions({resourcePath:"request-queue"}))}log(){return new LogClient(this.subResourceOptions({resourcePath:"log"}))}async getStreamedLog(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ln(e.timeoutSecs,lV),ln(e.signal,lJ);let{fromStart:t=!0,timeoutSecs:r="long",signal:n}=e,{toLog:i}=e;if(null!==i&&s3.isNode){if(void 0===i||"default"===i){let e=await this.get({timeoutSecs:r,signal:n}),t=e?.id??"",o=e?.actId??"",a=o?await this.apifyClient.actor(o).get({timeoutSecs:r,signal:n}):void 0,s=[a?.name??"",`runId:${t}`].filter(Boolean).join(" ");i=new Log({level:od.DEBUG,prefix:`${s} -> `,logger:new LoggerActorRedirect})}return new StreamedLog({logClient:this.log(),toLog:i,fromStart:t,signal:n})}}async *iterateDatasetItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{offset:t,limit:r,chunkSize:n,pollIntervalSecs:i=5,timeoutSecs:o="long",signal:a,...s}=ln(e,dh,"RunIterateDatasetItemsOptions"),l=n||1e3,u=t??0,c=r?u+r:void 0,p=await this.get({timeoutSecs:o,signal:a}),d=p&&p.id!==this.id?this.apifyClient.run(p.id):this,f=d.dataset(),h=async(e,t)=>f.listItems({...s,offset:e,limit:t,timeoutSecs:o,signal:a});for(;;){let e=!p||oo.includes(p.status),t=await f.get({timeoutSecs:o,signal:a}),r=t?.itemCount??0;for(void 0!==c&&(r=Math.min(r,c));u<r;){let e=Math.min(l,r-u),t=await h(u,e);yield*t.items,u+=e}if(void 0!==c&&u>=c)return;if(e)break;p=await d.waitForFinish({waitSecs:i,timeoutSecs:o,signal:a})}let{clean:m,skipEmpty:g,unwind:y}=s;for(;;){let e=void 0!==c?Math.min(l,c-u):l,t=await h(u,e);if(yield*t.items,0===t.items.length&&!t[lR]&&(!(m||g||y?.length)||0===(await f.listItems({offset:u,limit:1,timeoutSecs:o,signal:a})).items.length)||(u+=e,void 0!==c&&u>=c))return}}};let dm=iB(oi),dg=iP({...lS,desc:iw().optional(),status:iL([dm,ix(dm)]).optional(),startedBefore:iL([iA(),nY()]).optional(),startedAfter:iL([iA(),nY()]).optional(),...lG});let RunCollectionClient=class RunCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"runs",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dg,"RunCollectionListOptions");return this.listResourcesPaginated(uX(),t,"medium")}};let dy=iP({...lS,desc:iw().optional(),...lG}),db=lf.optional();let WebhookCollectionClient=class WebhookCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"webhooks",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dy,"WebhookCollectionListOptions");return this.listResourcesPaginated(uM(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,db);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(cY(),e,r,n)}};let dv=iP({build:nY().optional(),contentType:nY().optional(),memory:ig().optional(),runTimeoutSecs:ig().min(0).optional(),waitForFinish:ig().optional(),webhooks:ix(lf).optional(),maxItems:ig().min(0).optional(),maxTotalChargeUsd:ig().min(0).optional(),restartOnError:iw().optional(),forcePermissionLevel:iB(oc).optional(),waitForResources:iL([iw(),ig().min(0)]).optional(),...lG}),dw=iP({build:nY().optional(),contentType:nY().optional(),memory:ig().optional(),runTimeoutSecs:ig().min(0).optional(),waitSecs:ig().min(0).optional(),webhooks:ix(lf).optional(),maxItems:ig().min(0).optional(),maxTotalChargeUsd:ig().min(0).optional(),log:iL([new i_({type:"null",...ea(void 0)}),i6(Log),iq("default")]).optional(),restartOnError:iw().optional(),forcePermissionLevel:iB(oc).optional(),waitForResources:iL([iw(),ig().min(0)]).optional(),...lG}),d_=iP({build:nY().optional(),contentType:nY().optional(),...lG}),dE=nY().min(1),dS=iP({betaPackages:iw().optional(),tag:nY().optional(),useCache:iw().optional(),waitForFinish:ig().optional(),...lG}),dR=iP({waitForFinish:ig().optional(),...lG}),dO=iP({status:iB(oi).optional(),origin:iB(oa).optional()});let ActorClient=class ActorClient extends ResourceClient{constructor(e){super({resourcePath:"actors",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(uP(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(uP(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async start(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ln(t,dv,"ActorStartOptions"),{waitForFinish:n,runTimeoutSecs:i,memory:o,build:a,maxItems:s,maxTotalChargeUsd:l,restartOnError:u,forcePermissionLevel:c,waitForResources:p,timeoutSecs:d,signal:f}=r,h={waitForFinish:n,timeout:i,memory:o,build:a,webhooks:lb(r.webhooks),maxItems:s,maxTotalChargeUsd:l,restartOnError:u,forcePermissionLevel:c},m={url:this.buildUrl("runs"),method:"POST",data:e,params:this.buildParams(h),stringifyFunctions:!0,timeoutSecs:this.timeoutForWaitForFinish(d,"medium",n),signal:f};return r.contentType&&(m.headers={"content-type":r.contentType}),lm(await pk(async()=>this.httpClient.call(m),!lE(e)&&p,this.httpClient.logger,f),u6())}async call(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{waitSecs:r,log:n,timeoutSecs:i="noTimeout",signal:o,...a}=ln(t,dw,"ActorCallOptions"),{id:s}=await this.start(e,{...a,timeoutSecs:i,signal:o}),l=this.apifyClient.run(s),u=await l.getStreamedLog({toLog:n,signal:o});return u?.start(),this.apifyClient.run(s).waitForFinish({waitSecs:r,timeoutSecs:i,signal:o}).finally(async()=>{await u?.stop()})}async validateInput(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ln(t,d_,"ActorValidateInputOptions"),n={url:this.buildUrl("validate-input"),method:"POST",data:e,params:this.buildParams({build:r.build}),stringifyFunctions:!0,timeoutSecs:r.timeoutSecs??"short",signal:r.signal};return r.contentType&&(n.headers={"content-type":r.contentType}),(await this.httpClient.call(n)).data.valid}async build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dE);let{timeoutSecs:r,signal:n,...i}=ln(t,dS,"ActorBuildOptions");return lm(await this.httpClient.call({url:this.buildUrl("builds"),method:"POST",params:this.buildParams({version:e,...i}),timeoutSecs:this.timeoutForWaitForFinish(r,"medium",i.waitForFinish),signal:n}),uG())}async defaultBuild(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r,...n}=ln(e,dR,"BuildClientGetOptions"),{id:i}=lm(await this.httpClient.call({url:this.buildUrl("builds/default"),method:"GET",params:this.buildParams(n),timeoutSecs:this.timeoutForWaitForFinish(t,"short",n.waitForFinish),signal:r}),uG());return new BuildClient({baseUrl:this.apifyClient.baseUrl,publicBaseUrl:this.apifyClient.publicBaseUrl,httpClient:this.httpClient,apifyClient:this.apifyClient,id:i})}lastRun(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dO,"ActorLastRunOptions");return new RunClient(this.subResourceOptions({id:"last",params:this.buildParams(t),resourcePath:"runs"}))}builds(){return new BuildCollectionClient(this.subResourceOptions({resourcePath:"builds"}))}runs(){return new RunCollectionClient(this.subResourceOptions({resourcePath:"runs"}))}version(e){return ln(e,dE),new ActorVersionClient(this.subResourceOptions({id:e}))}versions(){return new ActorVersionCollectionClient(this.subResourceOptions())}webhooks(){return new WebhookCollectionClient(this.subResourceOptions())}};let dC=lf.optional();let ActorCollectionClient=class ActorCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"actors",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dT,"ActorCollectionListOptions");return this.listResourcesPaginated(uo(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dC);let{timeoutSecs:r="medium",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(uP(),e,r,n)}};var dA=((I={}).CREATED_AT="createdAt",I.LAST_RUN_STARTED_AT="stats.lastRunStartedAt",I);let dT=iP({my:iw().optional(),...lS,desc:iw().optional(),sortBy:iB(dA).optional(),...lG}),dx=iP({unnamed:iw().optional(),...lS,desc:iw().optional(),ownership:iB(op).optional(),...lG}),dk=nY().optional(),dP=lf.optional();let DatasetCollectionClient=class DatasetCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"datasets",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dx,"DatasetCollectionClientListOptions");return this.listResourcesPaginated(c0(),t,"medium")}async getOrCreate(e,t){ln(e,dk),ln(t?.schema,dP),ln(t?.timeoutSecs,lV),ln(t?.signal,lJ);let{timeoutSecs:r="short",signal:n,...i}=t??{},o=Object.keys(i).length>0;return this.getOrCreateResource(u8(),e,o?i:void 0,r,n)}};let dI=iP({unnamed:iw().optional(),...lS,desc:iw().optional(),ownership:iB(op).optional(),...lG}),dU=nY().optional(),dL=lf.optional();let KeyValueStoreCollectionClient=class KeyValueStoreCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"key-value-stores",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dI,"KeyValueStoreCollectionClientListOptions");return this.listResourcesPaginated(cQ(),t,"medium")}async getOrCreate(e,t){ln(e,dU),ln(t?.schema,dL),ln(t?.timeoutSecs,lV),ln(t?.signal,lJ);let{timeoutSecs:r="short",signal:n,...i}=t??{},o=Object.keys(i).length>0;return this.getOrCreateResource(cr(),e,o?i:void 0,r,n)}};let dz=iP({unnamed:iw().optional(),...lS,desc:iw().optional(),ownership:iB(op).optional(),...lG}),dN=nY().optional();let RequestQueueCollectionClient=class RequestQueueCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"request-queues",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dz,"RequestQueueCollectionListOptions");return this.listResourcesPaginated(c2(),t,"medium")}async getOrCreate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dN);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.getOrCreateResource(cm(),e,void 0,r,n)}};let dj=ix(ps());let ScheduleClient=class ScheduleClient extends ResourceClient{constructor(e){super({resourcePath:"schedules",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(pa(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(pa(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async getLog(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("log"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r}),dj)}};let dD=iP({...lS,desc:iw().optional(),...lG}),d$=lf.optional();let ScheduleCollectionClient=class ScheduleCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"schedules",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dD,"ScheduleCollectionListOptions");return this.listResourcesPaginated(pt(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,d$);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(pa(),e,r,n)}};let dM=iP({...lS,search:nY().optional(),sortBy:nY().optional(),category:nY().optional(),username:nY().optional(),pricingModel:nY().optional(),includeUnrunnableActors:iw().optional(),...lG});let StoreCollectionClient=class StoreCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"store",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dM,"StoreCollectionListOptions");return this.listResourcesPaginated(pc(),t,"medium")}};let dB=lf.optional(),dF=iP({build:nY().optional(),memory:ig().optional(),runTimeoutSecs:ig().min(0).optional(),waitForFinish:ig().optional(),webhooks:ix(lf).optional(),maxItems:ig().min(0).optional(),maxTotalChargeUsd:ig().min(0).optional(),restartOnError:iw().optional(),waitForResources:iL([iw(),ig().min(0)]).optional(),...lG}),dq=iP({build:nY().optional(),memory:ig().optional(),runTimeoutSecs:ig().min(0).optional(),waitSecs:ig().min(0).optional(),webhooks:ix(lf).optional(),maxItems:ig().min(0).optional(),maxTotalChargeUsd:ig().min(0).optional(),restartOnError:iw().optional(),waitForResources:iL([iw(),ig().min(0)]).optional(),...lG}),dW=iP({status:iB(oi).optional(),origin:iB(oa).optional()});let TaskClient=class TaskClient extends ResourceClient{constructor(e){super({resourcePath:"actor-tasks",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(cG(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(cG(),e,r,n)}async publish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.update({isPublic:!0},e)}async unpublish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.update({isPublic:!1},e)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async start(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dB);let r=ln(t,dF,"TaskStartOptions"),{waitForFinish:n,runTimeoutSecs:i,memory:o,build:a,maxItems:s,maxTotalChargeUsd:l,restartOnError:u,waitForResources:c,timeoutSecs:p,signal:d}=r,f={waitForFinish:n,timeout:i,memory:o,build:a,webhooks:lb(r.webhooks),maxItems:s,maxTotalChargeUsd:l,restartOnError:u},h={url:this.buildUrl("runs"),method:"POST",data:e,params:this.buildParams(f),stringifyFunctions:!0,headers:{"Content-Type":"application/json"},timeoutSecs:this.timeoutForWaitForFinish(p,"medium",n),signal:d};return lm(await pk(async()=>this.httpClient.call(h),!lE(e)&&c,this.httpClient.logger,d),u6())}async call(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dB);let{waitSecs:r,timeoutSecs:n="noTimeout",signal:i,...o}=ln(t,dq,"TaskCallOptions"),{id:a}=await this.start(e,{...o,timeoutSecs:n,signal:i});return this.apifyClient.run(a).waitForFinish({waitSecs:r,timeoutSecs:n,signal:i})}async getInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("input"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r})).data}async updateInput(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("input"),method:"PUT",params:this.buildParams(),data:e,timeoutSecs:r,signal:n})).data}lastRun(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dW,"TaskLastRunOptions");return new RunClient(this.subResourceOptions({id:"last",params:this.buildParams(t),resourcePath:"runs"}))}runs(){return new RunCollectionClient(this.subResourceOptions({resourcePath:"runs"}))}webhooks(){return new WebhookCollectionClient(this.subResourceOptions())}};let dZ=iP({...lS,desc:iw().optional(),...lG});let TaskCollectionClient=class TaskCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"actor-tasks",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dZ,"TaskCollectionListOptions");return this.listResourcesPaginated(cK(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="medium",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(cG(),e,r,n)}};let UserClient=class UserClient extends ResourceClient{constructor(e){super({resourcePath:"users",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(pb(),{},t,r)}async monthlyUsage(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("usage/monthly"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r}),pO())}async limits(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("limits"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r}),pT())}async updateLimits(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions"),i={url:this.buildUrl("limits"),method:"PUT",params:this.buildParams(),data:e,timeoutSecs:r,signal:n};await this.httpClient.call(i)}};let dK=iP({...lS,desc:iw().optional(),...lG});let WebhookDispatchCollectionClient=class WebhookDispatchCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"webhook-dispatches",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dK,"WebhookDispatchCollectionListOptions");return this.listResourcesPaginated(c9(),t,"medium")}};let WebhookClient=class WebhookClient extends ResourceClient{constructor(e){super({resourcePath:"webhooks",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(cY(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(cY(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async test(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("test"),method:"POST",params:this.buildParams(),timeoutSecs:t,signal:r}),c3())}dispatches(){return new WebhookDispatchCollectionClient(this.subResourceOptions({resourcePath:"dispatches"}))}};let WebhookDispatchClient=class WebhookDispatchClient extends ResourceClient{constructor(e){super({resourcePath:"webhook-dispatches",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(c3(),{},t,r)}};let dH="https://api.apify.com";function dV(e){let t=new URL(e),r=t.pathname.replace(/\/+$/,"");return t.pathname=r.endsWith("/v2")?r:`${r}/v2`,t.href}let dJ=iP({baseUrl:nY().default(dH),compression:lK.default("brotli"),headers:i$(nY(),nY()).optional(),publicBaseUrl:nY().default(dH),maxRetries:l1.maxRetries.default(8),minDelayBetweenRetriesMillis:l1.minDelayBetweenRetriesMillis.default(500),timeoutShortSecs:l1.timeoutShortSecs.default(5),timeoutMediumSecs:l1.timeoutMediumSecs.default(30),timeoutLongSecs:l1.timeoutLongSecs.default(360),timeoutMaxSecs:l1.timeoutMaxSecs.default(360),token:nY().optional(),userAgentSuffix:iL([nY(),ix(nY())]).optional()}),dG=iP({baseUrl:nY().default(dH),publicBaseUrl:nY().default(dH),token:nY().optional(),httpClient:i6(HttpClient)}),dY=nY().min(1),dQ=iP({clientKey:nY().min(1).optional(),timeoutSecs:ig().positive().optional()});let ApifyClient=class ApifyClient{baseUrl;publicBaseUrl;token;stats;logger;#z;#N;constructor(e={}){let t=ln(e,dJ,"ApifyClientOptions"),{baseUrl:r,compression:n,headers:i,publicBaseUrl:o,maxRetries:a,minDelayBetweenRetriesMillis:s,timeoutShortSecs:l,timeoutMediumSecs:u,timeoutLongSecs:c,timeoutMaxSecs:p,token:d}=t;this.baseUrl=dV(r),this.publicBaseUrl=dV(o),this.token=d,this.stats=new Statistics,this.logger=oT.child({prefix:"ApifyClient"}),this.#N={stats:this.stats,maxRetries:a,minDelayBetweenRetriesMillis:s,compression:n,headers:i,timeoutShortSecs:l,timeoutMediumSecs:u,timeoutLongSecs:c,timeoutMaxSecs:p,logger:this.logger,token:this.token,userAgentSuffix:t.userAgentSuffix}}static withCustomHttpClient(e){let{httpClient:t,...r}=ln(e,dG,"ApifyClientCustomHttpClientOptions"),n=new ApifyClient(r);return n.httpClient=t,n}get httpClient(){return this.#z??=new AxiosHttpClient(this.#N),this.#z}set httpClient(e){this.token&&e.setDefaultAuthorization(this.token),this.#z=e,this.stats=e.stats}#j(){return{baseUrl:this.baseUrl,publicBaseUrl:this.publicBaseUrl,apifyClient:this,httpClient:this.httpClient}}actors(){return new ActorCollectionClient(this.#j())}actor(e){return ln(e,dY),new ActorClient({id:e,...this.#j()})}builds(){return new BuildCollectionClient(this.#j())}build(e){return ln(e,dY),new BuildClient({id:e,...this.#j()})}datasets(){return new DatasetCollectionClient(this.#j())}dataset(e){return ln(e,dY),new DatasetClient({id:e,...this.#j()})}keyValueStores(){return new KeyValueStoreCollectionClient(this.#j())}keyValueStore(e){return ln(e,dY),new KeyValueStoreClient({id:e,...this.#j()})}log(e){return ln(e,dY),new LogClient({id:e,...this.#j()})}requestQueues(){return new RequestQueueCollectionClient(this.#j())}requestQueue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dY);let r=ln(t,dQ,"RequestQueueUserOptions");return new RequestQueueClient({id:e,...this.#j()},r)}runs(){return new RunCollectionClient({...this.#j(),resourcePath:"actor-runs"})}run(e){return ln(e,dY),new RunClient({id:e,...this.#j()})}tasks(){return new TaskCollectionClient(this.#j())}task(e){return ln(e,dY),new TaskClient({id:e,...this.#j()})}schedules(){return new ScheduleCollectionClient(this.#j())}schedule(e){return ln(e,dY),new ScheduleClient({id:e,...this.#j()})}user(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"me";return ln(e,dY),new UserClient({id:e,...this.#j()})}webhooks(){return new WebhookCollectionClient(this.#j())}webhook(e){return ln(e,dY),new WebhookClient({id:e,...this.#j()})}webhookDispatches(){return new WebhookDispatchCollectionClient(this.#j())}webhookDispatch(e){return ln(e,dY),new WebhookDispatchClient({id:e,...this.#j()})}store(){return new StoreCollectionClient(this.#j())}async setStatusMessage(e,t){let r=lv(ol);if(!r)throw Error(`Environment variable ${ol} is not set!`);await this.run(r).update({statusMessage:e,...t})}}})();var i=n.TD,o=n.B,a=n.h0,s=n.XP,l=n.v8,u=n.Lu,c=n.vp,p=n.Jo,d=n.UP,f=n.rj,h=n.Ns,m=n.yD,g=n.Ip,y=n.kt,b=n.KW,v=n.fK,w=n.wb,_=n.wv,E=n.yY,S=n.qQ,R=n._,O=n.Qq,C=n.tY,A=n.rE,T=n.PD,x=n.lE,k=n.ss,P=n.kq,I=n.m_,U=n.O_,L=n.OE,z=n.oc,N=n.oW,j=n.dK,D=n.Ry,$=n.Ng,M=n.Hg,B=n.L6,F=n.Ty,q=n.gP,W=n.py,Z=n.YS,K=n.t1,H=n.jE,V=n.D_,J=n.jx,G=n.F,Y=n.J_,Q=n.hH,X=n.zC,ee=n._l;export{i as ActorClient,o as ActorCollectionClient,a as ActorEnvVarClient,s as ActorEnvVarCollectionClient,l as ActorListSortBy,u as ActorSourceType,c as ActorVersionClient,p as ActorVersionCollectionClient,d as ApifyApiError,f as ApifyClient,h as ArgumentValidationError,m as AxiosHttpClient,g as BrotliHttpCompressor,y as BuildClient,b as BuildCollectionClient,v as ConflictError,w as DatasetClient,_ as DatasetCollectionClient,E as DownloadItemsFormat,S as ForbiddenError,R as GzipHttpCompressor,O as HttpClient,C as InvalidRequestError,A as InvalidResponseBodyError,T as KeyValueStoreClient,x as KeyValueStoreCollectionClient,k as LogClient,P as LoggerActorRedirect,I as NotFoundError,U as PlatformFeature,L as RateLimitError,z as RequestQueueClient,N as RequestQueueCollectionClient,j as ResponseValidationError,D as RunClient,$ as RunCollectionClient,M as ScheduleActions,B as ScheduleClient,F as ScheduleCollectionClient,q as ServerError,W as StoreCollectionClient,Z as StreamedLog,K as TaskClient,H as TaskCollectionClient,V as UnauthorizedError,J as UserClient,G as WebhookClient,Y as WebhookCollectionClient,Q as WebhookDispatchClient,X as WebhookDispatchCollectionClient,ee as WebhookDispatchStatus};
|
|
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}.
|
|
67
|
+
Cause:${e.stack}`)}};function l3(e,t){let r=t.toLowerCase(),n=Object.keys(e).find(e=>e.toLowerCase()===r);return void 0===n?void 0:e[n]}function l9(e,t){let r={...e};for(let[e,n]of Object.entries(t??{})){for(let t of Object.keys(r))t.toLowerCase()===e.toLowerCase()&&delete r[t];r[e]=n}return r}function l6(e){return e?.split(";",1)[0].trim().toLowerCase()}function l5(e,t){return"function"==typeof t?t.toString():t}function l8(e){return!!Array.isArray(e)||"object"==typeof e&&null!==e&&!(e instanceof Date)&&!lw(e)}let AxiosHttpClient=class AxiosHttpClient extends HttpClient{axios;httpAgent;httpsAgent;#g;constructor(e={}){for(let t of(super(e),this.axios=sM.create({proxy:!1,validateStatus:null,transformRequest:[],transformResponse:[],responseType:"arraybuffer",maxBodyLength:1/0,maxContentLength:-1}),this.axios.defaults.headers=new sQ,e.requestInterceptors??[]))this.axios.interceptors.request.use(t)}isTimeoutError(e){return!!super.isTimeoutError(e)||sM.isAxiosError(e)&&(e.code===sF.ECONNABORTED||e.code===sF.ETIMEDOUT)}isRetryableTransportError(e){return!!sM.isAxiosError(e)&&"object"==typeof e.request&&null!==e.request&&null!=e.config}async close(){await this.#g?.catch(()=>{}),this.httpAgent?.destroy(),this.httpsAgent?.destroy()}async sendRequest(e){await this.#y();let{method:t,url:r,headers:n,body:i,timeoutMillis:o,stream:a,signal:s}=e,l=await this.axios.request({method:t,url:r,headers:n,data:i,timeout:o??0,signal:s,responseType:a?"stream":"arraybuffer",...lE(i)?{maxRedirects:0}:{}});return{status:l.status,headers:sQ.from(l.headers).toJSON(),body:l.data}}async #y(){return this.#g??=this.#b(),this.#g}async #b(){let e=await s3.createHttpAgents({timeoutMillis:this.timeoutMaxMillis});e&&(this.httpAgent=e.httpAgent,this.httpsAgent=e.httpsAgent,this.axios.defaults.httpAgent=this.httpAgent,this.axios.defaults.httpsAgent=this.httpsAgent)}};let ApiClient=class ApiClient{id;safeId;baseUrl;publicBaseUrl;resourcePath;url;apifyClient;httpClient;params;constructor(e){let{baseUrl:t,publicBaseUrl:r,apifyClient:n,httpClient:i,resourcePath:o,id:a,params:s={}}=e;this.id=a,this.safeId=a&&this.toSafeId(a),this.baseUrl=t,this.publicBaseUrl=r,this.resourcePath=o,this.url=a?`${t}/${o}/${lA(this.safeId)}`:`${t}/${o}`,this.apifyClient=n,this.httpClient=i,this.params=s}subResourceOptions(e){return{...{baseUrl:this.buildUrl(),publicBaseUrl:this.publicBaseUrl,apifyClient:this.apifyClient,httpClient:this.httpClient,params:this.buildParams()},...e}}buildUrl(e){return e?`${this.url}/${lT(e)}`:this.url}buildPublicUrl(e){let t=this.id?`${this.publicBaseUrl}/${this.resourcePath}/${lA(this.safeId)}`:`${this.publicBaseUrl}/${this.resourcePath}`;return e?`${t}/${lT(e)}`:t}buildParams(e){return{...this.params,...e}}toSafeId(e){return e.replaceAll("/","~")}listPaginatedFromCallback(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(e,t)=>(0===e&&(e=void 0),0===t&&(t=void 0),void 0===e)?t:void 0===t?e:Math.min(e,t),{chunkSize:n,...i}=t,o=r(t.limit,n),a=e({...i,limit:o}),s=(e,t)=>{let r=Math.max(e[lR]??0,e.items.length);return t?Math.min(r,t):r};async function*l(){let l=await a;yield*l.items;let u=s(l,o),c=(t.offset??0)+u,p=t.limit?t.limit-u:void 0;for(;u>0&&(void 0===p||p>0);){let t=r(p,n),o={...i,limit:t,offset:c};l=await e(o),yield*l.items,c+=u=s(l,t),void 0!==p&&(p-=u)}}return Object.defineProperty(a,Symbol.asyncIterator,{value:l})}};let ResourceClient=class ResourceClient extends ApiClient{timeoutForWaitForFinish(e,t,r){if(void 0!==e)return e;if(void 0===r)return t;let n=Math.min(r,60);return n<=0?t:n+this.httpClient.timeoutMillis[t]/1e3}async getResource(e,t,r,n){let i={url:this.buildUrl(),method:"GET",params:this.buildParams(t),timeoutSecs:r,signal:n};try{let t=await this.httpClient.call(i);return lm(t,e)}catch(e){ly(e,this.id)}}async updateResource(e,t,r,n){return lm(await this.httpClient.call({url:this.buildUrl(),method:"PUT",params:this.buildParams(),data:t,timeoutSecs:r,signal:n}),e)}async deleteResource(e,t){try{await this.httpClient.call({url:this.buildUrl(),method:"DELETE",params:this.buildParams(),timeoutSecs:e,signal:t})}catch(e){ly(e,this.id)}}async waitForJobFinish(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{waitSecs:n=999999,timeoutSecs:i="noTimeout",signal:o}=r,a=1e3*n,s=Date.now(),l=()=>!(Date.now()-s>=a)&&!(t&&oo.includes(t.status));do{let r=Math.max(0,Math.round((a-(Date.now()-s))/1e3)),n={url:this.buildUrl(),method:"GET",params:this.buildParams({waitForFinish:r}),timeoutSecs:i,signal:o};try{let r=await this.httpClient.call(n);t=lm(r,e)}catch(e){lg(e),t=void 0}t||(await lx(250,o),o?.throwIfAborted())}while(l())if(!t){let e=this.constructor.name.match(/(\w+)Client/)[1].toLowerCase();throw Error(`Waiting for ${e} to finish failed. Cannot fetch actor ${e} details from the server.`)}return t}};function l7(e){return r$(nX,e)}function ue(e){return new iC({type:"date",coerce:!0,...ea(e)})}function ut(e){let t;return()=>t??=e()}let ur=ut(()=>iU({total:ib().min(0),offset:ib().min(0),limit:ib().min(1),desc:iw(),count:ib().min(0)})),un=ut(()=>iU({totalBuilds:ib().optional(),totalRuns:ib().optional(),totalUsers:ib().optional(),totalUsers7Days:ib().optional(),totalUsers30Days:ib().optional(),totalUsers90Days:ib().optional(),totalMetamorphs:ib().optional(),lastRunStartedAt:l7({offset:!0}).pipe(ue()).optional(),actorReviewCount:ib().optional(),actorReviewRating:ig().optional(),bookmarkCount:ib().optional(),publicActorRunStats30Days:iU({ABORTED:ib().optional(),FAILED:ib().optional(),SUCCEEDED:ib().optional(),"TIMED-OUT":ib().optional(),TOTAL:ib().optional()}).optional()})),ui=ut(()=>iU({id:nY(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),name:nY(),username:nY(),title:nY().optional(),stats:un().nullable().optional()})),uo=ut(()=>ur().extend({items:ix(ui())})),ua=ut(()=>iB(["SOURCE_FILES","GIT_REPO","TARBALL","GITHUB_GIST","SOURCE_CODE"]).or(nY())),us=ut(()=>iU({name:nY(),value:nY().optional(),isSecret:iw().nullable().optional()})),ul=ut(()=>iB(["BASE64","TEXT"]).or(nY())),uu=ut(()=>iU({format:ul().optional(),content:nY().optional(),name:nY()})),uc=ut(()=>iU({name:nY(),folder:iw()})),up=ut(()=>ix(iL([uu(),uc()]))),ud=ut(()=>iU({versionNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/),sourceType:ua().nullable(),envVars:ix(us()).nullable().optional(),applyEnvVarsToBuild:iw().nullable().optional(),buildTag:nY().nullable().optional(),sourceFiles:up().optional(),gitRepoUrl:nY().nullable().optional(),tarballUrl:nY().nullable().optional(),gitHubGistUrl:nY().nullable().optional()})),uf=ut(()=>iB(["LIMITED_PERMISSIONS","FULL_PERMISSIONS"]).or(nY())),uh=ut(()=>iU({build:nY().optional(),timeoutSecs:ib().optional(),memoryMbytes:ib().optional(),restartOnError:iw().optional(),maxItems:ib().nullable().optional(),forcePermissionLevel:uf().nullable().optional()})),um=ut(()=>iU({isEnabled:iw().nullable().optional(),desiredRequestsPerActorRun:ib().nullable().optional(),maxRequestsPerActorRun:ib().nullable().optional(),idleTimeoutSecs:ib().nullable().optional(),build:nY().nullable().optional(),memoryMbytes:ib().nullable().optional(),disableStandbyFieldsOverride:iw().nullable().optional(),shouldPassActorInput:iw().nullable().optional()})),ug=ut(()=>iU({body:nY().optional(),contentType:nY().optional()})),uy=ut(()=>iU({apifyMarginPercentage:ig(),createdAt:l7({offset:!0}).pipe(ue()),startedAt:l7({offset:!0}).pipe(ue()),notifiedAboutFutureChangeAt:l7({offset:!0}).pipe(ue()).nullable().optional(),notifiedAboutChangeAt:l7({offset:!0}).pipe(ue()).nullable().optional(),reasonForChange:nY().nullable().optional(),isPriceChangeNotificationSuppressed:iw().optional(),forceContainsSignificantPriceChange:iw().optional()})),ub=ut(()=>iU({tieredEventPriceUsd:ig()})),uv=ut(()=>i$(nY(),ub())),uw=ut(()=>iU({eventTitle:nY(),eventDescription:nY(),eventPriceUsd:ig().optional(),eventTieredPricingUsd:uv().optional(),isPrimaryEvent:iw().optional(),isOneTimeEvent:iw().optional()})),u_=ut(()=>uy().extend({pricingModel:iq("PAY_PER_EVENT"),pricingPerEvent:iU({actorChargeEvents:i$(nY(),uw()).optional()}),minimalMaxTotalChargeUsd:ig().nullable().optional()})),uE=ut(()=>iU({tieredPricePerUnitUsd:ig()})),uS=ut(()=>i$(nY(),uE())),uR=ut(()=>uy().extend({pricingModel:iq("PRICE_PER_DATASET_ITEM"),unitName:nY(),pricePerUnitUsd:ig().optional(),tieredPricing:uS().optional()})),uO=ut(()=>uy().extend({pricingModel:iq("FLAT_PRICE_PER_MONTH"),trialMinutes:ib(),pricePerUnitUsd:ig()})),uC=ut(()=>uy().extend({pricingModel:iq("FREE")})),uA=ut(()=>iN("pricingModel",[u_(),uR(),uO(),uC()])),uT=ut(()=>iU({buildId:nY().optional(),buildNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).nullable().optional(),buildNumberInt:ib().optional(),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional()})),ux=ut(()=>i$(nY(),uT().nullable())),uk=ut(()=>iB(["NONE","RESIDENTIAL_PROXY_REQUIRED","UNDER_MAINTENANCE"]).or(nY()).nullable()),uP=ut(()=>iU({id:nY(),userId:nY(),name:nY(),username:nY(),description:nY().nullable().optional(),restartOnError:iw().optional(),isPublic:iw(),actorPermissionLevel:uf().optional(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),stats:un(),versions:ix(ud()),pricingInfos:ix(uA()).optional(),defaultRunOptions:uh(),exampleRunInput:ug().nullable().optional(),isDeprecated:iw().nullable().optional(),deploymentKey:nY().optional(),title:nY().nullable().optional(),taggedBuilds:ux().nullable().optional(),actorStandby:um().nullable().optional(),readmeSummary:nY().optional(),seoTitle:nY().nullable().optional(),seoDescription:nY().nullable().optional(),pictureUrl:nY().nullable().optional(),standbyUrl:nY().nullable().optional(),notice:uk().optional(),categories:ix(nY()).optional(),isCritical:iw().optional(),isGeneric:iw().optional(),isSourceCodeHidden:iw().optional(),hasNoDataset:iw().optional()})),uU=ut(()=>iU({total:ib(),items:ix(ud())})),uI=ut(()=>iU({total:ib(),items:ix(us())})),uL=ut(()=>iB(["ACTOR.BUILD.ABORTED","ACTOR.BUILD.CREATED","ACTOR.BUILD.FAILED","ACTOR.BUILD.SUCCEEDED","ACTOR.BUILD.TIMED_OUT","ACTOR.RUN.ABORTED","ACTOR.RUN.CREATED","ACTOR.RUN.FAILED","ACTOR.RUN.RESURRECTED","ACTOR.RUN.SUCCEEDED","ACTOR.RUN.TIMED_OUT","TEST"]).or(nY())),uz=ut(()=>iU({actorId:nY().nullable().optional(),actorTaskId:nY().nullable().optional(),actorRunId:nY().nullable().optional()})),uN=ut(()=>iB(["ACTIVE","SUCCEEDED","FAILED"]).or(nY())),uj=ut(()=>iU({status:uN(),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),removedAt:l7({offset:!0}).pipe(ue()).nullable().optional()})),uD=ut(()=>iU({totalDispatches:ib().optional()})),u$=ut(()=>iU({id:nY(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),userId:nY(),isAdHoc:iw().nullable().optional(),isApifyIntegration:iw().optional(),isEnabled:iw().optional(),actionType:nY().optional(),shouldInterpolateStrings:iw().nullable().optional(),eventTypes:ix(uL()),condition:uz(),ignoreSslErrors:iw(),doNotRetry:iw(),requestUrl:n5({normalize:!0}),lastDispatch:uj().nullable().optional(),stats:uD().nullable().optional()})),uM=ut(()=>ur().extend({items:ix(u$())})),uB=ut(()=>iB(["READY","RUNNING","SUCCEEDED","FAILED","TIMING-OUT","TIMED-OUT","ABORTING","ABORTED"]).or(nY())),uF=ut(()=>iB(["DEVELOPMENT","WEB","API","SCHEDULER","TEST","WEBHOOK","ACTOR","CLI","CI","STANDBY","MCP"]).or(nY())),uq=ut(()=>iU({origin:uF(),clientIp:nY().optional(),userAgent:nY().optional()})),uW=ut(()=>iU({id:nY(),actId:nY().optional(),userId:nY().optional(),status:uB(),startedAt:l7({offset:!0}).pipe(ue()),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),usageTotalUsd:ig(),buildNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/),buildNumberInt:ib().optional(),meta:uq().optional()})),uZ=ut(()=>ur().extend({items:ix(uW())})),uK=ut(()=>iU({durationMillis:ib().optional(),runTimeSecs:ig().optional(),computeUnits:ig().optional(),imageSizeBytes:ib().nullable().optional()})),uH=ut(()=>iU({useCache:iw().nullable().optional(),betaPackages:iw().nullable().optional(),memoryMbytes:ib().nullable().optional(),diskMbytes:ib().nullable().optional()})),uV=ut(()=>iU({ACTOR_COMPUTE_UNITS:ig().nullable().optional()})),uJ=ut(()=>iU({actorSpecification:iq(1).optional(),name:nY().optional(),version:nY().regex(/^[0-9]+(\.[0-9]+)+$/).optional(),buildTag:nY().optional(),environmentVariables:i$(nY(),nY()).optional(),dockerfile:nY().optional(),dockerContextDir:nY().optional(),readme:nY().nullable().optional(),input:i$(nY(),iS()).nullable().optional(),changelog:nY().nullable().optional(),storages:iU({dataset:i$(nY(),iS()).optional()}).optional(),defaultMemoryMbytes:iL([nY(),ib()]).optional(),minMemoryMbytes:ib().min(128).optional(),maxMemoryMbytes:ib().min(128).optional(),usesStandbyMode:iw().optional()})),uG=ut(()=>iU({id:nY(),actId:nY(),userId:nY(),startedAt:l7({offset:!0}).pipe(ue()),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),status:uB(),meta:uq(),stats:uK().nullable().optional(),options:uH().nullable().optional(),usage:uV().nullable().optional(),usageTotalUsd:ig().nullable().optional(),usageUsd:uV().nullable().optional(),inputSchema:nY().nullable().optional(),readme:nY().nullable().optional(),buildNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/),imageDigest:nY().nullable().optional(),actVersion:iU({sourceType:ua().optional(),buildTag:nY().optional(),versionNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/).optional(),gitRepoUrl:nY().optional(),sourceFiles:ix(uu()).optional()}).optional(),actorDefinition:uJ().nullable().optional()})),uY=ut(()=>iU({origin:uF(),clientIp:nY().nullable().optional(),userAgent:nY().nullable().optional(),scheduleId:nY().nullable().optional(),scheduledAt:l7({offset:!0}).pipe(ue()).nullable().optional()})),uQ=ut(()=>iU({id:nY(),actId:nY(),userId:nY().optional(),actorTaskId:nY().nullable().optional(),status:uB(),startedAt:l7({offset:!0}).pipe(ue()),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),buildId:nY(),buildNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).optional(),buildNumberInt:ib().optional(),meta:uY(),usageTotalUsd:ig(),defaultKeyValueStoreId:nY(),defaultDatasetId:nY(),defaultRequestQueueId:nY()})),uX=ut(()=>ur().extend({items:ix(uQ())})),u0=ut(()=>iU({inputBodyLen:ib().min(0).nullable().optional(),migrationCount:ib().min(0).optional(),rebootCount:ib().min(0).optional(),restartCount:ib().min(0).optional(),resurrectCount:ib().min(0).optional(),memAvgBytes:ig().optional(),memMaxBytes:ib().min(0).optional(),memCurrentBytes:ib().min(0).optional(),cpuAvgUsage:ig().optional(),cpuMaxUsage:ig().optional(),cpuCurrentUsage:ig().optional(),netRxBytes:ib().min(0).optional(),netTxBytes:ib().min(0).optional(),durationMillis:ib().min(0).optional(),runTimeSecs:ig().min(0).optional(),metamorph:ib().min(0).optional(),computeUnits:ig().min(0).optional()})),u1=ut(()=>iU({build:nY(),timeoutSecs:ib().min(0),memoryMbytes:ib().min(128).max(32768),diskMbytes:ib().min(0),maxItems:ib().min(0).nullable().optional(),maxTotalChargeUsd:ig().min(0).nullable().optional()})),u2=ut(()=>iB(["ANYONE_WITH_ID_CAN_READ","ANYONE_WITH_NAME_CAN_READ","FOLLOW_USER_SETTING","RESTRICTED"]).or(nY())),u4=ut(()=>iU({ACTOR_COMPUTE_UNITS:ig().nullable().optional(),DATASET_READS:ib().nullable().optional(),DATASET_WRITES:ib().nullable().optional(),KEY_VALUE_STORE_READS:ib().nullable().optional(),KEY_VALUE_STORE_WRITES:ib().nullable().optional(),KEY_VALUE_STORE_LISTS:ib().nullable().optional(),REQUEST_QUEUE_READS:ib().nullable().optional(),REQUEST_QUEUE_WRITES:ib().nullable().optional(),DATA_TRANSFER_INTERNAL_GBYTES:ig().nullable().optional(),DATA_TRANSFER_EXTERNAL_GBYTES:ig().nullable().optional(),PROXY_RESIDENTIAL_TRANSFER_GBYTES:ig().nullable().optional(),PROXY_SERPS:ib().nullable().optional()})),u3=ut(()=>iU({ACTOR_COMPUTE_UNITS:ig().nullable().optional(),DATASET_READS:ig().nullable().optional(),DATASET_WRITES:ig().nullable().optional(),KEY_VALUE_STORE_READS:ig().nullable().optional(),KEY_VALUE_STORE_WRITES:ig().nullable().optional(),KEY_VALUE_STORE_LISTS:ig().nullable().optional(),REQUEST_QUEUE_READS:ig().nullable().optional(),REQUEST_QUEUE_WRITES:ig().nullable().optional(),DATA_TRANSFER_INTERNAL_GBYTES:ig().nullable().optional(),DATA_TRANSFER_EXTERNAL_GBYTES:ig().nullable().optional(),PROXY_RESIDENTIAL_TRANSFER_GBYTES:ig().nullable().optional(),PROXY_SERPS:ig().nullable().optional()})),u9=ut(()=>iU({createdAt:l7({offset:!0}).pipe(ue()),actorId:nY(),buildId:nY(),inputKey:nY().nullable().optional()})),u6=ut(()=>iU({id:nY(),actId:nY(),userId:nY(),actorTaskId:nY().nullable().optional(),startedAt:l7({offset:!0}).pipe(ue()),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),status:uB(),statusMessage:nY().nullable().optional(),isStatusMessageTerminal:iw().nullable().optional(),meta:uY(),pricingInfo:uA().optional(),stats:u0(),chargedEventCounts:i$(nY(),ib()).optional(),options:u1(),buildId:nY(),exitCode:ib().nullable().optional(),generalAccess:u2().nullable().optional(),defaultKeyValueStoreId:nY(),defaultDatasetId:nY(),defaultRequestQueueId:nY(),storageIds:iU({datasets:iU({default:nY().optional()}).catchall(nY()).optional(),keyValueStores:iU({default:nY().optional()}).catchall(nY()).optional(),requestQueues:iU({default:nY().optional()}).catchall(nY()).optional()}).optional(),buildNumber:nY().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).nullable().optional(),containerUrl:n5({normalize:!0}).optional(),isContainerServerReady:iw().nullable().optional(),gitBranchName:nY().nullable().optional(),usage:u4().nullable().optional(),usageTotalUsd:ig().nullable().optional(),usageUsd:u3().nullable().optional(),metamorphs:ix(u9()).nullable().optional(),platformUsageBillingModel:nY().optional()})),u5=ut(()=>iU({readCount:ib().optional(),writeCount:ib().optional(),storageBytes:ib().optional(),inflatedBytes:ib().optional()})),u8=ut(()=>iU({id:nY(),name:nY().nullable().optional(),userId:nY(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),accessedAt:l7({offset:!0}).pipe(ue()),itemCount:ib().min(0),cleanItemCount:ib().min(0),actId:nY().nullable().optional(),actRunId:nY().nullable().optional(),fields:ix(nY()).nullable().optional(),schema:i$(nY(),iS()).nullable().optional(),consoleUrl:n5({normalize:!0}),itemsPublicUrl:n5({normalize:!0}).optional(),urlSigningSecretKey:nY().nullable().optional(),generalAccess:u2().nullable().optional(),stats:u5().optional()})),u7=ut(()=>iU({min:ig().nullable().optional(),max:ig().nullable().optional(),nullCount:ib().nullable().optional(),emptyCount:ib().nullable().optional()})),ce=ut(()=>iU({fieldStatistics:i$(nY(),u7()).nullable().optional()})),ct=ut(()=>iU({readCount:ib().optional(),writeCount:ib().optional(),deleteCount:ib().optional(),listCount:ib().optional(),s3StorageBytes:ib().optional(),storageBytes:ib().optional()})),cr=ut(()=>iU({id:nY(),name:nY().nullable().optional(),userId:nY().nullable().optional(),username:nY().nullable().optional(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),accessedAt:l7({offset:!0}).pipe(ue()),actId:nY().nullable().optional(),actRunId:nY().nullable().optional(),consoleUrl:n5({normalize:!0}).optional(),keysPublicUrl:n5({normalize:!0}).optional(),recordsPublicUrl:n5({normalize:!0}).optional(),schema:i$(nY(),iS()).nullable().optional(),urlSigningSecretKey:nY().nullable().optional(),generalAccess:u2().nullable().optional(),stats:ct().optional()})),cn=ut(()=>iU({key:nY(),size:ib(),recordPublicUrl:n5({normalize:!0})})),ci=ut(()=>iU({items:ix(cn()),count:ib(),limit:ib(),exclusiveStartKey:nY().nullable().optional(),isTruncated:iw(),nextExclusiveStartKey:nY().nullable().optional()})),co=ut(()=>nY()),ca=ut(()=>nY()),cs=ut(()=>l7({offset:!0}).pipe(ue())),cl=ut(()=>l7({offset:!0}).pipe(ue())),cu=ut(()=>l7({offset:!0}).pipe(ue())),cc=ut(()=>ib().min(0)),cp=ut(()=>ib().min(0)),cd=ut(()=>ib()),cf=ut(()=>iw()),ch=ut(()=>iU({deleteCount:ib().optional(),headItemReadCount:ib().optional(),readCount:ib().optional(),storageBytes:ib().optional(),writeCount:ib().optional()})),cm=ut(()=>iU({id:co(),name:nY().nullable().optional(),userId:ca(),actId:nY().nullable().optional(),actRunId:nY().nullable().optional(),createdAt:cs(),modifiedAt:cl(),accessedAt:cu(),totalRequestCount:cc(),handledRequestCount:cp(),pendingRequestCount:cd(),hadMultipleClients:cf(),consoleUrl:n5({normalize:!0}),stats:ch().optional(),generalAccess:u2().nullable().optional()})),cg=ut(()=>nY()),cy=ut(()=>nY()),cb=ut(()=>iB(["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]).or(nY())),cv=ut(()=>cb()),cw=ut(()=>ib()),c_=ut(()=>i$(nY(),iS())),cE=ut(()=>iU({uniqueKey:cg(),url:cy(),method:cv().optional(),retryCount:cw().optional(),loadedUrl:nY().nullable().optional(),payload:iL([nY(),i$(nY(),iS())]).nullable().optional(),headers:i$(nY(),iS()).nullable().optional(),userData:c_().optional(),noRetry:iw().nullable().optional(),errorMessages:ix(nY()).nullable().optional(),handledAt:l7({offset:!0}).pipe(ue()).nullable().optional()})),cS=ut(()=>nY()),cR=ut(()=>cE().extend({id:cS().optional()}).required({id:!0})),cO=ut(()=>iU({items:ix(cR()),limit:ib(),exclusiveStartId:nY().optional(),cursor:nY().optional(),nextCursor:nY().optional()})),cC=ut(()=>iw()),cA=ut(()=>iw()),cT=ut(()=>iU({requestId:cS(),wasAlreadyPresent:cC(),wasAlreadyHandled:cA()})),cx=ut(()=>iU({requestId:cS(),uniqueKey:cg(),wasAlreadyPresent:cC(),wasAlreadyHandled:cA()})),ck=ut(()=>iU({id:cS().optional(),uniqueKey:cg(),url:cy(),method:cv().optional()})),cP=ut(()=>iU({processedRequests:ix(cx()),unprocessedRequests:ix(ck())})),cU=ut(()=>iU({uniqueKey:cg().optional(),id:cS()})),cI=ut(()=>iU({uniqueKey:cg(),id:cS().optional()})),cL=ut(()=>iL([cU(),cI()])),cz=ut(()=>iU({processedRequests:ix(cL()),unprocessedRequests:ix(ck())})),cN=ut(()=>iU({unlockedCount:ib()})),cj=ut(()=>l7({offset:!0}).pipe(ue())),cD=ut(()=>iU({lockExpiresAt:cj()})),c$=ut(()=>ib()),cM=ut(()=>iU({id:cS(),uniqueKey:cg(),url:cy(),method:cv().optional(),retryCount:cw().optional()})),cB=ut(()=>iU({limit:c$(),queueModifiedAt:cl(),hadMultipleClients:cf(),items:ix(cM())})),cF=ut(()=>iU({id:cS(),uniqueKey:cg(),url:cy(),method:cv().optional(),retryCount:cw().optional(),lockExpiresAt:cj()})),cq=ut(()=>iU({limit:c$(),queueModifiedAt:cl(),queueHasLockedRequests:iw().optional(),clientKey:nY().optional(),hadMultipleClients:cf(),lockSecs:ib(),items:ix(cF())})),cW=ut(()=>iU({totalRuns:ib().optional()})),cZ=ut(()=>iU({id:nY(),userId:nY(),actId:nY(),actName:nY().nullable().optional(),name:nY(),username:nY().nullable().optional(),actUsername:nY().nullable().optional(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),stats:cW().nullable().optional()})),cK=ut(()=>ur().extend({items:ix(cZ())})),cH=ut(()=>iU({build:nY().nullable().optional(),timeoutSecs:ib().nullable().optional(),memoryMbytes:ib().nullable().optional(),maxItems:ib().nullable().optional(),maxTotalChargeUsd:ig().nullable().optional(),restartOnError:iw().nullable().optional()})),cV=ut(()=>i$(nY(),iS())),cJ=ut(()=>iU({publishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),seoTitle:nY().max(60).nullable().optional(),seoDescription:nY().max(160).nullable().optional(),inputSchemaFields:ix(nY()).nullable().optional(),datasetName:nY().nullable().optional(),datasetView:nY().nullable().optional()})),cG=ut(()=>iU({id:nY(),userId:nY(),actId:nY(),name:nY(),username:nY().nullable().optional(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),removedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),stats:cW().nullable().optional(),options:cH().nullable().optional(),input:iL([cV(),ix(cV())]).nullable().optional(),title:nY().nullable().optional(),description:nY().nullable().optional(),actorStandby:um().nullable().optional(),standbyUrl:n5({normalize:!0}).nullable().optional(),isPublic:iw().optional(),publicConfig:cJ().nullable().optional()})),cY=ut(()=>iU({id:nY(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),userId:nY(),isAdHoc:iw().nullable().optional(),shouldInterpolateStrings:iw().nullable().optional(),eventTypes:ix(uL()),condition:uz(),ignoreSslErrors:iw(),doNotRetry:iw().nullable().optional(),requestUrl:n5({normalize:!0}).nullable().optional(),payloadTemplate:nY().nullable().optional(),headersTemplate:nY().nullable().optional(),description:nY().nullable().optional(),lastDispatch:uj().nullable().optional(),stats:uD().nullable().optional()})),cQ=ut(()=>ur().extend({unnamed:iw().optional(),items:ix(cr())})),cX=ut(()=>iU({id:nY(),name:nY(),userId:nY(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),accessedAt:l7({offset:!0}).pipe(ue()),itemCount:ib(),cleanItemCount:ib(),actId:nY().nullable().optional(),actRunId:nY().nullable().optional(),title:nY().nullable().optional(),username:nY().optional(),generalAccess:u2().nullable().optional(),stats:u5().optional()})),c0=ut(()=>ur().extend({unnamed:iw().optional(),items:ix(cX())})),c1=ut(()=>iU({id:co(),name:nY(),userId:ca(),username:nY(),createdAt:cs(),modifiedAt:cl(),accessedAt:cu(),expireAt:l7({offset:!0}).pipe(ue()).optional(),totalRequestCount:cc(),handledRequestCount:cp(),pendingRequestCount:cd(),actId:nY().nullable().optional(),actRunId:nY().nullable().optional(),hadMultipleClients:cf(),generalAccess:u2().nullable().optional(),stats:ch().optional()})),c2=ut(()=>ur().extend({unnamed:iw().optional(),items:ix(c1())})),c4=ut(()=>iU({actionType:nY().optional(),condition:uz().optional(),requestUrl:n5({normalize:!0}).nullable().optional(),isAdHoc:iw().optional()})),c3=ut(()=>iU({id:nY(),userId:nY(),webhookId:nY(),createdAt:l7({offset:!0}).pipe(ue()),status:uN(),eventType:uL(),eventData:iU({actorId:nY(),actorRunId:nY().optional(),actorBuildId:nY().optional(),actorTaskId:nY().nullable().optional()}).nullable().optional(),webhook:c4().nullable().optional(),calls:ix(iU({startedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),finishedAt:l7({offset:!0}).pipe(ue()).nullable().optional(),errorMessage:nY().nullable().optional(),responseStatus:ib().nullable().optional(),responseBody:nY().nullable().optional()})).optional()})),c9=ut(()=>ur().extend({items:ix(c3())})),c6=ut(()=>iU({id:nY(),userId:nY(),name:nY(),cronExpression:nY(),timezone:nY(),isEnabled:iw(),isExclusive:iw(),createdAt:l7({offset:!0}).pipe(ue()),modifiedAt:l7({offset:!0}).pipe(ue()),nextRunAt:l7({offset:!0}).pipe(ue()).nullable().optional(),lastRunAt:l7({offset:!0}).pipe(ue()).nullable().optional()})),c5=ut(()=>iU({id:nY(),type:iq("RUN_ACTOR"),actorId:nY()})),c8=ut(()=>iU({id:nY(),type:iq("RUN_ACTOR_TASK"),actorTaskId:nY()})),c7=ut(()=>iN("type",[c5(),c8()])),pe=ut(()=>c6().extend({actions:ix(c7())})),pt=ut(()=>ur().extend({items:ix(pe())})),pr=ut(()=>iU({body:nY().nullable().optional(),contentType:nY().nullable().optional()})),pn=ut(()=>iU({id:nY(),type:iq("RUN_ACTOR"),actorId:nY(),runInput:pr().nullable().optional(),runOptions:cH().nullable().optional()})),pi=ut(()=>iU({id:nY(),type:iq("RUN_ACTOR_TASK"),actorTaskId:nY(),input:i$(nY(),iS()).nullable().optional()})),po=ut(()=>iN("type",[pn(),pi()])),pa=ut(()=>c6().extend({description:nY().nullable().optional(),title:nY().nullable().optional(),notifications:iU({email:iw().optional()}).optional(),actions:ix(po())})),ps=ut(()=>iU({message:nY(),level:nY(),createdAt:l7({offset:!0}).pipe(ue())})),pl=ut(()=>iU({pricingModel:nY(),apifyMarginPercentage:ig().optional(),createdAt:l7({offset:!0}).pipe(ue()).optional(),startedAt:l7({offset:!0}).pipe(ue()).optional(),notifiedAboutChangeAt:l7({offset:!0}).pipe(ue()).nullable().optional(),notifiedAboutFutureChangeAt:l7({offset:!0}).pipe(ue()).nullable().optional(),isPriceChangeNotificationSuppressed:iw().optional(),forceContainsSignificantPriceChange:iw().optional(),isPPEPlatformUsagePaidByUser:iw().optional(),reasonForChange:nY().nullable().optional(),trialMinutes:ib().nullable().optional(),unitName:nY().nullable().optional(),pricePerUnitUsd:ig().nullable().optional(),minimalMaxTotalChargeUsd:ig().nullable().optional(),pricingPerEvent:i$(nY(),iS()).nullable().optional()})),pu=ut(()=>iU({id:nY(),title:nY(),name:nY(),username:nY(),userFullName:nY().nullable().optional(),description:nY().nullable().optional(),categories:ix(nY()).optional(),notice:uk().optional(),pictureUrl:nY().nullable().optional(),userPictureUrl:n5({normalize:!0}).nullable().optional(),url:n5({normalize:!0}).nullable().optional(),stats:un(),currentPricingInfo:pl().optional(),isWhiteListedForAgenticPayments:iw().nullable().optional(),actorReviewCount:ib().optional(),actorReviewRating:ig().optional(),bookmarkCount:ib().optional(),badge:nY().nullable().optional(),readmeSummary:nY().optional()})),pc=ut(()=>ur().extend({items:ix(pu())})),pp=ut(()=>iU({bio:nY().nullable().optional(),readme:nY().nullable().optional(),name:nY().optional(),pictureUrl:n5({normalize:!0}).nullable().optional(),githubUsername:nY().nullable().optional(),websiteUrl:n5({normalize:!0}).nullable().optional(),twitterUsername:nY().nullable().optional()})),pd=ut(()=>iU({name:nY(),description:nY().nullable(),availableCount:ib()})),pf=ut(()=>iU({password:nY(),groups:ix(pd())})),ph=ut(()=>i$(nY(),ib())),pm=ut(()=>iU({id:nY().optional(),description:nY().optional(),isEnabled:iw().optional(),monthlyBasePriceUsd:ig().optional(),monthlyUsageCreditsUsd:ig().optional(),usageDiscountPercent:ig().optional(),enabledPlatformFeatures:ix(nY()).optional(),maxMonthlyUsageUsd:ig().optional(),maxActorMemoryGbytes:ig().optional(),maxMonthlyActorComputeUnits:ig().optional(),maxMonthlyResidentialProxyGbytes:ig().optional(),maxMonthlyProxySerps:ib().optional(),maxMonthlyExternalDataTransferGbytes:ig().optional(),maxActorCount:ib().optional(),maxActorTaskCount:ib().optional(),dataRetentionDays:ib().optional(),availableProxyGroups:ph(),teamAccountSeatCount:ib().optional(),supportLevel:nY().optional(),availableAddOns:ix(nY()).optional(),tier:nY().optional(),apiRateLimitBoosts:ib().optional(),maxScheduleCount:ib().optional(),maxConcurrentActorRuns:ib().optional(),planPricing:i$(nY(),iS()).optional()})),pg=ut(()=>iU({isEnabled:iw(),disabledReason:nY().nullable(),disabledReasonType:nY().nullable(),isTrial:iw(),trialExpirationAt:l7({offset:!0}).pipe(ue()).nullable()})),py=ut(()=>iU({ACTORS:pg(),STORAGE:pg(),SCHEDULER:pg(),PROXY:pg(),PROXY_EXTERNAL_ACCESS:pg(),PROXY_RESIDENTIAL:pg(),PROXY_SERPS:pg(),WEBHOOKS:pg(),ACTORS_PUBLIC_ALL:pg(),ACTORS_PUBLIC_DEVELOPER:pg()})),pb=ut(()=>iU({id:nY().optional(),username:nY(),profile:pp().optional(),email:nY().optional(),proxy:pf().optional(),plan:pm().optional(),effectivePlatformFeatures:py().optional(),createdAt:l7({offset:!0}).pipe(ue()).optional(),isPaying:iw().optional()})),pv=ut(()=>iU({startAt:l7({offset:!0}).pipe(ue()),endAt:l7({offset:!0}).pipe(ue())})),pw=ut(()=>iU({quantityAbove:ig(),discountPercent:ig(),tierQuantity:ig(),unitPriceUsd:ig(),priceUsd:ig()})),p_=ut(()=>iU({quantity:ig(),baseAmountUsd:ig(),baseUnitPriceUsd:ig().optional(),amountAfterVolumeDiscountUsd:ig().optional(),priceTiers:ix(pw()).optional()})),pE=ut(()=>i$(nY(),p_())),pS=ut(()=>i$(nY(),p_())),pR=ut(()=>iU({date:l7({offset:!0}).pipe(ue()),serviceUsage:pS(),totalUsageCreditsUsd:ig()})),pO=ut(()=>iU({usageCycle:pv(),monthlyServiceUsage:pE(),dailyServiceUsages:ix(pR()),totalUsageCreditsUsdBeforeVolumeDiscount:ig(),totalUsageCreditsUsdAfterVolumeDiscount:ig()})),pC=ut(()=>iU({maxMonthlyUsageUsd:ig(),maxMonthlyActorComputeUnits:ig(),maxMonthlyExternalDataTransferGbytes:ig(),maxMonthlyProxySerps:ib(),maxMonthlyResidentialProxyGbytes:ig(),maxActorMemoryGbytes:ig(),maxActorCount:ib(),maxActorTaskCount:ib(),maxConcurrentActorJobs:ib(),maxTeamAccountSeatCount:ib(),dataRetentionDays:ib(),maxScheduleCount:ib().optional()})),pA=ut(()=>iU({monthlyUsageUsd:ig(),monthlyActorComputeUnits:ig(),monthlyExternalDataTransferGbytes:ig(),monthlyProxySerps:ib(),monthlyResidentialProxyGbytes:ig(),actorMemoryGbytes:ig(),actorCount:ib(),actorTaskCount:ib(),activeActorJobCount:ib(),teamAccountSeatCount:ib(),scheduleCount:ib().optional()})),pT=ut(()=>iU({monthlyUsageCycle:pv(),limits:pC(),current:pA()})),px=new Set(["actor-memory-limit-exceeded","concurrent-runs-limit-exceeded"]);async function pk(e,t,r,n){if(!t)return e();let i=!0===t?1/0:Date.now()+1e3*t;for(;;)try{return await e()}catch(o){if(!(o instanceof ApifyApiError)||!px.has(o.type??""))throw o;let e=i-Date.now();if(e<=0)throw o;let t=Math.min(1e4,e);r.info(`Not enough resources to start the run, retrying in ${Number((t/1e3).toPrecision(3))}s: ${o.message}`),await lx(t,n),n?.throwIfAborted()}}let ActorEnvVarClient=class ActorEnvVarClient extends ResourceClient{constructor(e){super({resourcePath:"env-vars",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(us(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(us(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}};let ResourceCollectionClient=class ResourceCollectionClient extends ApiClient{async listResources(e,t,r,n){return lm(await this.httpClient.call({url:this.buildUrl(),method:"GET",params:this.buildParams(t),timeoutSecs:r,signal:n}),e)}listUnpaginatedResources(e,t,r){let n=this.listResources(e,void 0,t,r);return Object.defineProperty(n,Symbol.asyncIterator,{async *value(){yield*(await n).items}})}listResourcesPaginated(e,t,r){let{timeoutSecs:n=r,signal:i,...o}=t;return this.listPaginatedFromCallback(async t=>this.listResources(e,t,n,i),o)}async createResource(e,t,r,n){return lm(await this.httpClient.call({url:this.buildUrl(),method:"POST",params:this.buildParams(),data:t,timeoutSecs:r,signal:n}),e)}async getOrCreateResource(e,t,r,n,i){return lm(await this.httpClient.call({url:this.buildUrl(),method:"POST",params:this.buildParams({name:t}),data:r,timeoutSecs:n,signal:i}),e)}};let pP=lf.optional();let ActorEnvVarCollectionClient=class ActorEnvVarCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"env-vars",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.listUnpaginatedResources(uI(),t,r)}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pP);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(us(),e,r,n)}};var pU=((A={}).Active="ACTIVE",A.Succeeded="SUCCEEDED",A.Failed="FAILED",A),pI=((T={}).SourceFiles="SOURCE_FILES",T.GitRepo="GIT_REPO",T.Tarball="TARBALL",T.GitHubGist="GITHUB_GIST",T.SourceCode="SOURCE_CODE",T),pL=((x={}).RunActor="RUN_ACTOR",x.RunActorTask="RUN_ACTOR_TASK",x),pz=((k={}).Actors="ACTORS",k.Storage="STORAGE",k.ProxySERPS="PROXY_SERPS",k.Scheduler="SCHEDULER",k.Webhooks="WEBHOOKS",k.Proxy="PROXY",k.ProxyExternalAccess="PROXY_EXTERNAL_ACCESS",k);let pN=nY().min(1);let ActorVersionClient=class ActorVersionClient extends ResourceClient{constructor(e){super({resourcePath:"versions",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(ud(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(ud(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}envVar(e){return ln(e,pN),new ActorEnvVarClient(this.subResourceOptions({id:e}))}envVars(){return new ActorEnvVarCollectionClient(this.subResourceOptions())}};let pj=lf.optional();let ActorVersionCollectionClient=class ActorVersionCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"versions",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.listUnpaginatedResources(uU(),t,r)}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pj);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(ud(),e,r,n)}};let pD=iP({raw:iw().optional(),...lG});let LogClient=class LogClient extends ResourceClient{constructor(e){super({resourcePath:"logs",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:r,...n}=ln(e,pD,"LogOptions"),i={url:this.buildUrl(),method:"GET",params:this.buildParams(n),timeoutSecs:t,signal:r};try{return(await this.httpClient.call(i)).data}catch(e){ly(e,this.id)}}async stream(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:r,raw:n}=ln(e,pD,"LogOptions"),i={url:this.buildUrl(),method:"GET",params:this.buildParams({stream:!0,raw:n}),responseType:"stream",timeoutSecs:t,signal:r};try{return(await this.httpClient.call(i)).data}catch(e){ly(e,this.id)}}};let LoggerActorRedirect=class LoggerActorRedirect extends Logger{constructor(e={}){super({skipTime:!0,level:z.DEBUG,...e})}_log(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(e>this.options.level)return;if(r||n)throw Error("Redirect logger does not use other arguments than level and message");let{prefix:o}=i;o=o?`${o}`:"";let a="";this.options.skipTime||(a=`${new Date().toISOString().replace("Z","").replace("T"," ")} `);let s=`${oE().gray(a)}${oE().cyan(o)}${t||""}`;return this._outputWithConsole(z.INFO,s),s}};let StreamedLog=class StreamedLog{#v;#w=[];#_=new TextDecoder;#E=/(?:\n|^)(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)/g;#S;#R;#O;#C=null;#A=!1;constructor(e){let{toLog:t,logClient:r,fromStart:n=!0,signal:i}=e;this.#v=t,this.#R=r,this.#O=i,this.#S=n?null:new Date}start(){if(this.#C)throw Error("Streaming task already active");this.#A=!1,this.#C=this.#T()}async stop(){if(!this.#C)throw Error("Streaming task is not active");this.#A=!0;try{await this.#C}catch(e){if(!(e instanceof Error&&"AbortError"===e.name))throw e}finally{this.#C=null}}async #T(){try{let e=await this.#R.stream({raw:!0,signal:this.#O});if(!e)return;let t=await this.#x(e),r=this.#_.decode(t).trim();r.length&&this.#v.info(r)}catch(e){if(this.#O?.aborted)return;oT.warning("Log redirection stopped due to error",e)}}async #x(e){let t=new Uint8Array;for await(let r of e){let e=new Uint8Array(t.length+r.length);e.set(t,0),e.set(r,t.length);let n=e.lastIndexOf(10);if(t=e.slice(n),this.#w.push(e.slice(0,n)),this.#k(),this.#A)break}return t}#k(){let e=this.#_.decode(function(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(this.#w)).split(this.#E).slice(1),t=e.filter((e,t)=>t%2==0),r=e.filter((e,t)=>t%2!=0);this.#w=[],t.forEach((e,t)=>{let n=r[t];this.#S&&new Date(e)<this.#S||this.#v.info((e+n).trim())})}};let p$=iP({waitForFinish:ig().optional(),...lG}),pM=iP({waitSecs:ig().optional(),...lG});let BuildClient=class BuildClient extends ResourceClient{constructor(e){super({resourcePath:"actor-builds",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r,...n}=ln(e,p$,"BuildClientGetOptions");return this.getResource(uG(),n,this.timeoutForWaitForFinish(t,"short",n.waitForFinish),r)}async abort(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("abort"),method:"POST",params:this.buildParams(),timeoutSecs:t,signal:r}),uG())}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async getOpenApiDefinition(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r}=ln(e,lY,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("openapi.json"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r})).data}async waitForFinish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,pM,"BuildClientWaitForFinishOptions");return this.waitForJobFinish(uG(),t)}log(){return new LogClient(this.subResourceOptions({resourcePath:"log"}))}};let pB=iP({...lS,desc:iw().optional(),...lG});let BuildCollectionClient=class BuildCollectionClient extends ResourceCollectionClient{constructor(e){super({...e,resourcePath:e.resourcePath||"actor-builds"})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,pB,"BuildCollectionClientListOptions");return this.listResourcesPaginated(uZ(),t,"medium")}};var pF=((P={}).JSON="json",P.JSONL="jsonl",P.XML="xml",P.HTML="html",P.CSV="csv",P.XLSX="xlsx",P.RSS="rss",P);let pq=iB(pF),pW=i3(ld,"Expected an object"),pZ=iP({clean:iw().optional(),desc:iw().optional(),flatten:ix(nY()).optional(),fields:ix(nY()).optional(),omit:ix(nY()).optional(),...lS,skipEmpty:iw().optional(),skipHidden:iw().optional(),unwind:iL([nY(),ix(nY())]).optional(),view:nY().optional(),signature:nY().optional(),...lG}),pK=iP({attachment:iw().optional(),bom:iw().optional(),clean:iw().optional(),delimiter:nY().optional(),desc:iw().optional(),flatten:ix(nY()).optional(),fields:ix(nY()).optional(),omit:ix(nY()).optional(),limit:ig().min(0).optional(),offset:ig().min(0).optional(),skipEmpty:iw().optional(),skipHeaderRow:iw().optional(),skipHidden:iw().optional(),unwind:iL([nY(),ix(nY())]).optional(),view:nY().optional(),xmlRoot:nY().optional(),xmlRow:nY().optional(),signature:nY().optional(),...lG}),pH=iL([pW,nY(),ix(pW)]),pV=iP({clean:iw().optional(),desc:iw().optional(),flatten:ix(nY()).optional(),fields:ix(nY()).optional(),format:pq.optional(),omit:ix(nY()).optional(),limit:ig().min(0).optional(),offset:ig().min(0).optional(),skipEmpty:iw().optional(),skipHidden:iw().optional(),unwind:iL([nY(),ix(nY())]).optional(),view:nY().optional(),expiresInSecs:ig().optional(),...lG});let DatasetClient=class DatasetClient extends ResourceClient{constructor(e){super({resourcePath:"datasets",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(u8(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(u8(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}listItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{timeoutSecs:r="long",signal:n,...i}=ln(e,pZ,"DatasetClientListItemOptions"),o=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=await t.httpClient.call({url:t.buildUrl("items"),method:"GET",params:t.buildParams(e),timeoutSecs:r,signal:n});return t.#P(i,e.desc??!1)};return this.listPaginatedFromCallback(o,i)}async downloadItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pq);let{timeoutSecs:r="long",signal:n,...i}=ln(t,pK,"DatasetClientDownloadItemsOptions"),{data:o}=await this.httpClient.call({url:this.buildUrl("items"),method:"GET",params:this.buildParams({format:e,...i}),responseType:"buffer",timeoutSecs:r,signal:n});return o}async pushItems(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pH);let{timeoutSecs:r="medium",signal:n}=ln(t,lY,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl("items"),method:"POST",headers:{"content-type":"application/json; charset=utf-8"},data:e,params:this.buildParams(),doNotRetryTimeouts:!0,timeoutSecs:r,signal:n})}async getStatistics(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("statistics"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r}),ce())}async createItemsPublicUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:r,expiresInSecs:n,...i}=ln(e,pV,"DatasetClientCreateItemsUrlOptions"),o=await this.get({timeoutSecs:t,signal:r}),a=new URL(this.buildPublicUrl("items"));if(o?.urlSigningSecretKey){let e=await lD({resourceId:o.id,urlSigningSecretKey:o.urlSigningSecretKey,expiresInMillis:n?1e3*n:void 0});a.searchParams.set("signature",e)}return(a=lO(a,i)).toString()}#P(e,t){let r=e.headers["x-apify-pagination-desc"],n={items:e.data,total:Number(e.headers["x-apify-pagination-total"]),offset:Number(e.headers["x-apify-pagination-offset"]),count:e.data.length,limit:Number(e.headers["x-apify-pagination-limit"]),desc:"string"==typeof r?JSON.parse(r):t},i=e.headers["x-apify-pagination-count"];return void 0===i?n:Object.defineProperty(n,lR,{value:Number(i)})}};let pJ=iP({limit:ig().min(0).optional(),exclusiveStartKey:nY().optional(),collection:nY().optional(),prefix:nY().optional(),signature:nY().optional(),...lG}),pG=nY().min(1),pY=iP({limit:ig().min(0).optional(),exclusiveStartKey:nY().optional(),collection:nY().optional(),prefix:nY().optional(),expiresInSecs:ig().optional(),...lG}),pQ=nY(),pX=iP({buffer:iw().optional(),stream:iw().optional(),disableRedirect:iw().optional(),signature:nY().optional(),...lG}),p0=iP({key:nY(),value:i3(e=>void 0!==e&&"symbol"!=typeof e&&"bigint"!=typeof e&&"function"!=typeof e&&("number"!=typeof e||Number.isFinite(e)),"Expected a JSON-serializable value, binary data, or a stream"),contentType:nY().min(1).optional()}),p1=iP({...lG,doNotRetryTimeouts:iw().optional()});let KeyValueStoreClient=class KeyValueStoreClient extends ResourceClient{constructor(e){super({resourcePath:"key-value-stores",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(cr(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="long",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(cr(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}listKeys(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{timeoutSecs:r="medium",signal:n,...i}=ln(e,pJ,"KeyValueClientListKeysOptions"),o=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lm(await t.httpClient.call({url:t.buildUrl("keys"),method:"GET",params:t.buildParams(e),timeoutSecs:r,signal:n}),ci())},a=o(i);async function*s(){let e=await a;yield*e.items;let t=i.limit?i.limit-e.items.length:void 0;for(;e.items.length>0&&null!=e.nextExclusiveStartKey&&(void 0===t||t>0);){let r={...i,limit:t,exclusiveStartKey:e.nextExclusiveStartKey};e=await o(r),yield*e.items,t&&(t-=e.items.length)}}return Object.defineProperty(a,Symbol.asyncIterator,{value:s})}async getRecordPublicUrl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pG);let{timeoutSecs:r="long",signal:n}=ln(t,lY,"TimeoutOptions"),i=await this.get({timeoutSecs:r,signal:n}),o=new URL(this.buildPublicUrl(["records",e]));if(i?.urlSigningSecretKey){let t=await lj(i.urlSigningSecretKey,e);o.searchParams.append("signature",t)}return o.toString()}async createKeysPublicUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="long",signal:r,expiresInSecs:n,...i}=ln(e,pY,"KeyValueClientCreateKeysUrlOptions"),o=await this.get({timeoutSecs:t,signal:r}),a=new URL(this.buildPublicUrl("keys"));if(o?.urlSigningSecretKey){let e=await lD({resourceId:o.id,urlSigningSecretKey:o.urlSigningSecretKey,expiresInMillis:n?1e3*n:void 0});a.searchParams.set("signature",e)}return(a=lO(a,i)).toString()}async recordExists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:r="long",signal:n}=ln(t,lY,"TimeoutOptions"),i={url:this.buildUrl(["records",e]),method:"HEAD",params:this.buildParams(),timeoutSecs:r,signal:n};try{return await this.httpClient.call(i),!0}catch(e){lg(e)}return!1}async getRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pQ);let r=ln(t,pX,"KeyValueClientGetRecordOptions");if(r.stream&&!s3.isNode)throw Error("The stream option can only be used in Node.js environment.");"disableRedirect"in r&&oT.deprecated("The disableRedirect option for getRecord() is deprecated. It has no effect and will be removed in the following major release.");let n={attachment:"true"};r.signature&&(n.signature=r.signature);let i={url:this.buildUrl(["records",e]),method:"GET",params:this.buildParams(n),timeoutSecs:r.timeoutSecs??"long",signal:r.signal};r.buffer&&(i.responseType="buffer"),r.stream&&(i.responseType="stream");try{let t=await this.httpClient.call(i);return{key:e,value:t.data,contentType:t.headers["content-type"]}}catch(e){lg(e)}}async setRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,p0);let r=ln(t,p1,"KeyValueStoreRecordOptions"),{key:n}=e,{value:i,contentType:o}=e,{timeoutSecs:a="long",signal:s,doNotRetryTimeouts:l}=r,u=lE(i)||lw(i);if(o||(o=u?"application/octet-stream":"string"==typeof i?"text/plain; charset=utf-8":"application/json; charset=utf-8"),o.startsWith("application/json")&&!u&&"string"!=typeof i)try{i=JSON.stringify(i,null,2)}catch(e){throw Error(`The record value cannot be stringified to JSON. Please provide other content type.
|
|
68
|
+
Cause: ${e.message}`)}let c={url:this.buildUrl(["records",n]),method:"PUT",params:this.buildParams(),data:i,headers:o?{"content-type":o}:void 0,doNotRetryTimeouts:l,timeoutSecs:a,signal:s};await this.httpClient.call(c)}async deleteRecord(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,pQ);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl(["records",e]),method:"DELETE",params:this.buildParams(),timeoutSecs:r,signal:n})}};let p2=iP({limit:ig().min(0).optional(),...lG}),p4=iP({lockSecs:ig(),limit:ig().min(0).optional(),...lG}),p3=i3(e=>ld(e)&&void 0===e.id,"Expected a request object without an `id`"),p9=iP({forefront:iw().optional(),...lG}),p6=ix(p3).min(1),p5=iw().optional(),p8=ig().optional(),p7=ix(i3(e=>ld(e)&&("string"==typeof e.id||"string"==typeof e.uniqueKey),"Expected a request object with an `id` or a `uniqueKey`")).min(1).max(25),de=nY(),dt=i3(e=>ld(e)&&"string"==typeof e.id,"Expected a request object with an `id`"),dr=iP({lockSecs:ig(),forefront:iw().optional(),...lG}),dn=ix(iB(["locked","pending"])).min(1),di=iP({limit:ig().min(0).optional(),cursor:nY().optional(),filter:dn.optional(),...lG}),da=iP({limit:ig().min(0).optional(),maxPageLimit:ig().default(1e3),cursor:nY().optional(),filter:dn.optional(),...lG});let RequestQueueClient=class RequestQueueClient extends ResourceClient{#U;#I;constructor(e,t={}){super({resourcePath:"request-queues",...e}),this.#U=t.clientKey,this.#I=t.timeoutSecs}#L(e,t){return void 0!==e?e:void 0===this.#I||this.httpClient.timeoutMillis[t]/1e3<=this.#I?t:this.#I}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(cm(),{},this.#L(t,"short"),r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r,signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(cm(),e,this.#L(r,"short"),n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(this.#L(t,"short"),r)}async listHead(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,p2,"RequestQueueClientListHeadOptions");return lm(await this.httpClient.call({url:this.buildUrl("head"),method:"GET",timeoutSecs:this.#L(t.timeoutSecs,"short"),signal:t.signal,params:this.buildParams({limit:t.limit,clientKey:this.#U})}),cB())}async listAndLockHead(e){let t=ln(e,p4,"RequestQueueClientListAndLockHeadOptions");return lm(await this.httpClient.call({url:this.buildUrl("head/lock"),method:"POST",timeoutSecs:this.#L(t.timeoutSecs,"medium"),signal:t.signal,params:this.buildParams({limit:t.limit,lockSecs:t.lockSecs,clientKey:this.#U})}),cq())}async addRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,p3);let r=ln(t,p9,"RequestQueueClientAddRequestOptions");return lm(await this.httpClient.call({url:this.buildUrl("requests"),method:"POST",timeoutSecs:this.#L(r.timeoutSecs,"short"),signal:r.signal,data:e,params:this.buildParams({forefront:r.forefront,clientKey:this.#U})}),cT())}async addRequestBatch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ln(t,p9,"RequestQueueClientAddRequestOptions");return lm(await this.httpClient.call({url:this.buildUrl("requests/batch"),method:"POST",timeoutSecs:this.#L(r.timeoutSecs,"medium"),signal:r.signal,headers:{"content-type":"application/json"},data:`[${e.map(e=>{let{json:t}=e;return t}).join(",")}]`,params:this.buildParams({forefront:r.forefront,clientKey:this.#U})}),cP())}async addRequestBatchWithRetries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{forefront:r,timeoutSecs:n,signal:i,maxUnprocessedRequestsRetries:o=3,minDelayBetweenUnprocessedRequestsRetriesMillis:a=500}=t,s=e,l=[],u=[];for(let t=0;t<1+o;t++){try{let o=await this.addRequestBatch(s,{forefront:r,timeoutSecs:n,signal:i});l.push(...o.processedRequests),u=o.unprocessedRequests,0!==u.length&&this.httpClient.stats.addRateLimitError(t+1);let a=l.map(e=>{let{uniqueKey:t}=e;return t});if(s=e.filter(e=>{let{request:t}=e;return!a.includes(t.uniqueKey)}),0===s.length)break}catch(r){if(i?.throwIfAborted(),r instanceof ResponseValidationError)throw r;oT.exception(r,"Request batch insert failed");let t=l.map(e=>{let{uniqueKey:t}=e;return t});u=e.filter(e=>{let{request:r}=e;return!t.includes(r.uniqueKey)}).map(e=>{let{request:{method:t,uniqueKey:r,url:n}}=e;return{method:t,uniqueKey:r,url:n}});break}let o=Math.floor((1+Math.random())*2**t*a);await lx(o,i),i?.throwIfAborted()}return{processedRequests:l,unprocessedRequests:u}}async batchAddRequests(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{forefront:r,timeoutSecs:n,signal:i,maxUnprocessedRequestsRetries:o=3,maxParallel:a=5,minDelayBetweenUnprocessedRequestsRetriesMillis:s=500}=t;ln(e,p6),ln(r,p5),ln(n,lV),ln(i,lJ),ln(o,p8),ln(a,p8),ln(s,p8);let l=new Set,u=[],c=9437184-Math.ceil(9437184*1e-4);for(let r of function(e,t){let{maxCount:r,maxByteLength:n}=t,i=[],o=[],a=1;for(let t of e)o.length>0&&(o.length>=r||a+t.byteLength+1>n)&&(i.push(o),o=[],a=1),o.push(t),a+=t.byteLength+1;return o.length>0&&i.push(o),i}(e.map((e,t)=>{let r=JSON.stringify(e),n=la.encode(r).byteLength;if(n+2>c)throw Error(`RequestQueueClient.batchAddRequests: The size of the request with index: ${t} exceeds the maximum allowed size (${c} bytes).`);return{request:e,json:r,byteLength:n}}),{maxCount:25,maxByteLength:c})){let e=this.addRequestBatchWithRetries(r,t);l.add(e),e.then(t=>{l.delete(e),u.push(t)},()=>void 0),l.size>=a&&await Promise.race(l)}await Promise.all(l);let p={processedRequests:[],unprocessedRequests:[]};return u.forEach(e=>{let{processedRequests:t,unprocessedRequests:r}=e;p.processedRequests.push(...t),p.unprocessedRequests.push(...r)}),p}async batchDeleteRequests(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,p7);let{timeoutSecs:r,signal:n}=ln(t,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("requests/batch"),method:"DELETE",timeoutSecs:this.#L(r,"short"),signal:n,data:e,params:this.buildParams({clientKey:this.#U})}),cz())}async getRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,de);let{timeoutSecs:r,signal:n}=ln(t,lY,"TimeoutOptions"),i={url:this.buildUrl(["requests",e]),method:"GET",timeoutSecs:this.#L(r,"short"),signal:n,params:this.buildParams()};try{let e=await this.httpClient.call(i);return lm(e,cR())}catch(e){lg(e)}}async updateRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dt);let r=ln(t,p9,"RequestQueueClientAddRequestOptions");return lm(await this.httpClient.call({url:this.buildUrl(["requests",e.id]),method:"PUT",timeoutSecs:this.#L(r.timeoutSecs,"medium"),signal:r.signal,data:e,params:this.buildParams({forefront:r.forefront,clientKey:this.#U})}),cT())}async deleteRequest(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,de);let{timeoutSecs:r,signal:n}=ln(t,lY,"TimeoutOptions");await this.httpClient.call({url:this.buildUrl(["requests",e]),method:"DELETE",timeoutSecs:this.#L(r,"short"),signal:n,params:this.buildParams({clientKey:this.#U})})}async prolongRequestLock(e,t){ln(e,de);let r=ln(t,dr,"RequestQueueClientProlongRequestLockOptions");return lm(await this.httpClient.call({url:this.buildUrl(["requests",e,"lock"]),method:"PUT",timeoutSecs:this.#L(r.timeoutSecs,"medium"),signal:r.signal,params:this.buildParams({forefront:r.forefront,lockSecs:r.lockSecs,clientKey:this.#U})}),cD())}async deleteRequestLock(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,de);let r=ln(t,p9,"RequestQueueClientDeleteRequestLockOptions");await this.httpClient.call({url:this.buildUrl(["requests",e,"lock"]),method:"DELETE",timeoutSecs:this.#L(r.timeoutSecs,"short"),signal:r.signal,params:this.buildParams({forefront:r.forefront,clientKey:this.#U})})}listRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t=this;let{timeoutSecs:r,signal:n,...i}=ln(e,di,"RequestQueueClientListRequestsOptions"),o=this.#L(r,"medium"),a=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return lm(await t.httpClient.call({url:t.buildUrl("requests"),method:"GET",timeoutSecs:o,signal:n,params:t.buildParams({...e,filter:e.filter?e.filter.join(","):void 0,clientKey:t.#U})}),cO())},s=a(i);async function*l(){let e=await s;yield*e.items;let t=i.limit?i.limit-e.items.length:void 0;for(;e.items.length>0&&e.nextCursor&&(void 0===t||t>0);){let r={...i,limit:t,cursor:e.nextCursor};e=await a(r),yield*e.items,t&&(t-=e.items.length)}}return Object.defineProperty(s,Symbol.asyncIterator,{value:l})}async unlockRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("requests/unlock"),method:"POST",timeoutSecs:this.#L(t,"long"),signal:r,params:this.buildParams({clientKey:this.#U})}),cN())}paginateRequests(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{limit:t,cursor:r,filter:n,maxPageLimit:i,timeoutSecs:o,signal:a}=ln(e,da,"RequestQueueClientPaginateRequestsOptions");return new RequestQueuePaginationIterator({getPage:async e=>this.listRequests({...e,filter:n,timeoutSecs:o,signal:a}),limit:t,cursor:r,maxPageLimit:i})}};let ds=iP({waitForFinish:ig().optional(),...lG}),dl=iP({gracefully:iw().optional(),...lG}),du=nY(),dc=iP({contentType:nY().optional(),build:nY().optional(),...lG}),dp=iP({build:nY().optional(),memory:ig().optional(),runTimeoutSecs:ig().optional(),maxItems:ig().optional(),maxTotalChargeUsd:ig().optional(),restartOnError:iw().optional(),...lG}),dd=iP({eventName:nY(),count:ig().default(1),idempotencyKey:nY().optional(),...lG}),df=iP({waitSecs:ig().optional(),...lG}),dh=iP({clean:iw().optional(),fields:ix(nY()).optional(),omit:ix(nY()).optional(),...lS,skipEmpty:iw().optional(),skipHidden:iw().optional(),unwind:ix(nY()).optional(),pollIntervalSecs:ig().min(0).optional(),...lG});let RunClient=class RunClient extends ResourceClient{constructor(e){super({...e,resourcePath:e.resourcePath||"actor-runs"})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r,...n}=ln(e,ds,"RunGetOptions");return this.getResource(u6(),n,this.timeoutForWaitForFinish(t,"short",n.waitForFinish),r)}async abort(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r,...n}=ln(e,dl,"RunAbortOptions");return lm(await this.httpClient.call({url:this.buildUrl("abort"),method:"POST",params:this.buildParams(n),timeoutSecs:t,signal:r}),u6())}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async metamorph(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};ln(e,du);let n=ln(r,dc,"RunMetamorphOptions"),i={targetActorId:this.toSafeId(e),build:n.build},o={url:this.buildUrl("metamorph"),method:"POST",data:t,params:this.buildParams(i),stringifyFunctions:!0,timeoutSecs:n.timeoutSecs??"medium",signal:n.signal};return n.contentType&&(o.headers={"content-type":n.contentType}),lm(await this.httpClient.call(o),u6())}async reboot(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r}=ln(e,lY,"TimeoutOptions"),n={url:this.buildUrl("reboot"),method:"POST",timeoutSecs:t,signal:r};return lm(await this.httpClient.call(n),u6())}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(u6(),e,r,n)}async resurrect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r,runTimeoutSecs:n,...i}=ln(e,dp,"RunResurrectOptions");return lm(await this.httpClient.call({url:this.buildUrl("resurrect"),method:"POST",params:this.buildParams({...i,timeout:n}),timeoutSecs:t,signal:r}),u6())}async charge(e){let{eventName:t,count:r,idempotencyKey:n,timeoutSecs:i="short",signal:o}=ln(e,dd,"RunChargeOptions"),a=(Math.random()+1).toString(36).slice(3,8),s=n??`${this.id}-${t}-${Date.now()}-${a}`,l={url:this.buildUrl("charge"),method:"POST",data:{eventName:t,count:r},headers:{"idempotency-key":s},timeoutSecs:i,signal:o};return await this.httpClient.call(l)}async waitForFinish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,df,"RunWaitForFinishOptions");return this.waitForJobFinish(u6(),t)}dataset(){return new DatasetClient(this.subResourceOptions({resourcePath:"dataset"}))}keyValueStore(){return new KeyValueStoreClient(this.subResourceOptions({resourcePath:"key-value-store"}))}requestQueue(){return new RequestQueueClient(this.subResourceOptions({resourcePath:"request-queue"}))}log(){return new LogClient(this.subResourceOptions({resourcePath:"log"}))}async getStreamedLog(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ln(e.timeoutSecs,lV),ln(e.signal,lJ);let{fromStart:t=!0,timeoutSecs:r="long",signal:n}=e,{toLog:i}=e;if(null!==i&&s3.isNode){if(void 0===i||"default"===i){let e=await this.get({timeoutSecs:r,signal:n}),t=e?.id??"",o=e?.actId??"",a=o?await this.apifyClient.actor(o).get({timeoutSecs:r,signal:n}):void 0,s=[a?.name??"",`runId:${t}`].filter(Boolean).join(" ");i=new Log({level:od.DEBUG,prefix:`${s} -> `,logger:new LoggerActorRedirect})}return new StreamedLog({logClient:this.log(),toLog:i,fromStart:t,signal:n})}}async *iterateDatasetItems(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{offset:t,limit:r,chunkSize:n,pollIntervalSecs:i=5,timeoutSecs:o="long",signal:a,...s}=ln(e,dh,"RunIterateDatasetItemsOptions"),l=n||1e3,u=t??0,c=r?u+r:void 0,p=await this.get({timeoutSecs:o,signal:a}),d=p&&p.id!==this.id?this.apifyClient.run(p.id):this,f=d.dataset(),h=async(e,t)=>f.listItems({...s,offset:e,limit:t,timeoutSecs:o,signal:a});for(;;){let e=!p||oo.includes(p.status),t=await f.get({timeoutSecs:o,signal:a}),r=t?.itemCount??0;for(void 0!==c&&(r=Math.min(r,c));u<r;){let e=Math.min(l,r-u),t=await h(u,e);yield*t.items,u+=e}if(void 0!==c&&u>=c)return;if(e)break;p=await d.waitForFinish({waitSecs:i,timeoutSecs:o,signal:a})}let{clean:m,skipEmpty:g,unwind:y}=s;for(;;){let e=void 0!==c?Math.min(l,c-u):l,t=await h(u,e);if(yield*t.items,0===t.items.length&&!t[lR]&&(!(m||g||y?.length)||0===(await f.listItems({offset:u,limit:1,timeoutSecs:o,signal:a})).items.length)||(u+=e,void 0!==c&&u>=c))return}}};let dm=iB(oi),dg=iP({...lS,desc:iw().optional(),status:iL([dm,ix(dm)]).optional(),startedBefore:iL([iA(),nY()]).optional(),startedAfter:iL([iA(),nY()]).optional(),...lG});let RunCollectionClient=class RunCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"runs",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dg,"RunCollectionListOptions");return this.listResourcesPaginated(uX(),t,"medium")}};let dy=iP({...lS,desc:iw().optional(),...lG}),db=lf.optional();let WebhookCollectionClient=class WebhookCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"webhooks",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dy,"WebhookCollectionListOptions");return this.listResourcesPaginated(uM(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,db);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(cY(),e,r,n)}};let dv=iP({build:nY().optional(),contentType:nY().optional(),memory:ig().optional(),runTimeoutSecs:ig().min(0).optional(),waitForFinish:ig().optional(),webhooks:ix(lf).optional(),maxItems:ig().min(0).optional(),maxTotalChargeUsd:ig().min(0).optional(),restartOnError:iw().optional(),forcePermissionLevel:iB(oc).optional(),waitForResources:iL([iw(),ig().min(0)]).optional(),...lG}),dw=iP({build:nY().optional(),contentType:nY().optional(),memory:ig().optional(),runTimeoutSecs:ig().min(0).optional(),waitSecs:ig().min(0).optional(),webhooks:ix(lf).optional(),maxItems:ig().min(0).optional(),maxTotalChargeUsd:ig().min(0).optional(),log:iL([new i_({type:"null",...ea(void 0)}),i6(Log),iq("default")]).optional(),restartOnError:iw().optional(),forcePermissionLevel:iB(oc).optional(),waitForResources:iL([iw(),ig().min(0)]).optional(),...lG}),d_=iP({build:nY().optional(),contentType:nY().optional(),...lG}),dE=nY().min(1),dS=iP({betaPackages:iw().optional(),tag:nY().optional(),useCache:iw().optional(),waitForFinish:ig().optional(),...lG}),dR=iP({waitForFinish:ig().optional(),...lG}),dO=iP({status:iB(oi).optional(),origin:iB(oa).optional()});let ActorClient=class ActorClient extends ResourceClient{constructor(e){super({resourcePath:"actors",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(uP(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(uP(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async start(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ln(t,dv,"ActorStartOptions"),{waitForFinish:n,runTimeoutSecs:i,memory:o,build:a,maxItems:s,maxTotalChargeUsd:l,restartOnError:u,forcePermissionLevel:c,waitForResources:p,timeoutSecs:d,signal:f}=r,h={waitForFinish:n,timeout:i,memory:o,build:a,webhooks:lb(r.webhooks),maxItems:s,maxTotalChargeUsd:l,restartOnError:u,forcePermissionLevel:c},m={url:this.buildUrl("runs"),method:"POST",data:e,params:this.buildParams(h),stringifyFunctions:!0,timeoutSecs:this.timeoutForWaitForFinish(d,"medium",n),signal:f};return r.contentType&&(m.headers={"content-type":r.contentType}),lm(await pk(async()=>this.httpClient.call(m),!lE(e)&&p,this.httpClient.logger,f),u6())}async call(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{waitSecs:r,log:n,timeoutSecs:i="noTimeout",signal:o,...a}=ln(t,dw,"ActorCallOptions"),{id:s}=await this.start(e,{...a,timeoutSecs:i,signal:o}),l=this.apifyClient.run(s),u=await l.getStreamedLog({toLog:n,signal:o});return u?.start(),this.apifyClient.run(s).waitForFinish({waitSecs:r,timeoutSecs:i,signal:o}).finally(async()=>{await u?.stop()})}async validateInput(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ln(t,d_,"ActorValidateInputOptions"),n={url:this.buildUrl("validate-input"),method:"POST",data:e,params:this.buildParams({build:r.build}),stringifyFunctions:!0,timeoutSecs:r.timeoutSecs??"short",signal:r.signal};return r.contentType&&(n.headers={"content-type":r.contentType}),(await this.httpClient.call(n)).data.valid}async build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dE);let{timeoutSecs:r,signal:n,...i}=ln(t,dS,"ActorBuildOptions");return lm(await this.httpClient.call({url:this.buildUrl("builds"),method:"POST",params:this.buildParams({version:e,...i}),timeoutSecs:this.timeoutForWaitForFinish(r,"medium",i.waitForFinish),signal:n}),uG())}async defaultBuild(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t,signal:r,...n}=ln(e,dR,"BuildClientGetOptions"),{id:i}=lm(await this.httpClient.call({url:this.buildUrl("builds/default"),method:"GET",params:this.buildParams(n),timeoutSecs:this.timeoutForWaitForFinish(t,"short",n.waitForFinish),signal:r}),uG());return new BuildClient({baseUrl:this.apifyClient.baseUrl,publicBaseUrl:this.apifyClient.publicBaseUrl,httpClient:this.httpClient,apifyClient:this.apifyClient,id:i})}lastRun(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dO,"ActorLastRunOptions");return new RunClient(this.subResourceOptions({id:"last",params:this.buildParams(t),resourcePath:"runs"}))}builds(){return new BuildCollectionClient(this.subResourceOptions({resourcePath:"builds"}))}runs(){return new RunCollectionClient(this.subResourceOptions({resourcePath:"runs"}))}version(e){return ln(e,dE),new ActorVersionClient(this.subResourceOptions({id:e}))}versions(){return new ActorVersionCollectionClient(this.subResourceOptions())}webhooks(){return new WebhookCollectionClient(this.subResourceOptions())}};let dC=lf.optional();let ActorCollectionClient=class ActorCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"actors",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dT,"ActorCollectionListOptions");return this.listResourcesPaginated(uo(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dC);let{timeoutSecs:r="medium",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(uP(),e,r,n)}};var dA=((U={}).CREATED_AT="createdAt",U.LAST_RUN_STARTED_AT="stats.lastRunStartedAt",U);let dT=iP({my:iw().optional(),...lS,desc:iw().optional(),sortBy:iB(dA).optional(),...lG}),dx=iP({unnamed:iw().optional(),...lS,desc:iw().optional(),ownership:iB(op).optional(),...lG}),dk=nY().optional(),dP=lf.optional();let DatasetCollectionClient=class DatasetCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"datasets",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dx,"DatasetCollectionClientListOptions");return this.listResourcesPaginated(c0(),t,"medium")}async getOrCreate(e,t){ln(e,dk),ln(t?.schema,dP),ln(t?.timeoutSecs,lV),ln(t?.signal,lJ);let{timeoutSecs:r="short",signal:n,...i}=t??{},o=Object.keys(i).length>0;return this.getOrCreateResource(u8(),e,o?i:void 0,r,n)}};let dU=iP({unnamed:iw().optional(),...lS,desc:iw().optional(),ownership:iB(op).optional(),...lG}),dI=nY().optional(),dL=lf.optional();let KeyValueStoreCollectionClient=class KeyValueStoreCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"key-value-stores",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dU,"KeyValueStoreCollectionClientListOptions");return this.listResourcesPaginated(cQ(),t,"medium")}async getOrCreate(e,t){ln(e,dI),ln(t?.schema,dL),ln(t?.timeoutSecs,lV),ln(t?.signal,lJ);let{timeoutSecs:r="short",signal:n,...i}=t??{},o=Object.keys(i).length>0;return this.getOrCreateResource(cr(),e,o?i:void 0,r,n)}};let dz=iP({unnamed:iw().optional(),...lS,desc:iw().optional(),ownership:iB(op).optional(),...lG}),dN=nY().optional();let RequestQueueCollectionClient=class RequestQueueCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"request-queues",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dz,"RequestQueueCollectionListOptions");return this.listResourcesPaginated(c2(),t,"medium")}async getOrCreate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dN);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.getOrCreateResource(cm(),e,void 0,r,n)}};let dj=ix(ps());let ScheduleClient=class ScheduleClient extends ResourceClient{constructor(e){super({resourcePath:"schedules",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(pa(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(pa(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async getLog(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("log"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r}),dj)}};let dD=iP({...lS,desc:iw().optional(),...lG}),d$=lf.optional();let ScheduleCollectionClient=class ScheduleCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"schedules",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dD,"ScheduleCollectionListOptions");return this.listResourcesPaginated(pt(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,d$);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(pa(),e,r,n)}};let dM=iP({...lS,search:nY().optional(),sortBy:nY().optional(),category:nY().optional(),username:nY().optional(),pricingModel:nY().optional(),includeUnrunnableActors:iw().optional(),...lG});let StoreCollectionClient=class StoreCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"store",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dM,"StoreCollectionListOptions");return this.listResourcesPaginated(pc(),t,"medium")}};let dB=lf.optional(),dF=iP({build:nY().optional(),memory:ig().optional(),runTimeoutSecs:ig().min(0).optional(),waitForFinish:ig().optional(),webhooks:ix(lf).optional(),maxItems:ig().min(0).optional(),maxTotalChargeUsd:ig().min(0).optional(),restartOnError:iw().optional(),waitForResources:iL([iw(),ig().min(0)]).optional(),...lG}),dq=iP({build:nY().optional(),memory:ig().optional(),runTimeoutSecs:ig().min(0).optional(),waitSecs:ig().min(0).optional(),webhooks:ix(lf).optional(),maxItems:ig().min(0).optional(),maxTotalChargeUsd:ig().min(0).optional(),restartOnError:iw().optional(),waitForResources:iL([iw(),ig().min(0)]).optional(),...lG}),dW=iP({status:iB(oi).optional(),origin:iB(oa).optional()});let TaskClient=class TaskClient extends ResourceClient{constructor(e){super({resourcePath:"actor-tasks",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(cG(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(cG(),e,r,n)}async publish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.update({isPublic:!0},e)}async unpublish(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.update({isPublic:!1},e)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async start(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dB);let r=ln(t,dF,"TaskStartOptions"),{waitForFinish:n,runTimeoutSecs:i,memory:o,build:a,maxItems:s,maxTotalChargeUsd:l,restartOnError:u,waitForResources:c,timeoutSecs:p,signal:d}=r,f={waitForFinish:n,timeout:i,memory:o,build:a,webhooks:lb(r.webhooks),maxItems:s,maxTotalChargeUsd:l,restartOnError:u},h={url:this.buildUrl("runs"),method:"POST",data:e,params:this.buildParams(f),stringifyFunctions:!0,headers:{"Content-Type":"application/json"},timeoutSecs:this.timeoutForWaitForFinish(p,"medium",n),signal:d};return lm(await pk(async()=>this.httpClient.call(h),!lE(e)&&c,this.httpClient.logger,d),u6())}async call(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dB);let{waitSecs:r,timeoutSecs:n="noTimeout",signal:i,...o}=ln(t,dq,"TaskCallOptions"),{id:a}=await this.start(e,{...o,timeoutSecs:n,signal:i});return this.apifyClient.run(a).waitForFinish({waitSecs:r,timeoutSecs:n,signal:i})}async getInput(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("input"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r})).data}async updateInput(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return(await this.httpClient.call({url:this.buildUrl("input"),method:"PUT",params:this.buildParams(),data:e,timeoutSecs:r,signal:n})).data}lastRun(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dW,"TaskLastRunOptions");return new RunClient(this.subResourceOptions({id:"last",params:this.buildParams(t),resourcePath:"runs"}))}runs(){return new RunCollectionClient(this.subResourceOptions({resourcePath:"runs"}))}webhooks(){return new WebhookCollectionClient(this.subResourceOptions())}};let dZ=iP({...lS,desc:iw().optional(),...lG});let TaskCollectionClient=class TaskCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"actor-tasks",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dZ,"TaskCollectionListOptions");return this.listResourcesPaginated(cK(),t,"medium")}async create(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="medium",signal:n}=ln(t,lY,"TimeoutOptions");return this.createResource(cG(),e,r,n)}};let UserClient=class UserClient extends ResourceClient{constructor(e){super({resourcePath:"users",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(pb(),{},t,r)}async monthlyUsage(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("usage/monthly"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r}),pO())}async limits(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("limits"),method:"GET",params:this.buildParams(),timeoutSecs:t,signal:r}),pT())}async updateLimits(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions"),i={url:this.buildUrl("limits"),method:"PUT",params:this.buildParams(),data:e,timeoutSecs:r,signal:n};await this.httpClient.call(i)}};let dK=iP({...lS,desc:iw().optional(),...lG});let WebhookDispatchCollectionClient=class WebhookDispatchCollectionClient extends ResourceCollectionClient{constructor(e){super({resourcePath:"webhook-dispatches",...e})}list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=ln(e,dK,"WebhookDispatchCollectionListOptions");return this.listResourcesPaginated(c9(),t,"medium")}};let WebhookClient=class WebhookClient extends ResourceClient{constructor(e){super({resourcePath:"webhooks",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(cY(),{},t,r)}async update(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,lf);let{timeoutSecs:r="short",signal:n}=ln(t,lY,"TimeoutOptions");return this.updateResource(cY(),e,r,n)}async delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.deleteResource(t,r)}async test(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="medium",signal:r}=ln(e,lY,"TimeoutOptions");return lm(await this.httpClient.call({url:this.buildUrl("test"),method:"POST",params:this.buildParams(),timeoutSecs:t,signal:r}),c3())}dispatches(){return new WebhookDispatchCollectionClient(this.subResourceOptions({resourcePath:"dispatches"}))}};let WebhookDispatchClient=class WebhookDispatchClient extends ResourceClient{constructor(e){super({resourcePath:"webhook-dispatches",...e})}async get(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{timeoutSecs:t="short",signal:r}=ln(e,lY,"TimeoutOptions");return this.getResource(c3(),{},t,r)}};let dH="https://api.apify.com";function dV(e){let t=new URL(e),r=t.pathname.replace(/\/+$/,"");return t.pathname=r.endsWith("/v2")?r:`${r}/v2`,t.href}let dJ=iP({baseUrl:nY().default(dH),compression:lK.default("brotli"),headers:i$(nY(),nY()).optional(),publicBaseUrl:nY().default(dH),maxRetries:l1.maxRetries.default(8),minDelayBetweenRetriesMillis:l1.minDelayBetweenRetriesMillis.default(500),timeoutShortSecs:l1.timeoutShortSecs.default(5),timeoutMediumSecs:l1.timeoutMediumSecs.default(30),timeoutLongSecs:l1.timeoutLongSecs.default(360),timeoutMaxSecs:l1.timeoutMaxSecs.default(360),token:nY().optional(),userAgentSuffix:iL([nY(),ix(nY())]).optional()}),dG=iP({baseUrl:nY().default(dH),publicBaseUrl:nY().default(dH),token:nY().optional(),httpClient:i6(HttpClient)}),dY=nY().min(1),dQ=iP({clientKey:nY().min(1).optional(),timeoutSecs:ig().positive().optional()});let ApifyClient=class ApifyClient{baseUrl;publicBaseUrl;token;stats;logger;#z;#N;constructor(e={}){let t=ln(e,dJ,"ApifyClientOptions"),{baseUrl:r,compression:n,headers:i,publicBaseUrl:o,maxRetries:a,minDelayBetweenRetriesMillis:s,timeoutShortSecs:l,timeoutMediumSecs:u,timeoutLongSecs:c,timeoutMaxSecs:p,token:d}=t;this.baseUrl=dV(r),this.publicBaseUrl=dV(o),this.token=d,this.stats=new Statistics,this.logger=oT.child({prefix:"ApifyClient"}),this.#N={stats:this.stats,maxRetries:a,minDelayBetweenRetriesMillis:s,compression:n,headers:i,timeoutShortSecs:l,timeoutMediumSecs:u,timeoutLongSecs:c,timeoutMaxSecs:p,logger:this.logger,token:this.token,userAgentSuffix:t.userAgentSuffix}}static withCustomHttpClient(e){let{httpClient:t,...r}=ln(e,dG,"ApifyClientCustomHttpClientOptions"),n=new ApifyClient(r);return n.httpClient=t,n}get httpClient(){return this.#z??=new AxiosHttpClient(this.#N),this.#z}set httpClient(e){this.token&&e.setDefaultAuthorization(this.token),this.#z=e,this.stats=e.stats}#j(){return{baseUrl:this.baseUrl,publicBaseUrl:this.publicBaseUrl,apifyClient:this,httpClient:this.httpClient}}actors(){return new ActorCollectionClient(this.#j())}actor(e){return ln(e,dY),new ActorClient({id:e,...this.#j()})}builds(){return new BuildCollectionClient(this.#j())}build(e){return ln(e,dY),new BuildClient({id:e,...this.#j()})}datasets(){return new DatasetCollectionClient(this.#j())}dataset(e){return ln(e,dY),new DatasetClient({id:e,...this.#j()})}keyValueStores(){return new KeyValueStoreCollectionClient(this.#j())}keyValueStore(e){return ln(e,dY),new KeyValueStoreClient({id:e,...this.#j()})}log(e){return ln(e,dY),new LogClient({id:e,...this.#j()})}requestQueues(){return new RequestQueueCollectionClient(this.#j())}requestQueue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ln(e,dY);let r=ln(t,dQ,"RequestQueueUserOptions");return new RequestQueueClient({id:e,...this.#j()},r)}runs(){return new RunCollectionClient({...this.#j(),resourcePath:"actor-runs"})}run(e){return ln(e,dY),new RunClient({id:e,...this.#j()})}tasks(){return new TaskCollectionClient(this.#j())}task(e){return ln(e,dY),new TaskClient({id:e,...this.#j()})}schedules(){return new ScheduleCollectionClient(this.#j())}schedule(e){return ln(e,dY),new ScheduleClient({id:e,...this.#j()})}user(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"me";return ln(e,dY),new UserClient({id:e,...this.#j()})}webhooks(){return new WebhookCollectionClient(this.#j())}webhook(e){return ln(e,dY),new WebhookClient({id:e,...this.#j()})}webhookDispatches(){return new WebhookDispatchCollectionClient(this.#j())}webhookDispatch(e){return ln(e,dY),new WebhookDispatchClient({id:e,...this.#j()})}store(){return new StoreCollectionClient(this.#j())}async setStatusMessage(e,t){let r=lv(ol);if(!r)throw Error(`Environment variable ${ol} is not set!`);await this.run(r).update({statusMessage:e,...t})}}})();var i=n.TD,o=n.B,a=n.h0,s=n.XP,l=n.v8,u=n.Lu,c=n.vp,p=n.Jo,d=n.UP,f=n.rj,h=n.Ns,m=n.yD,g=n.Ip,y=n.kt,b=n.KW,v=n.fK,w=n.wb,_=n.wv,E=n.yY,S=n.qQ,R=n._,O=n.Qq,C=n.tY,A=n.rE,T=n.PD,x=n.lE,k=n.ss,P=n.kq,U=n.m_,I=n.O_,L=n.OE,z=n.oc,N=n.oW,j=n.dK,D=n.Ry,$=n.Ng,M=n.Hg,B=n.L6,F=n.Ty,q=n.gP,W=n.py,Z=n.YS,K=n.t1,H=n.jE,V=n.D_,J=n.jx,G=n.F,Y=n.J_,Q=n.hH,X=n.zC,ee=n._l;export{i as ActorClient,o as ActorCollectionClient,a as ActorEnvVarClient,s as ActorEnvVarCollectionClient,l as ActorListSortBy,u as ActorSourceType,c as ActorVersionClient,p as ActorVersionCollectionClient,d as ApifyApiError,f as ApifyClient,h as ArgumentValidationError,m as AxiosHttpClient,g as BrotliHttpCompressor,y as BuildClient,b as BuildCollectionClient,v as ConflictError,w as DatasetClient,_ as DatasetCollectionClient,E as DownloadItemsFormat,S as ForbiddenError,R as GzipHttpCompressor,O as HttpClient,C as InvalidRequestError,A as InvalidResponseBodyError,T as KeyValueStoreClient,x as KeyValueStoreCollectionClient,k as LogClient,P as LoggerActorRedirect,U as NotFoundError,I as PlatformFeature,L as RateLimitError,z as RequestQueueClient,N as RequestQueueCollectionClient,j as ResponseValidationError,D as RunClient,$ as RunCollectionClient,M as ScheduleActions,B as ScheduleClient,F as ScheduleCollectionClient,q as ServerError,W as StoreCollectionClient,Z as StreamedLog,K as TaskClient,H as TaskCollectionClient,V as UnauthorizedError,J as UserClient,G as WebhookClient,Y as WebhookCollectionClient,Q as WebhookDispatchClient,X as WebhookDispatchCollectionClient,ee as WebhookDispatchStatus};
|
|
69
69
|
//# sourceMappingURL=bundle.js.map
|