@prisma/client 7.5.0-dev.6 → 7.5.0-dev.8
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/generator-build/index.js +2 -2
- package/package.json +34 -34
- package/runtime/client.d.mts +1 -1
- package/runtime/client.d.ts +1 -1
- package/runtime/client.js +20 -20
- package/runtime/client.js.map +3 -3
- package/runtime/client.mjs +20 -20
- package/runtime/client.mjs.map +3 -3
- package/runtime/wasm-compiler-edge.js +16 -16
- package/runtime/wasm-compiler-edge.js.map +4 -4
- package/runtime/wasm-compiler-edge.mjs +16 -16
- package/runtime/wasm-compiler-edge.mjs.map +4 -4
- package/scripts/default-index.js +1 -1
package/runtime/client.mjs
CHANGED
|
@@ -5,19 +5,19 @@ import * as __banner_node_url from "node:url";
|
|
|
5
5
|
const __filename = __banner_node_url.fileURLToPath(import.meta.url);
|
|
6
6
|
globalThis['__dirname'] = __banner_node_path.dirname(__filename);
|
|
7
7
|
const require = __banner_node_module.createRequire(import.meta.url);
|
|
8
|
-
var kl=Object.create;var Qr=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var Ol=Object.getOwnPropertyNames;var Nl=Object.getPrototypeOf,Dl=Object.prototype.hasOwnProperty;var Ml=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var mi=(e,t)=>()=>(e&&(t=e(e=0)),t);var _=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ke=(e,t)=>{for(var r in t)Qr(e,r,{get:t[r],enumerable:!0})},Fl=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ol(t))!Dl.call(e,i)&&i!==r&&Qr(e,i,{get:()=>t[i],enumerable:!(n=Il(t,i))||n.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?kl(Nl(e)):{},Fl(t||!e||!e.__esModule?Qr(r,"default",{value:e,enumerable:!0}):r,e));var ki=_((Tf,iu)=>{iu.exports={name:"@prisma/engines-version",version:"7.5.0-3.3f492635eb3e6b8b8cdfeb170b6c4f7e31f2f303",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"3f492635eb3e6b8b8cdfeb170b6c4f7e31f2f303"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Ii=_($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.enginesVersion=void 0;$t.enginesVersion=ki().prisma.enginesVersion});var Ni=_((Af,Oi)=>{"use strict";Oi.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Li=_((Rf,_i)=>{"use strict";_i.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var Vi=_((_f,jt)=>{"use strict";jt.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};jt.exports.default=jt.exports});var tn=_((kg,Hi)=>{"use strict";Hi.exports=function(){function e(t,r,n,i,o){return t<r||n<r?t>n?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&t.charCodeAt(s)===r.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,u,c,p,d,f,h,b,x,M,P,S,$=[];for(l=0;l<i;l++)$.push(l+1),$.push(t.charCodeAt(s+l));for(var Se=$.length-1;a<o-3;)for(x=r.charCodeAt(s+(u=a)),M=r.charCodeAt(s+(c=a+1)),P=r.charCodeAt(s+(p=a+2)),S=r.charCodeAt(s+(d=a+3)),f=a+=4,l=0;l<Se;l+=2)h=$[l],b=$[l+1],u=e(h,u,c,x,b),c=e(u,c,p,M,b),p=e(c,p,d,P,b),f=e(p,d,f,S,b),$[l]=f,d=p,p=c,c=u,u=h;for(;a<o;)for(x=r.charCodeAt(s+(u=a)),f=++a,l=0;l<Se;l+=2)h=$[l],$[l]=f=e(h,u,f,x,$[l+1]),u=h;return f}}()});var Zi=mi(()=>{"use strict"});var Yi=mi(()=>{"use strict"});var An=_(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.anumber=Sn;he.abytes=as;he.ahash=Ep;he.aexists=Pp;he.aoutput=Tp;function Sn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function xp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function as(e,...t){if(!xp(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Ep(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Sn(e.outputLen),Sn(e.blockLen)}function Pp(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Tp(e,t){as(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var ks=_(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.add5L=g.add5H=g.add4H=g.add4L=g.add3H=g.add3L=g.rotlBL=g.rotlBH=g.rotlSL=g.rotlSH=g.rotr32L=g.rotr32H=g.rotrBL=g.rotrBH=g.rotrSL=g.rotrSH=g.shrSL=g.shrSH=g.toBig=void 0;g.fromBig=Cn;g.split=ls;g.add=Ps;var gr=BigInt(2**32-1),vn=BigInt(32);function Cn(e,t=!1){return t?{h:Number(e&gr),l:Number(e>>vn&gr)}:{h:Number(e>>vn&gr)|0,l:Number(e&gr)|0}}function ls(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=Cn(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var us=(e,t)=>BigInt(e>>>0)<<vn|BigInt(t>>>0);g.toBig=us;var cs=(e,t,r)=>e>>>r;g.shrSH=cs;var ps=(e,t,r)=>e<<32-r|t>>>r;g.shrSL=ps;var ds=(e,t,r)=>e>>>r|t<<32-r;g.rotrSH=ds;var ms=(e,t,r)=>e<<32-r|t>>>r;g.rotrSL=ms;var fs=(e,t,r)=>e<<64-r|t>>>r-32;g.rotrBH=fs;var gs=(e,t,r)=>e>>>r-32|t<<64-r;g.rotrBL=gs;var ys=(e,t)=>t;g.rotr32H=ys;var hs=(e,t)=>e;g.rotr32L=hs;var ws=(e,t,r)=>e<<r|t>>>32-r;g.rotlSH=ws;var bs=(e,t,r)=>t<<r|e>>>32-r;g.rotlSL=bs;var xs=(e,t,r)=>t<<r-32|e>>>64-r;g.rotlBH=xs;var Es=(e,t,r)=>e<<r-32|t>>>64-r;g.rotlBL=Es;function Ps(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Ts=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);g.add3L=Ts;var Ss=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;g.add3H=Ss;var As=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);g.add4L=As;var vs=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;g.add4H=vs;var Cs=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);g.add5L=Cs;var Rs=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;g.add5H=Rs;var Sp={fromBig:Cn,split:ls,toBig:us,shrSH:cs,shrSL:ps,rotrSH:ds,rotrSL:ms,rotrBH:fs,rotrBL:gs,rotr32H:ys,rotr32L:hs,rotlSH:ws,rotlSL:bs,rotlBH:xs,rotlBL:Es,add:Ps,add3L:Ts,add3H:Ss,add4L:As,add4H:vs,add5H:Rs,add5L:Cs};g.default=Sp});var Is=_(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.crypto=void 0;var ae=Ml("node:crypto");yr.crypto=ae&&typeof ae=="object"&&"webcrypto"in ae?ae.webcrypto:ae&&typeof ae=="object"&&"randomBytes"in ae?ae:void 0});var Ds=_(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.Hash=w.nextTick=w.byteSwapIfBE=w.isLE=void 0;w.isBytes=Ap;w.u8=vp;w.u32=Cp;w.createView=Rp;w.rotr=kp;w.rotl=Ip;w.byteSwap=In;w.byteSwap32=Op;w.bytesToHex=Dp;w.hexToBytes=Mp;w.asyncLoop=_p;w.utf8ToBytes=Ns;w.toBytes=hr;w.concatBytes=Lp;w.checkOpts=$p;w.wrapConstructor=Vp;w.wrapConstructorWithOpts=qp;w.wrapXOFConstructorWithOpts=jp;w.randomBytes=Up;var je=Is(),kn=An();function Ap(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function vp(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Cp(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Rp(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function kp(e,t){return e<<32-t|e>>>t}function Ip(e,t){return e<<t|e>>>32-t>>>0}w.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function In(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}w.byteSwapIfBE=w.isLE?e=>e:e=>In(e);function Op(e){for(let t=0;t<e.length;t++)e[t]=In(e[t])}var Np=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Dp(e){(0,kn.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=Np[e[r]];return t}var ee={_0:48,_9:57,A:65,F:70,a:97,f:102};function Os(e){if(e>=ee._0&&e<=ee._9)return e-ee._0;if(e>=ee.A&&e<=ee.F)return e-(ee.A-10);if(e>=ee.a&&e<=ee.f)return e-(ee.a-10)}function Mp(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let s=Os(e.charCodeAt(o)),a=Os(e.charCodeAt(o+1));if(s===void 0||a===void 0){let l=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}n[i]=s*16+a}return n}var Fp=async()=>{};w.nextTick=Fp;async function _p(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);let o=Date.now()-n;o>=0&&o<t||(await(0,w.nextTick)(),n+=o)}}function Ns(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function hr(e){return typeof e=="string"&&(e=Ns(e)),(0,kn.abytes)(e),e}function Lp(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,kn.abytes)(i),t+=i.length}let r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return r}var Rn=class{clone(){return this._cloneInto()}};w.Hash=Rn;function $p(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function Vp(e){let t=n=>e().update(hr(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function qp(e){let t=(n,i)=>e(i).update(hr(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function jp(e){let t=(n,i)=>e(i).update(hr(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Up(e=32){if(je.crypto&&typeof je.crypto.getRandomValues=="function")return je.crypto.getRandomValues(new Uint8Array(e));if(je.crypto&&typeof je.crypto.randomBytes=="function")return je.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var js=_(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.shake256=v.shake128=v.keccak_512=v.keccak_384=v.keccak_256=v.keccak_224=v.sha3_512=v.sha3_384=v.sha3_256=v.sha3_224=v.Keccak=void 0;v.keccakP=Vs;var Ue=An(),Et=ks(),te=Ds(),_s=[],Ls=[],$s=[],Bp=BigInt(0),xt=BigInt(1),Qp=BigInt(2),Jp=BigInt(7),Hp=BigInt(256),Gp=BigInt(113);for(let e=0,t=xt,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],_s.push(2*(5*n+r)),Ls.push((e+1)*(e+2)/2%64);let i=Bp;for(let o=0;o<7;o++)t=(t<<xt^(t>>Jp)*Gp)%Hp,t&Qp&&(i^=xt<<(xt<<BigInt(o))-xt);$s.push(i)}var[zp,Wp]=(0,Et.split)($s,!0),Ms=(e,t,r)=>r>32?(0,Et.rotlBH)(e,t,r):(0,Et.rotlSH)(e,t,r),Fs=(e,t,r)=>r>32?(0,Et.rotlBL)(e,t,r):(0,Et.rotlSL)(e,t,r);function Vs(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,l=(s+2)%10,u=r[l],c=r[l+1],p=Ms(u,c,1)^r[a],d=Fs(u,c,1)^r[a+1];for(let f=0;f<50;f+=10)e[s+f]^=p,e[s+f+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=Ls[s],l=Ms(i,o,a),u=Fs(i,o,a),c=_s[s];i=e[c],o=e[c+1],e[c]=l,e[c+1]=u}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=zp[n],e[1]^=Wp[n]}r.fill(0)}var Pt=class e extends te.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Ue.anumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,te.u32)(this.state)}keccak(){te.isLE||(0,te.byteSwap32)(this.state32),Vs(this.state32,this.rounds),te.isLE||(0,te.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Ue.aexists)(this);let{blockLen:r,state:n}=this;t=(0,te.toBytes)(t);let i=t.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);for(let a=0;a<s;a++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){(0,Ue.aexists)(this,!1),(0,Ue.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,Ue.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Ue.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new e(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}};v.Keccak=Pt;var le=(e,t,r)=>(0,te.wrapConstructor)(()=>new Pt(t,e,r));v.sha3_224=le(6,144,224/8);v.sha3_256=le(6,136,256/8);v.sha3_384=le(6,104,384/8);v.sha3_512=le(6,72,512/8);v.keccak_224=le(1,144,224/8);v.keccak_256=le(1,136,256/8);v.keccak_384=le(1,104,384/8);v.keccak_512=le(1,72,512/8);var qs=(e,t,r)=>(0,te.wrapXOFConstructorWithOpts)((n={})=>new Pt(t,e,n.dkLen===void 0?r:n.dkLen,!0));v.shake128=qs(31,168,128/8);v.shake256=qs(31,136,256/8)});var Ws=_((Ax,ue)=>{"use strict";var{sha3_512:Kp}=js(),Bs=24,Tt=32,On=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Qs(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var Js=(e="")=>Qs(Kp(e)).toString(36).slice(1),Us=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),Zp=e=>Us[Math.floor(e()*Us.length)],Hs=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+On(Tt,t):On(Tt,t);return Js(n).substring(0,Tt)},Gs=e=>()=>e++,Yp=476782367,zs=({random:e=Math.random,counter:t=Gs(Math.floor(e()*Yp)),length:r=Bs,fingerprint:n=Hs({random:e})}={})=>function(){let o=Zp(e),s=Date.now().toString(36),a=t().toString(36),l=On(r,e),u=`${s+l+a+n}`;return`${o+Js(u).substring(1,r)}`},Xp=zs(),ed=(e,{minLength:t=2,maxLength:r=Tt}={})=>{let n=e.length,i=/^[0-9a-z]+$/;try{if(typeof e=="string"&&n>=t&&n<=r&&i.test(e))return!0}finally{}return!1};ue.exports.getConstants=()=>({defaultLength:Bs,bigLength:Tt});ue.exports.init=zs;ue.exports.createId=Xp;ue.exports.bufToBigInt=Qs;ue.exports.createCounter=Gs;ue.exports.createFingerprint=Hs;ue.exports.isCuid=ed});var Ks=_((vx,St)=>{"use strict";var{createId:td,init:rd,getConstants:nd,isCuid:id}=Ws();St.exports.createId=td;St.exports.init=rd;St.exports.getConstants=nd;St.exports.isCuid=id});var yi={};Ke(yi,{defineExtension:()=>fi,getExtensionContext:()=>gi});function fi(e){return typeof e=="function"?e:t=>t.$extends(e)}function gi(e){return e}var wi={};Ke(wi,{validator:()=>hi});function hi(...e){return t=>t}var J=class{_map=new Map;get(t){return this._map.get(t)?.value}set(t,r){this._map.set(t,{value:r})}getOrCreate(t,r){let n=this._map.get(t);if(n)return n.value;let i=r();return this.set(t,i),i}};function ie(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function bi(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function Ze(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function _l(e){return{models:Jr(e.models),enums:Jr(e.enums),types:Jr(e.types)}}function Jr(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}import{isAnyNull as tc,isDbNull as rc,isJsonNull as nc,ObjectEnumValue as ic}from"@prisma/client-runtime-utils";var Lt={};Ke(Lt,{$:()=>Si,bgBlack:()=>Hl,bgBlue:()=>Kl,bgCyan:()=>Yl,bgGreen:()=>zl,bgMagenta:()=>Zl,bgRed:()=>Gl,bgWhite:()=>Xl,bgYellow:()=>Wl,black:()=>Ul,blue:()=>me,bold:()=>U,cyan:()=>Y,dim:()=>Ye,gray:()=>rt,green:()=>et,grey:()=>Jl,hidden:()=>ql,inverse:()=>Vl,italic:()=>$l,magenta:()=>Bl,red:()=>de,reset:()=>Ll,strikethrough:()=>jl,underline:()=>Xe,white:()=>Ql,yellow:()=>tt});var Hr,xi,Ei,Pi,Ti=!0;typeof process<"u"&&({FORCE_COLOR:Hr,NODE_DISABLE_COLORS:xi,NO_COLOR:Ei,TERM:Pi}=process.env||{},Ti=process.stdout&&process.stdout.isTTY);var Si={enabled:!xi&&Ei==null&&Pi!=="dumb"&&(Hr!=null&&Hr!=="0"||Ti)};function T(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Si.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Ll=T(0,0),U=T(1,22),Ye=T(2,22),$l=T(3,23),Xe=T(4,24),Vl=T(7,27),ql=T(8,28),jl=T(9,29),Ul=T(30,39),de=T(31,39),et=T(32,39),tt=T(33,39),me=T(34,39),Bl=T(35,39),Y=T(36,39),Ql=T(37,39),rt=T(90,39),Jl=T(90,39),Hl=T(40,49),Gl=T(41,49),zl=T(42,49),Wl=T(43,49),Kl=T(44,49),Zl=T(45,49),Yl=T(46,49),Xl=T(47,49);var eu=100,Ai=["green","yellow","blue","magenta","cyan","red"],nt=[],vi=Date.now(),tu=0,Gr=typeof process<"u"?process.env:{};globalThis.DEBUG??=Gr.DEBUG??"";globalThis.DEBUG_COLORS??=Gr.DEBUG_COLORS?Gr.DEBUG_COLORS==="true":!0;var it={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function ru(e){let t={color:Ai[tu++%Ai.length],enabled:it.enabled(e),namespace:e,log:it.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&nt.push([o,...n]),nt.length>eu&&nt.shift(),it.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:nu(c)),u=`+${Date.now()-vi}ms`;vi=Date.now(),globalThis.DEBUG_COLORS?a(Lt[s](U(o)),...l,Lt[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var N=new Proxy(ru,{get:(e,t)=>it[t],set:(e,t,r)=>it[t]=r});function nu(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Ci(e=7500){let t=nt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
|
|
9
|
-
`);return t.length<e?t:t.slice(-e)}function Ri(){nt.length=0}var Di=pe(Ni(),1);function zr(e){let t=(0,Di.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var Mi="prisma+postgres",Vt=`${Mi}:`;function Fi(e){return e?.toString().startsWith(`${Vt}//`)??!1}function Wr(e){if(!Fi(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")||t.includes("[::1]")}var st={};Ke(st,{error:()=>au,info:()=>su,log:()=>ou,query:()=>lu,should:()=>$i,tags:()=>ot,warn:()=>Kr});var ot={error:de("prisma:error"),warn:tt("prisma:warn"),info:Y("prisma:info"),query:me("prisma:query")},$i={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function ou(...e){console.log(...e)}function Kr(e,...t){$i.warn()&&console.warn(`${ot.warn} ${e}`,...t)}function su(e,...t){console.info(`${ot.info} ${e}`,...t)}function au(e,...t){console.error(`${ot.error} ${e}`,...t)}function lu(e,...t){console.log(`${ot.query} ${e}`,...t)}function X(e,t){throw new Error(t)}function Zr({onlyFirst:e=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}var uu=Zr();function Ae(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(uu,"")}import qt from"node:path";function Yr(e){return qt.sep===qt.posix.sep?e:e.split(qt.sep).join(qt.posix.sep)}function Xr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ut(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function en(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n<e.length;n++)t(r,e[n])<0&&(r=e[n]);return r}function at(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var qi=new Set,ji=(e,t,...r)=>{qi.has(e)||(qi.add(e),Kr(t,...r))};function ve(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Bt(e){return e.toString()!=="Invalid Date"}import{Decimal as cu}from"@prisma/client-runtime-utils";function Ce(e){return cu.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}import{PrismaClientValidationError as Zu}from"@prisma/client-runtime-utils";var Qt={};Ke(Qt,{ModelAction:()=>Re,datamodelEnumToSchemaEnum:()=>pu});function pu(e){return{name:e.name,values:e.values.map(t=>t.name)}}var Re=(S=>(S.findUnique="findUnique",S.findUniqueOrThrow="findUniqueOrThrow",S.findFirst="findFirst",S.findFirstOrThrow="findFirstOrThrow",S.findMany="findMany",S.create="create",S.createMany="createMany",S.createManyAndReturn="createManyAndReturn",S.update="update",S.updateMany="updateMany",S.updateManyAndReturn="updateManyAndReturn",S.upsert="upsert",S.delete="delete",S.deleteMany="deleteMany",S.groupBy="groupBy",S.count="count",S.aggregate="aggregate",S.findRaw="findRaw",S.aggregateRaw="aggregateRaw",S))(Re||{});var Ji=pe(Li());import yu from"node:fs";var Ui={keyword:Y,entity:Y,value:e=>U(me(e)),punctuation:me,directive:Y,function:Y,variable:e=>U(me(e)),string:e=>U(et(e)),boolean:tt,number:Y,comment:rt};var du=e=>e,Jt={},mu=0,y={manual:Jt.Prism&&Jt.Prism.manual,disableWorkerMessageHandler:Jt.Prism&&Jt.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof B){let t=e;return new B(t.type,y.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(y.util.encode):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++mu}),e.__id},clone:function e(t,r){let n,i,o=y.util.type(t);switch(r=r||{},o){case"Object":if(i=y.util.objId(t),r[i])return r[i];n={},r[i]=n;for(let s in t)t.hasOwnProperty(s)&&(n[s]=e(t[s],r));return n;case"Array":return i=y.util.objId(t),r[i]?r[i]:(n=[],r[i]=n,t.forEach(function(s,a){n[a]=e(s,r)}),n);default:return t}}},languages:{extend:function(e,t){let r=y.util.clone(y.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||y.languages;let i=n[e],o={};for(let a in i)if(i.hasOwnProperty(a)){if(a==t)for(let l in r)r.hasOwnProperty(l)&&(o[l]=r[l]);r.hasOwnProperty(a)||(o[a]=i[a])}let s=n[e];return n[e]=o,y.languages.DFS(y.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=y.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=y.util.type(a);l==="Object"&&!i[o(a)]?(i[o(a)]=!0,e(a,r,null,i)):l==="Array"&&!i[o(a)]&&(i[o(a)]=!0,e(a,r,s,i))}}},plugins:{},highlight:function(e,t,r){let n={code:e,grammar:t,language:r};return y.hooks.run("before-tokenize",n),n.tokens=y.tokenize(n.code,n.grammar),y.hooks.run("after-tokenize",n),B.stringify(y.util.encode(n.tokens),n.language)},matchGrammar:function(e,t,r,n,i,o,s){for(let b in r){if(!r.hasOwnProperty(b)||!r[b])continue;if(b==s)return;let x=r[b];x=y.util.type(x)==="Array"?x:[x];for(let M=0;M<x.length;++M){let P=x[M],S=P.inside,$=!!P.lookbehind,Se=!!P.greedy,Br=0,vl=P.alias;if(Se&&!P.pattern.global){let F=P.pattern.toString().match(/[imuy]*$/)[0];P.pattern=RegExp(P.pattern.source,F+"g")}P=P.pattern||P;for(let F=n,ne=i;F<t.length;ne+=t[F].length,++F){let We=t[F];if(t.length>e.length)return;if(We instanceof B)continue;if(Se&&F!=t.length-1){P.lastIndex=ne;var p=P.exec(e);if(!p)break;var c=p.index+($?p[1].length:0),d=p.index+p[0].length,a=F,l=ne;for(let Rl=t.length;a<Rl&&(l<d||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++F,ne=l);if(t[F]instanceof B)continue;u=a-F,We=e.slice(ne,l),p.index-=ne}else{P.lastIndex=0;var p=P.exec(We),u=1}if(!p){if(o)break;continue}$&&(Br=p[1]?p[1].length:0);var c=p.index+Br,p=p[0].slice(Br),d=c+p.length,f=We.slice(0,c),h=We.slice(d);let _t=[F,u];f&&(++F,ne+=f.length,_t.push(f));let Cl=new B(b,S?y.tokenize(p,S):p,vl,p,Se);if(_t.push(Cl),h&&_t.push(h),Array.prototype.splice.apply(t,_t),u!=1&&y.matchGrammar(e,t,r,F,ne,!0,b),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return y.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=y.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=y.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:B};y.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};y.languages.javascript=y.languages.extend("clike",{"class-name":[y.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});y.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;y.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:y.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:y.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:y.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:y.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});y.languages.markup&&y.languages.markup.tag.addInlined("script","javascript");y.languages.js=y.languages.javascript;y.languages.typescript=y.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});y.languages.ts=y.languages.typescript;function B(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}B.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return B.stringify(r,t)}).join(""):fu(e.type)(e.content)};function fu(e){return Ui[e]||du}function Bi(e){return gu(e,y.languages.javascript)}function gu(e,t){return y.tokenize(e,t).map(n=>B.stringify(n)).join("")}function Qi(e){return zr(e)}var Ht=class e{firstLineNumber;lines;static read(t){let r;try{r=yu.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(t<this.firstLineNumber||t>this.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(`
|
|
10
|
-
`);return new e(t,
|
|
11
|
-
`))}highlight(){let t=
|
|
8
|
+
var kl=Object.create;var Qr=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var Ol=Object.getOwnPropertyNames;var Nl=Object.getPrototypeOf,Dl=Object.prototype.hasOwnProperty;var Fl=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var fi=(e,t)=>()=>(e&&(t=e(e=0)),t);var _=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ke=(e,t)=>{for(var r in t)Qr(e,r,{get:t[r],enumerable:!0})},Ml=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ol(t))!Dl.call(e,i)&&i!==r&&Qr(e,i,{get:()=>t[i],enumerable:!(n=Il(t,i))||n.enumerable});return e};var de=(e,t,r)=>(r=e!=null?kl(Nl(e)):{},Ml(t||!e||!e.__esModule?Qr(r,"default",{value:e,enumerable:!0}):r,e));var Ii=_((Tf,iu)=>{iu.exports={name:"@prisma/engines-version",version:"7.5.0-3.3f492635eb3e6b8b8cdfeb170b6c4f7e31f2f303",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"3f492635eb3e6b8b8cdfeb170b6c4f7e31f2f303"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Oi=_($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.enginesVersion=void 0;$t.enginesVersion=Ii().prisma.enginesVersion});var Di=_((Af,Ni)=>{"use strict";Ni.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var $i=_((Rf,Li)=>{"use strict";Li.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var qi=_((_f,jt)=>{"use strict";jt.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};jt.exports.default=jt.exports});var tn=_((kg,Gi)=>{"use strict";Gi.exports=function(){function e(t,r,n,i,o){return t<r||n<r?t>n?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&t.charCodeAt(s)===r.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,u,c,p,d,f,h,b,x,F,P,S,$=[];for(l=0;l<i;l++)$.push(l+1),$.push(t.charCodeAt(s+l));for(var Se=$.length-1;a<o-3;)for(x=r.charCodeAt(s+(u=a)),F=r.charCodeAt(s+(c=a+1)),P=r.charCodeAt(s+(p=a+2)),S=r.charCodeAt(s+(d=a+3)),f=a+=4,l=0;l<Se;l+=2)h=$[l],b=$[l+1],u=e(h,u,c,x,b),c=e(u,c,p,F,b),p=e(c,p,d,P,b),f=e(p,d,f,S,b),$[l]=f,d=p,p=c,c=u,u=h;for(;a<o;)for(x=r.charCodeAt(s+(u=a)),f=++a,l=0;l<Se;l+=2)h=$[l],$[l]=f=e(h,u,f,x,$[l+1]),u=h;return f}}()});var Yi=fi(()=>{"use strict"});var Xi=fi(()=>{"use strict"});var An=_(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.anumber=Sn;he.abytes=ls;he.ahash=Ep;he.aexists=Pp;he.aoutput=Tp;function Sn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function xp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ls(e,...t){if(!xp(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Ep(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Sn(e.outputLen),Sn(e.blockLen)}function Pp(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Tp(e,t){ls(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Is=_(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.add5L=g.add5H=g.add4H=g.add4L=g.add3H=g.add3L=g.rotlBL=g.rotlBH=g.rotlSL=g.rotlSH=g.rotr32L=g.rotr32H=g.rotrBL=g.rotrBH=g.rotrSL=g.rotrSH=g.shrSL=g.shrSH=g.toBig=void 0;g.fromBig=Cn;g.split=us;g.add=Ts;var gr=BigInt(2**32-1),vn=BigInt(32);function Cn(e,t=!1){return t?{h:Number(e&gr),l:Number(e>>vn&gr)}:{h:Number(e>>vn&gr)|0,l:Number(e&gr)|0}}function us(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=Cn(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var cs=(e,t)=>BigInt(e>>>0)<<vn|BigInt(t>>>0);g.toBig=cs;var ps=(e,t,r)=>e>>>r;g.shrSH=ps;var ds=(e,t,r)=>e<<32-r|t>>>r;g.shrSL=ds;var ms=(e,t,r)=>e>>>r|t<<32-r;g.rotrSH=ms;var fs=(e,t,r)=>e<<32-r|t>>>r;g.rotrSL=fs;var gs=(e,t,r)=>e<<64-r|t>>>r-32;g.rotrBH=gs;var ys=(e,t,r)=>e>>>r-32|t<<64-r;g.rotrBL=ys;var hs=(e,t)=>t;g.rotr32H=hs;var ws=(e,t)=>e;g.rotr32L=ws;var bs=(e,t,r)=>e<<r|t>>>32-r;g.rotlSH=bs;var xs=(e,t,r)=>t<<r|e>>>32-r;g.rotlSL=xs;var Es=(e,t,r)=>t<<r-32|e>>>64-r;g.rotlBH=Es;var Ps=(e,t,r)=>e<<r-32|t>>>64-r;g.rotlBL=Ps;function Ts(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Ss=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);g.add3L=Ss;var As=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;g.add3H=As;var vs=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);g.add4L=vs;var Cs=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;g.add4H=Cs;var Rs=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);g.add5L=Rs;var ks=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;g.add5H=ks;var Sp={fromBig:Cn,split:us,toBig:cs,shrSH:ps,shrSL:ds,rotrSH:ms,rotrSL:fs,rotrBH:gs,rotrBL:ys,rotr32H:hs,rotr32L:ws,rotlSH:bs,rotlSL:xs,rotlBH:Es,rotlBL:Ps,add:Ts,add3L:Ss,add3H:As,add4L:vs,add4H:Cs,add5H:ks,add5L:Rs};g.default=Sp});var Os=_(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.crypto=void 0;var le=Fl("node:crypto");yr.crypto=le&&typeof le=="object"&&"webcrypto"in le?le.webcrypto:le&&typeof le=="object"&&"randomBytes"in le?le:void 0});var Fs=_(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.Hash=w.nextTick=w.byteSwapIfBE=w.isLE=void 0;w.isBytes=Ap;w.u8=vp;w.u32=Cp;w.createView=Rp;w.rotr=kp;w.rotl=Ip;w.byteSwap=In;w.byteSwap32=Op;w.bytesToHex=Dp;w.hexToBytes=Fp;w.asyncLoop=_p;w.utf8ToBytes=Ds;w.toBytes=hr;w.concatBytes=Lp;w.checkOpts=$p;w.wrapConstructor=Vp;w.wrapConstructorWithOpts=qp;w.wrapXOFConstructorWithOpts=jp;w.randomBytes=Up;var je=Os(),kn=An();function Ap(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function vp(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Cp(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Rp(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function kp(e,t){return e<<32-t|e>>>t}function Ip(e,t){return e<<t|e>>>32-t>>>0}w.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function In(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}w.byteSwapIfBE=w.isLE?e=>e:e=>In(e);function Op(e){for(let t=0;t<e.length;t++)e[t]=In(e[t])}var Np=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Dp(e){(0,kn.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=Np[e[r]];return t}var te={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ns(e){if(e>=te._0&&e<=te._9)return e-te._0;if(e>=te.A&&e<=te.F)return e-(te.A-10);if(e>=te.a&&e<=te.f)return e-(te.a-10)}function Fp(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let s=Ns(e.charCodeAt(o)),a=Ns(e.charCodeAt(o+1));if(s===void 0||a===void 0){let l=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}n[i]=s*16+a}return n}var Mp=async()=>{};w.nextTick=Mp;async function _p(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);let o=Date.now()-n;o>=0&&o<t||(await(0,w.nextTick)(),n+=o)}}function Ds(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function hr(e){return typeof e=="string"&&(e=Ds(e)),(0,kn.abytes)(e),e}function Lp(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,kn.abytes)(i),t+=i.length}let r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return r}var Rn=class{clone(){return this._cloneInto()}};w.Hash=Rn;function $p(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function Vp(e){let t=n=>e().update(hr(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function qp(e){let t=(n,i)=>e(i).update(hr(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function jp(e){let t=(n,i)=>e(i).update(hr(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Up(e=32){if(je.crypto&&typeof je.crypto.getRandomValues=="function")return je.crypto.getRandomValues(new Uint8Array(e));if(je.crypto&&typeof je.crypto.randomBytes=="function")return je.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var Us=_(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.shake256=v.shake128=v.keccak_512=v.keccak_384=v.keccak_256=v.keccak_224=v.sha3_512=v.sha3_384=v.sha3_256=v.sha3_224=v.Keccak=void 0;v.keccakP=qs;var Ue=An(),Et=Is(),re=Fs(),Ls=[],$s=[],Vs=[],Bp=BigInt(0),xt=BigInt(1),Qp=BigInt(2),Jp=BigInt(7),Hp=BigInt(256),Gp=BigInt(113);for(let e=0,t=xt,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Ls.push(2*(5*n+r)),$s.push((e+1)*(e+2)/2%64);let i=Bp;for(let o=0;o<7;o++)t=(t<<xt^(t>>Jp)*Gp)%Hp,t&Qp&&(i^=xt<<(xt<<BigInt(o))-xt);Vs.push(i)}var[zp,Wp]=(0,Et.split)(Vs,!0),Ms=(e,t,r)=>r>32?(0,Et.rotlBH)(e,t,r):(0,Et.rotlSH)(e,t,r),_s=(e,t,r)=>r>32?(0,Et.rotlBL)(e,t,r):(0,Et.rotlSL)(e,t,r);function qs(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,l=(s+2)%10,u=r[l],c=r[l+1],p=Ms(u,c,1)^r[a],d=_s(u,c,1)^r[a+1];for(let f=0;f<50;f+=10)e[s+f]^=p,e[s+f+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=$s[s],l=Ms(i,o,a),u=_s(i,o,a),c=Ls[s];i=e[c],o=e[c+1],e[c]=l,e[c+1]=u}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=zp[n],e[1]^=Wp[n]}r.fill(0)}var Pt=class e extends re.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Ue.anumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,re.u32)(this.state)}keccak(){re.isLE||(0,re.byteSwap32)(this.state32),qs(this.state32,this.rounds),re.isLE||(0,re.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Ue.aexists)(this);let{blockLen:r,state:n}=this;t=(0,re.toBytes)(t);let i=t.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);for(let a=0;a<s;a++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){(0,Ue.aexists)(this,!1),(0,Ue.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,Ue.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Ue.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new e(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}};v.Keccak=Pt;var ue=(e,t,r)=>(0,re.wrapConstructor)(()=>new Pt(t,e,r));v.sha3_224=ue(6,144,224/8);v.sha3_256=ue(6,136,256/8);v.sha3_384=ue(6,104,384/8);v.sha3_512=ue(6,72,512/8);v.keccak_224=ue(1,144,224/8);v.keccak_256=ue(1,136,256/8);v.keccak_384=ue(1,104,384/8);v.keccak_512=ue(1,72,512/8);var js=(e,t,r)=>(0,re.wrapXOFConstructorWithOpts)((n={})=>new Pt(t,e,n.dkLen===void 0?r:n.dkLen,!0));v.shake128=js(31,168,128/8);v.shake256=js(31,136,256/8)});var Ks=_((Ax,ce)=>{"use strict";var{sha3_512:Kp}=Us(),Qs=24,Tt=32,On=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Js(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var Hs=(e="")=>Js(Kp(e)).toString(36).slice(1),Bs=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),Zp=e=>Bs[Math.floor(e()*Bs.length)],Gs=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+On(Tt,t):On(Tt,t);return Hs(n).substring(0,Tt)},zs=e=>()=>e++,Yp=476782367,Ws=({random:e=Math.random,counter:t=zs(Math.floor(e()*Yp)),length:r=Qs,fingerprint:n=Gs({random:e})}={})=>function(){let o=Zp(e),s=Date.now().toString(36),a=t().toString(36),l=On(r,e),u=`${s+l+a+n}`;return`${o+Hs(u).substring(1,r)}`},Xp=Ws(),ed=(e,{minLength:t=2,maxLength:r=Tt}={})=>{let n=e.length,i=/^[0-9a-z]+$/;try{if(typeof e=="string"&&n>=t&&n<=r&&i.test(e))return!0}finally{}return!1};ce.exports.getConstants=()=>({defaultLength:Qs,bigLength:Tt});ce.exports.init=Ws;ce.exports.createId=Xp;ce.exports.bufToBigInt=Js;ce.exports.createCounter=zs;ce.exports.createFingerprint=Gs;ce.exports.isCuid=ed});var Zs=_((vx,St)=>{"use strict";var{createId:td,init:rd,getConstants:nd,isCuid:id}=Ks();St.exports.createId=td;St.exports.init=rd;St.exports.getConstants=nd;St.exports.isCuid=id});var hi={};Ke(hi,{defineExtension:()=>gi,getExtensionContext:()=>yi});function gi(e){return typeof e=="function"?e:t=>t.$extends(e)}function yi(e){return e}var bi={};Ke(bi,{validator:()=>wi});function wi(...e){return t=>t}var J=class{_map=new Map;get(t){return this._map.get(t)?.value}set(t,r){this._map.set(t,{value:r})}getOrCreate(t,r){let n=this._map.get(t);if(n)return n.value;let i=r();return this.set(t,i),i}};function oe(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function xi(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function Ze(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function _l(e){return{models:Jr(e.models),enums:Jr(e.enums),types:Jr(e.types)}}function Jr(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}import{isAnyNull as tc,isDbNull as rc,isJsonNull as nc,ObjectEnumValue as ic}from"@prisma/client-runtime-utils";var Lt={};Ke(Lt,{$:()=>Ai,bgBlack:()=>Hl,bgBlue:()=>Kl,bgCyan:()=>Yl,bgGreen:()=>zl,bgMagenta:()=>Zl,bgRed:()=>Gl,bgWhite:()=>Xl,bgYellow:()=>Wl,black:()=>Ul,blue:()=>fe,bold:()=>U,cyan:()=>X,dim:()=>Ye,gray:()=>rt,green:()=>et,grey:()=>Jl,hidden:()=>ql,inverse:()=>Vl,italic:()=>$l,magenta:()=>Bl,red:()=>me,reset:()=>Ll,strikethrough:()=>jl,underline:()=>Xe,white:()=>Ql,yellow:()=>tt});var Hr,Ei,Pi,Ti,Si=!0;typeof process<"u"&&({FORCE_COLOR:Hr,NODE_DISABLE_COLORS:Ei,NO_COLOR:Pi,TERM:Ti}=process.env||{},Si=process.stdout&&process.stdout.isTTY);var Ai={enabled:!Ei&&Pi==null&&Ti!=="dumb"&&(Hr!=null&&Hr!=="0"||Si)};function T(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ai.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Ll=T(0,0),U=T(1,22),Ye=T(2,22),$l=T(3,23),Xe=T(4,24),Vl=T(7,27),ql=T(8,28),jl=T(9,29),Ul=T(30,39),me=T(31,39),et=T(32,39),tt=T(33,39),fe=T(34,39),Bl=T(35,39),X=T(36,39),Ql=T(37,39),rt=T(90,39),Jl=T(90,39),Hl=T(40,49),Gl=T(41,49),zl=T(42,49),Wl=T(43,49),Kl=T(44,49),Zl=T(45,49),Yl=T(46,49),Xl=T(47,49);var eu=100,vi=["green","yellow","blue","magenta","cyan","red"],nt=[],Ci=Date.now(),tu=0,Gr=typeof process<"u"?process.env:{};globalThis.DEBUG??=Gr.DEBUG??"";globalThis.DEBUG_COLORS??=Gr.DEBUG_COLORS?Gr.DEBUG_COLORS==="true":!0;var it={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function ru(e){let t={color:vi[tu++%vi.length],enabled:it.enabled(e),namespace:e,log:it.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&nt.push([o,...n]),nt.length>eu&&nt.shift(),it.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:nu(c)),u=`+${Date.now()-Ci}ms`;Ci=Date.now(),globalThis.DEBUG_COLORS?a(Lt[s](U(o)),...l,Lt[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var N=new Proxy(ru,{get:(e,t)=>it[t],set:(e,t,r)=>it[t]=r});function nu(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Ri(e=7500){let t=nt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
|
|
9
|
+
`);return t.length<e?t:t.slice(-e)}function ki(){nt.length=0}var Fi=de(Di(),1);function zr(e){let t=(0,Fi.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var Mi="prisma+postgres",Vt=`${Mi}:`;function _i(e){return e?.toString().startsWith(`${Vt}//`)??!1}function Wr(e){if(!_i(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")||t.includes("[::1]")}var st={};Ke(st,{error:()=>au,info:()=>su,log:()=>ou,query:()=>lu,should:()=>Vi,tags:()=>ot,warn:()=>Kr});var ot={error:me("prisma:error"),warn:tt("prisma:warn"),info:X("prisma:info"),query:fe("prisma:query")},Vi={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function ou(...e){console.log(...e)}function Kr(e,...t){Vi.warn()&&console.warn(`${ot.warn} ${e}`,...t)}function su(e,...t){console.info(`${ot.info} ${e}`,...t)}function au(e,...t){console.error(`${ot.error} ${e}`,...t)}function lu(e,...t){console.log(`${ot.query} ${e}`,...t)}function ee(e,t){throw new Error(t)}function Zr({onlyFirst:e=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}var uu=Zr();function Ae(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(uu,"")}import qt from"node:path";function Yr(e){return qt.sep===qt.posix.sep?e:e.split(qt.sep).join(qt.posix.sep)}function Xr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ut(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function en(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n<e.length;n++)t(r,e[n])<0&&(r=e[n]);return r}function at(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var ji=new Set,Ui=(e,t,...r)=>{ji.has(e)||(ji.add(e),Kr(t,...r))};function ve(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Bt(e){return e.toString()!=="Invalid Date"}import{Decimal as cu}from"@prisma/client-runtime-utils";function Ce(e){return cu.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}import{PrismaClientValidationError as Zu}from"@prisma/client-runtime-utils";var Qt={};Ke(Qt,{ModelAction:()=>Re,datamodelEnumToSchemaEnum:()=>pu});function pu(e){return{name:e.name,values:e.values.map(t=>t.name)}}var Re=(S=>(S.findUnique="findUnique",S.findUniqueOrThrow="findUniqueOrThrow",S.findFirst="findFirst",S.findFirstOrThrow="findFirstOrThrow",S.findMany="findMany",S.create="create",S.createMany="createMany",S.createManyAndReturn="createManyAndReturn",S.update="update",S.updateMany="updateMany",S.updateManyAndReturn="updateManyAndReturn",S.upsert="upsert",S.delete="delete",S.deleteMany="deleteMany",S.groupBy="groupBy",S.count="count",S.aggregate="aggregate",S.findRaw="findRaw",S.aggregateRaw="aggregateRaw",S))(Re||{});var Hi=de($i());import yu from"node:fs";var Bi={keyword:X,entity:X,value:e=>U(fe(e)),punctuation:fe,directive:X,function:X,variable:e=>U(fe(e)),string:e=>U(et(e)),boolean:tt,number:X,comment:rt};var du=e=>e,Jt={},mu=0,y={manual:Jt.Prism&&Jt.Prism.manual,disableWorkerMessageHandler:Jt.Prism&&Jt.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof B){let t=e;return new B(t.type,y.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(y.util.encode):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++mu}),e.__id},clone:function e(t,r){let n,i,o=y.util.type(t);switch(r=r||{},o){case"Object":if(i=y.util.objId(t),r[i])return r[i];n={},r[i]=n;for(let s in t)t.hasOwnProperty(s)&&(n[s]=e(t[s],r));return n;case"Array":return i=y.util.objId(t),r[i]?r[i]:(n=[],r[i]=n,t.forEach(function(s,a){n[a]=e(s,r)}),n);default:return t}}},languages:{extend:function(e,t){let r=y.util.clone(y.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||y.languages;let i=n[e],o={};for(let a in i)if(i.hasOwnProperty(a)){if(a==t)for(let l in r)r.hasOwnProperty(l)&&(o[l]=r[l]);r.hasOwnProperty(a)||(o[a]=i[a])}let s=n[e];return n[e]=o,y.languages.DFS(y.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=y.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=y.util.type(a);l==="Object"&&!i[o(a)]?(i[o(a)]=!0,e(a,r,null,i)):l==="Array"&&!i[o(a)]&&(i[o(a)]=!0,e(a,r,s,i))}}},plugins:{},highlight:function(e,t,r){let n={code:e,grammar:t,language:r};return y.hooks.run("before-tokenize",n),n.tokens=y.tokenize(n.code,n.grammar),y.hooks.run("after-tokenize",n),B.stringify(y.util.encode(n.tokens),n.language)},matchGrammar:function(e,t,r,n,i,o,s){for(let b in r){if(!r.hasOwnProperty(b)||!r[b])continue;if(b==s)return;let x=r[b];x=y.util.type(x)==="Array"?x:[x];for(let F=0;F<x.length;++F){let P=x[F],S=P.inside,$=!!P.lookbehind,Se=!!P.greedy,Br=0,vl=P.alias;if(Se&&!P.pattern.global){let M=P.pattern.toString().match(/[imuy]*$/)[0];P.pattern=RegExp(P.pattern.source,M+"g")}P=P.pattern||P;for(let M=n,ie=i;M<t.length;ie+=t[M].length,++M){let We=t[M];if(t.length>e.length)return;if(We instanceof B)continue;if(Se&&M!=t.length-1){P.lastIndex=ie;var p=P.exec(e);if(!p)break;var c=p.index+($?p[1].length:0),d=p.index+p[0].length,a=M,l=ie;for(let Rl=t.length;a<Rl&&(l<d||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++M,ie=l);if(t[M]instanceof B)continue;u=a-M,We=e.slice(ie,l),p.index-=ie}else{P.lastIndex=0;var p=P.exec(We),u=1}if(!p){if(o)break;continue}$&&(Br=p[1]?p[1].length:0);var c=p.index+Br,p=p[0].slice(Br),d=c+p.length,f=We.slice(0,c),h=We.slice(d);let _t=[M,u];f&&(++M,ie+=f.length,_t.push(f));let Cl=new B(b,S?y.tokenize(p,S):p,vl,p,Se);if(_t.push(Cl),h&&_t.push(h),Array.prototype.splice.apply(t,_t),u!=1&&y.matchGrammar(e,t,r,M,ie,!0,b),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return y.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=y.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=y.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:B};y.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};y.languages.javascript=y.languages.extend("clike",{"class-name":[y.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});y.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;y.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:y.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:y.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:y.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:y.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});y.languages.markup&&y.languages.markup.tag.addInlined("script","javascript");y.languages.js=y.languages.javascript;y.languages.typescript=y.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});y.languages.ts=y.languages.typescript;function B(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}B.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return B.stringify(r,t)}).join(""):fu(e.type)(e.content)};function fu(e){return Bi[e]||du}function Qi(e){return gu(e,y.languages.javascript)}function gu(e,t){return y.tokenize(e,t).map(n=>B.stringify(n)).join("")}function Ji(e){return zr(e)}var Ht=class e{firstLineNumber;lines;static read(t){let r;try{r=yu.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(t<this.firstLineNumber||t>this.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(`
|
|
10
|
+
`);return new e(t,Ji(n).split(`
|
|
11
|
+
`))}highlight(){let t=Qi(this.toString());return new e(this.firstLineNumber,t.split(`
|
|
12
12
|
`))}toString(){return this.lines.join(`
|
|
13
|
-
`)}};var hu={red:
|
|
14
|
-
`)}function Su(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function Gt(e){let t=e.showColors?hu:wu,r;return r=xu(e,t),Tu(r,t)}var
|
|
15
|
-
`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};
|
|
16
|
-
Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Iu(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Ou(e,t,i);return}if(n.hasField("select")){Nu(e,t);return}}if(r?.[
|
|
17
|
-
`)}};function Fe(e){return new nn(ao(e))}function ao(e){let t=new Ne;for(let[r,n]of Object.entries(e)){let i=new Xt(r,lo(n));t.addField(i)}return t}function lo(e){if(typeof e=="string")return new R(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new R(String(e));if(typeof e=="bigint")return new R(`${e}n`);if(e===null)return new R("null");if(e===void 0)return new R("undefined");if(Ce(e))return new R(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new R(`Buffer.alloc(${e.byteLength})`):new R(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Bt(e)?e.toISOString():"Invalid Date";return new R(`new Date("${t}")`)}return e instanceof Wu?new R(`Prisma.${e._getName()}`):Me(e)?new R(`prisma.${ie(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Ku(e):typeof e=="object"?ao(e):new R(Object.prototype.toString.call(e))}function Ku(e){let t=new Oe;for(let r of e)t.addItem(lo(r));return t}function er(e,t){let r=t==="pretty"?Xi:Zt,n=e.renderAllMessages(r),i=new ke(0,{colors:r}).write(e).toString();return{message:n,args:i}}function tr({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=Fe(e);for(let p of t)zt(p,a,s);let{message:l,args:u}=er(a,r),c=Gt({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new Zu(c,{clientVersion:o})}function G(e){return e.replace(/^./,t=>t.toLowerCase())}function co(e,t,r){let n=G(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Yu({...e,...uo(t.name,e,t.result.$allModels),...uo(t.name,e,t.result[n])})}function Yu(e){let t=new J,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Ut(e,n=>({...n,needs:r(n.name,new Set)}))}function uo(e,t,r){return r?Ut(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Xu(t,o,i)})):{}}function Xu(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function po(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function mo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var rr=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new J;modelExtensionsCache=new J;queryCallbacksCache=new J;clientExtensions=Ze(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=Ze(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>co(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=G(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},_e=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new rr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new rr(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var nr=class{constructor(t){this.name=t}};function fo(e){return e instanceof nr}function ec(e){return new nr(e)}var go=Symbol(),pt=class{constructor(t){if(t!==go)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?on:t}},on=new pt(go);function V(e){return e instanceof pt}var oc={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},yo="explicitly `undefined` values are not allowed";function an({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=_e.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c,wrapRawValues:p}){let d=new sn({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c,wrapRawValues:p});return{modelName:e,action:oc[t],query:dt(r,d)}}function dt({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:wo(r,n),selection:sc(e,t,i,n)}}function sc(e,t,r,n){return e?(t?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):r&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),cc(e,n)):ac(n,t,r)}function ac(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&lc(n,t,e),uc(n,r,e),n}function lc(e,t,r){for(let[n,i]of Object.entries(t)){if(V(i))continue;let o=r.nestSelection(n);if(ln(i,o),i===!1||i===void 0){e[n]=!1;continue}let s=r.findField(n);if(s&&s.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),s){e[n]=dt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=dt(i,o)}}function uc(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=mo(i,n);for(let[s,a]of Object.entries(o)){if(V(a))continue;ln(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function cc(e,t){let r={},n=t.getComputedFields(),i=po(e,n);for(let[o,s]of Object.entries(i)){if(V(s))continue;let a=t.nestSelection(o);ln(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||V(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=dt({},a):r[o]=!0;continue}r[o]=dt(s,a)}}return r}function ho(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(ve(e)){if(Bt(e))return{$type:"DateTime",value:e.toISOString()};t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(fo(e))return{$type:"Param",value:e.name};if(Me(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return pc(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:Buffer.from(r,n,i).toString("base64")}}if(dc(e))return e.values;if(Ce(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof ic){if(!rc(e)&&!nc(e)&&!tc(e))throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(mc(e))return e.toJSON();if(typeof e=="object")return wo(e,t);t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function wo(e,t){if(t.shouldWrapRawValues()&&e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);V(i)||(i!==void 0?r[n]=ho(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:yo}))}return r}function pc(e,t){let r=[];for(let n=0;n<e.length;n++){let i=t.nestArgument(String(n)),o=e[n];if(o===void 0||V(o)){let s=o===void 0?"undefined":"Prisma.skip";t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:i.getSelectionPath(),argumentPath:i.getArgumentPath(),argument:{name:`${t.getArgumentName()}[${n}]`,typeNames:[]},underlyingError:`Can not use \`${s}\` value within array. Use \`null\` or filter out \`${s}\` values`})}r.push(ho(o,i))}return r}function dc(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function mc(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function ln(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:yo})}var sn=class e{constructor(t){this.params=t;this.params.modelName&&(this.modelOrType=this.params.runtimeDataModel.models[this.params.modelName]??this.params.runtimeDataModel.types[this.params.modelName])}modelOrType;throwValidationError(t){tr({errors:[t],originalMethod:this.params.originalMethod,args:this.params.rootArgs??{},callsite:this.params.callsite,errorFormat:this.params.errorFormat,clientVersion:this.params.clientVersion,globalOmit:this.params.globalOmit})}getSelectionPath(){return this.params.selectionPath}getArgumentPath(){return this.params.argumentPath}getArgumentName(){return this.params.argumentPath[this.params.argumentPath.length-1]}getOutputTypeDescription(){if(!(!this.params.modelName||!this.modelOrType))return{name:this.params.modelName,fields:this.modelOrType.fields.map(t=>({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}shouldWrapRawValues(){return this.params.wrapRawValues??!1}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[ie(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:X(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};function fc(e,t){let r=Ze(()=>gc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function gc(e){return{datamodel:{models:un(e.models),enums:un(e.enums),types:un(e.types)}}}function un(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var cn=new WeakMap,ir="$$PrismaTypedSql",mt=class{constructor(t,r){cn.set(this,{sql:t,values:r}),Object.defineProperty(this,ir,{value:ir})}get sql(){return cn.get(this).sql}get values(){return cn.get(this).values}};function yc(e){return(...t)=>new mt(e,t)}function or(e){return e!=null&&e[ir]===ir}import{Sql as Cm}from"@prisma/client-runtime-utils";import{AsyncResource as Rm}from"node:async_hooks";import{EventEmitter as km}from"node:events";function ft(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function D(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function fe(e){let t=new J;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var sr={enumerable:!0,configurable:!0,writable:!0};function ar(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>sr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var bo=Symbol.for("nodejs.util.inspect.custom");function Q(e,t){let r=hc(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=xo(Reflect.ownKeys(o),r),a=xo(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...sr,...l?.getPropertyDescriptor(s)}:sr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[bo]=function(){let o={...this};return delete o[bo],o},i}function hc(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function xo(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Le(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Eo(e){if(e===void 0)return"";let t=Fe(e);return new ke(0,{colors:Zt}).write(t).toString()}var gt="<unknown>";function Po(e){var t=e.split(`
|
|
18
|
-
`);return t.reduce(function(r,n){var i=xc(n)||Pc(n)||Ac(n)||kc(n)||Cc(n);return i&&r.push(i),r},[])}var wc=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bc=/\((\S*)(?::(\d+))(?::(\d+))\)/;function xc(e){var t=wc.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=bc.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||gt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Ec=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Pc(e){var t=Ec.exec(e);return t?{file:t[2],methodName:t[1]||gt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Tc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Sc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ac(e){var t=Tc.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Sc.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||gt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var vc=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Cc(e){var t=vc.exec(e);return t?{file:t[3],methodName:t[1]||gt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Rc=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function kc(e){var t=Rc.exec(e);return t?{file:t[2],methodName:t[1]||gt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var pn=class{getLocation(){return null}},dn=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=Po(t).find(i=>{if(!i.file)return!1;let o=Yr(i.file);return o!=="<anonymous>"&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/client.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function se(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new pn:new dn}var To={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function $e(e={}){let t=Oc(e);return Object.entries(t).reduce((n,[i,o])=>(To[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Oc(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function lr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function So(e,t){let r=lr(e);return t({action:"aggregate",unpacker:r,argsMapper:$e})(e)}function Nc(e={}){let{select:t,...r}=e;return typeof t=="object"?$e({...r,_count:t}):$e({...r,_count:{_all:!0}})}function Dc(e={}){return typeof e.select=="object"?t=>lr(e)(t)._count:t=>lr(e)(t)._count._all}function Ao(e,t){return t({action:"count",unpacker:Dc(e),argsMapper:Nc})(e)}function Mc(e={}){let t=$e(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function Fc(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function vo(e,t){return t({action:"groupBy",unpacker:Fc(e),argsMapper:Mc})(e)}function Co(e,t,r){if(t==="aggregate")return n=>So(n,r);if(t==="count")return n=>Ao(n,r);if(t==="groupBy")return n=>vo(n,r)}function Ro(e,t){let r=t.fields.filter(i=>!i.relationName),n=bi(r,"name");return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new ct(e,o,s.type,s.isList,s.kind==="enum")},...ar(Object.keys(n))})}var ko=e=>Array.isArray(e)?e:e.split("."),mn=(e,t)=>ko(t).reduce((r,n)=>r&&r[n],e),Io=(e,t,r)=>ko(t).reduceRight((n,i,o,s)=>Object.assign({},mn(e,s.slice(0,o)),{[i]:n}),r);function _c(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Lc(e,t,r){return t===void 0?e??{}:Io(t,r,e||!0)}function fn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=se(e._errorFormat),c=_c(n,i),p=Lc(l,o,c),d=r({dataPath:c,callsite:u})(p),f=$c(e,t);return new Proxy(d,{get(h,b){if(!f.includes(b))return h[b];let M=[a[b].type,r,b],P=[c,p];return fn(e,...M,...P)},...ar([...f,...Object.getOwnPropertyNames(d)])})}}function $c(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Vc=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],qc=["aggregate","count","groupBy"];function gn(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[jc(e,t),Bc(e,t),ft(r),D("name",()=>t),D("$name",()=>t),D("$parent",()=>e._appliedParent)];return Q({},n)}function jc(e,t){let r=G(t),n=Object.keys(Re).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=se(e._errorFormat);return e._createPrismaPromise(c=>{let p={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:c,callsite:u};return e._request({...p,...a})},{action:o,args:l,model:t})};return Vc.includes(o)?fn(e,t,s):Uc(i)?Co(e,i,s):s({})}}}function Uc(e){return qc.includes(e)}function Bc(e,t){return fe(D("fields",()=>{let r=e._runtimeDataModel.models[t];return Ro(t,r)}))}function Oo(e){return e.replace(/^./,t=>t.toUpperCase())}var yn=Symbol();function yt(e){let t=[Qc(e),Jc(e),D(yn,()=>e),D("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(ft(r)),Q(e,t)}function Qc(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function Jc(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(G),n=[...new Set(t.concat(r))];return fe({getKeys(){return n},getPropertyValue(i){let o=Oo(i);if(e._runtimeDataModel.models[o]!==void 0)return gn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return gn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function No(e){return e[yn]?e[yn]:e}function Do(e){if(typeof e=="function")return e(this);let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$on:{value:void 0}});return yt(t)}function Mo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(c=>n[c]);u.length>0&&a.push(Le(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(c=>!r[c]);u.length>0&&a.push(Le(u))}Hc(e,l.needs)&&s.push(Gc(l,Q(e,s)))}return s.length>0||a.length>0?Q(e,[...s,...a]):e}function Hc(e,t){return t.every(r=>Xr(e,r))}function Gc(e,t){return fe(D(e.name,()=>e.compute(t)))}function ur({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=ur({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&Fo({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&Fo({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function Fo({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||V(s))continue;let l=n.models[r].fields.find(c=>c.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=ur({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function _o({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:ur({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=G(l);return Mo({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}import{Decimal as Wc,ObjectEnumValue as Kc,Sql as $o}from"@prisma/client-runtime-utils";var zc=["$connect","$disconnect","$on","$transaction","$extends"],Lo=zc;function Vo(e){if(e instanceof $o)return Zc(e);if(or(e))return Yc(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=ht(e[n]);return r}let t={};for(let r in e)t[r]=ht(e[r]);return t}function Zc(e){return new $o(e.strings,e.values)}function Yc(e){return new mt(e.sql,e.values)}function ht(e){if(typeof e!="object"||e==null||e instanceof Kc||Me(e)||V(e))return e;if(Ce(e))return new Wc(e.toFixed());if(ve(e))return new Date(+e);if(ArrayBuffer.isView(e))return e.slice(0);if(Array.isArray(e)){let t=e.length,r;for(r=Array(t);t--;)r[t]=ht(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:ht(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=ht(e[r]);return t}X(e,"Unknown value")}function jo(e,t,r,n=0){return e._createPrismaPromise(i=>{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Vo(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Jo(o,l),a.args=s,jo(e,a,r,n+1)}})})}function Uo(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return jo(e,t,s)}function Bo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Qo(r,n,0,e):e(r)}}function Qo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=Jo(i,l),Qo(a,t,r+1,n)}})}var qo=e=>e;function Jo(e=qo,t=qo){return r=>e(t(r))}import{Decimal as Xc}from"@prisma/client-runtime-utils";import{Decimal as cr}from"@prisma/client-runtime-utils";function E(e,t){throw new Error(t)}function hn(e,t){return e===t||e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>hn(e[r],t[r]))}function Ve(e,t){let r=Object.keys(e),n=Object.keys(t);return(r.length<n.length?r:n).every(o=>{if(typeof e[o]==typeof t[o]&&typeof e[o]!="object")return e[o]===t[o];if(cr.isDecimal(e[o])||cr.isDecimal(t[o])){let s=Ho(e[o]),a=Ho(t[o]);return s&&a&&s.equals(a)}else if(e[o]instanceof Uint8Array||t[o]instanceof Uint8Array){let s=Go(e[o]),a=Go(t[o]);return s&&a&&s.equals(a)}else{if(e[o]instanceof Date||t[o]instanceof Date)return zo(e[o])?.getTime()===zo(t[o])?.getTime();if(typeof e[o]=="bigint"||typeof t[o]=="bigint")return Wo(e[o])===Wo(t[o]);if(typeof e[o]=="number"||typeof t[o]=="number")return Ko(e[o])===Ko(t[o])}return hn(e[o],t[o])})}function Ho(e){return cr.isDecimal(e)?e:typeof e=="number"||typeof e=="string"?new cr(e):void 0}function Go(e){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e.buffer,e.byteOffset,e.byteLength):typeof e=="string"?Buffer.from(e,"base64"):void 0}function zo(e){return e instanceof Date?e:typeof e=="string"||typeof e=="number"?new Date(e):void 0}function Wo(e){return typeof e=="bigint"?e:typeof e=="number"||typeof e=="string"?BigInt(e):void 0}function Ko(e){return typeof e=="number"?e:typeof e=="string"?Number(e):void 0}function wt(e){return JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():ArrayBuffer.isView(r)?Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("base64"):r)}function ep(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function tp(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function ge(e){return e===null?e:Array.isArray(e)?e.map(ge):typeof e=="object"?ep(e)?rp(e):e.constructor!==null&&e.constructor.name!=="Object"?e:tp(e,ge):e}function rp({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"DateTime":return new Date(t);case"Decimal":return new Xc(t);case"Json":return JSON.parse(t);default:E(t,"Unknown tagged value")}}function pr(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var m={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Character:6,Text:7,Date:8,Time:9,DateTime:10,Json:11,Enum:12,Bytes:13,Set:14,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,EnumArray:76,BytesArray:77,UuidArray:78,UnknownNumber:128};var k=class extends Error{name="UserFacingError";code;meta;constructor(t,r,n){super(t),this.code=r,this.meta=n??{}}toQueryResponseErrorObject(){return{error:this.message,user_facing_error:{is_panic:!1,message:this.message,meta:this.meta,error_code:this.code}}}};function qe(e){if(!pr(e))throw e;let t=np(e),r=Zo(e);throw!t||!r?e:new k(r,t,{driverAdapterError:e})}function bn(e){throw pr(e)?new k(`Raw query failed. Code: \`${e.cause.originalCode??"N/A"}\`. Message: \`${e.cause.originalMessage??Zo(e)}\``,"P2010",{driverAdapterError:e}):e}function np(e){switch(e.cause.kind){case"AuthenticationFailed":return"P1000";case"DatabaseNotReachable":return"P1001";case"DatabaseDoesNotExist":return"P1003";case"SocketTimeout":return"P1008";case"DatabaseAlreadyExists":return"P1009";case"DatabaseAccessDenied":return"P1010";case"TlsConnectionError":return"P1011";case"ConnectionClosed":return"P1017";case"TransactionAlreadyClosed":return"P1018";case"LengthMismatch":return"P2000";case"UniqueConstraintViolation":return"P2002";case"ForeignKeyConstraintViolation":return"P2003";case"InvalidInputValue":return"P2007";case"UnsupportedNativeDataType":return"P2010";case"NullConstraintViolation":return"P2011";case"ValueOutOfRange":return"P2020";case"TableDoesNotExist":return"P2021";case"ColumnNotFound":return"P2022";case"InvalidIsolationLevel":case"InconsistentColumnData":return"P2023";case"MissingFullTextSearchIndex":return"P2030";case"TransactionWriteConflict":return"P2034";case"GenericJs":return"P2036";case"TooManyConnections":return"P2037";case"postgres":case"sqlite":case"mysql":case"mssql":return;default:E(e.cause,`Unknown error: ${e.cause}`)}}function Zo(e){switch(e.cause.kind){case"AuthenticationFailed":return`Authentication failed against the database server, the provided database credentials for \`${e.cause.user??"(not available)"}\` are not valid`;case"DatabaseNotReachable":{let t=e.cause.host&&e.cause.port?`${e.cause.host}:${e.cause.port}`:e.cause.host;return`Can't reach database server${t?` at ${t}`:""}`}case"DatabaseDoesNotExist":return`Database \`${e.cause.db??"(not available)"}\` does not exist on the database server`;case"SocketTimeout":return"Operation has timed out";case"DatabaseAlreadyExists":return`Database \`${e.cause.db??"(not available)"}\` already exists on the database server`;case"DatabaseAccessDenied":return`User was denied access on the database \`${e.cause.db??"(not available)"}\``;case"TlsConnectionError":return`Error opening a TLS connection: ${e.cause.reason}`;case"ConnectionClosed":return"Server has closed the connection.";case"TransactionAlreadyClosed":return e.cause.cause;case"LengthMismatch":return`The provided value for the column is too long for the column's type. Column: ${e.cause.column??"(not available)"}`;case"UniqueConstraintViolation":return`Unique constraint failed on the ${wn(e.cause.constraint)}`;case"ForeignKeyConstraintViolation":return`Foreign key constraint violated on the ${wn(e.cause.constraint)}`;case"UnsupportedNativeDataType":return`Failed to deserialize column of type '${e.cause.type}'. If you're using $queryRaw and this column is explicitly marked as \`Unsupported\` in your Prisma schema, try casting this column to any supported Prisma type such as \`String\`.`;case"NullConstraintViolation":return`Null constraint violation on the ${wn(e.cause.constraint)}`;case"ValueOutOfRange":return`Value out of range for the type: ${e.cause.cause}`;case"TableDoesNotExist":return`The table \`${e.cause.table??"(not available)"}\` does not exist in the current database.`;case"ColumnNotFound":return`The column \`${e.cause.column??"(not available)"}\` does not exist in the current database.`;case"InvalidIsolationLevel":return`Error in connector: Conversion error: ${e.cause.level}`;case"InconsistentColumnData":return`Inconsistent column data: ${e.cause.cause}`;case"MissingFullTextSearchIndex":return"Cannot find a fulltext index to use for the native search, try adding a @@fulltext([Fields...]) to your schema";case"TransactionWriteConflict":return"Transaction failed due to a write conflict or a deadlock. Please retry your transaction";case"GenericJs":return`Error in external connector (id ${e.cause.id})`;case"TooManyConnections":return`Too many database connections opened: ${e.cause.cause}`;case"InvalidInputValue":return`Invalid input value: ${e.cause.message}`;case"sqlite":case"postgres":case"mysql":case"mssql":return;default:E(e.cause,`Unknown error: ${e.cause}`)}}function wn(e){return e&&"fields"in e?`fields: (${e.fields.map(t=>`\`${t}\``).join(", ")})`:e&&"index"in e?`constraint: \`${e.index}\``:e&&"foreignKey"in e?"foreign key":"(not available)"}function ip(e){if(typeof e!="object"||e===null)return!1;let t=e;return"$type"in t&&t.$type==="Param"||"prisma__type"in t&&t.prisma__type==="param"}function op(e){return"prisma__type"in e?e.prisma__value?.name:e.value.name}function sp(e,t){let r={};for(let[n,i]of Object.entries(e))if(r[n]=i,ip(i)){let o=op(i);o&&o in t&&(r[n]=t[o])}return r}function Yo(e,t,r={}){let n=e.map(o=>t.keys.reduce((s,a)=>(s[a]=ge(o[a]),s),{})),i=new Set(t.nestedSelection);return t.arguments.map(o=>{let s=sp(o,r),a=n.findIndex(l=>Ve(l,s));if(a===-1)return t.expectNonEmpty?new k("An operation failed because it depends on one or more records that were required but not found","P2025"):null;{let l=Object.entries(e[a]).filter(([u])=>i.has(u));return Object.fromEntries(l)}})}import{Decimal as ap}from"@prisma/client-runtime-utils";var A=class extends k{name="DataMapperError";constructor(t,r){super(t,"P2023",r)}},Xo=new WeakMap;function lp(e){let t=Xo.get(e);return t||(t=Object.entries(e),Xo.set(e,t)),t}function ts(e,t,r){switch(t.type){case"affectedRows":if(typeof e!="number")throw new A(`Expected an affected rows count, got: ${typeof e} (${e})`);return{count:e};case"object":return En(e,t.fields,r,t.skipNulls);case"field":return xn(e,"<result>",t.fieldType,r);default:E(t,`Invalid data mapping type: '${t.type}'`)}}function En(e,t,r,n){if(e===null)return null;if(Array.isArray(e)){let i=e;return n&&(i=i.filter(o=>o!==null)),i.map(o=>es(o,t,r))}if(typeof e=="object")return es(e,t,r);if(typeof e=="string"){let i;try{i=JSON.parse(e)}catch(o){throw new A("Expected an array or object, got a string that is not valid JSON",{cause:o})}return En(i,t,r,n)}throw new A(`Expected an array or an object, got: ${typeof e}`)}function es(e,t,r){if(typeof e!="object")throw new A(`Expected an object, but got '${typeof e}'`);let n={};for(let[i,o]of lp(t))switch(o.type){case"affectedRows":throw new A(`Unexpected 'AffectedRows' node in data mapping for field '${i}'`);case"object":{let{serializedName:s,fields:a,skipNulls:l}=o;if(s!==null&&!Object.hasOwn(e,s))throw new A(`Missing data field (Object): '${i}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`);let u=s!==null?e[s]:e;n[i]=En(u,a,r,l);break}case"field":{let s=o.dbName;if(Object.hasOwn(e,s))n[i]=up(e[s],s,o.fieldType,r);else throw new A(`Missing data field (Value): '${s}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`)}break;default:E(o,`DataMapper: Invalid data mapping node type: '${o.type}'`)}return n}function up(e,t,r,n){return e===null?r.arity==="list"?[]:null:r.arity==="list"?e.map((o,s)=>xn(o,`${t}[${s}]`,r,n)):xn(e,t,r,n)}function xn(e,t,r,n){switch(r.type){case"unsupported":return e;case"string":{if(typeof e!="string")throw new A(`Expected a string in column '${t}', got ${typeof e}: ${e}`);return e}case"int":switch(typeof e){case"number":return Math.trunc(e);case"string":{let i=Math.trunc(Number(e));if(Number.isNaN(i)||!Number.isFinite(i))throw new A(`Expected an integer in column '${t}', got string: ${e}`);if(!Number.isSafeInteger(i))throw new A(`Integer value in column '${t}' is too large to represent as a JavaScript number without loss of precision, got: ${e}. Consider using BigInt type.`);return i}default:throw new A(`Expected an integer in column '${t}', got ${typeof e}: ${e}`)}case"bigint":{if(typeof e!="number"&&typeof e!="string")throw new A(`Expected a bigint in column '${t}', got ${typeof e}: ${e}`);return{$type:"BigInt",value:e}}case"float":{if(typeof e=="number")return e;if(typeof e=="string"){let i=Number(e);if(Number.isNaN(i)&&!/^[-+]?nan$/.test(e.toLowerCase()))throw new A(`Expected a float in column '${t}', got string: ${e}`);return i}throw new A(`Expected a float in column '${t}', got ${typeof e}: ${e}`)}case"boolean":{if(typeof e=="boolean")return e;if(typeof e=="number")return e===1;if(typeof e=="string"){if(e==="true"||e==="TRUE"||e==="1")return!0;if(e==="false"||e==="FALSE"||e==="0")return!1;throw new A(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`)}if(Array.isArray(e)||e instanceof Uint8Array){for(let i of e)if(i!==0)return!0;return!1}throw new A(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`)}case"decimal":if(typeof e!="number"&&typeof e!="string"&&!ap.isDecimal(e))throw new A(`Expected a decimal in column '${t}', got ${typeof e}: ${e}`);return{$type:"Decimal",value:e};case"datetime":{if(typeof e=="string")return{$type:"DateTime",value:pp(e)};if(typeof e=="number"||e instanceof Date)return{$type:"DateTime",value:e};throw new A(`Expected a date in column '${t}', got ${typeof e}: ${e}`)}case"object":return{$type:"Json",value:wt(e)};case"json":return{$type:"Json",value:`${e}`};case"bytes":{switch(r.encoding){case"base64":if(typeof e!="string")throw new A(`Expected a base64-encoded byte array in column '${t}', got ${typeof e}: ${e}`);return{$type:"Bytes",value:e};case"hex":if(typeof e!="string"||!e.startsWith("\\x"))throw new A(`Expected a hex-encoded byte array in column '${t}', got ${typeof e}: ${e}`);return{$type:"Bytes",value:Buffer.from(e.slice(2),"hex").toString("base64")};case"array":if(Array.isArray(e))return{$type:"Bytes",value:Buffer.from(e).toString("base64")};if(e instanceof Uint8Array)return{$type:"Bytes",value:Buffer.from(e).toString("base64")};throw new A(`Expected a byte array in column '${t}', got ${typeof e}: ${e}`);default:E(r.encoding,`DataMapper: Unknown bytes encoding: ${r.encoding}`)}break}case"enum":{let i=n[r.name];if(i===void 0)throw new A(`Unknown enum '${r.name}'`);let o=i[`${e}`];if(o===void 0)throw new A(`Value '${e}' not found in enum '${r.name}'`);return o}default:E(r,`DataMapper: Unknown result type: ${r.type}`)}}var cp=/\d{2}:\d{2}:\d{2}(?:\.\d+)?(Z|[+-]\d{2}(:?\d{2})?)?$/;function pp(e){let t=cp.exec(e);if(t===null)return`${e}T00:00:00Z`;let r=e,[n,i,o]=t;if(i!==void 0&&i!=="Z"&&o===void 0?r=`${e}:00`:i===void 0&&(r=`${e}Z`),n.length===e.length)return`1970-01-01T${r}`;let s=t.index-1;return r[s]===" "&&(r=`${r.slice(0,s)}T${r.slice(s+1)}`),r}function z(e){if(typeof e!="object")return e;var t,r,n=Object.prototype.toString.call(e);if(n==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){r=new e.constructor;for(t in e)e.hasOwnProperty(t)&&r[t]!==e[t]&&(r[t]=z(e[t]))}else{r={};for(t in e)t==="__proto__"?Object.defineProperty(r,t,{value:z(e[t]),configurable:!0,enumerable:!0,writable:!0}):r[t]=z(e[t])}return r}if(n==="[object Array]"){for(t=e.length,r=Array(t);t--;)r[t]=z(e[t]);return r}return n==="[object Set]"?(r=new Set,e.forEach(function(i){r.add(z(i))}),r):n==="[object Map]"?(r=new Map,e.forEach(function(i,o){r.set(z(o),z(i))}),r):n==="[object Date]"?new Date(+e):n==="[object RegExp]"?(r=new RegExp(e.source,e.flags),r.lastIndex=e.lastIndex,r):n==="[object DataView]"?new e.constructor(z(e.buffer)):n==="[object ArrayBuffer]"?e.slice(0):n.slice(-6)==="Array]"?new e.constructor(e):e}function dp(e){let t=Object.entries(e);return t.length===0?"":(t.sort(([n],[i])=>n.localeCompare(i)),`/*${t.map(([n,i])=>{let o=encodeURIComponent(n),s=encodeURIComponent(i).replace(/'/g,"\\'");return`${o}='${s}'`}).join(",")}*/`)}function dr(e,t){let r={};for(let n of e){let i=n(z(t));for(let[o,s]of Object.entries(i))s!==void 0&&(r[o]=s)}return r}function rs(e,t){let r=dr(e,t);return dp(r)}function ns(e,t){return t?`${e} ${t}`:e}var bt;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(bt||(bt={}));function mp(e){switch(e){case"postgresql":case"postgres":case"prisma+postgres":return"postgresql";case"sqlserver":return"mssql";case"mysql":case"sqlite":case"cockroachdb":case"mongodb":return e;default:E(e,`Unknown provider: ${e}`)}}async function mr({query:e,tracingHelper:t,provider:r,onQuery:n,execute:i}){let o=n===void 0?i:async()=>{let s=new Date,a=performance.now(),l=await i(),u=performance.now();return n({timestamp:s,duration:u-a,query:e.sql,params:e.args}),l};return t.isEnabled()?await t.runInChildSpan({name:"db_query",kind:bt.CLIENT,attributes:{"db.query.text":e.sql,"db.system.name":mp(r)}},o):o()}function ye(e,t){var r="000000000"+e;return r.substr(r.length-t)}import fp from"node:os";function gp(){try{return fp.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var is=2,yp=ye(process.pid.toString(36),is),os=gp(),hp=os.length,wp=ye(os.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+hp+36).toString(36),is);function Pn(){return yp+wp}function fr(e){return typeof e=="string"&&/^c[a-z0-9]{20,32}$/.test(e)}function Tn(e){let n=Math.pow(36,4),i=0;function o(){return ye((Math.random()*n<<0).toString(36),4)}function s(){return i=i<n?i:0,i++,i-1}function a(){var l="c",u=new Date().getTime().toString(36),c=ye(s().toString(36),4),p=e(),d=o()+o();return l+u+c+p+d}return a.fingerprint=e,a.isCuid=fr,a}var bp=Tn(Pn);var ss=bp;var ia=pe(Ks());import{webcrypto as Ys}from"node:crypto";var Zs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var od=128,we,Be;function sd(e){!we||we.length<e?(we=Buffer.allocUnsafe(e*od),Ys.getRandomValues(we),Be=0):Be+e>we.length&&(Ys.getRandomValues(we),Be=0),Be+=e}function Nn(e=21){sd(e|=0);let t="";for(let r=Be-e;r<Be;r++)t+=Zs[we[r]&63];return t}import wr from"node:crypto";var ea="0123456789ABCDEFGHJKMNPQRSTVWXYZ",At=32;var ad=16,ta=10,Xs=0xffffffffffff;var be;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(be||(be={}));var xe=class extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}};function ld(e){let t=Math.floor(e()*At);return t===At&&(t=At-1),ea.charAt(t)}function ud(e){let t=cd(),r=t&&(t.crypto||t.msCrypto)||(typeof wr<"u"?wr:null);if(typeof r?.getRandomValues=="function")return()=>{let n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof r?.randomBytes=="function")return()=>r.randomBytes(1).readUInt8()/255;if(wr?.randomBytes)return()=>wr.randomBytes(1).readUInt8()/255;throw new xe(be.PRNGDetectFailure,"Failed to find a reliable PRNG")}function cd(){return md()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function pd(e,t){let r="";for(;e>0;e--)r=ld(t)+r;return r}function dd(e,t=ta){if(isNaN(e))throw new xe(be.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Xs)throw new xe(be.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Xs}: ${e}`);if(e<0)throw new xe(be.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new xe(be.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%At,n=ea.charAt(r)+n,e=(e-r)/At;return n}function md(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function ra(e,t){let r=t||ud(),n=!e||isNaN(e)?Date.now():e;return dd(n,ta)+pd(ad,r)}var I=[];for(let e=0;e<256;++e)I.push((e+256).toString(16).slice(1));function br(e,t=0){return(I[e[t+0]]+I[e[t+1]]+I[e[t+2]]+I[e[t+3]]+"-"+I[e[t+4]]+I[e[t+5]]+"-"+I[e[t+6]]+I[e[t+7]]+"-"+I[e[t+8]]+I[e[t+9]]+"-"+I[e[t+10]]+I[e[t+11]]+I[e[t+12]]+I[e[t+13]]+I[e[t+14]]+I[e[t+15]]).toLowerCase()}import{randomFillSync as fd}from"node:crypto";var Er=new Uint8Array(256),xr=Er.length;function Qe(){return xr>Er.length-16&&(fd(Er),xr=0),Er.slice(xr,xr+=16)}import{randomUUID as gd}from"node:crypto";var Dn={randomUUID:gd};function yd(e,t,r){if(Dn.randomUUID&&!t&&!e)return Dn.randomUUID();e=e||{};let n=e.random??e.rng?.()??Qe();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return br(n)}var Mn=yd;var Fn={};function hd(e,t,r){let n;if(e)n=na(e.random??e.rng?.()??Qe(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=Qe();wd(Fn,i,o),n=na(o,Fn.msecs,Fn.seq,t,r)}return t??br(n)}function wd(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function na(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}var _n=hd;var Pr=class{#e={};constructor(){this.register("uuid",new $n),this.register("cuid",new Vn),this.register("ulid",new qn),this.register("nanoid",new jn),this.register("product",new Un)}snapshot(){return Object.create(this.#e,{now:{value:new Ln}})}register(t,r){this.#e[t]=r}},Ln=class{#e=new Date;generate(){return this.#e.toISOString()}},$n=class{generate(t){if(t===4)return Mn();if(t===7)return _n();throw new Error("Invalid UUID generator arguments")}},Vn=class{generate(t){if(t===1)return ss();if(t===2)return(0,ia.createId)();throw new Error("Invalid CUID generator arguments")}},qn=class{generate(){return ra()}},jn=class{generate(t){if(typeof t=="number")return Nn(t);if(t===void 0)return Nn();throw new Error("Invalid Nanoid generator arguments")}},Un=class{generate(t,r){if(t===void 0||r===void 0)throw new Error("Invalid Product generator arguments");return Array.isArray(t)&&Array.isArray(r)?t.flatMap(n=>r.map(i=>[n,i])):Array.isArray(t)?t.map(n=>[n,r]):Array.isArray(r)?r.map(n=>[t,n]):[[t,r]]}};function Tr(e,t){return e==null?e:typeof e=="string"?Tr(JSON.parse(e),t):Array.isArray(e)?xd(e,t):bd(e,t)}function bd(e,t){if(t.pagination){let{skip:r,take:n,cursor:i}=t.pagination;if(r!==null&&r>0||n===0||i!==null&&!Ve(e,i))return null}return sa(e,t.nested)}function sa(e,t){for(let[r,n]of Object.entries(t))e[r]=Tr(e[r],n);return e}function xd(e,t){if(t.distinct!==null){let r=t.linkingFields!==null?[...t.distinct,...t.linkingFields]:t.distinct;e=Ed(e,r)}return t.pagination&&(e=Pd(e,t.pagination,t.linkingFields)),t.reverse&&e.reverse(),Object.keys(t.nested).length===0?e:e.map(r=>sa(r,t.nested))}function Ed(e,t){let r=new Set,n=[];for(let i of e){let o=Je(i,t);r.has(o)||(r.add(o),n.push(i))}return n}function Pd(e,t,r){if(r===null)return oa(e,t);let n=new Map;for(let o of e){let s=Je(o,r);n.has(s)||n.set(s,[]),n.get(s).push(o)}let i=Array.from(n.entries());return i.sort(([o],[s])=>o<s?-1:o>s?1:0),i.flatMap(([,o])=>oa(o,t))}function oa(e,{cursor:t,skip:r,take:n}){let i=t!==null?e.findIndex(a=>Ve(a,t)):0;if(i===-1)return[];let o=i+(r??0),s=n!==null?o+n:e.length;return e.slice(o,s)}function Je(e,t){return JSON.stringify(t.map(r=>e[r]))}function Bn(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}function Qn(e){return typeof e=="object"&&e!==null&&e.prisma__type==="generatorCall"}function Gn(e,t,r,n){let i=e.args.map(o=>q(o,t,r));switch(e.type){case"rawSql":return[Ad(e.sql,i,e.argTypes)];case"templateSql":return(e.chunkable?Cd(e.fragments,i,n):[i]).map(s=>{if(n!==void 0&&s.length>n)throw new k("The query parameter limit supported by your database is exceeded.","P2029");return Td(e.fragments,e.placeholderFormat,s,e.argTypes)});default:E(e.type,"Invalid query type")}}function q(e,t,r){for(;vd(e);)if(Bn(e)){let n=t[e.prisma__value.name];if(n===void 0)throw new Error(`Missing value for query variable ${e.prisma__value.name}`);e=n}else if(Qn(e)){let{name:n,args:i}=e.prisma__value,o=r[n];if(!o)throw new Error(`Encountered an unknown generator '${n}'`);e=o.generate(...i.map(s=>q(s,t,r)))}else E(e,`Unexpected unevaluated value type: ${e}`);return Array.isArray(e)&&(e=e.map(n=>q(n,t,r))),e}function Td(e,t,r,n){let i="",o={placeholderNumber:1},s=[],a=[];for(let l of Hn(e,r,n)){if(i+=Sd(l,t,o),l.type==="stringChunk")continue;let u=s.length,c=s.push(...aa(l))-u;if(l.argType.arity==="tuple"){if(c%l.argType.elements.length!==0)throw new Error(`Malformed query template. Expected the number of parameters to match the tuple arity, but got ${c} parameters for a tuple of arity ${l.argType.elements.length}.`);for(let p=0;p<c/l.argType.elements.length;p++)a.push(...l.argType.elements)}else for(let p=0;p<c;p++)a.push(l.argType)}return{sql:i,args:s,argTypes:a}}function Sd(e,t,r){let n=e.type;switch(n){case"parameter":return Jn(t,r.placeholderNumber++);case"stringChunk":return e.chunk;case"parameterTuple":return`(${e.value.length==0?"NULL":e.value.map(()=>Jn(t,r.placeholderNumber++)).join(",")})`;case"parameterTupleList":return e.value.map(i=>{let o=i.map(()=>Jn(t,r.placeholderNumber++)).join(e.itemSeparator);return`${e.itemPrefix}${o}${e.itemSuffix}`}).join(e.groupSeparator);default:E(n,"Invalid fragment type")}}function Jn(e,t){return e.hasNumbering?`${e.prefix}${t}`:e.prefix}function Ad(e,t,r){return{sql:e,args:t,argTypes:r}}function vd(e){return Bn(e)||Qn(e)}function*Hn(e,t,r){let n=0;for(let i of e)switch(i.type){case"parameter":{if(n>=t.length)throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);yield{...i,value:t[n],argType:r?.[n]},n++;break}case"stringChunk":{yield i;break}case"parameterTuple":{if(n>=t.length)throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);let o=t[n];yield{...i,value:Array.isArray(o)?o:[o],argType:r?.[n]},n++;break}case"parameterTupleList":{if(n>=t.length)throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);let o=t[n];if(!Array.isArray(o))throw new Error("Malformed query template. Tuple list expected.");if(o.length===0)throw new Error("Malformed query template. Tuple list cannot be empty.");for(let s of o)if(!Array.isArray(s))throw new Error("Malformed query template. Tuple expected.");yield{...i,value:o,argType:r?.[n]},n++;break}}}function*aa(e){switch(e.type){case"parameter":yield e.value;break;case"stringChunk":break;case"parameterTuple":yield*e.value;break;case"parameterTupleList":for(let t of e.value)yield*t;break}}function Cd(e,t,r){let n=0,i=0;for(let s of Hn(e,t,void 0)){let a=0;for(let l of aa(s))a++;i=Math.max(i,a),n+=a}let o=[[]];for(let s of Hn(e,t,void 0))switch(s.type){case"parameter":{for(let a of o)a.push(s.value);break}case"stringChunk":break;case"parameterTuple":{let a=s.value.length,l=[];if(r&&o.length===1&&a===i&&n>r&&n-a<r){let u=r-(n-a);l=Rd(s.value,u)}else l=[s.value];o=o.flatMap(u=>l.map(c=>[...u,c]));break}case"parameterTupleList":{let a=s.value.reduce((p,d)=>p+d.length,0),l=[],u=[],c=0;for(let p of s.value)r&&o.length===1&&a===i&&u.length>0&&n-a+c+p.length>r&&(l.push(u),u=[],c=0),u.push(p),c+=p.length;u.length>0&&l.push(u),o=o.flatMap(p=>l.map(d=>[...p,d]));break}}return o}function Rd(e,t){let r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function la(e){return e.rows.map(t=>t.reduce((r,n,i)=>(r[e.columnNames[i]]=n,r),{}))}function ua(e){return{columns:e.columnNames,types:e.columnTypes.map(t=>kd(t)),rows:e.rows.map(t=>t.map((r,n)=>vt(r,e.columnTypes[n])))}}function vt(e,t){if(e===null)return null;switch(t){case m.Int32:switch(typeof e){case"number":return Math.trunc(e);case"string":return Math.trunc(Number(e));default:throw new Error(`Cannot serialize value of type ${typeof e} as Int32`)}case m.Int32Array:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as Int32Array`);return e.map(r=>vt(r,m.Int32));case m.Int64:switch(typeof e){case"number":return BigInt(Math.trunc(e));case"string":return e;default:throw new Error(`Cannot serialize value of type ${typeof e} as Int64`)}case m.Int64Array:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as Int64Array`);return e.map(r=>vt(r,m.Int64));case m.Json:switch(typeof e){case"string":return JSON.parse(e);default:throw new Error(`Cannot serialize value of type ${typeof e} as Json`)}case m.JsonArray:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as JsonArray`);return e.map(r=>vt(r,m.Json));case m.Boolean:switch(typeof e){case"boolean":return e;case"string":return e==="true"||e==="1";case"number":return e===1;default:throw new Error(`Cannot serialize value of type ${typeof e} as Boolean`)}case m.BooleanArray:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as BooleanArray`);return e.map(r=>vt(r,m.Boolean));default:return e}}function kd(e){switch(e){case m.Int32:return"int";case m.Int64:return"bigint";case m.Float:return"float";case m.Double:return"double";case m.Text:return"string";case m.Enum:return"enum";case m.Bytes:return"bytes";case m.Boolean:return"bool";case m.Character:return"char";case m.Numeric:return"decimal";case m.Json:return"json";case m.Uuid:return"uuid";case m.DateTime:return"datetime";case m.Date:return"date";case m.Time:return"time";case m.Int32Array:return"int-array";case m.Int64Array:return"bigint-array";case m.FloatArray:return"float-array";case m.DoubleArray:return"double-array";case m.TextArray:return"string-array";case m.EnumArray:return"string-array";case m.BytesArray:return"bytes-array";case m.BooleanArray:return"bool-array";case m.CharacterArray:return"char-array";case m.NumericArray:return"decimal-array";case m.JsonArray:return"json-array";case m.UuidArray:return"uuid-array";case m.DateTimeArray:return"datetime-array";case m.DateArray:return"date-array";case m.TimeArray:return"time-array";case m.UnknownNumber:return"unknown";case m.Set:return"string";default:E(e,`Unexpected column type: ${e}`)}}function ca(e,t,r){if(!t.every(n=>zn(e,n))){let n=Id(e,r),i=Od(r);throw new k(n,i,r.context)}}function zn(e,t){switch(t.type){case"rowCountEq":return Array.isArray(e)?e.length===t.args:e===null?t.args===0:t.args===1;case"rowCountNeq":return Array.isArray(e)?e.length!==t.args:e===null?t.args!==0:t.args!==1;case"affectedRowCountEq":return e===t.args;case"never":return!1;default:E(t,`Unknown rule type: ${t.type}`)}}function Id(e,t){switch(t.error_identifier){case"RELATION_VIOLATION":return`The change you are trying to make would violate the required relation '${t.context.relation}' between the \`${t.context.modelA}\` and \`${t.context.modelB}\` models.`;case"MISSING_RECORD":return`An operation failed because it depends on one or more records that were required but not found. No record was found for ${t.context.operation}.`;case"MISSING_RELATED_RECORD":{let r=t.context.neededFor?` (needed to ${t.context.neededFor})`:"";return`An operation failed because it depends on one or more records that were required but not found. No '${t.context.model}' record${r} was found for ${t.context.operation} on ${t.context.relationType} relation '${t.context.relation}'.`}case"INCOMPLETE_CONNECT_INPUT":return`An operation failed because it depends on one or more records that were required but not found. Expected ${t.context.expectedRows} records to be connected, found only ${Array.isArray(e)?e.length:e}.`;case"INCOMPLETE_CONNECT_OUTPUT":return`The required connected records were not found. Expected ${t.context.expectedRows} records to be connected after connect operation on ${t.context.relationType} relation '${t.context.relation}', found ${Array.isArray(e)?e.length:e}.`;case"RECORDS_NOT_CONNECTED":return`The records for relation \`${t.context.relation}\` between the \`${t.context.parent}\` and \`${t.context.child}\` models are not connected.`;default:E(t,`Unknown error identifier: ${t}`)}}function Od(e){switch(e.error_identifier){case"RELATION_VIOLATION":return"P2014";case"RECORDS_NOT_CONNECTED":return"P2017";case"INCOMPLETE_CONNECT_OUTPUT":return"P2018";case"MISSING_RECORD":case"MISSING_RELATED_RECORD":case"INCOMPLETE_CONNECT_INPUT":return"P2025";default:E(e,`Unknown error identifier: ${e}`)}}var Ct=class e{#e;#t=new Pr;#r;#n;#i;#o;#a;constructor({onQuery:t,tracingHelper:r,serializer:n,rawSerializer:i,provider:o,connectionInfo:s}){this.#e=t,this.#r=r,this.#n=n,this.#i=i??n,this.#o=o,this.#a=s}static forSql(t){return new e({onQuery:t.onQuery,tracingHelper:t.tracingHelper,serializer:la,rawSerializer:ua,provider:t.provider,connectionInfo:t.connectionInfo})}async run(t,r){let{value:n}=await this.interpretNode(t,{...r,generators:this.#t.snapshot()}).catch(i=>qe(i));return n}async interpretNode(t,r){switch(t.type){case"value":return{value:q(t.args,r.scope,r.generators)};case"seq":{let n;for(let i of t.args)n=await this.interpretNode(i,r);return n??{value:void 0}}case"get":return{value:r.scope[t.args.name]};case"let":{let n=Object.create(r.scope);for(let i of t.args.bindings){let{value:o}=await this.interpretNode(i.expr,{...r,scope:n});n[i.name]=o}return this.interpretNode(t.args.expr,{...r,scope:n})}case"getFirstNonEmpty":{for(let n of t.args.names){let i=r.scope[n];if(!pa(i))return{value:i}}return{value:[]}}case"concat":{let n=await Promise.all(t.args.map(i=>this.interpretNode(i,r).then(o=>o.value)));return{value:n.length>0?n.reduce((i,o)=>i.concat(Wn(o)),[]):[]}}case"sum":{let n=await Promise.all(t.args.map(i=>this.interpretNode(i,r).then(o=>o.value)));return{value:n.length>0?n.reduce((i,o)=>W(i)+W(o)):0}}case"execute":{let n=Gn(t.args,r.scope,r.generators,this.#s()),i=0;for(let o of n){let s=da(o,r.sqlCommenter);i+=await this.#l(s,r.queryable,()=>r.queryable.executeRaw(s).catch(a=>t.args.type==="rawSql"?bn(a):qe(a)))}return{value:i}}case"query":{let n=Gn(t.args,r.scope,r.generators,this.#s()),i;for(let o of n){let s=da(o,r.sqlCommenter),a=await this.#l(s,r.queryable,()=>r.queryable.queryRaw(s).catch(l=>t.args.type==="rawSql"?bn(l):qe(l)));i===void 0?i=a:(i.rows.push(...a.rows),i.lastInsertId=a.lastInsertId)}return{value:t.args.type==="rawSql"?this.#i(i):this.#n(i),lastInsertId:i?.lastInsertId}}case"reverse":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args,r);return{value:Array.isArray(n)?n.reverse():n,lastInsertId:i}}case"unique":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args,r);if(!Array.isArray(n))return{value:n,lastInsertId:i};if(n.length>1)throw new Error(`Expected zero or one element, got ${n.length}`);return{value:n[0]??null,lastInsertId:i}}case"required":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args,r);if(pa(n))throw new Error("Required value is empty");return{value:n,lastInsertId:i}}case"mapField":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.records,r);return{value:ma(n,t.args.field),lastInsertId:i}}case"join":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.parent,r);if(n===null)return{value:null,lastInsertId:i};let o=await Promise.all(t.args.children.map(async s=>({joinExpr:s,childRecords:(await this.interpretNode(s.child,r)).value})));return{value:Nd(n,o),lastInsertId:i}}case"transaction":{if(!r.transactionManager.enabled)return this.interpretNode(t.args,r);let n=r.transactionManager.manager,i=await n.startInternalTransaction(),o=await n.getTransaction(i,"query");try{let s=await this.interpretNode(t.args,{...r,queryable:o});return await n.commitTransaction(i.id),s}catch(s){throw await n.rollbackTransaction(i.id),s}}case"dataMap":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r);return{value:ts(n,t.args.structure,t.args.enums),lastInsertId:i}}case"validate":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r);return ca(n,t.args.rules,t.args),{value:n,lastInsertId:i}}case"if":{let{value:n}=await this.interpretNode(t.args.value,r);return zn(n,t.args.rule)?await this.interpretNode(t.args.then,r):await this.interpretNode(t.args.else,r)}case"unit":return{value:void 0};case"diff":{let{value:n}=await this.interpretNode(t.args.from,r),{value:i}=await this.interpretNode(t.args.to,r),o=a=>a!==null?Je(Sr(a),t.args.fields):null,s=new Set(Wn(i).map(o));return{value:Wn(n).filter(a=>!s.has(o(a)))}}case"process":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r);return fa(t.args.operations,r.scope,r.generators),{value:Tr(n,t.args.operations),lastInsertId:i}}case"initializeRecord":{let{lastInsertId:n}=await this.interpretNode(t.args.expr,r),i={};for(let[o,s]of Object.entries(t.args.fields))i[o]=Dd(s,n,r.scope,r.generators);return{value:i,lastInsertId:n}}case"mapRecord":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r),o=n===null?{}:Sr(n);for(let[s,a]of Object.entries(t.args.fields))o[s]=Md(a,o[s],r.scope,r.generators);return{value:o,lastInsertId:i}}default:E(t,`Unexpected node type: ${t.type}`)}}#s(){return this.#a?.maxBindValues!==void 0?this.#a.maxBindValues:this.#u()}#u(){if(this.#o!==void 0)switch(this.#o){case"cockroachdb":case"postgres":case"postgresql":case"prisma+postgres":return 32766;case"mysql":return 65535;case"sqlite":return 999;case"sqlserver":return 2098;case"mongodb":return;default:E(this.#o,`Unexpected provider: ${this.#o}`)}}#l(t,r,n){return mr({query:t,execute:n,provider:this.#o??r.provider,tracingHelper:this.#r,onQuery:this.#e})}};function pa(e){return Array.isArray(e)?e.length===0:e==null}function Wn(e){return Array.isArray(e)?e:[e]}function W(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function Sr(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Expected object, got ${typeof e}`)}function ma(e,t){return Array.isArray(e)?e.map(r=>ma(r,t)):typeof e=="object"&&e!==null?e[t]??null:e}function Nd(e,t){for(let{joinExpr:r,childRecords:n}of t){let i=r.on.map(([a])=>a),o=r.on.map(([,a])=>a),s={};for(let a of Array.isArray(e)?e:[e]){let l=Sr(a),u=Je(l,i);s[u]||(s[u]=[]),s[u].push(l),r.isRelationUnique?l[r.parentField]=null:l[r.parentField]=[]}for(let a of Array.isArray(n)?n:[n]){if(a===null)continue;let l=Je(Sr(a),o);for(let u of s[l]??[])r.isRelationUnique?u[r.parentField]=a:u[r.parentField].push(a)}}return e}function Dd(e,t,r,n){switch(e.type){case"value":return q(e.value,r,n);case"lastInsertId":return t;default:E(e,`Unexpected field initializer type: ${e.type}`)}}function Md(e,t,r,n){switch(e.type){case"set":return q(e.value,r,n);case"add":return W(t)+W(q(e.value,r,n));case"subtract":return W(t)-W(q(e.value,r,n));case"multiply":return W(t)*W(q(e.value,r,n));case"divide":{let i=W(t),o=W(q(e.value,r,n));return o===0?null:i/o}default:E(e,`Unexpected field operation type: ${e.type}`)}}function da(e,t){if(!t||t.plugins.length===0)return e;let r=rs(t.plugins,{query:t.queryInfo,sql:e.sql});return r?{...e,sql:ns(e.sql,r)}:e}function fa(e,t,r){let n=e.pagination?.cursor;if(n)for(let[i,o]of Object.entries(n))n[i]=q(o,t,r);for(let i of Object.values(e.nested))fa(i,t,r)}async function Fd(){return globalThis.crypto??await import("node:crypto")}async function ga(){return(await Fd()).randomUUID()}async function ya(e,t){return new Promise(r=>{e.addEventListener(t,r,{once:!0})})}var j=class extends k{name="TransactionManagerError";constructor(t,r){super("Transaction API error: "+t,"P2028",r)}},Rt=class extends j{constructor(){super("Transaction not found. Transaction ID is invalid, refers to an old closed transaction Prisma doesn't have information about anymore, or was obtained before disconnecting.")}},Ar=class extends j{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction.`)}},vr=class extends j{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back.`)}},Cr=class extends j{constructor(){super("Unable to start a transaction in the given time.")}},Rr=class extends j{constructor(t,{timeout:r,timeTaken:n}){super(`A ${t} cannot be executed on an expired transaction. The timeout for this transaction was ${r} ms, however ${n} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction.`,{operation:t,timeout:r,timeTaken:n})}},He=class extends j{constructor(t){super(`Internal Consistency Error: ${t}`)}},kr=class extends j{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var _d=100,Ge=N("prisma:client:transactionManager"),Ld=()=>({sql:"COMMIT",args:[],argTypes:[]}),$d=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),Vd=()=>({sql:'-- Implicit "COMMIT" query via underlying driver',args:[],argTypes:[]}),qd=()=>({sql:'-- Implicit "ROLLBACK" query via underlying driver',args:[],argTypes:[]}),kt=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;#e;#t;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n,onQuery:i,provider:o}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n,this.#e=i,this.#t=o}async startInternalTransaction(t){let r=t!==void 0?this.#a(t):{};return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(r))}async startTransaction(t){let r=t!==void 0?this.#a(t):this.transactionOptions;return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(r))}async#r(t){let r={id:await ga(),status:"waiting",timer:void 0,timeout:t.timeout,startedAt:Date.now(),transaction:void 0},n=new AbortController,i=ha(()=>n.abort(),t.maxWait);i?.unref?.();let o=this.driverAdapter.startTransaction(t.isolationLevel).catch(qe);switch(r.transaction=await Promise.race([o.finally(()=>clearTimeout(i)),ya(n.signal,"abort").then(()=>{})]),this.transactions.set(r.id,r),r.status){case"waiting":if(n.signal.aborted)throw o.then(s=>s.rollback()).catch(s=>Ge("error in discarded transaction:",s)),await this.#o(r,"timed_out"),new Cr;return r.status="running",r.timer=this.#i(r.id,t.timeout),{id:r.id};case"timed_out":case"running":case"committed":case"rolled_back":throw new He(`Transaction in invalid state ${r.status} although it just finished startup.`);default:E(r.status,"Unknown transaction status.")}}async commitTransaction(t){return await this.tracingHelper.runInChildSpan("commit_transaction",async()=>{let r=this.#n(t,"commit");await this.#o(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.#n(t,"rollback");await this.#o(r,"rolled_back")})}async getTransaction(t,r){let n=this.#n(t.id,r);if(n.status==="closing"&&(await n.closing,n=this.#n(t.id,r)),!n.transaction)throw new Rt;return n.transaction}#n(t,r){let n=this.transactions.get(t);if(!n){let i=this.closedTransactions.find(o=>o.id===t);if(i)switch(Ge("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"closing":case"waiting":case"running":throw new He("Active transaction found in closed transactions list.");case"committed":throw new Ar(r);case"rolled_back":throw new vr(r);case"timed_out":throw new Rr(r,{timeout:i.timeout,timeTaken:Date.now()-i.startedAt})}else throw Ge("Transaction not found.",t),new Rt}if(["committed","rolled_back","timed_out"].includes(n.status))throw new He("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.#o(t,"rolled_back")))}#i(t,r){let n=Date.now(),i=ha(async()=>{Ge("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let o=this.transactions.get(t);o&&["running","waiting"].includes(o.status)?await this.#o(o,"timed_out"):Ge("Transaction already committed or rolled back when timeout happened.",t)},r);return i?.unref?.(),i}async#o(t,r){let n=async()=>{Ge("Closing transaction.",{transactionId:t.id,status:r});try{if(t.transaction&&r==="committed")if(t.transaction.options.usePhantomQuery)await this.#s(Vd(),t.transaction,()=>t.transaction.commit());else{let i=Ld();await this.#s(i,t.transaction,()=>t.transaction.executeRaw(i)).then(()=>t.transaction.commit(),o=>{let s=()=>Promise.reject(o);return t.transaction.rollback().then(s,s)})}else if(t.transaction)if(t.transaction.options.usePhantomQuery)await this.#s(qd(),t.transaction,()=>t.transaction.rollback());else{let i=$d();try{await this.#s(i,t.transaction,()=>t.transaction.executeRaw(i))}finally{await t.transaction.rollback()}}}finally{t.status=r,clearTimeout(t.timer),t.timer=void 0,this.transactions.delete(t.id),this.closedTransactions.push(t),this.closedTransactions.length>_d&&this.closedTransactions.shift()}};t.status==="closing"?(await t.closing,this.#n(t.id,r==="committed"?"commit":"rollback")):await Object.assign(t,{status:"closing",reason:r,closing:n()}).closing}#a(t){if(!t.timeout)throw new j("timeout is required");if(!t.maxWait)throw new j("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new kr(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}#s(t,r,n){return mr({query:t,execute:n,provider:this.#t??r.provider,tracingHelper:this.tracingHelper,onQuery:this.#e})}};function ha(e,t){return t!==void 0?setTimeout(e,t):void 0}import{PrismaClientInitializationError as ti,PrismaClientKnownRequestError as ri,PrismaClientRustPanicError as Ot,PrismaClientUnknownRequestError as Ga}from"@prisma/client-runtime-utils";function wa(e){return new Kn(e).deserialize()}function jd(e){return Buffer.from(e,"base64url")}var Kn=class{#e;#t;#r=0;constructor(t){this.#e=t;let r=jd(t.graph);this.#t=new DataView(r.buffer,r.byteOffset,r.byteLength)}deserialize(){let{inputNodeCount:t,outputNodeCount:r,rootCount:n}=this.#s(),i=this.#u(t),o=this.#l(r),s=this.#p(n);return{strings:this.#e.strings,inputNodes:i,outputNodes:o,roots:s}}#n(){let t=0,r=0,n;do n=this.#t.getUint8(this.#r++),t|=(n&127)<<r,r+=7;while(n>=128);return t}#i(){let t=this.#n();return t===0?void 0:t-1}#o(){let t=this.#t.getUint8(this.#r);return this.#r+=1,t}#a(){let t=this.#t.getUint16(this.#r,!0);return this.#r+=2,t}#s(){let t=this.#n(),r=this.#n(),n=this.#n();return{inputNodeCount:t,outputNodeCount:r,rootCount:n}}#u(t){let r=[];for(let n=0;n<t;n++){let i=this.#n(),o={};for(let s=0;s<i;s++){let a=this.#n(),l=this.#a(),u=this.#i(),c=this.#i(),d={flags:this.#o()};l!==0&&(d.scalarMask=l),u!==void 0&&(d.childNodeId=u),c!==void 0&&(d.enumNameIndex=c),o[a]=d}r.push({edges:o})}return r}#l(t){let r=[];for(let n=0;n<t;n++){let i=this.#n(),o={};for(let s=0;s<i;s++){let a=this.#n(),l=this.#i(),u=this.#i(),c={};l!==void 0&&(c.argsNodeId=l),u!==void 0&&(c.outputNodeId=u),o[a]=c}r.push({edges:o})}return r}#p(t){let r={};for(let n=0;n<t;n++){let i=this.#n(),o=this.#i(),s=this.#i(),a=this.#e.strings[i],l={};o!==void 0&&(l.argsNodeId=o),s!==void 0&&(l.outputNodeId=s),r[a]=l}return r}};var It=class e{#e;#t;#r;constructor(t,r){this.#e=t,this.#r=r,this.#t=new Map;for(let n=0;n<t.strings.length;n++)this.#t.set(t.strings[n],n)}static deserialize(t,r){let n=wa(t);return new e(n,r)}static fromData(t,r){return new e(t,r)}root(t){let r=this.#e.roots[t];if(r)return{argsNodeId:r.argsNodeId,outputNodeId:r.outputNodeId}}inputNode(t){if(!(t===void 0||t<0||t>=this.#e.inputNodes.length))return{id:t}}outputNode(t){if(!(t===void 0||t<0||t>=this.#e.outputNodes.length))return{id:t}}inputEdge(t,r){if(!t)return;let n=this.#e.inputNodes[t.id];if(!n)return;let i=this.#t.get(r);if(i===void 0)return;let o=n.edges[i];if(o)return{flags:o.flags,childNodeId:o.childNodeId,scalarMask:o.scalarMask??0,enumNameIndex:o.enumNameIndex}}outputEdge(t,r){if(!t)return;let n=this.#e.outputNodes[t.id];if(!n)return;let i=this.#t.get(r);if(i===void 0)return;let o=n.edges[i];if(o)return{argsNodeId:o.argsNodeId,outputNodeId:o.outputNodeId}}enumValues(t){if(t?.enumNameIndex===void 0)return;let r=this.#e.strings[t.enumNameIndex];if(r)return this.#r(r)}getString(t){return this.#e.strings[t]}},K={ParamScalar:1,ParamEnum:2,ParamListScalar:4,ParamListEnum:8,ListObject:16,Object:32},O={String:1,Int:2,BigInt:4,Float:8,Decimal:16,Boolean:32,DateTime:64,Json:128,Bytes:256};function Z(e,t){return(e.flags&t)!==0}function ce(e){return e.scalarMask}var Ir="7.5.0-dev.6";var ba={bigint:"bigint",date:"datetime",decimal:"decimal",bytes:"bytes"};function Ea(e){let t;try{t=JSON.parse(e)}catch(i){throw new Error(`Received invalid serialized parameters: ${i.message}`)}if(!Array.isArray(t))throw new Error("Received invalid serialized parameters: expected an array");let r=t.map(i=>Pa(i)),n=t.map(i=>Bd(i));return{args:r,argTypes:n}}function Pa(e){if(Array.isArray(e))return e.map(t=>Pa(t));if(typeof e=="object"&&e!==null&&"prisma__value"in e){if(!("prisma__type"in e))throw new Error("Invalid serialized parameter, prisma__type should be present when prisma__value is present");return`${e.prisma__value}`}return typeof e=="object"&&e!==null?JSON.stringify(e):e}function Bd(e){return Array.isArray(e)?{scalarType:e.length>0?xa(e[0]):"unknown",arity:"list"}:{scalarType:xa(e),arity:"scalar"}}function xa(e){return typeof e=="object"&&e!==null&&"prisma__type"in e&&typeof e.prisma__type=="string"&&e.prisma__type in ba?ba[e.prisma__type]:typeof e=="number"?"decimal":typeof e=="string"?"string":"unknown"}function Ta(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Sa(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function Aa(e){return e.split(`
|
|
13
|
+
`)}};var hu={red:me,gray:rt,dim:Ye,bold:U,underline:Xe,highlightSource:e=>e.highlight()},wu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function bu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function xu({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=bu({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=Ht.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=Pu(c),d=Eu(c);if(!d)return s;s.functionName=`${d.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,h=>h.slice(0,d.openingBraceIndex))),u=o.highlightSource(u);let f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((h,b)=>o.gray(String(b).padStart(f))+" "+h).mapLines(h=>o.dim(h)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let h=p+f+1;h+=2,s.callArguments=(0,Hi.default)(i,h).slice(h)}}return s}function Eu(e){let t=Object.keys(Re).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function Pu(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function Tu({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],l=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${l}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${l}`)),t&&a.push(s.underline(Su(t))),i){a.push("");let u=[i.toString()];o&&(u.push(o),u.push(s.dim(")"))),a.push(u.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(`
|
|
14
|
+
`)}function Su(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function Gt(e){let t=e.showColors?hu:wu,r;return r=xu(e,t),Tu(r,t)}var to=de(tn());function Ki(e,t,r){let n=Zi(e),i=Au(n),o=Cu(i);o?zt(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Zi(e){return e.errors.flatMap(t=>t.kind==="Union"?Zi(t):[t])}function Au(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:vu(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function vu(e,t){return[...new Set(e.concat(t))]}function Cu(e){return en(e,(t,r)=>{let n=zi(t),i=zi(r);return n!==i?n-i:Wi(t)-Wi(r)})}function zi(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Wi(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var L=class{constructor(t,r){this.name=t;this.value=r}isRequired=!1;makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};Xi();var ke=class{constructor(t=0,r){this.context=r;this.currentIndent=t}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r,n=(i,o)=>o.write(i)){let i=r.length-1;for(let o=0;o<r.length;o++)n(r[o],this),o!==i&&this.write(t);return this}writeLine(t){return this.write(t).newLine()}newLine(){this.lines.push(this.indentedCurrentLine()),this.currentLine="",this.marginSymbol=void 0;let t=this.afterNextNewLineCallback;return this.afterNextNewLineCallback=void 0,t?.(),this}withIndent(t){return this.indent(),t(this),this.unindent(),this}afterNextNewline(t){return this.afterNextNewLineCallback=t,this}indent(){return this.currentIndent++,this}unindent(){return this.currentIndent>0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(`
|
|
15
|
+
`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};Yi();var Wt=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var Kt=e=>e,Zt={bold:Kt,red:Kt,green:Kt,dim:Kt,enabled:!1},eo={bold:U,red:me,green:et,dim:Ye,enabled:!0},Ie={write(e){e.writeLine(",")}};var H=class{constructor(t){this.contents=t}isUnderlined=!1;color=t=>t;underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};var se=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var Oe=class extends se{items=[];addItem(t){return this.items.push(new Wt(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(r=>r.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let r=new H("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(Ie,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Ne=class e extends se{fields={};suggestions=[];addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[r,...n]=t,i=this.getField(r);if(!i)return;let o=i;for(let s of n){let a;if(o.value instanceof e?a=o.value.getField(s):o.value instanceof Oe&&(a=o.value.getField(Number(s))),!a)return;o=a}return o}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let r=this;for(let n of t){if(!(r instanceof e))return;let i=r.getSubSelectionValue(n);if(!i)return;r=i}return r}getDeepSelectionParent(t){let r=this.getSelectionParent();if(!r)return;let n=r;for(let i of t){let o=n.value.getFieldValue(i);if(!o||!(o instanceof e))return;let s=o.getSelectionParent();if(!s)return;n=s}return n}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(n=>n.getPrintWidth()))+2}write(t){let r=Object.values(this.fields);if(r.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,r)}asObject(){return this}writeEmpty(t){let r=new H("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(Ie,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var R=class extends se{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new H(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var lt=class{fields=[];addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(Ie,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function zt(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Ru(e,t);break;case"IncludeOnScalar":ku(e,t);break;case"EmptySelection":Iu(e,t,r);break;case"UnknownSelectionField":Fu(e,t);break;case"InvalidSelectionValue":Mu(e,t);break;case"UnknownArgument":_u(e,t);break;case"UnknownInputField":Lu(e,t);break;case"RequiredArgumentMissing":$u(e,t);break;case"InvalidArgumentType":Vu(e,t);break;case"InvalidArgumentValue":qu(e,t);break;case"ValueTooLarge":ju(e,t);break;case"SomeFieldsMissing":Uu(e,t);break;case"TooManyFieldsGiven":Bu(e,t);break;case"Union":Ki(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Ru(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function ku(e,t){let[r,n]=De(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new L(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${ut(s)}`:a+=".",a+=`
|
|
16
|
+
Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Iu(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Ou(e,t,i);return}if(n.hasField("select")){Nu(e,t);return}}if(r?.[oe(e.outputType.name)]){Du(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Ou(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new L(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Nu(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),io(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${ut(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Du(e,t){let r=new lt;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new L("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=De(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new Ne;l.addSuggestion(n),a.value=l}}t.addErrorMessage(i=>`The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`)}function Fu(e,t){let r=oo(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":io(n,e.outputType);break;case"include":Qu(n,e.outputType);break;case"omit":Ju(n,e.outputType);break}}t.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${r.fieldName}\``)}`];return r.parentKind!=="unknown"&&i.push(`for ${n.bold(r.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(ut(n)),i.join(" ")})}function Mu(e,t){let r=oo(e.selectionPath,t);r.parentKind!=="unknown"&&r.field.value.markAsError(),t.addErrorMessage(n=>`Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`)}function _u(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Hu(n,e.arguments)),t.addErrorMessage(i=>ro(i,r,e.arguments.map(o=>o.name)))}function Lu(e,t){let[r,n]=De(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&so(o,e.inputType)}t.addErrorMessage(o=>ro(o,n,e.inputType.fields.map(s=>s.name)))}function ro(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=zu(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(ut(e)),n.join(" ")}function $u(e,t){let r;t.addErrorMessage(l=>r?.value instanceof R&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=De(e.argumentPath),s=new lt,a=n.getDeepFieldValue(i)?.asObject();if(a){if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new L(o,s).makeRequired())}else{let l=e.inputTypes.map(no).join(" | ");a.addSuggestion(new L(o,l).makeRequired())}if(e.dependentArgumentPath){n.getDeepField(e.dependentArgumentPath)?.markAsError();let[,l]=De(e.dependentArgumentPath);t.addErrorMessage(u=>`Argument \`${u.green(o)}\` is required because argument \`${u.green(l)}\` was provided.`)}}}function no(e){return e.kind==="list"?`${no(e.elementType)}[]`:e.name}function Vu(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Yt("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function qu(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=Yt("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function ju(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof R&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function Uu(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&so(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Yt("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(ut(i)),o.join(" ")})}function Bu(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Yt("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function io(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new L(r.name,"true"))}function Qu(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new L(r.name,"true"))}function Ju(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new L(r.name,"true"))}function Hu(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new L(r.name,r.typeNames.join(" | ")))}function oo(e,t){let[r,n]=De(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function so(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new L(r.name,r.typeNames.join(" | ")))}function De(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function ut({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Yt(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Gu=3;function zu(e,t){let r=1/0,n;for(let i of t){let o=(0,to.default)(e,i);o>Gu||o<r&&(r=o,n=i)}return n}import{ObjectEnumValue as Wu}from"@prisma/client-runtime-utils";var ct=class{modelName;name;typeName;isList;isEnum;constructor(t,r,n,i,o){this.modelName=t,this.name=r,this.typeName=n,this.isList=i,this.isEnum=o}_toGraphQLInputType(){let t=this.isList?"List":"",r=this.isEnum?"Enum":"";return`${t}${r}${this.typeName}FieldRefInput<${this.modelName}>`}};function Fe(e){return e instanceof ct}var ao=": ",Xt=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+ao.length}write(t){let r=new H(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(ao).write(this.value)}};var nn=class{arguments;errorMessages=[];constructor(t){this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(`
|
|
17
|
+
`)}};function Me(e){return new nn(lo(e))}function lo(e){let t=new Ne;for(let[r,n]of Object.entries(e)){let i=new Xt(r,uo(n));t.addField(i)}return t}function uo(e){if(typeof e=="string")return new R(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new R(String(e));if(typeof e=="bigint")return new R(`${e}n`);if(e===null)return new R("null");if(e===void 0)return new R("undefined");if(Ce(e))return new R(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new R(`Buffer.alloc(${e.byteLength})`):new R(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Bt(e)?e.toISOString():"Invalid Date";return new R(`new Date("${t}")`)}return e instanceof Wu?new R(`Prisma.${e._getName()}`):Fe(e)?new R(`prisma.${oe(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Ku(e):typeof e=="object"?lo(e):new R(Object.prototype.toString.call(e))}function Ku(e){let t=new Oe;for(let r of e)t.addItem(uo(r));return t}function er(e,t){let r=t==="pretty"?eo:Zt,n=e.renderAllMessages(r),i=new ke(0,{colors:r}).write(e).toString();return{message:n,args:i}}function tr({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=Me(e);for(let p of t)zt(p,a,s);let{message:l,args:u}=er(a,r),c=Gt({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new Zu(c,{clientVersion:o})}function G(e){return e.replace(/^./,t=>t.toLowerCase())}function po(e,t,r){let n=G(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Yu({...e,...co(t.name,e,t.result.$allModels),...co(t.name,e,t.result[n])})}function Yu(e){let t=new J,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Ut(e,n=>({...n,needs:r(n.name,new Set)}))}function co(e,t,r){return r?Ut(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Xu(t,o,i)})):{}}function Xu(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function mo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function fo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var rr=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new J;modelExtensionsCache=new J;queryCallbacksCache=new J;clientExtensions=Ze(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=Ze(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>po(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=G(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},_e=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new rr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new rr(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var nr=class{constructor(t){this.name=t}};function go(e){return e instanceof nr}function ec(e){return new nr(e)}var yo=Symbol(),pt=class{constructor(t){if(t!==yo)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?on:t}},on=new pt(yo);function V(e){return e instanceof pt}var oc={findUnique:"findUnique",findUniqueOrThrow:"findUniqueOrThrow",findFirst:"findFirst",findFirstOrThrow:"findFirstOrThrow",findMany:"findMany",count:"aggregate",create:"createOne",createMany:"createMany",createManyAndReturn:"createManyAndReturn",update:"updateOne",updateMany:"updateMany",updateManyAndReturn:"updateManyAndReturn",upsert:"upsertOne",delete:"deleteOne",deleteMany:"deleteMany",executeRaw:"executeRaw",queryRaw:"queryRaw",aggregate:"aggregate",groupBy:"groupBy",runCommandRaw:"runCommandRaw",findRaw:"findRaw",aggregateRaw:"aggregateRaw"},ho="explicitly `undefined` values are not allowed";function an({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=_e.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c,wrapRawValues:p}){let d=new sn({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c,wrapRawValues:p});return{modelName:e,action:oc[t],query:dt(r,d)}}function dt({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:bo(r,n),selection:sc(e,t,i,n)}}function sc(e,t,r,n){return e?(t?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):r&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),cc(e,n)):ac(n,t,r)}function ac(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&lc(n,t,e),uc(n,r,e),n}function lc(e,t,r){for(let[n,i]of Object.entries(t)){if(V(i))continue;let o=r.nestSelection(n);if(ln(i,o),i===!1||i===void 0){e[n]=!1;continue}let s=r.findField(n);if(s&&s.kind!=="object"&&r.throwValidationError({kind:"IncludeOnScalar",selectionPath:r.getSelectionPath().concat(n),outputType:r.getOutputTypeDescription()}),s){e[n]=dt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=dt(i,o)}}function uc(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=fo(i,n);for(let[s,a]of Object.entries(o)){if(V(a))continue;ln(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function cc(e,t){let r={},n=t.getComputedFields(),i=mo(e,n);for(let[o,s]of Object.entries(i)){if(V(s))continue;let a=t.nestSelection(o);ln(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||V(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=dt({},a):r[o]=!0;continue}r[o]=dt(s,a)}}return r}function wo(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(ve(e)){if(Bt(e))return{$type:"DateTime",value:e.toISOString()};t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(go(e))return{$type:"Param",value:e.name};if(Fe(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return pc(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:Buffer.from(r,n,i).toString("base64")}}if(dc(e))return e.values;if(Ce(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof ic){if(!rc(e)&&!nc(e)&&!tc(e))throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(mc(e))return e.toJSON();if(typeof e=="object")return bo(e,t);t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:t.getSelectionPath(),argumentPath:t.getArgumentPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:`We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it`})}function bo(e,t){if(t.shouldWrapRawValues()&&e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);V(i)||(i!==void 0?r[n]=wo(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:ho}))}return r}function pc(e,t){let r=[];for(let n=0;n<e.length;n++){let i=t.nestArgument(String(n)),o=e[n];if(o===void 0||V(o)){let s=o===void 0?"undefined":"Prisma.skip";t.throwValidationError({kind:"InvalidArgumentValue",selectionPath:i.getSelectionPath(),argumentPath:i.getArgumentPath(),argument:{name:`${t.getArgumentName()}[${n}]`,typeNames:[]},underlyingError:`Can not use \`${s}\` value within array. Use \`null\` or filter out \`${s}\` values`})}r.push(wo(o,i))}return r}function dc(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function mc(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function ln(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:ho})}var sn=class e{constructor(t){this.params=t;this.params.modelName&&(this.modelOrType=this.params.runtimeDataModel.models[this.params.modelName]??this.params.runtimeDataModel.types[this.params.modelName])}modelOrType;throwValidationError(t){tr({errors:[t],originalMethod:this.params.originalMethod,args:this.params.rootArgs??{},callsite:this.params.callsite,errorFormat:this.params.errorFormat,clientVersion:this.params.clientVersion,globalOmit:this.params.globalOmit})}getSelectionPath(){return this.params.selectionPath}getArgumentPath(){return this.params.argumentPath}getArgumentName(){return this.params.argumentPath[this.params.argumentPath.length-1]}getOutputTypeDescription(){if(!(!this.params.modelName||!this.modelOrType))return{name:this.params.modelName,fields:this.modelOrType.fields.map(t=>({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}shouldWrapRawValues(){return this.params.wrapRawValues??!0}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[oe(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:ee(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};function fc(e,t){let r=Ze(()=>gc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function gc(e){return{datamodel:{models:un(e.models),enums:un(e.enums),types:un(e.types)}}}function un(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var cn=new WeakMap,ir="$$PrismaTypedSql",mt=class{constructor(t,r){cn.set(this,{sql:t,values:r}),Object.defineProperty(this,ir,{value:ir})}get sql(){return cn.get(this).sql}get values(){return cn.get(this).values}};function yc(e){return(...t)=>new mt(e,t)}function or(e){return e!=null&&e[ir]===ir}import{Sql as Cm}from"@prisma/client-runtime-utils";import{AsyncResource as Rm}from"node:async_hooks";import{EventEmitter as km}from"node:events";function ft(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function D(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function ge(e){let t=new J;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var sr={enumerable:!0,configurable:!0,writable:!0};function ar(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>sr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var xo=Symbol.for("nodejs.util.inspect.custom");function Q(e,t){let r=hc(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Eo(Reflect.ownKeys(o),r),a=Eo(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...sr,...l?.getPropertyDescriptor(s)}:sr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[xo]=function(){let o={...this};return delete o[xo],o},i}function hc(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Eo(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Le(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Po(e){if(e===void 0)return"";let t=Me(e);return new ke(0,{colors:Zt}).write(t).toString()}var gt="<unknown>";function To(e){var t=e.split(`
|
|
18
|
+
`);return t.reduce(function(r,n){var i=xc(n)||Pc(n)||Ac(n)||kc(n)||Cc(n);return i&&r.push(i),r},[])}var wc=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,bc=/\((\S*)(?::(\d+))(?::(\d+))\)/;function xc(e){var t=wc.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=bc.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||gt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Ec=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Pc(e){var t=Ec.exec(e);return t?{file:t[2],methodName:t[1]||gt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Tc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Sc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ac(e){var t=Tc.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Sc.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||gt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var vc=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Cc(e){var t=vc.exec(e);return t?{file:t[3],methodName:t[1]||gt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Rc=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function kc(e){var t=Rc.exec(e);return t?{file:t[2],methodName:t[1]||gt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var pn=class{getLocation(){return null}},dn=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=To(t).find(i=>{if(!i.file)return!1;let o=Yr(i.file);return o!=="<anonymous>"&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/client.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function ae(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new pn:new dn}var So={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function $e(e={}){let t=Oc(e);return Object.entries(t).reduce((n,[i,o])=>(So[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Oc(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function lr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Ao(e,t){let r=lr(e);return t({action:"aggregate",unpacker:r,argsMapper:$e})(e)}function Nc(e={}){let{select:t,...r}=e;return typeof t=="object"?$e({...r,_count:t}):$e({...r,_count:{_all:!0}})}function Dc(e={}){return typeof e.select=="object"?t=>lr(e)(t)._count:t=>lr(e)(t)._count._all}function vo(e,t){return t({action:"count",unpacker:Dc(e),argsMapper:Nc})(e)}function Fc(e={}){let t=$e(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function Mc(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Co(e,t){return t({action:"groupBy",unpacker:Mc(e),argsMapper:Fc})(e)}function Ro(e,t,r){if(t==="aggregate")return n=>Ao(n,r);if(t==="count")return n=>vo(n,r);if(t==="groupBy")return n=>Co(n,r)}function ko(e,t){let r=t.fields.filter(i=>!i.relationName),n=xi(r,"name");return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new ct(e,o,s.type,s.isList,s.kind==="enum")},...ar(Object.keys(n))})}var Io=e=>Array.isArray(e)?e:e.split("."),mn=(e,t)=>Io(t).reduce((r,n)=>r&&r[n],e),Oo=(e,t,r)=>Io(t).reduceRight((n,i,o,s)=>Object.assign({},mn(e,s.slice(0,o)),{[i]:n}),r);function _c(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Lc(e,t,r){return t===void 0?e??{}:Oo(t,r,e||!0)}function fn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=ae(e._errorFormat),c=_c(n,i),p=Lc(l,o,c),d=r({dataPath:c,callsite:u})(p),f=$c(e,t);return new Proxy(d,{get(h,b){if(!f.includes(b))return h[b];let F=[a[b].type,r,b],P=[c,p];return fn(e,...F,...P)},...ar([...f,...Object.getOwnPropertyNames(d)])})}}function $c(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Vc=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],qc=["aggregate","count","groupBy"];function gn(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[jc(e,t),Bc(e,t),ft(r),D("name",()=>t),D("$name",()=>t),D("$parent",()=>e._appliedParent)];return Q({},n)}function jc(e,t){let r=G(t),n=Object.keys(Re).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=ae(e._errorFormat);return e._createPrismaPromise(c=>{let p={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:c,callsite:u};return e._request({...p,...a})},{action:o,args:l,model:t})};return Vc.includes(o)?fn(e,t,s):Uc(i)?Ro(e,i,s):s({})}}}function Uc(e){return qc.includes(e)}function Bc(e,t){return ge(D("fields",()=>{let r=e._runtimeDataModel.models[t];return ko(t,r)}))}function No(e){return e.replace(/^./,t=>t.toUpperCase())}var yn=Symbol();function yt(e){let t=[Qc(e),Jc(e),D(yn,()=>e),D("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(ft(r)),Q(e,t)}function Qc(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function Jc(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(G),n=[...new Set(t.concat(r))];return ge({getKeys(){return n},getPropertyValue(i){let o=No(i);if(e._runtimeDataModel.models[o]!==void 0)return gn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return gn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Do(e){return e[yn]?e[yn]:e}function Fo(e){if(typeof e=="function")return e(this);let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$on:{value:void 0}});return yt(t)}function Mo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(c=>n[c]);u.length>0&&a.push(Le(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(c=>!r[c]);u.length>0&&a.push(Le(u))}Hc(e,l.needs)&&s.push(Gc(l,Q(e,s)))}return s.length>0||a.length>0?Q(e,[...s,...a]):e}function Hc(e,t){return t.every(r=>Xr(e,r))}function Gc(e,t){return ge(D(e.name,()=>e.compute(t)))}function ur({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=ur({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&_o({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&_o({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function _o({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||V(s))continue;let l=n.models[r].fields.find(c=>c.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=ur({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Lo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:ur({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=G(l);return Mo({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}import{Decimal as Wc,ObjectEnumValue as Kc,Sql as Vo}from"@prisma/client-runtime-utils";var zc=["$connect","$disconnect","$on","$transaction","$extends"],$o=zc;function qo(e){if(e instanceof Vo)return Zc(e);if(or(e))return Yc(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=ht(e[n]);return r}let t={};for(let r in e)t[r]=ht(e[r]);return t}function Zc(e){return new Vo(e.strings,e.values)}function Yc(e){return new mt(e.sql,e.values)}function ht(e){if(typeof e!="object"||e==null||e instanceof Kc||Fe(e)||V(e))return e;if(Ce(e))return new Wc(e.toFixed());if(ve(e))return new Date(+e);if(ArrayBuffer.isView(e))return e.slice(0);if(Array.isArray(e)){let t=e.length,r;for(r=Array(t);t--;)r[t]=ht(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:ht(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=ht(e[r]);return t}ee(e,"Unknown value")}function Uo(e,t,r,n=0){return e._createPrismaPromise(i=>{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:qo(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Ho(o,l),a.args=s,Uo(e,a,r,n+1)}})})}function Bo(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Uo(e,t,s)}function Qo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Jo(r,n,0,e):e(r)}}function Jo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=Ho(i,l),Jo(a,t,r+1,n)}})}var jo=e=>e;function Ho(e=jo,t=jo){return r=>e(t(r))}import{Decimal as Xc}from"@prisma/client-runtime-utils";import{Decimal as cr}from"@prisma/client-runtime-utils";function E(e,t){throw new Error(t)}function hn(e,t){return e===t||e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>hn(e[r],t[r]))}function Ve(e,t){let r=Object.keys(e),n=Object.keys(t);return(r.length<n.length?r:n).every(o=>{if(typeof e[o]==typeof t[o]&&typeof e[o]!="object")return e[o]===t[o];if(cr.isDecimal(e[o])||cr.isDecimal(t[o])){let s=Go(e[o]),a=Go(t[o]);return s&&a&&s.equals(a)}else if(e[o]instanceof Uint8Array||t[o]instanceof Uint8Array){let s=zo(e[o]),a=zo(t[o]);return s&&a&&s.equals(a)}else{if(e[o]instanceof Date||t[o]instanceof Date)return Wo(e[o])?.getTime()===Wo(t[o])?.getTime();if(typeof e[o]=="bigint"||typeof t[o]=="bigint")return Ko(e[o])===Ko(t[o]);if(typeof e[o]=="number"||typeof t[o]=="number")return Zo(e[o])===Zo(t[o])}return hn(e[o],t[o])})}function Go(e){return cr.isDecimal(e)?e:typeof e=="number"||typeof e=="string"?new cr(e):void 0}function zo(e){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e.buffer,e.byteOffset,e.byteLength):typeof e=="string"?Buffer.from(e,"base64"):void 0}function Wo(e){return e instanceof Date?e:typeof e=="string"||typeof e=="number"?new Date(e):void 0}function Ko(e){return typeof e=="bigint"?e:typeof e=="number"||typeof e=="string"?BigInt(e):void 0}function Zo(e){return typeof e=="number"?e:typeof e=="string"?Number(e):void 0}function wt(e){return JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString():ArrayBuffer.isView(r)?Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("base64"):r)}function ep(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function tp(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function z(e){return e===null?e:Array.isArray(e)?e.map(z):typeof e=="object"?ep(e)?rp(e):e.constructor!==null&&e.constructor.name!=="Object"?e:tp(e,z):e}function rp({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"DateTime":return new Date(t);case"Decimal":return new Xc(t);case"Json":return JSON.parse(t);case"Raw":return t;case"FieldRef":throw new Error("FieldRef tagged values cannot be deserialized to JavaScript values");case"Enum":return t;default:E(t,"Unknown tagged value")}}function pr(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var m={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Character:6,Text:7,Date:8,Time:9,DateTime:10,Json:11,Enum:12,Bytes:13,Set:14,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,EnumArray:76,BytesArray:77,UuidArray:78,UnknownNumber:128};var k=class extends Error{name="UserFacingError";code;meta;constructor(t,r,n){super(t),this.code=r,this.meta=n??{}}toQueryResponseErrorObject(){return{error:this.message,user_facing_error:{is_panic:!1,message:this.message,meta:this.meta,error_code:this.code}}}};function qe(e){if(!pr(e))throw e;let t=np(e),r=Yo(e);throw!t||!r?e:new k(r,t,{driverAdapterError:e})}function bn(e){throw pr(e)?new k(`Raw query failed. Code: \`${e.cause.originalCode??"N/A"}\`. Message: \`${e.cause.originalMessage??Yo(e)}\``,"P2010",{driverAdapterError:e}):e}function np(e){switch(e.cause.kind){case"AuthenticationFailed":return"P1000";case"DatabaseNotReachable":return"P1001";case"DatabaseDoesNotExist":return"P1003";case"SocketTimeout":return"P1008";case"DatabaseAlreadyExists":return"P1009";case"DatabaseAccessDenied":return"P1010";case"TlsConnectionError":return"P1011";case"ConnectionClosed":return"P1017";case"TransactionAlreadyClosed":return"P1018";case"LengthMismatch":return"P2000";case"UniqueConstraintViolation":return"P2002";case"ForeignKeyConstraintViolation":return"P2003";case"InvalidInputValue":return"P2007";case"UnsupportedNativeDataType":return"P2010";case"NullConstraintViolation":return"P2011";case"ValueOutOfRange":return"P2020";case"TableDoesNotExist":return"P2021";case"ColumnNotFound":return"P2022";case"InvalidIsolationLevel":case"InconsistentColumnData":return"P2023";case"MissingFullTextSearchIndex":return"P2030";case"TransactionWriteConflict":return"P2034";case"GenericJs":return"P2036";case"TooManyConnections":return"P2037";case"postgres":case"sqlite":case"mysql":case"mssql":return;default:E(e.cause,`Unknown error: ${e.cause}`)}}function Yo(e){switch(e.cause.kind){case"AuthenticationFailed":return`Authentication failed against the database server, the provided database credentials for \`${e.cause.user??"(not available)"}\` are not valid`;case"DatabaseNotReachable":{let t=e.cause.host&&e.cause.port?`${e.cause.host}:${e.cause.port}`:e.cause.host;return`Can't reach database server${t?` at ${t}`:""}`}case"DatabaseDoesNotExist":return`Database \`${e.cause.db??"(not available)"}\` does not exist on the database server`;case"SocketTimeout":return"Operation has timed out";case"DatabaseAlreadyExists":return`Database \`${e.cause.db??"(not available)"}\` already exists on the database server`;case"DatabaseAccessDenied":return`User was denied access on the database \`${e.cause.db??"(not available)"}\``;case"TlsConnectionError":return`Error opening a TLS connection: ${e.cause.reason}`;case"ConnectionClosed":return"Server has closed the connection.";case"TransactionAlreadyClosed":return e.cause.cause;case"LengthMismatch":return`The provided value for the column is too long for the column's type. Column: ${e.cause.column??"(not available)"}`;case"UniqueConstraintViolation":return`Unique constraint failed on the ${wn(e.cause.constraint)}`;case"ForeignKeyConstraintViolation":return`Foreign key constraint violated on the ${wn(e.cause.constraint)}`;case"UnsupportedNativeDataType":return`Failed to deserialize column of type '${e.cause.type}'. If you're using $queryRaw and this column is explicitly marked as \`Unsupported\` in your Prisma schema, try casting this column to any supported Prisma type such as \`String\`.`;case"NullConstraintViolation":return`Null constraint violation on the ${wn(e.cause.constraint)}`;case"ValueOutOfRange":return`Value out of range for the type: ${e.cause.cause}`;case"TableDoesNotExist":return`The table \`${e.cause.table??"(not available)"}\` does not exist in the current database.`;case"ColumnNotFound":return`The column \`${e.cause.column??"(not available)"}\` does not exist in the current database.`;case"InvalidIsolationLevel":return`Error in connector: Conversion error: ${e.cause.level}`;case"InconsistentColumnData":return`Inconsistent column data: ${e.cause.cause}`;case"MissingFullTextSearchIndex":return"Cannot find a fulltext index to use for the native search, try adding a @@fulltext([Fields...]) to your schema";case"TransactionWriteConflict":return"Transaction failed due to a write conflict or a deadlock. Please retry your transaction";case"GenericJs":return`Error in external connector (id ${e.cause.id})`;case"TooManyConnections":return`Too many database connections opened: ${e.cause.cause}`;case"InvalidInputValue":return`Invalid input value: ${e.cause.message}`;case"sqlite":case"postgres":case"mysql":case"mssql":return;default:E(e.cause,`Unknown error: ${e.cause}`)}}function wn(e){return e&&"fields"in e?`fields: (${e.fields.map(t=>`\`${t}\``).join(", ")})`:e&&"index"in e?`constraint: \`${e.index}\``:e&&"foreignKey"in e?"foreign key":"(not available)"}function ip(e){if(typeof e!="object"||e===null)return!1;let t=e;return"$type"in t&&t.$type==="Param"||"prisma__type"in t&&t.prisma__type==="param"}function op(e){return"prisma__type"in e?e.prisma__value?.name:e.value.name}function sp(e,t){let r={};for(let[n,i]of Object.entries(e))if(r[n]=i,ip(i)){let o=op(i);o&&o in t&&(r[n]=t[o])}return r}function Xo(e,t,r={}){let n=e.map(o=>t.keys.reduce((s,a)=>(s[a]=z(o[a]),s),{})),i=new Set(t.nestedSelection);return t.arguments.map(o=>{let s=sp(o,r),a=n.findIndex(l=>Ve(l,s));if(a===-1)return t.expectNonEmpty?new k("An operation failed because it depends on one or more records that were required but not found","P2025"):null;{let l=Object.entries(e[a]).filter(([u])=>i.has(u));return Object.fromEntries(l)}})}import{Decimal as ap}from"@prisma/client-runtime-utils";var A=class extends k{name="DataMapperError";constructor(t,r){super(t,"P2023",r)}},es=new WeakMap;function lp(e){let t=es.get(e);return t||(t=Object.entries(e),es.set(e,t)),t}function rs(e,t,r){switch(t.type){case"affectedRows":if(typeof e!="number")throw new A(`Expected an affected rows count, got: ${typeof e} (${e})`);return{count:e};case"object":return En(e,t.fields,r,t.skipNulls);case"field":return xn(e,"<result>",t.fieldType,r);default:E(t,`Invalid data mapping type: '${t.type}'`)}}function En(e,t,r,n){if(e===null)return null;if(Array.isArray(e)){let i=e;return n&&(i=i.filter(o=>o!==null)),i.map(o=>ts(o,t,r))}if(typeof e=="object")return ts(e,t,r);if(typeof e=="string"){let i;try{i=JSON.parse(e)}catch(o){throw new A("Expected an array or object, got a string that is not valid JSON",{cause:o})}return En(i,t,r,n)}throw new A(`Expected an array or an object, got: ${typeof e}`)}function ts(e,t,r){if(typeof e!="object")throw new A(`Expected an object, but got '${typeof e}'`);let n={};for(let[i,o]of lp(t))switch(o.type){case"affectedRows":throw new A(`Unexpected 'AffectedRows' node in data mapping for field '${i}'`);case"object":{let{serializedName:s,fields:a,skipNulls:l}=o;if(s!==null&&!Object.hasOwn(e,s))throw new A(`Missing data field (Object): '${i}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`);let u=s!==null?e[s]:e;n[i]=En(u,a,r,l);break}case"field":{let s=o.dbName;if(Object.hasOwn(e,s))n[i]=up(e[s],s,o.fieldType,r);else throw new A(`Missing data field (Value): '${s}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`)}break;default:E(o,`DataMapper: Invalid data mapping node type: '${o.type}'`)}return n}function up(e,t,r,n){return e===null?r.arity==="list"?[]:null:r.arity==="list"?e.map((o,s)=>xn(o,`${t}[${s}]`,r,n)):xn(e,t,r,n)}function xn(e,t,r,n){switch(r.type){case"unsupported":return e;case"string":{if(typeof e!="string")throw new A(`Expected a string in column '${t}', got ${typeof e}: ${e}`);return e}case"int":switch(typeof e){case"number":return Math.trunc(e);case"string":{let i=Math.trunc(Number(e));if(Number.isNaN(i)||!Number.isFinite(i))throw new A(`Expected an integer in column '${t}', got string: ${e}`);if(!Number.isSafeInteger(i))throw new A(`Integer value in column '${t}' is too large to represent as a JavaScript number without loss of precision, got: ${e}. Consider using BigInt type.`);return i}default:throw new A(`Expected an integer in column '${t}', got ${typeof e}: ${e}`)}case"bigint":{if(typeof e!="number"&&typeof e!="string")throw new A(`Expected a bigint in column '${t}', got ${typeof e}: ${e}`);return{$type:"BigInt",value:e}}case"float":{if(typeof e=="number")return e;if(typeof e=="string"){let i=Number(e);if(Number.isNaN(i)&&!/^[-+]?nan$/.test(e.toLowerCase()))throw new A(`Expected a float in column '${t}', got string: ${e}`);return i}throw new A(`Expected a float in column '${t}', got ${typeof e}: ${e}`)}case"boolean":{if(typeof e=="boolean")return e;if(typeof e=="number")return e===1;if(typeof e=="string"){if(e==="true"||e==="TRUE"||e==="1")return!0;if(e==="false"||e==="FALSE"||e==="0")return!1;throw new A(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`)}if(Array.isArray(e)||e instanceof Uint8Array){for(let i of e)if(i!==0)return!0;return!1}throw new A(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`)}case"decimal":if(typeof e!="number"&&typeof e!="string"&&!ap.isDecimal(e))throw new A(`Expected a decimal in column '${t}', got ${typeof e}: ${e}`);return{$type:"Decimal",value:e};case"datetime":{if(typeof e=="string")return{$type:"DateTime",value:pp(e)};if(typeof e=="number"||e instanceof Date)return{$type:"DateTime",value:e};throw new A(`Expected a date in column '${t}', got ${typeof e}: ${e}`)}case"object":return{$type:"Json",value:wt(e)};case"json":return{$type:"Json",value:`${e}`};case"bytes":{switch(r.encoding){case"base64":if(typeof e!="string")throw new A(`Expected a base64-encoded byte array in column '${t}', got ${typeof e}: ${e}`);return{$type:"Bytes",value:e};case"hex":if(typeof e!="string"||!e.startsWith("\\x"))throw new A(`Expected a hex-encoded byte array in column '${t}', got ${typeof e}: ${e}`);return{$type:"Bytes",value:Buffer.from(e.slice(2),"hex").toString("base64")};case"array":if(Array.isArray(e))return{$type:"Bytes",value:Buffer.from(e).toString("base64")};if(e instanceof Uint8Array)return{$type:"Bytes",value:Buffer.from(e).toString("base64")};throw new A(`Expected a byte array in column '${t}', got ${typeof e}: ${e}`);default:E(r.encoding,`DataMapper: Unknown bytes encoding: ${r.encoding}`)}break}case"enum":{let i=n[r.name];if(i===void 0)throw new A(`Unknown enum '${r.name}'`);let o=i[`${e}`];if(o===void 0)throw new A(`Value '${e}' not found in enum '${r.name}'`);return o}default:E(r,`DataMapper: Unknown result type: ${r.type}`)}}var cp=/\d{2}:\d{2}:\d{2}(?:\.\d+)?(Z|[+-]\d{2}(:?\d{2})?)?$/;function pp(e){let t=cp.exec(e);if(t===null)return`${e}T00:00:00Z`;let r=e,[n,i,o]=t;if(i!==void 0&&i!=="Z"&&o===void 0?r=`${e}:00`:i===void 0&&(r=`${e}Z`),n.length===e.length)return`1970-01-01T${r}`;let s=t.index-1;return r[s]===" "&&(r=`${r.slice(0,s)}T${r.slice(s+1)}`),r}function W(e){if(typeof e!="object")return e;var t,r,n=Object.prototype.toString.call(e);if(n==="[object Object]"){if(e.constructor!==Object&&typeof e.constructor=="function"){r=new e.constructor;for(t in e)e.hasOwnProperty(t)&&r[t]!==e[t]&&(r[t]=W(e[t]))}else{r={};for(t in e)t==="__proto__"?Object.defineProperty(r,t,{value:W(e[t]),configurable:!0,enumerable:!0,writable:!0}):r[t]=W(e[t])}return r}if(n==="[object Array]"){for(t=e.length,r=Array(t);t--;)r[t]=W(e[t]);return r}return n==="[object Set]"?(r=new Set,e.forEach(function(i){r.add(W(i))}),r):n==="[object Map]"?(r=new Map,e.forEach(function(i,o){r.set(W(o),W(i))}),r):n==="[object Date]"?new Date(+e):n==="[object RegExp]"?(r=new RegExp(e.source,e.flags),r.lastIndex=e.lastIndex,r):n==="[object DataView]"?new e.constructor(W(e.buffer)):n==="[object ArrayBuffer]"?e.slice(0):n.slice(-6)==="Array]"?new e.constructor(e):e}function dp(e){let t=Object.entries(e);return t.length===0?"":(t.sort(([n],[i])=>n.localeCompare(i)),`/*${t.map(([n,i])=>{let o=encodeURIComponent(n),s=encodeURIComponent(i).replace(/'/g,"\\'");return`${o}='${s}'`}).join(",")}*/`)}function dr(e,t){let r={};for(let n of e){let i=n(W(t));for(let[o,s]of Object.entries(i))s!==void 0&&(r[o]=s)}return r}function ns(e,t){let r=dr(e,t);return dp(r)}function is(e,t){return t?`${e} ${t}`:e}var bt;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(bt||(bt={}));function mp(e){switch(e){case"postgresql":case"postgres":case"prisma+postgres":return"postgresql";case"sqlserver":return"mssql";case"mysql":case"sqlite":case"cockroachdb":case"mongodb":return e;default:E(e,`Unknown provider: ${e}`)}}async function mr({query:e,tracingHelper:t,provider:r,onQuery:n,execute:i}){let o=n===void 0?i:async()=>{let s=new Date,a=performance.now(),l=await i(),u=performance.now();return n({timestamp:s,duration:u-a,query:e.sql,params:e.args}),l};return t.isEnabled()?await t.runInChildSpan({name:"db_query",kind:bt.CLIENT,attributes:{"db.query.text":e.sql,"db.system.name":mp(r)}},o):o()}function ye(e,t){var r="000000000"+e;return r.substr(r.length-t)}import fp from"node:os";function gp(){try{return fp.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var os=2,yp=ye(process.pid.toString(36),os),ss=gp(),hp=ss.length,wp=ye(ss.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+hp+36).toString(36),os);function Pn(){return yp+wp}function fr(e){return typeof e=="string"&&/^c[a-z0-9]{20,32}$/.test(e)}function Tn(e){let n=Math.pow(36,4),i=0;function o(){return ye((Math.random()*n<<0).toString(36),4)}function s(){return i=i<n?i:0,i++,i-1}function a(){var l="c",u=new Date().getTime().toString(36),c=ye(s().toString(36),4),p=e(),d=o()+o();return l+u+c+p+d}return a.fingerprint=e,a.isCuid=fr,a}var bp=Tn(Pn);var as=bp;var oa=de(Zs());import{webcrypto as Xs}from"node:crypto";var Ys="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var od=128,we,Be;function sd(e){!we||we.length<e?(we=Buffer.allocUnsafe(e*od),Xs.getRandomValues(we),Be=0):Be+e>we.length&&(Xs.getRandomValues(we),Be=0),Be+=e}function Nn(e=21){sd(e|=0);let t="";for(let r=Be-e;r<Be;r++)t+=Ys[we[r]&63];return t}import wr from"node:crypto";var ta="0123456789ABCDEFGHJKMNPQRSTVWXYZ",At=32;var ad=16,ra=10,ea=0xffffffffffff;var be;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(be||(be={}));var xe=class extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}};function ld(e){let t=Math.floor(e()*At);return t===At&&(t=At-1),ta.charAt(t)}function ud(e){let t=cd(),r=t&&(t.crypto||t.msCrypto)||(typeof wr<"u"?wr:null);if(typeof r?.getRandomValues=="function")return()=>{let n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof r?.randomBytes=="function")return()=>r.randomBytes(1).readUInt8()/255;if(wr?.randomBytes)return()=>wr.randomBytes(1).readUInt8()/255;throw new xe(be.PRNGDetectFailure,"Failed to find a reliable PRNG")}function cd(){return md()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function pd(e,t){let r="";for(;e>0;e--)r=ld(t)+r;return r}function dd(e,t=ra){if(isNaN(e))throw new xe(be.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>ea)throw new xe(be.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${ea}: ${e}`);if(e<0)throw new xe(be.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new xe(be.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%At,n=ta.charAt(r)+n,e=(e-r)/At;return n}function md(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function na(e,t){let r=t||ud(),n=!e||isNaN(e)?Date.now():e;return dd(n,ra)+pd(ad,r)}var I=[];for(let e=0;e<256;++e)I.push((e+256).toString(16).slice(1));function br(e,t=0){return(I[e[t+0]]+I[e[t+1]]+I[e[t+2]]+I[e[t+3]]+"-"+I[e[t+4]]+I[e[t+5]]+"-"+I[e[t+6]]+I[e[t+7]]+"-"+I[e[t+8]]+I[e[t+9]]+"-"+I[e[t+10]]+I[e[t+11]]+I[e[t+12]]+I[e[t+13]]+I[e[t+14]]+I[e[t+15]]).toLowerCase()}import{randomFillSync as fd}from"node:crypto";var Er=new Uint8Array(256),xr=Er.length;function Qe(){return xr>Er.length-16&&(fd(Er),xr=0),Er.slice(xr,xr+=16)}import{randomUUID as gd}from"node:crypto";var Dn={randomUUID:gd};function yd(e,t,r){if(Dn.randomUUID&&!t&&!e)return Dn.randomUUID();e=e||{};let n=e.random??e.rng?.()??Qe();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return br(n)}var Fn=yd;var Mn={};function hd(e,t,r){let n;if(e)n=ia(e.random??e.rng?.()??Qe(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=Qe();wd(Mn,i,o),n=ia(o,Mn.msecs,Mn.seq,t,r)}return t??br(n)}function wd(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function ia(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}var _n=hd;var Pr=class{#e={};constructor(){this.register("uuid",new $n),this.register("cuid",new Vn),this.register("ulid",new qn),this.register("nanoid",new jn),this.register("product",new Un)}snapshot(){return Object.create(this.#e,{now:{value:new Ln}})}register(t,r){this.#e[t]=r}},Ln=class{#e=new Date;generate(){return this.#e.toISOString()}},$n=class{generate(t){if(t===4)return Fn();if(t===7)return _n();throw new Error("Invalid UUID generator arguments")}},Vn=class{generate(t){if(t===1)return as();if(t===2)return(0,oa.createId)();throw new Error("Invalid CUID generator arguments")}},qn=class{generate(){return na()}},jn=class{generate(t){if(typeof t=="number")return Nn(t);if(t===void 0)return Nn();throw new Error("Invalid Nanoid generator arguments")}},Un=class{generate(t,r){if(t===void 0||r===void 0)throw new Error("Invalid Product generator arguments");return Array.isArray(t)&&Array.isArray(r)?t.flatMap(n=>r.map(i=>[n,i])):Array.isArray(t)?t.map(n=>[n,r]):Array.isArray(r)?r.map(n=>[t,n]):[[t,r]]}};function Tr(e,t){return e==null?e:typeof e=="string"?Tr(JSON.parse(e),t):Array.isArray(e)?xd(e,t):bd(e,t)}function bd(e,t){if(t.pagination){let{skip:r,take:n,cursor:i}=t.pagination;if(r!==null&&r>0||n===0||i!==null&&!Ve(e,i))return null}return aa(e,t.nested)}function aa(e,t){for(let[r,n]of Object.entries(t))e[r]=Tr(e[r],n);return e}function xd(e,t){if(t.distinct!==null){let r=t.linkingFields!==null?[...t.distinct,...t.linkingFields]:t.distinct;e=Ed(e,r)}return t.pagination&&(e=Pd(e,t.pagination,t.linkingFields)),t.reverse&&e.reverse(),Object.keys(t.nested).length===0?e:e.map(r=>aa(r,t.nested))}function Ed(e,t){let r=new Set,n=[];for(let i of e){let o=Je(i,t);r.has(o)||(r.add(o),n.push(i))}return n}function Pd(e,t,r){if(r===null)return sa(e,t);let n=new Map;for(let o of e){let s=Je(o,r);n.has(s)||n.set(s,[]),n.get(s).push(o)}let i=Array.from(n.entries());return i.sort(([o],[s])=>o<s?-1:o>s?1:0),i.flatMap(([,o])=>sa(o,t))}function sa(e,{cursor:t,skip:r,take:n}){let i=t!==null?e.findIndex(a=>Ve(a,t)):0;if(i===-1)return[];let o=i+(r??0),s=n!==null?o+n:e.length;return e.slice(o,s)}function Je(e,t){return JSON.stringify(t.map(r=>e[r]))}function Bn(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}function Qn(e){return typeof e=="object"&&e!==null&&e.prisma__type==="generatorCall"}function Gn(e,t,r,n){let i=e.args.map(o=>q(o,t,r));switch(e.type){case"rawSql":return[Ad(e.sql,i,e.argTypes)];case"templateSql":return(e.chunkable?Cd(e.fragments,i,n):[i]).map(s=>{if(n!==void 0&&s.length>n)throw new k("The query parameter limit supported by your database is exceeded.","P2029");return Td(e.fragments,e.placeholderFormat,s,e.argTypes)});default:E(e.type,"Invalid query type")}}function q(e,t,r){for(;vd(e);)if(Bn(e)){let n=t[e.prisma__value.name];if(n===void 0)throw new Error(`Missing value for query variable ${e.prisma__value.name}`);e=n}else if(Qn(e)){let{name:n,args:i}=e.prisma__value,o=r[n];if(!o)throw new Error(`Encountered an unknown generator '${n}'`);e=o.generate(...i.map(s=>q(s,t,r)))}else E(e,`Unexpected unevaluated value type: ${e}`);return Array.isArray(e)&&(e=e.map(n=>q(n,t,r))),e}function Td(e,t,r,n){let i="",o={placeholderNumber:1},s=[],a=[];for(let l of Hn(e,r,n)){if(i+=Sd(l,t,o),l.type==="stringChunk")continue;let u=s.length,c=s.push(...la(l))-u;if(l.argType.arity==="tuple"){if(c%l.argType.elements.length!==0)throw new Error(`Malformed query template. Expected the number of parameters to match the tuple arity, but got ${c} parameters for a tuple of arity ${l.argType.elements.length}.`);for(let p=0;p<c/l.argType.elements.length;p++)a.push(...l.argType.elements)}else for(let p=0;p<c;p++)a.push(l.argType)}return{sql:i,args:s,argTypes:a}}function Sd(e,t,r){let n=e.type;switch(n){case"parameter":return Jn(t,r.placeholderNumber++);case"stringChunk":return e.chunk;case"parameterTuple":return`(${e.value.length==0?"NULL":e.value.map(()=>Jn(t,r.placeholderNumber++)).join(",")})`;case"parameterTupleList":return e.value.map(i=>{let o=i.map(()=>Jn(t,r.placeholderNumber++)).join(e.itemSeparator);return`${e.itemPrefix}${o}${e.itemSuffix}`}).join(e.groupSeparator);default:E(n,"Invalid fragment type")}}function Jn(e,t){return e.hasNumbering?`${e.prefix}${t}`:e.prefix}function Ad(e,t,r){return{sql:e,args:t,argTypes:r}}function vd(e){return Bn(e)||Qn(e)}function*Hn(e,t,r){let n=0;for(let i of e)switch(i.type){case"parameter":{if(n>=t.length)throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);yield{...i,value:t[n],argType:r?.[n]},n++;break}case"stringChunk":{yield i;break}case"parameterTuple":{if(n>=t.length)throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);let o=t[n];yield{...i,value:Array.isArray(o)?o:[o],argType:r?.[n]},n++;break}case"parameterTupleList":{if(n>=t.length)throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);let o=t[n];if(!Array.isArray(o))throw new Error("Malformed query template. Tuple list expected.");if(o.length===0)throw new Error("Malformed query template. Tuple list cannot be empty.");for(let s of o)if(!Array.isArray(s))throw new Error("Malformed query template. Tuple expected.");yield{...i,value:o,argType:r?.[n]},n++;break}}}function*la(e){switch(e.type){case"parameter":yield e.value;break;case"stringChunk":break;case"parameterTuple":yield*e.value;break;case"parameterTupleList":for(let t of e.value)yield*t;break}}function Cd(e,t,r){let n=0,i=0;for(let s of Hn(e,t,void 0)){let a=0;for(let l of la(s))a++;i=Math.max(i,a),n+=a}let o=[[]];for(let s of Hn(e,t,void 0))switch(s.type){case"parameter":{for(let a of o)a.push(s.value);break}case"stringChunk":break;case"parameterTuple":{let a=s.value.length,l=[];if(r&&o.length===1&&a===i&&n>r&&n-a<r){let u=r-(n-a);l=Rd(s.value,u)}else l=[s.value];o=o.flatMap(u=>l.map(c=>[...u,c]));break}case"parameterTupleList":{let a=s.value.reduce((p,d)=>p+d.length,0),l=[],u=[],c=0;for(let p of s.value)r&&o.length===1&&a===i&&u.length>0&&n-a+c+p.length>r&&(l.push(u),u=[],c=0),u.push(p),c+=p.length;u.length>0&&l.push(u),o=o.flatMap(p=>l.map(d=>[...p,d]));break}}return o}function Rd(e,t){let r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function ua(e){return e.rows.map(t=>t.reduce((r,n,i)=>(r[e.columnNames[i]]=n,r),{}))}function ca(e){return{columns:e.columnNames,types:e.columnTypes.map(t=>kd(t)),rows:e.rows.map(t=>t.map((r,n)=>vt(r,e.columnTypes[n])))}}function vt(e,t){if(e===null)return null;switch(t){case m.Int32:switch(typeof e){case"number":return Math.trunc(e);case"string":return Math.trunc(Number(e));default:throw new Error(`Cannot serialize value of type ${typeof e} as Int32`)}case m.Int32Array:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as Int32Array`);return e.map(r=>vt(r,m.Int32));case m.Int64:switch(typeof e){case"number":return BigInt(Math.trunc(e));case"string":return e;default:throw new Error(`Cannot serialize value of type ${typeof e} as Int64`)}case m.Int64Array:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as Int64Array`);return e.map(r=>vt(r,m.Int64));case m.Json:switch(typeof e){case"string":return JSON.parse(e);default:throw new Error(`Cannot serialize value of type ${typeof e} as Json`)}case m.JsonArray:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as JsonArray`);return e.map(r=>vt(r,m.Json));case m.Boolean:switch(typeof e){case"boolean":return e;case"string":return e==="true"||e==="1";case"number":return e===1;default:throw new Error(`Cannot serialize value of type ${typeof e} as Boolean`)}case m.BooleanArray:if(!Array.isArray(e))throw new Error(`Cannot serialize value of type ${typeof e} as BooleanArray`);return e.map(r=>vt(r,m.Boolean));default:return e}}function kd(e){switch(e){case m.Int32:return"int";case m.Int64:return"bigint";case m.Float:return"float";case m.Double:return"double";case m.Text:return"string";case m.Enum:return"enum";case m.Bytes:return"bytes";case m.Boolean:return"bool";case m.Character:return"char";case m.Numeric:return"decimal";case m.Json:return"json";case m.Uuid:return"uuid";case m.DateTime:return"datetime";case m.Date:return"date";case m.Time:return"time";case m.Int32Array:return"int-array";case m.Int64Array:return"bigint-array";case m.FloatArray:return"float-array";case m.DoubleArray:return"double-array";case m.TextArray:return"string-array";case m.EnumArray:return"string-array";case m.BytesArray:return"bytes-array";case m.BooleanArray:return"bool-array";case m.CharacterArray:return"char-array";case m.NumericArray:return"decimal-array";case m.JsonArray:return"json-array";case m.UuidArray:return"uuid-array";case m.DateTimeArray:return"datetime-array";case m.DateArray:return"date-array";case m.TimeArray:return"time-array";case m.UnknownNumber:return"unknown";case m.Set:return"string";default:E(e,`Unexpected column type: ${e}`)}}function pa(e,t,r){if(!t.every(n=>zn(e,n))){let n=Id(e,r),i=Od(r);throw new k(n,i,r.context)}}function zn(e,t){switch(t.type){case"rowCountEq":return Array.isArray(e)?e.length===t.args:e===null?t.args===0:t.args===1;case"rowCountNeq":return Array.isArray(e)?e.length!==t.args:e===null?t.args!==0:t.args!==1;case"affectedRowCountEq":return e===t.args;case"never":return!1;default:E(t,`Unknown rule type: ${t.type}`)}}function Id(e,t){switch(t.error_identifier){case"RELATION_VIOLATION":return`The change you are trying to make would violate the required relation '${t.context.relation}' between the \`${t.context.modelA}\` and \`${t.context.modelB}\` models.`;case"MISSING_RECORD":return`An operation failed because it depends on one or more records that were required but not found. No record was found for ${t.context.operation}.`;case"MISSING_RELATED_RECORD":{let r=t.context.neededFor?` (needed to ${t.context.neededFor})`:"";return`An operation failed because it depends on one or more records that were required but not found. No '${t.context.model}' record${r} was found for ${t.context.operation} on ${t.context.relationType} relation '${t.context.relation}'.`}case"INCOMPLETE_CONNECT_INPUT":return`An operation failed because it depends on one or more records that were required but not found. Expected ${t.context.expectedRows} records to be connected, found only ${Array.isArray(e)?e.length:e}.`;case"INCOMPLETE_CONNECT_OUTPUT":return`The required connected records were not found. Expected ${t.context.expectedRows} records to be connected after connect operation on ${t.context.relationType} relation '${t.context.relation}', found ${Array.isArray(e)?e.length:e}.`;case"RECORDS_NOT_CONNECTED":return`The records for relation \`${t.context.relation}\` between the \`${t.context.parent}\` and \`${t.context.child}\` models are not connected.`;default:E(t,`Unknown error identifier: ${t}`)}}function Od(e){switch(e.error_identifier){case"RELATION_VIOLATION":return"P2014";case"RECORDS_NOT_CONNECTED":return"P2017";case"INCOMPLETE_CONNECT_OUTPUT":return"P2018";case"MISSING_RECORD":case"MISSING_RELATED_RECORD":case"INCOMPLETE_CONNECT_INPUT":return"P2025";default:E(e,`Unknown error identifier: ${e}`)}}var Ct=class e{#e;#t=new Pr;#r;#n;#i;#o;#a;constructor({onQuery:t,tracingHelper:r,serializer:n,rawSerializer:i,provider:o,connectionInfo:s}){this.#e=t,this.#r=r,this.#n=n,this.#i=i??n,this.#o=o,this.#a=s}static forSql(t){return new e({onQuery:t.onQuery,tracingHelper:t.tracingHelper,serializer:ua,rawSerializer:ca,provider:t.provider,connectionInfo:t.connectionInfo})}async run(t,r){let{value:n}=await this.interpretNode(t,{...r,generators:this.#t.snapshot()}).catch(i=>qe(i));return n}async interpretNode(t,r){switch(t.type){case"value":return{value:q(t.args,r.scope,r.generators)};case"seq":{let n;for(let i of t.args)n=await this.interpretNode(i,r);return n??{value:void 0}}case"get":return{value:r.scope[t.args.name]};case"let":{let n=Object.create(r.scope);for(let i of t.args.bindings){let{value:o}=await this.interpretNode(i.expr,{...r,scope:n});n[i.name]=o}return this.interpretNode(t.args.expr,{...r,scope:n})}case"getFirstNonEmpty":{for(let n of t.args.names){let i=r.scope[n];if(!da(i))return{value:i}}return{value:[]}}case"concat":{let n=await Promise.all(t.args.map(i=>this.interpretNode(i,r).then(o=>o.value)));return{value:n.length>0?n.reduce((i,o)=>i.concat(Wn(o)),[]):[]}}case"sum":{let n=await Promise.all(t.args.map(i=>this.interpretNode(i,r).then(o=>o.value)));return{value:n.length>0?n.reduce((i,o)=>K(i)+K(o)):0}}case"execute":{let n=Gn(t.args,r.scope,r.generators,this.#s()),i=0;for(let o of n){let s=ma(o,r.sqlCommenter);i+=await this.#l(s,r.queryable,()=>r.queryable.executeRaw(s).catch(a=>t.args.type==="rawSql"?bn(a):qe(a)))}return{value:i}}case"query":{let n=Gn(t.args,r.scope,r.generators,this.#s()),i;for(let o of n){let s=ma(o,r.sqlCommenter),a=await this.#l(s,r.queryable,()=>r.queryable.queryRaw(s).catch(l=>t.args.type==="rawSql"?bn(l):qe(l)));i===void 0?i=a:(i.rows.push(...a.rows),i.lastInsertId=a.lastInsertId)}return{value:t.args.type==="rawSql"?this.#i(i):this.#n(i),lastInsertId:i?.lastInsertId}}case"reverse":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args,r);return{value:Array.isArray(n)?n.reverse():n,lastInsertId:i}}case"unique":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args,r);if(!Array.isArray(n))return{value:n,lastInsertId:i};if(n.length>1)throw new Error(`Expected zero or one element, got ${n.length}`);return{value:n[0]??null,lastInsertId:i}}case"required":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args,r);if(da(n))throw new Error("Required value is empty");return{value:n,lastInsertId:i}}case"mapField":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.records,r);return{value:fa(n,t.args.field),lastInsertId:i}}case"join":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.parent,r);if(n===null)return{value:null,lastInsertId:i};let o=await Promise.all(t.args.children.map(async s=>({joinExpr:s,childRecords:(await this.interpretNode(s.child,r)).value})));return{value:Nd(n,o),lastInsertId:i}}case"transaction":{if(!r.transactionManager.enabled)return this.interpretNode(t.args,r);let n=r.transactionManager.manager,i=await n.startInternalTransaction(),o=await n.getTransaction(i,"query");try{let s=await this.interpretNode(t.args,{...r,queryable:o});return await n.commitTransaction(i.id),s}catch(s){throw await n.rollbackTransaction(i.id),s}}case"dataMap":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r);return{value:rs(n,t.args.structure,t.args.enums),lastInsertId:i}}case"validate":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r);return pa(n,t.args.rules,t.args),{value:n,lastInsertId:i}}case"if":{let{value:n}=await this.interpretNode(t.args.value,r);return zn(n,t.args.rule)?await this.interpretNode(t.args.then,r):await this.interpretNode(t.args.else,r)}case"unit":return{value:void 0};case"diff":{let{value:n}=await this.interpretNode(t.args.from,r),{value:i}=await this.interpretNode(t.args.to,r),o=a=>a!==null?Je(Sr(a),t.args.fields):null,s=new Set(Wn(i).map(o));return{value:Wn(n).filter(a=>!s.has(o(a)))}}case"process":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r);return ga(t.args.operations,r.scope,r.generators),{value:Tr(n,t.args.operations),lastInsertId:i}}case"initializeRecord":{let{lastInsertId:n}=await this.interpretNode(t.args.expr,r),i={};for(let[o,s]of Object.entries(t.args.fields))i[o]=Dd(s,n,r.scope,r.generators);return{value:i,lastInsertId:n}}case"mapRecord":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r),o=n===null?{}:Sr(n);for(let[s,a]of Object.entries(t.args.fields))o[s]=Fd(a,o[s],r.scope,r.generators);return{value:o,lastInsertId:i}}default:E(t,`Unexpected node type: ${t.type}`)}}#s(){return this.#a?.maxBindValues!==void 0?this.#a.maxBindValues:this.#u()}#u(){if(this.#o!==void 0)switch(this.#o){case"cockroachdb":case"postgres":case"postgresql":case"prisma+postgres":return 32766;case"mysql":return 65535;case"sqlite":return 999;case"sqlserver":return 2098;case"mongodb":return;default:E(this.#o,`Unexpected provider: ${this.#o}`)}}#l(t,r,n){return mr({query:t,execute:n,provider:this.#o??r.provider,tracingHelper:this.#r,onQuery:this.#e})}};function da(e){return Array.isArray(e)?e.length===0:e==null}function Wn(e){return Array.isArray(e)?e:[e]}function K(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function Sr(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Expected object, got ${typeof e}`)}function fa(e,t){return Array.isArray(e)?e.map(r=>fa(r,t)):typeof e=="object"&&e!==null?e[t]??null:e}function Nd(e,t){for(let{joinExpr:r,childRecords:n}of t){let i=r.on.map(([a])=>a),o=r.on.map(([,a])=>a),s={};for(let a of Array.isArray(e)?e:[e]){let l=Sr(a),u=Je(l,i);s[u]||(s[u]=[]),s[u].push(l),r.isRelationUnique?l[r.parentField]=null:l[r.parentField]=[]}for(let a of Array.isArray(n)?n:[n]){if(a===null)continue;let l=Je(Sr(a),o);for(let u of s[l]??[])r.isRelationUnique?u[r.parentField]=a:u[r.parentField].push(a)}}return e}function Dd(e,t,r,n){switch(e.type){case"value":return q(e.value,r,n);case"lastInsertId":return t;default:E(e,`Unexpected field initializer type: ${e.type}`)}}function Fd(e,t,r,n){switch(e.type){case"set":return q(e.value,r,n);case"add":return K(t)+K(q(e.value,r,n));case"subtract":return K(t)-K(q(e.value,r,n));case"multiply":return K(t)*K(q(e.value,r,n));case"divide":{let i=K(t),o=K(q(e.value,r,n));return o===0?null:i/o}default:E(e,`Unexpected field operation type: ${e.type}`)}}function ma(e,t){if(!t||t.plugins.length===0)return e;let r=ns(t.plugins,{query:t.queryInfo,sql:e.sql});return r?{...e,sql:is(e.sql,r)}:e}function ga(e,t,r){let n=e.pagination?.cursor;if(n)for(let[i,o]of Object.entries(n))n[i]=q(o,t,r);for(let i of Object.values(e.nested))ga(i,t,r)}async function Md(){return globalThis.crypto??await import("node:crypto")}async function ya(){return(await Md()).randomUUID()}async function ha(e,t){return new Promise(r=>{e.addEventListener(t,r,{once:!0})})}var j=class extends k{name="TransactionManagerError";constructor(t,r){super("Transaction API error: "+t,"P2028",r)}},Rt=class extends j{constructor(){super("Transaction not found. Transaction ID is invalid, refers to an old closed transaction Prisma doesn't have information about anymore, or was obtained before disconnecting.")}},Ar=class extends j{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction.`)}},vr=class extends j{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back.`)}},Cr=class extends j{constructor(){super("Unable to start a transaction in the given time.")}},Rr=class extends j{constructor(t,{timeout:r,timeTaken:n}){super(`A ${t} cannot be executed on an expired transaction. The timeout for this transaction was ${r} ms, however ${n} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction.`,{operation:t,timeout:r,timeTaken:n})}},He=class extends j{constructor(t){super(`Internal Consistency Error: ${t}`)}},kr=class extends j{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var _d=100,Ge=N("prisma:client:transactionManager"),Ld=()=>({sql:"COMMIT",args:[],argTypes:[]}),$d=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),Vd=()=>({sql:'-- Implicit "COMMIT" query via underlying driver',args:[],argTypes:[]}),qd=()=>({sql:'-- Implicit "ROLLBACK" query via underlying driver',args:[],argTypes:[]}),kt=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;#e;#t;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n,onQuery:i,provider:o}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n,this.#e=i,this.#t=o}async startInternalTransaction(t){let r=t!==void 0?this.#a(t):{};return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(r))}async startTransaction(t){let r=t!==void 0?this.#a(t):this.transactionOptions;return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(r))}async#r(t){let r={id:await ya(),status:"waiting",timer:void 0,timeout:t.timeout,startedAt:Date.now(),transaction:void 0},n=new AbortController,i=wa(()=>n.abort(),t.maxWait);i?.unref?.();let o=this.driverAdapter.startTransaction(t.isolationLevel).catch(qe);switch(r.transaction=await Promise.race([o.finally(()=>clearTimeout(i)),ha(n.signal,"abort").then(()=>{})]),this.transactions.set(r.id,r),r.status){case"waiting":if(n.signal.aborted)throw o.then(s=>s.rollback()).catch(s=>Ge("error in discarded transaction:",s)),await this.#o(r,"timed_out"),new Cr;return r.status="running",r.timer=this.#i(r.id,t.timeout),{id:r.id};case"timed_out":case"running":case"committed":case"rolled_back":throw new He(`Transaction in invalid state ${r.status} although it just finished startup.`);default:E(r.status,"Unknown transaction status.")}}async commitTransaction(t){return await this.tracingHelper.runInChildSpan("commit_transaction",async()=>{let r=this.#n(t,"commit");await this.#o(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.#n(t,"rollback");await this.#o(r,"rolled_back")})}async getTransaction(t,r){let n=this.#n(t.id,r);if(n.status==="closing"&&(await n.closing,n=this.#n(t.id,r)),!n.transaction)throw new Rt;return n.transaction}#n(t,r){let n=this.transactions.get(t);if(!n){let i=this.closedTransactions.find(o=>o.id===t);if(i)switch(Ge("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"closing":case"waiting":case"running":throw new He("Active transaction found in closed transactions list.");case"committed":throw new Ar(r);case"rolled_back":throw new vr(r);case"timed_out":throw new Rr(r,{timeout:i.timeout,timeTaken:Date.now()-i.startedAt})}else throw Ge("Transaction not found.",t),new Rt}if(["committed","rolled_back","timed_out"].includes(n.status))throw new He("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.#o(t,"rolled_back")))}#i(t,r){let n=Date.now(),i=wa(async()=>{Ge("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let o=this.transactions.get(t);o&&["running","waiting"].includes(o.status)?await this.#o(o,"timed_out"):Ge("Transaction already committed or rolled back when timeout happened.",t)},r);return i?.unref?.(),i}async#o(t,r){let n=async()=>{Ge("Closing transaction.",{transactionId:t.id,status:r});try{if(t.transaction&&r==="committed")if(t.transaction.options.usePhantomQuery)await this.#s(Vd(),t.transaction,()=>t.transaction.commit());else{let i=Ld();await this.#s(i,t.transaction,()=>t.transaction.executeRaw(i)).then(()=>t.transaction.commit(),o=>{let s=()=>Promise.reject(o);return t.transaction.rollback().then(s,s)})}else if(t.transaction)if(t.transaction.options.usePhantomQuery)await this.#s(qd(),t.transaction,()=>t.transaction.rollback());else{let i=$d();try{await this.#s(i,t.transaction,()=>t.transaction.executeRaw(i))}finally{await t.transaction.rollback()}}}finally{t.status=r,clearTimeout(t.timer),t.timer=void 0,this.transactions.delete(t.id),this.closedTransactions.push(t),this.closedTransactions.length>_d&&this.closedTransactions.shift()}};t.status==="closing"?(await t.closing,this.#n(t.id,r==="committed"?"commit":"rollback")):await Object.assign(t,{status:"closing",reason:r,closing:n()}).closing}#a(t){if(!t.timeout)throw new j("timeout is required");if(!t.maxWait)throw new j("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new kr(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}#s(t,r,n){return mr({query:t,execute:n,provider:this.#t??r.provider,tracingHelper:this.tracingHelper,onQuery:this.#e})}};function wa(e,t){return t!==void 0?setTimeout(e,t):void 0}import{PrismaClientInitializationError as ti,PrismaClientKnownRequestError as ri,PrismaClientRustPanicError as Ot,PrismaClientUnknownRequestError as za}from"@prisma/client-runtime-utils";function ba(e){return new Kn(e).deserialize()}function jd(e){return Buffer.from(e,"base64url")}var Kn=class{#e;#t;#r=0;constructor(t){this.#e=t;let r=jd(t.graph);this.#t=new DataView(r.buffer,r.byteOffset,r.byteLength)}deserialize(){let{inputNodeCount:t,outputNodeCount:r,rootCount:n}=this.#s(),i=this.#u(t),o=this.#l(r),s=this.#p(n);return{strings:this.#e.strings,inputNodes:i,outputNodes:o,roots:s}}#n(){let t=0,r=0,n;do n=this.#t.getUint8(this.#r++),t|=(n&127)<<r,r+=7;while(n>=128);return t}#i(){let t=this.#n();return t===0?void 0:t-1}#o(){let t=this.#t.getUint8(this.#r);return this.#r+=1,t}#a(){let t=this.#t.getUint16(this.#r,!0);return this.#r+=2,t}#s(){let t=this.#n(),r=this.#n(),n=this.#n();return{inputNodeCount:t,outputNodeCount:r,rootCount:n}}#u(t){let r=[];for(let n=0;n<t;n++){let i=this.#n(),o={};for(let s=0;s<i;s++){let a=this.#n(),l=this.#a(),u=this.#i(),c=this.#i(),d={flags:this.#o()};l!==0&&(d.scalarMask=l),u!==void 0&&(d.childNodeId=u),c!==void 0&&(d.enumNameIndex=c),o[a]=d}r.push({edges:o})}return r}#l(t){let r=[];for(let n=0;n<t;n++){let i=this.#n(),o={};for(let s=0;s<i;s++){let a=this.#n(),l=this.#i(),u=this.#i(),c={};l!==void 0&&(c.argsNodeId=l),u!==void 0&&(c.outputNodeId=u),o[a]=c}r.push({edges:o})}return r}#p(t){let r={};for(let n=0;n<t;n++){let i=this.#n(),o=this.#i(),s=this.#i(),a=this.#e.strings[i],l={};o!==void 0&&(l.argsNodeId=o),s!==void 0&&(l.outputNodeId=s),r[a]=l}return r}};var It=class e{#e;#t;#r;constructor(t,r){this.#e=t,this.#r=r,this.#t=new Map;for(let n=0;n<t.strings.length;n++)this.#t.set(t.strings[n],n)}static deserialize(t,r){let n=ba(t);return new e(n,r)}static fromData(t,r){return new e(t,r)}root(t){let r=this.#e.roots[t];if(r)return{argsNodeId:r.argsNodeId,outputNodeId:r.outputNodeId}}inputNode(t){if(!(t===void 0||t<0||t>=this.#e.inputNodes.length))return{id:t}}outputNode(t){if(!(t===void 0||t<0||t>=this.#e.outputNodes.length))return{id:t}}inputEdge(t,r){if(!t)return;let n=this.#e.inputNodes[t.id];if(!n)return;let i=this.#t.get(r);if(i===void 0)return;let o=n.edges[i];if(o)return{flags:o.flags,childNodeId:o.childNodeId,scalarMask:o.scalarMask??0,enumNameIndex:o.enumNameIndex}}outputEdge(t,r){if(!t)return;let n=this.#e.outputNodes[t.id];if(!n)return;let i=this.#t.get(r);if(i===void 0)return;let o=n.edges[i];if(o)return{argsNodeId:o.argsNodeId,outputNodeId:o.outputNodeId}}enumValues(t){if(t?.enumNameIndex===void 0)return;let r=this.#e.strings[t.enumNameIndex];if(r)return this.#r(r)}getString(t){return this.#e.strings[t]}},Z={ParamScalar:1,ParamEnum:2,ParamListScalar:4,ParamListEnum:8,ListObject:16,Object:32},O={String:1,Int:2,BigInt:4,Float:8,Decimal:16,Boolean:32,DateTime:64,Json:128,Bytes:256};function Y(e,t){return(e.flags&t)!==0}function pe(e){return e.scalarMask}var Ir="7.5.0-dev.8";var xa={bigint:"bigint",date:"datetime",decimal:"decimal",bytes:"bytes"};function Pa(e){let t;try{t=JSON.parse(e)}catch(i){throw new Error(`Received invalid serialized parameters: ${i.message}`)}if(!Array.isArray(t))throw new Error("Received invalid serialized parameters: expected an array");let r=t.map(i=>Ta(i)),n=t.map(i=>Bd(i));return{args:r,argTypes:n}}function Ta(e){if(Array.isArray(e))return e.map(t=>Ta(t));if(typeof e=="object"&&e!==null&&"prisma__value"in e){if(!("prisma__type"in e))throw new Error("Invalid serialized parameter, prisma__type should be present when prisma__value is present");return`${e.prisma__value}`}return typeof e=="object"&&e!==null?JSON.stringify(e):e}function Bd(e){return Array.isArray(e)?{scalarType:e.length>0?Ea(e[0]):"unknown",arity:"list"}:{scalarType:Ea(e),arity:"scalar"}}function Ea(e){return typeof e=="object"&&e!==null&&"prisma__type"in e&&typeof e.prisma__type=="string"&&e.prisma__type in xa?xa[e.prisma__type]:typeof e=="number"?"decimal":typeof e=="string"?"string":"unknown"}function Sa(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Aa(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function va(e){return e.split(`
|
|
19
19
|
`).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(`
|
|
20
|
-
`)}var
|
|
20
|
+
`)}var Ca=de(qi());function Ra({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,Ca.default)({user:t,repo:r,template:n,title:e,body:i})}function ka({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=Ri(6e3-(s?.length??0)),l=va(Ae(a)),u=n?`# Description
|
|
21
21
|
\`\`\`
|
|
22
22
|
${n}
|
|
23
23
|
\`\`\``:"",c=Ae(`Hi Prisma Team! My Prisma Client just crashed. This is the report:
|
|
@@ -50,9 +50,9 @@ ${l}
|
|
|
50
50
|
|
|
51
51
|
## Prisma Engine Query
|
|
52
52
|
\`\`\`
|
|
53
|
-
${s?
|
|
53
|
+
${s?Aa(s):""}
|
|
54
54
|
\`\`\`
|
|
55
|
-
`),p=
|
|
55
|
+
`),p=Ra({title:r,body:c});return`${r}
|
|
56
56
|
|
|
57
57
|
This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.
|
|
58
58
|
|
|
@@ -61,26 +61,26 @@ ${Xe(p)}
|
|
|
61
61
|
If you want the Prisma team to look into it, please open the link above \u{1F64F}
|
|
62
62
|
To increase the chance of success, please post your schema and a snippet of
|
|
63
63
|
how you used Prisma Client in the issue.
|
|
64
|
-
`}var Or=class e{#e;#t;#r;#n;#i;constructor(t,r,n){this.#e=t,this.#t=r,this.#r=n,this.#n=r.getConnectionInfo?.(),this.#i=Ct.forSql({onQuery:this.#e.onQuery,tracingHelper:this.#e.tracingHelper,provider:this.#e.provider,connectionInfo:this.#n})}static async connect(t){let r,n;try{r=await t.driverAdapterFactory.connect(),n=new kt({driverAdapter:r,transactionOptions:t.transactionOptions,tracingHelper:t.tracingHelper,onQuery:t.onQuery,provider:t.provider})}catch(i){throw await r?.dispose(),i}return new e(t,r,n)}getConnectionInfo(){let t=this.#n??{supportsRelationJoins:!1};return Promise.resolve({provider:this.#t.provider,connectionInfo:t})}async execute({plan:t,placeholderValues:r,transaction:n,batchIndex:i,queryInfo:o}){let s=n?await this.#r.getTransaction(n,i!==void 0?"batch query":"query"):this.#t;return await this.#i.run(t,{queryable:s,transactionManager:n?{enabled:!1}:{enabled:!0,manager:this.#r},scope:r,sqlCommenter:this.#e.sqlCommenters&&{plugins:this.#e.sqlCommenters,queryInfo:o}})}async startTransaction(t){return{...await this.#r.startTransaction(t),payload:void 0}}async commitTransaction(t){await this.#r.commitTransaction(t.id)}async rollbackTransaction(t){await this.#r.rollbackTransaction(t.id)}async disconnect(){try{await this.#r.cancelAllTransactions()}finally{await this.#t.dispose()}}apiKey(){return null}};var Qd=new Set(["DateTime","Decimal","BigInt","Bytes","Json","Raw"]);function Nr(e){if(e==null)return{kind:"null"};if(typeof e=="string")return{kind:"primitive",value:e};if(typeof e=="number")return{kind:"primitive",value:e};if(typeof e=="boolean")return{kind:"primitive",value:e};if(Array.isArray(e))return{kind:"array",items:e};if(typeof e=="object"){let t=e;if("$type"in t&&typeof t.$type=="string"){let r=t.$type;return Qd.has(r)?{kind:"taggedScalar",tag:r,value:t.value}:{kind:"structural",value:t.value}}return{kind:"object",entries:t}}return{kind:"structural",value:e}}function ka(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("$type"in e)}function Ia(e){return typeof e=="object"&&e!==null&&"$type"in e&&typeof e.$type=="string"}function Na(e,t){let r=new Dr(t),n=e.modelName?`${e.modelName}.${e.action}`:e.action,i=t.root(n);return{parameterizedQuery:{...e,query:r.parameterizeFieldSelection(e.query,i?.argsNodeId,i?.outputNodeId)},placeholderValues:r.getPlaceholderValues()}}function Da(e,t){let r=new Dr(t),n=[];for(let i=0;i<e.batch.length;i++){let o=e.batch[i],s=o.modelName?`${o.modelName}.${o.action}`:o.action,a=t.root(s);n.push({...o,query:r.parameterizeFieldSelection(o.query,a?.argsNodeId,a?.outputNodeId)})}return{parameterizedBatch:{...e,batch:n},placeholderValues:r.getPlaceholderValues()}}var Dr=class{#e;#t=new Map;#r=new Map;#n=1;constructor(t){this.#e=t}getPlaceholderValues(){return Object.fromEntries(this.#t)}#i(t,r){let n=Hd(t,r),i=this.#r.get(n);if(i!==void 0)return Oa(i,r);let o=`%${this.#n++}`;return this.#r.set(n,o),this.#t.set(o,t),Oa(o,r)}parameterizeFieldSelection(t,r,n){let i=this.#e.inputNode(r),o=this.#e.outputNode(n),s={...t};return t.arguments&&t.arguments.$type!=="Raw"&&(s.arguments=this.#o(t.arguments,i)),t.selection&&(s.selection=this.#c(t.selection,o)),s}#o(t,r){if(!r)return t;let n={};for(let[i,o]of Object.entries(t)){let s=this.#e.inputEdge(r,i);s?n[i]=this.#a(o,s):n[i]=o}return n}#a(t,r){let n=Nr(t);switch(n.kind){case"null":return t;case"structural":return t;case"primitive":return this.#s(n.value,r);case"taggedScalar":return this.#u(t,n.tag,r);case"array":return this.#l(n.items,t,r);case"object":return this.#p(n.entries,r);default:throw new Error(`Unknown value kind ${n.kind}`)}}#s(t,r){if(Z(r,K.ParamEnum)&&r.enumNameIndex!==void 0&&typeof t=="string"&&this.#e.enumValues(r)?.includes(t)){let s={type:"Enum"};return this.#i(t,s)}if(!Z(r,K.ParamScalar))return t;let n=ce(r);if(n===0)return t;let i=Zn(t);return Fa(i,n)?(n&O.Json&&(t=JSON.stringify(t)),this.#i(t,i)):t}#u(t,r,n){if(!Z(n,K.ParamScalar))return t;let i=ce(n);if(i===0||!La(r,i))return t;let o=_a(t.$type),s=$a(t);return this.#i(s,o)}#l(t,r,n){if(Z(n,K.ParamScalar)&&ce(n)&O.Json){let i=JSON.stringify(t),o={type:"Json"};return this.#i(i,o)}if(Z(n,K.ParamEnum)){let i=this.#e.enumValues(n);if(i&&t.every(o=>typeof o=="string"&&i.includes(o))){let o={type:"List",inner:{type:"Enum"}};return this.#i(t,o)}}if(Z(n,K.ParamListScalar)&&t.every(o=>Zd(o,n))&&t.length>0){let o=t.map(l=>Yd(l)),a={type:"List",inner:Wd(t)};return this.#i(o,a)}if(Z(n,K.ListObject)){let i=this.#e.inputNode(n.childNodeId);if(i)return t.map(o=>ka(o)?this.#o(o,i):o)}return r}#p(t,r){if(Z(r,K.Object)){let i=this.#e.inputNode(r.childNodeId);if(i)return this.#o(t,i)}if(ce(r)&O.Json){let i=JSON.stringify(t),o={type:"Json"};return this.#i(i,o)}return t}#c(t,r){if(!t||!r)return t;let n={};for(let[i,o]of Object.entries(t)){if(i==="$scalars"||i==="$composites"||typeof o=="boolean"){n[i]=o;continue}let s=this.#e.outputEdge(r,i);if(s){let a=o,l=this.#e.inputNode(s.argsNodeId),u=this.#e.outputNode(s.outputNodeId),c={selection:a.selection?this.#c(a.selection,u):{}};a.arguments&&(c.arguments=this.#o(a.arguments,l)),n[i]=c}else n[i]=o}return n}};function Oa(e,t){return{$type:"Param",value:{name:e,...t}}}function Ma(e){return e.type==="List"?`List<${Ma(e.inner)}>`:e.type}function Jd(e){return ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"):JSON.stringify(e)}function Hd(e,t){let r=Ma(t),n=Jd(e);return`${r}:${n}`}var Gd=2**31-1,zd=-(2**31);function Zn(e){switch(typeof e){case"boolean":return{type:"Boolean"};case"number":return Number.isInteger(e)?zd<=e&&e<=Gd?{type:"Int"}:{type:"BigInt"}:{type:"Float"};case"string":return{type:"String"};default:throw new Error("unreachable")}}function Fa({type:e},t){switch(e){case"Boolean":return(t&O.Boolean)!==0;case"Int":return(t&(O.Int|O.BigInt|O.Float))!==0;case"BigInt":return(t&O.BigInt)!==0;case"Float":return(t&O.Float)!==0;case"String":return(t&O.String)!==0;default:return!1}}function _a(e){switch(e){case"BigInt":case"Bytes":case"DateTime":case"Json":return{type:e};case"Decimal":return{type:"Float"};default:return}}function Wd(e){let t={type:"Any"};for(let r of e){let n=Nr(r),i;switch(n.kind){case"primitive":i=Zn(n.value);break;case"taggedScalar":i=_a(n.tag)??{type:"Any"};break;default:return{type:"Any"}}t=Kd(t,i)}return t}function Kd(e,t){if(e.type==="Any")return t;if(t.type==="Any"||e.type===t.type)return e;let r={Int:0,BigInt:1,Float:2},n=r[e.type],i=r[t.type];return n!==void 0&&i!==void 0?n>=i?e:t:{type:"Any"}}function La(e,t){switch(e){case"DateTime":return(t&O.DateTime)!==0;case"Decimal":return(t&O.Decimal)!==0;case"BigInt":return(t&O.BigInt)!==0;case"Bytes":return(t&O.Bytes)!==0;case"Json":return(t&O.Json)!==0;default:return!1}}function Zd(e,t){let r=Nr(e);switch(r.kind){case"structural":return!1;case"null":return!1;case"primitive":{let n=Zn(r.value),i=ce(t);return i!==0&&Fa(n,i)}case"taggedScalar":{let n=ce(t);return n!==0&&La(r.tag,n)}default:return!1}}function Yd(e){return Ia(e)?$a(e):e}function $a(e){return e.value}var Mr=class{#e;#t;#r;constructor(t=1e3){this.#e=new Map,this.#t=new Map,this.#r=t}getSingle(t){let r=this.#e.get(t);return r&&(this.#e.delete(t),this.#e.set(t,r)),r}setSingle(t,r){if(this.#e.has(t)){this.#e.delete(t),this.#e.set(t,r);return}if(this.#e.size>=this.#r){let n=this.#e.keys().next().value;n!==void 0&&this.#e.delete(n)}this.#e.set(t,r)}getBatch(t){let r=this.#t.get(t);return r&&(this.#t.delete(t),this.#t.set(t,r)),r}setBatch(t,r){if(this.#t.has(t)){this.#t.delete(t),this.#t.set(t,r);return}if(this.#t.size>=this.#r){let n=this.#t.keys().next().value;n!==void 0&&this.#t.delete(n)}this.#t.set(t,r)}clear(){this.#e.clear(),this.#t.clear()}get size(){return this.#e.size+this.#t.size}get singleCacheSize(){return this.#e.size}get batchCacheSize(){return this.#t.size}};import{PrismaClientKnownRequestError as rm}from"@prisma/client-runtime-utils";var Fr=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function Va(e,t,r){let n=r||{},i=n.encode||encodeURIComponent;if(typeof i!="function")throw new TypeError("option encode is invalid");if(!Fr.test(e))throw new TypeError("argument name is invalid");let o=i(t);if(o&&!Fr.test(o))throw new TypeError("argument val is invalid");let s=e+"="+o;if(n.maxAge!==void 0&&n.maxAge!==null){let a=n.maxAge-0;if(Number.isNaN(a)||!Number.isFinite(a))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(a)}if(n.domain){if(!Fr.test(n.domain))throw new TypeError("option domain is invalid");s+="; Domain="+n.domain}if(n.path){if(!Fr.test(n.path))throw new TypeError("option path is invalid");s+="; Path="+n.path}if(n.expires){if(!Xd(n.expires)||Number.isNaN(n.expires.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():n.priority){case"low":{s+="; Priority=Low";break}case"medium":{s+="; Priority=Medium";break}case"high":{s+="; Priority=High";break}default:throw new TypeError("option priority is invalid")}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:{s+="; SameSite=Strict";break}case"lax":{s+="; SameSite=Lax";break}case"strict":{s+="; SameSite=Strict";break}case"none":{s+="; SameSite=None";break}default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(s+="; Partitioned"),s}function Xd(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}function qa(e,t){let r=(e||"").split(";").filter(l=>typeof l=="string"&&!!l.trim()),n=r.shift()||"",i=em(n),o=i.name,s=i.value;try{s=t?.decode===!1?s:(t?.decode||decodeURIComponent)(s)}catch{}let a={name:o,value:s};for(let l of r){let u=l.split("="),c=(u.shift()||"").trimStart().toLowerCase(),p=u.join("=");switch(c){case"expires":{a.expires=new Date(p);break}case"max-age":{a.maxAge=Number.parseInt(p,10);break}case"secure":{a.secure=!0;break}case"httponly":{a.httpOnly=!0;break}case"samesite":{a.sameSite=p;break}default:a[c]=p}}return a}function em(e){let t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}var _r=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var Lr=class extends _r{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function ja(e,t){return{...e,isRetryable:t}}var Ee=class extends Lr{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,ja(r,!1))}};at(Ee,"InvalidDatasourceError");function Ua(e){let t={clientVersion:e.clientVersion},r;try{r=new URL(e.accelerateUrl)}catch(l){let u=l.message;throw new Ee(`Error validating \`accelerateUrl\`, the URL cannot be parsed, reason: ${u}`,t)}let{protocol:n,searchParams:i}=r;if(n!=="prisma:"&&n!==Vt)throw new Ee("Error validating `accelerateUrl`: the URL must start with the protocol `prisma://` or `prisma+postgres://`",t);let o=i.get("api_key");if(o===null||o.length<1)throw new Ee("Error validating `accelerateUrl`: the URL must contain a valid API key",t);let s=Wr(r)?"http:":"https:";process.env.TEST_CLIENT_ENGINE_REMOTE_EXECUTOR&&r.searchParams.has("use_http")&&(s="http:");let a=new URL(r.href.replace(n,s));return{apiKey:o,url:a}}var Ba=pe(Ii()),$r=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,transactionId:r}={}){let n={Accept:"application/json",Authorization:`Bearer ${this.apiKey}`,"Content-Type":"application/json","Prisma-Engine-Hash":this.engineHash,"Prisma-Engine-Version":Ba.enginesVersion};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-Transaction-Id"]=r);let i=this.#e();return i.length>0&&(n["X-Capture-Telemetry"]=i.join(", ")),n}#e(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}};function tm(e){return e[0]*1e3+e[1]/1e6}function Yn(e){return new Date(tm(e))}var Qa=N("prisma:client:clientEngine:remoteExecutor"),Vr=class{#e;#t;#r;#n;#i;#o;constructor(t){this.#e=t.clientVersion,this.#n=t.logEmitter,this.#i=t.tracingHelper,this.#o=t.sqlCommenters;let{url:r,apiKey:n}=Ua({clientVersion:t.clientVersion,accelerateUrl:t.accelerateUrl});this.#r=new Xn(r),this.#t=new $r({apiKey:n,engineHash:t.clientVersion,logLevel:t.logLevel,logQueries:t.logQueries,tracingHelper:t.tracingHelper})}async getConnectionInfo(){return await this.#a({path:"/connection-info",method:"GET"})}async execute({plan:t,placeholderValues:r,batchIndex:n,model:i,operation:o,transaction:s,customFetch:a,queryInfo:l}){let u=l&&this.#o?.length?dr(this.#o,{query:l}):void 0;return(await this.#a({path:s?`/transaction/${s.id}/query`:"/query",method:"POST",body:{model:i,operation:o,plan:t,params:r,comments:u&&Object.keys(u).length>0?u:void 0},batchRequestIdx:n,fetch:a})).data}async startTransaction(t){return{...await this.#a({path:"/transaction/start",method:"POST",body:t}),payload:void 0}}async commitTransaction(t){await this.#a({path:`/transaction/${t.id}/commit`,method:"POST"})}async rollbackTransaction(t){await this.#a({path:`/transaction/${t.id}/rollback`,method:"POST"})}disconnect(){return Promise.resolve()}apiKey(){return this.#t.apiKey}async#a({path:t,method:r,body:n,fetch:i=globalThis.fetch,batchRequestIdx:o}){let s=await this.#r.request({method:r,path:t,headers:this.#t.build(),body:n,fetch:i});s.ok||await this.#s(s,o);let a=await s.json();return typeof a.extensions=="object"&&a.extensions!==null&&this.#u(a.extensions),a}async#s(t,r){let n=t.headers.get("Prisma-Error-Code"),i=await t.text(),o,s=i;try{o=JSON.parse(i)}catch{o={}}typeof o.code=="string"&&(n=o.code),typeof o.error=="string"?s=o.error:typeof o.message=="string"?s=o.message:typeof o.InvalidRequestError=="object"&&o.InvalidRequestError!==null&&typeof o.InvalidRequestError.reason=="string"&&(s=o.InvalidRequestError.reason),s=s||`HTTP ${t.status}: ${t.statusText}`;let a=typeof o.meta=="object"&&o.meta!==null?o.meta:o;throw new rm(s,{clientVersion:this.#e,code:n??"P6000",batchRequestIdx:r,meta:a})}#u(t){if(t.logs)for(let r of t.logs)this.#l(r);t.spans&&this.#i.dispatchEngineSpans(t.spans)}#l(t){switch(t.level){case"debug":case"trace":Qa(t);break;case"error":case"warn":case"info":{this.#n.emit(t.level,{timestamp:Yn(t.timestamp),message:t.attributes.message??"",target:t.target??"RemoteExecutor"});break}case"query":{this.#n.emit("query",{query:t.attributes.query??"",timestamp:Yn(t.timestamp),duration:t.attributes.duration_ms??0,params:t.attributes.params??"",target:t.target??"RemoteExecutor"});break}default:throw new Error(`Unexpected log level: ${t.level}`)}}},Xn=class{#e;#t;#r;constructor(t){this.#e=t,this.#t=new Map}async request({method:t,path:r,headers:n,body:i,fetch:o}){let s=new URL(r,this.#e),a=this.#n(s);a&&(n.Cookie=a),this.#r&&(n["Accelerate-Query-Engine-Jwt"]=this.#r);let l=await o(s.href,{method:t,body:i!==void 0?JSON.stringify(i):void 0,headers:n});return Qa(t,s,l.status,l.statusText),this.#r=l.headers.get("Accelerate-Query-Engine-Jwt")??void 0,this.#i(s,l),l}#n(t){let r=[],n=new Date;for(let[i,o]of this.#t){if(o.expires&&o.expires<n){this.#t.delete(i);continue}let s=o.domain??t.hostname,a=o.path??"/";t.hostname.endsWith(s)&&t.pathname.startsWith(a)&&r.push(Va(o.name,o.value))}return r.length>0?r.join("; "):void 0}#i(t,r){let n=r.headers.getSetCookie?.()||[];if(n.length===0){let i=r.headers.get("Set-Cookie");i&&n.push(i)}for(let i of n){let o=qa(i),s=o.domain??t.hostname,a=o.path??"/",l=`${s}:${a}:${o.name}`;this.#t.set(l,{name:o.name,value:o.value,domain:s,path:a,expires:o.expires})}}};import{PrismaClientInitializationError as Ja}from"@prisma/client-runtime-utils";var ei={},Ha={async loadQueryCompiler(e){let{clientVersion:t,compilerWasm:r}=e;if(r===void 0)throw new Ja("WASM query compiler was unexpectedly `undefined`",t);let n;return e.activeProvider===void 0||ei[e.activeProvider]===void 0?(n=(async()=>{let i=await r.getRuntime(),o=await r.getQueryCompilerWasmModule();if(o==null)throw new Ja("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let s={[r.importName]:i},a=new WebAssembly.Instance(o,s),l=a.exports.__wbindgen_start;return i.__wbg_set_wasm(a.exports),l(),i.QueryCompiler})(),e.activeProvider!==void 0&&(ei[e.activeProvider]=n)):n=ei[e.activeProvider],await n}};var nm="P2038",re=N("prisma:client:clientEngine"),Za=globalThis;Za.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new Ot(e,Ir)}};var Nt=class{name="ClientEngine";#e;#t={type:"disconnected"};#r;#n;#i;#o;config;datamodel;logEmitter;logQueries;logLevel;tracingHelper;#a;constructor(t,r){if(t.accelerateUrl!==void 0)this.#n={remote:!0,accelerateUrl:t.accelerateUrl};else if(t.adapter)this.#n={remote:!1,driverAdapterFactory:t.adapter},re("Using driver adapter: %O",t.adapter);else throw new ti("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,nm);this.#r=r??Ha,this.config=t,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,this.#i=new Mr,this.#o=It.deserialize(t.parameterizationSchema,n=>{if(Object.hasOwn(t.runtimeDataModel.enums,n))return t.runtimeDataModel.enums[n].values.map(i=>i.name)}),t.enableDebugLogs&&(this.logLevel="debug"),this.logQueries&&(this.#a=n=>{this.logEmitter.emit("query",{...n,params:wt(n.params),target:"ClientEngine"})})}async#s(){switch(this.#t.type){case"disconnected":{let t=this.tracingHelper.runInChildSpan("connect",async()=>{let r,n;try{r=await this.#u(),n=await this.#l(r)}catch(o){throw this.#t={type:"disconnected"},n?.free(),await r?.disconnect(),o}let i={executor:r,queryCompiler:n};return this.#t={type:"connected",engine:i},i});return this.#t={type:"connecting",promise:t},await t}case"connecting":return await this.#t.promise;case"connected":return this.#t.engine;case"disconnecting":return await this.#t.promise,await this.#s()}}async#u(){return this.#n.remote?new Vr({clientVersion:this.config.clientVersion,accelerateUrl:this.#n.accelerateUrl,logEmitter:this.logEmitter,logLevel:this.logLevel,logQueries:this.logQueries,tracingHelper:this.tracingHelper,sqlCommenters:this.config.sqlCommenters}):await Or.connect({driverAdapterFactory:this.#n.driverAdapterFactory,tracingHelper:this.tracingHelper,transactionOptions:{...this.config.transactionOptions,isolationLevel:this.#g(this.config.transactionOptions.isolationLevel)},onQuery:this.#a,provider:this.config.activeProvider,sqlCommenters:this.config.sqlCommenters})}async#l(t){let r=this.#e;r===void 0&&(r=await this.#r.loadQueryCompiler(this.config),this.#e=r);let{provider:n,connectionInfo:i}=await t.getConnectionInfo();try{return this.#m(()=>new r({datamodel:this.datamodel,provider:n,connectionInfo:i}),void 0,!1)}catch(o){throw this.#p(o)}}#p(t){if(t instanceof Ot)return t;try{let r=JSON.parse(t.message);return new ti(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#c(t,r){if(t instanceof ti)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new Ot(za(this,t.message,r),this.config.clientVersion);if(t instanceof k)return new ri(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let n=JSON.parse(t);return new Ga(`${n.message}
|
|
65
|
-
${n.backtrace}`,{clientVersion:this.config.clientVersion})}catch{return t}}#d(t){return t instanceof Ot?t:typeof t.message=="string"&&typeof t.code=="string"?new ri(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion}):typeof t.message=="string"?new
|
|
64
|
+
`}var Or=class e{#e;#t;#r;#n;#i;constructor(t,r,n){this.#e=t,this.#t=r,this.#r=n,this.#n=r.getConnectionInfo?.(),this.#i=Ct.forSql({onQuery:this.#e.onQuery,tracingHelper:this.#e.tracingHelper,provider:this.#e.provider,connectionInfo:this.#n})}static async connect(t){let r,n;try{r=await t.driverAdapterFactory.connect(),n=new kt({driverAdapter:r,transactionOptions:t.transactionOptions,tracingHelper:t.tracingHelper,onQuery:t.onQuery,provider:t.provider})}catch(i){throw await r?.dispose(),i}return new e(t,r,n)}getConnectionInfo(){let t=this.#n??{supportsRelationJoins:!1};return Promise.resolve({provider:this.#t.provider,connectionInfo:t})}async execute({plan:t,placeholderValues:r,transaction:n,batchIndex:i,queryInfo:o}){let s=n?await this.#r.getTransaction(n,i!==void 0?"batch query":"query"):this.#t;return await this.#i.run(t,{queryable:s,transactionManager:n?{enabled:!1}:{enabled:!0,manager:this.#r},scope:r,sqlCommenter:this.#e.sqlCommenters&&{plugins:this.#e.sqlCommenters,queryInfo:o}})}async startTransaction(t){return{...await this.#r.startTransaction(t),payload:void 0}}async commitTransaction(t){await this.#r.commitTransaction(t.id)}async rollbackTransaction(t){await this.#r.rollbackTransaction(t.id)}async disconnect(){try{await this.#r.cancelAllTransactions()}finally{await this.#t.dispose()}}apiKey(){return null}};var Qd=new Set(["DateTime","Decimal","BigInt","Bytes","Json","Raw"]);function Nr(e){if(e==null)return{kind:"null"};if(typeof e=="string")return{kind:"primitive",value:e};if(typeof e=="number")return{kind:"primitive",value:e};if(typeof e=="boolean")return{kind:"primitive",value:e};if(Array.isArray(e))return{kind:"array",items:e};if(typeof e=="object"){let t=e;if("$type"in t&&typeof t.$type=="string"){let r=t.$type;return Qd.has(r)?{kind:"taggedScalar",tag:r,value:t.value}:{kind:"structural",value:t.value}}return{kind:"object",entries:t}}return{kind:"structural",value:e}}function Ia(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("$type"in e)}function Oa(e){return typeof e=="object"&&e!==null&&"$type"in e&&typeof e.$type=="string"}function Da(e,t){let r=new Dr(t),n=e.modelName?`${e.modelName}.${e.action}`:e.action,i=t.root(n);return{parameterizedQuery:{...e,query:r.parameterizeFieldSelection(e.query,i?.argsNodeId,i?.outputNodeId)},placeholderValues:r.getPlaceholderValues()}}function Fa(e,t){let r=new Dr(t),n=[];for(let i=0;i<e.batch.length;i++){let o=e.batch[i],s=o.modelName?`${o.modelName}.${o.action}`:o.action,a=t.root(s);n.push({...o,query:r.parameterizeFieldSelection(o.query,a?.argsNodeId,a?.outputNodeId)})}return{parameterizedBatch:{...e,batch:n},placeholderValues:r.getPlaceholderValues()}}var Dr=class{#e;#t=new Map;#r=new Map;#n=1;constructor(t){this.#e=t}getPlaceholderValues(){return Object.fromEntries(this.#t)}#i(t,r){let n=Hd(t,r),i=this.#r.get(n);if(i!==void 0)return Na(i,r);let o=`%${this.#n++}`;return this.#r.set(n,o),this.#t.set(o,t),Na(o,r)}parameterizeFieldSelection(t,r,n){let i=this.#e.inputNode(r),o=this.#e.outputNode(n),s={...t};return t.arguments&&t.arguments.$type!=="Raw"&&(s.arguments=this.#o(t.arguments,i)),t.selection&&(s.selection=this.#c(t.selection,o)),s}#o(t,r){if(!r)return t;let n={};for(let[i,o]of Object.entries(t)){let s=this.#e.inputEdge(r,i);s?n[i]=this.#a(o,s):n[i]=o}return n}#a(t,r){let n=Nr(t);switch(n.kind){case"null":return t;case"structural":return t;case"primitive":return this.#s(n.value,r);case"taggedScalar":return this.#u(t,n.tag,r);case"array":return this.#l(n.items,t,r);case"object":return this.#p(n.entries,r);default:throw new Error(`Unknown value kind ${n.kind}`)}}#s(t,r){if(Y(r,Z.ParamEnum)&&r.enumNameIndex!==void 0&&typeof t=="string"&&this.#e.enumValues(r)?.includes(t)){let s={type:"Enum"};return this.#i(t,s)}if(!Y(r,Z.ParamScalar))return t;let n=pe(r);if(n===0)return t;let i=Zn(t);return _a(i,n)?(n&O.Json&&(t=JSON.stringify(t)),this.#i(t,i)):t}#u(t,r,n){if(!Y(n,Z.ParamScalar))return t;let i=pe(n);if(i===0||!$a(r,i))return t;let o=La(t.$type),s=Va(t);return this.#i(s,o)}#l(t,r,n){if(Y(n,Z.ParamScalar)&&pe(n)&O.Json){let i=JSON.stringify(z(t)),o={type:"Json"};return this.#i(i,o)}if(Y(n,Z.ParamEnum)){let i=this.#e.enumValues(n);if(i&&t.every(o=>typeof o=="string"&&i.includes(o))){let o={type:"List",inner:{type:"Enum"}};return this.#i(t,o)}}if(Y(n,Z.ParamListScalar)&&t.every(o=>Zd(o,n))&&t.length>0){let o=t.map(l=>Yd(l)),a={type:"List",inner:Wd(t)};return this.#i(o,a)}if(Y(n,Z.ListObject)){let i=this.#e.inputNode(n.childNodeId);if(i)return t.map(o=>Ia(o)?this.#o(o,i):o)}return r}#p(t,r){if(Y(r,Z.Object)){let i=this.#e.inputNode(r.childNodeId);if(i)return this.#o(t,i)}if(pe(r)&O.Json){let i=JSON.stringify(z(t)),o={type:"Json"};return this.#i(i,o)}return t}#c(t,r){if(!t||!r)return t;let n={};for(let[i,o]of Object.entries(t)){if(i==="$scalars"||i==="$composites"||typeof o=="boolean"){n[i]=o;continue}let s=this.#e.outputEdge(r,i);if(s){let a=o,l=this.#e.inputNode(s.argsNodeId),u=this.#e.outputNode(s.outputNodeId),c={selection:a.selection?this.#c(a.selection,u):{}};a.arguments&&(c.arguments=this.#o(a.arguments,l)),n[i]=c}else n[i]=o}return n}};function Na(e,t){return{$type:"Param",value:{name:e,...t}}}function Ma(e){return e.type==="List"?`List<${Ma(e.inner)}>`:e.type}function Jd(e){return ArrayBuffer.isView(e)?Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"):JSON.stringify(e)}function Hd(e,t){let r=Ma(t),n=Jd(e);return`${r}:${n}`}var Gd=2**31-1,zd=-(2**31);function Zn(e){switch(typeof e){case"boolean":return{type:"Boolean"};case"number":return Number.isInteger(e)?zd<=e&&e<=Gd?{type:"Int"}:{type:"BigInt"}:{type:"Float"};case"string":return{type:"String"};default:throw new Error("unreachable")}}function _a({type:e},t){switch(e){case"Boolean":return(t&O.Boolean)!==0;case"Int":return(t&(O.Int|O.BigInt|O.Float))!==0;case"BigInt":return(t&O.BigInt)!==0;case"Float":return(t&O.Float)!==0;case"String":return(t&O.String)!==0;default:return!1}}function La(e){switch(e){case"BigInt":case"Bytes":case"DateTime":case"Json":return{type:e};case"Decimal":return{type:"Float"};default:return}}function Wd(e){let t={type:"Any"};for(let r of e){let n=Nr(r),i;switch(n.kind){case"primitive":i=Zn(n.value);break;case"taggedScalar":i=La(n.tag)??{type:"Any"};break;default:return{type:"Any"}}t=Kd(t,i)}return t}function Kd(e,t){if(e.type==="Any")return t;if(t.type==="Any"||e.type===t.type)return e;let r={Int:0,BigInt:1,Float:2},n=r[e.type],i=r[t.type];return n!==void 0&&i!==void 0?n>=i?e:t:{type:"Any"}}function $a(e,t){switch(e){case"DateTime":return(t&O.DateTime)!==0;case"Decimal":return(t&O.Decimal)!==0;case"BigInt":return(t&O.BigInt)!==0;case"Bytes":return(t&O.Bytes)!==0;case"Json":return(t&O.Json)!==0;default:return!1}}function Zd(e,t){let r=Nr(e);switch(r.kind){case"structural":return!1;case"null":return!1;case"primitive":{let n=Zn(r.value),i=pe(t);return i!==0&&_a(n,i)}case"taggedScalar":{let n=pe(t);return n!==0&&$a(r.tag,n)}default:return!1}}function Yd(e){return Oa(e)?Va(e):e}function Va(e){return e.value}var Fr=class{#e;#t;#r;constructor(t=1e3){this.#e=new Map,this.#t=new Map,this.#r=t}getSingle(t){let r=this.#e.get(t);return r&&(this.#e.delete(t),this.#e.set(t,r)),r}setSingle(t,r){if(this.#e.has(t)){this.#e.delete(t),this.#e.set(t,r);return}if(this.#e.size>=this.#r){let n=this.#e.keys().next().value;n!==void 0&&this.#e.delete(n)}this.#e.set(t,r)}getBatch(t){let r=this.#t.get(t);return r&&(this.#t.delete(t),this.#t.set(t,r)),r}setBatch(t,r){if(this.#t.has(t)){this.#t.delete(t),this.#t.set(t,r);return}if(this.#t.size>=this.#r){let n=this.#t.keys().next().value;n!==void 0&&this.#t.delete(n)}this.#t.set(t,r)}clear(){this.#e.clear(),this.#t.clear()}get size(){return this.#e.size+this.#t.size}get singleCacheSize(){return this.#e.size}get batchCacheSize(){return this.#t.size}};import{PrismaClientKnownRequestError as rm}from"@prisma/client-runtime-utils";var Mr=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function qa(e,t,r){let n=r||{},i=n.encode||encodeURIComponent;if(typeof i!="function")throw new TypeError("option encode is invalid");if(!Mr.test(e))throw new TypeError("argument name is invalid");let o=i(t);if(o&&!Mr.test(o))throw new TypeError("argument val is invalid");let s=e+"="+o;if(n.maxAge!==void 0&&n.maxAge!==null){let a=n.maxAge-0;if(Number.isNaN(a)||!Number.isFinite(a))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+Math.floor(a)}if(n.domain){if(!Mr.test(n.domain))throw new TypeError("option domain is invalid");s+="; Domain="+n.domain}if(n.path){if(!Mr.test(n.path))throw new TypeError("option path is invalid");s+="; Path="+n.path}if(n.expires){if(!Xd(n.expires)||Number.isNaN(n.expires.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+n.expires.toUTCString()}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.priority)switch(typeof n.priority=="string"?n.priority.toLowerCase():n.priority){case"low":{s+="; Priority=Low";break}case"medium":{s+="; Priority=Medium";break}case"high":{s+="; Priority=High";break}default:throw new TypeError("option priority is invalid")}if(n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:{s+="; SameSite=Strict";break}case"lax":{s+="; SameSite=Lax";break}case"strict":{s+="; SameSite=Strict";break}case"none":{s+="; SameSite=None";break}default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(s+="; Partitioned"),s}function Xd(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}function ja(e,t){let r=(e||"").split(";").filter(l=>typeof l=="string"&&!!l.trim()),n=r.shift()||"",i=em(n),o=i.name,s=i.value;try{s=t?.decode===!1?s:(t?.decode||decodeURIComponent)(s)}catch{}let a={name:o,value:s};for(let l of r){let u=l.split("="),c=(u.shift()||"").trimStart().toLowerCase(),p=u.join("=");switch(c){case"expires":{a.expires=new Date(p);break}case"max-age":{a.maxAge=Number.parseInt(p,10);break}case"secure":{a.secure=!0;break}case"httponly":{a.httpOnly=!0;break}case"samesite":{a.sameSite=p;break}default:a[c]=p}}return a}function em(e){let t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}var _r=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var Lr=class extends _r{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function Ua(e,t){return{...e,isRetryable:t}}var Ee=class extends Lr{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,Ua(r,!1))}};at(Ee,"InvalidDatasourceError");function Ba(e){let t={clientVersion:e.clientVersion},r;try{r=new URL(e.accelerateUrl)}catch(l){let u=l.message;throw new Ee(`Error validating \`accelerateUrl\`, the URL cannot be parsed, reason: ${u}`,t)}let{protocol:n,searchParams:i}=r;if(n!=="prisma:"&&n!==Vt)throw new Ee("Error validating `accelerateUrl`: the URL must start with the protocol `prisma://` or `prisma+postgres://`",t);let o=i.get("api_key");if(o===null||o.length<1)throw new Ee("Error validating `accelerateUrl`: the URL must contain a valid API key",t);let s=Wr(r)?"http:":"https:";process.env.TEST_CLIENT_ENGINE_REMOTE_EXECUTOR&&r.searchParams.has("use_http")&&(s="http:");let a=new URL(r.href.replace(n,s));return{apiKey:o,url:a}}var Qa=de(Oi()),$r=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,transactionId:r}={}){let n={Accept:"application/json",Authorization:`Bearer ${this.apiKey}`,"Content-Type":"application/json","Prisma-Engine-Hash":this.engineHash,"Prisma-Engine-Version":Qa.enginesVersion};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-Transaction-Id"]=r);let i=this.#e();return i.length>0&&(n["X-Capture-Telemetry"]=i.join(", ")),n}#e(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}};function tm(e){return e[0]*1e3+e[1]/1e6}function Yn(e){return new Date(tm(e))}var Ja=N("prisma:client:clientEngine:remoteExecutor"),Vr=class{#e;#t;#r;#n;#i;#o;constructor(t){this.#e=t.clientVersion,this.#n=t.logEmitter,this.#i=t.tracingHelper,this.#o=t.sqlCommenters;let{url:r,apiKey:n}=Ba({clientVersion:t.clientVersion,accelerateUrl:t.accelerateUrl});this.#r=new Xn(r),this.#t=new $r({apiKey:n,engineHash:t.clientVersion,logLevel:t.logLevel,logQueries:t.logQueries,tracingHelper:t.tracingHelper})}async getConnectionInfo(){return await this.#a({path:"/connection-info",method:"GET"})}async execute({plan:t,placeholderValues:r,batchIndex:n,model:i,operation:o,transaction:s,customFetch:a,queryInfo:l}){let u=l&&this.#o?.length?dr(this.#o,{query:l}):void 0;return(await this.#a({path:s?`/transaction/${s.id}/query`:"/query",method:"POST",body:{model:i,operation:o,plan:t,params:r,comments:u&&Object.keys(u).length>0?u:void 0},batchRequestIdx:n,fetch:a})).data}async startTransaction(t){return{...await this.#a({path:"/transaction/start",method:"POST",body:t}),payload:void 0}}async commitTransaction(t){await this.#a({path:`/transaction/${t.id}/commit`,method:"POST"})}async rollbackTransaction(t){await this.#a({path:`/transaction/${t.id}/rollback`,method:"POST"})}disconnect(){return Promise.resolve()}apiKey(){return this.#t.apiKey}async#a({path:t,method:r,body:n,fetch:i=globalThis.fetch,batchRequestIdx:o}){let s=await this.#r.request({method:r,path:t,headers:this.#t.build(),body:n,fetch:i});s.ok||await this.#s(s,o);let a=await s.json();return typeof a.extensions=="object"&&a.extensions!==null&&this.#u(a.extensions),a}async#s(t,r){let n=t.headers.get("Prisma-Error-Code"),i=await t.text(),o,s=i;try{o=JSON.parse(i)}catch{o={}}typeof o.code=="string"&&(n=o.code),typeof o.error=="string"?s=o.error:typeof o.message=="string"?s=o.message:typeof o.InvalidRequestError=="object"&&o.InvalidRequestError!==null&&typeof o.InvalidRequestError.reason=="string"&&(s=o.InvalidRequestError.reason),s=s||`HTTP ${t.status}: ${t.statusText}`;let a=typeof o.meta=="object"&&o.meta!==null?o.meta:o;throw new rm(s,{clientVersion:this.#e,code:n??"P6000",batchRequestIdx:r,meta:a})}#u(t){if(t.logs)for(let r of t.logs)this.#l(r);t.spans&&this.#i.dispatchEngineSpans(t.spans)}#l(t){switch(t.level){case"debug":case"trace":Ja(t);break;case"error":case"warn":case"info":{this.#n.emit(t.level,{timestamp:Yn(t.timestamp),message:t.attributes.message??"",target:t.target??"RemoteExecutor"});break}case"query":{this.#n.emit("query",{query:t.attributes.query??"",timestamp:Yn(t.timestamp),duration:t.attributes.duration_ms??0,params:t.attributes.params??"",target:t.target??"RemoteExecutor"});break}default:throw new Error(`Unexpected log level: ${t.level}`)}}},Xn=class{#e;#t;#r;constructor(t){this.#e=t,this.#t=new Map}async request({method:t,path:r,headers:n,body:i,fetch:o}){let s=new URL(r,this.#e),a=this.#n(s);a&&(n.Cookie=a),this.#r&&(n["Accelerate-Query-Engine-Jwt"]=this.#r);let l=await o(s.href,{method:t,body:i!==void 0?JSON.stringify(i):void 0,headers:n});return Ja(t,s,l.status,l.statusText),this.#r=l.headers.get("Accelerate-Query-Engine-Jwt")??void 0,this.#i(s,l),l}#n(t){let r=[],n=new Date;for(let[i,o]of this.#t){if(o.expires&&o.expires<n){this.#t.delete(i);continue}let s=o.domain??t.hostname,a=o.path??"/";t.hostname.endsWith(s)&&t.pathname.startsWith(a)&&r.push(qa(o.name,o.value))}return r.length>0?r.join("; "):void 0}#i(t,r){let n=r.headers.getSetCookie?.()||[];if(n.length===0){let i=r.headers.get("Set-Cookie");i&&n.push(i)}for(let i of n){let o=ja(i),s=o.domain??t.hostname,a=o.path??"/",l=`${s}:${a}:${o.name}`;this.#t.set(l,{name:o.name,value:o.value,domain:s,path:a,expires:o.expires})}}};import{PrismaClientInitializationError as Ha}from"@prisma/client-runtime-utils";var ei={},Ga={async loadQueryCompiler(e){let{clientVersion:t,compilerWasm:r}=e;if(r===void 0)throw new Ha("WASM query compiler was unexpectedly `undefined`",t);let n;return e.activeProvider===void 0||ei[e.activeProvider]===void 0?(n=(async()=>{let i=await r.getRuntime(),o=await r.getQueryCompilerWasmModule();if(o==null)throw new Ha("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let s={[r.importName]:i},a=new WebAssembly.Instance(o,s),l=a.exports.__wbindgen_start;return i.__wbg_set_wasm(a.exports),l(),i.QueryCompiler})(),e.activeProvider!==void 0&&(ei[e.activeProvider]=n)):n=ei[e.activeProvider],await n}};var nm="P2038",ne=N("prisma:client:clientEngine"),Ya=globalThis;Ya.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new Ot(e,Ir)}};var Nt=class{name="ClientEngine";#e;#t={type:"disconnected"};#r;#n;#i;#o;config;datamodel;logEmitter;logQueries;logLevel;tracingHelper;#a;constructor(t,r){if(t.accelerateUrl!==void 0)this.#n={remote:!0,accelerateUrl:t.accelerateUrl};else if(t.adapter)this.#n={remote:!1,driverAdapterFactory:t.adapter},ne("Using driver adapter: %O",t.adapter);else throw new ti("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,nm);this.#r=r??Ga,this.config=t,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,this.#i=new Fr,this.#o=It.deserialize(t.parameterizationSchema,n=>{if(Object.hasOwn(t.runtimeDataModel.enums,n))return t.runtimeDataModel.enums[n].values.map(i=>i.name)}),t.enableDebugLogs&&(this.logLevel="debug"),this.logQueries&&(this.#a=n=>{this.logEmitter.emit("query",{...n,params:wt(n.params),target:"ClientEngine"})})}async#s(){switch(this.#t.type){case"disconnected":{let t=this.tracingHelper.runInChildSpan("connect",async()=>{let r,n;try{r=await this.#u(),n=await this.#l(r)}catch(o){throw this.#t={type:"disconnected"},n?.free(),await r?.disconnect(),o}let i={executor:r,queryCompiler:n};return this.#t={type:"connected",engine:i},i});return this.#t={type:"connecting",promise:t},await t}case"connecting":return await this.#t.promise;case"connected":return this.#t.engine;case"disconnecting":return await this.#t.promise,await this.#s()}}async#u(){return this.#n.remote?new Vr({clientVersion:this.config.clientVersion,accelerateUrl:this.#n.accelerateUrl,logEmitter:this.logEmitter,logLevel:this.logLevel,logQueries:this.logQueries,tracingHelper:this.tracingHelper,sqlCommenters:this.config.sqlCommenters}):await Or.connect({driverAdapterFactory:this.#n.driverAdapterFactory,tracingHelper:this.tracingHelper,transactionOptions:{...this.config.transactionOptions,isolationLevel:this.#g(this.config.transactionOptions.isolationLevel)},onQuery:this.#a,provider:this.config.activeProvider,sqlCommenters:this.config.sqlCommenters})}async#l(t){let r=this.#e;r===void 0&&(r=await this.#r.loadQueryCompiler(this.config),this.#e=r);let{provider:n,connectionInfo:i}=await t.getConnectionInfo();try{return this.#m(()=>new r({datamodel:this.datamodel,provider:n,connectionInfo:i}),void 0,!1)}catch(o){throw this.#p(o)}}#p(t){if(t instanceof Ot)return t;try{let r=JSON.parse(t.message);return new ti(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#c(t,r){if(t instanceof ti)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new Ot(Wa(this,t.message,r),this.config.clientVersion);if(t instanceof k)return new ri(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let n=JSON.parse(t);return new za(`${n.message}
|
|
65
|
+
${n.backtrace}`,{clientVersion:this.config.clientVersion})}catch{return t}}#d(t){return t instanceof Ot?t:typeof t.message=="string"&&typeof t.code=="string"?new ri(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion}):typeof t.message=="string"?new za(t.message,{clientVersion:this.config.clientVersion}):t}#m(t,r,n=!0){let i=Ya.PRISMA_WASM_PANIC_REGISTRY.set_message,o;global.PRISMA_WASM_PANIC_REGISTRY.set_message=s=>{o=s};try{return t()}finally{if(global.PRISMA_WASM_PANIC_REGISTRY.set_message=i,o)throw this.#e=void 0,n&&this.stop().catch(s=>ne("failed to disconnect:",s)),new Ot(Wa(this,o,r),this.config.clientVersion)}}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the client engine, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){await this.#s()}async stop(){switch(this.#t.type){case"disconnected":return;case"connecting":return await this.#t.promise,await this.stop();case"connected":{let t=this.#t.engine,r=this.tracingHelper.runInChildSpan("disconnect",async()=>{try{await t.executor.disconnect(),t.queryCompiler.free()}finally{this.#t={type:"disconnected"}}});return this.#t={type:"disconnecting",promise:r},await r}case"disconnecting":return await this.#t.promise}}version(){return"unknown"}async transaction(t,r,n){let i,{executor:o}=await this.#s();try{if(t==="start"){let s=n;i=await o.startTransaction({...s,isolationLevel:this.#g(s.isolationLevel)})}else if(t==="commit"){let s=n;await o.commitTransaction(s)}else if(t==="rollback"){let s=n;await o.rollbackTransaction(s)}else ee(t,"Invalid transaction action.")}catch(s){throw this.#c(s)}return i?{id:i.id,payload:void 0}:void 0}async request(t,{interactiveTransaction:r,customDataProxyFetch:n}){ne("sending request");let{executor:i,queryCompiler:o}=await this.#s().catch(l=>{throw this.#c(l,JSON.stringify(t))}),s,a={};if(Ka(t))s=Za(t);else{let{parameterizedQuery:l,placeholderValues:u}=Da(t,this.#o),c=JSON.stringify(l);a=u;let p=this.#i.getSingle(c);p?(ne("query plan cache hit"),s=p):(ne("query plan cache miss"),s=this.#h(l,c,o),this.#i.setSingle(c,s))}try{ne("query plan created",s);let l=await i.execute({plan:s,model:t.modelName,operation:t.action,placeholderValues:a,transaction:r,batchIndex:void 0,customFetch:n?.(globalThis.fetch),queryInfo:{type:"single",modelName:t.modelName,action:t.action,query:t.query}});return ne("query plan executed"),{data:{[t.action]:l}}}catch(l){throw this.#c(l,JSON.stringify(t))}}async requestBatch(t,{transaction:r,customDataProxyFetch:n}){if(t.length===0)return[];let i=t[0].action,o=t[0].modelName,s=Sa(t,r),a=JSON.stringify(s),{executor:l,queryCompiler:u}=await this.#s().catch(f=>{throw this.#c(f,a)}),c=o===void 0,p,d={};if(c)p=this.#f(t,a,u);else{let{parameterizedBatch:f,placeholderValues:h}=Fa(s,this.#o),b=JSON.stringify(f);d=h;let x=this.#i.getBatch(b);if(x)ne("batch query plan cache hit"),p=x;else{ne("batch query plan cache miss");try{p=this.#f(f.batch,b,u),this.#i.setBatch(b,p)}catch(F){throw this.#d(F)}}}try{let f;switch(r?.kind==="itx"&&(f=r.options),p.type){case"multi":{if(r?.kind!=="itx"){let x=r?.options.isolationLevel?{...this.config.transactionOptions,isolationLevel:r.options.isolationLevel}:this.config.transactionOptions;f=await this.transaction("start",{},x)}let h=[],b=!1;for(let[x,F]of p.plans.entries())try{let P=await l.execute({plan:F,placeholderValues:d,model:t[x].modelName,operation:t[x].action,batchIndex:x,transaction:f,customFetch:n?.(globalThis.fetch),queryInfo:{type:"single",...t[x]}});h.push({data:{[t[x].action]:P}})}catch(P){h.push(P),b=!0;break}return f!==void 0&&r?.kind!=="itx"&&(b?await this.transaction("rollback",{},f):await this.transaction("commit",{},f)),h}case"compacted":{if(!t.every(x=>x.action===i&&x.modelName===o)){let x=t.map(P=>P.action).join(", "),F=t.map(P=>P.modelName).join(", ");throw new Error(`Internal error: All queries in a compacted batch must have the same action and model name, but received actions: [${x}] and model names: [${F}]. This indicates a bug in the client. Please report this issue to the Prisma team with your query details.`)}if(o===void 0)throw new Error("Internal error: A compacted batch cannot contain raw queries. This indicates a bug in the client. Please report this issue to the Prisma team with your query details.");let h=await l.execute({plan:p.plan,placeholderValues:d,model:o,operation:i,batchIndex:void 0,transaction:f,customFetch:n?.(globalThis.fetch),queryInfo:{type:"compacted",action:i,modelName:o,queries:t}});return Xo(h,p,d).map(x=>({data:{[i]:x}}))}}}catch(f){throw this.#c(f,a)}}async apiKey(){let{executor:t}=await this.#s();return t.apiKey()}#h(t,r,n){try{return this.#m(()=>this.#y({queries:[t],execute:()=>n.compile(r)}))}catch(i){throw this.#d(i)}}#f(t,r,n){if(t.every(Ka))return{type:"multi",plans:t.map(i=>Za(i))};try{return this.#m(()=>this.#y({queries:t,execute:()=>n.compileBatch(r)}))}catch(i){throw this.#d(i)}}#g(t){switch(t){case void 0:return;case"ReadUncommitted":return"READ UNCOMMITTED";case"ReadCommitted":return"READ COMMITTED";case"RepeatableRead":return"REPEATABLE READ";case"Serializable":return"SERIALIZABLE";case"Snapshot":return"SNAPSHOT";default:throw new ri(`Inconsistent column data: Conversion failed: Invalid isolation level \`${t}\``,{code:"P2023",clientVersion:this.config.clientVersion,meta:{providedIsolationLevel:t}})}}#y({queries:t,execute:r}){return this.tracingHelper.runInChildSpan({name:"compile",attributes:{models:t.map(n=>n.modelName).filter(n=>n!==void 0),actions:t.map(n=>n.action)}},r)}};function Wa(e,t,r){return ka({binaryTarget:void 0,title:t,version:e.config.clientVersion,engineVersion:"unknown",database:e.config.activeProvider,query:r})}function Ka(e){return e.action==="queryRaw"||e.action==="executeRaw"}function Za(e){let t=e.query.arguments.query,{args:r,argTypes:n}=Pa(e.query.arguments.parameters);return{type:e.action==="queryRaw"?"query":"execute",args:{type:"rawSql",sql:t,args:r,argTypes:n}}}function Xa(e){return new Nt(e)}var el=e=>({command:e});import{Sql as sm}from"@prisma/client-runtime-utils";var tl=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);import{Decimal as im}from"@prisma/client-runtime-utils";function ze(e){try{return rl(e,"fast")}catch{return rl(e,"slow")}}function rl(e,t){return JSON.stringify(e.map(r=>il(r,t)))}function il(e,t){if(Array.isArray(e))return e.map(r=>il(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(ve(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(im.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(om(e))return{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:Buffer.from(r,n,i).toString("base64")}}return typeof e=="object"&&t==="slow"?ol(e):e}function om(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function ol(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(nl);let t={};for(let r of Object.keys(e))t[r]=nl(e[r]);return t}function nl(e){return typeof e=="bigint"?e.toString():ol(e)}var am=/^(\s*alter\s)/i,sl=N("prisma:client");function ni(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&am.exec(t))throw new Error(`Running ALTER using ${n} is not supported
|
|
66
66
|
Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization.
|
|
67
67
|
|
|
68
68
|
Example:
|
|
69
69
|
await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
|
|
70
70
|
|
|
71
71
|
More Information: https://pris.ly/d/execute-raw
|
|
72
|
-
`)}var ii=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(or(r))n=r.sql,i={values:ze(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:ze(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:ze(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:ze(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=
|
|
73
|
-
Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};at(C,"PrismaClientConstructorValidationError");var wl=["errorFormat","adapter","accelerateUrl","log","transactionOptions","omit","comments","__internal"],bl=["pretty","colorless","minimal"],xl=["info","query","warn","error"],Em={adapter:()=>{},accelerateUrl:e=>{if(e!==void 0){if(typeof e!="string")throw new C(`Invalid value ${JSON.stringify(e)} for "accelerateUrl" provided to PrismaClient constructor.`);if(e.trim().length===0)throw new C('"accelerateUrl" provided to PrismaClient constructor must be a non-empty string.')}},errorFormat:e=>{if(e){if(typeof e!="string")throw new C(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!bl.includes(e)){let t=Dt(e,bl);throw new C(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new C(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!xl.includes(r)){let n=Dt(r,xl);throw new C(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Dt(i,o);throw new C(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new C(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new C(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new C(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new C('"omit" option is expected to be an object.');if(e===null)throw new C('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Sm(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new C(Am(e,r))},comments:e=>{if(e!==void 0){if(!Array.isArray(e))throw new C(`Invalid value ${JSON.stringify(e)} for "comments" provided to PrismaClient constructor. Expected an array of SQL commenter plugins.`);for(let t=0;t<e.length;t++)if(typeof e[t]!="function")throw new C(`Invalid value at index ${t} for "comments" provided to PrismaClient constructor. Each plugin must be a function.`)}},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new C(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Dt(r,t);throw new C(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Pm(e){let t=e.adapter!==void 0,r=e.accelerateUrl!==void 0;if(t&&r)throw new C('The "adapter" and "accelerateUrl" options are mutually exclusive. Please provide only one of them.');if(!t&&!r)throw new C('Using engine type "client" requires either "adapter" or "accelerateUrl" to be provided to PrismaClient constructor.')}function Tl(e,t){for(let[r,n]of Object.entries(e)){if(!wl.includes(r)){let i=Dt(r,wl);throw new C(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Em[r](n,t)}Pm(e)}function Dt(e,t){if(t.length===0||typeof e!="string")return"";let r=Tm(e,t);return r?` Did you mean "${r}"?`:""}function Tm(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Pl.default)(e,i)}));r.sort((i,o)=>i.distance<o.distance?-1:1);let n=r[0];return n.distance<3?n.value:null}function Sm(e,t){return El(t.models,e)??El(t.types,e)}function El(e,t){let r=Object.keys(e).find(n=>
|
|
72
|
+
`)}var ii=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(or(r))n=r.sql,i={values:ze(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:ze(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:ze(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:ze(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=tl(r),i={values:ze(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?sl(`prisma.${e}(${n}, ${i.values})`):sl(`prisma.${e}(${n})`),{query:n,parameters:i}},al={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new sm(t,r)}},ll={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function oi(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=ul(r(s)):ul(r(s))}catch(a){return Promise.reject(a)}};return{get spec(){return n},then(s,a){return o().then(s,a)},catch(s){return o().catch(s)},finally(s){return o().finally(s)},requestTransaction(s){let a=o(s);return a.requestTransaction?a.requestTransaction(s):a},[Symbol.toStringTag]:"PrismaPromise"}}}function ul(e){return typeof e.then=="function"?e:Promise.resolve(e)}var cl={name:"@prisma/instrumentation-contract",version:"7.5.0-dev.8",description:"Shared types and utilities for Prisma instrumentation",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation-contract"},bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},files:["dist"],sideEffects:!1,devDependencies:{"@opentelemetry/api":"1.9.0"},peerDependencies:{"@opentelemetry/api":"^1.8"}};var um=cl.version.split(".")[0],cm="PRISMA_INSTRUMENTATION",pm=`V${um}_PRISMA_INSTRUMENTATION`,pl=globalThis;function dl(){let e=pl[pm];return e?.helper?e.helper:pl[cm]?.helper}var dm={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},si=class{isEnabled(){return this.getTracingHelper().isEnabled()}getTraceParent(t){return this.getTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getTracingHelper().runInChildSpan(t,r)}getTracingHelper(){return dl()??dm}};function ml(){return new si}function fl(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function gl(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}import{hasBatchIndex as ym}from"@prisma/client-runtime-utils";function li(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(ai(e.query.arguments)),t.push(ai(e.query.selection)),t.join("")}function ai(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${ai(n)})`:r}).join(" ")})`}var mm={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateManyAndReturn:!0,updateOne:!0,upsertOne:!0};function ui(e){return mm[e]}var qr=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i<r.length;i++)r[i].reject(n);else for(let i=0;i<r.length;i++){let o=n[i];o instanceof Error?r[i].reject(o):r[i].resolve(o)}}).catch(n=>{for(let i=0;i<r.length;i++)r[i].reject(n)}))}}get[Symbol.toStringTag](){return"DataLoader"}};import{Decimal as fm}from"@prisma/client-runtime-utils";function Pe(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bytes":{let{buffer:r,byteOffset:n,byteLength:i}=Buffer.from(t,"base64");return new Uint8Array(r,n,i)}case"decimal":return new fm(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"bigint-array":return t.map(r=>Pe("bigint",r));case"bytes-array":return t.map(r=>Pe("bytes",r));case"decimal-array":return t.map(r=>Pe("decimal",r));case"datetime-array":return t.map(r=>Pe("datetime",r));case"date-array":return t.map(r=>Pe("date",r));case"time-array":return t.map(r=>Pe("time",r));default:return t}}function ci(e){let t=[],r=gm(e);for(let n=0;n<e.rows.length;n++){let i=e.rows[n],o={...r};for(let s=0;s<i.length;s++)o[e.columns[s]]=Pe(e.types[s],i[s]);t.push(o)}return t}function gm(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var hm=N("prisma:client:request_handler"),Ur=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new qr({batchLoader:Qo(async({requests:n,customDataProxyFetch:i})=>{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>ui(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:wm(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?yl(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:ui(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>{if(n.transaction?.kind==="itx"){let i=li(n.protocolQuery);return`itx-${n.transaction.id}${i?`-${i}`:""}`}return n.transaction?.id?`transaction-${n.transaction.id}`:li(n.protocolQuery)},batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:t.globalOmit})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=this.unpack(i,t,r);return process.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(hm(t),bm(t,i))throw t;if(t instanceof pi&&xm(t)){let u=hl(t.meta);tr({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let l=t.message;if(n&&(l=Gt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new pi(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new jr(l,this.client._clientVersion);if(t instanceof di)throw new di(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof Te)throw new Te(l,this.client._clientVersion);if(t instanceof jr)throw new jr(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?Ae(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.keys(t)[0],o=Object.values(t)[0],s=r.filter(u=>u!=="select"&&u!=="include"),a=mn(o,s),l=i==="queryRaw"?ci(a):z(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function wm(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:yl(e)};ee(e,"Unknown transaction kind")}}function yl(e){return{id:e.id,payload:e.payload}}function bm(e,t){return ym(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function xm(e){return e.code==="P2009"||e.code==="P2012"}function hl(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(hl)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var mi=Ir;var Pl=de(tn());var C=class extends Error{constructor(t){super(t+`
|
|
73
|
+
Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};at(C,"PrismaClientConstructorValidationError");var wl=["errorFormat","adapter","accelerateUrl","log","transactionOptions","omit","comments","__internal"],bl=["pretty","colorless","minimal"],xl=["info","query","warn","error"],Em={adapter:()=>{},accelerateUrl:e=>{if(e!==void 0){if(typeof e!="string")throw new C(`Invalid value ${JSON.stringify(e)} for "accelerateUrl" provided to PrismaClient constructor.`);if(e.trim().length===0)throw new C('"accelerateUrl" provided to PrismaClient constructor must be a non-empty string.')}},errorFormat:e=>{if(e){if(typeof e!="string")throw new C(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!bl.includes(e)){let t=Dt(e,bl);throw new C(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new C(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!xl.includes(r)){let n=Dt(r,xl);throw new C(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Dt(i,o);throw new C(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new C(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new C(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new C(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,t)=>{if(typeof e!="object")throw new C('"omit" option is expected to be an object.');if(e===null)throw new C('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Sm(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let l=o.fields.find(u=>u.name===s);if(!l){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){r.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&r.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(r.length>0)throw new C(Am(e,r))},comments:e=>{if(e!==void 0){if(!Array.isArray(e))throw new C(`Invalid value ${JSON.stringify(e)} for "comments" provided to PrismaClient constructor. Expected an array of SQL commenter plugins.`);for(let t=0;t<e.length;t++)if(typeof e[t]!="function")throw new C(`Invalid value at index ${t} for "comments" provided to PrismaClient constructor. Each plugin must be a function.`)}},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new C(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Dt(r,t);throw new C(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Pm(e){let t=e.adapter!==void 0,r=e.accelerateUrl!==void 0;if(t&&r)throw new C('The "adapter" and "accelerateUrl" options are mutually exclusive. Please provide only one of them.');if(!t&&!r)throw new C('Using engine type "client" requires either "adapter" or "accelerateUrl" to be provided to PrismaClient constructor.')}function Tl(e,t){for(let[r,n]of Object.entries(e)){if(!wl.includes(r)){let i=Dt(r,wl);throw new C(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Em[r](n,t)}Pm(e)}function Dt(e,t){if(t.length===0||typeof e!="string")return"";let r=Tm(e,t);return r?` Did you mean "${r}"?`:""}function Tm(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Pl.default)(e,i)}));r.sort((i,o)=>i.distance<o.distance?-1:1);let n=r[0];return n.distance<3?n.value:null}function Sm(e,t){return El(t.models,e)??El(t.types,e)}function El(e,t){let r=Object.keys(e).find(n=>oe(n)===t);if(r)return e[r]}function Am(e,t){let r=Me(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=er(r,"colorless");return`Error validating "omit" option:
|
|
74
74
|
|
|
75
75
|
${i}
|
|
76
76
|
|
|
77
|
-
${n}`}import{hasBatchIndex as vm}from"@prisma/client-runtime-utils";function Sl(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u<e.length;u++)e[u].then(c=>{n[u]=c,a()},c=>{if(!vm(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var
|
|
77
|
+
${n}`}import{hasBatchIndex as vm}from"@prisma/client-runtime-utils";function Sl(e){return e.length===0?Promise.resolve([]):new Promise((t,r)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u<e.length;u++)e[u].then(c=>{n[u]=c,a()},c=>{if(!vm(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var Ft=N("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Im={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Om=Symbol.for("prisma.client.transaction.id"),Nm={id:0,nextId(){return++this.id}};function Dm(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=oi();constructor(n){if(!n)throw new Te("`PrismaClient` needs to be constructed with a non-empty, valid `PrismaClientOptions`:\n\n```\nnew PrismaClient({\n ...\n})\n```\n\nor\n\n```\nconstructor() {\n super({ ... });\n}\n```\n ",mi);e=n.__internal?.configOverride?.(e)??e,Tl(n,e);let i=new km().on("error",()=>{});this._extensions=_e.empty(),this._previewFeatures=e.previewFeatures,this._clientVersion=e.clientVersion??mi,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=ml();let o;if(n.adapter){o=n.adapter;let s=e.activeProvider==="postgresql"||e.activeProvider==="cockroachdb"?"postgres":e.activeProvider;if(o.provider!==s)throw new Te(`The Driver Adapter \`${o.adapterName}\`, based on \`${o.provider}\`, is not compatible with the provider \`${s}\` specified in the Prisma schema.`,this._clientVersion)}try{let s=n??{},l=(s.__internal??{}).debug===!0;if(l&&N.enable("prisma:client"),s.errorFormat?this._errorFormat=s.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={enableDebugLogs:l,logLevel:s.log&&gl(s.log),logQueries:s.log&&!!(typeof s.log=="string"?s.log==="query":s.log.find(u=>typeof u=="string"?u==="query":u.level==="query")),compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:s.transactionOptions?.maxWait??2e3,timeout:s.transactionOptions?.timeout??5e3,isolationLevel:s.transactionOptions?.isolationLevel},logEmitter:i,adapter:o,accelerateUrl:s.accelerateUrl,sqlCommenters:s.comments,parameterizationSchema:e.parameterizationSchema,runtimeDataModel:e.runtimeDataModel},this._accelerateEngineConfig=Object.create(this._engineConfig),this._accelerateEngineConfig.accelerateUtils={resolveDatasourceUrl:()=>{if(s.accelerateUrl)return s.accelerateUrl;throw new Te(`\`accelerateUrl\` is required when using \`@prisma/extension-accelerate\`:
|
|
78
78
|
|
|
79
79
|
new PrismaClient({
|
|
80
80
|
accelerateUrl: "prisma://...",
|
|
81
81
|
}).$extends(withAccelerate())
|
|
82
|
-
`,e.clientVersion)}},
|
|
83
|
-
`)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:b,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:d,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:f})}catch(h){throw h.clientVersion=this._clientVersion,h}}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$extends=
|
|
82
|
+
`,e.clientVersion)}},Ft("clientVersion",e.clientVersion),this._engine=Xa(this._engineConfig),this._requestHandler=new Ur(this,i),s.log)for(let u of s.log){let c=typeof u=="string"?u:u.emit==="stdout"?u.level:null;c&&this.$on(c,p=>{st.log(`${st.tags[c]??""}`,p.message||p.query)})}}catch(s){throw s.clientVersion=this._clientVersion,s}return this._appliedParent=yt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$on(n,i){return n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i),this}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{ki()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:ii({clientMethod:i,activeProvider:a}),callsite:ae(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Al(n,i);return ni(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Mt("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(ni(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Mt(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:el,callsite:ae(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:ii({clientMethod:i,activeProvider:a}),callsite:ae(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Al(n,i));throw new Mt("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawTyped(n){return this._createPrismaPromise(i=>{if(!this._hasPreviewFlag("typedSql"))throw new Mt("`typedSql` preview feature must be enabled in order to access $queryRawTyped API",{clientVersion:this._clientVersion});return this.$queryRawInternal(i,"$queryRawTyped",n)})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Nm.nextId(),s=fl(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return Sl(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return Q(yt(Q(Do(this),[D("_appliedParent",()=>this._appliedParent._createItxClient(n)),D("_createPrismaPromise",()=>oi(n)),D(Om,()=>n.id)])),[Le($o)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Im,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=async l=>{let{runInTransaction:u,args:c,...p}=l,d={...n,...p};c&&(d.args=i.middlewareArgsToRequestArgs(c)),n.transaction!==void 0&&u===!1&&delete d.transaction;let f=await Bo(this,d);return d.model?Lo({result:f,modelName:d.model,args:d.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):f};return this._tracingHelper.runInChildSpan(s.operation,()=>new Rm("prisma-client-request").runInAsyncScope(()=>a(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:d,customDataProxyFetch:f}){try{n=u?u(n):n;let h={name:"serialize"},b=this._tracingHelper.runInChildSpan(h,()=>an({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures,globalOmit:this._globalOmit}));return N.enabled("prisma:client")&&(Ft("Prisma Client call:"),Ft(`prisma.${i}(${Po(n)})`),Ft("Generated request:"),Ft(JSON.stringify(b,null,2)+`
|
|
83
|
+
`)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:b,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:d,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:f})}catch(h){throw h.clientVersion=this._clientVersion,h}}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$extends=Fo}return t}function Al(e,t){return Fm(e)?[new Cm(e,t),al]:[e,ll]}function Fm(e){return Array.isArray(e)&&Array.isArray(e.raw)}var Mm=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function _m(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Mm.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}var Lm=()=>globalThis.process?.release?.name==="node",$m=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,Vm=()=>!!globalThis.Deno,qm=()=>typeof globalThis.Netlify=="object",jm=()=>typeof globalThis.EdgeRuntime=="object",Um=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function Bm(){return[[qm,"netlify"],[jm,"edge-light"],[Um,"workerd"],[Vm,"deno"],[$m,"bun"],[Lm,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var Qm={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)"};function Jm(){let e=Bm();return{id:e,prettyName:Qm[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}import{PrismaClientInitializationError as Te,PrismaClientKnownRequestError as pi,PrismaClientRustPanicError as jr,PrismaClientUnknownRequestError as di,PrismaClientValidationError as Mt}from"@prisma/client-runtime-utils";import{empty as bA,join as xA,raw as EA,Sql as PA,sql as TA}from"@prisma/client-runtime-utils";import{AnyNull as AA,DbNull as vA,isAnyNull as CA,isDbNull as RA,isJsonNull as kA,JsonNull as IA,NullTypes as OA,ObjectEnumValue as NA}from"@prisma/client-runtime-utils";import{Decimal as FA}from"@prisma/client-runtime-utils";export{AA as AnyNull,Qt as DMMF,vA as DbNull,N as Debug,FA as Decimal,hi as Extensions,IA as JsonNull,OA as NullTypes,NA as ObjectEnumValue,Te as PrismaClientInitializationError,pi as PrismaClientKnownRequestError,jr as PrismaClientRustPanicError,di as PrismaClientUnknownRequestError,Mt as PrismaClientValidationError,bi as Public,PA as Sql,ec as createParam,fc as defineDmmfProperty,z as deserializeJsonObject,ci as deserializeRawResult,_l as dmmfToRuntimeDataModel,bA as empty,Dm as getPrismaClient,Jm as getRuntime,CA as isAnyNull,RA as isDbNull,kA as isJsonNull,xA as join,_m as makeStrictEnum,yc as makeTypedQueryFactory,EA as raw,an as serializeJsonQuery,on as skip,TA as sqltag,Ui as warnOnce};
|
|
84
84
|
/*! Bundled license information:
|
|
85
85
|
|
|
86
86
|
@noble/hashes/utils.js:
|