@prisma/client 6.3.0-dev.17 → 6.3.0-dev.18
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 +23 -10
- package/package.json +17 -17
- package/runtime/binary.js +78 -78
- package/runtime/edge-esm.js +16 -16
- package/runtime/edge.js +16 -16
- package/runtime/library.d.ts +28 -12
- package/runtime/library.js +64 -62
- package/runtime/react-native.d.ts +28 -12
- package/runtime/react-native.js +27 -27
- package/runtime/wasm.js +20 -19
- package/scripts/default-index.js +1 -1
package/runtime/wasm.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
"use strict";var Uo=Object.create;var At=Object.defineProperty;var qo=Object.getOwnPropertyDescriptor;var $o=Object.getOwnPropertyNames;var Vo=Object.getPrototypeOf,Bo=Object.prototype.hasOwnProperty;var ae=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),St=(e,t)=>{for(var r in t)At(e,r,{get:t[r],enumerable:!0})},on=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $o(t))!Bo.call(e,i)&&i!==r&&At(e,i,{get:()=>t[i],enumerable:!(n=qo(t,i))||n.enumerable});return e};var et=(e,t,r)=>(r=e!=null?Uo(Vo(e)):{},on(t||!e||!e.__esModule?At(r,"default",{value:e,enumerable:!0}):r,e)),jo=e=>on(At({},"__esModule",{value:!0}),e);function gr(e,t){if(t=t.toLowerCase(),t==="utf8"||t==="utf-8")return new y(Wo.encode(e));if(t==="base64"||t==="base64url")return e=e.replace(/-/g,"+").replace(/_/g,"/"),e=e.replace(/[^A-Za-z0-9+/]/g,""),new y([...atob(e)].map(r=>r.charCodeAt(0)));if(t==="binary"||t==="ascii"||t==="latin1"||t==="latin-1")return new y([...e].map(r=>r.charCodeAt(0)));if(t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le"){let r=new y(e.length*2),n=new DataView(r.buffer);for(let i=0;i<e.length;i++)n.setUint16(i*2,e.charCodeAt(i),!0);return r}if(t==="hex"){let r=new y(e.length/2);for(let n=0,i=0;i<e.length;i+=2,n++)r[n]=parseInt(e.slice(i,i+2),16);return r}an(`encoding "${t}"`)}function Qo(e){let r=Object.getOwnPropertyNames(DataView.prototype).filter(a=>a.startsWith("get")||a.startsWith("set")),n=r.map(a=>a.replace("get","read").replace("set","write")),i=(a,u)=>function(g=0){return $(g,"offset"),z(g,"offset"),B(g,"offset",this.length-1),new DataView(this.buffer)[r[a]](g,u)},o=(a,u)=>function(g,T=0){let C=r[a].match(/set(\w+\d+)/)[1].toLowerCase(),O=Go[C];return $(T,"offset"),z(T,"offset"),B(T,"offset",this.length-1),Jo(g,"value",O[0],O[1]),new DataView(this.buffer)[r[a]](T,g,u),T+parseInt(r[a].match(/\d+/)[0])/8},s=a=>{a.forEach(u=>{u.includes("Uint")&&(e[u.replace("Uint","UInt")]=e[u]),u.includes("Float64")&&(e[u.replace("Float64","Double")]=e[u]),u.includes("Float32")&&(e[u.replace("Float32","Float")]=e[u])})};n.forEach((a,u)=>{a.startsWith("read")&&(e[a]=i(u,!1),e[a+"LE"]=i(u,!0),e[a+"BE"]=i(u,!1)),a.startsWith("write")&&(e[a]=o(u,!1),e[a+"LE"]=o(u,!0),e[a+"BE"]=o(u,!1)),s([a,a+"LE",a+"BE"])})}function an(e){throw new Error(`Buffer polyfill does not implement "${e}"`)}function Ot(e,t){if(!(e instanceof Uint8Array))throw new TypeError(`The "${t}" argument must be an instance of Buffer or Uint8Array`)}function B(e,t,r=zo+1){if(e<0||e>r){let n=new RangeError(`The value of "${t}" is out of range. It must be >= 0 && <= ${r}. Received ${e}`);throw n.code="ERR_OUT_OF_RANGE",n}}function $(e,t){if(typeof e!="number"){let r=new TypeError(`The "${t}" argument must be of type number. Received type ${typeof e}.`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function z(e,t){if(!Number.isInteger(e)||Number.isNaN(e)){let r=new RangeError(`The value of "${t}" is out of range. It must be an integer. Received ${e}`);throw r.code="ERR_OUT_OF_RANGE",r}}function Jo(e,t,r,n){if(e<r||e>n){let i=new RangeError(`The value of "${t}" is out of range. It must be >= ${r} and <= ${n}. Received ${e}`);throw i.code="ERR_OUT_OF_RANGE",i}}function sn(e,t){if(typeof e!="string"){let r=new TypeError(`The "${t}" argument must be of type string. Received type ${typeof e}`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function Yo(e,t="utf8"){return y.from(e,t)}var y,Go,Wo,Ko,Ho,zo,b,hr,c=ae(()=>{"use strict";y=class e extends Uint8Array{constructor(){super(...arguments);this._isBuffer=!0}get offset(){return this.byteOffset}static alloc(r,n=0,i="utf8"){return sn(i,"encoding"),e.allocUnsafe(r).fill(n,i)}static allocUnsafe(r){return e.from(r)}static allocUnsafeSlow(r){return e.from(r)}static isBuffer(r){return r&&!!r._isBuffer}static byteLength(r,n="utf8"){if(typeof r=="string")return gr(r,n).byteLength;if(r&&r.byteLength)return r.byteLength;let i=new TypeError('The "string" argument must be of type string or an instance of Buffer or ArrayBuffer.');throw i.code="ERR_INVALID_ARG_TYPE",i}static isEncoding(r){return Ho.includes(r)}static compare(r,n){Ot(r,"buff1"),Ot(n,"buff2");for(let i=0;i<r.length;i++){if(r[i]<n[i])return-1;if(r[i]>n[i])return 1}return r.length===n.length?0:r.length>n.length?1:-1}static from(r,n="utf8"){if(r&&typeof r=="object"&&r.type==="Buffer")return new e(r.data);if(typeof r=="number")return new e(new Uint8Array(r));if(typeof r=="string")return gr(r,n);if(ArrayBuffer.isView(r)){let{byteOffset:i,byteLength:o,buffer:s}=r;return"map"in r&&typeof r.map=="function"?new e(r.map(a=>a%256),i,o):new e(s,i,o)}if(r&&typeof r=="object"&&("length"in r||"byteLength"in r||"buffer"in r))return new e(r);throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}static concat(r,n){if(r.length===0)return e.alloc(0);let i=[].concat(...r.map(s=>[...s])),o=e.alloc(n!==void 0?n:i.length);return o.set(n!==void 0?i.slice(0,n):i),o}slice(r=0,n=this.length){return this.subarray(r,n)}subarray(r=0,n=this.length){return Object.setPrototypeOf(super.subarray(r,n),e.prototype)}reverse(){return super.reverse(),this}readIntBE(r,n){$(r,"offset"),z(r,"offset"),B(r,"offset",this.length-1),$(n,"byteLength"),z(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s<n;s++)o=o*256+i.getUint8(s);return i.getUint8(0)&128&&(o-=Math.pow(256,n)),o}readIntLE(r,n){$(r,"offset"),z(r,"offset"),B(r,"offset",this.length-1),$(n,"byteLength"),z(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s<n;s++)o+=i.getUint8(s)*Math.pow(256,s);return i.getUint8(n-1)&128&&(o-=Math.pow(256,n)),o}readUIntBE(r,n){$(r,"offset"),z(r,"offset"),B(r,"offset",this.length-1),$(n,"byteLength"),z(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s<n;s++)o=o*256+i.getUint8(s);return o}readUintBE(r,n){return this.readUIntBE(r,n)}readUIntLE(r,n){$(r,"offset"),z(r,"offset"),B(r,"offset",this.length-1),$(n,"byteLength"),z(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s<n;s++)o+=i.getUint8(s)*Math.pow(256,s);return o}readUintLE(r,n){return this.readUIntLE(r,n)}writeIntBE(r,n,i){return r=r<0?r+Math.pow(256,i):r,this.writeUIntBE(r,n,i)}writeIntLE(r,n,i){return r=r<0?r+Math.pow(256,i):r,this.writeUIntLE(r,n,i)}writeUIntBE(r,n,i){$(n,"offset"),z(n,"offset"),B(n,"offset",this.length-1),$(i,"byteLength"),z(i,"byteLength");let o=new DataView(this.buffer,n,i);for(let s=i-1;s>=0;s--)o.setUint8(s,r&255),r=r/256;return n+i}writeUintBE(r,n,i){return this.writeUIntBE(r,n,i)}writeUIntLE(r,n,i){$(n,"offset"),z(n,"offset"),B(n,"offset",this.length-1),$(i,"byteLength"),z(i,"byteLength");let o=new DataView(this.buffer,n,i);for(let s=0;s<i;s++)o.setUint8(s,r&255),r=r/256;return n+i}writeUintLE(r,n,i){return this.writeUIntLE(r,n,i)}toJSON(){return{type:"Buffer",data:Array.from(this)}}swap16(){let r=new DataView(this.buffer,this.byteOffset,this.byteLength);for(let n=0;n<this.length;n+=2)r.setUint16(n,r.getUint16(n,!0),!1);return this}swap32(){let r=new DataView(this.buffer,this.byteOffset,this.byteLength);for(let n=0;n<this.length;n+=4)r.setUint32(n,r.getUint32(n,!0),!1);return this}swap64(){let r=new DataView(this.buffer,this.byteOffset,this.byteLength);for(let n=0;n<this.length;n+=8)r.setBigUint64(n,r.getBigUint64(n,!0),!1);return this}compare(r,n=0,i=r.length,o=0,s=this.length){return Ot(r,"target"),$(n,"targetStart"),$(i,"targetEnd"),$(o,"sourceStart"),$(s,"sourceEnd"),B(n,"targetStart"),B(i,"targetEnd",r.length),B(o,"sourceStart"),B(s,"sourceEnd",this.length),e.compare(this.slice(o,s),r.slice(n,i))}equals(r){return Ot(r,"otherBuffer"),this.length===r.length&&this.every((n,i)=>n===r[i])}copy(r,n=0,i=0,o=this.length){B(n,"targetStart"),B(i,"sourceStart",this.length),B(o,"sourceEnd"),n>>>=0,i>>>=0,o>>>=0;let s=0;for(;i<o&&!(this[i]===void 0||r[n]===void 0);)r[n]=this[i],s++,i++,n++;return s}write(r,n,i,o="utf8"){let s=typeof n=="string"?0:n??0,a=typeof i=="string"?this.length-s:i??this.length-s;return o=typeof n=="string"?n:typeof i=="string"?i:o,$(s,"offset"),$(a,"length"),B(s,"offset",this.length),B(a,"length",this.length),(o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")&&(a=a-a%2),gr(r,o).copy(this,s,0,a)}fill(r=0,n=0,i=this.length,o="utf-8"){let s=typeof n=="string"?0:n,a=typeof i=="string"?this.length:i;if(o=typeof n=="string"?n:typeof i=="string"?i:o,r=e.from(typeof r=="number"?[r]:r??[],o),sn(o,"encoding"),B(s,"offset",this.length),B(a,"end",this.length),r.length!==0)for(let u=s;u<a;u+=r.length)super.set(r.slice(0,r.length+u>=this.length?this.length-u:r.length),u);return this}includes(r,n=null,i="utf-8"){return this.indexOf(r,n,i)!==-1}lastIndexOf(r,n=null,i="utf-8"){return this.indexOf(r,n,i,!0)}indexOf(r,n=null,i="utf-8",o=!1){let s=o?this.findLastIndex.bind(this):this.findIndex.bind(this);i=typeof n=="string"?n:i;let a=e.from(typeof r=="number"?[r]:r,i),u=typeof n=="string"?0:n;return u=typeof n=="number"?u:null,u=Number.isNaN(u)?null:u,u??=o?this.length:0,u=u<0?this.length+u:u,a.length===0&&o===!1?u>=this.length?this.length:u:a.length===0&&o===!0?(u>=this.length?this.length:u)||this.length:s((g,T)=>(o?T<=u:T>=u)&&this[T]===a[0]&&a.every((O,A)=>this[T+A]===O))}toString(r="utf8",n=0,i=this.length){if(n=n<0?0:n,r=r.toString().toLowerCase(),i<=0)return"";if(r==="utf8"||r==="utf-8")return Ko.decode(this.slice(n,i));if(r==="base64"||r==="base64url"){let o=btoa(this.reduce((s,a)=>s+hr(a),""));return r==="base64url"?o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):o}if(r==="binary"||r==="ascii"||r==="latin1"||r==="latin-1")return this.slice(n,i).reduce((o,s)=>o+hr(s&(r==="ascii"?127:255)),"");if(r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le"){let o=new DataView(this.buffer.slice(n,i));return Array.from({length:o.byteLength/2},(s,a)=>a*2+1<o.byteLength?hr(o.getUint16(a*2,!0)):"").join("")}if(r==="hex")return this.slice(n,i).reduce((o,s)=>o+s.toString(16).padStart(2,"0"),"");an(`encoding "${r}"`)}toLocaleString(){return this.toString()}inspect(){return`<Buffer ${this.toString("hex").match(/.{1,2}/g).join(" ")}>`}};Go={int8:[-128,127],int16:[-32768,32767],int32:[-2147483648,2147483647],uint8:[0,255],uint16:[0,65535],uint32:[0,4294967295],float32:[-1/0,1/0],float64:[-1/0,1/0],bigint64:[-0x8000000000000000n,0x7fffffffffffffffn],biguint64:[0n,0xffffffffffffffffn]},Wo=new TextEncoder,Ko=new TextDecoder,Ho=["utf8","utf-8","hex","base64","ascii","binary","base64url","ucs2","ucs-2","utf16le","utf-16le","latin1","latin-1"],zo=4294967295;Qo(y.prototype);b=new Proxy(Yo,{construct(e,[t,r]){return y.from(t,r)},get(e,t){return y[t]}}),hr=String.fromCodePoint});var h,m=ae(()=>{"use strict";h={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var x,p=ae(()=>{"use strict";x=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,d=ae(()=>{"use strict";E=()=>{};E.prototype=E});var w,f=ae(()=>{"use strict";w=class{constructor(t){this.value=t}deref(){return this.value}}});function mn(e,t){var r,n,i,o,s,a,u,g,T=e.constructor,C=T.precision;if(!e.s||!t.s)return t.s||(t=new T(e)),U?D(t,C):t;if(u=e.d,g=t.d,s=e.e,i=t.e,u=u.slice(),o=s-i,o){for(o<0?(n=u,o=-o,a=g.length):(n=g,i=s,a=u.length),s=Math.ceil(C/N),a=s>a?s+1:a+1,o>a&&(o=a,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(a=u.length,o=g.length,a-o<0&&(o=a,n=g,g=u,u=n),r=0;o;)r=(u[--o]=u[o]+g[o]+r)/j|0,u[o]%=j;for(r&&(u.unshift(r),++i),a=u.length;u[--a]==0;)u.pop();return t.d=u,t.e=i,U?D(t,C):t}function ue(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Se+e)}function le(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=N-n.length,r&&(o+=Pe(r)),o+=n;s=e[t],n=s+"",r=N-n.length,r&&(o+=Pe(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function pn(e,t){var r,n,i,o,s,a,u=0,g=0,T=e.constructor,C=T.precision;if(V(e)>16)throw Error(br+V(e));if(!e.s)return new T(Z);for(t==null?(U=!1,a=C):a=t,s=new T(.03125);e.abs().gte(.1);)e=e.times(s),g+=5;for(n=Math.log(Ae(2,g))/Math.LN10*2+5|0,a+=n,r=i=o=new T(Z),T.precision=a;;){if(i=D(i.times(e),a),r=r.times(++u),s=o.plus(be(i,r,a)),le(s.d).slice(0,a)===le(o.d).slice(0,a)){for(;g--;)o=D(o.times(o),a);return T.precision=C,t==null?(U=!0,D(o,C)):o}o=s}}function V(e){for(var t=e.e*N,r=e.d[0];r>=10;r/=10)t++;return t}function yr(e,t,r){if(t>e.LN10.sd())throw U=!0,r&&(e.precision=r),Error(ne+"LN10 precision limit exceeded");return D(new e(e.LN10),t)}function Pe(e){for(var t="";e--;)t+="0";return t}function tt(e,t){var r,n,i,o,s,a,u,g,T,C=1,O=10,A=e,k=A.d,S=A.constructor,M=S.precision;if(A.s<1)throw Error(ne+(A.s?"NaN":"-Infinity"));if(A.eq(Z))return new S(0);if(t==null?(U=!1,g=M):g=t,A.eq(10))return t==null&&(U=!0),yr(S,g);if(g+=O,S.precision=g,r=le(k),n=r.charAt(0),o=V(A),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=le(A.d),n=r.charAt(0),C++;o=V(A),n>1?(A=new S("0."+r),o++):A=new S(n+"."+r.slice(1))}else return u=yr(S,g+2,M).times(o+""),A=tt(new S(n+"."+r.slice(1)),g-O).plus(u),S.precision=M,t==null?(U=!0,D(A,M)):A;for(a=s=A=be(A.minus(Z),A.plus(Z),g),T=D(A.times(A),g),i=3;;){if(s=D(s.times(T),g),u=a.plus(be(s,new S(i),g)),le(u.d).slice(0,g)===le(a.d).slice(0,g))return a=a.times(2),o!==0&&(a=a.plus(yr(S,g+2,M).times(o+""))),a=be(a,new S(C),g),S.precision=M,t==null?(U=!0,D(a,M)):a;a=u,i+=2}}function ln(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=_e(r/N),e.d=[],n=(r+1)%N,r<0&&(n+=N),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=N;n<i;)e.d.push(+t.slice(n,n+=N));t=t.slice(n),n=N-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),U&&(e.e>kt||e.e<-kt))throw Error(br+r)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,r){var n,i,o,s,a,u,g,T,C=e.d;for(s=1,o=C[0];o>=10;o/=10)s++;if(n=t-s,n<0)n+=N,i=t,g=C[T=0];else{if(T=Math.ceil((n+1)/N),o=C.length,T>=o)return e;for(g=o=C[T],s=1;o>=10;o/=10)s++;n%=N,i=n-N+s}if(r!==void 0&&(o=Ae(10,s-i-1),a=g/o%10|0,u=t<0||C[T+1]!==void 0||g%o,u=r<4?(a||u)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||u||r==6&&(n>0?i>0?g/Ae(10,s-i):0:C[T-1])%10&1||r==(e.s<0?8:7))),t<1||!C[0])return u?(o=V(e),C.length=1,t=t-o-1,C[0]=Ae(10,(N-t%N)%N),e.e=_e(-t/N)||0):(C.length=1,C[0]=e.e=e.s=0),e;if(n==0?(C.length=T,o=1,T--):(C.length=T+1,o=Ae(10,N-n),C[T]=i>0?(g/Ae(10,s-i)%Ae(10,i)|0)*o:0),u)for(;;)if(T==0){(C[0]+=o)==j&&(C[0]=1,++e.e);break}else{if(C[T]+=o,C[T]!=j)break;C[T--]=0,o=1}for(n=C.length;C[--n]===0;)C.pop();if(U&&(e.e>kt||e.e<-kt))throw Error(br+V(e));return e}function dn(e,t){var r,n,i,o,s,a,u,g,T,C,O=e.constructor,A=O.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new O(e),U?D(t,A):t;if(u=e.d,C=t.d,n=t.e,g=e.e,u=u.slice(),s=g-n,s){for(T=s<0,T?(r=u,s=-s,a=C.length):(r=C,n=g,a=u.length),i=Math.max(Math.ceil(A/N),a)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=u.length,a=C.length,T=i<a,T&&(a=i),i=0;i<a;i++)if(u[i]!=C[i]){T=u[i]<C[i];break}s=0}for(T&&(r=u,u=C,C=r,t.s=-t.s),a=u.length,i=C.length-a;i>0;--i)u[a++]=0;for(i=C.length;i>s;){if(u[--i]<C[i]){for(o=i;o&&u[--o]===0;)u[o]=j-1;--u[o],u[i]+=j}u[i]-=C[i]}for(;u[--a]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(t.d=u,t.e=n,U?D(t,A):t):new O(0)}function Oe(e,t,r){var n,i=V(e),o=le(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+Pe(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+Pe(-i-1)+o,r&&(n=r-s)>0&&(o+=Pe(n))):i>=s?(o+=Pe(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Pe(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=Pe(n))),e.s<0?"-"+o:o}function un(e,t){if(e.length>t)return e.length=t,!0}function fn(e){var t,r,n;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Se+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return ln(s,o.toString())}else if(typeof o!="string")throw Error(Se+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,Zo.test(o))ln(s,o);else throw Error(Se+o)}if(i.prototype=R,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=fn,i.config=i.set=es,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function es(e){if(!e||typeof e!="object")throw Error(ne+"Object expected");var t,r,n,i=["precision",1,Le,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(_e(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Se+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Se+r+": "+n);return this}var Le,Xo,wr,U,ne,Se,br,_e,Ae,Zo,Z,j,N,cn,kt,R,be,wr,Mt,gn=ae(()=>{"use strict";c();m();p();d();f();l();Le=1e9,Xo={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},U=!0,ne="[DecimalError] ",Se=ne+"Invalid argument: ",br=ne+"Exponent out of range: ",_e=Math.floor,Ae=Math.pow,Zo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,j=1e7,N=7,cn=9007199254740991,kt=_e(cn/N),R={};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};R.decimalPlaces=R.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*N;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};R.dividedBy=R.div=function(e){return be(this,new this.constructor(e))};R.dividedToIntegerBy=R.idiv=function(e){var t=this,r=t.constructor;return D(be(t,new r(e),0,1),r.precision)};R.equals=R.eq=function(e){return!this.cmp(e)};R.exponent=function(){return V(this)};R.greaterThan=R.gt=function(e){return this.cmp(e)>0};R.greaterThanOrEqualTo=R.gte=function(e){return this.cmp(e)>=0};R.isInteger=R.isint=function(){return this.e>this.d.length-2};R.isNegative=R.isneg=function(){return this.s<0};R.isPositive=R.ispos=function(){return this.s>0};R.isZero=function(){return this.s===0};R.lessThan=R.lt=function(e){return this.cmp(e)<0};R.lessThanOrEqualTo=R.lte=function(e){return this.cmp(e)<1};R.logarithm=R.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Z))throw Error(ne+"NaN");if(r.s<1)throw Error(ne+(r.s?"NaN":"-Infinity"));return r.eq(Z)?new n(0):(U=!1,t=be(tt(r,o),tt(e,o),o),U=!0,D(t,i))};R.minus=R.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?dn(t,e):mn(t,(e.s=-e.s,e))};R.modulo=R.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(ne+"NaN");return r.s?(U=!1,t=be(r,e,0,1).times(e),U=!0,r.minus(t)):D(new n(r),i)};R.naturalExponential=R.exp=function(){return pn(this)};R.naturalLogarithm=R.ln=function(){return tt(this)};R.negated=R.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};R.plus=R.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?mn(t,e):dn(t,(e.s=-e.s,e))};R.precision=R.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Se+e);if(t=V(i)+1,n=i.d.length-1,r=n*N+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};R.squareRoot=R.sqrt=function(){var e,t,r,n,i,o,s,a=this,u=a.constructor;if(a.s<1){if(!a.s)return new u(0);throw Error(ne+"NaN")}for(e=V(a),U=!1,i=Math.sqrt(+a),i==0||i==1/0?(t=le(a.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=_e((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new u(t)):n=new u(i.toString()),r=u.precision,i=s=r+3;;)if(o=n,n=o.plus(be(a,o,s+2)).times(.5),le(o.d).slice(0,s)===(t=le(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(D(o,r+1,0),o.times(o).eq(a)){n=o;break}}else if(t!="9999")break;s+=4}return U=!0,D(n,r)};R.times=R.mul=function(e){var t,r,n,i,o,s,a,u,g,T=this,C=T.constructor,O=T.d,A=(e=new C(e)).d;if(!T.s||!e.s)return new C(0);for(e.s*=T.s,r=T.e+e.e,u=O.length,g=A.length,u<g&&(o=O,O=A,A=o,s=u,u=g,g=s),o=[],s=u+g,n=s;n--;)o.push(0);for(n=g;--n>=0;){for(t=0,i=u+n;i>n;)a=o[i]+A[n]*O[i-n-1]+t,o[i--]=a%j|0,t=a/j|0;o[i]=(o[i]+t)%j|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,U?D(e,C.precision):e};R.toDecimalPlaces=R.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ue(e,0,Le),t===void 0?t=n.rounding:ue(t,0,8),D(r,e+V(r)+1,t))};R.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Oe(n,!0):(ue(e,0,Le),t===void 0?t=i.rounding:ue(t,0,8),n=D(new i(n),e+1,t),r=Oe(n,!0,e+1)),r};R.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?Oe(i):(ue(e,0,Le),t===void 0?t=o.rounding:ue(t,0,8),n=D(new o(i),e+V(i)+1,t),r=Oe(n.abs(),!1,e+V(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};R.toInteger=R.toint=function(){var e=this,t=e.constructor;return D(new t(e),V(e)+1,t.rounding)};R.toNumber=function(){return+this};R.toPower=R.pow=function(e){var t,r,n,i,o,s,a=this,u=a.constructor,g=12,T=+(e=new u(e));if(!e.s)return new u(Z);if(a=new u(a),!a.s){if(e.s<1)throw Error(ne+"Infinity");return a}if(a.eq(Z))return a;if(n=u.precision,e.eq(Z))return D(a,n);if(t=e.e,r=e.d.length-1,s=t>=r,o=a.s,s){if((r=T<0?-T:T)<=cn){for(i=new u(Z),t=Math.ceil(n/N+4),U=!1;r%2&&(i=i.times(a),un(i.d,t)),r=_e(r/2),r!==0;)a=a.times(a),un(a.d,t);return U=!0,e.s<0?new u(Z).div(i):D(i,n)}}else if(o<0)throw Error(ne+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,a.s=1,U=!1,i=e.times(tt(a,n+g)),U=!0,i=pn(i),i.s=o,i};R.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=V(i),n=Oe(i,r<=o.toExpNeg||r>=o.toExpPos)):(ue(e,1,Le),t===void 0?t=o.rounding:ue(t,0,8),i=D(new o(i),e,t),r=V(i),n=Oe(i,e<=r||r<=o.toExpNeg,e)),n};R.toSignificantDigits=R.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ue(e,1,Le),t===void 0?t=n.rounding:ue(t,0,8)),D(new n(r),e,t)};R.toString=R.valueOf=R.val=R.toJSON=R[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=V(e),r=e.constructor;return Oe(e,t<=r.toExpNeg||t>=r.toExpPos)};be=function(){function e(n,i){var o,s=0,a=n.length;for(n=n.slice();a--;)o=n[a]*i+s,n[a]=o%j|0,s=o/j|0;return s&&n.unshift(s),n}function t(n,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;a<o;a++)if(n[a]!=i[a]){u=n[a]>i[a]?1:-1;break}return u}function r(n,i,o){for(var s=0;o--;)n[o]-=s,s=n[o]<i[o]?1:0,n[o]=s*j+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s){var a,u,g,T,C,O,A,k,S,M,ie,K,Ie,H,_,fr,oe,Ct,Rt=n.constructor,No=n.s==i.s?1:-1,se=n.d,q=i.d;if(!n.s)return new Rt(n);if(!i.s)throw Error(ne+"Division by zero");for(u=n.e-i.e,oe=q.length,_=se.length,A=new Rt(No),k=A.d=[],g=0;q[g]==(se[g]||0);)++g;if(q[g]>(se[g]||0)&&--u,o==null?K=o=Rt.precision:s?K=o+(V(n)-V(i))+1:K=o,K<0)return new Rt(0);if(K=K/N+2|0,g=0,oe==1)for(T=0,q=q[0],K++;(g<_||T)&&K--;g++)Ie=T*j+(se[g]||0),k[g]=Ie/q|0,T=Ie%q|0;else{for(T=j/(q[0]+1)|0,T>1&&(q=e(q,T),se=e(se,T),oe=q.length,_=se.length),H=oe,S=se.slice(0,oe),M=S.length;M<oe;)S[M++]=0;Ct=q.slice(),Ct.unshift(0),fr=q[0],q[1]>=j/2&&++fr;do T=0,a=t(q,S,oe,M),a<0?(ie=S[0],oe!=M&&(ie=ie*j+(S[1]||0)),T=ie/fr|0,T>1?(T>=j&&(T=j-1),C=e(q,T),O=C.length,M=S.length,a=t(C,S,O,M),a==1&&(T--,r(C,oe<O?Ct:q,O))):(T==0&&(a=T=1),C=q.slice()),O=C.length,O<M&&C.unshift(0),r(S,C,M),a==-1&&(M=S.length,a=t(q,S,oe,M),a<1&&(T++,r(S,oe<M?Ct:q,M))),M=S.length):a===0&&(T++,S=[0]),k[g++]=T,a&&S[0]?S[M++]=se[H]||0:(S=[se[H]],M=1);while((H++<_||S[0]!==void 0)&&K--)}return k[0]||k.shift(),A.e=u,D(A,s?o+V(A)+1:o)}}();wr=fn(Xo);Z=new wr(1);Mt=wr});var v,ce,l=ae(()=>{"use strict";gn();v=class extends Mt{static isDecimal(t){return t instanceof Mt}static random(t=20){{let n=crypto.getRandomValues(new Uint8Array(t)).reduce((i,o)=>i+o,"");return new Mt(`0.${n.slice(0,t)}`)}}},ce=v});function ts(){return!1}var rs,ns,wn,En=ae(()=>{"use strict";c();m();p();d();f();l();rs={},ns={existsSync:ts,promises:rs},wn=ns});function us(...e){return e.join("/")}function cs(...e){return e.join("/")}var _n,ms,ps,nt,Dn=ae(()=>{"use strict";c();m();p();d();f();l();_n="/",ms={sep:_n},ps={resolve:us,posix:ms,join:cs,sep:_n},nt=ps});var Ft,qn=ae(()=>{"use strict";c();m();p();d();f();l();Ft=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var Vn=Ze((rm,$n)=>{"use strict";c();m();p();d();f();l();$n.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 Qn=Ze((hm,jn)=>{"use strict";c();m();p();d();f();l();jn.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Gn=Ze((vm,Jn)=>{"use strict";c();m();p();d();f();l();var bs=Qn();Jn.exports=e=>typeof e=="string"?e.replace(bs(),""):e});var Mr=Ze((If,Hn)=>{"use strict";c();m();p();d();f();l();Hn.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,u,g,T,C,O,A,k,S,M,ie,K,Ie,H=[];for(u=0;u<i;u++)H.push(u+1),H.push(t.charCodeAt(s+u));for(var _=H.length-1;a<o-3;)for(M=r.charCodeAt(s+(g=a)),ie=r.charCodeAt(s+(T=a+1)),K=r.charCodeAt(s+(C=a+2)),Ie=r.charCodeAt(s+(O=a+3)),A=a+=4,u=0;u<_;u+=2)k=H[u],S=H[u+1],g=e(k,g,T,M,S),T=e(g,T,C,ie,S),C=e(T,C,O,K,S),A=e(C,O,A,Ie,S),H[u]=A,O=C,C=T,T=g,g=k;for(;a<o;)for(M=r.charCodeAt(s+(g=a)),A=++a,u=0;u<_;u+=2)k=H[u],H[u]=A=e(k,g,A,M,H[u+1]),g=k;return A}}()});var vi=Ze((sE,fa)=>{fa.exports={name:"@prisma/engines-version",version:"6.3.0-16.eb5bc5493ac383a8fe3c3e7fabfc93e4d44ca21e",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"eb5bc5493ac383a8fe3c3e7fabfc93e4d44ca21e"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.68",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var ml={};St(ml,{Debug:()=>Tr,Decimal:()=>ce,Extensions:()=>Er,MetricsClient:()=>Ke,PrismaClientInitializationError:()=>I,PrismaClientKnownRequestError:()=>Y,PrismaClientRustPanicError:()=>Ee,PrismaClientUnknownRequestError:()=>Q,PrismaClientValidationError:()=>G,Public:()=>xr,Sql:()=>X,defineDmmfProperty:()=>Ei,deserializeJsonResponse:()=>Ne,deserializeRawResult:()=>pr,dmmfToRuntimeDataModel:()=>wi,empty:()=>Ci,getPrismaClient:()=>_o,getRuntime:()=>Ce,join:()=>Ti,makeStrictEnum:()=>Do,makeTypedQueryFactory:()=>xi,objectEnumValues:()=>Gt,raw:()=>jr,serializeJsonQuery:()=>Xt,skip:()=>Yt,sqltag:()=>Qr,warnEnvConflicts:()=>void 0,warnOnce:()=>at});module.exports=jo(ml);c();m();p();d();f();l();var Er={};St(Er,{defineExtension:()=>hn,getExtensionContext:()=>yn});c();m();p();d();f();l();c();m();p();d();f();l();function hn(e){return typeof e=="function"?e:t=>t.$extends(e)}c();m();p();d();f();l();function yn(e){return e}var xr={};St(xr,{validator:()=>bn});c();m();p();d();f();l();c();m();p();d();f();l();function bn(...e){return t=>t}c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();var Pr,xn,Pn,vn,Tn=!0;typeof h<"u"&&({FORCE_COLOR:Pr,NODE_DISABLE_COLORS:xn,NO_COLOR:Pn,TERM:vn}=h.env||{},Tn=h.stdout&&h.stdout.isTTY);var is={enabled:!xn&&Pn==null&&vn!=="dumb"&&(Pr!=null&&Pr!=="0"||Tn)};function F(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!is.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var hu=F(0,0),It=F(1,22),Lt=F(2,22),yu=F(3,23),Cn=F(4,24),bu=F(7,27),wu=F(8,28),Eu=F(9,29),xu=F(30,39),De=F(31,39),Rn=F(32,39),An=F(33,39),Sn=F(34,39),Pu=F(35,39),On=F(36,39),vu=F(37,39),kn=F(90,39),Tu=F(90,39),Cu=F(40,49),Ru=F(41,49),Au=F(42,49),Su=F(43,49),Ou=F(44,49),ku=F(45,49),Mu=F(46,49),Iu=F(47,49);c();m();p();d();f();l();var os=100,Mn=["green","yellow","blue","magenta","cyan","red"],_t=[],In=Date.now(),ss=0,vr=typeof h<"u"?h.env:{};globalThis.DEBUG??=vr.DEBUG??"";globalThis.DEBUG_COLORS??=vr.DEBUG_COLORS?vr.DEBUG_COLORS==="true":!0;var rt={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 as(e){let t={color:Mn[ss++%Mn.length],enabled:rt.enabled(e),namespace:e,log:rt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&_t.push([o,...n]),_t.length>os&&_t.shift(),rt.enabled(o)||i){let u=n.map(T=>typeof T=="string"?T:ls(T)),g=`+${Date.now()-In}ms`;In=Date.now(),a(o,...u,g)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Tr=new Proxy(as,{get:(e,t)=>rt[t],set:(e,t,r)=>rt[t]=r});function ls(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 Ln(){_t.length=0}var ee=Tr;c();m();p();d();f();l();c();m();p();d();f();l();var Cr=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];c();m();p();d();f();l();var Fn="library";function it(e){let t=ds();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Fn)}function ds(){let e=h.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}c();m();p();d();f();l();var Nn="prisma+postgres",Un=`${Nn}:`;function Rr(e){return e?.startsWith(`${Un}//`)??!1}c();m();p();d();f();l();c();m();p();d();f();l();var Dt;(t=>{let e;(_=>(_.findUnique="findUnique",_.findUniqueOrThrow="findUniqueOrThrow",_.findFirst="findFirst",_.findFirstOrThrow="findFirstOrThrow",_.findMany="findMany",_.create="create",_.createMany="createMany",_.createManyAndReturn="createManyAndReturn",_.update="update",_.updateMany="updateMany",_.updateManyAndReturn="updateManyAndReturn",_.upsert="upsert",_.delete="delete",_.deleteMany="deleteMany",_.groupBy="groupBy",_.count="count",_.aggregate="aggregate",_.findRaw="findRaw",_.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Dt||={});var st={};St(st,{error:()=>hs,info:()=>gs,log:()=>fs,query:()=>ys,should:()=>Bn,tags:()=>ot,warn:()=>Ar});c();m();p();d();f();l();var ot={error:De("prisma:error"),warn:An("prisma:warn"),info:On("prisma:info"),query:Sn("prisma:query")},Bn={warn:()=>!h.env.PRISMA_DISABLE_WARNINGS};function fs(...e){console.log(...e)}function Ar(e,...t){Bn.warn()&&console.warn(`${ot.warn} ${e}`,...t)}function gs(e,...t){console.info(`${ot.info} ${e}`,...t)}function hs(e,...t){console.error(`${ot.error} ${e}`,...t)}function ys(e,...t){console.log(`${ot.query} ${e}`,...t)}c();m();p();d();f();l();function Nt(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}c();m();p();d();f();l();function we(e,t){throw new Error(t)}c();m();p();d();f();l();function Sr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}c();m();p();d();f();l();var Or=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});c();m();p();d();f();l();function Fe(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}c();m();p();d();f();l();function kr(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}c();m();p();d();f();l();function te(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}c();m();p();d();f();l();var Wn=new Set,at=(e,t,...r)=>{Wn.has(e)||(Wn.add(e),Ar(t,...r))};var I=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};te(I,"PrismaClientInitializationError");c();m();p();d();f();l();var Y=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};te(Y,"PrismaClientKnownRequestError");c();m();p();d();f();l();var Ee=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};te(Ee,"PrismaClientRustPanicError");c();m();p();d();f();l();var Q=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};te(Q,"PrismaClientUnknownRequestError");c();m();p();d();f();l();var G=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};te(G,"PrismaClientValidationError");c();m();p();d();f();l();l();function Ne(e){return e===null?e:Array.isArray(e)?e.map(Ne):typeof e=="object"?ws(e)?Es(e):Fe(e,Ne):e}function ws(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Es({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":{let{buffer:r,byteOffset:n,byteLength:i}=b.from(t,"base64");return new Uint8Array(r,n,i)}case"DateTime":return new Date(t);case"Decimal":return new ce(t);case"Json":return JSON.parse(t);default:we(t,"Unknown tagged value")}}c();m();p();d();f();l();c();m();p();d();f();l();function Ue(e){return e.substring(0,1).toLowerCase()+e.substring(1)}c();m();p();d();f();l();function qe(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Ut(e){return e.toString()!=="Invalid Date"}c();m();p();d();f();l();l();function $e(e){return v.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}c();m();p();d();f();l();c();m();p();d();f();l();var xs=et(Vn());var Ps={red:De,gray:kn,dim:Lt,bold:It,underline:Cn,highlightSource:e=>e.highlight()},vs={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Ts({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Cs({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],u=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${u}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${u}`)),t&&a.push(s.underline(Rs(t))),i){a.push("");let g=[i.toString()];o&&(g.push(o),g.push(s.dim(")"))),a.push(g.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(`
|
|
2
|
-
`)}function
|
|
3
|
-
`)}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}};c();m();p();d();
|
|
4
|
-
Note that ${s.bold("include")} statements only accept relation fields.`,a})}function
|
|
5
|
-
`)}};function Ge(e){return new _r(ui(e))}function ui(e){let t=new Qe;for(let[r,n]of Object.entries(e)){let i=new Wt(r,ci(n));t.addField(i)}return t}function ci(e){if(typeof e=="string")return new J(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new J(String(e));if(typeof e=="bigint")return new J(`${e}n`);if(e===null)return new J("null");if(e===void 0)return new J("undefined");if($e(e))return new J(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return b.isBuffer(e)?new J(`Buffer.alloc(${e.byteLength})`):new J(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Ut(e)?e.toISOString():"Invalid Date";return new J(`new Date("${t}")`)}return e instanceof xe?new J(`Prisma.${e._getName()}`):Je(e)?new J(`prisma.${ai(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Xs(e):typeof e=="object"?ui(e):new J(Object.prototype.toString.call(e))}function Xs(e){let t=new je;for(let r of e)t.addItem(ci(r));return t}function Kt(e,t){let r=t==="pretty"?ei:jt,n=e.renderAllMessages(r),i=new Ve(0,{colors:r}).write(e).toString();return{message:n,args:i}}function Ht({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=Ge(e);for(let C of t)$t(C,a,s);let{message:u,args:g}=Kt(a,r),T=qt({message:u,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:g});throw new G(T,{clientVersion:o})}c();m();p();d();f();l();c();m();p();d();f();l();var pe=class{constructor(){this._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}};c();m();p();d();f();l();function ht(e){let t;return{get(){return t||(t={value:e()}),t.value}}}c();m();p();d();f();l();function de(e){return e.replace(/^./,t=>t.toLowerCase())}c();m();p();d();f();l();function pi(e,t,r){let n=de(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Zs({...e,...mi(t.name,e,t.result.$allModels),...mi(t.name,e,t.result[n])})}function Zs(e){let t=new pe,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 Fe(e,n=>({...n,needs:r(n.name,new Set)}))}function mi(e,t,r){return r?Fe(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:ea(t,o,i)})):{}}function ea(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function di(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 fi(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 zt=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new pe;this.modelExtensionsCache=new pe;this.queryCallbacksCache=new pe;this.clientExtensions=ht(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=ht(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>pi(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=de(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()}},We=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new zt(t))}isEmpty(){return this.head===void 0}append(t){return new e(new zt(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()??[]}};c();m();p();d();f();l();c();m();p();d();f();l();var gi=Symbol(),yt=class{constructor(t){if(t!==gi)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?Yt:t}},Yt=new yt(gi);function fe(e){return e instanceof yt}var ta={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"},hi="explicitly `undefined` values are not allowed";function Xt({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=We.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:u,previewFeatures:g,globalOmit:T}){let C=new Dr({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:u,previewFeatures:g,globalOmit:T});return{modelName:e,action:ta[t],query:bt(r,C)}}function bt({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:bi(r,n),selection:ra(e,t,i,n)}}function ra(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()}),sa(e,n)):na(n,t,r)}function na(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&ia(n,t,e),oa(n,r,e),n}function ia(e,t,r){for(let[n,i]of Object.entries(t)){if(fe(i))continue;let o=r.nestSelection(n);if(Fr(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]=bt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=bt(i,o)}}function oa(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=fi(i,n);for(let[s,a]of Object.entries(o)){if(fe(a))continue;Fr(a,r.nestSelection(s));let u=r.findField(s);n?.[s]&&!u||(e[s]=!a)}}function sa(e,t){let r={},n=t.getComputedFields(),i=di(e,n);for(let[o,s]of Object.entries(i)){if(fe(s))continue;let a=t.nestSelection(o);Fr(s,a);let u=t.findField(o);if(!(n?.[o]&&!u)){if(s===!1||s===void 0||fe(s)){r[o]=!1;continue}if(s===!0){u?.kind==="object"?r[o]=bt({},a):r[o]=!0;continue}r[o]=bt(s,a)}}return r}function yi(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(qe(e)){if(Ut(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(Je(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return aa(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:b.from(r,n,i).toString("base64")}}if(la(e))return e.values;if($e(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof xe){if(e!==Gt.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(ua(e))return e.toJSON();if(typeof e=="object")return bi(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 bi(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);fe(i)||(i!==void 0?r[n]=yi(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:hi}))}return r}function aa(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||fe(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(yi(o,i))}return r}function la(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function ua(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function Fr(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:hi})}var Dr=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])}throwValidationError(t){Ht({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?.[Ue(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:we(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};c();m();p();d();f();l();var Ke=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};c();m();p();d();f();l();function wi(e){return{models:Nr(e.models),enums:Nr(e.enums),types:Nr(e.types)}}function Nr(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function Ei(e,t){let r=ht(()=>ca(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function ca(e){throw new Error("Prisma.dmmf is not available when running in edge runtimes.")}function Ur(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}c();m();p();d();f();l();var qr=new WeakMap,Zt="$$PrismaTypedSql",$r=class{constructor(t,r){qr.set(this,{sql:t,values:r}),Object.defineProperty(this,Zt,{value:Zt})}get sql(){return qr.get(this).sql}get values(){return qr.get(this).values}};function xi(e){return(...t)=>new $r(e,t)}function Pi(e){return e!=null&&e[Zt]===Zt}c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();c();m();p();d();f();l();function wt(e){return{ok:!1,error:e,map(){return wt(e)},flatMap(){return wt(e)}}}var Vr=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},Br=e=>{let t=new Vr,r=ge(t,e.transactionContext.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:ge(t,e.queryRaw.bind(e)),executeRaw:ge(t,e.executeRaw.bind(e)),provider:e.provider,transactionContext:async(...i)=>(await r(...i)).map(s=>ma(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=da(t,e.getConnectionInfo.bind(e))),n},ma=(e,t)=>{let r=ge(e,t.startTransaction.bind(t));return{adapterName:t.adapterName,provider:t.provider,queryRaw:ge(e,t.queryRaw.bind(t)),executeRaw:ge(e,t.executeRaw.bind(t)),startTransaction:async(...n)=>(await r(...n)).map(o=>pa(e,o))}},pa=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:ge(e,t.queryRaw.bind(t)),executeRaw:ge(e,t.executeRaw.bind(t)),commit:ge(e,t.commit.bind(t)),rollback:ge(e,t.rollback.bind(t))});function ge(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return wt({kind:"GenericJs",id:i})}}}function da(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return wt({kind:"GenericJs",id:i})}}}var Lo=et(vi());c();m();p();d();f();l();qn();En();Dn();c();m();p();d();f();l();var X=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;i<r.length;){let s=r[i++],a=t[i];if(s instanceof e){this.strings[o]+=s.strings[0];let u=0;for(;u<s.values.length;)this.values[o++]=s.values[u++],this.strings[o]=s.strings[u];this.strings[o]+=a}else this.values[o++]=s,this.strings[o]=a}}get sql(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`?${this.strings[r++]}`;return n}get statement(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`:${r}${this.strings[r++]}`;return n}get text(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`$${r}${this.strings[r++]}`;return n}inspect(){return{sql:this.sql,statement:this.statement,text:this.text,values:this.values}}};function Ti(e,t=",",r="",n=""){if(e.length===0)throw new TypeError("Expected `join([])` to be called with an array of multiple elements, but got an empty array");return new X([r,...Array(e.length-1).fill(t),n],e)}function jr(e){return new X([e],[])}var Ci=jr("");function Qr(e,...t){return new X(e,t)}c();m();p();d();f();l();c();m();p();d();f();l();function Et(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}c();m();p();d();f();l();function W(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}c();m();p();d();f();l();function ke(e){let t=new pe;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}c();m();p();d();f();l();c();m();p();d();f();l();var er={enumerable:!0,configurable:!0,writable:!0};function tr(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>er,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Ri=Symbol.for("nodejs.util.inspect.custom");function he(e,t){let r=ga(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=Ai(Reflect.ownKeys(o),r),a=Ai(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 u=r.get(s);return u?u.getPropertyDescriptor?{...er,...u?.getPropertyDescriptor(s)}:er:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[Ri]=function(){let o={...this};return delete o[Ri],o},i}function ga(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 Ai(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}c();m();p();d();f();l();function He(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}c();m();p();d();f();l();function rr(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}c();m();p();d();f();l();function Si(e){if(e===void 0)return"";let t=Ge(e);return new Ve(0,{colors:jt}).write(t).toString()}c();m();p();d();f();l();var ha="P2037";function nr({error:e,user_facing_error:t},r,n){return t.error_code?new Y(ya(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new Q(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function ya(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===ha&&(r+=`
|
|
6
|
-
Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}c();m();p();d();
|
|
1
|
+
"use strict";var zo=Object.create;var kt=Object.defineProperty;var Yo=Object.getOwnPropertyDescriptor;var Xo=Object.getOwnPropertyNames;var Zo=Object.getPrototypeOf,es=Object.prototype.hasOwnProperty;var le=(e,t)=>()=>(e&&(t=e(e=0)),t);var tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),It=(e,t)=>{for(var r in t)kt(e,r,{get:t[r],enumerable:!0})},mn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Xo(t))!es.call(e,i)&&i!==r&&kt(e,i,{get:()=>t[i],enumerable:!(n=Yo(t,i))||n.enumerable});return e};var rt=(e,t,r)=>(r=e!=null?zo(Zo(e)):{},mn(t||!e||!e.__esModule?kt(r,"default",{value:e,enumerable:!0}):r,e)),ts=e=>mn(kt({},"__esModule",{value:!0}),e);function xr(e,t){if(t=t.toLowerCase(),t==="utf8"||t==="utf-8")return new y(os.encode(e));if(t==="base64"||t==="base64url")return e=e.replace(/-/g,"+").replace(/_/g,"/"),e=e.replace(/[^A-Za-z0-9+/]/g,""),new y([...atob(e)].map(r=>r.charCodeAt(0)));if(t==="binary"||t==="ascii"||t==="latin1"||t==="latin-1")return new y([...e].map(r=>r.charCodeAt(0)));if(t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le"){let r=new y(e.length*2),n=new DataView(r.buffer);for(let i=0;i<e.length;i++)n.setUint16(i*2,e.charCodeAt(i),!0);return r}if(t==="hex"){let r=new y(e.length/2);for(let n=0,i=0;i<e.length;i+=2,n++)r[n]=parseInt(e.slice(i,i+2),16);return r}dn(`encoding "${t}"`)}function rs(e){let r=Object.getOwnPropertyNames(DataView.prototype).filter(a=>a.startsWith("get")||a.startsWith("set")),n=r.map(a=>a.replace("get","read").replace("set","write")),i=(a,f)=>function(h=0){return V(h,"offset"),Y(h,"offset"),j(h,"offset",this.length-1),new DataView(this.buffer)[r[a]](h,f)},o=(a,f)=>function(h,T=0){let C=r[a].match(/set(\w+\d+)/)[1].toLowerCase(),O=is[C];return V(T,"offset"),Y(T,"offset"),j(T,"offset",this.length-1),ns(h,"value",O[0],O[1]),new DataView(this.buffer)[r[a]](T,h,f),T+parseInt(r[a].match(/\d+/)[0])/8},s=a=>{a.forEach(f=>{f.includes("Uint")&&(e[f.replace("Uint","UInt")]=e[f]),f.includes("Float64")&&(e[f.replace("Float64","Double")]=e[f]),f.includes("Float32")&&(e[f.replace("Float32","Float")]=e[f])})};n.forEach((a,f)=>{a.startsWith("read")&&(e[a]=i(f,!1),e[a+"LE"]=i(f,!0),e[a+"BE"]=i(f,!1)),a.startsWith("write")&&(e[a]=o(f,!1),e[a+"LE"]=o(f,!0),e[a+"BE"]=o(f,!1)),s([a,a+"LE",a+"BE"])})}function dn(e){throw new Error(`Buffer polyfill does not implement "${e}"`)}function Lt(e,t){if(!(e instanceof Uint8Array))throw new TypeError(`The "${t}" argument must be an instance of Buffer or Uint8Array`)}function j(e,t,r=ls+1){if(e<0||e>r){let n=new RangeError(`The value of "${t}" is out of range. It must be >= 0 && <= ${r}. Received ${e}`);throw n.code="ERR_OUT_OF_RANGE",n}}function V(e,t){if(typeof e!="number"){let r=new TypeError(`The "${t}" argument must be of type number. Received type ${typeof e}.`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function Y(e,t){if(!Number.isInteger(e)||Number.isNaN(e)){let r=new RangeError(`The value of "${t}" is out of range. It must be an integer. Received ${e}`);throw r.code="ERR_OUT_OF_RANGE",r}}function ns(e,t,r,n){if(e<r||e>n){let i=new RangeError(`The value of "${t}" is out of range. It must be >= ${r} and <= ${n}. Received ${e}`);throw i.code="ERR_OUT_OF_RANGE",i}}function pn(e,t){if(typeof e!="string"){let r=new TypeError(`The "${t}" argument must be of type string. Received type ${typeof e}`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function us(e,t="utf8"){return y.from(e,t)}var y,is,os,ss,as,ls,b,Pr,u=le(()=>{"use strict";y=class e extends Uint8Array{constructor(){super(...arguments);this._isBuffer=!0}get offset(){return this.byteOffset}static alloc(r,n=0,i="utf8"){return pn(i,"encoding"),e.allocUnsafe(r).fill(n,i)}static allocUnsafe(r){return e.from(r)}static allocUnsafeSlow(r){return e.from(r)}static isBuffer(r){return r&&!!r._isBuffer}static byteLength(r,n="utf8"){if(typeof r=="string")return xr(r,n).byteLength;if(r&&r.byteLength)return r.byteLength;let i=new TypeError('The "string" argument must be of type string or an instance of Buffer or ArrayBuffer.');throw i.code="ERR_INVALID_ARG_TYPE",i}static isEncoding(r){return as.includes(r)}static compare(r,n){Lt(r,"buff1"),Lt(n,"buff2");for(let i=0;i<r.length;i++){if(r[i]<n[i])return-1;if(r[i]>n[i])return 1}return r.length===n.length?0:r.length>n.length?1:-1}static from(r,n="utf8"){if(r&&typeof r=="object"&&r.type==="Buffer")return new e(r.data);if(typeof r=="number")return new e(new Uint8Array(r));if(typeof r=="string")return xr(r,n);if(ArrayBuffer.isView(r)){let{byteOffset:i,byteLength:o,buffer:s}=r;return"map"in r&&typeof r.map=="function"?new e(r.map(a=>a%256),i,o):new e(s,i,o)}if(r&&typeof r=="object"&&("length"in r||"byteLength"in r||"buffer"in r))return new e(r);throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}static concat(r,n){if(r.length===0)return e.alloc(0);let i=[].concat(...r.map(s=>[...s])),o=e.alloc(n!==void 0?n:i.length);return o.set(n!==void 0?i.slice(0,n):i),o}slice(r=0,n=this.length){return this.subarray(r,n)}subarray(r=0,n=this.length){return Object.setPrototypeOf(super.subarray(r,n),e.prototype)}reverse(){return super.reverse(),this}readIntBE(r,n){V(r,"offset"),Y(r,"offset"),j(r,"offset",this.length-1),V(n,"byteLength"),Y(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s<n;s++)o=o*256+i.getUint8(s);return i.getUint8(0)&128&&(o-=Math.pow(256,n)),o}readIntLE(r,n){V(r,"offset"),Y(r,"offset"),j(r,"offset",this.length-1),V(n,"byteLength"),Y(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s<n;s++)o+=i.getUint8(s)*Math.pow(256,s);return i.getUint8(n-1)&128&&(o-=Math.pow(256,n)),o}readUIntBE(r,n){V(r,"offset"),Y(r,"offset"),j(r,"offset",this.length-1),V(n,"byteLength"),Y(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s<n;s++)o=o*256+i.getUint8(s);return o}readUintBE(r,n){return this.readUIntBE(r,n)}readUIntLE(r,n){V(r,"offset"),Y(r,"offset"),j(r,"offset",this.length-1),V(n,"byteLength"),Y(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s<n;s++)o+=i.getUint8(s)*Math.pow(256,s);return o}readUintLE(r,n){return this.readUIntLE(r,n)}writeIntBE(r,n,i){return r=r<0?r+Math.pow(256,i):r,this.writeUIntBE(r,n,i)}writeIntLE(r,n,i){return r=r<0?r+Math.pow(256,i):r,this.writeUIntLE(r,n,i)}writeUIntBE(r,n,i){V(n,"offset"),Y(n,"offset"),j(n,"offset",this.length-1),V(i,"byteLength"),Y(i,"byteLength");let o=new DataView(this.buffer,n,i);for(let s=i-1;s>=0;s--)o.setUint8(s,r&255),r=r/256;return n+i}writeUintBE(r,n,i){return this.writeUIntBE(r,n,i)}writeUIntLE(r,n,i){V(n,"offset"),Y(n,"offset"),j(n,"offset",this.length-1),V(i,"byteLength"),Y(i,"byteLength");let o=new DataView(this.buffer,n,i);for(let s=0;s<i;s++)o.setUint8(s,r&255),r=r/256;return n+i}writeUintLE(r,n,i){return this.writeUIntLE(r,n,i)}toJSON(){return{type:"Buffer",data:Array.from(this)}}swap16(){let r=new DataView(this.buffer,this.byteOffset,this.byteLength);for(let n=0;n<this.length;n+=2)r.setUint16(n,r.getUint16(n,!0),!1);return this}swap32(){let r=new DataView(this.buffer,this.byteOffset,this.byteLength);for(let n=0;n<this.length;n+=4)r.setUint32(n,r.getUint32(n,!0),!1);return this}swap64(){let r=new DataView(this.buffer,this.byteOffset,this.byteLength);for(let n=0;n<this.length;n+=8)r.setBigUint64(n,r.getBigUint64(n,!0),!1);return this}compare(r,n=0,i=r.length,o=0,s=this.length){return Lt(r,"target"),V(n,"targetStart"),V(i,"targetEnd"),V(o,"sourceStart"),V(s,"sourceEnd"),j(n,"targetStart"),j(i,"targetEnd",r.length),j(o,"sourceStart"),j(s,"sourceEnd",this.length),e.compare(this.slice(o,s),r.slice(n,i))}equals(r){return Lt(r,"otherBuffer"),this.length===r.length&&this.every((n,i)=>n===r[i])}copy(r,n=0,i=0,o=this.length){j(n,"targetStart"),j(i,"sourceStart",this.length),j(o,"sourceEnd"),n>>>=0,i>>>=0,o>>>=0;let s=0;for(;i<o&&!(this[i]===void 0||r[n]===void 0);)r[n]=this[i],s++,i++,n++;return s}write(r,n,i,o="utf8"){let s=typeof n=="string"?0:n??0,a=typeof i=="string"?this.length-s:i??this.length-s;return o=typeof n=="string"?n:typeof i=="string"?i:o,V(s,"offset"),V(a,"length"),j(s,"offset",this.length),j(a,"length",this.length),(o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")&&(a=a-a%2),xr(r,o).copy(this,s,0,a)}fill(r=0,n=0,i=this.length,o="utf-8"){let s=typeof n=="string"?0:n,a=typeof i=="string"?this.length:i;if(o=typeof n=="string"?n:typeof i=="string"?i:o,r=e.from(typeof r=="number"?[r]:r??[],o),pn(o,"encoding"),j(s,"offset",this.length),j(a,"end",this.length),r.length!==0)for(let f=s;f<a;f+=r.length)super.set(r.slice(0,r.length+f>=this.length?this.length-f:r.length),f);return this}includes(r,n=null,i="utf-8"){return this.indexOf(r,n,i)!==-1}lastIndexOf(r,n=null,i="utf-8"){return this.indexOf(r,n,i,!0)}indexOf(r,n=null,i="utf-8",o=!1){let s=o?this.findLastIndex.bind(this):this.findIndex.bind(this);i=typeof n=="string"?n:i;let a=e.from(typeof r=="number"?[r]:r,i),f=typeof n=="string"?0:n;return f=typeof n=="number"?f:null,f=Number.isNaN(f)?null:f,f??=o?this.length:0,f=f<0?this.length+f:f,a.length===0&&o===!1?f>=this.length?this.length:f:a.length===0&&o===!0?(f>=this.length?this.length:f)||this.length:s((h,T)=>(o?T<=f:T>=f)&&this[T]===a[0]&&a.every((O,A)=>this[T+A]===O))}toString(r="utf8",n=0,i=this.length){if(n=n<0?0:n,r=r.toString().toLowerCase(),i<=0)return"";if(r==="utf8"||r==="utf-8")return ss.decode(this.slice(n,i));if(r==="base64"||r==="base64url"){let o=btoa(this.reduce((s,a)=>s+Pr(a),""));return r==="base64url"?o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):o}if(r==="binary"||r==="ascii"||r==="latin1"||r==="latin-1")return this.slice(n,i).reduce((o,s)=>o+Pr(s&(r==="ascii"?127:255)),"");if(r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le"){let o=new DataView(this.buffer.slice(n,i));return Array.from({length:o.byteLength/2},(s,a)=>a*2+1<o.byteLength?Pr(o.getUint16(a*2,!0)):"").join("")}if(r==="hex")return this.slice(n,i).reduce((o,s)=>o+s.toString(16).padStart(2,"0"),"");dn(`encoding "${r}"`)}toLocaleString(){return this.toString()}inspect(){return`<Buffer ${this.toString("hex").match(/.{1,2}/g).join(" ")}>`}};is={int8:[-128,127],int16:[-32768,32767],int32:[-2147483648,2147483647],uint8:[0,255],uint16:[0,65535],uint32:[0,4294967295],float32:[-1/0,1/0],float64:[-1/0,1/0],bigint64:[-0x8000000000000000n,0x7fffffffffffffffn],biguint64:[0n,0xffffffffffffffffn]},os=new TextEncoder,ss=new TextDecoder,as=["utf8","utf-8","hex","base64","ascii","binary","base64url","ucs2","ucs-2","utf16le","utf-16le","latin1","latin-1"],ls=4294967295;rs(y.prototype);b=new Proxy(us,{construct(e,[t,r]){return y.from(t,r)},get(e,t){return y[t]}}),Pr=String.fromCodePoint});var g,c=le(()=>{"use strict";g={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var x,m=le(()=>{"use strict";x=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,p=le(()=>{"use strict";E=()=>{};E.prototype=E});var w,d=le(()=>{"use strict";w=class{constructor(t){this.value=t}deref(){return this.value}}});function hn(e,t){var r,n,i,o,s,a,f,h,T=e.constructor,C=T.precision;if(!e.s||!t.s)return t.s||(t=new T(e)),q?D(t,C):t;if(f=e.d,h=t.d,s=e.e,i=t.e,f=f.slice(),o=s-i,o){for(o<0?(n=f,o=-o,a=h.length):(n=h,i=s,a=f.length),s=Math.ceil(C/N),a=s>a?s+1:a+1,o>a&&(o=a,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(a=f.length,o=h.length,a-o<0&&(o=a,n=h,h=f,f=n),r=0;o;)r=(f[--o]=f[o]+h[o]+r)/Q|0,f[o]%=Q;for(r&&(f.unshift(r),++i),a=f.length;f[--a]==0;)f.pop();return t.d=f,t.e=i,q?D(t,C):t}function ce(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Oe+e)}function ue(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=N-n.length,r&&(o+=ve(r)),o+=n;s=e[t],n=s+"",r=N-n.length,r&&(o+=ve(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function bn(e,t){var r,n,i,o,s,a,f=0,h=0,T=e.constructor,C=T.precision;if($(e)>16)throw Error(Tr+$(e));if(!e.s)return new T(ee);for(t==null?(q=!1,a=C):a=t,s=new T(.03125);e.abs().gte(.1);)e=e.times(s),h+=5;for(n=Math.log(Se(2,h))/Math.LN10*2+5|0,a+=n,r=i=o=new T(ee),T.precision=a;;){if(i=D(i.times(e),a),r=r.times(++f),s=o.plus(we(i,r,a)),ue(s.d).slice(0,a)===ue(o.d).slice(0,a)){for(;h--;)o=D(o.times(o),a);return T.precision=C,t==null?(q=!0,D(o,C)):o}o=s}}function $(e){for(var t=e.e*N,r=e.d[0];r>=10;r/=10)t++;return t}function vr(e,t,r){if(t>e.LN10.sd())throw q=!0,r&&(e.precision=r),Error(ne+"LN10 precision limit exceeded");return D(new e(e.LN10),t)}function ve(e){for(var t="";e--;)t+="0";return t}function nt(e,t){var r,n,i,o,s,a,f,h,T,C=1,O=10,A=e,I=A.d,S=A.constructor,L=S.precision;if(A.s<1)throw Error(ne+(A.s?"NaN":"-Infinity"));if(A.eq(ee))return new S(0);if(t==null?(q=!1,h=L):h=t,A.eq(10))return t==null&&(q=!0),vr(S,h);if(h+=O,S.precision=h,r=ue(I),n=r.charAt(0),o=$(A),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=ue(A.d),n=r.charAt(0),C++;o=$(A),n>1?(A=new S("0."+r),o++):A=new S(n+"."+r.slice(1))}else return f=vr(S,h+2,L).times(o+""),A=nt(new S(n+"."+r.slice(1)),h-O).plus(f),S.precision=L,t==null?(q=!0,D(A,L)):A;for(a=s=A=we(A.minus(ee),A.plus(ee),h),T=D(A.times(A),h),i=3;;){if(s=D(s.times(T),h),f=a.plus(we(s,new S(i),h)),ue(f.d).slice(0,h)===ue(a.d).slice(0,h))return a=a.times(2),o!==0&&(a=a.plus(vr(S,h+2,L).times(o+""))),a=we(a,new S(C),h),S.precision=L,t==null?(q=!0,D(a,L)):a;a=f,i+=2}}function fn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=De(r/N),e.d=[],n=(r+1)%N,r<0&&(n+=N),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=N;n<i;)e.d.push(+t.slice(n,n+=N));t=t.slice(n),n=N-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),q&&(e.e>Mt||e.e<-Mt))throw Error(Tr+r)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,r){var n,i,o,s,a,f,h,T,C=e.d;for(s=1,o=C[0];o>=10;o/=10)s++;if(n=t-s,n<0)n+=N,i=t,h=C[T=0];else{if(T=Math.ceil((n+1)/N),o=C.length,T>=o)return e;for(h=o=C[T],s=1;o>=10;o/=10)s++;n%=N,i=n-N+s}if(r!==void 0&&(o=Se(10,s-i-1),a=h/o%10|0,f=t<0||C[T+1]!==void 0||h%o,f=r<4?(a||f)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||f||r==6&&(n>0?i>0?h/Se(10,s-i):0:C[T-1])%10&1||r==(e.s<0?8:7))),t<1||!C[0])return f?(o=$(e),C.length=1,t=t-o-1,C[0]=Se(10,(N-t%N)%N),e.e=De(-t/N)||0):(C.length=1,C[0]=e.e=e.s=0),e;if(n==0?(C.length=T,o=1,T--):(C.length=T+1,o=Se(10,N-n),C[T]=i>0?(h/Se(10,s-i)%Se(10,i)|0)*o:0),f)for(;;)if(T==0){(C[0]+=o)==Q&&(C[0]=1,++e.e);break}else{if(C[T]+=o,C[T]!=Q)break;C[T--]=0,o=1}for(n=C.length;C[--n]===0;)C.pop();if(q&&(e.e>Mt||e.e<-Mt))throw Error(Tr+$(e));return e}function wn(e,t){var r,n,i,o,s,a,f,h,T,C,O=e.constructor,A=O.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new O(e),q?D(t,A):t;if(f=e.d,C=t.d,n=t.e,h=e.e,f=f.slice(),s=h-n,s){for(T=s<0,T?(r=f,s=-s,a=C.length):(r=C,n=h,a=f.length),i=Math.max(Math.ceil(A/N),a)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=f.length,a=C.length,T=i<a,T&&(a=i),i=0;i<a;i++)if(f[i]!=C[i]){T=f[i]<C[i];break}s=0}for(T&&(r=f,f=C,C=r,t.s=-t.s),a=f.length,i=C.length-a;i>0;--i)f[a++]=0;for(i=C.length;i>s;){if(f[--i]<C[i]){for(o=i;o&&f[--o]===0;)f[o]=Q-1;--f[o],f[i]+=Q}f[i]-=C[i]}for(;f[--a]===0;)f.pop();for(;f[0]===0;f.shift())--n;return f[0]?(t.d=f,t.e=n,q?D(t,A):t):new O(0)}function ke(e,t,r){var n,i=$(e),o=ue(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+ve(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ve(-i-1)+o,r&&(n=r-s)>0&&(o+=ve(n))):i>=s?(o+=ve(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+ve(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=ve(n))),e.s<0?"-"+o:o}function gn(e,t){if(e.length>t)return e.length=t,!0}function En(e){var t,r,n;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Oe+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return fn(s,o.toString())}else if(typeof o!="string")throw Error(Oe+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,ms.test(o))fn(s,o);else throw Error(Oe+o)}if(i.prototype=R,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=En,i.config=i.set=ps,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function ps(e){if(!e||typeof e!="object")throw Error(ne+"Object expected");var t,r,n,i=["precision",1,_e,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(De(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Oe+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Oe+r+": "+n);return this}var _e,cs,Cr,q,ne,Oe,Tr,De,Se,ms,ee,Q,N,yn,Mt,R,we,Cr,_t,xn=le(()=>{"use strict";u();c();m();p();d();l();_e=1e9,cs={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},q=!0,ne="[DecimalError] ",Oe=ne+"Invalid argument: ",Tr=ne+"Exponent out of range: ",De=Math.floor,Se=Math.pow,ms=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Q=1e7,N=7,yn=9007199254740991,Mt=De(yn/N),R={};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};R.decimalPlaces=R.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*N;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};R.dividedBy=R.div=function(e){return we(this,new this.constructor(e))};R.dividedToIntegerBy=R.idiv=function(e){var t=this,r=t.constructor;return D(we(t,new r(e),0,1),r.precision)};R.equals=R.eq=function(e){return!this.cmp(e)};R.exponent=function(){return $(this)};R.greaterThan=R.gt=function(e){return this.cmp(e)>0};R.greaterThanOrEqualTo=R.gte=function(e){return this.cmp(e)>=0};R.isInteger=R.isint=function(){return this.e>this.d.length-2};R.isNegative=R.isneg=function(){return this.s<0};R.isPositive=R.ispos=function(){return this.s>0};R.isZero=function(){return this.s===0};R.lessThan=R.lt=function(e){return this.cmp(e)<0};R.lessThanOrEqualTo=R.lte=function(e){return this.cmp(e)<1};R.logarithm=R.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(ee))throw Error(ne+"NaN");if(r.s<1)throw Error(ne+(r.s?"NaN":"-Infinity"));return r.eq(ee)?new n(0):(q=!1,t=we(nt(r,o),nt(e,o),o),q=!0,D(t,i))};R.minus=R.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?wn(t,e):hn(t,(e.s=-e.s,e))};R.modulo=R.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(ne+"NaN");return r.s?(q=!1,t=we(r,e,0,1).times(e),q=!0,r.minus(t)):D(new n(r),i)};R.naturalExponential=R.exp=function(){return bn(this)};R.naturalLogarithm=R.ln=function(){return nt(this)};R.negated=R.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};R.plus=R.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?hn(t,e):wn(t,(e.s=-e.s,e))};R.precision=R.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Oe+e);if(t=$(i)+1,n=i.d.length-1,r=n*N+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};R.squareRoot=R.sqrt=function(){var e,t,r,n,i,o,s,a=this,f=a.constructor;if(a.s<1){if(!a.s)return new f(0);throw Error(ne+"NaN")}for(e=$(a),q=!1,i=Math.sqrt(+a),i==0||i==1/0?(t=ue(a.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=De((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=s=r+3;;)if(o=n,n=o.plus(we(a,o,s+2)).times(.5),ue(o.d).slice(0,s)===(t=ue(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(D(o,r+1,0),o.times(o).eq(a)){n=o;break}}else if(t!="9999")break;s+=4}return q=!0,D(n,r)};R.times=R.mul=function(e){var t,r,n,i,o,s,a,f,h,T=this,C=T.constructor,O=T.d,A=(e=new C(e)).d;if(!T.s||!e.s)return new C(0);for(e.s*=T.s,r=T.e+e.e,f=O.length,h=A.length,f<h&&(o=O,O=A,A=o,s=f,f=h,h=s),o=[],s=f+h,n=s;n--;)o.push(0);for(n=h;--n>=0;){for(t=0,i=f+n;i>n;)a=o[i]+A[n]*O[i-n-1]+t,o[i--]=a%Q|0,t=a/Q|0;o[i]=(o[i]+t)%Q|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,q?D(e,C.precision):e};R.toDecimalPlaces=R.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ce(e,0,_e),t===void 0?t=n.rounding:ce(t,0,8),D(r,e+$(r)+1,t))};R.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ke(n,!0):(ce(e,0,_e),t===void 0?t=i.rounding:ce(t,0,8),n=D(new i(n),e+1,t),r=ke(n,!0,e+1)),r};R.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?ke(i):(ce(e,0,_e),t===void 0?t=o.rounding:ce(t,0,8),n=D(new o(i),e+$(i)+1,t),r=ke(n.abs(),!1,e+$(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};R.toInteger=R.toint=function(){var e=this,t=e.constructor;return D(new t(e),$(e)+1,t.rounding)};R.toNumber=function(){return+this};R.toPower=R.pow=function(e){var t,r,n,i,o,s,a=this,f=a.constructor,h=12,T=+(e=new f(e));if(!e.s)return new f(ee);if(a=new f(a),!a.s){if(e.s<1)throw Error(ne+"Infinity");return a}if(a.eq(ee))return a;if(n=f.precision,e.eq(ee))return D(a,n);if(t=e.e,r=e.d.length-1,s=t>=r,o=a.s,s){if((r=T<0?-T:T)<=yn){for(i=new f(ee),t=Math.ceil(n/N+4),q=!1;r%2&&(i=i.times(a),gn(i.d,t)),r=De(r/2),r!==0;)a=a.times(a),gn(a.d,t);return q=!0,e.s<0?new f(ee).div(i):D(i,n)}}else if(o<0)throw Error(ne+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,a.s=1,q=!1,i=e.times(nt(a,n+h)),q=!0,i=bn(i),i.s=o,i};R.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=$(i),n=ke(i,r<=o.toExpNeg||r>=o.toExpPos)):(ce(e,1,_e),t===void 0?t=o.rounding:ce(t,0,8),i=D(new o(i),e,t),r=$(i),n=ke(i,e<=r||r<=o.toExpNeg,e)),n};R.toSignificantDigits=R.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ce(e,1,_e),t===void 0?t=n.rounding:ce(t,0,8)),D(new n(r),e,t)};R.toString=R.valueOf=R.val=R.toJSON=R[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=$(e),r=e.constructor;return ke(e,t<=r.toExpNeg||t>=r.toExpPos)};we=function(){function e(n,i){var o,s=0,a=n.length;for(n=n.slice();a--;)o=n[a]*i+s,n[a]=o%Q|0,s=o/Q|0;return s&&n.unshift(s),n}function t(n,i,o,s){var a,f;if(o!=s)f=o>s?1:-1;else for(a=f=0;a<o;a++)if(n[a]!=i[a]){f=n[a]>i[a]?1:-1;break}return f}function r(n,i,o){for(var s=0;o--;)n[o]-=s,s=n[o]<i[o]?1:0,n[o]=s*Q+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s){var a,f,h,T,C,O,A,I,S,L,oe,K,Me,z,_,Er,se,St,Ot=n.constructor,Ko=n.s==i.s?1:-1,ae=n.d,B=i.d;if(!n.s)return new Ot(n);if(!i.s)throw Error(ne+"Division by zero");for(f=n.e-i.e,se=B.length,_=ae.length,A=new Ot(Ko),I=A.d=[],h=0;B[h]==(ae[h]||0);)++h;if(B[h]>(ae[h]||0)&&--f,o==null?K=o=Ot.precision:s?K=o+($(n)-$(i))+1:K=o,K<0)return new Ot(0);if(K=K/N+2|0,h=0,se==1)for(T=0,B=B[0],K++;(h<_||T)&&K--;h++)Me=T*Q+(ae[h]||0),I[h]=Me/B|0,T=Me%B|0;else{for(T=Q/(B[0]+1)|0,T>1&&(B=e(B,T),ae=e(ae,T),se=B.length,_=ae.length),z=se,S=ae.slice(0,se),L=S.length;L<se;)S[L++]=0;St=B.slice(),St.unshift(0),Er=B[0],B[1]>=Q/2&&++Er;do T=0,a=t(B,S,se,L),a<0?(oe=S[0],se!=L&&(oe=oe*Q+(S[1]||0)),T=oe/Er|0,T>1?(T>=Q&&(T=Q-1),C=e(B,T),O=C.length,L=S.length,a=t(C,S,O,L),a==1&&(T--,r(C,se<O?St:B,O))):(T==0&&(a=T=1),C=B.slice()),O=C.length,O<L&&C.unshift(0),r(S,C,L),a==-1&&(L=S.length,a=t(B,S,se,L),a<1&&(T++,r(S,se<L?St:B,L))),L=S.length):a===0&&(T++,S=[0]),I[h++]=T,a&&S[0]?S[L++]=ae[z]||0:(S=[ae[z]],L=1);while((z++<_||S[0]!==void 0)&&K--)}return I[0]||I.shift(),A.e=f,D(A,s?o+$(A)+1:o)}}();Cr=En(cs);ee=new Cr(1);_t=Cr});var v,me,l=le(()=>{"use strict";xn();v=class extends _t{static isDecimal(t){return t instanceof _t}static random(t=20){{let n=crypto.getRandomValues(new Uint8Array(t)).reduce((i,o)=>i+o,"");return new _t(`0.${n.slice(0,t)}`)}}},me=v});function ds(){return!1}var fs,gs,Cn,Rn=le(()=>{"use strict";u();c();m();p();d();l();fs={},gs={existsSync:ds,promises:fs},Cn=gs});function xs(...e){return e.join("/")}function Ps(...e){return e.join("/")}var Bn,vs,Ts,st,Vn=le(()=>{"use strict";u();c();m();p();d();l();Bn="/",vs={sep:Bn},Ts={resolve:xs,posix:vs,join:Ps,sep:Bn},st=Ts});var Ut,Jn=le(()=>{"use strict";u();c();m();p();d();l();Ut=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var Wn=tt((wm,Gn)=>{"use strict";u();c();m();p();d();l();Gn.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 zn=tt((Mm,Kn)=>{"use strict";u();c();m();p();d();l();Kn.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Xn=tt((Bm,Yn)=>{"use strict";u();c();m();p();d();l();var ks=zn();Yn.exports=e=>typeof e=="string"?e.replace(ks(),""):e});var Fr=tt((Kf,ti)=>{"use strict";u();c();m();p();d();l();ti.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,f,h,T,C,O,A,I,S,L,oe,K,Me,z=[];for(f=0;f<i;f++)z.push(f+1),z.push(t.charCodeAt(s+f));for(var _=z.length-1;a<o-3;)for(L=r.charCodeAt(s+(h=a)),oe=r.charCodeAt(s+(T=a+1)),K=r.charCodeAt(s+(C=a+2)),Me=r.charCodeAt(s+(O=a+3)),A=a+=4,f=0;f<_;f+=2)I=z[f],S=z[f+1],h=e(I,h,T,L,S),T=e(h,T,C,oe,S),C=e(T,C,O,K,S),A=e(C,O,A,Me,S),z[f]=A,O=C,C=T,T=h,h=I;for(;a<o;)for(L=r.charCodeAt(s+(h=a)),A=++a,f=0;f<_;f+=2)I=z[f],z[f]=A=e(I,h,A,L,z[f+1]),h=I;return A}}()});var Ii=tt((IE,Ra)=>{Ra.exports={name:"@prisma/engines-version",version:"6.3.0-16.eb5bc5493ac383a8fe3c3e7fabfc93e4d44ca21e",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"eb5bc5493ac383a8fe3c3e7fabfc93e4d44ca21e"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.68",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Sl={};It(Sl,{Debug:()=>kr,Decimal:()=>me,Extensions:()=>Rr,MetricsClient:()=>ze,PrismaClientInitializationError:()=>k,PrismaClientKnownRequestError:()=>X,PrismaClientRustPanicError:()=>xe,PrismaClientUnknownRequestError:()=>U,PrismaClientValidationError:()=>G,Public:()=>Ar,Sql:()=>Z,createParam:()=>Pi,defineDmmfProperty:()=>Si,deserializeJsonResponse:()=>Ue,deserializeRawResult:()=>br,dmmfToRuntimeDataModel:()=>Ai,empty:()=>Mi,getPrismaClient:()=>Go,getRuntime:()=>Re,join:()=>Li,makeStrictEnum:()=>Wo,makeTypedQueryFactory:()=>Oi,objectEnumValues:()=>Kt,raw:()=>Hr,serializeJsonQuery:()=>rr,skip:()=>tr,sqltag:()=>Kr,warnEnvConflicts:()=>void 0,warnOnce:()=>ut});module.exports=ts(Sl);u();c();m();p();d();l();var Rr={};It(Rr,{defineExtension:()=>Pn,getExtensionContext:()=>vn});u();c();m();p();d();l();u();c();m();p();d();l();function Pn(e){return typeof e=="function"?e:t=>t.$extends(e)}u();c();m();p();d();l();function vn(e){return e}var Ar={};It(Ar,{validator:()=>Tn});u();c();m();p();d();l();u();c();m();p();d();l();function Tn(...e){return t=>t}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Sr,An,Sn,On,kn=!0;typeof g<"u"&&({FORCE_COLOR:Sr,NODE_DISABLE_COLORS:An,NO_COLOR:Sn,TERM:On}=g.env||{},kn=g.stdout&&g.stdout.isTTY);var ys={enabled:!An&&Sn==null&&On!=="dumb"&&(Sr!=null&&Sr!=="0"||kn)};function F(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!ys.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Mu=F(0,0),Dt=F(1,22),Ft=F(2,22),_u=F(3,23),In=F(4,24),Du=F(7,27),Fu=F(8,28),Nu=F(9,29),qu=F(30,39),Fe=F(31,39),Ln=F(32,39),Mn=F(33,39),_n=F(34,39),Uu=F(35,39),Dn=F(36,39),Bu=F(37,39),Fn=F(90,39),Vu=F(90,39),$u=F(40,49),ju=F(41,49),Qu=F(42,49),Ju=F(43,49),Gu=F(44,49),Wu=F(45,49),Hu=F(46,49),Ku=F(47,49);u();c();m();p();d();l();var hs=100,Nn=["green","yellow","blue","magenta","cyan","red"],Nt=[],qn=Date.now(),bs=0,Or=typeof g<"u"?g.env:{};globalThis.DEBUG??=Or.DEBUG??"";globalThis.DEBUG_COLORS??=Or.DEBUG_COLORS?Or.DEBUG_COLORS==="true":!0;var it={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function ws(e){let t={color:Nn[bs++%Nn.length],enabled:it.enabled(e),namespace:e,log:it.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Nt.push([o,...n]),Nt.length>hs&&Nt.shift(),it.enabled(o)||i){let f=n.map(T=>typeof T=="string"?T:Es(T)),h=`+${Date.now()-qn}ms`;qn=Date.now(),a(o,...f,h)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var kr=new Proxy(ws,{get:(e,t)=>it[t],set:(e,t,r)=>it[t]=r});function Es(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 Un(){Nt.length=0}var W=kr;u();c();m();p();d();l();u();c();m();p();d();l();var ot=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];u();c();m();p();d();l();var $n="library";function Ne(e){let t=Cs();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":$n)}function Cs(){let e=g.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}u();c();m();p();d();l();var jn="prisma+postgres",Qn=`${jn}:`;function Ir(e){return e?.startsWith(`${Qn}//`)??!1}u();c();m();p();d();l();u();c();m();p();d();l();var qt;(t=>{let e;(_=>(_.findUnique="findUnique",_.findUniqueOrThrow="findUniqueOrThrow",_.findFirst="findFirst",_.findFirstOrThrow="findFirstOrThrow",_.findMany="findMany",_.create="create",_.createMany="createMany",_.createManyAndReturn="createManyAndReturn",_.update="update",_.updateMany="updateMany",_.updateManyAndReturn="updateManyAndReturn",_.upsert="upsert",_.delete="delete",_.deleteMany="deleteMany",_.groupBy="groupBy",_.count="count",_.aggregate="aggregate",_.findRaw="findRaw",_.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(qt||={});var lt={};It(lt,{error:()=>Ss,info:()=>As,log:()=>Rs,query:()=>Os,should:()=>Hn,tags:()=>at,warn:()=>Lr});u();c();m();p();d();l();var at={error:Fe("prisma:error"),warn:Mn("prisma:warn"),info:Dn("prisma:info"),query:_n("prisma:query")},Hn={warn:()=>!g.env.PRISMA_DISABLE_WARNINGS};function Rs(...e){console.log(...e)}function Lr(e,...t){Hn.warn()&&console.warn(`${at.warn} ${e}`,...t)}function As(e,...t){console.info(`${at.info} ${e}`,...t)}function Ss(e,...t){console.error(`${at.error} ${e}`,...t)}function Os(e,...t){console.log(`${at.query} ${e}`,...t)}u();c();m();p();d();l();function Bt(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}u();c();m();p();d();l();function Ee(e,t){throw new Error(t)}u();c();m();p();d();l();function Mr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}u();c();m();p();d();l();var _r=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});u();c();m();p();d();l();function qe(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}u();c();m();p();d();l();function Dr(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}u();c();m();p();d();l();function te(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}u();c();m();p();d();l();var Zn=new Set,ut=(e,t,...r)=>{Zn.has(e)||(Zn.add(e),Lr(t,...r))};var k=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};te(k,"PrismaClientInitializationError");u();c();m();p();d();l();var X=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};te(X,"PrismaClientKnownRequestError");u();c();m();p();d();l();var xe=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};te(xe,"PrismaClientRustPanicError");u();c();m();p();d();l();var U=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};te(U,"PrismaClientUnknownRequestError");u();c();m();p();d();l();var G=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};te(G,"PrismaClientValidationError");u();c();m();p();d();l();l();function Ue(e){return e===null?e:Array.isArray(e)?e.map(Ue):typeof e=="object"?Is(e)?Ls(e):qe(e,Ue):e}function Is(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Ls({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":{let{buffer:r,byteOffset:n,byteLength:i}=b.from(t,"base64");return new Uint8Array(r,n,i)}case"DateTime":return new Date(t);case"Decimal":return new me(t);case"Json":return JSON.parse(t);default:Ee(t,"Unknown tagged value")}}u();c();m();p();d();l();u();c();m();p();d();l();function Be(e){return e.substring(0,1).toLowerCase()+e.substring(1)}u();c();m();p();d();l();function Ve(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Vt(e){return e.toString()!=="Invalid Date"}u();c();m();p();d();l();l();function $e(e){return v.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}u();c();m();p();d();l();u();c();m();p();d();l();var Ms=rt(Wn());var _s={red:Fe,gray:Fn,dim:Ft,bold:Dt,underline:In,highlightSource:e=>e.highlight()},Ds={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Fs({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Ns({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],f=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${f}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${f}`)),t&&a.push(s.underline(qs(t))),i){a.push("");let h=[i.toString()];o&&(h.push(o),h.push(s.dim(")"))),a.push(h.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(`
|
|
2
|
+
`)}function qs(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function $t(e){let t=e.showColors?_s:Ds,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(e,t):r=Fs(e),Ns(r,t)}u();c();m();p();d();l();var ai=rt(Fr());u();c();m();p();d();l();function ii(e,t,r){let n=oi(e),i=Us(n),o=Vs(i);o?jt(o,t,r):t.addErrorMessage(()=>"Unknown error")}function oi(e){return e.errors.flatMap(t=>t.kind==="Union"?oi(t):[t])}function Us(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:Bs(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Bs(e,t){return[...new Set(e.concat(t))]}function Vs(e){return Dr(e,(t,r)=>{let n=ri(t),i=ri(r);return n!==i?n-i:ni(t)-ni(r)})}function ri(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function ni(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}u();c();m();p();d();l();var re=class{constructor(t,r){this.name=t;this.value=r;this.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)}};u();c();m();p();d();l();u();c();m();p();d();l();var je=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}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(`
|
|
3
|
+
`)}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}};u();c();m();p();d();l();u();c();m();p();d();l();var Qt=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};u();c();m();p();d();l();var Jt=e=>e,Gt={bold:Jt,red:Jt,green:Jt,dim:Jt,enabled:!1},si={bold:Dt,red:Fe,green:Ln,dim:Ft,enabled:!0},Qe={write(e){e.writeLine(",")}};u();c();m();p();d();l();var pe=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.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)))})}};u();c();m();p();d();l();var Te=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var Je=class extends Te{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new Qt(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new pe("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(Qe,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Ge=class e extends Te{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let f;if(s.value instanceof e?f=s.value.getField(a):s.value instanceof Je&&(f=s.value.getField(Number(a))),!f)return;s=f}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new pe("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(Qe,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};u();c();m();p();d();l();var J=class extends Te{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new pe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};u();c();m();p();d();l();var ct=class{constructor(){this.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(Qe,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function jt(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":js(e,t);break;case"IncludeOnScalar":Qs(e,t);break;case"EmptySelection":Js(e,t,r);break;case"UnknownSelectionField":Ks(e,t);break;case"InvalidSelectionValue":zs(e,t);break;case"UnknownArgument":Ys(e,t);break;case"UnknownInputField":Xs(e,t);break;case"RequiredArgumentMissing":Zs(e,t);break;case"InvalidArgumentType":ea(e,t);break;case"InvalidArgumentValue":ta(e,t);break;case"ValueTooLarge":ra(e,t);break;case"SomeFieldsMissing":na(e,t);break;case"TooManyFieldsGiven":ia(e,t);break;case"Union":ii(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function js(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 Qs(e,t){let[r,n]=mt(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 re(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)}. ${pt(s)}`:a+=".",a+=`
|
|
4
|
+
Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Js(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Gs(e,t,i);return}if(n.hasField("select")){Ws(e,t);return}}if(r?.[Be(e.outputType.name)]){Hs(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Gs(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new re(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 Ws(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),ci(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${pt(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Hs(e,t){let r=new ct;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new re("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=mt(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let f=a?.value.asObject()??new Ge;f.addSuggestion(n),a.value=f}}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 Ks(e,t){let r=mi(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":ci(n,e.outputType);break;case"include":oa(n,e.outputType);break;case"omit":sa(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(pt(n)),i.join(" ")})}function zs(e,t){let r=mi(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 Ys(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),aa(n,e.arguments)),t.addErrorMessage(i=>li(i,r,e.arguments.map(o=>o.name)))}function Xs(e,t){let[r,n]=mt(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&pi(o,e.inputType)}t.addErrorMessage(o=>li(o,n,e.inputType.fields.map(s=>s.name)))}function li(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=ua(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(pt(e)),n.join(" ")}function Zs(e,t){let r;t.addErrorMessage(f=>r?.value instanceof J&&r.value.text==="null"?`Argument \`${f.green(o)}\` must not be ${f.red("null")}.`:`Argument \`${f.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=mt(e.argumentPath),s=new ct,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 f of e.inputTypes[0].fields)s.addField(f.name,f.typeNames.join(" | "));a.addSuggestion(new re(o,s).makeRequired())}else{let f=e.inputTypes.map(ui).join(" | ");a.addSuggestion(new re(o,f).makeRequired())}}function ui(e){return e.kind==="list"?`${ui(e.elementType)}[]`:e.name}function ea(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=Wt("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 ta(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=Wt("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function ra(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 J&&(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 na(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&&pi(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")} ${Wt("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(pt(i)),o.join(" ")})}function ia(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 ${Wt("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function ci(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new re(r.name,"true"))}function oa(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new re(r.name,"true"))}function sa(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new re(r.name,"true"))}function aa(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new re(r.name,r.typeNames.join(" | ")))}function mi(e,t){let[r,n]=mt(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(),f=o?.getField(n);return o&&f?{parentKind:"select",parent:o,field:f,fieldName:n}:(f=s?.getField(n),s&&f?{parentKind:"include",field:f,parent:s,fieldName:n}:(f=a?.getField(n),a&&f?{parentKind:"omit",field:f,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function pi(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new re(r.name,r.typeNames.join(" | ")))}function mt(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function pt({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Wt(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var la=3;function ua(e,t){let r=1/0,n;for(let i of t){let o=(0,ai.default)(e,i);o>la||o<r&&(r=o,n=i)}return n}u();c();m();p();d();l();u();c();m();p();d();l();function di(e){return e.substring(0,1).toLowerCase()+e.substring(1)}u();c();m();p();d();l();var dt=class{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 We(e){return e instanceof dt}u();c();m();p();d();l();var Ht=Symbol(),Nr=new WeakMap,Pe=class{constructor(t){t===Ht?Nr.set(this,`Prisma.${this._getName()}`):Nr.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Nr.get(this)}},ft=class extends Pe{_getNamespace(){return"NullTypes"}},gt=class extends ft{};qr(gt,"DbNull");var yt=class extends ft{};qr(yt,"JsonNull");var ht=class extends ft{};qr(ht,"AnyNull");var Kt={classes:{DbNull:gt,JsonNull:yt,AnyNull:ht},instances:{DbNull:new gt(Ht),JsonNull:new yt(Ht),AnyNull:new ht(Ht)}};function qr(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}u();c();m();p();d();l();var fi=": ",zt=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+fi.length}write(t){let r=new pe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(fi).write(this.value)}};var Ur=class{constructor(t){this.errorMessages=[];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(`
|
|
5
|
+
`)}};function He(e){return new Ur(gi(e))}function gi(e){let t=new Ge;for(let[r,n]of Object.entries(e)){let i=new zt(r,yi(n));t.addField(i)}return t}function yi(e){if(typeof e=="string")return new J(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new J(String(e));if(typeof e=="bigint")return new J(`${e}n`);if(e===null)return new J("null");if(e===void 0)return new J("undefined");if($e(e))return new J(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return b.isBuffer(e)?new J(`Buffer.alloc(${e.byteLength})`):new J(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Vt(e)?e.toISOString():"Invalid Date";return new J(`new Date("${t}")`)}return e instanceof Pe?new J(`Prisma.${e._getName()}`):We(e)?new J(`prisma.${di(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?ca(e):typeof e=="object"?gi(e):new J(Object.prototype.toString.call(e))}function ca(e){let t=new Je;for(let r of e)t.addItem(yi(r));return t}function Yt(e,t){let r=t==="pretty"?si:Gt,n=e.renderAllMessages(r),i=new je(0,{colors:r}).write(e).toString();return{message:n,args:i}}function Xt({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=He(e);for(let C of t)jt(C,a,s);let{message:f,args:h}=Yt(a,r),T=$t({message:f,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:h});throw new G(T,{clientVersion:o})}u();c();m();p();d();l();u();c();m();p();d();l();var de=class{constructor(){this._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}};u();c();m();p();d();l();function bt(e){let t;return{get(){return t||(t={value:e()}),t.value}}}u();c();m();p();d();l();function fe(e){return e.replace(/^./,t=>t.toLowerCase())}u();c();m();p();d();l();function bi(e,t,r){let n=fe(r);return!t.result||!(t.result.$allModels||t.result[n])?e:ma({...e,...hi(t.name,e,t.result.$allModels),...hi(t.name,e,t.result[n])})}function ma(e){let t=new de,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 qe(e,n=>({...n,needs:r(n.name,new Set)}))}function hi(e,t,r){return r?qe(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:pa(t,o,i)})):{}}function pa(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function wi(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 Ei(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 Zt=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new de;this.modelExtensionsCache=new de;this.queryCallbacksCache=new de;this.clientExtensions=bt(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=bt(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>bi(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=fe(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()}},Ke=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Zt(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Zt(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()??[]}};u();c();m();p();d();l();var er=class{constructor(t){this.name=t}};function xi(e){return e instanceof er}function Pi(e){return new er(e)}u();c();m();p();d();l();u();c();m();p();d();l();var vi=Symbol(),wt=class{constructor(t){if(t!==vi)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?tr:t}},tr=new wt(vi);function ge(e){return e instanceof wt}var da={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"},Ti="explicitly `undefined` values are not allowed";function rr({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=Ke.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:f,previewFeatures:h,globalOmit:T}){let C=new Br({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:f,previewFeatures:h,globalOmit:T});return{modelName:e,action:da[t],query:Et(r,C)}}function Et({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:Ri(r,n),selection:fa(e,t,i,n)}}function fa(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()}),ba(e,n)):ga(n,t,r)}function ga(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&ya(n,t,e),ha(n,r,e),n}function ya(e,t,r){for(let[n,i]of Object.entries(t)){if(ge(i))continue;let o=r.nestSelection(n);if(Vr(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]=Et(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=Et(i,o)}}function ha(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=Ei(i,n);for(let[s,a]of Object.entries(o)){if(ge(a))continue;Vr(a,r.nestSelection(s));let f=r.findField(s);n?.[s]&&!f||(e[s]=!a)}}function ba(e,t){let r={},n=t.getComputedFields(),i=wi(e,n);for(let[o,s]of Object.entries(i)){if(ge(s))continue;let a=t.nestSelection(o);Vr(s,a);let f=t.findField(o);if(!(n?.[o]&&!f)){if(s===!1||s===void 0||ge(s)){r[o]=!1;continue}if(s===!0){f?.kind==="object"?r[o]=Et({},a):r[o]=!0;continue}r[o]=Et(s,a)}}return r}function Ci(e,t){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return{$type:"BigInt",value:String(e)};if(Ve(e)){if(Vt(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(xi(e))return{$type:"Param",value:e.name};if(We(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return wa(e,t);if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:b.from(r,n,i).toString("base64")}}if(Ea(e))return e.values;if($e(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof Pe){if(e!==Kt.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(xa(e))return e.toJSON();if(typeof e=="object")return Ri(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 Ri(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);ge(i)||(i!==void 0?r[n]=Ci(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:Ti}))}return r}function wa(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||ge(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(Ci(o,i))}return r}function Ea(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function xa(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function Vr(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:Ti})}var Br=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])}throwValidationError(t){Xt({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?.[Be(this.params.modelName)]??{}:{}}shouldApplyGlobalOmit(){switch(this.params.action){case"findFirst":case"findFirstOrThrow":case"findUniqueOrThrow":case"findMany":case"upsert":case"findUnique":case"createManyAndReturn":case"create":case"update":case"updateManyAndReturn":case"delete":return!0;case"executeRaw":case"aggregateRaw":case"runCommandRaw":case"findRaw":case"createMany":case"deleteMany":case"groupBy":case"updateMany":case"count":case"aggregate":case"queryRaw":return!1;default:Ee(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};u();c();m();p();d();l();var ze=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};u();c();m();p();d();l();function Ai(e){return{models:$r(e.models),enums:$r(e.enums),types:$r(e.types)}}function $r(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function Si(e,t){let r=bt(()=>Pa(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function Pa(e){throw new Error("Prisma.dmmf is not available when running in edge runtimes.")}function jr(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}u();c();m();p();d();l();var Qr=new WeakMap,nr="$$PrismaTypedSql",Jr=class{constructor(t,r){Qr.set(this,{sql:t,values:r}),Object.defineProperty(this,nr,{value:nr})}get sql(){return Qr.get(this).sql}get values(){return Qr.get(this).values}};function Oi(e){return(...t)=>new Jr(e,t)}function ki(e){return e!=null&&e[nr]===nr}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();function xt(e){return{ok:!1,error:e,map(){return xt(e)},flatMap(){return xt(e)}}}var Gr=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},Wr=e=>{let t=new Gr,r=ye(t,e.transactionContext.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:ye(t,e.queryRaw.bind(e)),executeRaw:ye(t,e.executeRaw.bind(e)),provider:e.provider,transactionContext:async(...i)=>(await r(...i)).map(s=>va(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=Ca(t,e.getConnectionInfo.bind(e))),n},va=(e,t)=>{let r=ye(e,t.startTransaction.bind(t));return{adapterName:t.adapterName,provider:t.provider,queryRaw:ye(e,t.queryRaw.bind(t)),executeRaw:ye(e,t.executeRaw.bind(t)),startTransaction:async(...n)=>(await r(...n)).map(o=>Ta(e,o))}},Ta=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:ye(e,t.queryRaw.bind(t)),executeRaw:ye(e,t.executeRaw.bind(t)),commit:ye(e,t.commit.bind(t)),rollback:ye(e,t.rollback.bind(t))});function ye(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return xt({kind:"GenericJs",id:i})}}}function Ca(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return xt({kind:"GenericJs",id:i})}}}var Jo=rt(Ii());u();c();m();p();d();l();Jn();Rn();Vn();u();c();m();p();d();l();var Z=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;i<r.length;){let s=r[i++],a=t[i];if(s instanceof e){this.strings[o]+=s.strings[0];let f=0;for(;f<s.values.length;)this.values[o++]=s.values[f++],this.strings[o]=s.strings[f];this.strings[o]+=a}else this.values[o++]=s,this.strings[o]=a}}get sql(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`?${this.strings[r++]}`;return n}get statement(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`:${r}${this.strings[r++]}`;return n}get text(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`$${r}${this.strings[r++]}`;return n}inspect(){return{sql:this.sql,statement:this.statement,text:this.text,values:this.values}}};function Li(e,t=",",r="",n=""){if(e.length===0)throw new TypeError("Expected `join([])` to be called with an array of multiple elements, but got an empty array");return new Z([r,...Array(e.length-1).fill(t),n],e)}function Hr(e){return new Z([e],[])}var Mi=Hr("");function Kr(e,...t){return new Z(e,t)}u();c();m();p();d();l();u();c();m();p();d();l();function Pt(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}u();c();m();p();d();l();function H(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}u();c();m();p();d();l();function Ie(e){let t=new de;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}u();c();m();p();d();l();u();c();m();p();d();l();var ir={enumerable:!0,configurable:!0,writable:!0};function or(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>ir,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var _i=Symbol.for("nodejs.util.inspect.custom");function he(e,t){let r=Aa(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=Di(Reflect.ownKeys(o),r),a=Di(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 f=r.get(s);return f?f.getPropertyDescriptor?{...ir,...f?.getPropertyDescriptor(s)}:ir:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[_i]=function(){let o={...this};return delete o[_i],o},i}function Aa(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 Di(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}u();c();m();p();d();l();function Ye(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}u();c();m();p();d();l();function sr(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}u();c();m();p();d();l();function Fi(e){if(e===void 0)return"";let t=He(e);return new je(0,{colors:Gt}).write(t).toString()}u();c();m();p();d();l();var Sa="P2037";function ar({error:e,user_facing_error:t},r,n){return t.error_code?new X(Oa(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new U(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function Oa(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===Sa&&(r+=`
|
|
6
|
+
Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var zr=class{getLocation(){return null}};function Ce(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new zr}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Ni={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Xe(e={}){let t=Ia(e);return Object.entries(t).reduce((n,[i,o])=>(Ni[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Ia(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 qi(e,t){let r=lr(e);return t({action:"aggregate",unpacker:r,argsMapper:Xe})(e)}u();c();m();p();d();l();function La(e={}){let{select:t,...r}=e;return typeof t=="object"?Xe({...r,_count:t}):Xe({...r,_count:{_all:!0}})}function Ma(e={}){return typeof e.select=="object"?t=>lr(e)(t)._count:t=>lr(e)(t)._count._all}function Ui(e,t){return t({action:"count",unpacker:Ma(e),argsMapper:La})(e)}u();c();m();p();d();l();function _a(e={}){let t=Xe(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 Da(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Bi(e,t){return t({action:"groupBy",unpacker:Da(e),argsMapper:_a})(e)}function Vi(e,t,r){if(t==="aggregate")return n=>qi(n,r);if(t==="count")return n=>Ui(n,r);if(t==="groupBy")return n=>Bi(n,r)}u();c();m();p();d();l();function $i(e,t){let r=t.fields.filter(i=>!i.relationName),n=_r(r,i=>i.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 dt(e,o,s.type,s.isList,s.kind==="enum")},...or(Object.keys(n))})}u();c();m();p();d();l();u();c();m();p();d();l();var ji=e=>Array.isArray(e)?e:e.split("."),Yr=(e,t)=>ji(t).reduce((r,n)=>r&&r[n],e),Qi=(e,t,r)=>ji(t).reduceRight((n,i,o,s)=>Object.assign({},Yr(e,s.slice(0,o)),{[i]:n}),r);function Fa(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Na(e,t,r){return t===void 0?e??{}:Qi(t,r,e||!0)}function Xr(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((f,h)=>({...f,[h.name]:h}),{});return f=>{let h=Ce(e._errorFormat),T=Fa(n,i),C=Na(f,o,T),O=r({dataPath:T,callsite:h})(C),A=qa(e,t);return new Proxy(O,{get(I,S){if(!A.includes(S))return I[S];let oe=[a[S].type,r,S],K=[T,C];return Xr(e,...oe,...K)},...or([...A,...Object.getOwnPropertyNames(O)])})}}function qa(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Ua=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Ba=["aggregate","count","groupBy"];function Zr(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Va(e,t),ja(e,t),Pt(r),H("name",()=>t),H("$name",()=>t),H("$parent",()=>e._appliedParent)];return he({},n)}function Va(e,t){let r=fe(t),n=Object.keys(qt.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>f=>{let h=Ce(e._errorFormat);return e._createPrismaPromise(T=>{let C={args:f,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:T,callsite:h};return e._request({...C,...a})},{action:o,args:f,model:t})};return Ua.includes(o)?Xr(e,t,s):$a(i)?Vi(e,i,s):s({})}}}function $a(e){return Ba.includes(e)}function ja(e,t){return Ie(H("fields",()=>{let r=e._runtimeDataModel.models[t];return $i(t,r)}))}u();c();m();p();d();l();function Ji(e){return e.replace(/^./,t=>t.toUpperCase())}var en=Symbol();function vt(e){let t=[Qa(e),H(en,()=>e),H("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Pt(r)),he(e,t)}function Qa(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(fe),n=[...new Set(t.concat(r))];return Ie({getKeys(){return n},getPropertyValue(i){let o=Ji(i);if(e._runtimeDataModel.models[o]!==void 0)return Zr(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Zr(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Gi(e){return e[en]?e[en]:e}function Wi(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return vt(t)}u();c();m();p();d();l();u();c();m();p();d();l();function Hi({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let f of Object.values(o)){if(n){if(n[f.name])continue;let h=f.needs.filter(T=>n[T]);h.length>0&&a.push(Ye(h))}else if(r){if(!r[f.name])continue;let h=f.needs.filter(T=>!r[T]);h.length>0&&a.push(Ye(h))}Ja(e,f.needs)&&s.push(Ga(f,he(e,s)))}return s.length>0||a.length>0?he(e,[...s,...a]):e}function Ja(e,t){return t.every(r=>Mr(e,r))}function Ga(e,t){return Ie(H(e.name,()=>e.compute(t)))}u();c();m();p();d();l();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&&Ki({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&Ki({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function Ki({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||ge(s))continue;let f=n.models[r].fields.find(T=>T.name===o);if(!f||f.kind!=="object"||!f.relationName)continue;let h=typeof s=="object"?s:{};t[o]=ur({visitor:i,result:t[o],args:h,modelName:f.type,runtimeDataModel:n})}}function zi({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,f,h)=>{let T=fe(f);return Hi({result:a,modelName:T,select:h.select,omit:h.select?void 0:{...o?.[T],...h.omit},extensions:n})}})}u();c();m();p();d();l();u();c();m();p();d();l();l();function Yi(e){if(e instanceof Z)return Wa(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=Tt(e[n]);return r}let t={};for(let r in e)t[r]=Tt(e[r]);return t}function Wa(e){return new Z(e.strings,e.values)}function Tt(e){if(typeof e!="object"||e==null||e instanceof Pe||We(e))return e;if($e(e))return new me(e.toFixed());if(Ve(e))return new Date(+e);if(ArrayBuffer.isView(e))return e.slice(0);if(Array.isArray(e)){let t=e.length,r;for(r=Array(t);t--;)r[t]=Tt(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:Tt(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=Tt(e[r]);return t}Ee(e,"Unknown value")}function Zi(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:Yi(t.args??{}),__internalParams:t,query:(s,a=t)=>{let f=a.customDataProxyFetch;return a.customDataProxyFetch=no(o,f),a.args=s,Zi(e,a,r,n+1)}})})}function eo(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 Zi(e,t,s)}function to(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?ro(r,n,0,e):e(r)}}function ro(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 f=a.customDataProxyFetch;return a.customDataProxyFetch=no(i,f),ro(a,t,r+1,n)}})}var Xi=e=>e;function no(e=Xi,t=Xi){return r=>e(t(r))}u();c();m();p();d();l();var io=W("prisma:client"),oo={Vercel:"vercel","Netlify CI":"netlify"};function so({postinstall:e,ciName:t,clientVersion:r}){if(io("checkPlatformCaching:postinstall",e),io("checkPlatformCaching:ciName",t),e===!0&&t&&t in oo){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process.
|
|
7
7
|
|
|
8
|
-
Learn how: https://pris.ly/d/${
|
|
8
|
+
Learn how: https://pris.ly/d/${oo[t]}-build`;throw console.error(n),new k(n,r)}}u();c();m();p();d();l();function ao(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Ha="Cloudflare-Workers",Ka="node";function lo(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Ha?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===Ka?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var za={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 Re(){let e=lo();return{id:e,prettyName:za[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();function tn(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}u();c();m();p();d();l();function uo(e){return e.rows.map(t=>t.reduce((r,n,i)=>(r[e.columnNames[i]]=n,r),{}))}var cr=class{constructor(t,r){this.adapter=t;this.params=r}async run(t){return this.interpretNode(t,this.params)}async interpretNode(t,r){switch(t.type){case"seq":{let n=await Promise.all(t.args.map(i=>this.interpretNode(i,r)));return n[n.length-1]}case"get":return r[t.args.name];case"let":{let n=Object.create(r);return await Promise.all(t.args.bindings.map(async i=>{n[i.name]=await this.interpretNode(i.expr,r)})),this.interpretNode(t.args.expr,n)}case"getFirstNonEmpty":{for(let n of t.args.names){let i=r[n];if(!Ya(i))return i}return[]}case"concat":return(await Promise.all(t.args.map(i=>this.interpretNode(i,r)))).reduce((i,o)=>i.concat(Xa(o)),[]);case"sum":return(await Promise.all(t.args.map(i=>this.interpretNode(i,r)))).reduce((i,o)=>co(i)+co(o));case"execute":{let n=await this.adapter.executeRaw(mo(t.args,r));if(n.ok)return n.value;throw n.error}case"query":{let n=await this.adapter.queryRaw(mo(t.args,r));if(n.ok)return uo(n.value);throw n.error}default:throw new Error(`Unexpected node type: ${t.type}`)}}};function Ya(e){return Array.isArray(e)?e.length===0:e==null}function Xa(e){return Array.isArray(e)?e:[e]}function co(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function mo({query:e,params:t},r){let n=t.map(o=>{if(!tn(o))return o;let s=r[o.prisma__value.name];if(s===void 0)throw new Error(`Missing value for query variable ${o.prisma__value.name}`);return s}),i=t.map(o=>Za(o));return{sql:e,args:n,argTypes:i}}function Za(e){return e===null?"Int32":typeof e=="string"?"Text":typeof e=="number"?"Numeric":typeof e=="boolean"?"Boolean":Array.isArray(e)?"Array":tn(e)?el(e.prisma__value.type):"Json"}function el(e){let r={Any:"Json",String:"Text",Int:"Int32",BigInt:"Int64",Float:"Double",Boolean:"Boolean",Decimal:"Numeric",Date:"DateTime",Object:"Json",Bytes:"Bytes",Array:"Array"}[e];if(!r)throw new Error(`Unknown placeholder type: ${e}`);return r}u();c();m();p();d();l();var rn,mr={async loadLibrary(e){let{clientVersion:t,adapter:r,engineWasm:n}=e;if(r===void 0)throw new k(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Re().prettyName})`,t);if(n===void 0)throw new k("WASM engine was unexpectedly `undefined`",t);rn===void 0&&(rn=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new k("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let a={"./query_engine_bg.js":o},f=new WebAssembly.Instance(s,a);return o.__wbg_set_wasm(f.exports),o.QueryEngine})());let i=await rn;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var po="P2038",ie=W("prisma:client:libraryEngine");function tl(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var iA=[...ot,"native"],fo="1",Ct=class{constructor(t,r){this.name="ClientEngine";if(!t.previewFeatures?.includes("driverAdapters"))throw new k("EngineType `client` requires the driverAdapters preview feature to be enabled.",t.clientVersion,po);let{adapter:n}=t;if(n)this.driverAdapter=n,ie("Using driver adapter: %O",n);else throw new k("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,po);this.libraryLoader=r??mr,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,t.enableDebugLogs&&(this.logLevel="debug");let i=Object.keys(t.overrideDatasources)[0],o=t.overrideDatasources[i]?.url;i!==void 0&&o!==void 0&&(this.datasourceOverrides={[i]:o}),this.libraryInstantiationPromise=this.instantiateLibrary()}applyPendingMigrations(){throw new Error("Cannot call applyPendingMigrations on engine type client.")}transaction(t,r,n){throw new Error("Method not implemented.")}async instantiateLibrary(){if(ie("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new U("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new U("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new w(this);this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:g.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json",enableTracing:this.tracingHelper.isEnabled()},r=>{t.deref()?.logger(r)},this.driverAdapter)}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new k(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);r&&(r.level=r?.level.toLowerCase()??"unknown",tl(r),this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path}))}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return ie(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{ie("library starting");try{let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r),fo),this.libraryStarted=!0,ie("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new k(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return ie("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),ie("library stopping");let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r),fo),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,ie("library stopped")};return this.libraryStoppingPromise=this.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){ie(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify(t);try{await this.start();let o=await this.engine.compile(i,!1),s=JSON.parse(o);ie("query plan created",o);let a={},h=await new cr(this.driverAdapter,a).run(s);return ie("query plan executed"),{data:{[t.action]:h}}}catch(o){if(o instanceof k)throw o;o.code==="GenericFailure"&&o.message?.startsWith("PANIC:");let s=this.parseRequestError(o.message);throw typeof s=="string"?o:new U(`${s.message}
|
|
9
|
+
${s.backtrace}`,{clientVersion:this.config.clientVersion})}}requestBatch(t,{transaction:r,traceparent:n}){throw ie("requestBatch"),new Error("Method not implemented.")}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};u();c();m();p();d();l();function pr({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw Re().id==="workerd"?new k(`error: Environment variable not found: ${s.fromEnvVar}.
|
|
9
10
|
|
|
10
11
|
In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`.
|
|
11
|
-
To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new
|
|
12
|
-
${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){
|
|
13
|
-
`),{clientVersion:t.clientVersion})}if(s)return new
|
|
14
|
-
`),{clientVersion:t.clientVersion})}throw new G("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}c();m();p();d();
|
|
12
|
+
To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new k(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new k("error: Missing URL environment variable, value, or override.",n);return i}u();c();m();p();d();l();u();c();m();p();d();l();function go(e){if(e?.kind==="itx")return e.options.id}var rl="P2036",be=W("prisma:client:libraryEngine");function nl(e){return e.item_type==="query"&&"query"in e}function il(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var GA=[...ot,"native"],ol=0xffffffffffffffffn,nn=1n;function sl(){let e=nn++;return nn>ol&&(nn=1n),e}var Rt=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=r??mr,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}wrapEngine(t){return{applyPendingMigrations:t.applyPendingMigrations?.bind(t),commitTransaction:this.withRequestId(t.commitTransaction.bind(t)),connect:this.withRequestId(t.connect.bind(t)),disconnect:this.withRequestId(t.disconnect.bind(t)),metrics:t.metrics?.bind(t),query:this.withRequestId(t.query.bind(t)),rollbackTransaction:this.withRequestId(t.rollbackTransaction.bind(t)),sdlSchema:t.sdlSchema?.bind(t),startTransaction:this.withRequestId(t.startTransaction.bind(t)),trace:t.trace.bind(t),compile:()=>{throw new Error("Not implemented. Use the ClientEngine for this.")}}}withRequestId(t){return async(...r)=>{let n=sl().toString();try{return await t(...r,n)}finally{if(this.tracingHelper.isEnabled()){let i=await this.engine?.trace(n);if(i){let o=JSON.parse(i);this.tracingHelper.dispatchEngineSpans(o.spans)}}}}}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(al(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new X(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(be("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new U("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new U("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new w(this),{adapter:r}=this.config;r&&be("Using driver adapter: %O",r),this.engine=this.wrapEngine(new this.QueryEngineConstructor({datamodel:this.datamodel,env:g.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json",enableTracing:this.tracingHelper.isEnabled()},n=>{t.deref()?.logger(n)},r))}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new k(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);r&&(r.level=r?.level.toLowerCase()??"unknown",nl(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):(il(r),this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path})))}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return be(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{be("library starting");try{let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,be("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new k(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return be("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),be("library stopping");let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,be("library stopped")};return this.libraryStoppingPromise=this.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){be(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new U(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s}}catch(s){if(s instanceof k)throw s;s.code==="GenericFailure"&&s.message?.startsWith("PANIC:");let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new U(`${a.message}
|
|
13
|
+
${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){be("requestBatch");let i=sr(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),go(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new U(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:f}=s;if(Array.isArray(a))return a.map(h=>h.errors&&h.errors.length>0?this.loggerRustPanic??this.buildQueryError(h.errors[0]):{data:h});throw f&&f.length===1?new Error(f[0].error):new Error(JSON.stringify(s))}buildQueryError(t){t.user_facing_error.is_panic;let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:ar(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===rl&&this.config.adapter){let r=t.meta?.id;Bt(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return Bt(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function al(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}u();c();m();p();d();l();var At="Accelerate has not been setup correctly. Make sure your client is using `.$extends(withAccelerate())`. See https://pris.ly/d/accelerate-getting-started",dr=class{constructor(t){this.config=t;this.name="AccelerateEngine";this.resolveDatasourceUrl=this.config.accelerateUtils?.resolveDatasourceUrl;this.getBatchRequestPayload=this.config.accelerateUtils?.getBatchRequestPayload;this.prismaGraphQLToJSError=this.config.accelerateUtils?.prismaGraphQLToJSError;this.PrismaClientUnknownRequestError=this.config.accelerateUtils?.PrismaClientUnknownRequestError;this.PrismaClientInitializationError=this.config.accelerateUtils?.PrismaClientInitializationError;this.PrismaClientKnownRequestError=this.config.accelerateUtils?.PrismaClientKnownRequestError;this.debug=this.config.accelerateUtils?.debug;this.engineVersion=this.config.accelerateUtils?.engineVersion;this.clientVersion=this.config.accelerateUtils?.clientVersion}onBeforeExit(t){}async start(){}async stop(){}version(t){return"unknown"}transaction(t,r,n){throw new k(At,this.config.clientVersion)}metrics(t){throw new k(At,this.config.clientVersion)}request(t,r){throw new k(At,this.config.clientVersion)}requestBatch(t,r){throw new k(At,this.config.clientVersion)}applyPendingMigrations(){throw new k(At,this.config.clientVersion)}};function yo({copyEngine:e=!0},t){let r;try{r=pr({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...g.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||Ir(r));e&&n&&ut("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=Ne(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",f=i==="binary",h=i==="client";if(o&&s||s&&!1){let T;throw e?r?.startsWith("prisma://")?T=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:T=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:T=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new G(T.join(`
|
|
14
|
+
`),{clientVersion:t.clientVersion})}if(s)return new Rt(t);if(o)return new dr(t);if(h)return new Ct(t);{let T=[`PrismaClient failed to initialize because it wasn't configured to run in this environment (${Re().prettyName}).`,"In order to run Prisma Client in an edge runtime, you will need to configure one of the following options:","- Enable Driver Adapters: https://pris.ly/d/driver-adapters","- Enable Accelerate: https://pris.ly/d/accelerate"];throw new G(T.join(`
|
|
15
|
+
`),{clientVersion:t.clientVersion})}throw new G("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}u();c();m();p();d();l();function fr({generator:e}){return e?.previewFeatures??[]}u();c();m();p();d();l();var ho=e=>({command:e});u();c();m();p();d();l();u();c();m();p();d();l();var bo=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);u();c();m();p();d();l();l();function Ze(e){try{return wo(e,"fast")}catch{return wo(e,"slow")}}function wo(e,t){return JSON.stringify(e.map(r=>xo(r,t)))}function xo(e,t){if(Array.isArray(e))return e.map(r=>xo(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(Ve(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(me.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(b.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(ll(e))return{prisma__type:"bytes",prisma__value:b.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:b.from(r,n,i).toString("base64")}}return typeof e=="object"&&t==="slow"?Po(e):e}function ll(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Po(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Eo);let t={};for(let r of Object.keys(e))t[r]=Eo(e[r]);return t}function Eo(e){return typeof e=="bigint"?e.toString():Po(e)}u();c();m();p();d();l();var ul=["$connect","$disconnect","$on","$transaction","$use","$extends"],vo=ul;var cl=/^(\s*alter\s)/i,To=W("prisma:client");function on(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&cl.exec(t))throw new Error(`Running ALTER using ${n} is not supported
|
|
15
16
|
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.
|
|
16
17
|
|
|
17
18
|
Example:
|
|
18
19
|
await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
|
|
19
20
|
|
|
20
21
|
More Information: https://pris.ly/d/execute-raw
|
|
21
|
-
`)}var
|
|
22
|
-
Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};te(
|
|
23
|
-
It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new
|
|
24
|
-
It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new
|
|
25
|
-
It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new
|
|
26
|
-
Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new
|
|
22
|
+
`)}var sn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(ki(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=bo(r),i={values:Ze(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?To(`prisma.${e}(${n}, ${i.values})`):To(`prisma.${e}(${n})`),{query:n,parameters:i}},Co={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new Z(t,r)}},Ro={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};u();c();m();p();d();l();function an(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Ao(r(s)):Ao(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 Ao(e){return typeof e.then=="function"?e:Promise.resolve(e)}u();c();m();p();d();l();var ml={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},ln=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getGlobalTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??ml}};function So(){return new ln}u();c();m();p();d();l();function Oo(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}u();c();m();p();d();l();function ko(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)}u();c();m();p();d();l();var gr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};u();c();m();p();d();l();var Lo=rt(Xn());u();c();m();p();d();l();function yr(e){return typeof e.batchRequestIdx=="number"}u();c();m();p();d();l();function Io(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(un(e.query.arguments)),t.push(un(e.query.selection)),t.join("")}function un(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${un(n)})`:r}).join(" ")})`}u();c();m();p();d();l();var pl={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 cn(e){return pl[e]}u();c();m();p();d();l();var hr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,g.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"}};u();c();m();p();d();l();l();function Le(e,t){if(t===null)return t;switch(e){case"bigint":return BigInt(t);case"bytes":{let{buffer:r,byteOffset:n,byteLength:i}=b.from(t,"base64");return new Uint8Array(r,n,i)}case"decimal":return new me(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=>Le("bigint",r));case"bytes-array":return t.map(r=>Le("bytes",r));case"decimal-array":return t.map(r=>Le("decimal",r));case"datetime-array":return t.map(r=>Le("datetime",r));case"date-array":return t.map(r=>Le("date",r));case"time-array":return t.map(r=>Le("time",r));default:return t}}function br(e){let t=[],r=dl(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]]=Le(e.types[s],i[s]);t.push(o)}return t}function dl(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var fl=W("prisma:client:request_handler"),wr=class{constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new hr({batchLoader:to(async({requests:n,customDataProxyFetch:i})=>{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(C=>C.protocolQuery),f=this.client._tracingHelper.getTraceParent(s),h=n.some(C=>cn(C.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:f,transaction:gl(o),containsWrite:h,customDataProxyFetch:i})).map((C,O)=>{if(C instanceof Error)return C;try{return this.mapQueryEngineResult(n[O],C)}catch(A){return A}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Mo(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:cn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Io(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 g.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(fl(t),yl(t,i))throw t;if(t instanceof X&&hl(t)){let h=_o(t.meta);Xt({args:o,errors:[h],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion,globalOmit:a})}let f=t.message;if(n&&(f=$t({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:f})),f=this.sanitizeMessage(f),t.code){let h=s?{modelName:s,...t.meta}:t.meta;throw new X(f,{code:t.code,clientVersion:this.client._clientVersion,meta:h,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new xe(f,this.client._clientVersion);if(t instanceof U)throw new U(f,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof k)throw new k(f,this.client._clientVersion);if(t instanceof xe)throw new xe(f,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Lo.default)(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(h=>h!=="select"&&h!=="include"),a=Yr(o,s),f=i==="queryRaw"?br(a):Ue(a);return n?n(f):f}get[Symbol.toStringTag](){return"RequestHandler"}};function gl(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Mo(e)};Ee(e,"Unknown transaction kind")}}function Mo(e){return{id:e.id,payload:e.payload}}function yl(e,t){return yr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function hl(e){return e.code==="P2009"||e.code==="P2012"}function _o(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(_o)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}u();c();m();p();d();l();var Do="6.3.0-dev.18";var Fo=Do;u();c();m();p();d();l();var Vo=rt(Fr());u();c();m();p();d();l();var M=class extends Error{constructor(t){super(t+`
|
|
23
|
+
Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};te(M,"PrismaClientConstructorValidationError");var No=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],qo=["pretty","colorless","minimal"],Uo=["info","query","warn","error"],wl={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new M(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=et(r,t)||` Available datasources: ${t.join(", ")}`;throw new M(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new M(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
|
|
24
|
+
It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new M(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
|
|
25
|
+
It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new M(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor.
|
|
26
|
+
It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&Ne(t.generator)==="client")throw new M('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e===null)return;if(e===void 0)throw new M('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!fr(t).includes("driverAdapters"))throw new M('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Ne(t.generator)==="binary")throw new M('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new M(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor.
|
|
27
|
+
Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new M(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!qo.includes(e)){let t=et(e,qo);throw new M(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new M(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Uo.includes(r)){let n=et(r,Uo);throw new M(`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=et(i,o);throw new M(`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 M(`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 M(`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 M(`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 M('"omit" option is expected to be an object.');if(e===null)throw new M('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=xl(n,t.runtimeDataModel);if(!o){r.push({kind:"UnknownModel",modelKey:n});continue}for(let[s,a]of Object.entries(i)){let f=o.fields.find(h=>h.name===s);if(!f){r.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(f.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 M(Pl(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new M(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=et(r,t);throw new M(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function $o(e,t){for(let[r,n]of Object.entries(e)){if(!No.includes(r)){let i=et(r,No);throw new M(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}wl[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new M('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function et(e,t){if(t.length===0||typeof e!="string")return"";let r=El(e,t);return r?` Did you mean "${r}"?`:""}function El(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Vo.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 xl(e,t){return Bo(t.models,e)??Bo(t.types,e)}function Bo(e,t){let r=Object.keys(e).find(n=>Be(n)===t);if(r)return e[r]}function Pl(e,t){let r=He(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}=Yt(r,"colorless");return`Error validating "omit" option:
|
|
27
28
|
|
|
28
29
|
${i}
|
|
29
30
|
|
|
30
|
-
${n}`}c();m();p();d();f();l();function Mo(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)))},u=g=>{o||(o=!0,r(g))};for(let g=0;g<e.length;g++)e[g].then(T=>{n[g]=T,a()},T=>{if(!cr(T)){u(T);return}T.batchRequestIdx===g?u(T):(i||(i=T),a())})})}var Re=ee("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var sl={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},al=Symbol.for("prisma.client.transaction.id"),ll={id:0,nextId(){return++this.id}};function _o(e){class t{constructor(n){this._originalClient=this;this._middlewares=new ur;this._createPrismaPromise=en();this.$extends=qi;e=n?.__internal?.configOverride?.(e)??e,Xi(e),n&&ko(n,e);let i=new Ft().on("error",()=>{});this._extensions=We.empty(),this._previewFeatures=lr(e),this._clientVersion=e.clientVersion??To,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=ho();let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&nt.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&nt.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=Br(n.adapter);let u=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==u)throw new I(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${u}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new I("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=e.injectableEdgeEnv?.();try{let u=n??{},g=u.__internal??{},T=g.debug===!0;T&&ee.enable("prisma:client");let C=nt.resolve(e.dirname,e.relativePath);wn.existsSync(C)||(C=e.dirname),Re("dirname",e.dirname),Re("relativePath",e.relativePath),Re("cwd",C);let O=g.engine||{};if(u.errorFormat?this._errorFormat=u.errorFormat:h.env.NODE_ENV==="production"?this._errorFormat="minimal":h.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:C,dirname:e.dirname,enableDebugLogs:T,allowTriggerPanic:O.allowTriggerPanic,datamodelPath:nt.join(e.dirname,e.filename??"schema.prisma"),prismaPath:O.binaryPath??void 0,engineEndpoint:O.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:u.log&&bo(u.log),logQueries:u.log&&!!(typeof u.log=="string"?u.log==="query":u.log.find(A=>typeof A=="string"?A==="query":A.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:Zi(u,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:u.transactionOptions?.maxWait??2e3,timeout:u.transactionOptions?.timeout??5e3,isolationLevel:u.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:sr,getBatchRequestPayload:rr,prismaGraphQLToJSError:nr,PrismaClientUnknownRequestError:Q,PrismaClientInitializationError:I,PrismaClientKnownRequestError:Y,debug:ee("prisma:client:accelerateEngine"),engineVersion:Lo.version,clientVersion:e.clientVersion}},Re("clientVersion",e.clientVersion),this._engine=no(e,this._engineConfig),this._requestHandler=new dr(this,i),u.log)for(let A of u.log){let k=typeof A=="string"?A:A.emit==="stdout"?A.level:null;k&&this.$on(k,S=>{st.log(`${st.tags[k]??""}`,S.message||S.query)})}this._metrics=new Ke(this._engine)}catch(u){throw u.clientVersion=this._clientVersion,u}return this._appliedParent=xt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$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{Ln()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Zr({clientMethod:i,activeProvider:a}),callsite:Te(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Io(n,i);return Xr(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new G("`$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=>(Xr(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new G(`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:io,callsite:Te(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:Zr({clientMethod:i,activeProvider:a}),callsite:Te(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",...Io(n,i));throw new G("`$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 G("`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=ll.nextId(),s=yo(n.length),a=n.map((u,g)=>{if(u?.[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 T=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,C={kind:"batch",id:o,index:g,isolationLevel:T,lock:s};return u.requestTransaction?.(C)??u});return Mo(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),u;try{let g={kind:"itx",...a};u=await n(this._createItxClient(g)),await this._engine.transaction("commit",o,a)}catch(g){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),g}return u}_createItxClient(n){return xt(he(Ui(this),[W("_appliedParent",()=>this._appliedParent._createItxClient(n)),W("_createPrismaPromise",()=>en(n)),W(al,()=>n.id),He(co)]))}$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??sl,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,u=async g=>{let T=this._middlewares.get(++a);if(T)return this._tracingHelper.runInChildSpan(s.middleware,M=>T(g,ie=>(M?.end(),u(ie))));let{runInTransaction:C,args:O,...A}=g,k={...n,...A};O&&(k.args=i.middlewareArgsToRequestArgs(O)),n.transaction!==void 0&&C===!1&&delete k.transaction;let S=await Gi(this,k);return k.model?Bi({result:S,modelName:k.model,args:k.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):S};return this._tracingHelper.runInChildSpan(s.operation,()=>u(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:u,argsMapper:g,transaction:T,unpacker:C,otelParentCtx:O,customDataProxyFetch:A}){try{n=g?g(n):n;let k={name:"serialize"},S=this._tracingHelper.runInChildSpan(k,()=>Xt({modelName:u,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 ee.enabled("prisma:client")&&(Re("Prisma Client call:"),Re(`prisma.${i}(${Si(n)})`),Re("Generated request:"),Re(JSON.stringify(S,null,2)+`
|
|
31
|
-
`)),T?.kind==="batch"&&await T.lock,this._requestHandler.request({protocolQuery:S,modelName:
|
|
31
|
+
${n}`}u();c();m();p();d();l();function jo(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)))},f=h=>{o||(o=!0,r(h))};for(let h=0;h<e.length;h++)e[h].then(T=>{n[h]=T,a()},T=>{if(!yr(T)){f(T);return}T.batchRequestIdx===h?f(T):(i||(i=T),a())})})}var Ae=W("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var vl={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Tl=Symbol.for("prisma.client.transaction.id"),Cl={id:0,nextId(){return++this.id}};function Go(e){class t{constructor(n){this._originalClient=this;this._middlewares=new gr;this._createPrismaPromise=an();this.$extends=Wi;e=n?.__internal?.configOverride?.(e)??e,so(e),n&&$o(n,e);let i=new Ut().on("error",()=>{});this._extensions=Ke.empty(),this._previewFeatures=fr(e),this._clientVersion=e.clientVersion??Fo,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=So();let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&st.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&st.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=Wr(n.adapter);let f=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==f)throw new k(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${f}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new k("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=e.injectableEdgeEnv?.();try{let f=n??{},h=f.__internal??{},T=h.debug===!0;T&&W.enable("prisma:client");let C=st.resolve(e.dirname,e.relativePath);Cn.existsSync(C)||(C=e.dirname),Ae("dirname",e.dirname),Ae("relativePath",e.relativePath),Ae("cwd",C);let O=h.engine||{};if(f.errorFormat?this._errorFormat=f.errorFormat:g.env.NODE_ENV==="production"?this._errorFormat="minimal":g.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:C,dirname:e.dirname,enableDebugLogs:T,allowTriggerPanic:O.allowTriggerPanic,datamodelPath:st.join(e.dirname,e.filename??"schema.prisma"),prismaPath:O.binaryPath??void 0,engineEndpoint:O.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:f.log&&ko(f.log),logQueries:f.log&&!!(typeof f.log=="string"?f.log==="query":f.log.find(A=>typeof A=="string"?A==="query":A.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:ao(f,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:f.transactionOptions?.maxWait??2e3,timeout:f.transactionOptions?.timeout??5e3,isolationLevel:f.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:pr,getBatchRequestPayload:sr,prismaGraphQLToJSError:ar,PrismaClientUnknownRequestError:U,PrismaClientInitializationError:k,PrismaClientKnownRequestError:X,debug:W("prisma:client:accelerateEngine"),engineVersion:Jo.version,clientVersion:e.clientVersion}},Ae("clientVersion",e.clientVersion),this._engine=yo(e,this._engineConfig),this._requestHandler=new wr(this,i),f.log)for(let A of f.log){let I=typeof A=="string"?A:A.emit==="stdout"?A.level:null;I&&this.$on(I,S=>{lt.log(`${lt.tags[I]??""}`,S.message||S.query)})}this._metrics=new ze(this._engine)}catch(f){throw f.clientVersion=this._clientVersion,f}return this._appliedParent=vt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$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{Un()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:sn({clientMethod:i,activeProvider:a}),callsite:Ce(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Qo(n,i);return on(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new G("`$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=>(on(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new G(`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:ho,callsite:Ce(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:sn({clientMethod:i,activeProvider:a}),callsite:Ce(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",...Qo(n,i));throw new G("`$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 G("`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=Cl.nextId(),s=Oo(n.length),a=n.map((f,h)=>{if(f?.[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 T=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,C={kind:"batch",id:o,index:h,isolationLevel:T,lock:s};return f.requestTransaction?.(C)??f});return jo(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),f;try{let h={kind:"itx",...a};f=await n(this._createItxClient(h)),await this._engine.transaction("commit",o,a)}catch(h){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),h}return f}_createItxClient(n){return vt(he(Gi(this),[H("_appliedParent",()=>this._appliedParent._createItxClient(n)),H("_createPrismaPromise",()=>an(n)),H(Tl,()=>n.id),Ye(vo)]))}$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??vl,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,f=async h=>{let T=this._middlewares.get(++a);if(T)return this._tracingHelper.runInChildSpan(s.middleware,L=>T(h,oe=>(L?.end(),f(oe))));let{runInTransaction:C,args:O,...A}=h,I={...n,...A};O&&(I.args=i.middlewareArgsToRequestArgs(O)),n.transaction!==void 0&&C===!1&&delete I.transaction;let S=await eo(this,I);return I.model?zi({result:S,modelName:I.model,args:I.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):S};return this._tracingHelper.runInChildSpan(s.operation,()=>f(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:f,argsMapper:h,transaction:T,unpacker:C,otelParentCtx:O,customDataProxyFetch:A}){try{n=h?h(n):n;let I={name:"serialize"},S=this._tracingHelper.runInChildSpan(I,()=>rr({modelName:f,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 W.enabled("prisma:client")&&(Ae("Prisma Client call:"),Ae(`prisma.${i}(${Fi(n)})`),Ae("Generated request:"),Ae(JSON.stringify(S,null,2)+`
|
|
32
|
+
`)),T?.kind==="batch"&&await T.lock,this._requestHandler.request({protocolQuery:S,modelName:f,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:T,unpacker:C,otelParentCtx:O,otelChildCtx:this._tracingHelper.getActiveContext(),globalOmit:this._globalOmit,customDataProxyFetch:A})}catch(I){throw I.clientVersion=this._clientVersion,I}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new G("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Qo(e,t){return Rl(e)?[new Z(e,t),Co]:[e,Ro]}function Rl(e){return Array.isArray(e)&&Array.isArray(e.raw)}u();c();m();p();d();l();var Al=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Wo(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Al.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}u();c();m();p();d();l();l();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce});
|
|
32
33
|
//# sourceMappingURL=wasm.js.map
|