PageSourceSearch

https://www.swipephotos.com/_next/static/chunks/b478a885.3ddcc9a460f07513.js

js swipephotos.com collected 2026-10-02 15:28:05 UTC 81,309 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1162],{16337:(e,t,r)=>{r.r(t),r.d(t,{alphamask:()=>rb,applySegmentationMask:()=>rk,preload:()=>rg,removeBackground:()=>rv,removeForeground:()=>r_,segmentForeground:()=>rw});var a,n,i,s,o,u,d,l=Object.create,c=Object.defineProperty,h=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,f=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,y=(e,t)=>function(){return t||(0,e[p(e)[0]])((t={exports:{}}).exports,t),t.exports},g=(e,t,r)=>(r=null!=e?l(f(e)):{},((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let n of p(t))m.call(e,n)||n===r||c(e,n,{get:()=>t[n],enumerable:!(a=h(t,n))||a.enumerable});return e})(!t&&e&&e.__esModule?r:c(r,"default",{value:e,enumerable:!0}),e)),v=y({"../../node_modules/.pnpm/[email protected]/node_modules/iota-array/iota.js"(e,t){t.exports=function(e){for(var t=Array(e),r=0;r<e;++r)t[r]=r;return t}}}),_=y({"../../node_modules/.pnpm/[email protected]/node_modules/is-buffer/index.js"(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){var t;return null!=e&&(r(e)||"function"==typeof(t=e).readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))||!!e._isBuffer)}}}),b=y({"../../node_modules/.pnpm/[email protected]/node_modules/ndarray/ndarray.js"(e,t){var r=v(),a=_(),n="undefined"!=typeof Float64Array;function i(e,t){return e[0]-t[0]}function s(){var e,t=this.stride,r=Array(t.length);for(e=0;e<r.length;++e)r[e]=[Math.abs(t[e]),e];r.sort(i);var a=Array(r.length);for(e=0;e<a.length;++e)a[e]=r[e][1];return a}var o={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};t.exports=function(e,t,i,u){if(void 0===e){var d=o.array[0];return d([])}"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var l=t.length;if(void 0===i){i=Array(l);for(var c=l-1,h=1;c>=0;--c)i[c]=h,h*=t[c]}if(void 0===u){u=0;for(var c=0;c<l;++c)i[c]<0&&(u-=(t[c]-1)*i[c])}for(var p=function(e){if(a(e))return"buffer";if(n)switch(Object.prototype.toString.call(e)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(e)?"array":"generic"}(e),f=o[p];f.length<=l+1;)f.push(function(e,t){var a="View"+t+"d"+e;t<0&&(a="View_Nil"+e);var n="generic"===e;if(-1===t){var i="function "+a+"(a){this.data=a;};var proto="+a+".prototype;proto.dtype='"+e+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+a+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+a+"(a){return new "+a+"(a);}",u=Function(i);return u()}if(0===t){var i="function "+a+"(a,d) {this.data = a;this.offset = d};var proto="+a+".prototype;proto.dtype='"+e+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+a+"_copy() {return new "+a+"(this.data,this.offset)};proto.pick=function "+a+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+a+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+a+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+a+"(a,b,c,d){return new "+a+"(a,d)}",u=Function("TrivialArray",i);return u(o[e][0])}var i=["'use strict'"],d=r(t),l=d.map(function(e){return"i"+e}),c="this.offset+"+d.map(function(e){return"this.stride["+e+"]*i"+e}).join("+"),h=d.map(function(e){return"b"+e}).join(","),p=d.map(function(e){return"c"+e}).join(",");i.push("function "+a+"(a,"+h+","+p+",d){this.data=a","this.shape=["+h+"]","this.stride=["+p+"]","this.offset=d|0}","var proto="+a+".prototype","proto.dtype='"+e+"'","proto.dimension="+t),i.push("Object.defineProperty(proto,'size',{get:function "+a+"_size(){return "+d.map(function(e){return"this.shape["+e+"]"}).join("*"),"}})"),1===t?i.push("proto.order=[0]"):(i.push("Object.defineProperty(proto,'order',{get:"),t<4?(i.push("function "+a+"_order(){"),2===t?i.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+a+"_set("+l.join(",")+",v){"),n?i.push("return this.data.set("+c+",v)}"):i.push("return this.data["+c+"]=v}"),i.push("proto.get=function "+a+"_get("+l.join(",")+"){"),n?i.push("return this.data.get("+c+")}"):i.push("return this.data["+c+"]}"),i.push("proto.index=function "+a+"_index(",l.join(),"){return "+c+"}"),i.push("proto.hi=function "+a+"_hi("+l.join(",")+"){return new "+a+"(this.data,"+d.map(function(e){return"(typeof i"+e+"!=='number'||i"+e+"<0)?this.shape["+e+"]:i"+e+"|0"}).join(",")+","+d.map(function(e){return"this.stride["+e+"]"}).join(",")+",this.offset)}");var f=d.map(function(e){return"a"+e+"=this.shape["+e+"]"}),m=d.map(function(e){return"c"+e+"=this.stride["+e+"]"});i.push("proto.lo=function "+a+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+f.join(",")+","+m.join(","));for(var y=0;y<t;++y)i.push("if(typeof i"+y+"==='number'&&i"+y+">=0){d=i"+y+"|0;b+=c"+y+"*d;a"+y+"-=d}");i.push("return new "+a+"(this.data,"+d.map(function(e){return"a"+e}).join(",")+","+d.map(function(e){return"c"+e}).join(",")+",b)}"),i.push("proto.step=function "+a+"_step("+l.join(",")+"){var "+d.map(function(e){return"a"+e+"=this.shape["+e+"]"}).join(",")+","+d.map(function(e){return"b"+e+"=this.stride["+e+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var y=0;y<t;
1++y)i.push("if(typeof i"+y+"==='number'){d=i"+y+"|0;if(d<0){c+=b"+y+"*(a"+y+"-1);a"+y+"=ceil(-a"+y+"/d)}else{a"+y+"=ceil(a"+y+"/d)}b"+y+"*=d}");i.push("return new "+a+"(this.data,"+d.map(function(e){return"a"+e}).join(",")+","+d.map(function(e){return"b"+e}).join(",")+",c)}");for(var g=Array(t),v=Array(t),y=0;y<t;++y)g[y]="a[i"+y+"]",v[y]="b[i"+y+"]";i.push("proto.transpose=function "+a+"_transpose("+l+"){"+l.map(function(e,t){return e+"=("+e+"===undefined?"+t+":"+e+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+a+"(this.data,"+g.join(",")+","+v.join(",")+",this.offset)}"),i.push("proto.pick=function "+a+"_pick("+l+"){var a=[],b=[],c=this.offset");for(var y=0;y<t;++y)i.push("if(typeof i"+y+"==='number'&&i"+y+">=0){c=(c+this.stride["+y+"]*i"+y+")|0}else{a.push(this.shape["+y+"]);b.push(this.stride["+y+"])}");i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+a+"(data,shape,stride,offset){return new "+a+"(data,"+d.map(function(e){return"shape["+e+"]"}).join(",")+","+d.map(function(e){return"stride["+e+"]"}).join(",")+",offset)}");var u=Function("CTOR_LIST","ORDER",i.join("\n"));return u(o[e],s)}(p,f.length-1));var d=f[l+1];return d(e,t,i,u)}}}),w="object"==typeof global&&global&&global.Object===Object&&global,k="object"==typeof self&&self&&self.Object===Object&&self,x=w||k||Function("return this")(),j=x.Symbol,O=Object.prototype,A=O.hasOwnProperty,T=O.toString,C=j?j.toStringTag:void 0,Z=function(e){var t=A.call(e,C),r=e[C];try{e[C]=void 0;var a=!0}catch(e){}var n=T.call(e);return a&&(t?e[C]=r:delete e[C]),n},S=Object.prototype.toString,E=j?j.toStringTag:void 0,N=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":E&&E in Object(e)?Z(e):S.call(e)},P=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},I=function(e){if(!P(e))return!1;var t=N(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},$=x["__core-js_shared__"],R=function(){var e=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),M=Function.prototype.toString,F=function(e){if(null!=e){try{return M.call(e)}catch(e){}try{return e+""}catch(e){}}return""},z=/^\[object .+?Constructor\]$/,L=Object.prototype,U=Function.prototype.toString,D=L.hasOwnProperty,V=RegExp("^"+U.call(D).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),B=function(e){return!!P(e)&&(!R||!(R in e))&&(I(e)?V:z).test(F(e))},K=function(e,t){var r=null==e?void 0:e[t];return B(r)?r:void 0},W=K(Object,"create"),q=Object.prototype.hasOwnProperty,G=Object.prototype.hasOwnProperty;function J(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}J.prototype.clear=function(){this.__data__=W?W(null):{},this.size=0},J.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},J.prototype.get=function(e){var t=this.__data__;if(W){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return q.call(t,e)?t[e]:void 0},J.prototype.has=function(e){var t=this.__data__;return W?void 0!==t[e]:G.call(t,e)},J.prototype.set=function(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=W&&void 0===t?"__lodash_hash_undefined__":t,this};var H=function(e,t){for(var r,a=e.length;a--;)if((r=e[a][0])===t||r!=r&&t!=t)return a;return -1},Y=Array.prototype.splice;function X(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,r=H(t,e);return!(r<0)&&(r==t.length-1?t.pop():Y.call(t,r,1),--this.size,!0)},X.prototype.get=function(e){var t=this.__data__,r=H(t,e);return r<0?void 0:t[r][1]},X.prototype.has=function(e){return H(this.__data__,e)>-1},X.prototype.set=function(e,t){var r=this.__data__,a=H(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this};var Q=K(x,"Map"),ee=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},et=function(e,t){var r=e.__data__;return ee(t)?r["string"==typeof t?"string":"hash"]:r.map};function er(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}function ea(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var r=function(){var a=arguments,n=t?t.apply(this,a):a[0],i=r.cache;if(i.has(n))return i.get(n);var s=e.apply(this,a);return r.cache=i.set(n,s)||i,s};return r.cache=new(ea.Cache||er),r}er.prototype.clear=function(){this.size=0,this.__data__={hash:new J,map:new(Q||X),string:new J}},er.prototype.delete=function(e){var t=et(this,e).delete(e);return this.size-=!!t,t},er.prototype.get=function(e){return et(this,e).get(e)},er.prototype.has=function(e){return et(this,e).has(e)},er.prototype.set=function(e,t){var r=et(this,e),a=r.size;return r.set(e,t),this.size+=+(r.size!=a),this},ea.Cache=er;var en=g(b()),ei=class e{constructor(e,t){this.type="application/octet-stream",this.params={},this.type=e,this.params=t}toString(){let e=[];for(let t in this.params){let r=this.params[t];e.push(`${t}=${r}`)}return[this.type,...e].join(";")}static create(t,r){return new e(t,r)}isIdentical(e){return this.type===e.type&&this.params===e.params}isEqual(e){return this.type===e.type}static fromString(t){let[r,...a]=t.split(";"),n={};for(let e of a){let[t,r]=e.split("=");n[t.trim()]=r.trim()}return new e(r,n)}},es=g(b());async function eo(e){let t=ei.fromString(e.type);switch(t.type){case"image/x-alpha8":{let r=parseInt(t.params.width),a=parseInt(t.params.height);return(0,es.default)(new Uint8Array(await e.arrayBuffer()),[a,r,1])}case"image/x-rgba8":{let r=parseInt(t.params.width),a=parseInt(t.params.height);return(0,es.default)(new Uint8Array(await e.arrayBuffer()),[a,r,4])}case"application/octet-stream":case"image/png":case"image/jpeg":case"image/jpg":case"image/webp":{var r,a,n;let t=((n=(a=ec((r=await createImageBitmap(e)).width,r.height)).getContext("2d")).drawImage(r,0,0),n.getImageData(0,0,a.width,a.height));return(0,es.default)(new Uint8Array(t.data),[t.height,t.width,4])}default:throw Error(`Invalid format: ${t.type} with params: ${t.params}`)}}async function eu(e,t=.8,r="image/png"){let[a,n,i]=e.shape;switch(r){case"image/x-alpha8":case"image/x-rgba8":{let t=ei.create(r,{width:n.toString(),height:a.toString()});return new Blob([e.data],{type:t.toString()})}case"image/png":case"image/jpeg":case"image/webp":{let i=new ImageData(new Uint8ClampedArray(e.data),n,a);var s=ec(i.width,i.height);return s.getContext("2d").putImageData(i,0,0),s.convertToBlob({quality:t,type:r})}default:throw Error(`Invalid format: ${r}`)}}function ed(e,t,r,a=!1){let[n,i,s]=e.shape,o=i/t,u=n/r;a&&(o=u=Math.max(o,u)>1?Math.max(o,u):Math.min(o,u));let d=(0,en.default)(function(e){if("undefined"!=typeof Uint8Array)return new Uint8Array(e);if("undefined"!=typeof Uint8ClampedArray)return new Uint8ClampedArray(e);if("undefined"!=typeof Uint16Array)return new Uint16Array(e);if("undefined"!=typeof Uint32Array)return new Uint32Array(e);if("undefined"!=typeof Float32Array)return new Float32Array(e);else if("undefined"!=typeof Float64Array)return new Float64Array(e);else throw Error("TypedArray not supported")}(s*t*r),[r,t,s]);for(let a=0;a<r;a++)for(let r=0;r<t;r++){let t=r*o,l=a*u,c=Math.max(Math.floor(t),0),h=Math.min(Math.ceil(t),i-1),p=Math.max(Math.floor(l),0),f=Math.min(Math.ceil(l),n-1),m=t-c,y=l-p;for(let t=0;t<s;t++){let n=e.get(p,c,t),i=e.get(p,h,t),s=(1-m)*(1-y)*n+m*(1-y)*i+(1-m)*y*e.get(f,c,t)+m*y*e.get(f,h,t);d.set(a,r,t,s)}}return d}async function el(e,t){if("string"==typeof e){var r,a;r=e,a=t.publicPath,e=RegExp("^(?:[a-z+]+:)?//","i").test(r)?r:new URL(r,a).href,e=new URL(e)}if(e instanceof URL){let t=await fetch(e,{});e=await t.blob()}return(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e=new Blob([e])),e instanceof Blob&&(e=await eo(e)),e}function ec(e,t){let r;if(!(r="undefined"!=typeof OffscreenCanvas?new OffscreenCanvas(e,t):document.createElement("canvas")))throw Error("Canvas nor OffscreenCanvas are available in the current context.");return r}var eh=g(b()),ep=async()=>void 0!==navigator.gpu&&null!==await navigator.gpu.requestAdapter();async function ef(e,t){return URL.createObjectURL(await em(e,t))}async function em(e,t){let r=new URL("resources.json",t.publicPath),a=await fetch(r);if(!a.ok)throw Error("Resource metadata not found. Ensure that the config.publicPath is configured correctly.");let n=(await a.json())[e];if(!n)throw Error(`Resource ${e} not found. Ensure that the config.publicPath is configured correctly.`);let i=n.chunks,s=0,o=i.map(async r=>{let a=r.offsets[1]-r.offsets[0],i=t.publicPath?new URL(r.name,t.publicPath).toString():r.name,o=await fetch(i,t.fetchArgs),u=await o.blob();if(a!==u.size)throw Error(`Failed to fetch ${e} with size ${a} but got ${u.size}`);return t.progress&&(s+=a,t.progress(`fetch:${e}`,s,n.size)),u}),u=new Blob(await Promise.all(o),{type:n.mime});if(u.size!==n.size)throw Error(`Failed to fetch ${e} with size ${n.size} but got ${u.size}`);return u}var ey=null,eg=async e=>null!==ey?ey:ey=e?(await Promise.all([r.e(5679),r.e(4080)]).then(r.bind(r,59288))).default:(await Promise.all([r.e(2643),r.e(1699)]
1).then(r.bind(r,84932))).default;async function ev(e,t){let r="gpu"===t.device&&await ep(),a=r&&t.proxyToWorker,n=await eg(r);t.debug&&(console.debug("	Using WebGPU:",r),console.debug("	Proxy to Worker:",a),n.env.debug=!0,n.env.logLevel="verbose"),n.env.wasm.numThreads=navigator.hardwareConcurrency??4,n.env.wasm.proxy=a;let i=r?"/onnxruntime-web/ort-wasm-simd-threaded.jsep":"/onnxruntime-web/ort-wasm-simd-threaded",s=await ef(`${i}.wasm`,t),o=await ef(`${i}.mjs`,t);return n.env.wasm.wasmPaths={mjs:o,wasm:s},t.debug&&console.debug("ort.env.wasm:",n.env.wasm),await n.InferenceSession.create(e,{executionProviders:[r?"webgpu":"wasm"],graphOptimizationLevel:"all",executionMode:"parallel",enableCpuMemArena:!0}).catch(e=>{throw Error(`Failed to create session: "${e}". Please check if the publicPath is set correctly.`)})}async function e_(e,t,r,a){let n="gpu"===a.device&&await ep(),i=await eg(n),s={};for(let[e,r]of t)s[e]=new i.Tensor("float32",new Float32Array(r.data),r.shape);let o=await e.run(s,{}),u=[];for(let e of r){let t=o[e],r=t.dims,a=t.data,n=(0,eh.default)(a,r);u.push(n)}return u}!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},e.getValidEnumValues=t=>{let r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),a={};for(let e of r)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(let r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(a||(a={})),(n||(n={})).mergeShapes=(e,t)=>({...e,...t});var eb=a.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ew=e=>{switch(typeof e){case"undefined":return eb.undefined;case"string":return eb.string;case"number":return isNaN(e)?eb.nan:eb.number;case"boolean":return eb.boolean;case"function":return eb.function;case"bigint":return eb.bigint;case"symbol":return eb.symbol;case"object":if(Array.isArray(e))return eb.array;if(null===e)return eb.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return eb.promise;if("undefined"!=typeof Map&&e instanceof Map)return eb.map;if("undefined"!=typeof Set&&e instanceof Set)return eb.set;if("undefined"!=typeof Date&&e instanceof Date)return eb.date;return eb.object;default:return eb.unknown}}
vendor: 5,810 bytes, line 1
1,ek=a.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ex=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},a=e=>{for(let n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(a);else if("invalid_return_type"===n.code)a(n.returnTypeError);else if("invalid_arguments"===n.code)a(n.argumentsError);else if(0===n.path.length)r._errors.push(t(n));else{let e=r,a=0;for(;a<n.path.length;){let r=n.path[a];a===n.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(n))):e[r]=e[r]||{_errors:[]},e=e[r],a++}}};return a(this),r}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,a.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t={},r=[];for(let a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):r.push(e(a));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};ex.create=e=>new ex(e);var ej=(e,t)=>{let r;switch(e.code){case ek.invalid_type:r=e.received===eb.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ek.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,a.jsonStringifyReplacer)}`;break;case ek.unrecognized_keys:r=`Unrecognized key(s) in object: ${a.joinValues(e.keys,", ")}`;break;case ek.invalid_union:r="Invalid input";break;case ek.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${a.joinValues(e.options)}`;break;case ek.invalid_enum_value:r=`Invalid enum value. Expected ${a.joinValues(e.options)}, received '${e.received}'`;break;case ek.invalid_arguments:r="Invalid function arguments";break;case ek.invalid_return_type:r="Invalid function return type";break;case ek.invalid_date:r="Invalid date";break;case ek.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:a.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ek.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ek.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ek.custom:r="Invalid input";break;case ek.invalid_intersection_types:r="Intersection results could not be merged";break;case ek.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ek.not_finite:r="Number must be finite";break;default:r=t.defaultError,a.assertNever(e)}return{message:r}},eO=ej;function eA(){return eO}var eT=e=>{let{data:t,path:r,errorMaps:a,issueData:n}=e,i=[...r,...n.path||[]],s={...n,path:i};if(void 0!==n.message)return{...n,path:i,message:n.message};let o="";for(let e of a.filter(e=>!!e).slice().reverse())o=e(s,{data:t,defaultError:o}).message;return{...n,path:i,message:o}};function eC(e,t){let r=eA(),a=eT({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ej?void 0:ej].filter(e=>!!e)});e.common.issues.push(a)}var eZ=class e{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let a of t){if("aborted"===a.status)return eS;"dirty"===a.status&&e.dirty(),r.push(a.value)}return{status:e.value,value:r}}static async mergeObjectAsync(t,r){let a=[];for(let e of r){let t=await e.key,r=await e.value;a.push({key:t,value:r})}return e.mergeObjectSync(t,a)}static mergeObjectSync(e,t){let r={};for(let a of t){let{key:t,value:n}=a;if("aborted"===t.status||"aborted"===n.status)return eS;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==n.value||a.alwaysSet)&&(r[t.value]=n.value)}return{status:e.value,value:r}}},eS=Object.freeze({status:"aborted"}),eE=e=>({status:"dirty",value:e}),eN=e=>
1({status:"valid",value:e}),eP=e=>"aborted"===e.status,eI=e=>"dirty"===e.status,e$=e=>"valid"===e.status,eR=e=>"undefined"!=typeof Promise&&e instanceof Promise;function eM(e,t,r,a){if("a"===r&&!a)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(e):a?a.value:t.get(e)}function eF(e,t,r,a,n){if("m"===a)throw TypeError("Private method is not writable");if("a"===a&&!n)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?n.call(e,r):n?n.value=r:t.set(e,r),r}!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(i||(i={}));var ez=class{constructor(e,t,r,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},eL=(e,t)=>{if(e$(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new ex(e.common.issues);return this._error=t,this._error}}};function eU(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:a,description:n}=e;if(t&&(r||a))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(t,n)=>{var i,s;let{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:n.defaultError}:void 0===n.data?{message:null!=(i=null!=o?o:a)?i:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!=(s=null!=o?o:r)?s:n.defaultError}},description:n}}var eD=class{get description(){return this._def.description}_getType(e){return ew(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ew(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new eZ,ctx:{common:e.parent.common,data:e.data,parsedType:ew(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(eR(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let a={common:{issues:[],async:null!=(r=null==t?void 0:t.async)&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ew(e)},n=this._parseSync({data:e,path:a.path,parent:a});return eL(a,n)}"~validate"(e){var t,r;let a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ew(e)};if(!this["~standard"].async)try{let t=this._parseSync({data:e,path:[],parent:a});return e$(t)?{value:t.value}:{issues:a.common.issues}}catch(e){(null==(r=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(e=>e$(e)?{value:e.value}:{issues:a.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ew(e)},a=this._parse({data:e,path:r.path,parent:r});return eL(r,await (eR(a)?a:Promise.resolve(a)))}refine(e,t){return this._refinement((r,a)=>{let n=e(r),i=()=>a.addIssue({code:ek.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(r):t});return"undefined"!=typeof Promise&&n instanceof Promise?n.then(e=>!!e||(i(),!1)):!!n||(i(),!1)})}refinement(e,t){return this._refinement((r,a)=>!!e(r)||(a.addIssue("function"==typeof t?t(r,a):t),!1))}_refinement(e){return new tA({schema:this,typeName:d.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return tT.create(this,this._def)}nullable(){return tC.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return td.create(this)}promise(){return tO.create(this,this._def)}or(e){return tc.create([this,e],this._def)}and(e){return tf.create(this,e,this._def)}transform(e){return new tA({...eU(this._def),schema:this,typeName:d.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new tZ({...eU(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:d.ZodDefault})}brand(){return new tP({typeName:d.ZodBranded,type:this,...eU(this._def)})}catch(e){return new tS({...eU(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:d.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return tI.create(this,e)}readonly(){return t$.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},eV=/^c[^\s-]{8,}
1$/i,eB=/^[0-9a-z]+$/,eK=/^[0-9A-HJKMNP-TV-Z]{26}$/i,eW=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,eq=/^[a-z0-9_-]{21}$/i,eG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,eJ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eH=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,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])$/,eX=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,eQ=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,e0=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,e1=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,e4=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,e9="((\\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(`^${e9}$`);function e6(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function e3(e){let t=`${e9}T${e6(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)}var e5=class e extends eD{_parse(e){var t,r,n,i;let s;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==eb.string){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.string,received:t.parsedType}),eS}let o=new eZ;for(let d of this._def.checks)if("min"===d.kind)e.data.length<d.value&&(eC(s=this._getOrReturnCtx(e,s),{code:ek.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),o.dirty());else if("max"===d.kind)e.data.length>d.value&&(eC(s=this._getOrReturnCtx(e,s),{code:ek.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),o.dirty());else if("length"===d.kind){let t=e.data.length>d.value,r=e.data.length<d.value;(t||r)&&(s=this._getOrReturnCtx(e,s),t?eC(s,{code:ek.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}):r&&eC(s,{code:ek.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}),o.dirty())}else if("email"===d.kind)eH.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"email",code:ek.invalid_string,message:d.message}),o.dirty());else if("emoji"===d.kind)u||(u=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),u.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"emoji",code:ek.invalid_string,message:d.message}),o.dirty());else if("uuid"===d.kind)eW.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"uuid",code:ek.invalid_string,message:d.message}),o.dirty());else if("nanoid"===d.kind)eq.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"nanoid",code:ek.invalid_string,message:d.message}),o.dirty());else if("cuid"===d.kind)eV.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"cuid",code:ek.invalid_string,message:d.message}),o.dirty());else if("cuid2"===d.kind)eB.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"cuid2",code:ek.invalid_string,message:d.message}),o.dirty());else if("ulid"===d.kind)eK.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"ulid",code:ek.invalid_string,message:d.message}),o.dirty());else if("url"===d.kind)try{new URL(e.data)}catch(t){eC(s=this._getOrReturnCtx(e,s),{validation:"url",code:ek.invalid_string,message:d.message}),o.dirty()}else"regex"===d.kind?(d.regex.lastIndex=0,d.regex.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"regex",code:ek.invalid_string,message:d.message}),o.dirty())):"trim"===d.kind?e.data=e.data.trim():"includes"===d.kind?e.data.includes(d.value,d.position)||(eC(s=this._getOrReturnCtx(e,s),{code:ek.invalid_string,validation:{includes:d.value,position:d.position},message:d.message}),o.dirty()):"toLowerCase"===d.kind?e.data=e.data.toLowerCase():"toUpperCase"===d.kind?e.data=e.data.toUpperCase():"startsWith"===d.kind?e.data.startsWith(d.value)||(eC(s=this._getOrReturnCtx(e,s),{code:ek.invalid_string,validation:{startsWith:d.value},message:d.message}),o.dirty()):"endsWith"===d.kind?e.data.endsWith(d.value)||(eC(s=this._getOrReturnCtx(e,s),{code:ek.invalid_string,validation:{endsWith:d.value},message:d.message}),o.dirty()):"datetime"===d.kind?e3(d).test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{code:ek.invalid_string,validation:"datetime",message:d.message}),o.dirty()):"date"===d.kind?e2.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{code:ek.invalid_string,validation:"date",message:d.message}),o.dirty()):"time"===d.kind?RegExp(`^${e6(d)}$`).test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{code:ek.invalid_string,validation:"time",message:d.message}),o.dirty()):"duration"===d.kind?eJ.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"duration",code:ek.invalid_string,message:d.message}),o.dirty()):"ip"===d.kind?(t=e.data,!(("v4"===(r=d.version)||!r)&&eY.test(t)||("v6"===r||!r)&&eQ.test(t))&&1&&(eC(s=this._getOrReturnCtx(e,s),{validation:"ip",code:ek.invalid_string,message:d.message}),o.dirty())):"jwt"===d.kind?!function(e,t){if(!eG.test(e))return!1;try{let[r]=e.split("."),a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(a));if("object"!=typeof n||null===n||!n.typ||!n.alg||t&&n.alg!==t)return!1;return!0}catch(e){return!1}}(e.data,d.alg)&&(eC(s=this._getOrReturnCtx(e,s),{validation:"jwt",code:ek.invalid_string,message:d.message}),o.dirty()):"cidr"===d.kind?(n=e.data,!(("v4"===(i=d.version)||!i)&&eX.test(n)||("v6"===i||!i)&&e0.test(n))&&1&&
1(eC(s=this._getOrReturnCtx(e,s),{validation:"cidr",code:ek.invalid_string,message:d.message}),o.dirty())):"base64"===d.kind?e1.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"base64",code:ek.invalid_string,message:d.message}),o.dirty()):"base64url"===d.kind?e4.test(e.data)||(eC(s=this._getOrReturnCtx(e,s),{validation:"base64url",code:ek.invalid_string,message:d.message}),o.dirty()):a.assertNever(d);return{status:o.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:ek.invalid_string,...i.errToObj(r)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:"email",...i.errToObj(e)})}url(e){return this._addCheck({kind:"url",...i.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...i.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...i.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...i.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...i.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...i.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...i.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...i.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...i.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...i.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...i.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...i.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!=(t=null==e?void 0:e.offset)&&t,local:null!=(r=null==e?void 0:e.local)&&r,...i.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...i.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...i.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...i.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...i.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...i.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...i.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...i.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...i.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...i.errToObj(t)})}nonempty(e){return this.min(1,i.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}};e5.create=e=>{var t;return new e5({checks:[],typeName:d.ZodString,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...eU(e)})};var e8=class e extends eD{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==eb.number){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.number,received:t.parsedType}),eS}let r=new eZ;for(let n of this._def.checks)"int"===n.kind?a.isInteger(e.data)||(eC(t=this._getOrReturnCtx(e,t),{code:ek.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(eC(t=this._getOrReturnCtx(e,t),{code:ek.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(eC(t=this._getOrReturnCtx(e,t),{code:ek.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,n=r>a?r:a;return parseInt(e.toFixed(n).replace(".",""))%parseInt(t.toFixed(n).replace(".",""))/Math.pow(10,n)}(e.data,n.value)&&(eC(t=this._getOrReturnCtx(e,t),{code:ek.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(eC(t=this._getOrReturnCtx(e,t),{code:ek.not_finite,message:n.message}),r.dirty()):a.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,i.toString(t))}gt(e,t){return this.setLimit("min",e,!1,i.toString(t))}lte(e,t){return this.setLimit("max",e,!0,i.toString(t))}lt(e,t){return this.setLimit("max",e,!1,i.toString(t))}setLimit(t,r,a,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:a,message:i.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:"int",message:i.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:i.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:i.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:i.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:i.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:i.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:i.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:i.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:i.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&a.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value);return Number.isFinite(t)&&Number.isFinite(e)}};e8.create=e=>new e8({checks:[],typeName:d.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...eU(e)});var e7=class e extends eD{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==eb.bigint)return this._getInvalidInput(e);let r=new eZ;for(let n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(eC(t=this._getOrReturnCtx(e,t),{code:ek.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(eC(t=this._getOrReturnCtx(e,t),{code:ek.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(eC(t=this._getOrReturnCtx(e,t),{code:ek.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):a.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.bigint,received:t.parsedType}),eS}gte(e,t){return this.setLimit("min",e,!0,i.toString(t))}gt(e,t){return this.setLimit("min",e,!1,i.toString(t))}lte(e,t){return this.setLimit("max",e,!0,i.toString(t))}lt(e,t){return this.setLimit("max",e,!1,i.toString(t))}setLimit(t,r,a,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:a,message:i.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}
1positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:i.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:i.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:i.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:i.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:i.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}};e7.create=e=>{var t;return new e7({checks:[],typeName:d.ZodBigInt,coerce:null!=(t=null==e?void 0:e.coerce)&&t,...eU(e)})};var te=class extends eD{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==eb.boolean){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.boolean,received:t.parsedType}),eS}return eN(e.data)}};te.create=e=>new te({typeName:d.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...eU(e)});var tt=class e extends eD{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==eb.date){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.date,received:t.parsedType}),eS}if(isNaN(e.data.getTime()))return eC(this._getOrReturnCtx(e),{code:ek.invalid_date}),eS;let r=new eZ;for(let n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(eC(t=this._getOrReturnCtx(e,t),{code:ek.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(eC(t=this._getOrReturnCtx(e,t),{code:ek.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()):a.assertNever(n);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:i.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:i.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}};tt.create=e=>new tt({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:d.ZodDate,...eU(e)});var tr=class extends eD{_parse(e){if(this._getType(e)!==eb.symbol){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.symbol,received:t.parsedType}),eS}return eN(e.data)}};tr.create=e=>new tr({typeName:d.ZodSymbol,...eU(e)});var ta=class extends eD{_parse(e){if(this._getType(e)!==eb.undefined){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.undefined,received:t.parsedType}),eS}return eN(e.data)}};ta.create=e=>new ta({typeName:d.ZodUndefined,...eU(e)});var tn=class extends eD{_parse(e){if(this._getType(e)!==eb.null){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.null,received:t.parsedType}),eS}return eN(e.data)}};tn.create=e=>new tn({typeName:d.ZodNull,...eU(e)});var ti=class extends eD{constructor(){super(...arguments),this._any=!0}_parse(e){return eN(e.data)}};ti.create=e=>new ti({typeName:d.ZodAny,...eU(e)});var ts=class extends eD{constructor(){super(...arguments),this._unknown=!0}_parse(e){return eN(e.data)}};ts.create=e=>new ts({typeName:d.ZodUnknown,...eU(e)});var to=class extends eD{_parse(e){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.never,received:t.parsedType}),eS}};to.create=e=>new to({typeName:d.ZodNever,...eU(e)});var tu=class extends eD{_parse(e){if(this._getType(e)!==eb.undefined){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.void,received:t.parsedType}),eS}return eN(e.data)}};tu.create=e=>new tu({typeName:d.ZodVoid,...eU(e)});var td=class e extends eD{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),a=this._def;if(t.parsedType!==eb.array)return eC(t,{code:ek.invalid_type,expected:eb.array,received:t.parsedType}),eS;if(null!==a.exactLength){let e=t.data.length>
1a.exactLength.value,n=t.data.length<a.exactLength.value;(e||n)&&(eC(t,{code:e?ek.too_big:ek.too_small,minimum:n?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),r.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(eC(t,{code:ek.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),r.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(eC(t,{code:ek.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>a.type._parseAsync(new ez(t,e,t.path,r)))).then(e=>eZ.mergeArray(r,e));let n=[...t.data].map((e,r)=>a.type._parseSync(new ez(t,e,t.path,r)));return eZ.mergeArray(r,n)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:i.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:i.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:i.toString(r)}})}nonempty(e){return this.min(1,e)}};td.create=(e,t)=>new td({type:e,minLength:null,maxLength:null,exactLength:null,typeName:d.ZodArray,...eU(t)});var tl=class e extends eD{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=a.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==eb.object){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.object,received:t.parsedType}),eS}let{status:t,ctx:r}=this._processInputParams(e),{shape:a,keys:n}=this._getCached(),i=[];if(!(this._def.catchall instanceof to&&"strip"===this._def.unknownKeys))for(let e in r.data)n.includes(e)||i.push(e);let s=[];for(let e of n){let t=a[e],n=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new ez(r,n,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof to){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of i)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)i.length>0&&(eC(r,{code:ek.unrecognized_keys,keys:i}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of i){let a=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new ez(r,a,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let r=await t.key,a=await t.value;e.push({key:r,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>eZ.mergeObjectSync(t,e)):eZ.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(t){return i.errToObj,new e({...this._def,unknownKeys:"strict",...void 0!==t?{errorMap:(e,r)=>{var a,n,s,o;let u=null!=(s=null==(n=(a=this._def).errorMap)?void 0:n.call(a,e,r).message)?s:r.defaultError;return"unrecognized_keys"===e.code?{message:null!=(o=i.errToObj(t).message)?o:u}:{message:u}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:d.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return a.objectKeys(t).forEach(e=>{t[e]&&this.shape[e]&&(r[e]=this.shape[e])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return a.objectKeys(this.shape).forEach(e=>{t[e]||(r[e]=this.shape[e])}),new e({...this._def,shape:()=>r})}deepPartial(){return function e(t){if(t instanceof tl){let r={};for(let a in t.shape){let n=t.shape[a];r[a]=tT.create(e(n))}return new tl({...t._def,shape:()=>r})}if(t instanceof td)return new td({...t._def,type:e(t.element)});if(t instanceof tT)return tT.create(e(t.unwrap()));if(t instanceof tC)return tC.create(e(t.unwrap()));if(t instanceof tm)return tm.create(t.items.map(t=>e(t)));else return t}(this)}partial(t){let r={};
1return a.objectKeys(this.shape).forEach(e=>{let a=this.shape[e];t&&!t[e]?r[e]=a:r[e]=a.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return a.objectKeys(this.shape).forEach(e=>{if(t&&!t[e])r[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof tT;)t=t._def.innerType;r[e]=t}}),new e({...this._def,shape:()=>r})}keyof(){return tk(a.objectKeys(this.shape))}};tl.create=(e,t)=>new tl({shape:()=>e,unknownKeys:"strip",catchall:to.create(),typeName:d.ZodObject,...eU(t)}),tl.strictCreate=(e,t)=>new tl({shape:()=>e,unknownKeys:"strict",catchall:to.create(),typeName:d.ZodObject,...eU(t)}),tl.lazycreate=(e,t)=>new tl({shape:e,unknownKeys:"strip",catchall:to.create(),typeName:d.ZodObject,...eU(t)});var tc=class extends eD{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new ex(e.ctx.common.issues));return eC(t,{code:ek.invalid_union,unionErrors:r}),eS});{let e,a=[];for(let n of r){let r={...t,common:{...t.common,issues:[]},parent:null},i=n._parseSync({data:t.data,path:t.path,parent:r});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:r}),r.common.issues.length&&a.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let n=a.map(e=>new ex(e));return eC(t,{code:ek.invalid_union,unionErrors:n}),eS}}get options(){return this._def.options}};tc.create=(e,t)=>new tc({options:e,typeName:d.ZodUnion,...eU(t)});var th=e=>{if(e instanceof tb)return th(e.schema);if(e instanceof tA)return th(e.innerType());if(e instanceof tw)return[e.value];if(e instanceof tx)return e.options;if(e instanceof tj)return a.objectValues(e.enum);else if(e instanceof tZ)return th(e._def.innerType);else if(e instanceof ta)return[void 0];else if(e instanceof tn)return[null];else if(e instanceof tT)return[void 0,...th(e.unwrap())];else if(e instanceof tC)return[null,...th(e.unwrap())];else if(e instanceof tP)return th(e.unwrap());else if(e instanceof t$)return th(e.unwrap());else if(e instanceof tS)return th(e._def.innerType);else return[]},tp=class e extends eD{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==eb.object)return eC(t,{code:ek.invalid_type,expected:eb.object,received:t.parsedType}),eS;let r=this.discriminator,a=t.data[r],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(eC(t,{code:ek.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),eS)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,a){let n=new Map;for(let e of r){let r=th(e.shape[t]);if(!r.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of r){if(n.has(a))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);n.set(a,e)}}return new e({typeName:d.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...eU(a)})}},tf=class extends eD{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(eP(e)||eP(n))return eS;let i=function e(t,r){let n=ew(t),i=ew(r);if(t===r)return{valid:!0,data:t};if(n===eb.object&&i===eb.object){let n=a.objectKeys(r),i=a.objectKeys(t).filter(e=>-1!==n.indexOf(e)),s={...t,...r};for(let a of i){let n=e(t[a],r[a]);if(!n.valid)return{valid:!1};s[a]=n.data}return{valid:!0,data:s}}if(n===eb.array&&i===eb.array){if(t.length!==r.length)return{valid:!1};let a=[];for(let n=0;n<t.length;n++){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1};a.push(i.data)}return{valid:!0,data:a}}if(n===eb.date&&i===eb.date&&+t==+r)return{valid:!0,data:t};return{valid:!1}}(e.value,n.value);return i.valid?((eI(e)||eI(n))&&t.dirty(),{status:t.value,value:i.data}):(eC(r,{code:ek.invalid_intersection_types}),eS)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};tf.create=(e,t,r)=>new tf({left:e,right:t,typeName:d.ZodIntersection,...eU(r)});var tm=class e extends eD{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eb.array)return eC(r,{code:ek.invalid_type,expected:eb.array,received:r.parsedType}),eS;if(r.data.length<this._def.items.length)return eC(r,{code:ek.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),eS;!this._def.rest&&r.data.length>this._def.items.length&&(eC(r,{code:ek.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...r.data].map((e,t)=>{let a=this._def.items[t]||this._def.rest;return a?a._parse(new ez(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(a).then(e=>eZ.mergeArray(t,e)):eZ.mergeArray(t,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};tm.create=(e,t)=>
vendor: 4,907 bytes, line 1
1{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new tm({items:e,typeName:d.ZodTuple,rest:null,...eU(t)})};var ty=class e extends eD{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eb.object)return eC(r,{code:ek.invalid_type,expected:eb.object,received:r.parsedType}),eS;let a=[],n=this._def.keyType,i=this._def.valueType;for(let e in r.data)a.push({key:n._parse(new ez(r,e,r.path,e)),value:i._parse(new ez(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?eZ.mergeObjectAsync(t,a):eZ.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(t,r,a){return new e(r instanceof eD?{keyType:t,valueType:r,typeName:d.ZodRecord,...eU(a)}:{keyType:e5.create(),valueType:t,typeName:d.ZodRecord,...eU(r)})}},tg=class extends eD{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eb.map)return eC(r,{code:ek.invalid_type,expected:eb.map,received:r.parsedType}),eS;let a=this._def.keyType,n=this._def.valueType,i=[...r.data.entries()].map(([e,t],i)=>({key:a._parse(new ez(r,e,r.path,[i,"key"])),value:n._parse(new ez(r,t,r.path,[i,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of i){let a=await r.key,n=await r.value;if("aborted"===a.status||"aborted"===n.status)return eS;("dirty"===a.status||"dirty"===n.status)&&t.dirty(),e.set(a.value,n.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of i){let a=r.key,n=r.value;if("aborted"===a.status||"aborted"===n.status)return eS;("dirty"===a.status||"dirty"===n.status)&&t.dirty(),e.set(a.value,n.value)}return{status:t.value,value:e}}}};tg.create=(e,t,r)=>new tg({valueType:t,keyType:e,typeName:d.ZodMap,...eU(r)});var tv=class e extends eD{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==eb.set)return eC(r,{code:ek.invalid_type,expected:eb.set,received:r.parsedType}),eS;let a=this._def;null!==a.minSize&&r.data.size<a.minSize.value&&(eC(r,{code:ek.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&r.data.size>a.maxSize.value&&(eC(r,{code:ek.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let n=this._def.valueType;function i(e){let r=new Set;for(let a of e){if("aborted"===a.status)return eS;"dirty"===a.status&&t.dirty(),r.add(a.value)}return{status:t.value,value:r}}let s=[...r.data.values()].map((e,t)=>n._parse(new ez(r,e,r.path,t)));return r.common.async?Promise.all(s).then(e=>i(e)):i(s)}min(t,r){return new e({...this._def,minSize:{value:t,message:i.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:i.toString(r)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};tv.create=(e,t)=>new tv({valueType:e,minSize:null,maxSize:null,typeName:d.ZodSet,...eU(t)});var t_=class e extends eD{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==eb.function)return eC(t,{code:ek.invalid_type,expected:eb.function,received:t.parsedType}),eS;function r(e,r){return eT({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,eA(),ej].filter(e=>!!e),issueData:{code:ek.invalid_arguments,argumentsError:r}})}function a(e,r){return eT({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,eA(),ej].filter(e=>!!e),issueData:{code:ek.invalid_return_type,returnTypeError:r}})}let n={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof tO){let e=this;return eN(async function(...t){let s=new ex([]),o=await e._def.args.parseAsync(t,n).catch(e=>{throw s.addIssue(r(t,e)),s}),u=await Reflect.apply(i,this,o);return await e._def.returns._def.type.parseAsync(u,n).catch(e=>{throw s.addIssue(a(u,e)),s})})}{let e=this;return eN(function(...t){let s=e._def.args.safeParse(t,n);if(!s.success)throw new ex([r(t,s.error)]);let o=Reflect.apply(i,this,s.data),u=e._def.returns.safeParse(o,n);if(!u.success)throw new ex([a(o,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:tm.create(t).rest(ts.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,r,a){return new e({args:t||tm.create([]).rest(ts.create()),returns:r||ts.create(),typeName:d.ZodFunction,...eU(a)})}},tb=class extends eD{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};tb.create=(e,t)=>
1new tb({getter:e,typeName:d.ZodLazy,...eU(t)});var tw=class extends eD{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return eC(t,{received:t.data,code:ek.invalid_literal,expected:this._def.value}),eS}return{status:"valid",value:e.data}}get value(){return this._def.value}};function tk(e,t){return new tx({values:e,typeName:d.ZodEnum,...eU(t)})}tw.create=(e,t)=>new tw({value:e,typeName:d.ZodLiteral,...eU(t)});var tx=class e extends eD{constructor(){super(...arguments),s.set(this,void 0)}_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return eC(t,{expected:a.joinValues(r),received:t.parsedType,code:ek.invalid_type}),eS}if(eM(this,s,"f")||eF(this,s,new Set(this._def.values),"f"),!eM(this,s,"f").has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return eC(t,{received:t.data,code:ek.invalid_enum_value,options:r}),eS}return eN(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...r})}};s=new WeakMap,tx.create=tk;var tj=class extends eD{constructor(){super(...arguments),o.set(this,void 0)}_parse(e){let t=a.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==eb.string&&r.parsedType!==eb.number){let e=a.objectValues(t);return eC(r,{expected:a.joinValues(e),received:r.parsedType,code:ek.invalid_type}),eS}if(eM(this,o,"f")||eF(this,o,new Set(a.getValidEnumValues(this._def.values)),"f"),!eM(this,o,"f").has(e.data)){let e=a.objectValues(t);return eC(r,{received:r.data,code:ek.invalid_enum_value,options:e}),eS}return eN(e.data)}get enum(){return this._def.values}};o=new WeakMap,tj.create=(e,t)=>new tj({values:e,typeName:d.ZodNativeEnum,...eU(t)});var tO=class extends eD{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==eb.promise&&!1===t.common.async?(eC(t,{code:ek.invalid_type,expected:eb.promise,received:t.parsedType}),eS):eN((t.parsedType===eb.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};tO.create=(e,t)=>new tO({type:e,typeName:d.ZodPromise,...eU(t)});var tA=class extends eD{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===d.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:e=>{eC(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===n.type){let e=n.transform(r.data,i);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return eS;let a=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===a.status?eS:"dirty"===a.status||"dirty"===t.value?eE(a.value):a});{if("aborted"===t.value)return eS;let a=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===a.status?eS:"dirty"===a.status||"dirty"===t.value?eE(a.value):a}}if("refinement"===n.type){let e=e=>{let t=n.refinement(e,i);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?eS:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===a.status?eS:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}}if("transform"===n.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>e$(e)?Promise.resolve(n.transform(e.value,i)).then(e=>({status:t.value,value:e})):e);else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!e$(e))return e;let a=n.transform(e.value,i);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}a.assertNever(n)}};tA.create=(e,t,r)=>new tA({schema:e,typeName:d.ZodEffects,effect:t,...eU(r)}),tA.createWithPreprocess=(e,t,r)=>new tA({schema:t,effect:{type:"preprocess",transform:e},typeName:d.ZodEffects,...eU(r)});var tT=class extends eD{_parse(e){return this._getType(e)===eb.undefined?eN(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};tT.create=(e,t)=>
1new tT({innerType:e,typeName:d.ZodOptional,...eU(t)});var tC=class extends eD{_parse(e){return this._getType(e)===eb.null?eN(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};tC.create=(e,t)=>new tC({innerType:e,typeName:d.ZodNullable,...eU(t)});var tZ=class extends eD{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===eb.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};tZ.create=(e,t)=>new tZ({innerType:e,typeName:d.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...eU(t)});var tS=class extends eD{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return eR(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ex(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new ex(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};tS.create=(e,t)=>new tS({innerType:e,typeName:d.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...eU(t)});var tE=class extends eD{_parse(e){if(this._getType(e)!==eb.nan){let t=this._getOrReturnCtx(e);return eC(t,{code:ek.invalid_type,expected:eb.nan,received:t.parsedType}),eS}return{status:"valid",value:e.data}}};tE.create=e=>new tE({typeName:d.ZodNaN,...eU(e)});var tN=Symbol("zod_brand"),tP=class extends eD{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},tI=class e extends eD{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?eS:"dirty"===e.status?(t.dirty(),eE(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?eS:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(t,r){return new e({in:t,out:r,typeName:d.ZodPipeline})}},t$=class extends eD{_parse(e){let t=this._def.innerType._parse(e),r=e=>(e$(e)&&(e.value=Object.freeze(e.value)),e);return eR(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}};function tR(e,t){let r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function tM(e,t={},r){return e?ti.create().superRefine((a,n)=>{var i,s;let o=e(a);if(o instanceof Promise)return o.then(e=>{var i,s;if(!e){let e=tR(t,a),o=null==(s=null!=(i=e.fatal)?i:r)||s;n.addIssue({code:"custom",...e,fatal:o})}});if(!o){let e=tR(t,a),o=null==(s=null!=(i=e.fatal)?i:r)||s;n.addIssue({code:"custom",...e,fatal:o})}}):ti.create()}t$.create=(e,t)=>new t$({innerType:e,typeName:d.ZodReadonly,...eU(t)});var tF={object:tl.lazycreate};!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(d||(d={}));var tz=e5.create,tL=e8.create,tU=tE.create,tD=e7.create,tV=te.create,tB=tt.create,tK=tr.create,tW=ta.create,tq=tn.create,tG=ti.create,tJ=ts.create,tH=to.create,tY=tu.create,tX=td.create,tQ=tl.create,t0=tl.strictCreate,t1=tc.create,t4=tp.create,t9=tf.create,t2=tm.create,t6=ty.create,t3=tg.create,t5=tv.create,t8=t_.create,t7=tb.create,re=tw.create,rt=tx.create,rr=tj.create,ra=tO.create,rn=tA.create,ri=tT.create,rs=tC.create,ro=tA.createWithPreprocess,ru=tI.create,rd=Object.freeze({__proto__:null,defaultErrorMap:ej,setErrorMap:function(e){eO=e},getErrorMap:eA,makeIssue:eT,EMPTY_PATH:[],addIssueToContext:eC,ParseStatus:eZ,INVALID:eS,DIRTY:eE,OK:eN,isAborted:eP,isDirty:eI,isValid:e$,isAsync:eR,get util(){return a},get objectUtil(){return n},ZodParsedType:eb,getParsedType:ew,ZodType:eD,datetimeRegex:e3,ZodString:e5,ZodNumber:e8,ZodBigInt:e7,ZodBoolean:te,ZodDate:tt,ZodSymbol:tr,ZodUndefined:ta,ZodNull:tn,ZodAny:ti,ZodUnknown:ts,ZodNever:to,ZodVoid:tu,ZodArray:td,ZodObject:tl,ZodUnion:tc,ZodDiscriminatedUnion:tp,ZodIntersection:tf,ZodTuple:tm,ZodRecord:ty,ZodMap:tg,ZodSet:tv,ZodFunction:t_,ZodLazy:tb,ZodLiteral:tw,ZodEnum:tx,ZodNativeEnum:tj,ZodPromise:tO,ZodEffects:tA,ZodTransformer:tA,ZodOptional:tT,ZodNullable:tC,ZodDefault:tZ,ZodCatch:tS,ZodNaN:tE,BRAND:tN,ZodBranded:tP,ZodPipeline:tI,ZodReadonly:t$,custom:tM,Schema:eD,ZodSchema:eD,late:tF,get ZodFirstPartyTypeKind(){return d},coerce:{string:e=>e5.create({...e,coerce:!0}),number:e=>e8.create({...e,coerce:!0}),boolean:e=>te.create({...e,coerce:!0}),bigint:e=>e7.create({...e,coerce:!0}),date:e=>tt.create({...e,coerce:!0})},any:tG,array:tX,bigint:tD,boolean:tV,date:tB,discriminatedUnion:t4,effect:rn,enum:rt,function:t8,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>tM(t=>t instanceof e,t),intersection:t9,lazy:t7,literal:re,map:t3,nan:tU,nativeEnum:rr,never:tH,null:tq,nullable:rs,number:tL,object:tQ,oboolean:()=>tV().optional(),onumber:()=>tL().optional(),optional:ri,ostring:()=>tz().optional(),pipeline:ru,preprocess:ro,promise:ra,record:t6,set
1:t5,strictObject:t0,string:tz,symbol:tK,transformer:rn,tuple:t2,undefined:tW,union:t1,unknown:tJ,void:tY,NEVER:eS,ZodIssueCode:ek,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:ex}),rl={name:"@imgly/background-removal",version:"1.7.0"},rc=rd.object({publicPath:rd.string().optional().describe("The public path to the wasm files and the onnx model.").default("https://staticimgly.com/@imgly/background-removal-data/${PACKAGE_VERSION}/dist/").transform(e=>e.replace("${PACKAGE_NAME}",rl.name).replace("${PACKAGE_VERSION}",rl.version)),debug:rd.boolean().default(!1).describe("Whether to enable debug logging."),rescale:rd.boolean().default(!0).describe("Whether to rescale the image."),device:rd.enum(["cpu","gpu"]).default("cpu").describe("The device to run the model on."),proxyToWorker:rd.boolean().default(!1).describe("Whether to proxy inference to a web worker."),fetchArgs:rd.any().default({}).describe("Arguments to pass to fetch when loading the model."),progress:rd.function().args(rd.string(),rd.number(),rd.number()).returns(rd.void()).describe("Progress callback.").optional(),model:rd.preprocess(e=>{switch(e){case"large":return"isnet";case"small":return"isnet_quint8";case"medium":return"isnet_fp16";default:return e}},rd.enum(["isnet","isnet_fp16","isnet_quint8"])).default("medium"),output:rd.object({format:rd.enum(["image/png","image/jpeg","image/webp","image/x-rgba8","image/x-alpha8"]).default("image/png"),quality:rd.number().default(.8)}).default({})}).default({}).transform(e=>(e.debug&&console.log("Config:",e),e.debug&&!e.progress&&(e.progress=e.progress??((e,t,r)=>{console.debug(`Downloading ${e}: ${t} of ${r}`)}),!crossOriginIsolated&&e.debug&&console.debug("Cross-Origin-Isolated is not enabled. Performance will be degraded. Please see  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer.")),e));function rh(e){return rc.parse(e??{})}var rp=g(b());async function rf(e){e.debug&&console.debug("Loading model...",e.model);let t=e.model,r=await em(`/models/${t}`,e),a=await r.arrayBuffer();return await ev(a,e)}async function rm(e,t,r){let[a,n,i]=e.shape,s=ed(e,1024,1024,!1),o=function(e,t=[128,128,128],r=[256,256,256]){var a=e.data;let[n,i,s]=e.shape,o=n*i,u=new Float32Array(3*o);for(let e=0,n=0;e<a.length;e+=4,n+=1)u[n]=(a[e]-t[0])/r[0],u[n+o]=(a[e+1]-t[1])/r[1],u[n+o+o]=(a[e+2]-t[2])/r[2];return(0,en.default)(u,[1,3,n,i])}(s),u=await e_(r.base,[["input",o]],["output"],t),d=function(e){let t=new Uint8Array(e.data.length);for(let r=0;r<e.data.length;r++)t[r]=255*e.data[r];return(0,en.default)(t,e.shape)}((0,rp.default)(u[0].data,[1024,1024,1]));return t.rescale?[d=ed(d,n,a,!1),e]:[d,s]}var ry=ea(async function(e){e=rh(e);let t=await rf(e);return{config:e,session:{base:t}}},e=>JSON.stringify(e));async function rg(e){await ry(e)}async function rv(e,t){let{config:r,session:a}=await ry(t);r.progress&&r.progress("compute:decode",0,4);let n=await el(e,r);r.progress?.("compute:inference",1,4);let[i,s]=await rm(n,r,a);r.progress?.("compute:mask",2,4);let[o,u]=s.shape,d=o*u;for(let e=0;e<d;e+=1)s.data[4*e+3]=i.data[e];r.progress?.("compute:encode",3,4);let l=await eu(s,r.output.quality,r.output.format);return r.progress?.("compute:encode",4,4),l}async function r_(e,t){let{config:r,session:a}=await ry(t),n=await el(e,r),[i,s]=await rm(n,r,a),[o,u,d]=s.shape,l=o*u;for(let e=0;e<l;e+=1)s.data[4*e+3]=255-i.data[e];return await eu(s,r.output.quality,r.output.format)}var rb=rw;async function rw(e,t){let{config:r,session:a}=await ry(t),n=await el(e,r),[i,s,o]=n.shape,[u,d]=await rm(n,r,a),l=s*i;for(let e=0;e<l;e+=1){let t=4*e,r=u.data[e];n.data[t]=255,n.data[t+1]=255,n.data[t+2]=255,n.data[t+3]=r}return await eu(n,r.output.quality,r.output.format)}async function rk(e,t,r){r=rh(r);let a=await el(e,r),[n,i,s]=a.shape,o=await el(t,r),[u,d,l]=o.shape,c=u!==n||d!==i?ed(o,i,n):o,h=i*n;for(let e=0;e<h;e+=1){let t=s*e,r=l*e;a.data[t+3]=c.data[r+3]}return await eu(a,r.output.quality,r.output.format)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.