prisma 6.9.0-dev.7 → 6.9.0-dev.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var cc=Object.create;var Ur=Object.defineProperty;var pc=Object.getOwnPropertyDescriptor;var dc=Object.getOwnPropertyNames;var mc=Object.getPrototypeOf,fc=Object.prototype.hasOwnProperty;var _o=(e,t)=>()=>(e&&(t=e(e=0)),t);var H=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),it=(e,t)=>{for(var r in t)Ur(e,r,{get:t[r],enumerable:!0})},No=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of dc(t))!fc.call(e,i)&&i!==r&&Ur(e,i,{get:()=>t[i],enumerable:!(n=pc(t,i))||n.enumerable});return e};var q=(e,t,r)=>(r=e!=null?cc(mc(e)):{},No(t||!e||!e.__esModule?Ur(r,"default",{value:e,enumerable:!0}):r,e)),gc=e=>No(Ur({},"__esModule",{value:!0}),e);var Jo=H((Wg,Lc)=>{Lc.exports={name:"@prisma/internals",version:"6.9.0-dev.7",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.5.0",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/schema-engine-wasm":"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var zo=H((zg,Ko)=>{"use strict";Ko.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var es=H((Xg,Xo)=>{"use strict";Xo.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 ns=H((th,rs)=>{"use strict";rs.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 ui=H((rh,is)=>{"use strict";var Hc=ns();is.exports=e=>typeof e=="string"?e.replace(Hc(),""):e});var os=H((oh,Gc)=>{Gc.exports={name:"dotenv",version:"16.5.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var cs=H((sh,Ce)=>{"use strict";var pi=require("node:fs"),di=require("node:path"),Wc=require("node:os"),Jc=require("node:crypto"),Kc=os(),as=Kc.version,zc=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Yc(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
1
+ "use strict";var cc=Object.create;var Ur=Object.defineProperty;var pc=Object.getOwnPropertyDescriptor;var dc=Object.getOwnPropertyNames;var mc=Object.getPrototypeOf,fc=Object.prototype.hasOwnProperty;var _o=(e,t)=>()=>(e&&(t=e(e=0)),t);var H=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),it=(e,t)=>{for(var r in t)Ur(e,r,{get:t[r],enumerable:!0})},No=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of dc(t))!fc.call(e,i)&&i!==r&&Ur(e,i,{get:()=>t[i],enumerable:!(n=pc(t,i))||n.enumerable});return e};var q=(e,t,r)=>(r=e!=null?cc(mc(e)):{},No(t||!e||!e.__esModule?Ur(r,"default",{value:e,enumerable:!0}):r,e)),gc=e=>No(Ur({},"__esModule",{value:!0}),e);var Jo=H((Wg,Lc)=>{Lc.exports={name:"@prisma/internals",version:"6.9.0-dev.8",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.5.0",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/schema-engine-wasm":"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var zo=H((zg,Ko)=>{"use strict";Ko.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var es=H((Xg,Xo)=>{"use strict";Xo.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 ns=H((th,rs)=>{"use strict";rs.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 ui=H((rh,is)=>{"use strict";var Hc=ns();is.exports=e=>typeof e=="string"?e.replace(Hc(),""):e});var os=H((oh,Gc)=>{Gc.exports={name:"dotenv",version:"16.5.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var cs=H((sh,Ce)=>{"use strict";var pi=require("node:fs"),di=require("node:path"),Wc=require("node:os"),Jc=require("node:crypto"),Kc=os(),as=Kc.version,zc=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Yc(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
2
  `);let n;for(;(n=zc.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
3
3
  `),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function Zc(e){let t=us(e),r=j.configDotenv({path:t});if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=ls(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=ep(r,a);o=j.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return j.parse(o)}function Xc(e){console.log(`[dotenv@${as}][WARN] ${e}`)}function Wt(e){console.log(`[dotenv@${as}][DEBUG] ${e}`)}function ls(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function ep(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function us(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)pi.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=di.resolve(process.cwd(),".env.vault");return pi.existsSync(t)?t:null}function ss(e){return e[0]==="~"?di.join(Wc.homedir(),e.slice(1)):e}function tp(e){!!(e&&e.debug)&&Wt("Loading env from encrypted .env.vault");let r=j._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),j.populate(n,r,e),{parsed:r}}function rp(e){let t=di.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&Wt("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[ss(e.path)];else{i=[];for(let l of e.path)i.push(ss(l))}let o,s={};for(let l of i)try{let u=j.parse(pi.readFileSync(l,{encoding:r}));j.populate(s,u,e)}catch(u){n&&Wt(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),j.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function np(e){if(ls(e).length===0)return j.configDotenv(e);let t=us(e);return t?j._configVault(e):(Xc(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),j.configDotenv(e))}function ip(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=Jc.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||l){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw s}}function op(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override);if(typeof t!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o]),n&&Wt(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var j={configDotenv:rp,_configVault:tp,_parseVault:Zc,config:np,decrypt:ip,parse:Yc,populate:op};Ce.exports.configDotenv=j.configDotenv;Ce.exports._configVault=j._configVault;Ce.exports._parseVault=j._parseVault;Ce.exports.config=j.config;Ce.exports.decrypt=j.decrypt;Ce.exports.parse=j.parse;Ce.exports.populate=j.populate;Ce.exports=j});var fs=H((dh,Wr)=>{"use strict";Wr.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};Wr.exports.default=Wr.exports});var vi=H((jy,$s)=>{"use strict";$s.exports=function(){function e(t,r,n,i,o){return t<r||n<r?t>n?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&t.charCodeAt(s)===r.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,u,c,p,d,m,g,h,R,T,C,w,I=[];for(l=0;l<i;l++)I.push(l+1),I.push(t.charCodeAt(s+l));for(var pe=I.length-1;a<o-3;)for(R=r.charCodeAt(s+(u=a)),T=r.charCodeAt(s+(c=a+1)),C=r.charCodeAt(s+(p=a+2)),w=r.charCodeAt(s+(d=a+3)),m=a+=4,l=0;l<pe;l+=2)g=I[l],h=I[l+1],u=e(g,u,c,R,h),c=e(u,c,p,T,h),p=e(c,p,d,C,h),m=e(p,d,m,w,h),I[l]=m,d=p,p=c,c=u,u=g;for(;a<o;)for(R=r.charCodeAt(s+(u=a)),m=++a,l=0;l<pe;l+=2)g=I[l],I[l]=m=e(g,u,m,R,I[l+1]),u=g;return m}}()});var Bs=_o(()=>{"use strict"});var Qs=_o(()=>{"use strict"});var fa=H((hb,Xd)=>{Xd.exports={name:"@prisma/engines-version",version:"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"2060c79ba17c6bb9f5823312b6f6b7f4a845738e"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Wi=H(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.anumber=Gi;Je.abytes=al;Je.ahash=Zm;Je.aexists=Xm;Je.aoutput=ef;function Gi(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ym(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function al(e,...t){if(!Ym(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Zm(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Gi(e.outputLen),Gi(e.blockLen)}function Xm(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ef(e,t){al(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var kl=H(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.add5L=P.add5H=P.add4H=P.add4L=P.add3H=P.add3L=P.rotlBL=P.rotlBH=P.rotlSL=P.rotlSH=P.rotr32L=P.rotr32H=P.rotrBL=P.rotrBH=P.rotrSL=P.rotrSH=P.shrSL=P.shrSH=P.toBig=void 0;P.fromBig=Ki;P.split=ll;P.add=Pl;var In=BigInt(2**32-1),Ji=BigInt(32);function Ki(e,t=!1){return t?{h:Number(e&In),l:Number(e>>Ji&In)}:{h:Number(e>>Ji&In)|0,l:Number(e&In)|0}}function ll(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=Ki(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var ul=(e,t)=>BigInt(e>>>0)<<Ji|BigInt(t>>>0);P.toBig=ul;var cl=(e,t,r)=>e>>>r;P.shrSH=cl;var pl=(e,t,r)=>e<<32-r|t>>>r;P.shrSL=pl;var dl=(e,t,r)=>e>>>r|t<<32-r;P.rotrSH=dl;var ml=(e,t,r)=>e<<32-r|t>>>r;P.rotrSL=ml;var fl=(e,t,r)=>e<<64-r|t>>>r-32;P.rotrBH=fl;var gl=(e,t,r)=>e>>>r-32|t<<64-r;P.rotrBL=gl;var hl=(e,t)=>t;P.rotr32H=hl;var yl=(e,t)=>e;P.rotr32L=yl;var wl=(e,t,r)=>e<<r|t>>>32-r;P.rotlSH=wl;var El=(e,t,r)=>t<<r|e>>>32-r;P.rotlSL=El;var bl=(e,t,r)=>t<<r-32|e>>>64-r;P.rotlBH=bl;var xl=(e,t,r)=>e<<r-32|t>>>64-r;P.rotlBL=xl;function Pl(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var vl=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);P.add3L=vl;var Tl=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;P.add3H=Tl;var Cl=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);P.add4L=Cl;var Al=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;P.add4H=Al;var Sl=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);P.add5L=Sl;var Rl=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;P.add5H=Rl;var tf={fromBig:Ki,split:ll,toBig:ul,shrSH:cl,shrSL:pl,rotrSH:dl,rotrSL:ml,rotrBH:fl,rotrBL:gl,rotr32H:hl,rotr32L:yl,rotlSH:wl,rotlSL:El,rotlBH:bl,rotlBL:xl,add:Pl,add3L:vl,add3H:Tl,add4L:Cl,add4H:Al,add5H:Rl,add5L:Sl};P.default=tf});var Il=H(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.crypto=void 0;var $e=require("node:crypto");On.crypto=$e&&typeof $e=="object"&&"webcrypto"in $e?$e.webcrypto:$e&&typeof $e=="object"&&"randomBytes"in $e?$e:void 0});var _l=H(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.Hash=S.nextTick=S.byteSwapIfBE=S.isLE=void 0;S.isBytes=rf;S.u8=nf;S.u32=of;S.createView=sf;S.rotr=af;S.rotl=lf;S.byteSwap=Zi;S.byteSwap32=uf;S.bytesToHex=pf;S.hexToBytes=df;S.asyncLoop=ff;S.utf8ToBytes=Dl;S.toBytes=Dn;S.concatBytes=gf;S.checkOpts=hf;S.wrapConstructor=yf;S.wrapConstructorWithOpts=wf;S.wrapXOFConstructorWithOpts=Ef;S.randomBytes=bf;var At=Il(),Yi=Wi();function rf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function nf(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function of(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function sf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function af(e,t){return e<<32-t|e>>>t}function lf(e,t){return e<<t|e>>>32-t>>>0}S.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Zi(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}S.byteSwapIfBE=S.isLE?e=>e:e=>Zi(e);function uf(e){for(let t=0;t<e.length;t++)e[t]=Zi(e[t])}var cf=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function pf(e){(0,Yi.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=cf[e[r]];return t}var Re={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ol(e){if(e>=Re._0&&e<=Re._9)return e-Re._0;if(e>=Re.A&&e<=Re.F)return e-(Re.A-10);if(e>=Re.a&&e<=Re.f)return e-(Re.a-10)}function df(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let s=Ol(e.charCodeAt(o)),a=Ol(e.charCodeAt(o+1));if(s===void 0||a===void 0){let l=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}n[i]=s*16+a}return n}var mf=async()=>{};S.nextTick=mf;async function ff(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);let o=Date.now()-n;o>=0&&o<t||(await(0,S.nextTick)(),n+=o)}}function Dl(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Dn(e){return typeof e=="string"&&(e=Dl(e)),(0,Yi.abytes)(e),e}function gf(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,Yi.abytes)(i),t+=i.length}let r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return r}var zi=class{clone(){return this._cloneInto()}};S.Hash=zi;function hf(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function yf(e){let t=n=>e().update(Dn(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function wf(e){let t=(n,i)=>e(i).update(Dn(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Ef(e){let t=(n,i)=>e(i).update(Dn(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function bf(e=32){if(At.crypto&&typeof At.crypto.getRandomValues=="function")return At.crypto.getRandomValues(new Uint8Array(e));if(At.crypto&&typeof At.crypto.randomBytes=="function")return At.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var jl=H(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.shake256=F.shake128=F.keccak_512=F.keccak_384=F.keccak_256=F.keccak_224=F.sha3_512=F.sha3_384=F.sha3_256=F.sha3_224=F.Keccak=void 0;F.keccakP=Vl;var St=Wi(),yr=kl(),ke=_l(),Fl=[],Ll=[],$l=[],xf=BigInt(0),hr=BigInt(1),Pf=BigInt(2),vf=BigInt(7),Tf=BigInt(256),Cf=BigInt(113);for(let e=0,t=hr,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Fl.push(2*(5*n+r)),Ll.push((e+1)*(e+2)/2%64);let i=xf;for(let o=0;o<7;o++)t=(t<<hr^(t>>vf)*Cf)%Tf,t&Pf&&(i^=hr<<(hr<<BigInt(o))-hr);$l.push(i)}var[Af,Sf]=(0,yr.split)($l,!0),Nl=(e,t,r)=>r>32?(0,yr.rotlBH)(e,t,r):(0,yr.rotlSH)(e,t,r),Ml=(e,t,r)=>r>32?(0,yr.rotlBL)(e,t,r):(0,yr.rotlSL)(e,t,r);function Vl(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,l=(s+2)%10,u=r[l],c=r[l+1],p=Nl(u,c,1)^r[a],d=Ml(u,c,1)^r[a+1];for(let m=0;m<50;m+=10)e[s+m]^=p,e[s+m+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=Ll[s],l=Nl(i,o,a),u=Ml(i,o,a),c=Fl[s];i=e[c],o=e[c+1],e[c]=l,e[c+1]=u}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=Af[n],e[1]^=Sf[n]}r.fill(0)}var wr=class e extends ke.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,St.anumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,ke.u32)(this.state)}keccak(){ke.isLE||(0,ke.byteSwap32)(this.state32),Vl(this.state32,this.rounds),ke.isLE||(0,ke.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,St.aexists)(this);let{blockLen:r,state:n}=this;t=(0,ke.toBytes)(t);let i=t.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);for(let a=0;a<s;a++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){(0,St.aexists)(this,!1),(0,St.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,St.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,St.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new e(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}};F.Keccak=wr;var Ve=(e,t,r)=>(0,ke.wrapConstructor)(()=>new wr(t,e,r));F.sha3_224=Ve(6,144,224/8);F.sha3_256=Ve(6,136,256/8);F.sha3_384=Ve(6,104,384/8);F.sha3_512=Ve(6,72,512/8);F.keccak_224=Ve(1,144,224/8);F.keccak_256=Ve(1,136,256/8);F.keccak_384=Ve(1,104,384/8);F.keccak_512=Ve(1,72,512/8);var ql=(e,t,r)=>(0,ke.wrapXOFConstructorWithOpts)((n={})=>new wr(t,e,n.dkLen===void 0?r:n.dkLen,!0));F.shake128=ql(31,168,128/8);F.shake256=ql(31,136,256/8)});var Kl=H((B0,qe)=>{"use strict";var{sha3_512:Rf}=jl(),Bl=24,Er=32,Xi=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function Ql(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var Hl=(e="")=>Ql(Rf(e)).toString(36).slice(1),Ul=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),kf=e=>Ul[Math.floor(e()*Ul.length)],Gl=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+Xi(Er,t):Xi(Er,t);return Hl(n).substring(0,Er)},Wl=e=>()=>e++,If=476782367,Jl=({random:e=Math.random,counter:t=Wl(Math.floor(e()*If)),length:r=Bl,fingerprint:n=Gl({random:e})}={})=>function(){let o=kf(e),s=Date.now().toString(36),a=t().toString(36),l=Xi(r,e),u=`${s+l+a+n}`;return`${o+Hl(u).substring(1,r)}`},Of=Jl(),Df=(e,{minLength:t=2,maxLength:r=Er}={})=>{let n=e.length,i=/^[0-9a-z]+$/;try{if(typeof e=="string"&&n>=t&&n<=r&&i.test(e))return!0}finally{}return!1};qe.exports.getConstants=()=>({defaultLength:Bl,bigLength:Er});qe.exports.init=Jl;qe.exports.createId=Of;qe.exports.bufToBigInt=Ql;qe.exports.createCounter=Wl;qe.exports.createFingerprint=Gl;qe.exports.isCuid=Df});var zl=H((Q0,br)=>{"use strict";var{createId:_f,init:Nf,getConstants:Mf,isCuid:Ff}=Kl();br.exports.createId=_f;br.exports.init=Nf;br.exports.getConstants=Mf;br.exports.isCuid=Ff});var Mg={};it(Mg,{DMMF:()=>Zt,Debug:()=>L,Decimal:()=>se,Extensions:()=>ti,MetricsClient:()=>xt,PrismaClientInitializationError:()=>k,PrismaClientKnownRequestError:()=>B,PrismaClientRustPanicError:()=>ee,PrismaClientUnknownRequestError:()=>z,PrismaClientValidationError:()=>Y,Public:()=>ri,Sql:()=>ae,createParam:()=>sa,defineDmmfProperty:()=>da,deserializeJsonResponse:()=>ct,deserializeRawResult:()=>Yn,dmmfToRuntimeDataModel:()=>Ds,empty:()=>ha,getPrismaClient:()=>ac,getRuntime:()=>Rn,join:()=>ga,makeStrictEnum:()=>lc,makeTypedQueryFactory:()=>ma,objectEnumValues:()=>mn,raw:()=>Di,serializeJsonQuery:()=>bn,skip:()=>En,sqltag:()=>_i,warnEnvConflicts:()=>uc,warnOnce:()=>Kt});module.exports=gc(Mg);var ti={};it(ti,{defineExtension:()=>Mo,getExtensionContext:()=>Fo});function Mo(e){return typeof e=="function"?e:t=>t.$extends(e)}function Fo(e){return e}var ri={};it(ri,{validator:()=>Lo});function Lo(...e){return t=>t}var Br={};it(Br,{$:()=>Uo,bgBlack:()=>Cc,bgBlue:()=>kc,bgCyan:()=>Oc,bgGreen:()=>Sc,bgMagenta:()=>Ic,bgRed:()=>Ac,bgWhite:()=>Dc,bgYellow:()=>Rc,black:()=>xc,blue:()=>Qe,bold:()=>X,cyan:()=>Te,dim:()=>Ue,gray:()=>jt,green:()=>qt,grey:()=>Tc,hidden:()=>Ec,inverse:()=>wc,italic:()=>yc,magenta:()=>Pc,red:()=>ve,reset:()=>hc,strikethrough:()=>bc,underline:()=>ie,white:()=>vc,yellow:()=>Be});var ni,$o,Vo,qo,jo=!0;typeof process<"u"&&({FORCE_COLOR:ni,NODE_DISABLE_COLORS:$o,NO_COLOR:Vo,TERM:qo}=process.env||{},jo=process.stdout&&process.stdout.isTTY);var Uo={enabled:!$o&&Vo==null&&qo!=="dumb"&&(ni!=null&&ni!=="0"||jo)};function N(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Uo.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var hc=N(0,0),X=N(1,22),Ue=N(2,22),yc=N(3,23),ie=N(4,24),wc=N(7,27),Ec=N(8,28),bc=N(9,29),xc=N(30,39),ve=N(31,39),qt=N(32,39),Be=N(33,39),Qe=N(34,39),Pc=N(35,39),Te=N(36,39),vc=N(37,39),jt=N(90,39),Tc=N(90,39),Cc=N(40,49),Ac=N(41,49),Sc=N(42,49),Rc=N(43,49),kc=N(44,49),Ic=N(45,49),Oc=N(46,49),Dc=N(47,49);var _c=100,Bo=["green","yellow","blue","magenta","cyan","red"],Ut=[],Qo=Date.now(),Nc=0,ii=typeof process<"u"?process.env:{};globalThis.DEBUG??=ii.DEBUG??"";globalThis.DEBUG_COLORS??=ii.DEBUG_COLORS?ii.DEBUG_COLORS==="true":!0;var Bt={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 Mc(e){let t={color:Bo[Nc++%Bo.length],enabled:Bt.enabled(e),namespace:e,log:Bt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Ut.push([o,...n]),Ut.length>_c&&Ut.shift(),Bt.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Fc(c)),u=`+${Date.now()-Qo}ms`;Qo=Date.now(),globalThis.DEBUG_COLORS?a(Br[s](X(o)),...l,Br[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var L=new Proxy(Mc,{get:(e,t)=>Bt[t],set:(e,t,r)=>Bt[t]=r});function Fc(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 Ho(e=7500){let t=Ut.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
4
4
  `);return t.length<e?t:t.slice(-e)}function Go(){Ut.length=0}var Wo=L;var $c=Jo(),oi=$c.version;function ot(e){let t=Vc();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":qc(e))}function Vc(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function qc(e){return e?.previewFeatures.includes("queryCompiler")?"client":"library"}var Yo=q(zo(),1);function si(e){let t=(0,Yo.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var Zo="prisma+postgres",Qr=`${Zo}:`;function Hr(e){return e?.toString().startsWith(`${Qr}//`)??!1}function ai(e){if(!Hr(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")}var Ht={};it(Ht,{error:()=>Bc,info:()=>Uc,log:()=>jc,query:()=>Qc,should:()=>ts,tags:()=>Qt,warn:()=>li});var Qt={error:ve("prisma:error"),warn:Be("prisma:warn"),info:Te("prisma:info"),query:Qe("prisma:query")},ts={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function jc(...e){console.log(...e)}function li(e,...t){ts.warn()&&console.warn(`${Qt.warn} ${e}`,...t)}function Uc(e,...t){console.info(`${Qt.info} ${e}`,...t)}function Bc(e,...t){console.error(`${Qt.error} ${e}`,...t)}function Qc(e,...t){console.log(`${Qt.query} ${e}`,...t)}function de(e,t){throw new Error(t)}var Gt=q(require("node:path"));function ci(e){return Gt.default.sep===Gt.default.posix.sep?e:e.split(Gt.default.sep).join(Gt.default.posix.sep)}var fi=q(cs()),Gr=q(require("node:fs"));var st=q(require("node:path"));function ps(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",u=r(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var mi=Wo("prisma:tryLoadEnv");function Jt({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=ds(e);r.conflictCheck!=="none"&&sp(n,t,r.conflictCheck);let i=null;return ms(n?.path,t)||(i=ds(t)),!n&&!i&&mi("No Environment variables loaded"),i?.dotenvResult.error?console.error(ve(X("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
@@ -68,7 +68,7 @@ ${ie(p)}
68
68
  If you want the Prisma team to look into it, please open the link above \u{1F64F}
69
69
  To increase the chance of success, please post your schema and a snippet of
70
70
  how you used Prisma Client in the issue.
71
- `}var fr;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(fr||(fr={}));function $(e,t){throw new Error(t)}function Ct(e,t){return e===t||e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>Ct(e[r],t[r]))}function Za(e){switch(e){case"postgres":return"postgresql";case"mysql":return"mysql";case"sqlite":return"sqlite";default:$(e,`Unknown provider: ${e}`)}}function ji(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var gr=class extends Error{name="UserFacingError";code;meta;constructor(t,r,n){super(t),this.code=r,this.meta=n}toQueryResponseErrorObject(){return{error:this.message,user_facing_error:{is_panic:!1,message:this.message,meta:this.meta,error_code:this.code}}}};function Xa(e){if(!ji(e))throw e;let t=Qm(e),r=Hm(e);throw!t||!r?e:new gr(r,t,e)}function Qm(e){switch(e.cause.kind){case"AuthenticationFailed":return"P1000";case"DatabaseDoesNotExist":return"P1003";case"SocketTimeout":return"P1008";case"DatabaseAlreadyExists":return"P1009";case"DatabaseAccessDenied":return"P1010";case"LengthMismatch":return"P2000";case"UniqueConstraintViolation":return"P2002";case"ForeignKeyConstraintViolation":return"P2003";case"UnsupportedNativeDataType":return"P2010";case"NullConstraintViolation":return"P2011";case"TableDoesNotExist":return"P2021";case"ColumnNotFound":return"P2022";case"InvalidIsolationLevel":return"P2023";case"TransactionWriteConflict":return"P2034";case"GenericJs":return"P2036";case"TooManyConnections":return"P2037";case"postgres":case"sqlite":case"mysql":return;default:$(e.cause,`Unknown error: ${e.cause}`)}}function Hm(e){switch(e.cause.kind){case"AuthenticationFailed":return`Authentication failed against the database server, the provided database credentials for \`${e.cause.user??"(not available)"}\` are not valid`;case"DatabaseDoesNotExist":return`Database \`${e.cause.db??"(not available)"}\` does not exist on the database server`;case"SocketTimeout":return"Operation has timed out";case"DatabaseAlreadyExists":return`Database \`${e.cause.db??"(not available)"}\` already exists on the database server`;case"DatabaseAccessDenied":return`User was denied access on the database \`${e.cause.db??"(not available)"}\``;case"LengthMismatch":return`The provided value for the column is too long for the column's type. Column: ${e.cause.column??"(not available)"}`;case"UniqueConstraintViolation":return`Unique constraint failed on the ${Ui({fields:e.cause.fields})}`;case"ForeignKeyConstraintViolation":return`Foreign key constraint violated on the ${Ui(e.cause.constraint)}`;case"UnsupportedNativeDataType":return`Failed to deserialize column of type '${e.cause.type}'. If you're using $queryRaw and this column is explicitly marked as \`Unsupported\` in your Prisma schema, try casting this column to any supported Prisma type such as \`String\`.`;case"NullConstraintViolation":return`Null constraint violation on the ${Ui({fields:e.cause.fields})}`;case"TableDoesNotExist":return`The table \`${e.cause.table??"(not available)"}\` does not exist in the current database.`;case"ColumnNotFound":return`The column \`${e.cause.column??"(not available)"}\` does not exist in the current database.`;case"InvalidIsolationLevel":return`Invalid isolation level \`${e.cause.level}\``;case"TransactionWriteConflict":return"Transaction failed due to a write conflict or a deadlock. Please retry your transaction";case"GenericJs":return`Error in external connector (id ${e.cause.id})`;case"TooManyConnections":return`Too many database connections opened: ${e.cause.cause}`;case"sqlite":case"postgres":case"mysql":return;default:$(e.cause,`Unknown error: ${e.cause}`)}}function Ui(e){return e&&"fields"in e?`fields: (${e.fields.map(t=>`\`${t}\``).join(", ")})`:e&&"index"in e?`constraint: \`${e.index}\``:e&&"foreignKey"in e?"foreign key":"(not available)"}function tl(e,t){switch(t.type){case"Object":return rl(e,t.fields);case"Value":return Bi(e,t.resultType);default:$(t,`Invalid data mapping type: '${t.type}'`)}}function rl(e,t){if(e===null)return null;if(Array.isArray(e))return e.map(n=>el(n,t));if(typeof e=="object")return el(e,t);throw new Error(`DataMapper: Expected an array or an object, got: ${typeof e}`)}function el(e,t){if(typeof e!="object")throw new Error(`DataMapper: Expected an object, but got '${typeof e}'`);let r={};for(let[n,i]of Object.entries(t))switch(i.type){case"Object":{if(!i.flattened&&!Object.hasOwn(e,n))throw new Error(`DataMapper: Missing data field (Object): '${n}'; node: ${JSON.stringify(i)}; data: ${JSON.stringify(e)}`);let o=i.flattened?e:e[n];r[n]=rl(o,i.fields);break}case"Value":{let o=i.dbName;if(Object.hasOwn(e,o))r[n]=Bi(e[o],i.resultType);else throw new Error(`DataMapper: Missing data field (Value): '${o}'; node: ${JSON.stringify(i)}; data: ${JSON.stringify(e)}`)}break;default:$(i,`DataMapper: Invalid data mapping node type: '${i.type}'`)}return r}function Bi(e,t){if(e===null)return null;switch(t.type){case"Any":return e;case"String":return typeof e=="string"?e:`${e}`;case"Int":return typeof e=="number"?e:parseInt(`${e}`,10);case"BigInt":return typeof e=="bigint"?e:BigInt(`${e}`);case"Float":return typeof e=="number"?e:parseFloat(`${e}`);case"Boolean":return typeof e=="boolean"?e:e!=="0";case"Decimal":return typeof e=="number"?new se(e):new se(`${e}`);case"Date":return e instanceof Date?e:new Date(`${e}`);case"Array":return e.map(n=>Bi(n,t.inner));case"Object":return typeof e=="string"?e:JSON.stringify(e);case"Bytes":{if(!Array.isArray(e))throw new Error(`DataMapper: Bytes data is invalid, got: ${typeof e}`);return new Uint8Array(e)}default:$(t,`DataMapper: Unknown result type: ${t.type}`)}}function We(e,t){var r="000000000"+e;return r.substr(r.length-t)}var nl=q(require("node:os"),1);function Gm(){try{return nl.default.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var il=2,Wm=We(process.pid.toString(36),il),ol=Gm(),Jm=ol.length,Km=We(ol.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+Jm+36).toString(36),il);function Qi(){return Wm+Km}function kn(e){return typeof e=="string"&&/^c[a-z0-9]{20,32}$/.test(e)}function Hi(e){let n=Math.pow(36,4),i=0;function o(){return We((Math.random()*n<<0).toString(36),4)}function s(){return i=i<n?i:0,i++,i-1}function a(){var l="c",u=new Date().getTime().toString(36),c=We(s().toString(36),4),p=e(),d=o()+o();return l+u+c+p+d}return a.fingerprint=e,a.isCuid=kn,a}var zm=Hi(Qi);var sl=zm;var ou=q(zl());var eo=require("node:crypto");var Yl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Lf=128,Ke,Rt;function $f(e){!Ke||Ke.length<e?(Ke=Buffer.allocUnsafe(e*Lf),eo.webcrypto.getRandomValues(Ke),Rt=0):Rt+e>Ke.length&&(eo.webcrypto.getRandomValues(Ke),Rt=0),Rt+=e}function to(e=21){$f(e|=0);let t="";for(let r=Rt-e;r<Rt;r++)t+=Yl[Ke[r]&63];return t}var xr=q(require("node:crypto"),1);var Xl="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Pr=32;var Vf=16,eu=10,Zl=0xffffffffffff;var ze;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(ze||(ze={}));var Ye=class extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}};function qf(e){let t=Math.floor(e()*Pr);return t===Pr&&(t=Pr-1),Xl.charAt(t)}function jf(e){let t=Uf(),r=t&&(t.crypto||t.msCrypto)||(typeof xr.default<"u"?xr.default:null);if(typeof r?.getRandomValues=="function")return()=>{let n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof r?.randomBytes=="function")return()=>r.randomBytes(1).readUInt8()/255;if(xr.default?.randomBytes)return()=>xr.default.randomBytes(1).readUInt8()/255;throw new Ye(ze.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Uf(){return Hf()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Bf(e,t){let r="";for(;e>0;e--)r=qf(t)+r;return r}function Qf(e,t=eu){if(isNaN(e))throw new Ye(ze.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Zl)throw new Ye(ze.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Zl}: ${e}`);if(e<0)throw new Ye(ze.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Ye(ze.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%Pr,n=Xl.charAt(r)+n,e=(e-r)/Pr;return n}function Hf(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function tu(e,t){let r=t||jf(),n=!e||isNaN(e)?Date.now():e;return Qf(n,eu)+Bf(Vf,r)}var W=[];for(let e=0;e<256;++e)W.push((e+256).toString(16).slice(1));function _n(e,t=0){return(W[e[t+0]]+W[e[t+1]]+W[e[t+2]]+W[e[t+3]]+"-"+W[e[t+4]]+W[e[t+5]]+"-"+W[e[t+6]]+W[e[t+7]]+"-"+W[e[t+8]]+W[e[t+9]]+"-"+W[e[t+10]]+W[e[t+11]]+W[e[t+12]]+W[e[t+13]]+W[e[t+14]]+W[e[t+15]]).toLowerCase()}var ru=require("node:crypto"),Mn=new Uint8Array(256),Nn=Mn.length;function kt(){return Nn>Mn.length-16&&((0,ru.randomFillSync)(Mn),Nn=0),Mn.slice(Nn,Nn+=16)}var nu=require("node:crypto"),ro={randomUUID:nu.randomUUID};function Gf(e,t,r){if(ro.randomUUID&&!t&&!e)return ro.randomUUID();e=e||{};let n=e.random??e.rng?.()??kt();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return _n(n)}var no=Gf;var io={};function Wf(e,t,r){let n;if(e)n=iu(e.random??e.rng?.()??kt(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=kt();Jf(io,i,o),n=iu(o,io.msecs,io.seq,t,r)}return t??_n(n)}function Jf(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function iu(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}var oo=Wf;var Fn=class{#e={};constructor(){this.register("now",new Ln),this.register("uuid",new so),this.register("cuid",new ao),this.register("ulid",new lo),this.register("nanoid",new uo),this.register("product",new co)}snapshot(){return Object.create(this.#e,{now:{value:new Ln}})}register(t,r){this.#e[t]=r}},Ln=class{#e=new Date;generate(){return this.#e.toISOString()}},so=class{generate(t){if(t===4)return no();if(t===7)return oo();throw new Error("Invalid UUID generator arguments")}},ao=class{generate(t){if(t===1)return sl();if(t===2)return(0,ou.createId)();throw new Error("Invalid CUID generator arguments")}},lo=class{generate(){return tu()}},uo=class{generate(t){if(typeof t=="number")return to(t);if(t===void 0)return to();throw new Error("Invalid Nanoid generator arguments")}},co=class{generate(t,r){if(t===void 0||r===void 0)throw new Error("Invalid Product generator arguments");return Array.isArray(t)&&Array.isArray(r)?t.flatMap(n=>r.map(i=>[n,i])):Array.isArray(t)?t.map(n=>[n,r]):Array.isArray(r)?r.map(n=>[t,n]):[[t,r]]}};function po(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}function mo(e){return typeof e=="object"&&e!==null&&e.prisma__type==="generatorCall"}function su(e){return typeof e=="object"&&e!==null&&e.prisma__type==="bytes"}function ho(e,t,r){let n=e.type;switch(n){case"rawSql":return lu(e.sql,au(e.params,t,r));case"templateSql":return Kf(e.fragments,e.placeholderFormat,au(e.params,t,r));default:$(n,"Invalid query type")}}function au(e,t,r){return e.map(n=>go(n,t,r))}function go(e,t,r){let n=e;for(;Yf(n);)if(po(n)){let i=t[n.prisma__value.name];if(i===void 0)throw new Error(`Missing value for query variable ${n.prisma__value.name}`);n=i}else if(mo(n)){let{name:i,args:o}=n.prisma__value,s=r[i];if(!s)throw new Error(`Encountered an unknown generator '${i}'`);n=s.generate(...o.map(a=>go(a,t,r)))}else $(n,`Unexpected unevaluated value type: ${n}`);return Array.isArray(n)&&(n=n.map(i=>go(i,t,r))),su(n)&&(n=Buffer.from(n.prisma__value,"base64")),n}function Kf(e,t,r){let n=0,i=1,o=[],s=e.map(a=>{let l=a.type;switch(l){case"parameter":if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);return o.push(r[n++]),fo(t,i++);case"stringChunk":return a.value;case"parameterTuple":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++],c=Array.isArray(u)?u:[u];return`(${c.length==0?"NULL":c.map(d=>(o.push(d),fo(t,i++))).join(",")})`}case"parameterTupleList":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++];if(!Array.isArray(u))throw new Error("Malformed query template. Tuple list expected.");if(u.length===0)throw new Error("Malformed query template. Tuple list cannot be empty.");return u.map(p=>{if(!Array.isArray(p))throw new Error("Malformed query template. Tuple expected.");return`(${p.map(m=>(o.push(m),fo(t,i++))).join(",")})`}).join(",")}default:$(l,"Invalid fragment type")}}).join("");return lu(s,o)}function fo(e,t){return e.hasNumbering?`${e.prefix}${t}`:e.prefix}function lu(e,t){let r=t.map(n=>zf(n));return{sql:e,args:t,argTypes:r}}function zf(e){return typeof e=="string"?"Text":typeof e=="number"?"Numeric":typeof e=="boolean"?"Boolean":Array.isArray(e)?"Array":Buffer.isBuffer(e)?"Bytes":"Unknown"}function Yf(e){return po(e)||mo(e)}function uu(e){return e.rows.map(t=>t.reduce((r,n,i)=>{let o=e.columnNames[i].split("."),s=r;for(let a=0;a<o.length;a++){let l=o[a];a===o.length-1?s[l]=n:(s[l]===void 0&&(s[l]={}),s=s[l])}return r},{}))}function cu(e,t,r){if(!t.every(n=>yo(e,n))){let n=Zf(e,r),i=Xf(r);throw new gr(n,i,r.context)}}function yo(e,t){switch(t.type){case"rowCountEq":return Array.isArray(e)?e.length===t.args:e===null?t.args===0:t.args===1;case"rowCountNeq":return Array.isArray(e)?e.length!==t.args:e===null?t.args!==0:t.args!==1;case"never":return!1;default:$(t,`Unknown rule type: ${t.type}`)}}function Zf(e,t){switch(t.error_identifier){case"RELATION_VIOLATION":return`The change you are trying to make would violate the required relation '${t.context.relation}' between the \`${t.context.modelA}\` and \`${t.context.modelB}\` models.`;case"MISSING_RECORD":return`An operation failed because it depends on one or more records that were required but not found. No record was found for ${t.context.operation}.`;case"MISSING_RELATED_RECORD":{let r=t.context.neededFor?` (needed to ${t.context.neededFor})`:"";return`An operation failed because it depends on one or more records that were required but not found. No '${t.context.model}' record${r} was found for ${t.context.operation} on ${t.context.relationType} relation '${t.context.relation}'.`}case"INCOMPLETE_CONNECT_INPUT":return`An operation failed because it depends on one or more records that were required but not found. Expected ${t.context.expectedRows} records to be connected, found only ${Array.isArray(e)?e.length:0}.`;case"RECORDS_NOT_CONNECTED":return`The records for relation \`${t.context.relation}\` between the \`${t.context.parent}\` and \`${t.context.child}\` models are not connected.`;default:$(t,`Unknown error identifier: ${t}`)}}function Xf(e){switch(e.error_identifier){case"RELATION_VIOLATION":return"P2014";case"RECORDS_NOT_CONNECTED":return"P2017";case"MISSING_RECORD":case"MISSING_RELATED_RECORD":case"INCOMPLETE_CONNECT_INPUT":return"P2025";default:$(e,`Unknown error identifier: ${e}`)}}var It=class e{#e;#n;#t;#i=new Fn;#r;#o;constructor({transactionManager:t,placeholderValues:r,onQuery:n,tracingHelper:i,serializer:o}){this.#e=t,this.#n=r,this.#t=n,this.#r=i,this.#o=o}static forSql(t){return new e({transactionManager:t.transactionManager,placeholderValues:t.placeholderValues,onQuery:t.onQuery,tracingHelper:t.tracingHelper,serializer:uu})}async run(t,r){return this.interpretNode(t,r,this.#n,this.#i.snapshot()).catch(n=>Xa(n))}async interpretNode(t,r,n,i){switch(t.type){case"seq":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i)));return o[o.length-1]}case"get":return n[t.args.name];case"let":{let o=Object.create(n);for(let s of t.args.bindings)o[s.name]=await this.interpretNode(s.expr,r,o,i);return this.interpretNode(t.args.expr,r,o,i)}case"getFirstNonEmpty":{for(let o of t.args.names){let s=n[o];if(!pu(s))return s}return[]}case"concat":return(await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i)))).reduce((s,a)=>s.concat(vr(a)),[]);case"sum":return(await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i)))).reduce((s,a)=>du(s)+du(a));case"execute":{let o=ho(t.args,n,i);return this.#s(o,r,async()=>await r.executeRaw(o))}case"query":{let o=ho(t.args,n,i);return this.#s(o,r,async()=>this.#o(await r.queryRaw(o)))}case"reverse":{let o=await this.interpretNode(t.args,r,n,i);return Array.isArray(o)?o.reverse():o}case"unique":{let o=await this.interpretNode(t.args,r,n,i);if(!Array.isArray(o))return o;if(o.length>1)throw new Error(`Expected zero or one element, got ${o.length}`);return o[0]??null}case"required":{let o=await this.interpretNode(t.args,r,n,i);if(pu(o))throw new Error("Required value is empty");return o}case"mapField":{let o=await this.interpretNode(t.args.records,r,n,i);return yu(o,t.args.field)}case"join":{let o=await this.interpretNode(t.args.parent,r,n,i),s=await Promise.all(t.args.children.map(async a=>({joinExpr:a,childRecords:await this.interpretNode(a.child,r,n,i)})));if(Array.isArray(o)){for(let a of o)mu($n(a),s);return o}return mu($n(o),s)}case"transaction":{if(!this.#e.enabled)return this.interpretNode(t.args,r,n,i);let o=this.#e.manager,s=await o.startTransaction(),a=o.getTransaction(s,"query");try{let l=await this.interpretNode(t.args,a,n,i);return await o.commitTransaction(s.id),l}catch(l){throw await o.rollbackTransaction(s.id),l}}case"dataMap":{let o=await this.interpretNode(t.args.expr,r,n,i);return tl(o,t.args.structure)}case"validate":{let o=await this.interpretNode(t.args.expr,r,n,i);return cu(o,t.args.rules,t.args),o}case"if":{let o=await this.interpretNode(t.args.value,r,n,i);return yo(o,t.args.rule)?await this.interpretNode(t.args.then,r,n,i):await this.interpretNode(t.args.else,r,n,i)}case"unit":return;case"diff":{let o=await this.interpretNode(t.args.from,r,n,i),s=await this.interpretNode(t.args.to,r,n,i),a=new Set(vr(s));return vr(o).filter(l=>!a.has(l))}case"distinctBy":{let o=await this.interpretNode(t.args.expr,r,n,i),s=new Set,a=[];for(let l of vr(o)){let u=hu(l,t.args.fields);s.has(u)||(s.add(u),a.push(l))}return a}case"paginate":{let o=await this.interpretNode(t.args.expr,r,n,i),s=vr(o),a=t.args.pagination.linkingFields;if(a!==null){let l=new Map;for(let c of s){let p=hu(c,a);l.has(p)||l.set(p,[]),l.get(p).push(c)}let u=Array.from(l.entries());return u.sort(([c],[p])=>c<p?-1:c>p?1:0),u.flatMap(([,c])=>gu(c,t.args.pagination))}return gu(s,t.args.pagination)}default:$(t,`Unexpected node type: ${t.type}`)}}#s(t,r,n){return this.#r.runInChildSpan({name:"db_query",kind:fr.CLIENT,attributes:{"db.query.text":t.sql,"db.system.name":Za(r.provider)}},async()=>{let i=new Date,o=performance.now(),s=await n(),a=performance.now();return this.#t?.({timestamp:i,duration:a-o,query:t.sql,params:t.args}),s})}};function pu(e){return Array.isArray(e)?e.length===0:e==null}function vr(e){return Array.isArray(e)?e:[e]}function du(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function $n(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Expected object, got ${typeof e}`)}function yu(e,t){return Array.isArray(e)?e.map(r=>yu(r,t)):typeof e=="object"&&e!==null?e[t]??null:e}function mu(e,t){for(let{joinExpr:r,childRecords:n}of t)e[r.parentField]=eg(n,e,r);return e}function eg(e,t,r){if(Array.isArray(e)){let n=e.filter(i=>fu($n(i),t,r));return r.isRelationUnique?n.length>0?n[0]:null:n}else{if(e===null)return null;{let n=$n(e);return fu(n,t,r)?n:null}}}function fu(e,t,r){for(let[n,i]of r.on)if(t[n]!==e[i])return!1;return!0}function gu(e,{cursor:t,skip:r,take:n}){let i=t!==null?e.findIndex(a=>tg(a,t)):0;if(i===-1)return[];let o=i+(r??0),s=n!==null?o+n:e.length;return e.slice(o,s)}function hu(e,t){return JSON.stringify(t.map(r=>e[r]))}function tg(e,t){return Object.keys(t).every(r=>typeof e[r]!=typeof t[r]&&(typeof e[r]=="number"||typeof t[r]=="number")?`${e[r]}`==`${t[r]}`:Ct(t[r],e[r]))}async function rg(){return globalThis.crypto??await import("node:crypto")}async function wu(){return(await rg()).randomUUID()}var re=class extends Error{constructor(r,n){super("Transaction API error: "+r);this.meta=n}code="P2028"},Tr=class extends re{constructor(){super("Transaction not found. Transaction ID is invalid, refers to an old closed transaction Prisma doesn't have information about anymore, or was obtained before disconnecting.")}},Vn=class extends re{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction`)}},qn=class extends re{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back`)}},jn=class extends re{constructor(){super("Unable to start a transaction in the given time.")}},Un=class extends re{constructor(t,{timeout:r,timeTaken:n}){super(`A ${t} cannot be executed on an expired transaction. The timeout for this transaction was ${r} ms, however ${n} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction`,{operation:t,timeout:r,timeTaken:n})}},Ot=class extends re{constructor(t){super(`Internal Consistency Error: ${t}`)}},Bn=class extends re{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var ng=100,Cr=L("prisma:client:transactionManager"),ig=()=>({sql:"COMMIT",args:[],argTypes:[]}),og=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),Ar=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n}async startTransaction(t){return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#e(t))}async#e(t){let r=t!==void 0?this.validateOptions(t):this.transactionOptions,n={id:await wu(),status:"waiting",timer:void 0,timeout:r.timeout,startedAt:Date.now(),transaction:void 0};this.transactions.set(n.id,n),n.timer=this.startTransactionTimeout(n.id,r.maxWait);let i=await this.driverAdapter.startTransaction(r.isolationLevel);switch(n.status){case"waiting":return n.transaction=i,clearTimeout(n.timer),n.timer=void 0,n.status="running",n.timer=this.startTransactionTimeout(n.id,r.timeout),{id:n.id};case"timed_out":throw new jn;case"running":case"committed":case"rolled_back":throw new Ot(`Transaction in invalid state ${n.status} although it just finished startup.`);default:$(n.status,"Unknown transaction status.")}}async commitTransaction(t){return await this.tracingHelper.runInChildSpan("commit_transaction",async()=>{let r=this.getActiveTransaction(t,"commit");await this.closeTransaction(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.getActiveTransaction(t,"rollback");await this.closeTransaction(r,"rolled_back")})}getTransaction(t,r){let n=this.getActiveTransaction(t.id,r);if(!n.transaction)throw new Tr;return n.transaction}getActiveTransaction(t,r){let n=this.transactions.get(t);if(!n){let i=this.closedTransactions.find(o=>o.id===t);if(i)switch(Cr("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"waiting":case"running":throw new Ot("Active transaction found in closed transactions list.");case"committed":throw new Vn(r);case"rolled_back":throw new qn(r);case"timed_out":throw new Un(r,{timeout:i.timeout,timeTaken:Date.now()-i.startedAt})}else throw Cr("Transaction not found.",t),new Tr}if(["committed","rolled_back","timed_out"].includes(n.status))throw new Ot("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.closeTransaction(t,"rolled_back")))}startTransactionTimeout(t,r){let n=Date.now();return setTimeout(async()=>{Cr("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let i=this.transactions.get(t);i&&["running","waiting"].includes(i.status)?await this.closeTransaction(i,"timed_out"):Cr("Transaction already committed or rolled back when timeout happened.",t)},r)}async closeTransaction(t,r){Cr("Closing transaction.",{transactionId:t.id,status:r}),t.status=r,t.transaction&&r==="committed"?(await t.transaction.commit(),t.transaction.options.usePhantomQuery||await t.transaction.executeRaw(ig())):t.transaction&&(await t.transaction.rollback(),t.transaction.options.usePhantomQuery||await t.transaction.executeRaw(og())),clearTimeout(t.timer),t.timer=void 0,this.transactions.delete(t.id),this.closedTransactions.push(t),this.closedTransactions.length>ng&&this.closedTransactions.shift()}validateOptions(t){if(!t.timeout)throw new re("timeout is required");if(!t.maxWait)throw new re("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new Bn(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}};var Qn="6.9.0-dev.7";var wo,Eu={async loadQueryCompiler(e){let{clientVersion:t,adapter:r,compilerWasm:n}=e;if(r===void 0)throw new k(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Rn().prettyName})`,t);if(n===void 0)throw new k("WASM query compiler was unexpectedly `undefined`",t);return wo===void 0&&(wo=(async()=>{let i=await n.getRuntime(),o=await n.getQueryCompilerWasmModule();if(o==null)throw new k("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let s={"./query_compiler_bg.js":i},a=new WebAssembly.Instance(o,s),l=a.exports.__wbindgen_start;return i.__wbg_set_wasm(a.exports),l(),i.QueryCompiler})()),await wo}};var bu="P2038",Hn=L("prisma:client:clientEngine"),Pu=globalThis;Pu.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new ee(e,Qn)}};var Dt=class{name="ClientEngine";queryCompiler;instantiateQueryCompilerPromise;QueryCompilerConstructor;queryCompilerLoader;adapterPromise;transactionManagerPromise;config;provider;datamodel;logEmitter;logQueries;logLevel;lastStartedQuery;tracingHelper;#e;constructor(t,r){if(!t.previewFeatures?.includes("driverAdapters"))throw new k("EngineType `client` requires the driverAdapters preview feature to be enabled.",t.clientVersion,bu);if(t.adapter)this.adapterPromise=t.adapter.connect(),this.provider=t.adapter.provider,Hn("Using driver adapter: %O",t.adapter);else throw new k("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,bu);this.queryCompilerLoader=r??Eu,this.config=t,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,t.enableDebugLogs&&(this.logLevel="debug"),this.logQueries&&(this.#e=n=>{this.logEmitter.emit("query",{...n,params:JSON.stringify(n.params),target:"ClientEngine"})}),this.transactionManagerPromise=this.adapterPromise.then(n=>new Ar({driverAdapter:n,transactionOptions:this.config.transactionOptions,tracingHelper:this.tracingHelper})),this.instantiateQueryCompilerPromise=this.instantiateQueryCompiler()}applyPendingMigrations(){throw new Error("Cannot call applyPendingMigrations on engine type client.")}async instantiateQueryCompiler(){if(!this.queryCompiler){this.QueryCompilerConstructor||(this.QueryCompilerConstructor=await this.queryCompilerLoader.loadQueryCompiler(this.config));try{this.#r(()=>{this.queryCompiler=new this.QueryCompilerConstructor({datamodel:this.datamodel,provider:this.provider,connectionInfo:{}})})}catch(t){throw this.#n(t)}}}#n(t){if(t instanceof ee)return t;try{let r=JSON.parse(t.message);return new k(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#t(t){if(t instanceof k)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new ee(xu(this,t.message),this.config.clientVersion);if(t instanceof re)return new B(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let r=JSON.parse(t);return new z(`${r.message}
71
+ `}var fr;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(fr||(fr={}));function $(e,t){throw new Error(t)}function Ct(e,t){return e===t||e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&Object.keys(e).length===Object.keys(t).length&&Object.keys(e).every(r=>Ct(e[r],t[r]))}function Za(e){switch(e){case"postgres":return"postgresql";case"mysql":return"mysql";case"sqlite":return"sqlite";default:$(e,`Unknown provider: ${e}`)}}function ji(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var gr=class extends Error{name="UserFacingError";code;meta;constructor(t,r,n){super(t),this.code=r,this.meta=n}toQueryResponseErrorObject(){return{error:this.message,user_facing_error:{is_panic:!1,message:this.message,meta:this.meta,error_code:this.code}}}};function Xa(e){if(!ji(e))throw e;let t=Qm(e),r=Hm(e);throw!t||!r?e:new gr(r,t,e)}function Qm(e){switch(e.cause.kind){case"AuthenticationFailed":return"P1000";case"DatabaseDoesNotExist":return"P1003";case"SocketTimeout":return"P1008";case"DatabaseAlreadyExists":return"P1009";case"DatabaseAccessDenied":return"P1010";case"LengthMismatch":return"P2000";case"UniqueConstraintViolation":return"P2002";case"ForeignKeyConstraintViolation":return"P2003";case"UnsupportedNativeDataType":return"P2010";case"NullConstraintViolation":return"P2011";case"TableDoesNotExist":return"P2021";case"ColumnNotFound":return"P2022";case"InvalidIsolationLevel":return"P2023";case"TransactionWriteConflict":return"P2034";case"GenericJs":return"P2036";case"TooManyConnections":return"P2037";case"postgres":case"sqlite":case"mysql":return;default:$(e.cause,`Unknown error: ${e.cause}`)}}function Hm(e){switch(e.cause.kind){case"AuthenticationFailed":return`Authentication failed against the database server, the provided database credentials for \`${e.cause.user??"(not available)"}\` are not valid`;case"DatabaseDoesNotExist":return`Database \`${e.cause.db??"(not available)"}\` does not exist on the database server`;case"SocketTimeout":return"Operation has timed out";case"DatabaseAlreadyExists":return`Database \`${e.cause.db??"(not available)"}\` already exists on the database server`;case"DatabaseAccessDenied":return`User was denied access on the database \`${e.cause.db??"(not available)"}\``;case"LengthMismatch":return`The provided value for the column is too long for the column's type. Column: ${e.cause.column??"(not available)"}`;case"UniqueConstraintViolation":return`Unique constraint failed on the ${Ui({fields:e.cause.fields})}`;case"ForeignKeyConstraintViolation":return`Foreign key constraint violated on the ${Ui(e.cause.constraint)}`;case"UnsupportedNativeDataType":return`Failed to deserialize column of type '${e.cause.type}'. If you're using $queryRaw and this column is explicitly marked as \`Unsupported\` in your Prisma schema, try casting this column to any supported Prisma type such as \`String\`.`;case"NullConstraintViolation":return`Null constraint violation on the ${Ui({fields:e.cause.fields})}`;case"TableDoesNotExist":return`The table \`${e.cause.table??"(not available)"}\` does not exist in the current database.`;case"ColumnNotFound":return`The column \`${e.cause.column??"(not available)"}\` does not exist in the current database.`;case"InvalidIsolationLevel":return`Invalid isolation level \`${e.cause.level}\``;case"TransactionWriteConflict":return"Transaction failed due to a write conflict or a deadlock. Please retry your transaction";case"GenericJs":return`Error in external connector (id ${e.cause.id})`;case"TooManyConnections":return`Too many database connections opened: ${e.cause.cause}`;case"sqlite":case"postgres":case"mysql":return;default:$(e.cause,`Unknown error: ${e.cause}`)}}function Ui(e){return e&&"fields"in e?`fields: (${e.fields.map(t=>`\`${t}\``).join(", ")})`:e&&"index"in e?`constraint: \`${e.index}\``:e&&"foreignKey"in e?"foreign key":"(not available)"}function tl(e,t){switch(t.type){case"Object":return rl(e,t.fields);case"Value":return Bi(e,t.resultType);default:$(t,`Invalid data mapping type: '${t.type}'`)}}function rl(e,t){if(e===null)return null;if(Array.isArray(e))return e.map(n=>el(n,t));if(typeof e=="object")return el(e,t);throw new Error(`DataMapper: Expected an array or an object, got: ${typeof e}`)}function el(e,t){if(typeof e!="object")throw new Error(`DataMapper: Expected an object, but got '${typeof e}'`);let r={};for(let[n,i]of Object.entries(t))switch(i.type){case"Object":{if(!i.flattened&&!Object.hasOwn(e,n))throw new Error(`DataMapper: Missing data field (Object): '${n}'; node: ${JSON.stringify(i)}; data: ${JSON.stringify(e)}`);let o=i.flattened?e:e[n];r[n]=rl(o,i.fields);break}case"Value":{let o=i.dbName;if(Object.hasOwn(e,o))r[n]=Bi(e[o],i.resultType);else throw new Error(`DataMapper: Missing data field (Value): '${o}'; node: ${JSON.stringify(i)}; data: ${JSON.stringify(e)}`)}break;default:$(i,`DataMapper: Invalid data mapping node type: '${i.type}'`)}return r}function Bi(e,t){if(e===null)return null;switch(t.type){case"Any":return e;case"String":return typeof e=="string"?e:`${e}`;case"Int":return typeof e=="number"?e:parseInt(`${e}`,10);case"BigInt":return typeof e=="bigint"?e:BigInt(`${e}`);case"Float":return typeof e=="number"?e:parseFloat(`${e}`);case"Boolean":return typeof e=="boolean"?e:e!=="0";case"Decimal":return typeof e=="number"?new se(e):new se(`${e}`);case"Date":return e instanceof Date?e:new Date(`${e}`);case"Array":return e.map(n=>Bi(n,t.inner));case"Object":return typeof e=="string"?e:JSON.stringify(e);case"Bytes":{if(!Array.isArray(e))throw new Error(`DataMapper: Bytes data is invalid, got: ${typeof e}`);return new Uint8Array(e)}default:$(t,`DataMapper: Unknown result type: ${t.type}`)}}function We(e,t){var r="000000000"+e;return r.substr(r.length-t)}var nl=q(require("node:os"),1);function Gm(){try{return nl.default.hostname()}catch{return process.env._CLUSTER_NETWORK_NAME_||process.env.COMPUTERNAME||"hostname"}}var il=2,Wm=We(process.pid.toString(36),il),ol=Gm(),Jm=ol.length,Km=We(ol.split("").reduce(function(e,t){return+e+t.charCodeAt(0)},+Jm+36).toString(36),il);function Qi(){return Wm+Km}function kn(e){return typeof e=="string"&&/^c[a-z0-9]{20,32}$/.test(e)}function Hi(e){let n=Math.pow(36,4),i=0;function o(){return We((Math.random()*n<<0).toString(36),4)}function s(){return i=i<n?i:0,i++,i-1}function a(){var l="c",u=new Date().getTime().toString(36),c=We(s().toString(36),4),p=e(),d=o()+o();return l+u+c+p+d}return a.fingerprint=e,a.isCuid=kn,a}var zm=Hi(Qi);var sl=zm;var ou=q(zl());var eo=require("node:crypto");var Yl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Lf=128,Ke,Rt;function $f(e){!Ke||Ke.length<e?(Ke=Buffer.allocUnsafe(e*Lf),eo.webcrypto.getRandomValues(Ke),Rt=0):Rt+e>Ke.length&&(eo.webcrypto.getRandomValues(Ke),Rt=0),Rt+=e}function to(e=21){$f(e|=0);let t="";for(let r=Rt-e;r<Rt;r++)t+=Yl[Ke[r]&63];return t}var xr=q(require("node:crypto"),1);var Xl="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Pr=32;var Vf=16,eu=10,Zl=0xffffffffffff;var ze;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(ze||(ze={}));var Ye=class extends Error{constructor(t,r){super(`${r} (${t})`),this.name="ULIDError",this.code=t}};function qf(e){let t=Math.floor(e()*Pr);return t===Pr&&(t=Pr-1),Xl.charAt(t)}function jf(e){let t=Uf(),r=t&&(t.crypto||t.msCrypto)||(typeof xr.default<"u"?xr.default:null);if(typeof r?.getRandomValues=="function")return()=>{let n=new Uint8Array(1);return r.getRandomValues(n),n[0]/255};if(typeof r?.randomBytes=="function")return()=>r.randomBytes(1).readUInt8()/255;if(xr.default?.randomBytes)return()=>xr.default.randomBytes(1).readUInt8()/255;throw new Ye(ze.PRNGDetectFailure,"Failed to find a reliable PRNG")}function Uf(){return Hf()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Bf(e,t){let r="";for(;e>0;e--)r=qf(t)+r;return r}function Qf(e,t=eu){if(isNaN(e))throw new Ye(ze.EncodeTimeValueMalformed,`Time must be a number: ${e}`);if(e>Zl)throw new Ye(ze.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${Zl}: ${e}`);if(e<0)throw new Ye(ze.EncodeTimeNegative,`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Ye(ze.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,n="";for(let i=t;i>0;i--)r=e%Pr,n=Xl.charAt(r)+n,e=(e-r)/Pr;return n}function Hf(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function tu(e,t){let r=t||jf(),n=!e||isNaN(e)?Date.now():e;return Qf(n,eu)+Bf(Vf,r)}var W=[];for(let e=0;e<256;++e)W.push((e+256).toString(16).slice(1));function _n(e,t=0){return(W[e[t+0]]+W[e[t+1]]+W[e[t+2]]+W[e[t+3]]+"-"+W[e[t+4]]+W[e[t+5]]+"-"+W[e[t+6]]+W[e[t+7]]+"-"+W[e[t+8]]+W[e[t+9]]+"-"+W[e[t+10]]+W[e[t+11]]+W[e[t+12]]+W[e[t+13]]+W[e[t+14]]+W[e[t+15]]).toLowerCase()}var ru=require("node:crypto"),Mn=new Uint8Array(256),Nn=Mn.length;function kt(){return Nn>Mn.length-16&&((0,ru.randomFillSync)(Mn),Nn=0),Mn.slice(Nn,Nn+=16)}var nu=require("node:crypto"),ro={randomUUID:nu.randomUUID};function Gf(e,t,r){if(ro.randomUUID&&!t&&!e)return ro.randomUUID();e=e||{};let n=e.random??e.rng?.()??kt();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let i=0;i<16;++i)t[r+i]=n[i];return t}return _n(n)}var no=Gf;var io={};function Wf(e,t,r){let n;if(e)n=iu(e.random??e.rng?.()??kt(),e.msecs,e.seq,t,r);else{let i=Date.now(),o=kt();Jf(io,i,o),n=iu(o,io.msecs,io.seq,t,r)}return t??_n(n)}function Jf(e,t,r){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function iu(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),r??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=t&255,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|e[10]&3,n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}var oo=Wf;var Fn=class{#e={};constructor(){this.register("now",new Ln),this.register("uuid",new so),this.register("cuid",new ao),this.register("ulid",new lo),this.register("nanoid",new uo),this.register("product",new co)}snapshot(){return Object.create(this.#e,{now:{value:new Ln}})}register(t,r){this.#e[t]=r}},Ln=class{#e=new Date;generate(){return this.#e.toISOString()}},so=class{generate(t){if(t===4)return no();if(t===7)return oo();throw new Error("Invalid UUID generator arguments")}},ao=class{generate(t){if(t===1)return sl();if(t===2)return(0,ou.createId)();throw new Error("Invalid CUID generator arguments")}},lo=class{generate(){return tu()}},uo=class{generate(t){if(typeof t=="number")return to(t);if(t===void 0)return to();throw new Error("Invalid Nanoid generator arguments")}},co=class{generate(t,r){if(t===void 0||r===void 0)throw new Error("Invalid Product generator arguments");return Array.isArray(t)&&Array.isArray(r)?t.flatMap(n=>r.map(i=>[n,i])):Array.isArray(t)?t.map(n=>[n,r]):Array.isArray(r)?r.map(n=>[t,n]):[[t,r]]}};function po(e){return typeof e=="object"&&e!==null&&e.prisma__type==="param"}function mo(e){return typeof e=="object"&&e!==null&&e.prisma__type==="generatorCall"}function su(e){return typeof e=="object"&&e!==null&&e.prisma__type==="bytes"}function ho(e,t,r){let n=e.type;switch(n){case"rawSql":return lu(e.sql,au(e.params,t,r));case"templateSql":return Kf(e.fragments,e.placeholderFormat,au(e.params,t,r));default:$(n,"Invalid query type")}}function au(e,t,r){return e.map(n=>go(n,t,r))}function go(e,t,r){let n=e;for(;Yf(n);)if(po(n)){let i=t[n.prisma__value.name];if(i===void 0)throw new Error(`Missing value for query variable ${n.prisma__value.name}`);n=i}else if(mo(n)){let{name:i,args:o}=n.prisma__value,s=r[i];if(!s)throw new Error(`Encountered an unknown generator '${i}'`);n=s.generate(...o.map(a=>go(a,t,r)))}else $(n,`Unexpected unevaluated value type: ${n}`);return Array.isArray(n)&&(n=n.map(i=>go(i,t,r))),su(n)&&(n=Buffer.from(n.prisma__value,"base64")),n}function Kf(e,t,r){let n=0,i=1,o=[],s=e.map(a=>{let l=a.type;switch(l){case"parameter":if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);return o.push(r[n++]),fo(t,i++);case"stringChunk":return a.value;case"parameterTuple":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++],c=Array.isArray(u)?u:[u];return`(${c.length==0?"NULL":c.map(d=>(o.push(d),fo(t,i++))).join(",")})`}case"parameterTupleList":{if(n>=r.length)throw new Error(`Malformed query template. Fragments attempt to read over ${r.length} parameters.`);let u=r[n++];if(!Array.isArray(u))throw new Error("Malformed query template. Tuple list expected.");if(u.length===0)throw new Error("Malformed query template. Tuple list cannot be empty.");return u.map(p=>{if(!Array.isArray(p))throw new Error("Malformed query template. Tuple expected.");return`(${p.map(m=>(o.push(m),fo(t,i++))).join(",")})`}).join(",")}default:$(l,"Invalid fragment type")}}).join("");return lu(s,o)}function fo(e,t){return e.hasNumbering?`${e.prefix}${t}`:e.prefix}function lu(e,t){let r=t.map(n=>zf(n));return{sql:e,args:t,argTypes:r}}function zf(e){return typeof e=="string"?"Text":typeof e=="number"?"Numeric":typeof e=="boolean"?"Boolean":Array.isArray(e)?"Array":Buffer.isBuffer(e)?"Bytes":"Unknown"}function Yf(e){return po(e)||mo(e)}function uu(e){return e.rows.map(t=>t.reduce((r,n,i)=>{let o=e.columnNames[i].split("."),s=r;for(let a=0;a<o.length;a++){let l=o[a];a===o.length-1?s[l]=n:(s[l]===void 0&&(s[l]={}),s=s[l])}return r},{}))}function cu(e,t,r){if(!t.every(n=>yo(e,n))){let n=Zf(e,r),i=Xf(r);throw new gr(n,i,r.context)}}function yo(e,t){switch(t.type){case"rowCountEq":return Array.isArray(e)?e.length===t.args:e===null?t.args===0:t.args===1;case"rowCountNeq":return Array.isArray(e)?e.length!==t.args:e===null?t.args!==0:t.args!==1;case"never":return!1;default:$(t,`Unknown rule type: ${t.type}`)}}function Zf(e,t){switch(t.error_identifier){case"RELATION_VIOLATION":return`The change you are trying to make would violate the required relation '${t.context.relation}' between the \`${t.context.modelA}\` and \`${t.context.modelB}\` models.`;case"MISSING_RECORD":return`An operation failed because it depends on one or more records that were required but not found. No record was found for ${t.context.operation}.`;case"MISSING_RELATED_RECORD":{let r=t.context.neededFor?` (needed to ${t.context.neededFor})`:"";return`An operation failed because it depends on one or more records that were required but not found. No '${t.context.model}' record${r} was found for ${t.context.operation} on ${t.context.relationType} relation '${t.context.relation}'.`}case"INCOMPLETE_CONNECT_INPUT":return`An operation failed because it depends on one or more records that were required but not found. Expected ${t.context.expectedRows} records to be connected, found only ${Array.isArray(e)?e.length:0}.`;case"RECORDS_NOT_CONNECTED":return`The records for relation \`${t.context.relation}\` between the \`${t.context.parent}\` and \`${t.context.child}\` models are not connected.`;default:$(t,`Unknown error identifier: ${t}`)}}function Xf(e){switch(e.error_identifier){case"RELATION_VIOLATION":return"P2014";case"RECORDS_NOT_CONNECTED":return"P2017";case"MISSING_RECORD":case"MISSING_RELATED_RECORD":case"INCOMPLETE_CONNECT_INPUT":return"P2025";default:$(e,`Unknown error identifier: ${e}`)}}var It=class e{#e;#n;#t;#i=new Fn;#r;#o;constructor({transactionManager:t,placeholderValues:r,onQuery:n,tracingHelper:i,serializer:o}){this.#e=t,this.#n=r,this.#t=n,this.#r=i,this.#o=o}static forSql(t){return new e({transactionManager:t.transactionManager,placeholderValues:t.placeholderValues,onQuery:t.onQuery,tracingHelper:t.tracingHelper,serializer:uu})}async run(t,r){return this.interpretNode(t,r,this.#n,this.#i.snapshot()).catch(n=>Xa(n))}async interpretNode(t,r,n,i){switch(t.type){case"seq":{let o=await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i)));return o[o.length-1]}case"get":return n[t.args.name];case"let":{let o=Object.create(n);for(let s of t.args.bindings)o[s.name]=await this.interpretNode(s.expr,r,o,i);return this.interpretNode(t.args.expr,r,o,i)}case"getFirstNonEmpty":{for(let o of t.args.names){let s=n[o];if(!pu(s))return s}return[]}case"concat":return(await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i)))).reduce((s,a)=>s.concat(vr(a)),[]);case"sum":return(await Promise.all(t.args.map(s=>this.interpretNode(s,r,n,i)))).reduce((s,a)=>du(s)+du(a));case"execute":{let o=ho(t.args,n,i);return this.#s(o,r,async()=>await r.executeRaw(o))}case"query":{let o=ho(t.args,n,i);return this.#s(o,r,async()=>this.#o(await r.queryRaw(o)))}case"reverse":{let o=await this.interpretNode(t.args,r,n,i);return Array.isArray(o)?o.reverse():o}case"unique":{let o=await this.interpretNode(t.args,r,n,i);if(!Array.isArray(o))return o;if(o.length>1)throw new Error(`Expected zero or one element, got ${o.length}`);return o[0]??null}case"required":{let o=await this.interpretNode(t.args,r,n,i);if(pu(o))throw new Error("Required value is empty");return o}case"mapField":{let o=await this.interpretNode(t.args.records,r,n,i);return yu(o,t.args.field)}case"join":{let o=await this.interpretNode(t.args.parent,r,n,i),s=await Promise.all(t.args.children.map(async a=>({joinExpr:a,childRecords:await this.interpretNode(a.child,r,n,i)})));if(Array.isArray(o)){for(let a of o)mu($n(a),s);return o}return mu($n(o),s)}case"transaction":{if(!this.#e.enabled)return this.interpretNode(t.args,r,n,i);let o=this.#e.manager,s=await o.startTransaction(),a=o.getTransaction(s,"query");try{let l=await this.interpretNode(t.args,a,n,i);return await o.commitTransaction(s.id),l}catch(l){throw await o.rollbackTransaction(s.id),l}}case"dataMap":{let o=await this.interpretNode(t.args.expr,r,n,i);return tl(o,t.args.structure)}case"validate":{let o=await this.interpretNode(t.args.expr,r,n,i);return cu(o,t.args.rules,t.args),o}case"if":{let o=await this.interpretNode(t.args.value,r,n,i);return yo(o,t.args.rule)?await this.interpretNode(t.args.then,r,n,i):await this.interpretNode(t.args.else,r,n,i)}case"unit":return;case"diff":{let o=await this.interpretNode(t.args.from,r,n,i),s=await this.interpretNode(t.args.to,r,n,i),a=new Set(vr(s));return vr(o).filter(l=>!a.has(l))}case"distinctBy":{let o=await this.interpretNode(t.args.expr,r,n,i),s=new Set,a=[];for(let l of vr(o)){let u=hu(l,t.args.fields);s.has(u)||(s.add(u),a.push(l))}return a}case"paginate":{let o=await this.interpretNode(t.args.expr,r,n,i),s=vr(o),a=t.args.pagination.linkingFields;if(a!==null){let l=new Map;for(let c of s){let p=hu(c,a);l.has(p)||l.set(p,[]),l.get(p).push(c)}let u=Array.from(l.entries());return u.sort(([c],[p])=>c<p?-1:c>p?1:0),u.flatMap(([,c])=>gu(c,t.args.pagination))}return gu(s,t.args.pagination)}default:$(t,`Unexpected node type: ${t.type}`)}}#s(t,r,n){return this.#r.runInChildSpan({name:"db_query",kind:fr.CLIENT,attributes:{"db.query.text":t.sql,"db.system.name":Za(r.provider)}},async()=>{let i=new Date,o=performance.now(),s=await n(),a=performance.now();return this.#t?.({timestamp:i,duration:a-o,query:t.sql,params:t.args}),s})}};function pu(e){return Array.isArray(e)?e.length===0:e==null}function vr(e){return Array.isArray(e)?e:[e]}function du(e){if(typeof e=="number")return e;if(typeof e=="string")return Number(e);throw new Error(`Expected number, got ${typeof e}`)}function $n(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Expected object, got ${typeof e}`)}function yu(e,t){return Array.isArray(e)?e.map(r=>yu(r,t)):typeof e=="object"&&e!==null?e[t]??null:e}function mu(e,t){for(let{joinExpr:r,childRecords:n}of t)e[r.parentField]=eg(n,e,r);return e}function eg(e,t,r){if(Array.isArray(e)){let n=e.filter(i=>fu($n(i),t,r));return r.isRelationUnique?n.length>0?n[0]:null:n}else{if(e===null)return null;{let n=$n(e);return fu(n,t,r)?n:null}}}function fu(e,t,r){for(let[n,i]of r.on)if(t[n]!==e[i])return!1;return!0}function gu(e,{cursor:t,skip:r,take:n}){let i=t!==null?e.findIndex(a=>tg(a,t)):0;if(i===-1)return[];let o=i+(r??0),s=n!==null?o+n:e.length;return e.slice(o,s)}function hu(e,t){return JSON.stringify(t.map(r=>e[r]))}function tg(e,t){return Object.keys(t).every(r=>typeof e[r]!=typeof t[r]&&(typeof e[r]=="number"||typeof t[r]=="number")?`${e[r]}`==`${t[r]}`:Ct(t[r],e[r]))}async function rg(){return globalThis.crypto??await import("node:crypto")}async function wu(){return(await rg()).randomUUID()}var re=class extends Error{constructor(r,n){super("Transaction API error: "+r);this.meta=n}code="P2028"},Tr=class extends re{constructor(){super("Transaction not found. Transaction ID is invalid, refers to an old closed transaction Prisma doesn't have information about anymore, or was obtained before disconnecting.")}},Vn=class extends re{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a committed transaction`)}},qn=class extends re{constructor(t){super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back`)}},jn=class extends re{constructor(){super("Unable to start a transaction in the given time.")}},Un=class extends re{constructor(t,{timeout:r,timeTaken:n}){super(`A ${t} cannot be executed on an expired transaction. The timeout for this transaction was ${r} ms, however ${n} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction`,{operation:t,timeout:r,timeTaken:n})}},Ot=class extends re{constructor(t){super(`Internal Consistency Error: ${t}`)}},Bn=class extends re{constructor(t){super(`Invalid isolation level: ${t}`,{isolationLevel:t})}};var ng=100,Cr=L("prisma:client:transactionManager"),ig=()=>({sql:"COMMIT",args:[],argTypes:[]}),og=()=>({sql:"ROLLBACK",args:[],argTypes:[]}),Ar=class{transactions=new Map;closedTransactions=[];driverAdapter;transactionOptions;tracingHelper;constructor({driverAdapter:t,transactionOptions:r,tracingHelper:n}){this.driverAdapter=t,this.transactionOptions=r,this.tracingHelper=n}async startTransaction(t){return await this.tracingHelper.runInChildSpan("start_transaction",()=>this.#e(t))}async#e(t){let r=t!==void 0?this.validateOptions(t):this.transactionOptions,n={id:await wu(),status:"waiting",timer:void 0,timeout:r.timeout,startedAt:Date.now(),transaction:void 0};this.transactions.set(n.id,n),n.timer=this.startTransactionTimeout(n.id,r.maxWait);let i=await this.driverAdapter.startTransaction(r.isolationLevel);switch(n.status){case"waiting":return n.transaction=i,clearTimeout(n.timer),n.timer=void 0,n.status="running",n.timer=this.startTransactionTimeout(n.id,r.timeout),{id:n.id};case"timed_out":throw new jn;case"running":case"committed":case"rolled_back":throw new Ot(`Transaction in invalid state ${n.status} although it just finished startup.`);default:$(n.status,"Unknown transaction status.")}}async commitTransaction(t){return await this.tracingHelper.runInChildSpan("commit_transaction",async()=>{let r=this.getActiveTransaction(t,"commit");await this.closeTransaction(r,"committed")})}async rollbackTransaction(t){return await this.tracingHelper.runInChildSpan("rollback_transaction",async()=>{let r=this.getActiveTransaction(t,"rollback");await this.closeTransaction(r,"rolled_back")})}getTransaction(t,r){let n=this.getActiveTransaction(t.id,r);if(!n.transaction)throw new Tr;return n.transaction}getActiveTransaction(t,r){let n=this.transactions.get(t);if(!n){let i=this.closedTransactions.find(o=>o.id===t);if(i)switch(Cr("Transaction already closed.",{transactionId:t,status:i.status}),i.status){case"waiting":case"running":throw new Ot("Active transaction found in closed transactions list.");case"committed":throw new Vn(r);case"rolled_back":throw new qn(r);case"timed_out":throw new Un(r,{timeout:i.timeout,timeTaken:Date.now()-i.startedAt})}else throw Cr("Transaction not found.",t),new Tr}if(["committed","rolled_back","timed_out"].includes(n.status))throw new Ot("Closed transaction found in active transactions map.");return n}async cancelAllTransactions(){await Promise.allSettled([...this.transactions.values()].map(t=>this.closeTransaction(t,"rolled_back")))}startTransactionTimeout(t,r){let n=Date.now();return setTimeout(async()=>{Cr("Transaction timed out.",{transactionId:t,timeoutStartedAt:n,timeout:r});let i=this.transactions.get(t);i&&["running","waiting"].includes(i.status)?await this.closeTransaction(i,"timed_out"):Cr("Transaction already committed or rolled back when timeout happened.",t)},r)}async closeTransaction(t,r){Cr("Closing transaction.",{transactionId:t.id,status:r}),t.status=r,t.transaction&&r==="committed"?(await t.transaction.commit(),t.transaction.options.usePhantomQuery||await t.transaction.executeRaw(ig())):t.transaction&&(await t.transaction.rollback(),t.transaction.options.usePhantomQuery||await t.transaction.executeRaw(og())),clearTimeout(t.timer),t.timer=void 0,this.transactions.delete(t.id),this.closedTransactions.push(t),this.closedTransactions.length>ng&&this.closedTransactions.shift()}validateOptions(t){if(!t.timeout)throw new re("timeout is required");if(!t.maxWait)throw new re("maxWait is required");if(t.isolationLevel==="SNAPSHOT")throw new Bn(t.isolationLevel);return{...t,timeout:t.timeout,maxWait:t.maxWait}}};var Qn="6.9.0-dev.8";var wo,Eu={async loadQueryCompiler(e){let{clientVersion:t,adapter:r,compilerWasm:n}=e;if(r===void 0)throw new k(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Rn().prettyName})`,t);if(n===void 0)throw new k("WASM query compiler was unexpectedly `undefined`",t);return wo===void 0&&(wo=(async()=>{let i=await n.getRuntime(),o=await n.getQueryCompilerWasmModule();if(o==null)throw new k("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let s={"./query_compiler_bg.js":i},a=new WebAssembly.Instance(o,s),l=a.exports.__wbindgen_start;return i.__wbg_set_wasm(a.exports),l(),i.QueryCompiler})()),await wo}};var bu="P2038",Hn=L("prisma:client:clientEngine"),Pu=globalThis;Pu.PRISMA_WASM_PANIC_REGISTRY={set_message(e){throw new ee(e,Qn)}};var Dt=class{name="ClientEngine";queryCompiler;instantiateQueryCompilerPromise;QueryCompilerConstructor;queryCompilerLoader;adapterPromise;transactionManagerPromise;config;provider;datamodel;logEmitter;logQueries;logLevel;lastStartedQuery;tracingHelper;#e;constructor(t,r){if(!t.previewFeatures?.includes("driverAdapters"))throw new k("EngineType `client` requires the driverAdapters preview feature to be enabled.",t.clientVersion,bu);if(t.adapter)this.adapterPromise=t.adapter.connect(),this.provider=t.adapter.provider,Hn("Using driver adapter: %O",t.adapter);else throw new k("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.",t.clientVersion,bu);this.queryCompilerLoader=r??Eu,this.config=t,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,t.enableDebugLogs&&(this.logLevel="debug"),this.logQueries&&(this.#e=n=>{this.logEmitter.emit("query",{...n,params:JSON.stringify(n.params),target:"ClientEngine"})}),this.transactionManagerPromise=this.adapterPromise.then(n=>new Ar({driverAdapter:n,transactionOptions:this.config.transactionOptions,tracingHelper:this.tracingHelper})),this.instantiateQueryCompilerPromise=this.instantiateQueryCompiler()}applyPendingMigrations(){throw new Error("Cannot call applyPendingMigrations on engine type client.")}async instantiateQueryCompiler(){if(!this.queryCompiler){this.QueryCompilerConstructor||(this.QueryCompilerConstructor=await this.queryCompilerLoader.loadQueryCompiler(this.config));try{this.#r(()=>{this.queryCompiler=new this.QueryCompilerConstructor({datamodel:this.datamodel,provider:this.provider,connectionInfo:{}})})}catch(t){throw this.#n(t)}}}#n(t){if(t instanceof ee)return t;try{let r=JSON.parse(t.message);return new k(r.message,this.config.clientVersion,r.error_code)}catch{return t}}#t(t){if(t instanceof k)return t;if(t.code==="GenericFailure"&&t.message?.startsWith("PANIC:"))return new ee(xu(this,t.message),this.config.clientVersion);if(t instanceof re)return new B(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion});try{let r=JSON.parse(t);return new z(`${r.message}
72
72
  ${r.backtrace}`,{clientVersion:this.config.clientVersion})}catch{return t}}#i(t){return t instanceof ee?t:typeof t.message=="string"&&typeof t.code=="string"?new B(t.message,{code:t.code,meta:t.meta,clientVersion:this.config.clientVersion}):t}#r(t){let r=Pu.PRISMA_WASM_PANIC_REGISTRY.set_message,n;global.PRISMA_WASM_PANIC_REGISTRY.set_message=i=>{n=i};try{return t()}finally{if(global.PRISMA_WASM_PANIC_REGISTRY.set_message=r,n)throw new ee(xu(this,n),this.config.clientVersion)}}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the client engine, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){await this.tracingHelper.runInChildSpan("connect",()=>this.ensureStarted())}async stop(){await this.tracingHelper.runInChildSpan("disconnect",async()=>{await this.instantiateQueryCompilerPromise,await(await this.transactionManagerPromise)?.cancelAllTransactions(),await(await this.adapterPromise).dispose()})}async ensureStarted(){let t=await this.adapterPromise,r=await this.transactionManagerPromise;return await this.instantiateQueryCompilerPromise,[t,r]}version(){return"unknown"}async transaction(t,r,n){let i,o=await this.transactionManagerPromise;try{if(t==="start"){let s=n;i=await o.startTransaction(s)}else if(t==="commit"){let s=n;await o.commitTransaction(s.id)}else if(t==="rollback"){let s=n;await o.rollbackTransaction(s.id)}else de(t,"Invalid transaction action.")}catch(s){throw this.#t(s)}return i?{id:i.id,payload:void 0}:void 0}async request(t,{traceparent:r,interactiveTransaction:n}){Hn("sending request");let i=JSON.stringify(t);this.lastStartedQuery=i;let[o,s]=await this.ensureStarted().catch(l=>{throw this.#t(l)}),a;try{a=this.#r(()=>this.queryCompiler.compile(i))}catch(l){throw this.#i(l)}try{let l=JSON.parse(a);Hn("query plan created",a);let u=n?s.getTransaction(n,"query"):o,c=n?{enabled:!1}:{enabled:!0,manager:s},p={},m=await It.forSql({transactionManager:c,placeholderValues:p,onQuery:this.#e,tracingHelper:this.tracingHelper}).run(l,u);return Hn("query plan executed"),{data:{[t.action]:m}}}catch(l){throw this.#t(l)}}async requestBatch(t,{transaction:r,traceparent:n}){if(t.length===0)return[];let i=t[0].action,o=JSON.stringify(vt(t,r));this.lastStartedQuery=o;let[,s]=await this.ensureStarted().catch(l=>{throw this.#t(l)}),a;try{a=this.queryCompiler.compileBatch(o)}catch(l){throw this.#i(l)}try{let l;if(r?.kind==="itx")l=r.options;else{let m=r?.options.isolationLevel?{...this.config.transactionOptions,isolationLevel:r.options.isolationLevel}:this.config.transactionOptions;l=await this.transaction("start",{},m)}let u={},c=It.forSql({transactionManager:{enabled:!1},placeholderValues:u,onQuery:this.#e,tracingHelper:this.tracingHelper}),p=s.getTransaction(l,"batch query"),d=[];switch(a.type){case"multi":{d=await Promise.all(a.plans.map(async(m,g)=>{let h=await c.run(m,p);return{data:{[t[g].action]:h}}}));break}case"compacted":{if(!t.every(g=>g.action===i))throw new Error("All queries in a batch must have the same action");let m=await c.run(a.plan,p);d=this.#o(m,a,i);break}}return r?.kind!=="itx"&&await this.transaction("commit",{},l),d}catch(l){throw this.#t(l)}}metrics(t){throw new Error("Method not implemented.")}#o(t,r,n){let i=t.map(s=>r.keys.reduce((a,l)=>(a[l]=s[l],a),{})),o=new Set(r.nestedSelection);return r.arguments.map(s=>{let a=i.findIndex(l=>ag(l,s));if(a===-1)return r.expectNonEmpty?new B("An operation failed because it depends on one or more records that were required but not found",{code:"P2025",clientVersion:this.config.clientVersion}):{data:{[n]:null}};{let l=Object.entries(t[a]).filter(([u])=>o.has(u));return{data:{[n]:Object.fromEntries(l)}}}})}};function xu(e,t){return Ya({binaryTarget:void 0,title:t,version:e.config.clientVersion,engineVersion:"unknown",database:e.config.activeProvider,query:e.lastStartedQuery})}function ag(e,t){let r=Object.keys(e),n=Object.keys(t);return(r.length<n.length?r:n).every(o=>Ct(e[o],t[o]))}function _t({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 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}var Gn=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var le=class extends Gn{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function A(e,t){return{...e,isRetryable:t}}var Nt=class extends le{name="ForcedRetryError";code="P5001";constructor(t){super("This request must be retried",A(t,!0))}};x(Nt,"ForcedRetryError");var Ze=class extends le{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,A(r,!1))}};x(Ze,"InvalidDatasourceError");var Xe=class extends le{name="NotImplementedYetError";code="P5004";constructor(t,r){super(t,A(r,!1))}};x(Xe,"NotImplementedYetError");var M=class extends le{response;constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var et=class extends M{name="SchemaMissingError";code="P5005";constructor(t){super("Schema needs to be uploaded",A(t,!0))}};x(et,"SchemaMissingError");var Eo="This request could not be understood by the server",Sr=class extends M{name="BadRequestError";code="P5000";constructor(t,r,n){super(r||Eo,A(t,!1)),n&&(this.code=n)}};x(Sr,"BadRequestError");var Rr=class extends M{name="HealthcheckTimeoutError";code="P5013";logs;constructor(t,r){super("Engine not started: healthcheck timeout",A(t,!0)),this.logs=r}};x(Rr,"HealthcheckTimeoutError");var kr=class extends M{name="EngineStartupError";code="P5014";logs;constructor(t,r,n){super(r,A(t,!0)),this.logs=n}};x(kr,"EngineStartupError");var Ir=class extends M{name="EngineVersionNotSupportedError";code="P5012";constructor(t){super("Engine version is not supported",A(t,!1))}};x(Ir,"EngineVersionNotSupportedError");var bo="Request timed out",Or=class extends M{name="GatewayTimeoutError";code="P5009";constructor(t,r=bo){super(r,A(t,!1))}};x(Or,"GatewayTimeoutError");var lg="Interactive transaction error",Dr=class extends M{name="InteractiveTransactionError";code="P5015";constructor(t,r=lg){super(r,A(t,!1))}};x(Dr,"InteractiveTransactionError");var ug="Request parameters are invalid",_r=class extends M{name="InvalidRequestError";code="P5011";constructor(t,r=ug){super(r,A(t,!1))}};x(_r,"InvalidRequestError");var xo="Requested resource does not exist",Nr=class extends M{name="NotFoundError";code="P5003";constructor(t,r=xo){super(r,A(t,!1))}};x(Nr,"NotFoundError");var Po="Unknown server error",Mt=class extends M{name="ServerError";code="P5006";logs;constructor(t,r,n){super(r||Po,A(t,!0)),this.logs=n}};x(Mt,"ServerError");var vo="Unauthorized, check your connection string",Mr=class extends M{name="UnauthorizedError";code="P5007";constructor(t,r=vo){super(r,A(t,!1))}};x(Mr,"UnauthorizedError");var To="Usage exceeded, retry again later",Fr=class extends M{name="UsageExceededError";code="P5008";constructor(t,r=To){super(r,A(t,!0))}};x(Fr,"UsageExceededError");async function cg(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Lr(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await cg(e);if(n.type==="QueryEngineError")throw new B(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Mt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new et(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Ir(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new kr(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new k(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Rr(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Dr(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new _r(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Mr(r,Ft(vo,n));if(e.status===404)return new Nr(r,Ft(xo,n));if(e.status===429)throw new Fr(r,Ft(To,n));if(e.status===504)throw new Or(r,Ft(bo,n));if(e.status>=500)throw new Mt(r,Ft(Po,n));if(e.status>=400)throw new Sr(r,Ft(Eo,n))}function Ft(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}function vu(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}var Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Tu(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=t[p]<<16|t[p+1]<<8|t[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,r+=Ie[s]+Ie[a]+Ie[l]+Ie[u];return i==1?(c=t[o],s=(c&252)>>2,a=(c&3)<<4,r+=Ie[s]+Ie[a]+"=="):i==2&&(c=t[o]<<8|t[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,r+=Ie[s]+Ie[a]+Ie[l]+"="),r}function Cu(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new k("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function pg(e){return e[0]*1e3+e[1]/1e6}function Co(e){return new Date(pg(e))}var Au={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.8.0-43.2060c79ba17c6bb9f5823312b6f6b7f4a845738e","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var $r=class extends le{name="RequestError";code="P5010";constructor(t,r){super(`Cannot fetch data from service:
73
73
  ${t}`,A(r,!0))}};x($r,"RequestError");async function tt(e,t,r=n=>n){let{clientVersion:n,...i}=t,o=r(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new $r(a,{clientVersion:n,cause:s})}}var mg=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Su=L("prisma:client:dataproxyEngine");async function fg(e,t){let r=Au["@prisma/engines-version"],n=t.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION||globalThis.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION||globalThis.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&mg.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){let[s]=r.split("-")??[],[a,l,u]=s.split("."),c=gg(`<=${a}.${l}.${u}`),p=await tt(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||"<empty body>"}`);let d=await p.text();Su("length of body fetched from unpkg.com",d.length);let m;try{m=JSON.parse(d)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),g}return m.version}throw new Xe("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Ru(e,t){let r=await fg(e,t);return Su("version",r),r}function gg(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var ku=3,Vr=L("prisma:client:dataproxyEngine"),Ao=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},qr=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;protocol;constructor(t){Cu(t),this.config=t,this.env={...t.env,...typeof process<"u"?process.env:{}},this.inlineSchema=Tu(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let{apiKey:t,url:r}=this.getURLAndAPIKey();this.host=r.host,this.headerBuilder=new Ao({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.protocol=ai(r)?"http":"https",this.remoteClientVersion=await Ru(this.host,this.config),Vr("host",this.host),Vr("protocol",this.protocol)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"trace":Vr(r);break;case"error":case"warn":case"info":{this.logEmitter.emit(r.level,{timestamp:Co(r.timestamp),message:r.attributes.message??"",target:r.target});break}case"query":{this.logEmitter.emit("query",{query:r.attributes.query??"",timestamp:Co(r.timestamp),duration:r.attributes.duration_ms??0,params:r.attributes.params??"",target:r.target});break}default:r.level}}),t?.traces?.length&&this.tracingHelper.dispatchEngineSpans(t.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`${this.protocol}://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await tt(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Vr("schema response status",r.status);let n=await Lr(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=vt(t,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await tt(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Vr("graphql response status",a.status),await this.handleError(await Lr(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await tt(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Lr(l,this.clientVersion));let u=await l.json(),{extensions:c}=u;c&&this.propagateResponseExtensions(c);let p=u.id,d=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:d}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await tt(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Lr(a,this.clientVersion));let l=await a.json(),{extensions:u}=l;u&&this.propagateResponseExtensions(u);return}}})}getURLAndAPIKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=_t({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new Ze(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,searchParams:s}=i;if(o!=="prisma:"&&o!==Qr)throw new Ze(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\` or \`prisma+postgres://\``,t);let a=s.get("api_key");if(a===null||a.length<1)throw new Ze(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return{apiKey:a,url:i}}metrics(){throw new Xe("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof le)||!i.isRetryable)throw i;if(r>=ku)throw i instanceof Nt?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${ku} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await vu(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof et)throw await this.uploadSchema(),new Nt({clientVersion:this.clientVersion,cause:t});if(t)throw t}convertProtocolErrorsToClientError(t){return t.length===1?Cn(t[0],this.config.clientVersion,this.config.activeProvider):new z(JSON.stringify(t),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Iu({copyEngine:e=!0},t){let r;try{r=_t({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||Hr(r));e&&n&&Kt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=ot(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary",u=i==="client";if(o&&s||s&&!1){let c;throw e?r?.startsWith("prisma://")?c=["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."]:c=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:c=["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 Y(c.join(`
74
74
  `),{clientVersion:t.clientVersion})}return o?new qr(t):u?new Dt(t):new Dt(t)}function Wn({generator:e}){return e?.previewFeatures??[]}var Ou=e=>({command:e});var Du=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);function Lt(e){try{return _u(e,"fast")}catch{return _u(e,"slow")}}function _u(e,t){return JSON.stringify(e.map(r=>Mu(r,t)))}function Mu(e,t){if(Array.isArray(e))return e.map(r=>Mu(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(pt(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(se.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(hg(e))return{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:r,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:Buffer.from(r,n,i).toString("base64")}}return typeof e=="object"&&t==="slow"?Fu(e):e}function hg(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Fu(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Nu);let t={};for(let r of Object.keys(e))t[r]=Nu(e[r]);return t}function Nu(e){return typeof e=="bigint"?e.toString():Fu(e)}var yg=/^(\s*alter\s)/i,Lu=L("prisma:client");function So(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&yg.exec(t))throw new Error(`Running ALTER using ${n} is not supported