@prisma/client 7.3.0-integration-parameterization.11 → 7.3.0-integration-parameterization.13
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.js +19 -19
- 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 +17 -17
- 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 vl=Object.create;var Qr=Object.defineProperty;var Cl=Object.getOwnPropertyDescriptor;var Rl=Object.getOwnPropertyNames;var kl=Object.getPrototypeOf,Ol=Object.prototype.hasOwnProperty;var Il=(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 di=(e,t)=>()=>(e&&(t=e(e=0)),t);var _=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ze=(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 Rl(t))!Ol.call(e,i)&&i!==r&&Qr(e,i,{get:()=>t[i],enumerable:!(n=Cl(t,i))||n.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?vl(kl(e)):{},Ml(t||!e||!e.__esModule?Qr(r,"default",{value:e,enumerable:!0}):r,e));var Ri=_((bf,tu)=>{tu.exports={name:"@prisma/engines-version",version:"7.3.0-14.parameterization-11aa30d30257422cbc5419b3ee255fa98d60bbab",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"11aa30d30257422cbc5419b3ee255fa98d60bbab"},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 ki=_(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.enginesVersion=void 0;Lt.enginesVersion=Ri().prisma.enginesVersion});var Ii=_((Ef,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 _i=_((Sf,Di)=>{"use strict";Di.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 Li=_((Mf,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=_((Ag,Ji)=>{"use strict";Ji.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,y,d,h,b,x,N,P,S,L=[];for(l=0;l<i;l++)L.push(l+1),L.push(t.charCodeAt(s+l));for(var Ae=L.length-1;a<o-3;)for(x=r.charCodeAt(s+(u=a)),N=r.charCodeAt(s+(c=a+1)),P=r.charCodeAt(s+(p=a+2)),S=r.charCodeAt(s+(y=a+3)),d=a+=4,l=0;l<Ae;l+=2)h=L[l],b=L[l+1],u=e(h,u,c,x,b),c=e(u,c,p,N,b),p=e(c,p,y,P,b),d=e(p,y,d,S,b),L[l]=d,y=p,p=c,c=u,u=h;for(;a<o;)for(x=r.charCodeAt(s+(u=a)),d=++a,l=0;l<Ae;l+=2)h=L[l],L[l]=d=e(h,u,d,x,L[l+1]),u=h;return d}}()});var Ki=di(()=>{"use strict"});var Zi=di(()=>{"use strict"});var An=_(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.anumber=Sn;he.abytes=ss;he.ahash=gp;he.aexists=yp;he.aoutput=hp;function Sn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function fp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ss(e,...t){if(!fp(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 gp(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 yp(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 hp(e,t){ss(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Rs=_(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.add5L=f.add5H=f.add4H=f.add4L=f.add3H=f.add3L=f.rotlBL=f.rotlBH=f.rotlSL=f.rotlSH=f.rotr32L=f.rotr32H=f.rotrBL=f.rotrBH=f.rotrSL=f.rotrSH=f.shrSL=f.shrSH=f.toBig=void 0;f.fromBig=Cn;f.split=as;f.add=Es;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 as(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 ls=(e,t)=>BigInt(e>>>0)<<vn|BigInt(t>>>0);f.toBig=ls;var us=(e,t,r)=>e>>>r;f.shrSH=us;var cs=(e,t,r)=>e<<32-r|t>>>r;f.shrSL=cs;var ps=(e,t,r)=>e>>>r|t<<32-r;f.rotrSH=ps;var ds=(e,t,r)=>e<<32-r|t>>>r;f.rotrSL=ds;var ms=(e,t,r)=>e<<64-r|t>>>r-32;f.rotrBH=ms;var fs=(e,t,r)=>e>>>r-32|t<<64-r;f.rotrBL=fs;var gs=(e,t)=>t;f.rotr32H=gs;var ys=(e,t)=>e;f.rotr32L=ys;var hs=(e,t,r)=>e<<r|t>>>32-r;f.rotlSH=hs;var ws=(e,t,r)=>t<<r|e>>>32-r;f.rotlSL=ws;var bs=(e,t,r)=>t<<r-32|e>>>64-r;f.rotlBH=bs;var xs=(e,t,r)=>e<<r-32|t>>>64-r;f.rotlBL=xs;function Es(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Ps=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);f.add3L=Ps;var Ts=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;f.add3H=Ts;var Ss=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);f.add4L=Ss;var As=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;f.add4H=As;var vs=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);f.add5L=vs;var Cs=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;f.add5H=Cs;var wp={fromBig:Cn,split:as,toBig:ls,shrSH:us,shrSL:cs,rotrSH:ps,rotrSL:ds,rotrBH:ms,rotrBL:fs,rotr32H:gs,rotr32L:ys,rotlSH:hs,rotlSL:ws,rotlBH:bs,rotlBL:xs,add:Es,add3L:Ps,add3H:Ts,add4L:Ss,add4H:As,add5H:Cs,add5L:vs};f.default=wp});var ks=_(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.crypto=void 0;var ae=Il("node:crypto");yr.crypto=ae&&typeof ae=="object"&&"webcrypto"in ae?ae.webcrypto:ae&&typeof ae=="object"&&"randomBytes"in ae?ae:void 0});var Ms=_(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.Hash=w.nextTick=w.byteSwapIfBE=w.isLE=void 0;w.isBytes=bp;w.u8=xp;w.u32=Ep;w.createView=Pp;w.rotr=Tp;w.rotl=Sp;w.byteSwap=On;w.byteSwap32=Ap;w.bytesToHex=Cp;w.hexToBytes=Rp;w.asyncLoop=Op;w.utf8ToBytes=Is;w.toBytes=hr;w.concatBytes=Ip;w.checkOpts=Mp;w.wrapConstructor=Fp;w.wrapConstructorWithOpts=Np;w.wrapXOFConstructorWithOpts=Dp;w.randomBytes=_p;var Ue=ks(),kn=An();function bp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function xp(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Ep(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Pp(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Tp(e,t){return e<<32-t|e>>>t}function Sp(e,t){return e<<t|e>>>32-t>>>0}w.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function On(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}w.byteSwapIfBE=w.isLE?e=>e:e=>On(e);function Ap(e){for(let t=0;t<e.length;t++)e[t]=On(e[t])}var vp=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Cp(e){(0,kn.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=vp[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 Rp(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 kp=async()=>{};w.nextTick=kp;async function Op(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 Is(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=Is(e)),(0,kn.abytes)(e),e}function Ip(...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 Mp(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 Fp(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 Np(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 Dp(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 _p(e=32){if(Ue.crypto&&typeof Ue.crypto.getRandomValues=="function")return Ue.crypto.getRandomValues(new Uint8Array(e));if(Ue.crypto&&typeof Ue.crypto.randomBytes=="function")return Ue.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var qs=_(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=Ls;var Be=An(),Pt=Rs(),te=Ms(),Ds=[],_s=[],$s=[],$p=BigInt(0),Et=BigInt(1),Lp=BigInt(2),Vp=BigInt(7),qp=BigInt(256),jp=BigInt(113);for(let e=0,t=Et,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Ds.push(2*(5*n+r)),_s.push((e+1)*(e+2)/2%64);let i=$p;for(let o=0;o<7;o++)t=(t<<Et^(t>>Vp)*jp)%qp,t&Lp&&(i^=Et<<(Et<<BigInt(o))-Et);$s.push(i)}var[Up,Bp]=(0,Pt.split)($s,!0),Fs=(e,t,r)=>r>32?(0,Pt.rotlBH)(e,t,r):(0,Pt.rotlSH)(e,t,r),Ns=(e,t,r)=>r>32?(0,Pt.rotlBL)(e,t,r):(0,Pt.rotlSL)(e,t,r);function Ls(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=Fs(u,c,1)^r[a],y=Ns(u,c,1)^r[a+1];for(let d=0;d<50;d+=10)e[s+d]^=p,e[s+d+1]^=y}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=_s[s],l=Fs(i,o,a),u=Ns(i,o,a),c=Ds[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]^=Up[n],e[1]^=Bp[n]}r.fill(0)}var Tt=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,Be.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),Ls(this.state32,this.rounds),te.isLE||(0,te.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Be.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,Be.aexists)(this,!1),(0,Be.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,Be.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Be.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=Tt;var le=(e,t,r)=>(0,te.wrapConstructor)(()=>new Tt(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 Vs=(e,t,r)=>(0,te.wrapXOFConstructorWithOpts)((n={})=>new Tt(t,e,n.dkLen===void 0?r:n.dkLen,!0));v.shake128=Vs(31,168,128/8);v.shake256=Vs(31,136,256/8)});var Ws=_((xx,ue)=>{"use strict";var{sha3_512:Qp}=qs(),Us=24,St=32,In=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Bs(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var Qs=(e="")=>Bs(Qp(e)).toString(36).slice(1),js=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),Jp=e=>js[Math.floor(e()*js.length)],Js=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+In(St,t):In(St,t);return Qs(n).substring(0,St)},Hs=e=>()=>e++,Hp=476782367,Gs=({random:e=Math.random,counter:t=Hs(Math.floor(e()*Hp)),length:r=Us,fingerprint:n=Js({random:e})}={})=>function(){let o=Jp(e),s=Date.now().toString(36),a=t().toString(36),l=In(r,e),u=`${s+l+a+n}`;return`${o+Qs(u).substring(1,r)}`},Gp=Gs(),Wp=(e,{minLength:t=2,maxLength:r=St}={})=>{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:Us,bigLength:St});ue.exports.init=Gs;ue.exports.createId=Gp;ue.exports.bufToBigInt=Bs;ue.exports.createCounter=Hs;ue.exports.createFingerprint=Js;ue.exports.isCuid=Wp});var zs=_((Ex,At)=>{"use strict";var{createId:zp,init:Kp,getConstants:Zp,isCuid:Yp}=Ws();At.exports.createId=zp;At.exports.init=Kp;At.exports.getConstants=Zp;At.exports.isCuid=Yp});var gi={};Ze(gi,{defineExtension:()=>mi,getExtensionContext:()=>fi});function mi(e){return typeof e=="function"?e:t=>t.$extends(e)}function fi(e){return e}var hi={};Ze(hi,{validator:()=>yi});function yi(...e){return t=>t}var Q=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 wi(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function Ye(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Fl(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 Yu,isDbNull as Xu,isJsonNull as ec,ObjectEnumValue as tc}from"@prisma/client-runtime-utils";var $t={};Ze($t,{$:()=>Ti,bgBlack:()=>Bl,bgBlue:()=>Gl,bgCyan:()=>zl,bgGreen:()=>Jl,bgMagenta:()=>Wl,bgRed:()=>Ql,bgWhite:()=>Kl,bgYellow:()=>Hl,black:()=>Vl,blue:()=>me,bold:()=>q,cyan:()=>Y,dim:()=>Xe,gray:()=>nt,green:()=>tt,grey:()=>Ul,hidden:()=>$l,inverse:()=>_l,italic:()=>Dl,magenta:()=>ql,red:()=>de,reset:()=>Nl,strikethrough:()=>Ll,underline:()=>et,white:()=>jl,yellow:()=>rt});var Hr,bi,xi,Ei,Pi=!0;typeof process<"u"&&({FORCE_COLOR:Hr,NODE_DISABLE_COLORS:bi,NO_COLOR:xi,TERM:Ei}=process.env||{},Pi=process.stdout&&process.stdout.isTTY);var Ti={enabled:!bi&&xi==null&&Ei!=="dumb"&&(Hr!=null&&Hr!=="0"||Pi)};function T(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ti.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Nl=T(0,0),q=T(1,22),Xe=T(2,22),Dl=T(3,23),et=T(4,24),_l=T(7,27),$l=T(8,28),Ll=T(9,29),Vl=T(30,39),de=T(31,39),tt=T(32,39),rt=T(33,39),me=T(34,39),ql=T(35,39),Y=T(36,39),jl=T(37,39),nt=T(90,39),Ul=T(90,39),Bl=T(40,49),Ql=T(41,49),Jl=T(42,49),Hl=T(43,49),Gl=T(44,49),Wl=T(45,49),zl=T(46,49),Kl=T(47,49);var Zl=100,Si=["green","yellow","blue","magenta","cyan","red"],it=[],Ai=Date.now(),Yl=0,Gr=typeof process<"u"?process.env:{};globalThis.DEBUG??=Gr.DEBUG??"";globalThis.DEBUG_COLORS??=Gr.DEBUG_COLORS?Gr.DEBUG_COLORS==="true":!0;var ot={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 Xl(e){let t={color:Si[Yl++%Si.length],enabled:ot.enabled(e),namespace:e,log:ot.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&it.push([o,...n]),it.length>Zl&&it.shift(),ot.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:eu(c)),u=`+${Date.now()-Ai}ms`;Ai=Date.now(),globalThis.DEBUG_COLORS?a($t[s](q(o)),...l,$t[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var M=new Proxy(Xl,{get:(e,t)=>ot[t],set:(e,t,r)=>ot[t]=r});function eu(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 vi(e=7500){let t=it.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 Ci(){it.length=0}var Mi=pe(Ii(),1);function Wr(e){let t=(0,Mi.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var Fi="prisma+postgres",Vt=`${Fi}:`;function Ni(e){return e?.toString().startsWith(`${Vt}//`)??!1}function zr(e){if(!Ni(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")||t.includes("[::1]")}var at={};Ze(at,{error:()=>iu,info:()=>nu,log:()=>ru,query:()=>ou,should:()=>$i,tags:()=>st,warn:()=>Kr});var st={error:de("prisma:error"),warn:rt("prisma:warn"),info:Y("prisma:info"),query:me("prisma:query")},$i={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function ru(...e){console.log(...e)}function Kr(e,...t){$i.warn()&&console.warn(`${st.warn} ${e}`,...t)}function nu(e,...t){console.info(`${st.info} ${e}`,...t)}function iu(e,...t){console.error(`${st.error} ${e}`,...t)}function ou(e,...t){console.log(`${st.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 su=Zr();function ve(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(su,"")}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 lt(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var Vi=new Set,qi=(e,t,...r)=>{Vi.has(e)||(Vi.add(e),Kr(t,...r))};function Ce(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Bt(e){return e.toString()!=="Invalid Date"}import{Decimal as au}from"@prisma/client-runtime-utils";function Re(e){return au.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 Wu}from"@prisma/client-runtime-utils";var Qt={};Ze(Qt,{ModelAction:()=>ke,datamodelEnumToSchemaEnum:()=>lu});function lu(e){return{name:e.name,values:e.values.map(t=>t.name)}}var ke=(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))(ke||{});var Qi=pe(_i());import mu from"node:fs";var ji={keyword:Y,entity:Y,value:e=>q(me(e)),punctuation:me,directive:Y,function:Y,variable:e=>q(me(e)),string:e=>q(tt(e)),boolean:rt,number:Y,comment:nt};var uu=e=>e,Jt={},cu=0,g={manual:Jt.Prism&&Jt.Prism.manual,disableWorkerMessageHandler:Jt.Prism&&Jt.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof j){let t=e;return new j(t.type,g.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(g.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:++cu}),e.__id},clone:function e(t,r){let n,i,o=g.util.type(t);switch(r=r||{},o){case"Object":if(i=g.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=g.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=g.util.clone(g.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||g.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,g.languages.DFS(g.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=g.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=g.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 g.hooks.run("before-tokenize",n),n.tokens=g.tokenize(n.code,n.grammar),g.hooks.run("after-tokenize",n),j.stringify(g.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=g.util.type(x)==="Array"?x:[x];for(let N=0;N<x.length;++N){let P=x[N],S=P.inside,L=!!P.lookbehind,Ae=!!P.greedy,Br=0,Tl=P.alias;if(Ae&&!P.pattern.global){let D=P.pattern.toString().match(/[imuy]*$/)[0];P.pattern=RegExp(P.pattern.source,D+"g")}P=P.pattern||P;for(let D=n,ne=i;D<t.length;ne+=t[D].length,++D){let Ke=t[D];if(t.length>e.length)return;if(Ke instanceof j)continue;if(Ae&&D!=t.length-1){P.lastIndex=ne;var p=P.exec(e);if(!p)break;var c=p.index+(L?p[1].length:0),y=p.index+p[0].length,a=D,l=ne;for(let Al=t.length;a<Al&&(l<y||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++D,ne=l);if(t[D]instanceof j)continue;u=a-D,Ke=e.slice(ne,l),p.index-=ne}else{P.lastIndex=0;var p=P.exec(Ke),u=1}if(!p){if(o)break;continue}L&&(Br=p[1]?p[1].length:0);var c=p.index+Br,p=p[0].slice(Br),y=c+p.length,d=Ke.slice(0,c),h=Ke.slice(y);let _t=[D,u];d&&(++D,ne+=d.length,_t.push(d));let Sl=new j(b,S?g.tokenize(p,S):p,Tl,p,Ae);if(_t.push(Sl),h&&_t.push(h),Array.prototype.splice.apply(t,_t),u!=1&&g.matchGrammar(e,t,r,D,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 g.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=g.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=g.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:j};g.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:/[{}[\];(),.:]/};g.languages.javascript=g.languages.extend("clike",{"class-name":[g.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}/});g.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;g.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:g.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:g.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:g.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:g.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});g.languages.markup&&g.languages.markup.tag.addInlined("script","javascript");g.languages.js=g.languages.javascript;g.languages.typescript=g.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/});g.languages.ts=g.languages.typescript;function j(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}j.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return j.stringify(r,t)}).join(""):pu(e.type)(e.content)};function pu(e){return ji[e]||uu}function Ui(e){return du(e,g.languages.javascript)}function du(e,t){return g.tokenize(e,t).map(n=>j.stringify(n)).join("")}function Bi(e){return Wr(e)}var Ht=class e{firstLineNumber;lines;static read(t){let r;try{r=mu.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 Cl=Object.create;var Hr=Object.defineProperty;var Rl=Object.getOwnPropertyDescriptor;var kl=Object.getOwnPropertyNames;var Ol=Object.getPrototypeOf,Il=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 D=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ze=(e,t)=>{for(var r in t)Hr(e,r,{get:t[r],enumerable:!0})},Fl=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of kl(t))!Il.call(e,i)&&i!==r&&Hr(e,i,{get:()=>t[i],enumerable:!(n=Rl(t,i))||n.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?Cl(Ol(e)):{},Fl(t||!e||!e.__esModule?Hr(r,"default",{value:e,enumerable:!0}):r,e));var ki=D((Tf,ru)=>{ru.exports={name:"@prisma/engines-version",version:"7.3.0-14.parameterization-11aa30d30257422cbc5419b3ee255fa98d60bbab",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"11aa30d30257422cbc5419b3ee255fa98d60bbab"},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=D(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.enginesVersion=void 0;Vt.enginesVersion=ki().prisma.enginesVersion});var Mi=D((Af,Ii)=>{"use strict";Ii.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=D((Rf,Di)=>{"use strict";Di.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=D((Df,Ut)=>{"use strict";Ut.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()};Ut.exports.default=Ut.exports});var nn=D((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,y,d,h,b,x,N,P,S,L=[];for(l=0;l<i;l++)L.push(l+1),L.push(t.charCodeAt(s+l));for(var Ae=L.length-1;a<o-3;)for(x=r.charCodeAt(s+(u=a)),N=r.charCodeAt(s+(c=a+1)),P=r.charCodeAt(s+(p=a+2)),S=r.charCodeAt(s+(y=a+3)),d=a+=4,l=0;l<Ae;l+=2)h=L[l],b=L[l+1],u=e(h,u,c,x,b),c=e(u,c,p,N,b),p=e(c,p,y,P,b),d=e(p,y,d,S,b),L[l]=d,y=p,p=c,c=u,u=h;for(;a<o;)for(x=r.charCodeAt(s+(u=a)),d=++a,l=0;l<Ae;l+=2)h=L[l],L[l]=d=e(h,u,d,x,L[l+1]),u=h;return d}}()});var Zi=mi(()=>{"use strict"});var Yi=mi(()=>{"use strict"});var Cn=D(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.anumber=vn;he.abytes=as;he.ahash=bp;he.aexists=xp;he.aoutput=Ep;function vn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function wp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function as(e,...t){if(!wp(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 bp(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");vn(e.outputLen),vn(e.blockLen)}function xp(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 Ep(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=D(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});f.add5L=f.add5H=f.add4H=f.add4L=f.add3H=f.add3L=f.rotlBL=f.rotlBH=f.rotlSL=f.rotlSH=f.rotr32L=f.rotr32H=f.rotrBL=f.rotrBH=f.rotrSL=f.rotrSH=f.shrSL=f.shrSH=f.toBig=void 0;f.fromBig=kn;f.split=ls;f.add=Ps;var yr=BigInt(2**32-1),Rn=BigInt(32);function kn(e,t=!1){return t?{h:Number(e&yr),l:Number(e>>Rn&yr)}:{h:Number(e>>Rn&yr)|0,l:Number(e&yr)|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}=kn(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var us=(e,t)=>BigInt(e>>>0)<<Rn|BigInt(t>>>0);f.toBig=us;var cs=(e,t,r)=>e>>>r;f.shrSH=cs;var ps=(e,t,r)=>e<<32-r|t>>>r;f.shrSL=ps;var ds=(e,t,r)=>e>>>r|t<<32-r;f.rotrSH=ds;var ms=(e,t,r)=>e<<32-r|t>>>r;f.rotrSL=ms;var fs=(e,t,r)=>e<<64-r|t>>>r-32;f.rotrBH=fs;var gs=(e,t,r)=>e>>>r-32|t<<64-r;f.rotrBL=gs;var ys=(e,t)=>t;f.rotr32H=ys;var hs=(e,t)=>e;f.rotr32L=hs;var ws=(e,t,r)=>e<<r|t>>>32-r;f.rotlSH=ws;var bs=(e,t,r)=>t<<r|e>>>32-r;f.rotlSL=bs;var xs=(e,t,r)=>t<<r-32|e>>>64-r;f.rotlBH=xs;var Es=(e,t,r)=>e<<r-32|t>>>64-r;f.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);f.add3L=Ts;var Ss=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;f.add3H=Ss;var As=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);f.add4L=As;var vs=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;f.add4H=vs;var Cs=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);f.add5L=Cs;var Rs=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;f.add5H=Rs;var Pp={fromBig:kn,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};f.default=Pp});var Os=D(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.crypto=void 0;var ae=Ml("node:crypto");hr.crypto=ae&&typeof ae=="object"&&"webcrypto"in ae?ae.webcrypto:ae&&typeof ae=="object"&&"randomBytes"in ae?ae:void 0});var Fs=D(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});w.Hash=w.nextTick=w.byteSwapIfBE=w.isLE=void 0;w.isBytes=Tp;w.u8=Sp;w.u32=Ap;w.createView=vp;w.rotr=Cp;w.rotl=Rp;w.byteSwap=Mn;w.byteSwap32=kp;w.bytesToHex=Ip;w.hexToBytes=Mp;w.asyncLoop=Np;w.utf8ToBytes=Ms;w.toBytes=wr;w.concatBytes=_p;w.checkOpts=Dp;w.wrapConstructor=$p;w.wrapConstructorWithOpts=Lp;w.wrapXOFConstructorWithOpts=Vp;w.randomBytes=qp;var Ue=Os(),In=Cn();function Tp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Sp(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Ap(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function vp(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Cp(e,t){return e<<32-t|e>>>t}function Rp(e,t){return e<<t|e>>>32-t>>>0}w.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Mn(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}w.byteSwapIfBE=w.isLE?e=>e:e=>Mn(e);function kp(e){for(let t=0;t<e.length;t++)e[t]=Mn(e[t])}var Op=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ip(e){(0,In.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=Op[e[r]];return t}var ee={_0:48,_9:57,A:65,F:70,a:97,f:102};function Is(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=Is(e.charCodeAt(o)),a=Is(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 Np(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 Ms(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function wr(e){return typeof e=="string"&&(e=Ms(e)),(0,In.abytes)(e),e}function _p(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,In.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 On=class{clone(){return this._cloneInto()}};w.Hash=On;function Dp(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 $p(e){let t=n=>e().update(wr(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Lp(e){let t=(n,i)=>e(i).update(wr(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Vp(e){let t=(n,i)=>e(i).update(wr(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function qp(e=32){if(Ue.crypto&&typeof Ue.crypto.getRandomValues=="function")return Ue.crypto.getRandomValues(new Uint8Array(e));if(Ue.crypto&&typeof Ue.crypto.randomBytes=="function")return Ue.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var js=D(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 Be=Cn(),Pt=ks(),te=Fs(),Ds=[],$s=[],Ls=[],jp=BigInt(0),Et=BigInt(1),Up=BigInt(2),Bp=BigInt(7),Qp=BigInt(256),Jp=BigInt(113);for(let e=0,t=Et,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Ds.push(2*(5*n+r)),$s.push((e+1)*(e+2)/2%64);let i=jp;for(let o=0;o<7;o++)t=(t<<Et^(t>>Bp)*Jp)%Qp,t&Up&&(i^=Et<<(Et<<BigInt(o))-Et);Ls.push(i)}var[Hp,Gp]=(0,Pt.split)(Ls,!0),Ns=(e,t,r)=>r>32?(0,Pt.rotlBH)(e,t,r):(0,Pt.rotlSH)(e,t,r),_s=(e,t,r)=>r>32?(0,Pt.rotlBL)(e,t,r):(0,Pt.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=Ns(u,c,1)^r[a],y=_s(u,c,1)^r[a+1];for(let d=0;d<50;d+=10)e[s+d]^=p,e[s+d+1]^=y}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=$s[s],l=Ns(i,o,a),u=_s(i,o,a),c=Ds[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]^=Hp[n],e[1]^=Gp[n]}r.fill(0)}var Tt=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,Be.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,Be.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,Be.aexists)(this,!1),(0,Be.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,Be.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,Be.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=Tt;var le=(e,t,r)=>(0,te.wrapConstructor)(()=>new Tt(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 Tt(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 zs=D((Sx,ue)=>{"use strict";var{sha3_512:Wp}=js(),Bs=24,St=32,Fn=(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(Wp(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+Fn(St,t):Fn(St,t);return Js(n).substring(0,St)},Gs=e=>()=>e++,Kp=476782367,Ws=({random:e=Math.random,counter:t=Gs(Math.floor(e()*Kp)),length:r=Bs,fingerprint:n=Hs({random:e})}={})=>function(){let o=zp(e),s=Date.now().toString(36),a=t().toString(36),l=Fn(r,e),u=`${s+l+a+n}`;return`${o+Js(u).substring(1,r)}`},Zp=Ws(),Yp=(e,{minLength:t=2,maxLength:r=St}={})=>{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:St});ue.exports.init=Ws;ue.exports.createId=Zp;ue.exports.bufToBigInt=Qs;ue.exports.createCounter=Gs;ue.exports.createFingerprint=Hs;ue.exports.isCuid=Yp});var Ks=D((Ax,At)=>{"use strict";var{createId:Xp,init:ed,getConstants:td,isCuid:rd}=zs();At.exports.createId=Xp;At.exports.init=ed;At.exports.getConstants=td;At.exports.isCuid=rd});var yi={};Ze(yi,{defineExtension:()=>fi,getExtensionContext:()=>gi});function fi(e){return typeof e=="function"?e:t=>t.$extends(e)}function gi(e){return e}var wi={};Ze(wi,{validator:()=>hi});function hi(...e){return t=>t}var Q=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 Ye(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Nl(e){return{models:Gr(e.models),enums:Gr(e.enums),types:Gr(e.types)}}function Gr(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}import{isAnyNull as Xu,isDbNull as ec,isJsonNull as tc,ObjectEnumValue as rc}from"@prisma/client-runtime-utils";var Lt={};Ze(Lt,{$:()=>Si,bgBlack:()=>Ql,bgBlue:()=>Wl,bgCyan:()=>Kl,bgGreen:()=>Hl,bgMagenta:()=>zl,bgRed:()=>Jl,bgWhite:()=>Zl,bgYellow:()=>Gl,black:()=>ql,blue:()=>me,bold:()=>q,cyan:()=>Y,dim:()=>Xe,gray:()=>nt,green:()=>tt,grey:()=>Bl,hidden:()=>Ll,inverse:()=>$l,italic:()=>Dl,magenta:()=>jl,red:()=>de,reset:()=>_l,strikethrough:()=>Vl,underline:()=>et,white:()=>Ul,yellow:()=>rt});var Wr,xi,Ei,Pi,Ti=!0;typeof process<"u"&&({FORCE_COLOR:Wr,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"&&(Wr!=null&&Wr!=="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 _l=T(0,0),q=T(1,22),Xe=T(2,22),Dl=T(3,23),et=T(4,24),$l=T(7,27),Ll=T(8,28),Vl=T(9,29),ql=T(30,39),de=T(31,39),tt=T(32,39),rt=T(33,39),me=T(34,39),jl=T(35,39),Y=T(36,39),Ul=T(37,39),nt=T(90,39),Bl=T(90,39),Ql=T(40,49),Jl=T(41,49),Hl=T(42,49),Gl=T(43,49),Wl=T(44,49),zl=T(45,49),Kl=T(46,49),Zl=T(47,49);var Yl=100,Ai=["green","yellow","blue","magenta","cyan","red"],it=[],vi=Date.now(),Xl=0,zr=typeof process<"u"?process.env:{};globalThis.DEBUG??=zr.DEBUG??"";globalThis.DEBUG_COLORS??=zr.DEBUG_COLORS?zr.DEBUG_COLORS==="true":!0;var ot={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 eu(e){let t={color:Ai[Xl++%Ai.length],enabled:ot.enabled(e),namespace:e,log:ot.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&it.push([o,...n]),it.length>Yl&&it.shift(),ot.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:tu(c)),u=`+${Date.now()-vi}ms`;vi=Date.now(),globalThis.DEBUG_COLORS?a(Lt[s](q(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 M=new Proxy(eu,{get:(e,t)=>ot[t],set:(e,t,r)=>ot[t]=r});function tu(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=it.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(){it.length=0}var Fi=pe(Mi(),1);function Kr(e){let t=(0,Fi.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var Ni="prisma+postgres",qt=`${Ni}:`;function _i(e){return e?.toString().startsWith(`${qt}//`)??!1}function Zr(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 at={};Ze(at,{error:()=>ou,info:()=>iu,log:()=>nu,query:()=>su,should:()=>Li,tags:()=>st,warn:()=>Yr});var st={error:de("prisma:error"),warn:rt("prisma:warn"),info:Y("prisma:info"),query:me("prisma:query")},Li={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function nu(...e){console.log(...e)}function Yr(e,...t){Li.warn()&&console.warn(`${st.warn} ${e}`,...t)}function iu(e,...t){console.info(`${st.info} ${e}`,...t)}function ou(e,...t){console.error(`${st.error} ${e}`,...t)}function su(e,...t){console.log(`${st.query} ${e}`,...t)}function X(e,t){throw new Error(t)}function Xr({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 au=Xr();function ve(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(au,"")}import jt from"node:path";function en(e){return jt.sep===jt.posix.sep?e:e.split(jt.sep).join(jt.posix.sep)}function tn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Bt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function rn(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 lt(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var qi=new Set,ji=(e,t,...r)=>{qi.has(e)||(qi.add(e),Yr(t,...r))};function Ce(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Qt(e){return e.toString()!=="Invalid Date"}import{Decimal as lu}from"@prisma/client-runtime-utils";function Re(e){return lu.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 Jt={};Ze(Jt,{ModelAction:()=>ke,datamodelEnumToSchemaEnum:()=>uu});function uu(e){return{name:e.name,values:e.values.map(t=>t.name)}}var ke=(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))(ke||{});var Ji=pe($i());import fu from"node:fs";var Ui={keyword:Y,entity:Y,value:e=>q(me(e)),punctuation:me,directive:Y,function:Y,variable:e=>q(me(e)),string:e=>q(tt(e)),boolean:rt,number:Y,comment:nt};var cu=e=>e,Ht={},pu=0,g={manual:Ht.Prism&&Ht.Prism.manual,disableWorkerMessageHandler:Ht.Prism&&Ht.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof j){let t=e;return new j(t.type,g.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(g.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:++pu}),e.__id},clone:function e(t,r){let n,i,o=g.util.type(t);switch(r=r||{},o){case"Object":if(i=g.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=g.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=g.util.clone(g.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||g.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,g.languages.DFS(g.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=g.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=g.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 g.hooks.run("before-tokenize",n),n.tokens=g.tokenize(n.code,n.grammar),g.hooks.run("after-tokenize",n),j.stringify(g.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=g.util.type(x)==="Array"?x:[x];for(let N=0;N<x.length;++N){let P=x[N],S=P.inside,L=!!P.lookbehind,Ae=!!P.greedy,Jr=0,Sl=P.alias;if(Ae&&!P.pattern.global){let _=P.pattern.toString().match(/[imuy]*$/)[0];P.pattern=RegExp(P.pattern.source,_+"g")}P=P.pattern||P;for(let _=n,ne=i;_<t.length;ne+=t[_].length,++_){let Ke=t[_];if(t.length>e.length)return;if(Ke instanceof j)continue;if(Ae&&_!=t.length-1){P.lastIndex=ne;var p=P.exec(e);if(!p)break;var c=p.index+(L?p[1].length:0),y=p.index+p[0].length,a=_,l=ne;for(let vl=t.length;a<vl&&(l<y||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++_,ne=l);if(t[_]instanceof j)continue;u=a-_,Ke=e.slice(ne,l),p.index-=ne}else{P.lastIndex=0;var p=P.exec(Ke),u=1}if(!p){if(o)break;continue}L&&(Jr=p[1]?p[1].length:0);var c=p.index+Jr,p=p[0].slice(Jr),y=c+p.length,d=Ke.slice(0,c),h=Ke.slice(y);let $t=[_,u];d&&(++_,ne+=d.length,$t.push(d));let Al=new j(b,S?g.tokenize(p,S):p,Sl,p,Ae);if($t.push(Al),h&&$t.push(h),Array.prototype.splice.apply(t,$t),u!=1&&g.matchGrammar(e,t,r,_,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 g.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=g.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=g.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:j};g.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:/[{}[\];(),.:]/};g.languages.javascript=g.languages.extend("clike",{"class-name":[g.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}/});g.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;g.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:g.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:g.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:g.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:g.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});g.languages.markup&&g.languages.markup.tag.addInlined("script","javascript");g.languages.js=g.languages.javascript;g.languages.typescript=g.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/});g.languages.ts=g.languages.typescript;function j(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}j.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return j.stringify(r,t)}).join(""):du(e.type)(e.content)};function du(e){return Ui[e]||cu}function Bi(e){return mu(e,g.languages.javascript)}function mu(e,t){return g.tokenize(e,t).map(n=>j.stringify(n)).join("")}function Qi(e){return Kr(e)}var Gt=class e{firstLineNumber;lines;static read(t){let r;try{r=fu.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,Qi(n).split(`
|
|
11
|
+
`))}highlight(){let t=Bi(this.toString());return new e(this.firstLineNumber,t.split(`
|
|
12
12
|
`))}toString(){return this.lines.join(`
|
|
13
|
-
`)}};var
|
|
14
|
-
`)}function
|
|
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
|
|
17
|
-
`)}};function _e(e){return new nn(so(e))}function so(e){let t=new Fe;for(let[r,n]of Object.entries(e)){let i=new Xt(r,ao(n));t.addField(i)}return t}function ao(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(Re(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 Hu?new R(`Prisma.${e._getName()}`):De(e)?new R(`prisma.${ie(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Gu(e):typeof e=="object"?so(e):new R(Object.prototype.toString.call(e))}function Gu(e){let t=new Me;for(let r of e)t.addItem(ao(r));return t}function er(e,t){let r=t==="pretty"?Yi:Zt,n=e.renderAllMessages(r),i=new Oe(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=_e(e);for(let p of t)Wt(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 Wu(c,{clientVersion:o})}function H(e){return e.replace(/^./,t=>t.toLowerCase())}function uo(e,t,r){let n=H(r);return!t.result||!(t.result.$allModels||t.result[n])?e:zu({...e,...lo(t.name,e,t.result.$allModels),...lo(t.name,e,t.result[n])})}function zu(e){let t=new Q,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 lo(e,t,r){return r?Ut(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Ku(t,o,i)})):{}}function Ku(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function co(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 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)delete r[i];return r}var rr=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new Q;modelExtensionsCache=new Q;queryCallbacksCache=new Q;clientExtensions=Ye(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=Ye(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>uo(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=H(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 mo(e){return e instanceof nr}function Zu(e){return new nr(e)}var fo=Symbol(),dt=class{constructor(t){if(t!==fo)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?on:t}},on=new dt(fo);function G(e){return e instanceof dt}var rc={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"},go="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}){let p=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});return{modelName:e,action:rc[t],query:mt(r,p)}}function mt({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:ho(r,n),selection:nc(e,t,i,n)}}function nc(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()}),ac(e,n)):ic(n,t,r)}function ic(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&oc(n,t,e),sc(n,r,e),n}function oc(e,t,r){for(let[n,i]of Object.entries(t)){if(G(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]=mt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=mt(i,o)}}function sc(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=po(i,n);for(let[s,a]of Object.entries(o)){if(G(a))continue;ln(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function ac(e,t){let r={},n=t.getComputedFields(),i=co(e,n);for(let[o,s]of Object.entries(i)){if(G(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||G(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=mt({},a):r[o]=!0;continue}r[o]=mt(s,a)}}return r}function yo(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(Ce(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(mo(e))return{$type:"Param",value:e.name};if(De(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return lc(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(uc(e))return e.values;if(Re(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof tc){if(!Xu(e)&&!ec(e)&&!Yu(e))throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(cc(e))return e.toJSON();if(typeof e=="object")return ho(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 ho(e,t){if(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);G(i)||(i!==void 0?r[n]=yo(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:go}))}return r}function lc(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||G(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(yo(o,i))}return r}function uc(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function cc(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:go})}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)}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 pc(e,t){let r=Ye(()=>dc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function dc(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",ft=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 mc(e){return(...t)=>new ft(e,t)}function or(e){return e!=null&&e[ir]===ir}import{Sql as Tm}from"@prisma/client-runtime-utils";import{AsyncResource as Sm}from"node:async_hooks";import{EventEmitter as Am}from"node:events";function gt(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function F(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function fe(e){let t=new Q;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 wo=Symbol.for("nodejs.util.inspect.custom");function U(e,t){let r=fc(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=bo(Reflect.ownKeys(o),r),a=bo(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[wo]=function(){let o={...this};return delete o[wo],o},i}function fc(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 bo(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Le(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function xo(e){if(e===void 0)return"";let t=_e(e);return new Oe(0,{colors:Zt}).write(t).toString()}var yt="<unknown>";function Eo(e){var t=e.split(`
|
|
18
|
-
`);return t.reduce(function(r,n){var i=hc(n)||bc(n)||Pc(n)||vc(n)||Sc(n);return i&&r.push(i),r},[])}var gc=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,yc=/\((\S*)(?::(\d+))(?::(\d+))\)/;function hc(e){var t=gc.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=yc.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]||yt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var wc=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function bc(e){var t=wc.exec(e);return t?{file:t[2],methodName:t[1]||yt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var xc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Ec=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Pc(e){var t=xc.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Ec.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||yt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Tc=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Sc(e){var t=Tc.exec(e);return t?{file:t[3],methodName:t[1]||yt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Ac=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function vc(e){var t=Ac.exec(e);return t?{file:t[2],methodName:t[1]||yt,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=Eo(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 Po={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Ve(e={}){let t=Rc(e);return Object.entries(t).reduce((n,[i,o])=>(Po[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Rc(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 To(e,t){let r=lr(e);return t({action:"aggregate",unpacker:r,argsMapper:Ve})(e)}function kc(e={}){let{select:t,...r}=e;return typeof t=="object"?Ve({...r,_count:t}):Ve({...r,_count:{_all:!0}})}function Oc(e={}){return typeof e.select=="object"?t=>lr(e)(t)._count:t=>lr(e)(t)._count._all}function So(e,t){return t({action:"count",unpacker:Oc(e),argsMapper:kc})(e)}function Ic(e={}){let t=Ve(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 Ao(e,t){return t({action:"groupBy",unpacker:Mc(e),argsMapper:Ic})(e)}function vo(e,t,r){if(t==="aggregate")return n=>To(n,r);if(t==="count")return n=>So(n,r);if(t==="groupBy")return n=>Ao(n,r)}function Co(e,t){let r=t.fields.filter(i=>!i.relationName),n=wi(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 pt(e,o,s.type,s.isList,s.kind==="enum")},...ar(Object.keys(n))})}var Ro=e=>Array.isArray(e)?e:e.split("."),mn=(e,t)=>Ro(t).reduce((r,n)=>r&&r[n],e),ko=(e,t,r)=>Ro(t).reduceRight((n,i,o,s)=>Object.assign({},mn(e,s.slice(0,o)),{[i]:n}),r);function Fc(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Nc(e,t,r){return t===void 0?e??{}:ko(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=Fc(n,i),p=Nc(l,o,c),y=r({dataPath:c,callsite:u})(p),d=Dc(e,t);return new Proxy(y,{get(h,b){if(!d.includes(b))return h[b];let N=[a[b].type,r,b],P=[c,p];return fn(e,...N,...P)},...ar([...d,...Object.getOwnPropertyNames(y)])})}}function Dc(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var _c=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],$c=["aggregate","count","groupBy"];function gn(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Lc(e,t),qc(e,t),gt(r),F("name",()=>t),F("$name",()=>t),F("$parent",()=>e._appliedParent)];return U({},n)}function Lc(e,t){let r=H(t),n=Object.keys(ke).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 _c.includes(o)?fn(e,t,s):Vc(i)?vo(e,i,s):s({})}}}function Vc(e){return $c.includes(e)}function qc(e,t){return fe(F("fields",()=>{let r=e._runtimeDataModel.models[t];return Co(t,r)}))}function Oo(e){return e.replace(/^./,t=>t.toUpperCase())}var yn=Symbol();function ht(e){let t=[jc(e),Uc(e),F(yn,()=>e),F("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(gt(r)),U(e,t)}function jc(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function Uc(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(H),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 Io(e){return e[yn]?e[yn]:e}function Mo(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 ht(t)}function Fo({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))}Bc(e,l.needs)&&s.push(Qc(l,U(e,s)))}return s.length>0||a.length>0?U(e,[...s,...a]):e}function Bc(e,t){return t.every(r=>Xr(e,r))}function Qc(e,t){return fe(F(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&&No({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&No({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function No({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||G(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 Do({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=H(l);return Fo({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}import{Decimal as Hc,ObjectEnumValue as Gc,Sql as $o}from"@prisma/client-runtime-utils";var Jc=["$connect","$disconnect","$on","$transaction","$extends"],_o=Jc;function Lo(e){if(e instanceof $o)return Wc(e);if(or(e))return zc(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=wt(e[n]);return r}let t={};for(let r in e)t[r]=wt(e[r]);return t}function Wc(e){return new $o(e.strings,e.values)}function zc(e){return new ft(e.sql,e.values)}function wt(e){if(typeof e!="object"||e==null||e instanceof Gc||De(e))return e;if(Re(e))return new Hc(e.toFixed());if(Ce(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]=wt(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:wt(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=wt(e[r]);return t}X(e,"Unknown value")}function qo(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:Lo(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Qo(o,l),a.args=s,qo(e,a,r,n+1)}})})}function jo(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 qo(e,t,s)}function Uo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Bo(r,n,0,e):e(r)}}function Bo(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=Qo(i,l),Bo(a,t,r+1,n)}})}var Vo=e=>e;function Qo(e=Vo,t=Vo){return r=>e(t(r))}import{Decimal as Kc}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 qe(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=Jo(e[o]),a=Jo(t[o]);return s&&a&&s.equals(a)}else if(e[o]instanceof Uint8Array||t[o]instanceof Uint8Array){let s=Ho(e[o]),a=Ho(t[o]);return s&&a&&s.equals(a)}else{if(e[o]instanceof Date||t[o]instanceof Date)return Go(e[o])?.getTime()===Go(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 zo(e[o])===zo(t[o])}return hn(e[o],t[o])})}function Jo(e){return cr.isDecimal(e)?e:typeof e=="number"||typeof e=="string"?new cr(e):void 0}function Ho(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 Go(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 zo(e){return typeof e=="number"?e:typeof e=="string"?Number(e):void 0}function bt(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 Zc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Yc(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"?Zc(e)?Xc(e):e.constructor!==null&&e.constructor.name!=="Object"?e:Yc(e,ge):e}function Xc({$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 Kc(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 je(e){if(!pr(e))throw e;let t=ep(e),r=Ko(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??Ko(e)}\``,"P2010",{driverAdapterError:e}):e}function ep(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 Ko(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 Zo(e,t){let r=e.map(i=>t.keys.reduce((o,s)=>(o[s]=ge(i[s]),o),{})),n=new Set(t.nestedSelection);return t.arguments.map(i=>{let o=r.findIndex(s=>qe(s,i));if(o===-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 s=Object.entries(e[o]).filter(([a])=>n.has(a));return Object.fromEntries(s)}})}import{Decimal as tp}from"@prisma/client-runtime-utils";var A=class extends k{name="DataMapperError";constructor(t,r){super(t,"P2023",r)}},Yo=new WeakMap;function rp(e){let t=Yo.get(e);return t||(t=Object.entries(e),Yo.set(e,t)),t}function es(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=>Xo(o,t,r))}if(typeof e=="object")return Xo(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 Xo(e,t,r){if(typeof e!="object")throw new A(`Expected an object, but got '${typeof e}'`);let n={};for(let[i,o]of rp(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]=np(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 np(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"&&!tp.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:op(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:bt(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 ip=/\d{2}:\d{2}:\d{2}(?:\.\d+)?(Z|[+-]\d{2}(:?\d{2})?)?$/;function op(e){let t=ip.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 sp(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 ts(e,t){let r=dr(e,t);return sp(r)}function rs(e,t){return t?`${e} ${t}`:e}var xt;(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"})(xt||(xt={}));function ap(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:xt.CLIENT,attributes:{"db.query.text":e.sql,"db.system.name":ap(r)}},o):o()}function ye(e,t){var r="000000000"+e;return r.substr(r.length-t)}import lp from"node:os";function up(){try{return lp.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var ns=2,cp=ye(process.pid.toString(36),ns),is=up(),pp=is.length,dp=ye(is.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+pp+36).toString(36),ns);function Pn(){return cp+dp}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(),y=o()+o();return l+u+c+p+y}return a.fingerprint=e,a.isCuid=fr,a}var mp=Tn(Pn);var os=mp;var na=pe(zs());import{webcrypto as Zs}from"node:crypto";var Ks="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Xp=128,we,Qe;function ed(e){!we||we.length<e?(we=Buffer.allocUnsafe(e*Xp),Zs.getRandomValues(we),Qe=0):Qe+e>we.length&&(Zs.getRandomValues(we),Qe=0),Qe+=e}function Mn(e=21){ed(e|=0);let t="";for(let r=Qe-e;r<Qe;r++)t+=Ks[we[r]&63];return t}import wr from"node:crypto";var Xs="0123456789ABCDEFGHJKMNPQRSTVWXYZ",vt=32;var td=16,ea=10,Ys=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 rd(e){let t=Math.floor(e()*vt);return t===vt&&(t=vt-1),Xs.charAt(t)}function nd(e){let t=id(),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 id(){return ad()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function od(e,t){let r="";for(;e>0;e--)r=rd(t)+r;return r}function sd(e,t=ea){if(isNaN(e))throw new xe(be.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Ys)throw new xe(be.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Ys}: ${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%vt,n=Xs.charAt(r)+n,e=(e-r)/vt;return n}function ad(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function ta(e,t){let r=t||nd(),n=!e||isNaN(e)?Date.now():e;return sd(n,ea)+od(td,r)}var O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));function br(e,t=0){return(O[e[t+0]]+O[e[t+1]]+O[e[t+2]]+O[e[t+3]]+"-"+O[e[t+4]]+O[e[t+5]]+"-"+O[e[t+6]]+O[e[t+7]]+"-"+O[e[t+8]]+O[e[t+9]]+"-"+O[e[t+10]]+O[e[t+11]]+O[e[t+12]]+O[e[t+13]]+O[e[t+14]]+O[e[t+15]]).toLowerCase()}import{randomFillSync as ld}from"node:crypto";var Er=new Uint8Array(256),xr=Er.length;function Je(){return xr>Er.length-16&&(ld(Er),xr=0),Er.slice(xr,xr+=16)}import{randomUUID as ud}from"node:crypto";var Fn={randomUUID:ud};function cd(e,t,r){if(Fn.randomUUID&&!t&&!e)return Fn.randomUUID();e=e||{};let n=e.random??e.rng?.()??Je();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 Nn=cd;var Dn={};function pd(e,t,r){let n;if(e)n=ra(e.random??e.rng?.()??Je(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=Je();dd(Dn,i,o),n=ra(o,Dn.msecs,Dn.seq,t,r)}return t??br(n)}function dd(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 ra(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=pd;var Pr=class{#t={};constructor(){this.register("uuid",new Ln),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.#t,{now:{value:new $n}})}register(t,r){this.#t[t]=r}},$n=class{#t=new Date;generate(){return this.#t.toISOString()}},Ln=class{generate(t){if(t===4)return Nn();if(t===7)return _n();throw new Error("Invalid UUID generator arguments")}},Vn=class{generate(t){if(t===1)return os();if(t===2)return(0,na.createId)();throw new Error("Invalid CUID generator arguments")}},qn=class{generate(){return ta()}},jn=class{generate(t){if(typeof t=="number")return Mn(t);if(t===void 0)return Mn();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)?fd(e,t):md(e,t)}function md(e,t){if(t.pagination){let{skip:r,take:n,cursor:i}=t.pagination;if(r!==null&&r>0||n===0||i!==null&&!qe(e,i))return null}return oa(e,t.nested)}function oa(e,t){for(let[r,n]of Object.entries(t))e[r]=Tr(e[r],n);return e}function fd(e,t){if(t.distinct!==null){let r=t.linkingFields!==null?[...t.distinct,...t.linkingFields]:t.distinct;e=gd(e,r)}return t.pagination&&(e=yd(e,t.pagination,t.linkingFields)),t.reverse&&e.reverse(),Object.keys(t.nested).length===0?e:e.map(r=>oa(r,t.nested))}function gd(e,t){let r=new Set,n=[];for(let i of e){let o=He(i,t);r.has(o)||(r.add(o),n.push(i))}return n}function yd(e,t,r){if(r===null)return ia(e,t);let n=new Map;for(let o of e){let s=He(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])=>ia(o,t))}function ia(e,{cursor:t,skip:r,take:n}){let i=t!==null?e.findIndex(a=>qe(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 He(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=>B(o,t,r));switch(e.type){case"rawSql":return[bd(e.sql,i,e.argTypes)];case"templateSql":return(e.chunkable?Ed(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 hd(e.fragments,e.placeholderFormat,s,e.argTypes)});default:E(e.type,"Invalid query type")}}function B(e,t,r){for(;xd(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=>B(s,t,r)))}else E(e,`Unexpected unevaluated value type: ${e}`);return Array.isArray(e)&&(e=e.map(n=>B(n,t,r))),e}function hd(e,t,r,n){let i="",o={placeholderNumber:1},s=[],a=[];for(let l of Hn(e,r,n)){if(i+=wd(l,t,o),l.type==="stringChunk")continue;let u=s.length,c=s.push(...sa(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 wd(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 bd(e,t,r){return{sql:e,args:t,argTypes:r}}function xd(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*sa(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 Ed(e,t,r){let n=0,i=0;for(let s of Hn(e,t,void 0)){let a=0;for(let l of sa(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=Pd(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,y)=>p+y.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(y=>[...p,y]));break}}return o}function Pd(e,t){let r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function aa(e){return e.rows.map(t=>t.reduce((r,n,i)=>(r[e.columnNames[i]]=n,r),{}))}function la(e){return{columns:e.columnNames,types:e.columnTypes.map(t=>Td(t)),rows:e.rows.map(t=>t.map((r,n)=>Ct(r,e.columnTypes[n])))}}function Ct(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=>Ct(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=>Ct(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=>Ct(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=>Ct(r,m.Boolean));default:return e}}function Td(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 ua(e,t,r){if(!t.every(n=>Wn(e,n))){let n=Sd(e,r),i=Ad(r);throw new k(n,i,r.context)}}function Wn(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 Sd(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 Ad(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 Rt=class e{#t;#e=new Pr;#r;#n;#o;#i;#s;constructor({onQuery:t,tracingHelper:r,serializer:n,rawSerializer:i,provider:o,connectionInfo:s}){this.#t=t,this.#r=r,this.#n=n,this.#o=i??n,this.#i=o,this.#s=s}static forSql(t){return new e({onQuery:t.onQuery,tracingHelper:t.tracingHelper,serializer:aa,rawSerializer:la,provider:t.provider,connectionInfo:t.connectionInfo})}async run(t,r){let{value:n}=await this.interpretNode(t,{...r,generators:this.#e.snapshot()}).catch(i=>je(i));return n}async interpretNode(t,r){switch(t.type){case"value":return{value:B(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(!ca(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(zn(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)=>z(i)+z(o)):0}}case"execute":{let n=Gn(t.args,r.scope,r.generators,this.#a()),i=0;for(let o of n){let s=pa(o,r.sqlCommenter);i+=await this.#u(s,r.queryable,()=>r.queryable.executeRaw(s).catch(a=>t.args.type==="rawSql"?bn(a):je(a)))}return{value:i}}case"query":{let n=Gn(t.args,r.scope,r.generators,this.#a()),i;for(let o of n){let s=pa(o,r.sqlCommenter),a=await this.#u(s,r.queryable,()=>r.queryable.queryRaw(s).catch(l=>t.args.type==="rawSql"?bn(l):je(l)));i===void 0?i=a:(i.rows.push(...a.rows),i.lastInsertId=a.lastInsertId)}return{value:t.args.type==="rawSql"?this.#o(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(ca(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:da(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:vd(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:es(n,t.args.structure,t.args.enums),lastInsertId:i}}case"validate":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r);return ua(n,t.args.rules,t.args),{value:n,lastInsertId:i}}case"if":{let{value:n}=await this.interpretNode(t.args.value,r);return Wn(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?He(Sr(a),t.args.fields):null,s=new Set(zn(i).map(o));return{value:zn(n).filter(a=>!s.has(o(a)))}}case"process":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r);return{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]=Cd(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]=Rd(a,o[s],r.scope,r.generators);return{value:o,lastInsertId:i}}default:E(t,`Unexpected node type: ${t.type}`)}}#a(){return this.#s?.maxBindValues!==void 0?this.#s.maxBindValues:this.#l()}#l(){if(this.#i!==void 0)switch(this.#i){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.#i,`Unexpected provider: ${this.#i}`)}}#u(t,r,n){return mr({query:t,execute:n,provider:this.#i??r.provider,tracingHelper:this.#r,onQuery:this.#t})}};function ca(e){return Array.isArray(e)?e.length===0:e==null}function zn(e){return Array.isArray(e)?e:[e]}function z(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 da(e,t){return Array.isArray(e)?e.map(r=>da(r,t)):typeof e=="object"&&e!==null?e[t]??null:e}function vd(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=He(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=He(Sr(a),o);for(let u of s[l]??[])r.isRelationUnique?u[r.parentField]=a:u[r.parentField].push(a)}}return e}function Cd(e,t,r,n){switch(e.type){case"value":return B(e.value,r,n);case"lastInsertId":return t;default:E(e,`Unexpected field initializer type: ${e.type}`)}}function Rd(e,t,r,n){switch(e.type){case"set":return B(e.value,r,n);case"add":return z(t)+z(B(e.value,r,n));case"subtract":return z(t)-z(B(e.value,r,n));case"multiply":return z(t)*z(B(e.value,r,n));case"divide":{let i=z(t),o=z(B(e.value,r,n));return o===0?null:i/o}default:E(e,`Unexpected field operation type: ${e.type}`)}}function pa(e,t){if(!t||t.plugins.length===0)return e;let r=ts(t.plugins,{query:t.queryInfo,sql:e.sql});return r?{...e,sql:rs(e.sql,r)}:e}async function kd(){return globalThis.crypto??await import("node:crypto")}async function ma(){return(await kd()).randomUUID()}async function fa(e,t){return new Promise(r=>{e.addEventListener(t,r,{once:!0})})}var V=class extends k{name="TransactionManagerError";constructor(t,r){super("Transaction API error: "+t,"P2028",r)}},kt=class extends V{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 V{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction.`)}},vr=class extends V{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back.`)}},Cr=class extends V{constructor(){super("Unable to start a transaction in the given time.")}},Rr=class extends V{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})}},Ge=class extends V{constructor(t){super(`Internal Consistency Error: ${t}`)}},kr=class extends V{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var Od=100,We=M("prisma:client:transactionManager"),Id=()=>({sql:"COMMIT",args:[],argTypes:[]}),Md=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),Fd=()=>({sql:'-- Implicit "COMMIT" query via underlying driver',args:[],argTypes:[]}),Nd=()=>({sql:'-- Implicit "ROLLBACK" query via underlying driver',args:[],argTypes:[]}),Ot=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;#t;#e;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n,onQuery:i,provider:o}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n,this.#t=i,this.#e=o}async startInternalTransaction(t){let r=t!==void 0?this.#s(t):{};return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(r))}async startTransaction(t){let r=t!==void 0?this.#s(t):this.transactionOptions;return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(r))}async#r(t){let r={id:await ma(),status:"waiting",timer:void 0,timeout:t.timeout,startedAt:Date.now(),transaction:void 0},n=new AbortController,i=ga(()=>n.abort(),t.maxWait);i?.unref?.();let o=this.driverAdapter.startTransaction(t.isolationLevel).catch(je);switch(r.transaction=await Promise.race([o.finally(()=>clearTimeout(i)),fa(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=>We("error in discarded transaction:",s)),await this.#i(r,"timed_out"),new Cr;return r.status="running",r.timer=this.#o(r.id,t.timeout),{id:r.id};case"timed_out":case"running":case"committed":case"rolled_back":throw new Ge(`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.#i(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.#n(t,"rollback");await this.#i(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 kt;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(We("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"closing":case"waiting":case"running":throw new Ge("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 We("Transaction not found.",t),new kt}if(["committed","rolled_back","timed_out"].includes(n.status))throw new Ge("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.#i(t,"rolled_back")))}#o(t,r){let n=Date.now(),i=ga(async()=>{We("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let o=this.transactions.get(t);o&&["running","waiting"].includes(o.status)?await this.#i(o,"timed_out"):We("Transaction already committed or rolled back when timeout happened.",t)},r);return i?.unref?.(),i}async#i(t,r){let n=async()=>{We("Closing transaction.",{transactionId:t.id,status:r});try{if(t.transaction&&r==="committed")if(t.transaction.options.usePhantomQuery)await this.#a(Fd(),t.transaction,()=>t.transaction.commit());else{let i=Id();await this.#a(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.#a(Nd(),t.transaction,()=>t.transaction.rollback());else{let i=Md();try{await this.#a(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>Od&&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}#s(t){if(!t.timeout)throw new V("timeout is required");if(!t.maxWait)throw new V("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new kr(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}#a(t,r,n){return mr({query:t,execute:n,provider:this.#e??r.provider,tracingHelper:this.tracingHelper,onQuery:this.#t})}};function ga(e,t){return t!==void 0?setTimeout(e,t):void 0}import{PrismaClientInitializationError as ei,PrismaClientKnownRequestError as ti,PrismaClientRustPanicError as It,PrismaClientUnknownRequestError as Vr}from"@prisma/client-runtime-utils";var Or="7.3.0-integration-parameterization.11";var ya={bigint:"bigint",date:"datetime",decimal:"decimal",bytes:"bytes"};function wa(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=>ba(i)),n=t.map(i=>_d(i));return{args:r,argTypes:n}}function ba(e){if(Array.isArray(e))return e.map(t=>ba(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 _d(e){return Array.isArray(e)?{scalarType:e.length>0?ha(e[0]):"unknown",arity:"list"}:{scalarType:ha(e),arity:"scalar"}}function ha(e){return typeof e=="object"&&e!==null&&"prisma__type"in e&&typeof e.prisma__type=="string"&&e.prisma__type in ya?ya[e.prisma__type]:typeof e=="number"?"decimal":typeof e=="string"?"string":"unknown"}function xa(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Ea(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function Pa(e){return e.split(`
|
|
13
|
+
`)}};var gu={red:de,gray:nt,dim:Xe,bold:q,underline:et,highlightSource:e=>e.highlight()},yu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function hu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function wu({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=hu({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=Gt.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=xu(c),y=bu(c);if(!y)return s;s.functionName=`${y.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,h=>h.slice(0,y.openingBraceIndex))),u=o.highlightSource(u);let d=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((h,b)=>o.gray(String(b).padStart(d))+" "+h).mapLines(h=>o.dim(h)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let h=p+d+1;h+=2,s.callArguments=(0,Ji.default)(i,h).slice(h)}}return s}function bu(e){let t=Object.keys(ke).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 xu(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function Eu({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(Pu(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 Pu(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function Wt(e){let t=e.showColors?gu:yu,r;return r=wu(e,t),Eu(r,t)}var eo=pe(nn());function zi(e,t,r){let n=Ki(e),i=Tu(n),o=Au(i);o?zt(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Ki(e){return e.errors.flatMap(t=>t.kind==="Union"?Ki(t):[t])}function Tu(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:Su(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Su(e,t){return[...new Set(e.concat(t))]}function Au(e){return rn(e,(t,r)=>{let n=Gi(t),i=Gi(r);return n!==i?n-i:Wi(t)-Wi(r)})}function Gi(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 $=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)}};Yi();var Oe=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}};Zi();var Kt=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var Zt=e=>e,Yt={bold:Zt,red:Zt,green:Zt,dim:Zt,enabled:!1},Xi={bold:q,red:de,green:tt,dim:Xe,enabled:!0},Ie={write(e){e.writeLine(",")}};var J=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 oe=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var Me=class extends oe{items=[];addItem(t){return this.items.push(new Kt(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 J("[]");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 Fe=class e extends oe{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 Me&&(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 J("{}");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 oe{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new J(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var ut=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":vu(e,t);break;case"IncludeOnScalar":Cu(e,t);break;case"EmptySelection":Ru(e,t,r);break;case"UnknownSelectionField":Mu(e,t);break;case"InvalidSelectionValue":Fu(e,t);break;case"UnknownArgument":Nu(e,t);break;case"UnknownInputField":_u(e,t);break;case"RequiredArgumentMissing":Du(e,t);break;case"InvalidArgumentType":$u(e,t);break;case"InvalidArgumentValue":Lu(e,t);break;case"ValueTooLarge":Vu(e,t);break;case"SomeFieldsMissing":qu(e,t);break;case"TooManyFieldsGiven":ju(e,t);break;case"Union":zi(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function vu(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 Cu(e,t){let[r,n]=Ne(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 $(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)}. ${ct(s)}`:a+=".",a+=`
|
|
16
|
+
Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Ru(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){ku(e,t,i);return}if(n.hasField("select")){Ou(e,t);return}}if(r?.[ie(e.outputType.name)]){Iu(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function ku(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new $(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 Ou(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),no(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${ct(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Iu(e,t){let r=new ut;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new $("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=Ne(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new Fe;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 Mu(e,t){let r=io(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":no(n,e.outputType);break;case"include":Uu(n,e.outputType);break;case"omit":Bu(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(ct(n)),i.join(" ")})}function Fu(e,t){let r=io(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 Nu(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Qu(n,e.arguments)),t.addErrorMessage(i=>to(i,r,e.arguments.map(o=>o.name)))}function _u(e,t){let[r,n]=Ne(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&oo(o,e.inputType)}t.addErrorMessage(o=>to(o,n,e.inputType.fields.map(s=>s.name)))}function to(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Hu(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(ct(e)),n.join(" ")}function Du(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]=Ne(e.argumentPath),s=new ut,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 $(o,s).makeRequired())}else{let l=e.inputTypes.map(ro).join(" | ");a.addSuggestion(new $(o,l).makeRequired())}if(e.dependentArgumentPath){n.getDeepField(e.dependentArgumentPath)?.markAsError();let[,l]=Ne(e.dependentArgumentPath);t.addErrorMessage(u=>`Argument \`${u.green(o)}\` is required because argument \`${u.green(l)}\` was provided.`)}}}function ro(e){return e.kind==="list"?`${ro(e.elementType)}[]`:e.name}function $u(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=Xt("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 Lu(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=Xt("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Vu(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 qu(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&&oo(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")} ${Xt("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(ct(i)),o.join(" ")})}function ju(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 ${Xt("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function no(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new $(r.name,"true"))}function Uu(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new $(r.name,"true"))}function Bu(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new $(r.name,"true"))}function Qu(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new $(r.name,r.typeNames.join(" | ")))}function io(e,t){let[r,n]=Ne(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 oo(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new $(r.name,r.typeNames.join(" | ")))}function Ne(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function ct({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Xt(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Ju=3;function Hu(e,t){let r=1/0,n;for(let i of t){let o=(0,eo.default)(e,i);o>Ju||o<r&&(r=o,n=i)}return n}import{ObjectEnumValue as Gu}from"@prisma/client-runtime-utils";var pt=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 _e(e){return e instanceof pt}var so=": ",er=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+so.length}write(t){let r=new J(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(so).write(this.value)}};var sn=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 De(e){return new sn(ao(e))}function ao(e){let t=new Fe;for(let[r,n]of Object.entries(e)){let i=new er(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(Re(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=Qt(e)?e.toISOString():"Invalid Date";return new R(`new Date("${t}")`)}return e instanceof Gu?new R(`Prisma.${e._getName()}`):_e(e)?new R(`prisma.${ie(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Wu(e):typeof e=="object"?ao(e):new R(Object.prototype.toString.call(e))}function Wu(e){let t=new Me;for(let r of e)t.addItem(lo(r));return t}function tr(e,t){let r=t==="pretty"?Xi:Yt,n=e.renderAllMessages(r),i=new Oe(0,{colors:r}).write(e).toString();return{message:n,args:i}}function rr({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=De(e);for(let p of t)zt(p,a,s);let{message:l,args:u}=tr(a,r),c=Wt({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new zu(c,{clientVersion:o})}function H(e){return e.replace(/^./,t=>t.toLowerCase())}function co(e,t,r){let n=H(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Ku({...e,...uo(t.name,e,t.result.$allModels),...uo(t.name,e,t.result[n])})}function Ku(e){let t=new Q,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 Bt(e,n=>({...n,needs:r(n.name,new Set)}))}function uo(e,t,r){return r?Bt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Zu(t,o,i)})):{}}function Zu(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 nr=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new Q;modelExtensionsCache=new Q;queryCallbacksCache=new Q;clientExtensions=Ye(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=Ye(()=>{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=H(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 nr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new nr(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 ir=class{constructor(t){this.name=t}};function fo(e){return e instanceof ir}function Yu(e){return new ir(e)}var go=Symbol(),dt=class{constructor(t){if(t!==go)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?an:t}},an=new dt(go);function G(e){return e instanceof dt}var nc={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 un({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=$e.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c}){let p=new ln({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c});return{modelName:e,action:nc[t],query:mt(r,p)}}function mt({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:wo(r,n),selection:ic(e,t,i,n)}}function ic(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()}),lc(e,n)):oc(n,t,r)}function oc(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&sc(n,t,e),ac(n,r,e),n}function sc(e,t,r){for(let[n,i]of Object.entries(t)){if(G(i))continue;let o=r.nestSelection(n);if(cn(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]=mt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=mt(i,o)}}function ac(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=mo(i,n);for(let[s,a]of Object.entries(o)){if(G(a))continue;cn(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function lc(e,t){let r={},n=t.getComputedFields(),i=po(e,n);for(let[o,s]of Object.entries(i)){if(G(s))continue;let a=t.nestSelection(o);cn(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||G(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=mt({},a):r[o]=!0;continue}r[o]=mt(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(Ce(e)){if(Qt(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(_e(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return uc(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(cc(e))return e.values;if(Re(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof rc){if(!ec(e)&&!tc(e)&&!Xu(e))throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(pc(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(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);G(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 uc(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||G(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 cc(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function pc(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function cn(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:yo})}var ln=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){rr({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)}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 dc(e,t){let r=Ye(()=>mc(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function mc(e){return{datamodel:{models:pn(e.models),enums:pn(e.enums),types:pn(e.types)}}}function pn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var dn=new WeakMap,or="$$PrismaTypedSql",ft=class{constructor(t,r){dn.set(this,{sql:t,values:r}),Object.defineProperty(this,or,{value:or})}get sql(){return dn.get(this).sql}get values(){return dn.get(this).values}};function fc(e){return(...t)=>new ft(e,t)}function sr(e){return e!=null&&e[or]===or}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 gt(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function F(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function fe(e){let t=new Q;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var ar={enumerable:!0,configurable:!0,writable:!0};function lr(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>ar,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 U(e,t){let r=gc(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?{...ar,...l?.getPropertyDescriptor(s)}:ar: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 gc(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=De(e);return new Oe(0,{colors:Yt}).write(t).toString()}var yt="<unknown>";function Po(e){var t=e.split(`
|
|
18
|
+
`);return t.reduce(function(r,n){var i=wc(n)||xc(n)||Tc(n)||Cc(n)||Ac(n);return i&&r.push(i),r},[])}var yc=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,hc=/\((\S*)(?::(\d+))(?::(\d+))\)/;function wc(e){var t=yc.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=hc.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]||yt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var bc=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function xc(e){var t=bc.exec(e);return t?{file:t[2],methodName:t[1]||yt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Ec=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Pc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Tc(e){var t=Ec.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Pc.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||yt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Sc=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Ac(e){var t=Sc.exec(e);return t?{file:t[3],methodName:t[1]||yt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var vc=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Cc(e){var t=vc.exec(e);return t?{file:t[2],methodName:t[1]||yt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var mn=class{getLocation(){return null}},fn=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=en(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 mn:new fn}var To={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Ve(e={}){let t=kc(e);return Object.entries(t).reduce((n,[i,o])=>(To[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function kc(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function ur(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function So(e,t){let r=ur(e);return t({action:"aggregate",unpacker:r,argsMapper:Ve})(e)}function Oc(e={}){let{select:t,...r}=e;return typeof t=="object"?Ve({...r,_count:t}):Ve({...r,_count:{_all:!0}})}function Ic(e={}){return typeof e.select=="object"?t=>ur(e)(t)._count:t=>ur(e)(t)._count._all}function Ao(e,t){return t({action:"count",unpacker:Ic(e),argsMapper:Oc})(e)}function Mc(e={}){let t=Ve(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 pt(e,o,s.type,s.isList,s.kind==="enum")},...lr(Object.keys(n))})}var ko=e=>Array.isArray(e)?e:e.split("."),gn=(e,t)=>ko(t).reduce((r,n)=>r&&r[n],e),Oo=(e,t,r)=>ko(t).reduceRight((n,i,o,s)=>Object.assign({},gn(e,s.slice(0,o)),{[i]:n}),r);function Nc(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function _c(e,t,r){return t===void 0?e??{}:Oo(t,r,e||!0)}function yn(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=Nc(n,i),p=_c(l,o,c),y=r({dataPath:c,callsite:u})(p),d=Dc(e,t);return new Proxy(y,{get(h,b){if(!d.includes(b))return h[b];let N=[a[b].type,r,b],P=[c,p];return yn(e,...N,...P)},...lr([...d,...Object.getOwnPropertyNames(y)])})}}function Dc(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var $c=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Lc=["aggregate","count","groupBy"];function hn(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Vc(e,t),jc(e,t),gt(r),F("name",()=>t),F("$name",()=>t),F("$parent",()=>e._appliedParent)];return U({},n)}function Vc(e,t){let r=H(t),n=Object.keys(ke).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 $c.includes(o)?yn(e,t,s):qc(i)?Co(e,i,s):s({})}}}function qc(e){return Lc.includes(e)}function jc(e,t){return fe(F("fields",()=>{let r=e._runtimeDataModel.models[t];return Ro(t,r)}))}function Io(e){return e.replace(/^./,t=>t.toUpperCase())}var wn=Symbol();function ht(e){let t=[Uc(e),Bc(e),F(wn,()=>e),F("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(gt(r)),U(e,t)}function Uc(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function Bc(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(H),n=[...new Set(t.concat(r))];return fe({getKeys(){return n},getPropertyValue(i){let o=Io(i);if(e._runtimeDataModel.models[o]!==void 0)return hn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return hn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Mo(e){return e[wn]?e[wn]: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 ht(t)}function No({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))}Qc(e,l.needs)&&s.push(Jc(l,U(e,s)))}return s.length>0||a.length>0?U(e,[...s,...a]):e}function Qc(e,t){return t.every(r=>tn(e,r))}function Jc(e,t){return fe(F(e.name,()=>e.compute(t)))}function cr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=cr({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||G(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]=cr({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Do({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:cr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=H(l);return No({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}import{Decimal as Gc,ObjectEnumValue as Wc,Sql as Lo}from"@prisma/client-runtime-utils";var Hc=["$connect","$disconnect","$on","$transaction","$extends"],$o=Hc;function Vo(e){if(e instanceof Lo)return zc(e);if(sr(e))return Kc(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=wt(e[n]);return r}let t={};for(let r in e)t[r]=wt(e[r]);return t}function zc(e){return new Lo(e.strings,e.values)}function Kc(e){return new ft(e.sql,e.values)}function wt(e){if(typeof e!="object"||e==null||e instanceof Wc||_e(e))return e;if(Re(e))return new Gc(e.toFixed());if(Ce(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]=wt(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:wt(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=wt(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 Zc}from"@prisma/client-runtime-utils";import{Decimal as pr}from"@prisma/client-runtime-utils";function E(e,t){throw new Error(t)}function bn(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=>bn(e[r],t[r]))}function qe(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(pr.isDecimal(e[o])||pr.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 Wo(e[o])?.getTime()===Wo(t[o])?.getTime();if(typeof e[o]=="bigint"||typeof t[o]=="bigint")return zo(e[o])===zo(t[o]);if(typeof e[o]=="number"||typeof t[o]=="number")return Ko(e[o])===Ko(t[o])}return bn(e[o],t[o])})}function Ho(e){return pr.isDecimal(e)?e:typeof e=="number"||typeof e=="string"?new pr(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 Wo(e){return e instanceof Date?e:typeof e=="string"||typeof e=="number"?new Date(e):void 0}function zo(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 bt(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 Yc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Xc(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"?Yc(e)?ep(e):e.constructor!==null&&e.constructor.name!=="Object"?e:Xc(e,ge):e}function ep({$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 Zc(t);case"Json":return JSON.parse(t);default:E(t,"Unknown tagged value")}}function dr(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 je(e){if(!dr(e))throw e;let t=tp(e),r=Zo(e);throw!t||!r?e:new k(r,t,{driverAdapterError:e})}function En(e){throw dr(e)?new k(`Raw query failed. Code: \`${e.cause.originalCode??"N/A"}\`. Message: \`${e.cause.originalMessage??Zo(e)}\``,"P2010",{driverAdapterError:e}):e}function tp(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 ${xn(e.cause.constraint)}`;case"ForeignKeyConstraintViolation":return`Foreign key constraint violated on the ${xn(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 ${xn(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 xn(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 rp(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 np(e){return"prisma__type"in e?e.prisma__value?.name:e.value.name}function ip(e,t){let r={};for(let[n,i]of Object.entries(e))if(r[n]=i,rp(i)){let o=np(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=ip(o,r),a=n.findIndex(l=>qe(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 op}from"@prisma/client-runtime-utils";var A=class extends k{name="DataMapperError";constructor(t,r){super(t,"P2023",r)}},Xo=new WeakMap;function sp(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 Tn(e,t.fields,r,t.skipNulls);case"field":return Pn(e,"<result>",t.fieldType,r);default:E(t,`Invalid data mapping type: '${t.type}'`)}}function Tn(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 Tn(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 sp(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]=Tn(u,a,r,l);break}case"field":{let s=o.dbName;if(Object.hasOwn(e,s))n[i]=ap(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 ap(e,t,r,n){return e===null?r.arity==="list"?[]:null:r.arity==="list"?e.map((o,s)=>Pn(o,`${t}[${s}]`,r,n)):Pn(e,t,r,n)}function Pn(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"&&!op.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:up(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:bt(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 lp=/\d{2}:\d{2}:\d{2}(?:\.\d+)?(Z|[+-]\d{2}(:?\d{2})?)?$/;function up(e){let t=lp.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 cp(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 mr(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 rs(e,t){let r=mr(e,t);return cp(r)}function ns(e,t){return t?`${e} ${t}`:e}var xt;(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"})(xt||(xt={}));function pp(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 fr({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:xt.CLIENT,attributes:{"db.query.text":e.sql,"db.system.name":pp(r)}},o):o()}function ye(e,t){var r="000000000"+e;return r.substr(r.length-t)}import dp from"node:os";function mp(){try{return dp.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var is=2,fp=ye(process.pid.toString(36),is),os=mp(),gp=os.length,yp=ye(os.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+gp+36).toString(36),is);function Sn(){return fp+yp}function gr(e){return typeof e=="string"&&/^c[a-z0-9]{20,32}$/.test(e)}function An(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(),y=o()+o();return l+u+c+p+y}return a.fingerprint=e,a.isCuid=gr,a}var hp=An(Sn);var ss=hp;var ia=pe(Ks());import{webcrypto as Ys}from"node:crypto";var Zs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var nd=128,we,Qe;function id(e){!we||we.length<e?(we=Buffer.allocUnsafe(e*nd),Ys.getRandomValues(we),Qe=0):Qe+e>we.length&&(Ys.getRandomValues(we),Qe=0),Qe+=e}function Nn(e=21){id(e|=0);let t="";for(let r=Qe-e;r<Qe;r++)t+=Zs[we[r]&63];return t}import br from"node:crypto";var ea="0123456789ABCDEFGHJKMNPQRSTVWXYZ",vt=32;var od=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 sd(e){let t=Math.floor(e()*vt);return t===vt&&(t=vt-1),ea.charAt(t)}function ad(e){let t=ld(),r=t&&(t.crypto||t.msCrypto)||(typeof br<"u"?br: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(br?.randomBytes)return()=>br.randomBytes(1).readUInt8()/255;throw new xe(be.PRNGDetectFailure,"Failed to find a reliable PRNG")}function ld(){return pd()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function ud(e,t){let r="";for(;e>0;e--)r=sd(t)+r;return r}function cd(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%vt,n=ea.charAt(r)+n,e=(e-r)/vt;return n}function pd(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function ra(e,t){let r=t||ad(),n=!e||isNaN(e)?Date.now():e;return cd(n,ta)+ud(od,r)}var O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));function xr(e,t=0){return(O[e[t+0]]+O[e[t+1]]+O[e[t+2]]+O[e[t+3]]+"-"+O[e[t+4]]+O[e[t+5]]+"-"+O[e[t+6]]+O[e[t+7]]+"-"+O[e[t+8]]+O[e[t+9]]+"-"+O[e[t+10]]+O[e[t+11]]+O[e[t+12]]+O[e[t+13]]+O[e[t+14]]+O[e[t+15]]).toLowerCase()}import{randomFillSync as dd}from"node:crypto";var Pr=new Uint8Array(256),Er=Pr.length;function Je(){return Er>Pr.length-16&&(dd(Pr),Er=0),Pr.slice(Er,Er+=16)}import{randomUUID as md}from"node:crypto";var _n={randomUUID:md};function fd(e,t,r){if(_n.randomUUID&&!t&&!e)return _n.randomUUID();e=e||{};let n=e.random??e.rng?.()??Je();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 xr(n)}var Dn=fd;var $n={};function gd(e,t,r){let n;if(e)n=na(e.random??e.rng?.()??Je(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=Je();yd($n,i,o),n=na(o,$n.msecs,$n.seq,t,r)}return t??xr(n)}function yd(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 Ln=gd;var Tr=class{#t={};constructor(){this.register("uuid",new qn),this.register("cuid",new jn),this.register("ulid",new Un),this.register("nanoid",new Bn),this.register("product",new Qn)}snapshot(){return Object.create(this.#t,{now:{value:new Vn}})}register(t,r){this.#t[t]=r}},Vn=class{#t=new Date;generate(){return this.#t.toISOString()}},qn=class{generate(t){if(t===4)return Dn();if(t===7)return Ln();throw new Error("Invalid UUID generator arguments")}},jn=class{generate(t){if(t===1)return ss();if(t===2)return(0,ia.createId)();throw new Error("Invalid CUID generator arguments")}},Un=class{generate(){return ra()}},Bn=class{generate(t){if(typeof t=="number")return Nn(t);if(t===void 0)return Nn();throw new Error("Invalid Nanoid generator arguments")}},Qn=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 Sr(e,t){return e==null?e:typeof e=="string"?Sr(JSON.parse(e),t):Array.isArray(e)?wd(e,t):hd(e,t)}function hd(e,t){if(t.pagination){let{skip:r,take:n,cursor:i}=t.pagination;if(r!==null&&r>0||n===0||i!==null&&!qe(e,i))return null}return sa(e,t.nested)}function sa(e,t){for(let[r,n]of Object.entries(t))e[r]=Sr(e[r],n);return e}function wd(e,t){if(t.distinct!==null){let r=t.linkingFields!==null?[...t.distinct,...t.linkingFields]:t.distinct;e=bd(e,r)}return t.pagination&&(e=xd(e,t.pagination,t.linkingFields)),t.reverse&&e.reverse(),Object.keys(t.nested).length===0?e:e.map(r=>sa(r,t.nested))}function bd(e,t){let r=new Set,n=[];for(let i of e){let o=He(i,t);r.has(o)||(r.add(o),n.push(i))}return n}function xd(e,t,r){if(r===null)return oa(e,t);let n=new Map;for(let o of e){let s=He(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=>qe(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 He(e,t){return JSON.stringify(t.map(r=>e[r]))}function Jn(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}function Hn(e){return typeof e=="object"&&e!==null&&e.prisma__type==="generatorCall"}function zn(e,t,r,n){let i=e.args.map(o=>B(o,t,r));switch(e.type){case"rawSql":return[Td(e.sql,i,e.argTypes)];case"templateSql":return(e.chunkable?Ad(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 Ed(e.fragments,e.placeholderFormat,s,e.argTypes)});default:E(e.type,"Invalid query type")}}function B(e,t,r){for(;Sd(e);)if(Jn(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(Hn(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=>B(s,t,r)))}else E(e,`Unexpected unevaluated value type: ${e}`);return Array.isArray(e)&&(e=e.map(n=>B(n,t,r))),e}function Ed(e,t,r,n){let i="",o={placeholderNumber:1},s=[],a=[];for(let l of Wn(e,r,n)){if(i+=Pd(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 Pd(e,t,r){let n=e.type;switch(n){case"parameter":return Gn(t,r.placeholderNumber++);case"stringChunk":return e.chunk;case"parameterTuple":return`(${e.value.length==0?"NULL":e.value.map(()=>Gn(t,r.placeholderNumber++)).join(",")})`;case"parameterTupleList":return e.value.map(i=>{let o=i.map(()=>Gn(t,r.placeholderNumber++)).join(e.itemSeparator);return`${e.itemPrefix}${o}${e.itemSuffix}`}).join(e.groupSeparator);default:E(n,"Invalid fragment type")}}function Gn(e,t){return e.hasNumbering?`${e.prefix}${t}`:e.prefix}function Td(e,t,r){return{sql:e,args:t,argTypes:r}}function Sd(e){return Jn(e)||Hn(e)}function*Wn(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 Ad(e,t,r){let n=0,i=0;for(let s of Wn(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 Wn(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=vd(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,y)=>p+y.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(y=>[...p,y]));break}}return o}function vd(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=>Cd(t)),rows:e.rows.map(t=>t.map((r,n)=>Ct(r,e.columnTypes[n])))}}function Ct(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=>Ct(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=>Ct(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=>Ct(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=>Ct(r,m.Boolean));default:return e}}function Cd(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=>Kn(e,n))){let n=Rd(e,r),i=kd(r);throw new k(n,i,r.context)}}function Kn(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 Rd(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 kd(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 Rt=class e{#t;#e=new Tr;#r;#n;#o;#i;#s;constructor({onQuery:t,tracingHelper:r,serializer:n,rawSerializer:i,provider:o,connectionInfo:s}){this.#t=t,this.#r=r,this.#n=n,this.#o=i??n,this.#i=o,this.#s=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.#e.snapshot()}).catch(i=>je(i));return n}async interpretNode(t,r){switch(t.type){case"value":return{value:B(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(Zn(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)=>z(i)+z(o)):0}}case"execute":{let n=zn(t.args,r.scope,r.generators,this.#a()),i=0;for(let o of n){let s=da(o,r.sqlCommenter);i+=await this.#u(s,r.queryable,()=>r.queryable.executeRaw(s).catch(a=>t.args.type==="rawSql"?En(a):je(a)))}return{value:i}}case"query":{let n=zn(t.args,r.scope,r.generators,this.#a()),i;for(let o of n){let s=da(o,r.sqlCommenter),a=await this.#u(s,r.queryable,()=>r.queryable.queryRaw(s).catch(l=>t.args.type==="rawSql"?En(l):je(l)));i===void 0?i=a:(i.rows.push(...a.rows),i.lastInsertId=a.lastInsertId)}return{value:t.args.type==="rawSql"?this.#o(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:Od(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 Kn(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?He(Ar(a),t.args.fields):null,s=new Set(Zn(i).map(o));return{value:Zn(n).filter(a=>!s.has(o(a)))}}case"process":{let{value:n,lastInsertId:i}=await this.interpretNode(t.args.expr,r);return{value:Sr(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]=Id(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?{}:Ar(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}`)}}#a(){return this.#s?.maxBindValues!==void 0?this.#s.maxBindValues:this.#l()}#l(){if(this.#i!==void 0)switch(this.#i){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.#i,`Unexpected provider: ${this.#i}`)}}#u(t,r,n){return fr({query:t,execute:n,provider:this.#i??r.provider,tracingHelper:this.#r,onQuery:this.#t})}};function pa(e){return Array.isArray(e)?e.length===0:e==null}function Zn(e){return Array.isArray(e)?e:[e]}function z(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function Ar(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 Od(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=Ar(a),u=He(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=He(Ar(a),o);for(let u of s[l]??[])r.isRelationUnique?u[r.parentField]=a:u[r.parentField].push(a)}}return e}function Id(e,t,r,n){switch(e.type){case"value":return B(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 B(e.value,r,n);case"add":return z(t)+z(B(e.value,r,n));case"subtract":return z(t)-z(B(e.value,r,n));case"multiply":return z(t)*z(B(e.value,r,n));case"divide":{let i=z(t),o=z(B(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}async function Fd(){return globalThis.crypto??await import("node:crypto")}async function fa(){return(await Fd()).randomUUID()}async function ga(e,t){return new Promise(r=>{e.addEventListener(t,r,{once:!0})})}var V=class extends k{name="TransactionManagerError";constructor(t,r){super("Transaction API error: "+t,"P2028",r)}},kt=class extends V{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.")}},vr=class extends V{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction.`)}},Cr=class extends V{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back.`)}},Rr=class extends V{constructor(){super("Unable to start a transaction in the given time.")}},kr=class extends V{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})}},Ge=class extends V{constructor(t){super(`Internal Consistency Error: ${t}`)}},Or=class extends V{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var Nd=100,We=M("prisma:client:transactionManager"),_d=()=>({sql:"COMMIT",args:[],argTypes:[]}),Dd=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),$d=()=>({sql:'-- Implicit "COMMIT" query via underlying driver',args:[],argTypes:[]}),Ld=()=>({sql:'-- Implicit "ROLLBACK" query via underlying driver',args:[],argTypes:[]}),Ot=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;#t;#e;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n,onQuery:i,provider:o}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n,this.#t=i,this.#e=o}async startInternalTransaction(t){let r=t!==void 0?this.#s(t):{};return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(r))}async startTransaction(t){let r=t!==void 0?this.#s(t):this.transactionOptions;return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#r(r))}async#r(t){let r={id:await fa(),status:"waiting",timer:void 0,timeout:t.timeout,startedAt:Date.now(),transaction:void 0},n=new AbortController,i=ya(()=>n.abort(),t.maxWait);i?.unref?.();let o=this.driverAdapter.startTransaction(t.isolationLevel).catch(je);switch(r.transaction=await Promise.race([o.finally(()=>clearTimeout(i)),ga(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=>We("error in discarded transaction:",s)),await this.#i(r,"timed_out"),new Rr;return r.status="running",r.timer=this.#o(r.id,t.timeout),{id:r.id};case"timed_out":case"running":case"committed":case"rolled_back":throw new Ge(`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.#i(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.#n(t,"rollback");await this.#i(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 kt;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(We("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"closing":case"waiting":case"running":throw new Ge("Active transaction found in closed transactions list.");case"committed":throw new vr(r);case"rolled_back":throw new Cr(r);case"timed_out":throw new kr(r,{timeout:i.timeout,timeTaken:Date.now()-i.startedAt})}else throw We("Transaction not found.",t),new kt}if(["committed","rolled_back","timed_out"].includes(n.status))throw new Ge("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.#i(t,"rolled_back")))}#o(t,r){let n=Date.now(),i=ya(async()=>{We("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let o=this.transactions.get(t);o&&["running","waiting"].includes(o.status)?await this.#i(o,"timed_out"):We("Transaction already committed or rolled back when timeout happened.",t)},r);return i?.unref?.(),i}async#i(t,r){let n=async()=>{We("Closing transaction.",{transactionId:t.id,status:r});try{if(t.transaction&&r==="committed")if(t.transaction.options.usePhantomQuery)await this.#a($d(),t.transaction,()=>t.transaction.commit());else{let i=_d();await this.#a(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.#a(Ld(),t.transaction,()=>t.transaction.rollback());else{let i=Dd();try{await this.#a(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>Nd&&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}#s(t){if(!t.timeout)throw new V("timeout is required");if(!t.maxWait)throw new V("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new Or(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}#a(t,r,n){return fr({query:t,execute:n,provider:this.#e??r.provider,tracingHelper:this.tracingHelper,onQuery:this.#t})}};function ya(e,t){return t!==void 0?setTimeout(e,t):void 0}import{PrismaClientInitializationError as ri,PrismaClientKnownRequestError as It,PrismaClientRustPanicError as Mt,PrismaClientUnknownRequestError as jr}from"@prisma/client-runtime-utils";var Ir="7.3.0-integration-parameterization.13";var ha={bigint:"bigint",date:"datetime",decimal:"decimal",bytes:"bytes"};function ba(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=>xa(i)),n=t.map(i=>qd(i));return{args:r,argTypes:n}}function xa(e){if(Array.isArray(e))return e.map(t=>xa(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 qd(e){return Array.isArray(e)?{scalarType:e.length>0?wa(e[0]):"unknown",arity:"list"}:{scalarType:wa(e),arity:"scalar"}}function wa(e){return typeof e=="object"&&e!==null&&"prisma__type"in e&&typeof e.prisma__type=="string"&&e.prisma__type in ha?ha[e.prisma__type]:typeof e=="number"?"decimal":typeof e=="string"?"string":"unknown"}function Ea(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Pa(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function Ta(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 Sa=pe(Vi());function Aa({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,Sa.default)({user:t,repo:r,template:n,title:e,body:i})}function va({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=Ci(6e3-(s?.length??0)),l=Ta(ve(a)),u=n?`# Description
|
|
21
21
|
\`\`\`
|
|
22
22
|
${n}
|
|
23
23
|
\`\`\``:"",c=ve(`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?Pa(s):""}
|
|
54
54
|
\`\`\`
|
|
55
|
-
`),p=
|
|
55
|
+
`),p=Aa({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 @@ ${et(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 Ir=class e{#t;#e;#r;#n;#o;constructor(t,r,n){this.#t=t,this.#e=r,this.#r=n,this.#n=r.getConnectionInfo?.(),this.#o=Rt.forSql({onQuery:this.#t.onQuery,tracingHelper:this.#t.tracingHelper,provider:this.#t.provider,connectionInfo:this.#n})}static async connect(t){let r,n;try{r=await t.driverAdapterFactory.connect(),n=new Ot({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.#e.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.#e;return await this.#o.run(t,{queryable:s,transactionManager:n?{enabled:!1}:{enabled:!0,manager:this.#r},scope:r,sqlCommenter:this.#t.sqlCommenters&&{plugins:this.#t.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.#e.dispose()}}apiKey(){return null}};function va(e,t){let r=new Map;for(let n=0;n<e.s.length;n++)r.set(e.s[n],n);return{root(n){return e.r[n]},inputNode(n){if(n!==void 0)return e.i[n]},outputNode(n){if(n!==void 0)return e.o[n]},inputEdge(n,i){if(!n?.f)return;let o=r.get(i);if(o!==void 0)return n.f[o]},outputEdge(n,i){if(!n?.f)return;let o=r.get(i);if(o!==void 0)return n.f[o]},enumValues(n){if(n?.e===void 0)return;let i=e.e[n.e];if(!i)return;let o=t.enums[i];if(o)return o.values.map(s=>s.name)}}}var K={ParamScalar:1,ParamEnum:2,ParamListScalar:4,ParamListEnum:8,ListObject:16,Object:32},I={String:1,Int:2,BigInt:4,Float:8,Decimal:16,Boolean:32,DateTime:64,Json:128,Bytes:256};function Z(e,t){return(e.k&t)!==0}function ce(e){return e.m??0}var $d=new Set(["DateTime","Decimal","BigInt","Bytes","Json"]),Ld=new Set(["FieldRef","Enum","Param","Raw"]);function Kn(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;if($d.has(r))return{kind:"taggedScalar",tag:r,value:t.value};if(Ld.has(r))return{kind:"structural",value:t.value}}return{kind:"object",entries:t}}return{kind:"structural",value:e}}function Ca(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("$type"in e)}function Ra(e){return typeof e=="object"&&e!==null&&"$type"in e&&typeof e.$type=="string"}function Ee(e,t){return{$type:"Param",value:{name:e,...t}}}function ka(e,t){let r=new Map,n=e.modelName?`${e.modelName}.${e.action}`:e.action,i=t.root(n);return{parameterizedQuery:{...e,query:Ia(e.query,i?.a,i?.o,"query",t,r)},placeholderValues:Object.fromEntries(r)}}function Oa(e,t){let r=new Map,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:Ia(o.query,a?.a,a?.o,`batch[${i}].query`,t,r)})}return{parameterizedBatch:{...e,batch:n},placeholderValues:Object.fromEntries(r)}}function Ia(e,t,r,n,i,o){let s=i.inputNode(t),a=i.outputNode(r),l={...e};return e.arguments&&e.arguments.$type!=="Raw"&&(l.arguments=Mr(e.arguments,s,`${n}.arguments`,i,o)),e.selection&&(l.selection=Ma(e.selection,a,`${n}.selection`,i,o)),l}function Mr(e,t,r,n,i){if(!t)return e;let o={};for(let[s,a]of Object.entries(e)){let l=n.inputEdge(t,s),u=`${r}.${s}`;l?o[s]=Vd(a,l,u,n,i):o[s]=a}return o}function Vd(e,t,r,n,i){let o=Kn(e);switch(o.kind){case"null":return e;case"structural":return e;case"primitive":return qd(o.value,t,r,n,i);case"taggedScalar":return jd(e,o.tag,t,r,i);case"array":return Ud(o.items,e,t,r,n,i);case"object":return Bd(o.entries,t,r,n,i);default:throw new Error(`Unknown value kind ${o.kind}`)}}function qd(e,t,r,n,i){if(Z(t,K.ParamEnum)&&t.e!==void 0&&typeof e=="string"&&n.enumValues(t)?.includes(e))return i.set(r,e),Ee(r,{type:"Enum"});if(!Z(t,K.ParamScalar))return e;let o=ce(t);if(o===0)return e;let s=Fa(e);return Na(s,o)?(i.set(r,e),Ee(r,s)):e}function jd(e,t,r,n,i){if(!Z(r,K.ParamScalar))return e;let o=ce(r);if(o===0||!Da(t,o))return e;let s=Hd(e.$type),a=_a(e);return i.set(n,a),Ee(n,s)}function Ud(e,t,r,n,i,o){if(Z(r,K.ParamScalar)&&ce(r)&I.Json)return o.set(n,e),Ee(n,{type:"Json"});if(Z(r,K.ListObject)){let s=i.inputNode(r.c);if(s)return e.map((a,l)=>Ca(a)?Mr(a,s,`${n}[${l}]`,i,o):a)}if(Z(r,K.ParamEnum)){let s=i.enumValues(r);if(s&&e.every(a=>typeof a=="string"&&s.includes(a)))return o.set(n,e),Ee(n,{type:"List",inner:{type:"Enum"}})}if(Z(r,K.ParamListScalar)&&e.every(a=>Gd(a,r))){let a=e.map(l=>Wd(l));return o.set(n,a),Ee(n,{type:"List",inner:{type:"Any"}})}return t}function Bd(e,t,r,n,i){if(Z(t,K.Object)){let s=n.inputNode(t.c);if(s)return Mr(e,s,r,n,i)}return ce(t)&I.Json?(i.set(r,e),Ee(r,{type:"Json"})):e}function Ma(e,t,r,n,i){if(!e||!t)return e;let o={};for(let[s,a]of Object.entries(e)){if(s==="$scalars"||s==="$composites"||typeof a=="boolean"){o[s]=a;continue}let l=n.outputEdge(t,s);if(l){let u=a,c=`${r}.${s}`,p=n.inputNode(l.a),y=n.outputNode(l.o),d={selection:u.selection?Ma(u.selection,y,`${c}.selection`,n,i):{}};u.arguments&&(d.arguments=Mr(u.arguments,p,`${c}.arguments`,n,i)),o[s]=d}else o[s]=a}return o}var Qd=2**31-1,Jd=-(2**31);function Fa(e){switch(typeof e){case"boolean":return{type:"Boolean"};case"number":return Number.isInteger(e)?Jd<=e&&e<=Qd?{type:"Int"}:{type:"BigInt"}:{type:"Float"};case"string":return{type:"String"};default:throw new Error("unreachable")}}function Na({type:e},t){switch(e){case"Boolean":return(t&I.Boolean)!==0;case"Int":return(t&(I.Int|I.BigInt|I.Float))!==0;case"BigInt":return(t&I.BigInt)!==0;case"Float":return(t&I.Float)!==0;case"String":return(t&I.String)!==0;default:return!1}}function Hd(e){switch(e){case"BigInt":case"Bytes":case"DateTime":case"Json":return{type:e};case"Decimal":return{type:"String"};default:return}}function Da(e,t){switch(e){case"DateTime":return(t&I.DateTime)!==0;case"Decimal":return(t&I.Decimal)!==0;case"BigInt":return(t&I.BigInt)!==0;case"Bytes":return(t&I.Bytes)!==0;case"Json":return(t&I.Json)!==0;default:return!1}}function Gd(e,t){let r=Kn(e);switch(r.kind){case"structural":return!1;case"null":return!1;case"primitive":{let n=Fa(r.value),i=ce(t);return i!==0&&Na(n,i)}case"taggedScalar":{let n=ce(t);return n!==0&&Da(r.tag,n)}default:return!1}}function Wd(e){return Ra(e)?_a(e):e}function _a(e){return e.$type==="Bytes"?Buffer.from(e.value,"base64"):e.value}var Fr=class{#t;#e;#r;constructor(t=1e3){this.#t=new Map,this.#e=new Map,this.#r=t}getSingle(t){let r=this.#t.get(t);return r&&(this.#t.delete(t),this.#t.set(t,r)),r}setSingle(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)}getBatch(t){let r=this.#e.get(t);return r&&(this.#e.delete(t),this.#e.set(t,r)),r}setBatch(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)}clear(){this.#t.clear(),this.#e.clear()}get size(){return this.#t.size+this.#e.size}get singleCacheSize(){return this.#t.size}get batchCacheSize(){return this.#e.size}};import{PrismaClientKnownRequestError as Yd}from"@prisma/client-runtime-utils";var Nr=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function $a(e,t,r){let n=r||{},i=n.encode||encodeURIComponent;if(typeof i!="function")throw new TypeError("option encode is invalid");if(!Nr.test(e))throw new TypeError("argument name is invalid");let o=i(t);if(o&&!Nr.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(!Nr.test(n.domain))throw new TypeError("option domain is invalid");s+="; Domain="+n.domain}if(n.path){if(!Nr.test(n.path))throw new TypeError("option path is invalid");s+="; Path="+n.path}if(n.expires){if(!zd(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 zd(e){return Object.prototype.toString.call(e)==="[object Date]"||e instanceof Date}function La(e,t){let r=(e||"").split(";").filter(l=>typeof l=="string"&&!!l.trim()),n=r.shift()||"",i=Kd(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 Kd(e){let t="",r="",n=e.split("=");return n.length>1?(t=n.shift(),r=n.join("=")):r=e,{name:t,value:r}}var Dr=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 _r=class extends Dr{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function Va(e,t){return{...e,isRetryable:t}}var Pe=class extends _r{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,Va(r,!1))}};lt(Pe,"InvalidDatasourceError");function qa(e){let t={clientVersion:e.clientVersion},r;try{r=new URL(e.accelerateUrl)}catch(l){let u=l.message;throw new Pe(`Error validating \`accelerateUrl\`, the URL cannot be parsed, reason: ${u}`,t)}let{protocol:n,searchParams:i}=r;if(n!=="prisma:"&&n!==Vt)throw new Pe("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 Pe("Error validating `accelerateUrl`: the URL must contain a valid API key",t);let s=zr(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 ja=pe(ki()),$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":ja.enginesVersion};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-Transaction-Id"]=r);let i=this.#t();return i.length>0&&(n["X-Capture-Telemetry"]=i.join(", ")),n}#t(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}};function Zd(e){return e[0]*1e3+e[1]/1e6}function Zn(e){return new Date(Zd(e))}var Ua=M("prisma:client:clientEngine:remoteExecutor"),Lr=class{#t;#e;#r;#n;#o;#i;constructor(t){this.#t=t.clientVersion,this.#n=t.logEmitter,this.#o=t.tracingHelper,this.#i=t.sqlCommenters;let{url:r,apiKey:n}=qa({clientVersion:t.clientVersion,accelerateUrl:t.accelerateUrl});this.#r=new Yn(r),this.#e=new $r({apiKey:n,engineHash:t.clientVersion,logLevel:t.logLevel,logQueries:t.logQueries,tracingHelper:t.tracingHelper})}async getConnectionInfo(){return await this.#s({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.#i?.length?dr(this.#i,{query:l}):void 0;return(await this.#s({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.#s({path:"/transaction/start",method:"POST",body:t}),payload:void 0}}async commitTransaction(t){await this.#s({path:`/transaction/${t.id}/commit`,method:"POST"})}async rollbackTransaction(t){await this.#s({path:`/transaction/${t.id}/rollback`,method:"POST"})}disconnect(){return Promise.resolve()}apiKey(){return this.#e.apiKey}async#s({path:t,method:r,body:n,fetch:i=globalThis.fetch,batchRequestIdx:o}){let s=await this.#r.request({method:r,path:t,headers:this.#e.build(),body:n,fetch:i});s.ok||await this.#a(s,o);let a=await s.json();return typeof a.extensions=="object"&&a.extensions!==null&&this.#l(a.extensions),a}async#a(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 Yd(s,{clientVersion:this.#t,code:n??"P6000",batchRequestIdx:r,meta:a})}#l(t){if(t.logs)for(let r of t.logs)this.#u(r);t.spans&&this.#o.dispatchEngineSpans(t.spans)}#u(t){switch(t.level){case"debug":case"trace":Ua(t);break;case"error":case"warn":case"info":{this.#n.emit(t.level,{timestamp:Zn(t.timestamp),message:t.attributes.message??"",target:t.target??"RemoteExecutor"});break}case"query":{this.#n.emit("query",{query:t.attributes.query??"",timestamp:Zn(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}`)}}},Yn=class{#t;#e;#r;constructor(t){this.#t=t,this.#e=new Map}async request({method:t,path:r,headers:n,body:i,fetch:o}){let s=new URL(r,this.#t),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 Ua(t,s,l.status,l.statusText),this.#r=l.headers.get("Accelerate-Query-Engine-Jwt")??void 0,this.#o(s,l),l}#n(t){let r=[],n=new Date;for(let[i,o]of this.#e){if(o.expires&&o.expires<n){this.#e.delete(i);continue}let s=o.domain??t.hostname,a=o.path??"/";t.hostname.endsWith(s)&&t.pathname.startsWith(a)&&r.push($a(o.name,o.value))}return r.length>0?r.join("; "):void 0}#o(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=La(i),s=o.domain??t.hostname,a=o.path??"/",l=`${s}:${a}:${o.name}`;this.#e.set(l,{name:o.name,value:o.value,domain:s,path:a,expires:o.expires})}}};import{PrismaClientInitializationError as Ba}from"@prisma/client-runtime-utils";var Xn={},Qa={async loadQueryCompiler(e){let{clientVersion:t,compilerWasm:r}=e;if(r===void 0)throw new Ba("WASM query compiler was unexpectedly `undefined`",t);let n;return e.activeProvider===void 0||Xn[e.activeProvider]===void 0?(n=(async()=>{let i=await r.getRuntime(),o=await r.getQueryCompilerWasmModule();if(o==null)throw new Ba("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&&(Xn[e.activeProvider]=n)):n=Xn[e.activeProvider],await n}};var Xd="P2038",re=M("prisma:client:clientEngine"),Wa=globalThis;Wa.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new It(e,Or)}};var Mt=class{name="ClientEngine";#t;#e={type:"disconnected"};#r;#n;#o;#i;#s;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 ei("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,Xd);this.#r=r??Qa,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.#o=new Fr,this.#i=!0,this.#s=va(t.parameterizationSchema,t.runtimeDataModel),t.enableDebugLogs&&(this.logLevel="debug"),this.logQueries&&(this.#a=n=>{this.logEmitter.emit("query",{...n,params:bt(n.params),target:"ClientEngine"})})}async#l(){switch(this.#e.type){case"disconnected":{let t=this.tracingHelper.runInChildSpan("connect",async()=>{let r,n;try{r=await this.#u(),n=await this.#h(r)}catch(o){throw this.#e={type:"disconnected"},n?.free(),await r?.disconnect(),o}let i={executor:r,queryCompiler:n};return this.#e={type:"connected",engine:i},i});return this.#e={type:"connecting",promise:t},await t}case"connecting":return await this.#e.promise;case"connected":return this.#e.engine;case"disconnecting":return await this.#e.promise,await this.#l()}}async#u(){return this.#n.remote?new Lr({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 Ir.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#h(t){let r=this.#t;r===void 0&&(r=await this.#r.loadQueryCompiler(this.config),this.#t=r);let{provider:n,connectionInfo:i}=await t.getConnectionInfo();try{return this.#d(()=>new r({datamodel:this.datamodel,provider:n,connectionInfo:i}),void 0,!1)}catch(o){throw this.#w(o)}}#w(t){if(t instanceof It)return t;try{let r=JSON.parse(t.message);return new ei(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#c(t,r){if(t instanceof ei)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new It(Ja(this,t.message,r),this.config.clientVersion);if(t instanceof k)return new ti(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let n=JSON.parse(t);return new Vr(`${n.message}
|
|
65
|
-
${n.backtrace}`,{clientVersion:this.config.clientVersion})}catch{return t}}#p(t){return t instanceof
|
|
64
|
+
`}var Mr=class e{#t;#e;#r;#n;#o;constructor(t,r,n){this.#t=t,this.#e=r,this.#r=n,this.#n=r.getConnectionInfo?.(),this.#o=Rt.forSql({onQuery:this.#t.onQuery,tracingHelper:this.#t.tracingHelper,provider:this.#t.provider,connectionInfo:this.#n})}static async connect(t){let r,n;try{r=await t.driverAdapterFactory.connect(),n=new Ot({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.#e.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.#e;return await this.#o.run(t,{queryable:s,transactionManager:n?{enabled:!1}:{enabled:!0,manager:this.#r},scope:r,sqlCommenter:this.#t.sqlCommenters&&{plugins:this.#t.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.#e.dispose()}}apiKey(){return null}};function Ca(e,t){let r=new Map;for(let n=0;n<e.s.length;n++)r.set(e.s[n],n);return{root(n){return e.r[n]},inputNode(n){if(n!==void 0)return e.i[n]},outputNode(n){if(n!==void 0)return e.o[n]},inputEdge(n,i){if(!n?.f)return;let o=r.get(i);if(o!==void 0)return n.f[o]},outputEdge(n,i){if(!n?.f)return;let o=r.get(i);if(o!==void 0)return n.f[o]},enumValues(n){if(n?.e===void 0)return;let i=e.e[n.e];if(!i)return;let o=t.enums[i];if(o)return o.values.map(s=>s.name)}}}var K={ParamScalar:1,ParamEnum:2,ParamListScalar:4,ParamListEnum:8,ListObject:16,Object:32},I={String:1,Int:2,BigInt:4,Float:8,Decimal:16,Boolean:32,DateTime:64,Json:128,Bytes:256};function Z(e,t){return(e.k&t)!==0}function ce(e){return e.m??0}var jd=new Set(["DateTime","Decimal","BigInt","Bytes","Json"]),Ud=new Set(["FieldRef","Enum","Param","Raw"]);function Fr(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;if(jd.has(r))return{kind:"taggedScalar",tag:r,value:t.value};if(Ud.has(r))return{kind:"structural",value:t.value}}return{kind:"object",entries:t}}return{kind:"structural",value:e}}function Ra(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!("$type"in e)}function ka(e){return typeof e=="object"&&e!==null&&"$type"in e&&typeof e.$type=="string"}function Ee(e,t){return{$type:"Param",value:{name:e,...t}}}function Oa(e,t){let r=new Map,n=e.modelName?`${e.modelName}.${e.action}`:e.action,i=t.root(n);return{parameterizedQuery:{...e,query:Ma(e.query,i?.a,i?.o,"query",t,r)},placeholderValues:Object.fromEntries(r)}}function Ia(e,t){let r=new Map,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:Ma(o.query,a?.a,a?.o,`batch[${i}].query`,t,r)})}return{parameterizedBatch:{...e,batch:n},placeholderValues:Object.fromEntries(r)}}function Ma(e,t,r,n,i,o){let s=i.inputNode(t),a=i.outputNode(r),l={...e};return e.arguments&&e.arguments.$type!=="Raw"&&(l.arguments=Nr(e.arguments,s,`${n}.arguments`,i,o)),e.selection&&(l.selection=Fa(e.selection,a,`${n}.selection`,i,o)),l}function Nr(e,t,r,n,i){if(!t)return e;let o={};for(let[s,a]of Object.entries(e)){let l=n.inputEdge(t,s),u=`${r}.${s}`;l?o[s]=Bd(a,l,u,n,i):o[s]=a}return o}function Bd(e,t,r,n,i){let o=Fr(e);switch(o.kind){case"null":return e;case"structural":return e;case"primitive":return Qd(o.value,t,r,n,i);case"taggedScalar":return Jd(e,o.tag,t,r,i);case"array":return Hd(o.items,e,t,r,n,i);case"object":return Gd(o.entries,t,r,n,i);default:throw new Error(`Unknown value kind ${o.kind}`)}}function Qd(e,t,r,n,i){if(Z(t,K.ParamEnum)&&t.e!==void 0&&typeof e=="string"&&n.enumValues(t)?.includes(e))return i.set(r,e),Ee(r,{type:"Enum"});if(!Z(t,K.ParamScalar))return e;let o=ce(t);if(o===0)return e;let s=Yn(e);return Na(s,o)?(i.set(r,e),Ee(r,s)):e}function Jd(e,t,r,n,i){if(!Z(r,K.ParamScalar))return e;let o=ce(r);if(o===0||!Da(t,o))return e;let s=_a(e.$type),a=$a(e);return i.set(n,a),Ee(n,s)}function Hd(e,t,r,n,i,o){if(Z(r,K.ParamScalar)&&ce(r)&I.Json)return o.set(n,e),Ee(n,{type:"Json"});if(Z(r,K.ParamEnum)){let s=i.enumValues(r);if(s&&e.every(a=>typeof a=="string"&&s.includes(a)))return o.set(n,e),Ee(n,{type:"List",inner:{type:"Enum"}})}if(Z(r,K.ParamListScalar)&&e.every(a=>Zd(a,r))&&e.length>0){let a=e.map(u=>Yd(u));o.set(n,a);let l=Kd(e[0]);return Ee(n,{type:"List",inner:l})}if(Z(r,K.ListObject)){let s=i.inputNode(r.c);if(s)return e.map((a,l)=>Ra(a)?Nr(a,s,`${n}[${l}]`,i,o):a)}return t}function Gd(e,t,r,n,i){if(Z(t,K.Object)){let s=n.inputNode(t.c);if(s)return Nr(e,s,r,n,i)}return ce(t)&I.Json?(i.set(r,e),Ee(r,{type:"Json"})):e}function Fa(e,t,r,n,i){if(!e||!t)return e;let o={};for(let[s,a]of Object.entries(e)){if(s==="$scalars"||s==="$composites"||typeof a=="boolean"){o[s]=a;continue}let l=n.outputEdge(t,s);if(l){let u=a,c=`${r}.${s}`,p=n.inputNode(l.a),y=n.outputNode(l.o),d={selection:u.selection?Fa(u.selection,y,`${c}.selection`,n,i):{}};u.arguments&&(d.arguments=Nr(u.arguments,p,`${c}.arguments`,n,i)),o[s]=d}else o[s]=a}return o}var Wd=2**31-1,zd=-(2**31);function Yn(e){switch(typeof e){case"boolean":return{type:"Boolean"};case"number":return Number.isInteger(e)?zd<=e&&e<=Wd?{type:"Int"}:{type:"BigInt"}:{type:"Float"};case"string":return{type:"String"};default:throw new Error("unreachable")}}function Na({type:e},t){switch(e){case"Boolean":return(t&I.Boolean)!==0;case"Int":return(t&(I.Int|I.BigInt|I.Float))!==0;case"BigInt":return(t&I.BigInt)!==0;case"Float":return(t&I.Float)!==0;case"String":return(t&I.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 Kd(e){let t=Fr(e);switch(t.kind){case"primitive":return Yn(t.value);case"taggedScalar":return _a(t.tag)??{type:"Any"};default:return{type:"Any"}}}function Da(e,t){switch(e){case"DateTime":return(t&I.DateTime)!==0;case"Decimal":return(t&I.Decimal)!==0;case"BigInt":return(t&I.BigInt)!==0;case"Bytes":return(t&I.Bytes)!==0;case"Json":return(t&I.Json)!==0;default:return!1}}function Zd(e,t){let r=Fr(e);switch(r.kind){case"structural":return!1;case"null":return!1;case"primitive":{let n=Yn(r.value),i=ce(t);return i!==0&&Na(n,i)}case"taggedScalar":{let n=ce(t);return n!==0&&Da(r.tag,n)}default:return!1}}function Yd(e){return ka(e)?$a(e):e}function $a(e){return e.$type==="Bytes"?Buffer.from(e.value,"base64"):e.value}var _r=class{#t;#e;#r;constructor(t=1e3){this.#t=new Map,this.#e=new Map,this.#r=t}getSingle(t){let r=this.#t.get(t);return r&&(this.#t.delete(t),this.#t.set(t,r)),r}setSingle(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)}getBatch(t){let r=this.#e.get(t);return r&&(this.#e.delete(t),this.#e.set(t,r)),r}setBatch(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)}clear(){this.#t.clear(),this.#e.clear()}get size(){return this.#t.size+this.#e.size}get singleCacheSize(){return this.#t.size}get batchCacheSize(){return this.#e.size}};import{PrismaClientKnownRequestError as rm}from"@prisma/client-runtime-utils";var Dr=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function La(e,t,r){let n=r||{},i=n.encode||encodeURIComponent;if(typeof i!="function")throw new TypeError("option encode is invalid");if(!Dr.test(e))throw new TypeError("argument name is invalid");let o=i(t);if(o&&!Dr.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(!Dr.test(n.domain))throw new TypeError("option domain is invalid");s+="; Domain="+n.domain}if(n.path){if(!Dr.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 Va(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 qa(e,t){return{...e,isRetryable:t}}var Pe=class extends Lr{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,qa(r,!1))}};lt(Pe,"InvalidDatasourceError");function ja(e){let t={clientVersion:e.clientVersion},r;try{r=new URL(e.accelerateUrl)}catch(l){let u=l.message;throw new Pe(`Error validating \`accelerateUrl\`, the URL cannot be parsed, reason: ${u}`,t)}let{protocol:n,searchParams:i}=r;if(n!=="prisma:"&&n!==qt)throw new Pe("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 Pe("Error validating `accelerateUrl`: the URL must contain a valid API key",t);let s=Zr(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 Ua=pe(Oi()),Vr=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":Ua.enginesVersion};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-Transaction-Id"]=r);let i=this.#t();return i.length>0&&(n["X-Capture-Telemetry"]=i.join(", ")),n}#t(){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 Xn(e){return new Date(tm(e))}var Ba=M("prisma:client:clientEngine:remoteExecutor"),qr=class{#t;#e;#r;#n;#o;#i;constructor(t){this.#t=t.clientVersion,this.#n=t.logEmitter,this.#o=t.tracingHelper,this.#i=t.sqlCommenters;let{url:r,apiKey:n}=ja({clientVersion:t.clientVersion,accelerateUrl:t.accelerateUrl});this.#r=new ei(r),this.#e=new Vr({apiKey:n,engineHash:t.clientVersion,logLevel:t.logLevel,logQueries:t.logQueries,tracingHelper:t.tracingHelper})}async getConnectionInfo(){return await this.#s({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.#i?.length?mr(this.#i,{query:l}):void 0;return(await this.#s({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.#s({path:"/transaction/start",method:"POST",body:t}),payload:void 0}}async commitTransaction(t){await this.#s({path:`/transaction/${t.id}/commit`,method:"POST"})}async rollbackTransaction(t){await this.#s({path:`/transaction/${t.id}/rollback`,method:"POST"})}disconnect(){return Promise.resolve()}apiKey(){return this.#e.apiKey}async#s({path:t,method:r,body:n,fetch:i=globalThis.fetch,batchRequestIdx:o}){let s=await this.#r.request({method:r,path:t,headers:this.#e.build(),body:n,fetch:i});s.ok||await this.#a(s,o);let a=await s.json();return typeof a.extensions=="object"&&a.extensions!==null&&this.#l(a.extensions),a}async#a(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.#t,code:n??"P6000",batchRequestIdx:r,meta:a})}#l(t){if(t.logs)for(let r of t.logs)this.#u(r);t.spans&&this.#o.dispatchEngineSpans(t.spans)}#u(t){switch(t.level){case"debug":case"trace":Ba(t);break;case"error":case"warn":case"info":{this.#n.emit(t.level,{timestamp:Xn(t.timestamp),message:t.attributes.message??"",target:t.target??"RemoteExecutor"});break}case"query":{this.#n.emit("query",{query:t.attributes.query??"",timestamp:Xn(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}`)}}},ei=class{#t;#e;#r;constructor(t){this.#t=t,this.#e=new Map}async request({method:t,path:r,headers:n,body:i,fetch:o}){let s=new URL(r,this.#t),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 Ba(t,s,l.status,l.statusText),this.#r=l.headers.get("Accelerate-Query-Engine-Jwt")??void 0,this.#o(s,l),l}#n(t){let r=[],n=new Date;for(let[i,o]of this.#e){if(o.expires&&o.expires<n){this.#e.delete(i);continue}let s=o.domain??t.hostname,a=o.path??"/";t.hostname.endsWith(s)&&t.pathname.startsWith(a)&&r.push(La(o.name,o.value))}return r.length>0?r.join("; "):void 0}#o(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=Va(i),s=o.domain??t.hostname,a=o.path??"/",l=`${s}:${a}:${o.name}`;this.#e.set(l,{name:o.name,value:o.value,domain:s,path:a,expires:o.expires})}}};import{PrismaClientInitializationError as Qa}from"@prisma/client-runtime-utils";var ti={},Ja={async loadQueryCompiler(e){let{clientVersion:t,compilerWasm:r}=e;if(r===void 0)throw new Qa("WASM query compiler was unexpectedly `undefined`",t);let n;return e.activeProvider===void 0||ti[e.activeProvider]===void 0?(n=(async()=>{let i=await r.getRuntime(),o=await r.getQueryCompilerWasmModule();if(o==null)throw new Qa("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&&(ti[e.activeProvider]=n)):n=ti[e.activeProvider],await n}};var nm="P2038",re=M("prisma:client:clientEngine"),za=globalThis;za.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new Mt(e,Ir)}};var Ft=class{name="ClientEngine";#t;#e={type:"disconnected"};#r;#n;#o;#i;#s;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 ri("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,nm);this.#r=r??Ja,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.#o=new _r,this.#i=!0,this.#s=Ca(t.parameterizationSchema,t.runtimeDataModel),t.enableDebugLogs&&(this.logLevel="debug"),this.logQueries&&(this.#a=n=>{this.logEmitter.emit("query",{...n,params:bt(n.params),target:"ClientEngine"})})}async#l(){switch(this.#e.type){case"disconnected":{let t=this.tracingHelper.runInChildSpan("connect",async()=>{let r,n;try{r=await this.#u(),n=await this.#h(r)}catch(o){throw this.#e={type:"disconnected"},n?.free(),await r?.disconnect(),o}let i={executor:r,queryCompiler:n};return this.#e={type:"connected",engine:i},i});return this.#e={type:"connecting",promise:t},await t}case"connecting":return await this.#e.promise;case"connected":return this.#e.engine;case"disconnecting":return await this.#e.promise,await this.#l()}}async#u(){return this.#n.remote?new qr({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 Mr.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#h(t){let r=this.#t;r===void 0&&(r=await this.#r.loadQueryCompiler(this.config),this.#t=r);let{provider:n,connectionInfo:i}=await t.getConnectionInfo();try{return this.#d(()=>new r({datamodel:this.datamodel,provider:n,connectionInfo:i}),void 0,!1)}catch(o){throw this.#w(o)}}#w(t){if(t instanceof Mt)return t;try{let r=JSON.parse(t.message);return new ri(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#c(t,r){if(t instanceof ri)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new Mt(Ha(this,t.message,r),this.config.clientVersion);if(t instanceof k)return new It(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let n=JSON.parse(t);return new jr(`${n.message}
|
|
65
|
+
${n.backtrace}`,{clientVersion:this.config.clientVersion})}catch{return t}}#p(t){return t instanceof Mt?t:typeof t.message=="string"&&typeof t.code=="string"?new It(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion}):typeof t.message=="string"?new jr(t.message,{clientVersion:this.config.clientVersion}):t}#d(t,r,n=!0){let i=za.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.#t=void 0,n&&this.stop().catch(s=>re("failed to disconnect:",s)),new Mt(Ha(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.#l()}async stop(){switch(this.#e.type){case"disconnected":return;case"connecting":return await this.#e.promise,await this.stop();case"connected":{let t=this.#e.engine,r=this.tracingHelper.runInChildSpan("disconnect",async()=>{try{await t.executor.disconnect(),t.queryCompiler.free()}finally{this.#e={type:"disconnected"}}});return this.#e={type:"disconnecting",promise:r},await r}case"disconnecting":return await this.#e.promise}}version(){return"unknown"}async transaction(t,r,n){let i,{executor:o}=await this.#l();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 X(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}){re("sending request");let{executor:i,queryCompiler:o}=await this.#l().catch(l=>{throw this.#c(l,JSON.stringify(t))}),s,a={};if(Ga(t))s=Wa(t);else if(this.#i)try{let{parameterizedQuery:l,placeholderValues:u}=Oa(t,this.#s),c=JSON.stringify(l);a=u;let p=this.#o.getSingle(c);p?(re("query plan cache hit"),s=p):(re("query plan cache miss"),s=this.#m(l,c,o),this.#o.setSingle(c,s))}catch(l){throw l instanceof It?l:new jr(String(l),{clientVersion:this.config.clientVersion})}else s=this.#m(t,JSON.stringify(t),o);try{re("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 re("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=Ea(t,r),a=JSON.stringify(s),{executor:l,queryCompiler:u}=await this.#l().catch(d=>{throw this.#c(d,a)}),c=o===void 0,p,y={};if(this.#i&&!c)try{let{parameterizedBatch:d,placeholderValues:h}=Ia(s,this.#s),b=JSON.stringify(d);y=h;let x=this.#o.getBatch(b);if(x)re("batch query plan cache hit"),p=x;else{re("batch query plan cache miss");try{p=this.#f(d.batch,b,u),this.#o.setBatch(b,p)}catch(N){throw this.#p(N)}}}catch(d){throw d instanceof It?d:new jr(String(d),{clientVersion:this.config.clientVersion})}else p=this.#f(t,a,u);try{let d;switch(r?.kind==="itx"&&(d=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;d=await this.transaction("start",{},x)}let h=[],b=!1;for(let[x,N]of p.plans.entries())try{let P=await l.execute({plan:N,placeholderValues:y,model:t[x].modelName,operation:t[x].action,batchIndex:x,transaction:d,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 d!==void 0&&r?.kind!=="itx"&&(b?await this.transaction("rollback",{},d):await this.transaction("commit",{},d)),h}case"compacted":{if(!t.every(x=>x.action===i&&x.modelName===o)){let x=t.map(P=>P.action).join(", "),N=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: [${N}]. 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:y,model:o,operation:i,batchIndex:void 0,transaction:d,customFetch:n?.(globalThis.fetch),queryInfo:{type:"compacted",action:i,modelName:o,queries:t}});return Yo(h,p,y).map(x=>({data:{[i]:x}}))}}}catch(d){throw this.#c(d,a)}}async apiKey(){let{executor:t}=await this.#l();return t.apiKey()}#m(t,r,n){try{return this.#d(()=>this.#y({queries:[t],execute:()=>n.compile(r)}))}catch(i){throw this.#p(i)}}#f(t,r,n){if(t.every(Ga))return{type:"multi",plans:t.map(i=>Wa(i))};try{return this.#d(()=>this.#y({queries:t,execute:()=>n.compileBatch(r)}))}catch(i){throw this.#p(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 It(`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 Ha(e,t,r){return va({binaryTarget:void 0,title:t,version:e.config.clientVersion,engineVersion:"unknown",database:e.config.activeProvider,query:r})}function Ga(e){return e.action==="queryRaw"||e.action==="executeRaw"}function Wa(e){let t=e.query.arguments.query,{args:r,argTypes:n}=ba(e.query.arguments.parameters);return{type:e.action==="queryRaw"?"query":"execute",args:{type:"rawSql",sql:t,args:r,argTypes:n}}}function Ka(e){return new Ft(e)}var Za=e=>({command:e});import{Sql as sm}from"@prisma/client-runtime-utils";var Ya=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 Xa(e,"fast")}catch{return Xa(e,"slow")}}function Xa(e,t){return JSON.stringify(e.map(r=>tl(r,t)))}function tl(e,t){if(Array.isArray(e))return e.map(r=>tl(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(Ce(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"?rl(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 rl(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(el);let t={};for(let r of Object.keys(e))t[r]=el(e[r]);return t}function el(e){return typeof e=="bigint"?e.toString():rl(e)}var am=/^(\s*alter\s)/i,nl=M("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
|
|
73
|
-
Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};lt(C,"PrismaClientConstructorValidationError");var
|
|
72
|
+
`)}var ii=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(sr(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=Ya(r),i={values:ze(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?nl(`prisma.${e}(${n}, ${i.values})`):nl(`prisma.${e}(${n})`),{query:n,parameters:i}},il={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new sm(t,r)}},ol={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??=sl(r(s)):sl(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 sl(e){return typeof e.then=="function"?e:Promise.resolve(e)}var al={name:"@prisma/instrumentation-contract",version:"7.3.0-integration-parameterization.13",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=al.version.split(".")[0],cm="PRISMA_INSTRUMENTATION",pm=`V${um}_PRISMA_INSTRUMENTATION`,ll=globalThis;function ul(){let e=ll[pm];return e?.helper?e.helper:ll[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 ul()??dm}};function cl(){return new si}function pl(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function dl(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 ml(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 li(e){return mm[e]}var Ur=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 Te(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=>Te("bigint",r));case"bytes-array":return t.map(r=>Te("bytes",r));case"decimal-array":return t.map(r=>Te("decimal",r));case"datetime-array":return t.map(r=>Te("datetime",r));case"date-array":return t.map(r=>Te("date",r));case"time-array":return t.map(r=>Te("time",r));default:return t}}function ui(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]]=Te(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=M("prisma:client:request_handler"),Qr=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new Ur({batchLoader:Bo(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=>li(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:wm(o),containsWrite:u,customDataProxyFetch:i})).map((p,y)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[y],p)}catch(d){return d}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?fl(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:li(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:ml(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 ci&&xm(t)){let u=gl(t.meta);rr({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=Wt({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 ci(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new Br(l,this.client._clientVersion);if(t instanceof pi)throw new pi(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof Se)throw new Se(l,this.client._clientVersion);if(t instanceof Br)throw new Br(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?ve(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=gn(o,s),l=i==="queryRaw"?ui(a):ge(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:fl(e)};X(e,"Unknown transaction kind")}}function fl(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 gl(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(gl)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var di=Ir;var xl=pe(nn());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"}};lt(C,"PrismaClientConstructorValidationError");var yl=["errorFormat","adapter","accelerateUrl","log","transactionOptions","omit","comments","__internal"],hl=["pretty","colorless","minimal"],wl=["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(!hl.includes(e)){let t=Nt(e,hl);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"&&!wl.includes(r)){let n=Nt(r,wl);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=Nt(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=Nt(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 El(e,t){for(let[r,n]of Object.entries(e)){if(!yl.includes(r)){let i=Nt(r,yl);throw new C(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Em[r](n,t)}Pm(e)}function Nt(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,xl.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 bl(t.models,e)??bl(t.types,e)}function bl(e,t){let r=Object.keys(e).find(n=>ie(n)===t);if(r)return e[r]}function Am(e,t){let r=De(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}=tr(r,"colorless");return`Error validating "omit" option:
|
|
74
74
|
|
|
75
75
|
${i}
|
|
76
76
|
|
|
77
|
-
${n}`}import{hasBatchIndex as
|
|
77
|
+
${n}`}import{hasBatchIndex as vm}from"@prisma/client-runtime-utils";function Pl(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 _t=M("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Om={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Im=Symbol.for("prisma.client.transaction.id"),Mm={id:0,nextId(){return++this.id}};function Fm(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 Se("`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 ",di);e=n.__internal?.configOverride?.(e)??e,El(n,e);let i=new km().on("error",()=>{});this._extensions=$e.empty(),this._previewFeatures=e.previewFeatures,this._clientVersion=e.clientVersion??di,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=cl();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 Se(`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&&M.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&&dl(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 Se(`\`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:y,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:d})}catch(h){throw h.clientVersion=this._clientVersion,h}}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$extends=
|
|
82
|
+
`,e.clientVersion)}},_t("clientVersion",e.clientVersion),this._engine=Ka(this._engineConfig),this._requestHandler=new Qr(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=>{at.log(`${at.tags[c]??""}`,p.message||p.query)})}}catch(s){throw s.clientVersion=this._clientVersion,s}return this._appliedParent=ht(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{Ri()}}$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:se(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Tl(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 Dt("`$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 Dt(`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:Za,callsite:se(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:se(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",...Tl(n,i));throw new Dt("`$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 Dt("`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=Mm.nextId(),s=pl(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 Pl(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 U(ht(U(Mo(this),[F("_appliedParent",()=>this._appliedParent._createItxClient(n)),F("_createPrismaPromise",()=>oi(n)),F(Im,()=>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??Om,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,y={...n,...p};c&&(y.args=i.middlewareArgsToRequestArgs(c)),n.transaction!==void 0&&u===!1&&delete y.transaction;let d=await Uo(this,y);return y.model?Do({result:d,modelName:y.model,args:y.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):d};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:y,customDataProxyFetch:d}){try{n=u?u(n):n;let h={name:"serialize"},b=this._tracingHelper.runInChildSpan(h,()=>un({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 M.enabled("prisma:client")&&(_t("Prisma Client call:"),_t(`prisma.${i}(${Eo(n)})`),_t("Generated request:"),_t(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:y,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:d})}catch(h){throw h.clientVersion=this._clientVersion,h}}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$extends=Fo}return t}function Tl(e,t){return Nm(e)?[new Cm(e,t),il]:[e,ol]}function Nm(e){return Array.isArray(e)&&Array.isArray(e.raw)}var _m=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Dm(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!_m.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}var $m=()=>globalThis.process?.release?.name==="node",Lm=()=>!!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"],[Lm,"bun"],[$m,"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 Se,PrismaClientKnownRequestError as ci,PrismaClientRustPanicError as Br,PrismaClientUnknownRequestError as pi,PrismaClientValidationError as Dt}from"@prisma/client-runtime-utils";import{empty as gA,join as yA,raw as hA,Sql as wA,sql as bA}from"@prisma/client-runtime-utils";import{AnyNull as EA,DbNull as PA,isAnyNull as TA,isDbNull as SA,isJsonNull as AA,JsonNull as vA,NullTypes as CA,ObjectEnumValue as RA}from"@prisma/client-runtime-utils";import{Decimal as OA}from"@prisma/client-runtime-utils";export{EA as AnyNull,Jt as DMMF,PA as DbNull,M as Debug,OA as Decimal,yi as Extensions,vA as JsonNull,CA as NullTypes,RA as ObjectEnumValue,Se as PrismaClientInitializationError,ci as PrismaClientKnownRequestError,Br as PrismaClientRustPanicError,pi as PrismaClientUnknownRequestError,Dt as PrismaClientValidationError,wi as Public,wA as Sql,Yu as createParam,dc as defineDmmfProperty,ge as deserializeJsonResponse,ui as deserializeRawResult,Nl as dmmfToRuntimeDataModel,gA as empty,Fm as getPrismaClient,Jm as getRuntime,TA as isAnyNull,SA as isDbNull,AA as isJsonNull,yA as join,Dm as makeStrictEnum,fc as makeTypedQueryFactory,hA as raw,un as serializeJsonQuery,an as skip,bA as sqltag,ji as warnOnce};
|
|
84
84
|
/*! Bundled license information:
|
|
85
85
|
|
|
86
86
|
@noble/hashes/utils.js:
|