diff --git a/integration-tests/tests/prisma/mysql/client/default.d.ts b/integration-tests/tests/prisma/mysql/client/default.d.ts deleted file mode 100644 index 34c616106..000000000 --- a/integration-tests/tests/prisma/mysql/client/default.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './index' \ No newline at end of file diff --git a/integration-tests/tests/prisma/mysql/client/default.js b/integration-tests/tests/prisma/mysql/client/default.js deleted file mode 100644 index fa52f0cd2..000000000 --- a/integration-tests/tests/prisma/mysql/client/default.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { ...require('.') } \ No newline at end of file diff --git a/integration-tests/tests/prisma/mysql/client/edge.d.ts b/integration-tests/tests/prisma/mysql/client/edge.d.ts deleted file mode 100644 index 479a9ab23..000000000 --- a/integration-tests/tests/prisma/mysql/client/edge.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './default' \ No newline at end of file diff --git a/integration-tests/tests/prisma/mysql/client/edge.js b/integration-tests/tests/prisma/mysql/client/edge.js deleted file mode 100644 index 60a9129e9..000000000 --- a/integration-tests/tests/prisma/mysql/client/edge.js +++ /dev/null @@ -1,179 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - PrismaClientKnownRequestError, - PrismaClientUnknownRequestError, - PrismaClientRustPanicError, - PrismaClientInitializationError, - PrismaClientValidationError, - NotFoundError, - getPrismaClient, - sqltag, - empty, - join, - raw, - Decimal, - Debug, - objectEnumValues, - makeStrictEnum, - Extensions, - warnOnce, - defineDmmfProperty, - Public, - getRuntime -} = require('./runtime/edge.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; -Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError -Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError -Prisma.PrismaClientInitializationError = PrismaClientInitializationError -Prisma.PrismaClientValidationError = PrismaClientValidationError -Prisma.NotFoundError = NotFoundError -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = sqltag -Prisma.empty = empty -Prisma.join = join -Prisma.raw = raw -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = Extensions.getExtensionContext -Prisma.defineExtension = Extensions.defineExtension - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - - - -/** - * Enums - */ -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; -/** - * Create the Client - */ -const config = { - "generator": { - "name": "client", - "provider": { - "fromEnvVar": null, - "value": "prisma-client-js" - }, - "output": { - "value": "/home/prodrigues/Desktop/summer-hackathon-s2-drizzle-orm/integration-tests/tests/prisma/mysql/client", - "fromEnvVar": null - }, - "config": { - "engineType": "library" - }, - "binaryTargets": [ - { - "fromEnvVar": null, - "value": "debian-openssl-3.0.x", - "native": true - } - ], - "previewFeatures": [], - "isCustomOutput": true - }, - "relativeEnvPaths": { - "rootEnvPath": null - }, - "relativePath": "..", - "clientVersion": "5.14.0", - "engineVersion": "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48", - "datasourceNames": [ - "db" - ], - "activeProvider": "mysql", - "postinstall": false, - "inlineDatasources": { - "db": { - "url": { - "fromEnvVar": "MYSQL_CONNECTION_STRING", - "value": null - } - } - }, - "inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n output = \"./client\"\n}\n\ngenerator drizzle {\n provider = \"drizzle-prisma-generator\"\n output = \"./drizzle\"\n}\n\ndatasource db {\n provider = \"mysql\"\n url = env(\"MYSQL_CONNECTION_STRING\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n}\n", - "inlineSchemaHash": "6e8dd18636337105b6f81492024552e63b9b9a29a0cadb79231c945267c145fa", - "copyEngine": true -} -config.dirname = '/' - -config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") -defineDmmfProperty(exports.Prisma, config.runtimeDataModel) -config.engineWasm = undefined - -config.injectableEdgeEnv = () => ({ - parsed: { - MYSQL_CONNECTION_STRING: typeof globalThis !== 'undefined' && globalThis['MYSQL_CONNECTION_STRING'] || typeof process !== 'undefined' && process.env && process.env.MYSQL_CONNECTION_STRING || undefined - } -}) - -if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) { - Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) -} - -const PrismaClient = getPrismaClient(config) -exports.PrismaClient = PrismaClient -Object.assign(exports, Prisma) - diff --git a/integration-tests/tests/prisma/mysql/client/index-browser.js b/integration-tests/tests/prisma/mysql/client/index-browser.js deleted file mode 100644 index 21e772f9b..000000000 --- a/integration-tests/tests/prisma/mysql/client/index-browser.js +++ /dev/null @@ -1,172 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - Decimal, - objectEnumValues, - makeStrictEnum, - Public, - getRuntime, -} = require('./runtime/index-browser.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)}; -Prisma.PrismaClientUnknownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientRustPanicError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientInitializationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientValidationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.NotFoundError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.empty = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.join = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.raw = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.defineExtension = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - -/** - * Enums - */ - -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; - -/** - * This is a stub Prisma Client that will error at runtime if called. - */ -class PrismaClient { - constructor() { - return new Proxy(this, { - get(target, prop) { - let message - const runtime = getRuntime() - if (runtime.isEdge) { - message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: -- Use Prisma Accelerate: https://pris.ly/d/accelerate -- Use Driver Adapters: https://pris.ly/d/driver-adapters -`; - } else { - message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).' - } - - message += ` -If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report` - - throw new Error(message) - } - }) - } -} - -exports.PrismaClient = PrismaClient - -Object.assign(exports, Prisma) diff --git a/integration-tests/tests/prisma/mysql/client/index.d.ts b/integration-tests/tests/prisma/mysql/client/index.d.ts deleted file mode 100644 index 398ce150c..000000000 --- a/integration-tests/tests/prisma/mysql/client/index.d.ts +++ /dev/null @@ -1,2166 +0,0 @@ - -/** - * Client -**/ - -import * as runtime from './runtime/library.js'; -import $Types = runtime.Types // general types -import $Public = runtime.Types.Public -import $Utils = runtime.Types.Utils -import $Extensions = runtime.Types.Extensions -import $Result = runtime.Types.Result - -export type PrismaPromise = $Public.PrismaPromise - - -/** - * Model User - * - */ -export type User = $Result.DefaultSelection - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ -export class PrismaClient< - T extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, - U = 'log' extends keyof T ? T['log'] extends Array ? Prisma.GetEvents : never : never, - ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs -> { - [K: symbol]: { types: Prisma.TypeMap['other'] } - - /** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ - - constructor(optionsArg ?: Prisma.Subset); - $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): void; - - /** - * Connect with the database - */ - $connect(): $Utils.JsPromise; - - /** - * Disconnect from the database - */ - $disconnect(): $Utils.JsPromise; - - /** - * Add a middleware - * @deprecated since 4.16.0. For new code, prefer client extensions instead. - * @see https://pris.ly/d/extensions - */ - $use(cb: Prisma.Middleware): void - -/** - * Executes a prepared raw query and returns the number of affected rows. - * @example - * ``` - * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};` - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Executes a raw query and returns the number of affected rows. - * Susceptible to SQL injections, see documentation. - * @example - * ``` - * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a prepared raw query and returns the `SELECT` data. - * @example - * ``` - * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};` - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a raw query and returns the `SELECT` data. - * Susceptible to SQL injections, see documentation. - * @example - * ``` - * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; - - /** - * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole. - * @example - * ``` - * const [george, bob, alice] = await prisma.$transaction([ - * prisma.user.create({ data: { name: 'George' } }), - * prisma.user.create({ data: { name: 'Bob' } }), - * prisma.user.create({ data: { name: 'Alice' } }), - * ]) - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions). - */ - $transaction

[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise> - - $transaction(fn: (prisma: Omit) => $Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise - - - $extends: $Extensions.ExtendsHook<'extends', Prisma.TypeMapCb, ExtArgs> - - /** - * `prisma.user`: Exposes CRUD operations for the **User** model. - * Example usage: - * ```ts - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - */ - get user(): Prisma.UserDelegate; -} - -export namespace Prisma { - export import DMMF = runtime.DMMF - - export type PrismaPromise = $Public.PrismaPromise - - /** - * Validator - */ - export import validator = runtime.Public.validator - - /** - * Prisma Errors - */ - export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError - export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError - export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError - export import PrismaClientInitializationError = runtime.PrismaClientInitializationError - export import PrismaClientValidationError = runtime.PrismaClientValidationError - export import NotFoundError = runtime.NotFoundError - - /** - * Re-export of sql-template-tag - */ - export import sql = runtime.sqltag - export import empty = runtime.empty - export import join = runtime.join - export import raw = runtime.raw - export import Sql = runtime.Sql - - /** - * Decimal.js - */ - export import Decimal = runtime.Decimal - - export type DecimalJsLike = runtime.DecimalJsLike - - /** - * Metrics - */ - export type Metrics = runtime.Metrics - export type Metric = runtime.Metric - export type MetricHistogram = runtime.MetricHistogram - export type MetricHistogramBucket = runtime.MetricHistogramBucket - - /** - * Extensions - */ - export import Extension = $Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = $Public.Args - export import Payload = $Public.Payload - export import Result = $Public.Result - export import Exact = $Public.Exact - - /** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ - export type PrismaVersion = { - client: string - } - - export const prismaVersion: PrismaVersion - - /** - * Utility Types - */ - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON object. - * This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. - */ - export type JsonObject = {[Key in string]?: JsonValue} - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON array. - */ - export interface JsonArray extends Array {} - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches any valid JSON value. - */ - export type JsonValue = string | number | boolean | JsonObject | JsonArray | null - - /** - * Matches a JSON object. - * Unlike `JsonObject`, this type allows undefined and read-only properties. - */ - export type InputJsonObject = {readonly [Key in string]?: InputJsonValue | null} - - /** - * Matches a JSON array. - * Unlike `JsonArray`, readonly arrays are assignable to this type. - */ - export interface InputJsonArray extends ReadonlyArray {} - - /** - * Matches any valid value that can be used as an input for operations like - * create and update as the value of a JSON field. Unlike `JsonValue`, this - * type allows read-only arrays and read-only object properties and disallows - * `null` at the top level. - * - * `null` cannot be used as the value of a JSON field because its meaning - * would be ambiguous. Use `Prisma.JsonNull` to store the JSON null value or - * `Prisma.DbNull` to clear the JSON value and set the field to the database - * NULL value instead. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values - */ - export type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | { toJSON(): unknown } - - /** - * Types of the values used to represent different kinds of `null` values when working with JSON fields. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - namespace NullTypes { - /** - * Type of `Prisma.DbNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.DbNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class DbNull { - private DbNull: never - private constructor() - } - - /** - * Type of `Prisma.JsonNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.JsonNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class JsonNull { - private JsonNull: never - private constructor() - } - - /** - * Type of `Prisma.AnyNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.AnyNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class AnyNull { - private AnyNull: never - private constructor() - } - } - - /** - * Helper for filtering JSON entries that have `null` on the database (empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const DbNull: NullTypes.DbNull - - /** - * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const JsonNull: NullTypes.JsonNull - - /** - * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const AnyNull: NullTypes.AnyNull - - type SelectAndInclude = { - select: any - include: any - } - - type SelectAndOmit = { - select: any - omit: any - } - - /** - * Get the type of the value, that the Promise holds. - */ - export type PromiseType> = T extends PromiseLike ? U : T; - - /** - * Get the return type of a function which returns a Promise. - */ - export type PromiseReturnType $Utils.JsPromise> = PromiseType> - - /** - * From T, pick a set of properties whose keys are in the union K - */ - type Prisma__Pick = { - [P in K]: T[P]; - }; - - - export type Enumerable = T | Array; - - export type RequiredKeys = { - [K in keyof T]-?: {} extends Prisma__Pick ? never : K - }[keyof T] - - export type TruthyKeys = keyof { - [K in keyof T as T[K] extends false | undefined | null ? never : K]: K - } - - export type TrueKeys = TruthyKeys>> - - /** - * Subset - * @desc From `T` pick properties that exist in `U`. Simple version of Intersection - */ - export type Subset = { - [key in keyof T]: key extends keyof U ? T[key] : never; - }; - - /** - * SelectSubset - * @desc From `T` pick properties that exist in `U`. Simple version of Intersection. - * Additionally, it validates, if both select and include are present. If the case, it errors. - */ - export type SelectSubset = { - [key in keyof T]: key extends keyof U ? T[key] : never - } & - (T extends SelectAndInclude - ? 'Please either choose `select` or `include`.' - : T extends SelectAndOmit - ? 'Please either choose `select` or `omit`.' - : {}) - - /** - * Subset + Intersection - * @desc From `T` pick properties that exist in `U` and intersect `K` - */ - export type SubsetIntersection = { - [key in keyof T]: key extends keyof U ? T[key] : never - } & - K - - type Without = { [P in Exclude]?: never }; - - /** - * XOR is needed to have a real mutually exclusive union type - * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types - */ - type XOR = - T extends object ? - U extends object ? - (Without & U) | (Without & T) - : U : T - - - /** - * Is T a Record? - */ - type IsObject = T extends Array - ? False - : T extends Date - ? False - : T extends Uint8Array - ? False - : T extends BigInt - ? False - : T extends object - ? True - : False - - - /** - * If it's T[], return T - */ - export type UnEnumerate = T extends Array ? U : T - - /** - * From ts-toolbelt - */ - - type __Either = Omit & - { - // Merge all but K - [P in K]: Prisma__Pick // With K possibilities - }[K] - - type EitherStrict = Strict<__Either> - - type EitherLoose = ComputeRaw<__Either> - - type _Either< - O extends object, - K extends Key, - strict extends Boolean - > = { - 1: EitherStrict - 0: EitherLoose - }[strict] - - type Either< - O extends object, - K extends Key, - strict extends Boolean = 1 - > = O extends unknown ? _Either : never - - export type Union = any - - type PatchUndefined = { - [K in keyof O]: O[K] extends undefined ? At : O[K] - } & {} - - /** Helper Types for "Merge" **/ - export type IntersectOf = ( - U extends unknown ? (k: U) => void : never - ) extends (k: infer I) => void - ? I - : never - - export type Overwrite = { - [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; - } & {}; - - type _Merge = IntersectOf; - }>>; - - type Key = string | number | symbol; - type AtBasic = K extends keyof O ? O[K] : never; - type AtStrict = O[K & keyof O]; - type AtLoose = O extends unknown ? AtStrict : never; - export type At = { - 1: AtStrict; - 0: AtLoose; - }[strict]; - - export type ComputeRaw = A extends Function ? A : { - [K in keyof A]: A[K]; - } & {}; - - export type OptionalFlat = { - [K in keyof O]?: O[K]; - } & {}; - - type _Record = { - [P in K]: T; - }; - - // cause typescript not to expand types and preserve names - type NoExpand = T extends unknown ? T : never; - - // this type assumes the passed object is entirely optional - type AtLeast = NoExpand< - O extends unknown - ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | {[P in keyof O as P extends K ? K : never]-?: O[P]} & O - : never>; - - type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; - - export type Strict = ComputeRaw<_Strict>; - /** End Helper Types for "Merge" **/ - - export type Merge = ComputeRaw<_Merge>>; - - /** - A [[Boolean]] - */ - export type Boolean = True | False - - // /** - // 1 - // */ - export type True = 1 - - /** - 0 - */ - export type False = 0 - - export type Not = { - 0: 1 - 1: 0 - }[B] - - export type Extends = [A1] extends [never] - ? 0 // anything `never` is false - : A1 extends A2 - ? 1 - : 0 - - export type Has = Not< - Extends, U1> - > - - export type Or = { - 0: { - 0: 0 - 1: 1 - } - 1: { - 0: 1 - 1: 1 - } - }[B1][B2] - - export type Keys = U extends unknown ? keyof U : never - - type Cast = A extends B ? A : B; - - export const type: unique symbol; - - - - /** - * Used by group by - */ - - export type GetScalarType = O extends object ? { - [P in keyof T]: P extends keyof O - ? O[P] - : never - } : never - - type FieldPaths< - T, - U = Omit - > = IsObject extends True ? U : T - - type GetHavingFields = { - [K in keyof T]: Or< - Or, Extends<'AND', K>>, - Extends<'NOT', K> - > extends True - ? // infer is only needed to not hit TS limit - // based on the brilliant idea of Pierre-Antoine Mills - // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 - T[K] extends infer TK - ? GetHavingFields extends object ? Merge> : never> - : never - : {} extends FieldPaths - ? never - : K - }[keyof T] - - /** - * Convert tuple to union - */ - type _TupleToUnion = T extends (infer E)[] ? E : never - type TupleToUnion = _TupleToUnion - type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T - - /** - * Like `Pick`, but additionally can also accept an array of keys - */ - type PickEnumerable | keyof T> = Prisma__Pick> - - /** - * Exclude all keys with underscores - */ - type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T - - - export type FieldRef = runtime.FieldRef - - type FieldRefInputType = Model extends never ? never : FieldRef - - - export const ModelName: { - User: 'User' - }; - - export type ModelName = (typeof ModelName)[keyof typeof ModelName] - - - export type Datasources = { - db?: Datasource - } - - - interface TypeMapCb extends $Utils.Fn<{extArgs: $Extensions.InternalArgs}, $Utils.Record> { - returns: Prisma.TypeMap - } - - export type TypeMap = { - meta: { - modelProps: 'user' - txIsolationLevel: Prisma.TransactionIsolationLevel - }, - model: { - User: { - payload: Prisma.$UserPayload - fields: Prisma.UserFieldRefs - operations: { - findUnique: { - args: Prisma.UserFindUniqueArgs, - result: $Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.UserFindUniqueOrThrowArgs, - result: $Utils.PayloadToResult - } - findFirst: { - args: Prisma.UserFindFirstArgs, - result: $Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.UserFindFirstOrThrowArgs, - result: $Utils.PayloadToResult - } - findMany: { - args: Prisma.UserFindManyArgs, - result: $Utils.PayloadToResult[] - } - create: { - args: Prisma.UserCreateArgs, - result: $Utils.PayloadToResult - } - createMany: { - args: Prisma.UserCreateManyArgs, - result: Prisma.BatchPayload - } - delete: { - args: Prisma.UserDeleteArgs, - result: $Utils.PayloadToResult - } - update: { - args: Prisma.UserUpdateArgs, - result: $Utils.PayloadToResult - } - deleteMany: { - args: Prisma.UserDeleteManyArgs, - result: Prisma.BatchPayload - } - updateMany: { - args: Prisma.UserUpdateManyArgs, - result: Prisma.BatchPayload - } - upsert: { - args: Prisma.UserUpsertArgs, - result: $Utils.PayloadToResult - } - aggregate: { - args: Prisma.UserAggregateArgs, - result: $Utils.Optional - } - groupBy: { - args: Prisma.UserGroupByArgs, - result: $Utils.Optional[] - } - count: { - args: Prisma.UserCountArgs, - result: $Utils.Optional | number - } - } - } - } - } & { - other: { - payload: any - operations: { - $executeRawUnsafe: { - args: [query: string, ...values: any[]], - result: any - } - $executeRaw: { - args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], - result: any - } - $queryRawUnsafe: { - args: [query: string, ...values: any[]], - result: any - } - $queryRaw: { - args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], - result: any - } - } - } - } - export const defineExtension: $Extensions.ExtendsHook<'define', Prisma.TypeMapCb, $Extensions.DefaultArgs> - export type DefaultPrismaClient = PrismaClient - export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' - export interface PrismaClientOptions { - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasources?: Datasources - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasourceUrl?: string - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat - /** - * @example - * ``` - * // Defaults to stdout - * log: ['query', 'info', 'warn', 'error'] - * - * // Emit as events - * log: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * { emit: 'stdout', level: 'error' } - * ] - * ``` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: (LogLevel | LogDefinition)[] - /** - * The default values for transactionOptions - * maxWait ?= 2000 - * timeout ?= 5000 - */ - transactionOptions?: { - maxWait?: number - timeout?: number - isolationLevel?: Prisma.TransactionIsolationLevel - } - } - - /* Types for Logging */ - export type LogLevel = 'info' | 'query' | 'warn' | 'error' - export type LogDefinition = { - level: LogLevel - emit: 'stdout' | 'event' - } - - export type GetLogType = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never - export type GetEvents = T extends Array ? - GetLogType | GetLogType | GetLogType | GetLogType - : never - - export type QueryEvent = { - timestamp: Date - query: string - params: string - duration: number - target: string - } - - export type LogEvent = { - timestamp: Date - message: string - target: string - } - /* End Types for Logging */ - - - export type PrismaAction = - | 'findUnique' - | 'findUniqueOrThrow' - | 'findMany' - | 'findFirst' - | 'findFirstOrThrow' - | 'create' - | 'createMany' - | 'createManyAndReturn' - | 'update' - | 'updateMany' - | 'upsert' - | 'delete' - | 'deleteMany' - | 'executeRaw' - | 'queryRaw' - | 'aggregate' - | 'count' - | 'runCommandRaw' - | 'findRaw' - | 'groupBy' - - /** - * These options are being passed into the middleware as "params" - */ - export type MiddlewareParams = { - model?: ModelName - action: PrismaAction - args: any - dataPath: string[] - runInTransaction: boolean - } - - /** - * The `T` type makes sure, that the `return proceed` is not forgotten in the middleware implementation - */ - export type Middleware = ( - params: MiddlewareParams, - next: (params: MiddlewareParams) => $Utils.JsPromise, - ) => $Utils.JsPromise - - // tested in getLogLevel.test.ts - export function getLogLevel(log: Array): LogLevel | undefined; - - /** - * `PrismaClient` proxy available in interactive transactions. - */ - export type TransactionClient = Omit - - export type Datasource = { - url?: string - } - - /** - * Count Types - */ - - - - /** - * Models - */ - - /** - * Model User - */ - - export type AggregateUser = { - _count: UserCountAggregateOutputType | null - _avg: UserAvgAggregateOutputType | null - _sum: UserSumAggregateOutputType | null - _min: UserMinAggregateOutputType | null - _max: UserMaxAggregateOutputType | null - } - - export type UserAvgAggregateOutputType = { - id: number | null - } - - export type UserSumAggregateOutputType = { - id: number | null - } - - export type UserMinAggregateOutputType = { - id: number | null - email: string | null - name: string | null - } - - export type UserMaxAggregateOutputType = { - id: number | null - email: string | null - name: string | null - } - - export type UserCountAggregateOutputType = { - id: number - email: number - name: number - _all: number - } - - - export type UserAvgAggregateInputType = { - id?: true - } - - export type UserSumAggregateInputType = { - id?: true - } - - export type UserMinAggregateInputType = { - id?: true - email?: true - name?: true - } - - export type UserMaxAggregateInputType = { - id?: true - email?: true - name?: true - } - - export type UserCountAggregateInputType = { - id?: true - email?: true - name?: true - _all?: true - } - - export type UserAggregateArgs = { - /** - * Filter which User to aggregate. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Users - **/ - _count?: true | UserCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to average - **/ - _avg?: UserAvgAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to sum - **/ - _sum?: UserSumAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: UserMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: UserMaxAggregateInputType - } - - export type GetUserAggregateType = { - [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : GetScalarType - : GetScalarType - } - - - - - export type UserGroupByArgs = { - where?: UserWhereInput - orderBy?: UserOrderByWithAggregationInput | UserOrderByWithAggregationInput[] - by: UserScalarFieldEnum[] | UserScalarFieldEnum - having?: UserScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: UserCountAggregateInputType | true - _avg?: UserAvgAggregateInputType - _sum?: UserSumAggregateInputType - _min?: UserMinAggregateInputType - _max?: UserMaxAggregateInputType - } - - export type UserGroupByOutputType = { - id: number - email: string - name: string | null - _count: UserCountAggregateOutputType | null - _avg: UserAvgAggregateOutputType | null - _sum: UserSumAggregateOutputType | null - _min: UserMinAggregateOutputType | null - _max: UserMaxAggregateOutputType | null - } - - type GetUserGroupByPayload = Prisma.PrismaPromise< - Array< - PickEnumerable & - { - [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : GetScalarType - : GetScalarType - } - > - > - - - export type UserSelect = $Extensions.GetSelect<{ - id?: boolean - email?: boolean - name?: boolean - }, ExtArgs["result"]["user"]> - - export type UserSelectScalar = { - id?: boolean - email?: boolean - name?: boolean - } - - - - export type $UserPayload = { - name: "User" - objects: {} - scalars: $Extensions.GetPayloadResult<{ - id: number - email: string - name: string | null - }, ExtArgs["result"]["user"]> - composites: {} - } - - - type UserGetPayload = $Result.GetResult - - type UserCountArgs = - Omit & { - select?: UserCountAggregateInputType | true - } - - export interface UserDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } - /** - * Find zero or one User that matches the filter. - * @param {UserFindUniqueArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUnique>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findUnique'> | null, null, ExtArgs> - - /** - * Find one User that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUniqueOrThrow>( - args?: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findUniqueOrThrow'>, never, ExtArgs> - - /** - * Find the first User that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserFindFirstArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirst>( - args?: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findFirst'> | null, null, ExtArgs> - - /** - * Find the first User that matches the filter or - * throw `PrismaKnownClientError` with `P2025` code if no matches were found. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserFindFirstOrThrowArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirstOrThrow>( - args?: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findFirstOrThrow'>, never, ExtArgs> - - /** - * Find zero or more Users that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all Users - * const users = await prisma.user.findMany() - * - * // Get first 10 Users - * const users = await prisma.user.findMany({ take: 10 }) - * - * // Only select the `id` - * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) - * - **/ - findMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise<$Result.GetResult, T, 'findMany'>> - - /** - * Create a User. - * @param {UserCreateArgs} args - Arguments to create a User. - * @example - * // Create one User - * const User = await prisma.user.create({ - * data: { - * // ... data to create a User - * } - * }) - * - **/ - create>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'create'>, never, ExtArgs> - - /** - * Create many Users. - * @param {UserCreateManyArgs} args - Arguments to create many Users. - * @example - * // Create many Users - * const user = await prisma.user.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - **/ - createMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Delete a User. - * @param {UserDeleteArgs} args - Arguments to delete one User. - * @example - * // Delete one User - * const User = await prisma.user.delete({ - * where: { - * // ... filter to delete one User - * } - * }) - * - **/ - delete>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'delete'>, never, ExtArgs> - - /** - * Update one User. - * @param {UserUpdateArgs} args - Arguments to update one User. - * @example - * // Update one User - * const user = await prisma.user.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - update>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'update'>, never, ExtArgs> - - /** - * Delete zero or more Users. - * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. - * @example - * // Delete a few Users - * const { count } = await prisma.user.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - **/ - deleteMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Update zero or more Users. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Users - * const user = await prisma.user.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - updateMany>( - args: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Create or update one User. - * @param {UserUpsertArgs} args - Arguments to update or create a User. - * @example - * // Update or create a User - * const user = await prisma.user.upsert({ - * create: { - * // ... data to create a User - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the User we want to update - * } - * }) - **/ - upsert>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'upsert'>, never, ExtArgs> - - /** - * Count the number of Users. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserCountArgs} args - Arguments to filter Users to count. - * @example - * // Count the number of Users - * const count = await prisma.user.count({ - * where: { - * // ... the filter for the Users we want to count - * } - * }) - **/ - count( - args?: Subset, - ): Prisma.PrismaPromise< - T extends $Utils.Record<'select', any> - ? T['select'] extends true - ? number - : GetScalarType - : number - > - - /** - * Allows you to perform aggregations operations on a User. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserAggregateArgs} args - Select which aggregations you would like to apply and on what fields. - * @example - * // Ordered by age ascending - * // Where email contains prisma.io - * // Limited to the 10 users - * const aggregations = await prisma.user.aggregate({ - * _avg: { - * age: true, - * }, - * where: { - * email: { - * contains: "prisma.io", - * }, - * }, - * orderBy: { - * age: "asc", - * }, - * take: 10, - * }) - **/ - aggregate(args: Subset): Prisma.PrismaPromise> - - /** - * Group by User. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserGroupByArgs} args - Group by arguments. - * @example - * // Group by city, order by createdAt, get count - * const result = await prisma.user.groupBy({ - * by: ['city', 'createdAt'], - * orderBy: { - * createdAt: true - * }, - * _count: { - * _all: true - * }, - * }) - * - **/ - groupBy< - T extends UserGroupByArgs, - HasSelectOrTake extends Or< - Extends<'skip', Keys>, - Extends<'take', Keys> - >, - OrderByArg extends True extends HasSelectOrTake - ? { orderBy: UserGroupByArgs['orderBy'] } - : { orderBy?: UserGroupByArgs['orderBy'] }, - OrderFields extends ExcludeUnderscoreKeys>>, - ByFields extends MaybeTupleToUnion, - ByValid extends Has, - HavingFields extends GetHavingFields, - HavingValid extends Has, - ByEmpty extends T['by'] extends never[] ? True : False, - InputErrors extends ByEmpty extends True - ? `Error: "by" must not be empty.` - : HavingValid extends False - ? { - [P in HavingFields]: P extends ByFields - ? never - : P extends string - ? `Error: Field "${P}" used in "having" needs to be provided in "by".` - : [ - Error, - 'Field ', - P, - ` in "having" needs to be provided in "by"`, - ] - }[HavingFields] - : 'take' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "take", you also need to provide "orderBy"' - : 'skip' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "skip", you also need to provide "orderBy"' - : ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetUserGroupByPayload : Prisma.PrismaPromise - /** - * Fields of the User model - */ - readonly fields: UserFieldRefs; - } - - /** - * The delegate class that acts as a "Promise-like" for User. - * Why is this prefixed with `Prisma__`? - * Because we want to prevent naming conflicts as mentioned in - * https://github.com/prisma/prisma-client-js/issues/707 - */ - export interface Prisma__UserClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: 'PrismaPromise'; - - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The - * resolved value cannot be modified from the callback. - * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). - * @returns A Promise for the completion of the callback. - */ - finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise; - } - - - - /** - * Fields of the User model - */ - interface UserFieldRefs { - readonly id: FieldRef<"User", 'Int'> - readonly email: FieldRef<"User", 'String'> - readonly name: FieldRef<"User", 'String'> - } - - - // Custom InputTypes - /** - * User findUnique - */ - export type UserFindUniqueArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where: UserWhereUniqueInput - } - - /** - * User findUniqueOrThrow - */ - export type UserFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where: UserWhereUniqueInput - } - - /** - * User findFirst - */ - export type UserFindFirstArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Users. - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Users. - */ - distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] - } - - /** - * User findFirstOrThrow - */ - export type UserFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Users. - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Users. - */ - distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] - } - - /** - * User findMany - */ - export type UserFindManyArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which Users to fetch. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Users. - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] - } - - /** - * User create - */ - export type UserCreateArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The data needed to create a User. - */ - data: XOR - } - - /** - * User createMany - */ - export type UserCreateManyArgs = { - /** - * The data used to create many Users. - */ - data: UserCreateManyInput | UserCreateManyInput[] - skipDuplicates?: boolean - } - - /** - * User update - */ - export type UserUpdateArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The data needed to update a User. - */ - data: XOR - /** - * Choose, which User to update. - */ - where: UserWhereUniqueInput - } - - /** - * User updateMany - */ - export type UserUpdateManyArgs = { - /** - * The data used to update Users. - */ - data: XOR - /** - * Filter which Users to update - */ - where?: UserWhereInput - } - - /** - * User upsert - */ - export type UserUpsertArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The filter to search for the User to update in case it exists. - */ - where: UserWhereUniqueInput - /** - * In case the User found by the `where` argument doesn't exist, create a new User with this data. - */ - create: XOR - /** - * In case the User was found with the provided `where` argument, update it with this data. - */ - update: XOR - } - - /** - * User delete - */ - export type UserDeleteArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter which User to delete. - */ - where: UserWhereUniqueInput - } - - /** - * User deleteMany - */ - export type UserDeleteManyArgs = { - /** - * Filter which Users to delete - */ - where?: UserWhereInput - } - - /** - * User without action - */ - export type UserDefaultArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - } - - - /** - * Enums - */ - - export const TransactionIsolationLevel: { - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' - }; - - export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] - - - export const UserScalarFieldEnum: { - id: 'id', - email: 'email', - name: 'name' - }; - - export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] - - - export const SortOrder: { - asc: 'asc', - desc: 'desc' - }; - - export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] - - - export const NullsOrder: { - first: 'first', - last: 'last' - }; - - export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] - - - /** - * Field references - */ - - - /** - * Reference to a field of type 'Int' - */ - export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> - - - - /** - * Reference to a field of type 'String' - */ - export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> - - - - /** - * Reference to a field of type 'Float' - */ - export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> - - /** - * Deep Input Types - */ - - - export type UserWhereInput = { - AND?: UserWhereInput | UserWhereInput[] - OR?: UserWhereInput[] - NOT?: UserWhereInput | UserWhereInput[] - id?: IntFilter<"User"> | number - email?: StringFilter<"User"> | string - name?: StringNullableFilter<"User"> | string | null - } - - export type UserOrderByWithRelationInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrderInput | SortOrder - } - - export type UserWhereUniqueInput = Prisma.AtLeast<{ - id?: number - email?: string - AND?: UserWhereInput | UserWhereInput[] - OR?: UserWhereInput[] - NOT?: UserWhereInput | UserWhereInput[] - name?: StringNullableFilter<"User"> | string | null - }, "id" | "email"> - - export type UserOrderByWithAggregationInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrderInput | SortOrder - _count?: UserCountOrderByAggregateInput - _avg?: UserAvgOrderByAggregateInput - _max?: UserMaxOrderByAggregateInput - _min?: UserMinOrderByAggregateInput - _sum?: UserSumOrderByAggregateInput - } - - export type UserScalarWhereWithAggregatesInput = { - AND?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[] - OR?: UserScalarWhereWithAggregatesInput[] - NOT?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[] - id?: IntWithAggregatesFilter<"User"> | number - email?: StringWithAggregatesFilter<"User"> | string - name?: StringNullableWithAggregatesFilter<"User"> | string | null - } - - export type UserCreateInput = { - email: string - name?: string | null - } - - export type UserUncheckedCreateInput = { - id?: number - email: string - name?: string | null - } - - export type UserUpdateInput = { - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type UserUncheckedUpdateInput = { - id?: IntFieldUpdateOperationsInput | number - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type UserCreateManyInput = { - id?: number - email: string - name?: string | null - } - - export type UserUpdateManyMutationInput = { - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type UserUncheckedUpdateManyInput = { - id?: IntFieldUpdateOperationsInput | number - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type IntFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntFilter<$PrismaModel> | number - } - - export type StringFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringFilter<$PrismaModel> | string - } - - export type StringNullableFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringNullableFilter<$PrismaModel> | string | null - } - - export type SortOrderInput = { - sort: SortOrder - nulls?: NullsOrder - } - - export type UserCountOrderByAggregateInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrder - } - - export type UserAvgOrderByAggregateInput = { - id?: SortOrder - } - - export type UserMaxOrderByAggregateInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrder - } - - export type UserMinOrderByAggregateInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrder - } - - export type UserSumOrderByAggregateInput = { - id?: SortOrder - } - - export type IntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: NestedIntFilter<$PrismaModel> - _avg?: NestedFloatFilter<$PrismaModel> - _sum?: NestedIntFilter<$PrismaModel> - _min?: NestedIntFilter<$PrismaModel> - _max?: NestedIntFilter<$PrismaModel> - } - - export type StringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedStringFilter<$PrismaModel> - _max?: NestedStringFilter<$PrismaModel> - } - - export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null - _count?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedStringNullableFilter<$PrismaModel> - _max?: NestedStringNullableFilter<$PrismaModel> - } - - export type StringFieldUpdateOperationsInput = { - set?: string - } - - export type NullableStringFieldUpdateOperationsInput = { - set?: string | null - } - - export type IntFieldUpdateOperationsInput = { - set?: number - increment?: number - decrement?: number - multiply?: number - divide?: number - } - - export type NestedIntFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntFilter<$PrismaModel> | number - } - - export type NestedStringFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringFilter<$PrismaModel> | string - } - - export type NestedStringNullableFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringNullableFilter<$PrismaModel> | string | null - } - - export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: NestedIntFilter<$PrismaModel> - _avg?: NestedFloatFilter<$PrismaModel> - _sum?: NestedIntFilter<$PrismaModel> - _min?: NestedIntFilter<$PrismaModel> - _max?: NestedIntFilter<$PrismaModel> - } - - export type NestedFloatFilter<$PrismaModel = never> = { - equals?: number | FloatFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | FloatFieldRefInput<$PrismaModel> - lte?: number | FloatFieldRefInput<$PrismaModel> - gt?: number | FloatFieldRefInput<$PrismaModel> - gte?: number | FloatFieldRefInput<$PrismaModel> - not?: NestedFloatFilter<$PrismaModel> | number - } - - export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedStringFilter<$PrismaModel> - _max?: NestedStringFilter<$PrismaModel> - } - - export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null - _count?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedStringNullableFilter<$PrismaModel> - _max?: NestedStringNullableFilter<$PrismaModel> - } - - export type NestedIntNullableFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntNullableFilter<$PrismaModel> | number | null - } - - - - /** - * Aliases for legacy arg types - */ - /** - * @deprecated Use UserDefaultArgs instead - */ - export type UserArgs = UserDefaultArgs - - /** - * Batch Payload for updateMany & deleteMany & createMany - */ - - export type BatchPayload = { - count: number - } - - /** - * DMMF - */ - export const dmmf: runtime.BaseDMMF -} \ No newline at end of file diff --git a/integration-tests/tests/prisma/mysql/client/index.js b/integration-tests/tests/prisma/mysql/client/index.js deleted file mode 100644 index 03c1ebcdf..000000000 --- a/integration-tests/tests/prisma/mysql/client/index.js +++ /dev/null @@ -1,200 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - PrismaClientKnownRequestError, - PrismaClientUnknownRequestError, - PrismaClientRustPanicError, - PrismaClientInitializationError, - PrismaClientValidationError, - NotFoundError, - getPrismaClient, - sqltag, - empty, - join, - raw, - Decimal, - Debug, - objectEnumValues, - makeStrictEnum, - Extensions, - warnOnce, - defineDmmfProperty, - Public, - getRuntime -} = require('./runtime/library.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; -Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError -Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError -Prisma.PrismaClientInitializationError = PrismaClientInitializationError -Prisma.PrismaClientValidationError = PrismaClientValidationError -Prisma.NotFoundError = NotFoundError -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = sqltag -Prisma.empty = empty -Prisma.join = join -Prisma.raw = raw -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = Extensions.getExtensionContext -Prisma.defineExtension = Extensions.defineExtension - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - - - const path = require('path') - -/** - * Enums - */ -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; -/** - * Create the Client - */ -const config = { - "generator": { - "name": "client", - "provider": { - "fromEnvVar": null, - "value": "prisma-client-js" - }, - "output": { - "value": "/home/prodrigues/Desktop/summer-hackathon-s2-drizzle-orm/integration-tests/tests/prisma/mysql/client", - "fromEnvVar": null - }, - "config": { - "engineType": "library" - }, - "binaryTargets": [ - { - "fromEnvVar": null, - "value": "debian-openssl-3.0.x", - "native": true - } - ], - "previewFeatures": [], - "isCustomOutput": true - }, - "relativeEnvPaths": { - "rootEnvPath": null - }, - "relativePath": "..", - "clientVersion": "5.14.0", - "engineVersion": "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48", - "datasourceNames": [ - "db" - ], - "activeProvider": "mysql", - "postinstall": false, - "inlineDatasources": { - "db": { - "url": { - "fromEnvVar": "MYSQL_CONNECTION_STRING", - "value": null - } - } - }, - "inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n output = \"./client\"\n}\n\ngenerator drizzle {\n provider = \"drizzle-prisma-generator\"\n output = \"./drizzle\"\n}\n\ndatasource db {\n provider = \"mysql\"\n url = env(\"MYSQL_CONNECTION_STRING\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n}\n", - "inlineSchemaHash": "6e8dd18636337105b6f81492024552e63b9b9a29a0cadb79231c945267c145fa", - "copyEngine": true -} - -const fs = require('fs') - -config.dirname = __dirname -if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { - const alternativePaths = [ - "tests/prisma/mysql/client", - "prisma/mysql/client", - ] - - const alternativePath = alternativePaths.find((altPath) => { - return fs.existsSync(path.join(process.cwd(), altPath, 'schema.prisma')) - }) ?? alternativePaths[0] - - config.dirname = path.join(process.cwd(), alternativePath) - config.isBundled = true -} - -config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") -defineDmmfProperty(exports.Prisma, config.runtimeDataModel) -config.engineWasm = undefined - - -const { warnEnvConflicts } = require('./runtime/library.js') - -warnEnvConflicts({ - rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath), - schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath) -}) - -const PrismaClient = getPrismaClient(config) -exports.PrismaClient = PrismaClient -Object.assign(exports, Prisma) - -// file annotations for bundling tools to include these files -path.join(__dirname, "libquery_engine-debian-openssl-3.0.x.so.node"); -path.join(process.cwd(), "tests/prisma/mysql/client/libquery_engine-debian-openssl-3.0.x.so.node") -// file annotations for bundling tools to include these files -path.join(__dirname, "schema.prisma"); -path.join(process.cwd(), "tests/prisma/mysql/client/schema.prisma") diff --git a/integration-tests/tests/prisma/mysql/client/libquery_engine-debian-openssl-3.0.x.so.node b/integration-tests/tests/prisma/mysql/client/libquery_engine-debian-openssl-3.0.x.so.node deleted file mode 100755 index ed0a5448d..000000000 Binary files a/integration-tests/tests/prisma/mysql/client/libquery_engine-debian-openssl-3.0.x.so.node and /dev/null differ diff --git a/integration-tests/tests/prisma/mysql/client/package.json b/integration-tests/tests/prisma/mysql/client/package.json deleted file mode 100644 index b02eedf45..000000000 --- a/integration-tests/tests/prisma/mysql/client/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "prisma-client-b6434cb1d30d05586e1c17bba0c8ec5b560190d7f97a74a6c655b4e12c8fcd74", - "main": "index.js", - "types": "index.d.ts", - "browser": "index-browser.js", - "exports": { - "./package.json": "./package.json", - ".": { - "require": { - "node": "./index.js", - "edge-light": "./wasm.js", - "workerd": "./wasm.js", - "worker": "./wasm.js", - "browser": "./index-browser.js", - "default": "./index.js" - }, - "import": { - "node": "./index.js", - "edge-light": "./wasm.js", - "workerd": "./wasm.js", - "worker": "./wasm.js", - "browser": "./index-browser.js", - "default": "./index.js" - }, - "default": "./index.js" - }, - "./edge": { - "types": "./edge.d.ts", - "require": "./edge.js", - "import": "./edge.js", - "default": "./edge.js" - }, - "./react-native": { - "types": "./react-native.d.ts", - "require": "./react-native.js", - "import": "./react-native.js", - "default": "./react-native.js" - }, - "./extension": { - "types": "./extension.d.ts", - "require": "./extension.js", - "import": "./extension.js", - "default": "./extension.js" - }, - "./index-browser": { - "types": "./index.d.ts", - "require": "./index-browser.js", - "import": "./index-browser.js", - "default": "./index-browser.js" - }, - "./index": { - "types": "./index.d.ts", - "require": "./index.js", - "import": "./index.js", - "default": "./index.js" - }, - "./wasm": { - "types": "./wasm.d.ts", - "require": "./wasm.js", - "import": "./wasm.js", - "default": "./wasm.js" - }, - "./runtime/library": { - "types": "./runtime/library.d.ts", - "require": "./runtime/library.js", - "import": "./runtime/library.js", - "default": "./runtime/library.js" - }, - "./runtime/binary": { - "types": "./runtime/binary.d.ts", - "require": "./runtime/binary.js", - "import": "./runtime/binary.js", - "default": "./runtime/binary.js" - }, - "./generator-build": { - "require": "./generator-build/index.js", - "import": "./generator-build/index.js", - "default": "./generator-build/index.js" - }, - "./*": "./*" - }, - "version": "5.14.0", - "sideEffects": false -} \ No newline at end of file diff --git a/integration-tests/tests/prisma/mysql/client/runtime/edge-esm.js b/integration-tests/tests/prisma/mysql/client/runtime/edge-esm.js deleted file mode 100644 index e9adb8e66..000000000 --- a/integration-tests/tests/prisma/mysql/client/runtime/edge-esm.js +++ /dev/null @@ -1,28 +0,0 @@ -var ia=Object.create;var rr=Object.defineProperty;var oa=Object.getOwnPropertyDescriptor;var sa=Object.getOwnPropertyNames;var aa=Object.getPrototypeOf,ua=Object.prototype.hasOwnProperty;var Pt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nr=(e,t)=>{for(var r in t)rr(e,r,{get:t[r],enumerable:!0})},Qn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sa(t))!ua.call(e,i)&&i!==r&&rr(e,i,{get:()=>t[i],enumerable:!(n=oa(t,i))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?ia(aa(e)):{},Qn(t||!e||!e.__esModule?rr(r,"default",{value:e,enumerable:!0}):r,e)),Gn=e=>Qn(rr({},"__esModule",{value:!0}),e);var y,c=Ee(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var Hn,b,p=Ee(()=>{"use strict";b=(Hn=globalThis.performance)!=null?Hn:(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,f=Ee(()=>{"use strict";E=()=>{};E.prototype=E});var m=Ee(()=>{"use strict"});var fi=Ae(rt=>{"use strict";d();c();p();f();m();var Zn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),la=Zn(e=>{"use strict";e.byteLength=u,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var D=C.indexOf("=");D===-1&&(D=A);var O=D===A?0:4-D%4;return[D,O]}function u(C){var A=a(C),D=A[0],O=A[1];return(D+O)*3/4-O}function l(C,A,D){return(A+D)*3/4-D}function g(C){var A,D=a(C),O=D[0],B=D[1],M=new n(l(C,O,B)),I=0,Z=B>0?O-4:O,L;for(L=0;L>16&255,M[I++]=A>>8&255,M[I++]=A&255;return B===2&&(A=r[C.charCodeAt(L)]<<2|r[C.charCodeAt(L+1)]>>4,M[I++]=A&255),B===1&&(A=r[C.charCodeAt(L)]<<10|r[C.charCodeAt(L+1)]<<4|r[C.charCodeAt(L+2)]>>2,M[I++]=A>>8&255,M[I++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function x(C,A,D){for(var O,B=[],M=A;MZ?Z:I+M));return O===1?(A=C[D-1],B.push(t[A>>2]+t[A<<4&63]+"==")):O===2&&(A=(C[D-2]<<8)+C[D-1],B.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),B.join("")}}),ca=Zn(e=>{e.read=function(t,r,n,i,o){var s,a,u=o*8-i-1,l=(1<>1,h=-7,x=n?o-1:0,S=n?-1:1,C=t[r+x];for(x+=S,s=C&(1<<-h)-1,C>>=-h,h+=u;h>0;s=s*256+t[r+x],x+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+x],x+=S,h-=8);if(s===0)s=1-g;else{if(s===l)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,u,l,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,D=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+x>=1?r+=S/l:r+=S*Math.pow(2,1-x),r*l>=2&&(a++,l/=2),a+x>=h?(u=0,a=h):a+x>=1?(u=(r*l-1)*Math.pow(2,o),a=a+x):(u=r*Math.pow(2,x-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=u&255,C+=A,u/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=D*128}}),Qr=la(),et=ca(),Wn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rt.Buffer=T;rt.SlowBuffer=ha;rt.INSPECT_MAX_BYTES=50;var ir=2147483647;rt.kMaxLength=ir;T.TYPED_ARRAY_SUPPORT=pa();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function pa(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function be(e){if(e>ir)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Wr(e)}return Xn(e,t,r)}T.poolSize=8192;function Xn(e,t,r){if(typeof e=="string")return ma(e,t);if(ArrayBuffer.isView(e))return da(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(me(e,ArrayBuffer)||e&&me(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(e,SharedArrayBuffer)||e&&me(e.buffer,SharedArrayBuffer)))return ti(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=ga(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return Xn(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function ei(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function fa(e,t,r){return ei(e),e<=0?be(e):t!==void 0?typeof r=="string"?be(e).fill(t,r):be(e).fill(t):be(e)}T.alloc=function(e,t,r){return fa(e,t,r)};function Wr(e){return ei(e),be(e<0?0:Kr(e)|0)}T.allocUnsafe=function(e){return Wr(e)};T.allocUnsafeSlow=function(e){return Wr(e)};function ma(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=ri(e,t)|0,n=be(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Gr(e){let t=e.length<0?0:Kr(e.length)|0,r=be(t);for(let n=0;n=ir)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ir.toString(16)+" bytes");return e|0}function ha(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),me(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function ri(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||me(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Hr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return pi(e).length;default:if(i)return n?-1:Hr(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=ri;function ya(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ra(this,t,r);case"utf8":case"utf-8":return ii(this,t,r);case"ascii":return Ca(this,t,r);case"latin1":case"binary":return Aa(this,t,r);case"base64":return va(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sa(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Ve(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Wn&&(T.prototype[Wn]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Yr(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:Kn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Kn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Kn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function u(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let l;if(i){let g=-1;for(l=r;ls&&(r=s-a),l=r;l>=0;l--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return wa(this,e,t,r);case"utf8":case"utf-8":return Ea(this,e,t,r);case"ascii":case"latin1":case"binary":return ba(this,e,t,r);case"base64":return xa(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pa(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function va(e,t,r){return t===0&&r===e.length?Qr.fromByteArray(e):Qr.fromByteArray(e.slice(t,r))}function ii(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let u,l,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(s=h));break;case 3:u=e[i+1],l=e[i+2],(u&192)===128&&(l&192)===128&&(h=(o&15)<<12|(u&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:u=e[i+1],l=e[i+2],g=e[i+3],(u&192)===128&&(l&192)===128&&(g&192)===128&&(h=(o&15)<<18|(u&63)<<12|(l&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ta(n)}var zn=4096;function Ta(e){let t=e.length;if(t<=zn)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Re(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Re(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),et.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),et.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!1,52,8)};function ie(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function oi(e,t,r,n,i){ci(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function si(e,t,r,n,i){ci(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=Re(function(e,t=0){return oi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Re(function(e,t=0){return si(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=Re(function(e,t=0){return oi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Re(function(e,t=0){return si(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ai(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ui(e,t,r,n,i){return t=+t,r=r>>>0,i||ai(e,t,r,4,34028234663852886e22,-34028234663852886e22),et.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return ui(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return ui(this,e,t,!1,r)};function li(e,t,r,n,i){return t=+t,r=r>>>0,i||ai(e,t,r,8,17976931348623157e292,-17976931348623157e292),et.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return li(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return li(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=Yn(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Yn(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Yn(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Ia(e,t,r){tt(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&vt(t,e.length-(r+1))}function ci(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Xe.ERR_OUT_OF_RANGE("value",a,e)}Ia(n,i,o)}function tt(e,t){if(typeof e!="number")throw new Xe.ERR_INVALID_ARG_TYPE(t,"number",e)}function vt(e,t,r){throw Math.floor(e)!==e?(tt(e,r),new Xe.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Xe.ERR_BUFFER_OUT_OF_BOUNDS:new Xe.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var ka=/[^+/0-9A-Za-z-_]/g;function Da(e){if(e=e.split("=")[0],e=e.trim().replace(ka,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Hr(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Oa(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function pi(e){return Qr.toByteArray(Da(e))}function or(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function me(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Yr(e){return e!==e}var Na=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Re(e){return typeof BigInt>"u"?_a:e}function _a(){throw new Error("BigInt not supported")}});var w,d=Ee(()=>{"use strict";w=Ue(fi())});function Fa(){return!1}var La,Ba,wi,Ei=Ee(()=>{"use strict";d();c();p();f();m();La={},Ba={existsSync:Fa,promises:La},wi=Ba});var Di=Ae((df,ki)=>{"use strict";d();c();p();f();m();ki.exports=(en(),Gn(Xr)).format});var Xr={};nr(Xr,{default:()=>Ua,deprecate:()=>Mi,format:()=>_i,inspect:()=>Ni,promisify:()=>Oi});function Oi(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function Mi(e,t){return(...r)=>(console.warn(t),e(...r))}function Ni(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var _i,qa,Ua,en=Ee(()=>{"use strict";d();c();p();f();m();_i=Di(),qa={promisify:Oi,deprecate:Mi,inspect:Ni,format:_i},Ua=qa});function Ga(...e){return e.join("/")}function Ha(...e){return e.join("/")}var ji,Wa,Ka,Ct,Ji=Ee(()=>{"use strict";d();c();p();f();m();ji="/",Wa={sep:ji},Ka={resolve:Ga,posix:Wa,join:Ha,sep:ji},Ct=Ka});var lr,Gi=Ee(()=>{"use strict";d();c();p();f();m();lr=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var Wi=Ae((bm,Hi)=>{"use strict";d();c();p();f();m();Hi.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 Yi=Ae((Om,zi)=>{"use strict";d();c();p();f();m();zi.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 Xi=Ae((Bm,Zi)=>{"use strict";d();c();p();f();m();var tu=Yi();Zi.exports=e=>typeof e=="string"?e.replace(tu(),""):e});var ro=Ae((Nh,su)=>{su.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var no=Ae(()=>{"use strict";d();c();p();f();m()});var Fn=Ae((l2,gs)=>{"use strict";d();c();p();f();m();gs.exports=function(){function e(t,r,n,i,o){return tn?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;smi,getExtensionContext:()=>di});d();c();p();f();m();d();c();p();f();m();function mi(e){return typeof e=="function"?e:t=>t.$extends(e)}d();c();p();f();m();function di(e){return e}var yi={};nr(yi,{validator:()=>hi});d();c();p();f();m();d();c();p();f();m();function hi(...e){return t=>t}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Zr,bi,xi,Pi,vi=!0;typeof y!="undefined"&&({FORCE_COLOR:Zr,NODE_DISABLE_COLORS:bi,NO_COLOR:xi,TERM:Pi}=y.env||{},vi=y.stdout&&y.stdout.isTTY);var $a={enabled:!bi&&xi==null&&Pi!=="dumb"&&(Zr!=null&&Zr!=="0"||vi)};function V(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!$a.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Jp=V(0,0),sr=V(1,22),ar=V(2,22),Qp=V(3,23),Ti=V(4,24),Gp=V(7,27),Hp=V(8,28),Wp=V(9,29),Kp=V(30,39),nt=V(31,39),Ci=V(32,39),Ai=V(33,39),Ri=V(34,39),zp=V(35,39),Si=V(36,39),Yp=V(37,39),Ii=V(90,39),Zp=V(90,39),Xp=V(40,49),ef=V(41,49),tf=V(42,49),rf=V(43,49),nf=V(44,49),of=V(45,49),sf=V(46,49),af=V(47,49);d();c();p();f();m();var Va=100,Fi=["green","yellow","blue","magenta","cyan","red"],ur=[],Li=Date.now(),ja=0,tn=typeof y!="undefined"?y.env:{},Bi,$i;($i=globalThis.DEBUG)!=null||(globalThis.DEBUG=(Bi=tn.DEBUG)!=null?Bi:"");var qi;(qi=globalThis.DEBUG_COLORS)!=null||(globalThis.DEBUG_COLORS=tn.DEBUG_COLORS?tn.DEBUG_COLORS==="true":!0);var Tt={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)=>{var o;let[t,r,...n]=e,i;typeof Pt=="function"&&typeof y!="undefined"&&typeof y.stderr!="undefined"&&typeof y.stderr.write=="function"?i=(...s)=>{var a;try{let u=(en(),Gn(Xr));y.stderr.write(u.format(...s)+` -`)}catch(u){i=(a=console.warn)!=null?a:console.log}}:i=(o=console.warn)!=null?o:console.log,i(`${t} ${r}`,...n)},formatters:{}};function Ja(e){let t={color:Fi[ja++%Fi.length],enabled:Tt.enabled(e),namespace:e,log:Tt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&ur.push([o,...n]),ur.length>Va&&ur.shift(),Tt.enabled(o)||i){let u=n.map(g=>typeof g=="string"?g:Qa(g)),l=`+${Date.now()-Li}ms`;Li=Date.now(),a(o,...u,l)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Ui=new Proxy(Ja,{get:(e,t)=>Tt[t],set:(e,t,r)=>Tt[t]=r});function Qa(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Vi(){ur.length=0}var re=Ui;d();c();p();f();m();d();c();p();f();m();var Qi="library";function At(e){let t=za();return t||((e==null?void 0:e.config.engineType)==="library"?"library":(e==null?void 0:e.config.engineType)==="binary"?"binary":Qi)}function za(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}d();c();p();f();m();d();c();p();f();m();var Se;(t=>{let e;(I=>(I.findUnique="findUnique",I.findUniqueOrThrow="findUniqueOrThrow",I.findFirst="findFirst",I.findFirstOrThrow="findFirstOrThrow",I.findMany="findMany",I.create="create",I.createMany="createMany",I.createManyAndReturn="createManyAndReturn",I.update="update",I.updateMany="updateMany",I.upsert="upsert",I.delete="delete",I.deleteMany="deleteMany",I.groupBy="groupBy",I.count="count",I.aggregate="aggregate",I.findRaw="findRaw",I.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(Se||(Se={}));var it={};nr(it,{error:()=>Xa,info:()=>Za,log:()=>Ya,query:()=>eu,should:()=>Ki,tags:()=>Rt,warn:()=>rn});d();c();p();f();m();var Rt={error:nt("prisma:error"),warn:Ai("prisma:warn"),info:Si("prisma:info"),query:Ri("prisma:query")},Ki={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function Ya(...e){console.log(...e)}function rn(e,...t){Ki.warn()&&console.warn(`${Rt.warn} ${e}`,...t)}function Za(e,...t){console.info(`${Rt.info} ${e}`,...t)}function Xa(e,...t){console.error(`${Rt.error} ${e}`,...t)}function eu(e,...t){console.log(`${Rt.query} ${e}`,...t)}d();c();p();f();m();function je(e,t){throw new Error(t)}d();c();p();f();m();function nn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}d();c();p();f();m();var on=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});d();c();p();f();m();function ot(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}d();c();p();f();m();function sn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{eo.has(e)||(eo.add(e),rn(t,...r))};d();c();p();f();m();var z=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};_(z,"PrismaClientKnownRequestError");var Ie=class extends z{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};_(Ie,"NotFoundError");d();c();p();f();m();var G=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};_(G,"PrismaClientInitializationError");d();c();p();f();m();var ke=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};_(ke,"PrismaClientRustPanicError");d();c();p();f();m();var ae=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};_(ae,"PrismaClientUnknownRequestError");d();c();p();f();m();var ee=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};_(ee,"PrismaClientValidationError");d();c();p();f();m();var St=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};d();c();p();f();m();d();c();p();f();m();function It(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function ru(e,t){let r=It(()=>nu(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function nu(e){return{datamodel:{models:an(e.models),enums:an(e.enums),types:an(e.types)}}}function an(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}d();c();p();f();m();var pr=Symbol(),un=new WeakMap,xe=class{constructor(t){t===pr?un.set(this,`Prisma.${this._getName()}`):un.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return un.get(this)}},kt=class extends xe{_getNamespace(){return"NullTypes"}},Dt=class extends kt{};cn(Dt,"DbNull");var Ot=class extends kt{};cn(Ot,"JsonNull");var Mt=class extends kt{};cn(Mt,"AnyNull");var ln={classes:{DbNull:Dt,JsonNull:Ot,AnyNull:Mt},instances:{DbNull:new Dt(pr),JsonNull:new Ot(pr),AnyNull:new Mt(pr)}};function cn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function Nt(e){return{ok:!1,error:e,map(){return Nt(e)},flatMap(){return Nt(e)}}}var pn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},fn=e=>{let t=new pn,r=Je(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Je(t,e.queryRaw.bind(e)),executeRaw:Je(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>iu(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=ou(t,e.getConnectionInfo.bind(e))),n},iu=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Je(e,t.queryRaw.bind(t)),executeRaw:Je(e,t.executeRaw.bind(t)),commit:Je(e,t.commit.bind(t)),rollback:Je(e,t.rollback.bind(t))});function Je(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return Nt({kind:"GenericJs",id:i})}}}function ou(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return Nt({kind:"GenericJs",id:i})}}}var na=Ue(ro());var yD=Ue(no());Gi();Ei();Ji();d();c();p();f();m();var ue=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){var n;return(n=e.getPropertyDescriptor)==null?void 0:n.call(e,r)}}}d();c();p();f();m();d();c();p();f();m();var fr={enumerable:!0,configurable:!0,writable:!0};function mr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>fr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var so=Symbol.for("nodejs.util.inspect.custom");function ge(e,t){let r=lu(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){var u,l;if(n.has(s))return!0;let a=r.get(s);return a?(l=(u=a.has)==null?void 0:u.call(a,s))!=null?l:!0:Reflect.has(o,s)},ownKeys(o){let s=ao(Reflect.ownKeys(o),r),a=ao(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){var l,g;let u=r.get(s);return((g=(l=u==null?void 0:u.getPropertyDescriptor)==null?void 0:l.call(u,s))==null?void 0:g.writable)===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let u=r.get(s);return u?u.getPropertyDescriptor?{...fr,...u==null?void 0:u.getPropertyDescriptor(s)}:fr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[so]=function(){let o={...this};return delete o[so],o},i}function lu(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function ao(e,t){return e.filter(r=>{var i,o;let n=t.get(r);return(o=(i=n==null?void 0:n.has)==null?void 0:i.call(n,r))!=null?o:!0})}d();c();p();f();m();function st(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}d();c();p();f();m();function dr(e,t){return{batch:e,transaction:(t==null?void 0:t.kind)==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}d();c();p();f();m();d();c();p();f();m();var at=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};d();c();p();f();m();d();c();p();f();m();function uo(e){return e.substring(0,1).toLowerCase()+e.substring(1)}d();c();p();f();m();function ut(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function gr(e){return e.toString()!=="Invalid Date"}d();c();p();f();m();d();c();p();f();m();var lt=9e15,Ne=1e9,mn="0123456789abcdef",yr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",wr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",dn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-lt,maxE:lt,crypto:!1},fo,Pe,F=!0,br="[DecimalError] ",Me=br+"Invalid argument: ",mo=br+"Precision limit exceeded",go=br+"crypto unavailable",ho="[object Decimal]",te=Math.floor,H=Math.pow,cu=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,pu=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,fu=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,yo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,pe=1e7,N=7,mu=9007199254740991,du=yr.length-1,gn=wr.length-1,R={toStringTag:ho};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)};R.ceil=function(){return k(new this.constructor(this),this.e+1,2)};R.clampedTo=R.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Me+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,u=o.s,l=e.s;if(!s||!a)return!u||!l?NaN:u!==l?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};R.cosine=R.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=gu(n,Po(n,r)),n.precision=e,n.rounding=t,k(Pe==2||Pe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};R.cubeRoot=R.cbrt=function(){var e,t,r,n,i,o,s,a,u,l,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(F=!1,o=g.s*H(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Y(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=H(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,u=a.times(a).times(a),l=u.plus(g),n=q(l.plus(g).times(a),l.plus(u),s+2,1),Y(a.d).slice(0,s)===(r=Y(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(k(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(k(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return F=!0,k(n,e,h.rounding,t)};R.decimalPlaces=R.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/N))*N,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};R.dividedBy=R.div=function(e){return q(this,new this.constructor(e))};R.dividedToIntegerBy=R.divToInt=function(e){var t=this,r=t.constructor;return k(q(t,new r(e),0,1,1),r.precision,r.rounding)};R.equals=R.eq=function(e){return this.cmp(e)===0};R.floor=function(){return k(new this.constructor(this),this.e+1,3)};R.greaterThan=R.gt=function(e){return this.cmp(e)>0};R.greaterThanOrEqualTo=R.gte=function(e){var t=this.cmp(e);return t==1||t===0};R.hyperbolicCosine=R.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Pr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=ct(s,1,o.times(t),new s(1),!0);for(var u,l=e,g=new s(8);l--;)u=o.times(o),o=a.minus(u.times(g.minus(u.times(g))));return k(o,s.precision=r,s.rounding=n,!0)};R.hyperbolicSine=R.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=ct(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Pr(5,e)),i=ct(o,2,i,i,!0);for(var s,a=new o(5),u=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(l))))}return o.precision=t,o.rounding=r,k(i,t,r,!0)};R.hyperbolicTangent=R.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,q(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};R.inverseCosine=R.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ce(r,i,o):new r(0):new r(NaN):t.isZero()?ce(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ce(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};R.inverseHyperbolicCosine=R.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,F=!1,r=r.times(r).minus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};R.inverseHyperbolicSine=R.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,F=!1,r=r.times(r).plus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln())};R.inverseHyperbolicTangent=R.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?k(new o(i),e,t,!0):(o.precision=r=n-i.e,i=q(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};R.inverseSine=R.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ce(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};R.inverseTangent=R.atan=function(){var e,t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding;if(l.isFinite()){if(l.isZero())return new g(l);if(l.abs().eq(1)&&h+4<=gn)return s=ce(g,h+4,x).times(.25),s.s=l.s,s}else{if(!l.s)return new g(NaN);if(h+4<=gn)return s=ce(g,h+4,x).times(.5),s.s=l.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/N+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(F=!1,t=Math.ceil(a/N),n=1,u=l.times(l),s=new g(l),i=l;e!==-1;)if(i=i.times(u),o=s.minus(i.div(n+=2)),i=i.times(u),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};R.isNaN=function(){return!this.s};R.isNegative=R.isNeg=function(){return this.s<0};R.isPositive=R.isPos=function(){return this.s>0};R.isZero=function(){return!!this.d&&this.d[0]===0};R.lessThan=R.lt=function(e){return this.cmp(e)<0};R.lessThanOrEqualTo=R.lte=function(e){return this.cmp(e)<1};R.logarithm=R.log=function(e){var t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new g(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(F=!1,a=h+S,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),Ft(u.d,i=h,x))do if(a+=10,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),!o){+Y(u.d).slice(i+1,i+15)+1==1e14&&(u=k(u,h+1,0));break}while(Ft(u.d,i+=10,x));return F=!0,k(u,h,x)};R.minus=R.sub=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.constructor;if(e=new C(e),!S.d||!e.d)return!S.s||!e.s?e=new C(NaN):S.d?e.s=-e.s:e=new C(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(l=S.d,x=e.d,a=C.precision,u=C.rounding,!l[0]||!x[0]){if(x[0])e.s=-e.s;else if(l[0])e=new C(S);else return new C(u===3?-0:0);return F?k(e,a,u):e}if(r=te(e.e/N),g=te(S.e/N),l=l.slice(),o=g-r,o){for(h=o<0,h?(t=l,o=-o,s=x.length):(t=x,r=g,s=l.length),n=Math.max(Math.ceil(a/N),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=x.length,h=n0;--n)l[s++]=0;for(n=x.length;n>o;){if(l[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=g.length,s-i<0&&(i=s,r=g,g=l,l=r),t=0;i;)t=(l[--i]=l[i]+g[i]+t)/pe|0,l[i]%=pe;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=xr(l,n),F?k(e,a,u):e};R.precision=R.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Me+e);return r.d?(t=wo(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};R.round=function(){var e=this,t=e.constructor;return k(new t(e),e.e+1,t.rounding)};R.sine=R.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=yu(n,Po(n,r)),n.precision=e,n.rounding=t,k(Pe>2?r.neg():r,e,t,!0)):new n(NaN)};R.squareRoot=R.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,u=s.e,l=s.s,g=s.constructor;if(l!==1||!a||!a[0])return new g(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(F=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Y(a),(t.length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=te((u+1)/2)-(u<0||u%2),l==1/0?t="5e"+u:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),n=new g(t)):n=new g(l.toString()),r=(u=g.precision)+3;;)if(o=n,n=o.plus(q(s,o,r+2,1)).times(.5),Y(o.d).slice(0,r)===(t=Y(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(k(o,u+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(n,u+1,1),e=!n.times(n).eq(s));break}return F=!0,k(n,u,g.rounding,e)};R.tangent=R.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=q(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,k(Pe==2||Pe==4?r.neg():r,e,t,!0)):new n(NaN)};R.times=R.mul=function(e){var t,r,n,i,o,s,a,u,l,g=this,h=g.constructor,x=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!x||!x[0]||!S||!S[0])return new h(!e.s||x&&!x[0]&&!S||S&&!S[0]&&!x?NaN:!x||!S?e.s/0:e.s*0);for(r=te(g.e/N)+te(e.e/N),u=x.length,l=S.length,u=0;){for(t=0,i=u+n;i>n;)a=o[i]+S[n]*x[i-n-1]+t,o[i--]=a%pe|0,t=a/pe|0;o[i]=(o[i]+t)%pe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=xr(o,r),F?k(e,h.precision,h.rounding):e};R.toBinary=function(e,t){return wn(this,2,e,t)};R.toDecimalPlaces=R.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(oe(e,0,Ne),t===void 0?t=n.rounding:oe(t,0,8),k(r,e+r.e+1,t))};R.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,!0):(oe(e,0,Ne),t===void 0?t=i.rounding:oe(t,0,8),n=k(new i(n),e+1,t),r=he(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=he(i):(oe(e,0,Ne),t===void 0?t=o.rounding:oe(t,0,8),n=k(new o(i),e+i.e+1,t),r=he(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};R.toFraction=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.d,A=S.constructor;if(!C)return new A(S);if(l=r=new A(1),n=u=new A(0),t=new A(n),o=t.e=wo(C)-S.e-1,s=o%N,t.d[0]=H(10,s<0?N+s:s),e==null)e=o>0?t:l;else{if(a=new A(e),!a.isInt()||a.lt(l))throw Error(Me+a);e=a.gt(t)?o>0?t:l:a}for(F=!1,a=new A(Y(C)),g=A.precision,A.precision=o=C.length*N*2;h=q(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=u.plus(h.times(i)),u=i,i=t,t=a.minus(h.times(i)),a=i;return i=q(e.minus(r),n,0,1,1),u=u.plus(i.times(l)),r=r.plus(i.times(n)),u.s=l.s=S.s,x=q(l,n,o,1).minus(S).abs().cmp(q(u,r,o,1).minus(S).abs())<1?[l,n]:[u,r],A.precision=g,F=!0,x};R.toHexadecimal=R.toHex=function(e,t){return wn(this,16,e,t)};R.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:oe(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(F=!1,r=q(r,e,0,t,1).times(e),F=!0,k(r)):(e.s=r.s,r=e),r};R.toNumber=function(){return+this};R.toOctal=function(e,t){return wn(this,8,e,t)};R.toPower=R.pow=function(e){var t,r,n,i,o,s,a=this,u=a.constructor,l=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(H(+a,l));if(a=new u(a),a.eq(1))return a;if(n=u.precision,o=u.rounding,e.eq(1))return k(a,n,o);if(t=te(e.e/N),t>=e.d.length-1&&(r=l<0?-l:l)<=mu)return i=Eo(u,a,r,n),e.s<0?new u(1).div(i):k(i,n,o);if(s=a.s,s<0){if(tu.maxE+1||t0?s/0:0):(F=!1,u.rounding=a.s=1,r=Math.min(12,(t+"").length),i=hn(e.times(Oe(a,n+r)),n),i.d&&(i=k(i,n+5,1),Ft(i.d,n,o)&&(t=n+10,i=k(hn(e.times(Oe(a,t+r)),t),t+5,1),+Y(i.d).slice(n+1,n+15)+1==1e14&&(i=k(i,n+1,0)))),i.s=s,F=!0,u.rounding=o,k(i,n,o))};R.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,Ne),t===void 0?t=i.rounding:oe(t,0,8),n=k(new i(n),e,t),r=he(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toSignificantDigits=R.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(oe(e,1,Ne),t===void 0?t=n.rounding:oe(t,0,8)),k(new n(r),e,t)};R.toString=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};R.truncated=R.trunc=function(){return k(new this.constructor(this),this.e+1,1)};R.valueOf=R.toJSON=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Y(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Me+e)}function Ft(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=N,i=0):(i=Math.ceil((t+1)/N),t%=N),o=H(10,N-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,s}function hr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function gu(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Pr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ct(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var q=function(){function e(n,i,o){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*i+a,n[u]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;ai[a]?1:-1;break}return u}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,u){var l,g,h,x,S,C,A,D,O,B,M,I,Z,L,Ye,Be,fe,$e,Q,Ce,qe=n.constructor,Ze=n.s==i.s?1:-1,X=n.d,U=i.d;if(!X||!X[0]||!U||!U[0])return new qe(!n.s||!i.s||(X?U&&X[0]==U[0]:!U)?NaN:X&&X[0]==0||!U?Ze*0:Ze/0);for(u?(S=1,g=n.e-i.e):(u=pe,S=N,g=te(n.e/S)-te(i.e/S)),Q=U.length,fe=X.length,O=new qe(Ze),B=O.d=[],h=0;U[h]==(X[h]||0);h++);if(U[h]>(X[h]||0)&&g--,o==null?(L=o=qe.precision,s=qe.rounding):a?L=o+(n.e-i.e)+1:L=o,L<0)B.push(1),C=!0;else{if(L=L/S+2|0,h=0,Q==1){for(x=0,U=U[0],L++;(h1&&(U=e(U,x,u),X=e(X,x,u),Q=U.length,fe=X.length),Be=Q,M=X.slice(0,Q),I=M.length;I=u/2&&++$e;do x=0,l=t(U,M,Q,I),l<0?(Z=M[0],Q!=I&&(Z=Z*u+(M[1]||0)),x=Z/$e|0,x>1?(x>=u&&(x=u-1),A=e(U,x,u),D=A.length,I=M.length,l=t(A,M,D,I),l==1&&(x--,r(A,Q=10;x/=10)h++;O.e=h+g*S-1,k(O,a?o+O.e+1:o,s,C)}return O}}();function k(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=N,s=t,g=h[x=0],u=g/H(10,i-s-1)%10|0;else if(x=Math.ceil((o+1)/N),a=h.length,x>=a)if(n){for(;a++<=x;)h.push(0);g=u=0,i=1,o%=N,s=o-N+1}else break e;else{for(g=a=h[x],i=1;a>=10;a/=10)i++;o%=N,s=o-N+i,u=s<0?0:g/H(10,i-s-1)%10|0}if(n=n||t<0||h[x+1]!==void 0||(s<0?g:g%H(10,i-s-1)),l=r<4?(u||n)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(o>0?s>0?g/H(10,i-s):0:h[x-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,l?(t-=e.e+1,h[0]=H(10,(N-t%N)%N),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=x,a=1,x--):(h.length=x+1,a=H(10,N-o),h[x]=s>0?(g/H(10,i-s)%H(10,s)|0)*a:0),l)for(;;)if(x==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==pe&&(h[0]=1));break}else{if(h[x]+=a,h[x]!=pe)break;h[x--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return F&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+De(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+De(-i-1)+o,r&&(n=r-s)>0&&(o+=De(n))):i>=s?(o+=De(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+De(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=De(n))),o}function xr(e,t){var r=e[0];for(t*=N;r>=10;r/=10)t++;return t}function Er(e,t,r){if(t>du)throw F=!0,r&&(e.precision=r),Error(mo);return k(new e(yr),t,1,!0)}function ce(e,t,r){if(t>gn)throw Error(mo);return k(new e(wr),t,r,!0)}function wo(e){var t=e.length-1,r=t*N+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function De(e){for(var t="";e--;)t+="0";return t}function Eo(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/N+4);for(F=!1;;){if(r%2&&(o=o.times(t),co(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),co(t.d,s)}return F=!0,o}function lo(e){return e.d[e.d.length-1]&1}function bo(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new x(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(F=!1,u=C):u=t,a=new x(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(H(2,h))/Math.LN10*2+5|0,u+=n,r=o=s=new x(1),x.precision=u;;){if(o=k(o.times(e),u,1),r=r.times(++g),a=s.plus(q(o,r,u,1)),Y(a.d).slice(0,u)===Y(s.d).slice(0,u)){for(i=h;i--;)s=k(s.times(s),u,1);if(t==null)if(l<3&&Ft(s.d,u-n,S,l))x.precision=u+=10,r=o=a=new x(1),g=0,l++;else return k(s,x.precision=C,S,F=!0);else return x.precision=C,s}s=a}}function Oe(e,t){var r,n,i,o,s,a,u,l,g,h,x,S=1,C=10,A=e,D=A.d,O=A.constructor,B=O.rounding,M=O.precision;if(A.s<0||!D||!D[0]||!A.e&&D[0]==1&&D.length==1)return new O(D&&!D[0]?-1/0:A.s!=1?NaN:D?0:A);if(t==null?(F=!1,g=M):g=t,O.precision=g+=C,r=Y(D),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Y(A.d),n=r.charAt(0),S++;o=A.e,n>1?(A=new O("0."+r),o++):A=new O(n+"."+r.slice(1))}else return l=Er(O,g+2,M).times(o+""),A=Oe(new O(n+"."+r.slice(1)),g-C).plus(l),O.precision=M,t==null?k(A,M,B,F=!0):A;for(h=A,u=s=A=q(A.minus(1),A.plus(1),g,1),x=k(A.times(A),g,1),i=3;;){if(s=k(s.times(x),g,1),l=u.plus(q(s,new O(i),g,1)),Y(l.d).slice(0,g)===Y(u.d).slice(0,g))if(u=u.times(2),o!==0&&(u=u.plus(Er(O,g+2,M).times(o+""))),u=q(u,new O(S),g,1),t==null)if(Ft(u.d,g-C,B,a))O.precision=g+=C,l=s=A=q(h.minus(1),h.plus(1),g,1),x=k(A.times(A),g,1),i=a=1;else return k(u,O.precision=M,B,F=!0);else return O.precision=M,u;u=l,i+=2}}function xo(e){return String(e.s*e.s/0)}function yn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%N,r<0&&(n+=N),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),yo.test(t))return yn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(pu.test(t))r=16,t=t.toLowerCase();else if(cu.test(t))r=2;else if(fu.test(t))r=8;else throw Error(Me+t);for(o=t.search(/p/i),o>0?(u=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Eo(n,new n(r),o,o*2)),l=hr(t,r,pe),g=l.length-1,o=g;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=xr(l,g),e.d=l,F=!1,s&&(e=q(e,i,a*4)),u&&(e=e.times(Math.abs(u)<54?H(2,u):Ge.pow(2,u))),F=!0,e)}function yu(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ct(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Pr(5,r)),t=ct(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function ct(e,t,r,n,i){var o,s,a,u,l=1,g=e.precision,h=Math.ceil(g/N);for(F=!1,u=r.times(r),a=new e(n);;){if(s=q(a.times(u),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=q(s.times(u),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,l++}return F=!0,s.d.length=h+1,s}function Pr(e,t){for(var r=e;--t;)r*=e;return r}function Po(e,t){var r,n=t.s<0,i=ce(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Pe=n?4:1,t;if(r=t.divToInt(i),r.isZero())Pe=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Pe=lo(r)?n?2:3:n?4:1,t;Pe=lo(r)?n?1:4:n?3:2}return t.minus(i).abs()}function wn(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor,C=r!==void 0;if(C?(oe(r,1,Ne),n===void 0?n=S.rounding:oe(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=xo(e);else{for(g=he(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),x=new S(1),x.e=g.length-s,x.d=hr(he(x),10,i),x.e=x.d.length),h=hr(g,10,i),o=u=h.length;h[--u]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=q(e,x,r,n,0,i),h=e.d,o=e.e,l=fo),s=h[r],a=i/2,l=l||h[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,l)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(u=h.length;!h[u-1];--u);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)g+="0";for(h=hr(g,i,t),u=h.length;!h[u-1];--u);for(s=1,g="1.";su)for(o-=u;o--;)g+="0";else ot)return e.length=t,!0}function wu(e){return new this(e).abs()}function Eu(e){return new this(e).acos()}function bu(e){return new this(e).acosh()}function xu(e,t){return new this(e).plus(t)}function Pu(e){return new this(e).asin()}function vu(e){return new this(e).asinh()}function Tu(e){return new this(e).atan()}function Cu(e){return new this(e).atanh()}function Au(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ce(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ce(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ce(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(q(e,t,o,1)),t=ce(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(q(e,t,o,1)),r}function Ru(e){return new this(e).cbrt()}function Su(e){return k(e=new this(e),e.e+1,2)}function Iu(e,t,r){return new this(e).clamp(t,r)}function ku(e){if(!e||typeof e!="object")throw Error(br+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ne,"rounding",0,8,"toExpNeg",-lt,0,"toExpPos",0,lt,"maxE",0,lt,"minE",-lt,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Me+r+": "+n);if(r="crypto",i&&(this[r]=dn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(go);else this[r]=!1;else throw Error(Me+r+": "+n);return this}function Du(e){return new this(e).cos()}function Ou(e){return new this(e).cosh()}function vo(e){var t,r,n;function i(o){var s,a,u,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,po(o)){l.s=o.s,F?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e=10;a/=10)s++;F?s>i.maxE?(l.e=NaN,l.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(go);else for(;o=10;i/=10)n++;n`}};function ft(e){return e instanceof Lt}d();c();p();f();m();d();c();p();f();m();var vr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};d();c();p();f();m();var Tr=e=>e,Cr={bold:Tr,red:Tr,green:Tr,dim:Tr,enabled:!1},To={bold:sr,red:nt,green:Ci,dim:ar,enabled:!0},mt={write(e){e.writeLine(",")}};d();c();p();f();m();var ye=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};d();c();p();f();m();var _e=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var dt=class extends _e{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new vr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new ye("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(mt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};d();c();p();f();m();var Co=": ",Ar=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Co.length}write(t){let r=new ye(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Co).write(this.value)}};d();c();p();f();m();var Rr=class e extends _e{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let u;if(s.value instanceof e?u=s.value.getField(a):s.value instanceof dt&&(u=s.value.getField(Number(a))),!u)return;s=u}return s}getDeepFieldValue(r){var n;return r.length===0?this:(n=this.getDeepField(r))==null?void 0:n.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){var n;return(n=this.getField(r))==null?void 0:n.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){var i,o;let r=(i=this.getField("select"))==null?void 0:i.value.asObject();if(r)return{kind:"select",value:r};let n=(o=this.getField("include"))==null?void 0:o.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){var n;return(n=this.getSelectionParent())==null?void 0:n.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new ye("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(mt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};d();c();p();f();m();var K=class extends _e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new ye(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var En=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Sr(e){return new En(Ao(e))}function Ao(e){let t=new Rr;for(let[r,n]of Object.entries(e)){let i=new Ar(r,Ro(n));t.addField(i)}return t}function Ro(e){if(typeof e=="string")return new K(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new K(String(e));if(typeof e=="bigint")return new K(`${e}n`);if(e===null)return new K("null");if(e===void 0)return new K("undefined");if(pt(e))return new K(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new K(`Buffer.alloc(${e.byteLength})`):new K(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=gr(e)?e.toISOString():"Invalid Date";return new K(`new Date("${t}")`)}return e instanceof xe?new K(`Prisma.${e._getName()}`):ft(e)?new K(`prisma.${uo(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?il(e):typeof e=="object"?Ao(e):new K(Object.prototype.toString.call(e))}function il(e){let t=new dt;for(let r of e)t.addItem(Ro(r));return t}function So(e){if(e===void 0)return"";let t=Sr(e);return new at(0,{colors:Cr}).write(t).toString()}d();c();p();f();m();var ol="P2037";function Bt({error:e,user_facing_error:t},r,n){return t.error_code?new z(sl(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new ae(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function sl(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===ol&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var bn=class{getLocation(){return null}};function Fe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new bn}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Io={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function gt(e={}){let t=ul(e);return Object.entries(t).reduce((n,[i,o])=>(Io[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function ul(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Ir(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ko(e,t){let r=Ir(e);return t({action:"aggregate",unpacker:r,argsMapper:gt})(e)}d();c();p();f();m();function ll(e={}){let{select:t,...r}=e;return typeof t=="object"?gt({...r,_count:t}):gt({...r,_count:{_all:!0}})}function cl(e={}){return typeof e.select=="object"?t=>Ir(e)(t)._count:t=>Ir(e)(t)._count._all}function Do(e,t){return t({action:"count",unpacker:cl(e),argsMapper:ll})(e)}d();c();p();f();m();function pl(e={}){let t=gt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function fl(e={}){return t=>(typeof(e==null?void 0:e._count)=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Oo(e,t){return t({action:"groupBy",unpacker:fl(e),argsMapper:pl})(e)}function Mo(e,t,r){if(t==="aggregate")return n=>ko(n,r);if(t==="count")return n=>Do(n,r);if(t==="groupBy")return n=>Oo(n,r)}d();c();p();f();m();function No(e,t){let r=t.fields.filter(i=>!i.relationName),n=on(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Lt(e,o,s.type,s.isList,s.kind==="enum")},...mr(Object.keys(n))})}d();c();p();f();m();d();c();p();f();m();var _o=e=>Array.isArray(e)?e:e.split("."),xn=(e,t)=>_o(t).reduce((r,n)=>r&&r[n],e),Fo=(e,t,r)=>_o(t).reduceRight((n,i,o,s)=>Object.assign({},xn(e,s.slice(0,o)),{[i]:n}),r);function ml(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function dl(e,t,r){return t===void 0?e!=null?e:{}:Fo(t,r,e||!0)}function Pn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((u,l)=>({...u,[l.name]:l}),{});return u=>{let l=Fe(e._errorFormat),g=ml(n,i),h=dl(u,o,g),x=r({dataPath:g,callsite:l})(h),S=gl(e,t);return new Proxy(x,{get(C,A){if(!S.includes(A))return C[A];let O=[a[A].type,r,A],B=[g,h];return Pn(e,...O,...B)},...mr([...S,...Object.getOwnPropertyNames(x)])})}}function gl(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}d();c();p();f();m();d();c();p();f();m();var hl=Ue(Wi());var yl={red:nt,gray:Ii,dim:ar,bold:sr,underline:Ti,highlightSource:e=>e.highlight()},wl={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function El({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r!=null?r:!1,callArguments:n}}function bl({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],u=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${u}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${u}`)),t&&a.push(s.underline(xl(t))),i){a.push("");let l=[i.toString()];o&&(l.push(o),l.push(s.dim(")"))),a.push(l.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function xl(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function ht(e){let t=e.showColors?yl:wl,r;return typeof $getTemplateParameters!="undefined"?r=$getTemplateParameters(e,t):r=El(e),bl(r,t)}function Lo(e,t,r,n){return e===Se.ModelAction.findFirstOrThrow||e===Se.ModelAction.findUniqueOrThrow?Pl(t,r,n):n}function Pl(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=ht({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new ee(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof z&&o.code==="P2025"?new Ie(`No ${e} found`,t):o})}}d();c();p();f();m();function we(e){return e.replace(/^./,t=>t.toLowerCase())}var vl=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Tl=["aggregate","count","groupBy"];function vn(e,t){var i;let r=(i=e._extensions.getAllModelExtensions(t))!=null?i:{},n=[Cl(e,t),Rl(e,t),_t(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return ge({},n)}function Cl(e,t){let r=we(t),n=Object.keys(Se.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=u=>e._request(u);s=Lo(o,t,e._clientVersion,s);let a=u=>l=>{let g=Fe(e._errorFormat);return e._createPrismaPromise(h=>{let x={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...x,...u})})};return vl.includes(o)?Pn(e,t,a):Al(i)?Mo(e,i,a):a({})}}}function Al(e){return Tl.includes(e)}function Rl(e,t){return Qe(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return No(t,r)}))}d();c();p();f();m();function Bo(e){return e.replace(/^./,t=>t.toUpperCase())}var Tn=Symbol();function $t(e){let t=[Sl(e),ne(Tn,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(_t(r)),ge(e,t)}function Sl(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(we),n=[...new Set(t.concat(r))];return Qe({getKeys(){return n},getPropertyValue(i){let o=Bo(i);if(e._runtimeDataModel.models[o]!==void 0)return vn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return vn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function $o(e){return e[Tn]?e[Tn]:e}function qo(e){var r;if(typeof e=="function")return e(this);if((r=e.client)!=null&&r.__AccelerateEngine){let n=e.client.__AccelerateEngine;this._originalClient._engine=new n(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return $t(t)}d();c();p();f();m();d();c();p();f();m();function Uo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let u of Object.values(o)){if(n){if(n[u.name])continue;let l=u.needs.filter(g=>n[g]);l.length>0&&a.push(st(l))}else if(r){if(!r[u.name])continue;let l=u.needs.filter(g=>!r[g]);l.length>0&&a.push(st(l))}Il(e,u.needs)&&s.push(kl(u,ge(e,s)))}return s.length>0||a.length>0?ge(e,[...s,...a]):e}function Il(e,t){return t.every(r=>nn(e,r))}function kl(e,t){return Qe(ne(e.name,()=>e.compute(t)))}d();c();p();f();m();function kr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){var s;if(Array.isArray(t)){for(let a=0;ag.name===o);if(!u||u.kind!=="object"||!u.relationName)continue;let l=typeof s=="object"?s:{};t[o]=kr({visitor:i,result:t[o],args:l,modelName:u.type,runtimeDataModel:n})}}function jo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:kr({result:e,args:r!=null?r:{},modelName:t,runtimeDataModel:i,visitor:(s,a,u)=>Uo({result:s,modelName:we(a),select:u.select,omit:u.omit,extensions:n})})}d();c();p();f();m();d();c();p();f();m();function Jo(e){if(e instanceof ue)return Dl(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{var s,a;let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(((s=t.transaction)==null?void 0:s.kind)==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Jo((a=t.args)!=null?a:{}),__internalParams:t,query:(u,l=t)=>{let g=l.customDataProxyFetch;return l.customDataProxyFetch=zo(o,g),l.args=u,Go(e,l,r,n+1)}})})}function Ho(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r!=null?r:"$none",o);return Go(e,t,s)}function Wo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Ko(r,n,0,e):e(r)}}function Ko(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let u=a.customDataProxyFetch;return a.customDataProxyFetch=zo(i,u),Ko(a,t,r+1,n)}})}var Qo=e=>e;function zo(e=Qo,t=Qo){return r=>e(t(r))}d();c();p();f();m();d();c();p();f();m();function Zo(e,t,r){let n=we(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Ol({...e,...Yo(t.name,e,t.result.$allModels),...Yo(t.name,e,t.result[n])})}function Ol(e){let t=new de,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return ot(e,n=>({...n,needs:r(n.name,new Set)}))}function Yo(e,t,r){return r?ot(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Ml(t,o,i)})):{}}function Ml(e,t,r){var i;let n=(i=e==null?void 0:e[t])==null?void 0:i.compute;return n?o=>r({...o,[t]:n(o)}):r}function Xo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function es(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Dr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new de;this.modelExtensionsCache=new de;this.queryCallbacksCache=new de;this.clientExtensions=It(()=>{var t,r;return this.extension.client?{...(r=this.previous)==null?void 0:r.getAllClientExtensions(),...this.extension.client}:(t=this.previous)==null?void 0:t.getAllClientExtensions()});this.batchCallbacks=It(()=>{var n,i,o;let t=(i=(n=this.previous)==null?void 0:n.getAllBatchQueryCallbacks())!=null?i:[],r=(o=this.extension.query)==null?void 0:o.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>{var r;return Zo((r=this.previous)==null?void 0:r.getAllComputedFields(t),this.extension,t)})}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{var n,i;let r=we(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?(n=this.previous)==null?void 0:n.getAllModelExtensions(t):{...(i=this.previous)==null?void 0:i.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{var s,a;let n=(a=(s=this.previous)==null?void 0:s.getAllQueryCallbacks(t,r))!=null?a:[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Or=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Dr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Dr(t,this.head))}getAllComputedFields(t){var r;return(r=this.head)==null?void 0:r.getAllComputedFields(t)}getAllClientExtensions(){var t;return(t=this.head)==null?void 0:t.getAllClientExtensions()}getAllModelExtensions(t){var r;return(r=this.head)==null?void 0:r.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){var n,i;return(i=(n=this.head)==null?void 0:n.getAllQueryCallbacks(t,r))!=null?i:[]}getAllBatchQueryCallbacks(){var t,r;return(r=(t=this.head)==null?void 0:t.getAllBatchQueryCallbacks())!=null?r:[]}};d();c();p();f();m();var ts=re("prisma:client"),rs={Vercel:"vercel","Netlify CI":"netlify"};function ns({postinstall:e,ciName:t,clientVersion:r}){if(ts("checkPlatformCaching:postinstall",e),ts("checkPlatformCaching:ciName",t),e===!0&&t&&t in rs){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${rs[t]}-build`;throw console.error(n),new G(n,r)}}d();c();p();f();m();function is(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Nl="Cloudflare-Workers",_l="node";function os(){var e,t,r;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Nl?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((r=(t=globalThis.process)==null?void 0:t.release)==null?void 0:r.name)===_l?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var Fl={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Cn(){let e=os();return{id:e,prettyName:Fl[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function yt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){var u,l;let i,o=Object.keys(e)[0],s=(u=e[o])==null?void 0:u.url,a=(l=t[o])==null?void 0:l.url;if(o===void 0?i=void 0:a?i=a:s!=null&&s.value?i=s.value:s!=null&&s.fromEnvVar&&(i=r[s.fromEnvVar]),(s==null?void 0:s.fromEnvVar)!==void 0&&i===void 0)throw Cn().id==="workerd"?new G(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new G(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new G("error: Missing URL environment variable, value, or override.",n);return i}d();c();p();f();m();d();c();p();f();m();var Mr=class extends Error{constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var se=class extends Mr{constructor(t,r){var n;super(t,r),this.isRetryable=(n=r.isRetryable)!=null?n:!0}};d();c();p();f();m();d();c();p();f();m();function $(e,t){return{...e,isRetryable:t}}var wt=class extends se{constructor(r){super("This request must be retried",$(r,!0));this.name="ForcedRetryError";this.code="P5001"}};_(wt,"ForcedRetryError");d();c();p();f();m();var He=class extends se{constructor(r,n){super(r,$(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};_(He,"InvalidDatasourceError");d();c();p();f();m();var We=class extends se{constructor(r,n){super(r,$(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};_(We,"NotImplementedYetError");d();c();p();f();m();d();c();p();f();m();var j=class extends se{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 Ke=class extends j{constructor(r){super("Schema needs to be uploaded",$(r,!0));this.name="SchemaMissingError";this.code="P5005"}};_(Ke,"SchemaMissingError");d();c();p();f();m();d();c();p();f();m();var An="This request could not be understood by the server",Ut=class extends j{constructor(r,n,i){super(n||An,$(r,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};_(Ut,"BadRequestError");d();c();p();f();m();var Vt=class extends j{constructor(r,n){super("Engine not started: healthcheck timeout",$(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};_(Vt,"HealthcheckTimeoutError");d();c();p();f();m();var jt=class extends j{constructor(r,n,i){super(n,$(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};_(jt,"EngineStartupError");d();c();p();f();m();var Jt=class extends j{constructor(r){super("Engine version is not supported",$(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};_(Jt,"EngineVersionNotSupportedError");d();c();p();f();m();var Rn="Request timed out",Qt=class extends j{constructor(r,n=Rn){super(n,$(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};_(Qt,"GatewayTimeoutError");d();c();p();f();m();var Ll="Interactive transaction error",Gt=class extends j{constructor(r,n=Ll){super(n,$(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};_(Gt,"InteractiveTransactionError");d();c();p();f();m();var Bl="Request parameters are invalid",Ht=class extends j{constructor(r,n=Bl){super(n,$(r,!1));this.name="InvalidRequestError";this.code="P5011"}};_(Ht,"InvalidRequestError");d();c();p();f();m();var Sn="Requested resource does not exist",Wt=class extends j{constructor(r,n=Sn){super(n,$(r,!1));this.name="NotFoundError";this.code="P5003"}};_(Wt,"NotFoundError");d();c();p();f();m();var In="Unknown server error",Et=class extends j{constructor(r,n,i){super(n||In,$(r,!0));this.name="ServerError";this.code="P5006";this.logs=i}};_(Et,"ServerError");d();c();p();f();m();var kn="Unauthorized, check your connection string",Kt=class extends j{constructor(r,n=kn){super(n,$(r,!1));this.name="UnauthorizedError";this.code="P5007"}};_(Kt,"UnauthorizedError");d();c();p();f();m();var Dn="Usage exceeded, retry again later",zt=class extends j{constructor(r,n=Dn){super(n,$(r,!0));this.name="UsageExceededError";this.code="P5008"}};_(zt,"UsageExceededError");async function $l(e){let t;try{t=await e.text()}catch(r){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(r){return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Yt(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await $l(e);if(n.type==="QueryEngineError")throw new z(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Et(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Ke(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Jt(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new jt(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new G(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Vt(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 Gt(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Ht(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Kt(r,bt(kn,n));if(e.status===404)return new Wt(r,bt(Sn,n));if(e.status===429)throw new zt(r,bt(Dn,n));if(e.status===504)throw new Qt(r,bt(Rn,n));if(e.status>=500)throw new Et(r,bt(In,n));if(e.status>=400)throw new Ut(r,bt(An,n))}function bt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}d();c();p();f();m();function ss(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))}d();c();p();f();m();var Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function as(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,u,l,g;for(let h=0;h>18,a=(g&258048)>>12,u=(g&4032)>>6,l=g&63,r+=Te[s]+Te[a]+Te[u]+Te[l];return i==1?(g=t[o],s=(g&252)>>2,a=(g&3)<<4,r+=Te[s]+Te[a]+"=="):i==2&&(g=t[o]<<8|t[o+1],s=(g&64512)>>10,a=(g&1008)>>4,u=(g&15)<<2,r+=Te[s]+Te[a]+Te[u]+"="),r}d();c();p();f();m();function us(e){var r;if(!!((r=e.generator)!=null&&r.previewFeatures.some(n=>n.toLowerCase().includes("metrics"))))throw new G("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)}d();c();p();f();m();function ql(e){return e[0]*1e3+e[1]/1e6}function ls(e){return new Date(ql(e))}d();c();p();f();m();var cs={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};d();c();p();f();m();d();c();p();f();m();var Zt=class extends se{constructor(r,n){super(`Cannot fetch data from service: -${r}`,$(n,!0));this.name="RequestError";this.code="P5010"}};_(Zt,"RequestError");async function ze(e,t,r=n=>n){var i;let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(On)(e,t)}catch(o){let s=(i=o.message)!=null?i:"Unknown error";throw new Zt(s,{clientVersion:n})}}function Vl(e){return{...e.headers,"Content-Type":"application/json"}}function jl(e){return{method:e.method,headers:Vl(e)}}function Jl(e,t){return{text:()=>Promise.resolve(w.Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(w.Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new Mn(t.headers)}}async function On(e,t={}){let r=Ql("https"),n=jl(t),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{var l;let u=r.request(e,n,g=>{let{statusCode:h,headers:{location:x}}=g;h>=301&&h<=399&&x&&(x.startsWith("http")===!1?s(On(`${o}${x}`,t)):s(On(x,t))),g.on("data",S=>i.push(S)),g.on("end",()=>s(Jl(i,g))),g.on("error",a)});u.on("error",a),u.end((l=t.body)!=null?l:"")})}var Ql=typeof Pt!="undefined"?Pt:()=>{},Mn=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let i of n)this.headers.set(r,i)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){var r;return(r=this.headers.get(t))!=null?r:null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,i]of this.headers)t.call(r,i,n,this)}};var Gl=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,ps=re("prisma:client:dataproxyEngine");async function Hl(e,t){var s,a,u;let r=cs["@prisma/engines-version"],n=(s=t.clientVersion)!=null?s:"unknown";if(y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=(a=n==null?void 0:n.split("-"))!=null?a:[];if(o===void 0&&Gl.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[l]=(u=r.split("-"))!=null?u:[],[g,h,x]=l.split("."),S=Wl(`<=${g}.${h}.${x}`),C=await ze(S,{clientVersion:n});if(!C.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${C.status} ${C.statusText}, response body: ${await C.text()||""}`);let A=await C.text();ps("length of body fetched from unpkg.com",A.length);let D;try{D=JSON.parse(A)}catch(O){throw console.error("JSON.parse error: body fetched from unpkg.com: ",A),O}return D.version}throw new We("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function fs(e,t){let r=await Hl(e,t);return ps("version",r),r}function Wl(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var ms=3,Nn=re("prisma:client:dataproxyEngine"),_n=class{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!=null?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}},Xt=class{constructor(t){this.name="DataProxyEngine";us(t),this.config=t,this.env={...t.env,...typeof y!="undefined"?y.env:{}},this.inlineSchema=as(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[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new _n({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await fs(t,this.config),Nn("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){var r,n;(r=t==null?void 0:t.logs)!=null&&r.length&&t.logs.forEach(i=>{switch(i.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let o=typeof i.attributes.query=="string"?i.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[s]=o.split("/* traceparent");o=s}this.logEmitter.emit("query",{query:o,timestamp:ls(i.timestamp),duration:Number(i.attributes.duration_ms),params:i.attributes.params,target:i.attributes.target})}}}),(n=t==null?void 0:t.traces)!=null&&n.length&&this.tracingHelper.createEngineSpan({span:!0,spans:t.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await ze(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Nn("schema response status",r.status);let n=await Yt(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==null?void 0:n.kind)==="itx"?n.options:void 0,s=dr(t,n),{batchResult:a,elapsed:u}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r});return a.map(l=>"errors"in l&&l.errors.length>0?Bt(l.errors[0],this.clientVersion,this.config.activeProvider):{data:l,elapsed:u})}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 ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Nn("graphql response status",a.status),await this.handleError(await Yt(a,this.clientVersion));let u=await a.json(),l=u.extensions;if(l&&this.propagateResponseExtensions(l),u.errors)throw u.errors.length===1?Bt(u.errors[0],this.config.clientVersion,this.config.activeProvider):new ae(u.errors,{clientVersion:this.config.clientVersion});return u}})}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 u=await ze(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Yt(u,this.clientVersion));let l=await u.json(),g=l.extensions;g&&this.propagateResponseExtensions(g);let h=l.id,x=l["data-proxy"].endpoint;return{id:h,payload:{endpoint:x}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Yt(a,this.clientVersion));let l=(await a.json()).extensions;l&&this.propagateResponseExtensions(l);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=yt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch(l){throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:")throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let u=a.get("api_key");if(u===null||u.length<1)throw new He(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,u]}metrics(){throw new We("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){var r;for(let n=0;;n++){let i=o=>{this.logEmitter.emit("info",{message:`Calling ${o} (n=${n})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:i})}catch(o){if(!(o instanceof se)||!o.isRetryable)throw o;if(n>=ms)throw o instanceof wt?o.cause:o;this.logEmitter.emit("warn",{message:`Attempt ${n+1}/${ms} failed for ${t.actionGerund}: ${(r=o.message)!=null?r:"(unknown)"}`,timestamp:new Date,target:""});let s=await ss(n);this.logEmitter.emit("warn",{message:`Retrying after ${s}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof Ke)throw await this.uploadSchema(),new wt({clientVersion:this.clientVersion,cause:t});if(t)throw t}applyPendingMigrations(){throw new Error("Method not implemented.")}};function ds({copyEngine:e=!0},t){let r;try{r=yt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch(u){}e&&(r!=null&&r.startsWith("prisma://"))&&cr("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=At(t.generator),i=!!(r!=null&&r.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o){let u;throw u=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new ee(u.join(` -`),{clientVersion:t.clientVersion})}if(i)return new Xt(t);throw new ee("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}d();c();p();f();m();function Nr({generator:e}){var t;return(t=e==null?void 0:e.previewFeatures)!=null?t:[]}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var bs=Ue(Fn());d();c();p();f();m();function ws(e,t){let r=Es(e),n=Kl(r),i=Yl(n);i?_r(i,t):t.addErrorMessage(()=>"Unknown error")}function Es(e){return e.errors.flatMap(t=>t.kind==="Union"?Es(t):[t])}function Kl(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:zl(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function zl(e,t){return[...new Set(e.concat(t))]}function Yl(e){return sn(e,(t,r)=>{let n=hs(t),i=hs(r);return n!==i?n-i:ys(t)-ys(r)})}function hs(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function ys(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}d();c();p();f();m();var le=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};d();c();p();f();m();var Fr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(mt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function _r(e,t){switch(e.kind){case"MutuallyExclusiveFields":Zl(e,t);break;case"IncludeOnScalar":Xl(e,t);break;case"EmptySelection":ec(e,t);break;case"UnknownSelectionField":nc(e,t);break;case"UnknownArgument":ic(e,t);break;case"UnknownInputField":oc(e,t);break;case"RequiredArgumentMissing":sc(e,t);break;case"InvalidArgumentType":ac(e,t);break;case"InvalidArgumentValue":uc(e,t);break;case"ValueTooLarge":lc(e,t);break;case"SomeFieldsMissing":cc(e,t);break;case"TooManyFieldsGiven":pc(e,t);break;case"Union":ws(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function Zl(e,t){var n,i,o;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();r&&((i=r.getField(e.firstField))==null||i.markAsError(),(o=r.getField(e.secondField))==null||o.markAsError()),t.addErrorMessage(s=>`Please ${s.bold("either")} use ${s.green(`\`${e.firstField}\``)} or ${s.green(`\`${e.secondField}\``)}, but ${s.red("not both")} at the same time.`)}function Xl(e,t){var s,a;let[r,n]=Lr(e.selectionPath),i=e.outputType,o=(s=t.arguments.getDeepSelectionParent(r))==null?void 0:s.value;if(o&&((a=o.getField(n))==null||a.markAsError(),i))for(let u of i.fields)u.isRelation&&o.addSuggestion(new le(u.name,"true"));t.addErrorMessage(u=>{let l=`Invalid scalar field ${u.red(`\`${n}\``)} for ${u.bold("include")} statement`;return i?l+=` on model ${u.bold(i.name)}. ${er(u)}`:l+=".",l+=` -Note that ${u.bold("include")} statements only accept relation fields.`,l})}function ec(e,t){var n,i;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();if(r){let o=(i=r.getField("omit"))==null?void 0:i.value.asObject();if(o){tc(e,t,o);return}}rc(e,t)}function tc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new le(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function rc(e,t){var o,s;let r=e.outputType,n=(o=t.arguments.getDeepSelectionParent(e.selectionPath))==null?void 0:o.value,i=(s=n==null?void 0:n.isEmpty())!=null?s:!1;n&&(n.removeAllFields(),vs(n,r)),t.addErrorMessage(a=>i?`The ${a.red("`select`")} statement for type ${a.bold(r.name)} must not be empty. ${er(a)}`:`The ${a.red("`select`")} statement for type ${a.bold(r.name)} needs ${a.bold("at least one truthy value")}.`)}function nc(e,t){var s,a,u,l,g,h,x;let[r,n]=Lr(e.selectionPath),i=(s=t.arguments.getDeepSubSelectionValue(r))==null?void 0:s.asObject(),o;if(i){let S=(a=i.getFieldValue("select"))==null?void 0:a.asObject(),C=(u=i.getFieldValue("include"))==null?void 0:u.asObject(),A=(l=i.getFieldValue("omit"))==null?void 0:l.asObject();S!=null&&S.hasField(n)?(o="select",(g=S.getField(n))==null||g.markAsError(),vs(S,e.outputType)):C!=null&&C.hasField(n)?(o="include",(h=C.getField(n))==null||h.markAsError(),fc(C,e.outputType)):A!=null&&A.hasField(n)&&(o="omit",(x=A.getField(n))==null||x.markAsError(),mc(A,e.outputType))}t.addErrorMessage(S=>{let C=[`Unknown field ${S.red(`\`${n}\``)}`];return o&&C.push(`for ${S.bold(o)} statement`),C.push(`on model ${S.bold(`\`${e.outputType.name}\``)}.`),C.push(er(S)),C.join(" ")})}function ic(e,t){var i,o;let r=e.argumentPath[0],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getField(r))==null||o.markAsError(),dc(n,e.arguments)),t.addErrorMessage(s=>xs(s,r,e.arguments.map(a=>a.name)))}function oc(e,t){var o,s,a;let[r,n]=Lr(e.argumentPath),i=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject();if(i){(s=i.getDeepField(e.argumentPath))==null||s.markAsError();let u=(a=i.getDeepFieldValue(r))==null?void 0:a.asObject();u&&Ts(u,e.inputType)}t.addErrorMessage(u=>xs(u,n,e.inputType.fields.map(l=>l.name)))}function xs(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=hc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(er(e)),n.join(" ")}function sc(e,t){var u,l;let r;t.addErrorMessage(g=>(r==null?void 0:r.value)instanceof K&&r.value.text==="null"?`Argument \`${g.green(o)}\` must not be ${g.red("null")}.`:`Argument \`${g.green(o)}\` is missing.`);let n=(u=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:u.asObject();if(!n)return;let[i,o]=Lr(e.argumentPath),s=new Fr,a=(l=n.getDeepFieldValue(i))==null?void 0:l.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let g of e.inputTypes[0].fields)s.addField(g.name,g.typeNames.join(" | "));a.addSuggestion(new le(o,s).makeRequired())}else{let g=e.inputTypes.map(Ps).join(" | ");a.addSuggestion(new le(o,g).makeRequired())}}function Ps(e){return e.kind==="list"?`${Ps(e.elementType)}[]`:e.name}function ac(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=Br("or",e.argument.typeNames.map(u=>s.green(u)));return`Argument \`${s.bold(r)}\`: Invalid value provided. Expected ${a}, provided ${s.red(e.inferredType)}.`})}function uc(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=[`Invalid value for argument \`${s.bold(r)}\``];if(e.underlyingError&&a.push(`: ${e.underlyingError}`),a.push("."),e.argument.typeNames.length>0){let u=Br("or",e.argument.typeNames.map(l=>s.green(l)));a.push(` Expected ${u}.`)}return a.join("")})}function lc(e,t){var o;let r=e.argument.name,n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath),a=s==null?void 0:s.value;a==null||a.markAsError(),a instanceof K&&(i=a.text)}t.addErrorMessage(s=>{let a=["Unable to fit value"];return i&&a.push(s.red(i)),a.push(`into a 64-bit signed integer for field \`${s.bold(r)}\``),a.join(" ")})}function cc(e,t){var i,o;let r=e.argumentPath[e.argumentPath.length-1],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();if(n){let s=(o=n.getDeepFieldValue(e.argumentPath))==null?void 0:o.asObject();s&&Ts(s,e.inputType)}t.addErrorMessage(s=>{let a=[`Argument \`${s.bold(r)}\` of type ${s.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?a.push(`${s.green("at least one of")} ${Br("or",e.constraints.requiredFields.map(u=>`\`${s.bold(u)}\``))} arguments.`):a.push(`${s.green("at least one")} argument.`):a.push(`${s.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),a.push(er(s)),a.join(" ")})}function pc(e,t){var o,s;let r=e.argumentPath[e.argumentPath.length-1],n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i=[];if(n){let a=(s=n.getDeepFieldValue(e.argumentPath))==null?void 0:s.asObject();a&&(a.markAsError(),i=Object.keys(a.getFields()))}t.addErrorMessage(a=>{let u=[`Argument \`${a.bold(r)}\` of type ${a.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?u.push(`${a.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?u.push(`${a.green("at most one")} argument,`):u.push(`${a.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),u.push(`but you provided ${Br("and",i.map(l=>a.red(l)))}. Please choose`),e.constraints.maxFieldCount===1?u.push("one."):u.push(`${e.constraints.maxFieldCount}.`),u.join(" ")})}function vs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,"true"))}function fc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new le(r.name,"true"))}function mc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new le(r.name,"true"))}function dc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Ts(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Lr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function er({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Br(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var gc=3;function hc(e,t){let r=1/0,n;for(let i of t){let o=(0,bs.default)(e,i);o>gc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){var r;return(r=this.model)==null?void 0:r.fields.find(n=>n.name===t)}nestSelection(t){let r=this.findField(t),n=(r==null?void 0:r.kind)==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};d();c();p();f();m();var Ss=e=>({command:e});d();c();p();f();m();d();c();p();f();m();var Is=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);d();c();p();f();m();function tr(e){try{return ks(e,"fast")}catch(t){return ks(e,"slow")}}function ks(e,t){return JSON.stringify(e.map(r=>Ac(r,t)))}function Ac(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:ut(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ve.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Rc(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Os(e):e}function Rc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Os(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ds);let t={};for(let r of Object.keys(e))t[r]=Ds(e[r]);return t}function Ds(e){return typeof e=="bigint"?e.toString():Os(e)}var Sc=/^(\s*alter\s)/i,Ms=re("prisma:client");function $n(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Sc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var qn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:tr(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:tr(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:tr(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Is(r),i={values:tr(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i!=null&&i.values?Ms(`prisma.${e}(${n}, ${i.values})`):Ms(`prisma.${e}(${n})`),{query:n,parameters:i}},Ns={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new ue(t,r)}},_s={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};d();c();p();f();m();function Un(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||(o==null?void 0:o.kind)==="itx"?n!=null?n:n=Fs(r(o)):Fs(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function Fs(e){return typeof e.then=="function"?e:Promise.resolve(e)}d();c();p();f();m();var Ls={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Vn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){var t,r;return(r=(t=globalThis.PRISMA_INSTRUMENTATION)==null?void 0:t.helper)!=null?r:Ls}};function Bs(e){return e.includes("tracing")?new Vn:Ls}d();c();p();f();m();function $s(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i==null?void 0:i(n)}}}d();c();p();f();m();var Ic=["$connect","$disconnect","$on","$transaction","$use","$extends"],qs=Ic;d();c();p();f();m();function Us(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}d();c();p();f();m();var qr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};d();c();p();f();m();var js=Ue(Xi());d();c();p();f();m();function Ur(e){return typeof e.batchRequestIdx=="number"}d();c();p();f();m();function Vr(e){return e===null?e:Array.isArray(e)?e.map(Vr):typeof e=="object"?kc(e)?Dc(e):ot(e,Vr):e}function kc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Dc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ve(t);case"Json":return JSON.parse(t);default:je(t,"Unknown tagged value")}}d();c();p();f();m();function Vs(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(jn(e.query.arguments)),t.push(jn(e.query.selection)),t.join("")}function jn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${jn(n)})`:r}).join(" ")})`}d();c();p();f();m();var Oc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Jn(e){return Oc[e]}d();c();p();f();m();var jr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),u=this.client._tracingHelper.getTraceParent(s),l=n.some(h=>Jn(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:u,transaction:Nc(o),containsWrite:l,customDataProxyFetch:i})).map((h,x)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[x],h)}catch(S){return S}})}),singleLoader:async n=>{var s;let i=((s=n.transaction)==null?void 0:s.kind)==="itx"?Js(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Jn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>{var i;return(i=n.transaction)!=null&&i.id?`transaction-${n.transaction.id}`:Vs(n.protocolQuery)},batchOrder(n,i){var o,s;return((o=n.transaction)==null?void 0:o.kind)==="batch"&&((s=i.transaction)==null?void 0:s.kind)==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n==null?void 0:n.data,o=n==null?void 0:n.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(Mc(t),_c(t,i)||t instanceof Ie)throw t;if(t instanceof z&&Fc(t)){let u=Qs(t.meta);$r({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=ht({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new z(a,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ke(a,this.client._clientVersion);if(t instanceof ae)throw new ae(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof G)throw new G(a,this.client._clientVersion);if(t instanceof ke)throw new ke(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,js.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=Vr(xn(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function Nc(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Js(e)};je(e,"Unknown transaction kind")}}function Js(e){return{id:e.id,payload:e.payload}}function _c(e,t){return Ur(e)&&(t==null?void 0:t.kind)==="batch"&&e.batchRequestIdx!==t.index}function Fc(e){return e.code==="P2009"||e.code==="P2012"}function Qs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Qs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}d();c();p();f();m();var Gs="5.14.0";var Hs=Gs;d();c();p();f();m();function Ws(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=Ks(t[n]);return r})}function Ks({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return w.Buffer.from(t,"base64");case"decimal":return new ve(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(Ks);default:return t}}d();c();p();f();m();var Xs=Ue(Fn());d();c();p();f();m();var J=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};_(J,"PrismaClientConstructorValidationError");var zs=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Ys=["pretty","colorless","minimal"],Zs=["info","query","warn","error"],Bc={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=xt(r,t)||` Available datasources: ${t.join(", ")}`;throw new J(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new J(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new J('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Nr(t).includes("driverAdapters"))throw new J('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(At()==="binary")throw new J('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e!="undefined"&&typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Ys.includes(e)){let t=xt(e,Ys);throw new J(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Zs.includes(r)){let n=xt(r,Zs);throw new J(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=xt(i,o);throw new J(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new J(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new J(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new J(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new J(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=xt(r,t);throw new J(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ea(e,t){for(let[r,n]of Object.entries(e)){if(!zs.includes(r)){let i=xt(r,zs);throw new J(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Bc[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new J('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function xt(e,t){if(t.length===0||typeof e!="string")return"";let r=$c(e,t);return r?` Did you mean "${r}"?`:""}function $c(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Xs.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},u=l=>{o||(o=!0,r(l))};for(let l=0;l{n[l]=g,a()},g=>{if(!Ur(g)){u(g);return}g.batchRequestIdx===l?u(g):(i||(i=g),a())})})}var Le=re("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var qc={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Uc=Symbol.for("prisma.client.transaction.id"),Vc={id:0,nextId(){return++this.id}};function jc(e){class t{constructor(n){this._originalClient=this;this._middlewares=new qr;this._createPrismaPromise=Un();this.$extends=qo;var u,l,g,h,x,S,C,A,D,O,B,M,I,Z;e=(g=(l=(u=n==null?void 0:n.__internal)==null?void 0:u.configOverride)==null?void 0:l.call(u,e))!=null?g:e,ns(e),n&&ea(n,e);let i=n!=null&&n.adapter?fn(n.adapter):void 0,o=new lr().on("error",()=>{});this._extensions=Or.empty(),this._previewFeatures=Nr(e),this._clientVersion=(h=e.clientVersion)!=null?h:Hs,this._activeProvider=e.activeProvider,this._tracingHelper=Bs(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Ct.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Ct.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=(x=e.injectableEdgeEnv)==null?void 0:x.call(e);try{let L=n!=null?n:{},Ye=(S=L.__internal)!=null?S:{},Be=Ye.debug===!0;Be&&re.enable("prisma:client");let fe=Ct.resolve(e.dirname,e.relativePath);wi.existsSync(fe)||(fe=e.dirname),Le("dirname",e.dirname),Le("relativePath",e.relativePath),Le("cwd",fe);let $e=Ye.engine||{};if(L.errorFormat?this._errorFormat=L.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:fe,dirname:e.dirname,enableDebugLogs:Be,allowTriggerPanic:$e.allowTriggerPanic,datamodelPath:Ct.join(e.dirname,(C=e.filename)!=null?C:"schema.prisma"),prismaPath:(A=$e.binaryPath)!=null?A:void 0,engineEndpoint:$e.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:L.log&&Us(L.log),logQueries:L.log&&!!(typeof L.log=="string"?L.log==="query":L.log.find(Q=>typeof Q=="string"?Q==="query":Q.level==="query")),env:(D=a==null?void 0:a.parsed)!=null?D:{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:is(L,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:(B=(O=L.transactionOptions)==null?void 0:O.maxWait)!=null?B:2e3,timeout:(I=(M=L.transactionOptions)==null?void 0:M.timeout)!=null?I:5e3,isolationLevel:(Z=L.transactionOptions)==null?void 0:Z.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:yt,getBatchRequestPayload:dr,prismaGraphQLToJSError:Bt,PrismaClientUnknownRequestError:ae,PrismaClientInitializationError:G,PrismaClientKnownRequestError:z,debug:re("prisma:client:accelerateEngine"),engineVersion:na.version,clientVersion:e.clientVersion}},Le("clientVersion",e.clientVersion),this._engine=ds(e,this._engineConfig),this._requestHandler=new Jr(this,o),L.log)for(let Q of L.log){let Ce=typeof Q=="string"?Q:Q.emit==="stdout"?Q.level:null;Ce&&this.$on(Ce,qe=>{var Ze;it.log(`${(Ze=it.tags[Ce])!=null?Ze:""}`,qe.message||qe.query)})}this._metrics=new St(this._engine)}catch(L){throw L.clientVersion=this._clientVersion,L}return this._appliedParent=$t(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Vi()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=ra(n,i);return $n(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new ee("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>($n(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new ee(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Ss,callsite:Fe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(Ws)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...ra(n,i));throw new ee("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Vc.nextId(),s=$s(n.length),a=n.map((u,l)=>{var x,S,C;if((u==null?void 0:u[Symbol.toStringTag])!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=(x=i==null?void 0:i.isolationLevel)!=null?x:this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:l,isolationLevel:g,lock:s};return(C=(S=u.requestTransaction)==null?void 0:S.call(u,h))!=null?C:u});return ta(a)}async _transactionWithCallback({callback:n,options:i}){var l,g,h;let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:(l=i==null?void 0:i.maxWait)!=null?l:this._engineConfig.transactionOptions.maxWait,timeout:(g=i==null?void 0:i.timeout)!=null?g:this._engineConfig.transactionOptions.timeout,isolationLevel:(h=i==null?void 0:i.isolationLevel)!=null?h:this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),u;try{let x={kind:"itx",...a};u=await n(this._createItxClient(x)),await this._engine.transaction("commit",o,a)}catch(x){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),x}return u}_createItxClient(n){return $t(ge($o(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>Un(n)),ne(Uc,()=>n.id),st(qs)]))}$transaction(n,i){var a;let o;typeof n=="function"?((a=this._engineConfig.adapter)==null?void 0:a.adapterName)==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){var l;n.otelParentCtx=this._tracingHelper.getActiveContext();let i=(l=n.middlewareArgsMapper)!=null?l:qc,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,u=async g=>{let h=this._middlewares.get(++a);if(h)return this._tracingHelper.runInChildSpan(s.middleware,O=>h(g,B=>(O==null||O.end(),u(B))));let{runInTransaction:x,args:S,...C}=g,A={...n,...C};S&&(A.args=i.middlewareArgsToRequestArgs(S)),n.transaction!==void 0&&x===!1&&delete A.transaction;let D=await Ho(this,A);return A.model?jo({result:D,modelName:A.model,args:A.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):D};return this._tracingHelper.runInChildSpan(s.operation,()=>u(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:u,argsMapper:l,transaction:g,unpacker:h,otelParentCtx:x,customDataProxyFetch:S}){try{n=l?l(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>Cs({modelName:u,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return re.enabled("prisma:client")&&(Le("Prisma Client call:"),Le(`prisma.${i}(${So(n)})`),Le("Generated request:"),Le(JSON.stringify(A,null,2)+` -`)),(g==null?void 0:g.kind)==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:u,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:x,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:S})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new ee("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){var i;return!!((i=this._engineConfig.previewFeatures)!=null&&i.includes(n))}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function ra(e,t){return Jc(e)?[new ue(e,t),Ns]:[e,_s]}function Jc(e){return Array.isArray(e)&&Array.isArray(e.raw)}d();c();p();f();m();var Qc=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Gc(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Qc.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}d();c();p();f();m();var export_warnEnvConflicts=void 0;export{Ui as Debug,ve as Decimal,gi as Extensions,St as MetricsClient,Ie as NotFoundError,G as PrismaClientInitializationError,z as PrismaClientKnownRequestError,ke as PrismaClientRustPanicError,ae as PrismaClientUnknownRequestError,ee as PrismaClientValidationError,yi as Public,ue as Sql,ru as defineDmmfProperty,uu as empty,jc as getPrismaClient,Cn as getRuntime,au as join,Gc as makeStrictEnum,ln as objectEnumValues,io as raw,oo as sqltag,export_warnEnvConflicts as warnEnvConflicts,cr as warnOnce}; -//# sourceMappingURL=edge-esm.js.map diff --git a/integration-tests/tests/prisma/mysql/client/runtime/edge.js b/integration-tests/tests/prisma/mysql/client/runtime/edge.js deleted file mode 100644 index 4ed919f76..000000000 --- a/integration-tests/tests/prisma/mysql/client/runtime/edge.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict";var la=Object.create;var nr=Object.defineProperty;var ca=Object.getOwnPropertyDescriptor;var pa=Object.getOwnPropertyNames;var fa=Object.getPrototypeOf,ma=Object.prototype.hasOwnProperty;var be=(e,t)=>()=>(e&&(t=e(e=0)),t);var Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vt=(e,t)=>{for(var r in t)nr(e,r,{get:t[r],enumerable:!0})},zn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pa(t))!ma.call(e,i)&&i!==r&&nr(e,i,{get:()=>t[i],enumerable:!(n=ca(t,i))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?la(fa(e)):{},zn(t||!e||!e.__esModule?nr(r,"default",{value:e,enumerable:!0}):r,e)),Gr=e=>zn(nr({},"__esModule",{value:!0}),e);var y,c=be(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var Yn,b,p=be(()=>{"use strict";b=(Yn=globalThis.performance)!=null?Yn:(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,f=be(()=>{"use strict";E=()=>{};E.prototype=E});var m=be(()=>{"use strict"});var hi=Se(rt=>{"use strict";d();c();p();f();m();var ri=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),da=ri(e=>{"use strict";e.byteLength=u,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var D=C.indexOf("=");D===-1&&(D=A);var O=D===A?0:4-D%4;return[D,O]}function u(C){var A=a(C),D=A[0],O=A[1];return(D+O)*3/4-O}function l(C,A,D){return(A+D)*3/4-D}function g(C){var A,D=a(C),O=D[0],B=D[1],M=new n(l(C,O,B)),I=0,X=B>0?O-4:O,L;for(L=0;L>16&255,M[I++]=A>>8&255,M[I++]=A&255;return B===2&&(A=r[C.charCodeAt(L)]<<2|r[C.charCodeAt(L+1)]>>4,M[I++]=A&255),B===1&&(A=r[C.charCodeAt(L)]<<10|r[C.charCodeAt(L+1)]<<4|r[C.charCodeAt(L+2)]>>2,M[I++]=A>>8&255,M[I++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function x(C,A,D){for(var O,B=[],M=A;MX?X:I+M));return O===1?(A=C[D-1],B.push(t[A>>2]+t[A<<4&63]+"==")):O===2&&(A=(C[D-2]<<8)+C[D-1],B.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),B.join("")}}),ga=ri(e=>{e.read=function(t,r,n,i,o){var s,a,u=o*8-i-1,l=(1<>1,h=-7,x=n?o-1:0,S=n?-1:1,C=t[r+x];for(x+=S,s=C&(1<<-h)-1,C>>=-h,h+=u;h>0;s=s*256+t[r+x],x+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+x],x+=S,h-=8);if(s===0)s=1-g;else{if(s===l)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,u,l,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,D=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+x>=1?r+=S/l:r+=S*Math.pow(2,1-x),r*l>=2&&(a++,l/=2),a+x>=h?(u=0,a=h):a+x>=1?(u=(r*l-1)*Math.pow(2,o),a=a+x):(u=r*Math.pow(2,x-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=u&255,C+=A,u/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=D*128}}),Hr=da(),et=ga(),Zn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rt.Buffer=T;rt.SlowBuffer=xa;rt.INSPECT_MAX_BYTES=50;var ir=2147483647;rt.kMaxLength=ir;T.TYPED_ARRAY_SUPPORT=ha();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ha(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function xe(e){if(e>ir)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return zr(e)}return ni(e,t,r)}T.poolSize=8192;function ni(e,t,r){if(typeof e=="string")return wa(e,t);if(ArrayBuffer.isView(e))return Ea(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(me(e,ArrayBuffer)||e&&me(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(e,SharedArrayBuffer)||e&&me(e.buffer,SharedArrayBuffer)))return oi(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=ba(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return ni(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function ii(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function ya(e,t,r){return ii(e),e<=0?xe(e):t!==void 0?typeof r=="string"?xe(e).fill(t,r):xe(e).fill(t):xe(e)}T.alloc=function(e,t,r){return ya(e,t,r)};function zr(e){return ii(e),xe(e<0?0:Yr(e)|0)}T.allocUnsafe=function(e){return zr(e)};T.allocUnsafeSlow=function(e){return zr(e)};function wa(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=si(e,t)|0,n=xe(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Wr(e){let t=e.length<0?0:Yr(e.length)|0,r=xe(t);for(let n=0;n=ir)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ir.toString(16)+" bytes");return e|0}function xa(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),me(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function si(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||me(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Kr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return gi(e).length;default:if(i)return n?-1:Kr(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=si;function Pa(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Oa(this,t,r);case"utf8":case"utf-8":return ui(this,t,r);case"ascii":return ka(this,t,r);case"latin1":case"binary":return Da(this,t,r);case"base64":return Sa(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ma(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Ve(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Zn&&(T.prototype[Zn]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Xr(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:Xn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Xn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Xn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function u(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let l;if(i){let g=-1;for(l=r;ls&&(r=s-a),l=r;l>=0;l--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return va(this,e,t,r);case"utf8":case"utf-8":return Ta(this,e,t,r);case"ascii":case"latin1":case"binary":return Ca(this,e,t,r);case"base64":return Aa(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ra(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Sa(e,t,r){return t===0&&r===e.length?Hr.fromByteArray(e):Hr.fromByteArray(e.slice(t,r))}function ui(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let u,l,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(s=h));break;case 3:u=e[i+1],l=e[i+2],(u&192)===128&&(l&192)===128&&(h=(o&15)<<12|(u&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:u=e[i+1],l=e[i+2],g=e[i+3],(u&192)===128&&(l&192)===128&&(g&192)===128&&(h=(o&15)<<18|(u&63)<<12|(l&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ia(n)}var ei=4096;function Ia(e){let t=e.length;if(t<=ei)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Ie(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Ie(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),et.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),et.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!1,52,8)};function ie(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function li(e,t,r,n,i){di(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function ci(e,t,r,n,i){di(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=Ie(function(e,t=0){return li(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Ie(function(e,t=0){return ci(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=Ie(function(e,t=0){return li(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Ie(function(e,t=0){return ci(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function pi(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function fi(e,t,r,n,i){return t=+t,r=r>>>0,i||pi(e,t,r,4,34028234663852886e22,-34028234663852886e22),et.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return fi(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return fi(this,e,t,!1,r)};function mi(e,t,r,n,i){return t=+t,r=r>>>0,i||pi(e,t,r,8,17976931348623157e292,-17976931348623157e292),et.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return mi(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return mi(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=ti(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=ti(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function ti(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Na(e,t,r){tt(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Tt(t,e.length-(r+1))}function di(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Xe.ERR_OUT_OF_RANGE("value",a,e)}Na(n,i,o)}function tt(e,t){if(typeof e!="number")throw new Xe.ERR_INVALID_ARG_TYPE(t,"number",e)}function Tt(e,t,r){throw Math.floor(e)!==e?(tt(e,r),new Xe.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Xe.ERR_BUFFER_OUT_OF_BOUNDS:new Xe.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var _a=/[^+/0-9A-Za-z-_]/g;function Fa(e){if(e=e.split("=")[0],e=e.trim().replace(_a,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Kr(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function La(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function gi(e){return Hr.toByteArray(Fa(e))}function or(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function me(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Xr(e){return e!==e}var $a=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Ie(e){return typeof BigInt>"u"?qa:e}function qa(){throw new Error("BigInt not supported")}});var w,d=be(()=>{"use strict";w=Ue(hi())});function Ua(){return!1}var Va,ja,bi,xi=be(()=>{"use strict";d();c();p();f();m();Va={},ja={existsSync:Ua,promises:Va},bi=ja});var Mi=Se((df,Oi)=>{"use strict";d();c();p();f();m();Oi.exports=(on(),Gr(nn)).format});var nn={};vt(nn,{default:()=>Ga,deprecate:()=>_i,format:()=>Li,inspect:()=>Fi,promisify:()=>Ni});function Ni(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function _i(e,t){return(...r)=>(console.warn(t),e(...r))}function Fi(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var Li,Qa,Ga,on=be(()=>{"use strict";d();c();p();f();m();Li=Mi(),Qa={promisify:Ni,deprecate:_i,inspect:Fi,format:Li},Ga=Qa});function Ya(...e){return e.join("/")}function Za(...e){return e.join("/")}var Ji,Xa,eu,At,Qi=be(()=>{"use strict";d();c();p();f();m();Ji="/",Xa={sep:Ji},eu={resolve:Ya,posix:Xa,join:Za,sep:Ji},At=eu});var lr,Hi=be(()=>{"use strict";d();c();p();f();m();lr=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var Ki=Se((Em,Wi)=>{"use strict";d();c();p();f();m();Wi.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 Zi=Se((Dm,Yi)=>{"use strict";d();c();p();f();m();Yi.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 eo=Se((Lm,Xi)=>{"use strict";d();c();p();f();m();var su=Zi();Xi.exports=e=>typeof e=="string"?e.replace(su(),""):e});var io=Se((Mh,cu)=>{cu.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var oo=Se(()=>{"use strict";d();c();p();f();m()});var Un=Se((a2,ys)=>{"use strict";d();c();p();f();m();ys.exports=function(){function e(t,r,n,i,o){return tn?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;san,Decimal:()=>ye,Extensions:()=>en,MetricsClient:()=>st,NotFoundError:()=>Pe,PrismaClientInitializationError:()=>G,PrismaClientKnownRequestError:()=>K,PrismaClientRustPanicError:()=>ve,PrismaClientUnknownRequestError:()=>oe,PrismaClientValidationError:()=>Y,Public:()=>tn,Sql:()=>se,defineDmmfProperty:()=>no,empty:()=>ao,getPrismaClient:()=>sa,getRuntime:()=>Mr,join:()=>so,makeStrictEnum:()=>aa,objectEnumValues:()=>pr,raw:()=>yn,sqltag:()=>wn,warnEnvConflicts:()=>void 0,warnOnce:()=>It});module.exports=Gr(Hc);d();c();p();f();m();var en={};vt(en,{defineExtension:()=>yi,getExtensionContext:()=>wi});d();c();p();f();m();d();c();p();f();m();function yi(e){return typeof e=="function"?e:t=>t.$extends(e)}d();c();p();f();m();function wi(e){return e}var tn={};vt(tn,{validator:()=>Ei});d();c();p();f();m();d();c();p();f();m();function Ei(...e){return t=>t}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var rn,Pi,vi,Ti,Ci=!0;typeof y!="undefined"&&({FORCE_COLOR:rn,NODE_DISABLE_COLORS:Pi,NO_COLOR:vi,TERM:Ti}=y.env||{},Ci=y.stdout&&y.stdout.isTTY);var Ja={enabled:!Pi&&vi==null&&Ti!=="dumb"&&(rn!=null&&rn!=="0"||Ci)};function V(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ja.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Jp=V(0,0),sr=V(1,22),ar=V(2,22),Qp=V(3,23),Ai=V(4,24),Gp=V(7,27),Hp=V(8,28),Wp=V(9,29),Kp=V(30,39),nt=V(31,39),Ri=V(32,39),Si=V(33,39),Ii=V(34,39),zp=V(35,39),ki=V(36,39),Yp=V(37,39),Di=V(90,39),Zp=V(90,39),Xp=V(40,49),ef=V(41,49),tf=V(42,49),rf=V(43,49),nf=V(44,49),of=V(45,49),sf=V(46,49),af=V(47,49);d();c();p();f();m();var Ha=100,Bi=["green","yellow","blue","magenta","cyan","red"],ur=[],$i=Date.now(),Wa=0,sn=typeof y!="undefined"?y.env:{},qi,Ui;(Ui=globalThis.DEBUG)!=null||(globalThis.DEBUG=(qi=sn.DEBUG)!=null?qi:"");var Vi;(Vi=globalThis.DEBUG_COLORS)!=null||(globalThis.DEBUG_COLORS=sn.DEBUG_COLORS?sn.DEBUG_COLORS==="true":!0);var Ct={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)=>{var o;let[t,r,...n]=e,i;typeof require=="function"&&typeof y!="undefined"&&typeof y.stderr!="undefined"&&typeof y.stderr.write=="function"?i=(...s)=>{var a;try{let u=(on(),Gr(nn));y.stderr.write(u.format(...s)+` -`)}catch(u){i=(a=console.warn)!=null?a:console.log}}:i=(o=console.warn)!=null?o:console.log,i(`${t} ${r}`,...n)},formatters:{}};function Ka(e){let t={color:Bi[Wa++%Bi.length],enabled:Ct.enabled(e),namespace:e,log:Ct.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&ur.push([o,...n]),ur.length>Ha&&ur.shift(),Ct.enabled(o)||i){let u=n.map(g=>typeof g=="string"?g:za(g)),l=`+${Date.now()-$i}ms`;$i=Date.now(),a(o,...u,l)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var an=new Proxy(Ka,{get:(e,t)=>Ct[t],set:(e,t,r)=>Ct[t]=r});function za(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 ji(){ur.length=0}var re=an;d();c();p();f();m();d();c();p();f();m();var Gi="library";function Rt(e){let t=tu();return t||((e==null?void 0:e.config.engineType)==="library"?"library":(e==null?void 0:e.config.engineType)==="binary"?"binary":Gi)}function tu(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}d();c();p();f();m();d();c();p();f();m();var ke;(t=>{let e;(I=>(I.findUnique="findUnique",I.findUniqueOrThrow="findUniqueOrThrow",I.findFirst="findFirst",I.findFirstOrThrow="findFirstOrThrow",I.findMany="findMany",I.create="create",I.createMany="createMany",I.createManyAndReturn="createManyAndReturn",I.update="update",I.updateMany="updateMany",I.upsert="upsert",I.delete="delete",I.deleteMany="deleteMany",I.groupBy="groupBy",I.count="count",I.aggregate="aggregate",I.findRaw="findRaw",I.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(ke||(ke={}));var it={};vt(it,{error:()=>iu,info:()=>nu,log:()=>ru,query:()=>ou,should:()=>zi,tags:()=>St,warn:()=>un});d();c();p();f();m();var St={error:nt("prisma:error"),warn:Si("prisma:warn"),info:ki("prisma:info"),query:Ii("prisma:query")},zi={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function ru(...e){console.log(...e)}function un(e,...t){zi.warn()&&console.warn(`${St.warn} ${e}`,...t)}function nu(e,...t){console.info(`${St.info} ${e}`,...t)}function iu(e,...t){console.error(`${St.error} ${e}`,...t)}function ou(e,...t){console.log(`${St.query} ${e}`,...t)}d();c();p();f();m();function je(e,t){throw new Error(t)}d();c();p();f();m();function ln(e,t){return Object.prototype.hasOwnProperty.call(e,t)}d();c();p();f();m();var cn=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});d();c();p();f();m();function ot(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}d();c();p();f();m();function pn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{to.has(e)||(to.add(e),un(t,...r))};d();c();p();f();m();var K=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};_(K,"PrismaClientKnownRequestError");var Pe=class extends K{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};_(Pe,"NotFoundError");d();c();p();f();m();var G=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};_(G,"PrismaClientInitializationError");d();c();p();f();m();var ve=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};_(ve,"PrismaClientRustPanicError");d();c();p();f();m();var oe=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};_(oe,"PrismaClientUnknownRequestError");d();c();p();f();m();var Y=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};_(Y,"PrismaClientValidationError");d();c();p();f();m();var st=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};d();c();p();f();m();d();c();p();f();m();function kt(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function no(e,t){let r=kt(()=>au(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function au(e){return{datamodel:{models:fn(e.models),enums:fn(e.enums),types:fn(e.types)}}}function fn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}d();c();p();f();m();var cr=Symbol(),mn=new WeakMap,Te=class{constructor(t){t===cr?mn.set(this,`Prisma.${this._getName()}`):mn.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return mn.get(this)}},Dt=class extends Te{_getNamespace(){return"NullTypes"}},Ot=class extends Dt{};dn(Ot,"DbNull");var Mt=class extends Dt{};dn(Mt,"JsonNull");var Nt=class extends Dt{};dn(Nt,"AnyNull");var pr={classes:{DbNull:Ot,JsonNull:Mt,AnyNull:Nt},instances:{DbNull:new Ot(cr),JsonNull:new Mt(cr),AnyNull:new Nt(cr)}};function dn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function _t(e){return{ok:!1,error:e,map(){return _t(e)},flatMap(){return _t(e)}}}var gn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},hn=e=>{let t=new gn,r=Je(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Je(t,e.queryRaw.bind(e)),executeRaw:Je(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>uu(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=lu(t,e.getConnectionInfo.bind(e))),n},uu=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Je(e,t.queryRaw.bind(t)),executeRaw:Je(e,t.executeRaw.bind(t)),commit:Je(e,t.commit.bind(t)),rollback:Je(e,t.rollback.bind(t))});function Je(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}function lu(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}var oa=Ue(io());var gD=Ue(oo());Hi();xi();Qi();d();c();p();f();m();var se=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){var n;return(n=e.getPropertyDescriptor)==null?void 0:n.call(e,r)}}}d();c();p();f();m();d();c();p();f();m();var fr={enumerable:!0,configurable:!0,writable:!0};function mr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>fr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var uo=Symbol.for("nodejs.util.inspect.custom");function ge(e,t){let r=pu(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){var u,l;if(n.has(s))return!0;let a=r.get(s);return a?(l=(u=a.has)==null?void 0:u.call(a,s))!=null?l:!0:Reflect.has(o,s)},ownKeys(o){let s=lo(Reflect.ownKeys(o),r),a=lo(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){var l,g;let u=r.get(s);return((g=(l=u==null?void 0:u.getPropertyDescriptor)==null?void 0:l.call(u,s))==null?void 0:g.writable)===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let u=r.get(s);return u?u.getPropertyDescriptor?{...fr,...u==null?void 0:u.getPropertyDescriptor(s)}:fr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[uo]=function(){let o={...this};return delete o[uo],o},i}function pu(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function lo(e,t){return e.filter(r=>{var i,o;let n=t.get(r);return(o=(i=n==null?void 0:n.has)==null?void 0:i.call(n,r))!=null?o:!0})}d();c();p();f();m();function at(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}d();c();p();f();m();function dr(e,t){return{batch:e,transaction:(t==null?void 0:t.kind)==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}d();c();p();f();m();d();c();p();f();m();var ut=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};d();c();p();f();m();d();c();p();f();m();function co(e){return e.substring(0,1).toLowerCase()+e.substring(1)}d();c();p();f();m();function lt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function gr(e){return e.toString()!=="Invalid Date"}d();c();p();f();m();d();c();p();f();m();var ct=9e15,Ne=1e9,En="0123456789abcdef",yr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",wr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",bn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ct,maxE:ct,crypto:!1},go,Ce,F=!0,br="[DecimalError] ",Me=br+"Invalid argument: ",ho=br+"Precision limit exceeded",yo=br+"crypto unavailable",wo="[object Decimal]",te=Math.floor,H=Math.pow,fu=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,mu=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,du=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Eo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,pe=1e7,N=7,gu=9007199254740991,hu=yr.length-1,xn=wr.length-1,R={toStringTag:wo};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)};R.ceil=function(){return k(new this.constructor(this),this.e+1,2)};R.clampedTo=R.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Me+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,u=o.s,l=e.s;if(!s||!a)return!u||!l?NaN:u!==l?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};R.cosine=R.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=yu(n,To(n,r)),n.precision=e,n.rounding=t,k(Ce==2||Ce==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};R.cubeRoot=R.cbrt=function(){var e,t,r,n,i,o,s,a,u,l,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(F=!1,o=g.s*H(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Z(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=H(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,u=a.times(a).times(a),l=u.plus(g),n=q(l.plus(g).times(a),l.plus(u),s+2,1),Z(a.d).slice(0,s)===(r=Z(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(k(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(k(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return F=!0,k(n,e,h.rounding,t)};R.decimalPlaces=R.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/N))*N,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};R.dividedBy=R.div=function(e){return q(this,new this.constructor(e))};R.dividedToIntegerBy=R.divToInt=function(e){var t=this,r=t.constructor;return k(q(t,new r(e),0,1,1),r.precision,r.rounding)};R.equals=R.eq=function(e){return this.cmp(e)===0};R.floor=function(){return k(new this.constructor(this),this.e+1,3)};R.greaterThan=R.gt=function(e){return this.cmp(e)>0};R.greaterThanOrEqualTo=R.gte=function(e){var t=this.cmp(e);return t==1||t===0};R.hyperbolicCosine=R.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Pr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=pt(s,1,o.times(t),new s(1),!0);for(var u,l=e,g=new s(8);l--;)u=o.times(o),o=a.minus(u.times(g.minus(u.times(g))));return k(o,s.precision=r,s.rounding=n,!0)};R.hyperbolicSine=R.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=pt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Pr(5,e)),i=pt(o,2,i,i,!0);for(var s,a=new o(5),u=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(l))))}return o.precision=t,o.rounding=r,k(i,t,r,!0)};R.hyperbolicTangent=R.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,q(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};R.inverseCosine=R.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ce(r,i,o):new r(0):new r(NaN):t.isZero()?ce(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ce(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};R.inverseHyperbolicCosine=R.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,F=!1,r=r.times(r).minus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};R.inverseHyperbolicSine=R.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,F=!1,r=r.times(r).plus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln())};R.inverseHyperbolicTangent=R.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?k(new o(i),e,t,!0):(o.precision=r=n-i.e,i=q(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};R.inverseSine=R.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ce(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};R.inverseTangent=R.atan=function(){var e,t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding;if(l.isFinite()){if(l.isZero())return new g(l);if(l.abs().eq(1)&&h+4<=xn)return s=ce(g,h+4,x).times(.25),s.s=l.s,s}else{if(!l.s)return new g(NaN);if(h+4<=xn)return s=ce(g,h+4,x).times(.5),s.s=l.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/N+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(F=!1,t=Math.ceil(a/N),n=1,u=l.times(l),s=new g(l),i=l;e!==-1;)if(i=i.times(u),o=s.minus(i.div(n+=2)),i=i.times(u),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};R.isNaN=function(){return!this.s};R.isNegative=R.isNeg=function(){return this.s<0};R.isPositive=R.isPos=function(){return this.s>0};R.isZero=function(){return!!this.d&&this.d[0]===0};R.lessThan=R.lt=function(e){return this.cmp(e)<0};R.lessThanOrEqualTo=R.lte=function(e){return this.cmp(e)<1};R.logarithm=R.log=function(e){var t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new g(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(F=!1,a=h+S,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),Lt(u.d,i=h,x))do if(a+=10,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),!o){+Z(u.d).slice(i+1,i+15)+1==1e14&&(u=k(u,h+1,0));break}while(Lt(u.d,i+=10,x));return F=!0,k(u,h,x)};R.minus=R.sub=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.constructor;if(e=new C(e),!S.d||!e.d)return!S.s||!e.s?e=new C(NaN):S.d?e.s=-e.s:e=new C(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(l=S.d,x=e.d,a=C.precision,u=C.rounding,!l[0]||!x[0]){if(x[0])e.s=-e.s;else if(l[0])e=new C(S);else return new C(u===3?-0:0);return F?k(e,a,u):e}if(r=te(e.e/N),g=te(S.e/N),l=l.slice(),o=g-r,o){for(h=o<0,h?(t=l,o=-o,s=x.length):(t=x,r=g,s=l.length),n=Math.max(Math.ceil(a/N),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=x.length,h=n0;--n)l[s++]=0;for(n=x.length;n>o;){if(l[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=g.length,s-i<0&&(i=s,r=g,g=l,l=r),t=0;i;)t=(l[--i]=l[i]+g[i]+t)/pe|0,l[i]%=pe;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=xr(l,n),F?k(e,a,u):e};R.precision=R.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Me+e);return r.d?(t=bo(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};R.round=function(){var e=this,t=e.constructor;return k(new t(e),e.e+1,t.rounding)};R.sine=R.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=Eu(n,To(n,r)),n.precision=e,n.rounding=t,k(Ce>2?r.neg():r,e,t,!0)):new n(NaN)};R.squareRoot=R.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,u=s.e,l=s.s,g=s.constructor;if(l!==1||!a||!a[0])return new g(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(F=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Z(a),(t.length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=te((u+1)/2)-(u<0||u%2),l==1/0?t="5e"+u:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),n=new g(t)):n=new g(l.toString()),r=(u=g.precision)+3;;)if(o=n,n=o.plus(q(s,o,r+2,1)).times(.5),Z(o.d).slice(0,r)===(t=Z(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(k(o,u+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(n,u+1,1),e=!n.times(n).eq(s));break}return F=!0,k(n,u,g.rounding,e)};R.tangent=R.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=q(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,k(Ce==2||Ce==4?r.neg():r,e,t,!0)):new n(NaN)};R.times=R.mul=function(e){var t,r,n,i,o,s,a,u,l,g=this,h=g.constructor,x=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!x||!x[0]||!S||!S[0])return new h(!e.s||x&&!x[0]&&!S||S&&!S[0]&&!x?NaN:!x||!S?e.s/0:e.s*0);for(r=te(g.e/N)+te(e.e/N),u=x.length,l=S.length,u=0;){for(t=0,i=u+n;i>n;)a=o[i]+S[n]*x[i-n-1]+t,o[i--]=a%pe|0,t=a/pe|0;o[i]=(o[i]+t)%pe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=xr(o,r),F?k(e,h.precision,h.rounding):e};R.toBinary=function(e,t){return Tn(this,2,e,t)};R.toDecimalPlaces=R.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ae(e,0,Ne),t===void 0?t=n.rounding:ae(t,0,8),k(r,e+r.e+1,t))};R.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,!0):(ae(e,0,Ne),t===void 0?t=i.rounding:ae(t,0,8),n=k(new i(n),e+1,t),r=he(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=he(i):(ae(e,0,Ne),t===void 0?t=o.rounding:ae(t,0,8),n=k(new o(i),e+i.e+1,t),r=he(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};R.toFraction=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.d,A=S.constructor;if(!C)return new A(S);if(l=r=new A(1),n=u=new A(0),t=new A(n),o=t.e=bo(C)-S.e-1,s=o%N,t.d[0]=H(10,s<0?N+s:s),e==null)e=o>0?t:l;else{if(a=new A(e),!a.isInt()||a.lt(l))throw Error(Me+a);e=a.gt(t)?o>0?t:l:a}for(F=!1,a=new A(Z(C)),g=A.precision,A.precision=o=C.length*N*2;h=q(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=u.plus(h.times(i)),u=i,i=t,t=a.minus(h.times(i)),a=i;return i=q(e.minus(r),n,0,1,1),u=u.plus(i.times(l)),r=r.plus(i.times(n)),u.s=l.s=S.s,x=q(l,n,o,1).minus(S).abs().cmp(q(u,r,o,1).minus(S).abs())<1?[l,n]:[u,r],A.precision=g,F=!0,x};R.toHexadecimal=R.toHex=function(e,t){return Tn(this,16,e,t)};R.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ae(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(F=!1,r=q(r,e,0,t,1).times(e),F=!0,k(r)):(e.s=r.s,r=e),r};R.toNumber=function(){return+this};R.toOctal=function(e,t){return Tn(this,8,e,t)};R.toPower=R.pow=function(e){var t,r,n,i,o,s,a=this,u=a.constructor,l=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(H(+a,l));if(a=new u(a),a.eq(1))return a;if(n=u.precision,o=u.rounding,e.eq(1))return k(a,n,o);if(t=te(e.e/N),t>=e.d.length-1&&(r=l<0?-l:l)<=gu)return i=xo(u,a,r,n),e.s<0?new u(1).div(i):k(i,n,o);if(s=a.s,s<0){if(tu.maxE+1||t0?s/0:0):(F=!1,u.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Pn(e.times(Oe(a,n+r)),n),i.d&&(i=k(i,n+5,1),Lt(i.d,n,o)&&(t=n+10,i=k(Pn(e.times(Oe(a,t+r)),t),t+5,1),+Z(i.d).slice(n+1,n+15)+1==1e14&&(i=k(i,n+1,0)))),i.s=s,F=!0,u.rounding=o,k(i,n,o))};R.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ae(e,1,Ne),t===void 0?t=i.rounding:ae(t,0,8),n=k(new i(n),e,t),r=he(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toSignificantDigits=R.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ae(e,1,Ne),t===void 0?t=n.rounding:ae(t,0,8)),k(new n(r),e,t)};R.toString=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};R.truncated=R.trunc=function(){return k(new this.constructor(this),this.e+1,1)};R.valueOf=R.toJSON=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Z(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Me+e)}function Lt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=N,i=0):(i=Math.ceil((t+1)/N),t%=N),o=H(10,N-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,s}function hr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function yu(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Pr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=pt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var q=function(){function e(n,i,o){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*i+a,n[u]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;ai[a]?1:-1;break}return u}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,u){var l,g,h,x,S,C,A,D,O,B,M,I,X,L,Ye,Be,fe,$e,Q,Re,qe=n.constructor,Ze=n.s==i.s?1:-1,ee=n.d,U=i.d;if(!ee||!ee[0]||!U||!U[0])return new qe(!n.s||!i.s||(ee?U&&ee[0]==U[0]:!U)?NaN:ee&&ee[0]==0||!U?Ze*0:Ze/0);for(u?(S=1,g=n.e-i.e):(u=pe,S=N,g=te(n.e/S)-te(i.e/S)),Q=U.length,fe=ee.length,O=new qe(Ze),B=O.d=[],h=0;U[h]==(ee[h]||0);h++);if(U[h]>(ee[h]||0)&&g--,o==null?(L=o=qe.precision,s=qe.rounding):a?L=o+(n.e-i.e)+1:L=o,L<0)B.push(1),C=!0;else{if(L=L/S+2|0,h=0,Q==1){for(x=0,U=U[0],L++;(h1&&(U=e(U,x,u),ee=e(ee,x,u),Q=U.length,fe=ee.length),Be=Q,M=ee.slice(0,Q),I=M.length;I=u/2&&++$e;do x=0,l=t(U,M,Q,I),l<0?(X=M[0],Q!=I&&(X=X*u+(M[1]||0)),x=X/$e|0,x>1?(x>=u&&(x=u-1),A=e(U,x,u),D=A.length,I=M.length,l=t(A,M,D,I),l==1&&(x--,r(A,Q=10;x/=10)h++;O.e=h+g*S-1,k(O,a?o+O.e+1:o,s,C)}return O}}();function k(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=N,s=t,g=h[x=0],u=g/H(10,i-s-1)%10|0;else if(x=Math.ceil((o+1)/N),a=h.length,x>=a)if(n){for(;a++<=x;)h.push(0);g=u=0,i=1,o%=N,s=o-N+1}else break e;else{for(g=a=h[x],i=1;a>=10;a/=10)i++;o%=N,s=o-N+i,u=s<0?0:g/H(10,i-s-1)%10|0}if(n=n||t<0||h[x+1]!==void 0||(s<0?g:g%H(10,i-s-1)),l=r<4?(u||n)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(o>0?s>0?g/H(10,i-s):0:h[x-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,l?(t-=e.e+1,h[0]=H(10,(N-t%N)%N),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=x,a=1,x--):(h.length=x+1,a=H(10,N-o),h[x]=s>0?(g/H(10,i-s)%H(10,s)|0)*a:0),l)for(;;)if(x==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==pe&&(h[0]=1));break}else{if(h[x]+=a,h[x]!=pe)break;h[x--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return F&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+De(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+De(-i-1)+o,r&&(n=r-s)>0&&(o+=De(n))):i>=s?(o+=De(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+De(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=De(n))),o}function xr(e,t){var r=e[0];for(t*=N;r>=10;r/=10)t++;return t}function Er(e,t,r){if(t>hu)throw F=!0,r&&(e.precision=r),Error(ho);return k(new e(yr),t,1,!0)}function ce(e,t,r){if(t>xn)throw Error(ho);return k(new e(wr),t,r,!0)}function bo(e){var t=e.length-1,r=t*N+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function De(e){for(var t="";e--;)t+="0";return t}function xo(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/N+4);for(F=!1;;){if(r%2&&(o=o.times(t),fo(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),fo(t.d,s)}return F=!0,o}function po(e){return e.d[e.d.length-1]&1}function Po(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new x(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(F=!1,u=C):u=t,a=new x(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(H(2,h))/Math.LN10*2+5|0,u+=n,r=o=s=new x(1),x.precision=u;;){if(o=k(o.times(e),u,1),r=r.times(++g),a=s.plus(q(o,r,u,1)),Z(a.d).slice(0,u)===Z(s.d).slice(0,u)){for(i=h;i--;)s=k(s.times(s),u,1);if(t==null)if(l<3&&Lt(s.d,u-n,S,l))x.precision=u+=10,r=o=a=new x(1),g=0,l++;else return k(s,x.precision=C,S,F=!0);else return x.precision=C,s}s=a}}function Oe(e,t){var r,n,i,o,s,a,u,l,g,h,x,S=1,C=10,A=e,D=A.d,O=A.constructor,B=O.rounding,M=O.precision;if(A.s<0||!D||!D[0]||!A.e&&D[0]==1&&D.length==1)return new O(D&&!D[0]?-1/0:A.s!=1?NaN:D?0:A);if(t==null?(F=!1,g=M):g=t,O.precision=g+=C,r=Z(D),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Z(A.d),n=r.charAt(0),S++;o=A.e,n>1?(A=new O("0."+r),o++):A=new O(n+"."+r.slice(1))}else return l=Er(O,g+2,M).times(o+""),A=Oe(new O(n+"."+r.slice(1)),g-C).plus(l),O.precision=M,t==null?k(A,M,B,F=!0):A;for(h=A,u=s=A=q(A.minus(1),A.plus(1),g,1),x=k(A.times(A),g,1),i=3;;){if(s=k(s.times(x),g,1),l=u.plus(q(s,new O(i),g,1)),Z(l.d).slice(0,g)===Z(u.d).slice(0,g))if(u=u.times(2),o!==0&&(u=u.plus(Er(O,g+2,M).times(o+""))),u=q(u,new O(S),g,1),t==null)if(Lt(u.d,g-C,B,a))O.precision=g+=C,l=s=A=q(h.minus(1),h.plus(1),g,1),x=k(A.times(A),g,1),i=a=1;else return k(u,O.precision=M,B,F=!0);else return O.precision=M,u;u=l,i+=2}}function vo(e){return String(e.s*e.s/0)}function vn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%N,r<0&&(n+=N),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Eo.test(t))return vn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(mu.test(t))r=16,t=t.toLowerCase();else if(fu.test(t))r=2;else if(du.test(t))r=8;else throw Error(Me+t);for(o=t.search(/p/i),o>0?(u=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=xo(n,new n(r),o,o*2)),l=hr(t,r,pe),g=l.length-1,o=g;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=xr(l,g),e.d=l,F=!1,s&&(e=q(e,i,a*4)),u&&(e=e.times(Math.abs(u)<54?H(2,u):Ge.pow(2,u))),F=!0,e)}function Eu(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:pt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Pr(5,r)),t=pt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function pt(e,t,r,n,i){var o,s,a,u,l=1,g=e.precision,h=Math.ceil(g/N);for(F=!1,u=r.times(r),a=new e(n);;){if(s=q(a.times(u),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=q(s.times(u),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,l++}return F=!0,s.d.length=h+1,s}function Pr(e,t){for(var r=e;--t;)r*=e;return r}function To(e,t){var r,n=t.s<0,i=ce(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Ce=n?4:1,t;if(r=t.divToInt(i),r.isZero())Ce=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Ce=po(r)?n?2:3:n?4:1,t;Ce=po(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Tn(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor,C=r!==void 0;if(C?(ae(r,1,Ne),n===void 0?n=S.rounding:ae(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=vo(e);else{for(g=he(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),x=new S(1),x.e=g.length-s,x.d=hr(he(x),10,i),x.e=x.d.length),h=hr(g,10,i),o=u=h.length;h[--u]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=q(e,x,r,n,0,i),h=e.d,o=e.e,l=go),s=h[r],a=i/2,l=l||h[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,l)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(u=h.length;!h[u-1];--u);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)g+="0";for(h=hr(g,i,t),u=h.length;!h[u-1];--u);for(s=1,g="1.";su)for(o-=u;o--;)g+="0";else ot)return e.length=t,!0}function bu(e){return new this(e).abs()}function xu(e){return new this(e).acos()}function Pu(e){return new this(e).acosh()}function vu(e,t){return new this(e).plus(t)}function Tu(e){return new this(e).asin()}function Cu(e){return new this(e).asinh()}function Au(e){return new this(e).atan()}function Ru(e){return new this(e).atanh()}function Su(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ce(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ce(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ce(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(q(e,t,o,1)),t=ce(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(q(e,t,o,1)),r}function Iu(e){return new this(e).cbrt()}function ku(e){return k(e=new this(e),e.e+1,2)}function Du(e,t,r){return new this(e).clamp(t,r)}function Ou(e){if(!e||typeof e!="object")throw Error(br+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ne,"rounding",0,8,"toExpNeg",-ct,0,"toExpPos",0,ct,"maxE",0,ct,"minE",-ct,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Me+r+": "+n);if(r="crypto",i&&(this[r]=bn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(yo);else this[r]=!1;else throw Error(Me+r+": "+n);return this}function Mu(e){return new this(e).cos()}function Nu(e){return new this(e).cosh()}function Co(e){var t,r,n;function i(o){var s,a,u,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,mo(o)){l.s=o.s,F?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e=10;a/=10)s++;F?s>i.maxE?(l.e=NaN,l.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(yo);else for(;o=10;i/=10)n++;n`}};function mt(e){return e instanceof Bt}d();c();p();f();m();d();c();p();f();m();var vr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};d();c();p();f();m();var Tr=e=>e,Cr={bold:Tr,red:Tr,green:Tr,dim:Tr,enabled:!1},Ao={bold:sr,red:nt,green:Ri,dim:ar,enabled:!0},dt={write(e){e.writeLine(",")}};d();c();p();f();m();var we=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};d();c();p();f();m();var _e=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var gt=class extends _e{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new vr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new we("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(dt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};d();c();p();f();m();var Ro=": ",Ar=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Ro.length}write(t){let r=new we(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Ro).write(this.value)}};d();c();p();f();m();var Rr=class e extends _e{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let u;if(s.value instanceof e?u=s.value.getField(a):s.value instanceof gt&&(u=s.value.getField(Number(a))),!u)return;s=u}return s}getDeepFieldValue(r){var n;return r.length===0?this:(n=this.getDeepField(r))==null?void 0:n.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){var n;return(n=this.getField(r))==null?void 0:n.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){var i,o;let r=(i=this.getField("select"))==null?void 0:i.value.asObject();if(r)return{kind:"select",value:r};let n=(o=this.getField("include"))==null?void 0:o.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){var n;return(n=this.getSelectionParent())==null?void 0:n.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new we("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(dt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};d();c();p();f();m();var z=class extends _e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new we(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var Cn=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Sr(e){return new Cn(So(e))}function So(e){let t=new Rr;for(let[r,n]of Object.entries(e)){let i=new Ar(r,Io(n));t.addField(i)}return t}function Io(e){if(typeof e=="string")return new z(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new z(String(e));if(typeof e=="bigint")return new z(`${e}n`);if(e===null)return new z("null");if(e===void 0)return new z("undefined");if(ft(e))return new z(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new z(`Buffer.alloc(${e.byteLength})`):new z(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=gr(e)?e.toISOString():"Invalid Date";return new z(`new Date("${t}")`)}return e instanceof Te?new z(`Prisma.${e._getName()}`):mt(e)?new z(`prisma.${co(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?sl(e):typeof e=="object"?So(e):new z(Object.prototype.toString.call(e))}function sl(e){let t=new gt;for(let r of e)t.addItem(Io(r));return t}function ko(e){if(e===void 0)return"";let t=Sr(e);return new ut(0,{colors:Cr}).write(t).toString()}d();c();p();f();m();var al="P2037";function $t({error:e,user_facing_error:t},r,n){return t.error_code?new K(ul(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new oe(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function ul(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===al&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var An=class{getLocation(){return null}};function Fe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new An}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Do={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function ht(e={}){let t=cl(e);return Object.entries(t).reduce((n,[i,o])=>(Do[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function cl(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Ir(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Oo(e,t){let r=Ir(e);return t({action:"aggregate",unpacker:r,argsMapper:ht})(e)}d();c();p();f();m();function pl(e={}){let{select:t,...r}=e;return typeof t=="object"?ht({...r,_count:t}):ht({...r,_count:{_all:!0}})}function fl(e={}){return typeof e.select=="object"?t=>Ir(e)(t)._count:t=>Ir(e)(t)._count._all}function Mo(e,t){return t({action:"count",unpacker:fl(e),argsMapper:pl})(e)}d();c();p();f();m();function ml(e={}){let t=ht(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function dl(e={}){return t=>(typeof(e==null?void 0:e._count)=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function No(e,t){return t({action:"groupBy",unpacker:dl(e),argsMapper:ml})(e)}function _o(e,t,r){if(t==="aggregate")return n=>Oo(n,r);if(t==="count")return n=>Mo(n,r);if(t==="groupBy")return n=>No(n,r)}d();c();p();f();m();function Fo(e,t){let r=t.fields.filter(i=>!i.relationName),n=cn(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Bt(e,o,s.type,s.isList,s.kind==="enum")},...mr(Object.keys(n))})}d();c();p();f();m();d();c();p();f();m();var Lo=e=>Array.isArray(e)?e:e.split("."),Rn=(e,t)=>Lo(t).reduce((r,n)=>r&&r[n],e),Bo=(e,t,r)=>Lo(t).reduceRight((n,i,o,s)=>Object.assign({},Rn(e,s.slice(0,o)),{[i]:n}),r);function gl(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function hl(e,t,r){return t===void 0?e!=null?e:{}:Bo(t,r,e||!0)}function Sn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((u,l)=>({...u,[l.name]:l}),{});return u=>{let l=Fe(e._errorFormat),g=gl(n,i),h=hl(u,o,g),x=r({dataPath:g,callsite:l})(h),S=yl(e,t);return new Proxy(x,{get(C,A){if(!S.includes(A))return C[A];let O=[a[A].type,r,A],B=[g,h];return Sn(e,...O,...B)},...mr([...S,...Object.getOwnPropertyNames(x)])})}}function yl(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}d();c();p();f();m();d();c();p();f();m();var wl=Ue(Ki());var El={red:nt,gray:Di,dim:ar,bold:sr,underline:Ai,highlightSource:e=>e.highlight()},bl={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function xl({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r!=null?r:!1,callArguments:n}}function Pl({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],u=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${u}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${u}`)),t&&a.push(s.underline(vl(t))),i){a.push("");let l=[i.toString()];o&&(l.push(o),l.push(s.dim(")"))),a.push(l.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function vl(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function yt(e){let t=e.showColors?El:bl,r;return typeof $getTemplateParameters!="undefined"?r=$getTemplateParameters(e,t):r=xl(e),Pl(r,t)}function $o(e,t,r,n){return e===ke.ModelAction.findFirstOrThrow||e===ke.ModelAction.findUniqueOrThrow?Tl(t,r,n):n}function Tl(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=yt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new Y(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof K&&o.code==="P2025"?new Pe(`No ${e} found`,t):o})}}d();c();p();f();m();function Ee(e){return e.replace(/^./,t=>t.toLowerCase())}var Cl=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Al=["aggregate","count","groupBy"];function In(e,t){var i;let r=(i=e._extensions.getAllModelExtensions(t))!=null?i:{},n=[Rl(e,t),Il(e,t),Ft(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return ge({},n)}function Rl(e,t){let r=Ee(t),n=Object.keys(ke.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=u=>e._request(u);s=$o(o,t,e._clientVersion,s);let a=u=>l=>{let g=Fe(e._errorFormat);return e._createPrismaPromise(h=>{let x={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...x,...u})})};return Cl.includes(o)?Sn(e,t,a):Sl(i)?_o(e,i,a):a({})}}}function Sl(e){return Al.includes(e)}function Il(e,t){return Qe(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return Fo(t,r)}))}d();c();p();f();m();function qo(e){return e.replace(/^./,t=>t.toUpperCase())}var kn=Symbol();function qt(e){let t=[kl(e),ne(kn,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Ft(r)),ge(e,t)}function kl(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Ee),n=[...new Set(t.concat(r))];return Qe({getKeys(){return n},getPropertyValue(i){let o=qo(i);if(e._runtimeDataModel.models[o]!==void 0)return In(e,o);if(e._runtimeDataModel.models[i]!==void 0)return In(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Uo(e){return e[kn]?e[kn]:e}function Vo(e){var r;if(typeof e=="function")return e(this);if((r=e.client)!=null&&r.__AccelerateEngine){let n=e.client.__AccelerateEngine;this._originalClient._engine=new n(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return qt(t)}d();c();p();f();m();d();c();p();f();m();function jo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let u of Object.values(o)){if(n){if(n[u.name])continue;let l=u.needs.filter(g=>n[g]);l.length>0&&a.push(at(l))}else if(r){if(!r[u.name])continue;let l=u.needs.filter(g=>!r[g]);l.length>0&&a.push(at(l))}Dl(e,u.needs)&&s.push(Ol(u,ge(e,s)))}return s.length>0||a.length>0?ge(e,[...s,...a]):e}function Dl(e,t){return t.every(r=>ln(e,r))}function Ol(e,t){return Qe(ne(e.name,()=>e.compute(t)))}d();c();p();f();m();function kr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){var s;if(Array.isArray(t)){for(let a=0;ag.name===o);if(!u||u.kind!=="object"||!u.relationName)continue;let l=typeof s=="object"?s:{};t[o]=kr({visitor:i,result:t[o],args:l,modelName:u.type,runtimeDataModel:n})}}function Qo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:kr({result:e,args:r!=null?r:{},modelName:t,runtimeDataModel:i,visitor:(s,a,u)=>jo({result:s,modelName:Ee(a),select:u.select,omit:u.omit,extensions:n})})}d();c();p();f();m();d();c();p();f();m();function Go(e){if(e instanceof se)return Ml(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{var s,a;let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(((s=t.transaction)==null?void 0:s.kind)==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Go((a=t.args)!=null?a:{}),__internalParams:t,query:(u,l=t)=>{let g=l.customDataProxyFetch;return l.customDataProxyFetch=Zo(o,g),l.args=u,Wo(e,l,r,n+1)}})})}function Ko(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r!=null?r:"$none",o);return Wo(e,t,s)}function zo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Yo(r,n,0,e):e(r)}}function Yo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let u=a.customDataProxyFetch;return a.customDataProxyFetch=Zo(i,u),Yo(a,t,r+1,n)}})}var Ho=e=>e;function Zo(e=Ho,t=Ho){return r=>e(t(r))}d();c();p();f();m();d();c();p();f();m();function es(e,t,r){let n=Ee(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Nl({...e,...Xo(t.name,e,t.result.$allModels),...Xo(t.name,e,t.result[n])})}function Nl(e){let t=new de,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return ot(e,n=>({...n,needs:r(n.name,new Set)}))}function Xo(e,t,r){return r?ot(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:_l(t,o,i)})):{}}function _l(e,t,r){var i;let n=(i=e==null?void 0:e[t])==null?void 0:i.compute;return n?o=>r({...o,[t]:n(o)}):r}function ts(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function rs(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Dr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new de;this.modelExtensionsCache=new de;this.queryCallbacksCache=new de;this.clientExtensions=kt(()=>{var t,r;return this.extension.client?{...(r=this.previous)==null?void 0:r.getAllClientExtensions(),...this.extension.client}:(t=this.previous)==null?void 0:t.getAllClientExtensions()});this.batchCallbacks=kt(()=>{var n,i,o;let t=(i=(n=this.previous)==null?void 0:n.getAllBatchQueryCallbacks())!=null?i:[],r=(o=this.extension.query)==null?void 0:o.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>{var r;return es((r=this.previous)==null?void 0:r.getAllComputedFields(t),this.extension,t)})}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{var n,i;let r=Ee(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?(n=this.previous)==null?void 0:n.getAllModelExtensions(t):{...(i=this.previous)==null?void 0:i.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{var s,a;let n=(a=(s=this.previous)==null?void 0:s.getAllQueryCallbacks(t,r))!=null?a:[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Or=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Dr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Dr(t,this.head))}getAllComputedFields(t){var r;return(r=this.head)==null?void 0:r.getAllComputedFields(t)}getAllClientExtensions(){var t;return(t=this.head)==null?void 0:t.getAllClientExtensions()}getAllModelExtensions(t){var r;return(r=this.head)==null?void 0:r.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){var n,i;return(i=(n=this.head)==null?void 0:n.getAllQueryCallbacks(t,r))!=null?i:[]}getAllBatchQueryCallbacks(){var t,r;return(r=(t=this.head)==null?void 0:t.getAllBatchQueryCallbacks())!=null?r:[]}};d();c();p();f();m();var ns=re("prisma:client"),is={Vercel:"vercel","Netlify CI":"netlify"};function os({postinstall:e,ciName:t,clientVersion:r}){if(ns("checkPlatformCaching:postinstall",e),ns("checkPlatformCaching:ciName",t),e===!0&&t&&t in is){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${is[t]}-build`;throw console.error(n),new G(n,r)}}d();c();p();f();m();function ss(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Fl="Cloudflare-Workers",Ll="node";function as(){var e,t,r;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Fl?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((r=(t=globalThis.process)==null?void 0:t.release)==null?void 0:r.name)===Ll?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var Bl={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Mr(){let e=as();return{id:e,prettyName:Bl[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function wt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){var u,l;let i,o=Object.keys(e)[0],s=(u=e[o])==null?void 0:u.url,a=(l=t[o])==null?void 0:l.url;if(o===void 0?i=void 0:a?i=a:s!=null&&s.value?i=s.value:s!=null&&s.fromEnvVar&&(i=r[s.fromEnvVar]),(s==null?void 0:s.fromEnvVar)!==void 0&&i===void 0)throw Mr().id==="workerd"?new G(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new G(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new G("error: Missing URL environment variable, value, or override.",n);return i}d();c();p();f();m();d();c();p();f();m();var Nr=class extends Error{constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var ue=class extends Nr{constructor(t,r){var n;super(t,r),this.isRetryable=(n=r.isRetryable)!=null?n:!0}};d();c();p();f();m();d();c();p();f();m();function $(e,t){return{...e,isRetryable:t}}var Et=class extends ue{constructor(r){super("This request must be retried",$(r,!0));this.name="ForcedRetryError";this.code="P5001"}};_(Et,"ForcedRetryError");d();c();p();f();m();var He=class extends ue{constructor(r,n){super(r,$(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};_(He,"InvalidDatasourceError");d();c();p();f();m();var We=class extends ue{constructor(r,n){super(r,$(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};_(We,"NotImplementedYetError");d();c();p();f();m();d();c();p();f();m();var j=class extends ue{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 Ke=class extends j{constructor(r){super("Schema needs to be uploaded",$(r,!0));this.name="SchemaMissingError";this.code="P5005"}};_(Ke,"SchemaMissingError");d();c();p();f();m();d();c();p();f();m();var Dn="This request could not be understood by the server",Vt=class extends j{constructor(r,n,i){super(n||Dn,$(r,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};_(Vt,"BadRequestError");d();c();p();f();m();var jt=class extends j{constructor(r,n){super("Engine not started: healthcheck timeout",$(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};_(jt,"HealthcheckTimeoutError");d();c();p();f();m();var Jt=class extends j{constructor(r,n,i){super(n,$(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};_(Jt,"EngineStartupError");d();c();p();f();m();var Qt=class extends j{constructor(r){super("Engine version is not supported",$(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};_(Qt,"EngineVersionNotSupportedError");d();c();p();f();m();var On="Request timed out",Gt=class extends j{constructor(r,n=On){super(n,$(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};_(Gt,"GatewayTimeoutError");d();c();p();f();m();var $l="Interactive transaction error",Ht=class extends j{constructor(r,n=$l){super(n,$(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};_(Ht,"InteractiveTransactionError");d();c();p();f();m();var ql="Request parameters are invalid",Wt=class extends j{constructor(r,n=ql){super(n,$(r,!1));this.name="InvalidRequestError";this.code="P5011"}};_(Wt,"InvalidRequestError");d();c();p();f();m();var Mn="Requested resource does not exist",Kt=class extends j{constructor(r,n=Mn){super(n,$(r,!1));this.name="NotFoundError";this.code="P5003"}};_(Kt,"NotFoundError");d();c();p();f();m();var Nn="Unknown server error",bt=class extends j{constructor(r,n,i){super(n||Nn,$(r,!0));this.name="ServerError";this.code="P5006";this.logs=i}};_(bt,"ServerError");d();c();p();f();m();var _n="Unauthorized, check your connection string",zt=class extends j{constructor(r,n=_n){super(n,$(r,!1));this.name="UnauthorizedError";this.code="P5007"}};_(zt,"UnauthorizedError");d();c();p();f();m();var Fn="Usage exceeded, retry again later",Yt=class extends j{constructor(r,n=Fn){super(n,$(r,!0));this.name="UsageExceededError";this.code="P5008"}};_(Yt,"UsageExceededError");async function Ul(e){let t;try{t=await e.text()}catch(r){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(r){return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Zt(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Ul(e);if(n.type==="QueryEngineError")throw new K(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new bt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Ke(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Qt(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Jt(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new G(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new jt(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 Ht(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Wt(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new zt(r,xt(_n,n));if(e.status===404)return new Kt(r,xt(Mn,n));if(e.status===429)throw new Yt(r,xt(Fn,n));if(e.status===504)throw new Gt(r,xt(On,n));if(e.status>=500)throw new bt(r,xt(Nn,n));if(e.status>=400)throw new Vt(r,xt(Dn,n))}function xt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}d();c();p();f();m();function us(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))}d();c();p();f();m();var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function ls(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,u,l,g;for(let h=0;h>18,a=(g&258048)>>12,u=(g&4032)>>6,l=g&63,r+=Ae[s]+Ae[a]+Ae[u]+Ae[l];return i==1?(g=t[o],s=(g&252)>>2,a=(g&3)<<4,r+=Ae[s]+Ae[a]+"=="):i==2&&(g=t[o]<<8|t[o+1],s=(g&64512)>>10,a=(g&1008)>>4,u=(g&15)<<2,r+=Ae[s]+Ae[a]+Ae[u]+"="),r}d();c();p();f();m();function cs(e){var r;if(!!((r=e.generator)!=null&&r.previewFeatures.some(n=>n.toLowerCase().includes("metrics"))))throw new G("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)}d();c();p();f();m();function Vl(e){return e[0]*1e3+e[1]/1e6}function ps(e){return new Date(Vl(e))}d();c();p();f();m();var fs={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};d();c();p();f();m();d();c();p();f();m();var Xt=class extends ue{constructor(r,n){super(`Cannot fetch data from service: -${r}`,$(n,!0));this.name="RequestError";this.code="P5010"}};_(Xt,"RequestError");async function ze(e,t,r=n=>n){var i;let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(Ln)(e,t)}catch(o){let s=(i=o.message)!=null?i:"Unknown error";throw new Xt(s,{clientVersion:n})}}function Jl(e){return{...e.headers,"Content-Type":"application/json"}}function Ql(e){return{method:e.method,headers:Jl(e)}}function Gl(e,t){return{text:()=>Promise.resolve(w.Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(w.Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new Bn(t.headers)}}async function Ln(e,t={}){let r=Hl("https"),n=Ql(t),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{var l;let u=r.request(e,n,g=>{let{statusCode:h,headers:{location:x}}=g;h>=301&&h<=399&&x&&(x.startsWith("http")===!1?s(Ln(`${o}${x}`,t)):s(Ln(x,t))),g.on("data",S=>i.push(S)),g.on("end",()=>s(Gl(i,g))),g.on("error",a)});u.on("error",a),u.end((l=t.body)!=null?l:"")})}var Hl=typeof require!="undefined"?require:()=>{},Bn=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let i of n)this.headers.set(r,i)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){var r;return(r=this.headers.get(t))!=null?r:null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,i]of this.headers)t.call(r,i,n,this)}};var Wl=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,ms=re("prisma:client:dataproxyEngine");async function Kl(e,t){var s,a,u;let r=fs["@prisma/engines-version"],n=(s=t.clientVersion)!=null?s:"unknown";if(y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=(a=n==null?void 0:n.split("-"))!=null?a:[];if(o===void 0&&Wl.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[l]=(u=r.split("-"))!=null?u:[],[g,h,x]=l.split("."),S=zl(`<=${g}.${h}.${x}`),C=await ze(S,{clientVersion:n});if(!C.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${C.status} ${C.statusText}, response body: ${await C.text()||""}`);let A=await C.text();ms("length of body fetched from unpkg.com",A.length);let D;try{D=JSON.parse(A)}catch(O){throw console.error("JSON.parse error: body fetched from unpkg.com: ",A),O}return D.version}throw new We("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function ds(e,t){let r=await Kl(e,t);return ms("version",r),r}function zl(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var gs=3,$n=re("prisma:client:dataproxyEngine"),qn=class{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!=null?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}},er=class{constructor(t){this.name="DataProxyEngine";cs(t),this.config=t,this.env={...t.env,...typeof y!="undefined"?y.env:{}},this.inlineSchema=ls(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[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new qn({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await ds(t,this.config),$n("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){var r,n;(r=t==null?void 0:t.logs)!=null&&r.length&&t.logs.forEach(i=>{switch(i.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let o=typeof i.attributes.query=="string"?i.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[s]=o.split("/* traceparent");o=s}this.logEmitter.emit("query",{query:o,timestamp:ps(i.timestamp),duration:Number(i.attributes.duration_ms),params:i.attributes.params,target:i.attributes.target})}}}),(n=t==null?void 0:t.traces)!=null&&n.length&&this.tracingHelper.createEngineSpan({span:!0,spans:t.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await ze(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||$n("schema response status",r.status);let n=await Zt(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==null?void 0:n.kind)==="itx"?n.options:void 0,s=dr(t,n),{batchResult:a,elapsed:u}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r});return a.map(l=>"errors"in l&&l.errors.length>0?$t(l.errors[0],this.clientVersion,this.config.activeProvider):{data:l,elapsed:u})}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 ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||$n("graphql response status",a.status),await this.handleError(await Zt(a,this.clientVersion));let u=await a.json(),l=u.extensions;if(l&&this.propagateResponseExtensions(l),u.errors)throw u.errors.length===1?$t(u.errors[0],this.config.clientVersion,this.config.activeProvider):new oe(u.errors,{clientVersion:this.config.clientVersion});return u}})}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 u=await ze(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Zt(u,this.clientVersion));let l=await u.json(),g=l.extensions;g&&this.propagateResponseExtensions(g);let h=l.id,x=l["data-proxy"].endpoint;return{id:h,payload:{endpoint:x}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Zt(a,this.clientVersion));let l=(await a.json()).extensions;l&&this.propagateResponseExtensions(l);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=wt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch(l){throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:")throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let u=a.get("api_key");if(u===null||u.length<1)throw new He(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,u]}metrics(){throw new We("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){var r;for(let n=0;;n++){let i=o=>{this.logEmitter.emit("info",{message:`Calling ${o} (n=${n})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:i})}catch(o){if(!(o instanceof ue)||!o.isRetryable)throw o;if(n>=gs)throw o instanceof Et?o.cause:o;this.logEmitter.emit("warn",{message:`Attempt ${n+1}/${gs} failed for ${t.actionGerund}: ${(r=o.message)!=null?r:"(unknown)"}`,timestamp:new Date,target:""});let s=await us(n);this.logEmitter.emit("warn",{message:`Retrying after ${s}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof Ke)throw await this.uploadSchema(),new Et({clientVersion:this.clientVersion,cause:t});if(t)throw t}applyPendingMigrations(){throw new Error("Method not implemented.")}};function hs({copyEngine:e=!0},t){let r;try{r=wt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch(u){}e&&(r!=null&&r.startsWith("prisma://"))&&It("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Rt(t.generator),i=!!(r!=null&&r.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o){let u;throw u=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new Y(u.join(` -`),{clientVersion:t.clientVersion})}if(i)return new er(t);throw new Y("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}d();c();p();f();m();function _r({generator:e}){var t;return(t=e==null?void 0:e.previewFeatures)!=null?t:[]}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Ps=Ue(Un());d();c();p();f();m();function bs(e,t){let r=xs(e),n=Yl(r),i=Xl(n);i?Fr(i,t):t.addErrorMessage(()=>"Unknown error")}function xs(e){return e.errors.flatMap(t=>t.kind==="Union"?xs(t):[t])}function Yl(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:Zl(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Zl(e,t){return[...new Set(e.concat(t))]}function Xl(e){return pn(e,(t,r)=>{let n=ws(t),i=ws(r);return n!==i?n-i:Es(t)-Es(r)})}function ws(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Es(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}d();c();p();f();m();var le=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};d();c();p();f();m();var Lr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(dt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Fr(e,t){switch(e.kind){case"MutuallyExclusiveFields":ec(e,t);break;case"IncludeOnScalar":tc(e,t);break;case"EmptySelection":rc(e,t);break;case"UnknownSelectionField":oc(e,t);break;case"UnknownArgument":sc(e,t);break;case"UnknownInputField":ac(e,t);break;case"RequiredArgumentMissing":uc(e,t);break;case"InvalidArgumentType":lc(e,t);break;case"InvalidArgumentValue":cc(e,t);break;case"ValueTooLarge":pc(e,t);break;case"SomeFieldsMissing":fc(e,t);break;case"TooManyFieldsGiven":mc(e,t);break;case"Union":bs(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function ec(e,t){var n,i,o;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();r&&((i=r.getField(e.firstField))==null||i.markAsError(),(o=r.getField(e.secondField))==null||o.markAsError()),t.addErrorMessage(s=>`Please ${s.bold("either")} use ${s.green(`\`${e.firstField}\``)} or ${s.green(`\`${e.secondField}\``)}, but ${s.red("not both")} at the same time.`)}function tc(e,t){var s,a;let[r,n]=Br(e.selectionPath),i=e.outputType,o=(s=t.arguments.getDeepSelectionParent(r))==null?void 0:s.value;if(o&&((a=o.getField(n))==null||a.markAsError(),i))for(let u of i.fields)u.isRelation&&o.addSuggestion(new le(u.name,"true"));t.addErrorMessage(u=>{let l=`Invalid scalar field ${u.red(`\`${n}\``)} for ${u.bold("include")} statement`;return i?l+=` on model ${u.bold(i.name)}. ${tr(u)}`:l+=".",l+=` -Note that ${u.bold("include")} statements only accept relation fields.`,l})}function rc(e,t){var n,i;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();if(r){let o=(i=r.getField("omit"))==null?void 0:i.value.asObject();if(o){nc(e,t,o);return}}ic(e,t)}function nc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new le(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function ic(e,t){var o,s;let r=e.outputType,n=(o=t.arguments.getDeepSelectionParent(e.selectionPath))==null?void 0:o.value,i=(s=n==null?void 0:n.isEmpty())!=null?s:!1;n&&(n.removeAllFields(),Cs(n,r)),t.addErrorMessage(a=>i?`The ${a.red("`select`")} statement for type ${a.bold(r.name)} must not be empty. ${tr(a)}`:`The ${a.red("`select`")} statement for type ${a.bold(r.name)} needs ${a.bold("at least one truthy value")}.`)}function oc(e,t){var s,a,u,l,g,h,x;let[r,n]=Br(e.selectionPath),i=(s=t.arguments.getDeepSubSelectionValue(r))==null?void 0:s.asObject(),o;if(i){let S=(a=i.getFieldValue("select"))==null?void 0:a.asObject(),C=(u=i.getFieldValue("include"))==null?void 0:u.asObject(),A=(l=i.getFieldValue("omit"))==null?void 0:l.asObject();S!=null&&S.hasField(n)?(o="select",(g=S.getField(n))==null||g.markAsError(),Cs(S,e.outputType)):C!=null&&C.hasField(n)?(o="include",(h=C.getField(n))==null||h.markAsError(),dc(C,e.outputType)):A!=null&&A.hasField(n)&&(o="omit",(x=A.getField(n))==null||x.markAsError(),gc(A,e.outputType))}t.addErrorMessage(S=>{let C=[`Unknown field ${S.red(`\`${n}\``)}`];return o&&C.push(`for ${S.bold(o)} statement`),C.push(`on model ${S.bold(`\`${e.outputType.name}\``)}.`),C.push(tr(S)),C.join(" ")})}function sc(e,t){var i,o;let r=e.argumentPath[0],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getField(r))==null||o.markAsError(),hc(n,e.arguments)),t.addErrorMessage(s=>vs(s,r,e.arguments.map(a=>a.name)))}function ac(e,t){var o,s,a;let[r,n]=Br(e.argumentPath),i=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject();if(i){(s=i.getDeepField(e.argumentPath))==null||s.markAsError();let u=(a=i.getDeepFieldValue(r))==null?void 0:a.asObject();u&&As(u,e.inputType)}t.addErrorMessage(u=>vs(u,n,e.inputType.fields.map(l=>l.name)))}function vs(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=wc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(tr(e)),n.join(" ")}function uc(e,t){var u,l;let r;t.addErrorMessage(g=>(r==null?void 0:r.value)instanceof z&&r.value.text==="null"?`Argument \`${g.green(o)}\` must not be ${g.red("null")}.`:`Argument \`${g.green(o)}\` is missing.`);let n=(u=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:u.asObject();if(!n)return;let[i,o]=Br(e.argumentPath),s=new Lr,a=(l=n.getDeepFieldValue(i))==null?void 0:l.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let g of e.inputTypes[0].fields)s.addField(g.name,g.typeNames.join(" | "));a.addSuggestion(new le(o,s).makeRequired())}else{let g=e.inputTypes.map(Ts).join(" | ");a.addSuggestion(new le(o,g).makeRequired())}}function Ts(e){return e.kind==="list"?`${Ts(e.elementType)}[]`:e.name}function lc(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=$r("or",e.argument.typeNames.map(u=>s.green(u)));return`Argument \`${s.bold(r)}\`: Invalid value provided. Expected ${a}, provided ${s.red(e.inferredType)}.`})}function cc(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=[`Invalid value for argument \`${s.bold(r)}\``];if(e.underlyingError&&a.push(`: ${e.underlyingError}`),a.push("."),e.argument.typeNames.length>0){let u=$r("or",e.argument.typeNames.map(l=>s.green(l)));a.push(` Expected ${u}.`)}return a.join("")})}function pc(e,t){var o;let r=e.argument.name,n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath),a=s==null?void 0:s.value;a==null||a.markAsError(),a instanceof z&&(i=a.text)}t.addErrorMessage(s=>{let a=["Unable to fit value"];return i&&a.push(s.red(i)),a.push(`into a 64-bit signed integer for field \`${s.bold(r)}\``),a.join(" ")})}function fc(e,t){var i,o;let r=e.argumentPath[e.argumentPath.length-1],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();if(n){let s=(o=n.getDeepFieldValue(e.argumentPath))==null?void 0:o.asObject();s&&As(s,e.inputType)}t.addErrorMessage(s=>{let a=[`Argument \`${s.bold(r)}\` of type ${s.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?a.push(`${s.green("at least one of")} ${$r("or",e.constraints.requiredFields.map(u=>`\`${s.bold(u)}\``))} arguments.`):a.push(`${s.green("at least one")} argument.`):a.push(`${s.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),a.push(tr(s)),a.join(" ")})}function mc(e,t){var o,s;let r=e.argumentPath[e.argumentPath.length-1],n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i=[];if(n){let a=(s=n.getDeepFieldValue(e.argumentPath))==null?void 0:s.asObject();a&&(a.markAsError(),i=Object.keys(a.getFields()))}t.addErrorMessage(a=>{let u=[`Argument \`${a.bold(r)}\` of type ${a.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?u.push(`${a.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?u.push(`${a.green("at most one")} argument,`):u.push(`${a.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),u.push(`but you provided ${$r("and",i.map(l=>a.red(l)))}. Please choose`),e.constraints.maxFieldCount===1?u.push("one."):u.push(`${e.constraints.maxFieldCount}.`),u.join(" ")})}function Cs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,"true"))}function dc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new le(r.name,"true"))}function gc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new le(r.name,"true"))}function hc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function As(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Br(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function tr({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function $r(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var yc=3;function wc(e,t){let r=1/0,n;for(let i of t){let o=(0,Ps.default)(e,i);o>yc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){var r;return(r=this.model)==null?void 0:r.fields.find(n=>n.name===t)}nestSelection(t){let r=this.findField(t),n=(r==null?void 0:r.kind)==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};d();c();p();f();m();var ks=e=>({command:e});d();c();p();f();m();d();c();p();f();m();var Ds=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);d();c();p();f();m();function rr(e){try{return Os(e,"fast")}catch(t){return Os(e,"slow")}}function Os(e,t){return JSON.stringify(e.map(r=>Sc(r,t)))}function Sc(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:lt(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ye.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Ic(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Ns(e):e}function Ic(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Ns(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ms);let t={};for(let r of Object.keys(e))t[r]=Ms(e[r]);return t}function Ms(e){return typeof e=="bigint"?e.toString():Ns(e)}var kc=/^(\s*alter\s)/i,_s=re("prisma:client");function Jn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&kc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Qn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:rr(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:rr(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:rr(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Ds(r),i={values:rr(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i!=null&&i.values?_s(`prisma.${e}(${n}, ${i.values})`):_s(`prisma.${e}(${n})`),{query:n,parameters:i}},Fs={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Ls={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};d();c();p();f();m();function Gn(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||(o==null?void 0:o.kind)==="itx"?n!=null?n:n=Bs(r(o)):Bs(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function Bs(e){return typeof e.then=="function"?e:Promise.resolve(e)}d();c();p();f();m();var $s={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Hn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){var t,r;return(r=(t=globalThis.PRISMA_INSTRUMENTATION)==null?void 0:t.helper)!=null?r:$s}};function qs(e){return e.includes("tracing")?new Hn:$s}d();c();p();f();m();function Us(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i==null?void 0:i(n)}}}d();c();p();f();m();var Dc=["$connect","$disconnect","$on","$transaction","$use","$extends"],Vs=Dc;d();c();p();f();m();function js(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}d();c();p();f();m();var Ur=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};d();c();p();f();m();var Qs=Ue(eo());d();c();p();f();m();function Vr(e){return typeof e.batchRequestIdx=="number"}d();c();p();f();m();function jr(e){return e===null?e:Array.isArray(e)?e.map(jr):typeof e=="object"?Oc(e)?Mc(e):ot(e,jr):e}function Oc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Mc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ye(t);case"Json":return JSON.parse(t);default:je(t,"Unknown tagged value")}}d();c();p();f();m();function Js(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Wn(e.query.arguments)),t.push(Wn(e.query.selection)),t.join("")}function Wn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Wn(n)})`:r}).join(" ")})`}d();c();p();f();m();var Nc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Kn(e){return Nc[e]}d();c();p();f();m();var Jr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),u=this.client._tracingHelper.getTraceParent(s),l=n.some(h=>Kn(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:u,transaction:Fc(o),containsWrite:l,customDataProxyFetch:i})).map((h,x)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[x],h)}catch(S){return S}})}),singleLoader:async n=>{var s;let i=((s=n.transaction)==null?void 0:s.kind)==="itx"?Gs(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Kn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>{var i;return(i=n.transaction)!=null&&i.id?`transaction-${n.transaction.id}`:Js(n.protocolQuery)},batchOrder(n,i){var o,s;return((o=n.transaction)==null?void 0:o.kind)==="batch"&&((s=i.transaction)==null?void 0:s.kind)==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n==null?void 0:n.data,o=n==null?void 0:n.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(_c(t),Lc(t,i)||t instanceof Pe)throw t;if(t instanceof K&&Bc(t)){let u=Hs(t.meta);qr({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=yt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new K(a,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ve(a,this.client._clientVersion);if(t instanceof oe)throw new oe(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof G)throw new G(a,this.client._clientVersion);if(t instanceof ve)throw new ve(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Qs.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=jr(Rn(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function Fc(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Gs(e)};je(e,"Unknown transaction kind")}}function Gs(e){return{id:e.id,payload:e.payload}}function Lc(e,t){return Vr(e)&&(t==null?void 0:t.kind)==="batch"&&e.batchRequestIdx!==t.index}function Bc(e){return e.code==="P2009"||e.code==="P2012"}function Hs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Hs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}d();c();p();f();m();var Ws="5.14.0";var Ks=Ws;d();c();p();f();m();function zs(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=Ys(t[n]);return r})}function Ys({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return w.Buffer.from(t,"base64");case"decimal":return new ye(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(Ys);default:return t}}d();c();p();f();m();var ta=Ue(Un());d();c();p();f();m();var J=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};_(J,"PrismaClientConstructorValidationError");var Zs=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Xs=["pretty","colorless","minimal"],ea=["info","query","warn","error"],qc={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=Pt(r,t)||` Available datasources: ${t.join(", ")}`;throw new J(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new J(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new J('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!_r(t).includes("driverAdapters"))throw new J('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Rt()==="binary")throw new J('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e!="undefined"&&typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Xs.includes(e)){let t=Pt(e,Xs);throw new J(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!ea.includes(r)){let n=Pt(r,ea);throw new J(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Pt(i,o);throw new J(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new J(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new J(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new J(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new J(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Pt(r,t);throw new J(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ra(e,t){for(let[r,n]of Object.entries(e)){if(!Zs.includes(r)){let i=Pt(r,Zs);throw new J(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}qc[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new J('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Pt(e,t){if(t.length===0||typeof e!="string")return"";let r=Uc(e,t);return r?` Did you mean "${r}"?`:""}function Uc(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,ta.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},u=l=>{o||(o=!0,r(l))};for(let l=0;l{n[l]=g,a()},g=>{if(!Vr(g)){u(g);return}g.batchRequestIdx===l?u(g):(i||(i=g),a())})})}var Le=re("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Vc={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},jc=Symbol.for("prisma.client.transaction.id"),Jc={id:0,nextId(){return++this.id}};function sa(e){class t{constructor(n){this._originalClient=this;this._middlewares=new Ur;this._createPrismaPromise=Gn();this.$extends=Vo;var u,l,g,h,x,S,C,A,D,O,B,M,I,X;e=(g=(l=(u=n==null?void 0:n.__internal)==null?void 0:u.configOverride)==null?void 0:l.call(u,e))!=null?g:e,os(e),n&&ra(n,e);let i=n!=null&&n.adapter?hn(n.adapter):void 0,o=new lr().on("error",()=>{});this._extensions=Or.empty(),this._previewFeatures=_r(e),this._clientVersion=(h=e.clientVersion)!=null?h:Ks,this._activeProvider=e.activeProvider,this._tracingHelper=qs(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&At.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&At.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=(x=e.injectableEdgeEnv)==null?void 0:x.call(e);try{let L=n!=null?n:{},Ye=(S=L.__internal)!=null?S:{},Be=Ye.debug===!0;Be&&re.enable("prisma:client");let fe=At.resolve(e.dirname,e.relativePath);bi.existsSync(fe)||(fe=e.dirname),Le("dirname",e.dirname),Le("relativePath",e.relativePath),Le("cwd",fe);let $e=Ye.engine||{};if(L.errorFormat?this._errorFormat=L.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:fe,dirname:e.dirname,enableDebugLogs:Be,allowTriggerPanic:$e.allowTriggerPanic,datamodelPath:At.join(e.dirname,(C=e.filename)!=null?C:"schema.prisma"),prismaPath:(A=$e.binaryPath)!=null?A:void 0,engineEndpoint:$e.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:L.log&&js(L.log),logQueries:L.log&&!!(typeof L.log=="string"?L.log==="query":L.log.find(Q=>typeof Q=="string"?Q==="query":Q.level==="query")),env:(D=a==null?void 0:a.parsed)!=null?D:{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:ss(L,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:(B=(O=L.transactionOptions)==null?void 0:O.maxWait)!=null?B:2e3,timeout:(I=(M=L.transactionOptions)==null?void 0:M.timeout)!=null?I:5e3,isolationLevel:(X=L.transactionOptions)==null?void 0:X.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:wt,getBatchRequestPayload:dr,prismaGraphQLToJSError:$t,PrismaClientUnknownRequestError:oe,PrismaClientInitializationError:G,PrismaClientKnownRequestError:K,debug:re("prisma:client:accelerateEngine"),engineVersion:oa.version,clientVersion:e.clientVersion}},Le("clientVersion",e.clientVersion),this._engine=hs(e,this._engineConfig),this._requestHandler=new Qr(this,o),L.log)for(let Q of L.log){let Re=typeof Q=="string"?Q:Q.emit==="stdout"?Q.level:null;Re&&this.$on(Re,qe=>{var Ze;it.log(`${(Ze=it.tags[Re])!=null?Ze:""}`,qe.message||qe.query)})}this._metrics=new st(this._engine)}catch(L){throw L.clientVersion=this._clientVersion,L}return this._appliedParent=qt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{ji()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=ia(n,i);return Jn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Y("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Jn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Y(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:ks,callsite:Fe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(zs)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...ia(n,i));throw new Y("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Jc.nextId(),s=Us(n.length),a=n.map((u,l)=>{var x,S,C;if((u==null?void 0:u[Symbol.toStringTag])!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=(x=i==null?void 0:i.isolationLevel)!=null?x:this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:l,isolationLevel:g,lock:s};return(C=(S=u.requestTransaction)==null?void 0:S.call(u,h))!=null?C:u});return na(a)}async _transactionWithCallback({callback:n,options:i}){var l,g,h;let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:(l=i==null?void 0:i.maxWait)!=null?l:this._engineConfig.transactionOptions.maxWait,timeout:(g=i==null?void 0:i.timeout)!=null?g:this._engineConfig.transactionOptions.timeout,isolationLevel:(h=i==null?void 0:i.isolationLevel)!=null?h:this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),u;try{let x={kind:"itx",...a};u=await n(this._createItxClient(x)),await this._engine.transaction("commit",o,a)}catch(x){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),x}return u}_createItxClient(n){return qt(ge(Uo(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>Gn(n)),ne(jc,()=>n.id),at(Vs)]))}$transaction(n,i){var a;let o;typeof n=="function"?((a=this._engineConfig.adapter)==null?void 0:a.adapterName)==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){var l;n.otelParentCtx=this._tracingHelper.getActiveContext();let i=(l=n.middlewareArgsMapper)!=null?l:Vc,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,u=async g=>{let h=this._middlewares.get(++a);if(h)return this._tracingHelper.runInChildSpan(s.middleware,O=>h(g,B=>(O==null||O.end(),u(B))));let{runInTransaction:x,args:S,...C}=g,A={...n,...C};S&&(A.args=i.middlewareArgsToRequestArgs(S)),n.transaction!==void 0&&x===!1&&delete A.transaction;let D=await Ko(this,A);return A.model?Qo({result:D,modelName:A.model,args:A.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):D};return this._tracingHelper.runInChildSpan(s.operation,()=>u(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:u,argsMapper:l,transaction:g,unpacker:h,otelParentCtx:x,customDataProxyFetch:S}){try{n=l?l(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>Rs({modelName:u,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return re.enabled("prisma:client")&&(Le("Prisma Client call:"),Le(`prisma.${i}(${ko(n)})`),Le("Generated request:"),Le(JSON.stringify(A,null,2)+` -`)),(g==null?void 0:g.kind)==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:u,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:x,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:S})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new Y("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){var i;return!!((i=this._engineConfig.previewFeatures)!=null&&i.includes(n))}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function ia(e,t){return Qc(e)?[new se(e,t),Fs]:[e,Ls]}function Qc(e){return Array.isArray(e)&&Array.isArray(e.raw)}d();c();p();f();m();var Gc=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function aa(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Gc.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}d();c();p();f();m();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=edge.js.map diff --git a/integration-tests/tests/prisma/mysql/client/runtime/index-browser.d.ts b/integration-tests/tests/prisma/mysql/client/runtime/index-browser.d.ts deleted file mode 100644 index f033b86a5..000000000 --- a/integration-tests/tests/prisma/mysql/client/runtime/index-browser.d.ts +++ /dev/null @@ -1,365 +0,0 @@ -declare class AnyNull extends NullTypesEnumValue { -} - -declare type Args = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : any; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof A]: Exact; -} : W) : never) | (A extends Narrowable ? A : never); - -export declare function getRuntime(): GetRuntimeOutput; - -declare type GetRuntimeOutput = { - id: Runtime; - prettyName: string; - isEdge: boolean; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -declare type Narrowable = string | number | bigint | boolean | []; - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * Base class for unique values of object-valued enums. - */ -declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -declare namespace Public { - export { - validator - } -} -export { Public } - -declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown"; - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -export { } diff --git a/integration-tests/tests/prisma/mysql/client/runtime/index-browser.js b/integration-tests/tests/prisma/mysql/client/runtime/index-browser.js deleted file mode 100644 index 4f8241715..000000000 --- a/integration-tests/tests/prisma/mysql/client/runtime/index-browser.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict";var de=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var je=Object.prototype.hasOwnProperty;var Ce=(e,n)=>{for(var i in n)de(e,i,{get:n[i],enumerable:!0})},Xe=(e,n,i,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Je(n))!je.call(e,r)&&r!==i&&de(e,r,{get:()=>n[r],enumerable:!(t=Ge(n,r))||t.enumerable});return e};var Ke=e=>Xe(de({},"__esModule",{value:!0}),e);var Xn={};Ce(Xn,{Decimal:()=>We,Public:()=>he,getRuntime:()=>Ae,makeStrictEnum:()=>Pe,objectEnumValues:()=>Oe});module.exports=Ke(Xn);var he={};Ce(he,{validator:()=>Me});function Me(...e){return n=>n}var ne=Symbol(),pe=new WeakMap,ge=class{constructor(n){n===ne?pe.set(this,"Prisma.".concat(this._getName())):pe.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return pe.get(this)}},J=class extends ge{_getNamespace(){return"NullTypes"}},j=class extends J{};me(j,"DbNull");var X=class extends J{};me(X,"JsonNull");var K=class extends J{};me(K,"AnyNull");var Oe={classes:{DbNull:j,JsonNull:X,AnyNull:K},instances:{DbNull:new j(ne),JsonNull:new X(ne),AnyNull:new K(ne)}};function me(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0})}var Qe=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Pe(e){return new Proxy(e,{get(n,i){if(i in n)return n[i];if(!Qe.has(i))throw new TypeError("Invalid enum value: ".concat(String(i)))}})}var Ye="Cloudflare-Workers",xe="node";function be(){var e,n,i;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Ye?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((i=(n=globalThis.process)==null?void 0:n.release)==null?void 0:i.name)===xe?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var ze={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Ae(){let e=be();return{id:e,prettyName:ze[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var H=9e15,V=1e9,we="0123456789abcdef",te="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",re="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ne={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-H,maxE:H,crypto:!1},Te,Z,w=!0,oe="[DecimalError] ",$=oe+"Invalid argument: ",Le=oe+"Precision limit exceeded",De=oe+"crypto unavailable",Fe="[object Decimal]",A=Math.floor,M=Math.pow,ye=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,en=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,nn=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ie=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,D=1e7,m=7,tn=9007199254740991,rn=te.length-1,ve=re.length-1,h={toStringTag:Fe};h.absoluteValue=h.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),p(e)};h.ceil=function(){return p(new this.constructor(this),this.e+1,2)};h.clampedTo=h.clamp=function(e,n){var i,t=this,r=t.constructor;if(e=new r(e),n=new r(n),!e.s||!n.s)return new r(NaN);if(e.gt(n))throw Error($+n);return i=t.cmp(e),i<0?e:t.cmp(n)>0?n:new r(t)};h.comparedTo=h.cmp=function(e){var n,i,t,r,s=this,o=s.d,u=(e=new s.constructor(e)).d,l=s.s,f=e.s;if(!o||!u)return!l||!f?NaN:l!==f?l:o===u?0:!o^l<0?1:-1;if(!o[0]||!u[0])return o[0]?l:u[0]?-f:0;if(l!==f)return l;if(s.e!==e.e)return s.e>e.e^l<0?1:-1;for(t=o.length,r=u.length,n=0,i=tu[n]^l<0?1:-1;return t===r?0:t>r^l<0?1:-1};h.cosine=h.cos=function(){var e,n,i=this,t=i.constructor;return i.d?i.d[0]?(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=sn(t,Ve(t,i)),t.precision=e,t.rounding=n,p(Z==2||Z==3?i.neg():i,e,n,!0)):new t(1):new t(NaN)};h.cubeRoot=h.cbrt=function(){var e,n,i,t,r,s,o,u,l,f,c=this,a=c.constructor;if(!c.isFinite()||c.isZero())return new a(c);for(w=!1,s=c.s*M(c.s*c,1/3),!s||Math.abs(s)==1/0?(i=O(c.d),e=c.e,(s=(e-i.length+1)%3)&&(i+=s==1||s==-2?"0":"00"),s=M(i,1/3),e=A((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?i="5e"+e:(i=s.toExponential(),i=i.slice(0,i.indexOf("e")+1)+e),t=new a(i),t.s=c.s):t=new a(s.toString()),o=(e=a.precision)+3;;)if(u=t,l=u.times(u).times(u),f=l.plus(c),t=S(f.plus(c).times(u),f.plus(l),o+2,1),O(u.d).slice(0,o)===(i=O(t.d)).slice(0,o))if(i=i.slice(o-3,o+1),i=="9999"||!r&&i=="4999"){if(!r&&(p(u,e+1,0),u.times(u).times(u).eq(c))){t=u;break}o+=4,r=1}else{(!+i||!+i.slice(1)&&i.charAt(0)=="5")&&(p(t,e+1,1),n=!t.times(t).times(t).eq(c));break}return w=!0,p(t,e,a.rounding,n)};h.decimalPlaces=h.dp=function(){var e,n=this.d,i=NaN;if(n){if(e=n.length-1,i=(e-A(this.e/m))*m,e=n[e],e)for(;e%10==0;e/=10)i--;i<0&&(i=0)}return i};h.dividedBy=h.div=function(e){return S(this,new this.constructor(e))};h.dividedToIntegerBy=h.divToInt=function(e){var n=this,i=n.constructor;return p(S(n,new i(e),0,1,1),i.precision,i.rounding)};h.equals=h.eq=function(e){return this.cmp(e)===0};h.floor=function(){return p(new this.constructor(this),this.e+1,3)};h.greaterThan=h.gt=function(e){return this.cmp(e)>0};h.greaterThanOrEqualTo=h.gte=function(e){var n=this.cmp(e);return n==1||n===0};h.hyperbolicCosine=h.cosh=function(){var e,n,i,t,r,s=this,o=s.constructor,u=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return u;i=o.precision,t=o.rounding,o.precision=i+Math.max(s.e,s.sd())+4,o.rounding=1,r=s.d.length,r<32?(e=Math.ceil(r/3),n=(1/fe(4,e)).toString()):(e=16,n="2.3283064365386962890625e-10"),s=W(o,1,s.times(n),new o(1),!0);for(var l,f=e,c=new o(8);f--;)l=s.times(s),s=u.minus(l.times(c.minus(l.times(c))));return p(s,o.precision=i,o.rounding=t,!0)};h.hyperbolicSine=h.sinh=function(){var e,n,i,t,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(n=s.precision,i=s.rounding,s.precision=n+Math.max(r.e,r.sd())+4,s.rounding=1,t=r.d.length,t<3)r=W(s,2,r,r,!0);else{e=1.4*Math.sqrt(t),e=e>16?16:e|0,r=r.times(1/fe(5,e)),r=W(s,2,r,r,!0);for(var o,u=new s(5),l=new s(16),f=new s(20);e--;)o=r.times(r),r=r.times(u.plus(o.times(l.times(o).plus(f))))}return s.precision=n,s.rounding=i,p(r,n,i,!0)};h.hyperbolicTangent=h.tanh=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+7,t.rounding=1,S(i.sinh(),i.cosh(),t.precision=e,t.rounding=n)):new t(i.s)};h.inverseCosine=h.acos=function(){var e,n=this,i=n.constructor,t=n.abs().cmp(1),r=i.precision,s=i.rounding;return t!==-1?t===0?n.isNeg()?L(i,r,s):new i(0):new i(NaN):n.isZero()?L(i,r+4,s).times(.5):(i.precision=r+6,i.rounding=1,n=n.asin(),e=L(i,r+4,s).times(.5),i.precision=r,i.rounding=s,e.minus(n))};h.inverseHyperbolicCosine=h.acosh=function(){var e,n,i=this,t=i.constructor;return i.lte(1)?new t(i.eq(1)?0:NaN):i.isFinite()?(e=t.precision,n=t.rounding,t.precision=e+Math.max(Math.abs(i.e),i.sd())+4,t.rounding=1,w=!1,i=i.times(i).minus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln()):new t(i)};h.inverseHyperbolicSine=h.asinh=function(){var e,n,i=this,t=i.constructor;return!i.isFinite()||i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+2*Math.max(Math.abs(i.e),i.sd())+6,t.rounding=1,w=!1,i=i.times(i).plus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln())};h.inverseHyperbolicTangent=h.atanh=function(){var e,n,i,t,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=s.precision,n=s.rounding,t=r.sd(),Math.max(t,e)<2*-r.e-1?p(new s(r),e,n,!0):(s.precision=i=t-r.e,r=S(r.plus(1),new s(1).minus(r),i+e,1),s.precision=e+4,s.rounding=1,r=r.ln(),s.precision=e,s.rounding=n,r.times(.5))):new s(NaN)};h.inverseSine=h.asin=function(){var e,n,i,t,r=this,s=r.constructor;return r.isZero()?new s(r):(n=r.abs().cmp(1),i=s.precision,t=s.rounding,n!==-1?n===0?(e=L(s,i+4,t).times(.5),e.s=r.s,e):new s(NaN):(s.precision=i+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=i,s.rounding=t,r.times(2)))};h.inverseTangent=h.atan=function(){var e,n,i,t,r,s,o,u,l,f=this,c=f.constructor,a=c.precision,d=c.rounding;if(f.isFinite()){if(f.isZero())return new c(f);if(f.abs().eq(1)&&a+4<=ve)return o=L(c,a+4,d).times(.25),o.s=f.s,o}else{if(!f.s)return new c(NaN);if(a+4<=ve)return o=L(c,a+4,d).times(.5),o.s=f.s,o}for(c.precision=u=a+10,c.rounding=1,i=Math.min(28,u/m+2|0),e=i;e;--e)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(w=!1,n=Math.ceil(u/m),t=1,l=f.times(f),o=new c(f),r=f;e!==-1;)if(r=r.times(l),s=o.minus(r.div(t+=2)),r=r.times(l),o=s.plus(r.div(t+=2)),o.d[n]!==void 0)for(e=n;o.d[e]===s.d[e]&&e--;);return i&&(o=o.times(2<this.d.length-2};h.isNaN=function(){return!this.s};h.isNegative=h.isNeg=function(){return this.s<0};h.isPositive=h.isPos=function(){return this.s>0};h.isZero=function(){return!!this.d&&this.d[0]===0};h.lessThan=h.lt=function(e){return this.cmp(e)<0};h.lessThanOrEqualTo=h.lte=function(e){return this.cmp(e)<1};h.logarithm=h.log=function(e){var n,i,t,r,s,o,u,l,f=this,c=f.constructor,a=c.precision,d=c.rounding,g=5;if(e==null)e=new c(10),n=!0;else{if(e=new c(e),i=e.d,e.s<0||!i||!i[0]||e.eq(1))return new c(NaN);n=e.eq(10)}if(i=f.d,f.s<0||!i||!i[0]||f.eq(1))return new c(i&&!i[0]?-1/0:f.s!=1?NaN:i?0:1/0);if(n)if(i.length>1)s=!0;else{for(r=i[0];r%10===0;)r/=10;s=r!==1}if(w=!1,u=a+g,o=B(f,u),t=n?se(c,u+10):B(e,u),l=S(o,t,u,1),Q(l.d,r=a,d))do if(u+=10,o=B(f,u),t=n?se(c,u+10):B(e,u),l=S(o,t,u,1),!s){+O(l.d).slice(r+1,r+15)+1==1e14&&(l=p(l,a+1,0));break}while(Q(l.d,r+=10,d));return w=!0,p(l,a,d)};h.minus=h.sub=function(e){var n,i,t,r,s,o,u,l,f,c,a,d,g=this,v=g.constructor;if(e=new v(e),!g.d||!e.d)return!g.s||!e.s?e=new v(NaN):g.d?e.s=-e.s:e=new v(e.d||g.s!==e.s?g:NaN),e;if(g.s!=e.s)return e.s=-e.s,g.plus(e);if(f=g.d,d=e.d,u=v.precision,l=v.rounding,!f[0]||!d[0]){if(d[0])e.s=-e.s;else if(f[0])e=new v(g);else return new v(l===3?-0:0);return w?p(e,u,l):e}if(i=A(e.e/m),c=A(g.e/m),f=f.slice(),s=c-i,s){for(a=s<0,a?(n=f,s=-s,o=d.length):(n=d,i=c,o=f.length),t=Math.max(Math.ceil(u/m),o)+2,s>t&&(s=t,n.length=1),n.reverse(),t=s;t--;)n.push(0);n.reverse()}else{for(t=f.length,o=d.length,a=t0;--t)f[o++]=0;for(t=d.length;t>s;){if(f[--t]o?s+1:o+1,r>o&&(r=o,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for(o=f.length,r=c.length,o-r<0&&(r=o,i=c,c=f,f=i),n=0;r;)n=(f[--r]=f[r]+c[r]+n)/D|0,f[r]%=D;for(n&&(f.unshift(n),++t),o=f.length;f[--o]==0;)f.pop();return e.d=f,e.e=ue(f,t),w?p(e,u,l):e};h.precision=h.sd=function(e){var n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error($+e);return i.d?(n=Ze(i.d),e&&i.e+1>n&&(n=i.e+1)):n=NaN,n};h.round=function(){var e=this,n=e.constructor;return p(new n(e),e.e+1,n.rounding)};h.sine=h.sin=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=un(t,Ve(t,i)),t.precision=e,t.rounding=n,p(Z>2?i.neg():i,e,n,!0)):new t(NaN)};h.squareRoot=h.sqrt=function(){var e,n,i,t,r,s,o=this,u=o.d,l=o.e,f=o.s,c=o.constructor;if(f!==1||!u||!u[0])return new c(!f||f<0&&(!u||u[0])?NaN:u?o:1/0);for(w=!1,f=Math.sqrt(+o),f==0||f==1/0?(n=O(u),(n.length+l)%2==0&&(n+="0"),f=Math.sqrt(n),l=A((l+1)/2)-(l<0||l%2),f==1/0?n="5e"+l:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+l),t=new c(n)):t=new c(f.toString()),i=(l=c.precision)+3;;)if(s=t,t=s.plus(S(o,s,i+2,1)).times(.5),O(s.d).slice(0,i)===(n=O(t.d)).slice(0,i))if(n=n.slice(i-3,i+1),n=="9999"||!r&&n=="4999"){if(!r&&(p(s,l+1,0),s.times(s).eq(o))){t=s;break}i+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(p(t,l+1,1),e=!t.times(t).eq(o));break}return w=!0,p(t,l,c.rounding,e)};h.tangent=h.tan=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+10,t.rounding=1,i=i.sin(),i.s=1,i=S(i,new t(1).minus(i.times(i)).sqrt(),e+10,0),t.precision=e,t.rounding=n,p(Z==2||Z==4?i.neg():i,e,n,!0)):new t(NaN)};h.times=h.mul=function(e){var n,i,t,r,s,o,u,l,f,c=this,a=c.constructor,d=c.d,g=(e=new a(e)).d;if(e.s*=c.s,!d||!d[0]||!g||!g[0])return new a(!e.s||d&&!d[0]&&!g||g&&!g[0]&&!d?NaN:!d||!g?e.s/0:e.s*0);for(i=A(c.e/m)+A(e.e/m),l=d.length,f=g.length,l=0;){for(n=0,r=l+t;r>t;)u=s[r]+g[t]*d[r-t-1]+n,s[r--]=u%D|0,n=u/D|0;s[r]=(s[r]+n)%D|0}for(;!s[--o];)s.pop();return n?++i:s.shift(),e.d=s,e.e=ue(s,i),w?p(e,a.precision,a.rounding):e};h.toBinary=function(e,n){return ke(this,2,e,n)};h.toDecimalPlaces=h.toDP=function(e,n){var i=this,t=i.constructor;return i=new t(i),e===void 0?i:(R(e,0,V),n===void 0?n=t.rounding:R(n,0,8),p(i,e+i.e+1,n))};h.toExponential=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=F(t,!0):(R(e,0,V),n===void 0?n=r.rounding:R(n,0,8),t=p(new r(t),e+1,n),i=F(t,!0,e+1)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toFixed=function(e,n){var i,t,r=this,s=r.constructor;return e===void 0?i=F(r):(R(e,0,V),n===void 0?n=s.rounding:R(n,0,8),t=p(new s(r),e+r.e+1,n),i=F(t,!1,e+t.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i};h.toFraction=function(e){var n,i,t,r,s,o,u,l,f,c,a,d,g=this,v=g.d,N=g.constructor;if(!v)return new N(g);if(f=i=new N(1),t=l=new N(0),n=new N(t),s=n.e=Ze(v)-g.e-1,o=s%m,n.d[0]=M(10,o<0?m+o:o),e==null)e=s>0?n:f;else{if(u=new N(e),!u.isInt()||u.lt(f))throw Error($+u);e=u.gt(n)?s>0?n:f:u}for(w=!1,u=new N(O(v)),c=N.precision,N.precision=s=v.length*m*2;a=S(u,n,0,1,1),r=i.plus(a.times(t)),r.cmp(e)!=1;)i=t,t=r,r=f,f=l.plus(a.times(r)),l=r,r=n,n=u.minus(a.times(r)),u=r;return r=S(e.minus(i),t,0,1,1),l=l.plus(r.times(f)),i=i.plus(r.times(t)),l.s=f.s=g.s,d=S(f,t,s,1).minus(g).abs().cmp(S(l,i,s,1).minus(g).abs())<1?[f,t]:[l,i],N.precision=c,w=!0,d};h.toHexadecimal=h.toHex=function(e,n){return ke(this,16,e,n)};h.toNearest=function(e,n){var i=this,t=i.constructor;if(i=new t(i),e==null){if(!i.d)return i;e=new t(1),n=t.rounding}else{if(e=new t(e),n===void 0?n=t.rounding:R(n,0,8),!i.d)return e.s?i:e;if(!e.d)return e.s&&(e.s=i.s),e}return e.d[0]?(w=!1,i=S(i,e,0,n,1).times(e),w=!0,p(i)):(e.s=i.s,i=e),i};h.toNumber=function(){return+this};h.toOctal=function(e,n){return ke(this,8,e,n)};h.toPower=h.pow=function(e){var n,i,t,r,s,o,u=this,l=u.constructor,f=+(e=new l(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new l(M(+u,f));if(u=new l(u),u.eq(1))return u;if(t=l.precision,s=l.rounding,e.eq(1))return p(u,t,s);if(n=A(e.e/m),n>=e.d.length-1&&(i=f<0?-f:f)<=tn)return r=Ue(l,u,i,t),e.s<0?new l(1).div(r):p(r,t,s);if(o=u.s,o<0){if(nl.maxE+1||n0?o/0:0):(w=!1,l.rounding=u.s=1,i=Math.min(12,(n+"").length),r=Ee(e.times(B(u,t+i)),t),r.d&&(r=p(r,t+5,1),Q(r.d,t,s)&&(n=t+10,r=p(Ee(e.times(B(u,n+i)),n),n+5,1),+O(r.d).slice(t+1,t+15)+1==1e14&&(r=p(r,t+1,0)))),r.s=o,w=!0,l.rounding=s,p(r,t,s))};h.toPrecision=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=F(t,t.e<=r.toExpNeg||t.e>=r.toExpPos):(R(e,1,V),n===void 0?n=r.rounding:R(n,0,8),t=p(new r(t),e,n),i=F(t,e<=t.e||t.e<=r.toExpNeg,e)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toSignificantDigits=h.toSD=function(e,n){var i=this,t=i.constructor;return e===void 0?(e=t.precision,n=t.rounding):(R(e,1,V),n===void 0?n=t.rounding:R(n,0,8)),p(new t(i),e,n)};h.toString=function(){var e=this,n=e.constructor,i=F(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()&&!e.isZero()?"-"+i:i};h.truncated=h.trunc=function(){return p(new this.constructor(this),this.e+1,1)};h.valueOf=h.toJSON=function(){var e=this,n=e.constructor,i=F(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()?"-"+i:i};function O(e){var n,i,t,r=e.length-1,s="",o=e[0];if(r>0){for(s+=o,n=1;ni)throw Error($+e)}function Q(e,n,i,t){var r,s,o,u;for(s=e[0];s>=10;s/=10)--n;return--n<0?(n+=m,r=0):(r=Math.ceil((n+1)/m),n%=m),s=M(10,m-n),u=e[r]%s|0,t==null?n<3?(n==0?u=u/100|0:n==1&&(u=u/10|0),o=i<4&&u==99999||i>3&&u==49999||u==5e4||u==0):o=(i<4&&u+1==s||i>3&&u+1==s/2)&&(e[r+1]/s/100|0)==M(10,n-2)-1||(u==s/2||u==0)&&(e[r+1]/s/100|0)==0:n<4?(n==0?u=u/1e3|0:n==1?u=u/100|0:n==2&&(u=u/10|0),o=(t||i<4)&&u==9999||!t&&i>3&&u==4999):o=((t||i<4)&&u+1==s||!t&&i>3&&u+1==s/2)&&(e[r+1]/s/1e3|0)==M(10,n-3)-1,o}function ie(e,n,i){for(var t,r=[0],s,o=0,u=e.length;oi-1&&(r[t+1]===void 0&&(r[t+1]=0),r[t+1]+=r[t]/i|0,r[t]%=i)}return r.reverse()}function sn(e,n){var i,t,r;if(n.isZero())return n;t=n.d.length,t<32?(i=Math.ceil(t/3),r=(1/fe(4,i)).toString()):(i=16,r="2.3283064365386962890625e-10"),e.precision+=i,n=W(e,1,n.times(r),new e(1));for(var s=i;s--;){var o=n.times(n);n=o.times(o).minus(o).times(8).plus(1)}return e.precision-=i,n}var S=function(){function e(t,r,s){var o,u=0,l=t.length;for(t=t.slice();l--;)o=t[l]*r+u,t[l]=o%s|0,u=o/s|0;return u&&t.unshift(u),t}function n(t,r,s,o){var u,l;if(s!=o)l=s>o?1:-1;else for(u=l=0;ur[u]?1:-1;break}return l}function i(t,r,s,o){for(var u=0;s--;)t[s]-=u,u=t[s]1;)t.shift()}return function(t,r,s,o,u,l){var f,c,a,d,g,v,N,_,C,q,E,P,x,I,le,z,G,ce,T,y,ee=t.constructor,ae=t.s==r.s?1:-1,b=t.d,k=r.d;if(!b||!b[0]||!k||!k[0])return new ee(!t.s||!r.s||(b?k&&b[0]==k[0]:!k)?NaN:b&&b[0]==0||!k?ae*0:ae/0);for(l?(g=1,c=t.e-r.e):(l=D,g=m,c=A(t.e/g)-A(r.e/g)),T=k.length,G=b.length,C=new ee(ae),q=C.d=[],a=0;k[a]==(b[a]||0);a++);if(k[a]>(b[a]||0)&&c--,s==null?(I=s=ee.precision,o=ee.rounding):u?I=s+(t.e-r.e)+1:I=s,I<0)q.push(1),v=!0;else{if(I=I/g+2|0,a=0,T==1){for(d=0,k=k[0],I++;(a1&&(k=e(k,d,l),b=e(b,d,l),T=k.length,G=b.length),z=T,E=b.slice(0,T),P=E.length;P=l/2&&++ce;do d=0,f=n(k,E,T,P),f<0?(x=E[0],T!=P&&(x=x*l+(E[1]||0)),d=x/ce|0,d>1?(d>=l&&(d=l-1),N=e(k,d,l),_=N.length,P=E.length,f=n(N,E,_,P),f==1&&(d--,i(N,T<_?y:k,_,l))):(d==0&&(f=d=1),N=k.slice()),_=N.length,_=10;d/=10)a++;C.e=a+c*g-1,p(C,u?s+C.e+1:s,o,v)}return C}}();function p(e,n,i,t){var r,s,o,u,l,f,c,a,d,g=e.constructor;e:if(n!=null){if(a=e.d,!a)return e;for(r=1,u=a[0];u>=10;u/=10)r++;if(s=n-r,s<0)s+=m,o=n,c=a[d=0],l=c/M(10,r-o-1)%10|0;else if(d=Math.ceil((s+1)/m),u=a.length,d>=u)if(t){for(;u++<=d;)a.push(0);c=l=0,r=1,s%=m,o=s-m+1}else break e;else{for(c=u=a[d],r=1;u>=10;u/=10)r++;s%=m,o=s-m+r,l=o<0?0:c/M(10,r-o-1)%10|0}if(t=t||n<0||a[d+1]!==void 0||(o<0?c:c%M(10,r-o-1)),f=i<4?(l||t)&&(i==0||i==(e.s<0?3:2)):l>5||l==5&&(i==4||t||i==6&&(s>0?o>0?c/M(10,r-o):0:a[d-1])%10&1||i==(e.s<0?8:7)),n<1||!a[0])return a.length=0,f?(n-=e.e+1,a[0]=M(10,(m-n%m)%m),e.e=-n||0):a[0]=e.e=0,e;if(s==0?(a.length=d,u=1,d--):(a.length=d+1,u=M(10,m-s),a[d]=o>0?(c/M(10,r-o)%M(10,o)|0)*u:0),f)for(;;)if(d==0){for(s=1,o=a[0];o>=10;o/=10)s++;for(o=a[0]+=u,u=1;o>=10;o/=10)u++;s!=u&&(e.e++,a[0]==D&&(a[0]=1));break}else{if(a[d]+=u,a[d]!=D)break;a[d--]=0,u=1}for(s=a.length;a[--s]===0;)a.pop()}return w&&(e.e>g.maxE?(e.d=null,e.e=NaN):e.e0?s=s.charAt(0)+"."+s.slice(1)+U(t):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+U(-r-1)+s,i&&(t=i-o)>0&&(s+=U(t))):r>=o?(s+=U(r+1-o),i&&(t=i-r-1)>0&&(s=s+"."+U(t))):((t=r+1)0&&(r+1===o&&(s+="."),s+=U(t))),s}function ue(e,n){var i=e[0];for(n*=m;i>=10;i/=10)n++;return n}function se(e,n,i){if(n>rn)throw w=!0,i&&(e.precision=i),Error(Le);return p(new e(te),n,1,!0)}function L(e,n,i){if(n>ve)throw Error(Le);return p(new e(re),n,i,!0)}function Ze(e){var n=e.length-1,i=n*m+1;if(n=e[n],n){for(;n%10==0;n/=10)i--;for(n=e[0];n>=10;n/=10)i++}return i}function U(e){for(var n="";e--;)n+="0";return n}function Ue(e,n,i,t){var r,s=new e(1),o=Math.ceil(t/m+4);for(w=!1;;){if(i%2&&(s=s.times(n),Re(s.d,o)&&(r=!0)),i=A(i/2),i===0){i=s.d.length-1,r&&s.d[i]===0&&++s.d[i];break}n=n.times(n),Re(n.d,o)}return w=!0,s}function _e(e){return e.d[e.d.length-1]&1}function Be(e,n,i){for(var t,r=new e(n[0]),s=0;++s17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(n==null?(w=!1,l=v):l=n,u=new d(.03125);e.e>-2;)e=e.times(u),a+=5;for(t=Math.log(M(2,a))/Math.LN10*2+5|0,l+=t,i=s=o=new d(1),d.precision=l;;){if(s=p(s.times(e),l,1),i=i.times(++c),u=o.plus(S(s,i,l,1)),O(u.d).slice(0,l)===O(o.d).slice(0,l)){for(r=a;r--;)o=p(o.times(o),l,1);if(n==null)if(f<3&&Q(o.d,l-t,g,f))d.precision=l+=10,i=s=u=new d(1),c=0,f++;else return p(o,d.precision=v,g,w=!0);else return d.precision=v,o}o=u}}function B(e,n){var i,t,r,s,o,u,l,f,c,a,d,g=1,v=10,N=e,_=N.d,C=N.constructor,q=C.rounding,E=C.precision;if(N.s<0||!_||!_[0]||!N.e&&_[0]==1&&_.length==1)return new C(_&&!_[0]?-1/0:N.s!=1?NaN:_?0:N);if(n==null?(w=!1,c=E):c=n,C.precision=c+=v,i=O(_),t=i.charAt(0),Math.abs(s=N.e)<15e14){for(;t<7&&t!=1||t==1&&i.charAt(1)>3;)N=N.times(e),i=O(N.d),t=i.charAt(0),g++;s=N.e,t>1?(N=new C("0."+i),s++):N=new C(t+"."+i.slice(1))}else return f=se(C,c+2,E).times(s+""),N=B(new C(t+"."+i.slice(1)),c-v).plus(f),C.precision=E,n==null?p(N,E,q,w=!0):N;for(a=N,l=o=N=S(N.minus(1),N.plus(1),c,1),d=p(N.times(N),c,1),r=3;;){if(o=p(o.times(d),c,1),f=l.plus(S(o,new C(r),c,1)),O(f.d).slice(0,c)===O(l.d).slice(0,c))if(l=l.times(2),s!==0&&(l=l.plus(se(C,c+2,E).times(s+""))),l=S(l,new C(g),c,1),n==null)if(Q(l.d,c-v,q,u))C.precision=c+=v,f=o=N=S(a.minus(1),a.plus(1),c,1),d=p(N.times(N),c,1),r=u=1;else return p(l,C.precision=E,q,w=!0);else return C.precision=E,l;l=f,r+=2}}function $e(e){return String(e.s*e.s/0)}function Se(e,n){var i,t,r;for((i=n.indexOf("."))>-1&&(n=n.replace(".","")),(t=n.search(/e/i))>0?(i<0&&(i=t),i+=+n.slice(t+1),n=n.substring(0,t)):i<0&&(i=n.length),t=0;n.charCodeAt(t)===48;t++);for(r=n.length;n.charCodeAt(r-1)===48;--r);if(n=n.slice(t,r),n){if(r-=t,e.e=i=i-t-1,e.d=[],t=(i+1)%m,i<0&&(t+=m),te.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Ie.test(n))return Se(e,n)}else if(n==="Infinity"||n==="NaN")return+n||(e.s=NaN),e.e=NaN,e.d=null,e;if(en.test(n))i=16,n=n.toLowerCase();else if(ye.test(n))i=2;else if(nn.test(n))i=8;else throw Error($+n);for(s=n.search(/p/i),s>0?(l=+n.slice(s+1),n=n.substring(2,s)):n=n.slice(2),s=n.indexOf("."),o=s>=0,t=e.constructor,o&&(n=n.replace(".",""),u=n.length,s=u-s,r=Ue(t,new t(i),s,s*2)),f=ie(n,i,D),c=f.length-1,s=c;f[s]===0;--s)f.pop();return s<0?new t(e.s*0):(e.e=ue(f,c),e.d=f,w=!1,o&&(e=S(e,r,u*4)),l&&(e=e.times(Math.abs(l)<54?M(2,l):Y.pow(2,l))),w=!0,e)}function un(e,n){var i,t=n.d.length;if(t<3)return n.isZero()?n:W(e,2,n,n);i=1.4*Math.sqrt(t),i=i>16?16:i|0,n=n.times(1/fe(5,i)),n=W(e,2,n,n);for(var r,s=new e(5),o=new e(16),u=new e(20);i--;)r=n.times(n),n=n.times(s.plus(r.times(o.times(r).minus(u))));return n}function W(e,n,i,t,r){var s,o,u,l,f=1,c=e.precision,a=Math.ceil(c/m);for(w=!1,l=i.times(i),u=new e(t);;){if(o=S(u.times(l),new e(n++*n++),c,1),u=r?t.plus(o):t.minus(o),t=S(o.times(l),new e(n++*n++),c,1),o=u.plus(t),o.d[a]!==void 0){for(s=a;o.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=t,t=o,o=s,f++}return w=!0,o.d.length=a+1,o}function fe(e,n){for(var i=e;--n;)i*=e;return i}function Ve(e,n){var i,t=n.s<0,r=L(e,e.precision,1),s=r.times(.5);if(n=n.abs(),n.lte(s))return Z=t?4:1,n;if(i=n.divToInt(r),i.isZero())Z=t?3:2;else{if(n=n.minus(i.times(r)),n.lte(s))return Z=_e(i)?t?2:3:t?4:1,n;Z=_e(i)?t?1:4:t?3:2}return n.minus(r).abs()}function ke(e,n,i,t){var r,s,o,u,l,f,c,a,d,g=e.constructor,v=i!==void 0;if(v?(R(i,1,V),t===void 0?t=g.rounding:R(t,0,8)):(i=g.precision,t=g.rounding),!e.isFinite())c=$e(e);else{for(c=F(e),o=c.indexOf("."),v?(r=2,n==16?i=i*4-3:n==8&&(i=i*3-2)):r=n,o>=0&&(c=c.replace(".",""),d=new g(1),d.e=c.length-o,d.d=ie(F(d),10,r),d.e=d.d.length),a=ie(c,10,r),s=l=a.length;a[--l]==0;)a.pop();if(!a[0])c=v?"0p+0":"0";else{if(o<0?s--:(e=new g(e),e.d=a,e.e=s,e=S(e,d,i,t,0,r),a=e.d,s=e.e,f=Te),o=a[i],u=r/2,f=f||a[i+1]!==void 0,f=t<4?(o!==void 0||f)&&(t===0||t===(e.s<0?3:2)):o>u||o===u&&(t===4||f||t===6&&a[i-1]&1||t===(e.s<0?8:7)),a.length=i,f)for(;++a[--i]>r-1;)a[i]=0,i||(++s,a.unshift(1));for(l=a.length;!a[l-1];--l);for(o=0,c="";o1)if(n==16||n==8){for(o=n==16?4:3,--l;l%o;l++)c+="0";for(a=ie(c,r,n),l=a.length;!a[l-1];--l);for(o=1,c="1.";ol)for(s-=l;s--;)c+="0";else sn)return e.length=n,!0}function fn(e){return new this(e).abs()}function ln(e){return new this(e).acos()}function cn(e){return new this(e).acosh()}function an(e,n){return new this(e).plus(n)}function dn(e){return new this(e).asin()}function hn(e){return new this(e).asinh()}function pn(e){return new this(e).atan()}function gn(e){return new this(e).atanh()}function mn(e,n){e=new this(e),n=new this(n);var i,t=this.precision,r=this.rounding,s=t+4;return!e.s||!n.s?i=new this(NaN):!e.d&&!n.d?(i=L(this,s,1).times(n.s>0?.25:.75),i.s=e.s):!n.d||e.isZero()?(i=n.s<0?L(this,t,r):new this(0),i.s=e.s):!e.d||n.isZero()?(i=L(this,s,1).times(.5),i.s=e.s):n.s<0?(this.precision=s,this.rounding=1,i=this.atan(S(e,n,s,1)),n=L(this,s,1),this.precision=t,this.rounding=r,i=e.s<0?i.minus(n):i.plus(n)):i=this.atan(S(e,n,s,1)),i}function wn(e){return new this(e).cbrt()}function Nn(e){return p(e=new this(e),e.e+1,2)}function vn(e,n,i){return new this(e).clamp(n,i)}function En(e){if(!e||typeof e!="object")throw Error(oe+"Object expected");var n,i,t,r=e.defaults===!0,s=["precision",1,V,"rounding",0,8,"toExpNeg",-H,0,"toExpPos",0,H,"maxE",0,H,"minE",-H,0,"modulo",0,9];for(n=0;n=s[n+1]&&t<=s[n+2])this[i]=t;else throw Error($+i+": "+t);if(i="crypto",r&&(this[i]=Ne[i]),(t=e[i])!==void 0)if(t===!0||t===!1||t===0||t===1)if(t)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[i]=!0;else throw Error(De);else this[i]=!1;else throw Error($+i+": "+t);return this}function Sn(e){return new this(e).cos()}function kn(e){return new this(e).cosh()}function He(e){var n,i,t;function r(s){var o,u,l,f=this;if(!(f instanceof r))return new r(s);if(f.constructor=r,qe(s)){f.s=s.s,w?!s.d||s.e>r.maxE?(f.e=NaN,f.d=null):s.e=10;u/=10)o++;w?o>r.maxE?(f.e=NaN,f.d=null):o=429e7?n[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=r%1e7;else if(crypto.randomBytes){for(n=crypto.randomBytes(t*=4);s=214e7?crypto.randomBytes(4).copy(n,s):(u.push(r%1e7),s+=4);s=t/4}else throw Error(De);else for(;s=10;r/=10)t++;t - * MIT Licence - *) -*/ -//# sourceMappingURL=index-browser.js.map diff --git a/integration-tests/tests/prisma/mysql/client/runtime/library.d.ts b/integration-tests/tests/prisma/mysql/client/runtime/library.d.ts deleted file mode 100644 index 5e02beada..000000000 --- a/integration-tests/tests/prisma/mysql/client/runtime/library.d.ts +++ /dev/null @@ -1,3193 +0,0 @@ -/** - * @param this - */ -declare function $extends(this: Client, extension: ExtensionArgs | ((client: Client) => Client)): Client; - -declare type AccelerateEngineConfig = { - inlineSchema: EngineConfig['inlineSchema']; - inlineSchemaHash: EngineConfig['inlineSchemaHash']; - env: EngineConfig['env']; - generator?: { - previewFeatures: string[]; - }; - inlineDatasources: EngineConfig['inlineDatasources']; - overrideDatasources: EngineConfig['overrideDatasources']; - clientVersion: EngineConfig['clientVersion']; - engineVersion: EngineConfig['engineVersion']; - logEmitter: EngineConfig['logEmitter']; - logQueries?: EngineConfig['logQueries']; - logLevel?: EngineConfig['logLevel']; - tracingHelper: EngineConfig['tracingHelper']; - accelerateUtils?: EngineConfig['accelerateUtils']; -}; - -export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'; - -export declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum'; - -export declare type AllModelsToStringIndex, K extends PropertyKey> = Args extends { - [P in K]: { - $allModels: infer AllModels; - }; -} ? { - [P in K]: Record; -} : {}; - -declare class AnyNull extends NullTypesEnumValue { -} - -export declare type Args = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : any; - -export declare type Args_3 = Args; - -/** - * Attributes is a map from string to attribute values. - * - * Note: only the own enumerable keys are counted as valid attribute keys. - */ -declare interface Attributes { - [attributeKey: string]: AttributeValue | undefined; -} - -/** - * Attribute values may be any non-nullish primitive value except an object. - * - * null or undefined attribute values are invalid and will result in undefined behavior. - */ -declare type AttributeValue = string | number | boolean | Array | Array | Array; - -export declare type BaseDMMF = Pick; - -declare type BatchArgs = { - queries: BatchQuery[]; - transaction?: { - isolationLevel?: IsolationLevel; - }; -}; - -declare type BatchInternalParams = { - requests: RequestParams[]; - customDataProxyFetch?: CustomDataProxyFetch; -}; - -declare type BatchQuery = { - model: string | undefined; - operation: string; - args: JsArgs | RawQueryArgs; -}; - -declare type BatchQueryEngineResult = QueryEngineResult | Error; - -declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise; - -declare type BatchQueryOptionsCbArgs = { - args: BatchArgs; - query: (args: BatchArgs, __internalParams?: BatchInternalParams) => Promise; - __internalParams: BatchInternalParams; -}; - -declare type BatchTransactionOptions = { - isolationLevel?: Transaction_2.IsolationLevel; -}; - -declare interface BinaryTargetsEnvValue { - fromEnvVar: string | null; - value: string; - native?: boolean; -} - -export declare type Call = (F & { - params: P; -})['returns']; - -declare interface CallSite { - getLocation(): LocationInFile | null; -} - -export declare type Cast = A extends W ? A : W; - -declare type Client = ReturnType extends new () => infer T ? T : never; - -export declare type ClientArg = { - [MethodName in string]: unknown; -}; - -export declare type ClientArgs = { - client: ClientArg; -}; - -export declare type ClientBuiltInProp = keyof DynamicClientExtensionThisBuiltin; - -declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum]; - -declare const ColumnTypeEnum: { - readonly Int32: 0; - readonly Int64: 1; - readonly Float: 2; - readonly Double: 3; - readonly Numeric: 4; - readonly Boolean: 5; - readonly Character: 6; - readonly Text: 7; - readonly Date: 8; - readonly Time: 9; - readonly DateTime: 10; - readonly Json: 11; - readonly Enum: 12; - readonly Bytes: 13; - readonly Set: 14; - readonly Uuid: 15; - readonly Int32Array: 64; - readonly Int64Array: 65; - readonly FloatArray: 66; - readonly DoubleArray: 67; - readonly NumericArray: 68; - readonly BooleanArray: 69; - readonly CharacterArray: 70; - readonly TextArray: 71; - readonly DateArray: 72; - readonly TimeArray: 73; - readonly DateTimeArray: 74; - readonly JsonArray: 75; - readonly EnumArray: 76; - readonly BytesArray: 77; - readonly UuidArray: 78; - readonly UnknownNumber: 128; -}; - -export declare type Compute = T extends Function ? T : { - [K in keyof T]: T[K]; -} & unknown; - -export declare type ComputeDeep = T extends Function ? T : { - [K in keyof T]: ComputeDeep; -} & unknown; - -declare type ComputedField = { - name: string; - needs: string[]; - compute: ResultArgsFieldCompute; -}; - -declare type ComputedFieldsMap = { - [fieldName: string]: ComputedField; -}; - -declare type ConnectionInfo = { - schemaName?: string; -}; - -declare interface Context { - /** - * Get a value from the context. - * - * @param key key which identifies a context value - */ - getValue(key: symbol): unknown; - /** - * Create a new context which inherits from this context and has - * the given key set to the given value. - * - * @param key context key for which to set the value - * @param value value to set for the given key - */ - setValue(key: symbol, value: unknown): Context; - /** - * Return a new context which inherits from this context but does - * not contain a value for the given key. - * - * @param key context key for which to clear a value - */ - deleteValue(key: symbol): Context; -} - -declare type Context_2 = T extends { - [K: symbol]: { - ctx: infer C; - }; -} ? C & T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -} : T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -}; - -export declare type Count = { - [K in keyof O]: Count; -} & {}; - -declare type CustomDataProxyFetch = (fetch: Fetch) => Fetch; - -declare class DataLoader { - private options; - batches: { - [key: string]: Job[]; - }; - private tickActive; - constructor(options: DataLoaderOptions); - request(request: T): Promise; - private dispatchBatches; - get [Symbol.toStringTag](): string; -} - -declare type DataLoaderOptions = { - singleLoader: (request: T) => Promise; - batchLoader: (request: T[]) => Promise; - batchBy: (request: T) => string | undefined; - batchOrder: (requestA: T, requestB: T) => number; -}; - -declare type Datasource = { - url?: string; -}; - -declare type Datasources = { - [name in string]: Datasource; -}; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare const Debug: typeof debugCreate & { - enable(namespace: any): void; - disable(): any; - enabled(namespace: string): boolean; - log: (...args: string[]) => void; - formatters: {}; -}; - -/** - * Create a new debug instance with the given namespace. - * - * @example - * ```ts - * import Debug from '@prisma/debug' - * const debug = Debug('prisma:client') - * debug('Hello World') - * ``` - */ -declare function debugCreate(namespace: string): ((...args: any[]) => void) & { - color: string; - enabled: boolean; - namespace: string; - log: (...args: string[]) => void; - extend: () => void; -}; - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -/** - * Interface for any Decimal.js-like library - * Allows us to accept Decimal.js from different - * versions and some compatible alternatives - */ -export declare interface DecimalJsLike { - d: number[]; - e: number; - s: number; - toFixed(): string; -} - -export declare type DefaultArgs = InternalArgs<{}, {}, {}, {}>; - -export declare type DefaultSelection

= UnwrapPayload<{ - default: P; -}>['default']; - -export declare function defineDmmfProperty(target: object, runtimeDataModel: RuntimeDataModel): void; - -declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Client)): (client: Client) => Client; - -declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"]; - -export declare type DevTypeMapDef = { - meta: { - modelProps: string; - }; - model: { - [Model in PropertyKey]: { - [Operation in PropertyKey]: DevTypeMapFnDef; - }; - }; - other: { - [Operation in PropertyKey]: DevTypeMapFnDef; - }; -}; - -export declare type DevTypeMapFnDef = { - args: any; - result: any; - payload: OperationPayload; -}; - -export declare namespace DMMF { - export type Document = ReadonlyDeep_2<{ - datamodel: Datamodel; - schema: Schema; - mappings: Mappings; - }>; - export type Mappings = ReadonlyDeep_2<{ - modelOperations: ModelMapping[]; - otherOperations: { - read: string[]; - write: string[]; - }; - }>; - export type OtherOperationMappings = ReadonlyDeep_2<{ - read: string[]; - write: string[]; - }>; - export type DatamodelEnum = ReadonlyDeep_2<{ - name: string; - values: EnumValue[]; - dbName?: string | null; - documentation?: string; - }>; - export type SchemaEnum = ReadonlyDeep_2<{ - name: string; - values: string[]; - }>; - export type EnumValue = ReadonlyDeep_2<{ - name: string; - dbName: string | null; - }>; - export type Datamodel = ReadonlyDeep_2<{ - models: Model[]; - enums: DatamodelEnum[]; - types: Model[]; - }>; - export type uniqueIndex = ReadonlyDeep_2<{ - name: string; - fields: string[]; - }>; - export type PrimaryKey = ReadonlyDeep_2<{ - name: string | null; - fields: string[]; - }>; - export type Model = ReadonlyDeep_2<{ - name: string; - dbName: string | null; - fields: Field[]; - uniqueFields: string[][]; - uniqueIndexes: uniqueIndex[]; - documentation?: string; - primaryKey: PrimaryKey | null; - isGenerated?: boolean; - }>; - export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'; - export type FieldNamespace = 'model' | 'prisma'; - export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes'; - export type Field = ReadonlyDeep_2<{ - kind: FieldKind; - name: string; - isRequired: boolean; - isList: boolean; - isUnique: boolean; - isId: boolean; - isReadOnly: boolean; - isGenerated?: boolean; - isUpdatedAt?: boolean; - /** - * Describes the data type in the same the way it is defined in the Prisma schema: - * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName - */ - type: string; - dbName?: string | null; - hasDefaultValue: boolean; - default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[]; - relationFromFields?: string[]; - relationToFields?: string[]; - relationOnDelete?: string; - relationName?: string; - documentation?: string; - }>; - export type FieldDefault = ReadonlyDeep_2<{ - name: string; - args: any[]; - }>; - export type FieldDefaultScalar = string | boolean | number; - export type Schema = ReadonlyDeep_2<{ - rootQueryType?: string; - rootMutationType?: string; - inputObjectTypes: { - model?: InputType[]; - prisma: InputType[]; - }; - outputObjectTypes: { - model: OutputType[]; - prisma: OutputType[]; - }; - enumTypes: { - model?: SchemaEnum[]; - prisma: SchemaEnum[]; - }; - fieldRefTypes: { - prisma?: FieldRefType[]; - }; - }>; - export type Query = ReadonlyDeep_2<{ - name: string; - args: SchemaArg[]; - output: QueryOutput; - }>; - export type QueryOutput = ReadonlyDeep_2<{ - name: string; - isRequired: boolean; - isList: boolean; - }>; - export type TypeRef = { - isList: boolean; - type: string; - location: AllowedLocations; - namespace?: FieldNamespace; - }; - export type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>; - export type SchemaArg = ReadonlyDeep_2<{ - name: string; - comment?: string; - isNullable: boolean; - isRequired: boolean; - inputTypes: InputTypeRef[]; - deprecation?: Deprecation; - }>; - export type OutputType = ReadonlyDeep_2<{ - name: string; - fields: SchemaField[]; - }>; - export type SchemaField = ReadonlyDeep_2<{ - name: string; - isNullable?: boolean; - outputType: OutputTypeRef; - args: SchemaArg[]; - deprecation?: Deprecation; - documentation?: string; - }>; - export type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>; - export type Deprecation = ReadonlyDeep_2<{ - sinceVersion: string; - reason: string; - plannedRemovalVersion?: string; - }>; - export type InputType = ReadonlyDeep_2<{ - name: string; - constraints: { - maxNumFields: number | null; - minNumFields: number | null; - fields?: string[]; - }; - meta?: { - source?: string; - }; - fields: SchemaArg[]; - }>; - export type FieldRefType = ReadonlyDeep_2<{ - name: string; - allowTypes: FieldRefAllowType[]; - fields: SchemaArg[]; - }>; - export type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>; - export type ModelMapping = ReadonlyDeep_2<{ - model: string; - plural: string; - findUnique?: string | null; - findUniqueOrThrow?: string | null; - findFirst?: string | null; - findFirstOrThrow?: string | null; - findMany?: string | null; - create?: string | null; - createMany?: string | null; - createManyAndReturn?: string | null; - update?: string | null; - updateMany?: string | null; - upsert?: string | null; - delete?: string | null; - deleteMany?: string | null; - aggregate?: string | null; - groupBy?: string | null; - count?: string | null; - findRaw?: string | null; - aggregateRaw?: string | null; - }>; - export enum ModelAction { - findUnique = "findUnique", - findUniqueOrThrow = "findUniqueOrThrow", - findFirst = "findFirst", - findFirstOrThrow = "findFirstOrThrow", - findMany = "findMany", - create = "create", - createMany = "createMany", - createManyAndReturn = "createManyAndReturn", - update = "update", - updateMany = "updateMany", - upsert = "upsert", - delete = "delete", - deleteMany = "deleteMany", - groupBy = "groupBy", - count = "count",// TODO: count does not actually exist, why? - aggregate = "aggregate", - findRaw = "findRaw", - aggregateRaw = "aggregateRaw" - } -} - -export declare interface DriverAdapter extends Queryable { - /** - * Starts new transaction. - */ - startTransaction(): Promise>; - /** - * Optional method that returns extra connection info - */ - getConnectionInfo?(): Result_4; -} - -/** Client */ -export declare type DynamicClientExtensionArgs> = { - [P in keyof C_]: unknown; -} & { - [K: symbol]: { - ctx: Optional, ITXClientDenyList> & { - $parent: Optional, ITXClientDenyList>; - }; - }; -}; - -export declare type DynamicClientExtensionThis> = { - [P in keyof ExtArgs['client']]: Return; -} & { - [P in Exclude]: DynamicModelExtensionThis, ExtArgs>; -} & { - [P in Exclude]: >(...args: ToTuple) => PrismaPromise; -} & { - [P in Exclude]: DynamicClientExtensionThisBuiltin[P]; -} & { - [K: symbol]: { - types: TypeMap['other']; - }; -}; - -export declare type DynamicClientExtensionThisBuiltin> = { - $extends: ExtendsHook<'extends', TypeMapCb, ExtArgs>; - $transaction

[]>(arg: [...P], options?: { - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise>; - $transaction(fn: (client: Omit, ITXClientDenyList>) => Promise, options?: { - maxWait?: number; - timeout?: number; - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise; - $disconnect(): Promise; - $connect(): Promise; -}; - -/** Model */ -export declare type DynamicModelExtensionArgs> = { - [K in keyof M_]: K extends '$allModels' ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: {}; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: { - ctx: DynamicModelExtensionThis, ExtArgs> & { - $parent: DynamicClientExtensionThis; - } & { - $name: ModelKey; - } & { - /** - * @deprecated Use `$name` instead. - */ - name: ModelKey; - }; - }; - } : never; -}; - -export declare type DynamicModelExtensionFluentApi = { - [K in keyof TypeMap['model'][M]['payload']['objects']]: (args?: Exact>) => PrismaPromise, [K]> | Null> & DynamicModelExtensionFluentApi>; -}; - -export declare type DynamicModelExtensionFnResult> = P extends FluentOperation ? DynamicModelExtensionFluentApi & PrismaPromise | Null> : PrismaPromise>; - -export declare type DynamicModelExtensionFnResultBase = GetResult; - -export declare type DynamicModelExtensionFnResultNull

= P extends 'findUnique' | 'findFirst' ? null : never; - -export declare type DynamicModelExtensionOperationFn = {} extends TypeMap['model'][M]['operations'][P]['args'] ? (args?: Exact) => DynamicModelExtensionFnResult : (args: Exact) => DynamicModelExtensionFnResult; - -export declare type DynamicModelExtensionThis> = { - [P in keyof ExtArgs['model'][Uncapitalize]]: Return][P]>; -} & { - [P in Exclude]>]: DynamicModelExtensionOperationFn; -} & { - [P in Exclude<'fields', keyof ExtArgs['model'][Uncapitalize]>]: TypeMap['model'][M]['fields']; -} & { - [K: symbol]: { - types: TypeMap['model'][M]; - }; -}; - -/** Query */ -export declare type DynamicQueryExtensionArgs = { - [K in keyof Q_]: K extends '$allOperations' ? (args: { - model?: string; - operation: string; - args: any; - query: (args: any) => PrismaPromise; - }) => Promise : K extends '$allModels' ? { - [P in keyof Q_[K] | keyof TypeMap['model'][keyof TypeMap['model']]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb : P extends keyof TypeMap['model'][keyof TypeMap['model']]['operations'] ? DynamicQueryExtensionCb : never; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof Q_[K] | keyof TypeMap['model'][ModelKey]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb, keyof TypeMap['model'][ModelKey]['operations']> : P extends keyof TypeMap['model'][ModelKey]['operations'] ? DynamicQueryExtensionCb, P> : never; - } : K extends keyof TypeMap['other']['operations'] ? DynamicQueryExtensionCb<[TypeMap], 0, 'other', K> : never; -}; - -export declare type DynamicQueryExtensionCb = >(args: A) => Promise; - -export declare type DynamicQueryExtensionCbArgs = (_1 extends unknown ? _2 extends unknown ? { - args: DynamicQueryExtensionCbArgsArgs; - model: _0 extends 0 ? undefined : _1; - operation: _2; - query: >(args: A) => PrismaPromise; -} : never : never) & { - query: (args: DynamicQueryExtensionCbArgsArgs) => PrismaPromise; -}; - -export declare type DynamicQueryExtensionCbArgsArgs = _2 extends '$queryRaw' | '$executeRaw' ? Sql : TypeMap[_0][_1]['operations'][_2]['args']; - -/** Result */ -export declare type DynamicResultExtensionArgs = { - [K in keyof R_]: { - [P in keyof R_[K]]?: { - needs?: DynamicResultExtensionNeeds, R_[K][P]>; - compute(data: DynamicResultExtensionData, R_[K][P]>): any; - }; - }; -}; - -export declare type DynamicResultExtensionData = GetFindResult; - -export declare type DynamicResultExtensionNeeds = { - [K in keyof S]: K extends keyof TypeMap['model'][M]['payload']['scalars'] ? S[K] : never; -} & { - [N in keyof TypeMap['model'][M]['payload']['scalars']]?: boolean; -}; - -/** - * Placeholder value for "no text". - */ -export declare const empty: Sql; - -export declare type EmptyToUnknown = T; - -declare interface Engine { - /** The name of the engine. This is meant to be consumed externally */ - readonly name: string; - onBeforeExit(callback: () => Promise): void; - start(): Promise; - stop(): Promise; - version(forceRun?: boolean): Promise | string; - request(query: JsonQuery, options: RequestOptions_2): Promise>; - requestBatch(queries: JsonQuery[], options: RequestBatchOptions): Promise[]>; - transaction(action: 'start', headers: Transaction_2.TransactionHeaders, options: Transaction_2.Options): Promise>; - transaction(action: 'commit', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; - transaction(action: 'rollback', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; - metrics(options: MetricsOptionsJson): Promise; - metrics(options: MetricsOptionsPrometheus): Promise; - applyPendingMigrations(): Promise; -} - -declare interface EngineConfig { - cwd: string; - dirname: string; - datamodelPath: string; - enableDebugLogs?: boolean; - allowTriggerPanic?: boolean; - prismaPath?: string; - generator?: GeneratorConfig; - overrideDatasources: Datasources; - showColors?: boolean; - logQueries?: boolean; - logLevel?: 'info' | 'warn'; - env: Record; - flags?: string[]; - clientVersion: string; - engineVersion: string; - previewFeatures?: string[]; - engineEndpoint?: string; - activeProvider?: string; - logEmitter: LogEmitter; - transactionOptions: Transaction_2.Options; - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`. - * If set, this is only used in the library engine, and all queries would be performed through it, - * rather than Prisma's Rust drivers. - * @remarks only used by LibraryEngine.ts - */ - adapter?: ErrorCapturingDriverAdapter; - /** - * The contents of the schema encoded into a string - * @remarks only used by DataProxyEngine.ts - */ - inlineSchema: string; - /** - * The contents of the datasource url saved in a string - * @remarks only used by DataProxyEngine.ts - */ - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - /** - * The string hash that was produced for a given schema - * @remarks only used by DataProxyEngine.ts - */ - inlineSchemaHash: string; - /** - * The helper for interaction with OTEL tracing - * @remarks enabling is determined by the client and @prisma/instrumentation package - */ - tracingHelper: TracingHelper; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * Web Assembly module loading configuration - */ - engineWasm?: WasmLoadingConfig; - /** - * Allows Accelerate to use runtime utilities from the client. These are - * necessary for the AccelerateEngine to function correctly. - */ - accelerateUtils?: { - resolveDatasourceUrl: typeof resolveDatasourceUrl; - getBatchRequestPayload: typeof getBatchRequestPayload; - prismaGraphQLToJSError: typeof prismaGraphQLToJSError; - PrismaClientUnknownRequestError: typeof PrismaClientUnknownRequestError; - PrismaClientInitializationError: typeof PrismaClientInitializationError; - PrismaClientKnownRequestError: typeof PrismaClientKnownRequestError; - debug: (...args: any[]) => void; - engineVersion: string; - clientVersion: string; - }; -} - -declare type EngineEvent = E extends QueryEventType ? QueryEvent : LogEvent; - -declare type EngineEventType = QueryEventType | LogEventType; - -declare type EngineProtocol = 'graphql' | 'json'; - -declare type EngineSpan = { - span: boolean; - name: string; - trace_id: string; - span_id: string; - parent_span_id: string; - start_time: [number, number]; - end_time: [number, number]; - attributes?: Record; - links?: { - trace_id: string; - span_id: string; - }[]; -}; - -declare type EngineSpanEvent = { - span: boolean; - spans: EngineSpan[]; -}; - -declare interface EnvValue { - fromEnvVar: null | string; - value: null | string; -} - -export declare type Equals = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? 1 : 0; - -declare type Error_2 = { - kind: 'GenericJs'; - id: number; -} | { - kind: 'UnsupportedNativeDataType'; - type: string; -} | { - kind: 'Postgres'; - code: string; - severity: string; - message: string; - detail: string | undefined; - column: string | undefined; - hint: string | undefined; -} | { - kind: 'Mysql'; - code: number; - message: string; - state: string; -} | { - kind: 'Sqlite'; - /** - * Sqlite extended error code: https://www.sqlite.org/rescode.html - */ - extendedCode: number; - message: string; -}; - -declare interface ErrorCapturingDriverAdapter extends DriverAdapter { - readonly errorRegistry: ErrorRegistry; -} - -declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal'; - -declare type ErrorRecord = { - error: unknown; -}; - -declare interface ErrorRegistry { - consumeError(id: number): ErrorRecord | undefined; -} - -declare interface ErrorWithBatchIndex { - batchRequestIdx?: number; -} - -declare type EventCallback = [E] extends ['beforeExit'] ? () => Promise : [E] extends [LogLevel] ? (event: EngineEvent) => void : never; - -export declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof A]: Exact; -} : W) : never) | (A extends Narrowable ? A : never); - -/** - * Defines Exception. - * - * string or an object with one of (message or name or code) and optional stack - */ -declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string; - -declare interface ExceptionWithCode { - code: string | number; - name?: string; - message?: string; - stack?: string; -} - -declare interface ExceptionWithMessage { - code?: string | number; - message: string; - name?: string; - stack?: string; -} - -declare interface ExceptionWithName { - code?: string | number; - message?: string; - name: string; - stack?: string; -} - -declare type ExtendedEventType = LogLevel | 'beforeExit'; - -declare type ExtendedSpanOptions = SpanOptions & { - /** The name of the span */ - name: string; - internal?: boolean; - middleware?: boolean; - /** Whether it propagates context (?=true) */ - active?: boolean; - /** The context to append the span to */ - context?: Context; -}; - -/** $extends, defineExtension */ -export declare interface ExtendsHook, TypeMap extends TypeMapDef = Call> { - extArgs: ExtArgs; - , MergedArgs extends InternalArgs = MergeExtArgs>(extension: ((client: DynamicClientExtensionThis) => { - $extends: { - extArgs: Args; - }; - }) | { - name?: string; - query?: DynamicQueryExtensionArgs; - result?: DynamicResultExtensionArgs & R; - model?: DynamicModelExtensionArgs & M; - client?: DynamicClientExtensionArgs & C; - }): { - extends: DynamicClientExtensionThis, TypeMapCb, MergedArgs>; - define: (client: any) => { - $extends: { - extArgs: Args; - }; - }; - }[Variant]; -} - -export declare type ExtensionArgs = Optional; - -declare namespace Extensions { - export { - defineExtension, - getExtensionContext - } -} -export { Extensions } - -declare namespace Extensions_2 { - export { - InternalArgs, - DefaultArgs, - GetPayloadResult, - GetSelect, - GetOmit, - DynamicQueryExtensionArgs, - DynamicQueryExtensionCb, - DynamicQueryExtensionCbArgs, - DynamicQueryExtensionCbArgsArgs, - DynamicResultExtensionArgs, - DynamicResultExtensionNeeds, - DynamicResultExtensionData, - DynamicModelExtensionArgs, - DynamicModelExtensionThis, - DynamicModelExtensionOperationFn, - DynamicModelExtensionFnResult, - DynamicModelExtensionFnResultBase, - DynamicModelExtensionFluentApi, - DynamicModelExtensionFnResultNull, - DynamicClientExtensionArgs, - DynamicClientExtensionThis, - ClientBuiltInProp, - DynamicClientExtensionThisBuiltin, - ExtendsHook, - MergeExtArgs, - AllModelsToStringIndex, - TypeMapDef, - DevTypeMapDef, - DevTypeMapFnDef, - TypeMapCbDef, - ModelKey, - RequiredExtensionArgs as UserArgs - } -} - -declare type Fetch = typeof nodeFetch; - -/** - * A reference to a specific field of a specific model - */ -export declare interface FieldRef { - readonly modelName: Model; - readonly name: string; - readonly typeName: FieldType; - readonly isList: boolean; -} - -export declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete'; - -export declare interface Fn { - params: Params; - returns: Returns; -} - -declare interface GeneratorConfig { - name: string; - output: EnvValue | null; - isCustomOutput?: boolean; - provider: EnvValue; - config: { - /** `output` is a reserved name and will only be available directly at `generator.output` */ - output?: never; - /** `provider` is a reserved name and will only be available directly at `generator.provider` */ - provider?: never; - /** `binaryTargets` is a reserved name and will only be available directly at `generator.binaryTargets` */ - binaryTargets?: never; - /** `previewFeatures` is a reserved name and will only be available directly at `generator.previewFeatures` */ - previewFeatures?: never; - } & { - [key: string]: string | string[] | undefined; - }; - binaryTargets: BinaryTargetsEnvValue[]; - previewFeatures: string[]; -} - -export declare type GetAggregateResult

= { - [K in keyof A as K extends Aggregate ? K : never]: K extends '_count' ? A[K] extends true ? number : Count : { - [J in keyof A[K] & string]: P['scalars'][J] | null; - }; -}; - -declare function getBatchRequestPayload(batch: JsonQuery[], transaction?: TransactionOptions_2): QueryEngineBatchRequest; - -export declare type GetBatchResult = { - count: number; -}; - -export declare type GetCountResult = A extends { - select: infer S; -} ? (S extends true ? number : Count) : number; - -declare function getExtensionContext(that: T): Context_2; - -export declare type GetFindResult

= A extends { - omit: infer Omission; -} ? Compute, TrueKeys>> : GetSelectIncludeResult; - -export declare type GetGroupByResult

= A extends { - by: string[]; -} ? Array & { - [K in A['by'][number]]: P['scalars'][K]; -}> : A extends { - by: string; -} ? Array & { - [K in A['by']]: P['scalars'][K]; -}> : {}[]; - -export declare type GetOmit = { - [K in (string extends keyof R ? never : keyof R) | BaseKeys]?: boolean; -}; - -export declare type GetPayloadResult, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = unknown extends R ? Base : { - [K in KR | keyof Base]: K extends KR ? R[K] extends () => { - compute: (...args: any) => infer C; - } ? C : never : Base[K]; -}; - -export declare function getPrismaClient(config: GetPrismaClientConfig): { - new (optionsArg?: PrismaClientOptions): { - _originalClient: any; - _runtimeDataModel: RuntimeDataModel; - _requestHandler: RequestHandler; - _connectionPromise?: Promise | undefined; - _disconnectionPromise?: Promise | undefined; - _engineConfig: EngineConfig; - _accelerateEngineConfig: AccelerateEngineConfig; - _clientVersion: string; - _errorFormat: ErrorFormat; - _tracingHelper: TracingHelper; - _metrics: MetricsClient; - _middlewares: MiddlewareHandler; - _previewFeatures: string[]; - _activeProvider: string; - _extensions: MergedExtensionsList; - _engine: Engine; - /** - * A fully constructed/applied Client that references the parent - * PrismaClient. This is used for Client extensions only. - */ - _appliedParent: any; - _createPrismaPromise: PrismaPromiseFactory; - /** - * Hook a middleware into the client - * @param middleware to hook - */ - $use(middleware: QueryMiddleware): void; - $on(eventType: E, callback: EventCallback): void; - $connect(): Promise; - /** - * Disconnect from the database - */ - $disconnect(): Promise; - /** - * Executes a raw query and always returns a number - */ - $executeRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; - /** - * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; - /** - * Executes a raw command only for MongoDB - * - * @param command - * @returns - */ - $runCommandRaw(command: Record): PrismaPromise_2; - /** - * Executes a raw query and returns selected data - */ - $queryRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; - /** - * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; - /** - * Execute a batch of requests in a transaction - * @param requests - * @param options - */ - _transactionWithArray({ promises, options, }: { - promises: Array>; - options?: BatchTransactionOptions; - }): Promise; - /** - * Perform a long-running transaction - * @param callback - * @param options - * @returns - */ - _transactionWithCallback({ callback, options, }: { - callback: (client: Client) => Promise; - options?: Options; - }): Promise; - _createItxClient(transaction: PrismaPromiseInteractiveTransaction): Client; - /** - * Execute queries within a transaction - * @param input a callback or a query list - * @param options to set timeouts (callback) - * @returns - */ - $transaction(input: any, options?: any): Promise; - /** - * Runs the middlewares over params before executing a request - * @param internalParams - * @returns - */ - _request(internalParams: InternalRequestParams): Promise; - _executeRequest({ args, clientMethod, dataPath, callsite, action, model, argsMapper, transaction, unpacker, otelParentCtx, customDataProxyFetch, }: InternalRequestParams): Promise; - readonly $metrics: MetricsClient; - /** - * Shortcut for checking a preview flag - * @param feature preview flag - * @returns - */ - _hasPreviewFlag(feature: string): boolean; - $applyPendingMigrations(): Promise; - $extends: typeof $extends; - readonly [Symbol.toStringTag]: string; - }; -}; - -/** - * Config that is stored into the generated client. When the generated client is - * loaded, this same config is passed to {@link getPrismaClient} which creates a - * closure with that config around a non-instantiated [[PrismaClient]]. - */ -declare type GetPrismaClientConfig = { - runtimeDataModel: RuntimeDataModel; - generator?: GeneratorConfig; - relativeEnvPaths: { - rootEnvPath?: string | null; - schemaEnvPath?: string | null; - }; - relativePath: string; - dirname: string; - filename?: string; - clientVersion: string; - engineVersion: string; - datasourceNames: string[]; - activeProvider: string; - /** - * The contents of the schema encoded into a string - * @remarks only used for the purpose of data proxy - */ - inlineSchema: string; - /** - * A special env object just for the data proxy edge runtime. - * Allows bundlers to inject their own env variables (Vercel). - * Allows platforms to declare global variables as env (Workers). - * @remarks only used for the purpose of data proxy - */ - injectableEdgeEnv?: () => LoadedEnv; - /** - * The contents of the datasource url saved in a string. - * This can either be an env var name or connection string. - * It is needed by the client to connect to the Data Proxy. - * @remarks only used for the purpose of data proxy - */ - inlineDatasources: { - [name in string]: { - url: EnvValue; - }; - }; - /** - * The string hash that was produced for a given schema - * @remarks only used for the purpose of data proxy - */ - inlineSchemaHash: string; - /** - * A marker to indicate that the client was not generated via `prisma - * generate` but was generated via `generate --postinstall` script instead. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - postinstall?: boolean; - /** - * Information about the CI where the Prisma Client has been generated. The - * name of the CI environment is stored at generation time because CI - * information is not always available at runtime. Moreover, the edge client - * has no notion of environment variables, so this works around that. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - ciName?: string; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * A boolean that is `false` when the client was generated with --no-engine. At - * runtime, this means the client will be bound to be using the Data Proxy. - */ - copyEngine?: boolean; - /** - * Optional wasm loading configuration - */ - engineWasm?: WasmLoadingConfig; -}; - -export declare type GetResult

= { - findUnique: GetFindResult | null; - findUniqueOrThrow: GetFindResult; - findFirst: GetFindResult | null; - findFirstOrThrow: GetFindResult; - findMany: GetFindResult[]; - create: GetFindResult; - createMany: GetBatchResult; - createManyAndReturn: GetFindResult[]; - update: GetFindResult; - updateMany: GetBatchResult; - upsert: GetFindResult; - delete: GetFindResult; - deleteMany: GetBatchResult; - aggregate: GetAggregateResult; - count: GetCountResult; - groupBy: GetGroupByResult; - $queryRaw: unknown; - $executeRaw: number; - $queryRawUnsafe: unknown; - $executeRawUnsafe: number; - $runCommandRaw: JsonObject; - findRaw: JsonObject; - aggregateRaw: JsonObject; -}[O]; - -export declare function getRuntime(): GetRuntimeOutput; - -declare type GetRuntimeOutput = { - id: Runtime; - prettyName: string; - isEdge: boolean; -}; - -export declare type GetSelect, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = { - [K in KR | keyof Base]?: K extends KR ? boolean : Base[K]; -}; - -export declare type GetSelectIncludeResult

= Equals extends 1 ? DefaultSelection

: A extends { - select: infer S extends object; -} & Record | { - include: infer I extends object; -} & Record ? { - [K in keyof S | keyof I as (S & I)[K] extends false | undefined | null ? never : K]: (S & I)[K] extends object ? P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult | SelectField & null : never : K extends '_count' ? Count> : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection | SelectField & null : never : P extends { - scalars: { - [k in K]: infer O; - }; - } ? O : K extends '_count' ? Count : never; -} & (A extends { - include: any; -} & Record ? DefaultSelection

: unknown) : DefaultSelection

; - -declare type HandleErrorParams = { - args: JsArgs; - error: any; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - modelName?: string; -}; - -/** - * Defines High-Resolution Time. - * - * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. - * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. - * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. - * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds: - * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. - * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: - * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000. - * This is represented in HrTime format as [1609504210, 150000000]. - */ -declare type HrTime = [number, number]; - -declare type InteractiveTransactionInfo = { - /** - * Transaction ID returned by the query engine. - */ - id: string; - /** - * Arbitrary payload the meaning of which depends on the `Engine` implementation. - * For example, `DataProxyEngine` needs to associate different API endpoints with transactions. - * In `LibraryEngine` and `BinaryEngine` it is currently not used. - */ - payload: Payload; -}; - -declare type InteractiveTransactionOptions = Transaction_2.InteractiveTransactionInfo; - -export declare type InternalArgs = { - result: { - [K in keyof R]: { - [P in keyof R[K]]: () => R[K][P]; - }; - }; - model: { - [K in keyof M]: { - [P in keyof M[K]]: () => M[K][P]; - }; - }; - query: { - [K in keyof Q]: { - [P in keyof Q[K]]: () => Q[K][P]; - }; - }; - client: { - [K in keyof C]: () => C[K]; - }; -}; - -declare type InternalRequestParams = { - /** - * The original client method being called. - * Even though the rootField / operation can be changed, - * this method stays as it is, as it's what the user's - * code looks like - */ - clientMethod: string; - /** - * Name of js model that triggered the request. Might be used - * for warnings or error messages - */ - jsModelName?: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - unpacker?: Unpacker; - otelParentCtx?: Context; - /** Used to "desugar" a user input into an "expanded" one */ - argsMapper?: (args?: UserArgs_2) => UserArgs_2; - /** Used to convert args for middleware and back */ - middlewareArgsMapper?: MiddlewareArgsMapper; - /** Used for Accelerate client extension via Data Proxy */ - customDataProxyFetch?: (fetch: Fetch) => Fetch; -} & Omit; - -declare enum IsolationLevel { - ReadUncommitted = "ReadUncommitted", - ReadCommitted = "ReadCommitted", - RepeatableRead = "RepeatableRead", - Snapshot = "Snapshot", - Serializable = "Serializable" -} - -export declare type ITXClientDenyList = (typeof denylist)[number]; - -export declare const itxClientDenyList: readonly (string | symbol)[]; - -declare interface Job { - resolve: (data: any) => void; - reject: (data: any) => void; - request: any; -} - -/** - * Create a SQL query for a list of values. - */ -export declare function join(values: readonly RawValue[], separator?: string, prefix?: string, suffix?: string): Sql; - -export declare type JsArgs = { - select?: Selection_2; - include?: Selection_2; - omit?: Omission; - [argName: string]: JsInputValue; -}; - -export declare type JsInputValue = null | undefined | string | number | boolean | bigint | Uint8Array | Date | DecimalJsLike | ObjectEnumValue | RawParameters | JsonConvertible | FieldRef | JsInputValue[] | { - [key: string]: JsInputValue; -}; - -declare type JsonArgumentValue = number | string | boolean | null | RawTaggedValue | JsonArgumentValue[] | { - [key: string]: JsonArgumentValue; -}; - -export declare interface JsonArray extends Array { -} - -declare type JsonBatchQuery = { - batch: JsonQuery[]; - transaction?: { - isolationLevel?: Transaction_2.IsolationLevel; - }; -}; - -export declare interface JsonConvertible { - toJSON(): unknown; -} - -declare type JsonFieldSelection = { - arguments?: Record | RawTaggedValue; - selection: JsonSelectionSet; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -export declare type JsonObject = { - [Key in string]?: JsonValue; -}; - -declare type JsonQuery = { - modelName?: string; - action: JsonQueryAction; - query: JsonFieldSelection; -}; - -declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw'; - -declare type JsonSelectionSet = { - $scalars?: boolean; - $composites?: boolean; -} & { - [fieldName: string]: boolean | JsonFieldSelection; -}; - -export declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null; - -export declare type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | { - [key: string]: JsOutputValue; -}; - -export declare type JsPromise = Promise & {}; - -declare type KnownErrorParams = { - code: string; - clientVersion: string; - meta?: Record; - batchRequestIdx?: number; -}; - -/** - * A pointer from the current {@link Span} to another span in the same trace or - * in a different trace. - * Few examples of Link usage. - * 1. Batch Processing: A batch of elements may contain elements associated - * with one or more traces/spans. Since there can only be one parent - * SpanContext, Link is used to keep reference to SpanContext of all - * elements in the batch. - * 2. Public Endpoint: A SpanContext in incoming client request on a public - * endpoint is untrusted from service provider perspective. In such case it - * is advisable to start a new trace with appropriate sampling decision. - * However, it is desirable to associate incoming SpanContext to new trace - * initiated on service provider side so two traces (from Client and from - * Service Provider) can be correlated. - */ -declare interface Link { - /** The {@link SpanContext} of a linked span. */ - context: SpanContext; - /** A set of {@link SpanAttributes} on the link. */ - attributes?: SpanAttributes; - /** Count of attributes of the link that were dropped due to collection limits */ - droppedAttributesCount?: number; -} - -declare type LoadedEnv = { - message?: string; - parsed: { - [x: string]: string; - }; -} | undefined; - -declare type LocationInFile = { - fileName: string; - lineNumber: number | null; - columnNumber: number | null; -}; - -declare type LogDefinition = { - level: LogLevel; - emit: 'stdout' | 'event'; -}; - -/** - * Typings for the events we emit. - * - * @remarks - * If this is updated, our edge runtime shim needs to be updated as well. - */ -declare type LogEmitter = { - on(event: E, listener: (event: EngineEvent) => void): LogEmitter; - emit(event: QueryEventType, payload: QueryEvent): boolean; - emit(event: LogEventType, payload: LogEvent): boolean; -}; - -declare type LogEvent = { - timestamp: Date; - message: string; - target: string; -}; - -declare type LogEventType = 'info' | 'warn' | 'error'; - -declare type LogLevel = 'info' | 'query' | 'warn' | 'error'; - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -/** - * Class that holds the list of all extensions, applied to particular instance, - * as well as resolved versions of the components that need to apply on - * different levels. Main idea of this class: avoid re-resolving as much of the - * stuff as possible when new extensions are added while also delaying the - * resolve until the point it is actually needed. For example, computed fields - * of the model won't be resolved unless the model is actually queried. Neither - * adding extensions with `client` component only cause other components to - * recompute. - */ -declare class MergedExtensionsList { - private head?; - private constructor(); - static empty(): MergedExtensionsList; - static single(extension: ExtensionArgs): MergedExtensionsList; - isEmpty(): boolean; - append(extension: ExtensionArgs): MergedExtensionsList; - getAllComputedFields(dmmfModelName: string): ComputedFieldsMap | undefined; - getAllClientExtensions(): ClientArg | undefined; - getAllModelExtensions(dmmfModelName: string): ModelArg | undefined; - getAllQueryCallbacks(jsModelName: string, operation: string): any; - getAllBatchQueryCallbacks(): BatchQueryOptionsCb[]; -} - -export declare type MergeExtArgs, Args extends Record> = ComputeDeep & AllModelsToStringIndex>; - -export declare type Metric = { - key: string; - value: T; - labels: Record; - description: string; -}; - -export declare type MetricHistogram = { - buckets: MetricHistogramBucket[]; - sum: number; - count: number; -}; - -export declare type MetricHistogramBucket = [maxValue: number, count: number]; - -export declare type Metrics = { - counters: Metric[]; - gauges: Metric[]; - histograms: Metric[]; -}; - -export declare class MetricsClient { - private _engine; - constructor(engine: Engine); - /** - * Returns all metrics gathered up to this point in prometheus format. - * Result of this call can be exposed directly to prometheus scraping endpoint - * - * @param options - * @returns - */ - prometheus(options?: MetricsOptions): Promise; - /** - * Returns all metrics gathered up to this point in prometheus format. - * - * @param options - * @returns - */ - json(options?: MetricsOptions): Promise; -} - -declare type MetricsOptions = { - /** - * Labels to add to every metrics in key-value format - */ - globalLabels?: Record; -}; - -declare type MetricsOptionsCommon = { - globalLabels?: Record; -}; - -declare type MetricsOptionsJson = { - format: 'json'; -} & MetricsOptionsCommon; - -declare type MetricsOptionsPrometheus = { - format: 'prometheus'; -} & MetricsOptionsCommon; - -declare type MiddlewareArgsMapper = { - requestArgsToMiddlewareArgs(requestArgs: RequestArgs): MiddlewareArgs; - middlewareArgsToRequestArgs(middlewareArgs: MiddlewareArgs): RequestArgs; -}; - -declare class MiddlewareHandler { - private _middlewares; - use(middleware: M): void; - get(id: number): M | undefined; - has(id: number): boolean; - length(): number; -} - -export declare type ModelArg = { - [MethodName in string]: unknown; -}; - -export declare type ModelArgs = { - model: { - [ModelName in string]: ModelArg; - }; -}; - -export declare type ModelKey = M extends keyof TypeMap['model'] ? M : Capitalize; - -export declare type ModelQueryOptionsCb = (args: ModelQueryOptionsCbArgs) => Promise; - -export declare type ModelQueryOptionsCbArgs = { - model: string; - operation: string; - args: JsArgs; - query: (args: JsArgs) => Promise; -}; - -export declare type NameArgs = { - name?: string; -}; - -export declare type Narrow = { - [K in keyof A]: A[K] extends Function ? A[K] : Narrow; -} | (A extends Narrowable ? A : never); - -export declare type Narrowable = string | number | bigint | boolean | []; - -export declare type NeverToUnknown = [T] extends [never] ? unknown : T; - -/** - * Imitates `fetch` via `https` to only suit our needs, it does nothing more. - * This is because we cannot bundle `node-fetch` as it uses many other Node.js - * utilities, while also bloating our bundles. This approach is much leaner. - * @param url - * @param options - * @returns - */ -declare function nodeFetch(url: string, options?: RequestOptions): Promise; - -declare class NodeHeaders { - readonly headers: Map; - constructor(init?: Record); - append(name: string, value: string): void; - delete(name: string): void; - get(name: string): string | null; - has(name: string): boolean; - set(name: string, value: string): void; - forEach(callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any): void; -} - -/** - * @deprecated Please don´t rely on type checks to this error anymore. - * This will become a regular `PrismaClientKnownRequestError` with code `P2025` - * in the future major version of the client. - * Instead of `error instanceof Prisma.NotFoundError` use `error.code === "P2025"`. - */ -export declare class NotFoundError extends PrismaClientKnownRequestError { - constructor(message: string, clientVersion: string); -} - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * List of Prisma enums that must use unique objects instead of strings as their values. - */ -export declare const objectEnumNames: string[]; - -/** - * Base class for unique values of object-valued enums. - */ -export declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-pg-worker"]; - -export declare type Omission = Record; - -declare type Omit_2 = { - [P in keyof T as P extends K ? never : P]: T[P]; -}; -export { Omit_2 as Omit } - -export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -export declare type OperationPayload = { - scalars: { - [ScalarName in string]: unknown; - }; - objects: { - [ObjectName in string]: unknown; - }; - composites: { - [CompositeName in string]: unknown; - }; -}; - -export declare type Optional = { - [P in K & keyof O]?: O[P]; -} & { - [P in Exclude]: O[P]; -}; - -export declare type OptionalFlat = { - [K in keyof T]?: T[K]; -}; - -export declare type OptionalKeys = { - [K in keyof O]-?: {} extends Pick_2 ? K : never; -}[keyof O]; - -declare type Options = { - maxWait?: number; - timeout?: number; - isolationLevel?: IsolationLevel; -}; - -declare type Options_2 = { - clientVersion: string; -}; - -export declare type Or = { - 0: { - 0: 0; - 1: 1; - }; - 1: { - 0: 1; - 1: 1; - }; -}[A][B]; - -export declare type PatchFlat = O1 & Omit_2; - -export declare type Path = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path : Default : O : never; - -export declare type Payload = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? T[symbol]['types']['payload'] : any; - -export declare type PayloadToResult = RenameAndNestPayloadKeys

> = { - [K in keyof O]?: O[K][K] extends any[] ? PayloadToResult[] : O[K][K] extends object ? PayloadToResult : O[K][K]; -}; - -declare type Pick_2 = { - [P in keyof T as P extends K ? P : never]: T[P]; -}; -export { Pick_2 as Pick } - -export declare class PrismaClientInitializationError extends Error { - clientVersion: string; - errorCode?: string; - retryable?: boolean; - constructor(message: string, clientVersion: string, errorCode?: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientKnownRequestError extends Error implements ErrorWithBatchIndex { - code: string; - meta?: Record; - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { code, clientVersion, meta, batchRequestIdx }: KnownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare type PrismaClientOptions = { - /** - * Overwrites the primary datasource url from your schema.prisma file - */ - datasourceUrl?: string; - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale. - */ - adapter?: DriverAdapter | null; - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasources?: Datasources; - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat; - /** - * The default values for Transaction options - * maxWait ?= 2000 - * timeout ?= 5000 - */ - transactionOptions?: Transaction_2.Options; - /** - * @example - * \`\`\` - * // Defaults to stdout - * log: ['query', 'info', 'warn'] - * - * // Emit as events - * log: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * ] - * \`\`\` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: Array; - /** - * @internal - * You probably don't want to use this. \`__internal\` is used by internal tooling. - */ - __internal?: { - debug?: boolean; - engine?: { - cwd?: string; - binaryPath?: string; - endpoint?: string; - allowTriggerPanic?: boolean; - }; - /** This can be used for testing purposes */ - configOverride?: (config: GetPrismaClientConfig) => GetPrismaClientConfig; - }; -}; - -export declare class PrismaClientRustPanicError extends Error { - clientVersion: string; - constructor(message: string, clientVersion: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientUnknownRequestError extends Error implements ErrorWithBatchIndex { - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { clientVersion, batchRequestIdx }: UnknownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientValidationError extends Error { - name: string; - clientVersion: string; - constructor(message: string, { clientVersion }: Options_2); - get [Symbol.toStringTag](): string; -} - -declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError; - -export declare interface PrismaPromise extends Promise { - [Symbol.toStringTag]: 'PrismaPromise'; -} - -/** - * Prisma's `Promise` that is backwards-compatible. All additions on top of the - * original `Promise` are optional so that it can be backwards-compatible. - * @see [[createPrismaPromise]] - */ -declare interface PrismaPromise_2 extends Promise { - /** - * Extension of the original `.then` function - * @param onfulfilled same as regular promises - * @param onrejected same as regular promises - * @param transaction transaction options - */ - then(onfulfilled?: (value: A) => R1 | PromiseLike, onrejected?: (error: unknown) => R2 | PromiseLike, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.catch` function - * @param onrejected same as regular promises - * @param transaction transaction options - */ - catch(onrejected?: ((reason: any) => R | PromiseLike) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.finally` function - * @param onfinally same as regular promises - * @param transaction transaction options - */ - finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Called when executing a batch of regular tx - * @param transaction transaction options for batch tx - */ - requestTransaction?(transaction: PrismaPromiseBatchTransaction): PromiseLike; -} - -declare type PrismaPromiseBatchTransaction = { - kind: 'batch'; - id: number; - isolationLevel?: IsolationLevel; - index: number; - lock: PromiseLike; -}; - -declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2; - -/** - * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which - * is essentially a proxy for `Promise`. All the transaction-compatible client - * methods return one, this allows for pre-preparing queries without executing - * them until `.then` is called. It's the foundation of Prisma's query batching. - * @param callback that will be wrapped within our promise implementation - * @see [[PrismaPromise]] - * @returns - */ -declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2; - -declare type PrismaPromiseInteractiveTransaction = { - kind: 'itx'; - id: string; - payload: PayloadType; -}; - -declare type PrismaPromiseTransaction = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction; - -declare namespace Public { - export { - validator - } -} -export { Public } - -declare namespace Public_2 { - export { - Args, - Result, - Payload, - PrismaPromise, - Operation, - Exact - } -} - -declare type Query = { - sql: string; - args: Array; -}; - -declare interface Queryable { - readonly provider: 'mysql' | 'postgres' | 'sqlite'; - readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {}); - /** - * Execute a query given as SQL, interpolating the given parameters, - * and returning the type-aware result set of the query. - * - * This is the preferred way of executing `SELECT` queries. - */ - queryRaw(params: Query): Promise>; - /** - * Execute a query given as SQL, interpolating the given parameters, - * and returning the number of affected rows. - * - * This is the preferred way of executing `INSERT`, `UPDATE`, `DELETE` queries, - * as well as transactional queries. - */ - executeRaw(params: Query): Promise>; -} - -declare type QueryEngineBatchGraphQLRequest = { - batch: QueryEngineRequest[]; - transaction?: boolean; - isolationLevel?: Transaction_2.IsolationLevel; -}; - -declare type QueryEngineBatchRequest = QueryEngineBatchGraphQLRequest | JsonBatchQuery; - -declare type QueryEngineConfig = { - datamodel: string; - configDir: string; - logQueries: boolean; - ignoreEnvVarErrors: boolean; - datasourceOverrides: Record; - env: Record; - logLevel: QueryEngineLogLevel; - telemetry?: QueryEngineTelemetry; - engineProtocol: EngineProtocol; -}; - -declare interface QueryEngineConstructor { - new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingDriverAdapter): QueryEngineInstance; -} - -declare type QueryEngineInstance = { - connect(headers: string): Promise; - disconnect(headers: string): Promise; - /** - * @param requestStr JSON.stringified `QueryEngineRequest | QueryEngineBatchRequest` - * @param headersStr JSON.stringified `QueryEngineRequestHeaders` - */ - query(requestStr: string, headersStr: string, transactionId?: string): Promise; - sdlSchema(): Promise; - dmmf(traceparent: string): Promise; - startTransaction(options: string, traceHeaders: string): Promise; - commitTransaction(id: string, traceHeaders: string): Promise; - rollbackTransaction(id: string, traceHeaders: string): Promise; - metrics(options: string): Promise; - applyPendingMigrations(): Promise; -}; - -declare type QueryEngineLogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off'; - -declare type QueryEngineRequest = { - query: string; - variables: Object; -}; - -declare type QueryEngineResult = { - data: T; - elapsed: number; -}; - -declare type QueryEngineTelemetry = { - enabled: Boolean; - endpoint: string; -}; - -declare type QueryEvent = { - timestamp: Date; - query: string; - params: string; - duration: number; - target: string; -}; - -declare type QueryEventType = 'query'; - -declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise) => Promise; - -declare type QueryMiddlewareParams = { - /** The model this is executed on */ - model?: string; - /** The action that is being handled */ - action: Action; - /** TODO what is this */ - dataPath: string[]; - /** TODO what is this */ - runInTransaction: boolean; - args?: UserArgs_2; -}; - -export declare type QueryOptions = { - query: { - [ModelName in string]: { - [ModelAction in string]: ModelQueryOptionsCb; - } | QueryOptionsCb; - }; -}; - -export declare type QueryOptionsCb = (args: QueryOptionsCbArgs) => Promise; - -export declare type QueryOptionsCbArgs = { - model?: string; - operation: string; - args: JsArgs | RawQueryArgs; - query: (args: JsArgs | RawQueryArgs) => Promise; -}; - -/** - * Create raw SQL statement. - */ -export declare function raw(value: string): Sql; - -export declare type RawParameters = { - __prismaRawParameters__: true; - values: string; -}; - -export declare type RawQueryArgs = Sql | [query: string, ...values: RawValue[]]; - -declare type RawTaggedValue = { - $type: 'Raw'; - value: unknown; -}; - -/** - * Supported value or SQL instance. - */ -export declare type RawValue = Value | Sql; - -export declare type ReadonlyDeep = { - readonly [K in keyof T]: ReadonlyDeep; -}; - -declare type ReadonlyDeep_2 = { - +readonly [K in keyof O]: ReadonlyDeep_2; -}; - -declare type Record_2 = { - [P in T]: U; -}; -export { Record_2 as Record } - -export declare type RenameAndNestPayloadKeys

= { - [K in keyof P as K extends 'scalars' | 'objects' | 'composites' ? keyof P[K] : never]: P[K]; -}; - -declare type RequestBatchOptions = { - transaction?: TransactionOptions_2; - traceparent?: string; - numTry?: number; - containsWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare interface RequestError { - error: string; - user_facing_error: { - is_panic: boolean; - message: string; - meta?: Record; - error_code?: string; - batch_request_idx?: number; - }; -} - -declare class RequestHandler { - client: Client; - dataloader: DataLoader; - private logEmitter?; - constructor(client: Client, logEmitter?: LogEmitter); - request(params: RequestParams): Promise; - mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResult): any; - /** - * Handles the error and logs it, logging the error is done synchronously waiting for the event - * handlers to finish. - */ - handleAndLogRequestError(params: HandleErrorParams): never; - handleRequestError({ error, clientMethod, callsite, transaction, args, modelName }: HandleErrorParams): never; - sanitizeMessage(message: any): any; - unpack(data: unknown, dataPath: string[], unpacker?: Unpacker): any; - get [Symbol.toStringTag](): string; -} - -declare type RequestOptions = { - method?: string; - headers?: Record; - body?: string; -}; - -declare type RequestOptions_2 = { - traceparent?: string; - numTry?: number; - interactiveTransaction?: InteractiveTransactionOptions; - isWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare type RequestParams = { - modelName?: string; - action: Action; - protocolQuery: JsonQuery; - dataPath: string[]; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - extensions: MergedExtensionsList; - args?: any; - headers?: Record; - unpacker?: Unpacker; - otelParentCtx?: Context; - otelChildCtx?: Context; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare type RequestResponse = { - ok: boolean; - url: string; - statusText?: string; - status: number; - headers: NodeHeaders; - text: () => Promise; - json: () => Promise; -}; - -declare type RequiredExtensionArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions; -export { RequiredExtensionArgs } -export { RequiredExtensionArgs as UserArgs } - -export declare type RequiredKeys = { - [K in keyof O]-?: {} extends Pick_2 ? never : K; -}[keyof O]; - -declare function resolveDatasourceUrl({ inlineDatasources, overrideDatasources, env, clientVersion, }: { - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - overrideDatasources: Datasources; - env: Record; - clientVersion: string; -}): string; - -export declare type Result = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? GetResult : GetResult<{ - composites: {}; - objects: {}; - scalars: {}; -}, {}, F>; - -export declare type Result_2 = Result; - -declare namespace Result_3 { - export { - Operation, - FluentOperation, - Count, - TrueKeys, - GetFindResult, - GetSelectIncludeResult, - SelectablePayloadFields, - SelectField, - DefaultSelection, - UnwrapPayload, - GetCountResult, - Aggregate, - GetAggregateResult, - GetBatchResult, - GetGroupByResult, - GetResult - } -} - -declare type Result_4 = { - map(fn: (value: T) => U): Result_4; - flatMap(fn: (value: T) => Result_4): Result_4; -} & ({ - readonly ok: true; - readonly value: T; -} | { - readonly ok: false; - readonly error: Error_2; -}); - -export declare type ResultArg = { - [FieldName in string]: ResultFieldDefinition; -}; - -export declare type ResultArgs = { - result: { - [ModelName in string]: ResultArg; - }; -}; - -export declare type ResultArgsFieldCompute = (model: any) => unknown; - -export declare type ResultFieldDefinition = { - needs?: { - [FieldName in string]: boolean; - }; - compute: ResultArgsFieldCompute; -}; - -declare interface ResultSet { - /** - * List of column types appearing in a database query, in the same order as `columnNames`. - * They are used within the Query Engine to convert values from JS to Quaint values. - */ - columnTypes: Array; - /** - * List of column names appearing in a database query, in the same order as `columnTypes`. - */ - columnNames: Array; - /** - * List of rows retrieved from a database query. - * Each row is a list of values, whose length matches `columnNames` and `columnTypes`. - */ - rows: Array>; - /** - * The last ID of an `INSERT` statement, if any. - * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite. - */ - lastInsertId?: string; -} - -export declare type Return = T extends (...args: any[]) => infer R ? R : T; - -declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown"; - -declare type RuntimeDataModel = { - readonly models: Record; - readonly enums: Record; - readonly types: Record; -}; - -declare type RuntimeEnum = Omit; - -declare type RuntimeModel = Omit; - -export declare type Select = T extends U ? T : never; - -export declare type SelectablePayloadFields = { - objects: { - [k in K]: O; - }; -} | { - composites: { - [k in K]: O; - }; -}; - -export declare type SelectField

, K extends PropertyKey> = P extends { - objects: Record; -} ? P['objects'][K] : P extends { - composites: Record; -} ? P['composites'][K] : never; - -declare type Selection_2 = Record; -export { Selection_2 as Selection } - -/** - * An interface that represents a span. A span represents a single operation - * within a trace. Examples of span might include remote procedure calls or a - * in-process function calls to sub-components. A Trace has a single, top-level - * "root" Span that in turn may have zero or more child Spans, which in turn - * may have children. - * - * Spans are created by the {@link Tracer.startSpan} method. - */ -declare interface Span { - /** - * Returns the {@link SpanContext} object associated with this Span. - * - * Get an immutable, serializable identifier for this span that can be used - * to create new child spans. Returned SpanContext is usable even after the - * span ends. - * - * @returns the SpanContext object associated with this Span. - */ - spanContext(): SpanContext; - /** - * Sets an attribute to the span. - * - * Sets a single Attribute with the key and value passed as arguments. - * - * @param key the key for this attribute. - * @param value the value for this attribute. Setting a value null or - * undefined is invalid and will result in undefined behavior. - */ - setAttribute(key: string, value: SpanAttributeValue): this; - /** - * Sets attributes to the span. - * - * @param attributes the attributes that will be added. - * null or undefined attribute values - * are invalid and will result in undefined behavior. - */ - setAttributes(attributes: SpanAttributes): this; - /** - * Adds an event to the Span. - * - * @param name the name of the event. - * @param [attributesOrStartTime] the attributes that will be added; these are - * associated with this event. Can be also a start time - * if type is {@type TimeInput} and 3rd param is undefined - * @param [startTime] start time of the event. - */ - addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this; - /** - * Sets a status to the span. If used, this will override the default Span - * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value - * of previous calls to SetStatus on the Span. - * - * @param status the SpanStatus to set. - */ - setStatus(status: SpanStatus): this; - /** - * Updates the Span name. - * - * This will override the name provided via {@link Tracer.startSpan}. - * - * Upon this update, any sampling behavior based on Span name will depend on - * the implementation. - * - * @param name the Span name. - */ - updateName(name: string): this; - /** - * Marks the end of Span execution. - * - * Call to End of a Span MUST not have any effects on child spans. Those may - * still be running and can be ended later. - * - * Do not return `this`. The Span generally should not be used after it - * is ended so chaining is not desired in this context. - * - * @param [endTime] the time to set as Span's end time. If not provided, - * use the current time as the span's end time. - */ - end(endTime?: TimeInput): void; - /** - * Returns the flag whether this span will be recorded. - * - * @returns true if this Span is active and recording information like events - * with the `AddEvent` operation and attributes using `setAttributes`. - */ - isRecording(): boolean; - /** - * Sets exception as a span event - * @param exception the exception the only accepted values are string or Error - * @param [time] the time to set as Span's event time. If not provided, - * use the current time. - */ - recordException(exception: Exception, time?: TimeInput): void; -} - -/** - * @deprecated please use {@link Attributes} - */ -declare type SpanAttributes = Attributes; - -/** - * @deprecated please use {@link AttributeValue} - */ -declare type SpanAttributeValue = AttributeValue; - -declare type SpanCallback = (span?: Span, context?: Context) => R; - -/** - * A SpanContext represents the portion of a {@link Span} which must be - * serialized and propagated along side of a {@link Baggage}. - */ -declare interface SpanContext { - /** - * The ID of the trace that this span belongs to. It is worldwide unique - * with practically sufficient probability by being made as 16 randomly - * generated bytes, encoded as a 32 lowercase hex characters corresponding to - * 128 bits. - */ - traceId: string; - /** - * The ID of the Span. It is globally unique with practically sufficient - * probability by being made as 8 randomly generated bytes, encoded as a 16 - * lowercase hex characters corresponding to 64 bits. - */ - spanId: string; - /** - * Only true if the SpanContext was propagated from a remote parent. - */ - isRemote?: boolean; - /** - * Trace flags to propagate. - * - * It is represented as 1 byte (bitmap). Bit to represent whether trace is - * sampled or not. When set, the least significant bit documents that the - * caller may have recorded trace data. A caller who does not record trace - * data out-of-band leaves this flag unset. - * - * see {@link TraceFlags} for valid flag values. - */ - traceFlags: number; - /** - * Tracing-system-specific info to propagate. - * - * The tracestate field value is a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * More Info: https://www.w3.org/TR/trace-context/#tracestate-field - * - * Examples: - * Single tracing system (generic format): - * tracestate: rojo=00f067aa0ba902b7 - * Multiple tracing systems (with different formatting): - * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE - */ - traceState?: TraceState; -} - -declare enum SpanKind { - /** Default value. Indicates that the span is used internally. */ - INTERNAL = 0, - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SERVER = 1, - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - CLIENT = 2, - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - PRODUCER = 3, - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - CONSUMER = 4 -} - -/** - * Options needed for span creation - */ -declare interface SpanOptions { - /** - * The SpanKind of a span - * @default {@link SpanKind.INTERNAL} - */ - kind?: SpanKind; - /** A span's attributes */ - attributes?: SpanAttributes; - /** {@link Link}s span to other spans */ - links?: Link[]; - /** A manually specified start time for the created `Span` object. */ - startTime?: TimeInput; - /** The new span should be a root span. (Ignore parent from context). */ - root?: boolean; -} - -declare interface SpanStatus { - /** The status code of this message. */ - code: SpanStatusCode; - /** A developer-facing error message. */ - message?: string; -} - -/** - * An enumeration of status codes. - */ -declare enum SpanStatusCode { - /** - * The default status. - */ - UNSET = 0, - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - OK = 1, - /** - * The operation contains an error. - */ - ERROR = 2 -} - -/** - * A SQL instance can be nested within each other to build SQL strings. - */ -export declare class Sql { - readonly values: Value[]; - readonly strings: string[]; - constructor(rawStrings: readonly string[], rawValues: readonly RawValue[]); - get sql(): string; - get statement(): string; - get text(): string; - inspect(): { - sql: string; - statement: string; - text: string; - values: unknown[]; - }; -} - -/** - * Create a SQL object from a template string. - */ -export declare function sqltag(strings: readonly string[], ...values: readonly RawValue[]): Sql; - -/** - * Defines TimeInput. - * - * hrtime, epoch milliseconds, performance.now() or Date - */ -declare type TimeInput = HrTime | number | Date; - -export declare type ToTuple = T extends any[] ? T : [T]; - -declare interface TraceState { - /** - * Create a new TraceState which inherits from this TraceState and has the - * given key set. - * The new entry will always be added in the front of the list of states. - * - * @param key key of the TraceState entry. - * @param value value of the TraceState entry. - */ - set(key: string, value: string): TraceState; - /** - * Return a new TraceState which inherits from this TraceState but does not - * contain the given key. - * - * @param key the key for the TraceState entry to be removed. - */ - unset(key: string): TraceState; - /** - * Returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - * - * @param key with which the specified value is to be associated. - * @returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - */ - get(key: string): string | undefined; - /** - * Serializes the TraceState to a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * - * @returns the serialized string. - */ - serialize(): string; -} - -declare interface TracingHelper { - isEnabled(): boolean; - getTraceParent(context?: Context): string; - createEngineSpan(engineSpanEvent: EngineSpanEvent): void; - getActiveContext(): Context | undefined; - runInChildSpan(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback): R; -} - -declare interface Transaction extends Queryable { - /** - * Transaction options. - */ - readonly options: TransactionOptions; - /** - * Commit the transaction. - */ - commit(): Promise>; - /** - * Rolls back the transaction. - */ - rollback(): Promise>; -} - -declare namespace Transaction_2 { - export { - IsolationLevel, - Options, - InteractiveTransactionInfo, - TransactionHeaders - } -} - -declare type TransactionHeaders = { - traceparent?: string; -}; - -declare type TransactionOptions = { - usePhantomQuery: boolean; -}; - -declare type TransactionOptions_2 = { - kind: 'itx'; - options: InteractiveTransactionOptions; -} | { - kind: 'batch'; - options: BatchTransactionOptions; -}; - -export declare type TrueKeys = { - [K in keyof T]: T[K] extends true ? K : never; -}[keyof T]; - -export declare type TypeMapCbDef = Fn<{ - extArgs: InternalArgs; -}, TypeMapDef>; - -/** Shared */ -export declare type TypeMapDef = Record; - -declare namespace Types { - export { - Result_3 as Result, - Extensions_2 as Extensions, - Utils, - Public_2 as Public, - OperationPayload as Payload - } -} -export { Types } - -declare type UnknownErrorParams = { - clientVersion: string; - batchRequestIdx?: number; -}; - -declare type Unpacker = (data: any) => any; - -export declare type UnwrapPayload

= {} extends P ? unknown : { - [K in keyof P]: P[K] extends { - scalars: infer S; - composites: infer C; - }[] ? Array> : P[K] extends { - scalars: infer S; - composites: infer C; - } | null ? S & UnwrapPayload | Select : never; -}; - -export declare type UnwrapPromise

= P extends Promise ? R : P; - -export declare type UnwrapTuple = { - [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise ? X : UnwrapPromise : UnwrapPromise; -}; - -/** - * Input that flows from the user into the Client. - */ -declare type UserArgs_2 = any; - -declare namespace Utils { - export { - EmptyToUnknown, - NeverToUnknown, - PatchFlat, - Omit_2 as Omit, - Pick_2 as Pick, - ComputeDeep, - Compute, - OptionalFlat, - ReadonlyDeep, - Narrowable, - Narrow, - Exact, - Cast, - JsonObject, - JsonArray, - JsonValue, - Record_2 as Record, - UnwrapPromise, - UnwrapTuple, - Path, - Fn, - Call, - RequiredKeys, - OptionalKeys, - Optional, - Return, - ToTuple, - RenameAndNestPayloadKeys, - PayloadToResult, - Select, - Equals, - Or, - JsPromise - } -} - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -/** - * Values supported by SQL engine. - */ -export declare type Value = unknown; - -export declare function warnEnvConflicts(envPaths: any): void; - -export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void; - -declare type WasmLoadingConfig = { - /** - * WASM-bindgen runtime for corresponding module - */ - getRuntime: () => { - __wbg_set_wasm(exports: unknown): any; - QueryEngine: QueryEngineConstructor; - }; - /** - * Loads the raw wasm module for the wasm query engine. This configuration is - * generated specifically for each type of client, eg. Node.js client and Edge - * clients will have different implementations. - * @remarks this is a callback on purpose, we only load the wasm if needed. - * @remarks only used by LibraryEngine.ts - */ - getQueryEngineWasmModule: () => Promise; -}; - -export { } diff --git a/integration-tests/tests/prisma/mysql/client/runtime/library.js b/integration-tests/tests/prisma/mysql/client/runtime/library.js deleted file mode 100644 index 016f60e77..000000000 --- a/integration-tests/tests/prisma/mysql/client/runtime/library.js +++ /dev/null @@ -1,140 +0,0 @@ -"use strict";var Ml=Object.create;var Ct=Object.defineProperty;var $l=Object.getOwnPropertyDescriptor;var ql=Object.getOwnPropertyNames;var jl=Object.getPrototypeOf,Vl=Object.prototype.hasOwnProperty;var Z=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Fr=(e,r)=>{for(var t in r)Ct(e,t,{get:r[t],enumerable:!0})},no=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ql(r))!Vl.call(e,i)&&i!==t&&Ct(e,i,{get:()=>r[i],enumerable:!(n=$l(r,i))||n.enumerable});return e};var k=(e,r,t)=>(t=e!=null?Ml(jl(e)):{},no(r||!e||!e.__esModule?Ct(t,"default",{value:e,enumerable:!0}):t,e)),Bl=e=>no(Ct({},"__esModule",{value:!0}),e);var Ao=Z((Bd,Un)=>{"use strict";var v=Un.exports;Un.exports.default=v;var D="\x1B[",jr="\x1B]",mr="\x07",Ft=";",Ro=process.env.TERM_PROGRAM==="Apple_Terminal";v.cursorTo=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof r!="number"?D+(e+1)+"G":D+(r+1)+";"+(e+1)+"H"};v.cursorMove=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let t="";return e<0?t+=D+-e+"D":e>0&&(t+=D+e+"C"),r<0?t+=D+-r+"A":r>0&&(t+=D+r+"B"),t};v.cursorUp=(e=1)=>D+e+"A";v.cursorDown=(e=1)=>D+e+"B";v.cursorForward=(e=1)=>D+e+"C";v.cursorBackward=(e=1)=>D+e+"D";v.cursorLeft=D+"G";v.cursorSavePosition=Ro?"\x1B7":D+"s";v.cursorRestorePosition=Ro?"\x1B8":D+"u";v.cursorGetPosition=D+"6n";v.cursorNextLine=D+"E";v.cursorPrevLine=D+"F";v.cursorHide=D+"?25l";v.cursorShow=D+"?25h";v.eraseLines=e=>{let r="";for(let t=0;t[jr,"8",Ft,Ft,r,mr,e,jr,"8",Ft,Ft,mr].join("");v.image=(e,r={})=>{let t=`${jr}1337;File=inline=1`;return r.width&&(t+=`;width=${r.width}`),r.height&&(t+=`;height=${r.height}`),r.preserveAspectRatio===!1&&(t+=";preserveAspectRatio=0"),t+":"+e.toString("base64")+mr};v.iTerm={setCwd:(e=process.cwd())=>`${jr}50;CurrentDir=${e}${mr}`,annotation:(e,r={})=>{let t=`${jr}1337;`,n=typeof r.x<"u",i=typeof r.y<"u";if((n||i)&&!(n&&i&&typeof r.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),t+=r.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",r.length>0?t+=(n?[e,r.length,r.x,r.y]:[r.length,e]).join("|"):t+=e,t+mr}}});var Qn=Z((Ud,Io)=>{"use strict";Io.exports=(e,r=process.argv)=>{let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),i=r.indexOf("--");return n!==-1&&(i===-1||n{"use strict";var Ru=require("os"),_o=require("tty"),pe=Qn(),{env:G}=process,Ve;pe("no-color")||pe("no-colors")||pe("color=false")||pe("color=never")?Ve=0:(pe("color")||pe("colors")||pe("color=true")||pe("color=always"))&&(Ve=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?Ve=1:G.FORCE_COLOR==="false"?Ve=0:Ve=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function Gn(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Jn(e,r){if(Ve===0)return 0;if(pe("color=16m")||pe("color=full")||pe("color=truecolor"))return 3;if(pe("color=256"))return 2;if(e&&!r&&Ve===void 0)return 0;let t=Ve||0;if(G.TERM==="dumb")return t;if(process.platform==="win32"){let n=Ru.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in G)||G.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let n=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:t}function Au(e){let r=Jn(e,e&&e.isTTY);return Gn(r)}ko.exports={supportsColor:Au,stdout:Gn(Jn(!0,_o.isatty(1))),stderr:Gn(Jn(!0,_o.isatty(2)))}});var Fo=Z((Gd,Lo)=>{"use strict";var Iu=Do(),dr=Qn();function Oo(e){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let r=(e||"").split(".").map(t=>parseInt(t,10));return{major:r[0],minor:r[1],patch:r[2]}}function Hn(e){let{env:r}=process;if("FORCE_HYPERLINK"in r)return!(r.FORCE_HYPERLINK.length>0&&parseInt(r.FORCE_HYPERLINK,10)===0);if(dr("no-hyperlink")||dr("no-hyperlinks")||dr("hyperlink=false")||dr("hyperlink=never"))return!1;if(dr("hyperlink=true")||dr("hyperlink=always")||"NETLIFY"in r)return!0;if(!Iu.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in r||"TEAMCITY_VERSION"in r)return!1;if("TERM_PROGRAM"in r){let t=Oo(r.TERM_PROGRAM_VERSION);switch(r.TERM_PROGRAM){case"iTerm.app":return t.major===3?t.minor>=1:t.major>3;case"WezTerm":return t.major>=20200620;case"vscode":return t.major>1||t.major===1&&t.minor>=72}}if("VTE_VERSION"in r){if(r.VTE_VERSION==="0.50.0")return!1;let t=Oo(r.VTE_VERSION);return t.major>0||t.minor>=50}return!1}Lo.exports={supportsHyperlink:Hn,stdout:Hn(process.stdout),stderr:Hn(process.stderr)}});var Mo=Z((Jd,Vr)=>{"use strict";var _u=Ao(),Wn=Fo(),No=(e,r,{target:t="stdout",...n}={})=>Wn[t]?_u.link(e,r):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,r):`${e} (\u200B${r}\u200B)`;Vr.exports=(e,r,t={})=>No(e,r,t);Vr.exports.stderr=(e,r,t={})=>No(e,r,{target:"stderr",...t});Vr.exports.isSupported=Wn.stdout;Vr.exports.stderr.isSupported=Wn.stderr});var Yn=Z((tf,ku)=>{ku.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var zn=Z(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.enginesVersion=void 0;Nt.enginesVersion=Yn().prisma.enginesVersion});var Vo=Z((Pf,Lu)=>{Lu.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",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","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var Uo=Z((vf,$t)=>{"use strict";var Fu=require("fs"),Bo=require("path"),Nu=require("os"),Mu=Vo(),$u=Mu.version,qu=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ju(e){let r={},t=e.toString();t=t.replace(/\r\n?/mg,` -`);let n;for(;(n=qu.exec(t))!=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,` -`),o=o.replace(/\\r/g,"\r")),r[i]=o}return r}function ri(e){console.log(`[dotenv@${$u}][DEBUG] ${e}`)}function Vu(e){return e[0]==="~"?Bo.join(Nu.homedir(),e.slice(1)):e}function Bu(e){let r=Bo.resolve(process.cwd(),".env"),t="utf8",n=!!(e&&e.debug),i=!!(e&&e.override);e&&(e.path!=null&&(r=Vu(e.path)),e.encoding!=null&&(t=e.encoding));try{let o=Mt.parse(Fu.readFileSync(r,{encoding:t}));return Object.keys(o).forEach(function(s){Object.prototype.hasOwnProperty.call(process.env,s)?(i===!0&&(process.env[s]=o[s]),n&&ri(i===!0?`"${s}" is already defined in \`process.env\` and WAS overwritten`:`"${s}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[s]=o[s]}),{parsed:o}}catch(o){return n&&ri(`Failed to load ${r} ${o.message}`),{error:o}}}var Mt={config:Bu,parse:ju};$t.exports.config=Mt.config;$t.exports.parse=Mt.parse;$t.exports=Mt});var Ko=Z((_f,Wo)=>{"use strict";Wo.exports=e=>{let r=e.match(/^[ \t]*(?=\S)/gm);return r?r.reduce((t,n)=>Math.min(t,n.length),1/0):0}});var zo=Z((kf,Yo)=>{"use strict";var Ju=Ko();Yo.exports=e=>{let r=Ju(e);if(r===0)return e;let t=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(t,"")}});var oi=Z((Mf,Zo)=>{"use strict";Zo.exports=(e,r=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof r!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``);if(typeof t.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(r===0)return e;let n=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,t.indent.repeat(r))}});var ts=Z((jf,rs)=>{"use strict";rs.exports=({onlyFirst:e=!1}={})=>{let r=["[\\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(r,e?void 0:"g")}});var ui=Z((Vf,ns)=>{"use strict";var ec=ts();ns.exports=e=>typeof e=="string"?e.replace(ec(),""):e});var is=Z((Qf,Vt)=>{"use strict";Vt.exports=(e={})=>{let r;if(e.repoUrl)r=e.repoUrl;else if(e.user&&e.repo)r=`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 t=new URL(`${r}/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(",")}t.searchParams.set(i,o)}}return t.toString()};Vt.exports.default=Vt.exports});var Wi=Z((DP,Ba)=>{"use strict";Ba.exports=function(){function e(r,t,n,i,o){return rn?n+1:r+1:i===o?t:t+1}return function(r,t){if(r===t)return 0;if(r.length>t.length){var n=r;r=t,t=n}for(var i=r.length,o=t.length;i>0&&r.charCodeAt(i-1)===t.charCodeAt(o-1);)i--,o--;for(var s=0;sFn,Decimal:()=>Te,Extensions:()=>kn,MetricsClient:()=>hr,NotFoundError:()=>Oe,PrismaClientInitializationError:()=>R,PrismaClientKnownRequestError:()=>V,PrismaClientRustPanicError:()=>le,PrismaClientUnknownRequestError:()=>B,PrismaClientValidationError:()=>W,Public:()=>Dn,Sql:()=>ie,defineDmmfProperty:()=>ss,empty:()=>ls,getPrismaClient:()=>Ll,getRuntime:()=>fn,join:()=>as,makeStrictEnum:()=>Fl,objectEnumValues:()=>Qt,raw:()=>Ei,sqltag:()=>bi,warnEnvConflicts:()=>Nl,warnOnce:()=>Hr});module.exports=Bl(fd);var kn={};Fr(kn,{defineExtension:()=>io,getExtensionContext:()=>oo});function io(e){return typeof e=="function"?e:r=>r.$extends(e)}function oo(e){return e}var Dn={};Fr(Dn,{validator:()=>so});function so(...e){return r=>r}var St={};Fr(St,{$:()=>po,bgBlack:()=>Zl,bgBlue:()=>tu,bgCyan:()=>iu,bgGreen:()=>eu,bgMagenta:()=>nu,bgRed:()=>Xl,bgWhite:()=>ou,bgYellow:()=>ru,black:()=>Wl,blue:()=>ze,bold:()=>H,cyan:()=>_e,dim:()=>Ie,gray:()=>Nr,green:()=>Me,grey:()=>zl,hidden:()=>Jl,inverse:()=>Gl,italic:()=>Ql,magenta:()=>Kl,red:()=>ue,reset:()=>Ul,strikethrough:()=>Hl,underline:()=>X,white:()=>Yl,yellow:()=>fe});var On,ao,lo,uo,co=!0;typeof process<"u"&&({FORCE_COLOR:On,NODE_DISABLE_COLORS:ao,NO_COLOR:lo,TERM:uo}=process.env||{},co=process.stdout&&process.stdout.isTTY);var po={enabled:!ao&&lo==null&&uo!=="dumb"&&(On!=null&&On!=="0"||co)};function N(e,r){let t=new RegExp(`\\x1b\\[${r}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${r}m`;return function(o){return!po.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(t,i+n):o)+i}}var Ul=N(0,0),H=N(1,22),Ie=N(2,22),Ql=N(3,23),X=N(4,24),Gl=N(7,27),Jl=N(8,28),Hl=N(9,29),Wl=N(30,39),ue=N(31,39),Me=N(32,39),fe=N(33,39),ze=N(34,39),Kl=N(35,39),_e=N(36,39),Yl=N(37,39),Nr=N(90,39),zl=N(90,39),Zl=N(40,49),Xl=N(41,49),eu=N(42,49),ru=N(43,49),tu=N(44,49),nu=N(45,49),iu=N(46,49),ou=N(47,49);var su=100,mo=["green","yellow","blue","magenta","cyan","red"],Mr=[],fo=Date.now(),au=0,Ln=typeof process<"u"?process.env:{};globalThis.DEBUG??(globalThis.DEBUG=Ln.DEBUG??"");globalThis.DEBUG_COLORS??(globalThis.DEBUG_COLORS=Ln.DEBUG_COLORS?Ln.DEBUG_COLORS==="true":!0);var $r={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let r=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),t=r.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=r.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return t&&!n},log:(...e)=>{let[r,t,...n]=e,i;typeof require=="function"&&typeof process<"u"&&typeof process.stderr<"u"&&typeof process.stderr.write=="function"?i=(...o)=>{try{let s=require("util");process.stderr.write(s.format(...o)+` -`)}catch{i=console.warn??console.log}}:i=console.warn??console.log,i(`${r} ${t}`,...n)},formatters:{}};function lu(e){let r={color:mo[au++%mo.length],enabled:$r.enabled(e),namespace:e,log:$r.log,extend:()=>{}},t=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=r;if(n.length!==0&&Mr.push([o,...n]),Mr.length>su&&Mr.shift(),$r.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:uu(c)),u=`+${Date.now()-fo}ms`;fo=Date.now(),globalThis.DEBUG_COLORS?a(St[s](H(o)),...l,St[s](u)):a(o,...l,u)}};return new Proxy(t,{get:(n,i)=>r[i],set:(n,i,o)=>r[i]=o})}var Fn=new Proxy(lu,{get:(e,r)=>$r[r],set:(e,r,t)=>$r[r]=t});function uu(e,r=2){let t=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(t.has(i))return"[Circular *]";t.add(i)}else if(typeof i=="bigint")return i.toString();return i},r)}function go(e=7500){let r=Mr.map(([t,...n])=>`${t} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(` -`);return r.length!!(e&&typeof e=="object"),It=e=>e&&!!e[ke],we=(e,r,t)=>{if(It(e)){let n=e[ke](),{matched:i,selections:o}=n.match(r);return i&&o&&Object.keys(o).forEach(s=>t(s,o[s])),i}if($n(e)){if(!$n(r))return!1;if(Array.isArray(e)){if(!Array.isArray(r))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];It(a)&&a[cu]?o.push(a):o.length?i.push(a):n.push(a)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(r.lengthwe(u,s[c],t))&&i.every((u,c)=>we(u,a[c],t))&&(o.length===0||we(o[0],l,t))}return e.length===r.length&&e.every((s,a)=>we(s,r[a],t))}return Object.keys(e).every(n=>{let i=e[n];return(n in r||It(o=i)&&o[ke]().matcherType==="optional")&&we(i,r[n],t);var o})}return Object.is(r,e)},je=e=>{var r,t,n;return $n(e)?It(e)?(r=(t=(n=e[ke]()).getSelectionKeys)==null?void 0:t.call(n))!=null?r:[]:Array.isArray(e)?qr(e,je):qr(Object.values(e),je):[]},qr=(e,r)=>e.reduce((t,n)=>t.concat(r(n)),[]);function ce(e){return Object.assign(e,{optional:()=>pu(e),and:r=>j(e,r),or:r=>mu(e,r),select:r=>r===void 0?Eo(e):Eo(r,e)})}function pu(e){return ce({[ke]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return r===void 0?(je(e).forEach(i=>n(i,void 0)),{matched:!0,selections:t}):{matched:we(e,r,n),selections:t}},getSelectionKeys:()=>je(e),matcherType:"optional"})})}function j(...e){return ce({[ke]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return{matched:e.every(i=>we(i,r,n)),selections:t}},getSelectionKeys:()=>qr(e,je),matcherType:"and"})})}function mu(...e){return ce({[ke]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return qr(e,je).forEach(i=>n(i,void 0)),{matched:e.some(i=>we(i,r,n)),selections:t}},getSelectionKeys:()=>qr(e,je),matcherType:"or"})})}function _(e){return{[ke]:()=>({match:r=>({matched:!!e(r)})})}}function Eo(...e){let r=typeof e[0]=="string"?e[0]:void 0,t=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return ce({[ke]:()=>({match:n=>{let i={[r??_t]:n};return{matched:t===void 0||we(t,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[r??_t].concat(t===void 0?[]:je(t))})})}function Ee(e){return typeof e=="number"}function Ze(e){return typeof e=="string"}function $e(e){return typeof e=="bigint"}var Rd=ce(_(function(e){return!0}));var Xe=e=>Object.assign(ce(e),{startsWith:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&n.startsWith(t)))));var t},endsWith:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&n.endsWith(t)))));var t},minLength:r=>Xe(j(e,(t=>_(n=>Ze(n)&&n.length>=t))(r))),maxLength:r=>Xe(j(e,(t=>_(n=>Ze(n)&&n.length<=t))(r))),includes:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&n.includes(t)))));var t},regex:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&!!n.match(t)))));var t}}),Ad=Xe(_(Ze)),be=e=>Object.assign(ce(e),{between:(r,t)=>be(j(e,((n,i)=>_(o=>Ee(o)&&n<=o&&i>=o))(r,t))),lt:r=>be(j(e,(t=>_(n=>Ee(n)&&nbe(j(e,(t=>_(n=>Ee(n)&&n>t))(r))),lte:r=>be(j(e,(t=>_(n=>Ee(n)&&n<=t))(r))),gte:r=>be(j(e,(t=>_(n=>Ee(n)&&n>=t))(r))),int:()=>be(j(e,_(r=>Ee(r)&&Number.isInteger(r)))),finite:()=>be(j(e,_(r=>Ee(r)&&Number.isFinite(r)))),positive:()=>be(j(e,_(r=>Ee(r)&&r>0))),negative:()=>be(j(e,_(r=>Ee(r)&&r<0)))}),Id=be(_(Ee)),qe=e=>Object.assign(ce(e),{between:(r,t)=>qe(j(e,((n,i)=>_(o=>$e(o)&&n<=o&&i>=o))(r,t))),lt:r=>qe(j(e,(t=>_(n=>$e(n)&&nqe(j(e,(t=>_(n=>$e(n)&&n>t))(r))),lte:r=>qe(j(e,(t=>_(n=>$e(n)&&n<=t))(r))),gte:r=>qe(j(e,(t=>_(n=>$e(n)&&n>=t))(r))),positive:()=>qe(j(e,_(r=>$e(r)&&r>0))),negative:()=>qe(j(e,_(r=>$e(r)&&r<0)))}),_d=qe(_($e)),kd=ce(_(function(e){return typeof e=="boolean"})),Dd=ce(_(function(e){return typeof e=="symbol"})),Od=ce(_(function(e){return e==null})),Ld=ce(_(function(e){return e!=null}));var qn={matched:!1,value:void 0};function pr(e){return new jn(e,qn)}var jn=class e{constructor(r,t){this.input=void 0,this.state=void 0,this.input=r,this.state=t}with(...r){if(this.state.matched)return this;let t=r[r.length-1],n=[r[0]],i;r.length===3&&typeof r[1]=="function"?i=r[1]:r.length>2&&n.push(...r.slice(1,r.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>we(u,this.input,a))||i&&!i(this.input)?qn:{matched:!0,value:t(o?_t in s?s[_t]:s:this.input,this.input)};return new e(this.input,l)}when(r,t){if(this.state.matched)return this;let n=!!r(this.input);return new e(this.input,n?{matched:!0,value:t(this.input,this.input)}:qn)}otherwise(r){return this.state.matched?this.state.value:r(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let r;try{r=JSON.stringify(this.input)}catch{r=this.input}throw new Error(`Pattern matching error: no pattern matches value ${r}`)}run(){return this.exhaustive()}returnType(){return this}};var Po=require("util");var du={warn:fe("prisma:warn")},fu={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function kt(e,...r){fu.warn()&&console.warn(`${du.warn} ${e}`,...r)}var gu=(0,Po.promisify)(xo.default.exec),re=L("prisma:get-platform"),hu=["1.0.x","1.1.x","3.0.x"];async function vo(){let e=Ot.default.platform(),r=process.arch;if(e==="freebsd"){let s=await Lt("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:r}}}if(e!=="linux")return{platform:e,arch:r};let t=await Eu(),n=await Su(),i=wu({arch:r,archFromUname:n,familyDistro:t.familyDistro}),{libssl:o}=await xu(i);return{platform:"linux",libssl:o,arch:r,archFromUname:n,...t}}function yu(e){let r=/^ID="?([^"\n]*)"?$/im,t=/^ID_LIKE="?([^"\n]*)"?$/im,n=r.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=t.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=pr({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return re(`Found distro info: -${JSON.stringify(a,null,2)}`),a}async function Eu(){let e="/etc/os-release";try{let r=await Vn.default.readFile(e,{encoding:"utf-8"});return yu(r)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function bu(e){let r=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(r){let t=`${r[1]}.x`;return To(t)}}function bo(e){let r=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(r){let t=`${r[1]}${r[2]??".0"}.x`;return To(t)}}function To(e){let r=(()=>{if(So(e))return e;let t=e.split(".");return t[1]="0",t.join(".")})();if(hu.includes(r))return r}function wu(e){return pr(e).with({familyDistro:"musl"},()=>(re('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:r})=>(re('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${r}-linux-gnu`,`/lib/${r}-linux-gnu`])).with({familyDistro:"rhel"},()=>(re('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:r,arch:t,archFromUname:n})=>(re(`Don't know any platform-specific paths for "${r}" on ${t} (${n})`),[]))}async function xu(e){let r='grep -v "libssl.so.0"',t=await wo(e);if(t){re(`Found libssl.so file using platform-specific paths: ${t}`);let o=bo(t);if(re(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}re('Falling back to "ldconfig" and other generic paths');let n=await Lt(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${r}`);if(n||(n=await wo(["/lib64","/usr/lib64","/lib"])),n){re(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=bo(n);if(re(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Lt("openssl version -v");if(i){re(`Found openssl binary with version: ${i}`);let o=bu(i);if(re(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return re("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function wo(e){for(let r of e){let t=await Pu(r);if(t)return t}}async function Pu(e){try{return(await Vn.default.readdir(e)).find(t=>t.startsWith("libssl.so.")&&!t.startsWith("libssl.so.0"))}catch(r){if(r.code==="ENOENT")return;throw r}}async function er(){let{binaryTarget:e}=await Co();return e}function vu(e){return e.binaryTarget!==void 0}async function Bn(){let{memoized:e,...r}=await Co();return r}var Dt={};async function Co(){if(vu(Dt))return Promise.resolve({...Dt,memoized:!0});let e=await vo(),r=Tu(e);return Dt={...e,binaryTarget:r},{...Dt,memoized:!1}}function Tu(e){let{platform:r,arch:t,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;r==="linux"&&!["x64","arm64"].includes(t)&&kt(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${t}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${n}".`);let l="1.1.x";if(r==="linux"&&i===void 0){let c=pr({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");kt(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}". -${c}`)}let u="debian";if(r==="linux"&&o===void 0&&re(`Distro is "${a}". Falling back to Prisma engines built for "${u}".`),r==="darwin"&&t==="arm64")return"darwin-arm64";if(r==="darwin")return"darwin";if(r==="win32")return"windows";if(r==="freebsd")return o;if(r==="openbsd")return"openbsd";if(r==="netbsd")return"netbsd";if(r==="linux"&&o==="nixos")return"linux-nixos";if(r==="linux"&&t==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(r==="linux"&&t==="arm")return`linux-arm-openssl-${i||l}`;if(r==="linux"&&o==="musl"){let c="linux-musl";return!i||So(i)?c:`${c}-openssl-${i}`}return r==="linux"&&o&&i?`${o}-openssl-${i}`:(r!=="linux"&&kt(`Prisma detected unknown OS "${r}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function Cu(e){try{return await e()}catch{return}}function Lt(e){return Cu(async()=>{let r=await gu(e);return re(`Command "${e}" successfully returned "${r.stdout}"`),r.stdout})}async function Su(){return typeof Ot.default.machine=="function"?Ot.default.machine():(await Lt("uname -m"))?.trim()}function So(e){return e.startsWith("1.")}var $o=k(Mo());function Kn(e){return(0,$o.default)(e,e,{fallback:X})}var Du=k(zn());var M=k(require("path")),Ou=k(zn()),df=L("prisma:engines");function qo(){return M.default.join(__dirname,"../")}var ff="libquery-engine";M.default.join(__dirname,"../query-engine-darwin");M.default.join(__dirname,"../query-engine-darwin-arm64");M.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");M.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");M.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");M.default.join(__dirname,"../query-engine-linux-static-x64");M.default.join(__dirname,"../query-engine-linux-static-arm64");M.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");M.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");M.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");M.default.join(__dirname,"../libquery_engine-darwin.dylib.node");M.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-musl.so.node");M.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");M.default.join(__dirname,"../query_engine-windows.dll.node");var Zn=k(require("fs")),jo=L("chmodPlusX");function Xn(e){if(process.platform==="win32")return;let r=Zn.default.statSync(e),t=r.mode|64|8|1;if(r.mode===t){jo(`Execution permissions of ${e} are fine`);return}let n=t.toString(8).slice(-3);jo(`Have to call chmodPlusX on ${e}`),Zn.default.chmodSync(e,n)}function ei(e){let r=e.e,t=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=r.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${Kn("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${Ie(e.id)}\`).`,s=pr({message:r.message,code:r.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${t("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${t("libgcc_s")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libssl"),()=>{let a=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${t("libssl")}. Please install ${a} and try again.`}).when(({message:a})=>a.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${i}`).when(({message:a})=>e.platformInfo.platform==="linux"&&a.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${i}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${i}`);return`${o} -${s} - -Details: ${r.message}`}var ni=k(Uo()),qt=k(require("fs"));var fr=k(require("path"));function Qo(e){let r=e.ignoreProcessEnv?{}:process.env,t=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(r,p)?r[p]:e.parsed[p]||"",u=t(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(r,n)?r[n]:e.parsed[n];e.parsed[n]=t(i)}for(let n in e.parsed)r[n]=e.parsed[n];return e}var ti=L("prisma:tryLoadEnv");function Br({rootEnvPath:e,schemaEnvPath:r},t={conflictCheck:"none"}){let n=Go(e);t.conflictCheck!=="none"&&Uu(n,r,t.conflictCheck);let i=null;return Jo(n?.path,r)||(i=Go(r)),!n&&!i&&ti("No Environment variables loaded"),i?.dotenvResult.error?console.error(ue(H("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(` -`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function Uu(e,r,t){let n=e?.dotenvResult.parsed,i=!Jo(e?.path,r);if(n&&r&&i&&qt.default.existsSync(r)){let o=ni.default.parse(qt.default.readFileSync(r)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=fr.default.relative(process.cwd(),e.path),l=fr.default.relative(process.cwd(),r);if(t==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${X(a)} and ${X(l)} -Conflicting env vars: -${s.map(c=>` ${H(c)}`).join(` -`)} - -We suggest to move the contents of ${X(l)} to ${X(a)} to consolidate your env vars. -`;throw new Error(u)}else if(t==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>H(c)).join(", ")} in ${X(a)} and ${X(l)} -Env vars from ${X(l)} overwrite the ones from ${X(a)} - `;console.warn(`${fe("warn(prisma)")} ${u}`)}}}}function Go(e){if(Qu(e)){ti(`Environment variables loaded from ${e}`);let r=ni.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Qo(r),message:Ie(`Environment variables loaded from ${fr.default.relative(process.cwd(),e)}`),path:e}}else ti(`Environment variables not found at ${e}`);return null}function Jo(e,r){return e&&r&&fr.default.resolve(e)===fr.default.resolve(r)}function Qu(e){return!!(e&&qt.default.existsSync(e))}var Ho="library";function Ur(e){let r=Gu();return r||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Ho)}function Gu(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}var De;(r=>{let e;(b=>(b.findUnique="findUnique",b.findUniqueOrThrow="findUniqueOrThrow",b.findFirst="findFirst",b.findFirstOrThrow="findFirstOrThrow",b.findMany="findMany",b.create="create",b.createMany="createMany",b.createManyAndReturn="createManyAndReturn",b.update="update",b.updateMany="updateMany",b.upsert="upsert",b.delete="delete",b.deleteMany="deleteMany",b.groupBy="groupBy",b.count="count",b.aggregate="aggregate",b.findRaw="findRaw",b.aggregateRaw="aggregateRaw"))(e=r.ModelAction||(r.ModelAction={}))})(De||(De={}));var Qr=k(require("path"));function ii(e){return Qr.default.sep===Qr.default.posix.sep?e:e.split(Qr.default.sep).join(Qr.default.posix.sep)}var Xo=k(oi());function ai(e){return String(new si(e))}var si=class{constructor(r){this.config=r}toString(){let{config:r}=this,t=r.provider.fromEnvVar?`env("${r.provider.fromEnvVar}")`:r.provider.value,n=JSON.parse(JSON.stringify({provider:t,binaryTargets:Hu(r.binaryTargets)}));return`generator ${r.name} { -${(0,Xo.default)(Wu(n),2)} -}`}};function Hu(e){let r;if(e.length>0){let t=e.find(n=>n.fromEnvVar!==null);t?r=`env("${t.fromEnvVar}")`:r=e.map(n=>n.native?"native":n.value)}else r=void 0;return r}function Wu(e){let r=Object.keys(e).reduce((t,n)=>Math.max(t,n.length),0);return Object.entries(e).map(([t,n])=>`${t.padEnd(r)} = ${Ku(n)}`).join(` -`)}function Ku(e){return JSON.parse(JSON.stringify(e,(r,t)=>Array.isArray(t)?`[${t.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(t)))}var Jr={};Fr(Jr,{error:()=>Zu,info:()=>zu,log:()=>Yu,query:()=>Xu,should:()=>es,tags:()=>Gr,warn:()=>li});var Gr={error:ue("prisma:error"),warn:fe("prisma:warn"),info:_e("prisma:info"),query:ze("prisma:query")},es={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Yu(...e){console.log(...e)}function li(e,...r){es.warn()&&console.warn(`${Gr.warn} ${e}`,...r)}function zu(e,...r){console.info(`${Gr.info} ${e}`,...r)}function Zu(e,...r){console.error(`${Gr.error} ${e}`,...r)}function Xu(e,...r){console.log(`${Gr.query} ${e}`,...r)}function jt(e,r){if(!e)throw new Error(`${r}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function rr(e,r){throw new Error(r)}function ci(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var pi=(e,r)=>e.reduce((t,n)=>(t[r(n)]=n,t),{});function gr(e,r){let t={};for(let n of Object.keys(e))t[n]=r(e[n],n);return t}function mi(e,r){if(e.length===0)return;let t=e[0];for(let n=1;n{os.has(e)||(os.add(e),li(r,...t))};var V=class extends Error{constructor(r,{code:t,clientVersion:n,meta:i,batchRequestIdx:o}){super(r),this.name="PrismaClientKnownRequestError",this.code=t,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};w(V,"PrismaClientKnownRequestError");var Oe=class extends V{constructor(r,t){super(r,{code:"P2025",clientVersion:t}),this.name="NotFoundError"}};w(Oe,"NotFoundError");var R=class e extends Error{constructor(r,t,n){super(r),this.name="PrismaClientInitializationError",this.clientVersion=t,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};w(R,"PrismaClientInitializationError");var le=class extends Error{constructor(r,t){super(r),this.name="PrismaClientRustPanicError",this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};w(le,"PrismaClientRustPanicError");var B=class extends Error{constructor(r,{clientVersion:t,batchRequestIdx:n}){super(r),this.name="PrismaClientUnknownRequestError",this.clientVersion=t,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};w(B,"PrismaClientUnknownRequestError");var W=class extends Error{constructor(t,{clientVersion:n}){super(t);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};w(W,"PrismaClientValidationError");var hr=class{constructor(r){this._engine=r}prometheus(r){return this._engine.metrics({format:"prometheus",...r})}json(r){return this._engine.metrics({format:"json",...r})}};function Wr(e){let r;return{get(){return r||(r={value:e()}),r.value}}}function ss(e,r){let t=Wr(()=>rc(r));Object.defineProperty(e,"dmmf",{get:()=>t.get()})}function rc(e){return{datamodel:{models:di(e.models),enums:di(e.enums),types:di(e.types)}}}function di(e){return Object.entries(e).map(([r,t])=>({name:r,...t}))}var Ut=Symbol(),fi=new WeakMap,Le=class{constructor(r){r===Ut?fi.set(this,`Prisma.${this._getName()}`):fi.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return fi.get(this)}},Kr=class extends Le{_getNamespace(){return"NullTypes"}},Yr=class extends Kr{};gi(Yr,"DbNull");var zr=class extends Kr{};gi(zr,"JsonNull");var Zr=class extends Kr{};gi(Zr,"AnyNull");var Qt={classes:{DbNull:Yr,JsonNull:zr,AnyNull:Zr},instances:{DbNull:new Yr(Ut),JsonNull:new zr(Ut),AnyNull:new Zr(Ut)}};function gi(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}function Xr(e){return{ok:!1,error:e,map(){return Xr(e)},flatMap(){return Xr(e)}}}var hi=class{constructor(){this.registeredErrors=[]}consumeError(r){return this.registeredErrors[r]}registerNewError(r){let t=0;for(;this.registeredErrors[t]!==void 0;)t++;return this.registeredErrors[t]={error:r},t}},yi=e=>{let r=new hi,t=tr(r,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:r,queryRaw:tr(r,e.queryRaw.bind(e)),executeRaw:tr(r,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await t(...i)).map(s=>tc(r,s))};return e.getConnectionInfo&&(n.getConnectionInfo=nc(r,e.getConnectionInfo.bind(e))),n},tc=(e,r)=>({adapterName:r.adapterName,provider:r.provider,options:r.options,queryRaw:tr(e,r.queryRaw.bind(r)),executeRaw:tr(e,r.executeRaw.bind(r)),commit:tr(e,r.commit.bind(r)),rollback:tr(e,r.rollback.bind(r))});function tr(e,r){return async(...t)=>{try{return await r(...t)}catch(n){let i=e.registerNewError(n);return Xr({kind:"GenericJs",id:i})}}}function nc(e,r){return(...t)=>{try{return r(...t)}catch(n){let i=e.registerNewError(n);return Xr({kind:"GenericJs",id:i})}}}var _l=k(Yn());var kl=require("async_hooks"),Dl=require("events"),Ol=k(require("fs")),vt=k(require("path"));var ie=class e{constructor(r,t){if(r.length-1!==t.length)throw r.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${r.length} strings to have ${r.length-1} values`);let n=t.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=r[0];let i=0,o=0;for(;ie.getPropertyValue(t))},getPropertyDescriptor(t){return e.getPropertyDescriptor?.(t)}}}var Gt={enumerable:!0,configurable:!0,writable:!0};function Jt(e){let r=new Set(e);return{getOwnPropertyDescriptor:()=>Gt,has:(t,n)=>r.has(n),set:(t,n,i)=>r.add(n)&&Reflect.set(t,n,i),ownKeys:()=>[...r]}}var us=Symbol.for("nodejs.util.inspect.custom");function Pe(e,r){let t=ic(r),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=t.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=t.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=cs(Reflect.ownKeys(o),t),a=cs(Array.from(t.keys()),t);return[...new Set([...s,...a,...n])]},set(o,s,a){return t.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=t.get(s);return l?l.getPropertyDescriptor?{...Gt,...l?.getPropertyDescriptor(s)}:Gt:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[us]=function(){let o={...this};return delete o[us],o},i}function ic(e){let r=new Map;for(let t of e){let n=t.getKeys();for(let i of n)r.set(i,t)}return r}function cs(e,r){return e.filter(t=>r.get(t)?.has?.(t)??!0)}function yr(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Er(e,r){return{batch:e,transaction:r?.kind==="batch"?{isolationLevel:r.options.isolationLevel}:void 0}}var br=class{constructor(r=0,t){this.context=t;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=r}write(r){return typeof r=="string"?this.currentLine+=r:r.write(this),this}writeJoined(r,t){let n=t.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(r){return this.marginSymbol=r,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let r=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+r.slice(1):r}};function ps(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function wr(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Ht(e){return e.toString()!=="Invalid Date"}var xr=9e15,Ge=1e9,wi="0123456789abcdef",Kt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Yt="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-xr,maxE:xr,crypto:!1},gs,Fe,x=!0,Zt="[DecimalError] ",Qe=Zt+"Invalid argument: ",hs=Zt+"Precision limit exceeded",ys=Zt+"crypto unavailable",Es="[object Decimal]",ee=Math.floor,Q=Math.pow,oc=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,sc=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,ac=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,bs=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,he=1e7,E=7,lc=9007199254740991,uc=Kt.length-1,Pi=Yt.length-1,d={toStringTag:Es};d.absoluteValue=d.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};d.ceil=function(){return y(new this.constructor(this),this.e+1,2)};d.clampedTo=d.clamp=function(e,r){var t,n=this,i=n.constructor;if(e=new i(e),r=new i(r),!e.s||!r.s)return new i(NaN);if(e.gt(r))throw Error(Qe+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new i(n)};d.comparedTo=d.cmp=function(e){var r,t,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,r=0,t=na[r]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};d.cosine=d.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+E,n.rounding=1,t=cc(n,Ts(n,t)),n.precision=e,n.rounding=r,y(Fe==2||Fe==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};d.cubeRoot=d.cbrt=function(){var e,r,t,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(x=!1,o=c.s*Q(c.s*c,1/3),!o||Math.abs(o)==1/0?(t=K(c.d),e=c.e,(o=(e-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=Q(t,1/3),e=ee((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new p(t),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=F(u.plus(c).times(a),u.plus(l),s+2,1),K(a.d).slice(0,s)===(t=K(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,e+1,1),r=!n.times(n).times(n).eq(c));break}return x=!0,y(n,e,p.rounding,r)};d.decimalPlaces=d.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-ee(this.e/E))*E,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};d.dividedBy=d.div=function(e){return F(this,new this.constructor(e))};d.dividedToIntegerBy=d.divToInt=function(e){var r=this,t=r.constructor;return y(F(r,new t(e),0,1,1),t.precision,t.rounding)};d.equals=d.eq=function(e){return this.cmp(e)===0};d.floor=function(){return y(new this.constructor(this),this.e+1,3)};d.greaterThan=d.gt=function(e){return this.cmp(e)>0};d.greaterThanOrEqualTo=d.gte=function(e){var r=this.cmp(e);return r==1||r===0};d.hyperbolicCosine=d.cosh=function(){var e,r,t,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;t=s.precision,n=s.rounding,s.precision=t+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),r=(1/en(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),o=Pr(s,1,o.times(r),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return y(o,s.precision=t,s.rounding=n,!0)};d.hyperbolicSine=d.sinh=function(){var e,r,t,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(r=o.precision,t=o.rounding,o.precision=r+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=Pr(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/en(5,e)),i=Pr(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=r,o.rounding=t,y(i,r,t,!0)};d.hyperbolicTangent=d.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,F(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)};d.inverseCosine=d.acos=function(){var e,r=this,t=r.constructor,n=r.abs().cmp(1),i=t.precision,o=t.rounding;return n!==-1?n===0?r.isNeg()?ge(t,i,o):new t(0):new t(NaN):r.isZero()?ge(t,i+4,o).times(.5):(t.precision=i+6,t.rounding=1,r=r.asin(),e=ge(t,i+4,o).times(.5),t.precision=i,t.rounding=o,e.minus(r))};d.inverseHyperbolicCosine=d.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,x=!1,t=t.times(t).minus(1).sqrt().plus(t),x=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)};d.inverseHyperbolicSine=d.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,x=!1,t=t.times(t).plus(1).sqrt().plus(t),x=!0,n.precision=e,n.rounding=r,t.ln())};d.inverseHyperbolicTangent=d.atanh=function(){var e,r,t,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,r=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?y(new o(i),e,r,!0):(o.precision=t=n-i.e,i=F(i.plus(1),new o(1).minus(i),t+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=r,i.times(.5))):new o(NaN)};d.inverseSine=d.asin=function(){var e,r,t,n,i=this,o=i.constructor;return i.isZero()?new o(i):(r=i.abs().cmp(1),t=o.precision,n=o.rounding,r!==-1?r===0?(e=ge(o,t+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=t+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=n,i.times(2)))};d.inverseTangent=d.atan=function(){var e,r,t,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,m=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=Pi)return s=ge(c,p+4,m).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=Pi)return s=ge(c,p+4,m).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,t=Math.min(28,a/E+2|0),e=t;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(x=!1,r=Math.ceil(a/E),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===o.d[e]&&e--;);return t&&(s=s.times(2<this.d.length-2};d.isNaN=function(){return!this.s};d.isNegative=d.isNeg=function(){return this.s<0};d.isPositive=d.isPos=function(){return this.s>0};d.isZero=function(){return!!this.d&&this.d[0]===0};d.lessThan=d.lt=function(e){return this.cmp(e)<0};d.lessThanOrEqualTo=d.lte=function(e){return this.cmp(e)<1};d.logarithm=d.log=function(e){var r,t,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,m=c.rounding,f=5;if(e==null)e=new c(10),r=!0;else{if(e=new c(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new c(NaN);r=e.eq(10)}if(t=u.d,u.s<0||!t||!t[0]||u.eq(1))return new c(t&&!t[0]?-1/0:u.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)o=!0;else{for(i=t[0];i%10===0;)i/=10;o=i!==1}if(x=!1,a=p+f,s=Ue(u,a),n=r?zt(c,a+10):Ue(e,a),l=F(s,n,a,1),rt(l.d,i=p,m))do if(a+=10,s=Ue(u,a),n=r?zt(c,a+10):Ue(e,a),l=F(s,n,a,1),!o){+K(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(rt(l.d,i+=10,m));return x=!0,y(l,p,m)};d.minus=d.sub=function(e){var r,t,n,i,o,s,a,l,u,c,p,m,f=this,g=f.constructor;if(e=new g(e),!f.d||!e.d)return!f.s||!e.s?e=new g(NaN):f.d?e.s=-e.s:e=new g(e.d||f.s!==e.s?f:NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(u=f.d,m=e.d,a=g.precision,l=g.rounding,!u[0]||!m[0]){if(m[0])e.s=-e.s;else if(u[0])e=new g(f);else return new g(l===3?-0:0);return x?y(e,a,l):e}if(t=ee(e.e/E),c=ee(f.e/E),u=u.slice(),o=c-t,o){for(p=o<0,p?(r=u,o=-o,s=m.length):(r=m,t=c,s=u.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,r.length=1),r.reverse(),n=o;n--;)r.push(0);r.reverse()}else{for(n=u.length,s=m.length,p=n0;--n)u[s++]=0;for(n=m.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,t=c,c=u,u=t),r=0;i;)r=(u[--i]=u[i]+c[i]+r)/he|0,u[i]%=he;for(r&&(u.unshift(r),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Xt(u,n),x?y(e,a,l):e};d.precision=d.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Qe+e);return t.d?(r=ws(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};d.round=function(){var e=this,r=e.constructor;return y(new r(e),e.e+1,r.rounding)};d.sine=d.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+E,n.rounding=1,t=mc(n,Ts(n,t)),n.precision=e,n.rounding=r,y(Fe>2?t.neg():t,e,r,!0)):new n(NaN)};d.squareRoot=d.sqrt=function(){var e,r,t,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(x=!1,u=Math.sqrt(+s),u==0||u==1/0?(r=K(a),(r.length+l)%2==0&&(r+="0"),u=Math.sqrt(r),l=ee((l+1)/2)-(l<0||l%2),u==1/0?r="5e"+l:(r=u.toExponential(),r=r.slice(0,r.indexOf("e")+1)+l),n=new c(r)):n=new c(u.toString()),t=(l=c.precision)+3;;)if(o=n,n=o.plus(F(s,o,t+2,1)).times(.5),K(o.d).slice(0,t)===(r=K(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}t+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return x=!0,y(n,l,c.rounding,e)};d.tangent=d.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=F(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,y(Fe==2||Fe==4?t.neg():t,e,r,!0)):new n(NaN)};d.times=d.mul=function(e){var r,t,n,i,o,s,a,l,u,c=this,p=c.constructor,m=c.d,f=(e=new p(e)).d;if(e.s*=c.s,!m||!m[0]||!f||!f[0])return new p(!e.s||m&&!m[0]&&!f||f&&!f[0]&&!m?NaN:!m||!f?e.s/0:e.s*0);for(t=ee(c.e/E)+ee(e.e/E),l=m.length,u=f.length,l=0;){for(r=0,i=l+n;i>n;)a=o[i]+f[n]*m[i-n-1]+r,o[i--]=a%he|0,r=a/he|0;o[i]=(o[i]+r)%he|0}for(;!o[--s];)o.pop();return r?++t:o.shift(),e.d=o,e.e=Xt(o,t),x?y(e,p.precision,p.rounding):e};d.toBinary=function(e,r){return Ci(this,2,e,r)};d.toDecimalPlaces=d.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(oe(e,0,Ge),r===void 0?r=n.rounding:oe(r,0,8),y(t,e+t.e+1,r))};d.toExponential=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=ve(n,!0):(oe(e,0,Ge),r===void 0?r=i.rounding:oe(r,0,8),n=y(new i(n),e+1,r),t=ve(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};d.toFixed=function(e,r){var t,n,i=this,o=i.constructor;return e===void 0?t=ve(i):(oe(e,0,Ge),r===void 0?r=o.rounding:oe(r,0,8),n=y(new o(i),e+i.e+1,r),t=ve(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};d.toFraction=function(e){var r,t,n,i,o,s,a,l,u,c,p,m,f=this,g=f.d,h=f.constructor;if(!g)return new h(f);if(u=t=new h(1),n=l=new h(0),r=new h(n),o=r.e=ws(g)-f.e-1,s=o%E,r.d[0]=Q(10,s<0?E+s:s),e==null)e=o>0?r:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error(Qe+a);e=a.gt(r)?o>0?r:u:a}for(x=!1,a=new h(K(g)),c=h.precision,h.precision=o=g.length*E*2;p=F(a,r,0,1,1),i=t.plus(p.times(n)),i.cmp(e)!=1;)t=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=r,r=a.minus(p.times(i)),a=i;return i=F(e.minus(t),n,0,1,1),l=l.plus(i.times(u)),t=t.plus(i.times(n)),l.s=u.s=f.s,m=F(u,n,o,1).minus(f).abs().cmp(F(l,t,o,1).minus(f).abs())<1?[u,n]:[l,t],h.precision=c,x=!0,m};d.toHexadecimal=d.toHex=function(e,r){return Ci(this,16,e,r)};d.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:oe(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(x=!1,t=F(t,e,0,r,1).times(e),x=!0,y(t)):(e.s=t.s,t=e),t};d.toNumber=function(){return+this};d.toOctal=function(e,r){return Ci(this,8,e,r)};d.toPower=d.pow=function(e){var r,t,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Q(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(r=ee(e.e/E),r>=e.d.length-1&&(t=u<0?-u:u)<=lc)return i=xs(l,a,t,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(rl.maxE+1||r0?s/0:0):(x=!1,l.rounding=a.s=1,t=Math.min(12,(r+"").length),i=vi(e.times(Ue(a,n+t)),n),i.d&&(i=y(i,n+5,1),rt(i.d,n,o)&&(r=n+10,i=y(vi(e.times(Ue(a,r+t)),r),r+5,1),+K(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,x=!0,l.rounding=o,y(i,n,o))};d.toPrecision=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=ve(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,Ge),r===void 0?r=i.rounding:oe(r,0,8),n=y(new i(n),e,r),t=ve(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t};d.toSignificantDigits=d.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(oe(e,1,Ge),r===void 0?r=n.rounding:oe(r,0,8)),y(new n(t),e,r)};d.toString=function(){var e=this,r=e.constructor,t=ve(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};d.truncated=d.trunc=function(){return y(new this.constructor(this),this.e+1,1)};d.valueOf=d.toJSON=function(){var e=this,r=e.constructor,t=ve(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function K(e){var r,t,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,r=1;rt)throw Error(Qe+e)}function rt(e,r,t,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--r;return--r<0?(r+=E,i=0):(i=Math.ceil((r+1)/E),r%=E),o=Q(10,E-r),a=e[i]%o|0,n==null?r<3?(r==0?a=a/100|0:r==1&&(a=a/10|0),s=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):s=(t<4&&a+1==o||t>3&&a+1==o/2)&&(e[i+1]/o/100|0)==Q(10,r-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:r<4?(r==0?a=a/1e3|0:r==1?a=a/100|0:r==2&&(a=a/10|0),s=(n||t<4)&&a==9999||!n&&t>3&&a==4999):s=((n||t<4)&&a+1==o||!n&&t>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==Q(10,r-3)-1,s}function Wt(e,r,t){for(var n,i=[0],o,s=0,a=e.length;st-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function cc(e,r){var t,n,i;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),i=(1/en(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=Pr(e,1,r.times(i),new e(1));for(var o=t;o--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var F=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function r(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function t(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,m,f,g,h,I,T,S,C,b,de,ae,Lr,U,ne,Ae,Y,cr,Tt=n.constructor,_n=n.s==i.s?1:-1,z=n.d,O=i.d;if(!z||!z[0]||!O||!O[0])return new Tt(!n.s||!i.s||(z?O&&z[0]==O[0]:!O)?NaN:z&&z[0]==0||!O?_n*0:_n/0);for(l?(f=1,c=n.e-i.e):(l=he,f=E,c=ee(n.e/f)-ee(i.e/f)),Y=O.length,ne=z.length,T=new Tt(_n),S=T.d=[],p=0;O[p]==(z[p]||0);p++);if(O[p]>(z[p]||0)&&c--,o==null?(ae=o=Tt.precision,s=Tt.rounding):a?ae=o+(n.e-i.e)+1:ae=o,ae<0)S.push(1),g=!0;else{if(ae=ae/f+2|0,p=0,Y==1){for(m=0,O=O[0],ae++;(p1&&(O=e(O,m,l),z=e(z,m,l),Y=O.length,ne=z.length),U=Y,C=z.slice(0,Y),b=C.length;b=l/2&&++Ae;do m=0,u=r(O,C,Y,b),u<0?(de=C[0],Y!=b&&(de=de*l+(C[1]||0)),m=de/Ae|0,m>1?(m>=l&&(m=l-1),h=e(O,m,l),I=h.length,b=C.length,u=r(h,C,I,b),u==1&&(m--,t(h,Y=10;m/=10)p++;T.e=p+c*f-1,y(T,a?o+T.e+1:o,s,g)}return T}}();function y(e,r,t,n){var i,o,s,a,l,u,c,p,m,f=e.constructor;e:if(r!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=r-i,o<0)o+=E,s=r,c=p[m=0],l=c/Q(10,i-s-1)%10|0;else if(m=Math.ceil((o+1)/E),a=p.length,m>=a)if(n){for(;a++<=m;)p.push(0);c=l=0,i=1,o%=E,s=o-E+1}else break e;else{for(c=a=p[m],i=1;a>=10;a/=10)i++;o%=E,s=o-E+i,l=s<0?0:c/Q(10,i-s-1)%10|0}if(n=n||r<0||p[m+1]!==void 0||(s<0?c:c%Q(10,i-s-1)),u=t<4?(l||n)&&(t==0||t==(e.s<0?3:2)):l>5||l==5&&(t==4||n||t==6&&(o>0?s>0?c/Q(10,i-s):0:p[m-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,u?(r-=e.e+1,p[0]=Q(10,(E-r%E)%E),e.e=-r||0):p[0]=e.e=0,e;if(o==0?(p.length=m,a=1,m--):(p.length=m+1,a=Q(10,E-o),p[m]=s>0?(c/Q(10,i-s)%Q(10,s)|0)*a:0),u)for(;;)if(m==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==he&&(p[0]=1));break}else{if(p[m]+=a,p[m]!=he)break;p[m--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return x&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Be(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Be(-i-1)+o,t&&(n=t-s)>0&&(o+=Be(n))):i>=s?(o+=Be(i+1-s),t&&(n=t-i-1)>0&&(o=o+"."+Be(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Be(n))),o}function Xt(e,r){var t=e[0];for(r*=E;t>=10;t/=10)r++;return r}function zt(e,r,t){if(r>uc)throw x=!0,t&&(e.precision=t),Error(hs);return y(new e(Kt),r,1,!0)}function ge(e,r,t){if(r>Pi)throw Error(hs);return y(new e(Yt),r,t,!0)}function ws(e){var r=e.length-1,t=r*E+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function Be(e){for(var r="";e--;)r+="0";return r}function xs(e,r,t,n){var i,o=new e(1),s=Math.ceil(n/E+4);for(x=!1;;){if(t%2&&(o=o.times(r),ds(o.d,s)&&(i=!0)),t=ee(t/2),t===0){t=o.d.length-1,i&&o.d[t]===0&&++o.d[t];break}r=r.times(r),ds(r.d,s)}return x=!0,o}function ms(e){return e.d[e.d.length-1]&1}function Ps(e,r,t){for(var n,i=new e(r[0]),o=0;++o17)return new m(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(r==null?(x=!1,l=g):l=r,a=new m(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(Q(2,p))/Math.LN10*2+5|0,l+=n,t=o=s=new m(1),m.precision=l;;){if(o=y(o.times(e),l,1),t=t.times(++c),a=s.plus(F(o,t,l,1)),K(a.d).slice(0,l)===K(s.d).slice(0,l)){for(i=p;i--;)s=y(s.times(s),l,1);if(r==null)if(u<3&&rt(s.d,l-n,f,u))m.precision=l+=10,t=o=a=new m(1),c=0,u++;else return y(s,m.precision=g,f,x=!0);else return m.precision=g,s}s=a}}function Ue(e,r){var t,n,i,o,s,a,l,u,c,p,m,f=1,g=10,h=e,I=h.d,T=h.constructor,S=T.rounding,C=T.precision;if(h.s<0||!I||!I[0]||!h.e&&I[0]==1&&I.length==1)return new T(I&&!I[0]?-1/0:h.s!=1?NaN:I?0:h);if(r==null?(x=!1,c=C):c=r,T.precision=c+=g,t=K(I),n=t.charAt(0),Math.abs(o=h.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)h=h.times(e),t=K(h.d),n=t.charAt(0),f++;o=h.e,n>1?(h=new T("0."+t),o++):h=new T(n+"."+t.slice(1))}else return u=zt(T,c+2,C).times(o+""),h=Ue(new T(n+"."+t.slice(1)),c-g).plus(u),T.precision=C,r==null?y(h,C,S,x=!0):h;for(p=h,l=s=h=F(h.minus(1),h.plus(1),c,1),m=y(h.times(h),c,1),i=3;;){if(s=y(s.times(m),c,1),u=l.plus(F(s,new T(i),c,1)),K(u.d).slice(0,c)===K(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(zt(T,c+2,C).times(o+""))),l=F(l,new T(f),c,1),r==null)if(rt(l.d,c-g,S,a))T.precision=c+=g,u=s=h=F(p.minus(1),p.plus(1),c,1),m=y(h.times(h),c,1),i=a=1;else return y(l,T.precision=C,S,x=!0);else return T.precision=C,l;l=u,i+=2}}function vs(e){return String(e.s*e.s/0)}function Ti(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(i=r.length;r.charCodeAt(i-1)===48;--i);if(r=r.slice(n,i),r){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%E,t<0&&(n+=E),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\d)_(?=\d)/g,"$1"),bs.test(r))return Ti(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(sc.test(r))t=16,r=r.toLowerCase();else if(oc.test(r))t=2;else if(ac.test(r))t=8;else throw Error(Qe+r);for(o=r.search(/p/i),o>0?(l=+r.slice(o+1),r=r.substring(2,o)):r=r.slice(2),o=r.indexOf("."),s=o>=0,n=e.constructor,s&&(r=r.replace(".",""),a=r.length,o=a-o,i=xs(n,new n(t),o,o*2)),u=Wt(r,t,he),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=Xt(u,c),e.d=u,x=!1,s&&(e=F(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?Q(2,l):ir.pow(2,l))),x=!0,e)}function mc(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:Pr(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/en(5,t)),r=Pr(e,2,r,r);for(var i,o=new e(5),s=new e(16),a=new e(20);t--;)i=r.times(r),r=r.times(o.plus(i.times(s.times(i).minus(a))));return r}function Pr(e,r,t,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/E);for(x=!1,l=t.times(t),a=new e(n);;){if(s=F(a.times(l),new e(r++*r++),c,1),a=i?n.plus(s):n.minus(s),n=F(s.times(l),new e(r++*r++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return x=!0,s.d.length=p+1,s}function en(e,r){for(var t=e;--r;)t*=e;return t}function Ts(e,r){var t,n=r.s<0,i=ge(e,e.precision,1),o=i.times(.5);if(r=r.abs(),r.lte(o))return Fe=n?4:1,r;if(t=r.divToInt(i),t.isZero())Fe=n?3:2;else{if(r=r.minus(t.times(i)),r.lte(o))return Fe=ms(t)?n?2:3:n?4:1,r;Fe=ms(t)?n?1:4:n?3:2}return r.minus(i).abs()}function Ci(e,r,t,n){var i,o,s,a,l,u,c,p,m,f=e.constructor,g=t!==void 0;if(g?(oe(t,1,Ge),n===void 0?n=f.rounding:oe(n,0,8)):(t=f.precision,n=f.rounding),!e.isFinite())c=vs(e);else{for(c=ve(e),s=c.indexOf("."),g?(i=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):i=r,s>=0&&(c=c.replace(".",""),m=new f(1),m.e=c.length-s,m.d=Wt(ve(m),10,i),m.e=m.d.length),p=Wt(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new f(e),e.d=p,e.e=o,e=F(e,m,t,n,0,i),p=e.d,o=e.e,u=gs),s=p[t],a=i/2,u=u||p[t+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[t-1]&1||n===(e.s<0?8:7)),p.length=t,u)for(;++p[--t]>i-1;)p[t]=0,t||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s1)if(r==16||r==8){for(s=r==16?4:3,--l;l%s;l++)c+="0";for(p=Wt(c,i,r),l=p.length;!p[l-1];--l);for(s=1,c="1.";sl)for(o-=l;o--;)c+="0";else or)return e.length=r,!0}function dc(e){return new this(e).abs()}function fc(e){return new this(e).acos()}function gc(e){return new this(e).acosh()}function hc(e,r){return new this(e).plus(r)}function yc(e){return new this(e).asin()}function Ec(e){return new this(e).asinh()}function bc(e){return new this(e).atan()}function wc(e){return new this(e).atanh()}function xc(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,o=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=ge(this,o,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?ge(this,n,i):new this(0),t.s=e.s):!e.d||r.isZero()?(t=ge(this,o,1).times(.5),t.s=e.s):r.s<0?(this.precision=o,this.rounding=1,t=this.atan(F(e,r,o,1)),r=ge(this,o,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(F(e,r,o,1)),t}function Pc(e){return new this(e).cbrt()}function vc(e){return y(e=new this(e),e.e+1,2)}function Tc(e,r,t){return new this(e).clamp(r,t)}function Cc(e){if(!e||typeof e!="object")throw Error(Zt+"Object expected");var r,t,n,i=e.defaults===!0,o=["precision",1,Ge,"rounding",0,8,"toExpNeg",-xr,0,"toExpPos",0,xr,"maxE",0,xr,"minE",-xr,0,"modulo",0,9];for(r=0;r=o[r+1]&&n<=o[r+2])this[t]=n;else throw Error(Qe+t+": "+n);if(t="crypto",i&&(this[t]=xi[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(ys);else this[t]=!1;else throw Error(Qe+t+": "+n);return this}function Sc(e){return new this(e).cos()}function Rc(e){return new this(e).cosh()}function Cs(e){var r,t,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,fs(o)){u.s=o.s,x?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;x?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?r[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(r,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(ys);else for(;o=10;i/=10)n++;n`}};function Tr(e){return e instanceof tt}var rn=class{constructor(r){this.value=r}write(r){r.write(this.value)}markAsError(){this.value.markAsError()}};var tn=e=>e,nn={bold:tn,red:tn,green:tn,dim:tn,enabled:!1},Ss={bold:H,red:ue,green:Me,dim:Ie,enabled:!0},Cr={write(e){e.writeLine(",")}};var Ce=class{constructor(r){this.contents=r;this.isUnderlined=!1;this.color=r=>r}underline(){return this.isUnderlined=!0,this}setColor(r){return this.color=r,this}write(r){let t=r.getCurrentLineLength();r.write(this.color(this.contents)),this.isUnderlined&&r.afterNextNewline(()=>{r.write(" ".repeat(t)).writeLine(this.color("~".repeat(this.contents.length)))})}};var Je=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var Sr=class extends Je{constructor(){super(...arguments);this.items=[]}addItem(t){return this.items.push(new rn(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let n=new Ce("[]");this.hasError&&n.setColor(t.context.colors.red).underline(),t.write(n)}writeWithItems(t){let{colors:n}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(Cr,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Rs=": ",on=class{constructor(r,t){this.name=r;this.value=t;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Rs.length}write(r){let t=new Ce(this.name);this.hasError&&t.underline().setColor(r.context.colors.red),r.write(t).write(Rs).write(this.value)}};var sn=class e extends Je{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[n,...i]=t,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof Sr&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let n=this;for(let i of t){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(t){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of t){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(i=>i.getPrintWidth()))+2}write(t){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,n)}asObject(){return this}writeEmpty(t){let n=new Ce("{}");this.hasError&&n.setColor(t.context.colors.red).underline(),t.write(n)}writeWithContents(t,n){t.writeLine("{").withIndent(()=>{t.writeJoined(Cr,[...n,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var J=class extends Je{constructor(t){super();this.text=t}getPrintWidth(){return this.text.length}write(t){let n=new Ce(this.text);this.hasError&&n.underline().setColor(t.context.colors.red),t.write(n)}asObject(){}};var Si=class{constructor(r){this.errorMessages=[];this.arguments=r}write(r){r.write(this.arguments)}addErrorMessage(r){this.errorMessages.push(r)}renderAllMessages(r){return this.errorMessages.map(t=>t(r)).join(` -`)}};function an(e){return new Si(As(e))}function As(e){let r=new sn;for(let[t,n]of Object.entries(e)){let i=new on(t,Is(n));r.addField(i)}return r}function Is(e){if(typeof e=="string")return new J(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new J(String(e));if(typeof e=="bigint")return new J(`${e}n`);if(e===null)return new J("null");if(e===void 0)return new J("undefined");if(vr(e))return new J(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new J(`Buffer.alloc(${e.byteLength})`):new J(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let r=Ht(e)?e.toISOString():"Invalid Date";return new J(`new Date("${r}")`)}return e instanceof Le?new J(`Prisma.${e._getName()}`):Tr(e)?new J(`prisma.${ps(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Xc(e):typeof e=="object"?As(e):new J(Object.prototype.toString.call(e))}function Xc(e){let r=new Sr;for(let t of e)r.addItem(Is(t));return r}function _s(e){if(e===void 0)return"";let r=an(e);return new br(0,{colors:nn}).write(r).toString()}var ep="P2037";function or({error:e,user_facing_error:r},t,n){return r.error_code?new V(rp(r,n),{code:r.error_code,clientVersion:t,meta:r.meta,batchRequestIdx:r.batch_request_idx}):new B(e,{clientVersion:t,batchRequestIdx:r.batch_request_idx})}function rp(e,r){let t=e.message;return(r==="postgresql"||r==="postgres"||r==="mysql")&&e.error_code===ep&&(t+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),t}var nt="";function ks(e){var r=e.split(` -`);return r.reduce(function(t,n){var i=ip(n)||sp(n)||up(n)||dp(n)||pp(n);return i&&t.push(i),t},[])}var tp=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,np=/\((\S*)(?::(\d+))(?::(\d+))\)/;function ip(e){var r=tp.exec(e);if(!r)return null;var t=r[2]&&r[2].indexOf("native")===0,n=r[2]&&r[2].indexOf("eval")===0,i=np.exec(r[2]);return n&&i!=null&&(r[2]=i[1],r[3]=i[2],r[4]=i[3]),{file:t?null:r[2],methodName:r[1]||nt,arguments:t?[r[2]]:[],lineNumber:r[3]?+r[3]:null,column:r[4]?+r[4]:null}}var op=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function sp(e){var r=op.exec(e);return r?{file:r[2],methodName:r[1]||nt,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null}var ap=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,lp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function up(e){var r=ap.exec(e);if(!r)return null;var t=r[3]&&r[3].indexOf(" > eval")>-1,n=lp.exec(r[3]);return t&&n!=null&&(r[3]=n[1],r[4]=n[2],r[5]=null),{file:r[3],methodName:r[1]||nt,arguments:r[2]?r[2].split(","):[],lineNumber:r[4]?+r[4]:null,column:r[5]?+r[5]:null}}var cp=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function pp(e){var r=cp.exec(e);return r?{file:r[3],methodName:r[1]||nt,arguments:[],lineNumber:+r[4],column:r[5]?+r[5]:null}:null}var mp=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function dp(e){var r=mp.exec(e);return r?{file:r[2],methodName:r[1]||nt,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null}var Ri=class{getLocation(){return null}},Ai=class{constructor(){this._error=new Error}getLocation(){let r=this._error.stack;if(!r)return null;let n=ks(r).find(i=>{if(!i.file)return!1;let o=ii(i.file);return o!==""&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function He(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Ri:new Ai}var Ds={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Rr(e={}){let r=gp(e);return Object.entries(r).reduce((n,[i,o])=>(Ds[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function gp(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function ln(e={}){return r=>(typeof e._count=="boolean"&&(r._count=r._count._all),r)}function Os(e,r){let t=ln(e);return r({action:"aggregate",unpacker:t,argsMapper:Rr})(e)}function hp(e={}){let{select:r,...t}=e;return typeof r=="object"?Rr({...t,_count:r}):Rr({...t,_count:{_all:!0}})}function yp(e={}){return typeof e.select=="object"?r=>ln(e)(r)._count:r=>ln(e)(r)._count._all}function Ls(e,r){return r({action:"count",unpacker:yp(e),argsMapper:hp})(e)}function Ep(e={}){let r=Rr(e);if(Array.isArray(r.by))for(let t of r.by)typeof t=="string"&&(r.select[t]=!0);else typeof r.by=="string"&&(r.select[r.by]=!0);return r}function bp(e={}){return r=>(typeof e?._count=="boolean"&&r.forEach(t=>{t._count=t._count._all}),r)}function Fs(e,r){return r({action:"groupBy",unpacker:bp(e),argsMapper:Ep})(e)}function Ns(e,r,t){if(r==="aggregate")return n=>Os(n,t);if(r==="count")return n=>Ls(n,t);if(r==="groupBy")return n=>Fs(n,t)}function Ms(e,r){let t=r.fields.filter(i=>!i.relationName),n=pi(t,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new tt(e,o,s.type,s.isList,s.kind==="enum")},...Jt(Object.keys(n))})}var $s=e=>Array.isArray(e)?e:e.split("."),Ii=(e,r)=>$s(r).reduce((t,n)=>t&&t[n],e),qs=(e,r,t)=>$s(r).reduceRight((n,i,o,s)=>Object.assign({},Ii(e,s.slice(0,o)),{[i]:n}),t);function wp(e,r){return e===void 0||r===void 0?[]:[...r,"select",e]}function xp(e,r,t){return r===void 0?e??{}:qs(r,t,e||!0)}function _i(e,r,t,n,i,o){let a=e._runtimeDataModel.models[r].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=He(e._errorFormat),c=wp(n,i),p=xp(l,o,c),m=t({dataPath:c,callsite:u})(p),f=Pp(e,r);return new Proxy(m,{get(g,h){if(!f.includes(h))return g[h];let T=[a[h].type,t,h],S=[c,p];return _i(e,...T,...S)},...Jt([...f,...Object.getOwnPropertyNames(m)])})}}function Pp(e,r){return e._runtimeDataModel.models[r].fields.filter(t=>t.kind==="object").map(t=>t.name)}var Gs=k(oi());var Qs=k(require("fs"));var js={keyword:_e,entity:_e,value:e=>H(ze(e)),punctuation:ze,directive:_e,function:_e,variable:e=>H(ze(e)),string:e=>H(Me(e)),boolean:fe,number:_e,comment:Nr};var vp=e=>e,un={},Tp=0,P={manual:un.Prism&&un.Prism.manual,disableWorkerMessageHandler:un.Prism&&un.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof ye){let r=e;return new ye(r.type,P.util.encode(r.content),r.alias)}else return Array.isArray(e)?e.map(P.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Ae instanceof ye)continue;if(de&&U!=r.length-1){S.lastIndex=ne;var p=S.exec(e);if(!p)break;var c=p.index+(b?p[1].length:0),m=p.index+p[0].length,a=U,l=ne;for(let O=r.length;a=l&&(++U,ne=l);if(r[U]instanceof ye)continue;u=a-U,Ae=e.slice(ne,l),p.index-=ne}else{S.lastIndex=0;var p=S.exec(Ae),u=1}if(!p){if(o)break;continue}b&&(ae=p[1]?p[1].length:0);var c=p.index+ae,p=p[0].slice(ae),m=c+p.length,f=Ae.slice(0,c),g=Ae.slice(m);let Y=[U,u];f&&(++U,ne+=f.length,Y.push(f));let cr=new ye(h,C?P.tokenize(p,C):p,Lr,p,de);if(Y.push(cr),g&&Y.push(g),Array.prototype.splice.apply(r,Y),u!=1&&P.matchGrammar(e,r,t,U,ne,!0,h),o)break}}}},tokenize:function(e,r){let t=[e],n=r.rest;if(n){for(let i in n)r[i]=n[i];delete r.rest}return P.matchGrammar(e,t,r,0,0,!1),t},hooks:{all:{},add:function(e,r){let t=P.hooks.all;t[e]=t[e]||[],t[e].push(r)},run:function(e,r){let t=P.hooks.all[e];if(!(!t||!t.length))for(var n=0,i;i=t[n++];)i(r)}},Token:ye};P.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};P.languages.javascript=P.languages.extend("clike",{"class-name":[P.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});P.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;P.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:P.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:P.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:P.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:P.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});P.languages.markup&&P.languages.markup.tag.addInlined("script","javascript");P.languages.js=P.languages.javascript;P.languages.typescript=P.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});P.languages.ts=P.languages.typescript;function ye(e,r,t,n,i){this.type=e,this.content=r,this.alias=t,this.length=(n||"").length|0,this.greedy=!!i}ye.stringify=function(e,r){return typeof e=="string"?e:Array.isArray(e)?e.map(function(t){return ye.stringify(t,r)}).join(""):Cp(e.type)(e.content)};function Cp(e){return js[e]||vp}function Vs(e){return Sp(e,P.languages.javascript)}function Sp(e,r){return P.tokenize(e,r).map(n=>ye.stringify(n)).join("")}var Bs=k(zo());function Us(e){return(0,Bs.default)(e)}var cn=class e{static read(r){let t;try{t=Qs.default.readFileSync(r,"utf-8")}catch{return null}return e.fromContent(t)}static fromContent(r){let t=r.split(/\r?\n/);return new e(1,t)}constructor(r,t){this.firstLineNumber=r,this.lines=t}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(r,t){if(rthis.lines.length+this.firstLineNumber)return this;let n=r-this.firstLineNumber,i=[...this.lines];return i[n]=t(i[n]),new e(this.firstLineNumber,i)}mapLines(r){return new e(this.firstLineNumber,this.lines.map((t,n)=>r(t,this.firstLineNumber+n)))}lineAt(r){return this.lines[r-this.firstLineNumber]}prependSymbolAt(r,t){return this.mapLines((n,i)=>i===r?`${t} ${n}`:` ${n}`)}slice(r,t){let n=this.lines.slice(r-1,t).join(` -`);return new e(r,Us(n).split(` -`))}highlight(){let r=Vs(this.toString());return new e(this.firstLineNumber,r.split(` -`))}toString(){return this.lines.join(` -`)}};var Rp={red:ue,gray:Nr,dim:Ie,bold:H,underline:X,highlightSource:e=>e.highlight()},Ap={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Ip({message:e,originalMethod:r,isPanic:t,callArguments:n}){return{functionName:`prisma.${r}()`,message:e,isPanic:t??!1,callArguments:n}}function _p({callsite:e,message:r,originalMethod:t,isPanic:n,callArguments:i},o){let s=Ip({message:r,originalMethod:t,isPanic:n,callArguments:i});if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=cn.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=Dp(c),m=kp(c);if(!m)return s;s.functionName=`${m.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,g=>g.slice(0,m.openingBraceIndex))),u=o.highlightSource(u);let f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,h)=>o.gray(String(h).padStart(f))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+f+1;g+=2,s.callArguments=(0,Gs.default)(i,g).slice(g)}}return s}function kp(e){let r=Object.keys(De.ModelAction).join("|"),n=new RegExp(String.raw`\.(${r})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function Dp(e){let r=0;for(let t=0;t{if("rejectOnNotFound"in n.args){let o=Ar({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new W(o,{clientVersion:r})}return await t(n).catch(o=>{throw o instanceof V&&o.code==="P2025"?new Oe(`No ${e} found`,r):o})}}function Se(e){return e.replace(/^./,r=>r.toLowerCase())}var Np=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Mp=["aggregate","count","groupBy"];function ki(e,r){let t=e._extensions.getAllModelExtensions(r)??{},n=[$p(e,r),jp(e,r),et(t),te("name",()=>r),te("$name",()=>r),te("$parent",()=>e._appliedParent)];return Pe({},n)}function $p(e,r){let t=Se(r),n=Object.keys(De.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=Js(o,r,e._clientVersion,s);let a=l=>u=>{let c=He(e._errorFormat);return e._createPrismaPromise(p=>{let m={args:u,dataPath:[],action:o,model:r,clientMethod:`${t}.${i}`,jsModelName:t,transaction:p,callsite:c};return s({...m,...l})})};return Np.includes(o)?_i(e,r,a):qp(i)?Ns(e,i,a):a({})}}}function qp(e){return Mp.includes(e)}function jp(e,r){return nr(te("fields",()=>{let t=e._runtimeDataModel.models[r];return Ms(r,t)}))}function Hs(e){return e.replace(/^./,r=>r.toUpperCase())}var Di=Symbol();function it(e){let r=[Vp(e),te(Di,()=>e),te("$parent",()=>e._appliedParent)],t=e._extensions.getAllClientExtensions();return t&&r.push(et(t)),Pe(e,r)}function Vp(e){let r=Object.keys(e._runtimeDataModel.models),t=r.map(Se),n=[...new Set(r.concat(t))];return nr({getKeys(){return n},getPropertyValue(i){let o=Hs(i);if(e._runtimeDataModel.models[o]!==void 0)return ki(e,o);if(e._runtimeDataModel.models[i]!==void 0)return ki(e,i)},getPropertyDescriptor(i){if(!t.includes(i))return{enumerable:!1}}})}function Ws(e){return e[Di]?e[Di]:e}function Ks(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let t=e.client.__AccelerateEngine;this._originalClient._engine=new t(this._originalClient._accelerateEngineConfig)}let r=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return it(r)}function Ys({result:e,modelName:r,select:t,omit:n,extensions:i}){let o=i.getAllComputedFields(r);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(c=>n[c]);u.length>0&&a.push(yr(u))}else if(t){if(!t[l.name])continue;let u=l.needs.filter(c=>!t[c]);u.length>0&&a.push(yr(u))}Bp(e,l.needs)&&s.push(Up(l,Pe(e,s)))}return s.length>0||a.length>0?Pe(e,[...s,...a]):e}function Bp(e,r){return r.every(t=>ci(e,t))}function Up(e,r){return nr(te(e.name,()=>e.compute(r)))}function pn({visitor:e,result:r,args:t,runtimeDataModel:n,modelName:i}){if(Array.isArray(r)){for(let s=0;sc.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};r[o]=pn({visitor:i,result:r[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Zs({result:e,modelName:r,args:t,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[r]?e:pn({result:e,args:t??{},modelName:r,runtimeDataModel:i,visitor:(s,a,l)=>Ys({result:s,modelName:Se(a),select:l.select,omit:l.omit,extensions:n})})}function Xs(e){if(e instanceof ie)return Qp(e);if(Array.isArray(e)){let t=[e[0]];for(let n=1;n{let o=r.customDataProxyFetch;return"transaction"in r&&i!==void 0&&(r.transaction?.kind==="batch"&&r.transaction.lock.then(),r.transaction=i),n===t.length?e._executeRequest(r):t[n]({model:r.model,operation:r.model?r.action:r.clientMethod,args:Xs(r.args??{}),__internalParams:r,query:(s,a=r)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=oa(o,l),a.args=s,ra(e,a,t,n+1)}})})}function ta(e,r){let{jsModelName:t,action:n,clientMethod:i}=r,o=t?n:i;if(e._extensions.isEmpty())return e._executeRequest(r);let s=e._extensions.getAllQueryCallbacks(t??"$none",o);return ra(e,r,s)}function na(e){return r=>{let t={requests:r},n=r[0].extensions.getAllBatchQueryCallbacks();return n.length?ia(t,n,0,e):e(t)}}function ia(e,r,t,n){if(t===r.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return r[t]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=oa(i,l),ia(a,r,t+1,n)}})}var ea=e=>e;function oa(e=ea,r=ea){return t=>e(r(t))}function aa(e,r,t){let n=Se(t);return!r.result||!(r.result.$allModels||r.result[n])?e:Gp({...e,...sa(r.name,e,r.result.$allModels),...sa(r.name,e,r.result[n])})}function Gp(e){let r=new xe,t=(n,i)=>r.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>t(o,i)):[n]));return gr(e,n=>({...n,needs:t(n.name,new Set)}))}function sa(e,r,t){return t?gr(t,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Jp(r,o,i)})):{}}function Jp(e,r,t){let n=e?.[r]?.compute;return n?i=>t({...i,[r]:n(i)}):t}function la(e,r){if(!r)return e;let t={...e};for(let n of Object.values(r))if(e[n.name])for(let i of n.needs)t[i]=!0;return t}function ua(e,r){if(!r)return e;let t={...e};for(let n of Object.values(r))if(!e[n.name])for(let i of n.needs)delete t[i];return t}var mn=class{constructor(r,t){this.extension=r;this.previous=t;this.computedFieldsCache=new xe;this.modelExtensionsCache=new xe;this.queryCallbacksCache=new xe;this.clientExtensions=Wr(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=Wr(()=>{let r=this.previous?.getAllBatchQueryCallbacks()??[],t=this.extension.query?.$__internalBatch;return t?r.concat(t):r})}getAllComputedFields(r){return this.computedFieldsCache.getOrCreate(r,()=>aa(this.previous?.getAllComputedFields(r),this.extension,r))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(r){return this.modelExtensionsCache.getOrCreate(r,()=>{let t=Se(r);return!this.extension.model||!(this.extension.model[t]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(r):{...this.previous?.getAllModelExtensions(r),...this.extension.model.$allModels,...this.extension.model[t]}})}getAllQueryCallbacks(r,t){return this.queryCallbacksCache.getOrCreate(`${r}:${t}`,()=>{let n=this.previous?.getAllQueryCallbacks(r,t)??[],i=[],o=this.extension.query;return!o||!(o[r]||o.$allModels||o[t]||o.$allOperations)?n:(o[r]!==void 0&&(o[r][t]!==void 0&&i.push(o[r][t]),o[r].$allOperations!==void 0&&i.push(o[r].$allOperations)),r!=="$none"&&o.$allModels!==void 0&&(o.$allModels[t]!==void 0&&i.push(o.$allModels[t]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[t]!==void 0&&i.push(o[t]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},dn=class e{constructor(r){this.head=r}static empty(){return new e}static single(r){return new e(new mn(r))}isEmpty(){return this.head===void 0}append(r){return new e(new mn(r,this.head))}getAllComputedFields(r){return this.head?.getAllComputedFields(r)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(r){return this.head?.getAllModelExtensions(r)}getAllQueryCallbacks(r,t){return this.head?.getAllQueryCallbacks(r,t)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var ca=L("prisma:client"),pa={Vercel:"vercel","Netlify CI":"netlify"};function ma({postinstall:e,ciName:r,clientVersion:t}){if(ca("checkPlatformCaching:postinstall",e),ca("checkPlatformCaching:ciName",r),e===!0&&r&&r in pa){let n=`Prisma has detected that this project was built on ${r}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${pa[r]}-build`;throw console.error(n),new R(n,t)}}function da(e,r){return e?e.datasources?e.datasources:e.datasourceUrl?{[r[0]]:{url:e.datasourceUrl}}:{}:{}}var Hp="Cloudflare-Workers",Wp="node";function fa(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Hp?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===Wp?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var Kp={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function fn(){let e=fa();return{id:e,prettyName:Kp[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var ba=k(require("fs")),st=k(require("path"));function gn(e){let{runtimeBinaryTarget:r}=e;return`Add "${r}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it: - -${Yp(e)}`}function Yp(e){let{generator:r,generatorBinaryTargets:t,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...t,i];return ai({...r,binaryTargets:o})}function We(e){let{runtimeBinaryTarget:r}=e;return`Prisma Client could not locate the Query Engine for runtime "${r}".`}function Ke(e){let{searchedLocations:r}=e;return`The following locations have been searched: -${[...new Set(r)].map(i=>` ${i}`).join(` -`)}`}function ga(e){let{runtimeBinaryTarget:r}=e;return`${We(e)} - -This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${r}". -${gn(e)} - -${Ke(e)}`}function hn(e){return`We would appreciate if you could take the time to share some information with us. -Please help us by answering a few questions: https://pris.ly/${e}`}function yn(e){let{errorStack:r}=e;return r?.match(/\/\.next|\/next@|\/next\//)?` - -We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function ha(e){let{queryEngineName:r}=e;return`${We(e)}${yn(e)} - -This is likely caused by a bundler that has not copied "${r}" next to the resulting bundle. -Ensure that "${r}" has been copied next to the bundle or in "${e.expectedLocation}". - -${hn("engine-not-found-bundler-investigation")} - -${Ke(e)}`}function ya(e){let{runtimeBinaryTarget:r,generatorBinaryTargets:t}=e,n=t.find(i=>i.native);return`${We(e)} - -This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${r}". -${gn(e)} - -${Ke(e)}`}function Ea(e){let{queryEngineName:r}=e;return`${We(e)}${yn(e)} - -This is likely caused by tooling that has not copied "${r}" to the deployment folder. -Ensure that you ran \`prisma generate\` and that "${r}" has been copied to "${e.expectedLocation}". - -${hn("engine-not-found-tooling-investigation")} - -${Ke(e)}`}var zp=L("prisma:client:engines:resolveEnginePath"),Zp=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function wa(e,r){let t={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??r.prismaPath;if(t!==void 0)return t;let{enginePath:n,searchedLocations:i}=await Xp(e,r);if(zp("enginePath",n),n!==void 0&&e==="binary"&&Xn(n),n!==void 0)return r.prismaPath=n;let o=await er(),s=r.generator?.binaryTargets??[],a=s.some(m=>m.native),l=!s.some(m=>m.value===o),u=__filename.match(Zp())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:r.generator,runtimeBinaryTarget:o,queryEngineName:xa(e,o),expectedLocation:st.default.relative(process.cwd(),r.dirname),errorStack:new Error().stack},p;throw a&&l?p=ya(c):l?p=ga(c):u?p=ha(c):p=Ea(c),new R(p,r.clientVersion)}async function Xp(engineType,config){let binaryTarget=await er(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,st.default.resolve(dirname,".."),config.generator?.output?.value??dirname,st.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(qo());for(let e of searchLocations){let r=xa(engineType,binaryTarget),t=st.default.join(e,r);if(searchedLocations.push(e),ba.default.existsSync(t))return{enginePath:t,searchedLocations}}return{enginePath:void 0,searchedLocations}}function xa(e,r){return e==="library"?At(r,"fs"):`query-engine-${r}${r==="windows"?".exe":""}`}var Oi=k(ui());function Pa(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,r=>`${r[0]}5`):""}function va(e){return e.split(` -`).map(r=>r.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` -`)}var Ta=k(is());function Ca({title:e,user:r="prisma",repo:t="prisma",template:n="bug_report.yml",body:i}){return(0,Ta.default)({user:r,repo:t,template:n,title:e,body:i})}function Sa({version:e,binaryTarget:r,title:t,description:n,engineVersion:i,database:o,query:s}){let a=go(6e3-(s?.length??0)),l=va((0,Oi.default)(a)),u=n?`# Description -\`\`\` -${n} -\`\`\``:"",c=(0,Oi.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: -## Versions - -| Name | Version | -|-----------------|--------------------| -| Node | ${process.version?.padEnd(19)}| -| OS | ${r?.padEnd(19)}| -| Prisma Client | ${e?.padEnd(19)}| -| Query Engine | ${i?.padEnd(19)}| -| Database | ${o?.padEnd(19)}| - -${u} - -## Logs -\`\`\` -${l} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?Pa(s):""} -\`\`\` -`),p=Ca({title:t,body:c});return`${t} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${X(p)} - -If you want the Prisma team to look into it, please open the link above \u{1F64F} -To increase the chance of success, please post your schema and a snippet of -how you used Prisma Client in the issue. -`}function Ir({inlineDatasources:e,overrideDatasources:r,env:t,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=r[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=t[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new R(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new R("error: Missing URL environment variable, value, or override.",n);return i}var En=class extends Error{constructor(r,t){super(r),this.clientVersion=t.clientVersion,this.cause=t.cause}get[Symbol.toStringTag](){return this.name}};var se=class extends En{constructor(r,t){super(r,t),this.isRetryable=t.isRetryable??!0}};function A(e,r){return{...e,isRetryable:r}}var _r=class extends se{constructor(t){super("This request must be retried",A(t,!0));this.name="ForcedRetryError";this.code="P5001"}};w(_r,"ForcedRetryError");var sr=class extends se{constructor(t,n){super(t,A(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};w(sr,"InvalidDatasourceError");var ar=class extends se{constructor(t,n){super(t,A(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};w(ar,"NotImplementedYetError");var $=class extends se{constructor(r,t){super(r,t),this.response=t.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 lr=class extends ${constructor(t){super("Schema needs to be uploaded",A(t,!0));this.name="SchemaMissingError";this.code="P5005"}};w(lr,"SchemaMissingError");var Li="This request could not be understood by the server",at=class extends ${constructor(t,n,i){super(n||Li,A(t,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};w(at,"BadRequestError");var lt=class extends ${constructor(t,n){super("Engine not started: healthcheck timeout",A(t,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};w(lt,"HealthcheckTimeoutError");var ut=class extends ${constructor(t,n,i){super(n,A(t,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};w(ut,"EngineStartupError");var ct=class extends ${constructor(t){super("Engine version is not supported",A(t,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};w(ct,"EngineVersionNotSupportedError");var Fi="Request timed out",pt=class extends ${constructor(t,n=Fi){super(n,A(t,!1));this.name="GatewayTimeoutError";this.code="P5009"}};w(pt,"GatewayTimeoutError");var em="Interactive transaction error",mt=class extends ${constructor(t,n=em){super(n,A(t,!1));this.name="InteractiveTransactionError";this.code="P5015"}};w(mt,"InteractiveTransactionError");var rm="Request parameters are invalid",dt=class extends ${constructor(t,n=rm){super(n,A(t,!1));this.name="InvalidRequestError";this.code="P5011"}};w(dt,"InvalidRequestError");var Ni="Requested resource does not exist",ft=class extends ${constructor(t,n=Ni){super(n,A(t,!1));this.name="NotFoundError";this.code="P5003"}};w(ft,"NotFoundError");var Mi="Unknown server error",kr=class extends ${constructor(t,n,i){super(n||Mi,A(t,!0));this.name="ServerError";this.code="P5006";this.logs=i}};w(kr,"ServerError");var $i="Unauthorized, check your connection string",gt=class extends ${constructor(t,n=$i){super(n,A(t,!1));this.name="UnauthorizedError";this.code="P5007"}};w(gt,"UnauthorizedError");var qi="Usage exceeded, retry again later",ht=class extends ${constructor(t,n=qi){super(n,A(t,!0));this.name="UsageExceededError";this.code="P5008"}};w(ht,"UsageExceededError");async function tm(e){let r;try{r=await e.text()}catch{return{type:"EmptyError"}}try{let t=JSON.parse(r);if(typeof t=="string")switch(t){case"InternalDataProxyError":return{type:"DataProxyError",body:t};default:return{type:"UnknownTextError",body:t}}if(typeof t=="object"&&t!==null){if("is_panic"in t&&"message"in t&&"error_code"in t)return{type:"QueryEngineError",body:t};if("EngineNotStarted"in t||"InteractiveTransactionMisrouted"in t||"InvalidRequestError"in t){let n=Object.values(t)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:t}:{type:"DataProxyError",body:t}}}return{type:"UnknownJsonError",body:t}}catch{return r===""?{type:"EmptyError"}:{type:"UnknownTextError",body:r}}}async function yt(e,r){if(e.ok)return;let t={clientVersion:r,response:e},n=await tm(e);if(n.type==="QueryEngineError")throw new V(n.body.message,{code:n.body.error_code,clientVersion:r});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new kr(t,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new lr(t);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new ct(t);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new ut(t,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new R(i,r,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new lt(t,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 mt(t,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new dt(t,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new gt(t,Dr($i,n));if(e.status===404)return new ft(t,Dr(Ni,n));if(e.status===429)throw new ht(t,Dr(qi,n));if(e.status===504)throw new pt(t,Dr(Fi,n));if(e.status>=500)throw new kr(t,Dr(Mi,n));if(e.status>=400)throw new at(t,Dr(Li,n))}function Dr(e,r){return r.type==="EmptyError"?e:`${e}: ${JSON.stringify(r)}`}function Ra(e){let r=Math.pow(2,e)*50,t=Math.ceil(Math.random()*r)-Math.ceil(r/2),n=r+t;return new Promise(i=>setTimeout(()=>i(n),n))}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Aa(e){let r=new TextEncoder().encode(e),t="",n=r.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,t+=Ne[s]+Ne[a]+Ne[l]+Ne[u];return i==1?(c=r[o],s=(c&252)>>2,a=(c&3)<<4,t+=Ne[s]+Ne[a]+"=="):i==2&&(c=r[o]<<8|r[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,t+=Ne[s]+Ne[a]+Ne[l]+"="),t}function Ia(e){if(!!e.generator?.previewFeatures.some(t=>t.toLowerCase().includes("metrics")))throw new R("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 nm(e){return e[0]*1e3+e[1]/1e6}function _a(e){return new Date(nm(e))}var ka={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Et=class extends se{constructor(t,n){super(`Cannot fetch data from service: -${t}`,A(n,!0));this.name="RequestError";this.code="P5010"}};w(Et,"RequestError");async function ur(e,r,t=n=>n){let n=r.clientVersion;try{return typeof fetch=="function"?await t(fetch)(e,r):await t(ji)(e,r)}catch(i){let o=i.message??"Unknown error";throw new Et(o,{clientVersion:n})}}function om(e){return{...e.headers,"Content-Type":"application/json"}}function sm(e){return{method:e.method,headers:om(e)}}function am(e,r){return{text:()=>Promise.resolve(Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(Buffer.concat(e).toString())),ok:r.statusCode>=200&&r.statusCode<=299,status:r.statusCode,url:r.url,headers:new Vi(r.headers)}}async function ji(e,r={}){let t=lm("https"),n=sm(r),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{let l=t.request(e,n,u=>{let{statusCode:c,headers:{location:p}}=u;c>=301&&c<=399&&p&&(p.startsWith("http")===!1?s(ji(`${o}${p}`,r)):s(ji(p,r))),u.on("data",m=>i.push(m)),u.on("end",()=>s(am(i,u))),u.on("error",a)});l.on("error",a),l.end(r.body??"")})}var lm=typeof require<"u"?require:()=>{},Vi=class{constructor(r={}){this.headers=new Map;for(let[t,n]of Object.entries(r))if(typeof n=="string")this.headers.set(t,n);else if(Array.isArray(n))for(let i of n)this.headers.set(t,i)}append(r,t){this.headers.set(r,t)}delete(r){this.headers.delete(r)}get(r){return this.headers.get(r)??null}has(r){return this.headers.has(r)}set(r,t){this.headers.set(r,t)}forEach(r,t){for(let[n,i]of this.headers)r.call(t,i,n,this)}};var um=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Da=L("prisma:client:dataproxyEngine");async function cm(e,r){let t=ka["@prisma/engines-version"],n=r.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.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&&um.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=t.split("-")??[],[a,l,u]=s.split("."),c=pm(`<=${a}.${l}.${u}`),p=await ur(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()||""}`);let m=await p.text();Da("length of body fetched from unpkg.com",m.length);let f;try{f=JSON.parse(m)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",m),g}return f.version}throw new ar("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Oa(e,r){let t=await cm(e,r);return Da("version",t),t}function pm(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var La=3,Bi=L("prisma:client:dataproxyEngine"),Ui=class{constructor({apiKey:r,tracingHelper:t,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=r,this.tracingHelper=t,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:r,interactiveTransaction:t}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=r??this.tracingHelper.getTraceParent()),t&&(n["X-transaction-id"]=t.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let r=[];return this.tracingHelper.isEnabled()&&r.push("tracing"),this.logLevel&&r.push(this.logLevel),this.logQueries&&r.push("query"),r}},bt=class{constructor(r){this.name="DataProxyEngine";Ia(r),this.config=r,this.env={...r.env,...typeof process<"u"?process.env:{}},this.inlineSchema=Aa(r.inlineSchema),this.inlineDatasources=r.inlineDatasources,this.inlineSchemaHash=r.inlineSchemaHash,this.clientVersion=r.clientVersion,this.engineHash=r.engineVersion,this.logEmitter=r.logEmitter,this.tracingHelper=r.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[r,t]=this.extractHostAndApiKey();this.host=r,this.headerBuilder=new Ui({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await Oa(r,this.config),Bi("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(r){r?.logs?.length&&r.logs.forEach(t=>{switch(t.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let n=typeof t.attributes.query=="string"?t.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[i]=n.split("/* traceparent");n=i}this.logEmitter.emit("query",{query:n,timestamp:_a(t.timestamp),duration:Number(t.attributes.duration_ms),params:t.attributes.params,target:t.attributes.target})}}}),r?.traces?.length&&this.tracingHelper.createEngineSpan({span:!0,spans:r.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(r){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${r}`}async uploadSchema(){let r={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(r,async()=>{let t=await ur(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});t.ok||Bi("schema response status",t.status);let n=await yt(t,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(r,{traceparent:t,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:r,traceparent:t,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(r,{traceparent:t,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Er(r,n),{batchResult:a,elapsed:l}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:t});return a.map(u=>"errors"in u&&u.errors.length>0?or(u.errors[0],this.clientVersion,this.config.activeProvider):{data:u,elapsed:l})}requestInternal({body:r,traceparent:t,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 ur(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t,interactiveTransaction:i}),body:JSON.stringify(r),clientVersion:this.clientVersion},n);a.ok||Bi("graphql response status",a.status),await this.handleError(await yt(a,this.clientVersion));let l=await a.json(),u=l.extensions;if(u&&this.propagateResponseExtensions(u),l.errors)throw l.errors.length===1?or(l.errors[0],this.config.clientVersion,this.config.activeProvider):new B(l.errors,{clientVersion:this.config.clientVersion});return l}})}async transaction(r,t,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[r]} transaction`,callback:async({logHttpCall:o})=>{if(r==="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 ur(a,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await yt(l,this.clientVersion));let u=await l.json(),c=u.extensions;c&&this.propagateResponseExtensions(c);let p=u.id,m=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:m}}}else{let s=`${n.payload.endpoint}/${r}`;o(s);let a=await ur(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),clientVersion:this.clientVersion});await this.handleError(await yt(a,this.clientVersion));let u=(await a.json()).extensions;u&&this.propagateResponseExtensions(u);return}}})}extractHostAndApiKey(){let r={clientVersion:this.clientVersion},t=Object.keys(this.inlineDatasources)[0],n=Ir({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new sr(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:")throw new sr(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r);let l=a.get("api_key");if(l===null||l.length<1)throw new sr(`Error validating datasource \`${t}\`: the URL must contain a valid API key`,r);return[s,l]}metrics(){throw new ar("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(r){for(let t=0;;t++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${t})`,timestamp:new Date,target:""})};try{return await r.callback({logHttpCall:n})}catch(i){if(!(i instanceof se)||!i.isRetryable)throw i;if(t>=La)throw i instanceof _r?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${t+1}/${La} failed for ${r.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await Ra(t);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(r){if(r instanceof lr)throw await this.uploadSchema(),new _r({clientVersion:this.clientVersion,cause:r});if(r)throw r}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Fa(e){if(e?.kind==="itx")return e.options.id}var Gi=k(require("os")),Na=k(require("path"));var Qi=Symbol("PrismaLibraryEngineCache");function mm(){let e=globalThis;return e[Qi]===void 0&&(e[Qi]={}),e[Qi]}function dm(e){let r=mm();if(r[e]!==void 0)return r[e];let t=Na.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=Gi.default.constants.dlopen.RTLD_LAZY|Gi.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,t,i),r[e]=n.exports,n.exports}var Ma={async loadLibrary(e){let r=await Bn(),t=await wa("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>dm(t))}catch(n){let i=ei({e:n,platformInfo:r,id:t});throw new R(i,e.clientVersion)}}};var Ji,$a={async loadLibrary(e){let{clientVersion:r,adapter:t,engineWasm:n}=e;if(t===void 0)throw new R(`The \`adapter\` option for \`PrismaClient\` is required in this context (${fn().prettyName})`,r);if(n===void 0)throw new R("WASM engine was unexpectedly `undefined`",r);Ji===void 0&&(Ji=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new R("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",r);let a={"./query_engine_bg.js":o},l=new WebAssembly.Instance(s,a);return o.__wbg_set_wasm(l.exports),o.QueryEngine})());let i=await Ji;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var fm="P2036",Re=L("prisma:client:libraryEngine");function gm(e){return e.item_type==="query"&&"query"in e}function hm(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var qa=[...Mn,"native"],ja=0,wt=class{constructor(r,t){this.name="LibraryEngine";this.libraryLoader=t??Ma,r.engineWasm!==void 0&&(this.libraryLoader=t??$a),this.config=r,this.libraryStarted=!1,this.logQueries=r.logQueries??!1,this.logLevel=r.logLevel??"error",this.logEmitter=r.logEmitter,this.datamodel=r.inlineSchema,r.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(r.overrideDatasources)[0],i=r.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary(),this.checkForTooManyEngines()}checkForTooManyEngines(){ja===10&&console.warn(`${fe("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(r,t,n){await this.start();let i=JSON.stringify(t),o;if(r==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else r==="commit"?o=await this.engine?.commitTransaction(n.id,i):r==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(ym(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new V(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(Re("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;Nn(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let r=await er();if(!qa.includes(r))throw new R(`Unknown ${ue("PRISMA_QUERY_ENGINE_LIBRARY")} ${ue(H(r))}. Possible binaryTargets: ${Me(qa.join(", "))} or a path to the query engine library. -You may have to run ${Me("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return r}}parseEngineResponse(r){if(!r)throw new B("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(r)}catch{throw new B("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let r=new WeakRef(this),{adapter:t}=this.config;t&&Re("Using driver adapter: %O",t),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{r.deref()?.logger(n)},t),ja++}catch(r){let t=r,n=this.parseInitError(t.message);throw typeof n=="string"?t:new R(n.message,this.config.clientVersion,n.error_code)}}}logger(r){let t=this.parseEngineResponse(r);if(t){if("span"in t){this.config.tracingHelper.createEngineSpan(t);return}t.level=t?.level.toLowerCase()??"unknown",gm(t)?this.logEmitter.emit("query",{timestamp:new Date,query:t.query,params:t.params,duration:Number(t.duration_ms),target:t.module_path}):hm(t)?this.loggerRustPanic=new le(Hi(this,`${t.message}: ${t.reason} in ${t.file}:${t.line}:${t.column}`),this.config.clientVersion):this.logEmitter.emit(t.level,{timestamp:new Date,message:t.message,target:t.module_path})}}parseInitError(r){try{return JSON.parse(r)}catch{}return r}parseRequestError(r){try{return JSON.parse(r)}catch{}return r}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Re(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let r=async()=>{Re("library starting");try{let t={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(t)),this.libraryStarted=!0,Re("library started")}catch(t){let n=this.parseInitError(t.message);throw typeof n=="string"?t:new R(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",r),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Re("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let r=async()=>{await new Promise(n=>setTimeout(n,5)),Re("library stopping");let t={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(t)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,Re("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",r),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(r){return this.library?.debugPanic(r)}async request(r,{traceparent:t,interactiveTransaction:n}){Re(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:t}),o=JSON.stringify(r);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new B(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof R)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new le(Hi(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new B(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(r,{transaction:t,traceparent:n}){Re("requestBatch");let i=Er(r,t);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Fa(t));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new B(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:l}=s;if(Array.isArray(a))return a.map(u=>u.errors&&u.errors.length>0?this.loggerRustPanic??this.buildQueryError(u.errors[0]):{data:u,elapsed:0});throw l&&l.length===1?new Error(l[0].error):new Error(JSON.stringify(s))}buildQueryError(r){if(r.user_facing_error.is_panic)return new le(Hi(this,r.user_facing_error.message),this.config.clientVersion);let t=this.getExternalAdapterError(r.user_facing_error);return t?t.error:or(r,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(r){if(r.error_code===fm&&this.config.adapter){let t=r.meta?.id;jt(typeof t=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(t);return jt(n,"External error with reported id was not registered"),n}}async metrics(r){await this.start();let t=await this.engine.metrics(JSON.stringify(r));return r.format==="prometheus"?t:this.parseEngineResponse(t)}};function ym(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function Hi(e,r){return Sa({binaryTarget:e.binaryTarget,title:r,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function Va({copyEngine:e=!0},r){let t;try{t=Ir({inlineDatasources:r.inlineDatasources,overrideDatasources:r.overrideDatasources,env:{...r.env,...process.env},clientVersion:r.clientVersion})}catch{}e&&t?.startsWith("prisma://")&&Hr("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Ur(r.generator),i=!!(t?.startsWith("prisma://")||!e),o=!!r.adapter,s=n==="library",a=n==="binary";if(i&&o||o&&!1){let l;throw e?t?.startsWith("prisma://")?l=["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."]:l=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:l=["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 W(l.join(` -`),{clientVersion:r.clientVersion})}if(i)return new bt(r);if(s)return new wt(r);throw new W("Invalid client engine type, please use `library` or `binary`",{clientVersion:r.clientVersion})}function bn({generator:e}){return e?.previewFeatures??[]}var Ha=k(Wi());function Ga(e,r){let t=Ja(e),n=Em(t),i=wm(n);i?wn(i,r):r.addErrorMessage(()=>"Unknown error")}function Ja(e){return e.errors.flatMap(r=>r.kind==="Union"?Ja(r):[r])}function Em(e){let r=new Map,t=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){t.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=r.get(i);o?r.set(i,{...n,argument:{...n.argument,typeNames:bm(o.argument.typeNames,n.argument.typeNames)}}):r.set(i,n)}return t.push(...r.values()),t}function bm(e,r){return[...new Set(e.concat(r))]}function wm(e){return mi(e,(r,t)=>{let n=Ua(r),i=Ua(t);return n!==i?n-i:Qa(r)-Qa(t)})}function Ua(e){let r=0;return Array.isArray(e.selectionPath)&&(r+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(r+=e.argumentPath.length),r}function Qa(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var me=class{constructor(r,t){this.name=r;this.value=t;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(r){let{colors:{green:t}}=r.context;r.addMarginSymbol(t(this.isRequired?"+":"?")),r.write(t(this.name)),this.isRequired||r.write(t("?")),r.write(t(": ")),typeof this.value=="string"?r.write(t(this.value)):r.write(this.value)}};var xn=class{constructor(){this.fields=[]}addField(r,t){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${r}: ${t}`))).addMarginSymbol(i(o("+")))}}),this}write(r){let{colors:{green:t}}=r.context;r.writeLine(t("{")).withIndent(()=>{r.writeJoined(Cr,this.fields).newLine()}).write(t("}")).addMarginSymbol(t("+"))}};function wn(e,r){switch(e.kind){case"MutuallyExclusiveFields":xm(e,r);break;case"IncludeOnScalar":Pm(e,r);break;case"EmptySelection":vm(e,r);break;case"UnknownSelectionField":Sm(e,r);break;case"UnknownArgument":Rm(e,r);break;case"UnknownInputField":Am(e,r);break;case"RequiredArgumentMissing":Im(e,r);break;case"InvalidArgumentType":_m(e,r);break;case"InvalidArgumentValue":km(e,r);break;case"ValueTooLarge":Dm(e,r);break;case"SomeFieldsMissing":Om(e,r);break;case"TooManyFieldsGiven":Lm(e,r);break;case"Union":Ga(e,r);break;default:throw new Error("not implemented: "+e.kind)}}function xm(e,r){let t=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();t&&(t.getField(e.firstField)?.markAsError(),t.getField(e.secondField)?.markAsError()),r.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Pm(e,r){let[t,n]=Pn(e.selectionPath),i=e.outputType,o=r.arguments.getDeepSelectionParent(t)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new me(s.name,"true"));r.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${xt(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function vm(e,r){let t=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(t){let n=t.getField("omit")?.value.asObject();if(n){Tm(e,r,n);return}}Cm(e,r)}function Tm(e,r,t){t.removeAllFields();for(let n of e.outputType.fields)t.addSuggestion(new me(n.name,"false"));r.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Cm(e,r){let t=e.outputType,n=r.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Ya(n,t)),r.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(t.name)} must not be empty. ${xt(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(t.name)} needs ${o.bold("at least one truthy value")}.`)}function Sm(e,r){let[t,n]=Pn(e.selectionPath),i=r.arguments.getDeepSubSelectionValue(t)?.asObject(),o;if(i){let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),l=i.getFieldValue("omit")?.asObject();s?.hasField(n)?(o="select",s.getField(n)?.markAsError(),Ya(s,e.outputType)):a?.hasField(n)?(o="include",a.getField(n)?.markAsError(),Fm(a,e.outputType)):l?.hasField(n)&&(o="omit",l.getField(n)?.markAsError(),Nm(l,e.outputType))}r.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(xt(s)),a.join(" ")})}function Rm(e,r){let t=e.argumentPath[0],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(t)?.markAsError(),Mm(n,e.arguments)),r.addErrorMessage(i=>Wa(i,t,e.arguments.map(o=>o.name)))}function Am(e,r){let[t,n]=Pn(e.argumentPath),i=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(t)?.asObject();o&&za(o,e.inputType)}r.addErrorMessage(o=>Wa(o,n,e.inputType.fields.map(s=>s.name)))}function Wa(e,r,t){let n=[`Unknown argument \`${e.red(r)}\`.`],i=qm(r,t);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),t.length>0&&n.push(xt(e)),n.join(" ")}function Im(e,r){let t;r.addErrorMessage(l=>t?.value instanceof J&&t.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Pn(e.argumentPath),s=new xn,a=n.getDeepFieldValue(i)?.asObject();if(a)if(t=a.getField(o),t&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new me(o,s).makeRequired())}else{let l=e.inputTypes.map(Ka).join(" | ");a.addSuggestion(new me(o,l).makeRequired())}}function Ka(e){return e.kind==="list"?`${Ka(e.elementType)}[]`:e.name}function _m(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),r.addErrorMessage(i=>{let o=vn("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(t)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function km(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),r.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(t)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=vn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Dm(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof J&&(i=s.text)}r.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(t)}\``),s.join(" ")})}function Om(e,r){let t=e.argumentPath[e.argumentPath.length-1],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&za(i,e.inputType)}r.addErrorMessage(i=>{let o=[`Argument \`${i.bold(t)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${vn("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(xt(i)),o.join(" ")})}function Lm(e,r){let t=e.argumentPath[e.argumentPath.length-1],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}r.addErrorMessage(o=>{let s=[`Argument \`${o.bold(t)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${vn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Ya(e,r){for(let t of r.fields)e.hasField(t.name)||e.addSuggestion(new me(t.name,"true"))}function Fm(e,r){for(let t of r.fields)t.isRelation&&!e.hasField(t.name)&&e.addSuggestion(new me(t.name,"true"))}function Nm(e,r){for(let t of r.fields)!e.hasField(t.name)&&!t.isRelation&&e.addSuggestion(new me(t.name,"true"))}function Mm(e,r){for(let t of r)e.hasField(t.name)||e.addSuggestion(new me(t.name,t.typeNames.join(" | ")))}function za(e,r){if(r.kind==="object")for(let t of r.fields)e.hasField(t.name)||e.addSuggestion(new me(t.name,t.typeNames.join(" | ")))}function Pn(e){let r=[...e],t=r.pop();if(!t)throw new Error("unexpected empty path");return[r,t]}function xt({green:e,enabled:r}){return"Available options are "+(r?`listed in ${e("green")}`:"marked with ?")+"."}function vn(e,r){if(r.length===1)return r[0];let t=[...r],n=t.pop();return`${t.join(", ")} ${e} ${n}`}var $m=3;function qm(e,r){let t=1/0,n;for(let i of r){let o=(0,Ha.default)(e,i);o>$m||o({name:r.name,typeName:"boolean",isRelation:r.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(r){return this.params.previewFeatures.includes(r)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(r){return this.model?.fields.find(t=>t.name===r)}nestSelection(r){let t=this.findField(r),n=t?.kind==="object"?t.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(r)})}nestArgument(r){return new e({...this.params,argumentPath:this.params.argumentPath.concat(r)})}};var rl=e=>({command:e});var tl=e=>e.strings.reduce((r,t,n)=>`${r}@P${n}${t}`);function Pt(e){try{return nl(e,"fast")}catch{return nl(e,"slow")}}function nl(e,r){return JSON.stringify(e.map(t=>Km(t,r)))}function Km(e,r){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:wr(e)?{prisma__type:"date",prisma__value:e.toJSON()}:Te.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Ym(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")}:typeof e=="object"&&r==="slow"?ol(e):e}function Ym(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function ol(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(il);let r={};for(let t of Object.keys(e))r[t]=il(e[t]);return r}function il(e){return typeof e=="bigint"?e.toString():ol(e)}var zm=/^(\s*alter\s)/i,sl=L("prisma:client");function zi(e,r,t,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&t.length>0&&zm.exec(r))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Zi=({clientMethod:e,activeProvider:r})=>t=>{let n="",i;if(Array.isArray(t)){let[o,...s]=t;n=o,i={values:Pt(s||[]),__prismaRawParameters__:!0}}else switch(r){case"sqlite":case"mysql":{n=t.sql,i={values:Pt(t.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=t.text,i={values:Pt(t.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=tl(t),i={values:Pt(t.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${r} provider does not support ${e}`)}return i?.values?sl(`prisma.${e}(${n}, ${i.values})`):sl(`prisma.${e}(${n})`),{query:n,parameters:i}},al={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[r,...t]=e;return new ie(r,t)}},ll={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Xi(e){return function(t){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??(n=ul(t(o))):ul(t(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function ul(e){return typeof e.then=="function"?e:Promise.resolve(e)}var cl={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,r){return r()}},eo=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(r){return this.getGlobalTracingHelper().getTraceParent(r)}createEngineSpan(r){return this.getGlobalTracingHelper().createEngineSpan(r)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(r,t){return this.getGlobalTracingHelper().runInChildSpan(r,t)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??cl}};function pl(e){return e.includes("tracing")?new eo:cl}function ml(e,r=()=>{}){let t,n=new Promise(i=>t=i);return{then(i){return--e===0&&t(r()),i?.(n)}}}var Zm=["$connect","$disconnect","$on","$transaction","$use","$extends"],dl=Zm;function fl(e){return typeof e=="string"?e:e.reduce((r,t)=>{let n=typeof t=="string"?t:t.level;return n==="query"?r:r&&(t==="info"||r==="info")?"info":n},void 0)}var Cn=class{constructor(){this._middlewares=[]}use(r){this._middlewares.push(r)}get(r){return this._middlewares[r]}has(r){return!!this._middlewares[r]}length(){return this._middlewares.length}};var hl=k(ui());function Sn(e){return typeof e.batchRequestIdx=="number"}function Rn(e){return e===null?e:Array.isArray(e)?e.map(Rn):typeof e=="object"?Xm(e)?ed(e):gr(e,Rn):e}function Xm(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function ed({$type:e,value:r}){switch(e){case"BigInt":return BigInt(r);case"Bytes":return Buffer.from(r,"base64");case"DateTime":return new Date(r);case"Decimal":return new Te(r);case"Json":return JSON.parse(r);default:rr(r,"Unknown tagged value")}}function gl(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let r=[];return e.modelName&&r.push(e.modelName),e.query.arguments&&r.push(ro(e.query.arguments)),r.push(ro(e.query.selection)),r.join("")}function ro(e){return`(${Object.keys(e).sort().map(t=>{let n=e[t];return typeof n=="object"&&n!==null?`(${t} ${ro(n)})`:t}).join(" ")})`}var rd={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function to(e){return rd[e]}var An=class{constructor(r){this.options=r;this.tickActive=!1;this.batches={}}request(r){let t=this.options.batchBy(r);return t?(this.batches[t]||(this.batches[t]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[t].push({request:r,resolve:n,reject:i})})):this.options.singleLoader(r)}dispatchBatches(){for(let r in this.batches){let t=this.batches[r];delete this.batches[r],t.length===1?this.options.singleLoader(t[0].request).then(n=>{n instanceof Error?t[0].reject(n):t[0].resolve(n)}).catch(n=>{t[0].reject(n)}):(t.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(t.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>to(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:nd(o),containsWrite:u,customDataProxyFetch:i})).map((p,m)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[m],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?yl(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:to(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:gl(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(r){try{return await this.dataloader.request(r)}catch(t){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=r;this.handleAndLogRequestError({error:t,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:r,unpacker:t},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,r,t);return process.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(r){try{this.handleRequestError(r)}catch(t){throw this.logEmitter&&this.logEmitter.emit("error",{message:t.message,target:r.clientMethod,timestamp:new Date}),t}}handleRequestError({error:r,clientMethod:t,callsite:n,transaction:i,args:o,modelName:s}){if(td(r),id(r,i)||r instanceof Oe)throw r;if(r instanceof V&&od(r)){let l=El(r.meta);Tn({args:o,errors:[l],callsite:n,errorFormat:this.client._errorFormat,originalMethod:t,clientVersion:this.client._clientVersion})}let a=r.message;if(n&&(a=Ar({callsite:n,originalMethod:t,isPanic:r.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),r.code){let l=s?{modelName:s,...r.meta}:r.meta;throw new V(a,{code:r.code,clientVersion:this.client._clientVersion,meta:l,batchRequestIdx:r.batchRequestIdx})}else{if(r.isPanic)throw new le(a,this.client._clientVersion);if(r instanceof B)throw new B(a,{clientVersion:this.client._clientVersion,batchRequestIdx:r.batchRequestIdx});if(r instanceof R)throw new R(a,this.client._clientVersion);if(r instanceof le)throw new le(a,this.client._clientVersion)}throw r.clientVersion=this.client._clientVersion,r}sanitizeMessage(r){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,hl.default)(r):r}unpack(r,t,n){if(!r||(r.data&&(r=r.data),!r))return r;let i=Object.values(r)[0],o=t.filter(a=>a!=="select"&&a!=="include"),s=Rn(Ii(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function nd(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:yl(e)};rr(e,"Unknown transaction kind")}}function yl(e){return{id:e.id,payload:e.payload}}function id(e,r){return Sn(e)&&r?.kind==="batch"&&e.batchRequestIdx!==r.index}function od(e){return e.code==="P2009"||e.code==="P2012"}function El(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(El)};if(Array.isArray(e.selectionPath)){let[,...r]=e.selectionPath;return{...e,selectionPath:r}}return e}var bl="5.14.0";var wl=bl;function xl(e){return e.map(r=>{let t={};for(let n of Object.keys(r))t[n]=Pl(r[n]);return t})}function Pl({prisma__type:e,prisma__value:r}){switch(e){case"bigint":return BigInt(r);case"bytes":return Buffer.from(r,"base64");case"decimal":return new Te(r);case"datetime":case"date":return new Date(r);case"time":return new Date(`1970-01-01T${r}Z`);case"array":return r.map(Pl);default:return r}}var Sl=k(Wi());var q=class extends Error{constructor(r){super(r+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};w(q,"PrismaClientConstructorValidationError");var vl=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Tl=["pretty","colorless","minimal"],Cl=["info","query","warn","error"],ad={datasources:(e,{datasourceNames:r})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[t,n]of Object.entries(e)){if(!r.includes(t)){let i=Or(t,r)||` Available datasources: ${r.join(", ")}`;throw new q(`Unknown datasource ${t} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new q(`Invalid value ${JSON.stringify(o)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,r)=>{if(e===null)return;if(e===void 0)throw new q('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!bn(r).includes("driverAdapters"))throw new q('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Ur()==="binary")throw new q('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Tl.includes(e)){let r=Or(e,Tl);throw new q(`Invalid errorFormat ${e} provided to PrismaClient constructor.${r}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function r(t){if(typeof t=="string"&&!Cl.includes(t)){let n=Or(t,Cl);throw new q(`Invalid log level "${t}" provided to PrismaClient constructor.${n}`)}}for(let t of e){r(t);let n={level:r,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Or(i,o);throw new q(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(t&&typeof t=="object")for(let[i,o]of Object.entries(t))if(n[i])n[i](o);else throw new q(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let r=e.maxWait;if(r!=null&&r<=0)throw new q(`Invalid value ${r} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let t=e.timeout;if(t!=null&&t<=0)throw new q(`Invalid value ${t} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let r=["debug","engine","configOverride"];if(typeof e!="object")throw new q(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[t]of Object.entries(e))if(!r.includes(t)){let n=Or(t,r);throw new q(`Invalid property ${JSON.stringify(t)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Rl(e,r){for(let[t,n]of Object.entries(e)){if(!vl.includes(t)){let i=Or(t,vl);throw new q(`Unknown property ${t} provided to PrismaClient constructor.${i}`)}ad[t](n,r)}if(e.datasourceUrl&&e.datasources)throw new q('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Or(e,r){if(r.length===0||typeof e!="string")return"";let t=ld(e,r);return t?` Did you mean "${t}"?`:""}function ld(e,r){if(r.length===0)return null;let t=r.map(i=>({value:i,distance:(0,Sl.default)(e,i)}));t.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?t(i):r(n)))},l=u=>{o||(o=!0,t(u))};for(let u=0;u{n[u]=c,a()},c=>{if(!Sn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var Ye=L("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var ud={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},cd=Symbol.for("prisma.client.transaction.id"),pd={id:0,nextId(){return++this.id}};function Ll(e){class r{constructor(n){this._originalClient=this;this._middlewares=new Cn;this._createPrismaPromise=Xi();this.$extends=Ks;e=n?.__internal?.configOverride?.(e)??e,ma(e),n&&Rl(n,e);let i=n?.adapter?yi(n.adapter):void 0,o=new Dl.EventEmitter().on("error",()=>{});this._extensions=dn.empty(),this._previewFeatures=bn(e),this._clientVersion=e.clientVersion??wl,this._activeProvider=e.activeProvider,this._tracingHelper=pl(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&vt.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&vt.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=!i&&Br(s,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&L.enable("prisma:client");let p=vt.default.resolve(e.dirname,e.relativePath);Ol.default.existsSync(p)||(p=e.dirname),Ye("dirname",e.dirname),Ye("relativePath",e.relativePath),Ye("cwd",p);let m=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:m.allowTriggerPanic,datamodelPath:vt.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:m.binaryPath??void 0,engineEndpoint:m.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&fl(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(f=>typeof f=="string"?f==="query":f.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:da(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Ir,getBatchRequestPayload:Er,prismaGraphQLToJSError:or,PrismaClientUnknownRequestError:B,PrismaClientInitializationError:R,PrismaClientKnownRequestError:V,debug:L("prisma:client:accelerateEngine"),engineVersion:_l.version,clientVersion:e.clientVersion}},Ye("clientVersion",e.clientVersion),this._engine=Va(e,this._engineConfig),this._requestHandler=new In(this,o),l.log)for(let f of l.log){let g=typeof f=="string"?f:f.emit==="stdout"?f.level:null;g&&this.$on(g,h=>{Jr.log(`${Jr.tags[g]??""}`,h.message||h.query)})}this._metrics=new hr(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=it(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{ho()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Zi({clientMethod:i,activeProvider:a}),callsite:He(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Il(n,i);return zi(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new W("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(zi(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new W(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:rl,callsite:He(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Zi({clientMethod:i,activeProvider:a}),callsite:He(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(xl)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Il(n,i));throw new W("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=pd.nextId(),s=ml(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return Al(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return it(Pe(Ws(this),[te("_appliedParent",()=>this._appliedParent._createItxClient(n)),te("_createPrismaPromise",()=>Xi(n)),te(cd,()=>n.id),yr(dl)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??ud,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,I=>c(u,T=>(I?.end(),l(T))));let{runInTransaction:p,args:m,...f}=u,g={...n,...f};m&&(g.args=i.middlewareArgsToRequestArgs(m)),n.transaction!==void 0&&p===!1&&delete g.transaction;let h=await ta(this,g);return g.model?Zs({result:h,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):h};return this._tracingHelper.runInChildSpan(s.operation,()=>new kl.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:m,customDataProxyFetch:f}){try{n=u?u(n):n;let g={name:"serialize"},h=this._tracingHelper.runInChildSpan(g,()=>Za({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return L.enabled("prisma:client")&&(Ye("Prisma Client call:"),Ye(`prisma.${i}(${_s(n)})`),Ye("Generated request:"),Ye(JSON.stringify(h,null,2)+` -`)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:h,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:m,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:f})}catch(g){throw g.clientVersion=this._clientVersion,g}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new W("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return r}function Il(e,r){return md(e)?[new ie(e,r),al]:[e,ll]}function md(e){return Array.isArray(e)&&Array.isArray(e.raw)}var dd=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Fl(e){return new Proxy(e,{get(r,t){if(t in r)return r[t];if(!dd.has(t))throw new TypeError(`Invalid enum value: ${String(t)}`)}})}function Nl(e){Br(e,{conflictCheck:"warn"})}0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -/*! Bundled license information: - -decimal.js/decimal.mjs: - (*! - * decimal.js v10.4.3 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2022 Michael Mclaughlin - * MIT Licence - *) -*/ -//# sourceMappingURL=library.js.map diff --git a/integration-tests/tests/prisma/mysql/client/runtime/react-native.js b/integration-tests/tests/prisma/mysql/client/runtime/react-native.js deleted file mode 100644 index a800dbe8b..000000000 --- a/integration-tests/tests/prisma/mysql/client/runtime/react-native.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict";var ea=Object.create;var Qt=Object.defineProperty;var ta=Object.getOwnPropertyDescriptor;var ra=Object.getOwnPropertyNames;var na=Object.getPrototypeOf,ia=Object.prototype.hasOwnProperty;var Se=(e,t)=>()=>(e&&(t=e(e=0)),t);var ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ye=(e,t)=>{for(var r in t)Qt(e,r,{get:t[r],enumerable:!0})},jn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ra(t))!ia.call(e,i)&&i!==r&&Qt(e,i,{get:()=>t[i],enumerable:!(n=ta(t,i))||n.enumerable});return e};var fe=(e,t,r)=>(r=e!=null?ea(na(e)):{},jn(t||!e||!e.__esModule?Qt(r,"default",{value:e,enumerable:!0}):r,e)),Dr=e=>jn(Qt({},"__esModule",{value:!0}),e);var y,c=Se(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var x,p=Se(()=>{"use strict";x=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,f=Se(()=>{"use strict";E=()=>{};E.prototype=E});var b,d=Se(()=>{"use strict";b=class{constructor(t){this.value=t}deref(){return this.value}}});var oi=ce(tt=>{"use strict";m();c();p();f();d();var Jn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),oa=Jn(e=>{"use strict";e.byteLength=l,e.toByteArray=g,e.fromByteArray=R;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var F=C.indexOf("=");F===-1&&(F=A);var L=F===A?0:4-F%4;return[F,L]}function l(C){var A=a(C),F=A[0],L=A[1];return(F+L)*3/4-L}function u(C,A,F){return(A+F)*3/4-F}function g(C){var A,F=a(C),L=F[0],N=F[1],M=new n(u(C,L,N)),k=0,z=N>0?L-4:L,j;for(j=0;j>16&255,M[k++]=A>>8&255,M[k++]=A&255;return N===2&&(A=r[C.charCodeAt(j)]<<2|r[C.charCodeAt(j+1)]>>4,M[k++]=A&255),N===1&&(A=r[C.charCodeAt(j)]<<10|r[C.charCodeAt(j+1)]<<4|r[C.charCodeAt(j+2)]>>2,M[k++]=A>>8&255,M[k++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function v(C,A,F){for(var L,N=[],M=A;Mz?z:k+M));return L===1?(A=C[F-1],N.push(t[A>>2]+t[A<<4&63]+"==")):L===2&&(A=(C[F-2]<<8)+C[F-1],N.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),N.join("")}}),sa=Jn(e=>{e.read=function(t,r,n,i,o){var s,a,l=o*8-i-1,u=(1<>1,h=-7,v=n?o-1:0,R=n?-1:1,C=t[r+v];for(v+=R,s=C&(1<<-h)-1,C>>=-h,h+=l;h>0;s=s*256+t[r+v],v+=R,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+v],v+=R,h-=8);if(s===0)s=1-g;else{if(s===u)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,l,u,g=s*8-o-1,h=(1<>1,R=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,F=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+v>=1?r+=R/u:r+=R*Math.pow(2,1-v),r*u>=2&&(a++,u/=2),a+v>=h?(l=0,a=h):a+v>=1?(l=(r*u-1)*Math.pow(2,o),a=a+v):(l=r*Math.pow(2,v-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=l&255,C+=A,l/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=F*128}}),Br=oa(),Xe=sa(),Un=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;tt.Buffer=T;tt.SlowBuffer=fa;tt.INSPECT_MAX_BYTES=50;var Jt=2147483647;tt.kMaxLength=Jt;T.TYPED_ARRAY_SUPPORT=aa();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function aa(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function Re(e){if(e>Jt)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ur(e)}return Wn(e,t,r)}T.poolSize=8192;function Wn(e,t,r){if(typeof e=="string")return ua(e,t);if(ArrayBuffer.isView(e))return ca(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ye(e,ArrayBuffer)||e&&ye(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ye(e,SharedArrayBuffer)||e&&ye(e.buffer,SharedArrayBuffer)))return Hn(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=pa(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return Wn(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function Gn(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function la(e,t,r){return Gn(e),e<=0?Re(e):t!==void 0?typeof r=="string"?Re(e).fill(t,r):Re(e).fill(t):Re(e)}T.alloc=function(e,t,r){return la(e,t,r)};function Ur(e){return Gn(e),Re(e<0?0:qr(e)|0)}T.allocUnsafe=function(e){return Ur(e)};T.allocUnsafeSlow=function(e){return Ur(e)};function ua(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=Kn(e,t)|0,n=Re(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function $r(e){let t=e.length<0?0:qr(e.length)|0,r=Re(t);for(let n=0;n=Jt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Jt.toString(16)+" bytes");return e|0}function fa(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(ye(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),ye(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function Kn(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ye(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return jr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ii(e).length;default:if(i)return n?-1:jr(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=Kn;function da(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Pa(this,t,r);case"utf8":case"utf-8":return Yn(this,t,r);case"ascii":return xa(this,t,r);case"latin1":case"binary":return va(this,t,r);case"base64":return ba(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ta(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function qe(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Un&&(T.prototype[Un]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(ye(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Qr(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:qn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):qn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function qn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function l(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let u;if(i){let g=-1;for(u=r;us&&(r=s-a),u=r;u>=0;u--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return ma(this,e,t,r);case"utf8":case"utf-8":return ga(this,e,t,r);case"ascii":case"latin1":case"binary":return ha(this,e,t,r);case"base64":return ya(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wa(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ba(e,t,r){return t===0&&r===e.length?Br.fromByteArray(e):Br.fromByteArray(e.slice(t,r))}function Yn(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,u,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[i+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(s=h));break;case 3:l=e[i+1],u=e[i+2],(l&192)===128&&(u&192)===128&&(h=(o&15)<<12|(l&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=e[i+1],u=e[i+2],g=e[i+3],(l&192)===128&&(u&192)===128&&(g&192)===128&&(h=(o&15)<<18|(l&63)<<12|(u&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ea(n)}var Vn=4096;function Ea(e){let t=e.length;if(t<=Vn)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=_e(function(e){e=e>>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=_e(function(e){e=e>>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),Xe.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),Xe.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),Xe.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),Xe.read(this,e,!1,52,8)};function oe(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;oe(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;oe(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function Zn(e,t,r,n,i){ni(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function Xn(e,t,r,n,i){ni(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=_e(function(e,t=0){return Zn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=_e(function(e,t=0){return Xn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);oe(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);oe(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=_e(function(e,t=0){return Zn(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=_e(function(e,t=0){return Xn(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ei(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ti(e,t,r,n,i){return t=+t,r=r>>>0,i||ei(e,t,r,4,34028234663852886e22,-34028234663852886e22),Xe.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return ti(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return ti(this,e,t,!1,r)};function ri(e,t,r,n,i){return t=+t,r=r>>>0,i||ei(e,t,r,8,17976931348623157e292,-17976931348623157e292),Xe.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return ri(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return ri(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=Qn(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Qn(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Qn(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Ca(e,t,r){et(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&yt(t,e.length-(r+1))}function ni(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Ze.ERR_OUT_OF_RANGE("value",a,e)}Ca(n,i,o)}function et(e,t){if(typeof e!="number")throw new Ze.ERR_INVALID_ARG_TYPE(t,"number",e)}function yt(e,t,r){throw Math.floor(e)!==e?(et(e,r),new Ze.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Ze.ERR_BUFFER_OUT_OF_BOUNDS:new Ze.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Aa=/[^+/0-9A-Za-z-_]/g;function Sa(e){if(e=e.split("=")[0],e=e.trim().replace(Aa,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function jr(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Ra(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function ii(e){return Br.toByteArray(Sa(e))}function Wt(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ye(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Qr(e){return e!==e}var Oa=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function _e(e){return typeof BigInt>"u"?Fa:e}function Fa(){throw new Error("BigInt not supported")}});var w,m=Se(()=>{"use strict";w=fe(oi())});function Ma(){return!1}var _a,La,Gt,Gr=Se(()=>{"use strict";m();c();p();f();d();_a={},La={existsSync:Ma,promises:_a},Gt=La});var gi=ce((gf,mi)=>{"use strict";m();c();p();f();d();mi.exports=(zr(),Dr(Kr)).format});var Kr={};Ye(Kr,{default:()=>Xa,deprecate:()=>yi,format:()=>bi,inspect:()=>wi,promisify:()=>hi});function hi(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function yi(e,t){return(...r)=>(console.warn(t),e(...r))}function wi(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var bi,Za,Xa,zr=Se(()=>{"use strict";m();c();p();f();d();bi=gi(),Za={promisify:hi,deprecate:yi,inspect:wi,format:bi},Xa=Za});function il(...e){return e.join("/")}function ol(...e){return e.join("/")}var Ti,sl,al,we,en=Se(()=>{"use strict";m();c();p();f();d();Ti="/",sl={sep:Ti},al={resolve:il,posix:sl,join:ol,sep:Ti},we=al});var Ci=ce(()=>{"use strict";m();c();p();f();d()});var Ri=ce((fd,Si)=>{"use strict";m();c();p();f();d();Si.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Oi=ce((wd,ki)=>{"use strict";m();c();p();f();d();var ul=Ri();ki.exports=e=>{let t=ul(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var Kt,Fi=Se(()=>{"use strict";m();c();p();f();d();Kt=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var _i=ce((Yd,Mi)=>{"use strict";m();c();p();f();d();Mi.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 Ni=ce((um,Ii)=>{"use strict";m();c();p();f();d();Ii.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 nn=ce((gm,Di)=>{"use strict";m();c();p();f();d();var ml=Ni();Di.exports=e=>typeof e=="string"?e.replace(ml(),""):e});var Bi=ce((_m,Yt)=>{"use strict";m();c();p();f();d();Yt.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()};Yt.exports.default=Yt.exports});var qi=ce((ky,wl)=>{wl.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Vi=ce(()=>{"use strict";m();c();p();f();d()});var Fn=ce((cA,ls)=>{"use strict";m();c();p();f();d();ls.exports=function(){function e(t,r,n,i,o){return tn?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;sZr,Decimal:()=>ve,Extensions:()=>Jr,MetricsClient:()=>nt,NotFoundError:()=>Oe,PrismaClientInitializationError:()=>V,PrismaClientKnownRequestError:()=>G,PrismaClientRustPanicError:()=>ue,PrismaClientUnknownRequestError:()=>H,PrismaClientValidationError:()=>Y,Public:()=>Wr,Sql:()=>se,defineDmmfProperty:()=>Ui,empty:()=>Ji,getPrismaClient:()=>Ys,getRuntime:()=>Zo,join:()=>Qi,makeStrictEnum:()=>Zs,objectEnumValues:()=>Xt,raw:()=>dn,sqltag:()=>mn,warnEnvConflicts:()=>void 0,warnOnce:()=>St});module.exports=Dr(fp);m();c();p();f();d();var Jr={};Ye(Jr,{defineExtension:()=>si,getExtensionContext:()=>ai});m();c();p();f();d();m();c();p();f();d();function si(e){return typeof e=="function"?e:t=>t.$extends(e)}m();c();p();f();d();function ai(e){return e}var Wr={};Ye(Wr,{validator:()=>li});m();c();p();f();d();m();c();p();f();d();function li(...e){return t=>t}m();c();p();f();d();m();c();p();f();d();var Ht={};Ye(Ht,{$:()=>di,bgBlack:()=>Qa,bgBlue:()=>Ha,bgCyan:()=>za,bgGreen:()=>Wa,bgMagenta:()=>Ka,bgRed:()=>Ja,bgWhite:()=>Ya,bgYellow:()=>Ga,black:()=>ja,blue:()=>Je,bold:()=>de,cyan:()=>ke,dim:()=>wt,gray:()=>xt,green:()=>Et,grey:()=>Va,hidden:()=>Ba,inverse:()=>Da,italic:()=>Na,magenta:()=>Ua,red:()=>Ve,reset:()=>Ia,strikethrough:()=>$a,underline:()=>bt,white:()=>qa,yellow:()=>Qe});m();c();p();f();d();var Hr,ui,ci,pi,fi=!0;typeof y<"u"&&({FORCE_COLOR:Hr,NODE_DISABLE_COLORS:ui,NO_COLOR:ci,TERM:pi}=y.env||{},fi=y.stdout&&y.stdout.isTTY);var di={enabled:!ui&&ci==null&&pi!=="dumb"&&(Hr!=null&&Hr!=="0"||fi)};function U(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!di.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Ia=U(0,0),de=U(1,22),wt=U(2,22),Na=U(3,23),bt=U(4,24),Da=U(7,27),Ba=U(8,28),$a=U(9,29),ja=U(30,39),Ve=U(31,39),Et=U(32,39),Qe=U(33,39),Je=U(34,39),Ua=U(35,39),ke=U(36,39),qa=U(37,39),xt=U(90,39),Va=U(90,39),Qa=U(40,49),Ja=U(41,49),Wa=U(42,49),Ga=U(43,49),Ha=U(44,49),Ka=U(45,49),za=U(46,49),Ya=U(47,49);m();c();p();f();d();var el=100,Ei=["green","yellow","blue","magenta","cyan","red"],vt=[],xi=Date.now(),tl=0,Yr=typeof y<"u"?y.env:{};globalThis.DEBUG??=Yr.DEBUG??"";globalThis.DEBUG_COLORS??=Yr.DEBUG_COLORS?Yr.DEBUG_COLORS==="true":!0;var Pt={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,i;typeof require=="function"&&typeof y<"u"&&typeof y.stderr<"u"&&typeof y.stderr.write=="function"?i=(...o)=>{try{let s=(zr(),Dr(Kr));y.stderr.write(s.format(...o)+` -`)}catch{i=console.warn??console.log}}:i=console.warn??console.log,i(`${t} ${r}`,...n)},formatters:{}};function rl(e){let t={color:Ei[tl++%Ei.length],enabled:Pt.enabled(e),namespace:e,log:Pt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&vt.push([o,...n]),vt.length>el&&vt.shift(),Pt.enabled(o)||i){let l=n.map(g=>typeof g=="string"?g:nl(g)),u=`+${Date.now()-xi}ms`;xi=Date.now(),globalThis.DEBUG_COLORS?a(Ht[s](de(o)),...l,Ht[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Zr=new Proxy(rl,{get:(e,t)=>Pt[t],set:(e,t,r)=>Pt[t]=r});function nl(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function vi(e=7500){let t=vt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(` -`);return t.length{let e;(k=>(k.findUnique="findUnique",k.findUniqueOrThrow="findUniqueOrThrow",k.findFirst="findFirst",k.findFirstOrThrow="findFirstOrThrow",k.findMany="findMany",k.create="create",k.createMany="createMany",k.createManyAndReturn="createManyAndReturn",k.update="update",k.updateMany="updateMany",k.upsert="upsert",k.delete="delete",k.deleteMany="deleteMany",k.groupBy="groupBy",k.count="count",k.aggregate="aggregate",k.findRaw="findRaw",k.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Le||={});m();c();p();f();d();en();function tn(e){return we.sep===we.posix.sep?e:e.split(we.sep).join(we.posix.sep)}var At={};Ye(At,{error:()=>fl,info:()=>pl,log:()=>cl,query:()=>dl,should:()=>Li,tags:()=>Ct,warn:()=>rn});m();c();p();f();d();var Ct={error:Ve("prisma:error"),warn:Qe("prisma:warn"),info:ke("prisma:info"),query:Je("prisma:query")},Li={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function cl(...e){console.log(...e)}function rn(e,...t){Li.warn()&&console.warn(`${Ct.warn} ${e}`,...t)}function pl(e,...t){console.info(`${Ct.info} ${e}`,...t)}function fl(e,...t){console.error(`${Ct.error} ${e}`,...t)}function dl(e,...t){console.log(`${Ct.query} ${e}`,...t)}m();c();p();f();d();function zt(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}m();c();p();f();d();function We(e,t){throw new Error(t)}m();c();p();f();d();function on(e,t){return Object.prototype.hasOwnProperty.call(e,t)}m();c();p();f();d();var sn=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});m();c();p();f();d();function rt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}m();c();p();f();d();function an(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{$i.has(e)||($i.add(e),rn(t,...r))};m();c();p();f();d();var G=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};re(G,"PrismaClientKnownRequestError");var Oe=class extends G{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};re(Oe,"NotFoundError");m();c();p();f();d();var V=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};re(V,"PrismaClientInitializationError");m();c();p();f();d();var ue=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};re(ue,"PrismaClientRustPanicError");m();c();p();f();d();var H=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};re(H,"PrismaClientUnknownRequestError");m();c();p();f();d();var Y=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};re(Y,"PrismaClientValidationError");m();c();p();f();d();var nt=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};m();c();p();f();d();m();c();p();f();d();function Rt(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Ui(e,t){let r=Rt(()=>gl(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function gl(e){return{datamodel:{models:ln(e.models),enums:ln(e.enums),types:ln(e.types)}}}function ln(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}m();c();p();f();d();var Zt=Symbol(),un=new WeakMap,Fe=class{constructor(t){t===Zt?un.set(this,`Prisma.${this._getName()}`):un.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return un.get(this)}},kt=class extends Fe{_getNamespace(){return"NullTypes"}},Ot=class extends kt{};cn(Ot,"DbNull");var Ft=class extends kt{};cn(Ft,"JsonNull");var Mt=class extends kt{};cn(Mt,"AnyNull");var Xt={classes:{DbNull:Ot,JsonNull:Ft,AnyNull:Mt},instances:{DbNull:new Ot(Zt),JsonNull:new Ft(Zt),AnyNull:new Mt(Zt)}};function cn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();function _t(e){return{ok:!1,error:e,map(){return _t(e)},flatMap(){return _t(e)}}}var pn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},fn=e=>{let t=new pn,r=Ge(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Ge(t,e.queryRaw.bind(e)),executeRaw:Ge(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>hl(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=yl(t,e.getConnectionInfo.bind(e))),n},hl=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Ge(e,t.queryRaw.bind(t)),executeRaw:Ge(e,t.executeRaw.bind(t)),commit:Ge(e,t.commit.bind(t)),rollback:Ge(e,t.rollback.bind(t))});function Ge(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}function yl(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}var zs=fe(qi());var wk=fe(Vi());Fi();Gr();en();m();c();p();f();d();var se=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}m();c();p();f();d();m();c();p();f();d();var er={enumerable:!0,configurable:!0,writable:!0};function tr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>er,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Wi=Symbol.for("nodejs.util.inspect.custom");function Ee(e,t){let r=bl(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Gi(Reflect.ownKeys(o),r),a=Gi(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...er,...l?.getPropertyDescriptor(s)}:er:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[Wi]=function(){let o={...this};return delete o[Wi],o},i}function bl(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Gi(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}m();c();p();f();d();function it(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}m();c();p();f();d();function rr(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}m();c();p();f();d();m();c();p();f();d();var ot=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};m();c();p();f();d();m();c();p();f();d();function Hi(e){return e.substring(0,1).toLowerCase()+e.substring(1)}m();c();p();f();d();function st(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function nr(e){return e.toString()!=="Invalid Date"}m();c();p();f();d();m();c();p();f();d();var at=9e15,Be=1e9,gn="0123456789abcdef",or="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",sr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",hn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-at,maxE:at,crypto:!1},Zi,Me,I=!0,lr="[DecimalError] ",De=lr+"Invalid argument: ",Xi=lr+"Precision limit exceeded",eo=lr+"crypto unavailable",to="[object Decimal]",te=Math.floor,J=Math.pow,El=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,xl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,vl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ro=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,_=7,Pl=9007199254740991,Tl=or.length-1,yn=sr.length-1,S={toStringTag:to};S.absoluteValue=S.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),O(e)};S.ceil=function(){return O(new this.constructor(this),this.e+1,2)};S.clampedTo=S.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(De+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};S.comparedTo=S.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};S.cosine=S.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+_,n.rounding=1,r=Cl(n,ao(n,r)),n.precision=e,n.rounding=t,O(Me==2||Me==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};S.cubeRoot=S.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(I=!1,o=g.s*J(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Z(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=J(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(g),n=$(u.plus(g).times(a),u.plus(l),s+2,1),Z(a.d).slice(0,s)===(r=Z(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(O(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(O(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return I=!0,O(n,e,h.rounding,t)};S.decimalPlaces=S.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/_))*_,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};S.dividedBy=S.div=function(e){return $(this,new this.constructor(e))};S.dividedToIntegerBy=S.divToInt=function(e){var t=this,r=t.constructor;return O($(t,new r(e),0,1,1),r.precision,r.rounding)};S.equals=S.eq=function(e){return this.cmp(e)===0};S.floor=function(){return O(new this.constructor(this),this.e+1,3)};S.greaterThan=S.gt=function(e){return this.cmp(e)>0};S.greaterThanOrEqualTo=S.gte=function(e){var t=this.cmp(e);return t==1||t===0};S.hyperbolicCosine=S.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/cr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=lt(s,1,o.times(t),new s(1),!0);for(var l,u=e,g=new s(8);u--;)l=o.times(o),o=a.minus(l.times(g.minus(l.times(g))));return O(o,s.precision=r,s.rounding=n,!0)};S.hyperbolicSine=S.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=lt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/cr(5,e)),i=lt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,O(i,t,r,!0)};S.hyperbolicTangent=S.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,$(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};S.inverseCosine=S.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?me(r,i,o):new r(0):new r(NaN):t.isZero()?me(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=me(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};S.inverseHyperbolicCosine=S.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,I=!1,r=r.times(r).minus(1).sqrt().plus(r),I=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};S.inverseHyperbolicSine=S.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,I=!1,r=r.times(r).plus(1).sqrt().plus(r),I=!0,n.precision=e,n.rounding=t,r.ln())};S.inverseHyperbolicTangent=S.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?O(new o(i),e,t,!0):(o.precision=r=n-i.e,i=$(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};S.inverseSine=S.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=me(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};S.inverseTangent=S.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding;if(u.isFinite()){if(u.isZero())return new g(u);if(u.abs().eq(1)&&h+4<=yn)return s=me(g,h+4,v).times(.25),s.s=u.s,s}else{if(!u.s)return new g(NaN);if(h+4<=yn)return s=me(g,h+4,v).times(.5),s.s=u.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/_+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(I=!1,t=Math.ceil(a/_),n=1,l=u.times(u),s=new g(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};S.isNaN=function(){return!this.s};S.isNegative=S.isNeg=function(){return this.s<0};S.isPositive=S.isPos=function(){return this.s>0};S.isZero=function(){return!!this.d&&this.d[0]===0};S.lessThan=S.lt=function(e){return this.cmp(e)<0};S.lessThanOrEqualTo=S.lte=function(e){return this.cmp(e)<1};S.logarithm=S.log=function(e){var t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding,R=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new g(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(I=!1,a=h+R,s=Ne(u,a),n=t?ar(g,a+10):Ne(e,a),l=$(s,n,a,1),It(l.d,i=h,v))do if(a+=10,s=Ne(u,a),n=t?ar(g,a+10):Ne(e,a),l=$(s,n,a,1),!o){+Z(l.d).slice(i+1,i+15)+1==1e14&&(l=O(l,h+1,0));break}while(It(l.d,i+=10,v));return I=!0,O(l,h,v)};S.minus=S.sub=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,R=this,C=R.constructor;if(e=new C(e),!R.d||!e.d)return!R.s||!e.s?e=new C(NaN):R.d?e.s=-e.s:e=new C(e.d||R.s!==e.s?R:NaN),e;if(R.s!=e.s)return e.s=-e.s,R.plus(e);if(u=R.d,v=e.d,a=C.precision,l=C.rounding,!u[0]||!v[0]){if(v[0])e.s=-e.s;else if(u[0])e=new C(R);else return new C(l===3?-0:0);return I?O(e,a,l):e}if(r=te(e.e/_),g=te(R.e/_),u=u.slice(),o=g-r,o){for(h=o<0,h?(t=u,o=-o,s=v.length):(t=v,r=g,s=u.length),n=Math.max(Math.ceil(a/_),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=v.length,h=n0;--n)u[s++]=0;for(n=v.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=g.length,s-i<0&&(i=s,r=g,g=u,u=r),t=0;i;)t=(u[--i]=u[i]+g[i]+t)/ge|0,u[i]%=ge;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=ur(u,n),I?O(e,a,l):e};S.precision=S.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(De+e);return r.d?(t=no(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};S.round=function(){var e=this,t=e.constructor;return O(new t(e),e.e+1,t.rounding)};S.sine=S.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+_,n.rounding=1,r=Sl(n,ao(n,r)),n.precision=e,n.rounding=t,O(Me>2?r.neg():r,e,t,!0)):new n(NaN)};S.squareRoot=S.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,g=s.constructor;if(u!==1||!a||!a[0])return new g(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(I=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=Z(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=te((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new g(t)):n=new g(u.toString()),r=(l=g.precision)+3;;)if(o=n,n=o.plus($(s,o,r+2,1)).times(.5),Z(o.d).slice(0,r)===(t=Z(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(O(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(O(n,l+1,1),e=!n.times(n).eq(s));break}return I=!0,O(n,l,g.rounding,e)};S.tangent=S.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=$(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,O(Me==2||Me==4?r.neg():r,e,t,!0)):new n(NaN)};S.times=S.mul=function(e){var t,r,n,i,o,s,a,l,u,g=this,h=g.constructor,v=g.d,R=(e=new h(e)).d;if(e.s*=g.s,!v||!v[0]||!R||!R[0])return new h(!e.s||v&&!v[0]&&!R||R&&!R[0]&&!v?NaN:!v||!R?e.s/0:e.s*0);for(r=te(g.e/_)+te(e.e/_),l=v.length,u=R.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+R[n]*v[i-n-1]+t,o[i--]=a%ge|0,t=a/ge|0;o[i]=(o[i]+t)%ge|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=ur(o,r),I?O(e,h.precision,h.rounding):e};S.toBinary=function(e,t){return En(this,2,e,t)};S.toDecimalPlaces=S.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ae(e,0,Be),t===void 0?t=n.rounding:ae(t,0,8),O(r,e+r.e+1,t))};S.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,!0):(ae(e,0,Be),t===void 0?t=i.rounding:ae(t,0,8),n=O(new i(n),e+1,t),r=xe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};S.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=xe(i):(ae(e,0,Be),t===void 0?t=o.rounding:ae(t,0,8),n=O(new o(i),e+i.e+1,t),r=xe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};S.toFraction=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,R=this,C=R.d,A=R.constructor;if(!C)return new A(R);if(u=r=new A(1),n=l=new A(0),t=new A(n),o=t.e=no(C)-R.e-1,s=o%_,t.d[0]=J(10,s<0?_+s:s),e==null)e=o>0?t:u;else{if(a=new A(e),!a.isInt()||a.lt(u))throw Error(De+a);e=a.gt(t)?o>0?t:u:a}for(I=!1,a=new A(Z(C)),g=A.precision,A.precision=o=C.length*_*2;h=$(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=$(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=R.s,v=$(u,n,o,1).minus(R).abs().cmp($(l,r,o,1).minus(R).abs())<1?[u,n]:[l,r],A.precision=g,I=!0,v};S.toHexadecimal=S.toHex=function(e,t){return En(this,16,e,t)};S.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ae(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(I=!1,r=$(r,e,0,t,1).times(e),I=!0,O(r)):(e.s=r.s,r=e),r};S.toNumber=function(){return+this};S.toOctal=function(e,t){return En(this,8,e,t)};S.toPower=S.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(J(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return O(a,n,o);if(t=te(e.e/_),t>=e.d.length-1&&(r=u<0?-u:u)<=Pl)return i=io(l,a,r,n),e.s<0?new l(1).div(i):O(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(I=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=wn(e.times(Ne(a,n+r)),n),i.d&&(i=O(i,n+5,1),It(i.d,n,o)&&(t=n+10,i=O(wn(e.times(Ne(a,t+r)),t),t+5,1),+Z(i.d).slice(n+1,n+15)+1==1e14&&(i=O(i,n+1,0)))),i.s=s,I=!0,l.rounding=o,O(i,n,o))};S.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ae(e,1,Be),t===void 0?t=i.rounding:ae(t,0,8),n=O(new i(n),e,t),r=xe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};S.toSignificantDigits=S.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ae(e,1,Be),t===void 0?t=n.rounding:ae(t,0,8)),O(new n(r),e,t)};S.toString=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};S.truncated=S.trunc=function(){return O(new this.constructor(this),this.e+1,1)};S.valueOf=S.toJSON=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Z(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(De+e)}function It(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=_,i=0):(i=Math.ceil((t+1)/_),t%=_),o=J(10,_-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==J(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==J(10,t-3)-1,s}function ir(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Cl(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/cr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=lt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var $=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,g,h,v,R,C,A,F,L,N,M,k,z,j,ht,Q,ie,Ae,X,ze,Vt=n.constructor,Nr=n.s==i.s?1:-1,ee=n.d,B=i.d;if(!ee||!ee[0]||!B||!B[0])return new Vt(!n.s||!i.s||(ee?B&&ee[0]==B[0]:!B)?NaN:ee&&ee[0]==0||!B?Nr*0:Nr/0);for(l?(R=1,g=n.e-i.e):(l=ge,R=_,g=te(n.e/R)-te(i.e/R)),X=B.length,ie=ee.length,L=new Vt(Nr),N=L.d=[],h=0;B[h]==(ee[h]||0);h++);if(B[h]>(ee[h]||0)&&g--,o==null?(j=o=Vt.precision,s=Vt.rounding):a?j=o+(n.e-i.e)+1:j=o,j<0)N.push(1),C=!0;else{if(j=j/R+2|0,h=0,X==1){for(v=0,B=B[0],j++;(h1&&(B=e(B,v,l),ee=e(ee,v,l),X=B.length,ie=ee.length),Q=X,M=ee.slice(0,X),k=M.length;k=l/2&&++Ae;do v=0,u=t(B,M,X,k),u<0?(z=M[0],X!=k&&(z=z*l+(M[1]||0)),v=z/Ae|0,v>1?(v>=l&&(v=l-1),A=e(B,v,l),F=A.length,k=M.length,u=t(A,M,F,k),u==1&&(v--,r(A,X=10;v/=10)h++;L.e=h+g*R-1,O(L,a?o+L.e+1:o,s,C)}return L}}();function O(e,t,r,n){var i,o,s,a,l,u,g,h,v,R=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=_,s=t,g=h[v=0],l=g/J(10,i-s-1)%10|0;else if(v=Math.ceil((o+1)/_),a=h.length,v>=a)if(n){for(;a++<=v;)h.push(0);g=l=0,i=1,o%=_,s=o-_+1}else break e;else{for(g=a=h[v],i=1;a>=10;a/=10)i++;o%=_,s=o-_+i,l=s<0?0:g/J(10,i-s-1)%10|0}if(n=n||t<0||h[v+1]!==void 0||(s<0?g:g%J(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?g/J(10,i-s):0:h[v-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=J(10,(_-t%_)%_),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=v,a=1,v--):(h.length=v+1,a=J(10,_-o),h[v]=s>0?(g/J(10,i-s)%J(10,s)|0)*a:0),u)for(;;)if(v==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==ge&&(h[0]=1));break}else{if(h[v]+=a,h[v]!=ge)break;h[v--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return I&&(e.e>R.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Ie(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Ie(-i-1)+o,r&&(n=r-s)>0&&(o+=Ie(n))):i>=s?(o+=Ie(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Ie(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Ie(n))),o}function ur(e,t){var r=e[0];for(t*=_;r>=10;r/=10)t++;return t}function ar(e,t,r){if(t>Tl)throw I=!0,r&&(e.precision=r),Error(Xi);return O(new e(or),t,1,!0)}function me(e,t,r){if(t>yn)throw Error(Xi);return O(new e(sr),t,r,!0)}function no(e){var t=e.length-1,r=t*_+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Ie(e){for(var t="";e--;)t+="0";return t}function io(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/_+4);for(I=!1;;){if(r%2&&(o=o.times(t),zi(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),zi(t.d,s)}return I=!0,o}function Ki(e){return e.d[e.d.length-1]&1}function oo(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new v(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(I=!1,l=C):l=t,a=new v(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(J(2,h))/Math.LN10*2+5|0,l+=n,r=o=s=new v(1),v.precision=l;;){if(o=O(o.times(e),l,1),r=r.times(++g),a=s.plus($(o,r,l,1)),Z(a.d).slice(0,l)===Z(s.d).slice(0,l)){for(i=h;i--;)s=O(s.times(s),l,1);if(t==null)if(u<3&&It(s.d,l-n,R,u))v.precision=l+=10,r=o=a=new v(1),g=0,u++;else return O(s,v.precision=C,R,I=!0);else return v.precision=C,s}s=a}}function Ne(e,t){var r,n,i,o,s,a,l,u,g,h,v,R=1,C=10,A=e,F=A.d,L=A.constructor,N=L.rounding,M=L.precision;if(A.s<0||!F||!F[0]||!A.e&&F[0]==1&&F.length==1)return new L(F&&!F[0]?-1/0:A.s!=1?NaN:F?0:A);if(t==null?(I=!1,g=M):g=t,L.precision=g+=C,r=Z(F),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Z(A.d),n=r.charAt(0),R++;o=A.e,n>1?(A=new L("0."+r),o++):A=new L(n+"."+r.slice(1))}else return u=ar(L,g+2,M).times(o+""),A=Ne(new L(n+"."+r.slice(1)),g-C).plus(u),L.precision=M,t==null?O(A,M,N,I=!0):A;for(h=A,l=s=A=$(A.minus(1),A.plus(1),g,1),v=O(A.times(A),g,1),i=3;;){if(s=O(s.times(v),g,1),u=l.plus($(s,new L(i),g,1)),Z(u.d).slice(0,g)===Z(l.d).slice(0,g))if(l=l.times(2),o!==0&&(l=l.plus(ar(L,g+2,M).times(o+""))),l=$(l,new L(R),g,1),t==null)if(It(l.d,g-C,N,a))L.precision=g+=C,u=s=A=$(h.minus(1),h.plus(1),g,1),v=O(A.times(A),g,1),i=a=1;else return O(l,L.precision=M,N,I=!0);else return L.precision=M,l;l=u,i+=2}}function so(e){return String(e.s*e.s/0)}function bn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%_,r<0&&(n+=_),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ro.test(t))return bn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(xl.test(t))r=16,t=t.toLowerCase();else if(El.test(t))r=2;else if(vl.test(t))r=8;else throw Error(De+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=io(n,new n(r),o,o*2)),u=ir(t,r,ge),g=u.length-1,o=g;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=ur(u,g),e.d=u,I=!1,s&&(e=$(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?J(2,l):Ke.pow(2,l))),I=!0,e)}function Sl(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:lt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/cr(5,r)),t=lt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function lt(e,t,r,n,i){var o,s,a,l,u=1,g=e.precision,h=Math.ceil(g/_);for(I=!1,l=r.times(r),a=new e(n);;){if(s=$(a.times(l),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=$(s.times(l),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return I=!0,s.d.length=h+1,s}function cr(e,t){for(var r=e;--t;)r*=e;return r}function ao(e,t){var r,n=t.s<0,i=me(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Me=n?4:1,t;if(r=t.divToInt(i),r.isZero())Me=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Me=Ki(r)?n?2:3:n?4:1,t;Me=Ki(r)?n?1:4:n?3:2}return t.minus(i).abs()}function En(e,t,r,n){var i,o,s,a,l,u,g,h,v,R=e.constructor,C=r!==void 0;if(C?(ae(r,1,Be),n===void 0?n=R.rounding:ae(n,0,8)):(r=R.precision,n=R.rounding),!e.isFinite())g=so(e);else{for(g=xe(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),v=new R(1),v.e=g.length-s,v.d=ir(xe(v),10,i),v.e=v.d.length),h=ir(g,10,i),o=l=h.length;h[--l]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new R(e),e.d=h,e.e=o,e=$(e,v,r,n,0,i),h=e.d,o=e.e,u=Zi),s=h[r],a=i/2,u=u||h[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,u)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)g+="0";for(h=ir(g,i,t),l=h.length;!h[l-1];--l);for(s=1,g="1.";sl)for(o-=l;o--;)g+="0";else ot)return e.length=t,!0}function Rl(e){return new this(e).abs()}function kl(e){return new this(e).acos()}function Ol(e){return new this(e).acosh()}function Fl(e,t){return new this(e).plus(t)}function Ml(e){return new this(e).asin()}function _l(e){return new this(e).asinh()}function Ll(e){return new this(e).atan()}function Il(e){return new this(e).atanh()}function Nl(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=me(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?me(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=me(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan($(e,t,o,1)),t=me(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan($(e,t,o,1)),r}function Dl(e){return new this(e).cbrt()}function Bl(e){return O(e=new this(e),e.e+1,2)}function $l(e,t,r){return new this(e).clamp(t,r)}function jl(e){if(!e||typeof e!="object")throw Error(lr+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Be,"rounding",0,8,"toExpNeg",-at,0,"toExpPos",0,at,"maxE",0,at,"minE",-at,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(De+r+": "+n);if(r="crypto",i&&(this[r]=hn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(eo);else this[r]=!1;else throw Error(De+r+": "+n);return this}function Ul(e){return new this(e).cos()}function ql(e){return new this(e).cosh()}function lo(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,Yi(o)){u.s=o.s,I?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;I?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(eo);else for(;o=10;i/=10)n++;n<_&&(r-=_-n)}return s.e=r,s.d=a,s}function nu(e){return O(e=new this(e),e.e+1,this.rounding)}function iu(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function ou(e){return new this(e).sin()}function su(e){return new this(e).sinh()}function au(e){return new this(e).sqrt()}function lu(e,t){return new this(e).sub(t)}function uu(){var e=0,t=arguments,r=new this(t[e]);for(I=!1;r.s&&++e`}};function ct(e){return e instanceof Nt}m();c();p();f();d();m();c();p();f();d();var pr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};m();c();p();f();d();var fr=e=>e,dr={bold:fr,red:fr,green:fr,dim:fr,enabled:!1},uo={bold:de,red:Ve,green:Et,dim:wt,enabled:!0},pt={write(e){e.writeLine(",")}};m();c();p();f();d();var Pe=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};m();c();p();f();d();var $e=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var ft=class extends $e{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new pr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new Pe("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(pt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};m();c();p();f();d();var co=": ",mr=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+co.length}write(t){let r=new Pe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(co).write(this.value)}};m();c();p();f();d();var gr=class e extends $e{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof ft&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new Pe("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(pt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};m();c();p();f();d();var K=class extends $e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Pe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var xn=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function hr(e){return new xn(po(e))}function po(e){let t=new gr;for(let[r,n]of Object.entries(e)){let i=new mr(r,fo(n));t.addField(i)}return t}function fo(e){if(typeof e=="string")return new K(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new K(String(e));if(typeof e=="bigint")return new K(`${e}n`);if(e===null)return new K("null");if(e===void 0)return new K("undefined");if(ut(e))return new K(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new K(`Buffer.alloc(${e.byteLength})`):new K(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=nr(e)?e.toISOString():"Invalid Date";return new K(`new Date("${t}")`)}return e instanceof Fe?new K(`Prisma.${e._getName()}`):ct(e)?new K(`prisma.${Hi(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?mu(e):typeof e=="object"?po(e):new K(Object.prototype.toString.call(e))}function mu(e){let t=new ft;for(let r of e)t.addItem(fo(r));return t}function mo(e){if(e===void 0)return"";let t=hr(e);return new ot(0,{colors:dr}).write(t).toString()}m();c();p();f();d();var gu="P2037";function yr({error:e,user_facing_error:t},r,n){return t.error_code?new G(hu(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new H(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function hu(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===gu&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var Dt="";function go(e){var t=e.split(` -`);return t.reduce(function(r,n){var i=bu(n)||xu(n)||Tu(n)||Ru(n)||Au(n);return i&&r.push(i),r},[])}var yu=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,wu=/\((\S*)(?::(\d+))(?::(\d+))\)/;function bu(e){var t=yu.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=wu.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||Dt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Eu=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function xu(e){var t=Eu.exec(e);return t?{file:t[2],methodName:t[1]||Dt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var vu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Pu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Tu(e){var t=vu.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Pu.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||Dt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Cu=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Au(e){var t=Cu.exec(e);return t?{file:t[3],methodName:t[1]||Dt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Su=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Ru(e){var t=Su.exec(e);return t?{file:t[2],methodName:t[1]||Dt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var vn=class{getLocation(){return null}},Pn=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=go(t).find(i=>{if(!i.file)return!1;let o=tn(i.file);return o!==""&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function je(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new vn:new Pn}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var ho={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function dt(e={}){let t=Ou(e);return Object.entries(t).reduce((n,[i,o])=>(ho[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Ou(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function wr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function yo(e,t){let r=wr(e);return t({action:"aggregate",unpacker:r,argsMapper:dt})(e)}m();c();p();f();d();function Fu(e={}){let{select:t,...r}=e;return typeof t=="object"?dt({...r,_count:t}):dt({...r,_count:{_all:!0}})}function Mu(e={}){return typeof e.select=="object"?t=>wr(e)(t)._count:t=>wr(e)(t)._count._all}function wo(e,t){return t({action:"count",unpacker:Mu(e),argsMapper:Fu})(e)}m();c();p();f();d();function _u(e={}){let t=dt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function Lu(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function bo(e,t){return t({action:"groupBy",unpacker:Lu(e),argsMapper:_u})(e)}function Eo(e,t,r){if(t==="aggregate")return n=>yo(n,r);if(t==="count")return n=>wo(n,r);if(t==="groupBy")return n=>bo(n,r)}m();c();p();f();d();function xo(e,t){let r=t.fields.filter(i=>!i.relationName),n=sn(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Nt(e,o,s.type,s.isList,s.kind==="enum")},...tr(Object.keys(n))})}m();c();p();f();d();m();c();p();f();d();var vo=e=>Array.isArray(e)?e:e.split("."),Tn=(e,t)=>vo(t).reduce((r,n)=>r&&r[n],e),Po=(e,t,r)=>vo(t).reduceRight((n,i,o,s)=>Object.assign({},Tn(e,s.slice(0,o)),{[i]:n}),r);function Iu(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Nu(e,t,r){return t===void 0?e??{}:Po(t,r,e||!0)}function Cn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=je(e._errorFormat),g=Iu(n,i),h=Nu(l,o,g),v=r({dataPath:g,callsite:u})(h),R=Du(e,t);return new Proxy(v,{get(C,A){if(!R.includes(A))return C[A];let L=[a[A].type,r,A],N=[g,h];return Cn(e,...L,...N)},...tr([...R,...Object.getOwnPropertyNames(v)])})}}function Du(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}m();c();p();f();d();m();c();p();f();d();var Ro=fe(_i());m();c();p();f();d();Gr();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var To={keyword:ke,entity:ke,value:e=>de(Je(e)),punctuation:Je,directive:ke,function:ke,variable:e=>de(Je(e)),string:e=>de(Et(e)),boolean:Qe,number:ke,comment:xt};var Bu=e=>e,br={},$u=0,D={manual:br.Prism&&br.Prism.manual,disableWorkerMessageHandler:br.Prism&&br.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof he){let t=e;return new he(t.type,D.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(D.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Ae instanceof he)continue;if(z&&Q!=t.length-1){N.lastIndex=ie;var h=N.exec(e);if(!h)break;var g=h.index+(k?h[1].length:0),v=h.index+h[0].length,a=Q,l=ie;for(let B=t.length;a=l&&(++Q,ie=l);if(t[Q]instanceof he)continue;u=a-Q,Ae=e.slice(ie,l),h.index-=ie}else{N.lastIndex=0;var h=N.exec(Ae),u=1}if(!h){if(o)break;continue}k&&(j=h[1]?h[1].length:0);var g=h.index+j,h=h[0].slice(j),v=g+h.length,R=Ae.slice(0,g),C=Ae.slice(v);let X=[Q,u];R&&(++Q,ie+=R.length,X.push(R));let ze=new he(A,M?D.tokenize(h,M):h,ht,h,z);if(X.push(ze),C&&X.push(C),Array.prototype.splice.apply(t,X),u!=1&&D.matchGrammar(e,t,r,Q,ie,!0,A),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return D.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=D.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=D.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:he};D.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};D.languages.javascript=D.languages.extend("clike",{"class-name":[D.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});D.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;D.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:D.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:D.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:D.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:D.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});D.languages.markup&&D.languages.markup.tag.addInlined("script","javascript");D.languages.js=D.languages.javascript;D.languages.typescript=D.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});D.languages.ts=D.languages.typescript;function he(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}he.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return he.stringify(r,t)}).join(""):ju(e.type)(e.content)};function ju(e){return To[e]||Bu}function Co(e){return Uu(e,D.languages.javascript)}function Uu(e,t){return D.tokenize(e,t).map(n=>he.stringify(n)).join("")}m();c();p();f();d();var Ao=fe(Oi());function So(e){return(0,Ao.default)(e)}var Er=class e{static read(t){let r;try{r=Gt.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(tthis.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(` -`);return new e(t,So(n).split(` -`))}highlight(){let t=Co(this.toString());return new e(this.firstLineNumber,t.split(` -`))}toString(){return this.lines.join(` -`)}};var qu={red:Ve,gray:xt,dim:wt,bold:de,underline:bt,highlightSource:e=>e.highlight()},Vu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Qu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Ju({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=Qu({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||y.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=Er.read(a.fileName)?.slice(l,a.lineNumber),g=u?.lineAt(a.lineNumber);if(u&&g){let h=Gu(g),v=Wu(g);if(!v)return s;s.functionName=`${v.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,C=>C.slice(0,v.openingBraceIndex))),u=o.highlightSource(u);let R=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((C,A)=>o.gray(String(A).padStart(R))+" "+C).mapLines(C=>o.dim(C)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let C=h+R+1;C+=2,s.callArguments=(0,Ro.default)(i,C).slice(C)}}return s}function Wu(e){let t=Object.keys(Le.ModelAction).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function Gu(e){let t=0;for(let r=0;r{if("rejectOnNotFound"in n.args){let o=mt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new Y(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof G&&o.code==="P2025"?new Oe(`No ${e} found`,t):o})}}m();c();p();f();d();function Te(e){return e.replace(/^./,t=>t.toLowerCase())}var Yu=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Zu=["aggregate","count","groupBy"];function An(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Xu(e,t),tc(e,t),Lt(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return Ee({},n)}function Xu(e,t){let r=Te(t),n=Object.keys(Le.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=ko(o,t,e._clientVersion,s);let a=l=>u=>{let g=je(e._errorFormat);return e._createPrismaPromise(h=>{let v={args:u,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...v,...l})})};return Yu.includes(o)?Cn(e,t,a):ec(i)?Eo(e,i,a):a({})}}}function ec(e){return Zu.includes(e)}function tc(e,t){return He(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return xo(t,r)}))}m();c();p();f();d();function Oo(e){return e.replace(/^./,t=>t.toUpperCase())}var Sn=Symbol();function Bt(e){let t=[rc(e),ne(Sn,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Lt(r)),Ee(e,t)}function rc(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Te),n=[...new Set(t.concat(r))];return He({getKeys(){return n},getPropertyValue(i){let o=Oo(i);if(e._runtimeDataModel.models[o]!==void 0)return An(e,o);if(e._runtimeDataModel.models[i]!==void 0)return An(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Fo(e){return e[Sn]?e[Sn]:e}function Mo(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Bt(t)}m();c();p();f();d();m();c();p();f();d();function _o({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(g=>n[g]);u.length>0&&a.push(it(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(g=>!r[g]);u.length>0&&a.push(it(u))}nc(e,l.needs)&&s.push(ic(l,Ee(e,s)))}return s.length>0||a.length>0?Ee(e,[...s,...a]):e}function nc(e,t){return t.every(r=>on(e,r))}function ic(e,t){return He(ne(e.name,()=>e.compute(t)))}m();c();p();f();d();function xr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sg.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=xr({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Io({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:xr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(s,a,l)=>_o({result:s,modelName:Te(a),select:l.select,omit:l.omit,extensions:n})})}m();c();p();f();d();m();c();p();f();d();function No(e){if(e instanceof se)return oc(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:No(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=qo(o,l),a.args=s,Bo(e,a,r,n+1)}})})}function $o(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Bo(e,t,s)}function jo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Uo(r,n,0,e):e(r)}}function Uo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=qo(i,l),Uo(a,t,r+1,n)}})}var Do=e=>e;function qo(e=Do,t=Do){return r=>e(t(r))}m();c();p();f();d();m();c();p();f();d();function Qo(e,t,r){let n=Te(r);return!t.result||!(t.result.$allModels||t.result[n])?e:sc({...e,...Vo(t.name,e,t.result.$allModels),...Vo(t.name,e,t.result[n])})}function sc(e){let t=new be,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return rt(e,n=>({...n,needs:r(n.name,new Set)}))}function Vo(e,t,r){return r?rt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:ac(t,o,i)})):{}}function ac(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Jo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function Wo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var vr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new be;this.modelExtensionsCache=new be;this.queryCallbacksCache=new be;this.clientExtensions=Rt(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=Rt(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Qo(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Te(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Pr=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new vr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new vr(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};m();c();p();f();d();var Go=le("prisma:client"),Ho={Vercel:"vercel","Netlify CI":"netlify"};function Ko({postinstall:e,ciName:t,clientVersion:r}){if(Go("checkPlatformCaching:postinstall",e),Go("checkPlatformCaching:ciName",t),e===!0&&t&&t in Ho){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${Ho[t]}-build`;throw console.error(n),new V(n,r)}}m();c();p();f();d();function zo(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var lc="Cloudflare-Workers",uc="node";function Yo(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===lc?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===uc?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var cc={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Zo(){let e=Yo();return{id:e,prettyName:cc[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}m();c();p();f();d();m();c();p();f();d();var Rn=fe(nn());m();c();p();f();d();function Xo(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}m();c();p();f();d();function es(e){return e.split(` -`).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` -`)}m();c();p();f();d();var pc=fe(Ci()),ts=fe(Bi());function rs({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,ts.default)({user:t,repo:r,template:n,title:e,body:i})}function ns({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=vi(6e3-(s?.length??0)),l=es((0,Rn.default)(a)),u=n?`# Description -\`\`\` -${n} -\`\`\``:"",g=(0,Rn.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: -## Versions - -| Name | Version | -|-----------------|--------------------| -| Node | ${y.version?.padEnd(19)}| -| OS | ${t?.padEnd(19)}| -| Prisma Client | ${e?.padEnd(19)}| -| Query Engine | ${i?.padEnd(19)}| -| Database | ${o?.padEnd(19)}| - -${u} - -## Logs -\`\`\` -${l} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?Xo(s):""} -\`\`\` -`),h=rs({title:r,body:g});return`${r} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${bt(h)} - -If you want the Prisma team to look into it, please open the link above \u{1F64F} -To increase the chance of success, please post your schema and a snippet of -how you used Prisma Client in the issue. -`}m();c();p();f();d();function Tr({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 V(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new V("error: Missing URL environment variable, value, or override.",n);return i}m();c();p();f();d();m();c();p();f();d();function is(e){if(e?.kind==="itx")return e.options.id}m();c();p();f();d();var kn=class{constructor(t,r,n){this.engineObject=__PrismaProxy.create({datamodel:t.datamodel,env:y.env,ignoreEnvVarErrors:!0,datasourceOverrides:t.datasourceOverrides??{},logLevel:t.logLevel,logQueries:t.logQueries??!1,logCallback:r})}async connect(t){return __PrismaProxy.connect(this.engineObject,t)}async disconnect(t){return __PrismaProxy.disconnect(this.engineObject,t)}query(t,r,n){return __PrismaProxy.execute(this.engineObject,t,r,n)}sdlSchema(){return Promise.resolve("{}")}dmmf(t){return Promise.resolve("{}")}async startTransaction(t,r){return __PrismaProxy.startTransaction(this.engineObject,t,r)}async commitTransaction(t,r){return __PrismaProxy.commitTransaction(this.engineObject,t,r)}async rollbackTransaction(t,r){return __PrismaProxy.rollbackTransaction(this.engineObject,t,r)}metrics(t){return Promise.resolve("{}")}async applyPendingMigrations(){return __PrismaProxy.applyPendingMigrations(this.engineObject)}},os={async loadLibrary(e){if(!__PrismaProxy)throw new V("__PrismaProxy not detected make sure React Native bindings are installed",e.clientVersion);return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:kn}}};var fc="P2036",Ce=le("prisma:client:libraryEngine");function dc(e){return e.item_type==="query"&&"query"in e}function mc(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var RC=[...Xr,"native"],ss=0,jt=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=os,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary(),this.checkForTooManyEngines()}checkForTooManyEngines(){ss===10&&console.warn(`${Qe("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async applyPendingMigrations(){await this.start(),await this.engine?.applyPendingMigrations()}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(gc(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new G(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(Ce("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new H("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new H("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new b(this),{adapter:r}=this.config;r&&Ce("Using driver adapter: %O",r),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:y.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{t.deref()?.logger(n)},r),ss++}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new V(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);if(r){if("span"in r){this.config.tracingHelper.createEngineSpan(r);return}r.level=r?.level.toLowerCase()??"unknown",dc(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):mc(r)?this.loggerRustPanic=new ue(On(this,`${r.message}: ${r.reason} in ${r.file}:${r.line}:${r.column}`),this.config.clientVersion):this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path})}}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Ce(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{Ce("library starting");try{let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,Ce("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new V(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Ce("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),Ce("library stopping");let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,Ce("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){Ce(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new H(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof V)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new ue(On(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new H(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){Ce("requestBatch");let i=rr(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),is(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new H(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:l}=s;if(Array.isArray(a))return a.map(u=>u.errors&&u.errors.length>0?this.loggerRustPanic??this.buildQueryError(u.errors[0]):{data:u,elapsed:0});throw l&&l.length===1?new Error(l[0].error):new Error(JSON.stringify(s))}buildQueryError(t){if(t.user_facing_error.is_panic)return new ue(On(this,t.user_facing_error.message),this.config.clientVersion);let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:yr(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===fc&&this.config.adapter){let r=t.meta?.id;zt(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return zt(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function gc(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function On(e,t){return ns({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function as({copyEngine:e=!0},t){let r;try{r=Tr({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch{}e&&r?.startsWith("prisma://")&&St("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Tt(t.generator),i=!!(r?.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o&&!1){let l;throw e?r?.startsWith("prisma://")?l=["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."]:l=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:l=["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(l.join(` -`),{clientVersion:t.clientVersion})}return new jt(t)}m();c();p();f();d();function Cr({generator:e}){return e?.previewFeatures??[]}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var ds=fe(Fn());m();c();p();f();d();function ps(e,t){let r=fs(e),n=hc(r),i=wc(n);i?Ar(i,t):t.addErrorMessage(()=>"Unknown error")}function fs(e){return e.errors.flatMap(t=>t.kind==="Union"?fs(t):[t])}function hc(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:yc(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function yc(e,t){return[...new Set(e.concat(t))]}function wc(e){return an(e,(t,r)=>{let n=us(t),i=us(r);return n!==i?n-i:cs(t)-cs(r)})}function us(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function cs(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}m();c();p();f();d();var pe=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};m();c();p();f();d();var Sr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(pt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Ar(e,t){switch(e.kind){case"MutuallyExclusiveFields":bc(e,t);break;case"IncludeOnScalar":Ec(e,t);break;case"EmptySelection":xc(e,t);break;case"UnknownSelectionField":Tc(e,t);break;case"UnknownArgument":Cc(e,t);break;case"UnknownInputField":Ac(e,t);break;case"RequiredArgumentMissing":Sc(e,t);break;case"InvalidArgumentType":Rc(e,t);break;case"InvalidArgumentValue":kc(e,t);break;case"ValueTooLarge":Oc(e,t);break;case"SomeFieldsMissing":Fc(e,t);break;case"TooManyFieldsGiven":Mc(e,t);break;case"Union":ps(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function bc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Ec(e,t){let[r,n]=Rr(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new pe(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${Ut(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function xc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(r){let n=r.getField("omit")?.value.asObject();if(n){vc(e,t,n);return}}Pc(e,t)}function vc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new pe(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Pc(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),hs(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${Ut(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Tc(e,t){let[r,n]=Rr(e.selectionPath),i=t.arguments.getDeepSubSelectionValue(r)?.asObject(),o;if(i){let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),l=i.getFieldValue("omit")?.asObject();s?.hasField(n)?(o="select",s.getField(n)?.markAsError(),hs(s,e.outputType)):a?.hasField(n)?(o="include",a.getField(n)?.markAsError(),_c(a,e.outputType)):l?.hasField(n)&&(o="omit",l.getField(n)?.markAsError(),Lc(l,e.outputType))}t.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(Ut(s)),a.join(" ")})}function Cc(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Ic(n,e.arguments)),t.addErrorMessage(i=>ms(i,r,e.arguments.map(o=>o.name)))}function Ac(e,t){let[r,n]=Rr(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&ys(o,e.inputType)}t.addErrorMessage(o=>ms(o,n,e.inputType.fields.map(s=>s.name)))}function ms(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Dc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(Ut(e)),n.join(" ")}function Sc(e,t){let r;t.addErrorMessage(l=>r?.value instanceof K&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Rr(e.argumentPath),s=new Sr,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new pe(o,s).makeRequired())}else{let l=e.inputTypes.map(gs).join(" | ");a.addSuggestion(new pe(o,l).makeRequired())}}function gs(e){return e.kind==="list"?`${gs(e.elementType)}[]`:e.name}function Rc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=kr("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function kc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=kr("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Oc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof K&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function Fc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&ys(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${kr("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(Ut(i)),o.join(" ")})}function Mc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${kr("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function hs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new pe(r.name,"true"))}function _c(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new pe(r.name,"true"))}function Lc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new pe(r.name,"true"))}function Ic(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new pe(r.name,r.typeNames.join(" | ")))}function ys(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new pe(r.name,r.typeNames.join(" | ")))}function Rr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function Ut({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function kr(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Nc=3;function Dc(e,t){let r=1/0,n;for(let i of t){let o=(0,ds.default)(e,i);o>Nc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.model?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};m();c();p();f();d();var xs=e=>({command:e});m();c();p();f();d();m();c();p();f();d();var vs=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);m();c();p();f();d();function qt(e){try{return Ps(e,"fast")}catch{return Ps(e,"slow")}}function Ps(e,t){return JSON.stringify(e.map(r=>Gc(r,t)))}function Gc(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:st(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ve.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Hc(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Cs(e):e}function Hc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Cs(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ts);let t={};for(let r of Object.keys(e))t[r]=Ts(e[r]);return t}function Ts(e){return typeof e=="bigint"?e.toString():Cs(e)}var Kc=/^(\s*alter\s)/i,As=le("prisma:client");function Ln(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Kc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var In=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:qt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:qt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:qt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=vs(r),i={values:qt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?As(`prisma.${e}(${n}, ${i.values})`):As(`prisma.${e}(${n})`),{query:n,parameters:i}},Ss={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Rs={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};m();c();p();f();d();function Nn(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=ks(r(o)):ks(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function ks(e){return typeof e.then=="function"?e:Promise.resolve(e)}m();c();p();f();d();var Os={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Dn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??Os}};function Fs(e){return e.includes("tracing")?new Dn:Os}m();c();p();f();d();function Ms(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}m();c();p();f();d();var zc=["$connect","$disconnect","$on","$transaction","$use","$extends"],_s=zc;m();c();p();f();d();function Ls(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}m();c();p();f();d();var Fr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};m();c();p();f();d();var Ns=fe(nn());m();c();p();f();d();function Mr(e){return typeof e.batchRequestIdx=="number"}m();c();p();f();d();function _r(e){return e===null?e:Array.isArray(e)?e.map(_r):typeof e=="object"?Yc(e)?Zc(e):rt(e,_r):e}function Yc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Zc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ve(t);case"Json":return JSON.parse(t);default:We(t,"Unknown tagged value")}}m();c();p();f();d();function Is(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Bn(e.query.arguments)),t.push(Bn(e.query.selection)),t.join("")}function Bn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Bn(n)})`:r}).join(" ")})`}m();c();p();f();d();var Xc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function $n(e){return Xc[e]}m();c();p();f();d();var Lr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(h=>$n(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:tp(o),containsWrite:u,customDataProxyFetch:i})).map((h,v)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[v],h)}catch(R){return R}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ds(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:$n(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Is(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(ep(t),rp(t,i)||t instanceof Oe)throw t;if(t instanceof G&&np(t)){let l=Bs(t.meta);Or({args:o,errors:[l],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=mt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let l=s?{modelName:s,...t.meta}:t.meta;throw new G(a,{code:t.code,clientVersion:this.client._clientVersion,meta:l,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ue(a,this.client._clientVersion);if(t instanceof H)throw new H(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof V)throw new V(a,this.client._clientVersion);if(t instanceof ue)throw new ue(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Ns.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=_r(Tn(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function tp(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ds(e)};We(e,"Unknown transaction kind")}}function Ds(e){return{id:e.id,payload:e.payload}}function rp(e,t){return Mr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function np(e){return e.code==="P2009"||e.code==="P2012"}function Bs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Bs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}m();c();p();f();d();var $s="5.14.0";var js=$s;m();c();p();f();d();function Us(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=qs(t[n]);return r})}function qs({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return w.Buffer.from(t,"base64");case"decimal":return new ve(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(qs);default:return t}}m();c();p();f();d();var Ws=fe(Fn());m();c();p();f();d();var q=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};re(q,"PrismaClientConstructorValidationError");var Vs=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Qs=["pretty","colorless","minimal"],Js=["info","query","warn","error"],op={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=gt(r,t)||` Available datasources: ${t.join(", ")}`;throw new q(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new q(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new q('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Cr(t).includes("driverAdapters"))throw new q('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Tt()==="binary")throw new q('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Qs.includes(e)){let t=gt(e,Qs);throw new q(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Js.includes(r)){let n=gt(r,Js);throw new q(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=gt(i,o);throw new q(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new q(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new q(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new q(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new q(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=gt(r,t);throw new q(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Gs(e,t){for(let[r,n]of Object.entries(e)){if(!Vs.includes(r)){let i=gt(r,Vs);throw new q(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}op[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new q('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function gt(e,t){if(t.length===0||typeof e!="string")return"";let r=sp(e,t);return r?` Did you mean "${r}"?`:""}function sp(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Ws.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u{n[u]=g,a()},g=>{if(!Mr(g)){l(g);return}g.batchRequestIdx===u?l(g):(i||(i=g),a())})})}var Ue=le("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var ap={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},lp=Symbol.for("prisma.client.transaction.id"),up={id:0,nextId(){return++this.id}};function Ys(e){class t{constructor(n){this._originalClient=this;this._middlewares=new Fr;this._createPrismaPromise=Nn();this.$extends=Mo;e=n?.__internal?.configOverride?.(e)??e,Ko(e),n&&Gs(n,e);let i=n?.adapter?fn(n.adapter):void 0,o=new Kt().on("error",()=>{});this._extensions=Pr.empty(),this._previewFeatures=Cr(e),this._clientVersion=e.clientVersion??js,this._activeProvider=e.activeProvider,this._tracingHelper=Fs(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&we.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&we.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},g=u.debug===!0;g&&le.enable("prisma:client");let h=we.resolve(e.dirname,e.relativePath);Gt.existsSync(h)||(h=e.dirname),Ue("dirname",e.dirname),Ue("relativePath",e.relativePath),Ue("cwd",h);let v=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:h,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:v.allowTriggerPanic,datamodelPath:we.join(e.dirname,e.filename??"schema.prisma"),prismaPath:v.binaryPath??void 0,engineEndpoint:v.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Ls(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(R=>typeof R=="string"?R==="query":R.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:zo(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Tr,getBatchRequestPayload:rr,prismaGraphQLToJSError:yr,PrismaClientUnknownRequestError:H,PrismaClientInitializationError:V,PrismaClientKnownRequestError:G,debug:le("prisma:client:accelerateEngine"),engineVersion:zs.version,clientVersion:e.clientVersion}},Ue("clientVersion",e.clientVersion),this._engine=as(e,this._engineConfig),this._requestHandler=new Ir(this,o),l.log)for(let R of l.log){let C=typeof R=="string"?R:R.emit==="stdout"?R.level:null;C&&this.$on(C,A=>{At.log(`${At.tags[C]??""}`,A.message||A.query)})}this._metrics=new nt(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=Bt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Pi()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:In({clientMethod:i,activeProvider:a}),callsite:je(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Ks(n,i);return Ln(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Y("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Ln(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Y(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:xs,callsite:je(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:In({clientMethod:i,activeProvider:a}),callsite:je(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(Us)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Ks(n,i));throw new Y("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=up.nextId(),s=Ms(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:u,isolationLevel:g,lock:s};return l.requestTransaction?.(h)??l});return Hs(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return Bt(Ee(Fo(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>Nn(n)),ne(lp,()=>n.id),it(_s)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??ap,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let g=this._middlewares.get(++a);if(g)return this._tracingHelper.runInChildSpan(s.middleware,F=>g(u,L=>(F?.end(),l(L))));let{runInTransaction:h,args:v,...R}=u,C={...n,...R};v&&(C.args=i.middlewareArgsToRequestArgs(v)),n.transaction!==void 0&&h===!1&&delete C.transaction;let A=await $o(this,C);return C.model?Io({result:A,modelName:C.model,args:C.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):A};return this._tracingHelper.runInChildSpan(s.operation,()=>l(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:g,unpacker:h,otelParentCtx:v,customDataProxyFetch:R}){try{n=u?u(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>ws({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return le.enabled("prisma:client")&&(Ue("Prisma Client call:"),Ue(`prisma.${i}(${mo(n)})`),Ue("Generated request:"),Ue(JSON.stringify(A,null,2)+` -`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:v,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:R})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new Y("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Ks(e,t){return cp(e)?[new se(e,t),Ss]:[e,Rs]}function cp(e){return Array.isArray(e)&&Array.isArray(e.raw)}m();c();p();f();d();var pp=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Zs(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!pp.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}m();c();p();f();d();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=react-native.js.map diff --git a/integration-tests/tests/prisma/mysql/client/runtime/wasm.js b/integration-tests/tests/prisma/mysql/client/runtime/wasm.js deleted file mode 100644 index 8e5f78d07..000000000 --- a/integration-tests/tests/prisma/mysql/client/runtime/wasm.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict";var ko=Object.create;var Et=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Mo=Object.getOwnPropertyNames;var Io=Object.getPrototypeOf,_o=Object.prototype.hasOwnProperty;var oe=(e,t)=>()=>(e&&(t=e(e=0)),t);var Te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ze=(e,t)=>{for(var r in t)Et(e,r,{get:t[r],enumerable:!0})},Kr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mo(t))!_o.call(e,i)&&i!==r&&Et(e,i,{get:()=>t[i],enumerable:!(n=Lo(t,i))||n.enumerable});return e};var _e=(e,t,r)=>(r=e!=null?ko(Io(e)):{},Kr(t||!e||!e.__esModule?Et(r,"default",{value:e,enumerable:!0}):r,e)),ar=e=>Kr(Et({},"__esModule",{value:!0}),e);function lr(e,t){if(t=t.toLowerCase(),t==="utf8"||t==="utf-8")return new h(Bo.encode(e));if(t==="base64"||t==="base64url")return e=e.replace(/-/g,"+").replace(/_/g,"/"),e=e.replace(/[^A-Za-z0-9+/]/g,""),new h([...atob(e)].map(r=>r.charCodeAt(0)));if(t==="binary"||t==="ascii"||t==="latin1"||t==="latin-1")return new h([...e].map(r=>r.charCodeAt(0)));if(t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le"){let r=new h(e.length*2),n=new DataView(r.buffer);for(let i=0;ia.startsWith("get")||a.startsWith("set")),n=r.map(a=>a.replace("get","read").replace("set","write")),i=(a,f)=>function(v=0){return $(v,"offset"),Y(v,"offset"),q(v,"offset",this.length-1),new DataView(this.buffer)[r[a]](v,f)},o=(a,f)=>function(v,C=0){let T=r[a].match(/set(\w+\d+)/)[1].toLowerCase(),O=No[T];return $(C,"offset"),Y(C,"offset"),q(C,"offset",this.length-1),Fo(v,"value",O[0],O[1]),new DataView(this.buffer)[r[a]](C,v,f),C+parseInt(r[a].match(/\d+/)[0])/8},s=a=>{a.forEach(f=>{f.includes("Uint")&&(e[f.replace("Uint","UInt")]=e[f]),f.includes("Float64")&&(e[f.replace("Float64","Double")]=e[f]),f.includes("Float32")&&(e[f.replace("Float32","Float")]=e[f])})};n.forEach((a,f)=>{a.startsWith("read")&&(e[a]=i(f,!1),e[a+"LE"]=i(f,!0),e[a+"BE"]=i(f,!1)),a.startsWith("write")&&(e[a]=o(f,!1),e[a+"LE"]=o(f,!0),e[a+"BE"]=o(f,!1)),s([a,a+"LE",a+"BE"])})}function zr(e){throw new Error(`Buffer polyfill does not implement "${e}"`)}function xt(e,t){if(!(e instanceof Uint8Array))throw new TypeError(`The "${t}" argument must be an instance of Buffer or Uint8Array`)}function q(e,t,r=Vo+1){if(e<0||e>r){let n=new RangeError(`The value of "${t}" is out of range. It must be >= 0 && <= ${r}. Received ${e}`);throw n.code="ERR_OUT_OF_RANGE",n}}function $(e,t){if(typeof e!="number"){let r=new TypeError(`The "${t}" argument must be of type number. Received type ${typeof e}.`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function Y(e,t){if(!Number.isInteger(e)||Number.isNaN(e)){let r=new RangeError(`The value of "${t}" is out of range. It must be an integer. Received ${e}`);throw r.code="ERR_OUT_OF_RANGE",r}}function Fo(e,t,r,n){if(en){let i=new RangeError(`The value of "${t}" is out of range. It must be >= ${r} and <= ${n}. Received ${e}`);throw i.code="ERR_OUT_OF_RANGE",i}}function Hr(e,t){if(typeof e!="string"){let r=new TypeError(`The "${t}" argument must be of type string. Received type ${typeof e}`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function qo(e,t="utf8"){return h.from(e,t)}var h,No,Bo,Uo,$o,Vo,y,ur,u=oe(()=>{"use strict";h=class e extends Uint8Array{constructor(){super(...arguments);this._isBuffer=!0}get offset(){return this.byteOffset}static alloc(r,n=0,i="utf8"){return Hr(i,"encoding"),e.allocUnsafe(r).fill(n,i)}static allocUnsafe(r){return e.from(r)}static allocUnsafeSlow(r){return e.from(r)}static isBuffer(r){return r&&!!r._isBuffer}static byteLength(r,n="utf8"){if(typeof r=="string")return lr(r,n).byteLength;if(r&&r.byteLength)return r.byteLength;let i=new TypeError('The "string" argument must be of type string or an instance of Buffer or ArrayBuffer.');throw i.code="ERR_INVALID_ARG_TYPE",i}static isEncoding(r){return $o.includes(r)}static compare(r,n){xt(r,"buff1"),xt(n,"buff2");for(let i=0;in[i])return 1}return r.length===n.length?0:r.length>n.length?1:-1}static from(r,n="utf8"){if(r&&typeof r=="object"&&r.type==="Buffer")return new e(r.data);if(typeof r=="number")return new e(new Uint8Array(r));if(typeof r=="string")return lr(r,n);if(ArrayBuffer.isView(r)){let{byteOffset:i,byteLength:o,buffer:s}=r;return"map"in r&&typeof r.map=="function"?new e(r.map(a=>a%256),i,o):new e(s,i,o)}if(r&&typeof r=="object"&&("length"in r||"byteLength"in r||"buffer"in r))return new e(r);throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}static concat(r,n){if(r.length===0)return e.alloc(0);let i=[].concat(...r.map(s=>[...s])),o=e.alloc(n!==void 0?n:i.length);return o.set(n!==void 0?i.slice(0,n):i),o}slice(r=0,n=this.length){return this.subarray(r,n)}subarray(r=0,n=this.length){return Object.setPrototypeOf(super.subarray(r,n),e.prototype)}reverse(){return super.reverse(),this}readIntBE(r,n){$(r,"offset"),Y(r,"offset"),q(r,"offset",this.length-1),$(n,"byteLength"),Y(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s=0;s--)o.setUint8(s,r&255),r=r/256;return n+i}writeUintBE(r,n,i){return this.writeUIntBE(r,n,i)}writeUIntLE(r,n,i){$(n,"offset"),Y(n,"offset"),q(n,"offset",this.length-1),$(i,"byteLength"),Y(i,"byteLength");let o=new DataView(this.buffer,n,i);for(let s=0;sn===r[i])}copy(r,n=0,i=0,o=this.length){q(n,"targetStart"),q(i,"sourceStart",this.length),q(o,"sourceEnd"),n>>>=0,i>>>=0,o>>>=0;let s=0;for(;i=this.length?this.length-f:r.length),f);return this}includes(r,n=null,i="utf-8"){return this.indexOf(r,n,i)!==-1}lastIndexOf(r,n=null,i="utf-8"){return this.indexOf(r,n,i,!0)}indexOf(r,n=null,i="utf-8",o=!1){let s=o?this.findLastIndex.bind(this):this.findIndex.bind(this);i=typeof n=="string"?n:i;let a=e.from(typeof r=="number"?[r]:r,i),f=typeof n=="string"?0:n;return f=typeof n=="number"?f:null,f=Number.isNaN(f)?null:f,f??=o?this.length:0,f=f<0?this.length+f:f,a.length===0&&o===!1?f>=this.length?this.length:f:a.length===0&&o===!0?(f>=this.length?this.length:f)||this.length:s((v,C)=>(o?C<=f:C>=f)&&this[C]===a[0]&&a.every((O,R)=>this[C+R]===O))}toString(r="utf8",n=0,i=this.length){if(n=n<0?0:n,r=r.toString().toLowerCase(),i<=0)return"";if(r==="utf8"||r==="utf-8")return Uo.decode(this.slice(n,i));if(r==="base64"||r==="base64url"){let o=btoa(this.reduce((s,a)=>s+ur(a),""));return r==="base64url"?o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):o}if(r==="binary"||r==="ascii"||r==="latin1"||r==="latin-1")return this.slice(n,i).reduce((o,s)=>o+ur(s&(r==="ascii"?127:255)),"");if(r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le"){let o=new DataView(this.buffer.slice(n,i));return Array.from({length:o.byteLength/2},(s,a)=>a*2+1o+s.toString(16).padStart(2,"0"),"");zr(`encoding "${r}"`)}toLocaleString(){return this.toString()}inspect(){return``}};No={int8:[-128,127],int16:[-32768,32767],int32:[-2147483648,2147483647],uint8:[0,255],uint16:[0,65535],uint32:[0,4294967295],float32:[-1/0,1/0],float64:[-1/0,1/0],bigint64:[-0x8000000000000000n,0x7fffffffffffffffn],biguint64:[0n,0xffffffffffffffffn]},Bo=new TextEncoder,Uo=new TextDecoder,$o=["utf8","utf-8","hex","base64","ascii","binary","base64url","ucs2","ucs-2","utf16le","utf-16le","latin1","latin-1"],Vo=4294967295;Do(h.prototype);y=new Proxy(qo,{construct(e,[t,r]){return h.from(t,r)},get(e,t){return h[t]}}),ur=String.fromCodePoint});var g,c=oe(()=>{"use strict";g={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var E,m=oe(()=>{"use strict";E=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var w,p=oe(()=>{"use strict";w=()=>{};w.prototype=w});var b,d=oe(()=>{"use strict";b=class{constructor(t){this.value=t}deref(){return this.value}}});function en(e,t){var r,n,i,o,s,a,f,v,C=e.constructor,T=C.precision;if(!e.s||!t.s)return t.s||(t=new C(e)),B?_(t,T):t;if(f=e.d,v=t.d,s=e.e,i=t.e,f=f.slice(),o=s-i,o){for(o<0?(n=f,o=-o,a=v.length):(n=v,i=s,a=f.length),s=Math.ceil(T/F),a=s>a?s+1:a+1,o>a&&(o=a,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(a=f.length,o=v.length,a-o<0&&(o=a,n=v,v=f,f=n),r=0;o;)r=(f[--o]=f[o]+v[o]+r)/j|0,f[o]%=j;for(r&&(f.unshift(r),++i),a=f.length;f[--a]==0;)f.pop();return t.d=f,t.e=i,B?_(t,T):t}function le(e,t,r){if(e!==~~e||er)throw Error(Re+e)}function ae(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t16)throw Error(mr+V(e));if(!e.s)return new C(Z);for(t==null?(B=!1,a=T):a=t,s=new C(.03125);e.abs().gte(.1);)e=e.times(s),v+=5;for(n=Math.log(Ae(2,v))/Math.LN10*2+5|0,a+=n,r=i=o=new C(Z),C.precision=a;;){if(i=_(i.times(e),a),r=r.times(++f),s=o.plus(ge(i,r,a)),ae(s.d).slice(0,a)===ae(o.d).slice(0,a)){for(;v--;)o=_(o.times(o),a);return C.precision=T,t==null?(B=!0,_(o,T)):o}o=s}}function V(e){for(var t=e.e*F,r=e.d[0];r>=10;r/=10)t++;return t}function cr(e,t,r){if(t>e.LN10.sd())throw B=!0,r&&(e.precision=r),Error(te+"LN10 precision limit exceeded");return _(new e(e.LN10),t)}function we(e){for(var t="";e--;)t+="0";return t}function Ye(e,t){var r,n,i,o,s,a,f,v,C,T=1,O=10,R=e,L=R.d,S=R.constructor,M=S.precision;if(R.s<1)throw Error(te+(R.s?"NaN":"-Infinity"));if(R.eq(Z))return new S(0);if(t==null?(B=!1,v=M):v=t,R.eq(10))return t==null&&(B=!0),cr(S,v);if(v+=O,S.precision=v,r=ae(L),n=r.charAt(0),o=V(R),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)R=R.times(e),r=ae(R.d),n=r.charAt(0),T++;o=V(R),n>1?(R=new S("0."+r),o++):R=new S(n+"."+r.slice(1))}else return f=cr(S,v+2,M).times(o+""),R=Ye(new S(n+"."+r.slice(1)),v-O).plus(f),S.precision=M,t==null?(B=!0,_(R,M)):R;for(a=s=R=ge(R.minus(Z),R.plus(Z),v),C=_(R.times(R),v),i=3;;){if(s=_(s.times(C),v),f=a.plus(ge(s,new S(i),v)),ae(f.d).slice(0,v)===ae(a.d).slice(0,v))return a=a.times(2),o!==0&&(a=a.plus(cr(S,v+2,M).times(o+""))),a=ge(a,new S(T),v),S.precision=M,t==null?(B=!0,_(a,M)):a;a=f,i+=2}}function Yr(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Fe(r/F),e.d=[],n=(r+1)%F,r<0&&(n+=F),nPt||e.e<-Pt))throw Error(mr+r)}else e.s=0,e.e=0,e.d=[0];return e}function _(e,t,r){var n,i,o,s,a,f,v,C,T=e.d;for(s=1,o=T[0];o>=10;o/=10)s++;if(n=t-s,n<0)n+=F,i=t,v=T[C=0];else{if(C=Math.ceil((n+1)/F),o=T.length,C>=o)return e;for(v=o=T[C],s=1;o>=10;o/=10)s++;n%=F,i=n-F+s}if(r!==void 0&&(o=Ae(10,s-i-1),a=v/o%10|0,f=t<0||T[C+1]!==void 0||v%o,f=r<4?(a||f)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||f||r==6&&(n>0?i>0?v/Ae(10,s-i):0:T[C-1])%10&1||r==(e.s<0?8:7))),t<1||!T[0])return f?(o=V(e),T.length=1,t=t-o-1,T[0]=Ae(10,(F-t%F)%F),e.e=Fe(-t/F)||0):(T.length=1,T[0]=e.e=e.s=0),e;if(n==0?(T.length=C,o=1,C--):(T.length=C+1,o=Ae(10,F-n),T[C]=i>0?(v/Ae(10,s-i)%Ae(10,i)|0)*o:0),f)for(;;)if(C==0){(T[0]+=o)==j&&(T[0]=1,++e.e);break}else{if(T[C]+=o,T[C]!=j)break;T[C--]=0,o=1}for(n=T.length;T[--n]===0;)T.pop();if(B&&(e.e>Pt||e.e<-Pt))throw Error(mr+V(e));return e}function rn(e,t){var r,n,i,o,s,a,f,v,C,T,O=e.constructor,R=O.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new O(e),B?_(t,R):t;if(f=e.d,T=t.d,n=t.e,v=e.e,f=f.slice(),s=v-n,s){for(C=s<0,C?(r=f,s=-s,a=T.length):(r=T,n=v,a=f.length),i=Math.max(Math.ceil(R/F),a)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=f.length,a=T.length,C=i0;--i)f[a++]=0;for(i=T.length;i>s;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+we(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+we(-i-1)+o,r&&(n=r-s)>0&&(o+=we(n))):i>=s?(o+=we(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+we(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=we(n))),e.s<0?"-"+o:o}function Xr(e,t){if(e.length>t)return e.length=t,!0}function nn(e){var t,r,n;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Re+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return Yr(s,o.toString())}else if(typeof o!="string")throw Error(Re+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,Qo.test(o))Yr(s,o);else throw Error(Re+o)}if(i.prototype=A,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=nn,i.config=i.set=Jo,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Re+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Re+r+": "+n);return this}var De,jo,pr,B,te,Re,mr,Fe,Ae,Qo,Z,j,F,Zr,Pt,A,ge,pr,vt,on=oe(()=>{"use strict";u();c();m();p();d();l();De=1e9,jo={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},B=!0,te="[DecimalError] ",Re=te+"Invalid argument: ",mr=te+"Exponent out of range: ",Fe=Math.floor,Ae=Math.pow,Qo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,j=1e7,F=7,Zr=9007199254740991,Pt=Fe(Zr/F),A={};A.absoluteValue=A.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};A.comparedTo=A.cmp=function(e){var t,r,n,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};A.decimalPlaces=A.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*F;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};A.dividedBy=A.div=function(e){return ge(this,new this.constructor(e))};A.dividedToIntegerBy=A.idiv=function(e){var t=this,r=t.constructor;return _(ge(t,new r(e),0,1),r.precision)};A.equals=A.eq=function(e){return!this.cmp(e)};A.exponent=function(){return V(this)};A.greaterThan=A.gt=function(e){return this.cmp(e)>0};A.greaterThanOrEqualTo=A.gte=function(e){return this.cmp(e)>=0};A.isInteger=A.isint=function(){return this.e>this.d.length-2};A.isNegative=A.isneg=function(){return this.s<0};A.isPositive=A.ispos=function(){return this.s>0};A.isZero=function(){return this.s===0};A.lessThan=A.lt=function(e){return this.cmp(e)<0};A.lessThanOrEqualTo=A.lte=function(e){return this.cmp(e)<1};A.logarithm=A.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Z))throw Error(te+"NaN");if(r.s<1)throw Error(te+(r.s?"NaN":"-Infinity"));return r.eq(Z)?new n(0):(B=!1,t=ge(Ye(r,o),Ye(e,o),o),B=!0,_(t,i))};A.minus=A.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rn(t,e):en(t,(e.s=-e.s,e))};A.modulo=A.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(te+"NaN");return r.s?(B=!1,t=ge(r,e,0,1).times(e),B=!0,r.minus(t)):_(new n(r),i)};A.naturalExponential=A.exp=function(){return tn(this)};A.naturalLogarithm=A.ln=function(){return Ye(this)};A.negated=A.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};A.plus=A.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?en(t,e):rn(t,(e.s=-e.s,e))};A.precision=A.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Re+e);if(t=V(i)+1,n=i.d.length-1,r=n*F+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};A.squareRoot=A.sqrt=function(){var e,t,r,n,i,o,s,a=this,f=a.constructor;if(a.s<1){if(!a.s)return new f(0);throw Error(te+"NaN")}for(e=V(a),B=!1,i=Math.sqrt(+a),i==0||i==1/0?(t=ae(a.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Fe((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=s=r+3;;)if(o=n,n=o.plus(ge(a,o,s+2)).times(.5),ae(o.d).slice(0,s)===(t=ae(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(_(o,r+1,0),o.times(o).eq(a)){n=o;break}}else if(t!="9999")break;s+=4}return B=!0,_(n,r)};A.times=A.mul=function(e){var t,r,n,i,o,s,a,f,v,C=this,T=C.constructor,O=C.d,R=(e=new T(e)).d;if(!C.s||!e.s)return new T(0);for(e.s*=C.s,r=C.e+e.e,f=O.length,v=R.length,f=0;){for(t=0,i=f+n;i>n;)a=o[i]+R[n]*O[i-n-1]+t,o[i--]=a%j|0,t=a/j|0;o[i]=(o[i]+t)%j|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,B?_(e,T.precision):e};A.toDecimalPlaces=A.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(le(e,0,De),t===void 0?t=n.rounding:le(t,0,8),_(r,e+V(r)+1,t))};A.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Se(n,!0):(le(e,0,De),t===void 0?t=i.rounding:le(t,0,8),n=_(new i(n),e+1,t),r=Se(n,!0,e+1)),r};A.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?Se(i):(le(e,0,De),t===void 0?t=o.rounding:le(t,0,8),n=_(new o(i),e+V(i)+1,t),r=Se(n.abs(),!1,e+V(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};A.toInteger=A.toint=function(){var e=this,t=e.constructor;return _(new t(e),V(e)+1,t.rounding)};A.toNumber=function(){return+this};A.toPower=A.pow=function(e){var t,r,n,i,o,s,a=this,f=a.constructor,v=12,C=+(e=new f(e));if(!e.s)return new f(Z);if(a=new f(a),!a.s){if(e.s<1)throw Error(te+"Infinity");return a}if(a.eq(Z))return a;if(n=f.precision,e.eq(Z))return _(a,n);if(t=e.e,r=e.d.length-1,s=t>=r,o=a.s,s){if((r=C<0?-C:C)<=Zr){for(i=new f(Z),t=Math.ceil(n/F+4),B=!1;r%2&&(i=i.times(a),Xr(i.d,t)),r=Fe(r/2),r!==0;)a=a.times(a),Xr(a.d,t);return B=!0,e.s<0?new f(Z).div(i):_(i,n)}}else if(o<0)throw Error(te+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,a.s=1,B=!1,i=e.times(Ye(a,n+v)),B=!0,i=tn(i),i.s=o,i};A.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=V(i),n=Se(i,r<=o.toExpNeg||r>=o.toExpPos)):(le(e,1,De),t===void 0?t=o.rounding:le(t,0,8),i=_(new o(i),e,t),r=V(i),n=Se(i,e<=r||r<=o.toExpNeg,e)),n};A.toSignificantDigits=A.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(le(e,1,De),t===void 0?t=n.rounding:le(t,0,8)),_(new n(r),e,t)};A.toString=A.valueOf=A.val=A.toJSON=A[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=V(e),r=e.constructor;return Se(e,t<=r.toExpNeg||t>=r.toExpPos)};ge=function(){function e(n,i){var o,s=0,a=n.length;for(n=n.slice();a--;)o=n[a]*i+s,n[a]=o%j|0,s=o/j|0;return s&&n.unshift(s),n}function t(n,i,o,s){var a,f;if(o!=s)f=o>s?1:-1;else for(a=f=0;ai[a]?1:-1;break}return f}function r(n,i,o){for(var s=0;o--;)n[o]-=s,s=n[o]1;)n.shift()}return function(n,i,o,s){var a,f,v,C,T,O,R,L,S,M,ne,z,Ie,k,Ce,sr,ie,bt,wt=n.constructor,Oo=n.s==i.s?1:-1,se=n.d,U=i.d;if(!n.s)return new wt(n);if(!i.s)throw Error(te+"Division by zero");for(f=n.e-i.e,ie=U.length,Ce=se.length,R=new wt(Oo),L=R.d=[],v=0;U[v]==(se[v]||0);)++v;if(U[v]>(se[v]||0)&&--f,o==null?z=o=wt.precision:s?z=o+(V(n)-V(i))+1:z=o,z<0)return new wt(0);if(z=z/F+2|0,v=0,ie==1)for(C=0,U=U[0],z++;(v1&&(U=e(U,C),se=e(se,C),ie=U.length,Ce=se.length),k=ie,S=se.slice(0,ie),M=S.length;M=j/2&&++sr;do C=0,a=t(U,S,ie,M),a<0?(ne=S[0],ie!=M&&(ne=ne*j+(S[1]||0)),C=ne/sr|0,C>1?(C>=j&&(C=j-1),T=e(U,C),O=T.length,M=S.length,a=t(T,S,O,M),a==1&&(C--,r(T,ie{"use strict";on();P=class extends vt{static isDecimal(t){return t instanceof vt}static random(t=20){{let n=crypto.getRandomValues(new Uint8Array(t)).reduce((i,o)=>i+o,"");return new vt(`0.${n.slice(0,t)}`)}}},ue=P});function Wo(){return!1}var Go,Ko,un,cn=oe(()=>{"use strict";u();c();m();p();d();l();Go={},Ko={existsSync:Wo,promises:Go},un=Ko});var xn=Te((Au,En)=>{"use strict";u();c();m();p();d();l();En.exports=(yr(),ar(hr)).format});var hr={};ze(hr,{default:()=>Yo,deprecate:()=>vn,format:()=>Tn,inspect:()=>Cn,promisify:()=>Pn});function Pn(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function vn(e,t){return(...r)=>(console.warn(t),e(...r))}function Cn(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var Tn,zo,Yo,yr=oe(()=>{"use strict";u();c();m();p();d();l();Tn=xn(),zo={promisify:Pn,deprecate:vn,inspect:Cn,format:Tn},Yo=zo});function rs(...e){return e.join("/")}function ns(...e){return e.join("/")}var On,is,os,Ze,kn=oe(()=>{"use strict";u();c();m();p();d();l();On="/",is={sep:On},os={resolve:rs,posix:is,join:ns,sep:On},Ze=os});var St,Mn=oe(()=>{"use strict";u();c();m();p();d();l();St=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var _n=Te((Kc,In)=>{"use strict";u();c();m();p();d();l();In.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 Nn=Te((lm,Fn)=>{"use strict";u();c();m();p();d();l();Fn.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 Un=Te((gm,Bn)=>{"use strict";u();c();m();p();d();l();var ms=Nn();Bn.exports=e=>typeof e=="string"?e.replace(ms(),""):e});var jn=Te((Jf,gs)=>{gs.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Qn=Te(()=>{"use strict";u();c();m();p();d();l()});var Ur=Te((ST,Fi)=>{"use strict";u();c();m();p();d();l();Fi.exports=function(){function e(t,r,n,i,o){return tn?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;swr,Decimal:()=>ue,Extensions:()=>dr,MetricsClient:()=>Ue,NotFoundError:()=>he,PrismaClientInitializationError:()=>I,PrismaClientKnownRequestError:()=>Q,PrismaClientRustPanicError:()=>ye,PrismaClientUnknownRequestError:()=>J,PrismaClientValidationError:()=>W,Public:()=>fr,Sql:()=>X,defineDmmfProperty:()=>qn,empty:()=>Wn,getPrismaClient:()=>Ao,getRuntime:()=>Pe,join:()=>Jn,makeStrictEnum:()=>Ro,objectEnumValues:()=>Lt,raw:()=>kr,sqltag:()=>Lr,warnEnvConflicts:()=>void 0,warnOnce:()=>nt});module.exports=ar(Ya);u();c();m();p();d();l();var dr={};ze(dr,{defineExtension:()=>sn,getExtensionContext:()=>an});u();c();m();p();d();l();u();c();m();p();d();l();function sn(e){return typeof e=="function"?e:t=>t.$extends(e)}u();c();m();p();d();l();function an(e){return e}var fr={};ze(fr,{validator:()=>ln});u();c();m();p();d();l();u();c();m();p();d();l();function ln(...e){return t=>t}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var gr,mn,pn,dn,fn=!0;typeof g<"u"&&({FORCE_COLOR:gr,NODE_DISABLE_COLORS:mn,NO_COLOR:pn,TERM:dn}=g.env||{},fn=g.stdout&&g.stdout.isTTY);var Ho={enabled:!mn&&pn==null&&dn!=="dumb"&&(gr!=null&&gr!=="0"||fn)};function D(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ho.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var ru=D(0,0),Ct=D(1,22),Tt=D(2,22),nu=D(3,23),gn=D(4,24),iu=D(7,27),ou=D(8,28),su=D(9,29),au=D(30,39),Ne=D(31,39),hn=D(32,39),At=D(33,39),yn=D(34,39),lu=D(35,39),bn=D(36,39),uu=D(37,39),wn=D(90,39),cu=D(90,39),mu=D(40,49),pu=D(41,49),du=D(42,49),fu=D(43,49),gu=D(44,49),hu=D(45,49),yu=D(46,49),bu=D(47,49);u();c();m();p();d();l();var Xo=100,An=["green","yellow","blue","magenta","cyan","red"],Rt=[],Rn=Date.now(),Zo=0,br=typeof g<"u"?g.env:{};globalThis.DEBUG??=br.DEBUG??"";globalThis.DEBUG_COLORS??=br.DEBUG_COLORS?br.DEBUG_COLORS==="true":!0;var Xe={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,i;typeof require=="function"&&typeof g<"u"&&typeof g.stderr<"u"&&typeof g.stderr.write=="function"?i=(...o)=>{try{let s=(yr(),ar(hr));g.stderr.write(s.format(...o)+` -`)}catch{i=console.warn??console.log}}:i=console.warn??console.log,i(`${t} ${r}`,...n)},formatters:{}};function es(e){let t={color:An[Zo++%An.length],enabled:Xe.enabled(e),namespace:e,log:Xe.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Rt.push([o,...n]),Rt.length>Xo&&Rt.shift(),Xe.enabled(o)||i){let f=n.map(C=>typeof C=="string"?C:ts(C)),v=`+${Date.now()-Rn}ms`;Rn=Date.now(),a(o,...f,v)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var wr=new Proxy(es,{get:(e,t)=>Xe[t],set:(e,t,r)=>Xe[t]=r});function ts(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 Sn(){Rt.length=0}var ee=wr;u();c();m();p();d();l();u();c();m();p();d();l();var Er=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];u();c();m();p();d();l();var Ln="library";function et(e){let t=ss();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Ln)}function ss(){let e=g.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}u();c();m();p();d();l();u();c();m();p();d();l();var Oe;(t=>{let e;(k=>(k.findUnique="findUnique",k.findUniqueOrThrow="findUniqueOrThrow",k.findFirst="findFirst",k.findFirstOrThrow="findFirstOrThrow",k.findMany="findMany",k.create="create",k.createMany="createMany",k.createManyAndReturn="createManyAndReturn",k.update="update",k.updateMany="updateMany",k.upsert="upsert",k.delete="delete",k.deleteMany="deleteMany",k.groupBy="groupBy",k.count="count",k.aggregate="aggregate",k.findRaw="findRaw",k.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Oe||={});var rt={};ze(rt,{error:()=>us,info:()=>ls,log:()=>as,query:()=>cs,should:()=>Dn,tags:()=>tt,warn:()=>xr});u();c();m();p();d();l();var tt={error:Ne("prisma:error"),warn:At("prisma:warn"),info:bn("prisma:info"),query:yn("prisma:query")},Dn={warn:()=>!g.env.PRISMA_DISABLE_WARNINGS};function as(...e){console.log(...e)}function xr(e,...t){Dn.warn()&&console.warn(`${tt.warn} ${e}`,...t)}function ls(e,...t){console.info(`${tt.info} ${e}`,...t)}function us(e,...t){console.error(`${tt.error} ${e}`,...t)}function cs(e,...t){console.log(`${tt.query} ${e}`,...t)}u();c();m();p();d();l();function Ot(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}u();c();m();p();d();l();function ke(e,t){throw new Error(t)}u();c();m();p();d();l();function Pr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}u();c();m();p();d();l();var vr=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});u();c();m();p();d();l();function Be(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}u();c();m();p();d();l();function Cr(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{$n.has(e)||($n.add(e),xr(t,...r))};u();c();m();p();d();l();var Q=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};K(Q,"PrismaClientKnownRequestError");var he=class extends Q{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};K(he,"NotFoundError");u();c();m();p();d();l();var I=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};K(I,"PrismaClientInitializationError");u();c();m();p();d();l();var ye=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};K(ye,"PrismaClientRustPanicError");u();c();m();p();d();l();var J=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};K(J,"PrismaClientUnknownRequestError");u();c();m();p();d();l();var W=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};K(W,"PrismaClientValidationError");u();c();m();p();d();l();var Ue=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};u();c();m();p();d();l();u();c();m();p();d();l();function it(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function qn(e,t){let r=it(()=>ps(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function ps(e){throw new Error("Prisma.dmmf is not available when running in edge runtimes.")}function Tr(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}u();c();m();p();d();l();var kt=Symbol(),Ar=new WeakMap,be=class{constructor(t){t===kt?Ar.set(this,`Prisma.${this._getName()}`):Ar.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Ar.get(this)}},ot=class extends be{_getNamespace(){return"NullTypes"}},st=class extends ot{};Rr(st,"DbNull");var at=class extends ot{};Rr(at,"JsonNull");var lt=class extends ot{};Rr(lt,"AnyNull");var Lt={classes:{DbNull:st,JsonNull:at,AnyNull:lt},instances:{DbNull:new st(kt),JsonNull:new at(kt),AnyNull:new lt(kt)}};function Rr(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();function ut(e){return{ok:!1,error:e,map(){return ut(e)},flatMap(){return ut(e)}}}var Sr=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},Or=e=>{let t=new Sr,r=Le(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Le(t,e.queryRaw.bind(e)),executeRaw:Le(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>ds(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=fs(t,e.getConnectionInfo.bind(e))),n},ds=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Le(e,t.queryRaw.bind(t)),executeRaw:Le(e,t.executeRaw.bind(t)),commit:Le(e,t.commit.bind(t)),rollback:Le(e,t.rollback.bind(t))});function Le(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return ut({kind:"GenericJs",id:i})}}}function fs(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return ut({kind:"GenericJs",id:i})}}}var To=_e(jn());var cO=_e(Qn());Mn();cn();kn();u();c();m();p();d();l();var X=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}u();c();m();p();d();l();u();c();m();p();d();l();var Mt={enumerable:!0,configurable:!0,writable:!0};function It(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>Mt,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Gn=Symbol.for("nodejs.util.inspect.custom");function me(e,t){let r=hs(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Kn(Reflect.ownKeys(o),r),a=Kn(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let f=r.get(s);return f?f.getPropertyDescriptor?{...Mt,...f?.getPropertyDescriptor(s)}:Mt:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[Gn]=function(){let o={...this};return delete o[Gn],o},i}function hs(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Kn(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}u();c();m();p();d();l();function $e(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}u();c();m();p();d();l();function _t(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}u();c();m();p();d();l();u();c();m();p();d();l();var Ve=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};u();c();m();p();d();l();u();c();m();p();d();l();function Hn(e){return e.substring(0,1).toLowerCase()+e.substring(1)}u();c();m();p();d();l();function qe(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Dt(e){return e.toString()!=="Invalid Date"}u();c();m();p();d();l();l();function je(e){return P.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}u();c();m();p();d();l();var mt=class{constructor(t,r,n,i,o){this.modelName=t,this.name=r,this.typeName=n,this.isList=i,this.isEnum=o}_toGraphQLInputType(){let t=this.isList?"List":"",r=this.isEnum?"Enum":"";return`${t}${r}${this.typeName}FieldRefInput<${this.modelName}>`}};function Qe(e){return e instanceof mt}u();c();m();p();d();l();u();c();m();p();d();l();var Ft=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};u();c();m();p();d();l();var Nt=e=>e,Bt={bold:Nt,red:Nt,green:Nt,dim:Nt,enabled:!1},zn={bold:Ct,red:Ne,green:hn,dim:Tt,enabled:!0},Je={write(e){e.writeLine(",")}};u();c();m();p();d();l();var pe=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};u();c();m();p();d();l();var Ee=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var We=class extends Ee{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new Ft(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new pe("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(Je,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};u();c();m();p();d();l();var Yn=": ",Ut=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Yn.length}write(t){let r=new pe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Yn).write(this.value)}};u();c();m();p();d();l();var $t=class e extends Ee{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let f;if(s.value instanceof e?f=s.value.getField(a):s.value instanceof We&&(f=s.value.getField(Number(a))),!f)return;s=f}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new pe("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(Je,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};u();c();m();p();d();l();var G=class extends Ee{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new pe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var Mr=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Vt(e){return new Mr(Xn(e))}function Xn(e){let t=new $t;for(let[r,n]of Object.entries(e)){let i=new Ut(r,Zn(n));t.addField(i)}return t}function Zn(e){if(typeof e=="string")return new G(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new G(String(e));if(typeof e=="bigint")return new G(`${e}n`);if(e===null)return new G("null");if(e===void 0)return new G("undefined");if(je(e))return new G(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return y.isBuffer(e)?new G(`Buffer.alloc(${e.byteLength})`):new G(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Dt(e)?e.toISOString():"Invalid Date";return new G(`new Date("${t}")`)}return e instanceof be?new G(`Prisma.${e._getName()}`):Qe(e)?new G(`prisma.${Hn(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?bs(e):typeof e=="object"?Xn(e):new G(Object.prototype.toString.call(e))}function bs(e){let t=new We;for(let r of e)t.addItem(Zn(r));return t}function ei(e){if(e===void 0)return"";let t=Vt(e);return new Ve(0,{colors:Bt}).write(t).toString()}u();c();m();p();d();l();var ws="P2037";function qt({error:e,user_facing_error:t},r,n){return t.error_code?new Q(Es(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new J(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function Es(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===ws&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Ir=class{getLocation(){return null}};function xe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Ir}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var ti={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Ge(e={}){let t=Ps(e);return Object.entries(t).reduce((n,[i,o])=>(ti[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Ps(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function jt(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ri(e,t){let r=jt(e);return t({action:"aggregate",unpacker:r,argsMapper:Ge})(e)}u();c();m();p();d();l();function vs(e={}){let{select:t,...r}=e;return typeof t=="object"?Ge({...r,_count:t}):Ge({...r,_count:{_all:!0}})}function Cs(e={}){return typeof e.select=="object"?t=>jt(e)(t)._count:t=>jt(e)(t)._count._all}function ni(e,t){return t({action:"count",unpacker:Cs(e),argsMapper:vs})(e)}u();c();m();p();d();l();function Ts(e={}){let t=Ge(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function As(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function ii(e,t){return t({action:"groupBy",unpacker:As(e),argsMapper:Ts})(e)}function oi(e,t,r){if(t==="aggregate")return n=>ri(n,r);if(t==="count")return n=>ni(n,r);if(t==="groupBy")return n=>ii(n,r)}u();c();m();p();d();l();function si(e,t){let r=t.fields.filter(i=>!i.relationName),n=vr(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new mt(e,o,s.type,s.isList,s.kind==="enum")},...It(Object.keys(n))})}u();c();m();p();d();l();u();c();m();p();d();l();var ai=e=>Array.isArray(e)?e:e.split("."),_r=(e,t)=>ai(t).reduce((r,n)=>r&&r[n],e),li=(e,t,r)=>ai(t).reduceRight((n,i,o,s)=>Object.assign({},_r(e,s.slice(0,o)),{[i]:n}),r);function Rs(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Ss(e,t,r){return t===void 0?e??{}:li(t,r,e||!0)}function Dr(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((f,v)=>({...f,[v.name]:v}),{});return f=>{let v=xe(e._errorFormat),C=Rs(n,i),T=Ss(f,o,C),O=r({dataPath:C,callsite:v})(T),R=Os(e,t);return new Proxy(O,{get(L,S){if(!R.includes(S))return L[S];let ne=[a[S].type,r,S],z=[C,T];return Dr(e,...ne,...z)},...It([...R,...Object.getOwnPropertyNames(O)])})}}function Os(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}u();c();m();p();d();l();u();c();m();p();d();l();var ks=_e(_n());var Ls={red:Ne,gray:wn,dim:Tt,bold:Ct,underline:gn,highlightSource:e=>e.highlight()},Ms={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Is({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function _s({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],f=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${f}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${f}`)),t&&a.push(s.underline(Ds(t))),i){a.push("");let v=[i.toString()];o&&(v.push(o),v.push(s.dim(")"))),a.push(v.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function Ds(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function Ke(e){let t=e.showColors?Ls:Ms,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(e,t):r=Is(e),_s(r,t)}function ui(e,t,r,n){return e===Oe.ModelAction.findFirstOrThrow||e===Oe.ModelAction.findUniqueOrThrow?Fs(t,r,n):n}function Fs(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=Ke({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new W(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof Q&&o.code==="P2025"?new he(`No ${e} found`,t):o})}}u();c();m();p();d();l();function de(e){return e.replace(/^./,t=>t.toLowerCase())}var Ns=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Bs=["aggregate","count","groupBy"];function Fr(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Us(e,t),Vs(e,t),ct(r),H("name",()=>t),H("$name",()=>t),H("$parent",()=>e._appliedParent)];return me({},n)}function Us(e,t){let r=de(t),n=Object.keys(Oe.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=f=>e._request(f);s=ui(o,t,e._clientVersion,s);let a=f=>v=>{let C=xe(e._errorFormat);return e._createPrismaPromise(T=>{let O={args:v,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:T,callsite:C};return s({...O,...f})})};return Ns.includes(o)?Dr(e,t,a):$s(i)?oi(e,i,a):a({})}}}function $s(e){return Bs.includes(e)}function Vs(e,t){return Me(H("fields",()=>{let r=e._runtimeDataModel.models[t];return si(t,r)}))}u();c();m();p();d();l();function ci(e){return e.replace(/^./,t=>t.toUpperCase())}var Nr=Symbol();function pt(e){let t=[qs(e),H(Nr,()=>e),H("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(ct(r)),me(e,t)}function qs(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(de),n=[...new Set(t.concat(r))];return Me({getKeys(){return n},getPropertyValue(i){let o=ci(i);if(e._runtimeDataModel.models[o]!==void 0)return Fr(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Fr(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function mi(e){return e[Nr]?e[Nr]:e}function pi(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return pt(t)}u();c();m();p();d();l();u();c();m();p();d();l();function di({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let f of Object.values(o)){if(n){if(n[f.name])continue;let v=f.needs.filter(C=>n[C]);v.length>0&&a.push($e(v))}else if(r){if(!r[f.name])continue;let v=f.needs.filter(C=>!r[C]);v.length>0&&a.push($e(v))}js(e,f.needs)&&s.push(Qs(f,me(e,s)))}return s.length>0||a.length>0?me(e,[...s,...a]):e}function js(e,t){return t.every(r=>Pr(e,r))}function Qs(e,t){return Me(H(e.name,()=>e.compute(t)))}u();c();m();p();d();l();function Qt({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sC.name===o);if(!f||f.kind!=="object"||!f.relationName)continue;let v=typeof s=="object"?s:{};t[o]=Qt({visitor:i,result:t[o],args:v,modelName:f.type,runtimeDataModel:n})}}function gi({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Qt({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(s,a,f)=>di({result:s,modelName:de(a),select:f.select,omit:f.omit,extensions:n})})}u();c();m();p();d();l();u();c();m();p();d();l();l();function hi(e){if(e instanceof X)return Js(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:hi(t.args??{}),__internalParams:t,query:(s,a=t)=>{let f=a.customDataProxyFetch;return a.customDataProxyFetch=Pi(o,f),a.args=s,bi(e,a,r,n+1)}})})}function wi(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return bi(e,t,s)}function Ei(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?xi(r,n,0,e):e(r)}}function xi(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let f=a.customDataProxyFetch;return a.customDataProxyFetch=Pi(i,f),xi(a,t,r+1,n)}})}var yi=e=>e;function Pi(e=yi,t=yi){return r=>e(t(r))}u();c();m();p();d();l();u();c();m();p();d();l();function Ci(e,t,r){let n=de(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Ws({...e,...vi(t.name,e,t.result.$allModels),...vi(t.name,e,t.result[n])})}function Ws(e){let t=new ce,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Be(e,n=>({...n,needs:r(n.name,new Set)}))}function vi(e,t,r){return r?Be(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Gs(t,o,i)})):{}}function Gs(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Ti(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function Ai(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Jt=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new ce;this.modelExtensionsCache=new ce;this.queryCallbacksCache=new ce;this.clientExtensions=it(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=it(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Ci(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=de(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Wt=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Jt(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Jt(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};u();c();m();p();d();l();var Ri=ee("prisma:client"),Si={Vercel:"vercel","Netlify CI":"netlify"};function Oi({postinstall:e,ciName:t,clientVersion:r}){if(Ri("checkPlatformCaching:postinstall",e),Ri("checkPlatformCaching:ciName",t),e===!0&&t&&t in Si){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${Si[t]}-build`;throw console.error(n),new I(n,r)}}u();c();m();p();d();l();function ki(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Ks="Cloudflare-Workers",Hs="node";function Li(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Ks?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===Hs?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var zs={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Pe(){let e=Li();return{id:e,prettyName:zs[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}u();c();m();p();d();l();u();c();m();p();d();l();function Gt({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 Pe().id==="workerd"?new I(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new I(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new I("error: Missing URL environment variable, value, or override.",n);return i}u();c();m();p();d();l();u();c();m();p();d();l();function Mi(e){if(e?.kind==="itx")return e.options.id}u();c();m();p();d();l();var Br,Ii={async loadLibrary(e){let{clientVersion:t,adapter:r,engineWasm:n}=e;if(r===void 0)throw new I(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Pe().prettyName})`,t);if(n===void 0)throw new I("WASM engine was unexpectedly `undefined`",t);Br===void 0&&(Br=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new I("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let a={"./query_engine_bg.js":o},f=new WebAssembly.Instance(s,a);return o.__wbg_set_wasm(f.exports),o.QueryEngine})());let i=await Br;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var Ys="P2036",fe=ee("prisma:client:libraryEngine");function Xs(e){return e.item_type==="query"&&"query"in e}function Zs(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var MC=[...Er,"native"],_i=0,ft=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=r??Ii,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary(),this.checkForTooManyEngines()}checkForTooManyEngines(){_i===10&&console.warn(`${At("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(ea(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new Q(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(fe("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new J("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new J("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new b(this),{adapter:r}=this.config;r&&fe("Using driver adapter: %O",r),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:g.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{t.deref()?.logger(n)},r),_i++}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new I(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);if(r){if("span"in r){this.config.tracingHelper.createEngineSpan(r);return}r.level=r?.level.toLowerCase()??"unknown",Xs(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):(Zs(r),this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path}))}}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return fe(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{fe("library starting");try{let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,fe("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new I(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return fe("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),fe("library stopping");let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,fe("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){fe(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new J(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof I)throw s;s.code==="GenericFailure"&&s.message?.startsWith("PANIC:");let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new J(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){fe("requestBatch");let i=_t(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Mi(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new J(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:f}=s;if(Array.isArray(a))return a.map(v=>v.errors&&v.errors.length>0?this.loggerRustPanic??this.buildQueryError(v.errors[0]):{data:v,elapsed:0});throw f&&f.length===1?new Error(f[0].error):new Error(JSON.stringify(s))}buildQueryError(t){t.user_facing_error.is_panic;let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:qt(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===Ys&&this.config.adapter){let r=t.meta?.id;Ot(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return Ot(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function ea(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}u();c();m();p();d();l();var gt="Accelerate has not been setup correctly. Make sure your client is using `.$extends(withAccelerate())`. See https://pris.ly/d/accelerate-getting-started",Kt=class{constructor(t){this.config=t;this.name="AccelerateEngine";this.resolveDatasourceUrl=this.config.accelerateUtils?.resolveDatasourceUrl;this.getBatchRequestPayload=this.config.accelerateUtils?.getBatchRequestPayload;this.prismaGraphQLToJSError=this.config.accelerateUtils?.prismaGraphQLToJSError;this.PrismaClientUnknownRequestError=this.config.accelerateUtils?.PrismaClientUnknownRequestError;this.PrismaClientInitializationError=this.config.accelerateUtils?.PrismaClientInitializationError;this.PrismaClientKnownRequestError=this.config.accelerateUtils?.PrismaClientKnownRequestError;this.debug=this.config.accelerateUtils?.debug;this.engineVersion=this.config.accelerateUtils?.engineVersion;this.clientVersion=this.config.accelerateUtils?.clientVersion}onBeforeExit(t){}async start(){}async stop(){}version(t){return"unknown"}transaction(t,r,n){throw new I(gt,this.config.clientVersion)}metrics(t){throw new I(gt,this.config.clientVersion)}request(t,r){throw new I(gt,this.config.clientVersion)}requestBatch(t,r){throw new I(gt,this.config.clientVersion)}applyPendingMigrations(){throw new I(gt,this.config.clientVersion)}};function Di({copyEngine:e=!0},t){let r;try{r=Gt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...g.env},clientVersion:t.clientVersion})}catch{}e&&r?.startsWith("prisma://")&&nt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=et(t.generator),i=!!(r?.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o&&!1){let f;throw e?r?.startsWith("prisma://")?f=["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."]:f=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:f=["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 W(f.join(` -`),{clientVersion:t.clientVersion})}if(o)return new ft(t);if(i)return new Kt(t);{let f=[`PrismaClient failed to initialize because it wasn't configured to run in this environment (${Pe().prettyName}).`,"In order to run Prisma Client in an edge runtime, you will need to configure one of the following options:","- Enable Driver Adapters: https://pris.ly/d/driver-adapters","- Enable Accelerate: https://pris.ly/d/accelerate"];throw new W(f.join(` -`),{clientVersion:t.clientVersion})}throw new W("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}u();c();m();p();d();l();function Ht({generator:e}){return e?.previewFeatures??[]}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Vi=_e(Ur());u();c();m();p();d();l();function Ui(e,t){let r=$i(e),n=ta(r),i=na(n);i?zt(i,t):t.addErrorMessage(()=>"Unknown error")}function $i(e){return e.errors.flatMap(t=>t.kind==="Union"?$i(t):[t])}function ta(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:ra(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function ra(e,t){return[...new Set(e.concat(t))]}function na(e){return Cr(e,(t,r)=>{let n=Ni(t),i=Ni(r);return n!==i?n-i:Bi(t)-Bi(r)})}function Ni(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Bi(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}u();c();m();p();d();l();var re=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};u();c();m();p();d();l();var Yt=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(Je,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function zt(e,t){switch(e.kind){case"MutuallyExclusiveFields":ia(e,t);break;case"IncludeOnScalar":oa(e,t);break;case"EmptySelection":sa(e,t);break;case"UnknownSelectionField":ua(e,t);break;case"UnknownArgument":ca(e,t);break;case"UnknownInputField":ma(e,t);break;case"RequiredArgumentMissing":pa(e,t);break;case"InvalidArgumentType":da(e,t);break;case"InvalidArgumentValue":fa(e,t);break;case"ValueTooLarge":ga(e,t);break;case"SomeFieldsMissing":ha(e,t);break;case"TooManyFieldsGiven":ya(e,t);break;case"Union":Ui(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function ia(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function oa(e,t){let[r,n]=Xt(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new re(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${ht(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function sa(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(r){let n=r.getField("omit")?.value.asObject();if(n){aa(e,t,n);return}}la(e,t)}function aa(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new re(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function la(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Qi(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${ht(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function ua(e,t){let[r,n]=Xt(e.selectionPath),i=t.arguments.getDeepSubSelectionValue(r)?.asObject(),o;if(i){let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),f=i.getFieldValue("omit")?.asObject();s?.hasField(n)?(o="select",s.getField(n)?.markAsError(),Qi(s,e.outputType)):a?.hasField(n)?(o="include",a.getField(n)?.markAsError(),ba(a,e.outputType)):f?.hasField(n)&&(o="omit",f.getField(n)?.markAsError(),wa(f,e.outputType))}t.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(ht(s)),a.join(" ")})}function ca(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Ea(n,e.arguments)),t.addErrorMessage(i=>qi(i,r,e.arguments.map(o=>o.name)))}function ma(e,t){let[r,n]=Xt(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&Ji(o,e.inputType)}t.addErrorMessage(o=>qi(o,n,e.inputType.fields.map(s=>s.name)))}function qi(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Pa(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(ht(e)),n.join(" ")}function pa(e,t){let r;t.addErrorMessage(f=>r?.value instanceof G&&r.value.text==="null"?`Argument \`${f.green(o)}\` must not be ${f.red("null")}.`:`Argument \`${f.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Xt(e.argumentPath),s=new Yt,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let f of e.inputTypes[0].fields)s.addField(f.name,f.typeNames.join(" | "));a.addSuggestion(new re(o,s).makeRequired())}else{let f=e.inputTypes.map(ji).join(" | ");a.addSuggestion(new re(o,f).makeRequired())}}function ji(e){return e.kind==="list"?`${ji(e.elementType)}[]`:e.name}function da(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Zt("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function fa(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=Zt("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function ga(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof G&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function ha(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&Ji(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Zt("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(ht(i)),o.join(" ")})}function ya(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Zt("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Qi(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new re(r.name,"true"))}function ba(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new re(r.name,"true"))}function wa(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new re(r.name,"true"))}function Ea(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new re(r.name,r.typeNames.join(" | ")))}function Ji(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new re(r.name,r.typeNames.join(" | ")))}function Xt(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function ht({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Zt(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var xa=3;function Pa(e,t){let r=1/0,n;for(let i of t){let o=(0,Vi.default)(e,i);o>xa||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.model?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};u();c();m();p();d();l();var Hi=e=>({command:e});u();c();m();p();d();l();u();c();m();p();d();l();var zi=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);u();c();m();p();d();l();l();function yt(e){try{return Yi(e,"fast")}catch{return Yi(e,"slow")}}function Yi(e,t){return JSON.stringify(e.map(r=>Ma(r,t)))}function Ma(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:qe(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ue.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:y.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Ia(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:y.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Zi(e):e}function Ia(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Zi(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Xi);let t={};for(let r of Object.keys(e))t[r]=Xi(e[r]);return t}function Xi(e){return typeof e=="bigint"?e.toString():Zi(e)}var _a=/^(\s*alter\s)/i,eo=ee("prisma:client");function qr(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&_a.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var jr=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:yt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:yt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:yt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=zi(r),i={values:yt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?eo(`prisma.${e}(${n}, ${i.values})`):eo(`prisma.${e}(${n})`),{query:n,parameters:i}},to={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new X(t,r)}},ro={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};u();c();m();p();d();l();function Qr(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=no(r(o)):no(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function no(e){return typeof e.then=="function"?e:Promise.resolve(e)}u();c();m();p();d();l();var io={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Jr=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??io}};function oo(e){return e.includes("tracing")?new Jr:io}u();c();m();p();d();l();function so(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}u();c();m();p();d();l();var Da=["$connect","$disconnect","$on","$transaction","$use","$extends"],ao=Da;u();c();m();p();d();l();function lo(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}u();c();m();p();d();l();var tr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};u();c();m();p();d();l();var co=_e(Un());u();c();m();p();d();l();function rr(e){return typeof e.batchRequestIdx=="number"}u();c();m();p();d();l();l();function nr(e){return e===null?e:Array.isArray(e)?e.map(nr):typeof e=="object"?Fa(e)?Na(e):Be(e,nr):e}function Fa(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Na({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return y.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ue(t);case"Json":return JSON.parse(t);default:ke(t,"Unknown tagged value")}}u();c();m();p();d();l();function uo(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Wr(e.query.arguments)),t.push(Wr(e.query.selection)),t.join("")}function Wr(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Wr(n)})`:r}).join(" ")})`}u();c();m();p();d();l();var Ba={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Gr(e){return Ba[e]}u();c();m();p();d();l();var ir=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,g.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(T=>T.protocolQuery),f=this.client._tracingHelper.getTraceParent(s),v=n.some(T=>Gr(T.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:f,transaction:$a(o),containsWrite:v,customDataProxyFetch:i})).map((T,O)=>{if(T instanceof Error)return T;try{return this.mapQueryEngineResult(n[O],T)}catch(R){return R}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?mo(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Gr(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:uo(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return g.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(Ua(t),Va(t,i)||t instanceof he)throw t;if(t instanceof Q&&qa(t)){let f=po(t.meta);er({args:o,errors:[f],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=Ke({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let f=s?{modelName:s,...t.meta}:t.meta;throw new Q(a,{code:t.code,clientVersion:this.client._clientVersion,meta:f,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ye(a,this.client._clientVersion);if(t instanceof J)throw new J(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof I)throw new I(a,this.client._clientVersion);if(t instanceof ye)throw new ye(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,co.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=nr(_r(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function $a(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:mo(e)};ke(e,"Unknown transaction kind")}}function mo(e){return{id:e.id,payload:e.payload}}function Va(e,t){return rr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function qa(e){return e.code==="P2009"||e.code==="P2012"}function po(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(po)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}u();c();m();p();d();l();var fo="5.14.0";var go=fo;u();c();m();p();d();l();l();function ho(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=yo(t[n]);return r})}function yo({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return y.from(t,"base64");case"decimal":return new ue(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(yo);default:return t}}u();c();m();p();d();l();var xo=_e(Ur());u();c();m();p();d();l();var N=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};K(N,"PrismaClientConstructorValidationError");var bo=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],wo=["pretty","colorless","minimal"],Eo=["info","query","warn","error"],Qa={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new N(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=He(r,t)||` Available datasources: ${t.join(", ")}`;throw new N(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new N(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new N(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new N(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new N('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Ht(t).includes("driverAdapters"))throw new N('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(et()==="binary")throw new N('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new N(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new N(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!wo.includes(e)){let t=He(e,wo);throw new N(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new N(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Eo.includes(r)){let n=He(r,Eo);throw new N(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=He(i,o);throw new N(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new N(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new N(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new N(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new N(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=He(r,t);throw new N(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Po(e,t){for(let[r,n]of Object.entries(e)){if(!bo.includes(r)){let i=He(r,bo);throw new N(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Qa[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new N('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function He(e,t){if(t.length===0||typeof e!="string")return"";let r=Ja(e,t);return r?` Did you mean "${r}"?`:""}function Ja(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,xo.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},f=v=>{o||(o=!0,r(v))};for(let v=0;v{n[v]=C,a()},C=>{if(!rr(C)){f(C);return}C.batchRequestIdx===v?f(C):(i||(i=C),a())})})}var ve=ee("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Wa={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Ga=Symbol.for("prisma.client.transaction.id"),Ka={id:0,nextId(){return++this.id}};function Ao(e){class t{constructor(n){this._originalClient=this;this._middlewares=new tr;this._createPrismaPromise=Qr();this.$extends=pi;e=n?.__internal?.configOverride?.(e)??e,Oi(e),n&&Po(n,e);let i=n?.adapter?Or(n.adapter):void 0,o=new St().on("error",()=>{});this._extensions=Wt.empty(),this._previewFeatures=Ht(e),this._clientVersion=e.clientVersion??go,this._activeProvider=e.activeProvider,this._tracingHelper=oo(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Ze.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Ze.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=e.injectableEdgeEnv?.();try{let f=n??{},v=f.__internal??{},C=v.debug===!0;C&&ee.enable("prisma:client");let T=Ze.resolve(e.dirname,e.relativePath);un.existsSync(T)||(T=e.dirname),ve("dirname",e.dirname),ve("relativePath",e.relativePath),ve("cwd",T);let O=v.engine||{};if(f.errorFormat?this._errorFormat=f.errorFormat:g.env.NODE_ENV==="production"?this._errorFormat="minimal":g.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:T,dirname:e.dirname,enableDebugLogs:C,allowTriggerPanic:O.allowTriggerPanic,datamodelPath:Ze.join(e.dirname,e.filename??"schema.prisma"),prismaPath:O.binaryPath??void 0,engineEndpoint:O.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:f.log&&lo(f.log),logQueries:f.log&&!!(typeof f.log=="string"?f.log==="query":f.log.find(R=>typeof R=="string"?R==="query":R.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:ki(f,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:f.transactionOptions?.maxWait??2e3,timeout:f.transactionOptions?.timeout??5e3,isolationLevel:f.transactionOptions?.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Gt,getBatchRequestPayload:_t,prismaGraphQLToJSError:qt,PrismaClientUnknownRequestError:J,PrismaClientInitializationError:I,PrismaClientKnownRequestError:Q,debug:ee("prisma:client:accelerateEngine"),engineVersion:To.version,clientVersion:e.clientVersion}},ve("clientVersion",e.clientVersion),this._engine=Di(e,this._engineConfig),this._requestHandler=new or(this,o),f.log)for(let R of f.log){let L=typeof R=="string"?R:R.emit==="stdout"?R.level:null;L&&this.$on(L,S=>{rt.log(`${rt.tags[L]??""}`,S.message||S.query)})}this._metrics=new Ue(this._engine)}catch(f){throw f.clientVersion=this._clientVersion,f}return this._appliedParent=pt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Sn()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:jr({clientMethod:i,activeProvider:a}),callsite:xe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Co(n,i);return qr(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new W("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(qr(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new W(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Hi,callsite:xe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:jr({clientMethod:i,activeProvider:a}),callsite:xe(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(ho)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Co(n,i));throw new W("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Ka.nextId(),s=so(n.length),a=n.map((f,v)=>{if(f?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let C=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,T={kind:"batch",id:o,index:v,isolationLevel:C,lock:s};return f.requestTransaction?.(T)??f});return vo(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),f;try{let v={kind:"itx",...a};f=await n(this._createItxClient(v)),await this._engine.transaction("commit",o,a)}catch(v){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),v}return f}_createItxClient(n){return pt(me(mi(this),[H("_appliedParent",()=>this._appliedParent._createItxClient(n)),H("_createPrismaPromise",()=>Qr(n)),H(Ga,()=>n.id),$e(ao)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Wa,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,f=async v=>{let C=this._middlewares.get(++a);if(C)return this._tracingHelper.runInChildSpan(s.middleware,M=>C(v,ne=>(M?.end(),f(ne))));let{runInTransaction:T,args:O,...R}=v,L={...n,...R};O&&(L.args=i.middlewareArgsToRequestArgs(O)),n.transaction!==void 0&&T===!1&&delete L.transaction;let S=await wi(this,L);return L.model?gi({result:S,modelName:L.model,args:L.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):S};return this._tracingHelper.runInChildSpan(s.operation,()=>f(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:f,argsMapper:v,transaction:C,unpacker:T,otelParentCtx:O,customDataProxyFetch:R}){try{n=v?v(n):n;let L={name:"serialize"},S=this._tracingHelper.runInChildSpan(L,()=>Wi({modelName:f,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return ee.enabled("prisma:client")&&(ve("Prisma Client call:"),ve(`prisma.${i}(${ei(n)})`),ve("Generated request:"),ve(JSON.stringify(S,null,2)+` -`)),C?.kind==="batch"&&await C.lock,this._requestHandler.request({protocolQuery:S,modelName:f,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:C,unpacker:T,otelParentCtx:O,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:R})}catch(L){throw L.clientVersion=this._clientVersion,L}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new W("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Co(e,t){return Ha(e)?[new X(e,t),to]:[e,ro]}function Ha(e){return Array.isArray(e)&&Array.isArray(e.raw)}u();c();m();p();d();l();var za=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Ro(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!za.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}u();c();m();p();d();l();l();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=wasm.js.map diff --git a/integration-tests/tests/prisma/mysql/client/schema.prisma b/integration-tests/tests/prisma/mysql/client/schema.prisma deleted file mode 100644 index b01570600..000000000 --- a/integration-tests/tests/prisma/mysql/client/schema.prisma +++ /dev/null @@ -1,20 +0,0 @@ -generator client { - provider = "prisma-client-js" - output = "./client" -} - -generator drizzle { - provider = "drizzle-prisma-generator" - output = "./drizzle" -} - -datasource db { - provider = "mysql" - url = env("MYSQL_CONNECTION_STRING") -} - -model User { - id Int @id @default(autoincrement()) - email String @unique - name String? -} diff --git a/integration-tests/tests/prisma/mysql/client/wasm.d.ts b/integration-tests/tests/prisma/mysql/client/wasm.d.ts deleted file mode 100644 index 34c616106..000000000 --- a/integration-tests/tests/prisma/mysql/client/wasm.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './index' \ No newline at end of file diff --git a/integration-tests/tests/prisma/mysql/client/wasm.js b/integration-tests/tests/prisma/mysql/client/wasm.js deleted file mode 100644 index 21e772f9b..000000000 --- a/integration-tests/tests/prisma/mysql/client/wasm.js +++ /dev/null @@ -1,172 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - Decimal, - objectEnumValues, - makeStrictEnum, - Public, - getRuntime, -} = require('./runtime/index-browser.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)}; -Prisma.PrismaClientUnknownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientRustPanicError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientInitializationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientValidationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.NotFoundError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.empty = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.join = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.raw = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.defineExtension = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - -/** - * Enums - */ - -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; - -/** - * This is a stub Prisma Client that will error at runtime if called. - */ -class PrismaClient { - constructor() { - return new Proxy(this, { - get(target, prop) { - let message - const runtime = getRuntime() - if (runtime.isEdge) { - message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: -- Use Prisma Accelerate: https://pris.ly/d/accelerate -- Use Driver Adapters: https://pris.ly/d/driver-adapters -`; - } else { - message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).' - } - - message += ` -If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report` - - throw new Error(message) - } - }) - } -} - -exports.PrismaClient = PrismaClient - -Object.assign(exports, Prisma) diff --git a/integration-tests/tests/prisma/mysql/drizzle/schema.ts b/integration-tests/tests/prisma/mysql/drizzle/schema.ts deleted file mode 100644 index d53d2af82..000000000 --- a/integration-tests/tests/prisma/mysql/drizzle/schema.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { int, mysqlTable, varchar } from 'drizzle-orm/mysql-core' - -export const User = mysqlTable('User', { - id: int('id').notNull().primaryKey().autoincrement(), - email: varchar('email', { length: 191 }).notNull().unique(), - name: varchar('name', { length: 191 }) -}); \ No newline at end of file diff --git a/integration-tests/tests/prisma/pg/client/default.d.ts b/integration-tests/tests/prisma/pg/client/default.d.ts deleted file mode 100644 index 34c616106..000000000 --- a/integration-tests/tests/prisma/pg/client/default.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './index' \ No newline at end of file diff --git a/integration-tests/tests/prisma/pg/client/default.js b/integration-tests/tests/prisma/pg/client/default.js deleted file mode 100644 index fa52f0cd2..000000000 --- a/integration-tests/tests/prisma/pg/client/default.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { ...require('.') } \ No newline at end of file diff --git a/integration-tests/tests/prisma/pg/client/edge.d.ts b/integration-tests/tests/prisma/pg/client/edge.d.ts deleted file mode 100644 index 479a9ab23..000000000 --- a/integration-tests/tests/prisma/pg/client/edge.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './default' \ No newline at end of file diff --git a/integration-tests/tests/prisma/pg/client/edge.js b/integration-tests/tests/prisma/pg/client/edge.js deleted file mode 100644 index e3d663bdb..000000000 --- a/integration-tests/tests/prisma/pg/client/edge.js +++ /dev/null @@ -1,184 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - PrismaClientKnownRequestError, - PrismaClientUnknownRequestError, - PrismaClientRustPanicError, - PrismaClientInitializationError, - PrismaClientValidationError, - NotFoundError, - getPrismaClient, - sqltag, - empty, - join, - raw, - Decimal, - Debug, - objectEnumValues, - makeStrictEnum, - Extensions, - warnOnce, - defineDmmfProperty, - Public, - getRuntime -} = require('./runtime/edge.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; -Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError -Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError -Prisma.PrismaClientInitializationError = PrismaClientInitializationError -Prisma.PrismaClientValidationError = PrismaClientValidationError -Prisma.NotFoundError = NotFoundError -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = sqltag -Prisma.empty = empty -Prisma.join = join -Prisma.raw = raw -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = Extensions.getExtensionContext -Prisma.defineExtension = Extensions.defineExtension - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - - - -/** - * Enums - */ -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.QueryMode = { - default: 'default', - insensitive: 'insensitive' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; -/** - * Create the Client - */ -const config = { - "generator": { - "name": "client", - "provider": { - "fromEnvVar": null, - "value": "prisma-client-js" - }, - "output": { - "value": "/home/prodrigues/Desktop/summer-hackathon-s2-drizzle-orm/integration-tests/tests/prisma/pg/client", - "fromEnvVar": null - }, - "config": { - "engineType": "library" - }, - "binaryTargets": [ - { - "fromEnvVar": null, - "value": "debian-openssl-3.0.x", - "native": true - } - ], - "previewFeatures": [], - "isCustomOutput": true - }, - "relativeEnvPaths": { - "rootEnvPath": null - }, - "relativePath": "..", - "clientVersion": "5.14.0", - "engineVersion": "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48", - "datasourceNames": [ - "db" - ], - "activeProvider": "postgresql", - "postinstall": false, - "inlineDatasources": { - "db": { - "url": { - "fromEnvVar": "PG_CONNECTION_STRING", - "value": null - } - } - }, - "inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n output = \"./client\"\n}\n\ngenerator drizzle {\n provider = \"drizzle-prisma-generator\"\n output = \"./drizzle\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"PG_CONNECTION_STRING\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n}\n", - "inlineSchemaHash": "c0d2427a6d727687e6b27b2e90867eb6aea914674b3e96b5bb3dced1fe6fecee", - "copyEngine": true -} -config.dirname = '/' - -config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") -defineDmmfProperty(exports.Prisma, config.runtimeDataModel) -config.engineWasm = undefined - -config.injectableEdgeEnv = () => ({ - parsed: { - PG_CONNECTION_STRING: typeof globalThis !== 'undefined' && globalThis['PG_CONNECTION_STRING'] || typeof process !== 'undefined' && process.env && process.env.PG_CONNECTION_STRING || undefined - } -}) - -if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) { - Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) -} - -const PrismaClient = getPrismaClient(config) -exports.PrismaClient = PrismaClient -Object.assign(exports, Prisma) - diff --git a/integration-tests/tests/prisma/pg/client/index-browser.js b/integration-tests/tests/prisma/pg/client/index-browser.js deleted file mode 100644 index 05e73deb6..000000000 --- a/integration-tests/tests/prisma/pg/client/index-browser.js +++ /dev/null @@ -1,177 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - Decimal, - objectEnumValues, - makeStrictEnum, - Public, - getRuntime, -} = require('./runtime/index-browser.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)}; -Prisma.PrismaClientUnknownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientRustPanicError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientInitializationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientValidationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.NotFoundError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.empty = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.join = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.raw = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.defineExtension = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - -/** - * Enums - */ - -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.QueryMode = { - default: 'default', - insensitive: 'insensitive' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; - -/** - * This is a stub Prisma Client that will error at runtime if called. - */ -class PrismaClient { - constructor() { - return new Proxy(this, { - get(target, prop) { - let message - const runtime = getRuntime() - if (runtime.isEdge) { - message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: -- Use Prisma Accelerate: https://pris.ly/d/accelerate -- Use Driver Adapters: https://pris.ly/d/driver-adapters -`; - } else { - message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).' - } - - message += ` -If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report` - - throw new Error(message) - } - }) - } -} - -exports.PrismaClient = PrismaClient - -Object.assign(exports, Prisma) diff --git a/integration-tests/tests/prisma/pg/client/index.d.ts b/integration-tests/tests/prisma/pg/client/index.d.ts deleted file mode 100644 index 047d5b70b..000000000 --- a/integration-tests/tests/prisma/pg/client/index.d.ts +++ /dev/null @@ -1,2244 +0,0 @@ - -/** - * Client -**/ - -import * as runtime from './runtime/library.js'; -import $Types = runtime.Types // general types -import $Public = runtime.Types.Public -import $Utils = runtime.Types.Utils -import $Extensions = runtime.Types.Extensions -import $Result = runtime.Types.Result - -export type PrismaPromise = $Public.PrismaPromise - - -/** - * Model User - * - */ -export type User = $Result.DefaultSelection - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ -export class PrismaClient< - T extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, - U = 'log' extends keyof T ? T['log'] extends Array ? Prisma.GetEvents : never : never, - ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs -> { - [K: symbol]: { types: Prisma.TypeMap['other'] } - - /** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ - - constructor(optionsArg ?: Prisma.Subset); - $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): void; - - /** - * Connect with the database - */ - $connect(): $Utils.JsPromise; - - /** - * Disconnect from the database - */ - $disconnect(): $Utils.JsPromise; - - /** - * Add a middleware - * @deprecated since 4.16.0. For new code, prefer client extensions instead. - * @see https://pris.ly/d/extensions - */ - $use(cb: Prisma.Middleware): void - -/** - * Executes a prepared raw query and returns the number of affected rows. - * @example - * ``` - * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};` - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Executes a raw query and returns the number of affected rows. - * Susceptible to SQL injections, see documentation. - * @example - * ``` - * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a prepared raw query and returns the `SELECT` data. - * @example - * ``` - * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};` - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a raw query and returns the `SELECT` data. - * Susceptible to SQL injections, see documentation. - * @example - * ``` - * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; - - /** - * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole. - * @example - * ``` - * const [george, bob, alice] = await prisma.$transaction([ - * prisma.user.create({ data: { name: 'George' } }), - * prisma.user.create({ data: { name: 'Bob' } }), - * prisma.user.create({ data: { name: 'Alice' } }), - * ]) - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions). - */ - $transaction

[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise> - - $transaction(fn: (prisma: Omit) => $Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise - - - $extends: $Extensions.ExtendsHook<'extends', Prisma.TypeMapCb, ExtArgs> - - /** - * `prisma.user`: Exposes CRUD operations for the **User** model. - * Example usage: - * ```ts - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - */ - get user(): Prisma.UserDelegate; -} - -export namespace Prisma { - export import DMMF = runtime.DMMF - - export type PrismaPromise = $Public.PrismaPromise - - /** - * Validator - */ - export import validator = runtime.Public.validator - - /** - * Prisma Errors - */ - export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError - export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError - export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError - export import PrismaClientInitializationError = runtime.PrismaClientInitializationError - export import PrismaClientValidationError = runtime.PrismaClientValidationError - export import NotFoundError = runtime.NotFoundError - - /** - * Re-export of sql-template-tag - */ - export import sql = runtime.sqltag - export import empty = runtime.empty - export import join = runtime.join - export import raw = runtime.raw - export import Sql = runtime.Sql - - /** - * Decimal.js - */ - export import Decimal = runtime.Decimal - - export type DecimalJsLike = runtime.DecimalJsLike - - /** - * Metrics - */ - export type Metrics = runtime.Metrics - export type Metric = runtime.Metric - export type MetricHistogram = runtime.MetricHistogram - export type MetricHistogramBucket = runtime.MetricHistogramBucket - - /** - * Extensions - */ - export import Extension = $Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = $Public.Args - export import Payload = $Public.Payload - export import Result = $Public.Result - export import Exact = $Public.Exact - - /** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ - export type PrismaVersion = { - client: string - } - - export const prismaVersion: PrismaVersion - - /** - * Utility Types - */ - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON object. - * This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. - */ - export type JsonObject = {[Key in string]?: JsonValue} - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON array. - */ - export interface JsonArray extends Array {} - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches any valid JSON value. - */ - export type JsonValue = string | number | boolean | JsonObject | JsonArray | null - - /** - * Matches a JSON object. - * Unlike `JsonObject`, this type allows undefined and read-only properties. - */ - export type InputJsonObject = {readonly [Key in string]?: InputJsonValue | null} - - /** - * Matches a JSON array. - * Unlike `JsonArray`, readonly arrays are assignable to this type. - */ - export interface InputJsonArray extends ReadonlyArray {} - - /** - * Matches any valid value that can be used as an input for operations like - * create and update as the value of a JSON field. Unlike `JsonValue`, this - * type allows read-only arrays and read-only object properties and disallows - * `null` at the top level. - * - * `null` cannot be used as the value of a JSON field because its meaning - * would be ambiguous. Use `Prisma.JsonNull` to store the JSON null value or - * `Prisma.DbNull` to clear the JSON value and set the field to the database - * NULL value instead. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values - */ - export type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | { toJSON(): unknown } - - /** - * Types of the values used to represent different kinds of `null` values when working with JSON fields. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - namespace NullTypes { - /** - * Type of `Prisma.DbNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.DbNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class DbNull { - private DbNull: never - private constructor() - } - - /** - * Type of `Prisma.JsonNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.JsonNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class JsonNull { - private JsonNull: never - private constructor() - } - - /** - * Type of `Prisma.AnyNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.AnyNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class AnyNull { - private AnyNull: never - private constructor() - } - } - - /** - * Helper for filtering JSON entries that have `null` on the database (empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const DbNull: NullTypes.DbNull - - /** - * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const JsonNull: NullTypes.JsonNull - - /** - * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const AnyNull: NullTypes.AnyNull - - type SelectAndInclude = { - select: any - include: any - } - - type SelectAndOmit = { - select: any - omit: any - } - - /** - * Get the type of the value, that the Promise holds. - */ - export type PromiseType> = T extends PromiseLike ? U : T; - - /** - * Get the return type of a function which returns a Promise. - */ - export type PromiseReturnType $Utils.JsPromise> = PromiseType> - - /** - * From T, pick a set of properties whose keys are in the union K - */ - type Prisma__Pick = { - [P in K]: T[P]; - }; - - - export type Enumerable = T | Array; - - export type RequiredKeys = { - [K in keyof T]-?: {} extends Prisma__Pick ? never : K - }[keyof T] - - export type TruthyKeys = keyof { - [K in keyof T as T[K] extends false | undefined | null ? never : K]: K - } - - export type TrueKeys = TruthyKeys>> - - /** - * Subset - * @desc From `T` pick properties that exist in `U`. Simple version of Intersection - */ - export type Subset = { - [key in keyof T]: key extends keyof U ? T[key] : never; - }; - - /** - * SelectSubset - * @desc From `T` pick properties that exist in `U`. Simple version of Intersection. - * Additionally, it validates, if both select and include are present. If the case, it errors. - */ - export type SelectSubset = { - [key in keyof T]: key extends keyof U ? T[key] : never - } & - (T extends SelectAndInclude - ? 'Please either choose `select` or `include`.' - : T extends SelectAndOmit - ? 'Please either choose `select` or `omit`.' - : {}) - - /** - * Subset + Intersection - * @desc From `T` pick properties that exist in `U` and intersect `K` - */ - export type SubsetIntersection = { - [key in keyof T]: key extends keyof U ? T[key] : never - } & - K - - type Without = { [P in Exclude]?: never }; - - /** - * XOR is needed to have a real mutually exclusive union type - * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types - */ - type XOR = - T extends object ? - U extends object ? - (Without & U) | (Without & T) - : U : T - - - /** - * Is T a Record? - */ - type IsObject = T extends Array - ? False - : T extends Date - ? False - : T extends Uint8Array - ? False - : T extends BigInt - ? False - : T extends object - ? True - : False - - - /** - * If it's T[], return T - */ - export type UnEnumerate = T extends Array ? U : T - - /** - * From ts-toolbelt - */ - - type __Either = Omit & - { - // Merge all but K - [P in K]: Prisma__Pick // With K possibilities - }[K] - - type EitherStrict = Strict<__Either> - - type EitherLoose = ComputeRaw<__Either> - - type _Either< - O extends object, - K extends Key, - strict extends Boolean - > = { - 1: EitherStrict - 0: EitherLoose - }[strict] - - type Either< - O extends object, - K extends Key, - strict extends Boolean = 1 - > = O extends unknown ? _Either : never - - export type Union = any - - type PatchUndefined = { - [K in keyof O]: O[K] extends undefined ? At : O[K] - } & {} - - /** Helper Types for "Merge" **/ - export type IntersectOf = ( - U extends unknown ? (k: U) => void : never - ) extends (k: infer I) => void - ? I - : never - - export type Overwrite = { - [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; - } & {}; - - type _Merge = IntersectOf; - }>>; - - type Key = string | number | symbol; - type AtBasic = K extends keyof O ? O[K] : never; - type AtStrict = O[K & keyof O]; - type AtLoose = O extends unknown ? AtStrict : never; - export type At = { - 1: AtStrict; - 0: AtLoose; - }[strict]; - - export type ComputeRaw = A extends Function ? A : { - [K in keyof A]: A[K]; - } & {}; - - export type OptionalFlat = { - [K in keyof O]?: O[K]; - } & {}; - - type _Record = { - [P in K]: T; - }; - - // cause typescript not to expand types and preserve names - type NoExpand = T extends unknown ? T : never; - - // this type assumes the passed object is entirely optional - type AtLeast = NoExpand< - O extends unknown - ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | {[P in keyof O as P extends K ? K : never]-?: O[P]} & O - : never>; - - type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; - - export type Strict = ComputeRaw<_Strict>; - /** End Helper Types for "Merge" **/ - - export type Merge = ComputeRaw<_Merge>>; - - /** - A [[Boolean]] - */ - export type Boolean = True | False - - // /** - // 1 - // */ - export type True = 1 - - /** - 0 - */ - export type False = 0 - - export type Not = { - 0: 1 - 1: 0 - }[B] - - export type Extends = [A1] extends [never] - ? 0 // anything `never` is false - : A1 extends A2 - ? 1 - : 0 - - export type Has = Not< - Extends, U1> - > - - export type Or = { - 0: { - 0: 0 - 1: 1 - } - 1: { - 0: 1 - 1: 1 - } - }[B1][B2] - - export type Keys = U extends unknown ? keyof U : never - - type Cast = A extends B ? A : B; - - export const type: unique symbol; - - - - /** - * Used by group by - */ - - export type GetScalarType = O extends object ? { - [P in keyof T]: P extends keyof O - ? O[P] - : never - } : never - - type FieldPaths< - T, - U = Omit - > = IsObject extends True ? U : T - - type GetHavingFields = { - [K in keyof T]: Or< - Or, Extends<'AND', K>>, - Extends<'NOT', K> - > extends True - ? // infer is only needed to not hit TS limit - // based on the brilliant idea of Pierre-Antoine Mills - // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 - T[K] extends infer TK - ? GetHavingFields extends object ? Merge> : never> - : never - : {} extends FieldPaths - ? never - : K - }[keyof T] - - /** - * Convert tuple to union - */ - type _TupleToUnion = T extends (infer E)[] ? E : never - type TupleToUnion = _TupleToUnion - type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T - - /** - * Like `Pick`, but additionally can also accept an array of keys - */ - type PickEnumerable | keyof T> = Prisma__Pick> - - /** - * Exclude all keys with underscores - */ - type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T - - - export type FieldRef = runtime.FieldRef - - type FieldRefInputType = Model extends never ? never : FieldRef - - - export const ModelName: { - User: 'User' - }; - - export type ModelName = (typeof ModelName)[keyof typeof ModelName] - - - export type Datasources = { - db?: Datasource - } - - - interface TypeMapCb extends $Utils.Fn<{extArgs: $Extensions.InternalArgs}, $Utils.Record> { - returns: Prisma.TypeMap - } - - export type TypeMap = { - meta: { - modelProps: 'user' - txIsolationLevel: Prisma.TransactionIsolationLevel - }, - model: { - User: { - payload: Prisma.$UserPayload - fields: Prisma.UserFieldRefs - operations: { - findUnique: { - args: Prisma.UserFindUniqueArgs, - result: $Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.UserFindUniqueOrThrowArgs, - result: $Utils.PayloadToResult - } - findFirst: { - args: Prisma.UserFindFirstArgs, - result: $Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.UserFindFirstOrThrowArgs, - result: $Utils.PayloadToResult - } - findMany: { - args: Prisma.UserFindManyArgs, - result: $Utils.PayloadToResult[] - } - create: { - args: Prisma.UserCreateArgs, - result: $Utils.PayloadToResult - } - createMany: { - args: Prisma.UserCreateManyArgs, - result: Prisma.BatchPayload - } - createManyAndReturn: { - args: Prisma.UserCreateManyAndReturnArgs, - result: $Utils.PayloadToResult[] - } - delete: { - args: Prisma.UserDeleteArgs, - result: $Utils.PayloadToResult - } - update: { - args: Prisma.UserUpdateArgs, - result: $Utils.PayloadToResult - } - deleteMany: { - args: Prisma.UserDeleteManyArgs, - result: Prisma.BatchPayload - } - updateMany: { - args: Prisma.UserUpdateManyArgs, - result: Prisma.BatchPayload - } - upsert: { - args: Prisma.UserUpsertArgs, - result: $Utils.PayloadToResult - } - aggregate: { - args: Prisma.UserAggregateArgs, - result: $Utils.Optional - } - groupBy: { - args: Prisma.UserGroupByArgs, - result: $Utils.Optional[] - } - count: { - args: Prisma.UserCountArgs, - result: $Utils.Optional | number - } - } - } - } - } & { - other: { - payload: any - operations: { - $executeRawUnsafe: { - args: [query: string, ...values: any[]], - result: any - } - $executeRaw: { - args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], - result: any - } - $queryRawUnsafe: { - args: [query: string, ...values: any[]], - result: any - } - $queryRaw: { - args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], - result: any - } - } - } - } - export const defineExtension: $Extensions.ExtendsHook<'define', Prisma.TypeMapCb, $Extensions.DefaultArgs> - export type DefaultPrismaClient = PrismaClient - export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' - export interface PrismaClientOptions { - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasources?: Datasources - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasourceUrl?: string - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat - /** - * @example - * ``` - * // Defaults to stdout - * log: ['query', 'info', 'warn', 'error'] - * - * // Emit as events - * log: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * { emit: 'stdout', level: 'error' } - * ] - * ``` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: (LogLevel | LogDefinition)[] - /** - * The default values for transactionOptions - * maxWait ?= 2000 - * timeout ?= 5000 - */ - transactionOptions?: { - maxWait?: number - timeout?: number - isolationLevel?: Prisma.TransactionIsolationLevel - } - } - - /* Types for Logging */ - export type LogLevel = 'info' | 'query' | 'warn' | 'error' - export type LogDefinition = { - level: LogLevel - emit: 'stdout' | 'event' - } - - export type GetLogType = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never - export type GetEvents = T extends Array ? - GetLogType | GetLogType | GetLogType | GetLogType - : never - - export type QueryEvent = { - timestamp: Date - query: string - params: string - duration: number - target: string - } - - export type LogEvent = { - timestamp: Date - message: string - target: string - } - /* End Types for Logging */ - - - export type PrismaAction = - | 'findUnique' - | 'findUniqueOrThrow' - | 'findMany' - | 'findFirst' - | 'findFirstOrThrow' - | 'create' - | 'createMany' - | 'createManyAndReturn' - | 'update' - | 'updateMany' - | 'upsert' - | 'delete' - | 'deleteMany' - | 'executeRaw' - | 'queryRaw' - | 'aggregate' - | 'count' - | 'runCommandRaw' - | 'findRaw' - | 'groupBy' - - /** - * These options are being passed into the middleware as "params" - */ - export type MiddlewareParams = { - model?: ModelName - action: PrismaAction - args: any - dataPath: string[] - runInTransaction: boolean - } - - /** - * The `T` type makes sure, that the `return proceed` is not forgotten in the middleware implementation - */ - export type Middleware = ( - params: MiddlewareParams, - next: (params: MiddlewareParams) => $Utils.JsPromise, - ) => $Utils.JsPromise - - // tested in getLogLevel.test.ts - export function getLogLevel(log: Array): LogLevel | undefined; - - /** - * `PrismaClient` proxy available in interactive transactions. - */ - export type TransactionClient = Omit - - export type Datasource = { - url?: string - } - - /** - * Count Types - */ - - - - /** - * Models - */ - - /** - * Model User - */ - - export type AggregateUser = { - _count: UserCountAggregateOutputType | null - _avg: UserAvgAggregateOutputType | null - _sum: UserSumAggregateOutputType | null - _min: UserMinAggregateOutputType | null - _max: UserMaxAggregateOutputType | null - } - - export type UserAvgAggregateOutputType = { - id: number | null - } - - export type UserSumAggregateOutputType = { - id: number | null - } - - export type UserMinAggregateOutputType = { - id: number | null - email: string | null - name: string | null - } - - export type UserMaxAggregateOutputType = { - id: number | null - email: string | null - name: string | null - } - - export type UserCountAggregateOutputType = { - id: number - email: number - name: number - _all: number - } - - - export type UserAvgAggregateInputType = { - id?: true - } - - export type UserSumAggregateInputType = { - id?: true - } - - export type UserMinAggregateInputType = { - id?: true - email?: true - name?: true - } - - export type UserMaxAggregateInputType = { - id?: true - email?: true - name?: true - } - - export type UserCountAggregateInputType = { - id?: true - email?: true - name?: true - _all?: true - } - - export type UserAggregateArgs = { - /** - * Filter which User to aggregate. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Users - **/ - _count?: true | UserCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to average - **/ - _avg?: UserAvgAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to sum - **/ - _sum?: UserSumAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: UserMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: UserMaxAggregateInputType - } - - export type GetUserAggregateType = { - [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : GetScalarType - : GetScalarType - } - - - - - export type UserGroupByArgs = { - where?: UserWhereInput - orderBy?: UserOrderByWithAggregationInput | UserOrderByWithAggregationInput[] - by: UserScalarFieldEnum[] | UserScalarFieldEnum - having?: UserScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: UserCountAggregateInputType | true - _avg?: UserAvgAggregateInputType - _sum?: UserSumAggregateInputType - _min?: UserMinAggregateInputType - _max?: UserMaxAggregateInputType - } - - export type UserGroupByOutputType = { - id: number - email: string - name: string | null - _count: UserCountAggregateOutputType | null - _avg: UserAvgAggregateOutputType | null - _sum: UserSumAggregateOutputType | null - _min: UserMinAggregateOutputType | null - _max: UserMaxAggregateOutputType | null - } - - type GetUserGroupByPayload = Prisma.PrismaPromise< - Array< - PickEnumerable & - { - [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : GetScalarType - : GetScalarType - } - > - > - - - export type UserSelect = $Extensions.GetSelect<{ - id?: boolean - email?: boolean - name?: boolean - }, ExtArgs["result"]["user"]> - - export type UserSelectScalar = { - id?: boolean - email?: boolean - name?: boolean - } - - - - export type $UserPayload = { - name: "User" - objects: {} - scalars: $Extensions.GetPayloadResult<{ - id: number - email: string - name: string | null - }, ExtArgs["result"]["user"]> - composites: {} - } - - - type UserGetPayload = $Result.GetResult - - type UserCountArgs = - Omit & { - select?: UserCountAggregateInputType | true - } - - export interface UserDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } - /** - * Find zero or one User that matches the filter. - * @param {UserFindUniqueArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUnique>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findUnique'> | null, null, ExtArgs> - - /** - * Find one User that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUniqueOrThrow>( - args?: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findUniqueOrThrow'>, never, ExtArgs> - - /** - * Find the first User that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserFindFirstArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirst>( - args?: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findFirst'> | null, null, ExtArgs> - - /** - * Find the first User that matches the filter or - * throw `PrismaKnownClientError` with `P2025` code if no matches were found. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserFindFirstOrThrowArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirstOrThrow>( - args?: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findFirstOrThrow'>, never, ExtArgs> - - /** - * Find zero or more Users that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all Users - * const users = await prisma.user.findMany() - * - * // Get first 10 Users - * const users = await prisma.user.findMany({ take: 10 }) - * - * // Only select the `id` - * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) - * - **/ - findMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise<$Result.GetResult, T, 'findMany'>> - - /** - * Create a User. - * @param {UserCreateArgs} args - Arguments to create a User. - * @example - * // Create one User - * const User = await prisma.user.create({ - * data: { - * // ... data to create a User - * } - * }) - * - **/ - create>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'create'>, never, ExtArgs> - - /** - * Create many Users. - * @param {UserCreateManyArgs} args - Arguments to create many Users. - * @example - * // Create many Users - * const user = await prisma.user.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - **/ - createMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Create many Users and returns the data saved in the database. - * @param {UserCreateManyAndReturnArgs} args - Arguments to create many Users. - * @example - * // Create many Users - * const user = await prisma.user.createManyAndReturn({ - * data: [ - * // ... provide data here - * ] - * }) - * - * // Create many Users and only return the `id` - * const userWithIdOnly = await prisma.user.createManyAndReturn({ - * select: { id: true }, - * data: [ - * // ... provide data here - * ] - * }) - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * - **/ - createManyAndReturn>( - args?: SelectSubset> - ): Prisma.PrismaPromise<$Result.GetResult, T, 'createManyAndReturn'>> - - /** - * Delete a User. - * @param {UserDeleteArgs} args - Arguments to delete one User. - * @example - * // Delete one User - * const User = await prisma.user.delete({ - * where: { - * // ... filter to delete one User - * } - * }) - * - **/ - delete>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'delete'>, never, ExtArgs> - - /** - * Update one User. - * @param {UserUpdateArgs} args - Arguments to update one User. - * @example - * // Update one User - * const user = await prisma.user.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - update>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'update'>, never, ExtArgs> - - /** - * Delete zero or more Users. - * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. - * @example - * // Delete a few Users - * const { count } = await prisma.user.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - **/ - deleteMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Update zero or more Users. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Users - * const user = await prisma.user.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - updateMany>( - args: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Create or update one User. - * @param {UserUpsertArgs} args - Arguments to update or create a User. - * @example - * // Update or create a User - * const user = await prisma.user.upsert({ - * create: { - * // ... data to create a User - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the User we want to update - * } - * }) - **/ - upsert>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'upsert'>, never, ExtArgs> - - /** - * Count the number of Users. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserCountArgs} args - Arguments to filter Users to count. - * @example - * // Count the number of Users - * const count = await prisma.user.count({ - * where: { - * // ... the filter for the Users we want to count - * } - * }) - **/ - count( - args?: Subset, - ): Prisma.PrismaPromise< - T extends $Utils.Record<'select', any> - ? T['select'] extends true - ? number - : GetScalarType - : number - > - - /** - * Allows you to perform aggregations operations on a User. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserAggregateArgs} args - Select which aggregations you would like to apply and on what fields. - * @example - * // Ordered by age ascending - * // Where email contains prisma.io - * // Limited to the 10 users - * const aggregations = await prisma.user.aggregate({ - * _avg: { - * age: true, - * }, - * where: { - * email: { - * contains: "prisma.io", - * }, - * }, - * orderBy: { - * age: "asc", - * }, - * take: 10, - * }) - **/ - aggregate(args: Subset): Prisma.PrismaPromise> - - /** - * Group by User. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserGroupByArgs} args - Group by arguments. - * @example - * // Group by city, order by createdAt, get count - * const result = await prisma.user.groupBy({ - * by: ['city', 'createdAt'], - * orderBy: { - * createdAt: true - * }, - * _count: { - * _all: true - * }, - * }) - * - **/ - groupBy< - T extends UserGroupByArgs, - HasSelectOrTake extends Or< - Extends<'skip', Keys>, - Extends<'take', Keys> - >, - OrderByArg extends True extends HasSelectOrTake - ? { orderBy: UserGroupByArgs['orderBy'] } - : { orderBy?: UserGroupByArgs['orderBy'] }, - OrderFields extends ExcludeUnderscoreKeys>>, - ByFields extends MaybeTupleToUnion, - ByValid extends Has, - HavingFields extends GetHavingFields, - HavingValid extends Has, - ByEmpty extends T['by'] extends never[] ? True : False, - InputErrors extends ByEmpty extends True - ? `Error: "by" must not be empty.` - : HavingValid extends False - ? { - [P in HavingFields]: P extends ByFields - ? never - : P extends string - ? `Error: Field "${P}" used in "having" needs to be provided in "by".` - : [ - Error, - 'Field ', - P, - ` in "having" needs to be provided in "by"`, - ] - }[HavingFields] - : 'take' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "take", you also need to provide "orderBy"' - : 'skip' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "skip", you also need to provide "orderBy"' - : ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetUserGroupByPayload : Prisma.PrismaPromise - /** - * Fields of the User model - */ - readonly fields: UserFieldRefs; - } - - /** - * The delegate class that acts as a "Promise-like" for User. - * Why is this prefixed with `Prisma__`? - * Because we want to prevent naming conflicts as mentioned in - * https://github.com/prisma/prisma-client-js/issues/707 - */ - export interface Prisma__UserClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: 'PrismaPromise'; - - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The - * resolved value cannot be modified from the callback. - * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). - * @returns A Promise for the completion of the callback. - */ - finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise; - } - - - - /** - * Fields of the User model - */ - interface UserFieldRefs { - readonly id: FieldRef<"User", 'Int'> - readonly email: FieldRef<"User", 'String'> - readonly name: FieldRef<"User", 'String'> - } - - - // Custom InputTypes - /** - * User findUnique - */ - export type UserFindUniqueArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where: UserWhereUniqueInput - } - - /** - * User findUniqueOrThrow - */ - export type UserFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where: UserWhereUniqueInput - } - - /** - * User findFirst - */ - export type UserFindFirstArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Users. - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Users. - */ - distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] - } - - /** - * User findFirstOrThrow - */ - export type UserFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Users. - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Users. - */ - distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] - } - - /** - * User findMany - */ - export type UserFindManyArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which Users to fetch. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Users. - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] - } - - /** - * User create - */ - export type UserCreateArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The data needed to create a User. - */ - data: XOR - } - - /** - * User createMany - */ - export type UserCreateManyArgs = { - /** - * The data used to create many Users. - */ - data: UserCreateManyInput | UserCreateManyInput[] - skipDuplicates?: boolean - } - - /** - * User createManyAndReturn - */ - export type UserCreateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The data used to create many Users. - */ - data: UserCreateManyInput | UserCreateManyInput[] - skipDuplicates?: boolean - } - - /** - * User update - */ - export type UserUpdateArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The data needed to update a User. - */ - data: XOR - /** - * Choose, which User to update. - */ - where: UserWhereUniqueInput - } - - /** - * User updateMany - */ - export type UserUpdateManyArgs = { - /** - * The data used to update Users. - */ - data: XOR - /** - * Filter which Users to update - */ - where?: UserWhereInput - } - - /** - * User upsert - */ - export type UserUpsertArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The filter to search for the User to update in case it exists. - */ - where: UserWhereUniqueInput - /** - * In case the User found by the `where` argument doesn't exist, create a new User with this data. - */ - create: XOR - /** - * In case the User was found with the provided `where` argument, update it with this data. - */ - update: XOR - } - - /** - * User delete - */ - export type UserDeleteArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter which User to delete. - */ - where: UserWhereUniqueInput - } - - /** - * User deleteMany - */ - export type UserDeleteManyArgs = { - /** - * Filter which Users to delete - */ - where?: UserWhereInput - } - - /** - * User without action - */ - export type UserDefaultArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - } - - - /** - * Enums - */ - - export const TransactionIsolationLevel: { - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' - }; - - export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] - - - export const UserScalarFieldEnum: { - id: 'id', - email: 'email', - name: 'name' - }; - - export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] - - - export const SortOrder: { - asc: 'asc', - desc: 'desc' - }; - - export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] - - - export const QueryMode: { - default: 'default', - insensitive: 'insensitive' - }; - - export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] - - - export const NullsOrder: { - first: 'first', - last: 'last' - }; - - export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] - - - /** - * Field references - */ - - - /** - * Reference to a field of type 'Int' - */ - export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> - - - - /** - * Reference to a field of type 'Int[]' - */ - export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> - - - - /** - * Reference to a field of type 'String' - */ - export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> - - - - /** - * Reference to a field of type 'String[]' - */ - export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> - - - - /** - * Reference to a field of type 'Float' - */ - export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> - - - - /** - * Reference to a field of type 'Float[]' - */ - export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> - - /** - * Deep Input Types - */ - - - export type UserWhereInput = { - AND?: UserWhereInput | UserWhereInput[] - OR?: UserWhereInput[] - NOT?: UserWhereInput | UserWhereInput[] - id?: IntFilter<"User"> | number - email?: StringFilter<"User"> | string - name?: StringNullableFilter<"User"> | string | null - } - - export type UserOrderByWithRelationInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrderInput | SortOrder - } - - export type UserWhereUniqueInput = Prisma.AtLeast<{ - id?: number - email?: string - AND?: UserWhereInput | UserWhereInput[] - OR?: UserWhereInput[] - NOT?: UserWhereInput | UserWhereInput[] - name?: StringNullableFilter<"User"> | string | null - }, "id" | "email"> - - export type UserOrderByWithAggregationInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrderInput | SortOrder - _count?: UserCountOrderByAggregateInput - _avg?: UserAvgOrderByAggregateInput - _max?: UserMaxOrderByAggregateInput - _min?: UserMinOrderByAggregateInput - _sum?: UserSumOrderByAggregateInput - } - - export type UserScalarWhereWithAggregatesInput = { - AND?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[] - OR?: UserScalarWhereWithAggregatesInput[] - NOT?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[] - id?: IntWithAggregatesFilter<"User"> | number - email?: StringWithAggregatesFilter<"User"> | string - name?: StringNullableWithAggregatesFilter<"User"> | string | null - } - - export type UserCreateInput = { - email: string - name?: string | null - } - - export type UserUncheckedCreateInput = { - id?: number - email: string - name?: string | null - } - - export type UserUpdateInput = { - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type UserUncheckedUpdateInput = { - id?: IntFieldUpdateOperationsInput | number - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type UserCreateManyInput = { - id?: number - email: string - name?: string | null - } - - export type UserUpdateManyMutationInput = { - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type UserUncheckedUpdateManyInput = { - id?: IntFieldUpdateOperationsInput | number - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type IntFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] | ListIntFieldRefInput<$PrismaModel> - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntFilter<$PrismaModel> | number - } - - export type StringFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] | ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - mode?: QueryMode - not?: NestedStringFilter<$PrismaModel> | string - } - - export type StringNullableFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | ListStringFieldRefInput<$PrismaModel> | null - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - mode?: QueryMode - not?: NestedStringNullableFilter<$PrismaModel> | string | null - } - - export type SortOrderInput = { - sort: SortOrder - nulls?: NullsOrder - } - - export type UserCountOrderByAggregateInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrder - } - - export type UserAvgOrderByAggregateInput = { - id?: SortOrder - } - - export type UserMaxOrderByAggregateInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrder - } - - export type UserMinOrderByAggregateInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrder - } - - export type UserSumOrderByAggregateInput = { - id?: SortOrder - } - - export type IntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] | ListIntFieldRefInput<$PrismaModel> - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: NestedIntFilter<$PrismaModel> - _avg?: NestedFloatFilter<$PrismaModel> - _sum?: NestedIntFilter<$PrismaModel> - _min?: NestedIntFilter<$PrismaModel> - _max?: NestedIntFilter<$PrismaModel> - } - - export type StringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] | ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - mode?: QueryMode - not?: NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedStringFilter<$PrismaModel> - _max?: NestedStringFilter<$PrismaModel> - } - - export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | ListStringFieldRefInput<$PrismaModel> | null - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - mode?: QueryMode - not?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null - _count?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedStringNullableFilter<$PrismaModel> - _max?: NestedStringNullableFilter<$PrismaModel> - } - - export type StringFieldUpdateOperationsInput = { - set?: string - } - - export type NullableStringFieldUpdateOperationsInput = { - set?: string | null - } - - export type IntFieldUpdateOperationsInput = { - set?: number - increment?: number - decrement?: number - multiply?: number - divide?: number - } - - export type NestedIntFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] | ListIntFieldRefInput<$PrismaModel> - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntFilter<$PrismaModel> | number - } - - export type NestedStringFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] | ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringFilter<$PrismaModel> | string - } - - export type NestedStringNullableFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | ListStringFieldRefInput<$PrismaModel> | null - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringNullableFilter<$PrismaModel> | string | null - } - - export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] | ListIntFieldRefInput<$PrismaModel> - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: NestedIntFilter<$PrismaModel> - _avg?: NestedFloatFilter<$PrismaModel> - _sum?: NestedIntFilter<$PrismaModel> - _min?: NestedIntFilter<$PrismaModel> - _max?: NestedIntFilter<$PrismaModel> - } - - export type NestedFloatFilter<$PrismaModel = never> = { - equals?: number | FloatFieldRefInput<$PrismaModel> - in?: number[] | ListFloatFieldRefInput<$PrismaModel> - notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> - lt?: number | FloatFieldRefInput<$PrismaModel> - lte?: number | FloatFieldRefInput<$PrismaModel> - gt?: number | FloatFieldRefInput<$PrismaModel> - gte?: number | FloatFieldRefInput<$PrismaModel> - not?: NestedFloatFilter<$PrismaModel> | number - } - - export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] | ListStringFieldRefInput<$PrismaModel> - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedStringFilter<$PrismaModel> - _max?: NestedStringFilter<$PrismaModel> - } - - export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | ListStringFieldRefInput<$PrismaModel> | null - notIn?: string[] | ListStringFieldRefInput<$PrismaModel> | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null - _count?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedStringNullableFilter<$PrismaModel> - _max?: NestedStringNullableFilter<$PrismaModel> - } - - export type NestedIntNullableFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> | null - in?: number[] | ListIntFieldRefInput<$PrismaModel> | null - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntNullableFilter<$PrismaModel> | number | null - } - - - - /** - * Aliases for legacy arg types - */ - /** - * @deprecated Use UserDefaultArgs instead - */ - export type UserArgs = UserDefaultArgs - - /** - * Batch Payload for updateMany & deleteMany & createMany - */ - - export type BatchPayload = { - count: number - } - - /** - * DMMF - */ - export const dmmf: runtime.BaseDMMF -} \ No newline at end of file diff --git a/integration-tests/tests/prisma/pg/client/index.js b/integration-tests/tests/prisma/pg/client/index.js deleted file mode 100644 index 5de19758e..000000000 --- a/integration-tests/tests/prisma/pg/client/index.js +++ /dev/null @@ -1,205 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - PrismaClientKnownRequestError, - PrismaClientUnknownRequestError, - PrismaClientRustPanicError, - PrismaClientInitializationError, - PrismaClientValidationError, - NotFoundError, - getPrismaClient, - sqltag, - empty, - join, - raw, - Decimal, - Debug, - objectEnumValues, - makeStrictEnum, - Extensions, - warnOnce, - defineDmmfProperty, - Public, - getRuntime -} = require('./runtime/library.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; -Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError -Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError -Prisma.PrismaClientInitializationError = PrismaClientInitializationError -Prisma.PrismaClientValidationError = PrismaClientValidationError -Prisma.NotFoundError = NotFoundError -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = sqltag -Prisma.empty = empty -Prisma.join = join -Prisma.raw = raw -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = Extensions.getExtensionContext -Prisma.defineExtension = Extensions.defineExtension - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - - - const path = require('path') - -/** - * Enums - */ -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.QueryMode = { - default: 'default', - insensitive: 'insensitive' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; -/** - * Create the Client - */ -const config = { - "generator": { - "name": "client", - "provider": { - "fromEnvVar": null, - "value": "prisma-client-js" - }, - "output": { - "value": "/home/prodrigues/Desktop/summer-hackathon-s2-drizzle-orm/integration-tests/tests/prisma/pg/client", - "fromEnvVar": null - }, - "config": { - "engineType": "library" - }, - "binaryTargets": [ - { - "fromEnvVar": null, - "value": "debian-openssl-3.0.x", - "native": true - } - ], - "previewFeatures": [], - "isCustomOutput": true - }, - "relativeEnvPaths": { - "rootEnvPath": null - }, - "relativePath": "..", - "clientVersion": "5.14.0", - "engineVersion": "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48", - "datasourceNames": [ - "db" - ], - "activeProvider": "postgresql", - "postinstall": false, - "inlineDatasources": { - "db": { - "url": { - "fromEnvVar": "PG_CONNECTION_STRING", - "value": null - } - } - }, - "inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n output = \"./client\"\n}\n\ngenerator drizzle {\n provider = \"drizzle-prisma-generator\"\n output = \"./drizzle\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"PG_CONNECTION_STRING\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n}\n", - "inlineSchemaHash": "c0d2427a6d727687e6b27b2e90867eb6aea914674b3e96b5bb3dced1fe6fecee", - "copyEngine": true -} - -const fs = require('fs') - -config.dirname = __dirname -if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { - const alternativePaths = [ - "tests/prisma/pg/client", - "prisma/pg/client", - ] - - const alternativePath = alternativePaths.find((altPath) => { - return fs.existsSync(path.join(process.cwd(), altPath, 'schema.prisma')) - }) ?? alternativePaths[0] - - config.dirname = path.join(process.cwd(), alternativePath) - config.isBundled = true -} - -config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") -defineDmmfProperty(exports.Prisma, config.runtimeDataModel) -config.engineWasm = undefined - - -const { warnEnvConflicts } = require('./runtime/library.js') - -warnEnvConflicts({ - rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath), - schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath) -}) - -const PrismaClient = getPrismaClient(config) -exports.PrismaClient = PrismaClient -Object.assign(exports, Prisma) - -// file annotations for bundling tools to include these files -path.join(__dirname, "libquery_engine-debian-openssl-3.0.x.so.node"); -path.join(process.cwd(), "tests/prisma/pg/client/libquery_engine-debian-openssl-3.0.x.so.node") -// file annotations for bundling tools to include these files -path.join(__dirname, "schema.prisma"); -path.join(process.cwd(), "tests/prisma/pg/client/schema.prisma") diff --git a/integration-tests/tests/prisma/pg/client/libquery_engine-debian-openssl-3.0.x.so.node b/integration-tests/tests/prisma/pg/client/libquery_engine-debian-openssl-3.0.x.so.node deleted file mode 100755 index ed0a5448d..000000000 Binary files a/integration-tests/tests/prisma/pg/client/libquery_engine-debian-openssl-3.0.x.so.node and /dev/null differ diff --git a/integration-tests/tests/prisma/pg/client/package.json b/integration-tests/tests/prisma/pg/client/package.json deleted file mode 100644 index 0ab71f648..000000000 --- a/integration-tests/tests/prisma/pg/client/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "prisma-client-36ecadfc127372c52e8d3861f31b913779ac8b6fcc16f69747cba9638e2d6be4", - "main": "index.js", - "types": "index.d.ts", - "browser": "index-browser.js", - "exports": { - "./package.json": "./package.json", - ".": { - "require": { - "node": "./index.js", - "edge-light": "./wasm.js", - "workerd": "./wasm.js", - "worker": "./wasm.js", - "browser": "./index-browser.js", - "default": "./index.js" - }, - "import": { - "node": "./index.js", - "edge-light": "./wasm.js", - "workerd": "./wasm.js", - "worker": "./wasm.js", - "browser": "./index-browser.js", - "default": "./index.js" - }, - "default": "./index.js" - }, - "./edge": { - "types": "./edge.d.ts", - "require": "./edge.js", - "import": "./edge.js", - "default": "./edge.js" - }, - "./react-native": { - "types": "./react-native.d.ts", - "require": "./react-native.js", - "import": "./react-native.js", - "default": "./react-native.js" - }, - "./extension": { - "types": "./extension.d.ts", - "require": "./extension.js", - "import": "./extension.js", - "default": "./extension.js" - }, - "./index-browser": { - "types": "./index.d.ts", - "require": "./index-browser.js", - "import": "./index-browser.js", - "default": "./index-browser.js" - }, - "./index": { - "types": "./index.d.ts", - "require": "./index.js", - "import": "./index.js", - "default": "./index.js" - }, - "./wasm": { - "types": "./wasm.d.ts", - "require": "./wasm.js", - "import": "./wasm.js", - "default": "./wasm.js" - }, - "./runtime/library": { - "types": "./runtime/library.d.ts", - "require": "./runtime/library.js", - "import": "./runtime/library.js", - "default": "./runtime/library.js" - }, - "./runtime/binary": { - "types": "./runtime/binary.d.ts", - "require": "./runtime/binary.js", - "import": "./runtime/binary.js", - "default": "./runtime/binary.js" - }, - "./generator-build": { - "require": "./generator-build/index.js", - "import": "./generator-build/index.js", - "default": "./generator-build/index.js" - }, - "./*": "./*" - }, - "version": "5.14.0", - "sideEffects": false -} \ No newline at end of file diff --git a/integration-tests/tests/prisma/pg/client/runtime/edge-esm.js b/integration-tests/tests/prisma/pg/client/runtime/edge-esm.js deleted file mode 100644 index e9adb8e66..000000000 --- a/integration-tests/tests/prisma/pg/client/runtime/edge-esm.js +++ /dev/null @@ -1,28 +0,0 @@ -var ia=Object.create;var rr=Object.defineProperty;var oa=Object.getOwnPropertyDescriptor;var sa=Object.getOwnPropertyNames;var aa=Object.getPrototypeOf,ua=Object.prototype.hasOwnProperty;var Pt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nr=(e,t)=>{for(var r in t)rr(e,r,{get:t[r],enumerable:!0})},Qn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sa(t))!ua.call(e,i)&&i!==r&&rr(e,i,{get:()=>t[i],enumerable:!(n=oa(t,i))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?ia(aa(e)):{},Qn(t||!e||!e.__esModule?rr(r,"default",{value:e,enumerable:!0}):r,e)),Gn=e=>Qn(rr({},"__esModule",{value:!0}),e);var y,c=Ee(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var Hn,b,p=Ee(()=>{"use strict";b=(Hn=globalThis.performance)!=null?Hn:(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,f=Ee(()=>{"use strict";E=()=>{};E.prototype=E});var m=Ee(()=>{"use strict"});var fi=Ae(rt=>{"use strict";d();c();p();f();m();var Zn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),la=Zn(e=>{"use strict";e.byteLength=u,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var D=C.indexOf("=");D===-1&&(D=A);var O=D===A?0:4-D%4;return[D,O]}function u(C){var A=a(C),D=A[0],O=A[1];return(D+O)*3/4-O}function l(C,A,D){return(A+D)*3/4-D}function g(C){var A,D=a(C),O=D[0],B=D[1],M=new n(l(C,O,B)),I=0,Z=B>0?O-4:O,L;for(L=0;L>16&255,M[I++]=A>>8&255,M[I++]=A&255;return B===2&&(A=r[C.charCodeAt(L)]<<2|r[C.charCodeAt(L+1)]>>4,M[I++]=A&255),B===1&&(A=r[C.charCodeAt(L)]<<10|r[C.charCodeAt(L+1)]<<4|r[C.charCodeAt(L+2)]>>2,M[I++]=A>>8&255,M[I++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function x(C,A,D){for(var O,B=[],M=A;MZ?Z:I+M));return O===1?(A=C[D-1],B.push(t[A>>2]+t[A<<4&63]+"==")):O===2&&(A=(C[D-2]<<8)+C[D-1],B.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),B.join("")}}),ca=Zn(e=>{e.read=function(t,r,n,i,o){var s,a,u=o*8-i-1,l=(1<>1,h=-7,x=n?o-1:0,S=n?-1:1,C=t[r+x];for(x+=S,s=C&(1<<-h)-1,C>>=-h,h+=u;h>0;s=s*256+t[r+x],x+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+x],x+=S,h-=8);if(s===0)s=1-g;else{if(s===l)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,u,l,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,D=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+x>=1?r+=S/l:r+=S*Math.pow(2,1-x),r*l>=2&&(a++,l/=2),a+x>=h?(u=0,a=h):a+x>=1?(u=(r*l-1)*Math.pow(2,o),a=a+x):(u=r*Math.pow(2,x-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=u&255,C+=A,u/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=D*128}}),Qr=la(),et=ca(),Wn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rt.Buffer=T;rt.SlowBuffer=ha;rt.INSPECT_MAX_BYTES=50;var ir=2147483647;rt.kMaxLength=ir;T.TYPED_ARRAY_SUPPORT=pa();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function pa(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function be(e){if(e>ir)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Wr(e)}return Xn(e,t,r)}T.poolSize=8192;function Xn(e,t,r){if(typeof e=="string")return ma(e,t);if(ArrayBuffer.isView(e))return da(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(me(e,ArrayBuffer)||e&&me(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(e,SharedArrayBuffer)||e&&me(e.buffer,SharedArrayBuffer)))return ti(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=ga(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return Xn(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function ei(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function fa(e,t,r){return ei(e),e<=0?be(e):t!==void 0?typeof r=="string"?be(e).fill(t,r):be(e).fill(t):be(e)}T.alloc=function(e,t,r){return fa(e,t,r)};function Wr(e){return ei(e),be(e<0?0:Kr(e)|0)}T.allocUnsafe=function(e){return Wr(e)};T.allocUnsafeSlow=function(e){return Wr(e)};function ma(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=ri(e,t)|0,n=be(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Gr(e){let t=e.length<0?0:Kr(e.length)|0,r=be(t);for(let n=0;n=ir)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ir.toString(16)+" bytes");return e|0}function ha(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),me(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function ri(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||me(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Hr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return pi(e).length;default:if(i)return n?-1:Hr(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=ri;function ya(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ra(this,t,r);case"utf8":case"utf-8":return ii(this,t,r);case"ascii":return Ca(this,t,r);case"latin1":case"binary":return Aa(this,t,r);case"base64":return va(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sa(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Ve(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Wn&&(T.prototype[Wn]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Yr(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:Kn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Kn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Kn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function u(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let l;if(i){let g=-1;for(l=r;ls&&(r=s-a),l=r;l>=0;l--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return wa(this,e,t,r);case"utf8":case"utf-8":return Ea(this,e,t,r);case"ascii":case"latin1":case"binary":return ba(this,e,t,r);case"base64":return xa(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pa(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function va(e,t,r){return t===0&&r===e.length?Qr.fromByteArray(e):Qr.fromByteArray(e.slice(t,r))}function ii(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let u,l,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(s=h));break;case 3:u=e[i+1],l=e[i+2],(u&192)===128&&(l&192)===128&&(h=(o&15)<<12|(u&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:u=e[i+1],l=e[i+2],g=e[i+3],(u&192)===128&&(l&192)===128&&(g&192)===128&&(h=(o&15)<<18|(u&63)<<12|(l&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ta(n)}var zn=4096;function Ta(e){let t=e.length;if(t<=zn)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Re(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Re(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),et.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),et.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!1,52,8)};function ie(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function oi(e,t,r,n,i){ci(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function si(e,t,r,n,i){ci(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=Re(function(e,t=0){return oi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Re(function(e,t=0){return si(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=Re(function(e,t=0){return oi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Re(function(e,t=0){return si(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ai(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ui(e,t,r,n,i){return t=+t,r=r>>>0,i||ai(e,t,r,4,34028234663852886e22,-34028234663852886e22),et.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return ui(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return ui(this,e,t,!1,r)};function li(e,t,r,n,i){return t=+t,r=r>>>0,i||ai(e,t,r,8,17976931348623157e292,-17976931348623157e292),et.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return li(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return li(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=Yn(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Yn(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Yn(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Ia(e,t,r){tt(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&vt(t,e.length-(r+1))}function ci(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Xe.ERR_OUT_OF_RANGE("value",a,e)}Ia(n,i,o)}function tt(e,t){if(typeof e!="number")throw new Xe.ERR_INVALID_ARG_TYPE(t,"number",e)}function vt(e,t,r){throw Math.floor(e)!==e?(tt(e,r),new Xe.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Xe.ERR_BUFFER_OUT_OF_BOUNDS:new Xe.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var ka=/[^+/0-9A-Za-z-_]/g;function Da(e){if(e=e.split("=")[0],e=e.trim().replace(ka,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Hr(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Oa(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function pi(e){return Qr.toByteArray(Da(e))}function or(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function me(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Yr(e){return e!==e}var Na=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Re(e){return typeof BigInt>"u"?_a:e}function _a(){throw new Error("BigInt not supported")}});var w,d=Ee(()=>{"use strict";w=Ue(fi())});function Fa(){return!1}var La,Ba,wi,Ei=Ee(()=>{"use strict";d();c();p();f();m();La={},Ba={existsSync:Fa,promises:La},wi=Ba});var Di=Ae((df,ki)=>{"use strict";d();c();p();f();m();ki.exports=(en(),Gn(Xr)).format});var Xr={};nr(Xr,{default:()=>Ua,deprecate:()=>Mi,format:()=>_i,inspect:()=>Ni,promisify:()=>Oi});function Oi(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function Mi(e,t){return(...r)=>(console.warn(t),e(...r))}function Ni(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var _i,qa,Ua,en=Ee(()=>{"use strict";d();c();p();f();m();_i=Di(),qa={promisify:Oi,deprecate:Mi,inspect:Ni,format:_i},Ua=qa});function Ga(...e){return e.join("/")}function Ha(...e){return e.join("/")}var ji,Wa,Ka,Ct,Ji=Ee(()=>{"use strict";d();c();p();f();m();ji="/",Wa={sep:ji},Ka={resolve:Ga,posix:Wa,join:Ha,sep:ji},Ct=Ka});var lr,Gi=Ee(()=>{"use strict";d();c();p();f();m();lr=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var Wi=Ae((bm,Hi)=>{"use strict";d();c();p();f();m();Hi.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 Yi=Ae((Om,zi)=>{"use strict";d();c();p();f();m();zi.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 Xi=Ae((Bm,Zi)=>{"use strict";d();c();p();f();m();var tu=Yi();Zi.exports=e=>typeof e=="string"?e.replace(tu(),""):e});var ro=Ae((Nh,su)=>{su.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var no=Ae(()=>{"use strict";d();c();p();f();m()});var Fn=Ae((l2,gs)=>{"use strict";d();c();p();f();m();gs.exports=function(){function e(t,r,n,i,o){return tn?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;smi,getExtensionContext:()=>di});d();c();p();f();m();d();c();p();f();m();function mi(e){return typeof e=="function"?e:t=>t.$extends(e)}d();c();p();f();m();function di(e){return e}var yi={};nr(yi,{validator:()=>hi});d();c();p();f();m();d();c();p();f();m();function hi(...e){return t=>t}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Zr,bi,xi,Pi,vi=!0;typeof y!="undefined"&&({FORCE_COLOR:Zr,NODE_DISABLE_COLORS:bi,NO_COLOR:xi,TERM:Pi}=y.env||{},vi=y.stdout&&y.stdout.isTTY);var $a={enabled:!bi&&xi==null&&Pi!=="dumb"&&(Zr!=null&&Zr!=="0"||vi)};function V(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!$a.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Jp=V(0,0),sr=V(1,22),ar=V(2,22),Qp=V(3,23),Ti=V(4,24),Gp=V(7,27),Hp=V(8,28),Wp=V(9,29),Kp=V(30,39),nt=V(31,39),Ci=V(32,39),Ai=V(33,39),Ri=V(34,39),zp=V(35,39),Si=V(36,39),Yp=V(37,39),Ii=V(90,39),Zp=V(90,39),Xp=V(40,49),ef=V(41,49),tf=V(42,49),rf=V(43,49),nf=V(44,49),of=V(45,49),sf=V(46,49),af=V(47,49);d();c();p();f();m();var Va=100,Fi=["green","yellow","blue","magenta","cyan","red"],ur=[],Li=Date.now(),ja=0,tn=typeof y!="undefined"?y.env:{},Bi,$i;($i=globalThis.DEBUG)!=null||(globalThis.DEBUG=(Bi=tn.DEBUG)!=null?Bi:"");var qi;(qi=globalThis.DEBUG_COLORS)!=null||(globalThis.DEBUG_COLORS=tn.DEBUG_COLORS?tn.DEBUG_COLORS==="true":!0);var Tt={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)=>{var o;let[t,r,...n]=e,i;typeof Pt=="function"&&typeof y!="undefined"&&typeof y.stderr!="undefined"&&typeof y.stderr.write=="function"?i=(...s)=>{var a;try{let u=(en(),Gn(Xr));y.stderr.write(u.format(...s)+` -`)}catch(u){i=(a=console.warn)!=null?a:console.log}}:i=(o=console.warn)!=null?o:console.log,i(`${t} ${r}`,...n)},formatters:{}};function Ja(e){let t={color:Fi[ja++%Fi.length],enabled:Tt.enabled(e),namespace:e,log:Tt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&ur.push([o,...n]),ur.length>Va&&ur.shift(),Tt.enabled(o)||i){let u=n.map(g=>typeof g=="string"?g:Qa(g)),l=`+${Date.now()-Li}ms`;Li=Date.now(),a(o,...u,l)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Ui=new Proxy(Ja,{get:(e,t)=>Tt[t],set:(e,t,r)=>Tt[t]=r});function Qa(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Vi(){ur.length=0}var re=Ui;d();c();p();f();m();d();c();p();f();m();var Qi="library";function At(e){let t=za();return t||((e==null?void 0:e.config.engineType)==="library"?"library":(e==null?void 0:e.config.engineType)==="binary"?"binary":Qi)}function za(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}d();c();p();f();m();d();c();p();f();m();var Se;(t=>{let e;(I=>(I.findUnique="findUnique",I.findUniqueOrThrow="findUniqueOrThrow",I.findFirst="findFirst",I.findFirstOrThrow="findFirstOrThrow",I.findMany="findMany",I.create="create",I.createMany="createMany",I.createManyAndReturn="createManyAndReturn",I.update="update",I.updateMany="updateMany",I.upsert="upsert",I.delete="delete",I.deleteMany="deleteMany",I.groupBy="groupBy",I.count="count",I.aggregate="aggregate",I.findRaw="findRaw",I.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(Se||(Se={}));var it={};nr(it,{error:()=>Xa,info:()=>Za,log:()=>Ya,query:()=>eu,should:()=>Ki,tags:()=>Rt,warn:()=>rn});d();c();p();f();m();var Rt={error:nt("prisma:error"),warn:Ai("prisma:warn"),info:Si("prisma:info"),query:Ri("prisma:query")},Ki={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function Ya(...e){console.log(...e)}function rn(e,...t){Ki.warn()&&console.warn(`${Rt.warn} ${e}`,...t)}function Za(e,...t){console.info(`${Rt.info} ${e}`,...t)}function Xa(e,...t){console.error(`${Rt.error} ${e}`,...t)}function eu(e,...t){console.log(`${Rt.query} ${e}`,...t)}d();c();p();f();m();function je(e,t){throw new Error(t)}d();c();p();f();m();function nn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}d();c();p();f();m();var on=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});d();c();p();f();m();function ot(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}d();c();p();f();m();function sn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{eo.has(e)||(eo.add(e),rn(t,...r))};d();c();p();f();m();var z=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};_(z,"PrismaClientKnownRequestError");var Ie=class extends z{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};_(Ie,"NotFoundError");d();c();p();f();m();var G=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};_(G,"PrismaClientInitializationError");d();c();p();f();m();var ke=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};_(ke,"PrismaClientRustPanicError");d();c();p();f();m();var ae=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};_(ae,"PrismaClientUnknownRequestError");d();c();p();f();m();var ee=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};_(ee,"PrismaClientValidationError");d();c();p();f();m();var St=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};d();c();p();f();m();d();c();p();f();m();function It(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function ru(e,t){let r=It(()=>nu(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function nu(e){return{datamodel:{models:an(e.models),enums:an(e.enums),types:an(e.types)}}}function an(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}d();c();p();f();m();var pr=Symbol(),un=new WeakMap,xe=class{constructor(t){t===pr?un.set(this,`Prisma.${this._getName()}`):un.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return un.get(this)}},kt=class extends xe{_getNamespace(){return"NullTypes"}},Dt=class extends kt{};cn(Dt,"DbNull");var Ot=class extends kt{};cn(Ot,"JsonNull");var Mt=class extends kt{};cn(Mt,"AnyNull");var ln={classes:{DbNull:Dt,JsonNull:Ot,AnyNull:Mt},instances:{DbNull:new Dt(pr),JsonNull:new Ot(pr),AnyNull:new Mt(pr)}};function cn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function Nt(e){return{ok:!1,error:e,map(){return Nt(e)},flatMap(){return Nt(e)}}}var pn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},fn=e=>{let t=new pn,r=Je(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Je(t,e.queryRaw.bind(e)),executeRaw:Je(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>iu(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=ou(t,e.getConnectionInfo.bind(e))),n},iu=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Je(e,t.queryRaw.bind(t)),executeRaw:Je(e,t.executeRaw.bind(t)),commit:Je(e,t.commit.bind(t)),rollback:Je(e,t.rollback.bind(t))});function Je(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return Nt({kind:"GenericJs",id:i})}}}function ou(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return Nt({kind:"GenericJs",id:i})}}}var na=Ue(ro());var yD=Ue(no());Gi();Ei();Ji();d();c();p();f();m();var ue=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){var n;return(n=e.getPropertyDescriptor)==null?void 0:n.call(e,r)}}}d();c();p();f();m();d();c();p();f();m();var fr={enumerable:!0,configurable:!0,writable:!0};function mr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>fr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var so=Symbol.for("nodejs.util.inspect.custom");function ge(e,t){let r=lu(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){var u,l;if(n.has(s))return!0;let a=r.get(s);return a?(l=(u=a.has)==null?void 0:u.call(a,s))!=null?l:!0:Reflect.has(o,s)},ownKeys(o){let s=ao(Reflect.ownKeys(o),r),a=ao(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){var l,g;let u=r.get(s);return((g=(l=u==null?void 0:u.getPropertyDescriptor)==null?void 0:l.call(u,s))==null?void 0:g.writable)===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let u=r.get(s);return u?u.getPropertyDescriptor?{...fr,...u==null?void 0:u.getPropertyDescriptor(s)}:fr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[so]=function(){let o={...this};return delete o[so],o},i}function lu(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function ao(e,t){return e.filter(r=>{var i,o;let n=t.get(r);return(o=(i=n==null?void 0:n.has)==null?void 0:i.call(n,r))!=null?o:!0})}d();c();p();f();m();function st(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}d();c();p();f();m();function dr(e,t){return{batch:e,transaction:(t==null?void 0:t.kind)==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}d();c();p();f();m();d();c();p();f();m();var at=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};d();c();p();f();m();d();c();p();f();m();function uo(e){return e.substring(0,1).toLowerCase()+e.substring(1)}d();c();p();f();m();function ut(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function gr(e){return e.toString()!=="Invalid Date"}d();c();p();f();m();d();c();p();f();m();var lt=9e15,Ne=1e9,mn="0123456789abcdef",yr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",wr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",dn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-lt,maxE:lt,crypto:!1},fo,Pe,F=!0,br="[DecimalError] ",Me=br+"Invalid argument: ",mo=br+"Precision limit exceeded",go=br+"crypto unavailable",ho="[object Decimal]",te=Math.floor,H=Math.pow,cu=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,pu=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,fu=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,yo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,pe=1e7,N=7,mu=9007199254740991,du=yr.length-1,gn=wr.length-1,R={toStringTag:ho};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)};R.ceil=function(){return k(new this.constructor(this),this.e+1,2)};R.clampedTo=R.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Me+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,u=o.s,l=e.s;if(!s||!a)return!u||!l?NaN:u!==l?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};R.cosine=R.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=gu(n,Po(n,r)),n.precision=e,n.rounding=t,k(Pe==2||Pe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};R.cubeRoot=R.cbrt=function(){var e,t,r,n,i,o,s,a,u,l,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(F=!1,o=g.s*H(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Y(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=H(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,u=a.times(a).times(a),l=u.plus(g),n=q(l.plus(g).times(a),l.plus(u),s+2,1),Y(a.d).slice(0,s)===(r=Y(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(k(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(k(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return F=!0,k(n,e,h.rounding,t)};R.decimalPlaces=R.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/N))*N,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};R.dividedBy=R.div=function(e){return q(this,new this.constructor(e))};R.dividedToIntegerBy=R.divToInt=function(e){var t=this,r=t.constructor;return k(q(t,new r(e),0,1,1),r.precision,r.rounding)};R.equals=R.eq=function(e){return this.cmp(e)===0};R.floor=function(){return k(new this.constructor(this),this.e+1,3)};R.greaterThan=R.gt=function(e){return this.cmp(e)>0};R.greaterThanOrEqualTo=R.gte=function(e){var t=this.cmp(e);return t==1||t===0};R.hyperbolicCosine=R.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Pr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=ct(s,1,o.times(t),new s(1),!0);for(var u,l=e,g=new s(8);l--;)u=o.times(o),o=a.minus(u.times(g.minus(u.times(g))));return k(o,s.precision=r,s.rounding=n,!0)};R.hyperbolicSine=R.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=ct(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Pr(5,e)),i=ct(o,2,i,i,!0);for(var s,a=new o(5),u=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(l))))}return o.precision=t,o.rounding=r,k(i,t,r,!0)};R.hyperbolicTangent=R.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,q(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};R.inverseCosine=R.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ce(r,i,o):new r(0):new r(NaN):t.isZero()?ce(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ce(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};R.inverseHyperbolicCosine=R.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,F=!1,r=r.times(r).minus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};R.inverseHyperbolicSine=R.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,F=!1,r=r.times(r).plus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln())};R.inverseHyperbolicTangent=R.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?k(new o(i),e,t,!0):(o.precision=r=n-i.e,i=q(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};R.inverseSine=R.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ce(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};R.inverseTangent=R.atan=function(){var e,t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding;if(l.isFinite()){if(l.isZero())return new g(l);if(l.abs().eq(1)&&h+4<=gn)return s=ce(g,h+4,x).times(.25),s.s=l.s,s}else{if(!l.s)return new g(NaN);if(h+4<=gn)return s=ce(g,h+4,x).times(.5),s.s=l.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/N+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(F=!1,t=Math.ceil(a/N),n=1,u=l.times(l),s=new g(l),i=l;e!==-1;)if(i=i.times(u),o=s.minus(i.div(n+=2)),i=i.times(u),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};R.isNaN=function(){return!this.s};R.isNegative=R.isNeg=function(){return this.s<0};R.isPositive=R.isPos=function(){return this.s>0};R.isZero=function(){return!!this.d&&this.d[0]===0};R.lessThan=R.lt=function(e){return this.cmp(e)<0};R.lessThanOrEqualTo=R.lte=function(e){return this.cmp(e)<1};R.logarithm=R.log=function(e){var t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new g(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(F=!1,a=h+S,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),Ft(u.d,i=h,x))do if(a+=10,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),!o){+Y(u.d).slice(i+1,i+15)+1==1e14&&(u=k(u,h+1,0));break}while(Ft(u.d,i+=10,x));return F=!0,k(u,h,x)};R.minus=R.sub=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.constructor;if(e=new C(e),!S.d||!e.d)return!S.s||!e.s?e=new C(NaN):S.d?e.s=-e.s:e=new C(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(l=S.d,x=e.d,a=C.precision,u=C.rounding,!l[0]||!x[0]){if(x[0])e.s=-e.s;else if(l[0])e=new C(S);else return new C(u===3?-0:0);return F?k(e,a,u):e}if(r=te(e.e/N),g=te(S.e/N),l=l.slice(),o=g-r,o){for(h=o<0,h?(t=l,o=-o,s=x.length):(t=x,r=g,s=l.length),n=Math.max(Math.ceil(a/N),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=x.length,h=n0;--n)l[s++]=0;for(n=x.length;n>o;){if(l[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=g.length,s-i<0&&(i=s,r=g,g=l,l=r),t=0;i;)t=(l[--i]=l[i]+g[i]+t)/pe|0,l[i]%=pe;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=xr(l,n),F?k(e,a,u):e};R.precision=R.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Me+e);return r.d?(t=wo(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};R.round=function(){var e=this,t=e.constructor;return k(new t(e),e.e+1,t.rounding)};R.sine=R.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=yu(n,Po(n,r)),n.precision=e,n.rounding=t,k(Pe>2?r.neg():r,e,t,!0)):new n(NaN)};R.squareRoot=R.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,u=s.e,l=s.s,g=s.constructor;if(l!==1||!a||!a[0])return new g(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(F=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Y(a),(t.length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=te((u+1)/2)-(u<0||u%2),l==1/0?t="5e"+u:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),n=new g(t)):n=new g(l.toString()),r=(u=g.precision)+3;;)if(o=n,n=o.plus(q(s,o,r+2,1)).times(.5),Y(o.d).slice(0,r)===(t=Y(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(k(o,u+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(n,u+1,1),e=!n.times(n).eq(s));break}return F=!0,k(n,u,g.rounding,e)};R.tangent=R.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=q(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,k(Pe==2||Pe==4?r.neg():r,e,t,!0)):new n(NaN)};R.times=R.mul=function(e){var t,r,n,i,o,s,a,u,l,g=this,h=g.constructor,x=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!x||!x[0]||!S||!S[0])return new h(!e.s||x&&!x[0]&&!S||S&&!S[0]&&!x?NaN:!x||!S?e.s/0:e.s*0);for(r=te(g.e/N)+te(e.e/N),u=x.length,l=S.length,u=0;){for(t=0,i=u+n;i>n;)a=o[i]+S[n]*x[i-n-1]+t,o[i--]=a%pe|0,t=a/pe|0;o[i]=(o[i]+t)%pe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=xr(o,r),F?k(e,h.precision,h.rounding):e};R.toBinary=function(e,t){return wn(this,2,e,t)};R.toDecimalPlaces=R.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(oe(e,0,Ne),t===void 0?t=n.rounding:oe(t,0,8),k(r,e+r.e+1,t))};R.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,!0):(oe(e,0,Ne),t===void 0?t=i.rounding:oe(t,0,8),n=k(new i(n),e+1,t),r=he(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=he(i):(oe(e,0,Ne),t===void 0?t=o.rounding:oe(t,0,8),n=k(new o(i),e+i.e+1,t),r=he(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};R.toFraction=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.d,A=S.constructor;if(!C)return new A(S);if(l=r=new A(1),n=u=new A(0),t=new A(n),o=t.e=wo(C)-S.e-1,s=o%N,t.d[0]=H(10,s<0?N+s:s),e==null)e=o>0?t:l;else{if(a=new A(e),!a.isInt()||a.lt(l))throw Error(Me+a);e=a.gt(t)?o>0?t:l:a}for(F=!1,a=new A(Y(C)),g=A.precision,A.precision=o=C.length*N*2;h=q(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=u.plus(h.times(i)),u=i,i=t,t=a.minus(h.times(i)),a=i;return i=q(e.minus(r),n,0,1,1),u=u.plus(i.times(l)),r=r.plus(i.times(n)),u.s=l.s=S.s,x=q(l,n,o,1).minus(S).abs().cmp(q(u,r,o,1).minus(S).abs())<1?[l,n]:[u,r],A.precision=g,F=!0,x};R.toHexadecimal=R.toHex=function(e,t){return wn(this,16,e,t)};R.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:oe(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(F=!1,r=q(r,e,0,t,1).times(e),F=!0,k(r)):(e.s=r.s,r=e),r};R.toNumber=function(){return+this};R.toOctal=function(e,t){return wn(this,8,e,t)};R.toPower=R.pow=function(e){var t,r,n,i,o,s,a=this,u=a.constructor,l=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(H(+a,l));if(a=new u(a),a.eq(1))return a;if(n=u.precision,o=u.rounding,e.eq(1))return k(a,n,o);if(t=te(e.e/N),t>=e.d.length-1&&(r=l<0?-l:l)<=mu)return i=Eo(u,a,r,n),e.s<0?new u(1).div(i):k(i,n,o);if(s=a.s,s<0){if(tu.maxE+1||t0?s/0:0):(F=!1,u.rounding=a.s=1,r=Math.min(12,(t+"").length),i=hn(e.times(Oe(a,n+r)),n),i.d&&(i=k(i,n+5,1),Ft(i.d,n,o)&&(t=n+10,i=k(hn(e.times(Oe(a,t+r)),t),t+5,1),+Y(i.d).slice(n+1,n+15)+1==1e14&&(i=k(i,n+1,0)))),i.s=s,F=!0,u.rounding=o,k(i,n,o))};R.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,Ne),t===void 0?t=i.rounding:oe(t,0,8),n=k(new i(n),e,t),r=he(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toSignificantDigits=R.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(oe(e,1,Ne),t===void 0?t=n.rounding:oe(t,0,8)),k(new n(r),e,t)};R.toString=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};R.truncated=R.trunc=function(){return k(new this.constructor(this),this.e+1,1)};R.valueOf=R.toJSON=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Y(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Me+e)}function Ft(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=N,i=0):(i=Math.ceil((t+1)/N),t%=N),o=H(10,N-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,s}function hr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function gu(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Pr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ct(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var q=function(){function e(n,i,o){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*i+a,n[u]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;ai[a]?1:-1;break}return u}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,u){var l,g,h,x,S,C,A,D,O,B,M,I,Z,L,Ye,Be,fe,$e,Q,Ce,qe=n.constructor,Ze=n.s==i.s?1:-1,X=n.d,U=i.d;if(!X||!X[0]||!U||!U[0])return new qe(!n.s||!i.s||(X?U&&X[0]==U[0]:!U)?NaN:X&&X[0]==0||!U?Ze*0:Ze/0);for(u?(S=1,g=n.e-i.e):(u=pe,S=N,g=te(n.e/S)-te(i.e/S)),Q=U.length,fe=X.length,O=new qe(Ze),B=O.d=[],h=0;U[h]==(X[h]||0);h++);if(U[h]>(X[h]||0)&&g--,o==null?(L=o=qe.precision,s=qe.rounding):a?L=o+(n.e-i.e)+1:L=o,L<0)B.push(1),C=!0;else{if(L=L/S+2|0,h=0,Q==1){for(x=0,U=U[0],L++;(h1&&(U=e(U,x,u),X=e(X,x,u),Q=U.length,fe=X.length),Be=Q,M=X.slice(0,Q),I=M.length;I=u/2&&++$e;do x=0,l=t(U,M,Q,I),l<0?(Z=M[0],Q!=I&&(Z=Z*u+(M[1]||0)),x=Z/$e|0,x>1?(x>=u&&(x=u-1),A=e(U,x,u),D=A.length,I=M.length,l=t(A,M,D,I),l==1&&(x--,r(A,Q=10;x/=10)h++;O.e=h+g*S-1,k(O,a?o+O.e+1:o,s,C)}return O}}();function k(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=N,s=t,g=h[x=0],u=g/H(10,i-s-1)%10|0;else if(x=Math.ceil((o+1)/N),a=h.length,x>=a)if(n){for(;a++<=x;)h.push(0);g=u=0,i=1,o%=N,s=o-N+1}else break e;else{for(g=a=h[x],i=1;a>=10;a/=10)i++;o%=N,s=o-N+i,u=s<0?0:g/H(10,i-s-1)%10|0}if(n=n||t<0||h[x+1]!==void 0||(s<0?g:g%H(10,i-s-1)),l=r<4?(u||n)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(o>0?s>0?g/H(10,i-s):0:h[x-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,l?(t-=e.e+1,h[0]=H(10,(N-t%N)%N),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=x,a=1,x--):(h.length=x+1,a=H(10,N-o),h[x]=s>0?(g/H(10,i-s)%H(10,s)|0)*a:0),l)for(;;)if(x==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==pe&&(h[0]=1));break}else{if(h[x]+=a,h[x]!=pe)break;h[x--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return F&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+De(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+De(-i-1)+o,r&&(n=r-s)>0&&(o+=De(n))):i>=s?(o+=De(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+De(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=De(n))),o}function xr(e,t){var r=e[0];for(t*=N;r>=10;r/=10)t++;return t}function Er(e,t,r){if(t>du)throw F=!0,r&&(e.precision=r),Error(mo);return k(new e(yr),t,1,!0)}function ce(e,t,r){if(t>gn)throw Error(mo);return k(new e(wr),t,r,!0)}function wo(e){var t=e.length-1,r=t*N+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function De(e){for(var t="";e--;)t+="0";return t}function Eo(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/N+4);for(F=!1;;){if(r%2&&(o=o.times(t),co(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),co(t.d,s)}return F=!0,o}function lo(e){return e.d[e.d.length-1]&1}function bo(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new x(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(F=!1,u=C):u=t,a=new x(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(H(2,h))/Math.LN10*2+5|0,u+=n,r=o=s=new x(1),x.precision=u;;){if(o=k(o.times(e),u,1),r=r.times(++g),a=s.plus(q(o,r,u,1)),Y(a.d).slice(0,u)===Y(s.d).slice(0,u)){for(i=h;i--;)s=k(s.times(s),u,1);if(t==null)if(l<3&&Ft(s.d,u-n,S,l))x.precision=u+=10,r=o=a=new x(1),g=0,l++;else return k(s,x.precision=C,S,F=!0);else return x.precision=C,s}s=a}}function Oe(e,t){var r,n,i,o,s,a,u,l,g,h,x,S=1,C=10,A=e,D=A.d,O=A.constructor,B=O.rounding,M=O.precision;if(A.s<0||!D||!D[0]||!A.e&&D[0]==1&&D.length==1)return new O(D&&!D[0]?-1/0:A.s!=1?NaN:D?0:A);if(t==null?(F=!1,g=M):g=t,O.precision=g+=C,r=Y(D),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Y(A.d),n=r.charAt(0),S++;o=A.e,n>1?(A=new O("0."+r),o++):A=new O(n+"."+r.slice(1))}else return l=Er(O,g+2,M).times(o+""),A=Oe(new O(n+"."+r.slice(1)),g-C).plus(l),O.precision=M,t==null?k(A,M,B,F=!0):A;for(h=A,u=s=A=q(A.minus(1),A.plus(1),g,1),x=k(A.times(A),g,1),i=3;;){if(s=k(s.times(x),g,1),l=u.plus(q(s,new O(i),g,1)),Y(l.d).slice(0,g)===Y(u.d).slice(0,g))if(u=u.times(2),o!==0&&(u=u.plus(Er(O,g+2,M).times(o+""))),u=q(u,new O(S),g,1),t==null)if(Ft(u.d,g-C,B,a))O.precision=g+=C,l=s=A=q(h.minus(1),h.plus(1),g,1),x=k(A.times(A),g,1),i=a=1;else return k(u,O.precision=M,B,F=!0);else return O.precision=M,u;u=l,i+=2}}function xo(e){return String(e.s*e.s/0)}function yn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%N,r<0&&(n+=N),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),yo.test(t))return yn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(pu.test(t))r=16,t=t.toLowerCase();else if(cu.test(t))r=2;else if(fu.test(t))r=8;else throw Error(Me+t);for(o=t.search(/p/i),o>0?(u=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Eo(n,new n(r),o,o*2)),l=hr(t,r,pe),g=l.length-1,o=g;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=xr(l,g),e.d=l,F=!1,s&&(e=q(e,i,a*4)),u&&(e=e.times(Math.abs(u)<54?H(2,u):Ge.pow(2,u))),F=!0,e)}function yu(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ct(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Pr(5,r)),t=ct(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function ct(e,t,r,n,i){var o,s,a,u,l=1,g=e.precision,h=Math.ceil(g/N);for(F=!1,u=r.times(r),a=new e(n);;){if(s=q(a.times(u),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=q(s.times(u),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,l++}return F=!0,s.d.length=h+1,s}function Pr(e,t){for(var r=e;--t;)r*=e;return r}function Po(e,t){var r,n=t.s<0,i=ce(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Pe=n?4:1,t;if(r=t.divToInt(i),r.isZero())Pe=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Pe=lo(r)?n?2:3:n?4:1,t;Pe=lo(r)?n?1:4:n?3:2}return t.minus(i).abs()}function wn(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor,C=r!==void 0;if(C?(oe(r,1,Ne),n===void 0?n=S.rounding:oe(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=xo(e);else{for(g=he(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),x=new S(1),x.e=g.length-s,x.d=hr(he(x),10,i),x.e=x.d.length),h=hr(g,10,i),o=u=h.length;h[--u]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=q(e,x,r,n,0,i),h=e.d,o=e.e,l=fo),s=h[r],a=i/2,l=l||h[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,l)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(u=h.length;!h[u-1];--u);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)g+="0";for(h=hr(g,i,t),u=h.length;!h[u-1];--u);for(s=1,g="1.";su)for(o-=u;o--;)g+="0";else ot)return e.length=t,!0}function wu(e){return new this(e).abs()}function Eu(e){return new this(e).acos()}function bu(e){return new this(e).acosh()}function xu(e,t){return new this(e).plus(t)}function Pu(e){return new this(e).asin()}function vu(e){return new this(e).asinh()}function Tu(e){return new this(e).atan()}function Cu(e){return new this(e).atanh()}function Au(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ce(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ce(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ce(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(q(e,t,o,1)),t=ce(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(q(e,t,o,1)),r}function Ru(e){return new this(e).cbrt()}function Su(e){return k(e=new this(e),e.e+1,2)}function Iu(e,t,r){return new this(e).clamp(t,r)}function ku(e){if(!e||typeof e!="object")throw Error(br+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ne,"rounding",0,8,"toExpNeg",-lt,0,"toExpPos",0,lt,"maxE",0,lt,"minE",-lt,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Me+r+": "+n);if(r="crypto",i&&(this[r]=dn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(go);else this[r]=!1;else throw Error(Me+r+": "+n);return this}function Du(e){return new this(e).cos()}function Ou(e){return new this(e).cosh()}function vo(e){var t,r,n;function i(o){var s,a,u,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,po(o)){l.s=o.s,F?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e=10;a/=10)s++;F?s>i.maxE?(l.e=NaN,l.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(go);else for(;o=10;i/=10)n++;n`}};function ft(e){return e instanceof Lt}d();c();p();f();m();d();c();p();f();m();var vr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};d();c();p();f();m();var Tr=e=>e,Cr={bold:Tr,red:Tr,green:Tr,dim:Tr,enabled:!1},To={bold:sr,red:nt,green:Ci,dim:ar,enabled:!0},mt={write(e){e.writeLine(",")}};d();c();p();f();m();var ye=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};d();c();p();f();m();var _e=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var dt=class extends _e{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new vr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new ye("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(mt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};d();c();p();f();m();var Co=": ",Ar=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Co.length}write(t){let r=new ye(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Co).write(this.value)}};d();c();p();f();m();var Rr=class e extends _e{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let u;if(s.value instanceof e?u=s.value.getField(a):s.value instanceof dt&&(u=s.value.getField(Number(a))),!u)return;s=u}return s}getDeepFieldValue(r){var n;return r.length===0?this:(n=this.getDeepField(r))==null?void 0:n.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){var n;return(n=this.getField(r))==null?void 0:n.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){var i,o;let r=(i=this.getField("select"))==null?void 0:i.value.asObject();if(r)return{kind:"select",value:r};let n=(o=this.getField("include"))==null?void 0:o.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){var n;return(n=this.getSelectionParent())==null?void 0:n.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new ye("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(mt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};d();c();p();f();m();var K=class extends _e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new ye(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var En=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Sr(e){return new En(Ao(e))}function Ao(e){let t=new Rr;for(let[r,n]of Object.entries(e)){let i=new Ar(r,Ro(n));t.addField(i)}return t}function Ro(e){if(typeof e=="string")return new K(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new K(String(e));if(typeof e=="bigint")return new K(`${e}n`);if(e===null)return new K("null");if(e===void 0)return new K("undefined");if(pt(e))return new K(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new K(`Buffer.alloc(${e.byteLength})`):new K(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=gr(e)?e.toISOString():"Invalid Date";return new K(`new Date("${t}")`)}return e instanceof xe?new K(`Prisma.${e._getName()}`):ft(e)?new K(`prisma.${uo(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?il(e):typeof e=="object"?Ao(e):new K(Object.prototype.toString.call(e))}function il(e){let t=new dt;for(let r of e)t.addItem(Ro(r));return t}function So(e){if(e===void 0)return"";let t=Sr(e);return new at(0,{colors:Cr}).write(t).toString()}d();c();p();f();m();var ol="P2037";function Bt({error:e,user_facing_error:t},r,n){return t.error_code?new z(sl(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new ae(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function sl(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===ol&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var bn=class{getLocation(){return null}};function Fe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new bn}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Io={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function gt(e={}){let t=ul(e);return Object.entries(t).reduce((n,[i,o])=>(Io[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function ul(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Ir(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ko(e,t){let r=Ir(e);return t({action:"aggregate",unpacker:r,argsMapper:gt})(e)}d();c();p();f();m();function ll(e={}){let{select:t,...r}=e;return typeof t=="object"?gt({...r,_count:t}):gt({...r,_count:{_all:!0}})}function cl(e={}){return typeof e.select=="object"?t=>Ir(e)(t)._count:t=>Ir(e)(t)._count._all}function Do(e,t){return t({action:"count",unpacker:cl(e),argsMapper:ll})(e)}d();c();p();f();m();function pl(e={}){let t=gt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function fl(e={}){return t=>(typeof(e==null?void 0:e._count)=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Oo(e,t){return t({action:"groupBy",unpacker:fl(e),argsMapper:pl})(e)}function Mo(e,t,r){if(t==="aggregate")return n=>ko(n,r);if(t==="count")return n=>Do(n,r);if(t==="groupBy")return n=>Oo(n,r)}d();c();p();f();m();function No(e,t){let r=t.fields.filter(i=>!i.relationName),n=on(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Lt(e,o,s.type,s.isList,s.kind==="enum")},...mr(Object.keys(n))})}d();c();p();f();m();d();c();p();f();m();var _o=e=>Array.isArray(e)?e:e.split("."),xn=(e,t)=>_o(t).reduce((r,n)=>r&&r[n],e),Fo=(e,t,r)=>_o(t).reduceRight((n,i,o,s)=>Object.assign({},xn(e,s.slice(0,o)),{[i]:n}),r);function ml(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function dl(e,t,r){return t===void 0?e!=null?e:{}:Fo(t,r,e||!0)}function Pn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((u,l)=>({...u,[l.name]:l}),{});return u=>{let l=Fe(e._errorFormat),g=ml(n,i),h=dl(u,o,g),x=r({dataPath:g,callsite:l})(h),S=gl(e,t);return new Proxy(x,{get(C,A){if(!S.includes(A))return C[A];let O=[a[A].type,r,A],B=[g,h];return Pn(e,...O,...B)},...mr([...S,...Object.getOwnPropertyNames(x)])})}}function gl(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}d();c();p();f();m();d();c();p();f();m();var hl=Ue(Wi());var yl={red:nt,gray:Ii,dim:ar,bold:sr,underline:Ti,highlightSource:e=>e.highlight()},wl={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function El({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r!=null?r:!1,callArguments:n}}function bl({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],u=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${u}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${u}`)),t&&a.push(s.underline(xl(t))),i){a.push("");let l=[i.toString()];o&&(l.push(o),l.push(s.dim(")"))),a.push(l.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function xl(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function ht(e){let t=e.showColors?yl:wl,r;return typeof $getTemplateParameters!="undefined"?r=$getTemplateParameters(e,t):r=El(e),bl(r,t)}function Lo(e,t,r,n){return e===Se.ModelAction.findFirstOrThrow||e===Se.ModelAction.findUniqueOrThrow?Pl(t,r,n):n}function Pl(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=ht({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new ee(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof z&&o.code==="P2025"?new Ie(`No ${e} found`,t):o})}}d();c();p();f();m();function we(e){return e.replace(/^./,t=>t.toLowerCase())}var vl=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Tl=["aggregate","count","groupBy"];function vn(e,t){var i;let r=(i=e._extensions.getAllModelExtensions(t))!=null?i:{},n=[Cl(e,t),Rl(e,t),_t(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return ge({},n)}function Cl(e,t){let r=we(t),n=Object.keys(Se.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=u=>e._request(u);s=Lo(o,t,e._clientVersion,s);let a=u=>l=>{let g=Fe(e._errorFormat);return e._createPrismaPromise(h=>{let x={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...x,...u})})};return vl.includes(o)?Pn(e,t,a):Al(i)?Mo(e,i,a):a({})}}}function Al(e){return Tl.includes(e)}function Rl(e,t){return Qe(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return No(t,r)}))}d();c();p();f();m();function Bo(e){return e.replace(/^./,t=>t.toUpperCase())}var Tn=Symbol();function $t(e){let t=[Sl(e),ne(Tn,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(_t(r)),ge(e,t)}function Sl(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(we),n=[...new Set(t.concat(r))];return Qe({getKeys(){return n},getPropertyValue(i){let o=Bo(i);if(e._runtimeDataModel.models[o]!==void 0)return vn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return vn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function $o(e){return e[Tn]?e[Tn]:e}function qo(e){var r;if(typeof e=="function")return e(this);if((r=e.client)!=null&&r.__AccelerateEngine){let n=e.client.__AccelerateEngine;this._originalClient._engine=new n(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return $t(t)}d();c();p();f();m();d();c();p();f();m();function Uo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let u of Object.values(o)){if(n){if(n[u.name])continue;let l=u.needs.filter(g=>n[g]);l.length>0&&a.push(st(l))}else if(r){if(!r[u.name])continue;let l=u.needs.filter(g=>!r[g]);l.length>0&&a.push(st(l))}Il(e,u.needs)&&s.push(kl(u,ge(e,s)))}return s.length>0||a.length>0?ge(e,[...s,...a]):e}function Il(e,t){return t.every(r=>nn(e,r))}function kl(e,t){return Qe(ne(e.name,()=>e.compute(t)))}d();c();p();f();m();function kr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){var s;if(Array.isArray(t)){for(let a=0;ag.name===o);if(!u||u.kind!=="object"||!u.relationName)continue;let l=typeof s=="object"?s:{};t[o]=kr({visitor:i,result:t[o],args:l,modelName:u.type,runtimeDataModel:n})}}function jo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:kr({result:e,args:r!=null?r:{},modelName:t,runtimeDataModel:i,visitor:(s,a,u)=>Uo({result:s,modelName:we(a),select:u.select,omit:u.omit,extensions:n})})}d();c();p();f();m();d();c();p();f();m();function Jo(e){if(e instanceof ue)return Dl(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{var s,a;let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(((s=t.transaction)==null?void 0:s.kind)==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Jo((a=t.args)!=null?a:{}),__internalParams:t,query:(u,l=t)=>{let g=l.customDataProxyFetch;return l.customDataProxyFetch=zo(o,g),l.args=u,Go(e,l,r,n+1)}})})}function Ho(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r!=null?r:"$none",o);return Go(e,t,s)}function Wo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Ko(r,n,0,e):e(r)}}function Ko(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let u=a.customDataProxyFetch;return a.customDataProxyFetch=zo(i,u),Ko(a,t,r+1,n)}})}var Qo=e=>e;function zo(e=Qo,t=Qo){return r=>e(t(r))}d();c();p();f();m();d();c();p();f();m();function Zo(e,t,r){let n=we(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Ol({...e,...Yo(t.name,e,t.result.$allModels),...Yo(t.name,e,t.result[n])})}function Ol(e){let t=new de,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return ot(e,n=>({...n,needs:r(n.name,new Set)}))}function Yo(e,t,r){return r?ot(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Ml(t,o,i)})):{}}function Ml(e,t,r){var i;let n=(i=e==null?void 0:e[t])==null?void 0:i.compute;return n?o=>r({...o,[t]:n(o)}):r}function Xo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function es(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Dr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new de;this.modelExtensionsCache=new de;this.queryCallbacksCache=new de;this.clientExtensions=It(()=>{var t,r;return this.extension.client?{...(r=this.previous)==null?void 0:r.getAllClientExtensions(),...this.extension.client}:(t=this.previous)==null?void 0:t.getAllClientExtensions()});this.batchCallbacks=It(()=>{var n,i,o;let t=(i=(n=this.previous)==null?void 0:n.getAllBatchQueryCallbacks())!=null?i:[],r=(o=this.extension.query)==null?void 0:o.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>{var r;return Zo((r=this.previous)==null?void 0:r.getAllComputedFields(t),this.extension,t)})}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{var n,i;let r=we(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?(n=this.previous)==null?void 0:n.getAllModelExtensions(t):{...(i=this.previous)==null?void 0:i.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{var s,a;let n=(a=(s=this.previous)==null?void 0:s.getAllQueryCallbacks(t,r))!=null?a:[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Or=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Dr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Dr(t,this.head))}getAllComputedFields(t){var r;return(r=this.head)==null?void 0:r.getAllComputedFields(t)}getAllClientExtensions(){var t;return(t=this.head)==null?void 0:t.getAllClientExtensions()}getAllModelExtensions(t){var r;return(r=this.head)==null?void 0:r.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){var n,i;return(i=(n=this.head)==null?void 0:n.getAllQueryCallbacks(t,r))!=null?i:[]}getAllBatchQueryCallbacks(){var t,r;return(r=(t=this.head)==null?void 0:t.getAllBatchQueryCallbacks())!=null?r:[]}};d();c();p();f();m();var ts=re("prisma:client"),rs={Vercel:"vercel","Netlify CI":"netlify"};function ns({postinstall:e,ciName:t,clientVersion:r}){if(ts("checkPlatformCaching:postinstall",e),ts("checkPlatformCaching:ciName",t),e===!0&&t&&t in rs){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${rs[t]}-build`;throw console.error(n),new G(n,r)}}d();c();p();f();m();function is(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Nl="Cloudflare-Workers",_l="node";function os(){var e,t,r;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Nl?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((r=(t=globalThis.process)==null?void 0:t.release)==null?void 0:r.name)===_l?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var Fl={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Cn(){let e=os();return{id:e,prettyName:Fl[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function yt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){var u,l;let i,o=Object.keys(e)[0],s=(u=e[o])==null?void 0:u.url,a=(l=t[o])==null?void 0:l.url;if(o===void 0?i=void 0:a?i=a:s!=null&&s.value?i=s.value:s!=null&&s.fromEnvVar&&(i=r[s.fromEnvVar]),(s==null?void 0:s.fromEnvVar)!==void 0&&i===void 0)throw Cn().id==="workerd"?new G(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new G(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new G("error: Missing URL environment variable, value, or override.",n);return i}d();c();p();f();m();d();c();p();f();m();var Mr=class extends Error{constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var se=class extends Mr{constructor(t,r){var n;super(t,r),this.isRetryable=(n=r.isRetryable)!=null?n:!0}};d();c();p();f();m();d();c();p();f();m();function $(e,t){return{...e,isRetryable:t}}var wt=class extends se{constructor(r){super("This request must be retried",$(r,!0));this.name="ForcedRetryError";this.code="P5001"}};_(wt,"ForcedRetryError");d();c();p();f();m();var He=class extends se{constructor(r,n){super(r,$(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};_(He,"InvalidDatasourceError");d();c();p();f();m();var We=class extends se{constructor(r,n){super(r,$(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};_(We,"NotImplementedYetError");d();c();p();f();m();d();c();p();f();m();var j=class extends se{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 Ke=class extends j{constructor(r){super("Schema needs to be uploaded",$(r,!0));this.name="SchemaMissingError";this.code="P5005"}};_(Ke,"SchemaMissingError");d();c();p();f();m();d();c();p();f();m();var An="This request could not be understood by the server",Ut=class extends j{constructor(r,n,i){super(n||An,$(r,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};_(Ut,"BadRequestError");d();c();p();f();m();var Vt=class extends j{constructor(r,n){super("Engine not started: healthcheck timeout",$(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};_(Vt,"HealthcheckTimeoutError");d();c();p();f();m();var jt=class extends j{constructor(r,n,i){super(n,$(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};_(jt,"EngineStartupError");d();c();p();f();m();var Jt=class extends j{constructor(r){super("Engine version is not supported",$(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};_(Jt,"EngineVersionNotSupportedError");d();c();p();f();m();var Rn="Request timed out",Qt=class extends j{constructor(r,n=Rn){super(n,$(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};_(Qt,"GatewayTimeoutError");d();c();p();f();m();var Ll="Interactive transaction error",Gt=class extends j{constructor(r,n=Ll){super(n,$(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};_(Gt,"InteractiveTransactionError");d();c();p();f();m();var Bl="Request parameters are invalid",Ht=class extends j{constructor(r,n=Bl){super(n,$(r,!1));this.name="InvalidRequestError";this.code="P5011"}};_(Ht,"InvalidRequestError");d();c();p();f();m();var Sn="Requested resource does not exist",Wt=class extends j{constructor(r,n=Sn){super(n,$(r,!1));this.name="NotFoundError";this.code="P5003"}};_(Wt,"NotFoundError");d();c();p();f();m();var In="Unknown server error",Et=class extends j{constructor(r,n,i){super(n||In,$(r,!0));this.name="ServerError";this.code="P5006";this.logs=i}};_(Et,"ServerError");d();c();p();f();m();var kn="Unauthorized, check your connection string",Kt=class extends j{constructor(r,n=kn){super(n,$(r,!1));this.name="UnauthorizedError";this.code="P5007"}};_(Kt,"UnauthorizedError");d();c();p();f();m();var Dn="Usage exceeded, retry again later",zt=class extends j{constructor(r,n=Dn){super(n,$(r,!0));this.name="UsageExceededError";this.code="P5008"}};_(zt,"UsageExceededError");async function $l(e){let t;try{t=await e.text()}catch(r){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(r){return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Yt(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await $l(e);if(n.type==="QueryEngineError")throw new z(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Et(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Ke(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Jt(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new jt(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new G(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Vt(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 Gt(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Ht(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Kt(r,bt(kn,n));if(e.status===404)return new Wt(r,bt(Sn,n));if(e.status===429)throw new zt(r,bt(Dn,n));if(e.status===504)throw new Qt(r,bt(Rn,n));if(e.status>=500)throw new Et(r,bt(In,n));if(e.status>=400)throw new Ut(r,bt(An,n))}function bt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}d();c();p();f();m();function ss(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))}d();c();p();f();m();var Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function as(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,u,l,g;for(let h=0;h>18,a=(g&258048)>>12,u=(g&4032)>>6,l=g&63,r+=Te[s]+Te[a]+Te[u]+Te[l];return i==1?(g=t[o],s=(g&252)>>2,a=(g&3)<<4,r+=Te[s]+Te[a]+"=="):i==2&&(g=t[o]<<8|t[o+1],s=(g&64512)>>10,a=(g&1008)>>4,u=(g&15)<<2,r+=Te[s]+Te[a]+Te[u]+"="),r}d();c();p();f();m();function us(e){var r;if(!!((r=e.generator)!=null&&r.previewFeatures.some(n=>n.toLowerCase().includes("metrics"))))throw new G("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)}d();c();p();f();m();function ql(e){return e[0]*1e3+e[1]/1e6}function ls(e){return new Date(ql(e))}d();c();p();f();m();var cs={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};d();c();p();f();m();d();c();p();f();m();var Zt=class extends se{constructor(r,n){super(`Cannot fetch data from service: -${r}`,$(n,!0));this.name="RequestError";this.code="P5010"}};_(Zt,"RequestError");async function ze(e,t,r=n=>n){var i;let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(On)(e,t)}catch(o){let s=(i=o.message)!=null?i:"Unknown error";throw new Zt(s,{clientVersion:n})}}function Vl(e){return{...e.headers,"Content-Type":"application/json"}}function jl(e){return{method:e.method,headers:Vl(e)}}function Jl(e,t){return{text:()=>Promise.resolve(w.Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(w.Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new Mn(t.headers)}}async function On(e,t={}){let r=Ql("https"),n=jl(t),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{var l;let u=r.request(e,n,g=>{let{statusCode:h,headers:{location:x}}=g;h>=301&&h<=399&&x&&(x.startsWith("http")===!1?s(On(`${o}${x}`,t)):s(On(x,t))),g.on("data",S=>i.push(S)),g.on("end",()=>s(Jl(i,g))),g.on("error",a)});u.on("error",a),u.end((l=t.body)!=null?l:"")})}var Ql=typeof Pt!="undefined"?Pt:()=>{},Mn=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let i of n)this.headers.set(r,i)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){var r;return(r=this.headers.get(t))!=null?r:null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,i]of this.headers)t.call(r,i,n,this)}};var Gl=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,ps=re("prisma:client:dataproxyEngine");async function Hl(e,t){var s,a,u;let r=cs["@prisma/engines-version"],n=(s=t.clientVersion)!=null?s:"unknown";if(y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=(a=n==null?void 0:n.split("-"))!=null?a:[];if(o===void 0&&Gl.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[l]=(u=r.split("-"))!=null?u:[],[g,h,x]=l.split("."),S=Wl(`<=${g}.${h}.${x}`),C=await ze(S,{clientVersion:n});if(!C.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${C.status} ${C.statusText}, response body: ${await C.text()||""}`);let A=await C.text();ps("length of body fetched from unpkg.com",A.length);let D;try{D=JSON.parse(A)}catch(O){throw console.error("JSON.parse error: body fetched from unpkg.com: ",A),O}return D.version}throw new We("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function fs(e,t){let r=await Hl(e,t);return ps("version",r),r}function Wl(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var ms=3,Nn=re("prisma:client:dataproxyEngine"),_n=class{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!=null?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}},Xt=class{constructor(t){this.name="DataProxyEngine";us(t),this.config=t,this.env={...t.env,...typeof y!="undefined"?y.env:{}},this.inlineSchema=as(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[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new _n({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await fs(t,this.config),Nn("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){var r,n;(r=t==null?void 0:t.logs)!=null&&r.length&&t.logs.forEach(i=>{switch(i.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let o=typeof i.attributes.query=="string"?i.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[s]=o.split("/* traceparent");o=s}this.logEmitter.emit("query",{query:o,timestamp:ls(i.timestamp),duration:Number(i.attributes.duration_ms),params:i.attributes.params,target:i.attributes.target})}}}),(n=t==null?void 0:t.traces)!=null&&n.length&&this.tracingHelper.createEngineSpan({span:!0,spans:t.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await ze(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Nn("schema response status",r.status);let n=await Yt(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==null?void 0:n.kind)==="itx"?n.options:void 0,s=dr(t,n),{batchResult:a,elapsed:u}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r});return a.map(l=>"errors"in l&&l.errors.length>0?Bt(l.errors[0],this.clientVersion,this.config.activeProvider):{data:l,elapsed:u})}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 ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Nn("graphql response status",a.status),await this.handleError(await Yt(a,this.clientVersion));let u=await a.json(),l=u.extensions;if(l&&this.propagateResponseExtensions(l),u.errors)throw u.errors.length===1?Bt(u.errors[0],this.config.clientVersion,this.config.activeProvider):new ae(u.errors,{clientVersion:this.config.clientVersion});return u}})}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 u=await ze(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Yt(u,this.clientVersion));let l=await u.json(),g=l.extensions;g&&this.propagateResponseExtensions(g);let h=l.id,x=l["data-proxy"].endpoint;return{id:h,payload:{endpoint:x}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Yt(a,this.clientVersion));let l=(await a.json()).extensions;l&&this.propagateResponseExtensions(l);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=yt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch(l){throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:")throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let u=a.get("api_key");if(u===null||u.length<1)throw new He(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,u]}metrics(){throw new We("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){var r;for(let n=0;;n++){let i=o=>{this.logEmitter.emit("info",{message:`Calling ${o} (n=${n})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:i})}catch(o){if(!(o instanceof se)||!o.isRetryable)throw o;if(n>=ms)throw o instanceof wt?o.cause:o;this.logEmitter.emit("warn",{message:`Attempt ${n+1}/${ms} failed for ${t.actionGerund}: ${(r=o.message)!=null?r:"(unknown)"}`,timestamp:new Date,target:""});let s=await ss(n);this.logEmitter.emit("warn",{message:`Retrying after ${s}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof Ke)throw await this.uploadSchema(),new wt({clientVersion:this.clientVersion,cause:t});if(t)throw t}applyPendingMigrations(){throw new Error("Method not implemented.")}};function ds({copyEngine:e=!0},t){let r;try{r=yt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch(u){}e&&(r!=null&&r.startsWith("prisma://"))&&cr("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=At(t.generator),i=!!(r!=null&&r.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o){let u;throw u=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new ee(u.join(` -`),{clientVersion:t.clientVersion})}if(i)return new Xt(t);throw new ee("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}d();c();p();f();m();function Nr({generator:e}){var t;return(t=e==null?void 0:e.previewFeatures)!=null?t:[]}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var bs=Ue(Fn());d();c();p();f();m();function ws(e,t){let r=Es(e),n=Kl(r),i=Yl(n);i?_r(i,t):t.addErrorMessage(()=>"Unknown error")}function Es(e){return e.errors.flatMap(t=>t.kind==="Union"?Es(t):[t])}function Kl(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:zl(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function zl(e,t){return[...new Set(e.concat(t))]}function Yl(e){return sn(e,(t,r)=>{let n=hs(t),i=hs(r);return n!==i?n-i:ys(t)-ys(r)})}function hs(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function ys(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}d();c();p();f();m();var le=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};d();c();p();f();m();var Fr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(mt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function _r(e,t){switch(e.kind){case"MutuallyExclusiveFields":Zl(e,t);break;case"IncludeOnScalar":Xl(e,t);break;case"EmptySelection":ec(e,t);break;case"UnknownSelectionField":nc(e,t);break;case"UnknownArgument":ic(e,t);break;case"UnknownInputField":oc(e,t);break;case"RequiredArgumentMissing":sc(e,t);break;case"InvalidArgumentType":ac(e,t);break;case"InvalidArgumentValue":uc(e,t);break;case"ValueTooLarge":lc(e,t);break;case"SomeFieldsMissing":cc(e,t);break;case"TooManyFieldsGiven":pc(e,t);break;case"Union":ws(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function Zl(e,t){var n,i,o;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();r&&((i=r.getField(e.firstField))==null||i.markAsError(),(o=r.getField(e.secondField))==null||o.markAsError()),t.addErrorMessage(s=>`Please ${s.bold("either")} use ${s.green(`\`${e.firstField}\``)} or ${s.green(`\`${e.secondField}\``)}, but ${s.red("not both")} at the same time.`)}function Xl(e,t){var s,a;let[r,n]=Lr(e.selectionPath),i=e.outputType,o=(s=t.arguments.getDeepSelectionParent(r))==null?void 0:s.value;if(o&&((a=o.getField(n))==null||a.markAsError(),i))for(let u of i.fields)u.isRelation&&o.addSuggestion(new le(u.name,"true"));t.addErrorMessage(u=>{let l=`Invalid scalar field ${u.red(`\`${n}\``)} for ${u.bold("include")} statement`;return i?l+=` on model ${u.bold(i.name)}. ${er(u)}`:l+=".",l+=` -Note that ${u.bold("include")} statements only accept relation fields.`,l})}function ec(e,t){var n,i;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();if(r){let o=(i=r.getField("omit"))==null?void 0:i.value.asObject();if(o){tc(e,t,o);return}}rc(e,t)}function tc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new le(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function rc(e,t){var o,s;let r=e.outputType,n=(o=t.arguments.getDeepSelectionParent(e.selectionPath))==null?void 0:o.value,i=(s=n==null?void 0:n.isEmpty())!=null?s:!1;n&&(n.removeAllFields(),vs(n,r)),t.addErrorMessage(a=>i?`The ${a.red("`select`")} statement for type ${a.bold(r.name)} must not be empty. ${er(a)}`:`The ${a.red("`select`")} statement for type ${a.bold(r.name)} needs ${a.bold("at least one truthy value")}.`)}function nc(e,t){var s,a,u,l,g,h,x;let[r,n]=Lr(e.selectionPath),i=(s=t.arguments.getDeepSubSelectionValue(r))==null?void 0:s.asObject(),o;if(i){let S=(a=i.getFieldValue("select"))==null?void 0:a.asObject(),C=(u=i.getFieldValue("include"))==null?void 0:u.asObject(),A=(l=i.getFieldValue("omit"))==null?void 0:l.asObject();S!=null&&S.hasField(n)?(o="select",(g=S.getField(n))==null||g.markAsError(),vs(S,e.outputType)):C!=null&&C.hasField(n)?(o="include",(h=C.getField(n))==null||h.markAsError(),fc(C,e.outputType)):A!=null&&A.hasField(n)&&(o="omit",(x=A.getField(n))==null||x.markAsError(),mc(A,e.outputType))}t.addErrorMessage(S=>{let C=[`Unknown field ${S.red(`\`${n}\``)}`];return o&&C.push(`for ${S.bold(o)} statement`),C.push(`on model ${S.bold(`\`${e.outputType.name}\``)}.`),C.push(er(S)),C.join(" ")})}function ic(e,t){var i,o;let r=e.argumentPath[0],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getField(r))==null||o.markAsError(),dc(n,e.arguments)),t.addErrorMessage(s=>xs(s,r,e.arguments.map(a=>a.name)))}function oc(e,t){var o,s,a;let[r,n]=Lr(e.argumentPath),i=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject();if(i){(s=i.getDeepField(e.argumentPath))==null||s.markAsError();let u=(a=i.getDeepFieldValue(r))==null?void 0:a.asObject();u&&Ts(u,e.inputType)}t.addErrorMessage(u=>xs(u,n,e.inputType.fields.map(l=>l.name)))}function xs(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=hc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(er(e)),n.join(" ")}function sc(e,t){var u,l;let r;t.addErrorMessage(g=>(r==null?void 0:r.value)instanceof K&&r.value.text==="null"?`Argument \`${g.green(o)}\` must not be ${g.red("null")}.`:`Argument \`${g.green(o)}\` is missing.`);let n=(u=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:u.asObject();if(!n)return;let[i,o]=Lr(e.argumentPath),s=new Fr,a=(l=n.getDeepFieldValue(i))==null?void 0:l.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let g of e.inputTypes[0].fields)s.addField(g.name,g.typeNames.join(" | "));a.addSuggestion(new le(o,s).makeRequired())}else{let g=e.inputTypes.map(Ps).join(" | ");a.addSuggestion(new le(o,g).makeRequired())}}function Ps(e){return e.kind==="list"?`${Ps(e.elementType)}[]`:e.name}function ac(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=Br("or",e.argument.typeNames.map(u=>s.green(u)));return`Argument \`${s.bold(r)}\`: Invalid value provided. Expected ${a}, provided ${s.red(e.inferredType)}.`})}function uc(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=[`Invalid value for argument \`${s.bold(r)}\``];if(e.underlyingError&&a.push(`: ${e.underlyingError}`),a.push("."),e.argument.typeNames.length>0){let u=Br("or",e.argument.typeNames.map(l=>s.green(l)));a.push(` Expected ${u}.`)}return a.join("")})}function lc(e,t){var o;let r=e.argument.name,n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath),a=s==null?void 0:s.value;a==null||a.markAsError(),a instanceof K&&(i=a.text)}t.addErrorMessage(s=>{let a=["Unable to fit value"];return i&&a.push(s.red(i)),a.push(`into a 64-bit signed integer for field \`${s.bold(r)}\``),a.join(" ")})}function cc(e,t){var i,o;let r=e.argumentPath[e.argumentPath.length-1],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();if(n){let s=(o=n.getDeepFieldValue(e.argumentPath))==null?void 0:o.asObject();s&&Ts(s,e.inputType)}t.addErrorMessage(s=>{let a=[`Argument \`${s.bold(r)}\` of type ${s.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?a.push(`${s.green("at least one of")} ${Br("or",e.constraints.requiredFields.map(u=>`\`${s.bold(u)}\``))} arguments.`):a.push(`${s.green("at least one")} argument.`):a.push(`${s.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),a.push(er(s)),a.join(" ")})}function pc(e,t){var o,s;let r=e.argumentPath[e.argumentPath.length-1],n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i=[];if(n){let a=(s=n.getDeepFieldValue(e.argumentPath))==null?void 0:s.asObject();a&&(a.markAsError(),i=Object.keys(a.getFields()))}t.addErrorMessage(a=>{let u=[`Argument \`${a.bold(r)}\` of type ${a.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?u.push(`${a.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?u.push(`${a.green("at most one")} argument,`):u.push(`${a.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),u.push(`but you provided ${Br("and",i.map(l=>a.red(l)))}. Please choose`),e.constraints.maxFieldCount===1?u.push("one."):u.push(`${e.constraints.maxFieldCount}.`),u.join(" ")})}function vs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,"true"))}function fc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new le(r.name,"true"))}function mc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new le(r.name,"true"))}function dc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Ts(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Lr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function er({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Br(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var gc=3;function hc(e,t){let r=1/0,n;for(let i of t){let o=(0,bs.default)(e,i);o>gc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){var r;return(r=this.model)==null?void 0:r.fields.find(n=>n.name===t)}nestSelection(t){let r=this.findField(t),n=(r==null?void 0:r.kind)==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};d();c();p();f();m();var Ss=e=>({command:e});d();c();p();f();m();d();c();p();f();m();var Is=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);d();c();p();f();m();function tr(e){try{return ks(e,"fast")}catch(t){return ks(e,"slow")}}function ks(e,t){return JSON.stringify(e.map(r=>Ac(r,t)))}function Ac(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:ut(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ve.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Rc(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Os(e):e}function Rc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Os(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ds);let t={};for(let r of Object.keys(e))t[r]=Ds(e[r]);return t}function Ds(e){return typeof e=="bigint"?e.toString():Os(e)}var Sc=/^(\s*alter\s)/i,Ms=re("prisma:client");function $n(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Sc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var qn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:tr(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:tr(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:tr(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Is(r),i={values:tr(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i!=null&&i.values?Ms(`prisma.${e}(${n}, ${i.values})`):Ms(`prisma.${e}(${n})`),{query:n,parameters:i}},Ns={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new ue(t,r)}},_s={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};d();c();p();f();m();function Un(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||(o==null?void 0:o.kind)==="itx"?n!=null?n:n=Fs(r(o)):Fs(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function Fs(e){return typeof e.then=="function"?e:Promise.resolve(e)}d();c();p();f();m();var Ls={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Vn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){var t,r;return(r=(t=globalThis.PRISMA_INSTRUMENTATION)==null?void 0:t.helper)!=null?r:Ls}};function Bs(e){return e.includes("tracing")?new Vn:Ls}d();c();p();f();m();function $s(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i==null?void 0:i(n)}}}d();c();p();f();m();var Ic=["$connect","$disconnect","$on","$transaction","$use","$extends"],qs=Ic;d();c();p();f();m();function Us(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}d();c();p();f();m();var qr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};d();c();p();f();m();var js=Ue(Xi());d();c();p();f();m();function Ur(e){return typeof e.batchRequestIdx=="number"}d();c();p();f();m();function Vr(e){return e===null?e:Array.isArray(e)?e.map(Vr):typeof e=="object"?kc(e)?Dc(e):ot(e,Vr):e}function kc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Dc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ve(t);case"Json":return JSON.parse(t);default:je(t,"Unknown tagged value")}}d();c();p();f();m();function Vs(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(jn(e.query.arguments)),t.push(jn(e.query.selection)),t.join("")}function jn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${jn(n)})`:r}).join(" ")})`}d();c();p();f();m();var Oc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Jn(e){return Oc[e]}d();c();p();f();m();var jr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),u=this.client._tracingHelper.getTraceParent(s),l=n.some(h=>Jn(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:u,transaction:Nc(o),containsWrite:l,customDataProxyFetch:i})).map((h,x)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[x],h)}catch(S){return S}})}),singleLoader:async n=>{var s;let i=((s=n.transaction)==null?void 0:s.kind)==="itx"?Js(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Jn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>{var i;return(i=n.transaction)!=null&&i.id?`transaction-${n.transaction.id}`:Vs(n.protocolQuery)},batchOrder(n,i){var o,s;return((o=n.transaction)==null?void 0:o.kind)==="batch"&&((s=i.transaction)==null?void 0:s.kind)==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n==null?void 0:n.data,o=n==null?void 0:n.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(Mc(t),_c(t,i)||t instanceof Ie)throw t;if(t instanceof z&&Fc(t)){let u=Qs(t.meta);$r({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=ht({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new z(a,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ke(a,this.client._clientVersion);if(t instanceof ae)throw new ae(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof G)throw new G(a,this.client._clientVersion);if(t instanceof ke)throw new ke(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,js.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=Vr(xn(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function Nc(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Js(e)};je(e,"Unknown transaction kind")}}function Js(e){return{id:e.id,payload:e.payload}}function _c(e,t){return Ur(e)&&(t==null?void 0:t.kind)==="batch"&&e.batchRequestIdx!==t.index}function Fc(e){return e.code==="P2009"||e.code==="P2012"}function Qs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Qs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}d();c();p();f();m();var Gs="5.14.0";var Hs=Gs;d();c();p();f();m();function Ws(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=Ks(t[n]);return r})}function Ks({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return w.Buffer.from(t,"base64");case"decimal":return new ve(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(Ks);default:return t}}d();c();p();f();m();var Xs=Ue(Fn());d();c();p();f();m();var J=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};_(J,"PrismaClientConstructorValidationError");var zs=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Ys=["pretty","colorless","minimal"],Zs=["info","query","warn","error"],Bc={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=xt(r,t)||` Available datasources: ${t.join(", ")}`;throw new J(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new J(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new J('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Nr(t).includes("driverAdapters"))throw new J('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(At()==="binary")throw new J('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e!="undefined"&&typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Ys.includes(e)){let t=xt(e,Ys);throw new J(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Zs.includes(r)){let n=xt(r,Zs);throw new J(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=xt(i,o);throw new J(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new J(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new J(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new J(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new J(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=xt(r,t);throw new J(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ea(e,t){for(let[r,n]of Object.entries(e)){if(!zs.includes(r)){let i=xt(r,zs);throw new J(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Bc[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new J('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function xt(e,t){if(t.length===0||typeof e!="string")return"";let r=$c(e,t);return r?` Did you mean "${r}"?`:""}function $c(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Xs.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},u=l=>{o||(o=!0,r(l))};for(let l=0;l{n[l]=g,a()},g=>{if(!Ur(g)){u(g);return}g.batchRequestIdx===l?u(g):(i||(i=g),a())})})}var Le=re("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var qc={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Uc=Symbol.for("prisma.client.transaction.id"),Vc={id:0,nextId(){return++this.id}};function jc(e){class t{constructor(n){this._originalClient=this;this._middlewares=new qr;this._createPrismaPromise=Un();this.$extends=qo;var u,l,g,h,x,S,C,A,D,O,B,M,I,Z;e=(g=(l=(u=n==null?void 0:n.__internal)==null?void 0:u.configOverride)==null?void 0:l.call(u,e))!=null?g:e,ns(e),n&&ea(n,e);let i=n!=null&&n.adapter?fn(n.adapter):void 0,o=new lr().on("error",()=>{});this._extensions=Or.empty(),this._previewFeatures=Nr(e),this._clientVersion=(h=e.clientVersion)!=null?h:Hs,this._activeProvider=e.activeProvider,this._tracingHelper=Bs(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Ct.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Ct.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=(x=e.injectableEdgeEnv)==null?void 0:x.call(e);try{let L=n!=null?n:{},Ye=(S=L.__internal)!=null?S:{},Be=Ye.debug===!0;Be&&re.enable("prisma:client");let fe=Ct.resolve(e.dirname,e.relativePath);wi.existsSync(fe)||(fe=e.dirname),Le("dirname",e.dirname),Le("relativePath",e.relativePath),Le("cwd",fe);let $e=Ye.engine||{};if(L.errorFormat?this._errorFormat=L.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:fe,dirname:e.dirname,enableDebugLogs:Be,allowTriggerPanic:$e.allowTriggerPanic,datamodelPath:Ct.join(e.dirname,(C=e.filename)!=null?C:"schema.prisma"),prismaPath:(A=$e.binaryPath)!=null?A:void 0,engineEndpoint:$e.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:L.log&&Us(L.log),logQueries:L.log&&!!(typeof L.log=="string"?L.log==="query":L.log.find(Q=>typeof Q=="string"?Q==="query":Q.level==="query")),env:(D=a==null?void 0:a.parsed)!=null?D:{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:is(L,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:(B=(O=L.transactionOptions)==null?void 0:O.maxWait)!=null?B:2e3,timeout:(I=(M=L.transactionOptions)==null?void 0:M.timeout)!=null?I:5e3,isolationLevel:(Z=L.transactionOptions)==null?void 0:Z.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:yt,getBatchRequestPayload:dr,prismaGraphQLToJSError:Bt,PrismaClientUnknownRequestError:ae,PrismaClientInitializationError:G,PrismaClientKnownRequestError:z,debug:re("prisma:client:accelerateEngine"),engineVersion:na.version,clientVersion:e.clientVersion}},Le("clientVersion",e.clientVersion),this._engine=ds(e,this._engineConfig),this._requestHandler=new Jr(this,o),L.log)for(let Q of L.log){let Ce=typeof Q=="string"?Q:Q.emit==="stdout"?Q.level:null;Ce&&this.$on(Ce,qe=>{var Ze;it.log(`${(Ze=it.tags[Ce])!=null?Ze:""}`,qe.message||qe.query)})}this._metrics=new St(this._engine)}catch(L){throw L.clientVersion=this._clientVersion,L}return this._appliedParent=$t(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Vi()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=ra(n,i);return $n(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new ee("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>($n(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new ee(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Ss,callsite:Fe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(Ws)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...ra(n,i));throw new ee("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Vc.nextId(),s=$s(n.length),a=n.map((u,l)=>{var x,S,C;if((u==null?void 0:u[Symbol.toStringTag])!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=(x=i==null?void 0:i.isolationLevel)!=null?x:this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:l,isolationLevel:g,lock:s};return(C=(S=u.requestTransaction)==null?void 0:S.call(u,h))!=null?C:u});return ta(a)}async _transactionWithCallback({callback:n,options:i}){var l,g,h;let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:(l=i==null?void 0:i.maxWait)!=null?l:this._engineConfig.transactionOptions.maxWait,timeout:(g=i==null?void 0:i.timeout)!=null?g:this._engineConfig.transactionOptions.timeout,isolationLevel:(h=i==null?void 0:i.isolationLevel)!=null?h:this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),u;try{let x={kind:"itx",...a};u=await n(this._createItxClient(x)),await this._engine.transaction("commit",o,a)}catch(x){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),x}return u}_createItxClient(n){return $t(ge($o(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>Un(n)),ne(Uc,()=>n.id),st(qs)]))}$transaction(n,i){var a;let o;typeof n=="function"?((a=this._engineConfig.adapter)==null?void 0:a.adapterName)==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){var l;n.otelParentCtx=this._tracingHelper.getActiveContext();let i=(l=n.middlewareArgsMapper)!=null?l:qc,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,u=async g=>{let h=this._middlewares.get(++a);if(h)return this._tracingHelper.runInChildSpan(s.middleware,O=>h(g,B=>(O==null||O.end(),u(B))));let{runInTransaction:x,args:S,...C}=g,A={...n,...C};S&&(A.args=i.middlewareArgsToRequestArgs(S)),n.transaction!==void 0&&x===!1&&delete A.transaction;let D=await Ho(this,A);return A.model?jo({result:D,modelName:A.model,args:A.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):D};return this._tracingHelper.runInChildSpan(s.operation,()=>u(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:u,argsMapper:l,transaction:g,unpacker:h,otelParentCtx:x,customDataProxyFetch:S}){try{n=l?l(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>Cs({modelName:u,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return re.enabled("prisma:client")&&(Le("Prisma Client call:"),Le(`prisma.${i}(${So(n)})`),Le("Generated request:"),Le(JSON.stringify(A,null,2)+` -`)),(g==null?void 0:g.kind)==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:u,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:x,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:S})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new ee("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){var i;return!!((i=this._engineConfig.previewFeatures)!=null&&i.includes(n))}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function ra(e,t){return Jc(e)?[new ue(e,t),Ns]:[e,_s]}function Jc(e){return Array.isArray(e)&&Array.isArray(e.raw)}d();c();p();f();m();var Qc=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Gc(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Qc.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}d();c();p();f();m();var export_warnEnvConflicts=void 0;export{Ui as Debug,ve as Decimal,gi as Extensions,St as MetricsClient,Ie as NotFoundError,G as PrismaClientInitializationError,z as PrismaClientKnownRequestError,ke as PrismaClientRustPanicError,ae as PrismaClientUnknownRequestError,ee as PrismaClientValidationError,yi as Public,ue as Sql,ru as defineDmmfProperty,uu as empty,jc as getPrismaClient,Cn as getRuntime,au as join,Gc as makeStrictEnum,ln as objectEnumValues,io as raw,oo as sqltag,export_warnEnvConflicts as warnEnvConflicts,cr as warnOnce}; -//# sourceMappingURL=edge-esm.js.map diff --git a/integration-tests/tests/prisma/pg/client/runtime/edge.js b/integration-tests/tests/prisma/pg/client/runtime/edge.js deleted file mode 100644 index 4ed919f76..000000000 --- a/integration-tests/tests/prisma/pg/client/runtime/edge.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict";var la=Object.create;var nr=Object.defineProperty;var ca=Object.getOwnPropertyDescriptor;var pa=Object.getOwnPropertyNames;var fa=Object.getPrototypeOf,ma=Object.prototype.hasOwnProperty;var be=(e,t)=>()=>(e&&(t=e(e=0)),t);var Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vt=(e,t)=>{for(var r in t)nr(e,r,{get:t[r],enumerable:!0})},zn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pa(t))!ma.call(e,i)&&i!==r&&nr(e,i,{get:()=>t[i],enumerable:!(n=ca(t,i))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?la(fa(e)):{},zn(t||!e||!e.__esModule?nr(r,"default",{value:e,enumerable:!0}):r,e)),Gr=e=>zn(nr({},"__esModule",{value:!0}),e);var y,c=be(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var Yn,b,p=be(()=>{"use strict";b=(Yn=globalThis.performance)!=null?Yn:(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,f=be(()=>{"use strict";E=()=>{};E.prototype=E});var m=be(()=>{"use strict"});var hi=Se(rt=>{"use strict";d();c();p();f();m();var ri=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),da=ri(e=>{"use strict";e.byteLength=u,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var D=C.indexOf("=");D===-1&&(D=A);var O=D===A?0:4-D%4;return[D,O]}function u(C){var A=a(C),D=A[0],O=A[1];return(D+O)*3/4-O}function l(C,A,D){return(A+D)*3/4-D}function g(C){var A,D=a(C),O=D[0],B=D[1],M=new n(l(C,O,B)),I=0,X=B>0?O-4:O,L;for(L=0;L>16&255,M[I++]=A>>8&255,M[I++]=A&255;return B===2&&(A=r[C.charCodeAt(L)]<<2|r[C.charCodeAt(L+1)]>>4,M[I++]=A&255),B===1&&(A=r[C.charCodeAt(L)]<<10|r[C.charCodeAt(L+1)]<<4|r[C.charCodeAt(L+2)]>>2,M[I++]=A>>8&255,M[I++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function x(C,A,D){for(var O,B=[],M=A;MX?X:I+M));return O===1?(A=C[D-1],B.push(t[A>>2]+t[A<<4&63]+"==")):O===2&&(A=(C[D-2]<<8)+C[D-1],B.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),B.join("")}}),ga=ri(e=>{e.read=function(t,r,n,i,o){var s,a,u=o*8-i-1,l=(1<>1,h=-7,x=n?o-1:0,S=n?-1:1,C=t[r+x];for(x+=S,s=C&(1<<-h)-1,C>>=-h,h+=u;h>0;s=s*256+t[r+x],x+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+x],x+=S,h-=8);if(s===0)s=1-g;else{if(s===l)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,u,l,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,D=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+x>=1?r+=S/l:r+=S*Math.pow(2,1-x),r*l>=2&&(a++,l/=2),a+x>=h?(u=0,a=h):a+x>=1?(u=(r*l-1)*Math.pow(2,o),a=a+x):(u=r*Math.pow(2,x-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=u&255,C+=A,u/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=D*128}}),Hr=da(),et=ga(),Zn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rt.Buffer=T;rt.SlowBuffer=xa;rt.INSPECT_MAX_BYTES=50;var ir=2147483647;rt.kMaxLength=ir;T.TYPED_ARRAY_SUPPORT=ha();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ha(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function xe(e){if(e>ir)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return zr(e)}return ni(e,t,r)}T.poolSize=8192;function ni(e,t,r){if(typeof e=="string")return wa(e,t);if(ArrayBuffer.isView(e))return Ea(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(me(e,ArrayBuffer)||e&&me(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(e,SharedArrayBuffer)||e&&me(e.buffer,SharedArrayBuffer)))return oi(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=ba(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return ni(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function ii(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function ya(e,t,r){return ii(e),e<=0?xe(e):t!==void 0?typeof r=="string"?xe(e).fill(t,r):xe(e).fill(t):xe(e)}T.alloc=function(e,t,r){return ya(e,t,r)};function zr(e){return ii(e),xe(e<0?0:Yr(e)|0)}T.allocUnsafe=function(e){return zr(e)};T.allocUnsafeSlow=function(e){return zr(e)};function wa(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=si(e,t)|0,n=xe(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Wr(e){let t=e.length<0?0:Yr(e.length)|0,r=xe(t);for(let n=0;n=ir)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ir.toString(16)+" bytes");return e|0}function xa(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),me(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function si(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||me(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Kr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return gi(e).length;default:if(i)return n?-1:Kr(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=si;function Pa(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Oa(this,t,r);case"utf8":case"utf-8":return ui(this,t,r);case"ascii":return ka(this,t,r);case"latin1":case"binary":return Da(this,t,r);case"base64":return Sa(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ma(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Ve(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Zn&&(T.prototype[Zn]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Xr(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:Xn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Xn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Xn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function u(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let l;if(i){let g=-1;for(l=r;ls&&(r=s-a),l=r;l>=0;l--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return va(this,e,t,r);case"utf8":case"utf-8":return Ta(this,e,t,r);case"ascii":case"latin1":case"binary":return Ca(this,e,t,r);case"base64":return Aa(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ra(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Sa(e,t,r){return t===0&&r===e.length?Hr.fromByteArray(e):Hr.fromByteArray(e.slice(t,r))}function ui(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let u,l,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(s=h));break;case 3:u=e[i+1],l=e[i+2],(u&192)===128&&(l&192)===128&&(h=(o&15)<<12|(u&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:u=e[i+1],l=e[i+2],g=e[i+3],(u&192)===128&&(l&192)===128&&(g&192)===128&&(h=(o&15)<<18|(u&63)<<12|(l&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ia(n)}var ei=4096;function Ia(e){let t=e.length;if(t<=ei)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Ie(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Ie(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),et.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),et.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!1,52,8)};function ie(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function li(e,t,r,n,i){di(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function ci(e,t,r,n,i){di(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=Ie(function(e,t=0){return li(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Ie(function(e,t=0){return ci(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=Ie(function(e,t=0){return li(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Ie(function(e,t=0){return ci(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function pi(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function fi(e,t,r,n,i){return t=+t,r=r>>>0,i||pi(e,t,r,4,34028234663852886e22,-34028234663852886e22),et.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return fi(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return fi(this,e,t,!1,r)};function mi(e,t,r,n,i){return t=+t,r=r>>>0,i||pi(e,t,r,8,17976931348623157e292,-17976931348623157e292),et.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return mi(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return mi(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=ti(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=ti(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function ti(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Na(e,t,r){tt(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Tt(t,e.length-(r+1))}function di(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Xe.ERR_OUT_OF_RANGE("value",a,e)}Na(n,i,o)}function tt(e,t){if(typeof e!="number")throw new Xe.ERR_INVALID_ARG_TYPE(t,"number",e)}function Tt(e,t,r){throw Math.floor(e)!==e?(tt(e,r),new Xe.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Xe.ERR_BUFFER_OUT_OF_BOUNDS:new Xe.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var _a=/[^+/0-9A-Za-z-_]/g;function Fa(e){if(e=e.split("=")[0],e=e.trim().replace(_a,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Kr(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function La(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function gi(e){return Hr.toByteArray(Fa(e))}function or(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function me(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Xr(e){return e!==e}var $a=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Ie(e){return typeof BigInt>"u"?qa:e}function qa(){throw new Error("BigInt not supported")}});var w,d=be(()=>{"use strict";w=Ue(hi())});function Ua(){return!1}var Va,ja,bi,xi=be(()=>{"use strict";d();c();p();f();m();Va={},ja={existsSync:Ua,promises:Va},bi=ja});var Mi=Se((df,Oi)=>{"use strict";d();c();p();f();m();Oi.exports=(on(),Gr(nn)).format});var nn={};vt(nn,{default:()=>Ga,deprecate:()=>_i,format:()=>Li,inspect:()=>Fi,promisify:()=>Ni});function Ni(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function _i(e,t){return(...r)=>(console.warn(t),e(...r))}function Fi(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var Li,Qa,Ga,on=be(()=>{"use strict";d();c();p();f();m();Li=Mi(),Qa={promisify:Ni,deprecate:_i,inspect:Fi,format:Li},Ga=Qa});function Ya(...e){return e.join("/")}function Za(...e){return e.join("/")}var Ji,Xa,eu,At,Qi=be(()=>{"use strict";d();c();p();f();m();Ji="/",Xa={sep:Ji},eu={resolve:Ya,posix:Xa,join:Za,sep:Ji},At=eu});var lr,Hi=be(()=>{"use strict";d();c();p();f();m();lr=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var Ki=Se((Em,Wi)=>{"use strict";d();c();p();f();m();Wi.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 Zi=Se((Dm,Yi)=>{"use strict";d();c();p();f();m();Yi.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 eo=Se((Lm,Xi)=>{"use strict";d();c();p();f();m();var su=Zi();Xi.exports=e=>typeof e=="string"?e.replace(su(),""):e});var io=Se((Mh,cu)=>{cu.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var oo=Se(()=>{"use strict";d();c();p();f();m()});var Un=Se((a2,ys)=>{"use strict";d();c();p();f();m();ys.exports=function(){function e(t,r,n,i,o){return tn?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;san,Decimal:()=>ye,Extensions:()=>en,MetricsClient:()=>st,NotFoundError:()=>Pe,PrismaClientInitializationError:()=>G,PrismaClientKnownRequestError:()=>K,PrismaClientRustPanicError:()=>ve,PrismaClientUnknownRequestError:()=>oe,PrismaClientValidationError:()=>Y,Public:()=>tn,Sql:()=>se,defineDmmfProperty:()=>no,empty:()=>ao,getPrismaClient:()=>sa,getRuntime:()=>Mr,join:()=>so,makeStrictEnum:()=>aa,objectEnumValues:()=>pr,raw:()=>yn,sqltag:()=>wn,warnEnvConflicts:()=>void 0,warnOnce:()=>It});module.exports=Gr(Hc);d();c();p();f();m();var en={};vt(en,{defineExtension:()=>yi,getExtensionContext:()=>wi});d();c();p();f();m();d();c();p();f();m();function yi(e){return typeof e=="function"?e:t=>t.$extends(e)}d();c();p();f();m();function wi(e){return e}var tn={};vt(tn,{validator:()=>Ei});d();c();p();f();m();d();c();p();f();m();function Ei(...e){return t=>t}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var rn,Pi,vi,Ti,Ci=!0;typeof y!="undefined"&&({FORCE_COLOR:rn,NODE_DISABLE_COLORS:Pi,NO_COLOR:vi,TERM:Ti}=y.env||{},Ci=y.stdout&&y.stdout.isTTY);var Ja={enabled:!Pi&&vi==null&&Ti!=="dumb"&&(rn!=null&&rn!=="0"||Ci)};function V(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ja.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Jp=V(0,0),sr=V(1,22),ar=V(2,22),Qp=V(3,23),Ai=V(4,24),Gp=V(7,27),Hp=V(8,28),Wp=V(9,29),Kp=V(30,39),nt=V(31,39),Ri=V(32,39),Si=V(33,39),Ii=V(34,39),zp=V(35,39),ki=V(36,39),Yp=V(37,39),Di=V(90,39),Zp=V(90,39),Xp=V(40,49),ef=V(41,49),tf=V(42,49),rf=V(43,49),nf=V(44,49),of=V(45,49),sf=V(46,49),af=V(47,49);d();c();p();f();m();var Ha=100,Bi=["green","yellow","blue","magenta","cyan","red"],ur=[],$i=Date.now(),Wa=0,sn=typeof y!="undefined"?y.env:{},qi,Ui;(Ui=globalThis.DEBUG)!=null||(globalThis.DEBUG=(qi=sn.DEBUG)!=null?qi:"");var Vi;(Vi=globalThis.DEBUG_COLORS)!=null||(globalThis.DEBUG_COLORS=sn.DEBUG_COLORS?sn.DEBUG_COLORS==="true":!0);var Ct={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)=>{var o;let[t,r,...n]=e,i;typeof require=="function"&&typeof y!="undefined"&&typeof y.stderr!="undefined"&&typeof y.stderr.write=="function"?i=(...s)=>{var a;try{let u=(on(),Gr(nn));y.stderr.write(u.format(...s)+` -`)}catch(u){i=(a=console.warn)!=null?a:console.log}}:i=(o=console.warn)!=null?o:console.log,i(`${t} ${r}`,...n)},formatters:{}};function Ka(e){let t={color:Bi[Wa++%Bi.length],enabled:Ct.enabled(e),namespace:e,log:Ct.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&ur.push([o,...n]),ur.length>Ha&&ur.shift(),Ct.enabled(o)||i){let u=n.map(g=>typeof g=="string"?g:za(g)),l=`+${Date.now()-$i}ms`;$i=Date.now(),a(o,...u,l)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var an=new Proxy(Ka,{get:(e,t)=>Ct[t],set:(e,t,r)=>Ct[t]=r});function za(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 ji(){ur.length=0}var re=an;d();c();p();f();m();d();c();p();f();m();var Gi="library";function Rt(e){let t=tu();return t||((e==null?void 0:e.config.engineType)==="library"?"library":(e==null?void 0:e.config.engineType)==="binary"?"binary":Gi)}function tu(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}d();c();p();f();m();d();c();p();f();m();var ke;(t=>{let e;(I=>(I.findUnique="findUnique",I.findUniqueOrThrow="findUniqueOrThrow",I.findFirst="findFirst",I.findFirstOrThrow="findFirstOrThrow",I.findMany="findMany",I.create="create",I.createMany="createMany",I.createManyAndReturn="createManyAndReturn",I.update="update",I.updateMany="updateMany",I.upsert="upsert",I.delete="delete",I.deleteMany="deleteMany",I.groupBy="groupBy",I.count="count",I.aggregate="aggregate",I.findRaw="findRaw",I.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(ke||(ke={}));var it={};vt(it,{error:()=>iu,info:()=>nu,log:()=>ru,query:()=>ou,should:()=>zi,tags:()=>St,warn:()=>un});d();c();p();f();m();var St={error:nt("prisma:error"),warn:Si("prisma:warn"),info:ki("prisma:info"),query:Ii("prisma:query")},zi={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function ru(...e){console.log(...e)}function un(e,...t){zi.warn()&&console.warn(`${St.warn} ${e}`,...t)}function nu(e,...t){console.info(`${St.info} ${e}`,...t)}function iu(e,...t){console.error(`${St.error} ${e}`,...t)}function ou(e,...t){console.log(`${St.query} ${e}`,...t)}d();c();p();f();m();function je(e,t){throw new Error(t)}d();c();p();f();m();function ln(e,t){return Object.prototype.hasOwnProperty.call(e,t)}d();c();p();f();m();var cn=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});d();c();p();f();m();function ot(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}d();c();p();f();m();function pn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{to.has(e)||(to.add(e),un(t,...r))};d();c();p();f();m();var K=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};_(K,"PrismaClientKnownRequestError");var Pe=class extends K{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};_(Pe,"NotFoundError");d();c();p();f();m();var G=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};_(G,"PrismaClientInitializationError");d();c();p();f();m();var ve=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};_(ve,"PrismaClientRustPanicError");d();c();p();f();m();var oe=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};_(oe,"PrismaClientUnknownRequestError");d();c();p();f();m();var Y=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};_(Y,"PrismaClientValidationError");d();c();p();f();m();var st=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};d();c();p();f();m();d();c();p();f();m();function kt(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function no(e,t){let r=kt(()=>au(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function au(e){return{datamodel:{models:fn(e.models),enums:fn(e.enums),types:fn(e.types)}}}function fn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}d();c();p();f();m();var cr=Symbol(),mn=new WeakMap,Te=class{constructor(t){t===cr?mn.set(this,`Prisma.${this._getName()}`):mn.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return mn.get(this)}},Dt=class extends Te{_getNamespace(){return"NullTypes"}},Ot=class extends Dt{};dn(Ot,"DbNull");var Mt=class extends Dt{};dn(Mt,"JsonNull");var Nt=class extends Dt{};dn(Nt,"AnyNull");var pr={classes:{DbNull:Ot,JsonNull:Mt,AnyNull:Nt},instances:{DbNull:new Ot(cr),JsonNull:new Mt(cr),AnyNull:new Nt(cr)}};function dn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function _t(e){return{ok:!1,error:e,map(){return _t(e)},flatMap(){return _t(e)}}}var gn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},hn=e=>{let t=new gn,r=Je(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Je(t,e.queryRaw.bind(e)),executeRaw:Je(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>uu(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=lu(t,e.getConnectionInfo.bind(e))),n},uu=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Je(e,t.queryRaw.bind(t)),executeRaw:Je(e,t.executeRaw.bind(t)),commit:Je(e,t.commit.bind(t)),rollback:Je(e,t.rollback.bind(t))});function Je(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}function lu(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}var oa=Ue(io());var gD=Ue(oo());Hi();xi();Qi();d();c();p();f();m();var se=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){var n;return(n=e.getPropertyDescriptor)==null?void 0:n.call(e,r)}}}d();c();p();f();m();d();c();p();f();m();var fr={enumerable:!0,configurable:!0,writable:!0};function mr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>fr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var uo=Symbol.for("nodejs.util.inspect.custom");function ge(e,t){let r=pu(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){var u,l;if(n.has(s))return!0;let a=r.get(s);return a?(l=(u=a.has)==null?void 0:u.call(a,s))!=null?l:!0:Reflect.has(o,s)},ownKeys(o){let s=lo(Reflect.ownKeys(o),r),a=lo(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){var l,g;let u=r.get(s);return((g=(l=u==null?void 0:u.getPropertyDescriptor)==null?void 0:l.call(u,s))==null?void 0:g.writable)===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let u=r.get(s);return u?u.getPropertyDescriptor?{...fr,...u==null?void 0:u.getPropertyDescriptor(s)}:fr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[uo]=function(){let o={...this};return delete o[uo],o},i}function pu(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function lo(e,t){return e.filter(r=>{var i,o;let n=t.get(r);return(o=(i=n==null?void 0:n.has)==null?void 0:i.call(n,r))!=null?o:!0})}d();c();p();f();m();function at(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}d();c();p();f();m();function dr(e,t){return{batch:e,transaction:(t==null?void 0:t.kind)==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}d();c();p();f();m();d();c();p();f();m();var ut=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};d();c();p();f();m();d();c();p();f();m();function co(e){return e.substring(0,1).toLowerCase()+e.substring(1)}d();c();p();f();m();function lt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function gr(e){return e.toString()!=="Invalid Date"}d();c();p();f();m();d();c();p();f();m();var ct=9e15,Ne=1e9,En="0123456789abcdef",yr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",wr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",bn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ct,maxE:ct,crypto:!1},go,Ce,F=!0,br="[DecimalError] ",Me=br+"Invalid argument: ",ho=br+"Precision limit exceeded",yo=br+"crypto unavailable",wo="[object Decimal]",te=Math.floor,H=Math.pow,fu=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,mu=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,du=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Eo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,pe=1e7,N=7,gu=9007199254740991,hu=yr.length-1,xn=wr.length-1,R={toStringTag:wo};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)};R.ceil=function(){return k(new this.constructor(this),this.e+1,2)};R.clampedTo=R.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Me+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,u=o.s,l=e.s;if(!s||!a)return!u||!l?NaN:u!==l?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};R.cosine=R.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=yu(n,To(n,r)),n.precision=e,n.rounding=t,k(Ce==2||Ce==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};R.cubeRoot=R.cbrt=function(){var e,t,r,n,i,o,s,a,u,l,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(F=!1,o=g.s*H(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Z(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=H(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,u=a.times(a).times(a),l=u.plus(g),n=q(l.plus(g).times(a),l.plus(u),s+2,1),Z(a.d).slice(0,s)===(r=Z(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(k(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(k(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return F=!0,k(n,e,h.rounding,t)};R.decimalPlaces=R.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/N))*N,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};R.dividedBy=R.div=function(e){return q(this,new this.constructor(e))};R.dividedToIntegerBy=R.divToInt=function(e){var t=this,r=t.constructor;return k(q(t,new r(e),0,1,1),r.precision,r.rounding)};R.equals=R.eq=function(e){return this.cmp(e)===0};R.floor=function(){return k(new this.constructor(this),this.e+1,3)};R.greaterThan=R.gt=function(e){return this.cmp(e)>0};R.greaterThanOrEqualTo=R.gte=function(e){var t=this.cmp(e);return t==1||t===0};R.hyperbolicCosine=R.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Pr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=pt(s,1,o.times(t),new s(1),!0);for(var u,l=e,g=new s(8);l--;)u=o.times(o),o=a.minus(u.times(g.minus(u.times(g))));return k(o,s.precision=r,s.rounding=n,!0)};R.hyperbolicSine=R.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=pt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Pr(5,e)),i=pt(o,2,i,i,!0);for(var s,a=new o(5),u=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(l))))}return o.precision=t,o.rounding=r,k(i,t,r,!0)};R.hyperbolicTangent=R.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,q(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};R.inverseCosine=R.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ce(r,i,o):new r(0):new r(NaN):t.isZero()?ce(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ce(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};R.inverseHyperbolicCosine=R.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,F=!1,r=r.times(r).minus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};R.inverseHyperbolicSine=R.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,F=!1,r=r.times(r).plus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln())};R.inverseHyperbolicTangent=R.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?k(new o(i),e,t,!0):(o.precision=r=n-i.e,i=q(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};R.inverseSine=R.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ce(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};R.inverseTangent=R.atan=function(){var e,t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding;if(l.isFinite()){if(l.isZero())return new g(l);if(l.abs().eq(1)&&h+4<=xn)return s=ce(g,h+4,x).times(.25),s.s=l.s,s}else{if(!l.s)return new g(NaN);if(h+4<=xn)return s=ce(g,h+4,x).times(.5),s.s=l.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/N+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(F=!1,t=Math.ceil(a/N),n=1,u=l.times(l),s=new g(l),i=l;e!==-1;)if(i=i.times(u),o=s.minus(i.div(n+=2)),i=i.times(u),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};R.isNaN=function(){return!this.s};R.isNegative=R.isNeg=function(){return this.s<0};R.isPositive=R.isPos=function(){return this.s>0};R.isZero=function(){return!!this.d&&this.d[0]===0};R.lessThan=R.lt=function(e){return this.cmp(e)<0};R.lessThanOrEqualTo=R.lte=function(e){return this.cmp(e)<1};R.logarithm=R.log=function(e){var t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new g(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(F=!1,a=h+S,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),Lt(u.d,i=h,x))do if(a+=10,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),!o){+Z(u.d).slice(i+1,i+15)+1==1e14&&(u=k(u,h+1,0));break}while(Lt(u.d,i+=10,x));return F=!0,k(u,h,x)};R.minus=R.sub=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.constructor;if(e=new C(e),!S.d||!e.d)return!S.s||!e.s?e=new C(NaN):S.d?e.s=-e.s:e=new C(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(l=S.d,x=e.d,a=C.precision,u=C.rounding,!l[0]||!x[0]){if(x[0])e.s=-e.s;else if(l[0])e=new C(S);else return new C(u===3?-0:0);return F?k(e,a,u):e}if(r=te(e.e/N),g=te(S.e/N),l=l.slice(),o=g-r,o){for(h=o<0,h?(t=l,o=-o,s=x.length):(t=x,r=g,s=l.length),n=Math.max(Math.ceil(a/N),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=x.length,h=n0;--n)l[s++]=0;for(n=x.length;n>o;){if(l[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=g.length,s-i<0&&(i=s,r=g,g=l,l=r),t=0;i;)t=(l[--i]=l[i]+g[i]+t)/pe|0,l[i]%=pe;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=xr(l,n),F?k(e,a,u):e};R.precision=R.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Me+e);return r.d?(t=bo(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};R.round=function(){var e=this,t=e.constructor;return k(new t(e),e.e+1,t.rounding)};R.sine=R.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=Eu(n,To(n,r)),n.precision=e,n.rounding=t,k(Ce>2?r.neg():r,e,t,!0)):new n(NaN)};R.squareRoot=R.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,u=s.e,l=s.s,g=s.constructor;if(l!==1||!a||!a[0])return new g(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(F=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Z(a),(t.length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=te((u+1)/2)-(u<0||u%2),l==1/0?t="5e"+u:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),n=new g(t)):n=new g(l.toString()),r=(u=g.precision)+3;;)if(o=n,n=o.plus(q(s,o,r+2,1)).times(.5),Z(o.d).slice(0,r)===(t=Z(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(k(o,u+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(n,u+1,1),e=!n.times(n).eq(s));break}return F=!0,k(n,u,g.rounding,e)};R.tangent=R.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=q(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,k(Ce==2||Ce==4?r.neg():r,e,t,!0)):new n(NaN)};R.times=R.mul=function(e){var t,r,n,i,o,s,a,u,l,g=this,h=g.constructor,x=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!x||!x[0]||!S||!S[0])return new h(!e.s||x&&!x[0]&&!S||S&&!S[0]&&!x?NaN:!x||!S?e.s/0:e.s*0);for(r=te(g.e/N)+te(e.e/N),u=x.length,l=S.length,u=0;){for(t=0,i=u+n;i>n;)a=o[i]+S[n]*x[i-n-1]+t,o[i--]=a%pe|0,t=a/pe|0;o[i]=(o[i]+t)%pe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=xr(o,r),F?k(e,h.precision,h.rounding):e};R.toBinary=function(e,t){return Tn(this,2,e,t)};R.toDecimalPlaces=R.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ae(e,0,Ne),t===void 0?t=n.rounding:ae(t,0,8),k(r,e+r.e+1,t))};R.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,!0):(ae(e,0,Ne),t===void 0?t=i.rounding:ae(t,0,8),n=k(new i(n),e+1,t),r=he(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=he(i):(ae(e,0,Ne),t===void 0?t=o.rounding:ae(t,0,8),n=k(new o(i),e+i.e+1,t),r=he(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};R.toFraction=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.d,A=S.constructor;if(!C)return new A(S);if(l=r=new A(1),n=u=new A(0),t=new A(n),o=t.e=bo(C)-S.e-1,s=o%N,t.d[0]=H(10,s<0?N+s:s),e==null)e=o>0?t:l;else{if(a=new A(e),!a.isInt()||a.lt(l))throw Error(Me+a);e=a.gt(t)?o>0?t:l:a}for(F=!1,a=new A(Z(C)),g=A.precision,A.precision=o=C.length*N*2;h=q(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=u.plus(h.times(i)),u=i,i=t,t=a.minus(h.times(i)),a=i;return i=q(e.minus(r),n,0,1,1),u=u.plus(i.times(l)),r=r.plus(i.times(n)),u.s=l.s=S.s,x=q(l,n,o,1).minus(S).abs().cmp(q(u,r,o,1).minus(S).abs())<1?[l,n]:[u,r],A.precision=g,F=!0,x};R.toHexadecimal=R.toHex=function(e,t){return Tn(this,16,e,t)};R.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ae(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(F=!1,r=q(r,e,0,t,1).times(e),F=!0,k(r)):(e.s=r.s,r=e),r};R.toNumber=function(){return+this};R.toOctal=function(e,t){return Tn(this,8,e,t)};R.toPower=R.pow=function(e){var t,r,n,i,o,s,a=this,u=a.constructor,l=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(H(+a,l));if(a=new u(a),a.eq(1))return a;if(n=u.precision,o=u.rounding,e.eq(1))return k(a,n,o);if(t=te(e.e/N),t>=e.d.length-1&&(r=l<0?-l:l)<=gu)return i=xo(u,a,r,n),e.s<0?new u(1).div(i):k(i,n,o);if(s=a.s,s<0){if(tu.maxE+1||t0?s/0:0):(F=!1,u.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Pn(e.times(Oe(a,n+r)),n),i.d&&(i=k(i,n+5,1),Lt(i.d,n,o)&&(t=n+10,i=k(Pn(e.times(Oe(a,t+r)),t),t+5,1),+Z(i.d).slice(n+1,n+15)+1==1e14&&(i=k(i,n+1,0)))),i.s=s,F=!0,u.rounding=o,k(i,n,o))};R.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ae(e,1,Ne),t===void 0?t=i.rounding:ae(t,0,8),n=k(new i(n),e,t),r=he(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toSignificantDigits=R.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ae(e,1,Ne),t===void 0?t=n.rounding:ae(t,0,8)),k(new n(r),e,t)};R.toString=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};R.truncated=R.trunc=function(){return k(new this.constructor(this),this.e+1,1)};R.valueOf=R.toJSON=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Z(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Me+e)}function Lt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=N,i=0):(i=Math.ceil((t+1)/N),t%=N),o=H(10,N-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,s}function hr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function yu(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Pr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=pt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var q=function(){function e(n,i,o){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*i+a,n[u]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;ai[a]?1:-1;break}return u}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,u){var l,g,h,x,S,C,A,D,O,B,M,I,X,L,Ye,Be,fe,$e,Q,Re,qe=n.constructor,Ze=n.s==i.s?1:-1,ee=n.d,U=i.d;if(!ee||!ee[0]||!U||!U[0])return new qe(!n.s||!i.s||(ee?U&&ee[0]==U[0]:!U)?NaN:ee&&ee[0]==0||!U?Ze*0:Ze/0);for(u?(S=1,g=n.e-i.e):(u=pe,S=N,g=te(n.e/S)-te(i.e/S)),Q=U.length,fe=ee.length,O=new qe(Ze),B=O.d=[],h=0;U[h]==(ee[h]||0);h++);if(U[h]>(ee[h]||0)&&g--,o==null?(L=o=qe.precision,s=qe.rounding):a?L=o+(n.e-i.e)+1:L=o,L<0)B.push(1),C=!0;else{if(L=L/S+2|0,h=0,Q==1){for(x=0,U=U[0],L++;(h1&&(U=e(U,x,u),ee=e(ee,x,u),Q=U.length,fe=ee.length),Be=Q,M=ee.slice(0,Q),I=M.length;I=u/2&&++$e;do x=0,l=t(U,M,Q,I),l<0?(X=M[0],Q!=I&&(X=X*u+(M[1]||0)),x=X/$e|0,x>1?(x>=u&&(x=u-1),A=e(U,x,u),D=A.length,I=M.length,l=t(A,M,D,I),l==1&&(x--,r(A,Q=10;x/=10)h++;O.e=h+g*S-1,k(O,a?o+O.e+1:o,s,C)}return O}}();function k(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=N,s=t,g=h[x=0],u=g/H(10,i-s-1)%10|0;else if(x=Math.ceil((o+1)/N),a=h.length,x>=a)if(n){for(;a++<=x;)h.push(0);g=u=0,i=1,o%=N,s=o-N+1}else break e;else{for(g=a=h[x],i=1;a>=10;a/=10)i++;o%=N,s=o-N+i,u=s<0?0:g/H(10,i-s-1)%10|0}if(n=n||t<0||h[x+1]!==void 0||(s<0?g:g%H(10,i-s-1)),l=r<4?(u||n)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(o>0?s>0?g/H(10,i-s):0:h[x-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,l?(t-=e.e+1,h[0]=H(10,(N-t%N)%N),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=x,a=1,x--):(h.length=x+1,a=H(10,N-o),h[x]=s>0?(g/H(10,i-s)%H(10,s)|0)*a:0),l)for(;;)if(x==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==pe&&(h[0]=1));break}else{if(h[x]+=a,h[x]!=pe)break;h[x--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return F&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+De(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+De(-i-1)+o,r&&(n=r-s)>0&&(o+=De(n))):i>=s?(o+=De(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+De(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=De(n))),o}function xr(e,t){var r=e[0];for(t*=N;r>=10;r/=10)t++;return t}function Er(e,t,r){if(t>hu)throw F=!0,r&&(e.precision=r),Error(ho);return k(new e(yr),t,1,!0)}function ce(e,t,r){if(t>xn)throw Error(ho);return k(new e(wr),t,r,!0)}function bo(e){var t=e.length-1,r=t*N+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function De(e){for(var t="";e--;)t+="0";return t}function xo(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/N+4);for(F=!1;;){if(r%2&&(o=o.times(t),fo(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),fo(t.d,s)}return F=!0,o}function po(e){return e.d[e.d.length-1]&1}function Po(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new x(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(F=!1,u=C):u=t,a=new x(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(H(2,h))/Math.LN10*2+5|0,u+=n,r=o=s=new x(1),x.precision=u;;){if(o=k(o.times(e),u,1),r=r.times(++g),a=s.plus(q(o,r,u,1)),Z(a.d).slice(0,u)===Z(s.d).slice(0,u)){for(i=h;i--;)s=k(s.times(s),u,1);if(t==null)if(l<3&&Lt(s.d,u-n,S,l))x.precision=u+=10,r=o=a=new x(1),g=0,l++;else return k(s,x.precision=C,S,F=!0);else return x.precision=C,s}s=a}}function Oe(e,t){var r,n,i,o,s,a,u,l,g,h,x,S=1,C=10,A=e,D=A.d,O=A.constructor,B=O.rounding,M=O.precision;if(A.s<0||!D||!D[0]||!A.e&&D[0]==1&&D.length==1)return new O(D&&!D[0]?-1/0:A.s!=1?NaN:D?0:A);if(t==null?(F=!1,g=M):g=t,O.precision=g+=C,r=Z(D),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Z(A.d),n=r.charAt(0),S++;o=A.e,n>1?(A=new O("0."+r),o++):A=new O(n+"."+r.slice(1))}else return l=Er(O,g+2,M).times(o+""),A=Oe(new O(n+"."+r.slice(1)),g-C).plus(l),O.precision=M,t==null?k(A,M,B,F=!0):A;for(h=A,u=s=A=q(A.minus(1),A.plus(1),g,1),x=k(A.times(A),g,1),i=3;;){if(s=k(s.times(x),g,1),l=u.plus(q(s,new O(i),g,1)),Z(l.d).slice(0,g)===Z(u.d).slice(0,g))if(u=u.times(2),o!==0&&(u=u.plus(Er(O,g+2,M).times(o+""))),u=q(u,new O(S),g,1),t==null)if(Lt(u.d,g-C,B,a))O.precision=g+=C,l=s=A=q(h.minus(1),h.plus(1),g,1),x=k(A.times(A),g,1),i=a=1;else return k(u,O.precision=M,B,F=!0);else return O.precision=M,u;u=l,i+=2}}function vo(e){return String(e.s*e.s/0)}function vn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%N,r<0&&(n+=N),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Eo.test(t))return vn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(mu.test(t))r=16,t=t.toLowerCase();else if(fu.test(t))r=2;else if(du.test(t))r=8;else throw Error(Me+t);for(o=t.search(/p/i),o>0?(u=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=xo(n,new n(r),o,o*2)),l=hr(t,r,pe),g=l.length-1,o=g;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=xr(l,g),e.d=l,F=!1,s&&(e=q(e,i,a*4)),u&&(e=e.times(Math.abs(u)<54?H(2,u):Ge.pow(2,u))),F=!0,e)}function Eu(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:pt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Pr(5,r)),t=pt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function pt(e,t,r,n,i){var o,s,a,u,l=1,g=e.precision,h=Math.ceil(g/N);for(F=!1,u=r.times(r),a=new e(n);;){if(s=q(a.times(u),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=q(s.times(u),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,l++}return F=!0,s.d.length=h+1,s}function Pr(e,t){for(var r=e;--t;)r*=e;return r}function To(e,t){var r,n=t.s<0,i=ce(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Ce=n?4:1,t;if(r=t.divToInt(i),r.isZero())Ce=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Ce=po(r)?n?2:3:n?4:1,t;Ce=po(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Tn(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor,C=r!==void 0;if(C?(ae(r,1,Ne),n===void 0?n=S.rounding:ae(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=vo(e);else{for(g=he(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),x=new S(1),x.e=g.length-s,x.d=hr(he(x),10,i),x.e=x.d.length),h=hr(g,10,i),o=u=h.length;h[--u]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=q(e,x,r,n,0,i),h=e.d,o=e.e,l=go),s=h[r],a=i/2,l=l||h[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,l)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(u=h.length;!h[u-1];--u);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)g+="0";for(h=hr(g,i,t),u=h.length;!h[u-1];--u);for(s=1,g="1.";su)for(o-=u;o--;)g+="0";else ot)return e.length=t,!0}function bu(e){return new this(e).abs()}function xu(e){return new this(e).acos()}function Pu(e){return new this(e).acosh()}function vu(e,t){return new this(e).plus(t)}function Tu(e){return new this(e).asin()}function Cu(e){return new this(e).asinh()}function Au(e){return new this(e).atan()}function Ru(e){return new this(e).atanh()}function Su(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ce(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ce(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ce(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(q(e,t,o,1)),t=ce(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(q(e,t,o,1)),r}function Iu(e){return new this(e).cbrt()}function ku(e){return k(e=new this(e),e.e+1,2)}function Du(e,t,r){return new this(e).clamp(t,r)}function Ou(e){if(!e||typeof e!="object")throw Error(br+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ne,"rounding",0,8,"toExpNeg",-ct,0,"toExpPos",0,ct,"maxE",0,ct,"minE",-ct,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Me+r+": "+n);if(r="crypto",i&&(this[r]=bn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(yo);else this[r]=!1;else throw Error(Me+r+": "+n);return this}function Mu(e){return new this(e).cos()}function Nu(e){return new this(e).cosh()}function Co(e){var t,r,n;function i(o){var s,a,u,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,mo(o)){l.s=o.s,F?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e=10;a/=10)s++;F?s>i.maxE?(l.e=NaN,l.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(yo);else for(;o=10;i/=10)n++;n`}};function mt(e){return e instanceof Bt}d();c();p();f();m();d();c();p();f();m();var vr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};d();c();p();f();m();var Tr=e=>e,Cr={bold:Tr,red:Tr,green:Tr,dim:Tr,enabled:!1},Ao={bold:sr,red:nt,green:Ri,dim:ar,enabled:!0},dt={write(e){e.writeLine(",")}};d();c();p();f();m();var we=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};d();c();p();f();m();var _e=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var gt=class extends _e{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new vr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new we("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(dt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};d();c();p();f();m();var Ro=": ",Ar=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Ro.length}write(t){let r=new we(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Ro).write(this.value)}};d();c();p();f();m();var Rr=class e extends _e{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let u;if(s.value instanceof e?u=s.value.getField(a):s.value instanceof gt&&(u=s.value.getField(Number(a))),!u)return;s=u}return s}getDeepFieldValue(r){var n;return r.length===0?this:(n=this.getDeepField(r))==null?void 0:n.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){var n;return(n=this.getField(r))==null?void 0:n.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){var i,o;let r=(i=this.getField("select"))==null?void 0:i.value.asObject();if(r)return{kind:"select",value:r};let n=(o=this.getField("include"))==null?void 0:o.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){var n;return(n=this.getSelectionParent())==null?void 0:n.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new we("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(dt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};d();c();p();f();m();var z=class extends _e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new we(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var Cn=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Sr(e){return new Cn(So(e))}function So(e){let t=new Rr;for(let[r,n]of Object.entries(e)){let i=new Ar(r,Io(n));t.addField(i)}return t}function Io(e){if(typeof e=="string")return new z(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new z(String(e));if(typeof e=="bigint")return new z(`${e}n`);if(e===null)return new z("null");if(e===void 0)return new z("undefined");if(ft(e))return new z(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new z(`Buffer.alloc(${e.byteLength})`):new z(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=gr(e)?e.toISOString():"Invalid Date";return new z(`new Date("${t}")`)}return e instanceof Te?new z(`Prisma.${e._getName()}`):mt(e)?new z(`prisma.${co(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?sl(e):typeof e=="object"?So(e):new z(Object.prototype.toString.call(e))}function sl(e){let t=new gt;for(let r of e)t.addItem(Io(r));return t}function ko(e){if(e===void 0)return"";let t=Sr(e);return new ut(0,{colors:Cr}).write(t).toString()}d();c();p();f();m();var al="P2037";function $t({error:e,user_facing_error:t},r,n){return t.error_code?new K(ul(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new oe(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function ul(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===al&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var An=class{getLocation(){return null}};function Fe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new An}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Do={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function ht(e={}){let t=cl(e);return Object.entries(t).reduce((n,[i,o])=>(Do[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function cl(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Ir(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Oo(e,t){let r=Ir(e);return t({action:"aggregate",unpacker:r,argsMapper:ht})(e)}d();c();p();f();m();function pl(e={}){let{select:t,...r}=e;return typeof t=="object"?ht({...r,_count:t}):ht({...r,_count:{_all:!0}})}function fl(e={}){return typeof e.select=="object"?t=>Ir(e)(t)._count:t=>Ir(e)(t)._count._all}function Mo(e,t){return t({action:"count",unpacker:fl(e),argsMapper:pl})(e)}d();c();p();f();m();function ml(e={}){let t=ht(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function dl(e={}){return t=>(typeof(e==null?void 0:e._count)=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function No(e,t){return t({action:"groupBy",unpacker:dl(e),argsMapper:ml})(e)}function _o(e,t,r){if(t==="aggregate")return n=>Oo(n,r);if(t==="count")return n=>Mo(n,r);if(t==="groupBy")return n=>No(n,r)}d();c();p();f();m();function Fo(e,t){let r=t.fields.filter(i=>!i.relationName),n=cn(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Bt(e,o,s.type,s.isList,s.kind==="enum")},...mr(Object.keys(n))})}d();c();p();f();m();d();c();p();f();m();var Lo=e=>Array.isArray(e)?e:e.split("."),Rn=(e,t)=>Lo(t).reduce((r,n)=>r&&r[n],e),Bo=(e,t,r)=>Lo(t).reduceRight((n,i,o,s)=>Object.assign({},Rn(e,s.slice(0,o)),{[i]:n}),r);function gl(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function hl(e,t,r){return t===void 0?e!=null?e:{}:Bo(t,r,e||!0)}function Sn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((u,l)=>({...u,[l.name]:l}),{});return u=>{let l=Fe(e._errorFormat),g=gl(n,i),h=hl(u,o,g),x=r({dataPath:g,callsite:l})(h),S=yl(e,t);return new Proxy(x,{get(C,A){if(!S.includes(A))return C[A];let O=[a[A].type,r,A],B=[g,h];return Sn(e,...O,...B)},...mr([...S,...Object.getOwnPropertyNames(x)])})}}function yl(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}d();c();p();f();m();d();c();p();f();m();var wl=Ue(Ki());var El={red:nt,gray:Di,dim:ar,bold:sr,underline:Ai,highlightSource:e=>e.highlight()},bl={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function xl({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r!=null?r:!1,callArguments:n}}function Pl({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],u=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${u}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${u}`)),t&&a.push(s.underline(vl(t))),i){a.push("");let l=[i.toString()];o&&(l.push(o),l.push(s.dim(")"))),a.push(l.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function vl(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function yt(e){let t=e.showColors?El:bl,r;return typeof $getTemplateParameters!="undefined"?r=$getTemplateParameters(e,t):r=xl(e),Pl(r,t)}function $o(e,t,r,n){return e===ke.ModelAction.findFirstOrThrow||e===ke.ModelAction.findUniqueOrThrow?Tl(t,r,n):n}function Tl(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=yt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new Y(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof K&&o.code==="P2025"?new Pe(`No ${e} found`,t):o})}}d();c();p();f();m();function Ee(e){return e.replace(/^./,t=>t.toLowerCase())}var Cl=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Al=["aggregate","count","groupBy"];function In(e,t){var i;let r=(i=e._extensions.getAllModelExtensions(t))!=null?i:{},n=[Rl(e,t),Il(e,t),Ft(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return ge({},n)}function Rl(e,t){let r=Ee(t),n=Object.keys(ke.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=u=>e._request(u);s=$o(o,t,e._clientVersion,s);let a=u=>l=>{let g=Fe(e._errorFormat);return e._createPrismaPromise(h=>{let x={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...x,...u})})};return Cl.includes(o)?Sn(e,t,a):Sl(i)?_o(e,i,a):a({})}}}function Sl(e){return Al.includes(e)}function Il(e,t){return Qe(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return Fo(t,r)}))}d();c();p();f();m();function qo(e){return e.replace(/^./,t=>t.toUpperCase())}var kn=Symbol();function qt(e){let t=[kl(e),ne(kn,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Ft(r)),ge(e,t)}function kl(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Ee),n=[...new Set(t.concat(r))];return Qe({getKeys(){return n},getPropertyValue(i){let o=qo(i);if(e._runtimeDataModel.models[o]!==void 0)return In(e,o);if(e._runtimeDataModel.models[i]!==void 0)return In(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Uo(e){return e[kn]?e[kn]:e}function Vo(e){var r;if(typeof e=="function")return e(this);if((r=e.client)!=null&&r.__AccelerateEngine){let n=e.client.__AccelerateEngine;this._originalClient._engine=new n(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return qt(t)}d();c();p();f();m();d();c();p();f();m();function jo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let u of Object.values(o)){if(n){if(n[u.name])continue;let l=u.needs.filter(g=>n[g]);l.length>0&&a.push(at(l))}else if(r){if(!r[u.name])continue;let l=u.needs.filter(g=>!r[g]);l.length>0&&a.push(at(l))}Dl(e,u.needs)&&s.push(Ol(u,ge(e,s)))}return s.length>0||a.length>0?ge(e,[...s,...a]):e}function Dl(e,t){return t.every(r=>ln(e,r))}function Ol(e,t){return Qe(ne(e.name,()=>e.compute(t)))}d();c();p();f();m();function kr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){var s;if(Array.isArray(t)){for(let a=0;ag.name===o);if(!u||u.kind!=="object"||!u.relationName)continue;let l=typeof s=="object"?s:{};t[o]=kr({visitor:i,result:t[o],args:l,modelName:u.type,runtimeDataModel:n})}}function Qo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:kr({result:e,args:r!=null?r:{},modelName:t,runtimeDataModel:i,visitor:(s,a,u)=>jo({result:s,modelName:Ee(a),select:u.select,omit:u.omit,extensions:n})})}d();c();p();f();m();d();c();p();f();m();function Go(e){if(e instanceof se)return Ml(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{var s,a;let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(((s=t.transaction)==null?void 0:s.kind)==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Go((a=t.args)!=null?a:{}),__internalParams:t,query:(u,l=t)=>{let g=l.customDataProxyFetch;return l.customDataProxyFetch=Zo(o,g),l.args=u,Wo(e,l,r,n+1)}})})}function Ko(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r!=null?r:"$none",o);return Wo(e,t,s)}function zo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Yo(r,n,0,e):e(r)}}function Yo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let u=a.customDataProxyFetch;return a.customDataProxyFetch=Zo(i,u),Yo(a,t,r+1,n)}})}var Ho=e=>e;function Zo(e=Ho,t=Ho){return r=>e(t(r))}d();c();p();f();m();d();c();p();f();m();function es(e,t,r){let n=Ee(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Nl({...e,...Xo(t.name,e,t.result.$allModels),...Xo(t.name,e,t.result[n])})}function Nl(e){let t=new de,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return ot(e,n=>({...n,needs:r(n.name,new Set)}))}function Xo(e,t,r){return r?ot(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:_l(t,o,i)})):{}}function _l(e,t,r){var i;let n=(i=e==null?void 0:e[t])==null?void 0:i.compute;return n?o=>r({...o,[t]:n(o)}):r}function ts(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function rs(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Dr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new de;this.modelExtensionsCache=new de;this.queryCallbacksCache=new de;this.clientExtensions=kt(()=>{var t,r;return this.extension.client?{...(r=this.previous)==null?void 0:r.getAllClientExtensions(),...this.extension.client}:(t=this.previous)==null?void 0:t.getAllClientExtensions()});this.batchCallbacks=kt(()=>{var n,i,o;let t=(i=(n=this.previous)==null?void 0:n.getAllBatchQueryCallbacks())!=null?i:[],r=(o=this.extension.query)==null?void 0:o.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>{var r;return es((r=this.previous)==null?void 0:r.getAllComputedFields(t),this.extension,t)})}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{var n,i;let r=Ee(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?(n=this.previous)==null?void 0:n.getAllModelExtensions(t):{...(i=this.previous)==null?void 0:i.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{var s,a;let n=(a=(s=this.previous)==null?void 0:s.getAllQueryCallbacks(t,r))!=null?a:[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Or=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Dr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Dr(t,this.head))}getAllComputedFields(t){var r;return(r=this.head)==null?void 0:r.getAllComputedFields(t)}getAllClientExtensions(){var t;return(t=this.head)==null?void 0:t.getAllClientExtensions()}getAllModelExtensions(t){var r;return(r=this.head)==null?void 0:r.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){var n,i;return(i=(n=this.head)==null?void 0:n.getAllQueryCallbacks(t,r))!=null?i:[]}getAllBatchQueryCallbacks(){var t,r;return(r=(t=this.head)==null?void 0:t.getAllBatchQueryCallbacks())!=null?r:[]}};d();c();p();f();m();var ns=re("prisma:client"),is={Vercel:"vercel","Netlify CI":"netlify"};function os({postinstall:e,ciName:t,clientVersion:r}){if(ns("checkPlatformCaching:postinstall",e),ns("checkPlatformCaching:ciName",t),e===!0&&t&&t in is){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${is[t]}-build`;throw console.error(n),new G(n,r)}}d();c();p();f();m();function ss(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Fl="Cloudflare-Workers",Ll="node";function as(){var e,t,r;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Fl?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((r=(t=globalThis.process)==null?void 0:t.release)==null?void 0:r.name)===Ll?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var Bl={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Mr(){let e=as();return{id:e,prettyName:Bl[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function wt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){var u,l;let i,o=Object.keys(e)[0],s=(u=e[o])==null?void 0:u.url,a=(l=t[o])==null?void 0:l.url;if(o===void 0?i=void 0:a?i=a:s!=null&&s.value?i=s.value:s!=null&&s.fromEnvVar&&(i=r[s.fromEnvVar]),(s==null?void 0:s.fromEnvVar)!==void 0&&i===void 0)throw Mr().id==="workerd"?new G(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new G(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new G("error: Missing URL environment variable, value, or override.",n);return i}d();c();p();f();m();d();c();p();f();m();var Nr=class extends Error{constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var ue=class extends Nr{constructor(t,r){var n;super(t,r),this.isRetryable=(n=r.isRetryable)!=null?n:!0}};d();c();p();f();m();d();c();p();f();m();function $(e,t){return{...e,isRetryable:t}}var Et=class extends ue{constructor(r){super("This request must be retried",$(r,!0));this.name="ForcedRetryError";this.code="P5001"}};_(Et,"ForcedRetryError");d();c();p();f();m();var He=class extends ue{constructor(r,n){super(r,$(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};_(He,"InvalidDatasourceError");d();c();p();f();m();var We=class extends ue{constructor(r,n){super(r,$(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};_(We,"NotImplementedYetError");d();c();p();f();m();d();c();p();f();m();var j=class extends ue{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 Ke=class extends j{constructor(r){super("Schema needs to be uploaded",$(r,!0));this.name="SchemaMissingError";this.code="P5005"}};_(Ke,"SchemaMissingError");d();c();p();f();m();d();c();p();f();m();var Dn="This request could not be understood by the server",Vt=class extends j{constructor(r,n,i){super(n||Dn,$(r,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};_(Vt,"BadRequestError");d();c();p();f();m();var jt=class extends j{constructor(r,n){super("Engine not started: healthcheck timeout",$(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};_(jt,"HealthcheckTimeoutError");d();c();p();f();m();var Jt=class extends j{constructor(r,n,i){super(n,$(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};_(Jt,"EngineStartupError");d();c();p();f();m();var Qt=class extends j{constructor(r){super("Engine version is not supported",$(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};_(Qt,"EngineVersionNotSupportedError");d();c();p();f();m();var On="Request timed out",Gt=class extends j{constructor(r,n=On){super(n,$(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};_(Gt,"GatewayTimeoutError");d();c();p();f();m();var $l="Interactive transaction error",Ht=class extends j{constructor(r,n=$l){super(n,$(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};_(Ht,"InteractiveTransactionError");d();c();p();f();m();var ql="Request parameters are invalid",Wt=class extends j{constructor(r,n=ql){super(n,$(r,!1));this.name="InvalidRequestError";this.code="P5011"}};_(Wt,"InvalidRequestError");d();c();p();f();m();var Mn="Requested resource does not exist",Kt=class extends j{constructor(r,n=Mn){super(n,$(r,!1));this.name="NotFoundError";this.code="P5003"}};_(Kt,"NotFoundError");d();c();p();f();m();var Nn="Unknown server error",bt=class extends j{constructor(r,n,i){super(n||Nn,$(r,!0));this.name="ServerError";this.code="P5006";this.logs=i}};_(bt,"ServerError");d();c();p();f();m();var _n="Unauthorized, check your connection string",zt=class extends j{constructor(r,n=_n){super(n,$(r,!1));this.name="UnauthorizedError";this.code="P5007"}};_(zt,"UnauthorizedError");d();c();p();f();m();var Fn="Usage exceeded, retry again later",Yt=class extends j{constructor(r,n=Fn){super(n,$(r,!0));this.name="UsageExceededError";this.code="P5008"}};_(Yt,"UsageExceededError");async function Ul(e){let t;try{t=await e.text()}catch(r){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(r){return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Zt(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Ul(e);if(n.type==="QueryEngineError")throw new K(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new bt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Ke(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Qt(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Jt(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new G(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new jt(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 Ht(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Wt(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new zt(r,xt(_n,n));if(e.status===404)return new Kt(r,xt(Mn,n));if(e.status===429)throw new Yt(r,xt(Fn,n));if(e.status===504)throw new Gt(r,xt(On,n));if(e.status>=500)throw new bt(r,xt(Nn,n));if(e.status>=400)throw new Vt(r,xt(Dn,n))}function xt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}d();c();p();f();m();function us(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))}d();c();p();f();m();var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function ls(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,u,l,g;for(let h=0;h>18,a=(g&258048)>>12,u=(g&4032)>>6,l=g&63,r+=Ae[s]+Ae[a]+Ae[u]+Ae[l];return i==1?(g=t[o],s=(g&252)>>2,a=(g&3)<<4,r+=Ae[s]+Ae[a]+"=="):i==2&&(g=t[o]<<8|t[o+1],s=(g&64512)>>10,a=(g&1008)>>4,u=(g&15)<<2,r+=Ae[s]+Ae[a]+Ae[u]+"="),r}d();c();p();f();m();function cs(e){var r;if(!!((r=e.generator)!=null&&r.previewFeatures.some(n=>n.toLowerCase().includes("metrics"))))throw new G("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)}d();c();p();f();m();function Vl(e){return e[0]*1e3+e[1]/1e6}function ps(e){return new Date(Vl(e))}d();c();p();f();m();var fs={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};d();c();p();f();m();d();c();p();f();m();var Xt=class extends ue{constructor(r,n){super(`Cannot fetch data from service: -${r}`,$(n,!0));this.name="RequestError";this.code="P5010"}};_(Xt,"RequestError");async function ze(e,t,r=n=>n){var i;let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(Ln)(e,t)}catch(o){let s=(i=o.message)!=null?i:"Unknown error";throw new Xt(s,{clientVersion:n})}}function Jl(e){return{...e.headers,"Content-Type":"application/json"}}function Ql(e){return{method:e.method,headers:Jl(e)}}function Gl(e,t){return{text:()=>Promise.resolve(w.Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(w.Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new Bn(t.headers)}}async function Ln(e,t={}){let r=Hl("https"),n=Ql(t),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{var l;let u=r.request(e,n,g=>{let{statusCode:h,headers:{location:x}}=g;h>=301&&h<=399&&x&&(x.startsWith("http")===!1?s(Ln(`${o}${x}`,t)):s(Ln(x,t))),g.on("data",S=>i.push(S)),g.on("end",()=>s(Gl(i,g))),g.on("error",a)});u.on("error",a),u.end((l=t.body)!=null?l:"")})}var Hl=typeof require!="undefined"?require:()=>{},Bn=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let i of n)this.headers.set(r,i)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){var r;return(r=this.headers.get(t))!=null?r:null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,i]of this.headers)t.call(r,i,n,this)}};var Wl=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,ms=re("prisma:client:dataproxyEngine");async function Kl(e,t){var s,a,u;let r=fs["@prisma/engines-version"],n=(s=t.clientVersion)!=null?s:"unknown";if(y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=(a=n==null?void 0:n.split("-"))!=null?a:[];if(o===void 0&&Wl.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[l]=(u=r.split("-"))!=null?u:[],[g,h,x]=l.split("."),S=zl(`<=${g}.${h}.${x}`),C=await ze(S,{clientVersion:n});if(!C.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${C.status} ${C.statusText}, response body: ${await C.text()||""}`);let A=await C.text();ms("length of body fetched from unpkg.com",A.length);let D;try{D=JSON.parse(A)}catch(O){throw console.error("JSON.parse error: body fetched from unpkg.com: ",A),O}return D.version}throw new We("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function ds(e,t){let r=await Kl(e,t);return ms("version",r),r}function zl(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var gs=3,$n=re("prisma:client:dataproxyEngine"),qn=class{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!=null?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}},er=class{constructor(t){this.name="DataProxyEngine";cs(t),this.config=t,this.env={...t.env,...typeof y!="undefined"?y.env:{}},this.inlineSchema=ls(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[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new qn({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await ds(t,this.config),$n("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){var r,n;(r=t==null?void 0:t.logs)!=null&&r.length&&t.logs.forEach(i=>{switch(i.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let o=typeof i.attributes.query=="string"?i.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[s]=o.split("/* traceparent");o=s}this.logEmitter.emit("query",{query:o,timestamp:ps(i.timestamp),duration:Number(i.attributes.duration_ms),params:i.attributes.params,target:i.attributes.target})}}}),(n=t==null?void 0:t.traces)!=null&&n.length&&this.tracingHelper.createEngineSpan({span:!0,spans:t.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await ze(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||$n("schema response status",r.status);let n=await Zt(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==null?void 0:n.kind)==="itx"?n.options:void 0,s=dr(t,n),{batchResult:a,elapsed:u}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r});return a.map(l=>"errors"in l&&l.errors.length>0?$t(l.errors[0],this.clientVersion,this.config.activeProvider):{data:l,elapsed:u})}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 ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||$n("graphql response status",a.status),await this.handleError(await Zt(a,this.clientVersion));let u=await a.json(),l=u.extensions;if(l&&this.propagateResponseExtensions(l),u.errors)throw u.errors.length===1?$t(u.errors[0],this.config.clientVersion,this.config.activeProvider):new oe(u.errors,{clientVersion:this.config.clientVersion});return u}})}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 u=await ze(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Zt(u,this.clientVersion));let l=await u.json(),g=l.extensions;g&&this.propagateResponseExtensions(g);let h=l.id,x=l["data-proxy"].endpoint;return{id:h,payload:{endpoint:x}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Zt(a,this.clientVersion));let l=(await a.json()).extensions;l&&this.propagateResponseExtensions(l);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=wt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch(l){throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:")throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let u=a.get("api_key");if(u===null||u.length<1)throw new He(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,u]}metrics(){throw new We("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){var r;for(let n=0;;n++){let i=o=>{this.logEmitter.emit("info",{message:`Calling ${o} (n=${n})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:i})}catch(o){if(!(o instanceof ue)||!o.isRetryable)throw o;if(n>=gs)throw o instanceof Et?o.cause:o;this.logEmitter.emit("warn",{message:`Attempt ${n+1}/${gs} failed for ${t.actionGerund}: ${(r=o.message)!=null?r:"(unknown)"}`,timestamp:new Date,target:""});let s=await us(n);this.logEmitter.emit("warn",{message:`Retrying after ${s}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof Ke)throw await this.uploadSchema(),new Et({clientVersion:this.clientVersion,cause:t});if(t)throw t}applyPendingMigrations(){throw new Error("Method not implemented.")}};function hs({copyEngine:e=!0},t){let r;try{r=wt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch(u){}e&&(r!=null&&r.startsWith("prisma://"))&&It("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Rt(t.generator),i=!!(r!=null&&r.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o){let u;throw u=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new Y(u.join(` -`),{clientVersion:t.clientVersion})}if(i)return new er(t);throw new Y("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}d();c();p();f();m();function _r({generator:e}){var t;return(t=e==null?void 0:e.previewFeatures)!=null?t:[]}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Ps=Ue(Un());d();c();p();f();m();function bs(e,t){let r=xs(e),n=Yl(r),i=Xl(n);i?Fr(i,t):t.addErrorMessage(()=>"Unknown error")}function xs(e){return e.errors.flatMap(t=>t.kind==="Union"?xs(t):[t])}function Yl(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:Zl(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Zl(e,t){return[...new Set(e.concat(t))]}function Xl(e){return pn(e,(t,r)=>{let n=ws(t),i=ws(r);return n!==i?n-i:Es(t)-Es(r)})}function ws(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Es(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}d();c();p();f();m();var le=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};d();c();p();f();m();var Lr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(dt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Fr(e,t){switch(e.kind){case"MutuallyExclusiveFields":ec(e,t);break;case"IncludeOnScalar":tc(e,t);break;case"EmptySelection":rc(e,t);break;case"UnknownSelectionField":oc(e,t);break;case"UnknownArgument":sc(e,t);break;case"UnknownInputField":ac(e,t);break;case"RequiredArgumentMissing":uc(e,t);break;case"InvalidArgumentType":lc(e,t);break;case"InvalidArgumentValue":cc(e,t);break;case"ValueTooLarge":pc(e,t);break;case"SomeFieldsMissing":fc(e,t);break;case"TooManyFieldsGiven":mc(e,t);break;case"Union":bs(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function ec(e,t){var n,i,o;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();r&&((i=r.getField(e.firstField))==null||i.markAsError(),(o=r.getField(e.secondField))==null||o.markAsError()),t.addErrorMessage(s=>`Please ${s.bold("either")} use ${s.green(`\`${e.firstField}\``)} or ${s.green(`\`${e.secondField}\``)}, but ${s.red("not both")} at the same time.`)}function tc(e,t){var s,a;let[r,n]=Br(e.selectionPath),i=e.outputType,o=(s=t.arguments.getDeepSelectionParent(r))==null?void 0:s.value;if(o&&((a=o.getField(n))==null||a.markAsError(),i))for(let u of i.fields)u.isRelation&&o.addSuggestion(new le(u.name,"true"));t.addErrorMessage(u=>{let l=`Invalid scalar field ${u.red(`\`${n}\``)} for ${u.bold("include")} statement`;return i?l+=` on model ${u.bold(i.name)}. ${tr(u)}`:l+=".",l+=` -Note that ${u.bold("include")} statements only accept relation fields.`,l})}function rc(e,t){var n,i;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();if(r){let o=(i=r.getField("omit"))==null?void 0:i.value.asObject();if(o){nc(e,t,o);return}}ic(e,t)}function nc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new le(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function ic(e,t){var o,s;let r=e.outputType,n=(o=t.arguments.getDeepSelectionParent(e.selectionPath))==null?void 0:o.value,i=(s=n==null?void 0:n.isEmpty())!=null?s:!1;n&&(n.removeAllFields(),Cs(n,r)),t.addErrorMessage(a=>i?`The ${a.red("`select`")} statement for type ${a.bold(r.name)} must not be empty. ${tr(a)}`:`The ${a.red("`select`")} statement for type ${a.bold(r.name)} needs ${a.bold("at least one truthy value")}.`)}function oc(e,t){var s,a,u,l,g,h,x;let[r,n]=Br(e.selectionPath),i=(s=t.arguments.getDeepSubSelectionValue(r))==null?void 0:s.asObject(),o;if(i){let S=(a=i.getFieldValue("select"))==null?void 0:a.asObject(),C=(u=i.getFieldValue("include"))==null?void 0:u.asObject(),A=(l=i.getFieldValue("omit"))==null?void 0:l.asObject();S!=null&&S.hasField(n)?(o="select",(g=S.getField(n))==null||g.markAsError(),Cs(S,e.outputType)):C!=null&&C.hasField(n)?(o="include",(h=C.getField(n))==null||h.markAsError(),dc(C,e.outputType)):A!=null&&A.hasField(n)&&(o="omit",(x=A.getField(n))==null||x.markAsError(),gc(A,e.outputType))}t.addErrorMessage(S=>{let C=[`Unknown field ${S.red(`\`${n}\``)}`];return o&&C.push(`for ${S.bold(o)} statement`),C.push(`on model ${S.bold(`\`${e.outputType.name}\``)}.`),C.push(tr(S)),C.join(" ")})}function sc(e,t){var i,o;let r=e.argumentPath[0],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getField(r))==null||o.markAsError(),hc(n,e.arguments)),t.addErrorMessage(s=>vs(s,r,e.arguments.map(a=>a.name)))}function ac(e,t){var o,s,a;let[r,n]=Br(e.argumentPath),i=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject();if(i){(s=i.getDeepField(e.argumentPath))==null||s.markAsError();let u=(a=i.getDeepFieldValue(r))==null?void 0:a.asObject();u&&As(u,e.inputType)}t.addErrorMessage(u=>vs(u,n,e.inputType.fields.map(l=>l.name)))}function vs(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=wc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(tr(e)),n.join(" ")}function uc(e,t){var u,l;let r;t.addErrorMessage(g=>(r==null?void 0:r.value)instanceof z&&r.value.text==="null"?`Argument \`${g.green(o)}\` must not be ${g.red("null")}.`:`Argument \`${g.green(o)}\` is missing.`);let n=(u=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:u.asObject();if(!n)return;let[i,o]=Br(e.argumentPath),s=new Lr,a=(l=n.getDeepFieldValue(i))==null?void 0:l.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let g of e.inputTypes[0].fields)s.addField(g.name,g.typeNames.join(" | "));a.addSuggestion(new le(o,s).makeRequired())}else{let g=e.inputTypes.map(Ts).join(" | ");a.addSuggestion(new le(o,g).makeRequired())}}function Ts(e){return e.kind==="list"?`${Ts(e.elementType)}[]`:e.name}function lc(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=$r("or",e.argument.typeNames.map(u=>s.green(u)));return`Argument \`${s.bold(r)}\`: Invalid value provided. Expected ${a}, provided ${s.red(e.inferredType)}.`})}function cc(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=[`Invalid value for argument \`${s.bold(r)}\``];if(e.underlyingError&&a.push(`: ${e.underlyingError}`),a.push("."),e.argument.typeNames.length>0){let u=$r("or",e.argument.typeNames.map(l=>s.green(l)));a.push(` Expected ${u}.`)}return a.join("")})}function pc(e,t){var o;let r=e.argument.name,n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath),a=s==null?void 0:s.value;a==null||a.markAsError(),a instanceof z&&(i=a.text)}t.addErrorMessage(s=>{let a=["Unable to fit value"];return i&&a.push(s.red(i)),a.push(`into a 64-bit signed integer for field \`${s.bold(r)}\``),a.join(" ")})}function fc(e,t){var i,o;let r=e.argumentPath[e.argumentPath.length-1],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();if(n){let s=(o=n.getDeepFieldValue(e.argumentPath))==null?void 0:o.asObject();s&&As(s,e.inputType)}t.addErrorMessage(s=>{let a=[`Argument \`${s.bold(r)}\` of type ${s.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?a.push(`${s.green("at least one of")} ${$r("or",e.constraints.requiredFields.map(u=>`\`${s.bold(u)}\``))} arguments.`):a.push(`${s.green("at least one")} argument.`):a.push(`${s.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),a.push(tr(s)),a.join(" ")})}function mc(e,t){var o,s;let r=e.argumentPath[e.argumentPath.length-1],n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i=[];if(n){let a=(s=n.getDeepFieldValue(e.argumentPath))==null?void 0:s.asObject();a&&(a.markAsError(),i=Object.keys(a.getFields()))}t.addErrorMessage(a=>{let u=[`Argument \`${a.bold(r)}\` of type ${a.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?u.push(`${a.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?u.push(`${a.green("at most one")} argument,`):u.push(`${a.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),u.push(`but you provided ${$r("and",i.map(l=>a.red(l)))}. Please choose`),e.constraints.maxFieldCount===1?u.push("one."):u.push(`${e.constraints.maxFieldCount}.`),u.join(" ")})}function Cs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,"true"))}function dc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new le(r.name,"true"))}function gc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new le(r.name,"true"))}function hc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function As(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Br(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function tr({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function $r(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var yc=3;function wc(e,t){let r=1/0,n;for(let i of t){let o=(0,Ps.default)(e,i);o>yc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){var r;return(r=this.model)==null?void 0:r.fields.find(n=>n.name===t)}nestSelection(t){let r=this.findField(t),n=(r==null?void 0:r.kind)==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};d();c();p();f();m();var ks=e=>({command:e});d();c();p();f();m();d();c();p();f();m();var Ds=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);d();c();p();f();m();function rr(e){try{return Os(e,"fast")}catch(t){return Os(e,"slow")}}function Os(e,t){return JSON.stringify(e.map(r=>Sc(r,t)))}function Sc(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:lt(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ye.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Ic(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Ns(e):e}function Ic(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Ns(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ms);let t={};for(let r of Object.keys(e))t[r]=Ms(e[r]);return t}function Ms(e){return typeof e=="bigint"?e.toString():Ns(e)}var kc=/^(\s*alter\s)/i,_s=re("prisma:client");function Jn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&kc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Qn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:rr(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:rr(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:rr(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Ds(r),i={values:rr(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i!=null&&i.values?_s(`prisma.${e}(${n}, ${i.values})`):_s(`prisma.${e}(${n})`),{query:n,parameters:i}},Fs={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Ls={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};d();c();p();f();m();function Gn(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||(o==null?void 0:o.kind)==="itx"?n!=null?n:n=Bs(r(o)):Bs(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function Bs(e){return typeof e.then=="function"?e:Promise.resolve(e)}d();c();p();f();m();var $s={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Hn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){var t,r;return(r=(t=globalThis.PRISMA_INSTRUMENTATION)==null?void 0:t.helper)!=null?r:$s}};function qs(e){return e.includes("tracing")?new Hn:$s}d();c();p();f();m();function Us(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i==null?void 0:i(n)}}}d();c();p();f();m();var Dc=["$connect","$disconnect","$on","$transaction","$use","$extends"],Vs=Dc;d();c();p();f();m();function js(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}d();c();p();f();m();var Ur=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};d();c();p();f();m();var Qs=Ue(eo());d();c();p();f();m();function Vr(e){return typeof e.batchRequestIdx=="number"}d();c();p();f();m();function jr(e){return e===null?e:Array.isArray(e)?e.map(jr):typeof e=="object"?Oc(e)?Mc(e):ot(e,jr):e}function Oc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Mc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ye(t);case"Json":return JSON.parse(t);default:je(t,"Unknown tagged value")}}d();c();p();f();m();function Js(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Wn(e.query.arguments)),t.push(Wn(e.query.selection)),t.join("")}function Wn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Wn(n)})`:r}).join(" ")})`}d();c();p();f();m();var Nc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Kn(e){return Nc[e]}d();c();p();f();m();var Jr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),u=this.client._tracingHelper.getTraceParent(s),l=n.some(h=>Kn(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:u,transaction:Fc(o),containsWrite:l,customDataProxyFetch:i})).map((h,x)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[x],h)}catch(S){return S}})}),singleLoader:async n=>{var s;let i=((s=n.transaction)==null?void 0:s.kind)==="itx"?Gs(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Kn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>{var i;return(i=n.transaction)!=null&&i.id?`transaction-${n.transaction.id}`:Js(n.protocolQuery)},batchOrder(n,i){var o,s;return((o=n.transaction)==null?void 0:o.kind)==="batch"&&((s=i.transaction)==null?void 0:s.kind)==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n==null?void 0:n.data,o=n==null?void 0:n.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(_c(t),Lc(t,i)||t instanceof Pe)throw t;if(t instanceof K&&Bc(t)){let u=Hs(t.meta);qr({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=yt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new K(a,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ve(a,this.client._clientVersion);if(t instanceof oe)throw new oe(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof G)throw new G(a,this.client._clientVersion);if(t instanceof ve)throw new ve(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Qs.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=jr(Rn(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function Fc(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Gs(e)};je(e,"Unknown transaction kind")}}function Gs(e){return{id:e.id,payload:e.payload}}function Lc(e,t){return Vr(e)&&(t==null?void 0:t.kind)==="batch"&&e.batchRequestIdx!==t.index}function Bc(e){return e.code==="P2009"||e.code==="P2012"}function Hs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Hs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}d();c();p();f();m();var Ws="5.14.0";var Ks=Ws;d();c();p();f();m();function zs(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=Ys(t[n]);return r})}function Ys({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return w.Buffer.from(t,"base64");case"decimal":return new ye(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(Ys);default:return t}}d();c();p();f();m();var ta=Ue(Un());d();c();p();f();m();var J=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};_(J,"PrismaClientConstructorValidationError");var Zs=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Xs=["pretty","colorless","minimal"],ea=["info","query","warn","error"],qc={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=Pt(r,t)||` Available datasources: ${t.join(", ")}`;throw new J(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new J(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new J('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!_r(t).includes("driverAdapters"))throw new J('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Rt()==="binary")throw new J('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e!="undefined"&&typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Xs.includes(e)){let t=Pt(e,Xs);throw new J(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!ea.includes(r)){let n=Pt(r,ea);throw new J(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Pt(i,o);throw new J(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new J(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new J(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new J(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new J(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Pt(r,t);throw new J(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ra(e,t){for(let[r,n]of Object.entries(e)){if(!Zs.includes(r)){let i=Pt(r,Zs);throw new J(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}qc[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new J('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Pt(e,t){if(t.length===0||typeof e!="string")return"";let r=Uc(e,t);return r?` Did you mean "${r}"?`:""}function Uc(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,ta.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},u=l=>{o||(o=!0,r(l))};for(let l=0;l{n[l]=g,a()},g=>{if(!Vr(g)){u(g);return}g.batchRequestIdx===l?u(g):(i||(i=g),a())})})}var Le=re("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Vc={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},jc=Symbol.for("prisma.client.transaction.id"),Jc={id:0,nextId(){return++this.id}};function sa(e){class t{constructor(n){this._originalClient=this;this._middlewares=new Ur;this._createPrismaPromise=Gn();this.$extends=Vo;var u,l,g,h,x,S,C,A,D,O,B,M,I,X;e=(g=(l=(u=n==null?void 0:n.__internal)==null?void 0:u.configOverride)==null?void 0:l.call(u,e))!=null?g:e,os(e),n&&ra(n,e);let i=n!=null&&n.adapter?hn(n.adapter):void 0,o=new lr().on("error",()=>{});this._extensions=Or.empty(),this._previewFeatures=_r(e),this._clientVersion=(h=e.clientVersion)!=null?h:Ks,this._activeProvider=e.activeProvider,this._tracingHelper=qs(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&At.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&At.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=(x=e.injectableEdgeEnv)==null?void 0:x.call(e);try{let L=n!=null?n:{},Ye=(S=L.__internal)!=null?S:{},Be=Ye.debug===!0;Be&&re.enable("prisma:client");let fe=At.resolve(e.dirname,e.relativePath);bi.existsSync(fe)||(fe=e.dirname),Le("dirname",e.dirname),Le("relativePath",e.relativePath),Le("cwd",fe);let $e=Ye.engine||{};if(L.errorFormat?this._errorFormat=L.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:fe,dirname:e.dirname,enableDebugLogs:Be,allowTriggerPanic:$e.allowTriggerPanic,datamodelPath:At.join(e.dirname,(C=e.filename)!=null?C:"schema.prisma"),prismaPath:(A=$e.binaryPath)!=null?A:void 0,engineEndpoint:$e.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:L.log&&js(L.log),logQueries:L.log&&!!(typeof L.log=="string"?L.log==="query":L.log.find(Q=>typeof Q=="string"?Q==="query":Q.level==="query")),env:(D=a==null?void 0:a.parsed)!=null?D:{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:ss(L,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:(B=(O=L.transactionOptions)==null?void 0:O.maxWait)!=null?B:2e3,timeout:(I=(M=L.transactionOptions)==null?void 0:M.timeout)!=null?I:5e3,isolationLevel:(X=L.transactionOptions)==null?void 0:X.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:wt,getBatchRequestPayload:dr,prismaGraphQLToJSError:$t,PrismaClientUnknownRequestError:oe,PrismaClientInitializationError:G,PrismaClientKnownRequestError:K,debug:re("prisma:client:accelerateEngine"),engineVersion:oa.version,clientVersion:e.clientVersion}},Le("clientVersion",e.clientVersion),this._engine=hs(e,this._engineConfig),this._requestHandler=new Qr(this,o),L.log)for(let Q of L.log){let Re=typeof Q=="string"?Q:Q.emit==="stdout"?Q.level:null;Re&&this.$on(Re,qe=>{var Ze;it.log(`${(Ze=it.tags[Re])!=null?Ze:""}`,qe.message||qe.query)})}this._metrics=new st(this._engine)}catch(L){throw L.clientVersion=this._clientVersion,L}return this._appliedParent=qt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{ji()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=ia(n,i);return Jn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Y("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Jn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Y(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:ks,callsite:Fe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(zs)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...ia(n,i));throw new Y("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Jc.nextId(),s=Us(n.length),a=n.map((u,l)=>{var x,S,C;if((u==null?void 0:u[Symbol.toStringTag])!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=(x=i==null?void 0:i.isolationLevel)!=null?x:this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:l,isolationLevel:g,lock:s};return(C=(S=u.requestTransaction)==null?void 0:S.call(u,h))!=null?C:u});return na(a)}async _transactionWithCallback({callback:n,options:i}){var l,g,h;let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:(l=i==null?void 0:i.maxWait)!=null?l:this._engineConfig.transactionOptions.maxWait,timeout:(g=i==null?void 0:i.timeout)!=null?g:this._engineConfig.transactionOptions.timeout,isolationLevel:(h=i==null?void 0:i.isolationLevel)!=null?h:this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),u;try{let x={kind:"itx",...a};u=await n(this._createItxClient(x)),await this._engine.transaction("commit",o,a)}catch(x){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),x}return u}_createItxClient(n){return qt(ge(Uo(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>Gn(n)),ne(jc,()=>n.id),at(Vs)]))}$transaction(n,i){var a;let o;typeof n=="function"?((a=this._engineConfig.adapter)==null?void 0:a.adapterName)==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){var l;n.otelParentCtx=this._tracingHelper.getActiveContext();let i=(l=n.middlewareArgsMapper)!=null?l:Vc,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,u=async g=>{let h=this._middlewares.get(++a);if(h)return this._tracingHelper.runInChildSpan(s.middleware,O=>h(g,B=>(O==null||O.end(),u(B))));let{runInTransaction:x,args:S,...C}=g,A={...n,...C};S&&(A.args=i.middlewareArgsToRequestArgs(S)),n.transaction!==void 0&&x===!1&&delete A.transaction;let D=await Ko(this,A);return A.model?Qo({result:D,modelName:A.model,args:A.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):D};return this._tracingHelper.runInChildSpan(s.operation,()=>u(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:u,argsMapper:l,transaction:g,unpacker:h,otelParentCtx:x,customDataProxyFetch:S}){try{n=l?l(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>Rs({modelName:u,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return re.enabled("prisma:client")&&(Le("Prisma Client call:"),Le(`prisma.${i}(${ko(n)})`),Le("Generated request:"),Le(JSON.stringify(A,null,2)+` -`)),(g==null?void 0:g.kind)==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:u,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:x,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:S})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new Y("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){var i;return!!((i=this._engineConfig.previewFeatures)!=null&&i.includes(n))}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function ia(e,t){return Qc(e)?[new se(e,t),Fs]:[e,Ls]}function Qc(e){return Array.isArray(e)&&Array.isArray(e.raw)}d();c();p();f();m();var Gc=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function aa(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Gc.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}d();c();p();f();m();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=edge.js.map diff --git a/integration-tests/tests/prisma/pg/client/runtime/index-browser.d.ts b/integration-tests/tests/prisma/pg/client/runtime/index-browser.d.ts deleted file mode 100644 index f033b86a5..000000000 --- a/integration-tests/tests/prisma/pg/client/runtime/index-browser.d.ts +++ /dev/null @@ -1,365 +0,0 @@ -declare class AnyNull extends NullTypesEnumValue { -} - -declare type Args = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : any; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof A]: Exact; -} : W) : never) | (A extends Narrowable ? A : never); - -export declare function getRuntime(): GetRuntimeOutput; - -declare type GetRuntimeOutput = { - id: Runtime; - prettyName: string; - isEdge: boolean; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -declare type Narrowable = string | number | bigint | boolean | []; - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * Base class for unique values of object-valued enums. - */ -declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -declare namespace Public { - export { - validator - } -} -export { Public } - -declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown"; - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -export { } diff --git a/integration-tests/tests/prisma/pg/client/runtime/index-browser.js b/integration-tests/tests/prisma/pg/client/runtime/index-browser.js deleted file mode 100644 index 4f8241715..000000000 --- a/integration-tests/tests/prisma/pg/client/runtime/index-browser.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict";var de=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var je=Object.prototype.hasOwnProperty;var Ce=(e,n)=>{for(var i in n)de(e,i,{get:n[i],enumerable:!0})},Xe=(e,n,i,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Je(n))!je.call(e,r)&&r!==i&&de(e,r,{get:()=>n[r],enumerable:!(t=Ge(n,r))||t.enumerable});return e};var Ke=e=>Xe(de({},"__esModule",{value:!0}),e);var Xn={};Ce(Xn,{Decimal:()=>We,Public:()=>he,getRuntime:()=>Ae,makeStrictEnum:()=>Pe,objectEnumValues:()=>Oe});module.exports=Ke(Xn);var he={};Ce(he,{validator:()=>Me});function Me(...e){return n=>n}var ne=Symbol(),pe=new WeakMap,ge=class{constructor(n){n===ne?pe.set(this,"Prisma.".concat(this._getName())):pe.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return pe.get(this)}},J=class extends ge{_getNamespace(){return"NullTypes"}},j=class extends J{};me(j,"DbNull");var X=class extends J{};me(X,"JsonNull");var K=class extends J{};me(K,"AnyNull");var Oe={classes:{DbNull:j,JsonNull:X,AnyNull:K},instances:{DbNull:new j(ne),JsonNull:new X(ne),AnyNull:new K(ne)}};function me(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0})}var Qe=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Pe(e){return new Proxy(e,{get(n,i){if(i in n)return n[i];if(!Qe.has(i))throw new TypeError("Invalid enum value: ".concat(String(i)))}})}var Ye="Cloudflare-Workers",xe="node";function be(){var e,n,i;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Ye?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((i=(n=globalThis.process)==null?void 0:n.release)==null?void 0:i.name)===xe?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var ze={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Ae(){let e=be();return{id:e,prettyName:ze[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var H=9e15,V=1e9,we="0123456789abcdef",te="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",re="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ne={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-H,maxE:H,crypto:!1},Te,Z,w=!0,oe="[DecimalError] ",$=oe+"Invalid argument: ",Le=oe+"Precision limit exceeded",De=oe+"crypto unavailable",Fe="[object Decimal]",A=Math.floor,M=Math.pow,ye=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,en=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,nn=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ie=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,D=1e7,m=7,tn=9007199254740991,rn=te.length-1,ve=re.length-1,h={toStringTag:Fe};h.absoluteValue=h.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),p(e)};h.ceil=function(){return p(new this.constructor(this),this.e+1,2)};h.clampedTo=h.clamp=function(e,n){var i,t=this,r=t.constructor;if(e=new r(e),n=new r(n),!e.s||!n.s)return new r(NaN);if(e.gt(n))throw Error($+n);return i=t.cmp(e),i<0?e:t.cmp(n)>0?n:new r(t)};h.comparedTo=h.cmp=function(e){var n,i,t,r,s=this,o=s.d,u=(e=new s.constructor(e)).d,l=s.s,f=e.s;if(!o||!u)return!l||!f?NaN:l!==f?l:o===u?0:!o^l<0?1:-1;if(!o[0]||!u[0])return o[0]?l:u[0]?-f:0;if(l!==f)return l;if(s.e!==e.e)return s.e>e.e^l<0?1:-1;for(t=o.length,r=u.length,n=0,i=tu[n]^l<0?1:-1;return t===r?0:t>r^l<0?1:-1};h.cosine=h.cos=function(){var e,n,i=this,t=i.constructor;return i.d?i.d[0]?(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=sn(t,Ve(t,i)),t.precision=e,t.rounding=n,p(Z==2||Z==3?i.neg():i,e,n,!0)):new t(1):new t(NaN)};h.cubeRoot=h.cbrt=function(){var e,n,i,t,r,s,o,u,l,f,c=this,a=c.constructor;if(!c.isFinite()||c.isZero())return new a(c);for(w=!1,s=c.s*M(c.s*c,1/3),!s||Math.abs(s)==1/0?(i=O(c.d),e=c.e,(s=(e-i.length+1)%3)&&(i+=s==1||s==-2?"0":"00"),s=M(i,1/3),e=A((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?i="5e"+e:(i=s.toExponential(),i=i.slice(0,i.indexOf("e")+1)+e),t=new a(i),t.s=c.s):t=new a(s.toString()),o=(e=a.precision)+3;;)if(u=t,l=u.times(u).times(u),f=l.plus(c),t=S(f.plus(c).times(u),f.plus(l),o+2,1),O(u.d).slice(0,o)===(i=O(t.d)).slice(0,o))if(i=i.slice(o-3,o+1),i=="9999"||!r&&i=="4999"){if(!r&&(p(u,e+1,0),u.times(u).times(u).eq(c))){t=u;break}o+=4,r=1}else{(!+i||!+i.slice(1)&&i.charAt(0)=="5")&&(p(t,e+1,1),n=!t.times(t).times(t).eq(c));break}return w=!0,p(t,e,a.rounding,n)};h.decimalPlaces=h.dp=function(){var e,n=this.d,i=NaN;if(n){if(e=n.length-1,i=(e-A(this.e/m))*m,e=n[e],e)for(;e%10==0;e/=10)i--;i<0&&(i=0)}return i};h.dividedBy=h.div=function(e){return S(this,new this.constructor(e))};h.dividedToIntegerBy=h.divToInt=function(e){var n=this,i=n.constructor;return p(S(n,new i(e),0,1,1),i.precision,i.rounding)};h.equals=h.eq=function(e){return this.cmp(e)===0};h.floor=function(){return p(new this.constructor(this),this.e+1,3)};h.greaterThan=h.gt=function(e){return this.cmp(e)>0};h.greaterThanOrEqualTo=h.gte=function(e){var n=this.cmp(e);return n==1||n===0};h.hyperbolicCosine=h.cosh=function(){var e,n,i,t,r,s=this,o=s.constructor,u=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return u;i=o.precision,t=o.rounding,o.precision=i+Math.max(s.e,s.sd())+4,o.rounding=1,r=s.d.length,r<32?(e=Math.ceil(r/3),n=(1/fe(4,e)).toString()):(e=16,n="2.3283064365386962890625e-10"),s=W(o,1,s.times(n),new o(1),!0);for(var l,f=e,c=new o(8);f--;)l=s.times(s),s=u.minus(l.times(c.minus(l.times(c))));return p(s,o.precision=i,o.rounding=t,!0)};h.hyperbolicSine=h.sinh=function(){var e,n,i,t,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(n=s.precision,i=s.rounding,s.precision=n+Math.max(r.e,r.sd())+4,s.rounding=1,t=r.d.length,t<3)r=W(s,2,r,r,!0);else{e=1.4*Math.sqrt(t),e=e>16?16:e|0,r=r.times(1/fe(5,e)),r=W(s,2,r,r,!0);for(var o,u=new s(5),l=new s(16),f=new s(20);e--;)o=r.times(r),r=r.times(u.plus(o.times(l.times(o).plus(f))))}return s.precision=n,s.rounding=i,p(r,n,i,!0)};h.hyperbolicTangent=h.tanh=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+7,t.rounding=1,S(i.sinh(),i.cosh(),t.precision=e,t.rounding=n)):new t(i.s)};h.inverseCosine=h.acos=function(){var e,n=this,i=n.constructor,t=n.abs().cmp(1),r=i.precision,s=i.rounding;return t!==-1?t===0?n.isNeg()?L(i,r,s):new i(0):new i(NaN):n.isZero()?L(i,r+4,s).times(.5):(i.precision=r+6,i.rounding=1,n=n.asin(),e=L(i,r+4,s).times(.5),i.precision=r,i.rounding=s,e.minus(n))};h.inverseHyperbolicCosine=h.acosh=function(){var e,n,i=this,t=i.constructor;return i.lte(1)?new t(i.eq(1)?0:NaN):i.isFinite()?(e=t.precision,n=t.rounding,t.precision=e+Math.max(Math.abs(i.e),i.sd())+4,t.rounding=1,w=!1,i=i.times(i).minus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln()):new t(i)};h.inverseHyperbolicSine=h.asinh=function(){var e,n,i=this,t=i.constructor;return!i.isFinite()||i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+2*Math.max(Math.abs(i.e),i.sd())+6,t.rounding=1,w=!1,i=i.times(i).plus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln())};h.inverseHyperbolicTangent=h.atanh=function(){var e,n,i,t,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=s.precision,n=s.rounding,t=r.sd(),Math.max(t,e)<2*-r.e-1?p(new s(r),e,n,!0):(s.precision=i=t-r.e,r=S(r.plus(1),new s(1).minus(r),i+e,1),s.precision=e+4,s.rounding=1,r=r.ln(),s.precision=e,s.rounding=n,r.times(.5))):new s(NaN)};h.inverseSine=h.asin=function(){var e,n,i,t,r=this,s=r.constructor;return r.isZero()?new s(r):(n=r.abs().cmp(1),i=s.precision,t=s.rounding,n!==-1?n===0?(e=L(s,i+4,t).times(.5),e.s=r.s,e):new s(NaN):(s.precision=i+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=i,s.rounding=t,r.times(2)))};h.inverseTangent=h.atan=function(){var e,n,i,t,r,s,o,u,l,f=this,c=f.constructor,a=c.precision,d=c.rounding;if(f.isFinite()){if(f.isZero())return new c(f);if(f.abs().eq(1)&&a+4<=ve)return o=L(c,a+4,d).times(.25),o.s=f.s,o}else{if(!f.s)return new c(NaN);if(a+4<=ve)return o=L(c,a+4,d).times(.5),o.s=f.s,o}for(c.precision=u=a+10,c.rounding=1,i=Math.min(28,u/m+2|0),e=i;e;--e)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(w=!1,n=Math.ceil(u/m),t=1,l=f.times(f),o=new c(f),r=f;e!==-1;)if(r=r.times(l),s=o.minus(r.div(t+=2)),r=r.times(l),o=s.plus(r.div(t+=2)),o.d[n]!==void 0)for(e=n;o.d[e]===s.d[e]&&e--;);return i&&(o=o.times(2<this.d.length-2};h.isNaN=function(){return!this.s};h.isNegative=h.isNeg=function(){return this.s<0};h.isPositive=h.isPos=function(){return this.s>0};h.isZero=function(){return!!this.d&&this.d[0]===0};h.lessThan=h.lt=function(e){return this.cmp(e)<0};h.lessThanOrEqualTo=h.lte=function(e){return this.cmp(e)<1};h.logarithm=h.log=function(e){var n,i,t,r,s,o,u,l,f=this,c=f.constructor,a=c.precision,d=c.rounding,g=5;if(e==null)e=new c(10),n=!0;else{if(e=new c(e),i=e.d,e.s<0||!i||!i[0]||e.eq(1))return new c(NaN);n=e.eq(10)}if(i=f.d,f.s<0||!i||!i[0]||f.eq(1))return new c(i&&!i[0]?-1/0:f.s!=1?NaN:i?0:1/0);if(n)if(i.length>1)s=!0;else{for(r=i[0];r%10===0;)r/=10;s=r!==1}if(w=!1,u=a+g,o=B(f,u),t=n?se(c,u+10):B(e,u),l=S(o,t,u,1),Q(l.d,r=a,d))do if(u+=10,o=B(f,u),t=n?se(c,u+10):B(e,u),l=S(o,t,u,1),!s){+O(l.d).slice(r+1,r+15)+1==1e14&&(l=p(l,a+1,0));break}while(Q(l.d,r+=10,d));return w=!0,p(l,a,d)};h.minus=h.sub=function(e){var n,i,t,r,s,o,u,l,f,c,a,d,g=this,v=g.constructor;if(e=new v(e),!g.d||!e.d)return!g.s||!e.s?e=new v(NaN):g.d?e.s=-e.s:e=new v(e.d||g.s!==e.s?g:NaN),e;if(g.s!=e.s)return e.s=-e.s,g.plus(e);if(f=g.d,d=e.d,u=v.precision,l=v.rounding,!f[0]||!d[0]){if(d[0])e.s=-e.s;else if(f[0])e=new v(g);else return new v(l===3?-0:0);return w?p(e,u,l):e}if(i=A(e.e/m),c=A(g.e/m),f=f.slice(),s=c-i,s){for(a=s<0,a?(n=f,s=-s,o=d.length):(n=d,i=c,o=f.length),t=Math.max(Math.ceil(u/m),o)+2,s>t&&(s=t,n.length=1),n.reverse(),t=s;t--;)n.push(0);n.reverse()}else{for(t=f.length,o=d.length,a=t0;--t)f[o++]=0;for(t=d.length;t>s;){if(f[--t]o?s+1:o+1,r>o&&(r=o,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for(o=f.length,r=c.length,o-r<0&&(r=o,i=c,c=f,f=i),n=0;r;)n=(f[--r]=f[r]+c[r]+n)/D|0,f[r]%=D;for(n&&(f.unshift(n),++t),o=f.length;f[--o]==0;)f.pop();return e.d=f,e.e=ue(f,t),w?p(e,u,l):e};h.precision=h.sd=function(e){var n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error($+e);return i.d?(n=Ze(i.d),e&&i.e+1>n&&(n=i.e+1)):n=NaN,n};h.round=function(){var e=this,n=e.constructor;return p(new n(e),e.e+1,n.rounding)};h.sine=h.sin=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=un(t,Ve(t,i)),t.precision=e,t.rounding=n,p(Z>2?i.neg():i,e,n,!0)):new t(NaN)};h.squareRoot=h.sqrt=function(){var e,n,i,t,r,s,o=this,u=o.d,l=o.e,f=o.s,c=o.constructor;if(f!==1||!u||!u[0])return new c(!f||f<0&&(!u||u[0])?NaN:u?o:1/0);for(w=!1,f=Math.sqrt(+o),f==0||f==1/0?(n=O(u),(n.length+l)%2==0&&(n+="0"),f=Math.sqrt(n),l=A((l+1)/2)-(l<0||l%2),f==1/0?n="5e"+l:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+l),t=new c(n)):t=new c(f.toString()),i=(l=c.precision)+3;;)if(s=t,t=s.plus(S(o,s,i+2,1)).times(.5),O(s.d).slice(0,i)===(n=O(t.d)).slice(0,i))if(n=n.slice(i-3,i+1),n=="9999"||!r&&n=="4999"){if(!r&&(p(s,l+1,0),s.times(s).eq(o))){t=s;break}i+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(p(t,l+1,1),e=!t.times(t).eq(o));break}return w=!0,p(t,l,c.rounding,e)};h.tangent=h.tan=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+10,t.rounding=1,i=i.sin(),i.s=1,i=S(i,new t(1).minus(i.times(i)).sqrt(),e+10,0),t.precision=e,t.rounding=n,p(Z==2||Z==4?i.neg():i,e,n,!0)):new t(NaN)};h.times=h.mul=function(e){var n,i,t,r,s,o,u,l,f,c=this,a=c.constructor,d=c.d,g=(e=new a(e)).d;if(e.s*=c.s,!d||!d[0]||!g||!g[0])return new a(!e.s||d&&!d[0]&&!g||g&&!g[0]&&!d?NaN:!d||!g?e.s/0:e.s*0);for(i=A(c.e/m)+A(e.e/m),l=d.length,f=g.length,l=0;){for(n=0,r=l+t;r>t;)u=s[r]+g[t]*d[r-t-1]+n,s[r--]=u%D|0,n=u/D|0;s[r]=(s[r]+n)%D|0}for(;!s[--o];)s.pop();return n?++i:s.shift(),e.d=s,e.e=ue(s,i),w?p(e,a.precision,a.rounding):e};h.toBinary=function(e,n){return ke(this,2,e,n)};h.toDecimalPlaces=h.toDP=function(e,n){var i=this,t=i.constructor;return i=new t(i),e===void 0?i:(R(e,0,V),n===void 0?n=t.rounding:R(n,0,8),p(i,e+i.e+1,n))};h.toExponential=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=F(t,!0):(R(e,0,V),n===void 0?n=r.rounding:R(n,0,8),t=p(new r(t),e+1,n),i=F(t,!0,e+1)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toFixed=function(e,n){var i,t,r=this,s=r.constructor;return e===void 0?i=F(r):(R(e,0,V),n===void 0?n=s.rounding:R(n,0,8),t=p(new s(r),e+r.e+1,n),i=F(t,!1,e+t.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i};h.toFraction=function(e){var n,i,t,r,s,o,u,l,f,c,a,d,g=this,v=g.d,N=g.constructor;if(!v)return new N(g);if(f=i=new N(1),t=l=new N(0),n=new N(t),s=n.e=Ze(v)-g.e-1,o=s%m,n.d[0]=M(10,o<0?m+o:o),e==null)e=s>0?n:f;else{if(u=new N(e),!u.isInt()||u.lt(f))throw Error($+u);e=u.gt(n)?s>0?n:f:u}for(w=!1,u=new N(O(v)),c=N.precision,N.precision=s=v.length*m*2;a=S(u,n,0,1,1),r=i.plus(a.times(t)),r.cmp(e)!=1;)i=t,t=r,r=f,f=l.plus(a.times(r)),l=r,r=n,n=u.minus(a.times(r)),u=r;return r=S(e.minus(i),t,0,1,1),l=l.plus(r.times(f)),i=i.plus(r.times(t)),l.s=f.s=g.s,d=S(f,t,s,1).minus(g).abs().cmp(S(l,i,s,1).minus(g).abs())<1?[f,t]:[l,i],N.precision=c,w=!0,d};h.toHexadecimal=h.toHex=function(e,n){return ke(this,16,e,n)};h.toNearest=function(e,n){var i=this,t=i.constructor;if(i=new t(i),e==null){if(!i.d)return i;e=new t(1),n=t.rounding}else{if(e=new t(e),n===void 0?n=t.rounding:R(n,0,8),!i.d)return e.s?i:e;if(!e.d)return e.s&&(e.s=i.s),e}return e.d[0]?(w=!1,i=S(i,e,0,n,1).times(e),w=!0,p(i)):(e.s=i.s,i=e),i};h.toNumber=function(){return+this};h.toOctal=function(e,n){return ke(this,8,e,n)};h.toPower=h.pow=function(e){var n,i,t,r,s,o,u=this,l=u.constructor,f=+(e=new l(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new l(M(+u,f));if(u=new l(u),u.eq(1))return u;if(t=l.precision,s=l.rounding,e.eq(1))return p(u,t,s);if(n=A(e.e/m),n>=e.d.length-1&&(i=f<0?-f:f)<=tn)return r=Ue(l,u,i,t),e.s<0?new l(1).div(r):p(r,t,s);if(o=u.s,o<0){if(nl.maxE+1||n0?o/0:0):(w=!1,l.rounding=u.s=1,i=Math.min(12,(n+"").length),r=Ee(e.times(B(u,t+i)),t),r.d&&(r=p(r,t+5,1),Q(r.d,t,s)&&(n=t+10,r=p(Ee(e.times(B(u,n+i)),n),n+5,1),+O(r.d).slice(t+1,t+15)+1==1e14&&(r=p(r,t+1,0)))),r.s=o,w=!0,l.rounding=s,p(r,t,s))};h.toPrecision=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=F(t,t.e<=r.toExpNeg||t.e>=r.toExpPos):(R(e,1,V),n===void 0?n=r.rounding:R(n,0,8),t=p(new r(t),e,n),i=F(t,e<=t.e||t.e<=r.toExpNeg,e)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toSignificantDigits=h.toSD=function(e,n){var i=this,t=i.constructor;return e===void 0?(e=t.precision,n=t.rounding):(R(e,1,V),n===void 0?n=t.rounding:R(n,0,8)),p(new t(i),e,n)};h.toString=function(){var e=this,n=e.constructor,i=F(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()&&!e.isZero()?"-"+i:i};h.truncated=h.trunc=function(){return p(new this.constructor(this),this.e+1,1)};h.valueOf=h.toJSON=function(){var e=this,n=e.constructor,i=F(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()?"-"+i:i};function O(e){var n,i,t,r=e.length-1,s="",o=e[0];if(r>0){for(s+=o,n=1;ni)throw Error($+e)}function Q(e,n,i,t){var r,s,o,u;for(s=e[0];s>=10;s/=10)--n;return--n<0?(n+=m,r=0):(r=Math.ceil((n+1)/m),n%=m),s=M(10,m-n),u=e[r]%s|0,t==null?n<3?(n==0?u=u/100|0:n==1&&(u=u/10|0),o=i<4&&u==99999||i>3&&u==49999||u==5e4||u==0):o=(i<4&&u+1==s||i>3&&u+1==s/2)&&(e[r+1]/s/100|0)==M(10,n-2)-1||(u==s/2||u==0)&&(e[r+1]/s/100|0)==0:n<4?(n==0?u=u/1e3|0:n==1?u=u/100|0:n==2&&(u=u/10|0),o=(t||i<4)&&u==9999||!t&&i>3&&u==4999):o=((t||i<4)&&u+1==s||!t&&i>3&&u+1==s/2)&&(e[r+1]/s/1e3|0)==M(10,n-3)-1,o}function ie(e,n,i){for(var t,r=[0],s,o=0,u=e.length;oi-1&&(r[t+1]===void 0&&(r[t+1]=0),r[t+1]+=r[t]/i|0,r[t]%=i)}return r.reverse()}function sn(e,n){var i,t,r;if(n.isZero())return n;t=n.d.length,t<32?(i=Math.ceil(t/3),r=(1/fe(4,i)).toString()):(i=16,r="2.3283064365386962890625e-10"),e.precision+=i,n=W(e,1,n.times(r),new e(1));for(var s=i;s--;){var o=n.times(n);n=o.times(o).minus(o).times(8).plus(1)}return e.precision-=i,n}var S=function(){function e(t,r,s){var o,u=0,l=t.length;for(t=t.slice();l--;)o=t[l]*r+u,t[l]=o%s|0,u=o/s|0;return u&&t.unshift(u),t}function n(t,r,s,o){var u,l;if(s!=o)l=s>o?1:-1;else for(u=l=0;ur[u]?1:-1;break}return l}function i(t,r,s,o){for(var u=0;s--;)t[s]-=u,u=t[s]1;)t.shift()}return function(t,r,s,o,u,l){var f,c,a,d,g,v,N,_,C,q,E,P,x,I,le,z,G,ce,T,y,ee=t.constructor,ae=t.s==r.s?1:-1,b=t.d,k=r.d;if(!b||!b[0]||!k||!k[0])return new ee(!t.s||!r.s||(b?k&&b[0]==k[0]:!k)?NaN:b&&b[0]==0||!k?ae*0:ae/0);for(l?(g=1,c=t.e-r.e):(l=D,g=m,c=A(t.e/g)-A(r.e/g)),T=k.length,G=b.length,C=new ee(ae),q=C.d=[],a=0;k[a]==(b[a]||0);a++);if(k[a]>(b[a]||0)&&c--,s==null?(I=s=ee.precision,o=ee.rounding):u?I=s+(t.e-r.e)+1:I=s,I<0)q.push(1),v=!0;else{if(I=I/g+2|0,a=0,T==1){for(d=0,k=k[0],I++;(a1&&(k=e(k,d,l),b=e(b,d,l),T=k.length,G=b.length),z=T,E=b.slice(0,T),P=E.length;P=l/2&&++ce;do d=0,f=n(k,E,T,P),f<0?(x=E[0],T!=P&&(x=x*l+(E[1]||0)),d=x/ce|0,d>1?(d>=l&&(d=l-1),N=e(k,d,l),_=N.length,P=E.length,f=n(N,E,_,P),f==1&&(d--,i(N,T<_?y:k,_,l))):(d==0&&(f=d=1),N=k.slice()),_=N.length,_=10;d/=10)a++;C.e=a+c*g-1,p(C,u?s+C.e+1:s,o,v)}return C}}();function p(e,n,i,t){var r,s,o,u,l,f,c,a,d,g=e.constructor;e:if(n!=null){if(a=e.d,!a)return e;for(r=1,u=a[0];u>=10;u/=10)r++;if(s=n-r,s<0)s+=m,o=n,c=a[d=0],l=c/M(10,r-o-1)%10|0;else if(d=Math.ceil((s+1)/m),u=a.length,d>=u)if(t){for(;u++<=d;)a.push(0);c=l=0,r=1,s%=m,o=s-m+1}else break e;else{for(c=u=a[d],r=1;u>=10;u/=10)r++;s%=m,o=s-m+r,l=o<0?0:c/M(10,r-o-1)%10|0}if(t=t||n<0||a[d+1]!==void 0||(o<0?c:c%M(10,r-o-1)),f=i<4?(l||t)&&(i==0||i==(e.s<0?3:2)):l>5||l==5&&(i==4||t||i==6&&(s>0?o>0?c/M(10,r-o):0:a[d-1])%10&1||i==(e.s<0?8:7)),n<1||!a[0])return a.length=0,f?(n-=e.e+1,a[0]=M(10,(m-n%m)%m),e.e=-n||0):a[0]=e.e=0,e;if(s==0?(a.length=d,u=1,d--):(a.length=d+1,u=M(10,m-s),a[d]=o>0?(c/M(10,r-o)%M(10,o)|0)*u:0),f)for(;;)if(d==0){for(s=1,o=a[0];o>=10;o/=10)s++;for(o=a[0]+=u,u=1;o>=10;o/=10)u++;s!=u&&(e.e++,a[0]==D&&(a[0]=1));break}else{if(a[d]+=u,a[d]!=D)break;a[d--]=0,u=1}for(s=a.length;a[--s]===0;)a.pop()}return w&&(e.e>g.maxE?(e.d=null,e.e=NaN):e.e0?s=s.charAt(0)+"."+s.slice(1)+U(t):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+U(-r-1)+s,i&&(t=i-o)>0&&(s+=U(t))):r>=o?(s+=U(r+1-o),i&&(t=i-r-1)>0&&(s=s+"."+U(t))):((t=r+1)0&&(r+1===o&&(s+="."),s+=U(t))),s}function ue(e,n){var i=e[0];for(n*=m;i>=10;i/=10)n++;return n}function se(e,n,i){if(n>rn)throw w=!0,i&&(e.precision=i),Error(Le);return p(new e(te),n,1,!0)}function L(e,n,i){if(n>ve)throw Error(Le);return p(new e(re),n,i,!0)}function Ze(e){var n=e.length-1,i=n*m+1;if(n=e[n],n){for(;n%10==0;n/=10)i--;for(n=e[0];n>=10;n/=10)i++}return i}function U(e){for(var n="";e--;)n+="0";return n}function Ue(e,n,i,t){var r,s=new e(1),o=Math.ceil(t/m+4);for(w=!1;;){if(i%2&&(s=s.times(n),Re(s.d,o)&&(r=!0)),i=A(i/2),i===0){i=s.d.length-1,r&&s.d[i]===0&&++s.d[i];break}n=n.times(n),Re(n.d,o)}return w=!0,s}function _e(e){return e.d[e.d.length-1]&1}function Be(e,n,i){for(var t,r=new e(n[0]),s=0;++s17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(n==null?(w=!1,l=v):l=n,u=new d(.03125);e.e>-2;)e=e.times(u),a+=5;for(t=Math.log(M(2,a))/Math.LN10*2+5|0,l+=t,i=s=o=new d(1),d.precision=l;;){if(s=p(s.times(e),l,1),i=i.times(++c),u=o.plus(S(s,i,l,1)),O(u.d).slice(0,l)===O(o.d).slice(0,l)){for(r=a;r--;)o=p(o.times(o),l,1);if(n==null)if(f<3&&Q(o.d,l-t,g,f))d.precision=l+=10,i=s=u=new d(1),c=0,f++;else return p(o,d.precision=v,g,w=!0);else return d.precision=v,o}o=u}}function B(e,n){var i,t,r,s,o,u,l,f,c,a,d,g=1,v=10,N=e,_=N.d,C=N.constructor,q=C.rounding,E=C.precision;if(N.s<0||!_||!_[0]||!N.e&&_[0]==1&&_.length==1)return new C(_&&!_[0]?-1/0:N.s!=1?NaN:_?0:N);if(n==null?(w=!1,c=E):c=n,C.precision=c+=v,i=O(_),t=i.charAt(0),Math.abs(s=N.e)<15e14){for(;t<7&&t!=1||t==1&&i.charAt(1)>3;)N=N.times(e),i=O(N.d),t=i.charAt(0),g++;s=N.e,t>1?(N=new C("0."+i),s++):N=new C(t+"."+i.slice(1))}else return f=se(C,c+2,E).times(s+""),N=B(new C(t+"."+i.slice(1)),c-v).plus(f),C.precision=E,n==null?p(N,E,q,w=!0):N;for(a=N,l=o=N=S(N.minus(1),N.plus(1),c,1),d=p(N.times(N),c,1),r=3;;){if(o=p(o.times(d),c,1),f=l.plus(S(o,new C(r),c,1)),O(f.d).slice(0,c)===O(l.d).slice(0,c))if(l=l.times(2),s!==0&&(l=l.plus(se(C,c+2,E).times(s+""))),l=S(l,new C(g),c,1),n==null)if(Q(l.d,c-v,q,u))C.precision=c+=v,f=o=N=S(a.minus(1),a.plus(1),c,1),d=p(N.times(N),c,1),r=u=1;else return p(l,C.precision=E,q,w=!0);else return C.precision=E,l;l=f,r+=2}}function $e(e){return String(e.s*e.s/0)}function Se(e,n){var i,t,r;for((i=n.indexOf("."))>-1&&(n=n.replace(".","")),(t=n.search(/e/i))>0?(i<0&&(i=t),i+=+n.slice(t+1),n=n.substring(0,t)):i<0&&(i=n.length),t=0;n.charCodeAt(t)===48;t++);for(r=n.length;n.charCodeAt(r-1)===48;--r);if(n=n.slice(t,r),n){if(r-=t,e.e=i=i-t-1,e.d=[],t=(i+1)%m,i<0&&(t+=m),te.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Ie.test(n))return Se(e,n)}else if(n==="Infinity"||n==="NaN")return+n||(e.s=NaN),e.e=NaN,e.d=null,e;if(en.test(n))i=16,n=n.toLowerCase();else if(ye.test(n))i=2;else if(nn.test(n))i=8;else throw Error($+n);for(s=n.search(/p/i),s>0?(l=+n.slice(s+1),n=n.substring(2,s)):n=n.slice(2),s=n.indexOf("."),o=s>=0,t=e.constructor,o&&(n=n.replace(".",""),u=n.length,s=u-s,r=Ue(t,new t(i),s,s*2)),f=ie(n,i,D),c=f.length-1,s=c;f[s]===0;--s)f.pop();return s<0?new t(e.s*0):(e.e=ue(f,c),e.d=f,w=!1,o&&(e=S(e,r,u*4)),l&&(e=e.times(Math.abs(l)<54?M(2,l):Y.pow(2,l))),w=!0,e)}function un(e,n){var i,t=n.d.length;if(t<3)return n.isZero()?n:W(e,2,n,n);i=1.4*Math.sqrt(t),i=i>16?16:i|0,n=n.times(1/fe(5,i)),n=W(e,2,n,n);for(var r,s=new e(5),o=new e(16),u=new e(20);i--;)r=n.times(n),n=n.times(s.plus(r.times(o.times(r).minus(u))));return n}function W(e,n,i,t,r){var s,o,u,l,f=1,c=e.precision,a=Math.ceil(c/m);for(w=!1,l=i.times(i),u=new e(t);;){if(o=S(u.times(l),new e(n++*n++),c,1),u=r?t.plus(o):t.minus(o),t=S(o.times(l),new e(n++*n++),c,1),o=u.plus(t),o.d[a]!==void 0){for(s=a;o.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=t,t=o,o=s,f++}return w=!0,o.d.length=a+1,o}function fe(e,n){for(var i=e;--n;)i*=e;return i}function Ve(e,n){var i,t=n.s<0,r=L(e,e.precision,1),s=r.times(.5);if(n=n.abs(),n.lte(s))return Z=t?4:1,n;if(i=n.divToInt(r),i.isZero())Z=t?3:2;else{if(n=n.minus(i.times(r)),n.lte(s))return Z=_e(i)?t?2:3:t?4:1,n;Z=_e(i)?t?1:4:t?3:2}return n.minus(r).abs()}function ke(e,n,i,t){var r,s,o,u,l,f,c,a,d,g=e.constructor,v=i!==void 0;if(v?(R(i,1,V),t===void 0?t=g.rounding:R(t,0,8)):(i=g.precision,t=g.rounding),!e.isFinite())c=$e(e);else{for(c=F(e),o=c.indexOf("."),v?(r=2,n==16?i=i*4-3:n==8&&(i=i*3-2)):r=n,o>=0&&(c=c.replace(".",""),d=new g(1),d.e=c.length-o,d.d=ie(F(d),10,r),d.e=d.d.length),a=ie(c,10,r),s=l=a.length;a[--l]==0;)a.pop();if(!a[0])c=v?"0p+0":"0";else{if(o<0?s--:(e=new g(e),e.d=a,e.e=s,e=S(e,d,i,t,0,r),a=e.d,s=e.e,f=Te),o=a[i],u=r/2,f=f||a[i+1]!==void 0,f=t<4?(o!==void 0||f)&&(t===0||t===(e.s<0?3:2)):o>u||o===u&&(t===4||f||t===6&&a[i-1]&1||t===(e.s<0?8:7)),a.length=i,f)for(;++a[--i]>r-1;)a[i]=0,i||(++s,a.unshift(1));for(l=a.length;!a[l-1];--l);for(o=0,c="";o1)if(n==16||n==8){for(o=n==16?4:3,--l;l%o;l++)c+="0";for(a=ie(c,r,n),l=a.length;!a[l-1];--l);for(o=1,c="1.";ol)for(s-=l;s--;)c+="0";else sn)return e.length=n,!0}function fn(e){return new this(e).abs()}function ln(e){return new this(e).acos()}function cn(e){return new this(e).acosh()}function an(e,n){return new this(e).plus(n)}function dn(e){return new this(e).asin()}function hn(e){return new this(e).asinh()}function pn(e){return new this(e).atan()}function gn(e){return new this(e).atanh()}function mn(e,n){e=new this(e),n=new this(n);var i,t=this.precision,r=this.rounding,s=t+4;return!e.s||!n.s?i=new this(NaN):!e.d&&!n.d?(i=L(this,s,1).times(n.s>0?.25:.75),i.s=e.s):!n.d||e.isZero()?(i=n.s<0?L(this,t,r):new this(0),i.s=e.s):!e.d||n.isZero()?(i=L(this,s,1).times(.5),i.s=e.s):n.s<0?(this.precision=s,this.rounding=1,i=this.atan(S(e,n,s,1)),n=L(this,s,1),this.precision=t,this.rounding=r,i=e.s<0?i.minus(n):i.plus(n)):i=this.atan(S(e,n,s,1)),i}function wn(e){return new this(e).cbrt()}function Nn(e){return p(e=new this(e),e.e+1,2)}function vn(e,n,i){return new this(e).clamp(n,i)}function En(e){if(!e||typeof e!="object")throw Error(oe+"Object expected");var n,i,t,r=e.defaults===!0,s=["precision",1,V,"rounding",0,8,"toExpNeg",-H,0,"toExpPos",0,H,"maxE",0,H,"minE",-H,0,"modulo",0,9];for(n=0;n=s[n+1]&&t<=s[n+2])this[i]=t;else throw Error($+i+": "+t);if(i="crypto",r&&(this[i]=Ne[i]),(t=e[i])!==void 0)if(t===!0||t===!1||t===0||t===1)if(t)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[i]=!0;else throw Error(De);else this[i]=!1;else throw Error($+i+": "+t);return this}function Sn(e){return new this(e).cos()}function kn(e){return new this(e).cosh()}function He(e){var n,i,t;function r(s){var o,u,l,f=this;if(!(f instanceof r))return new r(s);if(f.constructor=r,qe(s)){f.s=s.s,w?!s.d||s.e>r.maxE?(f.e=NaN,f.d=null):s.e=10;u/=10)o++;w?o>r.maxE?(f.e=NaN,f.d=null):o=429e7?n[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=r%1e7;else if(crypto.randomBytes){for(n=crypto.randomBytes(t*=4);s=214e7?crypto.randomBytes(4).copy(n,s):(u.push(r%1e7),s+=4);s=t/4}else throw Error(De);else for(;s=10;r/=10)t++;t - * MIT Licence - *) -*/ -//# sourceMappingURL=index-browser.js.map diff --git a/integration-tests/tests/prisma/pg/client/runtime/library.d.ts b/integration-tests/tests/prisma/pg/client/runtime/library.d.ts deleted file mode 100644 index 5e02beada..000000000 --- a/integration-tests/tests/prisma/pg/client/runtime/library.d.ts +++ /dev/null @@ -1,3193 +0,0 @@ -/** - * @param this - */ -declare function $extends(this: Client, extension: ExtensionArgs | ((client: Client) => Client)): Client; - -declare type AccelerateEngineConfig = { - inlineSchema: EngineConfig['inlineSchema']; - inlineSchemaHash: EngineConfig['inlineSchemaHash']; - env: EngineConfig['env']; - generator?: { - previewFeatures: string[]; - }; - inlineDatasources: EngineConfig['inlineDatasources']; - overrideDatasources: EngineConfig['overrideDatasources']; - clientVersion: EngineConfig['clientVersion']; - engineVersion: EngineConfig['engineVersion']; - logEmitter: EngineConfig['logEmitter']; - logQueries?: EngineConfig['logQueries']; - logLevel?: EngineConfig['logLevel']; - tracingHelper: EngineConfig['tracingHelper']; - accelerateUtils?: EngineConfig['accelerateUtils']; -}; - -export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'; - -export declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum'; - -export declare type AllModelsToStringIndex, K extends PropertyKey> = Args extends { - [P in K]: { - $allModels: infer AllModels; - }; -} ? { - [P in K]: Record; -} : {}; - -declare class AnyNull extends NullTypesEnumValue { -} - -export declare type Args = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : any; - -export declare type Args_3 = Args; - -/** - * Attributes is a map from string to attribute values. - * - * Note: only the own enumerable keys are counted as valid attribute keys. - */ -declare interface Attributes { - [attributeKey: string]: AttributeValue | undefined; -} - -/** - * Attribute values may be any non-nullish primitive value except an object. - * - * null or undefined attribute values are invalid and will result in undefined behavior. - */ -declare type AttributeValue = string | number | boolean | Array | Array | Array; - -export declare type BaseDMMF = Pick; - -declare type BatchArgs = { - queries: BatchQuery[]; - transaction?: { - isolationLevel?: IsolationLevel; - }; -}; - -declare type BatchInternalParams = { - requests: RequestParams[]; - customDataProxyFetch?: CustomDataProxyFetch; -}; - -declare type BatchQuery = { - model: string | undefined; - operation: string; - args: JsArgs | RawQueryArgs; -}; - -declare type BatchQueryEngineResult = QueryEngineResult | Error; - -declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise; - -declare type BatchQueryOptionsCbArgs = { - args: BatchArgs; - query: (args: BatchArgs, __internalParams?: BatchInternalParams) => Promise; - __internalParams: BatchInternalParams; -}; - -declare type BatchTransactionOptions = { - isolationLevel?: Transaction_2.IsolationLevel; -}; - -declare interface BinaryTargetsEnvValue { - fromEnvVar: string | null; - value: string; - native?: boolean; -} - -export declare type Call = (F & { - params: P; -})['returns']; - -declare interface CallSite { - getLocation(): LocationInFile | null; -} - -export declare type Cast = A extends W ? A : W; - -declare type Client = ReturnType extends new () => infer T ? T : never; - -export declare type ClientArg = { - [MethodName in string]: unknown; -}; - -export declare type ClientArgs = { - client: ClientArg; -}; - -export declare type ClientBuiltInProp = keyof DynamicClientExtensionThisBuiltin; - -declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum]; - -declare const ColumnTypeEnum: { - readonly Int32: 0; - readonly Int64: 1; - readonly Float: 2; - readonly Double: 3; - readonly Numeric: 4; - readonly Boolean: 5; - readonly Character: 6; - readonly Text: 7; - readonly Date: 8; - readonly Time: 9; - readonly DateTime: 10; - readonly Json: 11; - readonly Enum: 12; - readonly Bytes: 13; - readonly Set: 14; - readonly Uuid: 15; - readonly Int32Array: 64; - readonly Int64Array: 65; - readonly FloatArray: 66; - readonly DoubleArray: 67; - readonly NumericArray: 68; - readonly BooleanArray: 69; - readonly CharacterArray: 70; - readonly TextArray: 71; - readonly DateArray: 72; - readonly TimeArray: 73; - readonly DateTimeArray: 74; - readonly JsonArray: 75; - readonly EnumArray: 76; - readonly BytesArray: 77; - readonly UuidArray: 78; - readonly UnknownNumber: 128; -}; - -export declare type Compute = T extends Function ? T : { - [K in keyof T]: T[K]; -} & unknown; - -export declare type ComputeDeep = T extends Function ? T : { - [K in keyof T]: ComputeDeep; -} & unknown; - -declare type ComputedField = { - name: string; - needs: string[]; - compute: ResultArgsFieldCompute; -}; - -declare type ComputedFieldsMap = { - [fieldName: string]: ComputedField; -}; - -declare type ConnectionInfo = { - schemaName?: string; -}; - -declare interface Context { - /** - * Get a value from the context. - * - * @param key key which identifies a context value - */ - getValue(key: symbol): unknown; - /** - * Create a new context which inherits from this context and has - * the given key set to the given value. - * - * @param key context key for which to set the value - * @param value value to set for the given key - */ - setValue(key: symbol, value: unknown): Context; - /** - * Return a new context which inherits from this context but does - * not contain a value for the given key. - * - * @param key context key for which to clear a value - */ - deleteValue(key: symbol): Context; -} - -declare type Context_2 = T extends { - [K: symbol]: { - ctx: infer C; - }; -} ? C & T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -} : T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -}; - -export declare type Count = { - [K in keyof O]: Count; -} & {}; - -declare type CustomDataProxyFetch = (fetch: Fetch) => Fetch; - -declare class DataLoader { - private options; - batches: { - [key: string]: Job[]; - }; - private tickActive; - constructor(options: DataLoaderOptions); - request(request: T): Promise; - private dispatchBatches; - get [Symbol.toStringTag](): string; -} - -declare type DataLoaderOptions = { - singleLoader: (request: T) => Promise; - batchLoader: (request: T[]) => Promise; - batchBy: (request: T) => string | undefined; - batchOrder: (requestA: T, requestB: T) => number; -}; - -declare type Datasource = { - url?: string; -}; - -declare type Datasources = { - [name in string]: Datasource; -}; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare const Debug: typeof debugCreate & { - enable(namespace: any): void; - disable(): any; - enabled(namespace: string): boolean; - log: (...args: string[]) => void; - formatters: {}; -}; - -/** - * Create a new debug instance with the given namespace. - * - * @example - * ```ts - * import Debug from '@prisma/debug' - * const debug = Debug('prisma:client') - * debug('Hello World') - * ``` - */ -declare function debugCreate(namespace: string): ((...args: any[]) => void) & { - color: string; - enabled: boolean; - namespace: string; - log: (...args: string[]) => void; - extend: () => void; -}; - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -/** - * Interface for any Decimal.js-like library - * Allows us to accept Decimal.js from different - * versions and some compatible alternatives - */ -export declare interface DecimalJsLike { - d: number[]; - e: number; - s: number; - toFixed(): string; -} - -export declare type DefaultArgs = InternalArgs<{}, {}, {}, {}>; - -export declare type DefaultSelection

= UnwrapPayload<{ - default: P; -}>['default']; - -export declare function defineDmmfProperty(target: object, runtimeDataModel: RuntimeDataModel): void; - -declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Client)): (client: Client) => Client; - -declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"]; - -export declare type DevTypeMapDef = { - meta: { - modelProps: string; - }; - model: { - [Model in PropertyKey]: { - [Operation in PropertyKey]: DevTypeMapFnDef; - }; - }; - other: { - [Operation in PropertyKey]: DevTypeMapFnDef; - }; -}; - -export declare type DevTypeMapFnDef = { - args: any; - result: any; - payload: OperationPayload; -}; - -export declare namespace DMMF { - export type Document = ReadonlyDeep_2<{ - datamodel: Datamodel; - schema: Schema; - mappings: Mappings; - }>; - export type Mappings = ReadonlyDeep_2<{ - modelOperations: ModelMapping[]; - otherOperations: { - read: string[]; - write: string[]; - }; - }>; - export type OtherOperationMappings = ReadonlyDeep_2<{ - read: string[]; - write: string[]; - }>; - export type DatamodelEnum = ReadonlyDeep_2<{ - name: string; - values: EnumValue[]; - dbName?: string | null; - documentation?: string; - }>; - export type SchemaEnum = ReadonlyDeep_2<{ - name: string; - values: string[]; - }>; - export type EnumValue = ReadonlyDeep_2<{ - name: string; - dbName: string | null; - }>; - export type Datamodel = ReadonlyDeep_2<{ - models: Model[]; - enums: DatamodelEnum[]; - types: Model[]; - }>; - export type uniqueIndex = ReadonlyDeep_2<{ - name: string; - fields: string[]; - }>; - export type PrimaryKey = ReadonlyDeep_2<{ - name: string | null; - fields: string[]; - }>; - export type Model = ReadonlyDeep_2<{ - name: string; - dbName: string | null; - fields: Field[]; - uniqueFields: string[][]; - uniqueIndexes: uniqueIndex[]; - documentation?: string; - primaryKey: PrimaryKey | null; - isGenerated?: boolean; - }>; - export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'; - export type FieldNamespace = 'model' | 'prisma'; - export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes'; - export type Field = ReadonlyDeep_2<{ - kind: FieldKind; - name: string; - isRequired: boolean; - isList: boolean; - isUnique: boolean; - isId: boolean; - isReadOnly: boolean; - isGenerated?: boolean; - isUpdatedAt?: boolean; - /** - * Describes the data type in the same the way it is defined in the Prisma schema: - * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName - */ - type: string; - dbName?: string | null; - hasDefaultValue: boolean; - default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[]; - relationFromFields?: string[]; - relationToFields?: string[]; - relationOnDelete?: string; - relationName?: string; - documentation?: string; - }>; - export type FieldDefault = ReadonlyDeep_2<{ - name: string; - args: any[]; - }>; - export type FieldDefaultScalar = string | boolean | number; - export type Schema = ReadonlyDeep_2<{ - rootQueryType?: string; - rootMutationType?: string; - inputObjectTypes: { - model?: InputType[]; - prisma: InputType[]; - }; - outputObjectTypes: { - model: OutputType[]; - prisma: OutputType[]; - }; - enumTypes: { - model?: SchemaEnum[]; - prisma: SchemaEnum[]; - }; - fieldRefTypes: { - prisma?: FieldRefType[]; - }; - }>; - export type Query = ReadonlyDeep_2<{ - name: string; - args: SchemaArg[]; - output: QueryOutput; - }>; - export type QueryOutput = ReadonlyDeep_2<{ - name: string; - isRequired: boolean; - isList: boolean; - }>; - export type TypeRef = { - isList: boolean; - type: string; - location: AllowedLocations; - namespace?: FieldNamespace; - }; - export type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>; - export type SchemaArg = ReadonlyDeep_2<{ - name: string; - comment?: string; - isNullable: boolean; - isRequired: boolean; - inputTypes: InputTypeRef[]; - deprecation?: Deprecation; - }>; - export type OutputType = ReadonlyDeep_2<{ - name: string; - fields: SchemaField[]; - }>; - export type SchemaField = ReadonlyDeep_2<{ - name: string; - isNullable?: boolean; - outputType: OutputTypeRef; - args: SchemaArg[]; - deprecation?: Deprecation; - documentation?: string; - }>; - export type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>; - export type Deprecation = ReadonlyDeep_2<{ - sinceVersion: string; - reason: string; - plannedRemovalVersion?: string; - }>; - export type InputType = ReadonlyDeep_2<{ - name: string; - constraints: { - maxNumFields: number | null; - minNumFields: number | null; - fields?: string[]; - }; - meta?: { - source?: string; - }; - fields: SchemaArg[]; - }>; - export type FieldRefType = ReadonlyDeep_2<{ - name: string; - allowTypes: FieldRefAllowType[]; - fields: SchemaArg[]; - }>; - export type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>; - export type ModelMapping = ReadonlyDeep_2<{ - model: string; - plural: string; - findUnique?: string | null; - findUniqueOrThrow?: string | null; - findFirst?: string | null; - findFirstOrThrow?: string | null; - findMany?: string | null; - create?: string | null; - createMany?: string | null; - createManyAndReturn?: string | null; - update?: string | null; - updateMany?: string | null; - upsert?: string | null; - delete?: string | null; - deleteMany?: string | null; - aggregate?: string | null; - groupBy?: string | null; - count?: string | null; - findRaw?: string | null; - aggregateRaw?: string | null; - }>; - export enum ModelAction { - findUnique = "findUnique", - findUniqueOrThrow = "findUniqueOrThrow", - findFirst = "findFirst", - findFirstOrThrow = "findFirstOrThrow", - findMany = "findMany", - create = "create", - createMany = "createMany", - createManyAndReturn = "createManyAndReturn", - update = "update", - updateMany = "updateMany", - upsert = "upsert", - delete = "delete", - deleteMany = "deleteMany", - groupBy = "groupBy", - count = "count",// TODO: count does not actually exist, why? - aggregate = "aggregate", - findRaw = "findRaw", - aggregateRaw = "aggregateRaw" - } -} - -export declare interface DriverAdapter extends Queryable { - /** - * Starts new transaction. - */ - startTransaction(): Promise>; - /** - * Optional method that returns extra connection info - */ - getConnectionInfo?(): Result_4; -} - -/** Client */ -export declare type DynamicClientExtensionArgs> = { - [P in keyof C_]: unknown; -} & { - [K: symbol]: { - ctx: Optional, ITXClientDenyList> & { - $parent: Optional, ITXClientDenyList>; - }; - }; -}; - -export declare type DynamicClientExtensionThis> = { - [P in keyof ExtArgs['client']]: Return; -} & { - [P in Exclude]: DynamicModelExtensionThis, ExtArgs>; -} & { - [P in Exclude]: >(...args: ToTuple) => PrismaPromise; -} & { - [P in Exclude]: DynamicClientExtensionThisBuiltin[P]; -} & { - [K: symbol]: { - types: TypeMap['other']; - }; -}; - -export declare type DynamicClientExtensionThisBuiltin> = { - $extends: ExtendsHook<'extends', TypeMapCb, ExtArgs>; - $transaction

[]>(arg: [...P], options?: { - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise>; - $transaction(fn: (client: Omit, ITXClientDenyList>) => Promise, options?: { - maxWait?: number; - timeout?: number; - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise; - $disconnect(): Promise; - $connect(): Promise; -}; - -/** Model */ -export declare type DynamicModelExtensionArgs> = { - [K in keyof M_]: K extends '$allModels' ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: {}; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: { - ctx: DynamicModelExtensionThis, ExtArgs> & { - $parent: DynamicClientExtensionThis; - } & { - $name: ModelKey; - } & { - /** - * @deprecated Use `$name` instead. - */ - name: ModelKey; - }; - }; - } : never; -}; - -export declare type DynamicModelExtensionFluentApi = { - [K in keyof TypeMap['model'][M]['payload']['objects']]: (args?: Exact>) => PrismaPromise, [K]> | Null> & DynamicModelExtensionFluentApi>; -}; - -export declare type DynamicModelExtensionFnResult> = P extends FluentOperation ? DynamicModelExtensionFluentApi & PrismaPromise | Null> : PrismaPromise>; - -export declare type DynamicModelExtensionFnResultBase = GetResult; - -export declare type DynamicModelExtensionFnResultNull

= P extends 'findUnique' | 'findFirst' ? null : never; - -export declare type DynamicModelExtensionOperationFn = {} extends TypeMap['model'][M]['operations'][P]['args'] ? (args?: Exact) => DynamicModelExtensionFnResult : (args: Exact) => DynamicModelExtensionFnResult; - -export declare type DynamicModelExtensionThis> = { - [P in keyof ExtArgs['model'][Uncapitalize]]: Return][P]>; -} & { - [P in Exclude]>]: DynamicModelExtensionOperationFn; -} & { - [P in Exclude<'fields', keyof ExtArgs['model'][Uncapitalize]>]: TypeMap['model'][M]['fields']; -} & { - [K: symbol]: { - types: TypeMap['model'][M]; - }; -}; - -/** Query */ -export declare type DynamicQueryExtensionArgs = { - [K in keyof Q_]: K extends '$allOperations' ? (args: { - model?: string; - operation: string; - args: any; - query: (args: any) => PrismaPromise; - }) => Promise : K extends '$allModels' ? { - [P in keyof Q_[K] | keyof TypeMap['model'][keyof TypeMap['model']]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb : P extends keyof TypeMap['model'][keyof TypeMap['model']]['operations'] ? DynamicQueryExtensionCb : never; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof Q_[K] | keyof TypeMap['model'][ModelKey]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb, keyof TypeMap['model'][ModelKey]['operations']> : P extends keyof TypeMap['model'][ModelKey]['operations'] ? DynamicQueryExtensionCb, P> : never; - } : K extends keyof TypeMap['other']['operations'] ? DynamicQueryExtensionCb<[TypeMap], 0, 'other', K> : never; -}; - -export declare type DynamicQueryExtensionCb = >(args: A) => Promise; - -export declare type DynamicQueryExtensionCbArgs = (_1 extends unknown ? _2 extends unknown ? { - args: DynamicQueryExtensionCbArgsArgs; - model: _0 extends 0 ? undefined : _1; - operation: _2; - query: >(args: A) => PrismaPromise; -} : never : never) & { - query: (args: DynamicQueryExtensionCbArgsArgs) => PrismaPromise; -}; - -export declare type DynamicQueryExtensionCbArgsArgs = _2 extends '$queryRaw' | '$executeRaw' ? Sql : TypeMap[_0][_1]['operations'][_2]['args']; - -/** Result */ -export declare type DynamicResultExtensionArgs = { - [K in keyof R_]: { - [P in keyof R_[K]]?: { - needs?: DynamicResultExtensionNeeds, R_[K][P]>; - compute(data: DynamicResultExtensionData, R_[K][P]>): any; - }; - }; -}; - -export declare type DynamicResultExtensionData = GetFindResult; - -export declare type DynamicResultExtensionNeeds = { - [K in keyof S]: K extends keyof TypeMap['model'][M]['payload']['scalars'] ? S[K] : never; -} & { - [N in keyof TypeMap['model'][M]['payload']['scalars']]?: boolean; -}; - -/** - * Placeholder value for "no text". - */ -export declare const empty: Sql; - -export declare type EmptyToUnknown = T; - -declare interface Engine { - /** The name of the engine. This is meant to be consumed externally */ - readonly name: string; - onBeforeExit(callback: () => Promise): void; - start(): Promise; - stop(): Promise; - version(forceRun?: boolean): Promise | string; - request(query: JsonQuery, options: RequestOptions_2): Promise>; - requestBatch(queries: JsonQuery[], options: RequestBatchOptions): Promise[]>; - transaction(action: 'start', headers: Transaction_2.TransactionHeaders, options: Transaction_2.Options): Promise>; - transaction(action: 'commit', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; - transaction(action: 'rollback', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; - metrics(options: MetricsOptionsJson): Promise; - metrics(options: MetricsOptionsPrometheus): Promise; - applyPendingMigrations(): Promise; -} - -declare interface EngineConfig { - cwd: string; - dirname: string; - datamodelPath: string; - enableDebugLogs?: boolean; - allowTriggerPanic?: boolean; - prismaPath?: string; - generator?: GeneratorConfig; - overrideDatasources: Datasources; - showColors?: boolean; - logQueries?: boolean; - logLevel?: 'info' | 'warn'; - env: Record; - flags?: string[]; - clientVersion: string; - engineVersion: string; - previewFeatures?: string[]; - engineEndpoint?: string; - activeProvider?: string; - logEmitter: LogEmitter; - transactionOptions: Transaction_2.Options; - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`. - * If set, this is only used in the library engine, and all queries would be performed through it, - * rather than Prisma's Rust drivers. - * @remarks only used by LibraryEngine.ts - */ - adapter?: ErrorCapturingDriverAdapter; - /** - * The contents of the schema encoded into a string - * @remarks only used by DataProxyEngine.ts - */ - inlineSchema: string; - /** - * The contents of the datasource url saved in a string - * @remarks only used by DataProxyEngine.ts - */ - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - /** - * The string hash that was produced for a given schema - * @remarks only used by DataProxyEngine.ts - */ - inlineSchemaHash: string; - /** - * The helper for interaction with OTEL tracing - * @remarks enabling is determined by the client and @prisma/instrumentation package - */ - tracingHelper: TracingHelper; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * Web Assembly module loading configuration - */ - engineWasm?: WasmLoadingConfig; - /** - * Allows Accelerate to use runtime utilities from the client. These are - * necessary for the AccelerateEngine to function correctly. - */ - accelerateUtils?: { - resolveDatasourceUrl: typeof resolveDatasourceUrl; - getBatchRequestPayload: typeof getBatchRequestPayload; - prismaGraphQLToJSError: typeof prismaGraphQLToJSError; - PrismaClientUnknownRequestError: typeof PrismaClientUnknownRequestError; - PrismaClientInitializationError: typeof PrismaClientInitializationError; - PrismaClientKnownRequestError: typeof PrismaClientKnownRequestError; - debug: (...args: any[]) => void; - engineVersion: string; - clientVersion: string; - }; -} - -declare type EngineEvent = E extends QueryEventType ? QueryEvent : LogEvent; - -declare type EngineEventType = QueryEventType | LogEventType; - -declare type EngineProtocol = 'graphql' | 'json'; - -declare type EngineSpan = { - span: boolean; - name: string; - trace_id: string; - span_id: string; - parent_span_id: string; - start_time: [number, number]; - end_time: [number, number]; - attributes?: Record; - links?: { - trace_id: string; - span_id: string; - }[]; -}; - -declare type EngineSpanEvent = { - span: boolean; - spans: EngineSpan[]; -}; - -declare interface EnvValue { - fromEnvVar: null | string; - value: null | string; -} - -export declare type Equals = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? 1 : 0; - -declare type Error_2 = { - kind: 'GenericJs'; - id: number; -} | { - kind: 'UnsupportedNativeDataType'; - type: string; -} | { - kind: 'Postgres'; - code: string; - severity: string; - message: string; - detail: string | undefined; - column: string | undefined; - hint: string | undefined; -} | { - kind: 'Mysql'; - code: number; - message: string; - state: string; -} | { - kind: 'Sqlite'; - /** - * Sqlite extended error code: https://www.sqlite.org/rescode.html - */ - extendedCode: number; - message: string; -}; - -declare interface ErrorCapturingDriverAdapter extends DriverAdapter { - readonly errorRegistry: ErrorRegistry; -} - -declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal'; - -declare type ErrorRecord = { - error: unknown; -}; - -declare interface ErrorRegistry { - consumeError(id: number): ErrorRecord | undefined; -} - -declare interface ErrorWithBatchIndex { - batchRequestIdx?: number; -} - -declare type EventCallback = [E] extends ['beforeExit'] ? () => Promise : [E] extends [LogLevel] ? (event: EngineEvent) => void : never; - -export declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof A]: Exact; -} : W) : never) | (A extends Narrowable ? A : never); - -/** - * Defines Exception. - * - * string or an object with one of (message or name or code) and optional stack - */ -declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string; - -declare interface ExceptionWithCode { - code: string | number; - name?: string; - message?: string; - stack?: string; -} - -declare interface ExceptionWithMessage { - code?: string | number; - message: string; - name?: string; - stack?: string; -} - -declare interface ExceptionWithName { - code?: string | number; - message?: string; - name: string; - stack?: string; -} - -declare type ExtendedEventType = LogLevel | 'beforeExit'; - -declare type ExtendedSpanOptions = SpanOptions & { - /** The name of the span */ - name: string; - internal?: boolean; - middleware?: boolean; - /** Whether it propagates context (?=true) */ - active?: boolean; - /** The context to append the span to */ - context?: Context; -}; - -/** $extends, defineExtension */ -export declare interface ExtendsHook, TypeMap extends TypeMapDef = Call> { - extArgs: ExtArgs; - , MergedArgs extends InternalArgs = MergeExtArgs>(extension: ((client: DynamicClientExtensionThis) => { - $extends: { - extArgs: Args; - }; - }) | { - name?: string; - query?: DynamicQueryExtensionArgs; - result?: DynamicResultExtensionArgs & R; - model?: DynamicModelExtensionArgs & M; - client?: DynamicClientExtensionArgs & C; - }): { - extends: DynamicClientExtensionThis, TypeMapCb, MergedArgs>; - define: (client: any) => { - $extends: { - extArgs: Args; - }; - }; - }[Variant]; -} - -export declare type ExtensionArgs = Optional; - -declare namespace Extensions { - export { - defineExtension, - getExtensionContext - } -} -export { Extensions } - -declare namespace Extensions_2 { - export { - InternalArgs, - DefaultArgs, - GetPayloadResult, - GetSelect, - GetOmit, - DynamicQueryExtensionArgs, - DynamicQueryExtensionCb, - DynamicQueryExtensionCbArgs, - DynamicQueryExtensionCbArgsArgs, - DynamicResultExtensionArgs, - DynamicResultExtensionNeeds, - DynamicResultExtensionData, - DynamicModelExtensionArgs, - DynamicModelExtensionThis, - DynamicModelExtensionOperationFn, - DynamicModelExtensionFnResult, - DynamicModelExtensionFnResultBase, - DynamicModelExtensionFluentApi, - DynamicModelExtensionFnResultNull, - DynamicClientExtensionArgs, - DynamicClientExtensionThis, - ClientBuiltInProp, - DynamicClientExtensionThisBuiltin, - ExtendsHook, - MergeExtArgs, - AllModelsToStringIndex, - TypeMapDef, - DevTypeMapDef, - DevTypeMapFnDef, - TypeMapCbDef, - ModelKey, - RequiredExtensionArgs as UserArgs - } -} - -declare type Fetch = typeof nodeFetch; - -/** - * A reference to a specific field of a specific model - */ -export declare interface FieldRef { - readonly modelName: Model; - readonly name: string; - readonly typeName: FieldType; - readonly isList: boolean; -} - -export declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete'; - -export declare interface Fn { - params: Params; - returns: Returns; -} - -declare interface GeneratorConfig { - name: string; - output: EnvValue | null; - isCustomOutput?: boolean; - provider: EnvValue; - config: { - /** `output` is a reserved name and will only be available directly at `generator.output` */ - output?: never; - /** `provider` is a reserved name and will only be available directly at `generator.provider` */ - provider?: never; - /** `binaryTargets` is a reserved name and will only be available directly at `generator.binaryTargets` */ - binaryTargets?: never; - /** `previewFeatures` is a reserved name and will only be available directly at `generator.previewFeatures` */ - previewFeatures?: never; - } & { - [key: string]: string | string[] | undefined; - }; - binaryTargets: BinaryTargetsEnvValue[]; - previewFeatures: string[]; -} - -export declare type GetAggregateResult

= { - [K in keyof A as K extends Aggregate ? K : never]: K extends '_count' ? A[K] extends true ? number : Count : { - [J in keyof A[K] & string]: P['scalars'][J] | null; - }; -}; - -declare function getBatchRequestPayload(batch: JsonQuery[], transaction?: TransactionOptions_2): QueryEngineBatchRequest; - -export declare type GetBatchResult = { - count: number; -}; - -export declare type GetCountResult = A extends { - select: infer S; -} ? (S extends true ? number : Count) : number; - -declare function getExtensionContext(that: T): Context_2; - -export declare type GetFindResult

= A extends { - omit: infer Omission; -} ? Compute, TrueKeys>> : GetSelectIncludeResult; - -export declare type GetGroupByResult

= A extends { - by: string[]; -} ? Array & { - [K in A['by'][number]]: P['scalars'][K]; -}> : A extends { - by: string; -} ? Array & { - [K in A['by']]: P['scalars'][K]; -}> : {}[]; - -export declare type GetOmit = { - [K in (string extends keyof R ? never : keyof R) | BaseKeys]?: boolean; -}; - -export declare type GetPayloadResult, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = unknown extends R ? Base : { - [K in KR | keyof Base]: K extends KR ? R[K] extends () => { - compute: (...args: any) => infer C; - } ? C : never : Base[K]; -}; - -export declare function getPrismaClient(config: GetPrismaClientConfig): { - new (optionsArg?: PrismaClientOptions): { - _originalClient: any; - _runtimeDataModel: RuntimeDataModel; - _requestHandler: RequestHandler; - _connectionPromise?: Promise | undefined; - _disconnectionPromise?: Promise | undefined; - _engineConfig: EngineConfig; - _accelerateEngineConfig: AccelerateEngineConfig; - _clientVersion: string; - _errorFormat: ErrorFormat; - _tracingHelper: TracingHelper; - _metrics: MetricsClient; - _middlewares: MiddlewareHandler; - _previewFeatures: string[]; - _activeProvider: string; - _extensions: MergedExtensionsList; - _engine: Engine; - /** - * A fully constructed/applied Client that references the parent - * PrismaClient. This is used for Client extensions only. - */ - _appliedParent: any; - _createPrismaPromise: PrismaPromiseFactory; - /** - * Hook a middleware into the client - * @param middleware to hook - */ - $use(middleware: QueryMiddleware): void; - $on(eventType: E, callback: EventCallback): void; - $connect(): Promise; - /** - * Disconnect from the database - */ - $disconnect(): Promise; - /** - * Executes a raw query and always returns a number - */ - $executeRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; - /** - * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; - /** - * Executes a raw command only for MongoDB - * - * @param command - * @returns - */ - $runCommandRaw(command: Record): PrismaPromise_2; - /** - * Executes a raw query and returns selected data - */ - $queryRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; - /** - * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; - /** - * Execute a batch of requests in a transaction - * @param requests - * @param options - */ - _transactionWithArray({ promises, options, }: { - promises: Array>; - options?: BatchTransactionOptions; - }): Promise; - /** - * Perform a long-running transaction - * @param callback - * @param options - * @returns - */ - _transactionWithCallback({ callback, options, }: { - callback: (client: Client) => Promise; - options?: Options; - }): Promise; - _createItxClient(transaction: PrismaPromiseInteractiveTransaction): Client; - /** - * Execute queries within a transaction - * @param input a callback or a query list - * @param options to set timeouts (callback) - * @returns - */ - $transaction(input: any, options?: any): Promise; - /** - * Runs the middlewares over params before executing a request - * @param internalParams - * @returns - */ - _request(internalParams: InternalRequestParams): Promise; - _executeRequest({ args, clientMethod, dataPath, callsite, action, model, argsMapper, transaction, unpacker, otelParentCtx, customDataProxyFetch, }: InternalRequestParams): Promise; - readonly $metrics: MetricsClient; - /** - * Shortcut for checking a preview flag - * @param feature preview flag - * @returns - */ - _hasPreviewFlag(feature: string): boolean; - $applyPendingMigrations(): Promise; - $extends: typeof $extends; - readonly [Symbol.toStringTag]: string; - }; -}; - -/** - * Config that is stored into the generated client. When the generated client is - * loaded, this same config is passed to {@link getPrismaClient} which creates a - * closure with that config around a non-instantiated [[PrismaClient]]. - */ -declare type GetPrismaClientConfig = { - runtimeDataModel: RuntimeDataModel; - generator?: GeneratorConfig; - relativeEnvPaths: { - rootEnvPath?: string | null; - schemaEnvPath?: string | null; - }; - relativePath: string; - dirname: string; - filename?: string; - clientVersion: string; - engineVersion: string; - datasourceNames: string[]; - activeProvider: string; - /** - * The contents of the schema encoded into a string - * @remarks only used for the purpose of data proxy - */ - inlineSchema: string; - /** - * A special env object just for the data proxy edge runtime. - * Allows bundlers to inject their own env variables (Vercel). - * Allows platforms to declare global variables as env (Workers). - * @remarks only used for the purpose of data proxy - */ - injectableEdgeEnv?: () => LoadedEnv; - /** - * The contents of the datasource url saved in a string. - * This can either be an env var name or connection string. - * It is needed by the client to connect to the Data Proxy. - * @remarks only used for the purpose of data proxy - */ - inlineDatasources: { - [name in string]: { - url: EnvValue; - }; - }; - /** - * The string hash that was produced for a given schema - * @remarks only used for the purpose of data proxy - */ - inlineSchemaHash: string; - /** - * A marker to indicate that the client was not generated via `prisma - * generate` but was generated via `generate --postinstall` script instead. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - postinstall?: boolean; - /** - * Information about the CI where the Prisma Client has been generated. The - * name of the CI environment is stored at generation time because CI - * information is not always available at runtime. Moreover, the edge client - * has no notion of environment variables, so this works around that. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - ciName?: string; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * A boolean that is `false` when the client was generated with --no-engine. At - * runtime, this means the client will be bound to be using the Data Proxy. - */ - copyEngine?: boolean; - /** - * Optional wasm loading configuration - */ - engineWasm?: WasmLoadingConfig; -}; - -export declare type GetResult

= { - findUnique: GetFindResult | null; - findUniqueOrThrow: GetFindResult; - findFirst: GetFindResult | null; - findFirstOrThrow: GetFindResult; - findMany: GetFindResult[]; - create: GetFindResult; - createMany: GetBatchResult; - createManyAndReturn: GetFindResult[]; - update: GetFindResult; - updateMany: GetBatchResult; - upsert: GetFindResult; - delete: GetFindResult; - deleteMany: GetBatchResult; - aggregate: GetAggregateResult; - count: GetCountResult; - groupBy: GetGroupByResult; - $queryRaw: unknown; - $executeRaw: number; - $queryRawUnsafe: unknown; - $executeRawUnsafe: number; - $runCommandRaw: JsonObject; - findRaw: JsonObject; - aggregateRaw: JsonObject; -}[O]; - -export declare function getRuntime(): GetRuntimeOutput; - -declare type GetRuntimeOutput = { - id: Runtime; - prettyName: string; - isEdge: boolean; -}; - -export declare type GetSelect, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = { - [K in KR | keyof Base]?: K extends KR ? boolean : Base[K]; -}; - -export declare type GetSelectIncludeResult

= Equals extends 1 ? DefaultSelection

: A extends { - select: infer S extends object; -} & Record | { - include: infer I extends object; -} & Record ? { - [K in keyof S | keyof I as (S & I)[K] extends false | undefined | null ? never : K]: (S & I)[K] extends object ? P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult | SelectField & null : never : K extends '_count' ? Count> : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection | SelectField & null : never : P extends { - scalars: { - [k in K]: infer O; - }; - } ? O : K extends '_count' ? Count : never; -} & (A extends { - include: any; -} & Record ? DefaultSelection

: unknown) : DefaultSelection

; - -declare type HandleErrorParams = { - args: JsArgs; - error: any; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - modelName?: string; -}; - -/** - * Defines High-Resolution Time. - * - * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. - * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. - * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. - * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds: - * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. - * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: - * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000. - * This is represented in HrTime format as [1609504210, 150000000]. - */ -declare type HrTime = [number, number]; - -declare type InteractiveTransactionInfo = { - /** - * Transaction ID returned by the query engine. - */ - id: string; - /** - * Arbitrary payload the meaning of which depends on the `Engine` implementation. - * For example, `DataProxyEngine` needs to associate different API endpoints with transactions. - * In `LibraryEngine` and `BinaryEngine` it is currently not used. - */ - payload: Payload; -}; - -declare type InteractiveTransactionOptions = Transaction_2.InteractiveTransactionInfo; - -export declare type InternalArgs = { - result: { - [K in keyof R]: { - [P in keyof R[K]]: () => R[K][P]; - }; - }; - model: { - [K in keyof M]: { - [P in keyof M[K]]: () => M[K][P]; - }; - }; - query: { - [K in keyof Q]: { - [P in keyof Q[K]]: () => Q[K][P]; - }; - }; - client: { - [K in keyof C]: () => C[K]; - }; -}; - -declare type InternalRequestParams = { - /** - * The original client method being called. - * Even though the rootField / operation can be changed, - * this method stays as it is, as it's what the user's - * code looks like - */ - clientMethod: string; - /** - * Name of js model that triggered the request. Might be used - * for warnings or error messages - */ - jsModelName?: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - unpacker?: Unpacker; - otelParentCtx?: Context; - /** Used to "desugar" a user input into an "expanded" one */ - argsMapper?: (args?: UserArgs_2) => UserArgs_2; - /** Used to convert args for middleware and back */ - middlewareArgsMapper?: MiddlewareArgsMapper; - /** Used for Accelerate client extension via Data Proxy */ - customDataProxyFetch?: (fetch: Fetch) => Fetch; -} & Omit; - -declare enum IsolationLevel { - ReadUncommitted = "ReadUncommitted", - ReadCommitted = "ReadCommitted", - RepeatableRead = "RepeatableRead", - Snapshot = "Snapshot", - Serializable = "Serializable" -} - -export declare type ITXClientDenyList = (typeof denylist)[number]; - -export declare const itxClientDenyList: readonly (string | symbol)[]; - -declare interface Job { - resolve: (data: any) => void; - reject: (data: any) => void; - request: any; -} - -/** - * Create a SQL query for a list of values. - */ -export declare function join(values: readonly RawValue[], separator?: string, prefix?: string, suffix?: string): Sql; - -export declare type JsArgs = { - select?: Selection_2; - include?: Selection_2; - omit?: Omission; - [argName: string]: JsInputValue; -}; - -export declare type JsInputValue = null | undefined | string | number | boolean | bigint | Uint8Array | Date | DecimalJsLike | ObjectEnumValue | RawParameters | JsonConvertible | FieldRef | JsInputValue[] | { - [key: string]: JsInputValue; -}; - -declare type JsonArgumentValue = number | string | boolean | null | RawTaggedValue | JsonArgumentValue[] | { - [key: string]: JsonArgumentValue; -}; - -export declare interface JsonArray extends Array { -} - -declare type JsonBatchQuery = { - batch: JsonQuery[]; - transaction?: { - isolationLevel?: Transaction_2.IsolationLevel; - }; -}; - -export declare interface JsonConvertible { - toJSON(): unknown; -} - -declare type JsonFieldSelection = { - arguments?: Record | RawTaggedValue; - selection: JsonSelectionSet; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -export declare type JsonObject = { - [Key in string]?: JsonValue; -}; - -declare type JsonQuery = { - modelName?: string; - action: JsonQueryAction; - query: JsonFieldSelection; -}; - -declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw'; - -declare type JsonSelectionSet = { - $scalars?: boolean; - $composites?: boolean; -} & { - [fieldName: string]: boolean | JsonFieldSelection; -}; - -export declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null; - -export declare type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | { - [key: string]: JsOutputValue; -}; - -export declare type JsPromise = Promise & {}; - -declare type KnownErrorParams = { - code: string; - clientVersion: string; - meta?: Record; - batchRequestIdx?: number; -}; - -/** - * A pointer from the current {@link Span} to another span in the same trace or - * in a different trace. - * Few examples of Link usage. - * 1. Batch Processing: A batch of elements may contain elements associated - * with one or more traces/spans. Since there can only be one parent - * SpanContext, Link is used to keep reference to SpanContext of all - * elements in the batch. - * 2. Public Endpoint: A SpanContext in incoming client request on a public - * endpoint is untrusted from service provider perspective. In such case it - * is advisable to start a new trace with appropriate sampling decision. - * However, it is desirable to associate incoming SpanContext to new trace - * initiated on service provider side so two traces (from Client and from - * Service Provider) can be correlated. - */ -declare interface Link { - /** The {@link SpanContext} of a linked span. */ - context: SpanContext; - /** A set of {@link SpanAttributes} on the link. */ - attributes?: SpanAttributes; - /** Count of attributes of the link that were dropped due to collection limits */ - droppedAttributesCount?: number; -} - -declare type LoadedEnv = { - message?: string; - parsed: { - [x: string]: string; - }; -} | undefined; - -declare type LocationInFile = { - fileName: string; - lineNumber: number | null; - columnNumber: number | null; -}; - -declare type LogDefinition = { - level: LogLevel; - emit: 'stdout' | 'event'; -}; - -/** - * Typings for the events we emit. - * - * @remarks - * If this is updated, our edge runtime shim needs to be updated as well. - */ -declare type LogEmitter = { - on(event: E, listener: (event: EngineEvent) => void): LogEmitter; - emit(event: QueryEventType, payload: QueryEvent): boolean; - emit(event: LogEventType, payload: LogEvent): boolean; -}; - -declare type LogEvent = { - timestamp: Date; - message: string; - target: string; -}; - -declare type LogEventType = 'info' | 'warn' | 'error'; - -declare type LogLevel = 'info' | 'query' | 'warn' | 'error'; - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -/** - * Class that holds the list of all extensions, applied to particular instance, - * as well as resolved versions of the components that need to apply on - * different levels. Main idea of this class: avoid re-resolving as much of the - * stuff as possible when new extensions are added while also delaying the - * resolve until the point it is actually needed. For example, computed fields - * of the model won't be resolved unless the model is actually queried. Neither - * adding extensions with `client` component only cause other components to - * recompute. - */ -declare class MergedExtensionsList { - private head?; - private constructor(); - static empty(): MergedExtensionsList; - static single(extension: ExtensionArgs): MergedExtensionsList; - isEmpty(): boolean; - append(extension: ExtensionArgs): MergedExtensionsList; - getAllComputedFields(dmmfModelName: string): ComputedFieldsMap | undefined; - getAllClientExtensions(): ClientArg | undefined; - getAllModelExtensions(dmmfModelName: string): ModelArg | undefined; - getAllQueryCallbacks(jsModelName: string, operation: string): any; - getAllBatchQueryCallbacks(): BatchQueryOptionsCb[]; -} - -export declare type MergeExtArgs, Args extends Record> = ComputeDeep & AllModelsToStringIndex>; - -export declare type Metric = { - key: string; - value: T; - labels: Record; - description: string; -}; - -export declare type MetricHistogram = { - buckets: MetricHistogramBucket[]; - sum: number; - count: number; -}; - -export declare type MetricHistogramBucket = [maxValue: number, count: number]; - -export declare type Metrics = { - counters: Metric[]; - gauges: Metric[]; - histograms: Metric[]; -}; - -export declare class MetricsClient { - private _engine; - constructor(engine: Engine); - /** - * Returns all metrics gathered up to this point in prometheus format. - * Result of this call can be exposed directly to prometheus scraping endpoint - * - * @param options - * @returns - */ - prometheus(options?: MetricsOptions): Promise; - /** - * Returns all metrics gathered up to this point in prometheus format. - * - * @param options - * @returns - */ - json(options?: MetricsOptions): Promise; -} - -declare type MetricsOptions = { - /** - * Labels to add to every metrics in key-value format - */ - globalLabels?: Record; -}; - -declare type MetricsOptionsCommon = { - globalLabels?: Record; -}; - -declare type MetricsOptionsJson = { - format: 'json'; -} & MetricsOptionsCommon; - -declare type MetricsOptionsPrometheus = { - format: 'prometheus'; -} & MetricsOptionsCommon; - -declare type MiddlewareArgsMapper = { - requestArgsToMiddlewareArgs(requestArgs: RequestArgs): MiddlewareArgs; - middlewareArgsToRequestArgs(middlewareArgs: MiddlewareArgs): RequestArgs; -}; - -declare class MiddlewareHandler { - private _middlewares; - use(middleware: M): void; - get(id: number): M | undefined; - has(id: number): boolean; - length(): number; -} - -export declare type ModelArg = { - [MethodName in string]: unknown; -}; - -export declare type ModelArgs = { - model: { - [ModelName in string]: ModelArg; - }; -}; - -export declare type ModelKey = M extends keyof TypeMap['model'] ? M : Capitalize; - -export declare type ModelQueryOptionsCb = (args: ModelQueryOptionsCbArgs) => Promise; - -export declare type ModelQueryOptionsCbArgs = { - model: string; - operation: string; - args: JsArgs; - query: (args: JsArgs) => Promise; -}; - -export declare type NameArgs = { - name?: string; -}; - -export declare type Narrow = { - [K in keyof A]: A[K] extends Function ? A[K] : Narrow; -} | (A extends Narrowable ? A : never); - -export declare type Narrowable = string | number | bigint | boolean | []; - -export declare type NeverToUnknown = [T] extends [never] ? unknown : T; - -/** - * Imitates `fetch` via `https` to only suit our needs, it does nothing more. - * This is because we cannot bundle `node-fetch` as it uses many other Node.js - * utilities, while also bloating our bundles. This approach is much leaner. - * @param url - * @param options - * @returns - */ -declare function nodeFetch(url: string, options?: RequestOptions): Promise; - -declare class NodeHeaders { - readonly headers: Map; - constructor(init?: Record); - append(name: string, value: string): void; - delete(name: string): void; - get(name: string): string | null; - has(name: string): boolean; - set(name: string, value: string): void; - forEach(callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any): void; -} - -/** - * @deprecated Please don´t rely on type checks to this error anymore. - * This will become a regular `PrismaClientKnownRequestError` with code `P2025` - * in the future major version of the client. - * Instead of `error instanceof Prisma.NotFoundError` use `error.code === "P2025"`. - */ -export declare class NotFoundError extends PrismaClientKnownRequestError { - constructor(message: string, clientVersion: string); -} - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * List of Prisma enums that must use unique objects instead of strings as their values. - */ -export declare const objectEnumNames: string[]; - -/** - * Base class for unique values of object-valued enums. - */ -export declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-pg-worker"]; - -export declare type Omission = Record; - -declare type Omit_2 = { - [P in keyof T as P extends K ? never : P]: T[P]; -}; -export { Omit_2 as Omit } - -export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -export declare type OperationPayload = { - scalars: { - [ScalarName in string]: unknown; - }; - objects: { - [ObjectName in string]: unknown; - }; - composites: { - [CompositeName in string]: unknown; - }; -}; - -export declare type Optional = { - [P in K & keyof O]?: O[P]; -} & { - [P in Exclude]: O[P]; -}; - -export declare type OptionalFlat = { - [K in keyof T]?: T[K]; -}; - -export declare type OptionalKeys = { - [K in keyof O]-?: {} extends Pick_2 ? K : never; -}[keyof O]; - -declare type Options = { - maxWait?: number; - timeout?: number; - isolationLevel?: IsolationLevel; -}; - -declare type Options_2 = { - clientVersion: string; -}; - -export declare type Or = { - 0: { - 0: 0; - 1: 1; - }; - 1: { - 0: 1; - 1: 1; - }; -}[A][B]; - -export declare type PatchFlat = O1 & Omit_2; - -export declare type Path = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path : Default : O : never; - -export declare type Payload = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? T[symbol]['types']['payload'] : any; - -export declare type PayloadToResult = RenameAndNestPayloadKeys

> = { - [K in keyof O]?: O[K][K] extends any[] ? PayloadToResult[] : O[K][K] extends object ? PayloadToResult : O[K][K]; -}; - -declare type Pick_2 = { - [P in keyof T as P extends K ? P : never]: T[P]; -}; -export { Pick_2 as Pick } - -export declare class PrismaClientInitializationError extends Error { - clientVersion: string; - errorCode?: string; - retryable?: boolean; - constructor(message: string, clientVersion: string, errorCode?: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientKnownRequestError extends Error implements ErrorWithBatchIndex { - code: string; - meta?: Record; - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { code, clientVersion, meta, batchRequestIdx }: KnownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare type PrismaClientOptions = { - /** - * Overwrites the primary datasource url from your schema.prisma file - */ - datasourceUrl?: string; - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale. - */ - adapter?: DriverAdapter | null; - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasources?: Datasources; - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat; - /** - * The default values for Transaction options - * maxWait ?= 2000 - * timeout ?= 5000 - */ - transactionOptions?: Transaction_2.Options; - /** - * @example - * \`\`\` - * // Defaults to stdout - * log: ['query', 'info', 'warn'] - * - * // Emit as events - * log: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * ] - * \`\`\` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: Array; - /** - * @internal - * You probably don't want to use this. \`__internal\` is used by internal tooling. - */ - __internal?: { - debug?: boolean; - engine?: { - cwd?: string; - binaryPath?: string; - endpoint?: string; - allowTriggerPanic?: boolean; - }; - /** This can be used for testing purposes */ - configOverride?: (config: GetPrismaClientConfig) => GetPrismaClientConfig; - }; -}; - -export declare class PrismaClientRustPanicError extends Error { - clientVersion: string; - constructor(message: string, clientVersion: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientUnknownRequestError extends Error implements ErrorWithBatchIndex { - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { clientVersion, batchRequestIdx }: UnknownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientValidationError extends Error { - name: string; - clientVersion: string; - constructor(message: string, { clientVersion }: Options_2); - get [Symbol.toStringTag](): string; -} - -declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError; - -export declare interface PrismaPromise extends Promise { - [Symbol.toStringTag]: 'PrismaPromise'; -} - -/** - * Prisma's `Promise` that is backwards-compatible. All additions on top of the - * original `Promise` are optional so that it can be backwards-compatible. - * @see [[createPrismaPromise]] - */ -declare interface PrismaPromise_2 extends Promise { - /** - * Extension of the original `.then` function - * @param onfulfilled same as regular promises - * @param onrejected same as regular promises - * @param transaction transaction options - */ - then(onfulfilled?: (value: A) => R1 | PromiseLike, onrejected?: (error: unknown) => R2 | PromiseLike, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.catch` function - * @param onrejected same as regular promises - * @param transaction transaction options - */ - catch(onrejected?: ((reason: any) => R | PromiseLike) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.finally` function - * @param onfinally same as regular promises - * @param transaction transaction options - */ - finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Called when executing a batch of regular tx - * @param transaction transaction options for batch tx - */ - requestTransaction?(transaction: PrismaPromiseBatchTransaction): PromiseLike; -} - -declare type PrismaPromiseBatchTransaction = { - kind: 'batch'; - id: number; - isolationLevel?: IsolationLevel; - index: number; - lock: PromiseLike; -}; - -declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2; - -/** - * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which - * is essentially a proxy for `Promise`. All the transaction-compatible client - * methods return one, this allows for pre-preparing queries without executing - * them until `.then` is called. It's the foundation of Prisma's query batching. - * @param callback that will be wrapped within our promise implementation - * @see [[PrismaPromise]] - * @returns - */ -declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2; - -declare type PrismaPromiseInteractiveTransaction = { - kind: 'itx'; - id: string; - payload: PayloadType; -}; - -declare type PrismaPromiseTransaction = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction; - -declare namespace Public { - export { - validator - } -} -export { Public } - -declare namespace Public_2 { - export { - Args, - Result, - Payload, - PrismaPromise, - Operation, - Exact - } -} - -declare type Query = { - sql: string; - args: Array; -}; - -declare interface Queryable { - readonly provider: 'mysql' | 'postgres' | 'sqlite'; - readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {}); - /** - * Execute a query given as SQL, interpolating the given parameters, - * and returning the type-aware result set of the query. - * - * This is the preferred way of executing `SELECT` queries. - */ - queryRaw(params: Query): Promise>; - /** - * Execute a query given as SQL, interpolating the given parameters, - * and returning the number of affected rows. - * - * This is the preferred way of executing `INSERT`, `UPDATE`, `DELETE` queries, - * as well as transactional queries. - */ - executeRaw(params: Query): Promise>; -} - -declare type QueryEngineBatchGraphQLRequest = { - batch: QueryEngineRequest[]; - transaction?: boolean; - isolationLevel?: Transaction_2.IsolationLevel; -}; - -declare type QueryEngineBatchRequest = QueryEngineBatchGraphQLRequest | JsonBatchQuery; - -declare type QueryEngineConfig = { - datamodel: string; - configDir: string; - logQueries: boolean; - ignoreEnvVarErrors: boolean; - datasourceOverrides: Record; - env: Record; - logLevel: QueryEngineLogLevel; - telemetry?: QueryEngineTelemetry; - engineProtocol: EngineProtocol; -}; - -declare interface QueryEngineConstructor { - new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingDriverAdapter): QueryEngineInstance; -} - -declare type QueryEngineInstance = { - connect(headers: string): Promise; - disconnect(headers: string): Promise; - /** - * @param requestStr JSON.stringified `QueryEngineRequest | QueryEngineBatchRequest` - * @param headersStr JSON.stringified `QueryEngineRequestHeaders` - */ - query(requestStr: string, headersStr: string, transactionId?: string): Promise; - sdlSchema(): Promise; - dmmf(traceparent: string): Promise; - startTransaction(options: string, traceHeaders: string): Promise; - commitTransaction(id: string, traceHeaders: string): Promise; - rollbackTransaction(id: string, traceHeaders: string): Promise; - metrics(options: string): Promise; - applyPendingMigrations(): Promise; -}; - -declare type QueryEngineLogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off'; - -declare type QueryEngineRequest = { - query: string; - variables: Object; -}; - -declare type QueryEngineResult = { - data: T; - elapsed: number; -}; - -declare type QueryEngineTelemetry = { - enabled: Boolean; - endpoint: string; -}; - -declare type QueryEvent = { - timestamp: Date; - query: string; - params: string; - duration: number; - target: string; -}; - -declare type QueryEventType = 'query'; - -declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise) => Promise; - -declare type QueryMiddlewareParams = { - /** The model this is executed on */ - model?: string; - /** The action that is being handled */ - action: Action; - /** TODO what is this */ - dataPath: string[]; - /** TODO what is this */ - runInTransaction: boolean; - args?: UserArgs_2; -}; - -export declare type QueryOptions = { - query: { - [ModelName in string]: { - [ModelAction in string]: ModelQueryOptionsCb; - } | QueryOptionsCb; - }; -}; - -export declare type QueryOptionsCb = (args: QueryOptionsCbArgs) => Promise; - -export declare type QueryOptionsCbArgs = { - model?: string; - operation: string; - args: JsArgs | RawQueryArgs; - query: (args: JsArgs | RawQueryArgs) => Promise; -}; - -/** - * Create raw SQL statement. - */ -export declare function raw(value: string): Sql; - -export declare type RawParameters = { - __prismaRawParameters__: true; - values: string; -}; - -export declare type RawQueryArgs = Sql | [query: string, ...values: RawValue[]]; - -declare type RawTaggedValue = { - $type: 'Raw'; - value: unknown; -}; - -/** - * Supported value or SQL instance. - */ -export declare type RawValue = Value | Sql; - -export declare type ReadonlyDeep = { - readonly [K in keyof T]: ReadonlyDeep; -}; - -declare type ReadonlyDeep_2 = { - +readonly [K in keyof O]: ReadonlyDeep_2; -}; - -declare type Record_2 = { - [P in T]: U; -}; -export { Record_2 as Record } - -export declare type RenameAndNestPayloadKeys

= { - [K in keyof P as K extends 'scalars' | 'objects' | 'composites' ? keyof P[K] : never]: P[K]; -}; - -declare type RequestBatchOptions = { - transaction?: TransactionOptions_2; - traceparent?: string; - numTry?: number; - containsWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare interface RequestError { - error: string; - user_facing_error: { - is_panic: boolean; - message: string; - meta?: Record; - error_code?: string; - batch_request_idx?: number; - }; -} - -declare class RequestHandler { - client: Client; - dataloader: DataLoader; - private logEmitter?; - constructor(client: Client, logEmitter?: LogEmitter); - request(params: RequestParams): Promise; - mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResult): any; - /** - * Handles the error and logs it, logging the error is done synchronously waiting for the event - * handlers to finish. - */ - handleAndLogRequestError(params: HandleErrorParams): never; - handleRequestError({ error, clientMethod, callsite, transaction, args, modelName }: HandleErrorParams): never; - sanitizeMessage(message: any): any; - unpack(data: unknown, dataPath: string[], unpacker?: Unpacker): any; - get [Symbol.toStringTag](): string; -} - -declare type RequestOptions = { - method?: string; - headers?: Record; - body?: string; -}; - -declare type RequestOptions_2 = { - traceparent?: string; - numTry?: number; - interactiveTransaction?: InteractiveTransactionOptions; - isWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare type RequestParams = { - modelName?: string; - action: Action; - protocolQuery: JsonQuery; - dataPath: string[]; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - extensions: MergedExtensionsList; - args?: any; - headers?: Record; - unpacker?: Unpacker; - otelParentCtx?: Context; - otelChildCtx?: Context; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare type RequestResponse = { - ok: boolean; - url: string; - statusText?: string; - status: number; - headers: NodeHeaders; - text: () => Promise; - json: () => Promise; -}; - -declare type RequiredExtensionArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions; -export { RequiredExtensionArgs } -export { RequiredExtensionArgs as UserArgs } - -export declare type RequiredKeys = { - [K in keyof O]-?: {} extends Pick_2 ? never : K; -}[keyof O]; - -declare function resolveDatasourceUrl({ inlineDatasources, overrideDatasources, env, clientVersion, }: { - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - overrideDatasources: Datasources; - env: Record; - clientVersion: string; -}): string; - -export declare type Result = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? GetResult : GetResult<{ - composites: {}; - objects: {}; - scalars: {}; -}, {}, F>; - -export declare type Result_2 = Result; - -declare namespace Result_3 { - export { - Operation, - FluentOperation, - Count, - TrueKeys, - GetFindResult, - GetSelectIncludeResult, - SelectablePayloadFields, - SelectField, - DefaultSelection, - UnwrapPayload, - GetCountResult, - Aggregate, - GetAggregateResult, - GetBatchResult, - GetGroupByResult, - GetResult - } -} - -declare type Result_4 = { - map(fn: (value: T) => U): Result_4; - flatMap(fn: (value: T) => Result_4): Result_4; -} & ({ - readonly ok: true; - readonly value: T; -} | { - readonly ok: false; - readonly error: Error_2; -}); - -export declare type ResultArg = { - [FieldName in string]: ResultFieldDefinition; -}; - -export declare type ResultArgs = { - result: { - [ModelName in string]: ResultArg; - }; -}; - -export declare type ResultArgsFieldCompute = (model: any) => unknown; - -export declare type ResultFieldDefinition = { - needs?: { - [FieldName in string]: boolean; - }; - compute: ResultArgsFieldCompute; -}; - -declare interface ResultSet { - /** - * List of column types appearing in a database query, in the same order as `columnNames`. - * They are used within the Query Engine to convert values from JS to Quaint values. - */ - columnTypes: Array; - /** - * List of column names appearing in a database query, in the same order as `columnTypes`. - */ - columnNames: Array; - /** - * List of rows retrieved from a database query. - * Each row is a list of values, whose length matches `columnNames` and `columnTypes`. - */ - rows: Array>; - /** - * The last ID of an `INSERT` statement, if any. - * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite. - */ - lastInsertId?: string; -} - -export declare type Return = T extends (...args: any[]) => infer R ? R : T; - -declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown"; - -declare type RuntimeDataModel = { - readonly models: Record; - readonly enums: Record; - readonly types: Record; -}; - -declare type RuntimeEnum = Omit; - -declare type RuntimeModel = Omit; - -export declare type Select = T extends U ? T : never; - -export declare type SelectablePayloadFields = { - objects: { - [k in K]: O; - }; -} | { - composites: { - [k in K]: O; - }; -}; - -export declare type SelectField

, K extends PropertyKey> = P extends { - objects: Record; -} ? P['objects'][K] : P extends { - composites: Record; -} ? P['composites'][K] : never; - -declare type Selection_2 = Record; -export { Selection_2 as Selection } - -/** - * An interface that represents a span. A span represents a single operation - * within a trace. Examples of span might include remote procedure calls or a - * in-process function calls to sub-components. A Trace has a single, top-level - * "root" Span that in turn may have zero or more child Spans, which in turn - * may have children. - * - * Spans are created by the {@link Tracer.startSpan} method. - */ -declare interface Span { - /** - * Returns the {@link SpanContext} object associated with this Span. - * - * Get an immutable, serializable identifier for this span that can be used - * to create new child spans. Returned SpanContext is usable even after the - * span ends. - * - * @returns the SpanContext object associated with this Span. - */ - spanContext(): SpanContext; - /** - * Sets an attribute to the span. - * - * Sets a single Attribute with the key and value passed as arguments. - * - * @param key the key for this attribute. - * @param value the value for this attribute. Setting a value null or - * undefined is invalid and will result in undefined behavior. - */ - setAttribute(key: string, value: SpanAttributeValue): this; - /** - * Sets attributes to the span. - * - * @param attributes the attributes that will be added. - * null or undefined attribute values - * are invalid and will result in undefined behavior. - */ - setAttributes(attributes: SpanAttributes): this; - /** - * Adds an event to the Span. - * - * @param name the name of the event. - * @param [attributesOrStartTime] the attributes that will be added; these are - * associated with this event. Can be also a start time - * if type is {@type TimeInput} and 3rd param is undefined - * @param [startTime] start time of the event. - */ - addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this; - /** - * Sets a status to the span. If used, this will override the default Span - * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value - * of previous calls to SetStatus on the Span. - * - * @param status the SpanStatus to set. - */ - setStatus(status: SpanStatus): this; - /** - * Updates the Span name. - * - * This will override the name provided via {@link Tracer.startSpan}. - * - * Upon this update, any sampling behavior based on Span name will depend on - * the implementation. - * - * @param name the Span name. - */ - updateName(name: string): this; - /** - * Marks the end of Span execution. - * - * Call to End of a Span MUST not have any effects on child spans. Those may - * still be running and can be ended later. - * - * Do not return `this`. The Span generally should not be used after it - * is ended so chaining is not desired in this context. - * - * @param [endTime] the time to set as Span's end time. If not provided, - * use the current time as the span's end time. - */ - end(endTime?: TimeInput): void; - /** - * Returns the flag whether this span will be recorded. - * - * @returns true if this Span is active and recording information like events - * with the `AddEvent` operation and attributes using `setAttributes`. - */ - isRecording(): boolean; - /** - * Sets exception as a span event - * @param exception the exception the only accepted values are string or Error - * @param [time] the time to set as Span's event time. If not provided, - * use the current time. - */ - recordException(exception: Exception, time?: TimeInput): void; -} - -/** - * @deprecated please use {@link Attributes} - */ -declare type SpanAttributes = Attributes; - -/** - * @deprecated please use {@link AttributeValue} - */ -declare type SpanAttributeValue = AttributeValue; - -declare type SpanCallback = (span?: Span, context?: Context) => R; - -/** - * A SpanContext represents the portion of a {@link Span} which must be - * serialized and propagated along side of a {@link Baggage}. - */ -declare interface SpanContext { - /** - * The ID of the trace that this span belongs to. It is worldwide unique - * with practically sufficient probability by being made as 16 randomly - * generated bytes, encoded as a 32 lowercase hex characters corresponding to - * 128 bits. - */ - traceId: string; - /** - * The ID of the Span. It is globally unique with practically sufficient - * probability by being made as 8 randomly generated bytes, encoded as a 16 - * lowercase hex characters corresponding to 64 bits. - */ - spanId: string; - /** - * Only true if the SpanContext was propagated from a remote parent. - */ - isRemote?: boolean; - /** - * Trace flags to propagate. - * - * It is represented as 1 byte (bitmap). Bit to represent whether trace is - * sampled or not. When set, the least significant bit documents that the - * caller may have recorded trace data. A caller who does not record trace - * data out-of-band leaves this flag unset. - * - * see {@link TraceFlags} for valid flag values. - */ - traceFlags: number; - /** - * Tracing-system-specific info to propagate. - * - * The tracestate field value is a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * More Info: https://www.w3.org/TR/trace-context/#tracestate-field - * - * Examples: - * Single tracing system (generic format): - * tracestate: rojo=00f067aa0ba902b7 - * Multiple tracing systems (with different formatting): - * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE - */ - traceState?: TraceState; -} - -declare enum SpanKind { - /** Default value. Indicates that the span is used internally. */ - INTERNAL = 0, - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SERVER = 1, - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - CLIENT = 2, - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - PRODUCER = 3, - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - CONSUMER = 4 -} - -/** - * Options needed for span creation - */ -declare interface SpanOptions { - /** - * The SpanKind of a span - * @default {@link SpanKind.INTERNAL} - */ - kind?: SpanKind; - /** A span's attributes */ - attributes?: SpanAttributes; - /** {@link Link}s span to other spans */ - links?: Link[]; - /** A manually specified start time for the created `Span` object. */ - startTime?: TimeInput; - /** The new span should be a root span. (Ignore parent from context). */ - root?: boolean; -} - -declare interface SpanStatus { - /** The status code of this message. */ - code: SpanStatusCode; - /** A developer-facing error message. */ - message?: string; -} - -/** - * An enumeration of status codes. - */ -declare enum SpanStatusCode { - /** - * The default status. - */ - UNSET = 0, - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - OK = 1, - /** - * The operation contains an error. - */ - ERROR = 2 -} - -/** - * A SQL instance can be nested within each other to build SQL strings. - */ -export declare class Sql { - readonly values: Value[]; - readonly strings: string[]; - constructor(rawStrings: readonly string[], rawValues: readonly RawValue[]); - get sql(): string; - get statement(): string; - get text(): string; - inspect(): { - sql: string; - statement: string; - text: string; - values: unknown[]; - }; -} - -/** - * Create a SQL object from a template string. - */ -export declare function sqltag(strings: readonly string[], ...values: readonly RawValue[]): Sql; - -/** - * Defines TimeInput. - * - * hrtime, epoch milliseconds, performance.now() or Date - */ -declare type TimeInput = HrTime | number | Date; - -export declare type ToTuple = T extends any[] ? T : [T]; - -declare interface TraceState { - /** - * Create a new TraceState which inherits from this TraceState and has the - * given key set. - * The new entry will always be added in the front of the list of states. - * - * @param key key of the TraceState entry. - * @param value value of the TraceState entry. - */ - set(key: string, value: string): TraceState; - /** - * Return a new TraceState which inherits from this TraceState but does not - * contain the given key. - * - * @param key the key for the TraceState entry to be removed. - */ - unset(key: string): TraceState; - /** - * Returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - * - * @param key with which the specified value is to be associated. - * @returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - */ - get(key: string): string | undefined; - /** - * Serializes the TraceState to a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * - * @returns the serialized string. - */ - serialize(): string; -} - -declare interface TracingHelper { - isEnabled(): boolean; - getTraceParent(context?: Context): string; - createEngineSpan(engineSpanEvent: EngineSpanEvent): void; - getActiveContext(): Context | undefined; - runInChildSpan(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback): R; -} - -declare interface Transaction extends Queryable { - /** - * Transaction options. - */ - readonly options: TransactionOptions; - /** - * Commit the transaction. - */ - commit(): Promise>; - /** - * Rolls back the transaction. - */ - rollback(): Promise>; -} - -declare namespace Transaction_2 { - export { - IsolationLevel, - Options, - InteractiveTransactionInfo, - TransactionHeaders - } -} - -declare type TransactionHeaders = { - traceparent?: string; -}; - -declare type TransactionOptions = { - usePhantomQuery: boolean; -}; - -declare type TransactionOptions_2 = { - kind: 'itx'; - options: InteractiveTransactionOptions; -} | { - kind: 'batch'; - options: BatchTransactionOptions; -}; - -export declare type TrueKeys = { - [K in keyof T]: T[K] extends true ? K : never; -}[keyof T]; - -export declare type TypeMapCbDef = Fn<{ - extArgs: InternalArgs; -}, TypeMapDef>; - -/** Shared */ -export declare type TypeMapDef = Record; - -declare namespace Types { - export { - Result_3 as Result, - Extensions_2 as Extensions, - Utils, - Public_2 as Public, - OperationPayload as Payload - } -} -export { Types } - -declare type UnknownErrorParams = { - clientVersion: string; - batchRequestIdx?: number; -}; - -declare type Unpacker = (data: any) => any; - -export declare type UnwrapPayload

= {} extends P ? unknown : { - [K in keyof P]: P[K] extends { - scalars: infer S; - composites: infer C; - }[] ? Array> : P[K] extends { - scalars: infer S; - composites: infer C; - } | null ? S & UnwrapPayload | Select : never; -}; - -export declare type UnwrapPromise

= P extends Promise ? R : P; - -export declare type UnwrapTuple = { - [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise ? X : UnwrapPromise : UnwrapPromise; -}; - -/** - * Input that flows from the user into the Client. - */ -declare type UserArgs_2 = any; - -declare namespace Utils { - export { - EmptyToUnknown, - NeverToUnknown, - PatchFlat, - Omit_2 as Omit, - Pick_2 as Pick, - ComputeDeep, - Compute, - OptionalFlat, - ReadonlyDeep, - Narrowable, - Narrow, - Exact, - Cast, - JsonObject, - JsonArray, - JsonValue, - Record_2 as Record, - UnwrapPromise, - UnwrapTuple, - Path, - Fn, - Call, - RequiredKeys, - OptionalKeys, - Optional, - Return, - ToTuple, - RenameAndNestPayloadKeys, - PayloadToResult, - Select, - Equals, - Or, - JsPromise - } -} - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -/** - * Values supported by SQL engine. - */ -export declare type Value = unknown; - -export declare function warnEnvConflicts(envPaths: any): void; - -export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void; - -declare type WasmLoadingConfig = { - /** - * WASM-bindgen runtime for corresponding module - */ - getRuntime: () => { - __wbg_set_wasm(exports: unknown): any; - QueryEngine: QueryEngineConstructor; - }; - /** - * Loads the raw wasm module for the wasm query engine. This configuration is - * generated specifically for each type of client, eg. Node.js client and Edge - * clients will have different implementations. - * @remarks this is a callback on purpose, we only load the wasm if needed. - * @remarks only used by LibraryEngine.ts - */ - getQueryEngineWasmModule: () => Promise; -}; - -export { } diff --git a/integration-tests/tests/prisma/pg/client/runtime/library.js b/integration-tests/tests/prisma/pg/client/runtime/library.js deleted file mode 100644 index 016f60e77..000000000 --- a/integration-tests/tests/prisma/pg/client/runtime/library.js +++ /dev/null @@ -1,140 +0,0 @@ -"use strict";var Ml=Object.create;var Ct=Object.defineProperty;var $l=Object.getOwnPropertyDescriptor;var ql=Object.getOwnPropertyNames;var jl=Object.getPrototypeOf,Vl=Object.prototype.hasOwnProperty;var Z=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Fr=(e,r)=>{for(var t in r)Ct(e,t,{get:r[t],enumerable:!0})},no=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ql(r))!Vl.call(e,i)&&i!==t&&Ct(e,i,{get:()=>r[i],enumerable:!(n=$l(r,i))||n.enumerable});return e};var k=(e,r,t)=>(t=e!=null?Ml(jl(e)):{},no(r||!e||!e.__esModule?Ct(t,"default",{value:e,enumerable:!0}):t,e)),Bl=e=>no(Ct({},"__esModule",{value:!0}),e);var Ao=Z((Bd,Un)=>{"use strict";var v=Un.exports;Un.exports.default=v;var D="\x1B[",jr="\x1B]",mr="\x07",Ft=";",Ro=process.env.TERM_PROGRAM==="Apple_Terminal";v.cursorTo=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof r!="number"?D+(e+1)+"G":D+(r+1)+";"+(e+1)+"H"};v.cursorMove=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let t="";return e<0?t+=D+-e+"D":e>0&&(t+=D+e+"C"),r<0?t+=D+-r+"A":r>0&&(t+=D+r+"B"),t};v.cursorUp=(e=1)=>D+e+"A";v.cursorDown=(e=1)=>D+e+"B";v.cursorForward=(e=1)=>D+e+"C";v.cursorBackward=(e=1)=>D+e+"D";v.cursorLeft=D+"G";v.cursorSavePosition=Ro?"\x1B7":D+"s";v.cursorRestorePosition=Ro?"\x1B8":D+"u";v.cursorGetPosition=D+"6n";v.cursorNextLine=D+"E";v.cursorPrevLine=D+"F";v.cursorHide=D+"?25l";v.cursorShow=D+"?25h";v.eraseLines=e=>{let r="";for(let t=0;t[jr,"8",Ft,Ft,r,mr,e,jr,"8",Ft,Ft,mr].join("");v.image=(e,r={})=>{let t=`${jr}1337;File=inline=1`;return r.width&&(t+=`;width=${r.width}`),r.height&&(t+=`;height=${r.height}`),r.preserveAspectRatio===!1&&(t+=";preserveAspectRatio=0"),t+":"+e.toString("base64")+mr};v.iTerm={setCwd:(e=process.cwd())=>`${jr}50;CurrentDir=${e}${mr}`,annotation:(e,r={})=>{let t=`${jr}1337;`,n=typeof r.x<"u",i=typeof r.y<"u";if((n||i)&&!(n&&i&&typeof r.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),t+=r.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",r.length>0?t+=(n?[e,r.length,r.x,r.y]:[r.length,e]).join("|"):t+=e,t+mr}}});var Qn=Z((Ud,Io)=>{"use strict";Io.exports=(e,r=process.argv)=>{let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),i=r.indexOf("--");return n!==-1&&(i===-1||n{"use strict";var Ru=require("os"),_o=require("tty"),pe=Qn(),{env:G}=process,Ve;pe("no-color")||pe("no-colors")||pe("color=false")||pe("color=never")?Ve=0:(pe("color")||pe("colors")||pe("color=true")||pe("color=always"))&&(Ve=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?Ve=1:G.FORCE_COLOR==="false"?Ve=0:Ve=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function Gn(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Jn(e,r){if(Ve===0)return 0;if(pe("color=16m")||pe("color=full")||pe("color=truecolor"))return 3;if(pe("color=256"))return 2;if(e&&!r&&Ve===void 0)return 0;let t=Ve||0;if(G.TERM==="dumb")return t;if(process.platform==="win32"){let n=Ru.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in G)||G.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let n=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:t}function Au(e){let r=Jn(e,e&&e.isTTY);return Gn(r)}ko.exports={supportsColor:Au,stdout:Gn(Jn(!0,_o.isatty(1))),stderr:Gn(Jn(!0,_o.isatty(2)))}});var Fo=Z((Gd,Lo)=>{"use strict";var Iu=Do(),dr=Qn();function Oo(e){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let r=(e||"").split(".").map(t=>parseInt(t,10));return{major:r[0],minor:r[1],patch:r[2]}}function Hn(e){let{env:r}=process;if("FORCE_HYPERLINK"in r)return!(r.FORCE_HYPERLINK.length>0&&parseInt(r.FORCE_HYPERLINK,10)===0);if(dr("no-hyperlink")||dr("no-hyperlinks")||dr("hyperlink=false")||dr("hyperlink=never"))return!1;if(dr("hyperlink=true")||dr("hyperlink=always")||"NETLIFY"in r)return!0;if(!Iu.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in r||"TEAMCITY_VERSION"in r)return!1;if("TERM_PROGRAM"in r){let t=Oo(r.TERM_PROGRAM_VERSION);switch(r.TERM_PROGRAM){case"iTerm.app":return t.major===3?t.minor>=1:t.major>3;case"WezTerm":return t.major>=20200620;case"vscode":return t.major>1||t.major===1&&t.minor>=72}}if("VTE_VERSION"in r){if(r.VTE_VERSION==="0.50.0")return!1;let t=Oo(r.VTE_VERSION);return t.major>0||t.minor>=50}return!1}Lo.exports={supportsHyperlink:Hn,stdout:Hn(process.stdout),stderr:Hn(process.stderr)}});var Mo=Z((Jd,Vr)=>{"use strict";var _u=Ao(),Wn=Fo(),No=(e,r,{target:t="stdout",...n}={})=>Wn[t]?_u.link(e,r):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,r):`${e} (\u200B${r}\u200B)`;Vr.exports=(e,r,t={})=>No(e,r,t);Vr.exports.stderr=(e,r,t={})=>No(e,r,{target:"stderr",...t});Vr.exports.isSupported=Wn.stdout;Vr.exports.stderr.isSupported=Wn.stderr});var Yn=Z((tf,ku)=>{ku.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var zn=Z(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.enginesVersion=void 0;Nt.enginesVersion=Yn().prisma.enginesVersion});var Vo=Z((Pf,Lu)=>{Lu.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",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","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var Uo=Z((vf,$t)=>{"use strict";var Fu=require("fs"),Bo=require("path"),Nu=require("os"),Mu=Vo(),$u=Mu.version,qu=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ju(e){let r={},t=e.toString();t=t.replace(/\r\n?/mg,` -`);let n;for(;(n=qu.exec(t))!=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,` -`),o=o.replace(/\\r/g,"\r")),r[i]=o}return r}function ri(e){console.log(`[dotenv@${$u}][DEBUG] ${e}`)}function Vu(e){return e[0]==="~"?Bo.join(Nu.homedir(),e.slice(1)):e}function Bu(e){let r=Bo.resolve(process.cwd(),".env"),t="utf8",n=!!(e&&e.debug),i=!!(e&&e.override);e&&(e.path!=null&&(r=Vu(e.path)),e.encoding!=null&&(t=e.encoding));try{let o=Mt.parse(Fu.readFileSync(r,{encoding:t}));return Object.keys(o).forEach(function(s){Object.prototype.hasOwnProperty.call(process.env,s)?(i===!0&&(process.env[s]=o[s]),n&&ri(i===!0?`"${s}" is already defined in \`process.env\` and WAS overwritten`:`"${s}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[s]=o[s]}),{parsed:o}}catch(o){return n&&ri(`Failed to load ${r} ${o.message}`),{error:o}}}var Mt={config:Bu,parse:ju};$t.exports.config=Mt.config;$t.exports.parse=Mt.parse;$t.exports=Mt});var Ko=Z((_f,Wo)=>{"use strict";Wo.exports=e=>{let r=e.match(/^[ \t]*(?=\S)/gm);return r?r.reduce((t,n)=>Math.min(t,n.length),1/0):0}});var zo=Z((kf,Yo)=>{"use strict";var Ju=Ko();Yo.exports=e=>{let r=Ju(e);if(r===0)return e;let t=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(t,"")}});var oi=Z((Mf,Zo)=>{"use strict";Zo.exports=(e,r=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof r!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``);if(typeof t.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(r===0)return e;let n=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,t.indent.repeat(r))}});var ts=Z((jf,rs)=>{"use strict";rs.exports=({onlyFirst:e=!1}={})=>{let r=["[\\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(r,e?void 0:"g")}});var ui=Z((Vf,ns)=>{"use strict";var ec=ts();ns.exports=e=>typeof e=="string"?e.replace(ec(),""):e});var is=Z((Qf,Vt)=>{"use strict";Vt.exports=(e={})=>{let r;if(e.repoUrl)r=e.repoUrl;else if(e.user&&e.repo)r=`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 t=new URL(`${r}/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(",")}t.searchParams.set(i,o)}}return t.toString()};Vt.exports.default=Vt.exports});var Wi=Z((DP,Ba)=>{"use strict";Ba.exports=function(){function e(r,t,n,i,o){return rn?n+1:r+1:i===o?t:t+1}return function(r,t){if(r===t)return 0;if(r.length>t.length){var n=r;r=t,t=n}for(var i=r.length,o=t.length;i>0&&r.charCodeAt(i-1)===t.charCodeAt(o-1);)i--,o--;for(var s=0;sFn,Decimal:()=>Te,Extensions:()=>kn,MetricsClient:()=>hr,NotFoundError:()=>Oe,PrismaClientInitializationError:()=>R,PrismaClientKnownRequestError:()=>V,PrismaClientRustPanicError:()=>le,PrismaClientUnknownRequestError:()=>B,PrismaClientValidationError:()=>W,Public:()=>Dn,Sql:()=>ie,defineDmmfProperty:()=>ss,empty:()=>ls,getPrismaClient:()=>Ll,getRuntime:()=>fn,join:()=>as,makeStrictEnum:()=>Fl,objectEnumValues:()=>Qt,raw:()=>Ei,sqltag:()=>bi,warnEnvConflicts:()=>Nl,warnOnce:()=>Hr});module.exports=Bl(fd);var kn={};Fr(kn,{defineExtension:()=>io,getExtensionContext:()=>oo});function io(e){return typeof e=="function"?e:r=>r.$extends(e)}function oo(e){return e}var Dn={};Fr(Dn,{validator:()=>so});function so(...e){return r=>r}var St={};Fr(St,{$:()=>po,bgBlack:()=>Zl,bgBlue:()=>tu,bgCyan:()=>iu,bgGreen:()=>eu,bgMagenta:()=>nu,bgRed:()=>Xl,bgWhite:()=>ou,bgYellow:()=>ru,black:()=>Wl,blue:()=>ze,bold:()=>H,cyan:()=>_e,dim:()=>Ie,gray:()=>Nr,green:()=>Me,grey:()=>zl,hidden:()=>Jl,inverse:()=>Gl,italic:()=>Ql,magenta:()=>Kl,red:()=>ue,reset:()=>Ul,strikethrough:()=>Hl,underline:()=>X,white:()=>Yl,yellow:()=>fe});var On,ao,lo,uo,co=!0;typeof process<"u"&&({FORCE_COLOR:On,NODE_DISABLE_COLORS:ao,NO_COLOR:lo,TERM:uo}=process.env||{},co=process.stdout&&process.stdout.isTTY);var po={enabled:!ao&&lo==null&&uo!=="dumb"&&(On!=null&&On!=="0"||co)};function N(e,r){let t=new RegExp(`\\x1b\\[${r}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${r}m`;return function(o){return!po.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(t,i+n):o)+i}}var Ul=N(0,0),H=N(1,22),Ie=N(2,22),Ql=N(3,23),X=N(4,24),Gl=N(7,27),Jl=N(8,28),Hl=N(9,29),Wl=N(30,39),ue=N(31,39),Me=N(32,39),fe=N(33,39),ze=N(34,39),Kl=N(35,39),_e=N(36,39),Yl=N(37,39),Nr=N(90,39),zl=N(90,39),Zl=N(40,49),Xl=N(41,49),eu=N(42,49),ru=N(43,49),tu=N(44,49),nu=N(45,49),iu=N(46,49),ou=N(47,49);var su=100,mo=["green","yellow","blue","magenta","cyan","red"],Mr=[],fo=Date.now(),au=0,Ln=typeof process<"u"?process.env:{};globalThis.DEBUG??(globalThis.DEBUG=Ln.DEBUG??"");globalThis.DEBUG_COLORS??(globalThis.DEBUG_COLORS=Ln.DEBUG_COLORS?Ln.DEBUG_COLORS==="true":!0);var $r={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let r=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),t=r.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=r.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return t&&!n},log:(...e)=>{let[r,t,...n]=e,i;typeof require=="function"&&typeof process<"u"&&typeof process.stderr<"u"&&typeof process.stderr.write=="function"?i=(...o)=>{try{let s=require("util");process.stderr.write(s.format(...o)+` -`)}catch{i=console.warn??console.log}}:i=console.warn??console.log,i(`${r} ${t}`,...n)},formatters:{}};function lu(e){let r={color:mo[au++%mo.length],enabled:$r.enabled(e),namespace:e,log:$r.log,extend:()=>{}},t=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=r;if(n.length!==0&&Mr.push([o,...n]),Mr.length>su&&Mr.shift(),$r.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:uu(c)),u=`+${Date.now()-fo}ms`;fo=Date.now(),globalThis.DEBUG_COLORS?a(St[s](H(o)),...l,St[s](u)):a(o,...l,u)}};return new Proxy(t,{get:(n,i)=>r[i],set:(n,i,o)=>r[i]=o})}var Fn=new Proxy(lu,{get:(e,r)=>$r[r],set:(e,r,t)=>$r[r]=t});function uu(e,r=2){let t=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(t.has(i))return"[Circular *]";t.add(i)}else if(typeof i=="bigint")return i.toString();return i},r)}function go(e=7500){let r=Mr.map(([t,...n])=>`${t} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(` -`);return r.length!!(e&&typeof e=="object"),It=e=>e&&!!e[ke],we=(e,r,t)=>{if(It(e)){let n=e[ke](),{matched:i,selections:o}=n.match(r);return i&&o&&Object.keys(o).forEach(s=>t(s,o[s])),i}if($n(e)){if(!$n(r))return!1;if(Array.isArray(e)){if(!Array.isArray(r))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];It(a)&&a[cu]?o.push(a):o.length?i.push(a):n.push(a)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(r.lengthwe(u,s[c],t))&&i.every((u,c)=>we(u,a[c],t))&&(o.length===0||we(o[0],l,t))}return e.length===r.length&&e.every((s,a)=>we(s,r[a],t))}return Object.keys(e).every(n=>{let i=e[n];return(n in r||It(o=i)&&o[ke]().matcherType==="optional")&&we(i,r[n],t);var o})}return Object.is(r,e)},je=e=>{var r,t,n;return $n(e)?It(e)?(r=(t=(n=e[ke]()).getSelectionKeys)==null?void 0:t.call(n))!=null?r:[]:Array.isArray(e)?qr(e,je):qr(Object.values(e),je):[]},qr=(e,r)=>e.reduce((t,n)=>t.concat(r(n)),[]);function ce(e){return Object.assign(e,{optional:()=>pu(e),and:r=>j(e,r),or:r=>mu(e,r),select:r=>r===void 0?Eo(e):Eo(r,e)})}function pu(e){return ce({[ke]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return r===void 0?(je(e).forEach(i=>n(i,void 0)),{matched:!0,selections:t}):{matched:we(e,r,n),selections:t}},getSelectionKeys:()=>je(e),matcherType:"optional"})})}function j(...e){return ce({[ke]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return{matched:e.every(i=>we(i,r,n)),selections:t}},getSelectionKeys:()=>qr(e,je),matcherType:"and"})})}function mu(...e){return ce({[ke]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return qr(e,je).forEach(i=>n(i,void 0)),{matched:e.some(i=>we(i,r,n)),selections:t}},getSelectionKeys:()=>qr(e,je),matcherType:"or"})})}function _(e){return{[ke]:()=>({match:r=>({matched:!!e(r)})})}}function Eo(...e){let r=typeof e[0]=="string"?e[0]:void 0,t=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return ce({[ke]:()=>({match:n=>{let i={[r??_t]:n};return{matched:t===void 0||we(t,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[r??_t].concat(t===void 0?[]:je(t))})})}function Ee(e){return typeof e=="number"}function Ze(e){return typeof e=="string"}function $e(e){return typeof e=="bigint"}var Rd=ce(_(function(e){return!0}));var Xe=e=>Object.assign(ce(e),{startsWith:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&n.startsWith(t)))));var t},endsWith:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&n.endsWith(t)))));var t},minLength:r=>Xe(j(e,(t=>_(n=>Ze(n)&&n.length>=t))(r))),maxLength:r=>Xe(j(e,(t=>_(n=>Ze(n)&&n.length<=t))(r))),includes:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&n.includes(t)))));var t},regex:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&!!n.match(t)))));var t}}),Ad=Xe(_(Ze)),be=e=>Object.assign(ce(e),{between:(r,t)=>be(j(e,((n,i)=>_(o=>Ee(o)&&n<=o&&i>=o))(r,t))),lt:r=>be(j(e,(t=>_(n=>Ee(n)&&nbe(j(e,(t=>_(n=>Ee(n)&&n>t))(r))),lte:r=>be(j(e,(t=>_(n=>Ee(n)&&n<=t))(r))),gte:r=>be(j(e,(t=>_(n=>Ee(n)&&n>=t))(r))),int:()=>be(j(e,_(r=>Ee(r)&&Number.isInteger(r)))),finite:()=>be(j(e,_(r=>Ee(r)&&Number.isFinite(r)))),positive:()=>be(j(e,_(r=>Ee(r)&&r>0))),negative:()=>be(j(e,_(r=>Ee(r)&&r<0)))}),Id=be(_(Ee)),qe=e=>Object.assign(ce(e),{between:(r,t)=>qe(j(e,((n,i)=>_(o=>$e(o)&&n<=o&&i>=o))(r,t))),lt:r=>qe(j(e,(t=>_(n=>$e(n)&&nqe(j(e,(t=>_(n=>$e(n)&&n>t))(r))),lte:r=>qe(j(e,(t=>_(n=>$e(n)&&n<=t))(r))),gte:r=>qe(j(e,(t=>_(n=>$e(n)&&n>=t))(r))),positive:()=>qe(j(e,_(r=>$e(r)&&r>0))),negative:()=>qe(j(e,_(r=>$e(r)&&r<0)))}),_d=qe(_($e)),kd=ce(_(function(e){return typeof e=="boolean"})),Dd=ce(_(function(e){return typeof e=="symbol"})),Od=ce(_(function(e){return e==null})),Ld=ce(_(function(e){return e!=null}));var qn={matched:!1,value:void 0};function pr(e){return new jn(e,qn)}var jn=class e{constructor(r,t){this.input=void 0,this.state=void 0,this.input=r,this.state=t}with(...r){if(this.state.matched)return this;let t=r[r.length-1],n=[r[0]],i;r.length===3&&typeof r[1]=="function"?i=r[1]:r.length>2&&n.push(...r.slice(1,r.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>we(u,this.input,a))||i&&!i(this.input)?qn:{matched:!0,value:t(o?_t in s?s[_t]:s:this.input,this.input)};return new e(this.input,l)}when(r,t){if(this.state.matched)return this;let n=!!r(this.input);return new e(this.input,n?{matched:!0,value:t(this.input,this.input)}:qn)}otherwise(r){return this.state.matched?this.state.value:r(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let r;try{r=JSON.stringify(this.input)}catch{r=this.input}throw new Error(`Pattern matching error: no pattern matches value ${r}`)}run(){return this.exhaustive()}returnType(){return this}};var Po=require("util");var du={warn:fe("prisma:warn")},fu={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function kt(e,...r){fu.warn()&&console.warn(`${du.warn} ${e}`,...r)}var gu=(0,Po.promisify)(xo.default.exec),re=L("prisma:get-platform"),hu=["1.0.x","1.1.x","3.0.x"];async function vo(){let e=Ot.default.platform(),r=process.arch;if(e==="freebsd"){let s=await Lt("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:r}}}if(e!=="linux")return{platform:e,arch:r};let t=await Eu(),n=await Su(),i=wu({arch:r,archFromUname:n,familyDistro:t.familyDistro}),{libssl:o}=await xu(i);return{platform:"linux",libssl:o,arch:r,archFromUname:n,...t}}function yu(e){let r=/^ID="?([^"\n]*)"?$/im,t=/^ID_LIKE="?([^"\n]*)"?$/im,n=r.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=t.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=pr({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return re(`Found distro info: -${JSON.stringify(a,null,2)}`),a}async function Eu(){let e="/etc/os-release";try{let r=await Vn.default.readFile(e,{encoding:"utf-8"});return yu(r)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function bu(e){let r=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(r){let t=`${r[1]}.x`;return To(t)}}function bo(e){let r=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(r){let t=`${r[1]}${r[2]??".0"}.x`;return To(t)}}function To(e){let r=(()=>{if(So(e))return e;let t=e.split(".");return t[1]="0",t.join(".")})();if(hu.includes(r))return r}function wu(e){return pr(e).with({familyDistro:"musl"},()=>(re('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:r})=>(re('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${r}-linux-gnu`,`/lib/${r}-linux-gnu`])).with({familyDistro:"rhel"},()=>(re('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:r,arch:t,archFromUname:n})=>(re(`Don't know any platform-specific paths for "${r}" on ${t} (${n})`),[]))}async function xu(e){let r='grep -v "libssl.so.0"',t=await wo(e);if(t){re(`Found libssl.so file using platform-specific paths: ${t}`);let o=bo(t);if(re(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}re('Falling back to "ldconfig" and other generic paths');let n=await Lt(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${r}`);if(n||(n=await wo(["/lib64","/usr/lib64","/lib"])),n){re(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=bo(n);if(re(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Lt("openssl version -v");if(i){re(`Found openssl binary with version: ${i}`);let o=bu(i);if(re(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return re("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function wo(e){for(let r of e){let t=await Pu(r);if(t)return t}}async function Pu(e){try{return(await Vn.default.readdir(e)).find(t=>t.startsWith("libssl.so.")&&!t.startsWith("libssl.so.0"))}catch(r){if(r.code==="ENOENT")return;throw r}}async function er(){let{binaryTarget:e}=await Co();return e}function vu(e){return e.binaryTarget!==void 0}async function Bn(){let{memoized:e,...r}=await Co();return r}var Dt={};async function Co(){if(vu(Dt))return Promise.resolve({...Dt,memoized:!0});let e=await vo(),r=Tu(e);return Dt={...e,binaryTarget:r},{...Dt,memoized:!1}}function Tu(e){let{platform:r,arch:t,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;r==="linux"&&!["x64","arm64"].includes(t)&&kt(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${t}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${n}".`);let l="1.1.x";if(r==="linux"&&i===void 0){let c=pr({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");kt(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}". -${c}`)}let u="debian";if(r==="linux"&&o===void 0&&re(`Distro is "${a}". Falling back to Prisma engines built for "${u}".`),r==="darwin"&&t==="arm64")return"darwin-arm64";if(r==="darwin")return"darwin";if(r==="win32")return"windows";if(r==="freebsd")return o;if(r==="openbsd")return"openbsd";if(r==="netbsd")return"netbsd";if(r==="linux"&&o==="nixos")return"linux-nixos";if(r==="linux"&&t==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(r==="linux"&&t==="arm")return`linux-arm-openssl-${i||l}`;if(r==="linux"&&o==="musl"){let c="linux-musl";return!i||So(i)?c:`${c}-openssl-${i}`}return r==="linux"&&o&&i?`${o}-openssl-${i}`:(r!=="linux"&&kt(`Prisma detected unknown OS "${r}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function Cu(e){try{return await e()}catch{return}}function Lt(e){return Cu(async()=>{let r=await gu(e);return re(`Command "${e}" successfully returned "${r.stdout}"`),r.stdout})}async function Su(){return typeof Ot.default.machine=="function"?Ot.default.machine():(await Lt("uname -m"))?.trim()}function So(e){return e.startsWith("1.")}var $o=k(Mo());function Kn(e){return(0,$o.default)(e,e,{fallback:X})}var Du=k(zn());var M=k(require("path")),Ou=k(zn()),df=L("prisma:engines");function qo(){return M.default.join(__dirname,"../")}var ff="libquery-engine";M.default.join(__dirname,"../query-engine-darwin");M.default.join(__dirname,"../query-engine-darwin-arm64");M.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");M.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");M.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");M.default.join(__dirname,"../query-engine-linux-static-x64");M.default.join(__dirname,"../query-engine-linux-static-arm64");M.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");M.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");M.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");M.default.join(__dirname,"../libquery_engine-darwin.dylib.node");M.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-musl.so.node");M.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");M.default.join(__dirname,"../query_engine-windows.dll.node");var Zn=k(require("fs")),jo=L("chmodPlusX");function Xn(e){if(process.platform==="win32")return;let r=Zn.default.statSync(e),t=r.mode|64|8|1;if(r.mode===t){jo(`Execution permissions of ${e} are fine`);return}let n=t.toString(8).slice(-3);jo(`Have to call chmodPlusX on ${e}`),Zn.default.chmodSync(e,n)}function ei(e){let r=e.e,t=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=r.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${Kn("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${Ie(e.id)}\`).`,s=pr({message:r.message,code:r.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${t("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${t("libgcc_s")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libssl"),()=>{let a=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${t("libssl")}. Please install ${a} and try again.`}).when(({message:a})=>a.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${i}`).when(({message:a})=>e.platformInfo.platform==="linux"&&a.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${i}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${i}`);return`${o} -${s} - -Details: ${r.message}`}var ni=k(Uo()),qt=k(require("fs"));var fr=k(require("path"));function Qo(e){let r=e.ignoreProcessEnv?{}:process.env,t=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(r,p)?r[p]:e.parsed[p]||"",u=t(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(r,n)?r[n]:e.parsed[n];e.parsed[n]=t(i)}for(let n in e.parsed)r[n]=e.parsed[n];return e}var ti=L("prisma:tryLoadEnv");function Br({rootEnvPath:e,schemaEnvPath:r},t={conflictCheck:"none"}){let n=Go(e);t.conflictCheck!=="none"&&Uu(n,r,t.conflictCheck);let i=null;return Jo(n?.path,r)||(i=Go(r)),!n&&!i&&ti("No Environment variables loaded"),i?.dotenvResult.error?console.error(ue(H("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(` -`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function Uu(e,r,t){let n=e?.dotenvResult.parsed,i=!Jo(e?.path,r);if(n&&r&&i&&qt.default.existsSync(r)){let o=ni.default.parse(qt.default.readFileSync(r)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=fr.default.relative(process.cwd(),e.path),l=fr.default.relative(process.cwd(),r);if(t==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${X(a)} and ${X(l)} -Conflicting env vars: -${s.map(c=>` ${H(c)}`).join(` -`)} - -We suggest to move the contents of ${X(l)} to ${X(a)} to consolidate your env vars. -`;throw new Error(u)}else if(t==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>H(c)).join(", ")} in ${X(a)} and ${X(l)} -Env vars from ${X(l)} overwrite the ones from ${X(a)} - `;console.warn(`${fe("warn(prisma)")} ${u}`)}}}}function Go(e){if(Qu(e)){ti(`Environment variables loaded from ${e}`);let r=ni.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Qo(r),message:Ie(`Environment variables loaded from ${fr.default.relative(process.cwd(),e)}`),path:e}}else ti(`Environment variables not found at ${e}`);return null}function Jo(e,r){return e&&r&&fr.default.resolve(e)===fr.default.resolve(r)}function Qu(e){return!!(e&&qt.default.existsSync(e))}var Ho="library";function Ur(e){let r=Gu();return r||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Ho)}function Gu(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}var De;(r=>{let e;(b=>(b.findUnique="findUnique",b.findUniqueOrThrow="findUniqueOrThrow",b.findFirst="findFirst",b.findFirstOrThrow="findFirstOrThrow",b.findMany="findMany",b.create="create",b.createMany="createMany",b.createManyAndReturn="createManyAndReturn",b.update="update",b.updateMany="updateMany",b.upsert="upsert",b.delete="delete",b.deleteMany="deleteMany",b.groupBy="groupBy",b.count="count",b.aggregate="aggregate",b.findRaw="findRaw",b.aggregateRaw="aggregateRaw"))(e=r.ModelAction||(r.ModelAction={}))})(De||(De={}));var Qr=k(require("path"));function ii(e){return Qr.default.sep===Qr.default.posix.sep?e:e.split(Qr.default.sep).join(Qr.default.posix.sep)}var Xo=k(oi());function ai(e){return String(new si(e))}var si=class{constructor(r){this.config=r}toString(){let{config:r}=this,t=r.provider.fromEnvVar?`env("${r.provider.fromEnvVar}")`:r.provider.value,n=JSON.parse(JSON.stringify({provider:t,binaryTargets:Hu(r.binaryTargets)}));return`generator ${r.name} { -${(0,Xo.default)(Wu(n),2)} -}`}};function Hu(e){let r;if(e.length>0){let t=e.find(n=>n.fromEnvVar!==null);t?r=`env("${t.fromEnvVar}")`:r=e.map(n=>n.native?"native":n.value)}else r=void 0;return r}function Wu(e){let r=Object.keys(e).reduce((t,n)=>Math.max(t,n.length),0);return Object.entries(e).map(([t,n])=>`${t.padEnd(r)} = ${Ku(n)}`).join(` -`)}function Ku(e){return JSON.parse(JSON.stringify(e,(r,t)=>Array.isArray(t)?`[${t.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(t)))}var Jr={};Fr(Jr,{error:()=>Zu,info:()=>zu,log:()=>Yu,query:()=>Xu,should:()=>es,tags:()=>Gr,warn:()=>li});var Gr={error:ue("prisma:error"),warn:fe("prisma:warn"),info:_e("prisma:info"),query:ze("prisma:query")},es={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Yu(...e){console.log(...e)}function li(e,...r){es.warn()&&console.warn(`${Gr.warn} ${e}`,...r)}function zu(e,...r){console.info(`${Gr.info} ${e}`,...r)}function Zu(e,...r){console.error(`${Gr.error} ${e}`,...r)}function Xu(e,...r){console.log(`${Gr.query} ${e}`,...r)}function jt(e,r){if(!e)throw new Error(`${r}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function rr(e,r){throw new Error(r)}function ci(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var pi=(e,r)=>e.reduce((t,n)=>(t[r(n)]=n,t),{});function gr(e,r){let t={};for(let n of Object.keys(e))t[n]=r(e[n],n);return t}function mi(e,r){if(e.length===0)return;let t=e[0];for(let n=1;n{os.has(e)||(os.add(e),li(r,...t))};var V=class extends Error{constructor(r,{code:t,clientVersion:n,meta:i,batchRequestIdx:o}){super(r),this.name="PrismaClientKnownRequestError",this.code=t,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};w(V,"PrismaClientKnownRequestError");var Oe=class extends V{constructor(r,t){super(r,{code:"P2025",clientVersion:t}),this.name="NotFoundError"}};w(Oe,"NotFoundError");var R=class e extends Error{constructor(r,t,n){super(r),this.name="PrismaClientInitializationError",this.clientVersion=t,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};w(R,"PrismaClientInitializationError");var le=class extends Error{constructor(r,t){super(r),this.name="PrismaClientRustPanicError",this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};w(le,"PrismaClientRustPanicError");var B=class extends Error{constructor(r,{clientVersion:t,batchRequestIdx:n}){super(r),this.name="PrismaClientUnknownRequestError",this.clientVersion=t,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};w(B,"PrismaClientUnknownRequestError");var W=class extends Error{constructor(t,{clientVersion:n}){super(t);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};w(W,"PrismaClientValidationError");var hr=class{constructor(r){this._engine=r}prometheus(r){return this._engine.metrics({format:"prometheus",...r})}json(r){return this._engine.metrics({format:"json",...r})}};function Wr(e){let r;return{get(){return r||(r={value:e()}),r.value}}}function ss(e,r){let t=Wr(()=>rc(r));Object.defineProperty(e,"dmmf",{get:()=>t.get()})}function rc(e){return{datamodel:{models:di(e.models),enums:di(e.enums),types:di(e.types)}}}function di(e){return Object.entries(e).map(([r,t])=>({name:r,...t}))}var Ut=Symbol(),fi=new WeakMap,Le=class{constructor(r){r===Ut?fi.set(this,`Prisma.${this._getName()}`):fi.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return fi.get(this)}},Kr=class extends Le{_getNamespace(){return"NullTypes"}},Yr=class extends Kr{};gi(Yr,"DbNull");var zr=class extends Kr{};gi(zr,"JsonNull");var Zr=class extends Kr{};gi(Zr,"AnyNull");var Qt={classes:{DbNull:Yr,JsonNull:zr,AnyNull:Zr},instances:{DbNull:new Yr(Ut),JsonNull:new zr(Ut),AnyNull:new Zr(Ut)}};function gi(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}function Xr(e){return{ok:!1,error:e,map(){return Xr(e)},flatMap(){return Xr(e)}}}var hi=class{constructor(){this.registeredErrors=[]}consumeError(r){return this.registeredErrors[r]}registerNewError(r){let t=0;for(;this.registeredErrors[t]!==void 0;)t++;return this.registeredErrors[t]={error:r},t}},yi=e=>{let r=new hi,t=tr(r,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:r,queryRaw:tr(r,e.queryRaw.bind(e)),executeRaw:tr(r,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await t(...i)).map(s=>tc(r,s))};return e.getConnectionInfo&&(n.getConnectionInfo=nc(r,e.getConnectionInfo.bind(e))),n},tc=(e,r)=>({adapterName:r.adapterName,provider:r.provider,options:r.options,queryRaw:tr(e,r.queryRaw.bind(r)),executeRaw:tr(e,r.executeRaw.bind(r)),commit:tr(e,r.commit.bind(r)),rollback:tr(e,r.rollback.bind(r))});function tr(e,r){return async(...t)=>{try{return await r(...t)}catch(n){let i=e.registerNewError(n);return Xr({kind:"GenericJs",id:i})}}}function nc(e,r){return(...t)=>{try{return r(...t)}catch(n){let i=e.registerNewError(n);return Xr({kind:"GenericJs",id:i})}}}var _l=k(Yn());var kl=require("async_hooks"),Dl=require("events"),Ol=k(require("fs")),vt=k(require("path"));var ie=class e{constructor(r,t){if(r.length-1!==t.length)throw r.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${r.length} strings to have ${r.length-1} values`);let n=t.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=r[0];let i=0,o=0;for(;ie.getPropertyValue(t))},getPropertyDescriptor(t){return e.getPropertyDescriptor?.(t)}}}var Gt={enumerable:!0,configurable:!0,writable:!0};function Jt(e){let r=new Set(e);return{getOwnPropertyDescriptor:()=>Gt,has:(t,n)=>r.has(n),set:(t,n,i)=>r.add(n)&&Reflect.set(t,n,i),ownKeys:()=>[...r]}}var us=Symbol.for("nodejs.util.inspect.custom");function Pe(e,r){let t=ic(r),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=t.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=t.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=cs(Reflect.ownKeys(o),t),a=cs(Array.from(t.keys()),t);return[...new Set([...s,...a,...n])]},set(o,s,a){return t.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=t.get(s);return l?l.getPropertyDescriptor?{...Gt,...l?.getPropertyDescriptor(s)}:Gt:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[us]=function(){let o={...this};return delete o[us],o},i}function ic(e){let r=new Map;for(let t of e){let n=t.getKeys();for(let i of n)r.set(i,t)}return r}function cs(e,r){return e.filter(t=>r.get(t)?.has?.(t)??!0)}function yr(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Er(e,r){return{batch:e,transaction:r?.kind==="batch"?{isolationLevel:r.options.isolationLevel}:void 0}}var br=class{constructor(r=0,t){this.context=t;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=r}write(r){return typeof r=="string"?this.currentLine+=r:r.write(this),this}writeJoined(r,t){let n=t.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(r){return this.marginSymbol=r,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let r=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+r.slice(1):r}};function ps(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function wr(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Ht(e){return e.toString()!=="Invalid Date"}var xr=9e15,Ge=1e9,wi="0123456789abcdef",Kt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Yt="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-xr,maxE:xr,crypto:!1},gs,Fe,x=!0,Zt="[DecimalError] ",Qe=Zt+"Invalid argument: ",hs=Zt+"Precision limit exceeded",ys=Zt+"crypto unavailable",Es="[object Decimal]",ee=Math.floor,Q=Math.pow,oc=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,sc=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,ac=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,bs=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,he=1e7,E=7,lc=9007199254740991,uc=Kt.length-1,Pi=Yt.length-1,d={toStringTag:Es};d.absoluteValue=d.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};d.ceil=function(){return y(new this.constructor(this),this.e+1,2)};d.clampedTo=d.clamp=function(e,r){var t,n=this,i=n.constructor;if(e=new i(e),r=new i(r),!e.s||!r.s)return new i(NaN);if(e.gt(r))throw Error(Qe+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new i(n)};d.comparedTo=d.cmp=function(e){var r,t,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,r=0,t=na[r]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};d.cosine=d.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+E,n.rounding=1,t=cc(n,Ts(n,t)),n.precision=e,n.rounding=r,y(Fe==2||Fe==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};d.cubeRoot=d.cbrt=function(){var e,r,t,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(x=!1,o=c.s*Q(c.s*c,1/3),!o||Math.abs(o)==1/0?(t=K(c.d),e=c.e,(o=(e-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=Q(t,1/3),e=ee((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new p(t),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=F(u.plus(c).times(a),u.plus(l),s+2,1),K(a.d).slice(0,s)===(t=K(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,e+1,1),r=!n.times(n).times(n).eq(c));break}return x=!0,y(n,e,p.rounding,r)};d.decimalPlaces=d.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-ee(this.e/E))*E,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};d.dividedBy=d.div=function(e){return F(this,new this.constructor(e))};d.dividedToIntegerBy=d.divToInt=function(e){var r=this,t=r.constructor;return y(F(r,new t(e),0,1,1),t.precision,t.rounding)};d.equals=d.eq=function(e){return this.cmp(e)===0};d.floor=function(){return y(new this.constructor(this),this.e+1,3)};d.greaterThan=d.gt=function(e){return this.cmp(e)>0};d.greaterThanOrEqualTo=d.gte=function(e){var r=this.cmp(e);return r==1||r===0};d.hyperbolicCosine=d.cosh=function(){var e,r,t,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;t=s.precision,n=s.rounding,s.precision=t+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),r=(1/en(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),o=Pr(s,1,o.times(r),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return y(o,s.precision=t,s.rounding=n,!0)};d.hyperbolicSine=d.sinh=function(){var e,r,t,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(r=o.precision,t=o.rounding,o.precision=r+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=Pr(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/en(5,e)),i=Pr(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=r,o.rounding=t,y(i,r,t,!0)};d.hyperbolicTangent=d.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,F(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)};d.inverseCosine=d.acos=function(){var e,r=this,t=r.constructor,n=r.abs().cmp(1),i=t.precision,o=t.rounding;return n!==-1?n===0?r.isNeg()?ge(t,i,o):new t(0):new t(NaN):r.isZero()?ge(t,i+4,o).times(.5):(t.precision=i+6,t.rounding=1,r=r.asin(),e=ge(t,i+4,o).times(.5),t.precision=i,t.rounding=o,e.minus(r))};d.inverseHyperbolicCosine=d.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,x=!1,t=t.times(t).minus(1).sqrt().plus(t),x=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)};d.inverseHyperbolicSine=d.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,x=!1,t=t.times(t).plus(1).sqrt().plus(t),x=!0,n.precision=e,n.rounding=r,t.ln())};d.inverseHyperbolicTangent=d.atanh=function(){var e,r,t,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,r=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?y(new o(i),e,r,!0):(o.precision=t=n-i.e,i=F(i.plus(1),new o(1).minus(i),t+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=r,i.times(.5))):new o(NaN)};d.inverseSine=d.asin=function(){var e,r,t,n,i=this,o=i.constructor;return i.isZero()?new o(i):(r=i.abs().cmp(1),t=o.precision,n=o.rounding,r!==-1?r===0?(e=ge(o,t+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=t+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=n,i.times(2)))};d.inverseTangent=d.atan=function(){var e,r,t,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,m=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=Pi)return s=ge(c,p+4,m).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=Pi)return s=ge(c,p+4,m).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,t=Math.min(28,a/E+2|0),e=t;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(x=!1,r=Math.ceil(a/E),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===o.d[e]&&e--;);return t&&(s=s.times(2<this.d.length-2};d.isNaN=function(){return!this.s};d.isNegative=d.isNeg=function(){return this.s<0};d.isPositive=d.isPos=function(){return this.s>0};d.isZero=function(){return!!this.d&&this.d[0]===0};d.lessThan=d.lt=function(e){return this.cmp(e)<0};d.lessThanOrEqualTo=d.lte=function(e){return this.cmp(e)<1};d.logarithm=d.log=function(e){var r,t,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,m=c.rounding,f=5;if(e==null)e=new c(10),r=!0;else{if(e=new c(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new c(NaN);r=e.eq(10)}if(t=u.d,u.s<0||!t||!t[0]||u.eq(1))return new c(t&&!t[0]?-1/0:u.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)o=!0;else{for(i=t[0];i%10===0;)i/=10;o=i!==1}if(x=!1,a=p+f,s=Ue(u,a),n=r?zt(c,a+10):Ue(e,a),l=F(s,n,a,1),rt(l.d,i=p,m))do if(a+=10,s=Ue(u,a),n=r?zt(c,a+10):Ue(e,a),l=F(s,n,a,1),!o){+K(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(rt(l.d,i+=10,m));return x=!0,y(l,p,m)};d.minus=d.sub=function(e){var r,t,n,i,o,s,a,l,u,c,p,m,f=this,g=f.constructor;if(e=new g(e),!f.d||!e.d)return!f.s||!e.s?e=new g(NaN):f.d?e.s=-e.s:e=new g(e.d||f.s!==e.s?f:NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(u=f.d,m=e.d,a=g.precision,l=g.rounding,!u[0]||!m[0]){if(m[0])e.s=-e.s;else if(u[0])e=new g(f);else return new g(l===3?-0:0);return x?y(e,a,l):e}if(t=ee(e.e/E),c=ee(f.e/E),u=u.slice(),o=c-t,o){for(p=o<0,p?(r=u,o=-o,s=m.length):(r=m,t=c,s=u.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,r.length=1),r.reverse(),n=o;n--;)r.push(0);r.reverse()}else{for(n=u.length,s=m.length,p=n0;--n)u[s++]=0;for(n=m.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,t=c,c=u,u=t),r=0;i;)r=(u[--i]=u[i]+c[i]+r)/he|0,u[i]%=he;for(r&&(u.unshift(r),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Xt(u,n),x?y(e,a,l):e};d.precision=d.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Qe+e);return t.d?(r=ws(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};d.round=function(){var e=this,r=e.constructor;return y(new r(e),e.e+1,r.rounding)};d.sine=d.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+E,n.rounding=1,t=mc(n,Ts(n,t)),n.precision=e,n.rounding=r,y(Fe>2?t.neg():t,e,r,!0)):new n(NaN)};d.squareRoot=d.sqrt=function(){var e,r,t,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(x=!1,u=Math.sqrt(+s),u==0||u==1/0?(r=K(a),(r.length+l)%2==0&&(r+="0"),u=Math.sqrt(r),l=ee((l+1)/2)-(l<0||l%2),u==1/0?r="5e"+l:(r=u.toExponential(),r=r.slice(0,r.indexOf("e")+1)+l),n=new c(r)):n=new c(u.toString()),t=(l=c.precision)+3;;)if(o=n,n=o.plus(F(s,o,t+2,1)).times(.5),K(o.d).slice(0,t)===(r=K(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}t+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return x=!0,y(n,l,c.rounding,e)};d.tangent=d.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=F(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,y(Fe==2||Fe==4?t.neg():t,e,r,!0)):new n(NaN)};d.times=d.mul=function(e){var r,t,n,i,o,s,a,l,u,c=this,p=c.constructor,m=c.d,f=(e=new p(e)).d;if(e.s*=c.s,!m||!m[0]||!f||!f[0])return new p(!e.s||m&&!m[0]&&!f||f&&!f[0]&&!m?NaN:!m||!f?e.s/0:e.s*0);for(t=ee(c.e/E)+ee(e.e/E),l=m.length,u=f.length,l=0;){for(r=0,i=l+n;i>n;)a=o[i]+f[n]*m[i-n-1]+r,o[i--]=a%he|0,r=a/he|0;o[i]=(o[i]+r)%he|0}for(;!o[--s];)o.pop();return r?++t:o.shift(),e.d=o,e.e=Xt(o,t),x?y(e,p.precision,p.rounding):e};d.toBinary=function(e,r){return Ci(this,2,e,r)};d.toDecimalPlaces=d.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(oe(e,0,Ge),r===void 0?r=n.rounding:oe(r,0,8),y(t,e+t.e+1,r))};d.toExponential=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=ve(n,!0):(oe(e,0,Ge),r===void 0?r=i.rounding:oe(r,0,8),n=y(new i(n),e+1,r),t=ve(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};d.toFixed=function(e,r){var t,n,i=this,o=i.constructor;return e===void 0?t=ve(i):(oe(e,0,Ge),r===void 0?r=o.rounding:oe(r,0,8),n=y(new o(i),e+i.e+1,r),t=ve(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};d.toFraction=function(e){var r,t,n,i,o,s,a,l,u,c,p,m,f=this,g=f.d,h=f.constructor;if(!g)return new h(f);if(u=t=new h(1),n=l=new h(0),r=new h(n),o=r.e=ws(g)-f.e-1,s=o%E,r.d[0]=Q(10,s<0?E+s:s),e==null)e=o>0?r:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error(Qe+a);e=a.gt(r)?o>0?r:u:a}for(x=!1,a=new h(K(g)),c=h.precision,h.precision=o=g.length*E*2;p=F(a,r,0,1,1),i=t.plus(p.times(n)),i.cmp(e)!=1;)t=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=r,r=a.minus(p.times(i)),a=i;return i=F(e.minus(t),n,0,1,1),l=l.plus(i.times(u)),t=t.plus(i.times(n)),l.s=u.s=f.s,m=F(u,n,o,1).minus(f).abs().cmp(F(l,t,o,1).minus(f).abs())<1?[u,n]:[l,t],h.precision=c,x=!0,m};d.toHexadecimal=d.toHex=function(e,r){return Ci(this,16,e,r)};d.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:oe(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(x=!1,t=F(t,e,0,r,1).times(e),x=!0,y(t)):(e.s=t.s,t=e),t};d.toNumber=function(){return+this};d.toOctal=function(e,r){return Ci(this,8,e,r)};d.toPower=d.pow=function(e){var r,t,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Q(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(r=ee(e.e/E),r>=e.d.length-1&&(t=u<0?-u:u)<=lc)return i=xs(l,a,t,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(rl.maxE+1||r0?s/0:0):(x=!1,l.rounding=a.s=1,t=Math.min(12,(r+"").length),i=vi(e.times(Ue(a,n+t)),n),i.d&&(i=y(i,n+5,1),rt(i.d,n,o)&&(r=n+10,i=y(vi(e.times(Ue(a,r+t)),r),r+5,1),+K(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,x=!0,l.rounding=o,y(i,n,o))};d.toPrecision=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=ve(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,Ge),r===void 0?r=i.rounding:oe(r,0,8),n=y(new i(n),e,r),t=ve(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t};d.toSignificantDigits=d.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(oe(e,1,Ge),r===void 0?r=n.rounding:oe(r,0,8)),y(new n(t),e,r)};d.toString=function(){var e=this,r=e.constructor,t=ve(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};d.truncated=d.trunc=function(){return y(new this.constructor(this),this.e+1,1)};d.valueOf=d.toJSON=function(){var e=this,r=e.constructor,t=ve(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function K(e){var r,t,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,r=1;rt)throw Error(Qe+e)}function rt(e,r,t,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--r;return--r<0?(r+=E,i=0):(i=Math.ceil((r+1)/E),r%=E),o=Q(10,E-r),a=e[i]%o|0,n==null?r<3?(r==0?a=a/100|0:r==1&&(a=a/10|0),s=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):s=(t<4&&a+1==o||t>3&&a+1==o/2)&&(e[i+1]/o/100|0)==Q(10,r-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:r<4?(r==0?a=a/1e3|0:r==1?a=a/100|0:r==2&&(a=a/10|0),s=(n||t<4)&&a==9999||!n&&t>3&&a==4999):s=((n||t<4)&&a+1==o||!n&&t>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==Q(10,r-3)-1,s}function Wt(e,r,t){for(var n,i=[0],o,s=0,a=e.length;st-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function cc(e,r){var t,n,i;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),i=(1/en(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=Pr(e,1,r.times(i),new e(1));for(var o=t;o--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var F=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function r(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function t(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,m,f,g,h,I,T,S,C,b,de,ae,Lr,U,ne,Ae,Y,cr,Tt=n.constructor,_n=n.s==i.s?1:-1,z=n.d,O=i.d;if(!z||!z[0]||!O||!O[0])return new Tt(!n.s||!i.s||(z?O&&z[0]==O[0]:!O)?NaN:z&&z[0]==0||!O?_n*0:_n/0);for(l?(f=1,c=n.e-i.e):(l=he,f=E,c=ee(n.e/f)-ee(i.e/f)),Y=O.length,ne=z.length,T=new Tt(_n),S=T.d=[],p=0;O[p]==(z[p]||0);p++);if(O[p]>(z[p]||0)&&c--,o==null?(ae=o=Tt.precision,s=Tt.rounding):a?ae=o+(n.e-i.e)+1:ae=o,ae<0)S.push(1),g=!0;else{if(ae=ae/f+2|0,p=0,Y==1){for(m=0,O=O[0],ae++;(p1&&(O=e(O,m,l),z=e(z,m,l),Y=O.length,ne=z.length),U=Y,C=z.slice(0,Y),b=C.length;b=l/2&&++Ae;do m=0,u=r(O,C,Y,b),u<0?(de=C[0],Y!=b&&(de=de*l+(C[1]||0)),m=de/Ae|0,m>1?(m>=l&&(m=l-1),h=e(O,m,l),I=h.length,b=C.length,u=r(h,C,I,b),u==1&&(m--,t(h,Y=10;m/=10)p++;T.e=p+c*f-1,y(T,a?o+T.e+1:o,s,g)}return T}}();function y(e,r,t,n){var i,o,s,a,l,u,c,p,m,f=e.constructor;e:if(r!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=r-i,o<0)o+=E,s=r,c=p[m=0],l=c/Q(10,i-s-1)%10|0;else if(m=Math.ceil((o+1)/E),a=p.length,m>=a)if(n){for(;a++<=m;)p.push(0);c=l=0,i=1,o%=E,s=o-E+1}else break e;else{for(c=a=p[m],i=1;a>=10;a/=10)i++;o%=E,s=o-E+i,l=s<0?0:c/Q(10,i-s-1)%10|0}if(n=n||r<0||p[m+1]!==void 0||(s<0?c:c%Q(10,i-s-1)),u=t<4?(l||n)&&(t==0||t==(e.s<0?3:2)):l>5||l==5&&(t==4||n||t==6&&(o>0?s>0?c/Q(10,i-s):0:p[m-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,u?(r-=e.e+1,p[0]=Q(10,(E-r%E)%E),e.e=-r||0):p[0]=e.e=0,e;if(o==0?(p.length=m,a=1,m--):(p.length=m+1,a=Q(10,E-o),p[m]=s>0?(c/Q(10,i-s)%Q(10,s)|0)*a:0),u)for(;;)if(m==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==he&&(p[0]=1));break}else{if(p[m]+=a,p[m]!=he)break;p[m--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return x&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Be(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Be(-i-1)+o,t&&(n=t-s)>0&&(o+=Be(n))):i>=s?(o+=Be(i+1-s),t&&(n=t-i-1)>0&&(o=o+"."+Be(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Be(n))),o}function Xt(e,r){var t=e[0];for(r*=E;t>=10;t/=10)r++;return r}function zt(e,r,t){if(r>uc)throw x=!0,t&&(e.precision=t),Error(hs);return y(new e(Kt),r,1,!0)}function ge(e,r,t){if(r>Pi)throw Error(hs);return y(new e(Yt),r,t,!0)}function ws(e){var r=e.length-1,t=r*E+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function Be(e){for(var r="";e--;)r+="0";return r}function xs(e,r,t,n){var i,o=new e(1),s=Math.ceil(n/E+4);for(x=!1;;){if(t%2&&(o=o.times(r),ds(o.d,s)&&(i=!0)),t=ee(t/2),t===0){t=o.d.length-1,i&&o.d[t]===0&&++o.d[t];break}r=r.times(r),ds(r.d,s)}return x=!0,o}function ms(e){return e.d[e.d.length-1]&1}function Ps(e,r,t){for(var n,i=new e(r[0]),o=0;++o17)return new m(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(r==null?(x=!1,l=g):l=r,a=new m(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(Q(2,p))/Math.LN10*2+5|0,l+=n,t=o=s=new m(1),m.precision=l;;){if(o=y(o.times(e),l,1),t=t.times(++c),a=s.plus(F(o,t,l,1)),K(a.d).slice(0,l)===K(s.d).slice(0,l)){for(i=p;i--;)s=y(s.times(s),l,1);if(r==null)if(u<3&&rt(s.d,l-n,f,u))m.precision=l+=10,t=o=a=new m(1),c=0,u++;else return y(s,m.precision=g,f,x=!0);else return m.precision=g,s}s=a}}function Ue(e,r){var t,n,i,o,s,a,l,u,c,p,m,f=1,g=10,h=e,I=h.d,T=h.constructor,S=T.rounding,C=T.precision;if(h.s<0||!I||!I[0]||!h.e&&I[0]==1&&I.length==1)return new T(I&&!I[0]?-1/0:h.s!=1?NaN:I?0:h);if(r==null?(x=!1,c=C):c=r,T.precision=c+=g,t=K(I),n=t.charAt(0),Math.abs(o=h.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)h=h.times(e),t=K(h.d),n=t.charAt(0),f++;o=h.e,n>1?(h=new T("0."+t),o++):h=new T(n+"."+t.slice(1))}else return u=zt(T,c+2,C).times(o+""),h=Ue(new T(n+"."+t.slice(1)),c-g).plus(u),T.precision=C,r==null?y(h,C,S,x=!0):h;for(p=h,l=s=h=F(h.minus(1),h.plus(1),c,1),m=y(h.times(h),c,1),i=3;;){if(s=y(s.times(m),c,1),u=l.plus(F(s,new T(i),c,1)),K(u.d).slice(0,c)===K(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(zt(T,c+2,C).times(o+""))),l=F(l,new T(f),c,1),r==null)if(rt(l.d,c-g,S,a))T.precision=c+=g,u=s=h=F(p.minus(1),p.plus(1),c,1),m=y(h.times(h),c,1),i=a=1;else return y(l,T.precision=C,S,x=!0);else return T.precision=C,l;l=u,i+=2}}function vs(e){return String(e.s*e.s/0)}function Ti(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(i=r.length;r.charCodeAt(i-1)===48;--i);if(r=r.slice(n,i),r){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%E,t<0&&(n+=E),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\d)_(?=\d)/g,"$1"),bs.test(r))return Ti(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(sc.test(r))t=16,r=r.toLowerCase();else if(oc.test(r))t=2;else if(ac.test(r))t=8;else throw Error(Qe+r);for(o=r.search(/p/i),o>0?(l=+r.slice(o+1),r=r.substring(2,o)):r=r.slice(2),o=r.indexOf("."),s=o>=0,n=e.constructor,s&&(r=r.replace(".",""),a=r.length,o=a-o,i=xs(n,new n(t),o,o*2)),u=Wt(r,t,he),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=Xt(u,c),e.d=u,x=!1,s&&(e=F(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?Q(2,l):ir.pow(2,l))),x=!0,e)}function mc(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:Pr(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/en(5,t)),r=Pr(e,2,r,r);for(var i,o=new e(5),s=new e(16),a=new e(20);t--;)i=r.times(r),r=r.times(o.plus(i.times(s.times(i).minus(a))));return r}function Pr(e,r,t,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/E);for(x=!1,l=t.times(t),a=new e(n);;){if(s=F(a.times(l),new e(r++*r++),c,1),a=i?n.plus(s):n.minus(s),n=F(s.times(l),new e(r++*r++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return x=!0,s.d.length=p+1,s}function en(e,r){for(var t=e;--r;)t*=e;return t}function Ts(e,r){var t,n=r.s<0,i=ge(e,e.precision,1),o=i.times(.5);if(r=r.abs(),r.lte(o))return Fe=n?4:1,r;if(t=r.divToInt(i),t.isZero())Fe=n?3:2;else{if(r=r.minus(t.times(i)),r.lte(o))return Fe=ms(t)?n?2:3:n?4:1,r;Fe=ms(t)?n?1:4:n?3:2}return r.minus(i).abs()}function Ci(e,r,t,n){var i,o,s,a,l,u,c,p,m,f=e.constructor,g=t!==void 0;if(g?(oe(t,1,Ge),n===void 0?n=f.rounding:oe(n,0,8)):(t=f.precision,n=f.rounding),!e.isFinite())c=vs(e);else{for(c=ve(e),s=c.indexOf("."),g?(i=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):i=r,s>=0&&(c=c.replace(".",""),m=new f(1),m.e=c.length-s,m.d=Wt(ve(m),10,i),m.e=m.d.length),p=Wt(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new f(e),e.d=p,e.e=o,e=F(e,m,t,n,0,i),p=e.d,o=e.e,u=gs),s=p[t],a=i/2,u=u||p[t+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[t-1]&1||n===(e.s<0?8:7)),p.length=t,u)for(;++p[--t]>i-1;)p[t]=0,t||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s1)if(r==16||r==8){for(s=r==16?4:3,--l;l%s;l++)c+="0";for(p=Wt(c,i,r),l=p.length;!p[l-1];--l);for(s=1,c="1.";sl)for(o-=l;o--;)c+="0";else or)return e.length=r,!0}function dc(e){return new this(e).abs()}function fc(e){return new this(e).acos()}function gc(e){return new this(e).acosh()}function hc(e,r){return new this(e).plus(r)}function yc(e){return new this(e).asin()}function Ec(e){return new this(e).asinh()}function bc(e){return new this(e).atan()}function wc(e){return new this(e).atanh()}function xc(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,o=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=ge(this,o,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?ge(this,n,i):new this(0),t.s=e.s):!e.d||r.isZero()?(t=ge(this,o,1).times(.5),t.s=e.s):r.s<0?(this.precision=o,this.rounding=1,t=this.atan(F(e,r,o,1)),r=ge(this,o,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(F(e,r,o,1)),t}function Pc(e){return new this(e).cbrt()}function vc(e){return y(e=new this(e),e.e+1,2)}function Tc(e,r,t){return new this(e).clamp(r,t)}function Cc(e){if(!e||typeof e!="object")throw Error(Zt+"Object expected");var r,t,n,i=e.defaults===!0,o=["precision",1,Ge,"rounding",0,8,"toExpNeg",-xr,0,"toExpPos",0,xr,"maxE",0,xr,"minE",-xr,0,"modulo",0,9];for(r=0;r=o[r+1]&&n<=o[r+2])this[t]=n;else throw Error(Qe+t+": "+n);if(t="crypto",i&&(this[t]=xi[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(ys);else this[t]=!1;else throw Error(Qe+t+": "+n);return this}function Sc(e){return new this(e).cos()}function Rc(e){return new this(e).cosh()}function Cs(e){var r,t,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,fs(o)){u.s=o.s,x?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;x?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?r[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(r,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(ys);else for(;o=10;i/=10)n++;n`}};function Tr(e){return e instanceof tt}var rn=class{constructor(r){this.value=r}write(r){r.write(this.value)}markAsError(){this.value.markAsError()}};var tn=e=>e,nn={bold:tn,red:tn,green:tn,dim:tn,enabled:!1},Ss={bold:H,red:ue,green:Me,dim:Ie,enabled:!0},Cr={write(e){e.writeLine(",")}};var Ce=class{constructor(r){this.contents=r;this.isUnderlined=!1;this.color=r=>r}underline(){return this.isUnderlined=!0,this}setColor(r){return this.color=r,this}write(r){let t=r.getCurrentLineLength();r.write(this.color(this.contents)),this.isUnderlined&&r.afterNextNewline(()=>{r.write(" ".repeat(t)).writeLine(this.color("~".repeat(this.contents.length)))})}};var Je=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var Sr=class extends Je{constructor(){super(...arguments);this.items=[]}addItem(t){return this.items.push(new rn(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let n=new Ce("[]");this.hasError&&n.setColor(t.context.colors.red).underline(),t.write(n)}writeWithItems(t){let{colors:n}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(Cr,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Rs=": ",on=class{constructor(r,t){this.name=r;this.value=t;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Rs.length}write(r){let t=new Ce(this.name);this.hasError&&t.underline().setColor(r.context.colors.red),r.write(t).write(Rs).write(this.value)}};var sn=class e extends Je{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[n,...i]=t,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof Sr&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let n=this;for(let i of t){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(t){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of t){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(i=>i.getPrintWidth()))+2}write(t){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,n)}asObject(){return this}writeEmpty(t){let n=new Ce("{}");this.hasError&&n.setColor(t.context.colors.red).underline(),t.write(n)}writeWithContents(t,n){t.writeLine("{").withIndent(()=>{t.writeJoined(Cr,[...n,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var J=class extends Je{constructor(t){super();this.text=t}getPrintWidth(){return this.text.length}write(t){let n=new Ce(this.text);this.hasError&&n.underline().setColor(t.context.colors.red),t.write(n)}asObject(){}};var Si=class{constructor(r){this.errorMessages=[];this.arguments=r}write(r){r.write(this.arguments)}addErrorMessage(r){this.errorMessages.push(r)}renderAllMessages(r){return this.errorMessages.map(t=>t(r)).join(` -`)}};function an(e){return new Si(As(e))}function As(e){let r=new sn;for(let[t,n]of Object.entries(e)){let i=new on(t,Is(n));r.addField(i)}return r}function Is(e){if(typeof e=="string")return new J(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new J(String(e));if(typeof e=="bigint")return new J(`${e}n`);if(e===null)return new J("null");if(e===void 0)return new J("undefined");if(vr(e))return new J(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new J(`Buffer.alloc(${e.byteLength})`):new J(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let r=Ht(e)?e.toISOString():"Invalid Date";return new J(`new Date("${r}")`)}return e instanceof Le?new J(`Prisma.${e._getName()}`):Tr(e)?new J(`prisma.${ps(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Xc(e):typeof e=="object"?As(e):new J(Object.prototype.toString.call(e))}function Xc(e){let r=new Sr;for(let t of e)r.addItem(Is(t));return r}function _s(e){if(e===void 0)return"";let r=an(e);return new br(0,{colors:nn}).write(r).toString()}var ep="P2037";function or({error:e,user_facing_error:r},t,n){return r.error_code?new V(rp(r,n),{code:r.error_code,clientVersion:t,meta:r.meta,batchRequestIdx:r.batch_request_idx}):new B(e,{clientVersion:t,batchRequestIdx:r.batch_request_idx})}function rp(e,r){let t=e.message;return(r==="postgresql"||r==="postgres"||r==="mysql")&&e.error_code===ep&&(t+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),t}var nt="";function ks(e){var r=e.split(` -`);return r.reduce(function(t,n){var i=ip(n)||sp(n)||up(n)||dp(n)||pp(n);return i&&t.push(i),t},[])}var tp=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,np=/\((\S*)(?::(\d+))(?::(\d+))\)/;function ip(e){var r=tp.exec(e);if(!r)return null;var t=r[2]&&r[2].indexOf("native")===0,n=r[2]&&r[2].indexOf("eval")===0,i=np.exec(r[2]);return n&&i!=null&&(r[2]=i[1],r[3]=i[2],r[4]=i[3]),{file:t?null:r[2],methodName:r[1]||nt,arguments:t?[r[2]]:[],lineNumber:r[3]?+r[3]:null,column:r[4]?+r[4]:null}}var op=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function sp(e){var r=op.exec(e);return r?{file:r[2],methodName:r[1]||nt,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null}var ap=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,lp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function up(e){var r=ap.exec(e);if(!r)return null;var t=r[3]&&r[3].indexOf(" > eval")>-1,n=lp.exec(r[3]);return t&&n!=null&&(r[3]=n[1],r[4]=n[2],r[5]=null),{file:r[3],methodName:r[1]||nt,arguments:r[2]?r[2].split(","):[],lineNumber:r[4]?+r[4]:null,column:r[5]?+r[5]:null}}var cp=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function pp(e){var r=cp.exec(e);return r?{file:r[3],methodName:r[1]||nt,arguments:[],lineNumber:+r[4],column:r[5]?+r[5]:null}:null}var mp=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function dp(e){var r=mp.exec(e);return r?{file:r[2],methodName:r[1]||nt,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null}var Ri=class{getLocation(){return null}},Ai=class{constructor(){this._error=new Error}getLocation(){let r=this._error.stack;if(!r)return null;let n=ks(r).find(i=>{if(!i.file)return!1;let o=ii(i.file);return o!==""&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function He(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Ri:new Ai}var Ds={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Rr(e={}){let r=gp(e);return Object.entries(r).reduce((n,[i,o])=>(Ds[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function gp(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function ln(e={}){return r=>(typeof e._count=="boolean"&&(r._count=r._count._all),r)}function Os(e,r){let t=ln(e);return r({action:"aggregate",unpacker:t,argsMapper:Rr})(e)}function hp(e={}){let{select:r,...t}=e;return typeof r=="object"?Rr({...t,_count:r}):Rr({...t,_count:{_all:!0}})}function yp(e={}){return typeof e.select=="object"?r=>ln(e)(r)._count:r=>ln(e)(r)._count._all}function Ls(e,r){return r({action:"count",unpacker:yp(e),argsMapper:hp})(e)}function Ep(e={}){let r=Rr(e);if(Array.isArray(r.by))for(let t of r.by)typeof t=="string"&&(r.select[t]=!0);else typeof r.by=="string"&&(r.select[r.by]=!0);return r}function bp(e={}){return r=>(typeof e?._count=="boolean"&&r.forEach(t=>{t._count=t._count._all}),r)}function Fs(e,r){return r({action:"groupBy",unpacker:bp(e),argsMapper:Ep})(e)}function Ns(e,r,t){if(r==="aggregate")return n=>Os(n,t);if(r==="count")return n=>Ls(n,t);if(r==="groupBy")return n=>Fs(n,t)}function Ms(e,r){let t=r.fields.filter(i=>!i.relationName),n=pi(t,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new tt(e,o,s.type,s.isList,s.kind==="enum")},...Jt(Object.keys(n))})}var $s=e=>Array.isArray(e)?e:e.split("."),Ii=(e,r)=>$s(r).reduce((t,n)=>t&&t[n],e),qs=(e,r,t)=>$s(r).reduceRight((n,i,o,s)=>Object.assign({},Ii(e,s.slice(0,o)),{[i]:n}),t);function wp(e,r){return e===void 0||r===void 0?[]:[...r,"select",e]}function xp(e,r,t){return r===void 0?e??{}:qs(r,t,e||!0)}function _i(e,r,t,n,i,o){let a=e._runtimeDataModel.models[r].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=He(e._errorFormat),c=wp(n,i),p=xp(l,o,c),m=t({dataPath:c,callsite:u})(p),f=Pp(e,r);return new Proxy(m,{get(g,h){if(!f.includes(h))return g[h];let T=[a[h].type,t,h],S=[c,p];return _i(e,...T,...S)},...Jt([...f,...Object.getOwnPropertyNames(m)])})}}function Pp(e,r){return e._runtimeDataModel.models[r].fields.filter(t=>t.kind==="object").map(t=>t.name)}var Gs=k(oi());var Qs=k(require("fs"));var js={keyword:_e,entity:_e,value:e=>H(ze(e)),punctuation:ze,directive:_e,function:_e,variable:e=>H(ze(e)),string:e=>H(Me(e)),boolean:fe,number:_e,comment:Nr};var vp=e=>e,un={},Tp=0,P={manual:un.Prism&&un.Prism.manual,disableWorkerMessageHandler:un.Prism&&un.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof ye){let r=e;return new ye(r.type,P.util.encode(r.content),r.alias)}else return Array.isArray(e)?e.map(P.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Ae instanceof ye)continue;if(de&&U!=r.length-1){S.lastIndex=ne;var p=S.exec(e);if(!p)break;var c=p.index+(b?p[1].length:0),m=p.index+p[0].length,a=U,l=ne;for(let O=r.length;a=l&&(++U,ne=l);if(r[U]instanceof ye)continue;u=a-U,Ae=e.slice(ne,l),p.index-=ne}else{S.lastIndex=0;var p=S.exec(Ae),u=1}if(!p){if(o)break;continue}b&&(ae=p[1]?p[1].length:0);var c=p.index+ae,p=p[0].slice(ae),m=c+p.length,f=Ae.slice(0,c),g=Ae.slice(m);let Y=[U,u];f&&(++U,ne+=f.length,Y.push(f));let cr=new ye(h,C?P.tokenize(p,C):p,Lr,p,de);if(Y.push(cr),g&&Y.push(g),Array.prototype.splice.apply(r,Y),u!=1&&P.matchGrammar(e,r,t,U,ne,!0,h),o)break}}}},tokenize:function(e,r){let t=[e],n=r.rest;if(n){for(let i in n)r[i]=n[i];delete r.rest}return P.matchGrammar(e,t,r,0,0,!1),t},hooks:{all:{},add:function(e,r){let t=P.hooks.all;t[e]=t[e]||[],t[e].push(r)},run:function(e,r){let t=P.hooks.all[e];if(!(!t||!t.length))for(var n=0,i;i=t[n++];)i(r)}},Token:ye};P.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};P.languages.javascript=P.languages.extend("clike",{"class-name":[P.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});P.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;P.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:P.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:P.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:P.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:P.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});P.languages.markup&&P.languages.markup.tag.addInlined("script","javascript");P.languages.js=P.languages.javascript;P.languages.typescript=P.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});P.languages.ts=P.languages.typescript;function ye(e,r,t,n,i){this.type=e,this.content=r,this.alias=t,this.length=(n||"").length|0,this.greedy=!!i}ye.stringify=function(e,r){return typeof e=="string"?e:Array.isArray(e)?e.map(function(t){return ye.stringify(t,r)}).join(""):Cp(e.type)(e.content)};function Cp(e){return js[e]||vp}function Vs(e){return Sp(e,P.languages.javascript)}function Sp(e,r){return P.tokenize(e,r).map(n=>ye.stringify(n)).join("")}var Bs=k(zo());function Us(e){return(0,Bs.default)(e)}var cn=class e{static read(r){let t;try{t=Qs.default.readFileSync(r,"utf-8")}catch{return null}return e.fromContent(t)}static fromContent(r){let t=r.split(/\r?\n/);return new e(1,t)}constructor(r,t){this.firstLineNumber=r,this.lines=t}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(r,t){if(rthis.lines.length+this.firstLineNumber)return this;let n=r-this.firstLineNumber,i=[...this.lines];return i[n]=t(i[n]),new e(this.firstLineNumber,i)}mapLines(r){return new e(this.firstLineNumber,this.lines.map((t,n)=>r(t,this.firstLineNumber+n)))}lineAt(r){return this.lines[r-this.firstLineNumber]}prependSymbolAt(r,t){return this.mapLines((n,i)=>i===r?`${t} ${n}`:` ${n}`)}slice(r,t){let n=this.lines.slice(r-1,t).join(` -`);return new e(r,Us(n).split(` -`))}highlight(){let r=Vs(this.toString());return new e(this.firstLineNumber,r.split(` -`))}toString(){return this.lines.join(` -`)}};var Rp={red:ue,gray:Nr,dim:Ie,bold:H,underline:X,highlightSource:e=>e.highlight()},Ap={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Ip({message:e,originalMethod:r,isPanic:t,callArguments:n}){return{functionName:`prisma.${r}()`,message:e,isPanic:t??!1,callArguments:n}}function _p({callsite:e,message:r,originalMethod:t,isPanic:n,callArguments:i},o){let s=Ip({message:r,originalMethod:t,isPanic:n,callArguments:i});if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=cn.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=Dp(c),m=kp(c);if(!m)return s;s.functionName=`${m.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,g=>g.slice(0,m.openingBraceIndex))),u=o.highlightSource(u);let f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,h)=>o.gray(String(h).padStart(f))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+f+1;g+=2,s.callArguments=(0,Gs.default)(i,g).slice(g)}}return s}function kp(e){let r=Object.keys(De.ModelAction).join("|"),n=new RegExp(String.raw`\.(${r})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function Dp(e){let r=0;for(let t=0;t{if("rejectOnNotFound"in n.args){let o=Ar({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new W(o,{clientVersion:r})}return await t(n).catch(o=>{throw o instanceof V&&o.code==="P2025"?new Oe(`No ${e} found`,r):o})}}function Se(e){return e.replace(/^./,r=>r.toLowerCase())}var Np=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Mp=["aggregate","count","groupBy"];function ki(e,r){let t=e._extensions.getAllModelExtensions(r)??{},n=[$p(e,r),jp(e,r),et(t),te("name",()=>r),te("$name",()=>r),te("$parent",()=>e._appliedParent)];return Pe({},n)}function $p(e,r){let t=Se(r),n=Object.keys(De.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=Js(o,r,e._clientVersion,s);let a=l=>u=>{let c=He(e._errorFormat);return e._createPrismaPromise(p=>{let m={args:u,dataPath:[],action:o,model:r,clientMethod:`${t}.${i}`,jsModelName:t,transaction:p,callsite:c};return s({...m,...l})})};return Np.includes(o)?_i(e,r,a):qp(i)?Ns(e,i,a):a({})}}}function qp(e){return Mp.includes(e)}function jp(e,r){return nr(te("fields",()=>{let t=e._runtimeDataModel.models[r];return Ms(r,t)}))}function Hs(e){return e.replace(/^./,r=>r.toUpperCase())}var Di=Symbol();function it(e){let r=[Vp(e),te(Di,()=>e),te("$parent",()=>e._appliedParent)],t=e._extensions.getAllClientExtensions();return t&&r.push(et(t)),Pe(e,r)}function Vp(e){let r=Object.keys(e._runtimeDataModel.models),t=r.map(Se),n=[...new Set(r.concat(t))];return nr({getKeys(){return n},getPropertyValue(i){let o=Hs(i);if(e._runtimeDataModel.models[o]!==void 0)return ki(e,o);if(e._runtimeDataModel.models[i]!==void 0)return ki(e,i)},getPropertyDescriptor(i){if(!t.includes(i))return{enumerable:!1}}})}function Ws(e){return e[Di]?e[Di]:e}function Ks(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let t=e.client.__AccelerateEngine;this._originalClient._engine=new t(this._originalClient._accelerateEngineConfig)}let r=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return it(r)}function Ys({result:e,modelName:r,select:t,omit:n,extensions:i}){let o=i.getAllComputedFields(r);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(c=>n[c]);u.length>0&&a.push(yr(u))}else if(t){if(!t[l.name])continue;let u=l.needs.filter(c=>!t[c]);u.length>0&&a.push(yr(u))}Bp(e,l.needs)&&s.push(Up(l,Pe(e,s)))}return s.length>0||a.length>0?Pe(e,[...s,...a]):e}function Bp(e,r){return r.every(t=>ci(e,t))}function Up(e,r){return nr(te(e.name,()=>e.compute(r)))}function pn({visitor:e,result:r,args:t,runtimeDataModel:n,modelName:i}){if(Array.isArray(r)){for(let s=0;sc.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};r[o]=pn({visitor:i,result:r[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Zs({result:e,modelName:r,args:t,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[r]?e:pn({result:e,args:t??{},modelName:r,runtimeDataModel:i,visitor:(s,a,l)=>Ys({result:s,modelName:Se(a),select:l.select,omit:l.omit,extensions:n})})}function Xs(e){if(e instanceof ie)return Qp(e);if(Array.isArray(e)){let t=[e[0]];for(let n=1;n{let o=r.customDataProxyFetch;return"transaction"in r&&i!==void 0&&(r.transaction?.kind==="batch"&&r.transaction.lock.then(),r.transaction=i),n===t.length?e._executeRequest(r):t[n]({model:r.model,operation:r.model?r.action:r.clientMethod,args:Xs(r.args??{}),__internalParams:r,query:(s,a=r)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=oa(o,l),a.args=s,ra(e,a,t,n+1)}})})}function ta(e,r){let{jsModelName:t,action:n,clientMethod:i}=r,o=t?n:i;if(e._extensions.isEmpty())return e._executeRequest(r);let s=e._extensions.getAllQueryCallbacks(t??"$none",o);return ra(e,r,s)}function na(e){return r=>{let t={requests:r},n=r[0].extensions.getAllBatchQueryCallbacks();return n.length?ia(t,n,0,e):e(t)}}function ia(e,r,t,n){if(t===r.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return r[t]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=oa(i,l),ia(a,r,t+1,n)}})}var ea=e=>e;function oa(e=ea,r=ea){return t=>e(r(t))}function aa(e,r,t){let n=Se(t);return!r.result||!(r.result.$allModels||r.result[n])?e:Gp({...e,...sa(r.name,e,r.result.$allModels),...sa(r.name,e,r.result[n])})}function Gp(e){let r=new xe,t=(n,i)=>r.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>t(o,i)):[n]));return gr(e,n=>({...n,needs:t(n.name,new Set)}))}function sa(e,r,t){return t?gr(t,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Jp(r,o,i)})):{}}function Jp(e,r,t){let n=e?.[r]?.compute;return n?i=>t({...i,[r]:n(i)}):t}function la(e,r){if(!r)return e;let t={...e};for(let n of Object.values(r))if(e[n.name])for(let i of n.needs)t[i]=!0;return t}function ua(e,r){if(!r)return e;let t={...e};for(let n of Object.values(r))if(!e[n.name])for(let i of n.needs)delete t[i];return t}var mn=class{constructor(r,t){this.extension=r;this.previous=t;this.computedFieldsCache=new xe;this.modelExtensionsCache=new xe;this.queryCallbacksCache=new xe;this.clientExtensions=Wr(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=Wr(()=>{let r=this.previous?.getAllBatchQueryCallbacks()??[],t=this.extension.query?.$__internalBatch;return t?r.concat(t):r})}getAllComputedFields(r){return this.computedFieldsCache.getOrCreate(r,()=>aa(this.previous?.getAllComputedFields(r),this.extension,r))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(r){return this.modelExtensionsCache.getOrCreate(r,()=>{let t=Se(r);return!this.extension.model||!(this.extension.model[t]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(r):{...this.previous?.getAllModelExtensions(r),...this.extension.model.$allModels,...this.extension.model[t]}})}getAllQueryCallbacks(r,t){return this.queryCallbacksCache.getOrCreate(`${r}:${t}`,()=>{let n=this.previous?.getAllQueryCallbacks(r,t)??[],i=[],o=this.extension.query;return!o||!(o[r]||o.$allModels||o[t]||o.$allOperations)?n:(o[r]!==void 0&&(o[r][t]!==void 0&&i.push(o[r][t]),o[r].$allOperations!==void 0&&i.push(o[r].$allOperations)),r!=="$none"&&o.$allModels!==void 0&&(o.$allModels[t]!==void 0&&i.push(o.$allModels[t]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[t]!==void 0&&i.push(o[t]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},dn=class e{constructor(r){this.head=r}static empty(){return new e}static single(r){return new e(new mn(r))}isEmpty(){return this.head===void 0}append(r){return new e(new mn(r,this.head))}getAllComputedFields(r){return this.head?.getAllComputedFields(r)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(r){return this.head?.getAllModelExtensions(r)}getAllQueryCallbacks(r,t){return this.head?.getAllQueryCallbacks(r,t)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var ca=L("prisma:client"),pa={Vercel:"vercel","Netlify CI":"netlify"};function ma({postinstall:e,ciName:r,clientVersion:t}){if(ca("checkPlatformCaching:postinstall",e),ca("checkPlatformCaching:ciName",r),e===!0&&r&&r in pa){let n=`Prisma has detected that this project was built on ${r}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${pa[r]}-build`;throw console.error(n),new R(n,t)}}function da(e,r){return e?e.datasources?e.datasources:e.datasourceUrl?{[r[0]]:{url:e.datasourceUrl}}:{}:{}}var Hp="Cloudflare-Workers",Wp="node";function fa(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Hp?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===Wp?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var Kp={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function fn(){let e=fa();return{id:e,prettyName:Kp[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var ba=k(require("fs")),st=k(require("path"));function gn(e){let{runtimeBinaryTarget:r}=e;return`Add "${r}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it: - -${Yp(e)}`}function Yp(e){let{generator:r,generatorBinaryTargets:t,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...t,i];return ai({...r,binaryTargets:o})}function We(e){let{runtimeBinaryTarget:r}=e;return`Prisma Client could not locate the Query Engine for runtime "${r}".`}function Ke(e){let{searchedLocations:r}=e;return`The following locations have been searched: -${[...new Set(r)].map(i=>` ${i}`).join(` -`)}`}function ga(e){let{runtimeBinaryTarget:r}=e;return`${We(e)} - -This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${r}". -${gn(e)} - -${Ke(e)}`}function hn(e){return`We would appreciate if you could take the time to share some information with us. -Please help us by answering a few questions: https://pris.ly/${e}`}function yn(e){let{errorStack:r}=e;return r?.match(/\/\.next|\/next@|\/next\//)?` - -We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function ha(e){let{queryEngineName:r}=e;return`${We(e)}${yn(e)} - -This is likely caused by a bundler that has not copied "${r}" next to the resulting bundle. -Ensure that "${r}" has been copied next to the bundle or in "${e.expectedLocation}". - -${hn("engine-not-found-bundler-investigation")} - -${Ke(e)}`}function ya(e){let{runtimeBinaryTarget:r,generatorBinaryTargets:t}=e,n=t.find(i=>i.native);return`${We(e)} - -This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${r}". -${gn(e)} - -${Ke(e)}`}function Ea(e){let{queryEngineName:r}=e;return`${We(e)}${yn(e)} - -This is likely caused by tooling that has not copied "${r}" to the deployment folder. -Ensure that you ran \`prisma generate\` and that "${r}" has been copied to "${e.expectedLocation}". - -${hn("engine-not-found-tooling-investigation")} - -${Ke(e)}`}var zp=L("prisma:client:engines:resolveEnginePath"),Zp=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function wa(e,r){let t={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??r.prismaPath;if(t!==void 0)return t;let{enginePath:n,searchedLocations:i}=await Xp(e,r);if(zp("enginePath",n),n!==void 0&&e==="binary"&&Xn(n),n!==void 0)return r.prismaPath=n;let o=await er(),s=r.generator?.binaryTargets??[],a=s.some(m=>m.native),l=!s.some(m=>m.value===o),u=__filename.match(Zp())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:r.generator,runtimeBinaryTarget:o,queryEngineName:xa(e,o),expectedLocation:st.default.relative(process.cwd(),r.dirname),errorStack:new Error().stack},p;throw a&&l?p=ya(c):l?p=ga(c):u?p=ha(c):p=Ea(c),new R(p,r.clientVersion)}async function Xp(engineType,config){let binaryTarget=await er(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,st.default.resolve(dirname,".."),config.generator?.output?.value??dirname,st.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(qo());for(let e of searchLocations){let r=xa(engineType,binaryTarget),t=st.default.join(e,r);if(searchedLocations.push(e),ba.default.existsSync(t))return{enginePath:t,searchedLocations}}return{enginePath:void 0,searchedLocations}}function xa(e,r){return e==="library"?At(r,"fs"):`query-engine-${r}${r==="windows"?".exe":""}`}var Oi=k(ui());function Pa(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,r=>`${r[0]}5`):""}function va(e){return e.split(` -`).map(r=>r.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` -`)}var Ta=k(is());function Ca({title:e,user:r="prisma",repo:t="prisma",template:n="bug_report.yml",body:i}){return(0,Ta.default)({user:r,repo:t,template:n,title:e,body:i})}function Sa({version:e,binaryTarget:r,title:t,description:n,engineVersion:i,database:o,query:s}){let a=go(6e3-(s?.length??0)),l=va((0,Oi.default)(a)),u=n?`# Description -\`\`\` -${n} -\`\`\``:"",c=(0,Oi.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: -## Versions - -| Name | Version | -|-----------------|--------------------| -| Node | ${process.version?.padEnd(19)}| -| OS | ${r?.padEnd(19)}| -| Prisma Client | ${e?.padEnd(19)}| -| Query Engine | ${i?.padEnd(19)}| -| Database | ${o?.padEnd(19)}| - -${u} - -## Logs -\`\`\` -${l} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?Pa(s):""} -\`\`\` -`),p=Ca({title:t,body:c});return`${t} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${X(p)} - -If you want the Prisma team to look into it, please open the link above \u{1F64F} -To increase the chance of success, please post your schema and a snippet of -how you used Prisma Client in the issue. -`}function Ir({inlineDatasources:e,overrideDatasources:r,env:t,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=r[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=t[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new R(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new R("error: Missing URL environment variable, value, or override.",n);return i}var En=class extends Error{constructor(r,t){super(r),this.clientVersion=t.clientVersion,this.cause=t.cause}get[Symbol.toStringTag](){return this.name}};var se=class extends En{constructor(r,t){super(r,t),this.isRetryable=t.isRetryable??!0}};function A(e,r){return{...e,isRetryable:r}}var _r=class extends se{constructor(t){super("This request must be retried",A(t,!0));this.name="ForcedRetryError";this.code="P5001"}};w(_r,"ForcedRetryError");var sr=class extends se{constructor(t,n){super(t,A(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};w(sr,"InvalidDatasourceError");var ar=class extends se{constructor(t,n){super(t,A(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};w(ar,"NotImplementedYetError");var $=class extends se{constructor(r,t){super(r,t),this.response=t.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 lr=class extends ${constructor(t){super("Schema needs to be uploaded",A(t,!0));this.name="SchemaMissingError";this.code="P5005"}};w(lr,"SchemaMissingError");var Li="This request could not be understood by the server",at=class extends ${constructor(t,n,i){super(n||Li,A(t,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};w(at,"BadRequestError");var lt=class extends ${constructor(t,n){super("Engine not started: healthcheck timeout",A(t,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};w(lt,"HealthcheckTimeoutError");var ut=class extends ${constructor(t,n,i){super(n,A(t,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};w(ut,"EngineStartupError");var ct=class extends ${constructor(t){super("Engine version is not supported",A(t,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};w(ct,"EngineVersionNotSupportedError");var Fi="Request timed out",pt=class extends ${constructor(t,n=Fi){super(n,A(t,!1));this.name="GatewayTimeoutError";this.code="P5009"}};w(pt,"GatewayTimeoutError");var em="Interactive transaction error",mt=class extends ${constructor(t,n=em){super(n,A(t,!1));this.name="InteractiveTransactionError";this.code="P5015"}};w(mt,"InteractiveTransactionError");var rm="Request parameters are invalid",dt=class extends ${constructor(t,n=rm){super(n,A(t,!1));this.name="InvalidRequestError";this.code="P5011"}};w(dt,"InvalidRequestError");var Ni="Requested resource does not exist",ft=class extends ${constructor(t,n=Ni){super(n,A(t,!1));this.name="NotFoundError";this.code="P5003"}};w(ft,"NotFoundError");var Mi="Unknown server error",kr=class extends ${constructor(t,n,i){super(n||Mi,A(t,!0));this.name="ServerError";this.code="P5006";this.logs=i}};w(kr,"ServerError");var $i="Unauthorized, check your connection string",gt=class extends ${constructor(t,n=$i){super(n,A(t,!1));this.name="UnauthorizedError";this.code="P5007"}};w(gt,"UnauthorizedError");var qi="Usage exceeded, retry again later",ht=class extends ${constructor(t,n=qi){super(n,A(t,!0));this.name="UsageExceededError";this.code="P5008"}};w(ht,"UsageExceededError");async function tm(e){let r;try{r=await e.text()}catch{return{type:"EmptyError"}}try{let t=JSON.parse(r);if(typeof t=="string")switch(t){case"InternalDataProxyError":return{type:"DataProxyError",body:t};default:return{type:"UnknownTextError",body:t}}if(typeof t=="object"&&t!==null){if("is_panic"in t&&"message"in t&&"error_code"in t)return{type:"QueryEngineError",body:t};if("EngineNotStarted"in t||"InteractiveTransactionMisrouted"in t||"InvalidRequestError"in t){let n=Object.values(t)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:t}:{type:"DataProxyError",body:t}}}return{type:"UnknownJsonError",body:t}}catch{return r===""?{type:"EmptyError"}:{type:"UnknownTextError",body:r}}}async function yt(e,r){if(e.ok)return;let t={clientVersion:r,response:e},n=await tm(e);if(n.type==="QueryEngineError")throw new V(n.body.message,{code:n.body.error_code,clientVersion:r});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new kr(t,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new lr(t);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new ct(t);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new ut(t,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new R(i,r,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new lt(t,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 mt(t,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new dt(t,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new gt(t,Dr($i,n));if(e.status===404)return new ft(t,Dr(Ni,n));if(e.status===429)throw new ht(t,Dr(qi,n));if(e.status===504)throw new pt(t,Dr(Fi,n));if(e.status>=500)throw new kr(t,Dr(Mi,n));if(e.status>=400)throw new at(t,Dr(Li,n))}function Dr(e,r){return r.type==="EmptyError"?e:`${e}: ${JSON.stringify(r)}`}function Ra(e){let r=Math.pow(2,e)*50,t=Math.ceil(Math.random()*r)-Math.ceil(r/2),n=r+t;return new Promise(i=>setTimeout(()=>i(n),n))}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Aa(e){let r=new TextEncoder().encode(e),t="",n=r.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,t+=Ne[s]+Ne[a]+Ne[l]+Ne[u];return i==1?(c=r[o],s=(c&252)>>2,a=(c&3)<<4,t+=Ne[s]+Ne[a]+"=="):i==2&&(c=r[o]<<8|r[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,t+=Ne[s]+Ne[a]+Ne[l]+"="),t}function Ia(e){if(!!e.generator?.previewFeatures.some(t=>t.toLowerCase().includes("metrics")))throw new R("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 nm(e){return e[0]*1e3+e[1]/1e6}function _a(e){return new Date(nm(e))}var ka={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Et=class extends se{constructor(t,n){super(`Cannot fetch data from service: -${t}`,A(n,!0));this.name="RequestError";this.code="P5010"}};w(Et,"RequestError");async function ur(e,r,t=n=>n){let n=r.clientVersion;try{return typeof fetch=="function"?await t(fetch)(e,r):await t(ji)(e,r)}catch(i){let o=i.message??"Unknown error";throw new Et(o,{clientVersion:n})}}function om(e){return{...e.headers,"Content-Type":"application/json"}}function sm(e){return{method:e.method,headers:om(e)}}function am(e,r){return{text:()=>Promise.resolve(Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(Buffer.concat(e).toString())),ok:r.statusCode>=200&&r.statusCode<=299,status:r.statusCode,url:r.url,headers:new Vi(r.headers)}}async function ji(e,r={}){let t=lm("https"),n=sm(r),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{let l=t.request(e,n,u=>{let{statusCode:c,headers:{location:p}}=u;c>=301&&c<=399&&p&&(p.startsWith("http")===!1?s(ji(`${o}${p}`,r)):s(ji(p,r))),u.on("data",m=>i.push(m)),u.on("end",()=>s(am(i,u))),u.on("error",a)});l.on("error",a),l.end(r.body??"")})}var lm=typeof require<"u"?require:()=>{},Vi=class{constructor(r={}){this.headers=new Map;for(let[t,n]of Object.entries(r))if(typeof n=="string")this.headers.set(t,n);else if(Array.isArray(n))for(let i of n)this.headers.set(t,i)}append(r,t){this.headers.set(r,t)}delete(r){this.headers.delete(r)}get(r){return this.headers.get(r)??null}has(r){return this.headers.has(r)}set(r,t){this.headers.set(r,t)}forEach(r,t){for(let[n,i]of this.headers)r.call(t,i,n,this)}};var um=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Da=L("prisma:client:dataproxyEngine");async function cm(e,r){let t=ka["@prisma/engines-version"],n=r.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.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&&um.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=t.split("-")??[],[a,l,u]=s.split("."),c=pm(`<=${a}.${l}.${u}`),p=await ur(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()||""}`);let m=await p.text();Da("length of body fetched from unpkg.com",m.length);let f;try{f=JSON.parse(m)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",m),g}return f.version}throw new ar("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Oa(e,r){let t=await cm(e,r);return Da("version",t),t}function pm(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var La=3,Bi=L("prisma:client:dataproxyEngine"),Ui=class{constructor({apiKey:r,tracingHelper:t,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=r,this.tracingHelper=t,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:r,interactiveTransaction:t}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=r??this.tracingHelper.getTraceParent()),t&&(n["X-transaction-id"]=t.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let r=[];return this.tracingHelper.isEnabled()&&r.push("tracing"),this.logLevel&&r.push(this.logLevel),this.logQueries&&r.push("query"),r}},bt=class{constructor(r){this.name="DataProxyEngine";Ia(r),this.config=r,this.env={...r.env,...typeof process<"u"?process.env:{}},this.inlineSchema=Aa(r.inlineSchema),this.inlineDatasources=r.inlineDatasources,this.inlineSchemaHash=r.inlineSchemaHash,this.clientVersion=r.clientVersion,this.engineHash=r.engineVersion,this.logEmitter=r.logEmitter,this.tracingHelper=r.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[r,t]=this.extractHostAndApiKey();this.host=r,this.headerBuilder=new Ui({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await Oa(r,this.config),Bi("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(r){r?.logs?.length&&r.logs.forEach(t=>{switch(t.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let n=typeof t.attributes.query=="string"?t.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[i]=n.split("/* traceparent");n=i}this.logEmitter.emit("query",{query:n,timestamp:_a(t.timestamp),duration:Number(t.attributes.duration_ms),params:t.attributes.params,target:t.attributes.target})}}}),r?.traces?.length&&this.tracingHelper.createEngineSpan({span:!0,spans:r.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(r){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${r}`}async uploadSchema(){let r={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(r,async()=>{let t=await ur(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});t.ok||Bi("schema response status",t.status);let n=await yt(t,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(r,{traceparent:t,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:r,traceparent:t,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(r,{traceparent:t,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Er(r,n),{batchResult:a,elapsed:l}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:t});return a.map(u=>"errors"in u&&u.errors.length>0?or(u.errors[0],this.clientVersion,this.config.activeProvider):{data:u,elapsed:l})}requestInternal({body:r,traceparent:t,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 ur(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t,interactiveTransaction:i}),body:JSON.stringify(r),clientVersion:this.clientVersion},n);a.ok||Bi("graphql response status",a.status),await this.handleError(await yt(a,this.clientVersion));let l=await a.json(),u=l.extensions;if(u&&this.propagateResponseExtensions(u),l.errors)throw l.errors.length===1?or(l.errors[0],this.config.clientVersion,this.config.activeProvider):new B(l.errors,{clientVersion:this.config.clientVersion});return l}})}async transaction(r,t,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[r]} transaction`,callback:async({logHttpCall:o})=>{if(r==="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 ur(a,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await yt(l,this.clientVersion));let u=await l.json(),c=u.extensions;c&&this.propagateResponseExtensions(c);let p=u.id,m=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:m}}}else{let s=`${n.payload.endpoint}/${r}`;o(s);let a=await ur(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),clientVersion:this.clientVersion});await this.handleError(await yt(a,this.clientVersion));let u=(await a.json()).extensions;u&&this.propagateResponseExtensions(u);return}}})}extractHostAndApiKey(){let r={clientVersion:this.clientVersion},t=Object.keys(this.inlineDatasources)[0],n=Ir({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new sr(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:")throw new sr(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r);let l=a.get("api_key");if(l===null||l.length<1)throw new sr(`Error validating datasource \`${t}\`: the URL must contain a valid API key`,r);return[s,l]}metrics(){throw new ar("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(r){for(let t=0;;t++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${t})`,timestamp:new Date,target:""})};try{return await r.callback({logHttpCall:n})}catch(i){if(!(i instanceof se)||!i.isRetryable)throw i;if(t>=La)throw i instanceof _r?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${t+1}/${La} failed for ${r.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await Ra(t);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(r){if(r instanceof lr)throw await this.uploadSchema(),new _r({clientVersion:this.clientVersion,cause:r});if(r)throw r}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Fa(e){if(e?.kind==="itx")return e.options.id}var Gi=k(require("os")),Na=k(require("path"));var Qi=Symbol("PrismaLibraryEngineCache");function mm(){let e=globalThis;return e[Qi]===void 0&&(e[Qi]={}),e[Qi]}function dm(e){let r=mm();if(r[e]!==void 0)return r[e];let t=Na.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=Gi.default.constants.dlopen.RTLD_LAZY|Gi.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,t,i),r[e]=n.exports,n.exports}var Ma={async loadLibrary(e){let r=await Bn(),t=await wa("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>dm(t))}catch(n){let i=ei({e:n,platformInfo:r,id:t});throw new R(i,e.clientVersion)}}};var Ji,$a={async loadLibrary(e){let{clientVersion:r,adapter:t,engineWasm:n}=e;if(t===void 0)throw new R(`The \`adapter\` option for \`PrismaClient\` is required in this context (${fn().prettyName})`,r);if(n===void 0)throw new R("WASM engine was unexpectedly `undefined`",r);Ji===void 0&&(Ji=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new R("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",r);let a={"./query_engine_bg.js":o},l=new WebAssembly.Instance(s,a);return o.__wbg_set_wasm(l.exports),o.QueryEngine})());let i=await Ji;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var fm="P2036",Re=L("prisma:client:libraryEngine");function gm(e){return e.item_type==="query"&&"query"in e}function hm(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var qa=[...Mn,"native"],ja=0,wt=class{constructor(r,t){this.name="LibraryEngine";this.libraryLoader=t??Ma,r.engineWasm!==void 0&&(this.libraryLoader=t??$a),this.config=r,this.libraryStarted=!1,this.logQueries=r.logQueries??!1,this.logLevel=r.logLevel??"error",this.logEmitter=r.logEmitter,this.datamodel=r.inlineSchema,r.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(r.overrideDatasources)[0],i=r.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary(),this.checkForTooManyEngines()}checkForTooManyEngines(){ja===10&&console.warn(`${fe("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(r,t,n){await this.start();let i=JSON.stringify(t),o;if(r==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else r==="commit"?o=await this.engine?.commitTransaction(n.id,i):r==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(ym(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new V(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(Re("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;Nn(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let r=await er();if(!qa.includes(r))throw new R(`Unknown ${ue("PRISMA_QUERY_ENGINE_LIBRARY")} ${ue(H(r))}. Possible binaryTargets: ${Me(qa.join(", "))} or a path to the query engine library. -You may have to run ${Me("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return r}}parseEngineResponse(r){if(!r)throw new B("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(r)}catch{throw new B("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let r=new WeakRef(this),{adapter:t}=this.config;t&&Re("Using driver adapter: %O",t),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{r.deref()?.logger(n)},t),ja++}catch(r){let t=r,n=this.parseInitError(t.message);throw typeof n=="string"?t:new R(n.message,this.config.clientVersion,n.error_code)}}}logger(r){let t=this.parseEngineResponse(r);if(t){if("span"in t){this.config.tracingHelper.createEngineSpan(t);return}t.level=t?.level.toLowerCase()??"unknown",gm(t)?this.logEmitter.emit("query",{timestamp:new Date,query:t.query,params:t.params,duration:Number(t.duration_ms),target:t.module_path}):hm(t)?this.loggerRustPanic=new le(Hi(this,`${t.message}: ${t.reason} in ${t.file}:${t.line}:${t.column}`),this.config.clientVersion):this.logEmitter.emit(t.level,{timestamp:new Date,message:t.message,target:t.module_path})}}parseInitError(r){try{return JSON.parse(r)}catch{}return r}parseRequestError(r){try{return JSON.parse(r)}catch{}return r}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Re(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let r=async()=>{Re("library starting");try{let t={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(t)),this.libraryStarted=!0,Re("library started")}catch(t){let n=this.parseInitError(t.message);throw typeof n=="string"?t:new R(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",r),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Re("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let r=async()=>{await new Promise(n=>setTimeout(n,5)),Re("library stopping");let t={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(t)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,Re("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",r),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(r){return this.library?.debugPanic(r)}async request(r,{traceparent:t,interactiveTransaction:n}){Re(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:t}),o=JSON.stringify(r);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new B(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof R)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new le(Hi(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new B(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(r,{transaction:t,traceparent:n}){Re("requestBatch");let i=Er(r,t);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Fa(t));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new B(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:l}=s;if(Array.isArray(a))return a.map(u=>u.errors&&u.errors.length>0?this.loggerRustPanic??this.buildQueryError(u.errors[0]):{data:u,elapsed:0});throw l&&l.length===1?new Error(l[0].error):new Error(JSON.stringify(s))}buildQueryError(r){if(r.user_facing_error.is_panic)return new le(Hi(this,r.user_facing_error.message),this.config.clientVersion);let t=this.getExternalAdapterError(r.user_facing_error);return t?t.error:or(r,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(r){if(r.error_code===fm&&this.config.adapter){let t=r.meta?.id;jt(typeof t=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(t);return jt(n,"External error with reported id was not registered"),n}}async metrics(r){await this.start();let t=await this.engine.metrics(JSON.stringify(r));return r.format==="prometheus"?t:this.parseEngineResponse(t)}};function ym(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function Hi(e,r){return Sa({binaryTarget:e.binaryTarget,title:r,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function Va({copyEngine:e=!0},r){let t;try{t=Ir({inlineDatasources:r.inlineDatasources,overrideDatasources:r.overrideDatasources,env:{...r.env,...process.env},clientVersion:r.clientVersion})}catch{}e&&t?.startsWith("prisma://")&&Hr("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Ur(r.generator),i=!!(t?.startsWith("prisma://")||!e),o=!!r.adapter,s=n==="library",a=n==="binary";if(i&&o||o&&!1){let l;throw e?t?.startsWith("prisma://")?l=["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."]:l=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:l=["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 W(l.join(` -`),{clientVersion:r.clientVersion})}if(i)return new bt(r);if(s)return new wt(r);throw new W("Invalid client engine type, please use `library` or `binary`",{clientVersion:r.clientVersion})}function bn({generator:e}){return e?.previewFeatures??[]}var Ha=k(Wi());function Ga(e,r){let t=Ja(e),n=Em(t),i=wm(n);i?wn(i,r):r.addErrorMessage(()=>"Unknown error")}function Ja(e){return e.errors.flatMap(r=>r.kind==="Union"?Ja(r):[r])}function Em(e){let r=new Map,t=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){t.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=r.get(i);o?r.set(i,{...n,argument:{...n.argument,typeNames:bm(o.argument.typeNames,n.argument.typeNames)}}):r.set(i,n)}return t.push(...r.values()),t}function bm(e,r){return[...new Set(e.concat(r))]}function wm(e){return mi(e,(r,t)=>{let n=Ua(r),i=Ua(t);return n!==i?n-i:Qa(r)-Qa(t)})}function Ua(e){let r=0;return Array.isArray(e.selectionPath)&&(r+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(r+=e.argumentPath.length),r}function Qa(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var me=class{constructor(r,t){this.name=r;this.value=t;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(r){let{colors:{green:t}}=r.context;r.addMarginSymbol(t(this.isRequired?"+":"?")),r.write(t(this.name)),this.isRequired||r.write(t("?")),r.write(t(": ")),typeof this.value=="string"?r.write(t(this.value)):r.write(this.value)}};var xn=class{constructor(){this.fields=[]}addField(r,t){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${r}: ${t}`))).addMarginSymbol(i(o("+")))}}),this}write(r){let{colors:{green:t}}=r.context;r.writeLine(t("{")).withIndent(()=>{r.writeJoined(Cr,this.fields).newLine()}).write(t("}")).addMarginSymbol(t("+"))}};function wn(e,r){switch(e.kind){case"MutuallyExclusiveFields":xm(e,r);break;case"IncludeOnScalar":Pm(e,r);break;case"EmptySelection":vm(e,r);break;case"UnknownSelectionField":Sm(e,r);break;case"UnknownArgument":Rm(e,r);break;case"UnknownInputField":Am(e,r);break;case"RequiredArgumentMissing":Im(e,r);break;case"InvalidArgumentType":_m(e,r);break;case"InvalidArgumentValue":km(e,r);break;case"ValueTooLarge":Dm(e,r);break;case"SomeFieldsMissing":Om(e,r);break;case"TooManyFieldsGiven":Lm(e,r);break;case"Union":Ga(e,r);break;default:throw new Error("not implemented: "+e.kind)}}function xm(e,r){let t=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();t&&(t.getField(e.firstField)?.markAsError(),t.getField(e.secondField)?.markAsError()),r.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Pm(e,r){let[t,n]=Pn(e.selectionPath),i=e.outputType,o=r.arguments.getDeepSelectionParent(t)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new me(s.name,"true"));r.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${xt(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function vm(e,r){let t=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(t){let n=t.getField("omit")?.value.asObject();if(n){Tm(e,r,n);return}}Cm(e,r)}function Tm(e,r,t){t.removeAllFields();for(let n of e.outputType.fields)t.addSuggestion(new me(n.name,"false"));r.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Cm(e,r){let t=e.outputType,n=r.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Ya(n,t)),r.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(t.name)} must not be empty. ${xt(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(t.name)} needs ${o.bold("at least one truthy value")}.`)}function Sm(e,r){let[t,n]=Pn(e.selectionPath),i=r.arguments.getDeepSubSelectionValue(t)?.asObject(),o;if(i){let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),l=i.getFieldValue("omit")?.asObject();s?.hasField(n)?(o="select",s.getField(n)?.markAsError(),Ya(s,e.outputType)):a?.hasField(n)?(o="include",a.getField(n)?.markAsError(),Fm(a,e.outputType)):l?.hasField(n)&&(o="omit",l.getField(n)?.markAsError(),Nm(l,e.outputType))}r.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(xt(s)),a.join(" ")})}function Rm(e,r){let t=e.argumentPath[0],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(t)?.markAsError(),Mm(n,e.arguments)),r.addErrorMessage(i=>Wa(i,t,e.arguments.map(o=>o.name)))}function Am(e,r){let[t,n]=Pn(e.argumentPath),i=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(t)?.asObject();o&&za(o,e.inputType)}r.addErrorMessage(o=>Wa(o,n,e.inputType.fields.map(s=>s.name)))}function Wa(e,r,t){let n=[`Unknown argument \`${e.red(r)}\`.`],i=qm(r,t);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),t.length>0&&n.push(xt(e)),n.join(" ")}function Im(e,r){let t;r.addErrorMessage(l=>t?.value instanceof J&&t.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Pn(e.argumentPath),s=new xn,a=n.getDeepFieldValue(i)?.asObject();if(a)if(t=a.getField(o),t&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new me(o,s).makeRequired())}else{let l=e.inputTypes.map(Ka).join(" | ");a.addSuggestion(new me(o,l).makeRequired())}}function Ka(e){return e.kind==="list"?`${Ka(e.elementType)}[]`:e.name}function _m(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),r.addErrorMessage(i=>{let o=vn("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(t)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function km(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),r.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(t)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=vn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Dm(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof J&&(i=s.text)}r.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(t)}\``),s.join(" ")})}function Om(e,r){let t=e.argumentPath[e.argumentPath.length-1],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&za(i,e.inputType)}r.addErrorMessage(i=>{let o=[`Argument \`${i.bold(t)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${vn("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(xt(i)),o.join(" ")})}function Lm(e,r){let t=e.argumentPath[e.argumentPath.length-1],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}r.addErrorMessage(o=>{let s=[`Argument \`${o.bold(t)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${vn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Ya(e,r){for(let t of r.fields)e.hasField(t.name)||e.addSuggestion(new me(t.name,"true"))}function Fm(e,r){for(let t of r.fields)t.isRelation&&!e.hasField(t.name)&&e.addSuggestion(new me(t.name,"true"))}function Nm(e,r){for(let t of r.fields)!e.hasField(t.name)&&!t.isRelation&&e.addSuggestion(new me(t.name,"true"))}function Mm(e,r){for(let t of r)e.hasField(t.name)||e.addSuggestion(new me(t.name,t.typeNames.join(" | ")))}function za(e,r){if(r.kind==="object")for(let t of r.fields)e.hasField(t.name)||e.addSuggestion(new me(t.name,t.typeNames.join(" | ")))}function Pn(e){let r=[...e],t=r.pop();if(!t)throw new Error("unexpected empty path");return[r,t]}function xt({green:e,enabled:r}){return"Available options are "+(r?`listed in ${e("green")}`:"marked with ?")+"."}function vn(e,r){if(r.length===1)return r[0];let t=[...r],n=t.pop();return`${t.join(", ")} ${e} ${n}`}var $m=3;function qm(e,r){let t=1/0,n;for(let i of r){let o=(0,Ha.default)(e,i);o>$m||o({name:r.name,typeName:"boolean",isRelation:r.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(r){return this.params.previewFeatures.includes(r)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(r){return this.model?.fields.find(t=>t.name===r)}nestSelection(r){let t=this.findField(r),n=t?.kind==="object"?t.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(r)})}nestArgument(r){return new e({...this.params,argumentPath:this.params.argumentPath.concat(r)})}};var rl=e=>({command:e});var tl=e=>e.strings.reduce((r,t,n)=>`${r}@P${n}${t}`);function Pt(e){try{return nl(e,"fast")}catch{return nl(e,"slow")}}function nl(e,r){return JSON.stringify(e.map(t=>Km(t,r)))}function Km(e,r){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:wr(e)?{prisma__type:"date",prisma__value:e.toJSON()}:Te.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Ym(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")}:typeof e=="object"&&r==="slow"?ol(e):e}function Ym(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function ol(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(il);let r={};for(let t of Object.keys(e))r[t]=il(e[t]);return r}function il(e){return typeof e=="bigint"?e.toString():ol(e)}var zm=/^(\s*alter\s)/i,sl=L("prisma:client");function zi(e,r,t,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&t.length>0&&zm.exec(r))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Zi=({clientMethod:e,activeProvider:r})=>t=>{let n="",i;if(Array.isArray(t)){let[o,...s]=t;n=o,i={values:Pt(s||[]),__prismaRawParameters__:!0}}else switch(r){case"sqlite":case"mysql":{n=t.sql,i={values:Pt(t.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=t.text,i={values:Pt(t.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=tl(t),i={values:Pt(t.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${r} provider does not support ${e}`)}return i?.values?sl(`prisma.${e}(${n}, ${i.values})`):sl(`prisma.${e}(${n})`),{query:n,parameters:i}},al={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[r,...t]=e;return new ie(r,t)}},ll={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Xi(e){return function(t){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??(n=ul(t(o))):ul(t(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function ul(e){return typeof e.then=="function"?e:Promise.resolve(e)}var cl={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,r){return r()}},eo=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(r){return this.getGlobalTracingHelper().getTraceParent(r)}createEngineSpan(r){return this.getGlobalTracingHelper().createEngineSpan(r)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(r,t){return this.getGlobalTracingHelper().runInChildSpan(r,t)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??cl}};function pl(e){return e.includes("tracing")?new eo:cl}function ml(e,r=()=>{}){let t,n=new Promise(i=>t=i);return{then(i){return--e===0&&t(r()),i?.(n)}}}var Zm=["$connect","$disconnect","$on","$transaction","$use","$extends"],dl=Zm;function fl(e){return typeof e=="string"?e:e.reduce((r,t)=>{let n=typeof t=="string"?t:t.level;return n==="query"?r:r&&(t==="info"||r==="info")?"info":n},void 0)}var Cn=class{constructor(){this._middlewares=[]}use(r){this._middlewares.push(r)}get(r){return this._middlewares[r]}has(r){return!!this._middlewares[r]}length(){return this._middlewares.length}};var hl=k(ui());function Sn(e){return typeof e.batchRequestIdx=="number"}function Rn(e){return e===null?e:Array.isArray(e)?e.map(Rn):typeof e=="object"?Xm(e)?ed(e):gr(e,Rn):e}function Xm(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function ed({$type:e,value:r}){switch(e){case"BigInt":return BigInt(r);case"Bytes":return Buffer.from(r,"base64");case"DateTime":return new Date(r);case"Decimal":return new Te(r);case"Json":return JSON.parse(r);default:rr(r,"Unknown tagged value")}}function gl(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let r=[];return e.modelName&&r.push(e.modelName),e.query.arguments&&r.push(ro(e.query.arguments)),r.push(ro(e.query.selection)),r.join("")}function ro(e){return`(${Object.keys(e).sort().map(t=>{let n=e[t];return typeof n=="object"&&n!==null?`(${t} ${ro(n)})`:t}).join(" ")})`}var rd={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function to(e){return rd[e]}var An=class{constructor(r){this.options=r;this.tickActive=!1;this.batches={}}request(r){let t=this.options.batchBy(r);return t?(this.batches[t]||(this.batches[t]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[t].push({request:r,resolve:n,reject:i})})):this.options.singleLoader(r)}dispatchBatches(){for(let r in this.batches){let t=this.batches[r];delete this.batches[r],t.length===1?this.options.singleLoader(t[0].request).then(n=>{n instanceof Error?t[0].reject(n):t[0].resolve(n)}).catch(n=>{t[0].reject(n)}):(t.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(t.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>to(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:nd(o),containsWrite:u,customDataProxyFetch:i})).map((p,m)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[m],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?yl(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:to(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:gl(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(r){try{return await this.dataloader.request(r)}catch(t){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=r;this.handleAndLogRequestError({error:t,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:r,unpacker:t},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,r,t);return process.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(r){try{this.handleRequestError(r)}catch(t){throw this.logEmitter&&this.logEmitter.emit("error",{message:t.message,target:r.clientMethod,timestamp:new Date}),t}}handleRequestError({error:r,clientMethod:t,callsite:n,transaction:i,args:o,modelName:s}){if(td(r),id(r,i)||r instanceof Oe)throw r;if(r instanceof V&&od(r)){let l=El(r.meta);Tn({args:o,errors:[l],callsite:n,errorFormat:this.client._errorFormat,originalMethod:t,clientVersion:this.client._clientVersion})}let a=r.message;if(n&&(a=Ar({callsite:n,originalMethod:t,isPanic:r.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),r.code){let l=s?{modelName:s,...r.meta}:r.meta;throw new V(a,{code:r.code,clientVersion:this.client._clientVersion,meta:l,batchRequestIdx:r.batchRequestIdx})}else{if(r.isPanic)throw new le(a,this.client._clientVersion);if(r instanceof B)throw new B(a,{clientVersion:this.client._clientVersion,batchRequestIdx:r.batchRequestIdx});if(r instanceof R)throw new R(a,this.client._clientVersion);if(r instanceof le)throw new le(a,this.client._clientVersion)}throw r.clientVersion=this.client._clientVersion,r}sanitizeMessage(r){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,hl.default)(r):r}unpack(r,t,n){if(!r||(r.data&&(r=r.data),!r))return r;let i=Object.values(r)[0],o=t.filter(a=>a!=="select"&&a!=="include"),s=Rn(Ii(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function nd(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:yl(e)};rr(e,"Unknown transaction kind")}}function yl(e){return{id:e.id,payload:e.payload}}function id(e,r){return Sn(e)&&r?.kind==="batch"&&e.batchRequestIdx!==r.index}function od(e){return e.code==="P2009"||e.code==="P2012"}function El(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(El)};if(Array.isArray(e.selectionPath)){let[,...r]=e.selectionPath;return{...e,selectionPath:r}}return e}var bl="5.14.0";var wl=bl;function xl(e){return e.map(r=>{let t={};for(let n of Object.keys(r))t[n]=Pl(r[n]);return t})}function Pl({prisma__type:e,prisma__value:r}){switch(e){case"bigint":return BigInt(r);case"bytes":return Buffer.from(r,"base64");case"decimal":return new Te(r);case"datetime":case"date":return new Date(r);case"time":return new Date(`1970-01-01T${r}Z`);case"array":return r.map(Pl);default:return r}}var Sl=k(Wi());var q=class extends Error{constructor(r){super(r+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};w(q,"PrismaClientConstructorValidationError");var vl=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Tl=["pretty","colorless","minimal"],Cl=["info","query","warn","error"],ad={datasources:(e,{datasourceNames:r})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[t,n]of Object.entries(e)){if(!r.includes(t)){let i=Or(t,r)||` Available datasources: ${r.join(", ")}`;throw new q(`Unknown datasource ${t} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new q(`Invalid value ${JSON.stringify(o)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,r)=>{if(e===null)return;if(e===void 0)throw new q('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!bn(r).includes("driverAdapters"))throw new q('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Ur()==="binary")throw new q('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Tl.includes(e)){let r=Or(e,Tl);throw new q(`Invalid errorFormat ${e} provided to PrismaClient constructor.${r}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function r(t){if(typeof t=="string"&&!Cl.includes(t)){let n=Or(t,Cl);throw new q(`Invalid log level "${t}" provided to PrismaClient constructor.${n}`)}}for(let t of e){r(t);let n={level:r,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Or(i,o);throw new q(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(t&&typeof t=="object")for(let[i,o]of Object.entries(t))if(n[i])n[i](o);else throw new q(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let r=e.maxWait;if(r!=null&&r<=0)throw new q(`Invalid value ${r} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let t=e.timeout;if(t!=null&&t<=0)throw new q(`Invalid value ${t} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let r=["debug","engine","configOverride"];if(typeof e!="object")throw new q(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[t]of Object.entries(e))if(!r.includes(t)){let n=Or(t,r);throw new q(`Invalid property ${JSON.stringify(t)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Rl(e,r){for(let[t,n]of Object.entries(e)){if(!vl.includes(t)){let i=Or(t,vl);throw new q(`Unknown property ${t} provided to PrismaClient constructor.${i}`)}ad[t](n,r)}if(e.datasourceUrl&&e.datasources)throw new q('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Or(e,r){if(r.length===0||typeof e!="string")return"";let t=ld(e,r);return t?` Did you mean "${t}"?`:""}function ld(e,r){if(r.length===0)return null;let t=r.map(i=>({value:i,distance:(0,Sl.default)(e,i)}));t.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?t(i):r(n)))},l=u=>{o||(o=!0,t(u))};for(let u=0;u{n[u]=c,a()},c=>{if(!Sn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var Ye=L("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var ud={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},cd=Symbol.for("prisma.client.transaction.id"),pd={id:0,nextId(){return++this.id}};function Ll(e){class r{constructor(n){this._originalClient=this;this._middlewares=new Cn;this._createPrismaPromise=Xi();this.$extends=Ks;e=n?.__internal?.configOverride?.(e)??e,ma(e),n&&Rl(n,e);let i=n?.adapter?yi(n.adapter):void 0,o=new Dl.EventEmitter().on("error",()=>{});this._extensions=dn.empty(),this._previewFeatures=bn(e),this._clientVersion=e.clientVersion??wl,this._activeProvider=e.activeProvider,this._tracingHelper=pl(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&vt.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&vt.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=!i&&Br(s,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&L.enable("prisma:client");let p=vt.default.resolve(e.dirname,e.relativePath);Ol.default.existsSync(p)||(p=e.dirname),Ye("dirname",e.dirname),Ye("relativePath",e.relativePath),Ye("cwd",p);let m=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:m.allowTriggerPanic,datamodelPath:vt.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:m.binaryPath??void 0,engineEndpoint:m.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&fl(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(f=>typeof f=="string"?f==="query":f.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:da(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Ir,getBatchRequestPayload:Er,prismaGraphQLToJSError:or,PrismaClientUnknownRequestError:B,PrismaClientInitializationError:R,PrismaClientKnownRequestError:V,debug:L("prisma:client:accelerateEngine"),engineVersion:_l.version,clientVersion:e.clientVersion}},Ye("clientVersion",e.clientVersion),this._engine=Va(e,this._engineConfig),this._requestHandler=new In(this,o),l.log)for(let f of l.log){let g=typeof f=="string"?f:f.emit==="stdout"?f.level:null;g&&this.$on(g,h=>{Jr.log(`${Jr.tags[g]??""}`,h.message||h.query)})}this._metrics=new hr(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=it(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{ho()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Zi({clientMethod:i,activeProvider:a}),callsite:He(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Il(n,i);return zi(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new W("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(zi(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new W(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:rl,callsite:He(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Zi({clientMethod:i,activeProvider:a}),callsite:He(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(xl)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Il(n,i));throw new W("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=pd.nextId(),s=ml(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return Al(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return it(Pe(Ws(this),[te("_appliedParent",()=>this._appliedParent._createItxClient(n)),te("_createPrismaPromise",()=>Xi(n)),te(cd,()=>n.id),yr(dl)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??ud,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,I=>c(u,T=>(I?.end(),l(T))));let{runInTransaction:p,args:m,...f}=u,g={...n,...f};m&&(g.args=i.middlewareArgsToRequestArgs(m)),n.transaction!==void 0&&p===!1&&delete g.transaction;let h=await ta(this,g);return g.model?Zs({result:h,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):h};return this._tracingHelper.runInChildSpan(s.operation,()=>new kl.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:m,customDataProxyFetch:f}){try{n=u?u(n):n;let g={name:"serialize"},h=this._tracingHelper.runInChildSpan(g,()=>Za({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return L.enabled("prisma:client")&&(Ye("Prisma Client call:"),Ye(`prisma.${i}(${_s(n)})`),Ye("Generated request:"),Ye(JSON.stringify(h,null,2)+` -`)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:h,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:m,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:f})}catch(g){throw g.clientVersion=this._clientVersion,g}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new W("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return r}function Il(e,r){return md(e)?[new ie(e,r),al]:[e,ll]}function md(e){return Array.isArray(e)&&Array.isArray(e.raw)}var dd=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Fl(e){return new Proxy(e,{get(r,t){if(t in r)return r[t];if(!dd.has(t))throw new TypeError(`Invalid enum value: ${String(t)}`)}})}function Nl(e){Br(e,{conflictCheck:"warn"})}0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -/*! Bundled license information: - -decimal.js/decimal.mjs: - (*! - * decimal.js v10.4.3 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2022 Michael Mclaughlin - * MIT Licence - *) -*/ -//# sourceMappingURL=library.js.map diff --git a/integration-tests/tests/prisma/pg/client/runtime/react-native.js b/integration-tests/tests/prisma/pg/client/runtime/react-native.js deleted file mode 100644 index a800dbe8b..000000000 --- a/integration-tests/tests/prisma/pg/client/runtime/react-native.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict";var ea=Object.create;var Qt=Object.defineProperty;var ta=Object.getOwnPropertyDescriptor;var ra=Object.getOwnPropertyNames;var na=Object.getPrototypeOf,ia=Object.prototype.hasOwnProperty;var Se=(e,t)=>()=>(e&&(t=e(e=0)),t);var ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ye=(e,t)=>{for(var r in t)Qt(e,r,{get:t[r],enumerable:!0})},jn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ra(t))!ia.call(e,i)&&i!==r&&Qt(e,i,{get:()=>t[i],enumerable:!(n=ta(t,i))||n.enumerable});return e};var fe=(e,t,r)=>(r=e!=null?ea(na(e)):{},jn(t||!e||!e.__esModule?Qt(r,"default",{value:e,enumerable:!0}):r,e)),Dr=e=>jn(Qt({},"__esModule",{value:!0}),e);var y,c=Se(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var x,p=Se(()=>{"use strict";x=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,f=Se(()=>{"use strict";E=()=>{};E.prototype=E});var b,d=Se(()=>{"use strict";b=class{constructor(t){this.value=t}deref(){return this.value}}});var oi=ce(tt=>{"use strict";m();c();p();f();d();var Jn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),oa=Jn(e=>{"use strict";e.byteLength=l,e.toByteArray=g,e.fromByteArray=R;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var F=C.indexOf("=");F===-1&&(F=A);var L=F===A?0:4-F%4;return[F,L]}function l(C){var A=a(C),F=A[0],L=A[1];return(F+L)*3/4-L}function u(C,A,F){return(A+F)*3/4-F}function g(C){var A,F=a(C),L=F[0],N=F[1],M=new n(u(C,L,N)),k=0,z=N>0?L-4:L,j;for(j=0;j>16&255,M[k++]=A>>8&255,M[k++]=A&255;return N===2&&(A=r[C.charCodeAt(j)]<<2|r[C.charCodeAt(j+1)]>>4,M[k++]=A&255),N===1&&(A=r[C.charCodeAt(j)]<<10|r[C.charCodeAt(j+1)]<<4|r[C.charCodeAt(j+2)]>>2,M[k++]=A>>8&255,M[k++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function v(C,A,F){for(var L,N=[],M=A;Mz?z:k+M));return L===1?(A=C[F-1],N.push(t[A>>2]+t[A<<4&63]+"==")):L===2&&(A=(C[F-2]<<8)+C[F-1],N.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),N.join("")}}),sa=Jn(e=>{e.read=function(t,r,n,i,o){var s,a,l=o*8-i-1,u=(1<>1,h=-7,v=n?o-1:0,R=n?-1:1,C=t[r+v];for(v+=R,s=C&(1<<-h)-1,C>>=-h,h+=l;h>0;s=s*256+t[r+v],v+=R,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+v],v+=R,h-=8);if(s===0)s=1-g;else{if(s===u)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,l,u,g=s*8-o-1,h=(1<>1,R=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,F=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+v>=1?r+=R/u:r+=R*Math.pow(2,1-v),r*u>=2&&(a++,u/=2),a+v>=h?(l=0,a=h):a+v>=1?(l=(r*u-1)*Math.pow(2,o),a=a+v):(l=r*Math.pow(2,v-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=l&255,C+=A,l/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=F*128}}),Br=oa(),Xe=sa(),Un=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;tt.Buffer=T;tt.SlowBuffer=fa;tt.INSPECT_MAX_BYTES=50;var Jt=2147483647;tt.kMaxLength=Jt;T.TYPED_ARRAY_SUPPORT=aa();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function aa(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function Re(e){if(e>Jt)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ur(e)}return Wn(e,t,r)}T.poolSize=8192;function Wn(e,t,r){if(typeof e=="string")return ua(e,t);if(ArrayBuffer.isView(e))return ca(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ye(e,ArrayBuffer)||e&&ye(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ye(e,SharedArrayBuffer)||e&&ye(e.buffer,SharedArrayBuffer)))return Hn(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=pa(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return Wn(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function Gn(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function la(e,t,r){return Gn(e),e<=0?Re(e):t!==void 0?typeof r=="string"?Re(e).fill(t,r):Re(e).fill(t):Re(e)}T.alloc=function(e,t,r){return la(e,t,r)};function Ur(e){return Gn(e),Re(e<0?0:qr(e)|0)}T.allocUnsafe=function(e){return Ur(e)};T.allocUnsafeSlow=function(e){return Ur(e)};function ua(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=Kn(e,t)|0,n=Re(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function $r(e){let t=e.length<0?0:qr(e.length)|0,r=Re(t);for(let n=0;n=Jt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Jt.toString(16)+" bytes");return e|0}function fa(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(ye(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),ye(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function Kn(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ye(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return jr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ii(e).length;default:if(i)return n?-1:jr(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=Kn;function da(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Pa(this,t,r);case"utf8":case"utf-8":return Yn(this,t,r);case"ascii":return xa(this,t,r);case"latin1":case"binary":return va(this,t,r);case"base64":return ba(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ta(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function qe(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Un&&(T.prototype[Un]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(ye(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Qr(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:qn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):qn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function qn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function l(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let u;if(i){let g=-1;for(u=r;us&&(r=s-a),u=r;u>=0;u--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return ma(this,e,t,r);case"utf8":case"utf-8":return ga(this,e,t,r);case"ascii":case"latin1":case"binary":return ha(this,e,t,r);case"base64":return ya(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wa(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ba(e,t,r){return t===0&&r===e.length?Br.fromByteArray(e):Br.fromByteArray(e.slice(t,r))}function Yn(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,u,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[i+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(s=h));break;case 3:l=e[i+1],u=e[i+2],(l&192)===128&&(u&192)===128&&(h=(o&15)<<12|(l&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=e[i+1],u=e[i+2],g=e[i+3],(l&192)===128&&(u&192)===128&&(g&192)===128&&(h=(o&15)<<18|(l&63)<<12|(u&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ea(n)}var Vn=4096;function Ea(e){let t=e.length;if(t<=Vn)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=_e(function(e){e=e>>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=_e(function(e){e=e>>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),Xe.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),Xe.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),Xe.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),Xe.read(this,e,!1,52,8)};function oe(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;oe(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;oe(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function Zn(e,t,r,n,i){ni(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function Xn(e,t,r,n,i){ni(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=_e(function(e,t=0){return Zn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=_e(function(e,t=0){return Xn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);oe(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);oe(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=_e(function(e,t=0){return Zn(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=_e(function(e,t=0){return Xn(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ei(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ti(e,t,r,n,i){return t=+t,r=r>>>0,i||ei(e,t,r,4,34028234663852886e22,-34028234663852886e22),Xe.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return ti(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return ti(this,e,t,!1,r)};function ri(e,t,r,n,i){return t=+t,r=r>>>0,i||ei(e,t,r,8,17976931348623157e292,-17976931348623157e292),Xe.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return ri(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return ri(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=Qn(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Qn(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Qn(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Ca(e,t,r){et(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&yt(t,e.length-(r+1))}function ni(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Ze.ERR_OUT_OF_RANGE("value",a,e)}Ca(n,i,o)}function et(e,t){if(typeof e!="number")throw new Ze.ERR_INVALID_ARG_TYPE(t,"number",e)}function yt(e,t,r){throw Math.floor(e)!==e?(et(e,r),new Ze.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Ze.ERR_BUFFER_OUT_OF_BOUNDS:new Ze.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Aa=/[^+/0-9A-Za-z-_]/g;function Sa(e){if(e=e.split("=")[0],e=e.trim().replace(Aa,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function jr(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Ra(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function ii(e){return Br.toByteArray(Sa(e))}function Wt(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ye(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Qr(e){return e!==e}var Oa=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function _e(e){return typeof BigInt>"u"?Fa:e}function Fa(){throw new Error("BigInt not supported")}});var w,m=Se(()=>{"use strict";w=fe(oi())});function Ma(){return!1}var _a,La,Gt,Gr=Se(()=>{"use strict";m();c();p();f();d();_a={},La={existsSync:Ma,promises:_a},Gt=La});var gi=ce((gf,mi)=>{"use strict";m();c();p();f();d();mi.exports=(zr(),Dr(Kr)).format});var Kr={};Ye(Kr,{default:()=>Xa,deprecate:()=>yi,format:()=>bi,inspect:()=>wi,promisify:()=>hi});function hi(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function yi(e,t){return(...r)=>(console.warn(t),e(...r))}function wi(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var bi,Za,Xa,zr=Se(()=>{"use strict";m();c();p();f();d();bi=gi(),Za={promisify:hi,deprecate:yi,inspect:wi,format:bi},Xa=Za});function il(...e){return e.join("/")}function ol(...e){return e.join("/")}var Ti,sl,al,we,en=Se(()=>{"use strict";m();c();p();f();d();Ti="/",sl={sep:Ti},al={resolve:il,posix:sl,join:ol,sep:Ti},we=al});var Ci=ce(()=>{"use strict";m();c();p();f();d()});var Ri=ce((fd,Si)=>{"use strict";m();c();p();f();d();Si.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Oi=ce((wd,ki)=>{"use strict";m();c();p();f();d();var ul=Ri();ki.exports=e=>{let t=ul(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var Kt,Fi=Se(()=>{"use strict";m();c();p();f();d();Kt=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var _i=ce((Yd,Mi)=>{"use strict";m();c();p();f();d();Mi.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 Ni=ce((um,Ii)=>{"use strict";m();c();p();f();d();Ii.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 nn=ce((gm,Di)=>{"use strict";m();c();p();f();d();var ml=Ni();Di.exports=e=>typeof e=="string"?e.replace(ml(),""):e});var Bi=ce((_m,Yt)=>{"use strict";m();c();p();f();d();Yt.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()};Yt.exports.default=Yt.exports});var qi=ce((ky,wl)=>{wl.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Vi=ce(()=>{"use strict";m();c();p();f();d()});var Fn=ce((cA,ls)=>{"use strict";m();c();p();f();d();ls.exports=function(){function e(t,r,n,i,o){return tn?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;sZr,Decimal:()=>ve,Extensions:()=>Jr,MetricsClient:()=>nt,NotFoundError:()=>Oe,PrismaClientInitializationError:()=>V,PrismaClientKnownRequestError:()=>G,PrismaClientRustPanicError:()=>ue,PrismaClientUnknownRequestError:()=>H,PrismaClientValidationError:()=>Y,Public:()=>Wr,Sql:()=>se,defineDmmfProperty:()=>Ui,empty:()=>Ji,getPrismaClient:()=>Ys,getRuntime:()=>Zo,join:()=>Qi,makeStrictEnum:()=>Zs,objectEnumValues:()=>Xt,raw:()=>dn,sqltag:()=>mn,warnEnvConflicts:()=>void 0,warnOnce:()=>St});module.exports=Dr(fp);m();c();p();f();d();var Jr={};Ye(Jr,{defineExtension:()=>si,getExtensionContext:()=>ai});m();c();p();f();d();m();c();p();f();d();function si(e){return typeof e=="function"?e:t=>t.$extends(e)}m();c();p();f();d();function ai(e){return e}var Wr={};Ye(Wr,{validator:()=>li});m();c();p();f();d();m();c();p();f();d();function li(...e){return t=>t}m();c();p();f();d();m();c();p();f();d();var Ht={};Ye(Ht,{$:()=>di,bgBlack:()=>Qa,bgBlue:()=>Ha,bgCyan:()=>za,bgGreen:()=>Wa,bgMagenta:()=>Ka,bgRed:()=>Ja,bgWhite:()=>Ya,bgYellow:()=>Ga,black:()=>ja,blue:()=>Je,bold:()=>de,cyan:()=>ke,dim:()=>wt,gray:()=>xt,green:()=>Et,grey:()=>Va,hidden:()=>Ba,inverse:()=>Da,italic:()=>Na,magenta:()=>Ua,red:()=>Ve,reset:()=>Ia,strikethrough:()=>$a,underline:()=>bt,white:()=>qa,yellow:()=>Qe});m();c();p();f();d();var Hr,ui,ci,pi,fi=!0;typeof y<"u"&&({FORCE_COLOR:Hr,NODE_DISABLE_COLORS:ui,NO_COLOR:ci,TERM:pi}=y.env||{},fi=y.stdout&&y.stdout.isTTY);var di={enabled:!ui&&ci==null&&pi!=="dumb"&&(Hr!=null&&Hr!=="0"||fi)};function U(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!di.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Ia=U(0,0),de=U(1,22),wt=U(2,22),Na=U(3,23),bt=U(4,24),Da=U(7,27),Ba=U(8,28),$a=U(9,29),ja=U(30,39),Ve=U(31,39),Et=U(32,39),Qe=U(33,39),Je=U(34,39),Ua=U(35,39),ke=U(36,39),qa=U(37,39),xt=U(90,39),Va=U(90,39),Qa=U(40,49),Ja=U(41,49),Wa=U(42,49),Ga=U(43,49),Ha=U(44,49),Ka=U(45,49),za=U(46,49),Ya=U(47,49);m();c();p();f();d();var el=100,Ei=["green","yellow","blue","magenta","cyan","red"],vt=[],xi=Date.now(),tl=0,Yr=typeof y<"u"?y.env:{};globalThis.DEBUG??=Yr.DEBUG??"";globalThis.DEBUG_COLORS??=Yr.DEBUG_COLORS?Yr.DEBUG_COLORS==="true":!0;var Pt={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,i;typeof require=="function"&&typeof y<"u"&&typeof y.stderr<"u"&&typeof y.stderr.write=="function"?i=(...o)=>{try{let s=(zr(),Dr(Kr));y.stderr.write(s.format(...o)+` -`)}catch{i=console.warn??console.log}}:i=console.warn??console.log,i(`${t} ${r}`,...n)},formatters:{}};function rl(e){let t={color:Ei[tl++%Ei.length],enabled:Pt.enabled(e),namespace:e,log:Pt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&vt.push([o,...n]),vt.length>el&&vt.shift(),Pt.enabled(o)||i){let l=n.map(g=>typeof g=="string"?g:nl(g)),u=`+${Date.now()-xi}ms`;xi=Date.now(),globalThis.DEBUG_COLORS?a(Ht[s](de(o)),...l,Ht[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Zr=new Proxy(rl,{get:(e,t)=>Pt[t],set:(e,t,r)=>Pt[t]=r});function nl(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function vi(e=7500){let t=vt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(` -`);return t.length{let e;(k=>(k.findUnique="findUnique",k.findUniqueOrThrow="findUniqueOrThrow",k.findFirst="findFirst",k.findFirstOrThrow="findFirstOrThrow",k.findMany="findMany",k.create="create",k.createMany="createMany",k.createManyAndReturn="createManyAndReturn",k.update="update",k.updateMany="updateMany",k.upsert="upsert",k.delete="delete",k.deleteMany="deleteMany",k.groupBy="groupBy",k.count="count",k.aggregate="aggregate",k.findRaw="findRaw",k.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Le||={});m();c();p();f();d();en();function tn(e){return we.sep===we.posix.sep?e:e.split(we.sep).join(we.posix.sep)}var At={};Ye(At,{error:()=>fl,info:()=>pl,log:()=>cl,query:()=>dl,should:()=>Li,tags:()=>Ct,warn:()=>rn});m();c();p();f();d();var Ct={error:Ve("prisma:error"),warn:Qe("prisma:warn"),info:ke("prisma:info"),query:Je("prisma:query")},Li={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function cl(...e){console.log(...e)}function rn(e,...t){Li.warn()&&console.warn(`${Ct.warn} ${e}`,...t)}function pl(e,...t){console.info(`${Ct.info} ${e}`,...t)}function fl(e,...t){console.error(`${Ct.error} ${e}`,...t)}function dl(e,...t){console.log(`${Ct.query} ${e}`,...t)}m();c();p();f();d();function zt(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}m();c();p();f();d();function We(e,t){throw new Error(t)}m();c();p();f();d();function on(e,t){return Object.prototype.hasOwnProperty.call(e,t)}m();c();p();f();d();var sn=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});m();c();p();f();d();function rt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}m();c();p();f();d();function an(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{$i.has(e)||($i.add(e),rn(t,...r))};m();c();p();f();d();var G=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};re(G,"PrismaClientKnownRequestError");var Oe=class extends G{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};re(Oe,"NotFoundError");m();c();p();f();d();var V=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};re(V,"PrismaClientInitializationError");m();c();p();f();d();var ue=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};re(ue,"PrismaClientRustPanicError");m();c();p();f();d();var H=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};re(H,"PrismaClientUnknownRequestError");m();c();p();f();d();var Y=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};re(Y,"PrismaClientValidationError");m();c();p();f();d();var nt=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};m();c();p();f();d();m();c();p();f();d();function Rt(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Ui(e,t){let r=Rt(()=>gl(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function gl(e){return{datamodel:{models:ln(e.models),enums:ln(e.enums),types:ln(e.types)}}}function ln(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}m();c();p();f();d();var Zt=Symbol(),un=new WeakMap,Fe=class{constructor(t){t===Zt?un.set(this,`Prisma.${this._getName()}`):un.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return un.get(this)}},kt=class extends Fe{_getNamespace(){return"NullTypes"}},Ot=class extends kt{};cn(Ot,"DbNull");var Ft=class extends kt{};cn(Ft,"JsonNull");var Mt=class extends kt{};cn(Mt,"AnyNull");var Xt={classes:{DbNull:Ot,JsonNull:Ft,AnyNull:Mt},instances:{DbNull:new Ot(Zt),JsonNull:new Ft(Zt),AnyNull:new Mt(Zt)}};function cn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();function _t(e){return{ok:!1,error:e,map(){return _t(e)},flatMap(){return _t(e)}}}var pn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},fn=e=>{let t=new pn,r=Ge(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Ge(t,e.queryRaw.bind(e)),executeRaw:Ge(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>hl(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=yl(t,e.getConnectionInfo.bind(e))),n},hl=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Ge(e,t.queryRaw.bind(t)),executeRaw:Ge(e,t.executeRaw.bind(t)),commit:Ge(e,t.commit.bind(t)),rollback:Ge(e,t.rollback.bind(t))});function Ge(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}function yl(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}var zs=fe(qi());var wk=fe(Vi());Fi();Gr();en();m();c();p();f();d();var se=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}m();c();p();f();d();m();c();p();f();d();var er={enumerable:!0,configurable:!0,writable:!0};function tr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>er,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Wi=Symbol.for("nodejs.util.inspect.custom");function Ee(e,t){let r=bl(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Gi(Reflect.ownKeys(o),r),a=Gi(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...er,...l?.getPropertyDescriptor(s)}:er:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[Wi]=function(){let o={...this};return delete o[Wi],o},i}function bl(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Gi(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}m();c();p();f();d();function it(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}m();c();p();f();d();function rr(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}m();c();p();f();d();m();c();p();f();d();var ot=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};m();c();p();f();d();m();c();p();f();d();function Hi(e){return e.substring(0,1).toLowerCase()+e.substring(1)}m();c();p();f();d();function st(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function nr(e){return e.toString()!=="Invalid Date"}m();c();p();f();d();m();c();p();f();d();var at=9e15,Be=1e9,gn="0123456789abcdef",or="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",sr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",hn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-at,maxE:at,crypto:!1},Zi,Me,I=!0,lr="[DecimalError] ",De=lr+"Invalid argument: ",Xi=lr+"Precision limit exceeded",eo=lr+"crypto unavailable",to="[object Decimal]",te=Math.floor,J=Math.pow,El=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,xl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,vl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ro=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,_=7,Pl=9007199254740991,Tl=or.length-1,yn=sr.length-1,S={toStringTag:to};S.absoluteValue=S.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),O(e)};S.ceil=function(){return O(new this.constructor(this),this.e+1,2)};S.clampedTo=S.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(De+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};S.comparedTo=S.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};S.cosine=S.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+_,n.rounding=1,r=Cl(n,ao(n,r)),n.precision=e,n.rounding=t,O(Me==2||Me==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};S.cubeRoot=S.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(I=!1,o=g.s*J(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Z(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=J(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(g),n=$(u.plus(g).times(a),u.plus(l),s+2,1),Z(a.d).slice(0,s)===(r=Z(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(O(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(O(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return I=!0,O(n,e,h.rounding,t)};S.decimalPlaces=S.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/_))*_,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};S.dividedBy=S.div=function(e){return $(this,new this.constructor(e))};S.dividedToIntegerBy=S.divToInt=function(e){var t=this,r=t.constructor;return O($(t,new r(e),0,1,1),r.precision,r.rounding)};S.equals=S.eq=function(e){return this.cmp(e)===0};S.floor=function(){return O(new this.constructor(this),this.e+1,3)};S.greaterThan=S.gt=function(e){return this.cmp(e)>0};S.greaterThanOrEqualTo=S.gte=function(e){var t=this.cmp(e);return t==1||t===0};S.hyperbolicCosine=S.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/cr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=lt(s,1,o.times(t),new s(1),!0);for(var l,u=e,g=new s(8);u--;)l=o.times(o),o=a.minus(l.times(g.minus(l.times(g))));return O(o,s.precision=r,s.rounding=n,!0)};S.hyperbolicSine=S.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=lt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/cr(5,e)),i=lt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,O(i,t,r,!0)};S.hyperbolicTangent=S.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,$(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};S.inverseCosine=S.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?me(r,i,o):new r(0):new r(NaN):t.isZero()?me(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=me(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};S.inverseHyperbolicCosine=S.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,I=!1,r=r.times(r).minus(1).sqrt().plus(r),I=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};S.inverseHyperbolicSine=S.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,I=!1,r=r.times(r).plus(1).sqrt().plus(r),I=!0,n.precision=e,n.rounding=t,r.ln())};S.inverseHyperbolicTangent=S.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?O(new o(i),e,t,!0):(o.precision=r=n-i.e,i=$(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};S.inverseSine=S.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=me(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};S.inverseTangent=S.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding;if(u.isFinite()){if(u.isZero())return new g(u);if(u.abs().eq(1)&&h+4<=yn)return s=me(g,h+4,v).times(.25),s.s=u.s,s}else{if(!u.s)return new g(NaN);if(h+4<=yn)return s=me(g,h+4,v).times(.5),s.s=u.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/_+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(I=!1,t=Math.ceil(a/_),n=1,l=u.times(u),s=new g(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};S.isNaN=function(){return!this.s};S.isNegative=S.isNeg=function(){return this.s<0};S.isPositive=S.isPos=function(){return this.s>0};S.isZero=function(){return!!this.d&&this.d[0]===0};S.lessThan=S.lt=function(e){return this.cmp(e)<0};S.lessThanOrEqualTo=S.lte=function(e){return this.cmp(e)<1};S.logarithm=S.log=function(e){var t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding,R=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new g(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(I=!1,a=h+R,s=Ne(u,a),n=t?ar(g,a+10):Ne(e,a),l=$(s,n,a,1),It(l.d,i=h,v))do if(a+=10,s=Ne(u,a),n=t?ar(g,a+10):Ne(e,a),l=$(s,n,a,1),!o){+Z(l.d).slice(i+1,i+15)+1==1e14&&(l=O(l,h+1,0));break}while(It(l.d,i+=10,v));return I=!0,O(l,h,v)};S.minus=S.sub=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,R=this,C=R.constructor;if(e=new C(e),!R.d||!e.d)return!R.s||!e.s?e=new C(NaN):R.d?e.s=-e.s:e=new C(e.d||R.s!==e.s?R:NaN),e;if(R.s!=e.s)return e.s=-e.s,R.plus(e);if(u=R.d,v=e.d,a=C.precision,l=C.rounding,!u[0]||!v[0]){if(v[0])e.s=-e.s;else if(u[0])e=new C(R);else return new C(l===3?-0:0);return I?O(e,a,l):e}if(r=te(e.e/_),g=te(R.e/_),u=u.slice(),o=g-r,o){for(h=o<0,h?(t=u,o=-o,s=v.length):(t=v,r=g,s=u.length),n=Math.max(Math.ceil(a/_),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=v.length,h=n0;--n)u[s++]=0;for(n=v.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=g.length,s-i<0&&(i=s,r=g,g=u,u=r),t=0;i;)t=(u[--i]=u[i]+g[i]+t)/ge|0,u[i]%=ge;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=ur(u,n),I?O(e,a,l):e};S.precision=S.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(De+e);return r.d?(t=no(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};S.round=function(){var e=this,t=e.constructor;return O(new t(e),e.e+1,t.rounding)};S.sine=S.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+_,n.rounding=1,r=Sl(n,ao(n,r)),n.precision=e,n.rounding=t,O(Me>2?r.neg():r,e,t,!0)):new n(NaN)};S.squareRoot=S.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,g=s.constructor;if(u!==1||!a||!a[0])return new g(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(I=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=Z(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=te((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new g(t)):n=new g(u.toString()),r=(l=g.precision)+3;;)if(o=n,n=o.plus($(s,o,r+2,1)).times(.5),Z(o.d).slice(0,r)===(t=Z(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(O(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(O(n,l+1,1),e=!n.times(n).eq(s));break}return I=!0,O(n,l,g.rounding,e)};S.tangent=S.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=$(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,O(Me==2||Me==4?r.neg():r,e,t,!0)):new n(NaN)};S.times=S.mul=function(e){var t,r,n,i,o,s,a,l,u,g=this,h=g.constructor,v=g.d,R=(e=new h(e)).d;if(e.s*=g.s,!v||!v[0]||!R||!R[0])return new h(!e.s||v&&!v[0]&&!R||R&&!R[0]&&!v?NaN:!v||!R?e.s/0:e.s*0);for(r=te(g.e/_)+te(e.e/_),l=v.length,u=R.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+R[n]*v[i-n-1]+t,o[i--]=a%ge|0,t=a/ge|0;o[i]=(o[i]+t)%ge|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=ur(o,r),I?O(e,h.precision,h.rounding):e};S.toBinary=function(e,t){return En(this,2,e,t)};S.toDecimalPlaces=S.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ae(e,0,Be),t===void 0?t=n.rounding:ae(t,0,8),O(r,e+r.e+1,t))};S.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,!0):(ae(e,0,Be),t===void 0?t=i.rounding:ae(t,0,8),n=O(new i(n),e+1,t),r=xe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};S.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=xe(i):(ae(e,0,Be),t===void 0?t=o.rounding:ae(t,0,8),n=O(new o(i),e+i.e+1,t),r=xe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};S.toFraction=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,R=this,C=R.d,A=R.constructor;if(!C)return new A(R);if(u=r=new A(1),n=l=new A(0),t=new A(n),o=t.e=no(C)-R.e-1,s=o%_,t.d[0]=J(10,s<0?_+s:s),e==null)e=o>0?t:u;else{if(a=new A(e),!a.isInt()||a.lt(u))throw Error(De+a);e=a.gt(t)?o>0?t:u:a}for(I=!1,a=new A(Z(C)),g=A.precision,A.precision=o=C.length*_*2;h=$(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=$(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=R.s,v=$(u,n,o,1).minus(R).abs().cmp($(l,r,o,1).minus(R).abs())<1?[u,n]:[l,r],A.precision=g,I=!0,v};S.toHexadecimal=S.toHex=function(e,t){return En(this,16,e,t)};S.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ae(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(I=!1,r=$(r,e,0,t,1).times(e),I=!0,O(r)):(e.s=r.s,r=e),r};S.toNumber=function(){return+this};S.toOctal=function(e,t){return En(this,8,e,t)};S.toPower=S.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(J(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return O(a,n,o);if(t=te(e.e/_),t>=e.d.length-1&&(r=u<0?-u:u)<=Pl)return i=io(l,a,r,n),e.s<0?new l(1).div(i):O(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(I=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=wn(e.times(Ne(a,n+r)),n),i.d&&(i=O(i,n+5,1),It(i.d,n,o)&&(t=n+10,i=O(wn(e.times(Ne(a,t+r)),t),t+5,1),+Z(i.d).slice(n+1,n+15)+1==1e14&&(i=O(i,n+1,0)))),i.s=s,I=!0,l.rounding=o,O(i,n,o))};S.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ae(e,1,Be),t===void 0?t=i.rounding:ae(t,0,8),n=O(new i(n),e,t),r=xe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};S.toSignificantDigits=S.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ae(e,1,Be),t===void 0?t=n.rounding:ae(t,0,8)),O(new n(r),e,t)};S.toString=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};S.truncated=S.trunc=function(){return O(new this.constructor(this),this.e+1,1)};S.valueOf=S.toJSON=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Z(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(De+e)}function It(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=_,i=0):(i=Math.ceil((t+1)/_),t%=_),o=J(10,_-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==J(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==J(10,t-3)-1,s}function ir(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Cl(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/cr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=lt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var $=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,g,h,v,R,C,A,F,L,N,M,k,z,j,ht,Q,ie,Ae,X,ze,Vt=n.constructor,Nr=n.s==i.s?1:-1,ee=n.d,B=i.d;if(!ee||!ee[0]||!B||!B[0])return new Vt(!n.s||!i.s||(ee?B&&ee[0]==B[0]:!B)?NaN:ee&&ee[0]==0||!B?Nr*0:Nr/0);for(l?(R=1,g=n.e-i.e):(l=ge,R=_,g=te(n.e/R)-te(i.e/R)),X=B.length,ie=ee.length,L=new Vt(Nr),N=L.d=[],h=0;B[h]==(ee[h]||0);h++);if(B[h]>(ee[h]||0)&&g--,o==null?(j=o=Vt.precision,s=Vt.rounding):a?j=o+(n.e-i.e)+1:j=o,j<0)N.push(1),C=!0;else{if(j=j/R+2|0,h=0,X==1){for(v=0,B=B[0],j++;(h1&&(B=e(B,v,l),ee=e(ee,v,l),X=B.length,ie=ee.length),Q=X,M=ee.slice(0,X),k=M.length;k=l/2&&++Ae;do v=0,u=t(B,M,X,k),u<0?(z=M[0],X!=k&&(z=z*l+(M[1]||0)),v=z/Ae|0,v>1?(v>=l&&(v=l-1),A=e(B,v,l),F=A.length,k=M.length,u=t(A,M,F,k),u==1&&(v--,r(A,X=10;v/=10)h++;L.e=h+g*R-1,O(L,a?o+L.e+1:o,s,C)}return L}}();function O(e,t,r,n){var i,o,s,a,l,u,g,h,v,R=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=_,s=t,g=h[v=0],l=g/J(10,i-s-1)%10|0;else if(v=Math.ceil((o+1)/_),a=h.length,v>=a)if(n){for(;a++<=v;)h.push(0);g=l=0,i=1,o%=_,s=o-_+1}else break e;else{for(g=a=h[v],i=1;a>=10;a/=10)i++;o%=_,s=o-_+i,l=s<0?0:g/J(10,i-s-1)%10|0}if(n=n||t<0||h[v+1]!==void 0||(s<0?g:g%J(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?g/J(10,i-s):0:h[v-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=J(10,(_-t%_)%_),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=v,a=1,v--):(h.length=v+1,a=J(10,_-o),h[v]=s>0?(g/J(10,i-s)%J(10,s)|0)*a:0),u)for(;;)if(v==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==ge&&(h[0]=1));break}else{if(h[v]+=a,h[v]!=ge)break;h[v--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return I&&(e.e>R.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Ie(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Ie(-i-1)+o,r&&(n=r-s)>0&&(o+=Ie(n))):i>=s?(o+=Ie(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Ie(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Ie(n))),o}function ur(e,t){var r=e[0];for(t*=_;r>=10;r/=10)t++;return t}function ar(e,t,r){if(t>Tl)throw I=!0,r&&(e.precision=r),Error(Xi);return O(new e(or),t,1,!0)}function me(e,t,r){if(t>yn)throw Error(Xi);return O(new e(sr),t,r,!0)}function no(e){var t=e.length-1,r=t*_+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Ie(e){for(var t="";e--;)t+="0";return t}function io(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/_+4);for(I=!1;;){if(r%2&&(o=o.times(t),zi(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),zi(t.d,s)}return I=!0,o}function Ki(e){return e.d[e.d.length-1]&1}function oo(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new v(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(I=!1,l=C):l=t,a=new v(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(J(2,h))/Math.LN10*2+5|0,l+=n,r=o=s=new v(1),v.precision=l;;){if(o=O(o.times(e),l,1),r=r.times(++g),a=s.plus($(o,r,l,1)),Z(a.d).slice(0,l)===Z(s.d).slice(0,l)){for(i=h;i--;)s=O(s.times(s),l,1);if(t==null)if(u<3&&It(s.d,l-n,R,u))v.precision=l+=10,r=o=a=new v(1),g=0,u++;else return O(s,v.precision=C,R,I=!0);else return v.precision=C,s}s=a}}function Ne(e,t){var r,n,i,o,s,a,l,u,g,h,v,R=1,C=10,A=e,F=A.d,L=A.constructor,N=L.rounding,M=L.precision;if(A.s<0||!F||!F[0]||!A.e&&F[0]==1&&F.length==1)return new L(F&&!F[0]?-1/0:A.s!=1?NaN:F?0:A);if(t==null?(I=!1,g=M):g=t,L.precision=g+=C,r=Z(F),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Z(A.d),n=r.charAt(0),R++;o=A.e,n>1?(A=new L("0."+r),o++):A=new L(n+"."+r.slice(1))}else return u=ar(L,g+2,M).times(o+""),A=Ne(new L(n+"."+r.slice(1)),g-C).plus(u),L.precision=M,t==null?O(A,M,N,I=!0):A;for(h=A,l=s=A=$(A.minus(1),A.plus(1),g,1),v=O(A.times(A),g,1),i=3;;){if(s=O(s.times(v),g,1),u=l.plus($(s,new L(i),g,1)),Z(u.d).slice(0,g)===Z(l.d).slice(0,g))if(l=l.times(2),o!==0&&(l=l.plus(ar(L,g+2,M).times(o+""))),l=$(l,new L(R),g,1),t==null)if(It(l.d,g-C,N,a))L.precision=g+=C,u=s=A=$(h.minus(1),h.plus(1),g,1),v=O(A.times(A),g,1),i=a=1;else return O(l,L.precision=M,N,I=!0);else return L.precision=M,l;l=u,i+=2}}function so(e){return String(e.s*e.s/0)}function bn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%_,r<0&&(n+=_),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ro.test(t))return bn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(xl.test(t))r=16,t=t.toLowerCase();else if(El.test(t))r=2;else if(vl.test(t))r=8;else throw Error(De+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=io(n,new n(r),o,o*2)),u=ir(t,r,ge),g=u.length-1,o=g;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=ur(u,g),e.d=u,I=!1,s&&(e=$(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?J(2,l):Ke.pow(2,l))),I=!0,e)}function Sl(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:lt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/cr(5,r)),t=lt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function lt(e,t,r,n,i){var o,s,a,l,u=1,g=e.precision,h=Math.ceil(g/_);for(I=!1,l=r.times(r),a=new e(n);;){if(s=$(a.times(l),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=$(s.times(l),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return I=!0,s.d.length=h+1,s}function cr(e,t){for(var r=e;--t;)r*=e;return r}function ao(e,t){var r,n=t.s<0,i=me(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Me=n?4:1,t;if(r=t.divToInt(i),r.isZero())Me=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Me=Ki(r)?n?2:3:n?4:1,t;Me=Ki(r)?n?1:4:n?3:2}return t.minus(i).abs()}function En(e,t,r,n){var i,o,s,a,l,u,g,h,v,R=e.constructor,C=r!==void 0;if(C?(ae(r,1,Be),n===void 0?n=R.rounding:ae(n,0,8)):(r=R.precision,n=R.rounding),!e.isFinite())g=so(e);else{for(g=xe(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),v=new R(1),v.e=g.length-s,v.d=ir(xe(v),10,i),v.e=v.d.length),h=ir(g,10,i),o=l=h.length;h[--l]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new R(e),e.d=h,e.e=o,e=$(e,v,r,n,0,i),h=e.d,o=e.e,u=Zi),s=h[r],a=i/2,u=u||h[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,u)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)g+="0";for(h=ir(g,i,t),l=h.length;!h[l-1];--l);for(s=1,g="1.";sl)for(o-=l;o--;)g+="0";else ot)return e.length=t,!0}function Rl(e){return new this(e).abs()}function kl(e){return new this(e).acos()}function Ol(e){return new this(e).acosh()}function Fl(e,t){return new this(e).plus(t)}function Ml(e){return new this(e).asin()}function _l(e){return new this(e).asinh()}function Ll(e){return new this(e).atan()}function Il(e){return new this(e).atanh()}function Nl(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=me(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?me(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=me(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan($(e,t,o,1)),t=me(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan($(e,t,o,1)),r}function Dl(e){return new this(e).cbrt()}function Bl(e){return O(e=new this(e),e.e+1,2)}function $l(e,t,r){return new this(e).clamp(t,r)}function jl(e){if(!e||typeof e!="object")throw Error(lr+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Be,"rounding",0,8,"toExpNeg",-at,0,"toExpPos",0,at,"maxE",0,at,"minE",-at,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(De+r+": "+n);if(r="crypto",i&&(this[r]=hn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(eo);else this[r]=!1;else throw Error(De+r+": "+n);return this}function Ul(e){return new this(e).cos()}function ql(e){return new this(e).cosh()}function lo(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,Yi(o)){u.s=o.s,I?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;I?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(eo);else for(;o=10;i/=10)n++;n<_&&(r-=_-n)}return s.e=r,s.d=a,s}function nu(e){return O(e=new this(e),e.e+1,this.rounding)}function iu(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function ou(e){return new this(e).sin()}function su(e){return new this(e).sinh()}function au(e){return new this(e).sqrt()}function lu(e,t){return new this(e).sub(t)}function uu(){var e=0,t=arguments,r=new this(t[e]);for(I=!1;r.s&&++e`}};function ct(e){return e instanceof Nt}m();c();p();f();d();m();c();p();f();d();var pr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};m();c();p();f();d();var fr=e=>e,dr={bold:fr,red:fr,green:fr,dim:fr,enabled:!1},uo={bold:de,red:Ve,green:Et,dim:wt,enabled:!0},pt={write(e){e.writeLine(",")}};m();c();p();f();d();var Pe=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};m();c();p();f();d();var $e=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var ft=class extends $e{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new pr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new Pe("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(pt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};m();c();p();f();d();var co=": ",mr=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+co.length}write(t){let r=new Pe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(co).write(this.value)}};m();c();p();f();d();var gr=class e extends $e{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof ft&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new Pe("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(pt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};m();c();p();f();d();var K=class extends $e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Pe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var xn=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function hr(e){return new xn(po(e))}function po(e){let t=new gr;for(let[r,n]of Object.entries(e)){let i=new mr(r,fo(n));t.addField(i)}return t}function fo(e){if(typeof e=="string")return new K(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new K(String(e));if(typeof e=="bigint")return new K(`${e}n`);if(e===null)return new K("null");if(e===void 0)return new K("undefined");if(ut(e))return new K(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new K(`Buffer.alloc(${e.byteLength})`):new K(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=nr(e)?e.toISOString():"Invalid Date";return new K(`new Date("${t}")`)}return e instanceof Fe?new K(`Prisma.${e._getName()}`):ct(e)?new K(`prisma.${Hi(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?mu(e):typeof e=="object"?po(e):new K(Object.prototype.toString.call(e))}function mu(e){let t=new ft;for(let r of e)t.addItem(fo(r));return t}function mo(e){if(e===void 0)return"";let t=hr(e);return new ot(0,{colors:dr}).write(t).toString()}m();c();p();f();d();var gu="P2037";function yr({error:e,user_facing_error:t},r,n){return t.error_code?new G(hu(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new H(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function hu(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===gu&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var Dt="";function go(e){var t=e.split(` -`);return t.reduce(function(r,n){var i=bu(n)||xu(n)||Tu(n)||Ru(n)||Au(n);return i&&r.push(i),r},[])}var yu=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,wu=/\((\S*)(?::(\d+))(?::(\d+))\)/;function bu(e){var t=yu.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=wu.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||Dt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Eu=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function xu(e){var t=Eu.exec(e);return t?{file:t[2],methodName:t[1]||Dt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var vu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Pu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Tu(e){var t=vu.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Pu.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||Dt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Cu=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Au(e){var t=Cu.exec(e);return t?{file:t[3],methodName:t[1]||Dt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Su=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Ru(e){var t=Su.exec(e);return t?{file:t[2],methodName:t[1]||Dt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var vn=class{getLocation(){return null}},Pn=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=go(t).find(i=>{if(!i.file)return!1;let o=tn(i.file);return o!==""&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function je(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new vn:new Pn}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var ho={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function dt(e={}){let t=Ou(e);return Object.entries(t).reduce((n,[i,o])=>(ho[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Ou(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function wr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function yo(e,t){let r=wr(e);return t({action:"aggregate",unpacker:r,argsMapper:dt})(e)}m();c();p();f();d();function Fu(e={}){let{select:t,...r}=e;return typeof t=="object"?dt({...r,_count:t}):dt({...r,_count:{_all:!0}})}function Mu(e={}){return typeof e.select=="object"?t=>wr(e)(t)._count:t=>wr(e)(t)._count._all}function wo(e,t){return t({action:"count",unpacker:Mu(e),argsMapper:Fu})(e)}m();c();p();f();d();function _u(e={}){let t=dt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function Lu(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function bo(e,t){return t({action:"groupBy",unpacker:Lu(e),argsMapper:_u})(e)}function Eo(e,t,r){if(t==="aggregate")return n=>yo(n,r);if(t==="count")return n=>wo(n,r);if(t==="groupBy")return n=>bo(n,r)}m();c();p();f();d();function xo(e,t){let r=t.fields.filter(i=>!i.relationName),n=sn(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Nt(e,o,s.type,s.isList,s.kind==="enum")},...tr(Object.keys(n))})}m();c();p();f();d();m();c();p();f();d();var vo=e=>Array.isArray(e)?e:e.split("."),Tn=(e,t)=>vo(t).reduce((r,n)=>r&&r[n],e),Po=(e,t,r)=>vo(t).reduceRight((n,i,o,s)=>Object.assign({},Tn(e,s.slice(0,o)),{[i]:n}),r);function Iu(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Nu(e,t,r){return t===void 0?e??{}:Po(t,r,e||!0)}function Cn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=je(e._errorFormat),g=Iu(n,i),h=Nu(l,o,g),v=r({dataPath:g,callsite:u})(h),R=Du(e,t);return new Proxy(v,{get(C,A){if(!R.includes(A))return C[A];let L=[a[A].type,r,A],N=[g,h];return Cn(e,...L,...N)},...tr([...R,...Object.getOwnPropertyNames(v)])})}}function Du(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}m();c();p();f();d();m();c();p();f();d();var Ro=fe(_i());m();c();p();f();d();Gr();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var To={keyword:ke,entity:ke,value:e=>de(Je(e)),punctuation:Je,directive:ke,function:ke,variable:e=>de(Je(e)),string:e=>de(Et(e)),boolean:Qe,number:ke,comment:xt};var Bu=e=>e,br={},$u=0,D={manual:br.Prism&&br.Prism.manual,disableWorkerMessageHandler:br.Prism&&br.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof he){let t=e;return new he(t.type,D.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(D.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Ae instanceof he)continue;if(z&&Q!=t.length-1){N.lastIndex=ie;var h=N.exec(e);if(!h)break;var g=h.index+(k?h[1].length:0),v=h.index+h[0].length,a=Q,l=ie;for(let B=t.length;a=l&&(++Q,ie=l);if(t[Q]instanceof he)continue;u=a-Q,Ae=e.slice(ie,l),h.index-=ie}else{N.lastIndex=0;var h=N.exec(Ae),u=1}if(!h){if(o)break;continue}k&&(j=h[1]?h[1].length:0);var g=h.index+j,h=h[0].slice(j),v=g+h.length,R=Ae.slice(0,g),C=Ae.slice(v);let X=[Q,u];R&&(++Q,ie+=R.length,X.push(R));let ze=new he(A,M?D.tokenize(h,M):h,ht,h,z);if(X.push(ze),C&&X.push(C),Array.prototype.splice.apply(t,X),u!=1&&D.matchGrammar(e,t,r,Q,ie,!0,A),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return D.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=D.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=D.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:he};D.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};D.languages.javascript=D.languages.extend("clike",{"class-name":[D.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});D.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;D.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:D.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:D.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:D.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:D.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});D.languages.markup&&D.languages.markup.tag.addInlined("script","javascript");D.languages.js=D.languages.javascript;D.languages.typescript=D.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});D.languages.ts=D.languages.typescript;function he(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}he.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return he.stringify(r,t)}).join(""):ju(e.type)(e.content)};function ju(e){return To[e]||Bu}function Co(e){return Uu(e,D.languages.javascript)}function Uu(e,t){return D.tokenize(e,t).map(n=>he.stringify(n)).join("")}m();c();p();f();d();var Ao=fe(Oi());function So(e){return(0,Ao.default)(e)}var Er=class e{static read(t){let r;try{r=Gt.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(tthis.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(` -`);return new e(t,So(n).split(` -`))}highlight(){let t=Co(this.toString());return new e(this.firstLineNumber,t.split(` -`))}toString(){return this.lines.join(` -`)}};var qu={red:Ve,gray:xt,dim:wt,bold:de,underline:bt,highlightSource:e=>e.highlight()},Vu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Qu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Ju({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=Qu({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||y.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=Er.read(a.fileName)?.slice(l,a.lineNumber),g=u?.lineAt(a.lineNumber);if(u&&g){let h=Gu(g),v=Wu(g);if(!v)return s;s.functionName=`${v.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,C=>C.slice(0,v.openingBraceIndex))),u=o.highlightSource(u);let R=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((C,A)=>o.gray(String(A).padStart(R))+" "+C).mapLines(C=>o.dim(C)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let C=h+R+1;C+=2,s.callArguments=(0,Ro.default)(i,C).slice(C)}}return s}function Wu(e){let t=Object.keys(Le.ModelAction).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function Gu(e){let t=0;for(let r=0;r{if("rejectOnNotFound"in n.args){let o=mt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new Y(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof G&&o.code==="P2025"?new Oe(`No ${e} found`,t):o})}}m();c();p();f();d();function Te(e){return e.replace(/^./,t=>t.toLowerCase())}var Yu=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Zu=["aggregate","count","groupBy"];function An(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Xu(e,t),tc(e,t),Lt(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return Ee({},n)}function Xu(e,t){let r=Te(t),n=Object.keys(Le.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=ko(o,t,e._clientVersion,s);let a=l=>u=>{let g=je(e._errorFormat);return e._createPrismaPromise(h=>{let v={args:u,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...v,...l})})};return Yu.includes(o)?Cn(e,t,a):ec(i)?Eo(e,i,a):a({})}}}function ec(e){return Zu.includes(e)}function tc(e,t){return He(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return xo(t,r)}))}m();c();p();f();d();function Oo(e){return e.replace(/^./,t=>t.toUpperCase())}var Sn=Symbol();function Bt(e){let t=[rc(e),ne(Sn,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Lt(r)),Ee(e,t)}function rc(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Te),n=[...new Set(t.concat(r))];return He({getKeys(){return n},getPropertyValue(i){let o=Oo(i);if(e._runtimeDataModel.models[o]!==void 0)return An(e,o);if(e._runtimeDataModel.models[i]!==void 0)return An(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Fo(e){return e[Sn]?e[Sn]:e}function Mo(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Bt(t)}m();c();p();f();d();m();c();p();f();d();function _o({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(g=>n[g]);u.length>0&&a.push(it(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(g=>!r[g]);u.length>0&&a.push(it(u))}nc(e,l.needs)&&s.push(ic(l,Ee(e,s)))}return s.length>0||a.length>0?Ee(e,[...s,...a]):e}function nc(e,t){return t.every(r=>on(e,r))}function ic(e,t){return He(ne(e.name,()=>e.compute(t)))}m();c();p();f();d();function xr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sg.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=xr({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Io({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:xr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(s,a,l)=>_o({result:s,modelName:Te(a),select:l.select,omit:l.omit,extensions:n})})}m();c();p();f();d();m();c();p();f();d();function No(e){if(e instanceof se)return oc(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:No(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=qo(o,l),a.args=s,Bo(e,a,r,n+1)}})})}function $o(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Bo(e,t,s)}function jo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Uo(r,n,0,e):e(r)}}function Uo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=qo(i,l),Uo(a,t,r+1,n)}})}var Do=e=>e;function qo(e=Do,t=Do){return r=>e(t(r))}m();c();p();f();d();m();c();p();f();d();function Qo(e,t,r){let n=Te(r);return!t.result||!(t.result.$allModels||t.result[n])?e:sc({...e,...Vo(t.name,e,t.result.$allModels),...Vo(t.name,e,t.result[n])})}function sc(e){let t=new be,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return rt(e,n=>({...n,needs:r(n.name,new Set)}))}function Vo(e,t,r){return r?rt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:ac(t,o,i)})):{}}function ac(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Jo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function Wo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var vr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new be;this.modelExtensionsCache=new be;this.queryCallbacksCache=new be;this.clientExtensions=Rt(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=Rt(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Qo(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Te(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Pr=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new vr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new vr(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};m();c();p();f();d();var Go=le("prisma:client"),Ho={Vercel:"vercel","Netlify CI":"netlify"};function Ko({postinstall:e,ciName:t,clientVersion:r}){if(Go("checkPlatformCaching:postinstall",e),Go("checkPlatformCaching:ciName",t),e===!0&&t&&t in Ho){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${Ho[t]}-build`;throw console.error(n),new V(n,r)}}m();c();p();f();d();function zo(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var lc="Cloudflare-Workers",uc="node";function Yo(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===lc?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===uc?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var cc={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Zo(){let e=Yo();return{id:e,prettyName:cc[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}m();c();p();f();d();m();c();p();f();d();var Rn=fe(nn());m();c();p();f();d();function Xo(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}m();c();p();f();d();function es(e){return e.split(` -`).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` -`)}m();c();p();f();d();var pc=fe(Ci()),ts=fe(Bi());function rs({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,ts.default)({user:t,repo:r,template:n,title:e,body:i})}function ns({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=vi(6e3-(s?.length??0)),l=es((0,Rn.default)(a)),u=n?`# Description -\`\`\` -${n} -\`\`\``:"",g=(0,Rn.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: -## Versions - -| Name | Version | -|-----------------|--------------------| -| Node | ${y.version?.padEnd(19)}| -| OS | ${t?.padEnd(19)}| -| Prisma Client | ${e?.padEnd(19)}| -| Query Engine | ${i?.padEnd(19)}| -| Database | ${o?.padEnd(19)}| - -${u} - -## Logs -\`\`\` -${l} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?Xo(s):""} -\`\`\` -`),h=rs({title:r,body:g});return`${r} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${bt(h)} - -If you want the Prisma team to look into it, please open the link above \u{1F64F} -To increase the chance of success, please post your schema and a snippet of -how you used Prisma Client in the issue. -`}m();c();p();f();d();function Tr({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 V(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new V("error: Missing URL environment variable, value, or override.",n);return i}m();c();p();f();d();m();c();p();f();d();function is(e){if(e?.kind==="itx")return e.options.id}m();c();p();f();d();var kn=class{constructor(t,r,n){this.engineObject=__PrismaProxy.create({datamodel:t.datamodel,env:y.env,ignoreEnvVarErrors:!0,datasourceOverrides:t.datasourceOverrides??{},logLevel:t.logLevel,logQueries:t.logQueries??!1,logCallback:r})}async connect(t){return __PrismaProxy.connect(this.engineObject,t)}async disconnect(t){return __PrismaProxy.disconnect(this.engineObject,t)}query(t,r,n){return __PrismaProxy.execute(this.engineObject,t,r,n)}sdlSchema(){return Promise.resolve("{}")}dmmf(t){return Promise.resolve("{}")}async startTransaction(t,r){return __PrismaProxy.startTransaction(this.engineObject,t,r)}async commitTransaction(t,r){return __PrismaProxy.commitTransaction(this.engineObject,t,r)}async rollbackTransaction(t,r){return __PrismaProxy.rollbackTransaction(this.engineObject,t,r)}metrics(t){return Promise.resolve("{}")}async applyPendingMigrations(){return __PrismaProxy.applyPendingMigrations(this.engineObject)}},os={async loadLibrary(e){if(!__PrismaProxy)throw new V("__PrismaProxy not detected make sure React Native bindings are installed",e.clientVersion);return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:kn}}};var fc="P2036",Ce=le("prisma:client:libraryEngine");function dc(e){return e.item_type==="query"&&"query"in e}function mc(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var RC=[...Xr,"native"],ss=0,jt=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=os,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary(),this.checkForTooManyEngines()}checkForTooManyEngines(){ss===10&&console.warn(`${Qe("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async applyPendingMigrations(){await this.start(),await this.engine?.applyPendingMigrations()}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(gc(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new G(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(Ce("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new H("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new H("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new b(this),{adapter:r}=this.config;r&&Ce("Using driver adapter: %O",r),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:y.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{t.deref()?.logger(n)},r),ss++}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new V(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);if(r){if("span"in r){this.config.tracingHelper.createEngineSpan(r);return}r.level=r?.level.toLowerCase()??"unknown",dc(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):mc(r)?this.loggerRustPanic=new ue(On(this,`${r.message}: ${r.reason} in ${r.file}:${r.line}:${r.column}`),this.config.clientVersion):this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path})}}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Ce(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{Ce("library starting");try{let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,Ce("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new V(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Ce("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),Ce("library stopping");let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,Ce("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){Ce(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new H(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof V)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new ue(On(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new H(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){Ce("requestBatch");let i=rr(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),is(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new H(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:l}=s;if(Array.isArray(a))return a.map(u=>u.errors&&u.errors.length>0?this.loggerRustPanic??this.buildQueryError(u.errors[0]):{data:u,elapsed:0});throw l&&l.length===1?new Error(l[0].error):new Error(JSON.stringify(s))}buildQueryError(t){if(t.user_facing_error.is_panic)return new ue(On(this,t.user_facing_error.message),this.config.clientVersion);let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:yr(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===fc&&this.config.adapter){let r=t.meta?.id;zt(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return zt(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function gc(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function On(e,t){return ns({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function as({copyEngine:e=!0},t){let r;try{r=Tr({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch{}e&&r?.startsWith("prisma://")&&St("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Tt(t.generator),i=!!(r?.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o&&!1){let l;throw e?r?.startsWith("prisma://")?l=["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."]:l=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:l=["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(l.join(` -`),{clientVersion:t.clientVersion})}return new jt(t)}m();c();p();f();d();function Cr({generator:e}){return e?.previewFeatures??[]}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var ds=fe(Fn());m();c();p();f();d();function ps(e,t){let r=fs(e),n=hc(r),i=wc(n);i?Ar(i,t):t.addErrorMessage(()=>"Unknown error")}function fs(e){return e.errors.flatMap(t=>t.kind==="Union"?fs(t):[t])}function hc(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:yc(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function yc(e,t){return[...new Set(e.concat(t))]}function wc(e){return an(e,(t,r)=>{let n=us(t),i=us(r);return n!==i?n-i:cs(t)-cs(r)})}function us(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function cs(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}m();c();p();f();d();var pe=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};m();c();p();f();d();var Sr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(pt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Ar(e,t){switch(e.kind){case"MutuallyExclusiveFields":bc(e,t);break;case"IncludeOnScalar":Ec(e,t);break;case"EmptySelection":xc(e,t);break;case"UnknownSelectionField":Tc(e,t);break;case"UnknownArgument":Cc(e,t);break;case"UnknownInputField":Ac(e,t);break;case"RequiredArgumentMissing":Sc(e,t);break;case"InvalidArgumentType":Rc(e,t);break;case"InvalidArgumentValue":kc(e,t);break;case"ValueTooLarge":Oc(e,t);break;case"SomeFieldsMissing":Fc(e,t);break;case"TooManyFieldsGiven":Mc(e,t);break;case"Union":ps(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function bc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Ec(e,t){let[r,n]=Rr(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new pe(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${Ut(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function xc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(r){let n=r.getField("omit")?.value.asObject();if(n){vc(e,t,n);return}}Pc(e,t)}function vc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new pe(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Pc(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),hs(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${Ut(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Tc(e,t){let[r,n]=Rr(e.selectionPath),i=t.arguments.getDeepSubSelectionValue(r)?.asObject(),o;if(i){let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),l=i.getFieldValue("omit")?.asObject();s?.hasField(n)?(o="select",s.getField(n)?.markAsError(),hs(s,e.outputType)):a?.hasField(n)?(o="include",a.getField(n)?.markAsError(),_c(a,e.outputType)):l?.hasField(n)&&(o="omit",l.getField(n)?.markAsError(),Lc(l,e.outputType))}t.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(Ut(s)),a.join(" ")})}function Cc(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Ic(n,e.arguments)),t.addErrorMessage(i=>ms(i,r,e.arguments.map(o=>o.name)))}function Ac(e,t){let[r,n]=Rr(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&ys(o,e.inputType)}t.addErrorMessage(o=>ms(o,n,e.inputType.fields.map(s=>s.name)))}function ms(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Dc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(Ut(e)),n.join(" ")}function Sc(e,t){let r;t.addErrorMessage(l=>r?.value instanceof K&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Rr(e.argumentPath),s=new Sr,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new pe(o,s).makeRequired())}else{let l=e.inputTypes.map(gs).join(" | ");a.addSuggestion(new pe(o,l).makeRequired())}}function gs(e){return e.kind==="list"?`${gs(e.elementType)}[]`:e.name}function Rc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=kr("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function kc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=kr("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Oc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof K&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function Fc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&ys(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${kr("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(Ut(i)),o.join(" ")})}function Mc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${kr("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function hs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new pe(r.name,"true"))}function _c(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new pe(r.name,"true"))}function Lc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new pe(r.name,"true"))}function Ic(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new pe(r.name,r.typeNames.join(" | ")))}function ys(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new pe(r.name,r.typeNames.join(" | ")))}function Rr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function Ut({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function kr(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Nc=3;function Dc(e,t){let r=1/0,n;for(let i of t){let o=(0,ds.default)(e,i);o>Nc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.model?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};m();c();p();f();d();var xs=e=>({command:e});m();c();p();f();d();m();c();p();f();d();var vs=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);m();c();p();f();d();function qt(e){try{return Ps(e,"fast")}catch{return Ps(e,"slow")}}function Ps(e,t){return JSON.stringify(e.map(r=>Gc(r,t)))}function Gc(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:st(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ve.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Hc(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Cs(e):e}function Hc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Cs(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ts);let t={};for(let r of Object.keys(e))t[r]=Ts(e[r]);return t}function Ts(e){return typeof e=="bigint"?e.toString():Cs(e)}var Kc=/^(\s*alter\s)/i,As=le("prisma:client");function Ln(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Kc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var In=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:qt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:qt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:qt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=vs(r),i={values:qt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?As(`prisma.${e}(${n}, ${i.values})`):As(`prisma.${e}(${n})`),{query:n,parameters:i}},Ss={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Rs={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};m();c();p();f();d();function Nn(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=ks(r(o)):ks(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function ks(e){return typeof e.then=="function"?e:Promise.resolve(e)}m();c();p();f();d();var Os={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Dn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??Os}};function Fs(e){return e.includes("tracing")?new Dn:Os}m();c();p();f();d();function Ms(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}m();c();p();f();d();var zc=["$connect","$disconnect","$on","$transaction","$use","$extends"],_s=zc;m();c();p();f();d();function Ls(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}m();c();p();f();d();var Fr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};m();c();p();f();d();var Ns=fe(nn());m();c();p();f();d();function Mr(e){return typeof e.batchRequestIdx=="number"}m();c();p();f();d();function _r(e){return e===null?e:Array.isArray(e)?e.map(_r):typeof e=="object"?Yc(e)?Zc(e):rt(e,_r):e}function Yc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Zc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ve(t);case"Json":return JSON.parse(t);default:We(t,"Unknown tagged value")}}m();c();p();f();d();function Is(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Bn(e.query.arguments)),t.push(Bn(e.query.selection)),t.join("")}function Bn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Bn(n)})`:r}).join(" ")})`}m();c();p();f();d();var Xc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function $n(e){return Xc[e]}m();c();p();f();d();var Lr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(h=>$n(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:tp(o),containsWrite:u,customDataProxyFetch:i})).map((h,v)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[v],h)}catch(R){return R}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ds(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:$n(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Is(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(ep(t),rp(t,i)||t instanceof Oe)throw t;if(t instanceof G&&np(t)){let l=Bs(t.meta);Or({args:o,errors:[l],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=mt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let l=s?{modelName:s,...t.meta}:t.meta;throw new G(a,{code:t.code,clientVersion:this.client._clientVersion,meta:l,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ue(a,this.client._clientVersion);if(t instanceof H)throw new H(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof V)throw new V(a,this.client._clientVersion);if(t instanceof ue)throw new ue(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Ns.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=_r(Tn(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function tp(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ds(e)};We(e,"Unknown transaction kind")}}function Ds(e){return{id:e.id,payload:e.payload}}function rp(e,t){return Mr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function np(e){return e.code==="P2009"||e.code==="P2012"}function Bs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Bs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}m();c();p();f();d();var $s="5.14.0";var js=$s;m();c();p();f();d();function Us(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=qs(t[n]);return r})}function qs({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return w.Buffer.from(t,"base64");case"decimal":return new ve(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(qs);default:return t}}m();c();p();f();d();var Ws=fe(Fn());m();c();p();f();d();var q=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};re(q,"PrismaClientConstructorValidationError");var Vs=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Qs=["pretty","colorless","minimal"],Js=["info","query","warn","error"],op={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=gt(r,t)||` Available datasources: ${t.join(", ")}`;throw new q(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new q(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new q('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Cr(t).includes("driverAdapters"))throw new q('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Tt()==="binary")throw new q('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Qs.includes(e)){let t=gt(e,Qs);throw new q(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Js.includes(r)){let n=gt(r,Js);throw new q(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=gt(i,o);throw new q(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new q(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new q(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new q(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new q(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=gt(r,t);throw new q(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Gs(e,t){for(let[r,n]of Object.entries(e)){if(!Vs.includes(r)){let i=gt(r,Vs);throw new q(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}op[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new q('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function gt(e,t){if(t.length===0||typeof e!="string")return"";let r=sp(e,t);return r?` Did you mean "${r}"?`:""}function sp(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Ws.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u{n[u]=g,a()},g=>{if(!Mr(g)){l(g);return}g.batchRequestIdx===u?l(g):(i||(i=g),a())})})}var Ue=le("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var ap={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},lp=Symbol.for("prisma.client.transaction.id"),up={id:0,nextId(){return++this.id}};function Ys(e){class t{constructor(n){this._originalClient=this;this._middlewares=new Fr;this._createPrismaPromise=Nn();this.$extends=Mo;e=n?.__internal?.configOverride?.(e)??e,Ko(e),n&&Gs(n,e);let i=n?.adapter?fn(n.adapter):void 0,o=new Kt().on("error",()=>{});this._extensions=Pr.empty(),this._previewFeatures=Cr(e),this._clientVersion=e.clientVersion??js,this._activeProvider=e.activeProvider,this._tracingHelper=Fs(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&we.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&we.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},g=u.debug===!0;g&&le.enable("prisma:client");let h=we.resolve(e.dirname,e.relativePath);Gt.existsSync(h)||(h=e.dirname),Ue("dirname",e.dirname),Ue("relativePath",e.relativePath),Ue("cwd",h);let v=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:h,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:v.allowTriggerPanic,datamodelPath:we.join(e.dirname,e.filename??"schema.prisma"),prismaPath:v.binaryPath??void 0,engineEndpoint:v.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Ls(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(R=>typeof R=="string"?R==="query":R.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:zo(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Tr,getBatchRequestPayload:rr,prismaGraphQLToJSError:yr,PrismaClientUnknownRequestError:H,PrismaClientInitializationError:V,PrismaClientKnownRequestError:G,debug:le("prisma:client:accelerateEngine"),engineVersion:zs.version,clientVersion:e.clientVersion}},Ue("clientVersion",e.clientVersion),this._engine=as(e,this._engineConfig),this._requestHandler=new Ir(this,o),l.log)for(let R of l.log){let C=typeof R=="string"?R:R.emit==="stdout"?R.level:null;C&&this.$on(C,A=>{At.log(`${At.tags[C]??""}`,A.message||A.query)})}this._metrics=new nt(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=Bt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Pi()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:In({clientMethod:i,activeProvider:a}),callsite:je(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Ks(n,i);return Ln(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Y("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Ln(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Y(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:xs,callsite:je(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:In({clientMethod:i,activeProvider:a}),callsite:je(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(Us)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Ks(n,i));throw new Y("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=up.nextId(),s=Ms(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:u,isolationLevel:g,lock:s};return l.requestTransaction?.(h)??l});return Hs(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return Bt(Ee(Fo(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>Nn(n)),ne(lp,()=>n.id),it(_s)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??ap,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let g=this._middlewares.get(++a);if(g)return this._tracingHelper.runInChildSpan(s.middleware,F=>g(u,L=>(F?.end(),l(L))));let{runInTransaction:h,args:v,...R}=u,C={...n,...R};v&&(C.args=i.middlewareArgsToRequestArgs(v)),n.transaction!==void 0&&h===!1&&delete C.transaction;let A=await $o(this,C);return C.model?Io({result:A,modelName:C.model,args:C.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):A};return this._tracingHelper.runInChildSpan(s.operation,()=>l(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:g,unpacker:h,otelParentCtx:v,customDataProxyFetch:R}){try{n=u?u(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>ws({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return le.enabled("prisma:client")&&(Ue("Prisma Client call:"),Ue(`prisma.${i}(${mo(n)})`),Ue("Generated request:"),Ue(JSON.stringify(A,null,2)+` -`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:v,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:R})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new Y("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Ks(e,t){return cp(e)?[new se(e,t),Ss]:[e,Rs]}function cp(e){return Array.isArray(e)&&Array.isArray(e.raw)}m();c();p();f();d();var pp=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Zs(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!pp.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}m();c();p();f();d();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=react-native.js.map diff --git a/integration-tests/tests/prisma/pg/client/runtime/wasm.js b/integration-tests/tests/prisma/pg/client/runtime/wasm.js deleted file mode 100644 index 8e5f78d07..000000000 --- a/integration-tests/tests/prisma/pg/client/runtime/wasm.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict";var ko=Object.create;var Et=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Mo=Object.getOwnPropertyNames;var Io=Object.getPrototypeOf,_o=Object.prototype.hasOwnProperty;var oe=(e,t)=>()=>(e&&(t=e(e=0)),t);var Te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ze=(e,t)=>{for(var r in t)Et(e,r,{get:t[r],enumerable:!0})},Kr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mo(t))!_o.call(e,i)&&i!==r&&Et(e,i,{get:()=>t[i],enumerable:!(n=Lo(t,i))||n.enumerable});return e};var _e=(e,t,r)=>(r=e!=null?ko(Io(e)):{},Kr(t||!e||!e.__esModule?Et(r,"default",{value:e,enumerable:!0}):r,e)),ar=e=>Kr(Et({},"__esModule",{value:!0}),e);function lr(e,t){if(t=t.toLowerCase(),t==="utf8"||t==="utf-8")return new h(Bo.encode(e));if(t==="base64"||t==="base64url")return e=e.replace(/-/g,"+").replace(/_/g,"/"),e=e.replace(/[^A-Za-z0-9+/]/g,""),new h([...atob(e)].map(r=>r.charCodeAt(0)));if(t==="binary"||t==="ascii"||t==="latin1"||t==="latin-1")return new h([...e].map(r=>r.charCodeAt(0)));if(t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le"){let r=new h(e.length*2),n=new DataView(r.buffer);for(let i=0;ia.startsWith("get")||a.startsWith("set")),n=r.map(a=>a.replace("get","read").replace("set","write")),i=(a,f)=>function(v=0){return $(v,"offset"),Y(v,"offset"),q(v,"offset",this.length-1),new DataView(this.buffer)[r[a]](v,f)},o=(a,f)=>function(v,C=0){let T=r[a].match(/set(\w+\d+)/)[1].toLowerCase(),O=No[T];return $(C,"offset"),Y(C,"offset"),q(C,"offset",this.length-1),Fo(v,"value",O[0],O[1]),new DataView(this.buffer)[r[a]](C,v,f),C+parseInt(r[a].match(/\d+/)[0])/8},s=a=>{a.forEach(f=>{f.includes("Uint")&&(e[f.replace("Uint","UInt")]=e[f]),f.includes("Float64")&&(e[f.replace("Float64","Double")]=e[f]),f.includes("Float32")&&(e[f.replace("Float32","Float")]=e[f])})};n.forEach((a,f)=>{a.startsWith("read")&&(e[a]=i(f,!1),e[a+"LE"]=i(f,!0),e[a+"BE"]=i(f,!1)),a.startsWith("write")&&(e[a]=o(f,!1),e[a+"LE"]=o(f,!0),e[a+"BE"]=o(f,!1)),s([a,a+"LE",a+"BE"])})}function zr(e){throw new Error(`Buffer polyfill does not implement "${e}"`)}function xt(e,t){if(!(e instanceof Uint8Array))throw new TypeError(`The "${t}" argument must be an instance of Buffer or Uint8Array`)}function q(e,t,r=Vo+1){if(e<0||e>r){let n=new RangeError(`The value of "${t}" is out of range. It must be >= 0 && <= ${r}. Received ${e}`);throw n.code="ERR_OUT_OF_RANGE",n}}function $(e,t){if(typeof e!="number"){let r=new TypeError(`The "${t}" argument must be of type number. Received type ${typeof e}.`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function Y(e,t){if(!Number.isInteger(e)||Number.isNaN(e)){let r=new RangeError(`The value of "${t}" is out of range. It must be an integer. Received ${e}`);throw r.code="ERR_OUT_OF_RANGE",r}}function Fo(e,t,r,n){if(en){let i=new RangeError(`The value of "${t}" is out of range. It must be >= ${r} and <= ${n}. Received ${e}`);throw i.code="ERR_OUT_OF_RANGE",i}}function Hr(e,t){if(typeof e!="string"){let r=new TypeError(`The "${t}" argument must be of type string. Received type ${typeof e}`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function qo(e,t="utf8"){return h.from(e,t)}var h,No,Bo,Uo,$o,Vo,y,ur,u=oe(()=>{"use strict";h=class e extends Uint8Array{constructor(){super(...arguments);this._isBuffer=!0}get offset(){return this.byteOffset}static alloc(r,n=0,i="utf8"){return Hr(i,"encoding"),e.allocUnsafe(r).fill(n,i)}static allocUnsafe(r){return e.from(r)}static allocUnsafeSlow(r){return e.from(r)}static isBuffer(r){return r&&!!r._isBuffer}static byteLength(r,n="utf8"){if(typeof r=="string")return lr(r,n).byteLength;if(r&&r.byteLength)return r.byteLength;let i=new TypeError('The "string" argument must be of type string or an instance of Buffer or ArrayBuffer.');throw i.code="ERR_INVALID_ARG_TYPE",i}static isEncoding(r){return $o.includes(r)}static compare(r,n){xt(r,"buff1"),xt(n,"buff2");for(let i=0;in[i])return 1}return r.length===n.length?0:r.length>n.length?1:-1}static from(r,n="utf8"){if(r&&typeof r=="object"&&r.type==="Buffer")return new e(r.data);if(typeof r=="number")return new e(new Uint8Array(r));if(typeof r=="string")return lr(r,n);if(ArrayBuffer.isView(r)){let{byteOffset:i,byteLength:o,buffer:s}=r;return"map"in r&&typeof r.map=="function"?new e(r.map(a=>a%256),i,o):new e(s,i,o)}if(r&&typeof r=="object"&&("length"in r||"byteLength"in r||"buffer"in r))return new e(r);throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}static concat(r,n){if(r.length===0)return e.alloc(0);let i=[].concat(...r.map(s=>[...s])),o=e.alloc(n!==void 0?n:i.length);return o.set(n!==void 0?i.slice(0,n):i),o}slice(r=0,n=this.length){return this.subarray(r,n)}subarray(r=0,n=this.length){return Object.setPrototypeOf(super.subarray(r,n),e.prototype)}reverse(){return super.reverse(),this}readIntBE(r,n){$(r,"offset"),Y(r,"offset"),q(r,"offset",this.length-1),$(n,"byteLength"),Y(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s=0;s--)o.setUint8(s,r&255),r=r/256;return n+i}writeUintBE(r,n,i){return this.writeUIntBE(r,n,i)}writeUIntLE(r,n,i){$(n,"offset"),Y(n,"offset"),q(n,"offset",this.length-1),$(i,"byteLength"),Y(i,"byteLength");let o=new DataView(this.buffer,n,i);for(let s=0;sn===r[i])}copy(r,n=0,i=0,o=this.length){q(n,"targetStart"),q(i,"sourceStart",this.length),q(o,"sourceEnd"),n>>>=0,i>>>=0,o>>>=0;let s=0;for(;i=this.length?this.length-f:r.length),f);return this}includes(r,n=null,i="utf-8"){return this.indexOf(r,n,i)!==-1}lastIndexOf(r,n=null,i="utf-8"){return this.indexOf(r,n,i,!0)}indexOf(r,n=null,i="utf-8",o=!1){let s=o?this.findLastIndex.bind(this):this.findIndex.bind(this);i=typeof n=="string"?n:i;let a=e.from(typeof r=="number"?[r]:r,i),f=typeof n=="string"?0:n;return f=typeof n=="number"?f:null,f=Number.isNaN(f)?null:f,f??=o?this.length:0,f=f<0?this.length+f:f,a.length===0&&o===!1?f>=this.length?this.length:f:a.length===0&&o===!0?(f>=this.length?this.length:f)||this.length:s((v,C)=>(o?C<=f:C>=f)&&this[C]===a[0]&&a.every((O,R)=>this[C+R]===O))}toString(r="utf8",n=0,i=this.length){if(n=n<0?0:n,r=r.toString().toLowerCase(),i<=0)return"";if(r==="utf8"||r==="utf-8")return Uo.decode(this.slice(n,i));if(r==="base64"||r==="base64url"){let o=btoa(this.reduce((s,a)=>s+ur(a),""));return r==="base64url"?o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):o}if(r==="binary"||r==="ascii"||r==="latin1"||r==="latin-1")return this.slice(n,i).reduce((o,s)=>o+ur(s&(r==="ascii"?127:255)),"");if(r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le"){let o=new DataView(this.buffer.slice(n,i));return Array.from({length:o.byteLength/2},(s,a)=>a*2+1o+s.toString(16).padStart(2,"0"),"");zr(`encoding "${r}"`)}toLocaleString(){return this.toString()}inspect(){return``}};No={int8:[-128,127],int16:[-32768,32767],int32:[-2147483648,2147483647],uint8:[0,255],uint16:[0,65535],uint32:[0,4294967295],float32:[-1/0,1/0],float64:[-1/0,1/0],bigint64:[-0x8000000000000000n,0x7fffffffffffffffn],biguint64:[0n,0xffffffffffffffffn]},Bo=new TextEncoder,Uo=new TextDecoder,$o=["utf8","utf-8","hex","base64","ascii","binary","base64url","ucs2","ucs-2","utf16le","utf-16le","latin1","latin-1"],Vo=4294967295;Do(h.prototype);y=new Proxy(qo,{construct(e,[t,r]){return h.from(t,r)},get(e,t){return h[t]}}),ur=String.fromCodePoint});var g,c=oe(()=>{"use strict";g={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var E,m=oe(()=>{"use strict";E=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var w,p=oe(()=>{"use strict";w=()=>{};w.prototype=w});var b,d=oe(()=>{"use strict";b=class{constructor(t){this.value=t}deref(){return this.value}}});function en(e,t){var r,n,i,o,s,a,f,v,C=e.constructor,T=C.precision;if(!e.s||!t.s)return t.s||(t=new C(e)),B?_(t,T):t;if(f=e.d,v=t.d,s=e.e,i=t.e,f=f.slice(),o=s-i,o){for(o<0?(n=f,o=-o,a=v.length):(n=v,i=s,a=f.length),s=Math.ceil(T/F),a=s>a?s+1:a+1,o>a&&(o=a,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(a=f.length,o=v.length,a-o<0&&(o=a,n=v,v=f,f=n),r=0;o;)r=(f[--o]=f[o]+v[o]+r)/j|0,f[o]%=j;for(r&&(f.unshift(r),++i),a=f.length;f[--a]==0;)f.pop();return t.d=f,t.e=i,B?_(t,T):t}function le(e,t,r){if(e!==~~e||er)throw Error(Re+e)}function ae(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t16)throw Error(mr+V(e));if(!e.s)return new C(Z);for(t==null?(B=!1,a=T):a=t,s=new C(.03125);e.abs().gte(.1);)e=e.times(s),v+=5;for(n=Math.log(Ae(2,v))/Math.LN10*2+5|0,a+=n,r=i=o=new C(Z),C.precision=a;;){if(i=_(i.times(e),a),r=r.times(++f),s=o.plus(ge(i,r,a)),ae(s.d).slice(0,a)===ae(o.d).slice(0,a)){for(;v--;)o=_(o.times(o),a);return C.precision=T,t==null?(B=!0,_(o,T)):o}o=s}}function V(e){for(var t=e.e*F,r=e.d[0];r>=10;r/=10)t++;return t}function cr(e,t,r){if(t>e.LN10.sd())throw B=!0,r&&(e.precision=r),Error(te+"LN10 precision limit exceeded");return _(new e(e.LN10),t)}function we(e){for(var t="";e--;)t+="0";return t}function Ye(e,t){var r,n,i,o,s,a,f,v,C,T=1,O=10,R=e,L=R.d,S=R.constructor,M=S.precision;if(R.s<1)throw Error(te+(R.s?"NaN":"-Infinity"));if(R.eq(Z))return new S(0);if(t==null?(B=!1,v=M):v=t,R.eq(10))return t==null&&(B=!0),cr(S,v);if(v+=O,S.precision=v,r=ae(L),n=r.charAt(0),o=V(R),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)R=R.times(e),r=ae(R.d),n=r.charAt(0),T++;o=V(R),n>1?(R=new S("0."+r),o++):R=new S(n+"."+r.slice(1))}else return f=cr(S,v+2,M).times(o+""),R=Ye(new S(n+"."+r.slice(1)),v-O).plus(f),S.precision=M,t==null?(B=!0,_(R,M)):R;for(a=s=R=ge(R.minus(Z),R.plus(Z),v),C=_(R.times(R),v),i=3;;){if(s=_(s.times(C),v),f=a.plus(ge(s,new S(i),v)),ae(f.d).slice(0,v)===ae(a.d).slice(0,v))return a=a.times(2),o!==0&&(a=a.plus(cr(S,v+2,M).times(o+""))),a=ge(a,new S(T),v),S.precision=M,t==null?(B=!0,_(a,M)):a;a=f,i+=2}}function Yr(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Fe(r/F),e.d=[],n=(r+1)%F,r<0&&(n+=F),nPt||e.e<-Pt))throw Error(mr+r)}else e.s=0,e.e=0,e.d=[0];return e}function _(e,t,r){var n,i,o,s,a,f,v,C,T=e.d;for(s=1,o=T[0];o>=10;o/=10)s++;if(n=t-s,n<0)n+=F,i=t,v=T[C=0];else{if(C=Math.ceil((n+1)/F),o=T.length,C>=o)return e;for(v=o=T[C],s=1;o>=10;o/=10)s++;n%=F,i=n-F+s}if(r!==void 0&&(o=Ae(10,s-i-1),a=v/o%10|0,f=t<0||T[C+1]!==void 0||v%o,f=r<4?(a||f)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||f||r==6&&(n>0?i>0?v/Ae(10,s-i):0:T[C-1])%10&1||r==(e.s<0?8:7))),t<1||!T[0])return f?(o=V(e),T.length=1,t=t-o-1,T[0]=Ae(10,(F-t%F)%F),e.e=Fe(-t/F)||0):(T.length=1,T[0]=e.e=e.s=0),e;if(n==0?(T.length=C,o=1,C--):(T.length=C+1,o=Ae(10,F-n),T[C]=i>0?(v/Ae(10,s-i)%Ae(10,i)|0)*o:0),f)for(;;)if(C==0){(T[0]+=o)==j&&(T[0]=1,++e.e);break}else{if(T[C]+=o,T[C]!=j)break;T[C--]=0,o=1}for(n=T.length;T[--n]===0;)T.pop();if(B&&(e.e>Pt||e.e<-Pt))throw Error(mr+V(e));return e}function rn(e,t){var r,n,i,o,s,a,f,v,C,T,O=e.constructor,R=O.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new O(e),B?_(t,R):t;if(f=e.d,T=t.d,n=t.e,v=e.e,f=f.slice(),s=v-n,s){for(C=s<0,C?(r=f,s=-s,a=T.length):(r=T,n=v,a=f.length),i=Math.max(Math.ceil(R/F),a)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=f.length,a=T.length,C=i0;--i)f[a++]=0;for(i=T.length;i>s;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+we(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+we(-i-1)+o,r&&(n=r-s)>0&&(o+=we(n))):i>=s?(o+=we(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+we(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=we(n))),e.s<0?"-"+o:o}function Xr(e,t){if(e.length>t)return e.length=t,!0}function nn(e){var t,r,n;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Re+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return Yr(s,o.toString())}else if(typeof o!="string")throw Error(Re+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,Qo.test(o))Yr(s,o);else throw Error(Re+o)}if(i.prototype=A,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=nn,i.config=i.set=Jo,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Re+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Re+r+": "+n);return this}var De,jo,pr,B,te,Re,mr,Fe,Ae,Qo,Z,j,F,Zr,Pt,A,ge,pr,vt,on=oe(()=>{"use strict";u();c();m();p();d();l();De=1e9,jo={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},B=!0,te="[DecimalError] ",Re=te+"Invalid argument: ",mr=te+"Exponent out of range: ",Fe=Math.floor,Ae=Math.pow,Qo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,j=1e7,F=7,Zr=9007199254740991,Pt=Fe(Zr/F),A={};A.absoluteValue=A.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};A.comparedTo=A.cmp=function(e){var t,r,n,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};A.decimalPlaces=A.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*F;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};A.dividedBy=A.div=function(e){return ge(this,new this.constructor(e))};A.dividedToIntegerBy=A.idiv=function(e){var t=this,r=t.constructor;return _(ge(t,new r(e),0,1),r.precision)};A.equals=A.eq=function(e){return!this.cmp(e)};A.exponent=function(){return V(this)};A.greaterThan=A.gt=function(e){return this.cmp(e)>0};A.greaterThanOrEqualTo=A.gte=function(e){return this.cmp(e)>=0};A.isInteger=A.isint=function(){return this.e>this.d.length-2};A.isNegative=A.isneg=function(){return this.s<0};A.isPositive=A.ispos=function(){return this.s>0};A.isZero=function(){return this.s===0};A.lessThan=A.lt=function(e){return this.cmp(e)<0};A.lessThanOrEqualTo=A.lte=function(e){return this.cmp(e)<1};A.logarithm=A.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Z))throw Error(te+"NaN");if(r.s<1)throw Error(te+(r.s?"NaN":"-Infinity"));return r.eq(Z)?new n(0):(B=!1,t=ge(Ye(r,o),Ye(e,o),o),B=!0,_(t,i))};A.minus=A.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rn(t,e):en(t,(e.s=-e.s,e))};A.modulo=A.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(te+"NaN");return r.s?(B=!1,t=ge(r,e,0,1).times(e),B=!0,r.minus(t)):_(new n(r),i)};A.naturalExponential=A.exp=function(){return tn(this)};A.naturalLogarithm=A.ln=function(){return Ye(this)};A.negated=A.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};A.plus=A.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?en(t,e):rn(t,(e.s=-e.s,e))};A.precision=A.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Re+e);if(t=V(i)+1,n=i.d.length-1,r=n*F+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};A.squareRoot=A.sqrt=function(){var e,t,r,n,i,o,s,a=this,f=a.constructor;if(a.s<1){if(!a.s)return new f(0);throw Error(te+"NaN")}for(e=V(a),B=!1,i=Math.sqrt(+a),i==0||i==1/0?(t=ae(a.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Fe((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=s=r+3;;)if(o=n,n=o.plus(ge(a,o,s+2)).times(.5),ae(o.d).slice(0,s)===(t=ae(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(_(o,r+1,0),o.times(o).eq(a)){n=o;break}}else if(t!="9999")break;s+=4}return B=!0,_(n,r)};A.times=A.mul=function(e){var t,r,n,i,o,s,a,f,v,C=this,T=C.constructor,O=C.d,R=(e=new T(e)).d;if(!C.s||!e.s)return new T(0);for(e.s*=C.s,r=C.e+e.e,f=O.length,v=R.length,f=0;){for(t=0,i=f+n;i>n;)a=o[i]+R[n]*O[i-n-1]+t,o[i--]=a%j|0,t=a/j|0;o[i]=(o[i]+t)%j|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,B?_(e,T.precision):e};A.toDecimalPlaces=A.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(le(e,0,De),t===void 0?t=n.rounding:le(t,0,8),_(r,e+V(r)+1,t))};A.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Se(n,!0):(le(e,0,De),t===void 0?t=i.rounding:le(t,0,8),n=_(new i(n),e+1,t),r=Se(n,!0,e+1)),r};A.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?Se(i):(le(e,0,De),t===void 0?t=o.rounding:le(t,0,8),n=_(new o(i),e+V(i)+1,t),r=Se(n.abs(),!1,e+V(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};A.toInteger=A.toint=function(){var e=this,t=e.constructor;return _(new t(e),V(e)+1,t.rounding)};A.toNumber=function(){return+this};A.toPower=A.pow=function(e){var t,r,n,i,o,s,a=this,f=a.constructor,v=12,C=+(e=new f(e));if(!e.s)return new f(Z);if(a=new f(a),!a.s){if(e.s<1)throw Error(te+"Infinity");return a}if(a.eq(Z))return a;if(n=f.precision,e.eq(Z))return _(a,n);if(t=e.e,r=e.d.length-1,s=t>=r,o=a.s,s){if((r=C<0?-C:C)<=Zr){for(i=new f(Z),t=Math.ceil(n/F+4),B=!1;r%2&&(i=i.times(a),Xr(i.d,t)),r=Fe(r/2),r!==0;)a=a.times(a),Xr(a.d,t);return B=!0,e.s<0?new f(Z).div(i):_(i,n)}}else if(o<0)throw Error(te+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,a.s=1,B=!1,i=e.times(Ye(a,n+v)),B=!0,i=tn(i),i.s=o,i};A.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=V(i),n=Se(i,r<=o.toExpNeg||r>=o.toExpPos)):(le(e,1,De),t===void 0?t=o.rounding:le(t,0,8),i=_(new o(i),e,t),r=V(i),n=Se(i,e<=r||r<=o.toExpNeg,e)),n};A.toSignificantDigits=A.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(le(e,1,De),t===void 0?t=n.rounding:le(t,0,8)),_(new n(r),e,t)};A.toString=A.valueOf=A.val=A.toJSON=A[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=V(e),r=e.constructor;return Se(e,t<=r.toExpNeg||t>=r.toExpPos)};ge=function(){function e(n,i){var o,s=0,a=n.length;for(n=n.slice();a--;)o=n[a]*i+s,n[a]=o%j|0,s=o/j|0;return s&&n.unshift(s),n}function t(n,i,o,s){var a,f;if(o!=s)f=o>s?1:-1;else for(a=f=0;ai[a]?1:-1;break}return f}function r(n,i,o){for(var s=0;o--;)n[o]-=s,s=n[o]1;)n.shift()}return function(n,i,o,s){var a,f,v,C,T,O,R,L,S,M,ne,z,Ie,k,Ce,sr,ie,bt,wt=n.constructor,Oo=n.s==i.s?1:-1,se=n.d,U=i.d;if(!n.s)return new wt(n);if(!i.s)throw Error(te+"Division by zero");for(f=n.e-i.e,ie=U.length,Ce=se.length,R=new wt(Oo),L=R.d=[],v=0;U[v]==(se[v]||0);)++v;if(U[v]>(se[v]||0)&&--f,o==null?z=o=wt.precision:s?z=o+(V(n)-V(i))+1:z=o,z<0)return new wt(0);if(z=z/F+2|0,v=0,ie==1)for(C=0,U=U[0],z++;(v1&&(U=e(U,C),se=e(se,C),ie=U.length,Ce=se.length),k=ie,S=se.slice(0,ie),M=S.length;M=j/2&&++sr;do C=0,a=t(U,S,ie,M),a<0?(ne=S[0],ie!=M&&(ne=ne*j+(S[1]||0)),C=ne/sr|0,C>1?(C>=j&&(C=j-1),T=e(U,C),O=T.length,M=S.length,a=t(T,S,O,M),a==1&&(C--,r(T,ie{"use strict";on();P=class extends vt{static isDecimal(t){return t instanceof vt}static random(t=20){{let n=crypto.getRandomValues(new Uint8Array(t)).reduce((i,o)=>i+o,"");return new vt(`0.${n.slice(0,t)}`)}}},ue=P});function Wo(){return!1}var Go,Ko,un,cn=oe(()=>{"use strict";u();c();m();p();d();l();Go={},Ko={existsSync:Wo,promises:Go},un=Ko});var xn=Te((Au,En)=>{"use strict";u();c();m();p();d();l();En.exports=(yr(),ar(hr)).format});var hr={};ze(hr,{default:()=>Yo,deprecate:()=>vn,format:()=>Tn,inspect:()=>Cn,promisify:()=>Pn});function Pn(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function vn(e,t){return(...r)=>(console.warn(t),e(...r))}function Cn(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var Tn,zo,Yo,yr=oe(()=>{"use strict";u();c();m();p();d();l();Tn=xn(),zo={promisify:Pn,deprecate:vn,inspect:Cn,format:Tn},Yo=zo});function rs(...e){return e.join("/")}function ns(...e){return e.join("/")}var On,is,os,Ze,kn=oe(()=>{"use strict";u();c();m();p();d();l();On="/",is={sep:On},os={resolve:rs,posix:is,join:ns,sep:On},Ze=os});var St,Mn=oe(()=>{"use strict";u();c();m();p();d();l();St=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var _n=Te((Kc,In)=>{"use strict";u();c();m();p();d();l();In.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 Nn=Te((lm,Fn)=>{"use strict";u();c();m();p();d();l();Fn.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 Un=Te((gm,Bn)=>{"use strict";u();c();m();p();d();l();var ms=Nn();Bn.exports=e=>typeof e=="string"?e.replace(ms(),""):e});var jn=Te((Jf,gs)=>{gs.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Qn=Te(()=>{"use strict";u();c();m();p();d();l()});var Ur=Te((ST,Fi)=>{"use strict";u();c();m();p();d();l();Fi.exports=function(){function e(t,r,n,i,o){return tn?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;swr,Decimal:()=>ue,Extensions:()=>dr,MetricsClient:()=>Ue,NotFoundError:()=>he,PrismaClientInitializationError:()=>I,PrismaClientKnownRequestError:()=>Q,PrismaClientRustPanicError:()=>ye,PrismaClientUnknownRequestError:()=>J,PrismaClientValidationError:()=>W,Public:()=>fr,Sql:()=>X,defineDmmfProperty:()=>qn,empty:()=>Wn,getPrismaClient:()=>Ao,getRuntime:()=>Pe,join:()=>Jn,makeStrictEnum:()=>Ro,objectEnumValues:()=>Lt,raw:()=>kr,sqltag:()=>Lr,warnEnvConflicts:()=>void 0,warnOnce:()=>nt});module.exports=ar(Ya);u();c();m();p();d();l();var dr={};ze(dr,{defineExtension:()=>sn,getExtensionContext:()=>an});u();c();m();p();d();l();u();c();m();p();d();l();function sn(e){return typeof e=="function"?e:t=>t.$extends(e)}u();c();m();p();d();l();function an(e){return e}var fr={};ze(fr,{validator:()=>ln});u();c();m();p();d();l();u();c();m();p();d();l();function ln(...e){return t=>t}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var gr,mn,pn,dn,fn=!0;typeof g<"u"&&({FORCE_COLOR:gr,NODE_DISABLE_COLORS:mn,NO_COLOR:pn,TERM:dn}=g.env||{},fn=g.stdout&&g.stdout.isTTY);var Ho={enabled:!mn&&pn==null&&dn!=="dumb"&&(gr!=null&&gr!=="0"||fn)};function D(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ho.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var ru=D(0,0),Ct=D(1,22),Tt=D(2,22),nu=D(3,23),gn=D(4,24),iu=D(7,27),ou=D(8,28),su=D(9,29),au=D(30,39),Ne=D(31,39),hn=D(32,39),At=D(33,39),yn=D(34,39),lu=D(35,39),bn=D(36,39),uu=D(37,39),wn=D(90,39),cu=D(90,39),mu=D(40,49),pu=D(41,49),du=D(42,49),fu=D(43,49),gu=D(44,49),hu=D(45,49),yu=D(46,49),bu=D(47,49);u();c();m();p();d();l();var Xo=100,An=["green","yellow","blue","magenta","cyan","red"],Rt=[],Rn=Date.now(),Zo=0,br=typeof g<"u"?g.env:{};globalThis.DEBUG??=br.DEBUG??"";globalThis.DEBUG_COLORS??=br.DEBUG_COLORS?br.DEBUG_COLORS==="true":!0;var Xe={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,i;typeof require=="function"&&typeof g<"u"&&typeof g.stderr<"u"&&typeof g.stderr.write=="function"?i=(...o)=>{try{let s=(yr(),ar(hr));g.stderr.write(s.format(...o)+` -`)}catch{i=console.warn??console.log}}:i=console.warn??console.log,i(`${t} ${r}`,...n)},formatters:{}};function es(e){let t={color:An[Zo++%An.length],enabled:Xe.enabled(e),namespace:e,log:Xe.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Rt.push([o,...n]),Rt.length>Xo&&Rt.shift(),Xe.enabled(o)||i){let f=n.map(C=>typeof C=="string"?C:ts(C)),v=`+${Date.now()-Rn}ms`;Rn=Date.now(),a(o,...f,v)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var wr=new Proxy(es,{get:(e,t)=>Xe[t],set:(e,t,r)=>Xe[t]=r});function ts(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 Sn(){Rt.length=0}var ee=wr;u();c();m();p();d();l();u();c();m();p();d();l();var Er=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];u();c();m();p();d();l();var Ln="library";function et(e){let t=ss();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Ln)}function ss(){let e=g.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}u();c();m();p();d();l();u();c();m();p();d();l();var Oe;(t=>{let e;(k=>(k.findUnique="findUnique",k.findUniqueOrThrow="findUniqueOrThrow",k.findFirst="findFirst",k.findFirstOrThrow="findFirstOrThrow",k.findMany="findMany",k.create="create",k.createMany="createMany",k.createManyAndReturn="createManyAndReturn",k.update="update",k.updateMany="updateMany",k.upsert="upsert",k.delete="delete",k.deleteMany="deleteMany",k.groupBy="groupBy",k.count="count",k.aggregate="aggregate",k.findRaw="findRaw",k.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Oe||={});var rt={};ze(rt,{error:()=>us,info:()=>ls,log:()=>as,query:()=>cs,should:()=>Dn,tags:()=>tt,warn:()=>xr});u();c();m();p();d();l();var tt={error:Ne("prisma:error"),warn:At("prisma:warn"),info:bn("prisma:info"),query:yn("prisma:query")},Dn={warn:()=>!g.env.PRISMA_DISABLE_WARNINGS};function as(...e){console.log(...e)}function xr(e,...t){Dn.warn()&&console.warn(`${tt.warn} ${e}`,...t)}function ls(e,...t){console.info(`${tt.info} ${e}`,...t)}function us(e,...t){console.error(`${tt.error} ${e}`,...t)}function cs(e,...t){console.log(`${tt.query} ${e}`,...t)}u();c();m();p();d();l();function Ot(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}u();c();m();p();d();l();function ke(e,t){throw new Error(t)}u();c();m();p();d();l();function Pr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}u();c();m();p();d();l();var vr=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});u();c();m();p();d();l();function Be(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}u();c();m();p();d();l();function Cr(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{$n.has(e)||($n.add(e),xr(t,...r))};u();c();m();p();d();l();var Q=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};K(Q,"PrismaClientKnownRequestError");var he=class extends Q{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};K(he,"NotFoundError");u();c();m();p();d();l();var I=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};K(I,"PrismaClientInitializationError");u();c();m();p();d();l();var ye=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};K(ye,"PrismaClientRustPanicError");u();c();m();p();d();l();var J=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};K(J,"PrismaClientUnknownRequestError");u();c();m();p();d();l();var W=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};K(W,"PrismaClientValidationError");u();c();m();p();d();l();var Ue=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};u();c();m();p();d();l();u();c();m();p();d();l();function it(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function qn(e,t){let r=it(()=>ps(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function ps(e){throw new Error("Prisma.dmmf is not available when running in edge runtimes.")}function Tr(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}u();c();m();p();d();l();var kt=Symbol(),Ar=new WeakMap,be=class{constructor(t){t===kt?Ar.set(this,`Prisma.${this._getName()}`):Ar.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Ar.get(this)}},ot=class extends be{_getNamespace(){return"NullTypes"}},st=class extends ot{};Rr(st,"DbNull");var at=class extends ot{};Rr(at,"JsonNull");var lt=class extends ot{};Rr(lt,"AnyNull");var Lt={classes:{DbNull:st,JsonNull:at,AnyNull:lt},instances:{DbNull:new st(kt),JsonNull:new at(kt),AnyNull:new lt(kt)}};function Rr(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();function ut(e){return{ok:!1,error:e,map(){return ut(e)},flatMap(){return ut(e)}}}var Sr=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},Or=e=>{let t=new Sr,r=Le(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Le(t,e.queryRaw.bind(e)),executeRaw:Le(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>ds(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=fs(t,e.getConnectionInfo.bind(e))),n},ds=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Le(e,t.queryRaw.bind(t)),executeRaw:Le(e,t.executeRaw.bind(t)),commit:Le(e,t.commit.bind(t)),rollback:Le(e,t.rollback.bind(t))});function Le(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return ut({kind:"GenericJs",id:i})}}}function fs(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return ut({kind:"GenericJs",id:i})}}}var To=_e(jn());var cO=_e(Qn());Mn();cn();kn();u();c();m();p();d();l();var X=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}u();c();m();p();d();l();u();c();m();p();d();l();var Mt={enumerable:!0,configurable:!0,writable:!0};function It(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>Mt,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Gn=Symbol.for("nodejs.util.inspect.custom");function me(e,t){let r=hs(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Kn(Reflect.ownKeys(o),r),a=Kn(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let f=r.get(s);return f?f.getPropertyDescriptor?{...Mt,...f?.getPropertyDescriptor(s)}:Mt:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[Gn]=function(){let o={...this};return delete o[Gn],o},i}function hs(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Kn(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}u();c();m();p();d();l();function $e(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}u();c();m();p();d();l();function _t(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}u();c();m();p();d();l();u();c();m();p();d();l();var Ve=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};u();c();m();p();d();l();u();c();m();p();d();l();function Hn(e){return e.substring(0,1).toLowerCase()+e.substring(1)}u();c();m();p();d();l();function qe(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Dt(e){return e.toString()!=="Invalid Date"}u();c();m();p();d();l();l();function je(e){return P.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}u();c();m();p();d();l();var mt=class{constructor(t,r,n,i,o){this.modelName=t,this.name=r,this.typeName=n,this.isList=i,this.isEnum=o}_toGraphQLInputType(){let t=this.isList?"List":"",r=this.isEnum?"Enum":"";return`${t}${r}${this.typeName}FieldRefInput<${this.modelName}>`}};function Qe(e){return e instanceof mt}u();c();m();p();d();l();u();c();m();p();d();l();var Ft=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};u();c();m();p();d();l();var Nt=e=>e,Bt={bold:Nt,red:Nt,green:Nt,dim:Nt,enabled:!1},zn={bold:Ct,red:Ne,green:hn,dim:Tt,enabled:!0},Je={write(e){e.writeLine(",")}};u();c();m();p();d();l();var pe=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};u();c();m();p();d();l();var Ee=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var We=class extends Ee{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new Ft(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new pe("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(Je,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};u();c();m();p();d();l();var Yn=": ",Ut=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Yn.length}write(t){let r=new pe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Yn).write(this.value)}};u();c();m();p();d();l();var $t=class e extends Ee{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let f;if(s.value instanceof e?f=s.value.getField(a):s.value instanceof We&&(f=s.value.getField(Number(a))),!f)return;s=f}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new pe("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(Je,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};u();c();m();p();d();l();var G=class extends Ee{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new pe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var Mr=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Vt(e){return new Mr(Xn(e))}function Xn(e){let t=new $t;for(let[r,n]of Object.entries(e)){let i=new Ut(r,Zn(n));t.addField(i)}return t}function Zn(e){if(typeof e=="string")return new G(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new G(String(e));if(typeof e=="bigint")return new G(`${e}n`);if(e===null)return new G("null");if(e===void 0)return new G("undefined");if(je(e))return new G(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return y.isBuffer(e)?new G(`Buffer.alloc(${e.byteLength})`):new G(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Dt(e)?e.toISOString():"Invalid Date";return new G(`new Date("${t}")`)}return e instanceof be?new G(`Prisma.${e._getName()}`):Qe(e)?new G(`prisma.${Hn(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?bs(e):typeof e=="object"?Xn(e):new G(Object.prototype.toString.call(e))}function bs(e){let t=new We;for(let r of e)t.addItem(Zn(r));return t}function ei(e){if(e===void 0)return"";let t=Vt(e);return new Ve(0,{colors:Bt}).write(t).toString()}u();c();m();p();d();l();var ws="P2037";function qt({error:e,user_facing_error:t},r,n){return t.error_code?new Q(Es(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new J(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function Es(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===ws&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Ir=class{getLocation(){return null}};function xe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Ir}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var ti={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Ge(e={}){let t=Ps(e);return Object.entries(t).reduce((n,[i,o])=>(ti[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Ps(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function jt(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ri(e,t){let r=jt(e);return t({action:"aggregate",unpacker:r,argsMapper:Ge})(e)}u();c();m();p();d();l();function vs(e={}){let{select:t,...r}=e;return typeof t=="object"?Ge({...r,_count:t}):Ge({...r,_count:{_all:!0}})}function Cs(e={}){return typeof e.select=="object"?t=>jt(e)(t)._count:t=>jt(e)(t)._count._all}function ni(e,t){return t({action:"count",unpacker:Cs(e),argsMapper:vs})(e)}u();c();m();p();d();l();function Ts(e={}){let t=Ge(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function As(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function ii(e,t){return t({action:"groupBy",unpacker:As(e),argsMapper:Ts})(e)}function oi(e,t,r){if(t==="aggregate")return n=>ri(n,r);if(t==="count")return n=>ni(n,r);if(t==="groupBy")return n=>ii(n,r)}u();c();m();p();d();l();function si(e,t){let r=t.fields.filter(i=>!i.relationName),n=vr(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new mt(e,o,s.type,s.isList,s.kind==="enum")},...It(Object.keys(n))})}u();c();m();p();d();l();u();c();m();p();d();l();var ai=e=>Array.isArray(e)?e:e.split("."),_r=(e,t)=>ai(t).reduce((r,n)=>r&&r[n],e),li=(e,t,r)=>ai(t).reduceRight((n,i,o,s)=>Object.assign({},_r(e,s.slice(0,o)),{[i]:n}),r);function Rs(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Ss(e,t,r){return t===void 0?e??{}:li(t,r,e||!0)}function Dr(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((f,v)=>({...f,[v.name]:v}),{});return f=>{let v=xe(e._errorFormat),C=Rs(n,i),T=Ss(f,o,C),O=r({dataPath:C,callsite:v})(T),R=Os(e,t);return new Proxy(O,{get(L,S){if(!R.includes(S))return L[S];let ne=[a[S].type,r,S],z=[C,T];return Dr(e,...ne,...z)},...It([...R,...Object.getOwnPropertyNames(O)])})}}function Os(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}u();c();m();p();d();l();u();c();m();p();d();l();var ks=_e(_n());var Ls={red:Ne,gray:wn,dim:Tt,bold:Ct,underline:gn,highlightSource:e=>e.highlight()},Ms={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Is({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function _s({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],f=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${f}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${f}`)),t&&a.push(s.underline(Ds(t))),i){a.push("");let v=[i.toString()];o&&(v.push(o),v.push(s.dim(")"))),a.push(v.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function Ds(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function Ke(e){let t=e.showColors?Ls:Ms,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(e,t):r=Is(e),_s(r,t)}function ui(e,t,r,n){return e===Oe.ModelAction.findFirstOrThrow||e===Oe.ModelAction.findUniqueOrThrow?Fs(t,r,n):n}function Fs(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=Ke({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new W(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof Q&&o.code==="P2025"?new he(`No ${e} found`,t):o})}}u();c();m();p();d();l();function de(e){return e.replace(/^./,t=>t.toLowerCase())}var Ns=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Bs=["aggregate","count","groupBy"];function Fr(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Us(e,t),Vs(e,t),ct(r),H("name",()=>t),H("$name",()=>t),H("$parent",()=>e._appliedParent)];return me({},n)}function Us(e,t){let r=de(t),n=Object.keys(Oe.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=f=>e._request(f);s=ui(o,t,e._clientVersion,s);let a=f=>v=>{let C=xe(e._errorFormat);return e._createPrismaPromise(T=>{let O={args:v,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:T,callsite:C};return s({...O,...f})})};return Ns.includes(o)?Dr(e,t,a):$s(i)?oi(e,i,a):a({})}}}function $s(e){return Bs.includes(e)}function Vs(e,t){return Me(H("fields",()=>{let r=e._runtimeDataModel.models[t];return si(t,r)}))}u();c();m();p();d();l();function ci(e){return e.replace(/^./,t=>t.toUpperCase())}var Nr=Symbol();function pt(e){let t=[qs(e),H(Nr,()=>e),H("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(ct(r)),me(e,t)}function qs(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(de),n=[...new Set(t.concat(r))];return Me({getKeys(){return n},getPropertyValue(i){let o=ci(i);if(e._runtimeDataModel.models[o]!==void 0)return Fr(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Fr(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function mi(e){return e[Nr]?e[Nr]:e}function pi(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return pt(t)}u();c();m();p();d();l();u();c();m();p();d();l();function di({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let f of Object.values(o)){if(n){if(n[f.name])continue;let v=f.needs.filter(C=>n[C]);v.length>0&&a.push($e(v))}else if(r){if(!r[f.name])continue;let v=f.needs.filter(C=>!r[C]);v.length>0&&a.push($e(v))}js(e,f.needs)&&s.push(Qs(f,me(e,s)))}return s.length>0||a.length>0?me(e,[...s,...a]):e}function js(e,t){return t.every(r=>Pr(e,r))}function Qs(e,t){return Me(H(e.name,()=>e.compute(t)))}u();c();m();p();d();l();function Qt({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sC.name===o);if(!f||f.kind!=="object"||!f.relationName)continue;let v=typeof s=="object"?s:{};t[o]=Qt({visitor:i,result:t[o],args:v,modelName:f.type,runtimeDataModel:n})}}function gi({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Qt({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(s,a,f)=>di({result:s,modelName:de(a),select:f.select,omit:f.omit,extensions:n})})}u();c();m();p();d();l();u();c();m();p();d();l();l();function hi(e){if(e instanceof X)return Js(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:hi(t.args??{}),__internalParams:t,query:(s,a=t)=>{let f=a.customDataProxyFetch;return a.customDataProxyFetch=Pi(o,f),a.args=s,bi(e,a,r,n+1)}})})}function wi(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return bi(e,t,s)}function Ei(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?xi(r,n,0,e):e(r)}}function xi(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let f=a.customDataProxyFetch;return a.customDataProxyFetch=Pi(i,f),xi(a,t,r+1,n)}})}var yi=e=>e;function Pi(e=yi,t=yi){return r=>e(t(r))}u();c();m();p();d();l();u();c();m();p();d();l();function Ci(e,t,r){let n=de(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Ws({...e,...vi(t.name,e,t.result.$allModels),...vi(t.name,e,t.result[n])})}function Ws(e){let t=new ce,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Be(e,n=>({...n,needs:r(n.name,new Set)}))}function vi(e,t,r){return r?Be(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Gs(t,o,i)})):{}}function Gs(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Ti(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function Ai(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Jt=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new ce;this.modelExtensionsCache=new ce;this.queryCallbacksCache=new ce;this.clientExtensions=it(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=it(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Ci(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=de(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Wt=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Jt(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Jt(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};u();c();m();p();d();l();var Ri=ee("prisma:client"),Si={Vercel:"vercel","Netlify CI":"netlify"};function Oi({postinstall:e,ciName:t,clientVersion:r}){if(Ri("checkPlatformCaching:postinstall",e),Ri("checkPlatformCaching:ciName",t),e===!0&&t&&t in Si){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${Si[t]}-build`;throw console.error(n),new I(n,r)}}u();c();m();p();d();l();function ki(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Ks="Cloudflare-Workers",Hs="node";function Li(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Ks?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===Hs?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var zs={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Pe(){let e=Li();return{id:e,prettyName:zs[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}u();c();m();p();d();l();u();c();m();p();d();l();function Gt({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 Pe().id==="workerd"?new I(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new I(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new I("error: Missing URL environment variable, value, or override.",n);return i}u();c();m();p();d();l();u();c();m();p();d();l();function Mi(e){if(e?.kind==="itx")return e.options.id}u();c();m();p();d();l();var Br,Ii={async loadLibrary(e){let{clientVersion:t,adapter:r,engineWasm:n}=e;if(r===void 0)throw new I(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Pe().prettyName})`,t);if(n===void 0)throw new I("WASM engine was unexpectedly `undefined`",t);Br===void 0&&(Br=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new I("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let a={"./query_engine_bg.js":o},f=new WebAssembly.Instance(s,a);return o.__wbg_set_wasm(f.exports),o.QueryEngine})());let i=await Br;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var Ys="P2036",fe=ee("prisma:client:libraryEngine");function Xs(e){return e.item_type==="query"&&"query"in e}function Zs(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var MC=[...Er,"native"],_i=0,ft=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=r??Ii,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary(),this.checkForTooManyEngines()}checkForTooManyEngines(){_i===10&&console.warn(`${At("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(ea(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new Q(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(fe("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new J("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new J("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new b(this),{adapter:r}=this.config;r&&fe("Using driver adapter: %O",r),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:g.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{t.deref()?.logger(n)},r),_i++}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new I(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);if(r){if("span"in r){this.config.tracingHelper.createEngineSpan(r);return}r.level=r?.level.toLowerCase()??"unknown",Xs(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):(Zs(r),this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path}))}}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return fe(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{fe("library starting");try{let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,fe("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new I(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return fe("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),fe("library stopping");let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,fe("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){fe(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new J(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof I)throw s;s.code==="GenericFailure"&&s.message?.startsWith("PANIC:");let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new J(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){fe("requestBatch");let i=_t(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Mi(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new J(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:f}=s;if(Array.isArray(a))return a.map(v=>v.errors&&v.errors.length>0?this.loggerRustPanic??this.buildQueryError(v.errors[0]):{data:v,elapsed:0});throw f&&f.length===1?new Error(f[0].error):new Error(JSON.stringify(s))}buildQueryError(t){t.user_facing_error.is_panic;let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:qt(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===Ys&&this.config.adapter){let r=t.meta?.id;Ot(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return Ot(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function ea(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}u();c();m();p();d();l();var gt="Accelerate has not been setup correctly. Make sure your client is using `.$extends(withAccelerate())`. See https://pris.ly/d/accelerate-getting-started",Kt=class{constructor(t){this.config=t;this.name="AccelerateEngine";this.resolveDatasourceUrl=this.config.accelerateUtils?.resolveDatasourceUrl;this.getBatchRequestPayload=this.config.accelerateUtils?.getBatchRequestPayload;this.prismaGraphQLToJSError=this.config.accelerateUtils?.prismaGraphQLToJSError;this.PrismaClientUnknownRequestError=this.config.accelerateUtils?.PrismaClientUnknownRequestError;this.PrismaClientInitializationError=this.config.accelerateUtils?.PrismaClientInitializationError;this.PrismaClientKnownRequestError=this.config.accelerateUtils?.PrismaClientKnownRequestError;this.debug=this.config.accelerateUtils?.debug;this.engineVersion=this.config.accelerateUtils?.engineVersion;this.clientVersion=this.config.accelerateUtils?.clientVersion}onBeforeExit(t){}async start(){}async stop(){}version(t){return"unknown"}transaction(t,r,n){throw new I(gt,this.config.clientVersion)}metrics(t){throw new I(gt,this.config.clientVersion)}request(t,r){throw new I(gt,this.config.clientVersion)}requestBatch(t,r){throw new I(gt,this.config.clientVersion)}applyPendingMigrations(){throw new I(gt,this.config.clientVersion)}};function Di({copyEngine:e=!0},t){let r;try{r=Gt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...g.env},clientVersion:t.clientVersion})}catch{}e&&r?.startsWith("prisma://")&&nt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=et(t.generator),i=!!(r?.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o&&!1){let f;throw e?r?.startsWith("prisma://")?f=["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."]:f=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:f=["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 W(f.join(` -`),{clientVersion:t.clientVersion})}if(o)return new ft(t);if(i)return new Kt(t);{let f=[`PrismaClient failed to initialize because it wasn't configured to run in this environment (${Pe().prettyName}).`,"In order to run Prisma Client in an edge runtime, you will need to configure one of the following options:","- Enable Driver Adapters: https://pris.ly/d/driver-adapters","- Enable Accelerate: https://pris.ly/d/accelerate"];throw new W(f.join(` -`),{clientVersion:t.clientVersion})}throw new W("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}u();c();m();p();d();l();function Ht({generator:e}){return e?.previewFeatures??[]}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Vi=_e(Ur());u();c();m();p();d();l();function Ui(e,t){let r=$i(e),n=ta(r),i=na(n);i?zt(i,t):t.addErrorMessage(()=>"Unknown error")}function $i(e){return e.errors.flatMap(t=>t.kind==="Union"?$i(t):[t])}function ta(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:ra(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function ra(e,t){return[...new Set(e.concat(t))]}function na(e){return Cr(e,(t,r)=>{let n=Ni(t),i=Ni(r);return n!==i?n-i:Bi(t)-Bi(r)})}function Ni(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Bi(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}u();c();m();p();d();l();var re=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};u();c();m();p();d();l();var Yt=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(Je,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function zt(e,t){switch(e.kind){case"MutuallyExclusiveFields":ia(e,t);break;case"IncludeOnScalar":oa(e,t);break;case"EmptySelection":sa(e,t);break;case"UnknownSelectionField":ua(e,t);break;case"UnknownArgument":ca(e,t);break;case"UnknownInputField":ma(e,t);break;case"RequiredArgumentMissing":pa(e,t);break;case"InvalidArgumentType":da(e,t);break;case"InvalidArgumentValue":fa(e,t);break;case"ValueTooLarge":ga(e,t);break;case"SomeFieldsMissing":ha(e,t);break;case"TooManyFieldsGiven":ya(e,t);break;case"Union":Ui(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function ia(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function oa(e,t){let[r,n]=Xt(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new re(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${ht(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function sa(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(r){let n=r.getField("omit")?.value.asObject();if(n){aa(e,t,n);return}}la(e,t)}function aa(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new re(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function la(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Qi(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${ht(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function ua(e,t){let[r,n]=Xt(e.selectionPath),i=t.arguments.getDeepSubSelectionValue(r)?.asObject(),o;if(i){let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),f=i.getFieldValue("omit")?.asObject();s?.hasField(n)?(o="select",s.getField(n)?.markAsError(),Qi(s,e.outputType)):a?.hasField(n)?(o="include",a.getField(n)?.markAsError(),ba(a,e.outputType)):f?.hasField(n)&&(o="omit",f.getField(n)?.markAsError(),wa(f,e.outputType))}t.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(ht(s)),a.join(" ")})}function ca(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Ea(n,e.arguments)),t.addErrorMessage(i=>qi(i,r,e.arguments.map(o=>o.name)))}function ma(e,t){let[r,n]=Xt(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&Ji(o,e.inputType)}t.addErrorMessage(o=>qi(o,n,e.inputType.fields.map(s=>s.name)))}function qi(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Pa(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(ht(e)),n.join(" ")}function pa(e,t){let r;t.addErrorMessage(f=>r?.value instanceof G&&r.value.text==="null"?`Argument \`${f.green(o)}\` must not be ${f.red("null")}.`:`Argument \`${f.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Xt(e.argumentPath),s=new Yt,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let f of e.inputTypes[0].fields)s.addField(f.name,f.typeNames.join(" | "));a.addSuggestion(new re(o,s).makeRequired())}else{let f=e.inputTypes.map(ji).join(" | ");a.addSuggestion(new re(o,f).makeRequired())}}function ji(e){return e.kind==="list"?`${ji(e.elementType)}[]`:e.name}function da(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Zt("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function fa(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=Zt("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function ga(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof G&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function ha(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&Ji(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Zt("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(ht(i)),o.join(" ")})}function ya(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Zt("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Qi(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new re(r.name,"true"))}function ba(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new re(r.name,"true"))}function wa(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new re(r.name,"true"))}function Ea(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new re(r.name,r.typeNames.join(" | ")))}function Ji(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new re(r.name,r.typeNames.join(" | ")))}function Xt(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function ht({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Zt(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var xa=3;function Pa(e,t){let r=1/0,n;for(let i of t){let o=(0,Vi.default)(e,i);o>xa||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.model?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};u();c();m();p();d();l();var Hi=e=>({command:e});u();c();m();p();d();l();u();c();m();p();d();l();var zi=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);u();c();m();p();d();l();l();function yt(e){try{return Yi(e,"fast")}catch{return Yi(e,"slow")}}function Yi(e,t){return JSON.stringify(e.map(r=>Ma(r,t)))}function Ma(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:qe(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ue.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:y.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Ia(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:y.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Zi(e):e}function Ia(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Zi(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Xi);let t={};for(let r of Object.keys(e))t[r]=Xi(e[r]);return t}function Xi(e){return typeof e=="bigint"?e.toString():Zi(e)}var _a=/^(\s*alter\s)/i,eo=ee("prisma:client");function qr(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&_a.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var jr=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:yt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:yt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:yt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=zi(r),i={values:yt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?eo(`prisma.${e}(${n}, ${i.values})`):eo(`prisma.${e}(${n})`),{query:n,parameters:i}},to={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new X(t,r)}},ro={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};u();c();m();p();d();l();function Qr(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=no(r(o)):no(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function no(e){return typeof e.then=="function"?e:Promise.resolve(e)}u();c();m();p();d();l();var io={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Jr=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??io}};function oo(e){return e.includes("tracing")?new Jr:io}u();c();m();p();d();l();function so(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}u();c();m();p();d();l();var Da=["$connect","$disconnect","$on","$transaction","$use","$extends"],ao=Da;u();c();m();p();d();l();function lo(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}u();c();m();p();d();l();var tr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};u();c();m();p();d();l();var co=_e(Un());u();c();m();p();d();l();function rr(e){return typeof e.batchRequestIdx=="number"}u();c();m();p();d();l();l();function nr(e){return e===null?e:Array.isArray(e)?e.map(nr):typeof e=="object"?Fa(e)?Na(e):Be(e,nr):e}function Fa(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Na({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return y.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ue(t);case"Json":return JSON.parse(t);default:ke(t,"Unknown tagged value")}}u();c();m();p();d();l();function uo(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Wr(e.query.arguments)),t.push(Wr(e.query.selection)),t.join("")}function Wr(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Wr(n)})`:r}).join(" ")})`}u();c();m();p();d();l();var Ba={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Gr(e){return Ba[e]}u();c();m();p();d();l();var ir=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,g.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(T=>T.protocolQuery),f=this.client._tracingHelper.getTraceParent(s),v=n.some(T=>Gr(T.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:f,transaction:$a(o),containsWrite:v,customDataProxyFetch:i})).map((T,O)=>{if(T instanceof Error)return T;try{return this.mapQueryEngineResult(n[O],T)}catch(R){return R}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?mo(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Gr(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:uo(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return g.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(Ua(t),Va(t,i)||t instanceof he)throw t;if(t instanceof Q&&qa(t)){let f=po(t.meta);er({args:o,errors:[f],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=Ke({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let f=s?{modelName:s,...t.meta}:t.meta;throw new Q(a,{code:t.code,clientVersion:this.client._clientVersion,meta:f,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ye(a,this.client._clientVersion);if(t instanceof J)throw new J(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof I)throw new I(a,this.client._clientVersion);if(t instanceof ye)throw new ye(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,co.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=nr(_r(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function $a(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:mo(e)};ke(e,"Unknown transaction kind")}}function mo(e){return{id:e.id,payload:e.payload}}function Va(e,t){return rr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function qa(e){return e.code==="P2009"||e.code==="P2012"}function po(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(po)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}u();c();m();p();d();l();var fo="5.14.0";var go=fo;u();c();m();p();d();l();l();function ho(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=yo(t[n]);return r})}function yo({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return y.from(t,"base64");case"decimal":return new ue(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(yo);default:return t}}u();c();m();p();d();l();var xo=_e(Ur());u();c();m();p();d();l();var N=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};K(N,"PrismaClientConstructorValidationError");var bo=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],wo=["pretty","colorless","minimal"],Eo=["info","query","warn","error"],Qa={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new N(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=He(r,t)||` Available datasources: ${t.join(", ")}`;throw new N(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new N(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new N(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new N(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new N('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Ht(t).includes("driverAdapters"))throw new N('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(et()==="binary")throw new N('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new N(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new N(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!wo.includes(e)){let t=He(e,wo);throw new N(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new N(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Eo.includes(r)){let n=He(r,Eo);throw new N(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=He(i,o);throw new N(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new N(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new N(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new N(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new N(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=He(r,t);throw new N(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Po(e,t){for(let[r,n]of Object.entries(e)){if(!bo.includes(r)){let i=He(r,bo);throw new N(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Qa[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new N('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function He(e,t){if(t.length===0||typeof e!="string")return"";let r=Ja(e,t);return r?` Did you mean "${r}"?`:""}function Ja(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,xo.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},f=v=>{o||(o=!0,r(v))};for(let v=0;v{n[v]=C,a()},C=>{if(!rr(C)){f(C);return}C.batchRequestIdx===v?f(C):(i||(i=C),a())})})}var ve=ee("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Wa={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Ga=Symbol.for("prisma.client.transaction.id"),Ka={id:0,nextId(){return++this.id}};function Ao(e){class t{constructor(n){this._originalClient=this;this._middlewares=new tr;this._createPrismaPromise=Qr();this.$extends=pi;e=n?.__internal?.configOverride?.(e)??e,Oi(e),n&&Po(n,e);let i=n?.adapter?Or(n.adapter):void 0,o=new St().on("error",()=>{});this._extensions=Wt.empty(),this._previewFeatures=Ht(e),this._clientVersion=e.clientVersion??go,this._activeProvider=e.activeProvider,this._tracingHelper=oo(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Ze.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Ze.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=e.injectableEdgeEnv?.();try{let f=n??{},v=f.__internal??{},C=v.debug===!0;C&&ee.enable("prisma:client");let T=Ze.resolve(e.dirname,e.relativePath);un.existsSync(T)||(T=e.dirname),ve("dirname",e.dirname),ve("relativePath",e.relativePath),ve("cwd",T);let O=v.engine||{};if(f.errorFormat?this._errorFormat=f.errorFormat:g.env.NODE_ENV==="production"?this._errorFormat="minimal":g.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:T,dirname:e.dirname,enableDebugLogs:C,allowTriggerPanic:O.allowTriggerPanic,datamodelPath:Ze.join(e.dirname,e.filename??"schema.prisma"),prismaPath:O.binaryPath??void 0,engineEndpoint:O.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:f.log&&lo(f.log),logQueries:f.log&&!!(typeof f.log=="string"?f.log==="query":f.log.find(R=>typeof R=="string"?R==="query":R.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:ki(f,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:f.transactionOptions?.maxWait??2e3,timeout:f.transactionOptions?.timeout??5e3,isolationLevel:f.transactionOptions?.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Gt,getBatchRequestPayload:_t,prismaGraphQLToJSError:qt,PrismaClientUnknownRequestError:J,PrismaClientInitializationError:I,PrismaClientKnownRequestError:Q,debug:ee("prisma:client:accelerateEngine"),engineVersion:To.version,clientVersion:e.clientVersion}},ve("clientVersion",e.clientVersion),this._engine=Di(e,this._engineConfig),this._requestHandler=new or(this,o),f.log)for(let R of f.log){let L=typeof R=="string"?R:R.emit==="stdout"?R.level:null;L&&this.$on(L,S=>{rt.log(`${rt.tags[L]??""}`,S.message||S.query)})}this._metrics=new Ue(this._engine)}catch(f){throw f.clientVersion=this._clientVersion,f}return this._appliedParent=pt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Sn()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:jr({clientMethod:i,activeProvider:a}),callsite:xe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Co(n,i);return qr(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new W("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(qr(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new W(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Hi,callsite:xe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:jr({clientMethod:i,activeProvider:a}),callsite:xe(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(ho)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Co(n,i));throw new W("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Ka.nextId(),s=so(n.length),a=n.map((f,v)=>{if(f?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let C=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,T={kind:"batch",id:o,index:v,isolationLevel:C,lock:s};return f.requestTransaction?.(T)??f});return vo(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),f;try{let v={kind:"itx",...a};f=await n(this._createItxClient(v)),await this._engine.transaction("commit",o,a)}catch(v){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),v}return f}_createItxClient(n){return pt(me(mi(this),[H("_appliedParent",()=>this._appliedParent._createItxClient(n)),H("_createPrismaPromise",()=>Qr(n)),H(Ga,()=>n.id),$e(ao)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Wa,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,f=async v=>{let C=this._middlewares.get(++a);if(C)return this._tracingHelper.runInChildSpan(s.middleware,M=>C(v,ne=>(M?.end(),f(ne))));let{runInTransaction:T,args:O,...R}=v,L={...n,...R};O&&(L.args=i.middlewareArgsToRequestArgs(O)),n.transaction!==void 0&&T===!1&&delete L.transaction;let S=await wi(this,L);return L.model?gi({result:S,modelName:L.model,args:L.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):S};return this._tracingHelper.runInChildSpan(s.operation,()=>f(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:f,argsMapper:v,transaction:C,unpacker:T,otelParentCtx:O,customDataProxyFetch:R}){try{n=v?v(n):n;let L={name:"serialize"},S=this._tracingHelper.runInChildSpan(L,()=>Wi({modelName:f,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return ee.enabled("prisma:client")&&(ve("Prisma Client call:"),ve(`prisma.${i}(${ei(n)})`),ve("Generated request:"),ve(JSON.stringify(S,null,2)+` -`)),C?.kind==="batch"&&await C.lock,this._requestHandler.request({protocolQuery:S,modelName:f,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:C,unpacker:T,otelParentCtx:O,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:R})}catch(L){throw L.clientVersion=this._clientVersion,L}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new W("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Co(e,t){return Ha(e)?[new X(e,t),to]:[e,ro]}function Ha(e){return Array.isArray(e)&&Array.isArray(e.raw)}u();c();m();p();d();l();var za=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Ro(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!za.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}u();c();m();p();d();l();l();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=wasm.js.map diff --git a/integration-tests/tests/prisma/pg/client/schema.prisma b/integration-tests/tests/prisma/pg/client/schema.prisma deleted file mode 100644 index 722c5c4f8..000000000 --- a/integration-tests/tests/prisma/pg/client/schema.prisma +++ /dev/null @@ -1,20 +0,0 @@ -generator client { - provider = "prisma-client-js" - output = "./client" -} - -generator drizzle { - provider = "drizzle-prisma-generator" - output = "./drizzle" -} - -datasource db { - provider = "postgresql" - url = env("PG_CONNECTION_STRING") -} - -model User { - id Int @id @default(autoincrement()) - email String @unique - name String? -} diff --git a/integration-tests/tests/prisma/pg/client/wasm.d.ts b/integration-tests/tests/prisma/pg/client/wasm.d.ts deleted file mode 100644 index 34c616106..000000000 --- a/integration-tests/tests/prisma/pg/client/wasm.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './index' \ No newline at end of file diff --git a/integration-tests/tests/prisma/pg/client/wasm.js b/integration-tests/tests/prisma/pg/client/wasm.js deleted file mode 100644 index 05e73deb6..000000000 --- a/integration-tests/tests/prisma/pg/client/wasm.js +++ /dev/null @@ -1,177 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - Decimal, - objectEnumValues, - makeStrictEnum, - Public, - getRuntime, -} = require('./runtime/index-browser.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)}; -Prisma.PrismaClientUnknownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientRustPanicError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientInitializationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientValidationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.NotFoundError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.empty = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.join = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.raw = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.defineExtension = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - -/** - * Enums - */ - -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - ReadUncommitted: 'ReadUncommitted', - ReadCommitted: 'ReadCommitted', - RepeatableRead: 'RepeatableRead', - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.QueryMode = { - default: 'default', - insensitive: 'insensitive' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; - -/** - * This is a stub Prisma Client that will error at runtime if called. - */ -class PrismaClient { - constructor() { - return new Proxy(this, { - get(target, prop) { - let message - const runtime = getRuntime() - if (runtime.isEdge) { - message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: -- Use Prisma Accelerate: https://pris.ly/d/accelerate -- Use Driver Adapters: https://pris.ly/d/driver-adapters -`; - } else { - message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).' - } - - message += ` -If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report` - - throw new Error(message) - } - }) - } -} - -exports.PrismaClient = PrismaClient - -Object.assign(exports, Prisma) diff --git a/integration-tests/tests/prisma/pg/drizzle/schema.ts b/integration-tests/tests/prisma/pg/drizzle/schema.ts deleted file mode 100644 index 095affba8..000000000 --- a/integration-tests/tests/prisma/pg/drizzle/schema.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { pgTable, serial, text } from 'drizzle-orm/pg-core' - -export const User = pgTable('User', { - id: serial('id').notNull().primaryKey(), - email: text('email').notNull().unique(), - name: text('name') -}); \ No newline at end of file diff --git a/integration-tests/tests/prisma/sqlite/client/default.d.ts b/integration-tests/tests/prisma/sqlite/client/default.d.ts deleted file mode 100644 index 34c616106..000000000 --- a/integration-tests/tests/prisma/sqlite/client/default.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './index' \ No newline at end of file diff --git a/integration-tests/tests/prisma/sqlite/client/default.js b/integration-tests/tests/prisma/sqlite/client/default.js deleted file mode 100644 index fa52f0cd2..000000000 --- a/integration-tests/tests/prisma/sqlite/client/default.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = { ...require('.') } \ No newline at end of file diff --git a/integration-tests/tests/prisma/sqlite/client/edge.d.ts b/integration-tests/tests/prisma/sqlite/client/edge.d.ts deleted file mode 100644 index 479a9ab23..000000000 --- a/integration-tests/tests/prisma/sqlite/client/edge.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './default' \ No newline at end of file diff --git a/integration-tests/tests/prisma/sqlite/client/edge.js b/integration-tests/tests/prisma/sqlite/client/edge.js deleted file mode 100644 index eaad5a6de..000000000 --- a/integration-tests/tests/prisma/sqlite/client/edge.js +++ /dev/null @@ -1,174 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - PrismaClientKnownRequestError, - PrismaClientUnknownRequestError, - PrismaClientRustPanicError, - PrismaClientInitializationError, - PrismaClientValidationError, - NotFoundError, - getPrismaClient, - sqltag, - empty, - join, - raw, - Decimal, - Debug, - objectEnumValues, - makeStrictEnum, - Extensions, - warnOnce, - defineDmmfProperty, - Public, - getRuntime -} = require('./runtime/edge.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; -Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError -Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError -Prisma.PrismaClientInitializationError = PrismaClientInitializationError -Prisma.PrismaClientValidationError = PrismaClientValidationError -Prisma.NotFoundError = NotFoundError -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = sqltag -Prisma.empty = empty -Prisma.join = join -Prisma.raw = raw -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = Extensions.getExtensionContext -Prisma.defineExtension = Extensions.defineExtension - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - - - -/** - * Enums - */ -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; -/** - * Create the Client - */ -const config = { - "generator": { - "name": "client", - "provider": { - "fromEnvVar": null, - "value": "prisma-client-js" - }, - "output": { - "value": "/home/prodrigues/Desktop/summer-hackathon-s2-drizzle-orm/integration-tests/tests/prisma/sqlite/client", - "fromEnvVar": null - }, - "config": { - "engineType": "library" - }, - "binaryTargets": [ - { - "fromEnvVar": null, - "value": "debian-openssl-3.0.x", - "native": true - } - ], - "previewFeatures": [], - "isCustomOutput": true - }, - "relativeEnvPaths": { - "rootEnvPath": null - }, - "relativePath": "..", - "clientVersion": "5.14.0", - "engineVersion": "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48", - "datasourceNames": [ - "db" - ], - "activeProvider": "sqlite", - "postinstall": false, - "inlineDatasources": { - "db": { - "url": { - "fromEnvVar": null, - "value": "file:./db.sqlite" - } - } - }, - "inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n output = \"./client\"\n}\n\ngenerator drizzle {\n provider = \"drizzle-prisma-generator\"\n output = \"./drizzle\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n url = \"file:./db.sqlite\"\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n}\n", - "inlineSchemaHash": "27cd479fd1b89d536091428b8dcabf555138189cc583a755f0fe1c575abc3e80", - "copyEngine": true -} -config.dirname = '/' - -config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") -defineDmmfProperty(exports.Prisma, config.runtimeDataModel) -config.engineWasm = undefined - -config.injectableEdgeEnv = () => ({ - parsed: {} -}) - -if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) { - Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) -} - -const PrismaClient = getPrismaClient(config) -exports.PrismaClient = PrismaClient -Object.assign(exports, Prisma) - diff --git a/integration-tests/tests/prisma/sqlite/client/index-browser.js b/integration-tests/tests/prisma/sqlite/client/index-browser.js deleted file mode 100644 index e55c15f2f..000000000 --- a/integration-tests/tests/prisma/sqlite/client/index-browser.js +++ /dev/null @@ -1,169 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - Decimal, - objectEnumValues, - makeStrictEnum, - Public, - getRuntime, -} = require('./runtime/index-browser.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)}; -Prisma.PrismaClientUnknownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientRustPanicError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientInitializationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientValidationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.NotFoundError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.empty = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.join = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.raw = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.defineExtension = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - -/** - * Enums - */ - -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; - -/** - * This is a stub Prisma Client that will error at runtime if called. - */ -class PrismaClient { - constructor() { - return new Proxy(this, { - get(target, prop) { - let message - const runtime = getRuntime() - if (runtime.isEdge) { - message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: -- Use Prisma Accelerate: https://pris.ly/d/accelerate -- Use Driver Adapters: https://pris.ly/d/driver-adapters -`; - } else { - message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).' - } - - message += ` -If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report` - - throw new Error(message) - } - }) - } -} - -exports.PrismaClient = PrismaClient - -Object.assign(exports, Prisma) diff --git a/integration-tests/tests/prisma/sqlite/client/index.d.ts b/integration-tests/tests/prisma/sqlite/client/index.d.ts deleted file mode 100644 index ad0a505fa..000000000 --- a/integration-tests/tests/prisma/sqlite/client/index.d.ts +++ /dev/null @@ -1,2206 +0,0 @@ - -/** - * Client -**/ - -import * as runtime from './runtime/library.js'; -import $Types = runtime.Types // general types -import $Public = runtime.Types.Public -import $Utils = runtime.Types.Utils -import $Extensions = runtime.Types.Extensions -import $Result = runtime.Types.Result - -export type PrismaPromise = $Public.PrismaPromise - - -/** - * Model User - * - */ -export type User = $Result.DefaultSelection - -/** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ -export class PrismaClient< - T extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, - U = 'log' extends keyof T ? T['log'] extends Array ? Prisma.GetEvents : never : never, - ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs -> { - [K: symbol]: { types: Prisma.TypeMap['other'] } - - /** - * ## Prisma Client ʲˢ - * - * Type-safe database client for TypeScript & Node.js - * @example - * ``` - * const prisma = new PrismaClient() - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - * - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). - */ - - constructor(optionsArg ?: Prisma.Subset); - $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): void; - - /** - * Connect with the database - */ - $connect(): $Utils.JsPromise; - - /** - * Disconnect from the database - */ - $disconnect(): $Utils.JsPromise; - - /** - * Add a middleware - * @deprecated since 4.16.0. For new code, prefer client extensions instead. - * @see https://pris.ly/d/extensions - */ - $use(cb: Prisma.Middleware): void - -/** - * Executes a prepared raw query and returns the number of affected rows. - * @example - * ``` - * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};` - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Executes a raw query and returns the number of affected rows. - * Susceptible to SQL injections, see documentation. - * @example - * ``` - * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a prepared raw query and returns the `SELECT` data. - * @example - * ``` - * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};` - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; - - /** - * Performs a raw query and returns the `SELECT` data. - * Susceptible to SQL injections, see documentation. - * @example - * ``` - * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). - */ - $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; - - /** - * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole. - * @example - * ``` - * const [george, bob, alice] = await prisma.$transaction([ - * prisma.user.create({ data: { name: 'George' } }), - * prisma.user.create({ data: { name: 'Bob' } }), - * prisma.user.create({ data: { name: 'Alice' } }), - * ]) - * ``` - * - * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions). - */ - $transaction

[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise> - - $transaction(fn: (prisma: Omit) => $Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): $Utils.JsPromise - - - $extends: $Extensions.ExtendsHook<'extends', Prisma.TypeMapCb, ExtArgs> - - /** - * `prisma.user`: Exposes CRUD operations for the **User** model. - * Example usage: - * ```ts - * // Fetch zero or more Users - * const users = await prisma.user.findMany() - * ``` - */ - get user(): Prisma.UserDelegate; -} - -export namespace Prisma { - export import DMMF = runtime.DMMF - - export type PrismaPromise = $Public.PrismaPromise - - /** - * Validator - */ - export import validator = runtime.Public.validator - - /** - * Prisma Errors - */ - export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError - export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError - export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError - export import PrismaClientInitializationError = runtime.PrismaClientInitializationError - export import PrismaClientValidationError = runtime.PrismaClientValidationError - export import NotFoundError = runtime.NotFoundError - - /** - * Re-export of sql-template-tag - */ - export import sql = runtime.sqltag - export import empty = runtime.empty - export import join = runtime.join - export import raw = runtime.raw - export import Sql = runtime.Sql - - /** - * Decimal.js - */ - export import Decimal = runtime.Decimal - - export type DecimalJsLike = runtime.DecimalJsLike - - /** - * Metrics - */ - export type Metrics = runtime.Metrics - export type Metric = runtime.Metric - export type MetricHistogram = runtime.MetricHistogram - export type MetricHistogramBucket = runtime.MetricHistogramBucket - - /** - * Extensions - */ - export import Extension = $Extensions.UserArgs - export import getExtensionContext = runtime.Extensions.getExtensionContext - export import Args = $Public.Args - export import Payload = $Public.Payload - export import Result = $Public.Result - export import Exact = $Public.Exact - - /** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ - export type PrismaVersion = { - client: string - } - - export const prismaVersion: PrismaVersion - - /** - * Utility Types - */ - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON object. - * This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. - */ - export type JsonObject = {[Key in string]?: JsonValue} - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches a JSON array. - */ - export interface JsonArray extends Array {} - - /** - * From https://github.com/sindresorhus/type-fest/ - * Matches any valid JSON value. - */ - export type JsonValue = string | number | boolean | JsonObject | JsonArray | null - - /** - * Matches a JSON object. - * Unlike `JsonObject`, this type allows undefined and read-only properties. - */ - export type InputJsonObject = {readonly [Key in string]?: InputJsonValue | null} - - /** - * Matches a JSON array. - * Unlike `JsonArray`, readonly arrays are assignable to this type. - */ - export interface InputJsonArray extends ReadonlyArray {} - - /** - * Matches any valid value that can be used as an input for operations like - * create and update as the value of a JSON field. Unlike `JsonValue`, this - * type allows read-only arrays and read-only object properties and disallows - * `null` at the top level. - * - * `null` cannot be used as the value of a JSON field because its meaning - * would be ambiguous. Use `Prisma.JsonNull` to store the JSON null value or - * `Prisma.DbNull` to clear the JSON value and set the field to the database - * NULL value instead. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values - */ - export type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray | { toJSON(): unknown } - - /** - * Types of the values used to represent different kinds of `null` values when working with JSON fields. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - namespace NullTypes { - /** - * Type of `Prisma.DbNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.DbNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class DbNull { - private DbNull: never - private constructor() - } - - /** - * Type of `Prisma.JsonNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.JsonNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class JsonNull { - private JsonNull: never - private constructor() - } - - /** - * Type of `Prisma.AnyNull`. - * - * You cannot use other instances of this class. Please use the `Prisma.AnyNull` value. - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - class AnyNull { - private AnyNull: never - private constructor() - } - } - - /** - * Helper for filtering JSON entries that have `null` on the database (empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const DbNull: NullTypes.DbNull - - /** - * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const JsonNull: NullTypes.JsonNull - - /** - * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` - * - * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field - */ - export const AnyNull: NullTypes.AnyNull - - type SelectAndInclude = { - select: any - include: any - } - - type SelectAndOmit = { - select: any - omit: any - } - - /** - * Get the type of the value, that the Promise holds. - */ - export type PromiseType> = T extends PromiseLike ? U : T; - - /** - * Get the return type of a function which returns a Promise. - */ - export type PromiseReturnType $Utils.JsPromise> = PromiseType> - - /** - * From T, pick a set of properties whose keys are in the union K - */ - type Prisma__Pick = { - [P in K]: T[P]; - }; - - - export type Enumerable = T | Array; - - export type RequiredKeys = { - [K in keyof T]-?: {} extends Prisma__Pick ? never : K - }[keyof T] - - export type TruthyKeys = keyof { - [K in keyof T as T[K] extends false | undefined | null ? never : K]: K - } - - export type TrueKeys = TruthyKeys>> - - /** - * Subset - * @desc From `T` pick properties that exist in `U`. Simple version of Intersection - */ - export type Subset = { - [key in keyof T]: key extends keyof U ? T[key] : never; - }; - - /** - * SelectSubset - * @desc From `T` pick properties that exist in `U`. Simple version of Intersection. - * Additionally, it validates, if both select and include are present. If the case, it errors. - */ - export type SelectSubset = { - [key in keyof T]: key extends keyof U ? T[key] : never - } & - (T extends SelectAndInclude - ? 'Please either choose `select` or `include`.' - : T extends SelectAndOmit - ? 'Please either choose `select` or `omit`.' - : {}) - - /** - * Subset + Intersection - * @desc From `T` pick properties that exist in `U` and intersect `K` - */ - export type SubsetIntersection = { - [key in keyof T]: key extends keyof U ? T[key] : never - } & - K - - type Without = { [P in Exclude]?: never }; - - /** - * XOR is needed to have a real mutually exclusive union type - * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types - */ - type XOR = - T extends object ? - U extends object ? - (Without & U) | (Without & T) - : U : T - - - /** - * Is T a Record? - */ - type IsObject = T extends Array - ? False - : T extends Date - ? False - : T extends Uint8Array - ? False - : T extends BigInt - ? False - : T extends object - ? True - : False - - - /** - * If it's T[], return T - */ - export type UnEnumerate = T extends Array ? U : T - - /** - * From ts-toolbelt - */ - - type __Either = Omit & - { - // Merge all but K - [P in K]: Prisma__Pick // With K possibilities - }[K] - - type EitherStrict = Strict<__Either> - - type EitherLoose = ComputeRaw<__Either> - - type _Either< - O extends object, - K extends Key, - strict extends Boolean - > = { - 1: EitherStrict - 0: EitherLoose - }[strict] - - type Either< - O extends object, - K extends Key, - strict extends Boolean = 1 - > = O extends unknown ? _Either : never - - export type Union = any - - type PatchUndefined = { - [K in keyof O]: O[K] extends undefined ? At : O[K] - } & {} - - /** Helper Types for "Merge" **/ - export type IntersectOf = ( - U extends unknown ? (k: U) => void : never - ) extends (k: infer I) => void - ? I - : never - - export type Overwrite = { - [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; - } & {}; - - type _Merge = IntersectOf; - }>>; - - type Key = string | number | symbol; - type AtBasic = K extends keyof O ? O[K] : never; - type AtStrict = O[K & keyof O]; - type AtLoose = O extends unknown ? AtStrict : never; - export type At = { - 1: AtStrict; - 0: AtLoose; - }[strict]; - - export type ComputeRaw = A extends Function ? A : { - [K in keyof A]: A[K]; - } & {}; - - export type OptionalFlat = { - [K in keyof O]?: O[K]; - } & {}; - - type _Record = { - [P in K]: T; - }; - - // cause typescript not to expand types and preserve names - type NoExpand = T extends unknown ? T : never; - - // this type assumes the passed object is entirely optional - type AtLeast = NoExpand< - O extends unknown - ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) - | {[P in keyof O as P extends K ? K : never]-?: O[P]} & O - : never>; - - type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; - - export type Strict = ComputeRaw<_Strict>; - /** End Helper Types for "Merge" **/ - - export type Merge = ComputeRaw<_Merge>>; - - /** - A [[Boolean]] - */ - export type Boolean = True | False - - // /** - // 1 - // */ - export type True = 1 - - /** - 0 - */ - export type False = 0 - - export type Not = { - 0: 1 - 1: 0 - }[B] - - export type Extends = [A1] extends [never] - ? 0 // anything `never` is false - : A1 extends A2 - ? 1 - : 0 - - export type Has = Not< - Extends, U1> - > - - export type Or = { - 0: { - 0: 0 - 1: 1 - } - 1: { - 0: 1 - 1: 1 - } - }[B1][B2] - - export type Keys = U extends unknown ? keyof U : never - - type Cast = A extends B ? A : B; - - export const type: unique symbol; - - - - /** - * Used by group by - */ - - export type GetScalarType = O extends object ? { - [P in keyof T]: P extends keyof O - ? O[P] - : never - } : never - - type FieldPaths< - T, - U = Omit - > = IsObject extends True ? U : T - - type GetHavingFields = { - [K in keyof T]: Or< - Or, Extends<'AND', K>>, - Extends<'NOT', K> - > extends True - ? // infer is only needed to not hit TS limit - // based on the brilliant idea of Pierre-Antoine Mills - // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 - T[K] extends infer TK - ? GetHavingFields extends object ? Merge> : never> - : never - : {} extends FieldPaths - ? never - : K - }[keyof T] - - /** - * Convert tuple to union - */ - type _TupleToUnion = T extends (infer E)[] ? E : never - type TupleToUnion = _TupleToUnion - type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T - - /** - * Like `Pick`, but additionally can also accept an array of keys - */ - type PickEnumerable | keyof T> = Prisma__Pick> - - /** - * Exclude all keys with underscores - */ - type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T - - - export type FieldRef = runtime.FieldRef - - type FieldRefInputType = Model extends never ? never : FieldRef - - - export const ModelName: { - User: 'User' - }; - - export type ModelName = (typeof ModelName)[keyof typeof ModelName] - - - export type Datasources = { - db?: Datasource - } - - - interface TypeMapCb extends $Utils.Fn<{extArgs: $Extensions.InternalArgs}, $Utils.Record> { - returns: Prisma.TypeMap - } - - export type TypeMap = { - meta: { - modelProps: 'user' - txIsolationLevel: Prisma.TransactionIsolationLevel - }, - model: { - User: { - payload: Prisma.$UserPayload - fields: Prisma.UserFieldRefs - operations: { - findUnique: { - args: Prisma.UserFindUniqueArgs, - result: $Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.UserFindUniqueOrThrowArgs, - result: $Utils.PayloadToResult - } - findFirst: { - args: Prisma.UserFindFirstArgs, - result: $Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.UserFindFirstOrThrowArgs, - result: $Utils.PayloadToResult - } - findMany: { - args: Prisma.UserFindManyArgs, - result: $Utils.PayloadToResult[] - } - create: { - args: Prisma.UserCreateArgs, - result: $Utils.PayloadToResult - } - createMany: { - args: Prisma.UserCreateManyArgs, - result: Prisma.BatchPayload - } - createManyAndReturn: { - args: Prisma.UserCreateManyAndReturnArgs, - result: $Utils.PayloadToResult[] - } - delete: { - args: Prisma.UserDeleteArgs, - result: $Utils.PayloadToResult - } - update: { - args: Prisma.UserUpdateArgs, - result: $Utils.PayloadToResult - } - deleteMany: { - args: Prisma.UserDeleteManyArgs, - result: Prisma.BatchPayload - } - updateMany: { - args: Prisma.UserUpdateManyArgs, - result: Prisma.BatchPayload - } - upsert: { - args: Prisma.UserUpsertArgs, - result: $Utils.PayloadToResult - } - aggregate: { - args: Prisma.UserAggregateArgs, - result: $Utils.Optional - } - groupBy: { - args: Prisma.UserGroupByArgs, - result: $Utils.Optional[] - } - count: { - args: Prisma.UserCountArgs, - result: $Utils.Optional | number - } - } - } - } - } & { - other: { - payload: any - operations: { - $executeRawUnsafe: { - args: [query: string, ...values: any[]], - result: any - } - $executeRaw: { - args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], - result: any - } - $queryRawUnsafe: { - args: [query: string, ...values: any[]], - result: any - } - $queryRaw: { - args: [query: TemplateStringsArray | Prisma.Sql, ...values: any[]], - result: any - } - } - } - } - export const defineExtension: $Extensions.ExtendsHook<'define', Prisma.TypeMapCb, $Extensions.DefaultArgs> - export type DefaultPrismaClient = PrismaClient - export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' - export interface PrismaClientOptions { - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasources?: Datasources - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasourceUrl?: string - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat - /** - * @example - * ``` - * // Defaults to stdout - * log: ['query', 'info', 'warn', 'error'] - * - * // Emit as events - * log: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * { emit: 'stdout', level: 'error' } - * ] - * ``` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: (LogLevel | LogDefinition)[] - /** - * The default values for transactionOptions - * maxWait ?= 2000 - * timeout ?= 5000 - */ - transactionOptions?: { - maxWait?: number - timeout?: number - isolationLevel?: Prisma.TransactionIsolationLevel - } - } - - /* Types for Logging */ - export type LogLevel = 'info' | 'query' | 'warn' | 'error' - export type LogDefinition = { - level: LogLevel - emit: 'stdout' | 'event' - } - - export type GetLogType = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never - export type GetEvents = T extends Array ? - GetLogType | GetLogType | GetLogType | GetLogType - : never - - export type QueryEvent = { - timestamp: Date - query: string - params: string - duration: number - target: string - } - - export type LogEvent = { - timestamp: Date - message: string - target: string - } - /* End Types for Logging */ - - - export type PrismaAction = - | 'findUnique' - | 'findUniqueOrThrow' - | 'findMany' - | 'findFirst' - | 'findFirstOrThrow' - | 'create' - | 'createMany' - | 'createManyAndReturn' - | 'update' - | 'updateMany' - | 'upsert' - | 'delete' - | 'deleteMany' - | 'executeRaw' - | 'queryRaw' - | 'aggregate' - | 'count' - | 'runCommandRaw' - | 'findRaw' - | 'groupBy' - - /** - * These options are being passed into the middleware as "params" - */ - export type MiddlewareParams = { - model?: ModelName - action: PrismaAction - args: any - dataPath: string[] - runInTransaction: boolean - } - - /** - * The `T` type makes sure, that the `return proceed` is not forgotten in the middleware implementation - */ - export type Middleware = ( - params: MiddlewareParams, - next: (params: MiddlewareParams) => $Utils.JsPromise, - ) => $Utils.JsPromise - - // tested in getLogLevel.test.ts - export function getLogLevel(log: Array): LogLevel | undefined; - - /** - * `PrismaClient` proxy available in interactive transactions. - */ - export type TransactionClient = Omit - - export type Datasource = { - url?: string - } - - /** - * Count Types - */ - - - - /** - * Models - */ - - /** - * Model User - */ - - export type AggregateUser = { - _count: UserCountAggregateOutputType | null - _avg: UserAvgAggregateOutputType | null - _sum: UserSumAggregateOutputType | null - _min: UserMinAggregateOutputType | null - _max: UserMaxAggregateOutputType | null - } - - export type UserAvgAggregateOutputType = { - id: number | null - } - - export type UserSumAggregateOutputType = { - id: number | null - } - - export type UserMinAggregateOutputType = { - id: number | null - email: string | null - name: string | null - } - - export type UserMaxAggregateOutputType = { - id: number | null - email: string | null - name: string | null - } - - export type UserCountAggregateOutputType = { - id: number - email: number - name: number - _all: number - } - - - export type UserAvgAggregateInputType = { - id?: true - } - - export type UserSumAggregateInputType = { - id?: true - } - - export type UserMinAggregateInputType = { - id?: true - email?: true - name?: true - } - - export type UserMaxAggregateInputType = { - id?: true - email?: true - name?: true - } - - export type UserCountAggregateInputType = { - id?: true - email?: true - name?: true - _all?: true - } - - export type UserAggregateArgs = { - /** - * Filter which User to aggregate. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned Users - **/ - _count?: true | UserCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to average - **/ - _avg?: UserAvgAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to sum - **/ - _sum?: UserSumAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: UserMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: UserMaxAggregateInputType - } - - export type GetUserAggregateType = { - [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : GetScalarType - : GetScalarType - } - - - - - export type UserGroupByArgs = { - where?: UserWhereInput - orderBy?: UserOrderByWithAggregationInput | UserOrderByWithAggregationInput[] - by: UserScalarFieldEnum[] | UserScalarFieldEnum - having?: UserScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: UserCountAggregateInputType | true - _avg?: UserAvgAggregateInputType - _sum?: UserSumAggregateInputType - _min?: UserMinAggregateInputType - _max?: UserMaxAggregateInputType - } - - export type UserGroupByOutputType = { - id: number - email: string - name: string | null - _count: UserCountAggregateOutputType | null - _avg: UserAvgAggregateOutputType | null - _sum: UserSumAggregateOutputType | null - _min: UserMinAggregateOutputType | null - _max: UserMaxAggregateOutputType | null - } - - type GetUserGroupByPayload = Prisma.PrismaPromise< - Array< - PickEnumerable & - { - [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : GetScalarType - : GetScalarType - } - > - > - - - export type UserSelect = $Extensions.GetSelect<{ - id?: boolean - email?: boolean - name?: boolean - }, ExtArgs["result"]["user"]> - - export type UserSelectScalar = { - id?: boolean - email?: boolean - name?: boolean - } - - - - export type $UserPayload = { - name: "User" - objects: {} - scalars: $Extensions.GetPayloadResult<{ - id: number - email: string - name: string | null - }, ExtArgs["result"]["user"]> - composites: {} - } - - - type UserGetPayload = $Result.GetResult - - type UserCountArgs = - Omit & { - select?: UserCountAggregateInputType | true - } - - export interface UserDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } - /** - * Find zero or one User that matches the filter. - * @param {UserFindUniqueArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUnique>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findUnique'> | null, null, ExtArgs> - - /** - * Find one User that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findUniqueOrThrow>( - args?: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findUniqueOrThrow'>, never, ExtArgs> - - /** - * Find the first User that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserFindFirstArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirst>( - args?: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findFirst'> | null, null, ExtArgs> - - /** - * Find the first User that matches the filter or - * throw `PrismaKnownClientError` with `P2025` code if no matches were found. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserFindFirstOrThrowArgs} args - Arguments to find a User - * @example - * // Get one User - * const user = await prisma.user.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - **/ - findFirstOrThrow>( - args?: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'findFirstOrThrow'>, never, ExtArgs> - - /** - * Find zero or more Users that matches the filter. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all Users - * const users = await prisma.user.findMany() - * - * // Get first 10 Users - * const users = await prisma.user.findMany({ take: 10 }) - * - * // Only select the `id` - * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) - * - **/ - findMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise<$Result.GetResult, T, 'findMany'>> - - /** - * Create a User. - * @param {UserCreateArgs} args - Arguments to create a User. - * @example - * // Create one User - * const User = await prisma.user.create({ - * data: { - * // ... data to create a User - * } - * }) - * - **/ - create>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'create'>, never, ExtArgs> - - /** - * Create many Users. - * @param {UserCreateManyArgs} args - Arguments to create many Users. - * @example - * // Create many Users - * const user = await prisma.user.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - **/ - createMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Create many Users and returns the data saved in the database. - * @param {UserCreateManyAndReturnArgs} args - Arguments to create many Users. - * @example - * // Create many Users - * const user = await prisma.user.createManyAndReturn({ - * data: [ - * // ... provide data here - * ] - * }) - * - * // Create many Users and only return the `id` - * const userWithIdOnly = await prisma.user.createManyAndReturn({ - * select: { id: true }, - * data: [ - * // ... provide data here - * ] - * }) - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * - **/ - createManyAndReturn>( - args?: SelectSubset> - ): Prisma.PrismaPromise<$Result.GetResult, T, 'createManyAndReturn'>> - - /** - * Delete a User. - * @param {UserDeleteArgs} args - Arguments to delete one User. - * @example - * // Delete one User - * const User = await prisma.user.delete({ - * where: { - * // ... filter to delete one User - * } - * }) - * - **/ - delete>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'delete'>, never, ExtArgs> - - /** - * Update one User. - * @param {UserUpdateArgs} args - Arguments to update one User. - * @example - * // Update one User - * const user = await prisma.user.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - update>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'update'>, never, ExtArgs> - - /** - * Delete zero or more Users. - * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. - * @example - * // Delete a few Users - * const { count } = await prisma.user.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - **/ - deleteMany>( - args?: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Update zero or more Users. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many Users - * const user = await prisma.user.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - **/ - updateMany>( - args: SelectSubset> - ): Prisma.PrismaPromise - - /** - * Create or update one User. - * @param {UserUpsertArgs} args - Arguments to update or create a User. - * @example - * // Update or create a User - * const user = await prisma.user.upsert({ - * create: { - * // ... data to create a User - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the User we want to update - * } - * }) - **/ - upsert>( - args: SelectSubset> - ): Prisma__UserClient<$Result.GetResult, T, 'upsert'>, never, ExtArgs> - - /** - * Count the number of Users. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserCountArgs} args - Arguments to filter Users to count. - * @example - * // Count the number of Users - * const count = await prisma.user.count({ - * where: { - * // ... the filter for the Users we want to count - * } - * }) - **/ - count( - args?: Subset, - ): Prisma.PrismaPromise< - T extends $Utils.Record<'select', any> - ? T['select'] extends true - ? number - : GetScalarType - : number - > - - /** - * Allows you to perform aggregations operations on a User. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserAggregateArgs} args - Select which aggregations you would like to apply and on what fields. - * @example - * // Ordered by age ascending - * // Where email contains prisma.io - * // Limited to the 10 users - * const aggregations = await prisma.user.aggregate({ - * _avg: { - * age: true, - * }, - * where: { - * email: { - * contains: "prisma.io", - * }, - * }, - * orderBy: { - * age: "asc", - * }, - * take: 10, - * }) - **/ - aggregate(args: Subset): Prisma.PrismaPromise> - - /** - * Group by User. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {UserGroupByArgs} args - Group by arguments. - * @example - * // Group by city, order by createdAt, get count - * const result = await prisma.user.groupBy({ - * by: ['city', 'createdAt'], - * orderBy: { - * createdAt: true - * }, - * _count: { - * _all: true - * }, - * }) - * - **/ - groupBy< - T extends UserGroupByArgs, - HasSelectOrTake extends Or< - Extends<'skip', Keys>, - Extends<'take', Keys> - >, - OrderByArg extends True extends HasSelectOrTake - ? { orderBy: UserGroupByArgs['orderBy'] } - : { orderBy?: UserGroupByArgs['orderBy'] }, - OrderFields extends ExcludeUnderscoreKeys>>, - ByFields extends MaybeTupleToUnion, - ByValid extends Has, - HavingFields extends GetHavingFields, - HavingValid extends Has, - ByEmpty extends T['by'] extends never[] ? True : False, - InputErrors extends ByEmpty extends True - ? `Error: "by" must not be empty.` - : HavingValid extends False - ? { - [P in HavingFields]: P extends ByFields - ? never - : P extends string - ? `Error: Field "${P}" used in "having" needs to be provided in "by".` - : [ - Error, - 'Field ', - P, - ` in "having" needs to be provided in "by"`, - ] - }[HavingFields] - : 'take' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "take", you also need to provide "orderBy"' - : 'skip' extends Keys - ? 'orderBy' extends Keys - ? ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "skip", you also need to provide "orderBy"' - : ByValid extends True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetUserGroupByPayload : Prisma.PrismaPromise - /** - * Fields of the User model - */ - readonly fields: UserFieldRefs; - } - - /** - * The delegate class that acts as a "Promise-like" for User. - * Why is this prefixed with `Prisma__`? - * Because we want to prevent naming conflicts as mentioned in - * https://github.com/prisma/prisma-client-js/issues/707 - */ - export interface Prisma__UserClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: 'PrismaPromise'; - - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): $Utils.JsPromise; - /** - * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The - * resolved value cannot be modified from the callback. - * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). - * @returns A Promise for the completion of the callback. - */ - finally(onfinally?: (() => void) | undefined | null): $Utils.JsPromise; - } - - - - /** - * Fields of the User model - */ - interface UserFieldRefs { - readonly id: FieldRef<"User", 'Int'> - readonly email: FieldRef<"User", 'String'> - readonly name: FieldRef<"User", 'String'> - } - - - // Custom InputTypes - /** - * User findUnique - */ - export type UserFindUniqueArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where: UserWhereUniqueInput - } - - /** - * User findUniqueOrThrow - */ - export type UserFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where: UserWhereUniqueInput - } - - /** - * User findFirst - */ - export type UserFindFirstArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Users. - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Users. - */ - distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] - } - - /** - * User findFirstOrThrow - */ - export type UserFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which User to fetch. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for Users. - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of Users. - */ - distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] - } - - /** - * User findMany - */ - export type UserFindManyArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter, which Users to fetch. - */ - where?: UserWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of Users to fetch. - */ - orderBy?: UserOrderByWithRelationInput | UserOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing Users. - */ - cursor?: UserWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` Users from the position of the cursor. - */ - take?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Skip the first `n` Users. - */ - skip?: number - distinct?: UserScalarFieldEnum | UserScalarFieldEnum[] - } - - /** - * User create - */ - export type UserCreateArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The data needed to create a User. - */ - data: XOR - } - - /** - * User createMany - */ - export type UserCreateManyArgs = { - /** - * The data used to create many Users. - */ - data: UserCreateManyInput | UserCreateManyInput[] - } - - /** - * User createManyAndReturn - */ - export type UserCreateManyAndReturnArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The data used to create many Users. - */ - data: UserCreateManyInput | UserCreateManyInput[] - } - - /** - * User update - */ - export type UserUpdateArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The data needed to update a User. - */ - data: XOR - /** - * Choose, which User to update. - */ - where: UserWhereUniqueInput - } - - /** - * User updateMany - */ - export type UserUpdateManyArgs = { - /** - * The data used to update Users. - */ - data: XOR - /** - * Filter which Users to update - */ - where?: UserWhereInput - } - - /** - * User upsert - */ - export type UserUpsertArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * The filter to search for the User to update in case it exists. - */ - where: UserWhereUniqueInput - /** - * In case the User found by the `where` argument doesn't exist, create a new User with this data. - */ - create: XOR - /** - * In case the User was found with the provided `where` argument, update it with this data. - */ - update: XOR - } - - /** - * User delete - */ - export type UserDeleteArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - /** - * Filter which User to delete. - */ - where: UserWhereUniqueInput - } - - /** - * User deleteMany - */ - export type UserDeleteManyArgs = { - /** - * Filter which Users to delete - */ - where?: UserWhereInput - } - - /** - * User without action - */ - export type UserDefaultArgs = { - /** - * Select specific fields to fetch from the User - */ - select?: UserSelect | null - } - - - /** - * Enums - */ - - export const TransactionIsolationLevel: { - Serializable: 'Serializable' - }; - - export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] - - - export const UserScalarFieldEnum: { - id: 'id', - email: 'email', - name: 'name' - }; - - export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] - - - export const SortOrder: { - asc: 'asc', - desc: 'desc' - }; - - export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] - - - export const NullsOrder: { - first: 'first', - last: 'last' - }; - - export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] - - - /** - * Field references - */ - - - /** - * Reference to a field of type 'Int' - */ - export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> - - - - /** - * Reference to a field of type 'String' - */ - export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> - - - - /** - * Reference to a field of type 'Float' - */ - export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> - - /** - * Deep Input Types - */ - - - export type UserWhereInput = { - AND?: UserWhereInput | UserWhereInput[] - OR?: UserWhereInput[] - NOT?: UserWhereInput | UserWhereInput[] - id?: IntFilter<"User"> | number - email?: StringFilter<"User"> | string - name?: StringNullableFilter<"User"> | string | null - } - - export type UserOrderByWithRelationInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrderInput | SortOrder - } - - export type UserWhereUniqueInput = Prisma.AtLeast<{ - id?: number - email?: string - AND?: UserWhereInput | UserWhereInput[] - OR?: UserWhereInput[] - NOT?: UserWhereInput | UserWhereInput[] - name?: StringNullableFilter<"User"> | string | null - }, "id" | "email"> - - export type UserOrderByWithAggregationInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrderInput | SortOrder - _count?: UserCountOrderByAggregateInput - _avg?: UserAvgOrderByAggregateInput - _max?: UserMaxOrderByAggregateInput - _min?: UserMinOrderByAggregateInput - _sum?: UserSumOrderByAggregateInput - } - - export type UserScalarWhereWithAggregatesInput = { - AND?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[] - OR?: UserScalarWhereWithAggregatesInput[] - NOT?: UserScalarWhereWithAggregatesInput | UserScalarWhereWithAggregatesInput[] - id?: IntWithAggregatesFilter<"User"> | number - email?: StringWithAggregatesFilter<"User"> | string - name?: StringNullableWithAggregatesFilter<"User"> | string | null - } - - export type UserCreateInput = { - email: string - name?: string | null - } - - export type UserUncheckedCreateInput = { - id?: number - email: string - name?: string | null - } - - export type UserUpdateInput = { - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type UserUncheckedUpdateInput = { - id?: IntFieldUpdateOperationsInput | number - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type UserCreateManyInput = { - id?: number - email: string - name?: string | null - } - - export type UserUpdateManyMutationInput = { - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type UserUncheckedUpdateManyInput = { - id?: IntFieldUpdateOperationsInput | number - email?: StringFieldUpdateOperationsInput | string - name?: NullableStringFieldUpdateOperationsInput | string | null - } - - export type IntFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntFilter<$PrismaModel> | number - } - - export type StringFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringFilter<$PrismaModel> | string - } - - export type StringNullableFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringNullableFilter<$PrismaModel> | string | null - } - - export type SortOrderInput = { - sort: SortOrder - nulls?: NullsOrder - } - - export type UserCountOrderByAggregateInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrder - } - - export type UserAvgOrderByAggregateInput = { - id?: SortOrder - } - - export type UserMaxOrderByAggregateInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrder - } - - export type UserMinOrderByAggregateInput = { - id?: SortOrder - email?: SortOrder - name?: SortOrder - } - - export type UserSumOrderByAggregateInput = { - id?: SortOrder - } - - export type IntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: NestedIntFilter<$PrismaModel> - _avg?: NestedFloatFilter<$PrismaModel> - _sum?: NestedIntFilter<$PrismaModel> - _min?: NestedIntFilter<$PrismaModel> - _max?: NestedIntFilter<$PrismaModel> - } - - export type StringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedStringFilter<$PrismaModel> - _max?: NestedStringFilter<$PrismaModel> - } - - export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null - _count?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedStringNullableFilter<$PrismaModel> - _max?: NestedStringNullableFilter<$PrismaModel> - } - - export type StringFieldUpdateOperationsInput = { - set?: string - } - - export type NullableStringFieldUpdateOperationsInput = { - set?: string | null - } - - export type IntFieldUpdateOperationsInput = { - set?: number - increment?: number - decrement?: number - multiply?: number - divide?: number - } - - export type NestedIntFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntFilter<$PrismaModel> | number - } - - export type NestedStringFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringFilter<$PrismaModel> | string - } - - export type NestedStringNullableFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringNullableFilter<$PrismaModel> | string | null - } - - export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: NestedIntFilter<$PrismaModel> - _avg?: NestedFloatFilter<$PrismaModel> - _sum?: NestedIntFilter<$PrismaModel> - _min?: NestedIntFilter<$PrismaModel> - _max?: NestedIntFilter<$PrismaModel> - } - - export type NestedFloatFilter<$PrismaModel = never> = { - equals?: number | FloatFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | FloatFieldRefInput<$PrismaModel> - lte?: number | FloatFieldRefInput<$PrismaModel> - gt?: number | FloatFieldRefInput<$PrismaModel> - gte?: number | FloatFieldRefInput<$PrismaModel> - not?: NestedFloatFilter<$PrismaModel> | number - } - - export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: NestedIntFilter<$PrismaModel> - _min?: NestedStringFilter<$PrismaModel> - _max?: NestedStringFilter<$PrismaModel> - } - - export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | StringFieldRefInput<$PrismaModel> - lte?: string | StringFieldRefInput<$PrismaModel> - gt?: string | StringFieldRefInput<$PrismaModel> - gte?: string | StringFieldRefInput<$PrismaModel> - contains?: string | StringFieldRefInput<$PrismaModel> - startsWith?: string | StringFieldRefInput<$PrismaModel> - endsWith?: string | StringFieldRefInput<$PrismaModel> - not?: NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null - _count?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedStringNullableFilter<$PrismaModel> - _max?: NestedStringNullableFilter<$PrismaModel> - } - - export type NestedIntNullableFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntNullableFilter<$PrismaModel> | number | null - } - - - - /** - * Aliases for legacy arg types - */ - /** - * @deprecated Use UserDefaultArgs instead - */ - export type UserArgs = UserDefaultArgs - - /** - * Batch Payload for updateMany & deleteMany & createMany - */ - - export type BatchPayload = { - count: number - } - - /** - * DMMF - */ - export const dmmf: runtime.BaseDMMF -} \ No newline at end of file diff --git a/integration-tests/tests/prisma/sqlite/client/index.js b/integration-tests/tests/prisma/sqlite/client/index.js deleted file mode 100644 index c9a573a53..000000000 --- a/integration-tests/tests/prisma/sqlite/client/index.js +++ /dev/null @@ -1,197 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - PrismaClientKnownRequestError, - PrismaClientUnknownRequestError, - PrismaClientRustPanicError, - PrismaClientInitializationError, - PrismaClientValidationError, - NotFoundError, - getPrismaClient, - sqltag, - empty, - join, - raw, - Decimal, - Debug, - objectEnumValues, - makeStrictEnum, - Extensions, - warnOnce, - defineDmmfProperty, - Public, - getRuntime -} = require('./runtime/library.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError; -Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError -Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError -Prisma.PrismaClientInitializationError = PrismaClientInitializationError -Prisma.PrismaClientValidationError = PrismaClientValidationError -Prisma.NotFoundError = NotFoundError -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = sqltag -Prisma.empty = empty -Prisma.join = join -Prisma.raw = raw -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = Extensions.getExtensionContext -Prisma.defineExtension = Extensions.defineExtension - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - - - const path = require('path') - -/** - * Enums - */ -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; -/** - * Create the Client - */ -const config = { - "generator": { - "name": "client", - "provider": { - "fromEnvVar": null, - "value": "prisma-client-js" - }, - "output": { - "value": "/home/prodrigues/Desktop/summer-hackathon-s2-drizzle-orm/integration-tests/tests/prisma/sqlite/client", - "fromEnvVar": null - }, - "config": { - "engineType": "library" - }, - "binaryTargets": [ - { - "fromEnvVar": null, - "value": "debian-openssl-3.0.x", - "native": true - } - ], - "previewFeatures": [], - "isCustomOutput": true - }, - "relativeEnvPaths": { - "rootEnvPath": null - }, - "relativePath": "..", - "clientVersion": "5.14.0", - "engineVersion": "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48", - "datasourceNames": [ - "db" - ], - "activeProvider": "sqlite", - "postinstall": false, - "inlineDatasources": { - "db": { - "url": { - "fromEnvVar": null, - "value": "file:./db.sqlite" - } - } - }, - "inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n output = \"./client\"\n}\n\ngenerator drizzle {\n provider = \"drizzle-prisma-generator\"\n output = \"./drizzle\"\n}\n\ndatasource db {\n provider = \"sqlite\"\n url = \"file:./db.sqlite\"\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n}\n", - "inlineSchemaHash": "27cd479fd1b89d536091428b8dcabf555138189cc583a755f0fe1c575abc3e80", - "copyEngine": true -} - -const fs = require('fs') - -config.dirname = __dirname -if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { - const alternativePaths = [ - "tests/prisma/sqlite/client", - "prisma/sqlite/client", - ] - - const alternativePath = alternativePaths.find((altPath) => { - return fs.existsSync(path.join(process.cwd(), altPath, 'schema.prisma')) - }) ?? alternativePaths[0] - - config.dirname = path.join(process.cwd(), alternativePath) - config.isBundled = true -} - -config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") -defineDmmfProperty(exports.Prisma, config.runtimeDataModel) -config.engineWasm = undefined - - -const { warnEnvConflicts } = require('./runtime/library.js') - -warnEnvConflicts({ - rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath), - schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath) -}) - -const PrismaClient = getPrismaClient(config) -exports.PrismaClient = PrismaClient -Object.assign(exports, Prisma) - -// file annotations for bundling tools to include these files -path.join(__dirname, "libquery_engine-debian-openssl-3.0.x.so.node"); -path.join(process.cwd(), "tests/prisma/sqlite/client/libquery_engine-debian-openssl-3.0.x.so.node") -// file annotations for bundling tools to include these files -path.join(__dirname, "schema.prisma"); -path.join(process.cwd(), "tests/prisma/sqlite/client/schema.prisma") diff --git a/integration-tests/tests/prisma/sqlite/client/libquery_engine-debian-openssl-3.0.x.so.node b/integration-tests/tests/prisma/sqlite/client/libquery_engine-debian-openssl-3.0.x.so.node deleted file mode 100755 index ed0a5448d..000000000 Binary files a/integration-tests/tests/prisma/sqlite/client/libquery_engine-debian-openssl-3.0.x.so.node and /dev/null differ diff --git a/integration-tests/tests/prisma/sqlite/client/package.json b/integration-tests/tests/prisma/sqlite/client/package.json deleted file mode 100644 index 5d086fb13..000000000 --- a/integration-tests/tests/prisma/sqlite/client/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "name": "prisma-client-b0f0c2026deac30b0d8180ccd508d8dd87aaaf6ae01c82c9839a4d5fd0698c1d", - "main": "index.js", - "types": "index.d.ts", - "browser": "index-browser.js", - "exports": { - "./package.json": "./package.json", - ".": { - "require": { - "node": "./index.js", - "edge-light": "./wasm.js", - "workerd": "./wasm.js", - "worker": "./wasm.js", - "browser": "./index-browser.js", - "default": "./index.js" - }, - "import": { - "node": "./index.js", - "edge-light": "./wasm.js", - "workerd": "./wasm.js", - "worker": "./wasm.js", - "browser": "./index-browser.js", - "default": "./index.js" - }, - "default": "./index.js" - }, - "./edge": { - "types": "./edge.d.ts", - "require": "./edge.js", - "import": "./edge.js", - "default": "./edge.js" - }, - "./react-native": { - "types": "./react-native.d.ts", - "require": "./react-native.js", - "import": "./react-native.js", - "default": "./react-native.js" - }, - "./extension": { - "types": "./extension.d.ts", - "require": "./extension.js", - "import": "./extension.js", - "default": "./extension.js" - }, - "./index-browser": { - "types": "./index.d.ts", - "require": "./index-browser.js", - "import": "./index-browser.js", - "default": "./index-browser.js" - }, - "./index": { - "types": "./index.d.ts", - "require": "./index.js", - "import": "./index.js", - "default": "./index.js" - }, - "./wasm": { - "types": "./wasm.d.ts", - "require": "./wasm.js", - "import": "./wasm.js", - "default": "./wasm.js" - }, - "./runtime/library": { - "types": "./runtime/library.d.ts", - "require": "./runtime/library.js", - "import": "./runtime/library.js", - "default": "./runtime/library.js" - }, - "./runtime/binary": { - "types": "./runtime/binary.d.ts", - "require": "./runtime/binary.js", - "import": "./runtime/binary.js", - "default": "./runtime/binary.js" - }, - "./generator-build": { - "require": "./generator-build/index.js", - "import": "./generator-build/index.js", - "default": "./generator-build/index.js" - }, - "./*": "./*" - }, - "version": "5.14.0", - "sideEffects": false -} \ No newline at end of file diff --git a/integration-tests/tests/prisma/sqlite/client/runtime/edge-esm.js b/integration-tests/tests/prisma/sqlite/client/runtime/edge-esm.js deleted file mode 100644 index e9adb8e66..000000000 --- a/integration-tests/tests/prisma/sqlite/client/runtime/edge-esm.js +++ /dev/null @@ -1,28 +0,0 @@ -var ia=Object.create;var rr=Object.defineProperty;var oa=Object.getOwnPropertyDescriptor;var sa=Object.getOwnPropertyNames;var aa=Object.getPrototypeOf,ua=Object.prototype.hasOwnProperty;var Pt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nr=(e,t)=>{for(var r in t)rr(e,r,{get:t[r],enumerable:!0})},Qn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of sa(t))!ua.call(e,i)&&i!==r&&rr(e,i,{get:()=>t[i],enumerable:!(n=oa(t,i))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?ia(aa(e)):{},Qn(t||!e||!e.__esModule?rr(r,"default",{value:e,enumerable:!0}):r,e)),Gn=e=>Qn(rr({},"__esModule",{value:!0}),e);var y,c=Ee(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var Hn,b,p=Ee(()=>{"use strict";b=(Hn=globalThis.performance)!=null?Hn:(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,f=Ee(()=>{"use strict";E=()=>{};E.prototype=E});var m=Ee(()=>{"use strict"});var fi=Ae(rt=>{"use strict";d();c();p();f();m();var Zn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),la=Zn(e=>{"use strict";e.byteLength=u,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var D=C.indexOf("=");D===-1&&(D=A);var O=D===A?0:4-D%4;return[D,O]}function u(C){var A=a(C),D=A[0],O=A[1];return(D+O)*3/4-O}function l(C,A,D){return(A+D)*3/4-D}function g(C){var A,D=a(C),O=D[0],B=D[1],M=new n(l(C,O,B)),I=0,Z=B>0?O-4:O,L;for(L=0;L>16&255,M[I++]=A>>8&255,M[I++]=A&255;return B===2&&(A=r[C.charCodeAt(L)]<<2|r[C.charCodeAt(L+1)]>>4,M[I++]=A&255),B===1&&(A=r[C.charCodeAt(L)]<<10|r[C.charCodeAt(L+1)]<<4|r[C.charCodeAt(L+2)]>>2,M[I++]=A>>8&255,M[I++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function x(C,A,D){for(var O,B=[],M=A;MZ?Z:I+M));return O===1?(A=C[D-1],B.push(t[A>>2]+t[A<<4&63]+"==")):O===2&&(A=(C[D-2]<<8)+C[D-1],B.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),B.join("")}}),ca=Zn(e=>{e.read=function(t,r,n,i,o){var s,a,u=o*8-i-1,l=(1<>1,h=-7,x=n?o-1:0,S=n?-1:1,C=t[r+x];for(x+=S,s=C&(1<<-h)-1,C>>=-h,h+=u;h>0;s=s*256+t[r+x],x+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+x],x+=S,h-=8);if(s===0)s=1-g;else{if(s===l)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,u,l,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,D=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+x>=1?r+=S/l:r+=S*Math.pow(2,1-x),r*l>=2&&(a++,l/=2),a+x>=h?(u=0,a=h):a+x>=1?(u=(r*l-1)*Math.pow(2,o),a=a+x):(u=r*Math.pow(2,x-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=u&255,C+=A,u/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=D*128}}),Qr=la(),et=ca(),Wn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rt.Buffer=T;rt.SlowBuffer=ha;rt.INSPECT_MAX_BYTES=50;var ir=2147483647;rt.kMaxLength=ir;T.TYPED_ARRAY_SUPPORT=pa();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function pa(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function be(e){if(e>ir)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Wr(e)}return Xn(e,t,r)}T.poolSize=8192;function Xn(e,t,r){if(typeof e=="string")return ma(e,t);if(ArrayBuffer.isView(e))return da(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(me(e,ArrayBuffer)||e&&me(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(e,SharedArrayBuffer)||e&&me(e.buffer,SharedArrayBuffer)))return ti(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=ga(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return Xn(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function ei(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function fa(e,t,r){return ei(e),e<=0?be(e):t!==void 0?typeof r=="string"?be(e).fill(t,r):be(e).fill(t):be(e)}T.alloc=function(e,t,r){return fa(e,t,r)};function Wr(e){return ei(e),be(e<0?0:Kr(e)|0)}T.allocUnsafe=function(e){return Wr(e)};T.allocUnsafeSlow=function(e){return Wr(e)};function ma(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=ri(e,t)|0,n=be(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Gr(e){let t=e.length<0?0:Kr(e.length)|0,r=be(t);for(let n=0;n=ir)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ir.toString(16)+" bytes");return e|0}function ha(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),me(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function ri(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||me(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Hr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return pi(e).length;default:if(i)return n?-1:Hr(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=ri;function ya(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ra(this,t,r);case"utf8":case"utf-8":return ii(this,t,r);case"ascii":return Ca(this,t,r);case"latin1":case"binary":return Aa(this,t,r);case"base64":return va(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sa(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Ve(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Wn&&(T.prototype[Wn]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Yr(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:Kn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Kn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Kn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function u(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let l;if(i){let g=-1;for(l=r;ls&&(r=s-a),l=r;l>=0;l--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return wa(this,e,t,r);case"utf8":case"utf-8":return Ea(this,e,t,r);case"ascii":case"latin1":case"binary":return ba(this,e,t,r);case"base64":return xa(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pa(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function va(e,t,r){return t===0&&r===e.length?Qr.fromByteArray(e):Qr.fromByteArray(e.slice(t,r))}function ii(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let u,l,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(s=h));break;case 3:u=e[i+1],l=e[i+2],(u&192)===128&&(l&192)===128&&(h=(o&15)<<12|(u&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:u=e[i+1],l=e[i+2],g=e[i+3],(u&192)===128&&(l&192)===128&&(g&192)===128&&(h=(o&15)<<18|(u&63)<<12|(l&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ta(n)}var zn=4096;function Ta(e){let t=e.length;if(t<=zn)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Re(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Re(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&vt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),et.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),et.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!1,52,8)};function ie(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function oi(e,t,r,n,i){ci(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function si(e,t,r,n,i){ci(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=Re(function(e,t=0){return oi(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Re(function(e,t=0){return si(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=Re(function(e,t=0){return oi(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Re(function(e,t=0){return si(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ai(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ui(e,t,r,n,i){return t=+t,r=r>>>0,i||ai(e,t,r,4,34028234663852886e22,-34028234663852886e22),et.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return ui(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return ui(this,e,t,!1,r)};function li(e,t,r,n,i){return t=+t,r=r>>>0,i||ai(e,t,r,8,17976931348623157e292,-17976931348623157e292),et.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return li(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return li(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=Yn(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Yn(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Yn(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Ia(e,t,r){tt(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&vt(t,e.length-(r+1))}function ci(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Xe.ERR_OUT_OF_RANGE("value",a,e)}Ia(n,i,o)}function tt(e,t){if(typeof e!="number")throw new Xe.ERR_INVALID_ARG_TYPE(t,"number",e)}function vt(e,t,r){throw Math.floor(e)!==e?(tt(e,r),new Xe.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Xe.ERR_BUFFER_OUT_OF_BOUNDS:new Xe.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var ka=/[^+/0-9A-Za-z-_]/g;function Da(e){if(e=e.split("=")[0],e=e.trim().replace(ka,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Hr(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Oa(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function pi(e){return Qr.toByteArray(Da(e))}function or(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function me(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Yr(e){return e!==e}var Na=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Re(e){return typeof BigInt>"u"?_a:e}function _a(){throw new Error("BigInt not supported")}});var w,d=Ee(()=>{"use strict";w=Ue(fi())});function Fa(){return!1}var La,Ba,wi,Ei=Ee(()=>{"use strict";d();c();p();f();m();La={},Ba={existsSync:Fa,promises:La},wi=Ba});var Di=Ae((df,ki)=>{"use strict";d();c();p();f();m();ki.exports=(en(),Gn(Xr)).format});var Xr={};nr(Xr,{default:()=>Ua,deprecate:()=>Mi,format:()=>_i,inspect:()=>Ni,promisify:()=>Oi});function Oi(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function Mi(e,t){return(...r)=>(console.warn(t),e(...r))}function Ni(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var _i,qa,Ua,en=Ee(()=>{"use strict";d();c();p();f();m();_i=Di(),qa={promisify:Oi,deprecate:Mi,inspect:Ni,format:_i},Ua=qa});function Ga(...e){return e.join("/")}function Ha(...e){return e.join("/")}var ji,Wa,Ka,Ct,Ji=Ee(()=>{"use strict";d();c();p();f();m();ji="/",Wa={sep:ji},Ka={resolve:Ga,posix:Wa,join:Ha,sep:ji},Ct=Ka});var lr,Gi=Ee(()=>{"use strict";d();c();p();f();m();lr=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var Wi=Ae((bm,Hi)=>{"use strict";d();c();p();f();m();Hi.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 Yi=Ae((Om,zi)=>{"use strict";d();c();p();f();m();zi.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 Xi=Ae((Bm,Zi)=>{"use strict";d();c();p();f();m();var tu=Yi();Zi.exports=e=>typeof e=="string"?e.replace(tu(),""):e});var ro=Ae((Nh,su)=>{su.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var no=Ae(()=>{"use strict";d();c();p();f();m()});var Fn=Ae((l2,gs)=>{"use strict";d();c();p();f();m();gs.exports=function(){function e(t,r,n,i,o){return tn?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;smi,getExtensionContext:()=>di});d();c();p();f();m();d();c();p();f();m();function mi(e){return typeof e=="function"?e:t=>t.$extends(e)}d();c();p();f();m();function di(e){return e}var yi={};nr(yi,{validator:()=>hi});d();c();p();f();m();d();c();p();f();m();function hi(...e){return t=>t}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Zr,bi,xi,Pi,vi=!0;typeof y!="undefined"&&({FORCE_COLOR:Zr,NODE_DISABLE_COLORS:bi,NO_COLOR:xi,TERM:Pi}=y.env||{},vi=y.stdout&&y.stdout.isTTY);var $a={enabled:!bi&&xi==null&&Pi!=="dumb"&&(Zr!=null&&Zr!=="0"||vi)};function V(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!$a.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Jp=V(0,0),sr=V(1,22),ar=V(2,22),Qp=V(3,23),Ti=V(4,24),Gp=V(7,27),Hp=V(8,28),Wp=V(9,29),Kp=V(30,39),nt=V(31,39),Ci=V(32,39),Ai=V(33,39),Ri=V(34,39),zp=V(35,39),Si=V(36,39),Yp=V(37,39),Ii=V(90,39),Zp=V(90,39),Xp=V(40,49),ef=V(41,49),tf=V(42,49),rf=V(43,49),nf=V(44,49),of=V(45,49),sf=V(46,49),af=V(47,49);d();c();p();f();m();var Va=100,Fi=["green","yellow","blue","magenta","cyan","red"],ur=[],Li=Date.now(),ja=0,tn=typeof y!="undefined"?y.env:{},Bi,$i;($i=globalThis.DEBUG)!=null||(globalThis.DEBUG=(Bi=tn.DEBUG)!=null?Bi:"");var qi;(qi=globalThis.DEBUG_COLORS)!=null||(globalThis.DEBUG_COLORS=tn.DEBUG_COLORS?tn.DEBUG_COLORS==="true":!0);var Tt={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)=>{var o;let[t,r,...n]=e,i;typeof Pt=="function"&&typeof y!="undefined"&&typeof y.stderr!="undefined"&&typeof y.stderr.write=="function"?i=(...s)=>{var a;try{let u=(en(),Gn(Xr));y.stderr.write(u.format(...s)+` -`)}catch(u){i=(a=console.warn)!=null?a:console.log}}:i=(o=console.warn)!=null?o:console.log,i(`${t} ${r}`,...n)},formatters:{}};function Ja(e){let t={color:Fi[ja++%Fi.length],enabled:Tt.enabled(e),namespace:e,log:Tt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&ur.push([o,...n]),ur.length>Va&&ur.shift(),Tt.enabled(o)||i){let u=n.map(g=>typeof g=="string"?g:Qa(g)),l=`+${Date.now()-Li}ms`;Li=Date.now(),a(o,...u,l)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Ui=new Proxy(Ja,{get:(e,t)=>Tt[t],set:(e,t,r)=>Tt[t]=r});function Qa(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function Vi(){ur.length=0}var re=Ui;d();c();p();f();m();d();c();p();f();m();var Qi="library";function At(e){let t=za();return t||((e==null?void 0:e.config.engineType)==="library"?"library":(e==null?void 0:e.config.engineType)==="binary"?"binary":Qi)}function za(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}d();c();p();f();m();d();c();p();f();m();var Se;(t=>{let e;(I=>(I.findUnique="findUnique",I.findUniqueOrThrow="findUniqueOrThrow",I.findFirst="findFirst",I.findFirstOrThrow="findFirstOrThrow",I.findMany="findMany",I.create="create",I.createMany="createMany",I.createManyAndReturn="createManyAndReturn",I.update="update",I.updateMany="updateMany",I.upsert="upsert",I.delete="delete",I.deleteMany="deleteMany",I.groupBy="groupBy",I.count="count",I.aggregate="aggregate",I.findRaw="findRaw",I.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(Se||(Se={}));var it={};nr(it,{error:()=>Xa,info:()=>Za,log:()=>Ya,query:()=>eu,should:()=>Ki,tags:()=>Rt,warn:()=>rn});d();c();p();f();m();var Rt={error:nt("prisma:error"),warn:Ai("prisma:warn"),info:Si("prisma:info"),query:Ri("prisma:query")},Ki={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function Ya(...e){console.log(...e)}function rn(e,...t){Ki.warn()&&console.warn(`${Rt.warn} ${e}`,...t)}function Za(e,...t){console.info(`${Rt.info} ${e}`,...t)}function Xa(e,...t){console.error(`${Rt.error} ${e}`,...t)}function eu(e,...t){console.log(`${Rt.query} ${e}`,...t)}d();c();p();f();m();function je(e,t){throw new Error(t)}d();c();p();f();m();function nn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}d();c();p();f();m();var on=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});d();c();p();f();m();function ot(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}d();c();p();f();m();function sn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{eo.has(e)||(eo.add(e),rn(t,...r))};d();c();p();f();m();var z=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};_(z,"PrismaClientKnownRequestError");var Ie=class extends z{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};_(Ie,"NotFoundError");d();c();p();f();m();var G=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};_(G,"PrismaClientInitializationError");d();c();p();f();m();var ke=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};_(ke,"PrismaClientRustPanicError");d();c();p();f();m();var ae=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};_(ae,"PrismaClientUnknownRequestError");d();c();p();f();m();var ee=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};_(ee,"PrismaClientValidationError");d();c();p();f();m();var St=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};d();c();p();f();m();d();c();p();f();m();function It(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function ru(e,t){let r=It(()=>nu(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function nu(e){return{datamodel:{models:an(e.models),enums:an(e.enums),types:an(e.types)}}}function an(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}d();c();p();f();m();var pr=Symbol(),un=new WeakMap,xe=class{constructor(t){t===pr?un.set(this,`Prisma.${this._getName()}`):un.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return un.get(this)}},kt=class extends xe{_getNamespace(){return"NullTypes"}},Dt=class extends kt{};cn(Dt,"DbNull");var Ot=class extends kt{};cn(Ot,"JsonNull");var Mt=class extends kt{};cn(Mt,"AnyNull");var ln={classes:{DbNull:Dt,JsonNull:Ot,AnyNull:Mt},instances:{DbNull:new Dt(pr),JsonNull:new Ot(pr),AnyNull:new Mt(pr)}};function cn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function Nt(e){return{ok:!1,error:e,map(){return Nt(e)},flatMap(){return Nt(e)}}}var pn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},fn=e=>{let t=new pn,r=Je(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Je(t,e.queryRaw.bind(e)),executeRaw:Je(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>iu(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=ou(t,e.getConnectionInfo.bind(e))),n},iu=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Je(e,t.queryRaw.bind(t)),executeRaw:Je(e,t.executeRaw.bind(t)),commit:Je(e,t.commit.bind(t)),rollback:Je(e,t.rollback.bind(t))});function Je(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return Nt({kind:"GenericJs",id:i})}}}function ou(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return Nt({kind:"GenericJs",id:i})}}}var na=Ue(ro());var yD=Ue(no());Gi();Ei();Ji();d();c();p();f();m();var ue=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){var n;return(n=e.getPropertyDescriptor)==null?void 0:n.call(e,r)}}}d();c();p();f();m();d();c();p();f();m();var fr={enumerable:!0,configurable:!0,writable:!0};function mr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>fr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var so=Symbol.for("nodejs.util.inspect.custom");function ge(e,t){let r=lu(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){var u,l;if(n.has(s))return!0;let a=r.get(s);return a?(l=(u=a.has)==null?void 0:u.call(a,s))!=null?l:!0:Reflect.has(o,s)},ownKeys(o){let s=ao(Reflect.ownKeys(o),r),a=ao(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){var l,g;let u=r.get(s);return((g=(l=u==null?void 0:u.getPropertyDescriptor)==null?void 0:l.call(u,s))==null?void 0:g.writable)===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let u=r.get(s);return u?u.getPropertyDescriptor?{...fr,...u==null?void 0:u.getPropertyDescriptor(s)}:fr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[so]=function(){let o={...this};return delete o[so],o},i}function lu(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function ao(e,t){return e.filter(r=>{var i,o;let n=t.get(r);return(o=(i=n==null?void 0:n.has)==null?void 0:i.call(n,r))!=null?o:!0})}d();c();p();f();m();function st(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}d();c();p();f();m();function dr(e,t){return{batch:e,transaction:(t==null?void 0:t.kind)==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}d();c();p();f();m();d();c();p();f();m();var at=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};d();c();p();f();m();d();c();p();f();m();function uo(e){return e.substring(0,1).toLowerCase()+e.substring(1)}d();c();p();f();m();function ut(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function gr(e){return e.toString()!=="Invalid Date"}d();c();p();f();m();d();c();p();f();m();var lt=9e15,Ne=1e9,mn="0123456789abcdef",yr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",wr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",dn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-lt,maxE:lt,crypto:!1},fo,Pe,F=!0,br="[DecimalError] ",Me=br+"Invalid argument: ",mo=br+"Precision limit exceeded",go=br+"crypto unavailable",ho="[object Decimal]",te=Math.floor,H=Math.pow,cu=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,pu=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,fu=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,yo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,pe=1e7,N=7,mu=9007199254740991,du=yr.length-1,gn=wr.length-1,R={toStringTag:ho};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)};R.ceil=function(){return k(new this.constructor(this),this.e+1,2)};R.clampedTo=R.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Me+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,u=o.s,l=e.s;if(!s||!a)return!u||!l?NaN:u!==l?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};R.cosine=R.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=gu(n,Po(n,r)),n.precision=e,n.rounding=t,k(Pe==2||Pe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};R.cubeRoot=R.cbrt=function(){var e,t,r,n,i,o,s,a,u,l,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(F=!1,o=g.s*H(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Y(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=H(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,u=a.times(a).times(a),l=u.plus(g),n=q(l.plus(g).times(a),l.plus(u),s+2,1),Y(a.d).slice(0,s)===(r=Y(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(k(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(k(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return F=!0,k(n,e,h.rounding,t)};R.decimalPlaces=R.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/N))*N,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};R.dividedBy=R.div=function(e){return q(this,new this.constructor(e))};R.dividedToIntegerBy=R.divToInt=function(e){var t=this,r=t.constructor;return k(q(t,new r(e),0,1,1),r.precision,r.rounding)};R.equals=R.eq=function(e){return this.cmp(e)===0};R.floor=function(){return k(new this.constructor(this),this.e+1,3)};R.greaterThan=R.gt=function(e){return this.cmp(e)>0};R.greaterThanOrEqualTo=R.gte=function(e){var t=this.cmp(e);return t==1||t===0};R.hyperbolicCosine=R.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Pr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=ct(s,1,o.times(t),new s(1),!0);for(var u,l=e,g=new s(8);l--;)u=o.times(o),o=a.minus(u.times(g.minus(u.times(g))));return k(o,s.precision=r,s.rounding=n,!0)};R.hyperbolicSine=R.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=ct(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Pr(5,e)),i=ct(o,2,i,i,!0);for(var s,a=new o(5),u=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(l))))}return o.precision=t,o.rounding=r,k(i,t,r,!0)};R.hyperbolicTangent=R.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,q(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};R.inverseCosine=R.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ce(r,i,o):new r(0):new r(NaN):t.isZero()?ce(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ce(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};R.inverseHyperbolicCosine=R.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,F=!1,r=r.times(r).minus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};R.inverseHyperbolicSine=R.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,F=!1,r=r.times(r).plus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln())};R.inverseHyperbolicTangent=R.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?k(new o(i),e,t,!0):(o.precision=r=n-i.e,i=q(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};R.inverseSine=R.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ce(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};R.inverseTangent=R.atan=function(){var e,t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding;if(l.isFinite()){if(l.isZero())return new g(l);if(l.abs().eq(1)&&h+4<=gn)return s=ce(g,h+4,x).times(.25),s.s=l.s,s}else{if(!l.s)return new g(NaN);if(h+4<=gn)return s=ce(g,h+4,x).times(.5),s.s=l.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/N+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(F=!1,t=Math.ceil(a/N),n=1,u=l.times(l),s=new g(l),i=l;e!==-1;)if(i=i.times(u),o=s.minus(i.div(n+=2)),i=i.times(u),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};R.isNaN=function(){return!this.s};R.isNegative=R.isNeg=function(){return this.s<0};R.isPositive=R.isPos=function(){return this.s>0};R.isZero=function(){return!!this.d&&this.d[0]===0};R.lessThan=R.lt=function(e){return this.cmp(e)<0};R.lessThanOrEqualTo=R.lte=function(e){return this.cmp(e)<1};R.logarithm=R.log=function(e){var t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new g(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(F=!1,a=h+S,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),Ft(u.d,i=h,x))do if(a+=10,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),!o){+Y(u.d).slice(i+1,i+15)+1==1e14&&(u=k(u,h+1,0));break}while(Ft(u.d,i+=10,x));return F=!0,k(u,h,x)};R.minus=R.sub=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.constructor;if(e=new C(e),!S.d||!e.d)return!S.s||!e.s?e=new C(NaN):S.d?e.s=-e.s:e=new C(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(l=S.d,x=e.d,a=C.precision,u=C.rounding,!l[0]||!x[0]){if(x[0])e.s=-e.s;else if(l[0])e=new C(S);else return new C(u===3?-0:0);return F?k(e,a,u):e}if(r=te(e.e/N),g=te(S.e/N),l=l.slice(),o=g-r,o){for(h=o<0,h?(t=l,o=-o,s=x.length):(t=x,r=g,s=l.length),n=Math.max(Math.ceil(a/N),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=x.length,h=n0;--n)l[s++]=0;for(n=x.length;n>o;){if(l[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=g.length,s-i<0&&(i=s,r=g,g=l,l=r),t=0;i;)t=(l[--i]=l[i]+g[i]+t)/pe|0,l[i]%=pe;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=xr(l,n),F?k(e,a,u):e};R.precision=R.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Me+e);return r.d?(t=wo(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};R.round=function(){var e=this,t=e.constructor;return k(new t(e),e.e+1,t.rounding)};R.sine=R.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=yu(n,Po(n,r)),n.precision=e,n.rounding=t,k(Pe>2?r.neg():r,e,t,!0)):new n(NaN)};R.squareRoot=R.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,u=s.e,l=s.s,g=s.constructor;if(l!==1||!a||!a[0])return new g(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(F=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Y(a),(t.length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=te((u+1)/2)-(u<0||u%2),l==1/0?t="5e"+u:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),n=new g(t)):n=new g(l.toString()),r=(u=g.precision)+3;;)if(o=n,n=o.plus(q(s,o,r+2,1)).times(.5),Y(o.d).slice(0,r)===(t=Y(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(k(o,u+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(n,u+1,1),e=!n.times(n).eq(s));break}return F=!0,k(n,u,g.rounding,e)};R.tangent=R.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=q(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,k(Pe==2||Pe==4?r.neg():r,e,t,!0)):new n(NaN)};R.times=R.mul=function(e){var t,r,n,i,o,s,a,u,l,g=this,h=g.constructor,x=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!x||!x[0]||!S||!S[0])return new h(!e.s||x&&!x[0]&&!S||S&&!S[0]&&!x?NaN:!x||!S?e.s/0:e.s*0);for(r=te(g.e/N)+te(e.e/N),u=x.length,l=S.length,u=0;){for(t=0,i=u+n;i>n;)a=o[i]+S[n]*x[i-n-1]+t,o[i--]=a%pe|0,t=a/pe|0;o[i]=(o[i]+t)%pe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=xr(o,r),F?k(e,h.precision,h.rounding):e};R.toBinary=function(e,t){return wn(this,2,e,t)};R.toDecimalPlaces=R.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(oe(e,0,Ne),t===void 0?t=n.rounding:oe(t,0,8),k(r,e+r.e+1,t))};R.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,!0):(oe(e,0,Ne),t===void 0?t=i.rounding:oe(t,0,8),n=k(new i(n),e+1,t),r=he(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=he(i):(oe(e,0,Ne),t===void 0?t=o.rounding:oe(t,0,8),n=k(new o(i),e+i.e+1,t),r=he(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};R.toFraction=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.d,A=S.constructor;if(!C)return new A(S);if(l=r=new A(1),n=u=new A(0),t=new A(n),o=t.e=wo(C)-S.e-1,s=o%N,t.d[0]=H(10,s<0?N+s:s),e==null)e=o>0?t:l;else{if(a=new A(e),!a.isInt()||a.lt(l))throw Error(Me+a);e=a.gt(t)?o>0?t:l:a}for(F=!1,a=new A(Y(C)),g=A.precision,A.precision=o=C.length*N*2;h=q(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=u.plus(h.times(i)),u=i,i=t,t=a.minus(h.times(i)),a=i;return i=q(e.minus(r),n,0,1,1),u=u.plus(i.times(l)),r=r.plus(i.times(n)),u.s=l.s=S.s,x=q(l,n,o,1).minus(S).abs().cmp(q(u,r,o,1).minus(S).abs())<1?[l,n]:[u,r],A.precision=g,F=!0,x};R.toHexadecimal=R.toHex=function(e,t){return wn(this,16,e,t)};R.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:oe(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(F=!1,r=q(r,e,0,t,1).times(e),F=!0,k(r)):(e.s=r.s,r=e),r};R.toNumber=function(){return+this};R.toOctal=function(e,t){return wn(this,8,e,t)};R.toPower=R.pow=function(e){var t,r,n,i,o,s,a=this,u=a.constructor,l=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(H(+a,l));if(a=new u(a),a.eq(1))return a;if(n=u.precision,o=u.rounding,e.eq(1))return k(a,n,o);if(t=te(e.e/N),t>=e.d.length-1&&(r=l<0?-l:l)<=mu)return i=Eo(u,a,r,n),e.s<0?new u(1).div(i):k(i,n,o);if(s=a.s,s<0){if(tu.maxE+1||t0?s/0:0):(F=!1,u.rounding=a.s=1,r=Math.min(12,(t+"").length),i=hn(e.times(Oe(a,n+r)),n),i.d&&(i=k(i,n+5,1),Ft(i.d,n,o)&&(t=n+10,i=k(hn(e.times(Oe(a,t+r)),t),t+5,1),+Y(i.d).slice(n+1,n+15)+1==1e14&&(i=k(i,n+1,0)))),i.s=s,F=!0,u.rounding=o,k(i,n,o))};R.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,Ne),t===void 0?t=i.rounding:oe(t,0,8),n=k(new i(n),e,t),r=he(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toSignificantDigits=R.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(oe(e,1,Ne),t===void 0?t=n.rounding:oe(t,0,8)),k(new n(r),e,t)};R.toString=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};R.truncated=R.trunc=function(){return k(new this.constructor(this),this.e+1,1)};R.valueOf=R.toJSON=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Y(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Me+e)}function Ft(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=N,i=0):(i=Math.ceil((t+1)/N),t%=N),o=H(10,N-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,s}function hr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function gu(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Pr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=ct(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var q=function(){function e(n,i,o){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*i+a,n[u]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;ai[a]?1:-1;break}return u}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,u){var l,g,h,x,S,C,A,D,O,B,M,I,Z,L,Ye,Be,fe,$e,Q,Ce,qe=n.constructor,Ze=n.s==i.s?1:-1,X=n.d,U=i.d;if(!X||!X[0]||!U||!U[0])return new qe(!n.s||!i.s||(X?U&&X[0]==U[0]:!U)?NaN:X&&X[0]==0||!U?Ze*0:Ze/0);for(u?(S=1,g=n.e-i.e):(u=pe,S=N,g=te(n.e/S)-te(i.e/S)),Q=U.length,fe=X.length,O=new qe(Ze),B=O.d=[],h=0;U[h]==(X[h]||0);h++);if(U[h]>(X[h]||0)&&g--,o==null?(L=o=qe.precision,s=qe.rounding):a?L=o+(n.e-i.e)+1:L=o,L<0)B.push(1),C=!0;else{if(L=L/S+2|0,h=0,Q==1){for(x=0,U=U[0],L++;(h1&&(U=e(U,x,u),X=e(X,x,u),Q=U.length,fe=X.length),Be=Q,M=X.slice(0,Q),I=M.length;I=u/2&&++$e;do x=0,l=t(U,M,Q,I),l<0?(Z=M[0],Q!=I&&(Z=Z*u+(M[1]||0)),x=Z/$e|0,x>1?(x>=u&&(x=u-1),A=e(U,x,u),D=A.length,I=M.length,l=t(A,M,D,I),l==1&&(x--,r(A,Q=10;x/=10)h++;O.e=h+g*S-1,k(O,a?o+O.e+1:o,s,C)}return O}}();function k(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=N,s=t,g=h[x=0],u=g/H(10,i-s-1)%10|0;else if(x=Math.ceil((o+1)/N),a=h.length,x>=a)if(n){for(;a++<=x;)h.push(0);g=u=0,i=1,o%=N,s=o-N+1}else break e;else{for(g=a=h[x],i=1;a>=10;a/=10)i++;o%=N,s=o-N+i,u=s<0?0:g/H(10,i-s-1)%10|0}if(n=n||t<0||h[x+1]!==void 0||(s<0?g:g%H(10,i-s-1)),l=r<4?(u||n)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(o>0?s>0?g/H(10,i-s):0:h[x-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,l?(t-=e.e+1,h[0]=H(10,(N-t%N)%N),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=x,a=1,x--):(h.length=x+1,a=H(10,N-o),h[x]=s>0?(g/H(10,i-s)%H(10,s)|0)*a:0),l)for(;;)if(x==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==pe&&(h[0]=1));break}else{if(h[x]+=a,h[x]!=pe)break;h[x--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return F&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+De(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+De(-i-1)+o,r&&(n=r-s)>0&&(o+=De(n))):i>=s?(o+=De(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+De(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=De(n))),o}function xr(e,t){var r=e[0];for(t*=N;r>=10;r/=10)t++;return t}function Er(e,t,r){if(t>du)throw F=!0,r&&(e.precision=r),Error(mo);return k(new e(yr),t,1,!0)}function ce(e,t,r){if(t>gn)throw Error(mo);return k(new e(wr),t,r,!0)}function wo(e){var t=e.length-1,r=t*N+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function De(e){for(var t="";e--;)t+="0";return t}function Eo(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/N+4);for(F=!1;;){if(r%2&&(o=o.times(t),co(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),co(t.d,s)}return F=!0,o}function lo(e){return e.d[e.d.length-1]&1}function bo(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new x(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(F=!1,u=C):u=t,a=new x(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(H(2,h))/Math.LN10*2+5|0,u+=n,r=o=s=new x(1),x.precision=u;;){if(o=k(o.times(e),u,1),r=r.times(++g),a=s.plus(q(o,r,u,1)),Y(a.d).slice(0,u)===Y(s.d).slice(0,u)){for(i=h;i--;)s=k(s.times(s),u,1);if(t==null)if(l<3&&Ft(s.d,u-n,S,l))x.precision=u+=10,r=o=a=new x(1),g=0,l++;else return k(s,x.precision=C,S,F=!0);else return x.precision=C,s}s=a}}function Oe(e,t){var r,n,i,o,s,a,u,l,g,h,x,S=1,C=10,A=e,D=A.d,O=A.constructor,B=O.rounding,M=O.precision;if(A.s<0||!D||!D[0]||!A.e&&D[0]==1&&D.length==1)return new O(D&&!D[0]?-1/0:A.s!=1?NaN:D?0:A);if(t==null?(F=!1,g=M):g=t,O.precision=g+=C,r=Y(D),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Y(A.d),n=r.charAt(0),S++;o=A.e,n>1?(A=new O("0."+r),o++):A=new O(n+"."+r.slice(1))}else return l=Er(O,g+2,M).times(o+""),A=Oe(new O(n+"."+r.slice(1)),g-C).plus(l),O.precision=M,t==null?k(A,M,B,F=!0):A;for(h=A,u=s=A=q(A.minus(1),A.plus(1),g,1),x=k(A.times(A),g,1),i=3;;){if(s=k(s.times(x),g,1),l=u.plus(q(s,new O(i),g,1)),Y(l.d).slice(0,g)===Y(u.d).slice(0,g))if(u=u.times(2),o!==0&&(u=u.plus(Er(O,g+2,M).times(o+""))),u=q(u,new O(S),g,1),t==null)if(Ft(u.d,g-C,B,a))O.precision=g+=C,l=s=A=q(h.minus(1),h.plus(1),g,1),x=k(A.times(A),g,1),i=a=1;else return k(u,O.precision=M,B,F=!0);else return O.precision=M,u;u=l,i+=2}}function xo(e){return String(e.s*e.s/0)}function yn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%N,r<0&&(n+=N),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),yo.test(t))return yn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(pu.test(t))r=16,t=t.toLowerCase();else if(cu.test(t))r=2;else if(fu.test(t))r=8;else throw Error(Me+t);for(o=t.search(/p/i),o>0?(u=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=Eo(n,new n(r),o,o*2)),l=hr(t,r,pe),g=l.length-1,o=g;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=xr(l,g),e.d=l,F=!1,s&&(e=q(e,i,a*4)),u&&(e=e.times(Math.abs(u)<54?H(2,u):Ge.pow(2,u))),F=!0,e)}function yu(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:ct(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Pr(5,r)),t=ct(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function ct(e,t,r,n,i){var o,s,a,u,l=1,g=e.precision,h=Math.ceil(g/N);for(F=!1,u=r.times(r),a=new e(n);;){if(s=q(a.times(u),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=q(s.times(u),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,l++}return F=!0,s.d.length=h+1,s}function Pr(e,t){for(var r=e;--t;)r*=e;return r}function Po(e,t){var r,n=t.s<0,i=ce(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Pe=n?4:1,t;if(r=t.divToInt(i),r.isZero())Pe=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Pe=lo(r)?n?2:3:n?4:1,t;Pe=lo(r)?n?1:4:n?3:2}return t.minus(i).abs()}function wn(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor,C=r!==void 0;if(C?(oe(r,1,Ne),n===void 0?n=S.rounding:oe(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=xo(e);else{for(g=he(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),x=new S(1),x.e=g.length-s,x.d=hr(he(x),10,i),x.e=x.d.length),h=hr(g,10,i),o=u=h.length;h[--u]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=q(e,x,r,n,0,i),h=e.d,o=e.e,l=fo),s=h[r],a=i/2,l=l||h[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,l)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(u=h.length;!h[u-1];--u);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)g+="0";for(h=hr(g,i,t),u=h.length;!h[u-1];--u);for(s=1,g="1.";su)for(o-=u;o--;)g+="0";else ot)return e.length=t,!0}function wu(e){return new this(e).abs()}function Eu(e){return new this(e).acos()}function bu(e){return new this(e).acosh()}function xu(e,t){return new this(e).plus(t)}function Pu(e){return new this(e).asin()}function vu(e){return new this(e).asinh()}function Tu(e){return new this(e).atan()}function Cu(e){return new this(e).atanh()}function Au(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ce(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ce(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ce(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(q(e,t,o,1)),t=ce(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(q(e,t,o,1)),r}function Ru(e){return new this(e).cbrt()}function Su(e){return k(e=new this(e),e.e+1,2)}function Iu(e,t,r){return new this(e).clamp(t,r)}function ku(e){if(!e||typeof e!="object")throw Error(br+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ne,"rounding",0,8,"toExpNeg",-lt,0,"toExpPos",0,lt,"maxE",0,lt,"minE",-lt,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Me+r+": "+n);if(r="crypto",i&&(this[r]=dn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(go);else this[r]=!1;else throw Error(Me+r+": "+n);return this}function Du(e){return new this(e).cos()}function Ou(e){return new this(e).cosh()}function vo(e){var t,r,n;function i(o){var s,a,u,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,po(o)){l.s=o.s,F?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e=10;a/=10)s++;F?s>i.maxE?(l.e=NaN,l.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(go);else for(;o=10;i/=10)n++;n`}};function ft(e){return e instanceof Lt}d();c();p();f();m();d();c();p();f();m();var vr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};d();c();p();f();m();var Tr=e=>e,Cr={bold:Tr,red:Tr,green:Tr,dim:Tr,enabled:!1},To={bold:sr,red:nt,green:Ci,dim:ar,enabled:!0},mt={write(e){e.writeLine(",")}};d();c();p();f();m();var ye=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};d();c();p();f();m();var _e=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var dt=class extends _e{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new vr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new ye("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(mt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};d();c();p();f();m();var Co=": ",Ar=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Co.length}write(t){let r=new ye(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Co).write(this.value)}};d();c();p();f();m();var Rr=class e extends _e{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let u;if(s.value instanceof e?u=s.value.getField(a):s.value instanceof dt&&(u=s.value.getField(Number(a))),!u)return;s=u}return s}getDeepFieldValue(r){var n;return r.length===0?this:(n=this.getDeepField(r))==null?void 0:n.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){var n;return(n=this.getField(r))==null?void 0:n.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){var i,o;let r=(i=this.getField("select"))==null?void 0:i.value.asObject();if(r)return{kind:"select",value:r};let n=(o=this.getField("include"))==null?void 0:o.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){var n;return(n=this.getSelectionParent())==null?void 0:n.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new ye("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(mt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};d();c();p();f();m();var K=class extends _e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new ye(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var En=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Sr(e){return new En(Ao(e))}function Ao(e){let t=new Rr;for(let[r,n]of Object.entries(e)){let i=new Ar(r,Ro(n));t.addField(i)}return t}function Ro(e){if(typeof e=="string")return new K(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new K(String(e));if(typeof e=="bigint")return new K(`${e}n`);if(e===null)return new K("null");if(e===void 0)return new K("undefined");if(pt(e))return new K(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new K(`Buffer.alloc(${e.byteLength})`):new K(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=gr(e)?e.toISOString():"Invalid Date";return new K(`new Date("${t}")`)}return e instanceof xe?new K(`Prisma.${e._getName()}`):ft(e)?new K(`prisma.${uo(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?il(e):typeof e=="object"?Ao(e):new K(Object.prototype.toString.call(e))}function il(e){let t=new dt;for(let r of e)t.addItem(Ro(r));return t}function So(e){if(e===void 0)return"";let t=Sr(e);return new at(0,{colors:Cr}).write(t).toString()}d();c();p();f();m();var ol="P2037";function Bt({error:e,user_facing_error:t},r,n){return t.error_code?new z(sl(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new ae(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function sl(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===ol&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var bn=class{getLocation(){return null}};function Fe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new bn}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Io={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function gt(e={}){let t=ul(e);return Object.entries(t).reduce((n,[i,o])=>(Io[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function ul(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Ir(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ko(e,t){let r=Ir(e);return t({action:"aggregate",unpacker:r,argsMapper:gt})(e)}d();c();p();f();m();function ll(e={}){let{select:t,...r}=e;return typeof t=="object"?gt({...r,_count:t}):gt({...r,_count:{_all:!0}})}function cl(e={}){return typeof e.select=="object"?t=>Ir(e)(t)._count:t=>Ir(e)(t)._count._all}function Do(e,t){return t({action:"count",unpacker:cl(e),argsMapper:ll})(e)}d();c();p();f();m();function pl(e={}){let t=gt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function fl(e={}){return t=>(typeof(e==null?void 0:e._count)=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Oo(e,t){return t({action:"groupBy",unpacker:fl(e),argsMapper:pl})(e)}function Mo(e,t,r){if(t==="aggregate")return n=>ko(n,r);if(t==="count")return n=>Do(n,r);if(t==="groupBy")return n=>Oo(n,r)}d();c();p();f();m();function No(e,t){let r=t.fields.filter(i=>!i.relationName),n=on(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Lt(e,o,s.type,s.isList,s.kind==="enum")},...mr(Object.keys(n))})}d();c();p();f();m();d();c();p();f();m();var _o=e=>Array.isArray(e)?e:e.split("."),xn=(e,t)=>_o(t).reduce((r,n)=>r&&r[n],e),Fo=(e,t,r)=>_o(t).reduceRight((n,i,o,s)=>Object.assign({},xn(e,s.slice(0,o)),{[i]:n}),r);function ml(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function dl(e,t,r){return t===void 0?e!=null?e:{}:Fo(t,r,e||!0)}function Pn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((u,l)=>({...u,[l.name]:l}),{});return u=>{let l=Fe(e._errorFormat),g=ml(n,i),h=dl(u,o,g),x=r({dataPath:g,callsite:l})(h),S=gl(e,t);return new Proxy(x,{get(C,A){if(!S.includes(A))return C[A];let O=[a[A].type,r,A],B=[g,h];return Pn(e,...O,...B)},...mr([...S,...Object.getOwnPropertyNames(x)])})}}function gl(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}d();c();p();f();m();d();c();p();f();m();var hl=Ue(Wi());var yl={red:nt,gray:Ii,dim:ar,bold:sr,underline:Ti,highlightSource:e=>e.highlight()},wl={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function El({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r!=null?r:!1,callArguments:n}}function bl({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],u=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${u}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${u}`)),t&&a.push(s.underline(xl(t))),i){a.push("");let l=[i.toString()];o&&(l.push(o),l.push(s.dim(")"))),a.push(l.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function xl(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function ht(e){let t=e.showColors?yl:wl,r;return typeof $getTemplateParameters!="undefined"?r=$getTemplateParameters(e,t):r=El(e),bl(r,t)}function Lo(e,t,r,n){return e===Se.ModelAction.findFirstOrThrow||e===Se.ModelAction.findUniqueOrThrow?Pl(t,r,n):n}function Pl(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=ht({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new ee(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof z&&o.code==="P2025"?new Ie(`No ${e} found`,t):o})}}d();c();p();f();m();function we(e){return e.replace(/^./,t=>t.toLowerCase())}var vl=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Tl=["aggregate","count","groupBy"];function vn(e,t){var i;let r=(i=e._extensions.getAllModelExtensions(t))!=null?i:{},n=[Cl(e,t),Rl(e,t),_t(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return ge({},n)}function Cl(e,t){let r=we(t),n=Object.keys(Se.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=u=>e._request(u);s=Lo(o,t,e._clientVersion,s);let a=u=>l=>{let g=Fe(e._errorFormat);return e._createPrismaPromise(h=>{let x={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...x,...u})})};return vl.includes(o)?Pn(e,t,a):Al(i)?Mo(e,i,a):a({})}}}function Al(e){return Tl.includes(e)}function Rl(e,t){return Qe(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return No(t,r)}))}d();c();p();f();m();function Bo(e){return e.replace(/^./,t=>t.toUpperCase())}var Tn=Symbol();function $t(e){let t=[Sl(e),ne(Tn,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(_t(r)),ge(e,t)}function Sl(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(we),n=[...new Set(t.concat(r))];return Qe({getKeys(){return n},getPropertyValue(i){let o=Bo(i);if(e._runtimeDataModel.models[o]!==void 0)return vn(e,o);if(e._runtimeDataModel.models[i]!==void 0)return vn(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function $o(e){return e[Tn]?e[Tn]:e}function qo(e){var r;if(typeof e=="function")return e(this);if((r=e.client)!=null&&r.__AccelerateEngine){let n=e.client.__AccelerateEngine;this._originalClient._engine=new n(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return $t(t)}d();c();p();f();m();d();c();p();f();m();function Uo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let u of Object.values(o)){if(n){if(n[u.name])continue;let l=u.needs.filter(g=>n[g]);l.length>0&&a.push(st(l))}else if(r){if(!r[u.name])continue;let l=u.needs.filter(g=>!r[g]);l.length>0&&a.push(st(l))}Il(e,u.needs)&&s.push(kl(u,ge(e,s)))}return s.length>0||a.length>0?ge(e,[...s,...a]):e}function Il(e,t){return t.every(r=>nn(e,r))}function kl(e,t){return Qe(ne(e.name,()=>e.compute(t)))}d();c();p();f();m();function kr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){var s;if(Array.isArray(t)){for(let a=0;ag.name===o);if(!u||u.kind!=="object"||!u.relationName)continue;let l=typeof s=="object"?s:{};t[o]=kr({visitor:i,result:t[o],args:l,modelName:u.type,runtimeDataModel:n})}}function jo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:kr({result:e,args:r!=null?r:{},modelName:t,runtimeDataModel:i,visitor:(s,a,u)=>Uo({result:s,modelName:we(a),select:u.select,omit:u.omit,extensions:n})})}d();c();p();f();m();d();c();p();f();m();function Jo(e){if(e instanceof ue)return Dl(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{var s,a;let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(((s=t.transaction)==null?void 0:s.kind)==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Jo((a=t.args)!=null?a:{}),__internalParams:t,query:(u,l=t)=>{let g=l.customDataProxyFetch;return l.customDataProxyFetch=zo(o,g),l.args=u,Go(e,l,r,n+1)}})})}function Ho(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r!=null?r:"$none",o);return Go(e,t,s)}function Wo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Ko(r,n,0,e):e(r)}}function Ko(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let u=a.customDataProxyFetch;return a.customDataProxyFetch=zo(i,u),Ko(a,t,r+1,n)}})}var Qo=e=>e;function zo(e=Qo,t=Qo){return r=>e(t(r))}d();c();p();f();m();d();c();p();f();m();function Zo(e,t,r){let n=we(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Ol({...e,...Yo(t.name,e,t.result.$allModels),...Yo(t.name,e,t.result[n])})}function Ol(e){let t=new de,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return ot(e,n=>({...n,needs:r(n.name,new Set)}))}function Yo(e,t,r){return r?ot(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Ml(t,o,i)})):{}}function Ml(e,t,r){var i;let n=(i=e==null?void 0:e[t])==null?void 0:i.compute;return n?o=>r({...o,[t]:n(o)}):r}function Xo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function es(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Dr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new de;this.modelExtensionsCache=new de;this.queryCallbacksCache=new de;this.clientExtensions=It(()=>{var t,r;return this.extension.client?{...(r=this.previous)==null?void 0:r.getAllClientExtensions(),...this.extension.client}:(t=this.previous)==null?void 0:t.getAllClientExtensions()});this.batchCallbacks=It(()=>{var n,i,o;let t=(i=(n=this.previous)==null?void 0:n.getAllBatchQueryCallbacks())!=null?i:[],r=(o=this.extension.query)==null?void 0:o.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>{var r;return Zo((r=this.previous)==null?void 0:r.getAllComputedFields(t),this.extension,t)})}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{var n,i;let r=we(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?(n=this.previous)==null?void 0:n.getAllModelExtensions(t):{...(i=this.previous)==null?void 0:i.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{var s,a;let n=(a=(s=this.previous)==null?void 0:s.getAllQueryCallbacks(t,r))!=null?a:[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Or=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Dr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Dr(t,this.head))}getAllComputedFields(t){var r;return(r=this.head)==null?void 0:r.getAllComputedFields(t)}getAllClientExtensions(){var t;return(t=this.head)==null?void 0:t.getAllClientExtensions()}getAllModelExtensions(t){var r;return(r=this.head)==null?void 0:r.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){var n,i;return(i=(n=this.head)==null?void 0:n.getAllQueryCallbacks(t,r))!=null?i:[]}getAllBatchQueryCallbacks(){var t,r;return(r=(t=this.head)==null?void 0:t.getAllBatchQueryCallbacks())!=null?r:[]}};d();c();p();f();m();var ts=re("prisma:client"),rs={Vercel:"vercel","Netlify CI":"netlify"};function ns({postinstall:e,ciName:t,clientVersion:r}){if(ts("checkPlatformCaching:postinstall",e),ts("checkPlatformCaching:ciName",t),e===!0&&t&&t in rs){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${rs[t]}-build`;throw console.error(n),new G(n,r)}}d();c();p();f();m();function is(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Nl="Cloudflare-Workers",_l="node";function os(){var e,t,r;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Nl?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((r=(t=globalThis.process)==null?void 0:t.release)==null?void 0:r.name)===_l?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var Fl={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Cn(){let e=os();return{id:e,prettyName:Fl[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function yt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){var u,l;let i,o=Object.keys(e)[0],s=(u=e[o])==null?void 0:u.url,a=(l=t[o])==null?void 0:l.url;if(o===void 0?i=void 0:a?i=a:s!=null&&s.value?i=s.value:s!=null&&s.fromEnvVar&&(i=r[s.fromEnvVar]),(s==null?void 0:s.fromEnvVar)!==void 0&&i===void 0)throw Cn().id==="workerd"?new G(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new G(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new G("error: Missing URL environment variable, value, or override.",n);return i}d();c();p();f();m();d();c();p();f();m();var Mr=class extends Error{constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var se=class extends Mr{constructor(t,r){var n;super(t,r),this.isRetryable=(n=r.isRetryable)!=null?n:!0}};d();c();p();f();m();d();c();p();f();m();function $(e,t){return{...e,isRetryable:t}}var wt=class extends se{constructor(r){super("This request must be retried",$(r,!0));this.name="ForcedRetryError";this.code="P5001"}};_(wt,"ForcedRetryError");d();c();p();f();m();var He=class extends se{constructor(r,n){super(r,$(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};_(He,"InvalidDatasourceError");d();c();p();f();m();var We=class extends se{constructor(r,n){super(r,$(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};_(We,"NotImplementedYetError");d();c();p();f();m();d();c();p();f();m();var j=class extends se{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 Ke=class extends j{constructor(r){super("Schema needs to be uploaded",$(r,!0));this.name="SchemaMissingError";this.code="P5005"}};_(Ke,"SchemaMissingError");d();c();p();f();m();d();c();p();f();m();var An="This request could not be understood by the server",Ut=class extends j{constructor(r,n,i){super(n||An,$(r,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};_(Ut,"BadRequestError");d();c();p();f();m();var Vt=class extends j{constructor(r,n){super("Engine not started: healthcheck timeout",$(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};_(Vt,"HealthcheckTimeoutError");d();c();p();f();m();var jt=class extends j{constructor(r,n,i){super(n,$(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};_(jt,"EngineStartupError");d();c();p();f();m();var Jt=class extends j{constructor(r){super("Engine version is not supported",$(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};_(Jt,"EngineVersionNotSupportedError");d();c();p();f();m();var Rn="Request timed out",Qt=class extends j{constructor(r,n=Rn){super(n,$(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};_(Qt,"GatewayTimeoutError");d();c();p();f();m();var Ll="Interactive transaction error",Gt=class extends j{constructor(r,n=Ll){super(n,$(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};_(Gt,"InteractiveTransactionError");d();c();p();f();m();var Bl="Request parameters are invalid",Ht=class extends j{constructor(r,n=Bl){super(n,$(r,!1));this.name="InvalidRequestError";this.code="P5011"}};_(Ht,"InvalidRequestError");d();c();p();f();m();var Sn="Requested resource does not exist",Wt=class extends j{constructor(r,n=Sn){super(n,$(r,!1));this.name="NotFoundError";this.code="P5003"}};_(Wt,"NotFoundError");d();c();p();f();m();var In="Unknown server error",Et=class extends j{constructor(r,n,i){super(n||In,$(r,!0));this.name="ServerError";this.code="P5006";this.logs=i}};_(Et,"ServerError");d();c();p();f();m();var kn="Unauthorized, check your connection string",Kt=class extends j{constructor(r,n=kn){super(n,$(r,!1));this.name="UnauthorizedError";this.code="P5007"}};_(Kt,"UnauthorizedError");d();c();p();f();m();var Dn="Usage exceeded, retry again later",zt=class extends j{constructor(r,n=Dn){super(n,$(r,!0));this.name="UsageExceededError";this.code="P5008"}};_(zt,"UsageExceededError");async function $l(e){let t;try{t=await e.text()}catch(r){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(r){return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Yt(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await $l(e);if(n.type==="QueryEngineError")throw new z(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Et(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Ke(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Jt(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new jt(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new G(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new Vt(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 Gt(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Ht(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new Kt(r,bt(kn,n));if(e.status===404)return new Wt(r,bt(Sn,n));if(e.status===429)throw new zt(r,bt(Dn,n));if(e.status===504)throw new Qt(r,bt(Rn,n));if(e.status>=500)throw new Et(r,bt(In,n));if(e.status>=400)throw new Ut(r,bt(An,n))}function bt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}d();c();p();f();m();function ss(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))}d();c();p();f();m();var Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function as(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,u,l,g;for(let h=0;h>18,a=(g&258048)>>12,u=(g&4032)>>6,l=g&63,r+=Te[s]+Te[a]+Te[u]+Te[l];return i==1?(g=t[o],s=(g&252)>>2,a=(g&3)<<4,r+=Te[s]+Te[a]+"=="):i==2&&(g=t[o]<<8|t[o+1],s=(g&64512)>>10,a=(g&1008)>>4,u=(g&15)<<2,r+=Te[s]+Te[a]+Te[u]+"="),r}d();c();p();f();m();function us(e){var r;if(!!((r=e.generator)!=null&&r.previewFeatures.some(n=>n.toLowerCase().includes("metrics"))))throw new G("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)}d();c();p();f();m();function ql(e){return e[0]*1e3+e[1]/1e6}function ls(e){return new Date(ql(e))}d();c();p();f();m();var cs={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};d();c();p();f();m();d();c();p();f();m();var Zt=class extends se{constructor(r,n){super(`Cannot fetch data from service: -${r}`,$(n,!0));this.name="RequestError";this.code="P5010"}};_(Zt,"RequestError");async function ze(e,t,r=n=>n){var i;let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(On)(e,t)}catch(o){let s=(i=o.message)!=null?i:"Unknown error";throw new Zt(s,{clientVersion:n})}}function Vl(e){return{...e.headers,"Content-Type":"application/json"}}function jl(e){return{method:e.method,headers:Vl(e)}}function Jl(e,t){return{text:()=>Promise.resolve(w.Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(w.Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new Mn(t.headers)}}async function On(e,t={}){let r=Ql("https"),n=jl(t),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{var l;let u=r.request(e,n,g=>{let{statusCode:h,headers:{location:x}}=g;h>=301&&h<=399&&x&&(x.startsWith("http")===!1?s(On(`${o}${x}`,t)):s(On(x,t))),g.on("data",S=>i.push(S)),g.on("end",()=>s(Jl(i,g))),g.on("error",a)});u.on("error",a),u.end((l=t.body)!=null?l:"")})}var Ql=typeof Pt!="undefined"?Pt:()=>{},Mn=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let i of n)this.headers.set(r,i)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){var r;return(r=this.headers.get(t))!=null?r:null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,i]of this.headers)t.call(r,i,n,this)}};var Gl=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,ps=re("prisma:client:dataproxyEngine");async function Hl(e,t){var s,a,u;let r=cs["@prisma/engines-version"],n=(s=t.clientVersion)!=null?s:"unknown";if(y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=(a=n==null?void 0:n.split("-"))!=null?a:[];if(o===void 0&&Gl.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[l]=(u=r.split("-"))!=null?u:[],[g,h,x]=l.split("."),S=Wl(`<=${g}.${h}.${x}`),C=await ze(S,{clientVersion:n});if(!C.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${C.status} ${C.statusText}, response body: ${await C.text()||""}`);let A=await C.text();ps("length of body fetched from unpkg.com",A.length);let D;try{D=JSON.parse(A)}catch(O){throw console.error("JSON.parse error: body fetched from unpkg.com: ",A),O}return D.version}throw new We("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function fs(e,t){let r=await Hl(e,t);return ps("version",r),r}function Wl(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var ms=3,Nn=re("prisma:client:dataproxyEngine"),_n=class{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!=null?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}},Xt=class{constructor(t){this.name="DataProxyEngine";us(t),this.config=t,this.env={...t.env,...typeof y!="undefined"?y.env:{}},this.inlineSchema=as(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[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new _n({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await fs(t,this.config),Nn("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){var r,n;(r=t==null?void 0:t.logs)!=null&&r.length&&t.logs.forEach(i=>{switch(i.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let o=typeof i.attributes.query=="string"?i.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[s]=o.split("/* traceparent");o=s}this.logEmitter.emit("query",{query:o,timestamp:ls(i.timestamp),duration:Number(i.attributes.duration_ms),params:i.attributes.params,target:i.attributes.target})}}}),(n=t==null?void 0:t.traces)!=null&&n.length&&this.tracingHelper.createEngineSpan({span:!0,spans:t.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await ze(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Nn("schema response status",r.status);let n=await Yt(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==null?void 0:n.kind)==="itx"?n.options:void 0,s=dr(t,n),{batchResult:a,elapsed:u}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r});return a.map(l=>"errors"in l&&l.errors.length>0?Bt(l.errors[0],this.clientVersion,this.config.activeProvider):{data:l,elapsed:u})}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 ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Nn("graphql response status",a.status),await this.handleError(await Yt(a,this.clientVersion));let u=await a.json(),l=u.extensions;if(l&&this.propagateResponseExtensions(l),u.errors)throw u.errors.length===1?Bt(u.errors[0],this.config.clientVersion,this.config.activeProvider):new ae(u.errors,{clientVersion:this.config.clientVersion});return u}})}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 u=await ze(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Yt(u,this.clientVersion));let l=await u.json(),g=l.extensions;g&&this.propagateResponseExtensions(g);let h=l.id,x=l["data-proxy"].endpoint;return{id:h,payload:{endpoint:x}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Yt(a,this.clientVersion));let l=(await a.json()).extensions;l&&this.propagateResponseExtensions(l);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=yt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch(l){throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:")throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let u=a.get("api_key");if(u===null||u.length<1)throw new He(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,u]}metrics(){throw new We("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){var r;for(let n=0;;n++){let i=o=>{this.logEmitter.emit("info",{message:`Calling ${o} (n=${n})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:i})}catch(o){if(!(o instanceof se)||!o.isRetryable)throw o;if(n>=ms)throw o instanceof wt?o.cause:o;this.logEmitter.emit("warn",{message:`Attempt ${n+1}/${ms} failed for ${t.actionGerund}: ${(r=o.message)!=null?r:"(unknown)"}`,timestamp:new Date,target:""});let s=await ss(n);this.logEmitter.emit("warn",{message:`Retrying after ${s}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof Ke)throw await this.uploadSchema(),new wt({clientVersion:this.clientVersion,cause:t});if(t)throw t}applyPendingMigrations(){throw new Error("Method not implemented.")}};function ds({copyEngine:e=!0},t){let r;try{r=yt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch(u){}e&&(r!=null&&r.startsWith("prisma://"))&&cr("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=At(t.generator),i=!!(r!=null&&r.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o){let u;throw u=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new ee(u.join(` -`),{clientVersion:t.clientVersion})}if(i)return new Xt(t);throw new ee("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}d();c();p();f();m();function Nr({generator:e}){var t;return(t=e==null?void 0:e.previewFeatures)!=null?t:[]}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var bs=Ue(Fn());d();c();p();f();m();function ws(e,t){let r=Es(e),n=Kl(r),i=Yl(n);i?_r(i,t):t.addErrorMessage(()=>"Unknown error")}function Es(e){return e.errors.flatMap(t=>t.kind==="Union"?Es(t):[t])}function Kl(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:zl(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function zl(e,t){return[...new Set(e.concat(t))]}function Yl(e){return sn(e,(t,r)=>{let n=hs(t),i=hs(r);return n!==i?n-i:ys(t)-ys(r)})}function hs(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function ys(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}d();c();p();f();m();var le=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};d();c();p();f();m();var Fr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(mt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function _r(e,t){switch(e.kind){case"MutuallyExclusiveFields":Zl(e,t);break;case"IncludeOnScalar":Xl(e,t);break;case"EmptySelection":ec(e,t);break;case"UnknownSelectionField":nc(e,t);break;case"UnknownArgument":ic(e,t);break;case"UnknownInputField":oc(e,t);break;case"RequiredArgumentMissing":sc(e,t);break;case"InvalidArgumentType":ac(e,t);break;case"InvalidArgumentValue":uc(e,t);break;case"ValueTooLarge":lc(e,t);break;case"SomeFieldsMissing":cc(e,t);break;case"TooManyFieldsGiven":pc(e,t);break;case"Union":ws(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function Zl(e,t){var n,i,o;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();r&&((i=r.getField(e.firstField))==null||i.markAsError(),(o=r.getField(e.secondField))==null||o.markAsError()),t.addErrorMessage(s=>`Please ${s.bold("either")} use ${s.green(`\`${e.firstField}\``)} or ${s.green(`\`${e.secondField}\``)}, but ${s.red("not both")} at the same time.`)}function Xl(e,t){var s,a;let[r,n]=Lr(e.selectionPath),i=e.outputType,o=(s=t.arguments.getDeepSelectionParent(r))==null?void 0:s.value;if(o&&((a=o.getField(n))==null||a.markAsError(),i))for(let u of i.fields)u.isRelation&&o.addSuggestion(new le(u.name,"true"));t.addErrorMessage(u=>{let l=`Invalid scalar field ${u.red(`\`${n}\``)} for ${u.bold("include")} statement`;return i?l+=` on model ${u.bold(i.name)}. ${er(u)}`:l+=".",l+=` -Note that ${u.bold("include")} statements only accept relation fields.`,l})}function ec(e,t){var n,i;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();if(r){let o=(i=r.getField("omit"))==null?void 0:i.value.asObject();if(o){tc(e,t,o);return}}rc(e,t)}function tc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new le(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function rc(e,t){var o,s;let r=e.outputType,n=(o=t.arguments.getDeepSelectionParent(e.selectionPath))==null?void 0:o.value,i=(s=n==null?void 0:n.isEmpty())!=null?s:!1;n&&(n.removeAllFields(),vs(n,r)),t.addErrorMessage(a=>i?`The ${a.red("`select`")} statement for type ${a.bold(r.name)} must not be empty. ${er(a)}`:`The ${a.red("`select`")} statement for type ${a.bold(r.name)} needs ${a.bold("at least one truthy value")}.`)}function nc(e,t){var s,a,u,l,g,h,x;let[r,n]=Lr(e.selectionPath),i=(s=t.arguments.getDeepSubSelectionValue(r))==null?void 0:s.asObject(),o;if(i){let S=(a=i.getFieldValue("select"))==null?void 0:a.asObject(),C=(u=i.getFieldValue("include"))==null?void 0:u.asObject(),A=(l=i.getFieldValue("omit"))==null?void 0:l.asObject();S!=null&&S.hasField(n)?(o="select",(g=S.getField(n))==null||g.markAsError(),vs(S,e.outputType)):C!=null&&C.hasField(n)?(o="include",(h=C.getField(n))==null||h.markAsError(),fc(C,e.outputType)):A!=null&&A.hasField(n)&&(o="omit",(x=A.getField(n))==null||x.markAsError(),mc(A,e.outputType))}t.addErrorMessage(S=>{let C=[`Unknown field ${S.red(`\`${n}\``)}`];return o&&C.push(`for ${S.bold(o)} statement`),C.push(`on model ${S.bold(`\`${e.outputType.name}\``)}.`),C.push(er(S)),C.join(" ")})}function ic(e,t){var i,o;let r=e.argumentPath[0],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getField(r))==null||o.markAsError(),dc(n,e.arguments)),t.addErrorMessage(s=>xs(s,r,e.arguments.map(a=>a.name)))}function oc(e,t){var o,s,a;let[r,n]=Lr(e.argumentPath),i=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject();if(i){(s=i.getDeepField(e.argumentPath))==null||s.markAsError();let u=(a=i.getDeepFieldValue(r))==null?void 0:a.asObject();u&&Ts(u,e.inputType)}t.addErrorMessage(u=>xs(u,n,e.inputType.fields.map(l=>l.name)))}function xs(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=hc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(er(e)),n.join(" ")}function sc(e,t){var u,l;let r;t.addErrorMessage(g=>(r==null?void 0:r.value)instanceof K&&r.value.text==="null"?`Argument \`${g.green(o)}\` must not be ${g.red("null")}.`:`Argument \`${g.green(o)}\` is missing.`);let n=(u=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:u.asObject();if(!n)return;let[i,o]=Lr(e.argumentPath),s=new Fr,a=(l=n.getDeepFieldValue(i))==null?void 0:l.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let g of e.inputTypes[0].fields)s.addField(g.name,g.typeNames.join(" | "));a.addSuggestion(new le(o,s).makeRequired())}else{let g=e.inputTypes.map(Ps).join(" | ");a.addSuggestion(new le(o,g).makeRequired())}}function Ps(e){return e.kind==="list"?`${Ps(e.elementType)}[]`:e.name}function ac(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=Br("or",e.argument.typeNames.map(u=>s.green(u)));return`Argument \`${s.bold(r)}\`: Invalid value provided. Expected ${a}, provided ${s.red(e.inferredType)}.`})}function uc(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=[`Invalid value for argument \`${s.bold(r)}\``];if(e.underlyingError&&a.push(`: ${e.underlyingError}`),a.push("."),e.argument.typeNames.length>0){let u=Br("or",e.argument.typeNames.map(l=>s.green(l)));a.push(` Expected ${u}.`)}return a.join("")})}function lc(e,t){var o;let r=e.argument.name,n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath),a=s==null?void 0:s.value;a==null||a.markAsError(),a instanceof K&&(i=a.text)}t.addErrorMessage(s=>{let a=["Unable to fit value"];return i&&a.push(s.red(i)),a.push(`into a 64-bit signed integer for field \`${s.bold(r)}\``),a.join(" ")})}function cc(e,t){var i,o;let r=e.argumentPath[e.argumentPath.length-1],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();if(n){let s=(o=n.getDeepFieldValue(e.argumentPath))==null?void 0:o.asObject();s&&Ts(s,e.inputType)}t.addErrorMessage(s=>{let a=[`Argument \`${s.bold(r)}\` of type ${s.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?a.push(`${s.green("at least one of")} ${Br("or",e.constraints.requiredFields.map(u=>`\`${s.bold(u)}\``))} arguments.`):a.push(`${s.green("at least one")} argument.`):a.push(`${s.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),a.push(er(s)),a.join(" ")})}function pc(e,t){var o,s;let r=e.argumentPath[e.argumentPath.length-1],n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i=[];if(n){let a=(s=n.getDeepFieldValue(e.argumentPath))==null?void 0:s.asObject();a&&(a.markAsError(),i=Object.keys(a.getFields()))}t.addErrorMessage(a=>{let u=[`Argument \`${a.bold(r)}\` of type ${a.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?u.push(`${a.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?u.push(`${a.green("at most one")} argument,`):u.push(`${a.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),u.push(`but you provided ${Br("and",i.map(l=>a.red(l)))}. Please choose`),e.constraints.maxFieldCount===1?u.push("one."):u.push(`${e.constraints.maxFieldCount}.`),u.join(" ")})}function vs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,"true"))}function fc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new le(r.name,"true"))}function mc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new le(r.name,"true"))}function dc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Ts(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Lr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function er({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Br(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var gc=3;function hc(e,t){let r=1/0,n;for(let i of t){let o=(0,bs.default)(e,i);o>gc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){var r;return(r=this.model)==null?void 0:r.fields.find(n=>n.name===t)}nestSelection(t){let r=this.findField(t),n=(r==null?void 0:r.kind)==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};d();c();p();f();m();var Ss=e=>({command:e});d();c();p();f();m();d();c();p();f();m();var Is=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);d();c();p();f();m();function tr(e){try{return ks(e,"fast")}catch(t){return ks(e,"slow")}}function ks(e,t){return JSON.stringify(e.map(r=>Ac(r,t)))}function Ac(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:ut(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ve.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Rc(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Os(e):e}function Rc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Os(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ds);let t={};for(let r of Object.keys(e))t[r]=Ds(e[r]);return t}function Ds(e){return typeof e=="bigint"?e.toString():Os(e)}var Sc=/^(\s*alter\s)/i,Ms=re("prisma:client");function $n(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Sc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var qn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:tr(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:tr(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:tr(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Is(r),i={values:tr(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i!=null&&i.values?Ms(`prisma.${e}(${n}, ${i.values})`):Ms(`prisma.${e}(${n})`),{query:n,parameters:i}},Ns={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new ue(t,r)}},_s={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};d();c();p();f();m();function Un(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||(o==null?void 0:o.kind)==="itx"?n!=null?n:n=Fs(r(o)):Fs(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function Fs(e){return typeof e.then=="function"?e:Promise.resolve(e)}d();c();p();f();m();var Ls={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Vn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){var t,r;return(r=(t=globalThis.PRISMA_INSTRUMENTATION)==null?void 0:t.helper)!=null?r:Ls}};function Bs(e){return e.includes("tracing")?new Vn:Ls}d();c();p();f();m();function $s(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i==null?void 0:i(n)}}}d();c();p();f();m();var Ic=["$connect","$disconnect","$on","$transaction","$use","$extends"],qs=Ic;d();c();p();f();m();function Us(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}d();c();p();f();m();var qr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};d();c();p();f();m();var js=Ue(Xi());d();c();p();f();m();function Ur(e){return typeof e.batchRequestIdx=="number"}d();c();p();f();m();function Vr(e){return e===null?e:Array.isArray(e)?e.map(Vr):typeof e=="object"?kc(e)?Dc(e):ot(e,Vr):e}function kc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Dc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ve(t);case"Json":return JSON.parse(t);default:je(t,"Unknown tagged value")}}d();c();p();f();m();function Vs(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(jn(e.query.arguments)),t.push(jn(e.query.selection)),t.join("")}function jn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${jn(n)})`:r}).join(" ")})`}d();c();p();f();m();var Oc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Jn(e){return Oc[e]}d();c();p();f();m();var jr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),u=this.client._tracingHelper.getTraceParent(s),l=n.some(h=>Jn(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:u,transaction:Nc(o),containsWrite:l,customDataProxyFetch:i})).map((h,x)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[x],h)}catch(S){return S}})}),singleLoader:async n=>{var s;let i=((s=n.transaction)==null?void 0:s.kind)==="itx"?Js(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Jn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>{var i;return(i=n.transaction)!=null&&i.id?`transaction-${n.transaction.id}`:Vs(n.protocolQuery)},batchOrder(n,i){var o,s;return((o=n.transaction)==null?void 0:o.kind)==="batch"&&((s=i.transaction)==null?void 0:s.kind)==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n==null?void 0:n.data,o=n==null?void 0:n.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(Mc(t),_c(t,i)||t instanceof Ie)throw t;if(t instanceof z&&Fc(t)){let u=Qs(t.meta);$r({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=ht({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new z(a,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ke(a,this.client._clientVersion);if(t instanceof ae)throw new ae(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof G)throw new G(a,this.client._clientVersion);if(t instanceof ke)throw new ke(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,js.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=Vr(xn(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function Nc(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Js(e)};je(e,"Unknown transaction kind")}}function Js(e){return{id:e.id,payload:e.payload}}function _c(e,t){return Ur(e)&&(t==null?void 0:t.kind)==="batch"&&e.batchRequestIdx!==t.index}function Fc(e){return e.code==="P2009"||e.code==="P2012"}function Qs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Qs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}d();c();p();f();m();var Gs="5.14.0";var Hs=Gs;d();c();p();f();m();function Ws(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=Ks(t[n]);return r})}function Ks({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return w.Buffer.from(t,"base64");case"decimal":return new ve(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(Ks);default:return t}}d();c();p();f();m();var Xs=Ue(Fn());d();c();p();f();m();var J=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};_(J,"PrismaClientConstructorValidationError");var zs=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Ys=["pretty","colorless","minimal"],Zs=["info","query","warn","error"],Bc={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=xt(r,t)||` Available datasources: ${t.join(", ")}`;throw new J(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new J(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new J('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Nr(t).includes("driverAdapters"))throw new J('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(At()==="binary")throw new J('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e!="undefined"&&typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Ys.includes(e)){let t=xt(e,Ys);throw new J(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Zs.includes(r)){let n=xt(r,Zs);throw new J(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=xt(i,o);throw new J(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new J(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new J(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new J(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new J(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=xt(r,t);throw new J(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ea(e,t){for(let[r,n]of Object.entries(e)){if(!zs.includes(r)){let i=xt(r,zs);throw new J(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Bc[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new J('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function xt(e,t){if(t.length===0||typeof e!="string")return"";let r=$c(e,t);return r?` Did you mean "${r}"?`:""}function $c(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Xs.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},u=l=>{o||(o=!0,r(l))};for(let l=0;l{n[l]=g,a()},g=>{if(!Ur(g)){u(g);return}g.batchRequestIdx===l?u(g):(i||(i=g),a())})})}var Le=re("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var qc={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Uc=Symbol.for("prisma.client.transaction.id"),Vc={id:0,nextId(){return++this.id}};function jc(e){class t{constructor(n){this._originalClient=this;this._middlewares=new qr;this._createPrismaPromise=Un();this.$extends=qo;var u,l,g,h,x,S,C,A,D,O,B,M,I,Z;e=(g=(l=(u=n==null?void 0:n.__internal)==null?void 0:u.configOverride)==null?void 0:l.call(u,e))!=null?g:e,ns(e),n&&ea(n,e);let i=n!=null&&n.adapter?fn(n.adapter):void 0,o=new lr().on("error",()=>{});this._extensions=Or.empty(),this._previewFeatures=Nr(e),this._clientVersion=(h=e.clientVersion)!=null?h:Hs,this._activeProvider=e.activeProvider,this._tracingHelper=Bs(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Ct.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Ct.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=(x=e.injectableEdgeEnv)==null?void 0:x.call(e);try{let L=n!=null?n:{},Ye=(S=L.__internal)!=null?S:{},Be=Ye.debug===!0;Be&&re.enable("prisma:client");let fe=Ct.resolve(e.dirname,e.relativePath);wi.existsSync(fe)||(fe=e.dirname),Le("dirname",e.dirname),Le("relativePath",e.relativePath),Le("cwd",fe);let $e=Ye.engine||{};if(L.errorFormat?this._errorFormat=L.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:fe,dirname:e.dirname,enableDebugLogs:Be,allowTriggerPanic:$e.allowTriggerPanic,datamodelPath:Ct.join(e.dirname,(C=e.filename)!=null?C:"schema.prisma"),prismaPath:(A=$e.binaryPath)!=null?A:void 0,engineEndpoint:$e.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:L.log&&Us(L.log),logQueries:L.log&&!!(typeof L.log=="string"?L.log==="query":L.log.find(Q=>typeof Q=="string"?Q==="query":Q.level==="query")),env:(D=a==null?void 0:a.parsed)!=null?D:{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:is(L,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:(B=(O=L.transactionOptions)==null?void 0:O.maxWait)!=null?B:2e3,timeout:(I=(M=L.transactionOptions)==null?void 0:M.timeout)!=null?I:5e3,isolationLevel:(Z=L.transactionOptions)==null?void 0:Z.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:yt,getBatchRequestPayload:dr,prismaGraphQLToJSError:Bt,PrismaClientUnknownRequestError:ae,PrismaClientInitializationError:G,PrismaClientKnownRequestError:z,debug:re("prisma:client:accelerateEngine"),engineVersion:na.version,clientVersion:e.clientVersion}},Le("clientVersion",e.clientVersion),this._engine=ds(e,this._engineConfig),this._requestHandler=new Jr(this,o),L.log)for(let Q of L.log){let Ce=typeof Q=="string"?Q:Q.emit==="stdout"?Q.level:null;Ce&&this.$on(Ce,qe=>{var Ze;it.log(`${(Ze=it.tags[Ce])!=null?Ze:""}`,qe.message||qe.query)})}this._metrics=new St(this._engine)}catch(L){throw L.clientVersion=this._clientVersion,L}return this._appliedParent=$t(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Vi()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=ra(n,i);return $n(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new ee("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>($n(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new ee(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Ss,callsite:Fe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(Ws)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...ra(n,i));throw new ee("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Vc.nextId(),s=$s(n.length),a=n.map((u,l)=>{var x,S,C;if((u==null?void 0:u[Symbol.toStringTag])!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=(x=i==null?void 0:i.isolationLevel)!=null?x:this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:l,isolationLevel:g,lock:s};return(C=(S=u.requestTransaction)==null?void 0:S.call(u,h))!=null?C:u});return ta(a)}async _transactionWithCallback({callback:n,options:i}){var l,g,h;let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:(l=i==null?void 0:i.maxWait)!=null?l:this._engineConfig.transactionOptions.maxWait,timeout:(g=i==null?void 0:i.timeout)!=null?g:this._engineConfig.transactionOptions.timeout,isolationLevel:(h=i==null?void 0:i.isolationLevel)!=null?h:this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),u;try{let x={kind:"itx",...a};u=await n(this._createItxClient(x)),await this._engine.transaction("commit",o,a)}catch(x){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),x}return u}_createItxClient(n){return $t(ge($o(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>Un(n)),ne(Uc,()=>n.id),st(qs)]))}$transaction(n,i){var a;let o;typeof n=="function"?((a=this._engineConfig.adapter)==null?void 0:a.adapterName)==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){var l;n.otelParentCtx=this._tracingHelper.getActiveContext();let i=(l=n.middlewareArgsMapper)!=null?l:qc,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,u=async g=>{let h=this._middlewares.get(++a);if(h)return this._tracingHelper.runInChildSpan(s.middleware,O=>h(g,B=>(O==null||O.end(),u(B))));let{runInTransaction:x,args:S,...C}=g,A={...n,...C};S&&(A.args=i.middlewareArgsToRequestArgs(S)),n.transaction!==void 0&&x===!1&&delete A.transaction;let D=await Ho(this,A);return A.model?jo({result:D,modelName:A.model,args:A.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):D};return this._tracingHelper.runInChildSpan(s.operation,()=>u(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:u,argsMapper:l,transaction:g,unpacker:h,otelParentCtx:x,customDataProxyFetch:S}){try{n=l?l(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>Cs({modelName:u,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return re.enabled("prisma:client")&&(Le("Prisma Client call:"),Le(`prisma.${i}(${So(n)})`),Le("Generated request:"),Le(JSON.stringify(A,null,2)+` -`)),(g==null?void 0:g.kind)==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:u,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:x,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:S})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new ee("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){var i;return!!((i=this._engineConfig.previewFeatures)!=null&&i.includes(n))}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function ra(e,t){return Jc(e)?[new ue(e,t),Ns]:[e,_s]}function Jc(e){return Array.isArray(e)&&Array.isArray(e.raw)}d();c();p();f();m();var Qc=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Gc(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Qc.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}d();c();p();f();m();var export_warnEnvConflicts=void 0;export{Ui as Debug,ve as Decimal,gi as Extensions,St as MetricsClient,Ie as NotFoundError,G as PrismaClientInitializationError,z as PrismaClientKnownRequestError,ke as PrismaClientRustPanicError,ae as PrismaClientUnknownRequestError,ee as PrismaClientValidationError,yi as Public,ue as Sql,ru as defineDmmfProperty,uu as empty,jc as getPrismaClient,Cn as getRuntime,au as join,Gc as makeStrictEnum,ln as objectEnumValues,io as raw,oo as sqltag,export_warnEnvConflicts as warnEnvConflicts,cr as warnOnce}; -//# sourceMappingURL=edge-esm.js.map diff --git a/integration-tests/tests/prisma/sqlite/client/runtime/edge.js b/integration-tests/tests/prisma/sqlite/client/runtime/edge.js deleted file mode 100644 index 4ed919f76..000000000 --- a/integration-tests/tests/prisma/sqlite/client/runtime/edge.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict";var la=Object.create;var nr=Object.defineProperty;var ca=Object.getOwnPropertyDescriptor;var pa=Object.getOwnPropertyNames;var fa=Object.getPrototypeOf,ma=Object.prototype.hasOwnProperty;var be=(e,t)=>()=>(e&&(t=e(e=0)),t);var Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vt=(e,t)=>{for(var r in t)nr(e,r,{get:t[r],enumerable:!0})},zn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pa(t))!ma.call(e,i)&&i!==r&&nr(e,i,{get:()=>t[i],enumerable:!(n=ca(t,i))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?la(fa(e)):{},zn(t||!e||!e.__esModule?nr(r,"default",{value:e,enumerable:!0}):r,e)),Gr=e=>zn(nr({},"__esModule",{value:!0}),e);var y,c=be(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var Yn,b,p=be(()=>{"use strict";b=(Yn=globalThis.performance)!=null?Yn:(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,f=be(()=>{"use strict";E=()=>{};E.prototype=E});var m=be(()=>{"use strict"});var hi=Se(rt=>{"use strict";d();c();p();f();m();var ri=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),da=ri(e=>{"use strict";e.byteLength=u,e.toByteArray=g,e.fromByteArray=S;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var D=C.indexOf("=");D===-1&&(D=A);var O=D===A?0:4-D%4;return[D,O]}function u(C){var A=a(C),D=A[0],O=A[1];return(D+O)*3/4-O}function l(C,A,D){return(A+D)*3/4-D}function g(C){var A,D=a(C),O=D[0],B=D[1],M=new n(l(C,O,B)),I=0,X=B>0?O-4:O,L;for(L=0;L>16&255,M[I++]=A>>8&255,M[I++]=A&255;return B===2&&(A=r[C.charCodeAt(L)]<<2|r[C.charCodeAt(L+1)]>>4,M[I++]=A&255),B===1&&(A=r[C.charCodeAt(L)]<<10|r[C.charCodeAt(L+1)]<<4|r[C.charCodeAt(L+2)]>>2,M[I++]=A>>8&255,M[I++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function x(C,A,D){for(var O,B=[],M=A;MX?X:I+M));return O===1?(A=C[D-1],B.push(t[A>>2]+t[A<<4&63]+"==")):O===2&&(A=(C[D-2]<<8)+C[D-1],B.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),B.join("")}}),ga=ri(e=>{e.read=function(t,r,n,i,o){var s,a,u=o*8-i-1,l=(1<>1,h=-7,x=n?o-1:0,S=n?-1:1,C=t[r+x];for(x+=S,s=C&(1<<-h)-1,C>>=-h,h+=u;h>0;s=s*256+t[r+x],x+=S,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+x],x+=S,h-=8);if(s===0)s=1-g;else{if(s===l)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,u,l,g=s*8-o-1,h=(1<>1,S=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,D=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(u=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+x>=1?r+=S/l:r+=S*Math.pow(2,1-x),r*l>=2&&(a++,l/=2),a+x>=h?(u=0,a=h):a+x>=1?(u=(r*l-1)*Math.pow(2,o),a=a+x):(u=r*Math.pow(2,x-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=u&255,C+=A,u/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=D*128}}),Hr=da(),et=ga(),Zn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;rt.Buffer=T;rt.SlowBuffer=xa;rt.INSPECT_MAX_BYTES=50;var ir=2147483647;rt.kMaxLength=ir;T.TYPED_ARRAY_SUPPORT=ha();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ha(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function xe(e){if(e>ir)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return zr(e)}return ni(e,t,r)}T.poolSize=8192;function ni(e,t,r){if(typeof e=="string")return wa(e,t);if(ArrayBuffer.isView(e))return Ea(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(me(e,ArrayBuffer)||e&&me(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(e,SharedArrayBuffer)||e&&me(e.buffer,SharedArrayBuffer)))return oi(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=ba(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return ni(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function ii(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function ya(e,t,r){return ii(e),e<=0?xe(e):t!==void 0?typeof r=="string"?xe(e).fill(t,r):xe(e).fill(t):xe(e)}T.alloc=function(e,t,r){return ya(e,t,r)};function zr(e){return ii(e),xe(e<0?0:Yr(e)|0)}T.allocUnsafe=function(e){return zr(e)};T.allocUnsafeSlow=function(e){return zr(e)};function wa(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=si(e,t)|0,n=xe(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Wr(e){let t=e.length<0?0:Yr(e.length)|0,r=xe(t);for(let n=0;n=ir)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ir.toString(16)+" bytes");return e|0}function xa(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),me(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function si(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||me(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Kr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return gi(e).length;default:if(i)return n?-1:Kr(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=si;function Pa(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Oa(this,t,r);case"utf8":case"utf-8":return ui(this,t,r);case"ascii":return ka(this,t,r);case"latin1":case"binary":return Da(this,t,r);case"base64":return Sa(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ma(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function Ve(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Zn&&(T.prototype[Zn]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(me(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),u=this.slice(n,i),l=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Xr(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:Xn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Xn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Xn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function u(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let l;if(i){let g=-1;for(l=r;ls&&(r=s-a),l=r;l>=0;l--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return va(this,e,t,r);case"utf8":case"utf-8":return Ta(this,e,t,r);case"ascii":case"latin1":case"binary":return Ca(this,e,t,r);case"base64":return Aa(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ra(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Sa(e,t,r){return t===0&&r===e.length?Hr.fromByteArray(e):Hr.fromByteArray(e.slice(t,r))}function ui(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let u,l,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],(u&192)===128&&(h=(o&31)<<6|u&63,h>127&&(s=h));break;case 3:u=e[i+1],l=e[i+2],(u&192)===128&&(l&192)===128&&(h=(o&15)<<12|(u&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:u=e[i+1],l=e[i+2],g=e[i+3],(u&192)===128&&(l&192)===128&&(g&192)===128&&(h=(o&15)<<18|(u&63)<<12|(l&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ia(n)}var ei=4096;function Ia(e){let t=e.length;if(t<=ei)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=Ie(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=Ie(function(e){e=e>>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,tt(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&Tt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),et.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),et.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),et.read(this,e,!1,52,8)};function ie(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;ie(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function li(e,t,r,n,i){di(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function ci(e,t,r,n,i){di(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=Ie(function(e,t=0){return li(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=Ie(function(e,t=0){return ci(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);ie(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||ie(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=Ie(function(e,t=0){return li(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=Ie(function(e,t=0){return ci(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function pi(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function fi(e,t,r,n,i){return t=+t,r=r>>>0,i||pi(e,t,r,4,34028234663852886e22,-34028234663852886e22),et.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return fi(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return fi(this,e,t,!1,r)};function mi(e,t,r,n,i){return t=+t,r=r>>>0,i||pi(e,t,r,8,17976931348623157e292,-17976931348623157e292),et.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return mi(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return mi(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=ti(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=ti(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function ti(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Na(e,t,r){tt(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Tt(t,e.length-(r+1))}function di(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Xe.ERR_OUT_OF_RANGE("value",a,e)}Na(n,i,o)}function tt(e,t){if(typeof e!="number")throw new Xe.ERR_INVALID_ARG_TYPE(t,"number",e)}function Tt(e,t,r){throw Math.floor(e)!==e?(tt(e,r),new Xe.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Xe.ERR_BUFFER_OUT_OF_BOUNDS:new Xe.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var _a=/[^+/0-9A-Za-z-_]/g;function Fa(e){if(e=e.split("=")[0],e=e.trim().replace(_a,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Kr(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function La(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function gi(e){return Hr.toByteArray(Fa(e))}function or(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function me(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Xr(e){return e!==e}var $a=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Ie(e){return typeof BigInt>"u"?qa:e}function qa(){throw new Error("BigInt not supported")}});var w,d=be(()=>{"use strict";w=Ue(hi())});function Ua(){return!1}var Va,ja,bi,xi=be(()=>{"use strict";d();c();p();f();m();Va={},ja={existsSync:Ua,promises:Va},bi=ja});var Mi=Se((df,Oi)=>{"use strict";d();c();p();f();m();Oi.exports=(on(),Gr(nn)).format});var nn={};vt(nn,{default:()=>Ga,deprecate:()=>_i,format:()=>Li,inspect:()=>Fi,promisify:()=>Ni});function Ni(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function _i(e,t){return(...r)=>(console.warn(t),e(...r))}function Fi(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var Li,Qa,Ga,on=be(()=>{"use strict";d();c();p();f();m();Li=Mi(),Qa={promisify:Ni,deprecate:_i,inspect:Fi,format:Li},Ga=Qa});function Ya(...e){return e.join("/")}function Za(...e){return e.join("/")}var Ji,Xa,eu,At,Qi=be(()=>{"use strict";d();c();p();f();m();Ji="/",Xa={sep:Ji},eu={resolve:Ya,posix:Xa,join:Za,sep:Ji},At=eu});var lr,Hi=be(()=>{"use strict";d();c();p();f();m();lr=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var Ki=Se((Em,Wi)=>{"use strict";d();c();p();f();m();Wi.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 Zi=Se((Dm,Yi)=>{"use strict";d();c();p();f();m();Yi.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 eo=Se((Lm,Xi)=>{"use strict";d();c();p();f();m();var su=Zi();Xi.exports=e=>typeof e=="string"?e.replace(su(),""):e});var io=Se((Mh,cu)=>{cu.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var oo=Se(()=>{"use strict";d();c();p();f();m()});var Un=Se((a2,ys)=>{"use strict";d();c();p();f();m();ys.exports=function(){function e(t,r,n,i,o){return tn?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;san,Decimal:()=>ye,Extensions:()=>en,MetricsClient:()=>st,NotFoundError:()=>Pe,PrismaClientInitializationError:()=>G,PrismaClientKnownRequestError:()=>K,PrismaClientRustPanicError:()=>ve,PrismaClientUnknownRequestError:()=>oe,PrismaClientValidationError:()=>Y,Public:()=>tn,Sql:()=>se,defineDmmfProperty:()=>no,empty:()=>ao,getPrismaClient:()=>sa,getRuntime:()=>Mr,join:()=>so,makeStrictEnum:()=>aa,objectEnumValues:()=>pr,raw:()=>yn,sqltag:()=>wn,warnEnvConflicts:()=>void 0,warnOnce:()=>It});module.exports=Gr(Hc);d();c();p();f();m();var en={};vt(en,{defineExtension:()=>yi,getExtensionContext:()=>wi});d();c();p();f();m();d();c();p();f();m();function yi(e){return typeof e=="function"?e:t=>t.$extends(e)}d();c();p();f();m();function wi(e){return e}var tn={};vt(tn,{validator:()=>Ei});d();c();p();f();m();d();c();p();f();m();function Ei(...e){return t=>t}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var rn,Pi,vi,Ti,Ci=!0;typeof y!="undefined"&&({FORCE_COLOR:rn,NODE_DISABLE_COLORS:Pi,NO_COLOR:vi,TERM:Ti}=y.env||{},Ci=y.stdout&&y.stdout.isTTY);var Ja={enabled:!Pi&&vi==null&&Ti!=="dumb"&&(rn!=null&&rn!=="0"||Ci)};function V(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ja.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Jp=V(0,0),sr=V(1,22),ar=V(2,22),Qp=V(3,23),Ai=V(4,24),Gp=V(7,27),Hp=V(8,28),Wp=V(9,29),Kp=V(30,39),nt=V(31,39),Ri=V(32,39),Si=V(33,39),Ii=V(34,39),zp=V(35,39),ki=V(36,39),Yp=V(37,39),Di=V(90,39),Zp=V(90,39),Xp=V(40,49),ef=V(41,49),tf=V(42,49),rf=V(43,49),nf=V(44,49),of=V(45,49),sf=V(46,49),af=V(47,49);d();c();p();f();m();var Ha=100,Bi=["green","yellow","blue","magenta","cyan","red"],ur=[],$i=Date.now(),Wa=0,sn=typeof y!="undefined"?y.env:{},qi,Ui;(Ui=globalThis.DEBUG)!=null||(globalThis.DEBUG=(qi=sn.DEBUG)!=null?qi:"");var Vi;(Vi=globalThis.DEBUG_COLORS)!=null||(globalThis.DEBUG_COLORS=sn.DEBUG_COLORS?sn.DEBUG_COLORS==="true":!0);var Ct={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)=>{var o;let[t,r,...n]=e,i;typeof require=="function"&&typeof y!="undefined"&&typeof y.stderr!="undefined"&&typeof y.stderr.write=="function"?i=(...s)=>{var a;try{let u=(on(),Gr(nn));y.stderr.write(u.format(...s)+` -`)}catch(u){i=(a=console.warn)!=null?a:console.log}}:i=(o=console.warn)!=null?o:console.log,i(`${t} ${r}`,...n)},formatters:{}};function Ka(e){let t={color:Bi[Wa++%Bi.length],enabled:Ct.enabled(e),namespace:e,log:Ct.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&ur.push([o,...n]),ur.length>Ha&&ur.shift(),Ct.enabled(o)||i){let u=n.map(g=>typeof g=="string"?g:za(g)),l=`+${Date.now()-$i}ms`;$i=Date.now(),a(o,...u,l)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var an=new Proxy(Ka,{get:(e,t)=>Ct[t],set:(e,t,r)=>Ct[t]=r});function za(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 ji(){ur.length=0}var re=an;d();c();p();f();m();d();c();p();f();m();var Gi="library";function Rt(e){let t=tu();return t||((e==null?void 0:e.config.engineType)==="library"?"library":(e==null?void 0:e.config.engineType)==="binary"?"binary":Gi)}function tu(){let e=y.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}d();c();p();f();m();d();c();p();f();m();var ke;(t=>{let e;(I=>(I.findUnique="findUnique",I.findUniqueOrThrow="findUniqueOrThrow",I.findFirst="findFirst",I.findFirstOrThrow="findFirstOrThrow",I.findMany="findMany",I.create="create",I.createMany="createMany",I.createManyAndReturn="createManyAndReturn",I.update="update",I.updateMany="updateMany",I.upsert="upsert",I.delete="delete",I.deleteMany="deleteMany",I.groupBy="groupBy",I.count="count",I.aggregate="aggregate",I.findRaw="findRaw",I.aggregateRaw="aggregateRaw"))(e=t.ModelAction||(t.ModelAction={}))})(ke||(ke={}));var it={};vt(it,{error:()=>iu,info:()=>nu,log:()=>ru,query:()=>ou,should:()=>zi,tags:()=>St,warn:()=>un});d();c();p();f();m();var St={error:nt("prisma:error"),warn:Si("prisma:warn"),info:ki("prisma:info"),query:Ii("prisma:query")},zi={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function ru(...e){console.log(...e)}function un(e,...t){zi.warn()&&console.warn(`${St.warn} ${e}`,...t)}function nu(e,...t){console.info(`${St.info} ${e}`,...t)}function iu(e,...t){console.error(`${St.error} ${e}`,...t)}function ou(e,...t){console.log(`${St.query} ${e}`,...t)}d();c();p();f();m();function je(e,t){throw new Error(t)}d();c();p();f();m();function ln(e,t){return Object.prototype.hasOwnProperty.call(e,t)}d();c();p();f();m();var cn=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});d();c();p();f();m();function ot(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}d();c();p();f();m();function pn(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{to.has(e)||(to.add(e),un(t,...r))};d();c();p();f();m();var K=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};_(K,"PrismaClientKnownRequestError");var Pe=class extends K{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};_(Pe,"NotFoundError");d();c();p();f();m();var G=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};_(G,"PrismaClientInitializationError");d();c();p();f();m();var ve=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};_(ve,"PrismaClientRustPanicError");d();c();p();f();m();var oe=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};_(oe,"PrismaClientUnknownRequestError");d();c();p();f();m();var Y=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};_(Y,"PrismaClientValidationError");d();c();p();f();m();var st=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};d();c();p();f();m();d();c();p();f();m();function kt(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function no(e,t){let r=kt(()=>au(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function au(e){return{datamodel:{models:fn(e.models),enums:fn(e.enums),types:fn(e.types)}}}function fn(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}d();c();p();f();m();var cr=Symbol(),mn=new WeakMap,Te=class{constructor(t){t===cr?mn.set(this,`Prisma.${this._getName()}`):mn.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return mn.get(this)}},Dt=class extends Te{_getNamespace(){return"NullTypes"}},Ot=class extends Dt{};dn(Ot,"DbNull");var Mt=class extends Dt{};dn(Mt,"JsonNull");var Nt=class extends Dt{};dn(Nt,"AnyNull");var pr={classes:{DbNull:Ot,JsonNull:Mt,AnyNull:Nt},instances:{DbNull:new Ot(cr),JsonNull:new Mt(cr),AnyNull:new Nt(cr)}};function dn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function _t(e){return{ok:!1,error:e,map(){return _t(e)},flatMap(){return _t(e)}}}var gn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},hn=e=>{let t=new gn,r=Je(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Je(t,e.queryRaw.bind(e)),executeRaw:Je(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>uu(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=lu(t,e.getConnectionInfo.bind(e))),n},uu=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Je(e,t.queryRaw.bind(t)),executeRaw:Je(e,t.executeRaw.bind(t)),commit:Je(e,t.commit.bind(t)),rollback:Je(e,t.rollback.bind(t))});function Je(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}function lu(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}var oa=Ue(io());var gD=Ue(oo());Hi();xi();Qi();d();c();p();f();m();var se=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){var n;return(n=e.getPropertyDescriptor)==null?void 0:n.call(e,r)}}}d();c();p();f();m();d();c();p();f();m();var fr={enumerable:!0,configurable:!0,writable:!0};function mr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>fr,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var uo=Symbol.for("nodejs.util.inspect.custom");function ge(e,t){let r=pu(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){var u,l;if(n.has(s))return!0;let a=r.get(s);return a?(l=(u=a.has)==null?void 0:u.call(a,s))!=null?l:!0:Reflect.has(o,s)},ownKeys(o){let s=lo(Reflect.ownKeys(o),r),a=lo(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){var l,g;let u=r.get(s);return((g=(l=u==null?void 0:u.getPropertyDescriptor)==null?void 0:l.call(u,s))==null?void 0:g.writable)===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let u=r.get(s);return u?u.getPropertyDescriptor?{...fr,...u==null?void 0:u.getPropertyDescriptor(s)}:fr:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[uo]=function(){let o={...this};return delete o[uo],o},i}function pu(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function lo(e,t){return e.filter(r=>{var i,o;let n=t.get(r);return(o=(i=n==null?void 0:n.has)==null?void 0:i.call(n,r))!=null?o:!0})}d();c();p();f();m();function at(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}d();c();p();f();m();function dr(e,t){return{batch:e,transaction:(t==null?void 0:t.kind)==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}d();c();p();f();m();d();c();p();f();m();var ut=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};d();c();p();f();m();d();c();p();f();m();function co(e){return e.substring(0,1).toLowerCase()+e.substring(1)}d();c();p();f();m();function lt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function gr(e){return e.toString()!=="Invalid Date"}d();c();p();f();m();d();c();p();f();m();var ct=9e15,Ne=1e9,En="0123456789abcdef",yr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",wr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",bn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ct,maxE:ct,crypto:!1},go,Ce,F=!0,br="[DecimalError] ",Me=br+"Invalid argument: ",ho=br+"Precision limit exceeded",yo=br+"crypto unavailable",wo="[object Decimal]",te=Math.floor,H=Math.pow,fu=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,mu=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,du=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Eo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,pe=1e7,N=7,gu=9007199254740991,hu=yr.length-1,xn=wr.length-1,R={toStringTag:wo};R.absoluteValue=R.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),k(e)};R.ceil=function(){return k(new this.constructor(this),this.e+1,2)};R.clampedTo=R.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Me+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};R.comparedTo=R.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,u=o.s,l=e.s;if(!s||!a)return!u||!l?NaN:u!==l?u:s===a?0:!s^u<0?1:-1;if(!s[0]||!a[0])return s[0]?u:a[0]?-l:0;if(u!==l)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1};R.cosine=R.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=yu(n,To(n,r)),n.precision=e,n.rounding=t,k(Ce==2||Ce==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};R.cubeRoot=R.cbrt=function(){var e,t,r,n,i,o,s,a,u,l,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(F=!1,o=g.s*H(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Z(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=H(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,u=a.times(a).times(a),l=u.plus(g),n=q(l.plus(g).times(a),l.plus(u),s+2,1),Z(a.d).slice(0,s)===(r=Z(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(k(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(k(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return F=!0,k(n,e,h.rounding,t)};R.decimalPlaces=R.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/N))*N,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};R.dividedBy=R.div=function(e){return q(this,new this.constructor(e))};R.dividedToIntegerBy=R.divToInt=function(e){var t=this,r=t.constructor;return k(q(t,new r(e),0,1,1),r.precision,r.rounding)};R.equals=R.eq=function(e){return this.cmp(e)===0};R.floor=function(){return k(new this.constructor(this),this.e+1,3)};R.greaterThan=R.gt=function(e){return this.cmp(e)>0};R.greaterThanOrEqualTo=R.gte=function(e){var t=this.cmp(e);return t==1||t===0};R.hyperbolicCosine=R.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/Pr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=pt(s,1,o.times(t),new s(1),!0);for(var u,l=e,g=new s(8);l--;)u=o.times(o),o=a.minus(u.times(g.minus(u.times(g))));return k(o,s.precision=r,s.rounding=n,!0)};R.hyperbolicSine=R.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=pt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/Pr(5,e)),i=pt(o,2,i,i,!0);for(var s,a=new o(5),u=new o(16),l=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(u.times(s).plus(l))))}return o.precision=t,o.rounding=r,k(i,t,r,!0)};R.hyperbolicTangent=R.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,q(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};R.inverseCosine=R.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?ce(r,i,o):new r(0):new r(NaN):t.isZero()?ce(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=ce(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};R.inverseHyperbolicCosine=R.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,F=!1,r=r.times(r).minus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};R.inverseHyperbolicSine=R.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,F=!1,r=r.times(r).plus(1).sqrt().plus(r),F=!0,n.precision=e,n.rounding=t,r.ln())};R.inverseHyperbolicTangent=R.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?k(new o(i),e,t,!0):(o.precision=r=n-i.e,i=q(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};R.inverseSine=R.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=ce(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};R.inverseTangent=R.atan=function(){var e,t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding;if(l.isFinite()){if(l.isZero())return new g(l);if(l.abs().eq(1)&&h+4<=xn)return s=ce(g,h+4,x).times(.25),s.s=l.s,s}else{if(!l.s)return new g(NaN);if(h+4<=xn)return s=ce(g,h+4,x).times(.5),s.s=l.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/N+2|0),e=r;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(F=!1,t=Math.ceil(a/N),n=1,u=l.times(l),s=new g(l),i=l;e!==-1;)if(i=i.times(u),o=s.minus(i.div(n+=2)),i=i.times(u),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};R.isNaN=function(){return!this.s};R.isNegative=R.isNeg=function(){return this.s<0};R.isPositive=R.isPos=function(){return this.s>0};R.isZero=function(){return!!this.d&&this.d[0]===0};R.lessThan=R.lt=function(e){return this.cmp(e)<0};R.lessThanOrEqualTo=R.lte=function(e){return this.cmp(e)<1};R.logarithm=R.log=function(e){var t,r,n,i,o,s,a,u,l=this,g=l.constructor,h=g.precision,x=g.rounding,S=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=l.d,l.s<0||!r||!r[0]||l.eq(1))return new g(r&&!r[0]?-1/0:l.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(F=!1,a=h+S,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),Lt(u.d,i=h,x))do if(a+=10,s=Oe(l,a),n=t?Er(g,a+10):Oe(e,a),u=q(s,n,a,1),!o){+Z(u.d).slice(i+1,i+15)+1==1e14&&(u=k(u,h+1,0));break}while(Lt(u.d,i+=10,x));return F=!0,k(u,h,x)};R.minus=R.sub=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.constructor;if(e=new C(e),!S.d||!e.d)return!S.s||!e.s?e=new C(NaN):S.d?e.s=-e.s:e=new C(e.d||S.s!==e.s?S:NaN),e;if(S.s!=e.s)return e.s=-e.s,S.plus(e);if(l=S.d,x=e.d,a=C.precision,u=C.rounding,!l[0]||!x[0]){if(x[0])e.s=-e.s;else if(l[0])e=new C(S);else return new C(u===3?-0:0);return F?k(e,a,u):e}if(r=te(e.e/N),g=te(S.e/N),l=l.slice(),o=g-r,o){for(h=o<0,h?(t=l,o=-o,s=x.length):(t=x,r=g,s=l.length),n=Math.max(Math.ceil(a/N),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=l.length,s=x.length,h=n0;--n)l[s++]=0;for(n=x.length;n>o;){if(l[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=g.length,s-i<0&&(i=s,r=g,g=l,l=r),t=0;i;)t=(l[--i]=l[i]+g[i]+t)/pe|0,l[i]%=pe;for(t&&(l.unshift(t),++n),s=l.length;l[--s]==0;)l.pop();return e.d=l,e.e=xr(l,n),F?k(e,a,u):e};R.precision=R.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Me+e);return r.d?(t=bo(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};R.round=function(){var e=this,t=e.constructor;return k(new t(e),e.e+1,t.rounding)};R.sine=R.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+N,n.rounding=1,r=Eu(n,To(n,r)),n.precision=e,n.rounding=t,k(Ce>2?r.neg():r,e,t,!0)):new n(NaN)};R.squareRoot=R.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,u=s.e,l=s.s,g=s.constructor;if(l!==1||!a||!a[0])return new g(!l||l<0&&(!a||a[0])?NaN:a?s:1/0);for(F=!1,l=Math.sqrt(+s),l==0||l==1/0?(t=Z(a),(t.length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=te((u+1)/2)-(u<0||u%2),l==1/0?t="5e"+u:(t=l.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),n=new g(t)):n=new g(l.toString()),r=(u=g.precision)+3;;)if(o=n,n=o.plus(q(s,o,r+2,1)).times(.5),Z(o.d).slice(0,r)===(t=Z(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(k(o,u+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(k(n,u+1,1),e=!n.times(n).eq(s));break}return F=!0,k(n,u,g.rounding,e)};R.tangent=R.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=q(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,k(Ce==2||Ce==4?r.neg():r,e,t,!0)):new n(NaN)};R.times=R.mul=function(e){var t,r,n,i,o,s,a,u,l,g=this,h=g.constructor,x=g.d,S=(e=new h(e)).d;if(e.s*=g.s,!x||!x[0]||!S||!S[0])return new h(!e.s||x&&!x[0]&&!S||S&&!S[0]&&!x?NaN:!x||!S?e.s/0:e.s*0);for(r=te(g.e/N)+te(e.e/N),u=x.length,l=S.length,u=0;){for(t=0,i=u+n;i>n;)a=o[i]+S[n]*x[i-n-1]+t,o[i--]=a%pe|0,t=a/pe|0;o[i]=(o[i]+t)%pe|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=xr(o,r),F?k(e,h.precision,h.rounding):e};R.toBinary=function(e,t){return Tn(this,2,e,t)};R.toDecimalPlaces=R.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ae(e,0,Ne),t===void 0?t=n.rounding:ae(t,0,8),k(r,e+r.e+1,t))};R.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,!0):(ae(e,0,Ne),t===void 0?t=i.rounding:ae(t,0,8),n=k(new i(n),e+1,t),r=he(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=he(i):(ae(e,0,Ne),t===void 0?t=o.rounding:ae(t,0,8),n=k(new o(i),e+i.e+1,t),r=he(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};R.toFraction=function(e){var t,r,n,i,o,s,a,u,l,g,h,x,S=this,C=S.d,A=S.constructor;if(!C)return new A(S);if(l=r=new A(1),n=u=new A(0),t=new A(n),o=t.e=bo(C)-S.e-1,s=o%N,t.d[0]=H(10,s<0?N+s:s),e==null)e=o>0?t:l;else{if(a=new A(e),!a.isInt()||a.lt(l))throw Error(Me+a);e=a.gt(t)?o>0?t:l:a}for(F=!1,a=new A(Z(C)),g=A.precision,A.precision=o=C.length*N*2;h=q(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=l,l=u.plus(h.times(i)),u=i,i=t,t=a.minus(h.times(i)),a=i;return i=q(e.minus(r),n,0,1,1),u=u.plus(i.times(l)),r=r.plus(i.times(n)),u.s=l.s=S.s,x=q(l,n,o,1).minus(S).abs().cmp(q(u,r,o,1).minus(S).abs())<1?[l,n]:[u,r],A.precision=g,F=!0,x};R.toHexadecimal=R.toHex=function(e,t){return Tn(this,16,e,t)};R.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ae(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(F=!1,r=q(r,e,0,t,1).times(e),F=!0,k(r)):(e.s=r.s,r=e),r};R.toNumber=function(){return+this};R.toOctal=function(e,t){return Tn(this,8,e,t)};R.toPower=R.pow=function(e){var t,r,n,i,o,s,a=this,u=a.constructor,l=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(H(+a,l));if(a=new u(a),a.eq(1))return a;if(n=u.precision,o=u.rounding,e.eq(1))return k(a,n,o);if(t=te(e.e/N),t>=e.d.length-1&&(r=l<0?-l:l)<=gu)return i=xo(u,a,r,n),e.s<0?new u(1).div(i):k(i,n,o);if(s=a.s,s<0){if(tu.maxE+1||t0?s/0:0):(F=!1,u.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Pn(e.times(Oe(a,n+r)),n),i.d&&(i=k(i,n+5,1),Lt(i.d,n,o)&&(t=n+10,i=k(Pn(e.times(Oe(a,t+r)),t),t+5,1),+Z(i.d).slice(n+1,n+15)+1==1e14&&(i=k(i,n+1,0)))),i.s=s,F=!0,u.rounding=o,k(i,n,o))};R.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=he(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ae(e,1,Ne),t===void 0?t=i.rounding:ae(t,0,8),n=k(new i(n),e,t),r=he(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};R.toSignificantDigits=R.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ae(e,1,Ne),t===void 0?t=n.rounding:ae(t,0,8)),k(new n(r),e,t)};R.toString=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};R.truncated=R.trunc=function(){return k(new this.constructor(this),this.e+1,1)};R.valueOf=R.toJSON=function(){var e=this,t=e.constructor,r=he(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Z(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(Me+e)}function Lt(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=N,i=0):(i=Math.ceil((t+1)/N),t%=N),o=H(10,N-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==H(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==H(10,t-3)-1,s}function hr(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function yu(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/Pr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=pt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var q=function(){function e(n,i,o){var s,a=0,u=n.length;for(n=n.slice();u--;)s=n[u]*i+a,n[u]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,u;if(o!=s)u=o>s?1:-1;else for(a=u=0;ai[a]?1:-1;break}return u}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,u){var l,g,h,x,S,C,A,D,O,B,M,I,X,L,Ye,Be,fe,$e,Q,Re,qe=n.constructor,Ze=n.s==i.s?1:-1,ee=n.d,U=i.d;if(!ee||!ee[0]||!U||!U[0])return new qe(!n.s||!i.s||(ee?U&&ee[0]==U[0]:!U)?NaN:ee&&ee[0]==0||!U?Ze*0:Ze/0);for(u?(S=1,g=n.e-i.e):(u=pe,S=N,g=te(n.e/S)-te(i.e/S)),Q=U.length,fe=ee.length,O=new qe(Ze),B=O.d=[],h=0;U[h]==(ee[h]||0);h++);if(U[h]>(ee[h]||0)&&g--,o==null?(L=o=qe.precision,s=qe.rounding):a?L=o+(n.e-i.e)+1:L=o,L<0)B.push(1),C=!0;else{if(L=L/S+2|0,h=0,Q==1){for(x=0,U=U[0],L++;(h1&&(U=e(U,x,u),ee=e(ee,x,u),Q=U.length,fe=ee.length),Be=Q,M=ee.slice(0,Q),I=M.length;I=u/2&&++$e;do x=0,l=t(U,M,Q,I),l<0?(X=M[0],Q!=I&&(X=X*u+(M[1]||0)),x=X/$e|0,x>1?(x>=u&&(x=u-1),A=e(U,x,u),D=A.length,I=M.length,l=t(A,M,D,I),l==1&&(x--,r(A,Q=10;x/=10)h++;O.e=h+g*S-1,k(O,a?o+O.e+1:o,s,C)}return O}}();function k(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=N,s=t,g=h[x=0],u=g/H(10,i-s-1)%10|0;else if(x=Math.ceil((o+1)/N),a=h.length,x>=a)if(n){for(;a++<=x;)h.push(0);g=u=0,i=1,o%=N,s=o-N+1}else break e;else{for(g=a=h[x],i=1;a>=10;a/=10)i++;o%=N,s=o-N+i,u=s<0?0:g/H(10,i-s-1)%10|0}if(n=n||t<0||h[x+1]!==void 0||(s<0?g:g%H(10,i-s-1)),l=r<4?(u||n)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||n||r==6&&(o>0?s>0?g/H(10,i-s):0:h[x-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,l?(t-=e.e+1,h[0]=H(10,(N-t%N)%N),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=x,a=1,x--):(h.length=x+1,a=H(10,N-o),h[x]=s>0?(g/H(10,i-s)%H(10,s)|0)*a:0),l)for(;;)if(x==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==pe&&(h[0]=1));break}else{if(h[x]+=a,h[x]!=pe)break;h[x--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return F&&(e.e>S.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+De(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+De(-i-1)+o,r&&(n=r-s)>0&&(o+=De(n))):i>=s?(o+=De(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+De(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=De(n))),o}function xr(e,t){var r=e[0];for(t*=N;r>=10;r/=10)t++;return t}function Er(e,t,r){if(t>hu)throw F=!0,r&&(e.precision=r),Error(ho);return k(new e(yr),t,1,!0)}function ce(e,t,r){if(t>xn)throw Error(ho);return k(new e(wr),t,r,!0)}function bo(e){var t=e.length-1,r=t*N+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function De(e){for(var t="";e--;)t+="0";return t}function xo(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/N+4);for(F=!1;;){if(r%2&&(o=o.times(t),fo(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),fo(t.d,s)}return F=!0,o}function po(e){return e.d[e.d.length-1]&1}function Po(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new x(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(F=!1,u=C):u=t,a=new x(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(H(2,h))/Math.LN10*2+5|0,u+=n,r=o=s=new x(1),x.precision=u;;){if(o=k(o.times(e),u,1),r=r.times(++g),a=s.plus(q(o,r,u,1)),Z(a.d).slice(0,u)===Z(s.d).slice(0,u)){for(i=h;i--;)s=k(s.times(s),u,1);if(t==null)if(l<3&&Lt(s.d,u-n,S,l))x.precision=u+=10,r=o=a=new x(1),g=0,l++;else return k(s,x.precision=C,S,F=!0);else return x.precision=C,s}s=a}}function Oe(e,t){var r,n,i,o,s,a,u,l,g,h,x,S=1,C=10,A=e,D=A.d,O=A.constructor,B=O.rounding,M=O.precision;if(A.s<0||!D||!D[0]||!A.e&&D[0]==1&&D.length==1)return new O(D&&!D[0]?-1/0:A.s!=1?NaN:D?0:A);if(t==null?(F=!1,g=M):g=t,O.precision=g+=C,r=Z(D),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Z(A.d),n=r.charAt(0),S++;o=A.e,n>1?(A=new O("0."+r),o++):A=new O(n+"."+r.slice(1))}else return l=Er(O,g+2,M).times(o+""),A=Oe(new O(n+"."+r.slice(1)),g-C).plus(l),O.precision=M,t==null?k(A,M,B,F=!0):A;for(h=A,u=s=A=q(A.minus(1),A.plus(1),g,1),x=k(A.times(A),g,1),i=3;;){if(s=k(s.times(x),g,1),l=u.plus(q(s,new O(i),g,1)),Z(l.d).slice(0,g)===Z(u.d).slice(0,g))if(u=u.times(2),o!==0&&(u=u.plus(Er(O,g+2,M).times(o+""))),u=q(u,new O(S),g,1),t==null)if(Lt(u.d,g-C,B,a))O.precision=g+=C,l=s=A=q(h.minus(1),h.plus(1),g,1),x=k(A.times(A),g,1),i=a=1;else return k(u,O.precision=M,B,F=!0);else return O.precision=M,u;u=l,i+=2}}function vo(e){return String(e.s*e.s/0)}function vn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%N,r<0&&(n+=N),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Eo.test(t))return vn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(mu.test(t))r=16,t=t.toLowerCase();else if(fu.test(t))r=2;else if(du.test(t))r=8;else throw Error(Me+t);for(o=t.search(/p/i),o>0?(u=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=xo(n,new n(r),o,o*2)),l=hr(t,r,pe),g=l.length-1,o=g;l[o]===0;--o)l.pop();return o<0?new n(e.s*0):(e.e=xr(l,g),e.d=l,F=!1,s&&(e=q(e,i,a*4)),u&&(e=e.times(Math.abs(u)<54?H(2,u):Ge.pow(2,u))),F=!0,e)}function Eu(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:pt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/Pr(5,r)),t=pt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function pt(e,t,r,n,i){var o,s,a,u,l=1,g=e.precision,h=Math.ceil(g/N);for(F=!1,u=r.times(r),a=new e(n);;){if(s=q(a.times(u),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=q(s.times(u),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,l++}return F=!0,s.d.length=h+1,s}function Pr(e,t){for(var r=e;--t;)r*=e;return r}function To(e,t){var r,n=t.s<0,i=ce(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Ce=n?4:1,t;if(r=t.divToInt(i),r.isZero())Ce=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Ce=po(r)?n?2:3:n?4:1,t;Ce=po(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Tn(e,t,r,n){var i,o,s,a,u,l,g,h,x,S=e.constructor,C=r!==void 0;if(C?(ae(r,1,Ne),n===void 0?n=S.rounding:ae(n,0,8)):(r=S.precision,n=S.rounding),!e.isFinite())g=vo(e);else{for(g=he(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),x=new S(1),x.e=g.length-s,x.d=hr(he(x),10,i),x.e=x.d.length),h=hr(g,10,i),o=u=h.length;h[--u]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new S(e),e.d=h,e.e=o,e=q(e,x,r,n,0,i),h=e.d,o=e.e,l=go),s=h[r],a=i/2,l=l||h[r+1]!==void 0,l=n<4?(s!==void 0||l)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||l||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,l)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(u=h.length;!h[u-1];--u);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--u;u%s;u++)g+="0";for(h=hr(g,i,t),u=h.length;!h[u-1];--u);for(s=1,g="1.";su)for(o-=u;o--;)g+="0";else ot)return e.length=t,!0}function bu(e){return new this(e).abs()}function xu(e){return new this(e).acos()}function Pu(e){return new this(e).acosh()}function vu(e,t){return new this(e).plus(t)}function Tu(e){return new this(e).asin()}function Cu(e){return new this(e).asinh()}function Au(e){return new this(e).atan()}function Ru(e){return new this(e).atanh()}function Su(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=ce(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?ce(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=ce(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(q(e,t,o,1)),t=ce(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(q(e,t,o,1)),r}function Iu(e){return new this(e).cbrt()}function ku(e){return k(e=new this(e),e.e+1,2)}function Du(e,t,r){return new this(e).clamp(t,r)}function Ou(e){if(!e||typeof e!="object")throw Error(br+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ne,"rounding",0,8,"toExpNeg",-ct,0,"toExpPos",0,ct,"maxE",0,ct,"minE",-ct,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Me+r+": "+n);if(r="crypto",i&&(this[r]=bn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto!="undefined"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(yo);else this[r]=!1;else throw Error(Me+r+": "+n);return this}function Mu(e){return new this(e).cos()}function Nu(e){return new this(e).cosh()}function Co(e){var t,r,n;function i(o){var s,a,u,l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,mo(o)){l.s=o.s,F?!o.d||o.e>i.maxE?(l.e=NaN,l.d=null):o.e=10;a/=10)s++;F?s>i.maxE?(l.e=NaN,l.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(yo);else for(;o=10;i/=10)n++;n`}};function mt(e){return e instanceof Bt}d();c();p();f();m();d();c();p();f();m();var vr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};d();c();p();f();m();var Tr=e=>e,Cr={bold:Tr,red:Tr,green:Tr,dim:Tr,enabled:!1},Ao={bold:sr,red:nt,green:Ri,dim:ar,enabled:!0},dt={write(e){e.writeLine(",")}};d();c();p();f();m();var we=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};d();c();p();f();m();var _e=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var gt=class extends _e{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new vr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new we("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(dt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};d();c();p();f();m();var Ro=": ",Ar=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Ro.length}write(t){let r=new we(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Ro).write(this.value)}};d();c();p();f();m();var Rr=class e extends _e{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let u;if(s.value instanceof e?u=s.value.getField(a):s.value instanceof gt&&(u=s.value.getField(Number(a))),!u)return;s=u}return s}getDeepFieldValue(r){var n;return r.length===0?this:(n=this.getDeepField(r))==null?void 0:n.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){var n;return(n=this.getField(r))==null?void 0:n.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){var i,o;let r=(i=this.getField("select"))==null?void 0:i.value.asObject();if(r)return{kind:"select",value:r};let n=(o=this.getField("include"))==null?void 0:o.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){var n;return(n=this.getSelectionParent())==null?void 0:n.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new we("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(dt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};d();c();p();f();m();var z=class extends _e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new we(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var Cn=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Sr(e){return new Cn(So(e))}function So(e){let t=new Rr;for(let[r,n]of Object.entries(e)){let i=new Ar(r,Io(n));t.addField(i)}return t}function Io(e){if(typeof e=="string")return new z(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new z(String(e));if(typeof e=="bigint")return new z(`${e}n`);if(e===null)return new z("null");if(e===void 0)return new z("undefined");if(ft(e))return new z(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new z(`Buffer.alloc(${e.byteLength})`):new z(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=gr(e)?e.toISOString():"Invalid Date";return new z(`new Date("${t}")`)}return e instanceof Te?new z(`Prisma.${e._getName()}`):mt(e)?new z(`prisma.${co(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?sl(e):typeof e=="object"?So(e):new z(Object.prototype.toString.call(e))}function sl(e){let t=new gt;for(let r of e)t.addItem(Io(r));return t}function ko(e){if(e===void 0)return"";let t=Sr(e);return new ut(0,{colors:Cr}).write(t).toString()}d();c();p();f();m();var al="P2037";function $t({error:e,user_facing_error:t},r,n){return t.error_code?new K(ul(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new oe(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function ul(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===al&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var An=class{getLocation(){return null}};function Fe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new An}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Do={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function ht(e={}){let t=cl(e);return Object.entries(t).reduce((n,[i,o])=>(Do[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function cl(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Ir(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function Oo(e,t){let r=Ir(e);return t({action:"aggregate",unpacker:r,argsMapper:ht})(e)}d();c();p();f();m();function pl(e={}){let{select:t,...r}=e;return typeof t=="object"?ht({...r,_count:t}):ht({...r,_count:{_all:!0}})}function fl(e={}){return typeof e.select=="object"?t=>Ir(e)(t)._count:t=>Ir(e)(t)._count._all}function Mo(e,t){return t({action:"count",unpacker:fl(e),argsMapper:pl})(e)}d();c();p();f();m();function ml(e={}){let t=ht(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function dl(e={}){return t=>(typeof(e==null?void 0:e._count)=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function No(e,t){return t({action:"groupBy",unpacker:dl(e),argsMapper:ml})(e)}function _o(e,t,r){if(t==="aggregate")return n=>Oo(n,r);if(t==="count")return n=>Mo(n,r);if(t==="groupBy")return n=>No(n,r)}d();c();p();f();m();function Fo(e,t){let r=t.fields.filter(i=>!i.relationName),n=cn(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Bt(e,o,s.type,s.isList,s.kind==="enum")},...mr(Object.keys(n))})}d();c();p();f();m();d();c();p();f();m();var Lo=e=>Array.isArray(e)?e:e.split("."),Rn=(e,t)=>Lo(t).reduce((r,n)=>r&&r[n],e),Bo=(e,t,r)=>Lo(t).reduceRight((n,i,o,s)=>Object.assign({},Rn(e,s.slice(0,o)),{[i]:n}),r);function gl(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function hl(e,t,r){return t===void 0?e!=null?e:{}:Bo(t,r,e||!0)}function Sn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((u,l)=>({...u,[l.name]:l}),{});return u=>{let l=Fe(e._errorFormat),g=gl(n,i),h=hl(u,o,g),x=r({dataPath:g,callsite:l})(h),S=yl(e,t);return new Proxy(x,{get(C,A){if(!S.includes(A))return C[A];let O=[a[A].type,r,A],B=[g,h];return Sn(e,...O,...B)},...mr([...S,...Object.getOwnPropertyNames(x)])})}}function yl(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}d();c();p();f();m();d();c();p();f();m();var wl=Ue(Ki());var El={red:nt,gray:Di,dim:ar,bold:sr,underline:Ai,highlightSource:e=>e.highlight()},bl={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function xl({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r!=null?r:!1,callArguments:n}}function Pl({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],u=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${u}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${u}`)),t&&a.push(s.underline(vl(t))),i){a.push("");let l=[i.toString()];o&&(l.push(o),l.push(s.dim(")"))),a.push(l.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function vl(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function yt(e){let t=e.showColors?El:bl,r;return typeof $getTemplateParameters!="undefined"?r=$getTemplateParameters(e,t):r=xl(e),Pl(r,t)}function $o(e,t,r,n){return e===ke.ModelAction.findFirstOrThrow||e===ke.ModelAction.findUniqueOrThrow?Tl(t,r,n):n}function Tl(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=yt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new Y(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof K&&o.code==="P2025"?new Pe(`No ${e} found`,t):o})}}d();c();p();f();m();function Ee(e){return e.replace(/^./,t=>t.toLowerCase())}var Cl=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Al=["aggregate","count","groupBy"];function In(e,t){var i;let r=(i=e._extensions.getAllModelExtensions(t))!=null?i:{},n=[Rl(e,t),Il(e,t),Ft(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return ge({},n)}function Rl(e,t){let r=Ee(t),n=Object.keys(ke.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=u=>e._request(u);s=$o(o,t,e._clientVersion,s);let a=u=>l=>{let g=Fe(e._errorFormat);return e._createPrismaPromise(h=>{let x={args:l,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...x,...u})})};return Cl.includes(o)?Sn(e,t,a):Sl(i)?_o(e,i,a):a({})}}}function Sl(e){return Al.includes(e)}function Il(e,t){return Qe(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return Fo(t,r)}))}d();c();p();f();m();function qo(e){return e.replace(/^./,t=>t.toUpperCase())}var kn=Symbol();function qt(e){let t=[kl(e),ne(kn,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Ft(r)),ge(e,t)}function kl(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Ee),n=[...new Set(t.concat(r))];return Qe({getKeys(){return n},getPropertyValue(i){let o=qo(i);if(e._runtimeDataModel.models[o]!==void 0)return In(e,o);if(e._runtimeDataModel.models[i]!==void 0)return In(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Uo(e){return e[kn]?e[kn]:e}function Vo(e){var r;if(typeof e=="function")return e(this);if((r=e.client)!=null&&r.__AccelerateEngine){let n=e.client.__AccelerateEngine;this._originalClient._engine=new n(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return qt(t)}d();c();p();f();m();d();c();p();f();m();function jo({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let u of Object.values(o)){if(n){if(n[u.name])continue;let l=u.needs.filter(g=>n[g]);l.length>0&&a.push(at(l))}else if(r){if(!r[u.name])continue;let l=u.needs.filter(g=>!r[g]);l.length>0&&a.push(at(l))}Dl(e,u.needs)&&s.push(Ol(u,ge(e,s)))}return s.length>0||a.length>0?ge(e,[...s,...a]):e}function Dl(e,t){return t.every(r=>ln(e,r))}function Ol(e,t){return Qe(ne(e.name,()=>e.compute(t)))}d();c();p();f();m();function kr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){var s;if(Array.isArray(t)){for(let a=0;ag.name===o);if(!u||u.kind!=="object"||!u.relationName)continue;let l=typeof s=="object"?s:{};t[o]=kr({visitor:i,result:t[o],args:l,modelName:u.type,runtimeDataModel:n})}}function Qo({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:kr({result:e,args:r!=null?r:{},modelName:t,runtimeDataModel:i,visitor:(s,a,u)=>jo({result:s,modelName:Ee(a),select:u.select,omit:u.omit,extensions:n})})}d();c();p();f();m();d();c();p();f();m();function Go(e){if(e instanceof se)return Ml(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{var s,a;let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(((s=t.transaction)==null?void 0:s.kind)==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:Go((a=t.args)!=null?a:{}),__internalParams:t,query:(u,l=t)=>{let g=l.customDataProxyFetch;return l.customDataProxyFetch=Zo(o,g),l.args=u,Wo(e,l,r,n+1)}})})}function Ko(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r!=null?r:"$none",o);return Wo(e,t,s)}function zo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Yo(r,n,0,e):e(r)}}function Yo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let u=a.customDataProxyFetch;return a.customDataProxyFetch=Zo(i,u),Yo(a,t,r+1,n)}})}var Ho=e=>e;function Zo(e=Ho,t=Ho){return r=>e(t(r))}d();c();p();f();m();d();c();p();f();m();function es(e,t,r){let n=Ee(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Nl({...e,...Xo(t.name,e,t.result.$allModels),...Xo(t.name,e,t.result[n])})}function Nl(e){let t=new de,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return ot(e,n=>({...n,needs:r(n.name,new Set)}))}function Xo(e,t,r){return r?ot(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:_l(t,o,i)})):{}}function _l(e,t,r){var i;let n=(i=e==null?void 0:e[t])==null?void 0:i.compute;return n?o=>r({...o,[t]:n(o)}):r}function ts(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function rs(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Dr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new de;this.modelExtensionsCache=new de;this.queryCallbacksCache=new de;this.clientExtensions=kt(()=>{var t,r;return this.extension.client?{...(r=this.previous)==null?void 0:r.getAllClientExtensions(),...this.extension.client}:(t=this.previous)==null?void 0:t.getAllClientExtensions()});this.batchCallbacks=kt(()=>{var n,i,o;let t=(i=(n=this.previous)==null?void 0:n.getAllBatchQueryCallbacks())!=null?i:[],r=(o=this.extension.query)==null?void 0:o.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>{var r;return es((r=this.previous)==null?void 0:r.getAllComputedFields(t),this.extension,t)})}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{var n,i;let r=Ee(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?(n=this.previous)==null?void 0:n.getAllModelExtensions(t):{...(i=this.previous)==null?void 0:i.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{var s,a;let n=(a=(s=this.previous)==null?void 0:s.getAllQueryCallbacks(t,r))!=null?a:[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Or=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Dr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Dr(t,this.head))}getAllComputedFields(t){var r;return(r=this.head)==null?void 0:r.getAllComputedFields(t)}getAllClientExtensions(){var t;return(t=this.head)==null?void 0:t.getAllClientExtensions()}getAllModelExtensions(t){var r;return(r=this.head)==null?void 0:r.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){var n,i;return(i=(n=this.head)==null?void 0:n.getAllQueryCallbacks(t,r))!=null?i:[]}getAllBatchQueryCallbacks(){var t,r;return(r=(t=this.head)==null?void 0:t.getAllBatchQueryCallbacks())!=null?r:[]}};d();c();p();f();m();var ns=re("prisma:client"),is={Vercel:"vercel","Netlify CI":"netlify"};function os({postinstall:e,ciName:t,clientVersion:r}){if(ns("checkPlatformCaching:postinstall",e),ns("checkPlatformCaching:ciName",t),e===!0&&t&&t in is){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${is[t]}-build`;throw console.error(n),new G(n,r)}}d();c();p();f();m();function ss(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Fl="Cloudflare-Workers",Ll="node";function as(){var e,t,r;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Fl?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((r=(t=globalThis.process)==null?void 0:t.release)==null?void 0:r.name)===Ll?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var Bl={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Mr(){let e=as();return{id:e,prettyName:Bl[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();function wt({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){var u,l;let i,o=Object.keys(e)[0],s=(u=e[o])==null?void 0:u.url,a=(l=t[o])==null?void 0:l.url;if(o===void 0?i=void 0:a?i=a:s!=null&&s.value?i=s.value:s!=null&&s.fromEnvVar&&(i=r[s.fromEnvVar]),(s==null?void 0:s.fromEnvVar)!==void 0&&i===void 0)throw Mr().id==="workerd"?new G(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new G(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new G("error: Missing URL environment variable, value, or override.",n);return i}d();c();p();f();m();d();c();p();f();m();var Nr=class extends Error{constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var ue=class extends Nr{constructor(t,r){var n;super(t,r),this.isRetryable=(n=r.isRetryable)!=null?n:!0}};d();c();p();f();m();d();c();p();f();m();function $(e,t){return{...e,isRetryable:t}}var Et=class extends ue{constructor(r){super("This request must be retried",$(r,!0));this.name="ForcedRetryError";this.code="P5001"}};_(Et,"ForcedRetryError");d();c();p();f();m();var He=class extends ue{constructor(r,n){super(r,$(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};_(He,"InvalidDatasourceError");d();c();p();f();m();var We=class extends ue{constructor(r,n){super(r,$(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};_(We,"NotImplementedYetError");d();c();p();f();m();d();c();p();f();m();var j=class extends ue{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 Ke=class extends j{constructor(r){super("Schema needs to be uploaded",$(r,!0));this.name="SchemaMissingError";this.code="P5005"}};_(Ke,"SchemaMissingError");d();c();p();f();m();d();c();p();f();m();var Dn="This request could not be understood by the server",Vt=class extends j{constructor(r,n,i){super(n||Dn,$(r,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};_(Vt,"BadRequestError");d();c();p();f();m();var jt=class extends j{constructor(r,n){super("Engine not started: healthcheck timeout",$(r,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};_(jt,"HealthcheckTimeoutError");d();c();p();f();m();var Jt=class extends j{constructor(r,n,i){super(n,$(r,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};_(Jt,"EngineStartupError");d();c();p();f();m();var Qt=class extends j{constructor(r){super("Engine version is not supported",$(r,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};_(Qt,"EngineVersionNotSupportedError");d();c();p();f();m();var On="Request timed out",Gt=class extends j{constructor(r,n=On){super(n,$(r,!1));this.name="GatewayTimeoutError";this.code="P5009"}};_(Gt,"GatewayTimeoutError");d();c();p();f();m();var $l="Interactive transaction error",Ht=class extends j{constructor(r,n=$l){super(n,$(r,!1));this.name="InteractiveTransactionError";this.code="P5015"}};_(Ht,"InteractiveTransactionError");d();c();p();f();m();var ql="Request parameters are invalid",Wt=class extends j{constructor(r,n=ql){super(n,$(r,!1));this.name="InvalidRequestError";this.code="P5011"}};_(Wt,"InvalidRequestError");d();c();p();f();m();var Mn="Requested resource does not exist",Kt=class extends j{constructor(r,n=Mn){super(n,$(r,!1));this.name="NotFoundError";this.code="P5003"}};_(Kt,"NotFoundError");d();c();p();f();m();var Nn="Unknown server error",bt=class extends j{constructor(r,n,i){super(n||Nn,$(r,!0));this.name="ServerError";this.code="P5006";this.logs=i}};_(bt,"ServerError");d();c();p();f();m();var _n="Unauthorized, check your connection string",zt=class extends j{constructor(r,n=_n){super(n,$(r,!1));this.name="UnauthorizedError";this.code="P5007"}};_(zt,"UnauthorizedError");d();c();p();f();m();var Fn="Usage exceeded, retry again later",Yt=class extends j{constructor(r,n=Fn){super(n,$(r,!0));this.name="UsageExceededError";this.code="P5008"}};_(Yt,"UsageExceededError");async function Ul(e){let t;try{t=await e.text()}catch(r){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(r){return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function Zt(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await Ul(e);if(n.type==="QueryEngineError")throw new K(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new bt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new Ke(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Qt(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Jt(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new G(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new jt(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 Ht(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Wt(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new zt(r,xt(_n,n));if(e.status===404)return new Kt(r,xt(Mn,n));if(e.status===429)throw new Yt(r,xt(Fn,n));if(e.status===504)throw new Gt(r,xt(On,n));if(e.status>=500)throw new bt(r,xt(Nn,n));if(e.status>=400)throw new Vt(r,xt(Dn,n))}function xt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}d();c();p();f();m();function us(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))}d();c();p();f();m();var Ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function ls(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,u,l,g;for(let h=0;h>18,a=(g&258048)>>12,u=(g&4032)>>6,l=g&63,r+=Ae[s]+Ae[a]+Ae[u]+Ae[l];return i==1?(g=t[o],s=(g&252)>>2,a=(g&3)<<4,r+=Ae[s]+Ae[a]+"=="):i==2&&(g=t[o]<<8|t[o+1],s=(g&64512)>>10,a=(g&1008)>>4,u=(g&15)<<2,r+=Ae[s]+Ae[a]+Ae[u]+"="),r}d();c();p();f();m();function cs(e){var r;if(!!((r=e.generator)!=null&&r.previewFeatures.some(n=>n.toLowerCase().includes("metrics"))))throw new G("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)}d();c();p();f();m();function Vl(e){return e[0]*1e3+e[1]/1e6}function ps(e){return new Date(Vl(e))}d();c();p();f();m();var fs={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};d();c();p();f();m();d();c();p();f();m();var Xt=class extends ue{constructor(r,n){super(`Cannot fetch data from service: -${r}`,$(n,!0));this.name="RequestError";this.code="P5010"}};_(Xt,"RequestError");async function ze(e,t,r=n=>n){var i;let n=t.clientVersion;try{return typeof fetch=="function"?await r(fetch)(e,t):await r(Ln)(e,t)}catch(o){let s=(i=o.message)!=null?i:"Unknown error";throw new Xt(s,{clientVersion:n})}}function Jl(e){return{...e.headers,"Content-Type":"application/json"}}function Ql(e){return{method:e.method,headers:Jl(e)}}function Gl(e,t){return{text:()=>Promise.resolve(w.Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(w.Buffer.concat(e).toString())),ok:t.statusCode>=200&&t.statusCode<=299,status:t.statusCode,url:t.url,headers:new Bn(t.headers)}}async function Ln(e,t={}){let r=Hl("https"),n=Ql(t),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{var l;let u=r.request(e,n,g=>{let{statusCode:h,headers:{location:x}}=g;h>=301&&h<=399&&x&&(x.startsWith("http")===!1?s(Ln(`${o}${x}`,t)):s(Ln(x,t))),g.on("data",S=>i.push(S)),g.on("end",()=>s(Gl(i,g))),g.on("error",a)});u.on("error",a),u.end((l=t.body)!=null?l:"")})}var Hl=typeof require!="undefined"?require:()=>{},Bn=class{constructor(t={}){this.headers=new Map;for(let[r,n]of Object.entries(t))if(typeof n=="string")this.headers.set(r,n);else if(Array.isArray(n))for(let i of n)this.headers.set(r,i)}append(t,r){this.headers.set(t,r)}delete(t){this.headers.delete(t)}get(t){var r;return(r=this.headers.get(t))!=null?r:null}has(t){return this.headers.has(t)}set(t,r){this.headers.set(t,r)}forEach(t,r){for(let[n,i]of this.headers)t.call(r,i,n,this)}};var Wl=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,ms=re("prisma:client:dataproxyEngine");async function Kl(e,t){var s,a,u;let r=fs["@prisma/engines-version"],n=(s=t.clientVersion)!=null?s:"unknown";if(y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return y.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=(a=n==null?void 0:n.split("-"))!=null?a:[];if(o===void 0&&Wl.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[l]=(u=r.split("-"))!=null?u:[],[g,h,x]=l.split("."),S=zl(`<=${g}.${h}.${x}`),C=await ze(S,{clientVersion:n});if(!C.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${C.status} ${C.statusText}, response body: ${await C.text()||""}`);let A=await C.text();ms("length of body fetched from unpkg.com",A.length);let D;try{D=JSON.parse(A)}catch(O){throw console.error("JSON.parse error: body fetched from unpkg.com: ",A),O}return D.version}throw new We("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function ds(e,t){let r=await Kl(e,t);return ms("version",r),r}function zl(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var gs=3,$n=re("prisma:client:dataproxyEngine"),qn=class{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!=null?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}},er=class{constructor(t){this.name="DataProxyEngine";cs(t),this.config=t,this.env={...t.env,...typeof y!="undefined"?y.env:{}},this.inlineSchema=ls(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[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new qn({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await ds(t,this.config),$n("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){var r,n;(r=t==null?void 0:t.logs)!=null&&r.length&&t.logs.forEach(i=>{switch(i.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let o=typeof i.attributes.query=="string"?i.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[s]=o.split("/* traceparent");o=s}this.logEmitter.emit("query",{query:o,timestamp:ps(i.timestamp),duration:Number(i.attributes.duration_ms),params:i.attributes.params,target:i.attributes.target})}}}),(n=t==null?void 0:t.traces)!=null&&n.length&&this.tracingHelper.createEngineSpan({span:!0,spans:t.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await ze(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||$n("schema response status",r.status);let n=await Zt(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==null?void 0:n.kind)==="itx"?n.options:void 0,s=dr(t,n),{batchResult:a,elapsed:u}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r});return a.map(l=>"errors"in l&&l.errors.length>0?$t(l.errors[0],this.clientVersion,this.config.activeProvider):{data:l,elapsed:u})}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 ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||$n("graphql response status",a.status),await this.handleError(await Zt(a,this.clientVersion));let u=await a.json(),l=u.extensions;if(l&&this.propagateResponseExtensions(l),u.errors)throw u.errors.length===1?$t(u.errors[0],this.config.clientVersion,this.config.activeProvider):new oe(u.errors,{clientVersion:this.config.clientVersion});return u}})}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 u=await ze(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await Zt(u,this.clientVersion));let l=await u.json(),g=l.extensions;g&&this.propagateResponseExtensions(g);let h=l.id,x=l["data-proxy"].endpoint;return{id:h,payload:{endpoint:x}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await ze(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await Zt(a,this.clientVersion));let l=(await a.json()).extensions;l&&this.propagateResponseExtensions(l);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=wt({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch(l){throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:")throw new He(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let u=a.get("api_key");if(u===null||u.length<1)throw new He(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,u]}metrics(){throw new We("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){var r;for(let n=0;;n++){let i=o=>{this.logEmitter.emit("info",{message:`Calling ${o} (n=${n})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:i})}catch(o){if(!(o instanceof ue)||!o.isRetryable)throw o;if(n>=gs)throw o instanceof Et?o.cause:o;this.logEmitter.emit("warn",{message:`Attempt ${n+1}/${gs} failed for ${t.actionGerund}: ${(r=o.message)!=null?r:"(unknown)"}`,timestamp:new Date,target:""});let s=await us(n);this.logEmitter.emit("warn",{message:`Retrying after ${s}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof Ke)throw await this.uploadSchema(),new Et({clientVersion:this.clientVersion,cause:t});if(t)throw t}applyPendingMigrations(){throw new Error("Method not implemented.")}};function hs({copyEngine:e=!0},t){let r;try{r=wt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch(u){}e&&(r!=null&&r.startsWith("prisma://"))&&It("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Rt(t.generator),i=!!(r!=null&&r.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o){let u;throw u=["Prisma Client was configured to use the `adapter` option but it was imported via its `/edge` endpoint.","Please either remove the `/edge` endpoint or remove the `adapter` from the Prisma Client constructor."],new Y(u.join(` -`),{clientVersion:t.clientVersion})}if(i)return new er(t);throw new Y("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}d();c();p();f();m();function _r({generator:e}){var t;return(t=e==null?void 0:e.previewFeatures)!=null?t:[]}d();c();p();f();m();d();c();p();f();m();d();c();p();f();m();var Ps=Ue(Un());d();c();p();f();m();function bs(e,t){let r=xs(e),n=Yl(r),i=Xl(n);i?Fr(i,t):t.addErrorMessage(()=>"Unknown error")}function xs(e){return e.errors.flatMap(t=>t.kind==="Union"?xs(t):[t])}function Yl(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:Zl(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Zl(e,t){return[...new Set(e.concat(t))]}function Xl(e){return pn(e,(t,r)=>{let n=ws(t),i=ws(r);return n!==i?n-i:Es(t)-Es(r)})}function ws(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Es(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}d();c();p();f();m();var le=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};d();c();p();f();m();var Lr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(dt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Fr(e,t){switch(e.kind){case"MutuallyExclusiveFields":ec(e,t);break;case"IncludeOnScalar":tc(e,t);break;case"EmptySelection":rc(e,t);break;case"UnknownSelectionField":oc(e,t);break;case"UnknownArgument":sc(e,t);break;case"UnknownInputField":ac(e,t);break;case"RequiredArgumentMissing":uc(e,t);break;case"InvalidArgumentType":lc(e,t);break;case"InvalidArgumentValue":cc(e,t);break;case"ValueTooLarge":pc(e,t);break;case"SomeFieldsMissing":fc(e,t);break;case"TooManyFieldsGiven":mc(e,t);break;case"Union":bs(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function ec(e,t){var n,i,o;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();r&&((i=r.getField(e.firstField))==null||i.markAsError(),(o=r.getField(e.secondField))==null||o.markAsError()),t.addErrorMessage(s=>`Please ${s.bold("either")} use ${s.green(`\`${e.firstField}\``)} or ${s.green(`\`${e.secondField}\``)}, but ${s.red("not both")} at the same time.`)}function tc(e,t){var s,a;let[r,n]=Br(e.selectionPath),i=e.outputType,o=(s=t.arguments.getDeepSelectionParent(r))==null?void 0:s.value;if(o&&((a=o.getField(n))==null||a.markAsError(),i))for(let u of i.fields)u.isRelation&&o.addSuggestion(new le(u.name,"true"));t.addErrorMessage(u=>{let l=`Invalid scalar field ${u.red(`\`${n}\``)} for ${u.bold("include")} statement`;return i?l+=` on model ${u.bold(i.name)}. ${tr(u)}`:l+=".",l+=` -Note that ${u.bold("include")} statements only accept relation fields.`,l})}function rc(e,t){var n,i;let r=(n=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:n.asObject();if(r){let o=(i=r.getField("omit"))==null?void 0:i.value.asObject();if(o){nc(e,t,o);return}}ic(e,t)}function nc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new le(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function ic(e,t){var o,s;let r=e.outputType,n=(o=t.arguments.getDeepSelectionParent(e.selectionPath))==null?void 0:o.value,i=(s=n==null?void 0:n.isEmpty())!=null?s:!1;n&&(n.removeAllFields(),Cs(n,r)),t.addErrorMessage(a=>i?`The ${a.red("`select`")} statement for type ${a.bold(r.name)} must not be empty. ${tr(a)}`:`The ${a.red("`select`")} statement for type ${a.bold(r.name)} needs ${a.bold("at least one truthy value")}.`)}function oc(e,t){var s,a,u,l,g,h,x;let[r,n]=Br(e.selectionPath),i=(s=t.arguments.getDeepSubSelectionValue(r))==null?void 0:s.asObject(),o;if(i){let S=(a=i.getFieldValue("select"))==null?void 0:a.asObject(),C=(u=i.getFieldValue("include"))==null?void 0:u.asObject(),A=(l=i.getFieldValue("omit"))==null?void 0:l.asObject();S!=null&&S.hasField(n)?(o="select",(g=S.getField(n))==null||g.markAsError(),Cs(S,e.outputType)):C!=null&&C.hasField(n)?(o="include",(h=C.getField(n))==null||h.markAsError(),dc(C,e.outputType)):A!=null&&A.hasField(n)&&(o="omit",(x=A.getField(n))==null||x.markAsError(),gc(A,e.outputType))}t.addErrorMessage(S=>{let C=[`Unknown field ${S.red(`\`${n}\``)}`];return o&&C.push(`for ${S.bold(o)} statement`),C.push(`on model ${S.bold(`\`${e.outputType.name}\``)}.`),C.push(tr(S)),C.join(" ")})}function sc(e,t){var i,o;let r=e.argumentPath[0],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getField(r))==null||o.markAsError(),hc(n,e.arguments)),t.addErrorMessage(s=>vs(s,r,e.arguments.map(a=>a.name)))}function ac(e,t){var o,s,a;let[r,n]=Br(e.argumentPath),i=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject();if(i){(s=i.getDeepField(e.argumentPath))==null||s.markAsError();let u=(a=i.getDeepFieldValue(r))==null?void 0:a.asObject();u&&As(u,e.inputType)}t.addErrorMessage(u=>vs(u,n,e.inputType.fields.map(l=>l.name)))}function vs(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=wc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(tr(e)),n.join(" ")}function uc(e,t){var u,l;let r;t.addErrorMessage(g=>(r==null?void 0:r.value)instanceof z&&r.value.text==="null"?`Argument \`${g.green(o)}\` must not be ${g.red("null")}.`:`Argument \`${g.green(o)}\` is missing.`);let n=(u=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:u.asObject();if(!n)return;let[i,o]=Br(e.argumentPath),s=new Lr,a=(l=n.getDeepFieldValue(i))==null?void 0:l.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let g of e.inputTypes[0].fields)s.addField(g.name,g.typeNames.join(" | "));a.addSuggestion(new le(o,s).makeRequired())}else{let g=e.inputTypes.map(Ts).join(" | ");a.addSuggestion(new le(o,g).makeRequired())}}function Ts(e){return e.kind==="list"?`${Ts(e.elementType)}[]`:e.name}function lc(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=$r("or",e.argument.typeNames.map(u=>s.green(u)));return`Argument \`${s.bold(r)}\`: Invalid value provided. Expected ${a}, provided ${s.red(e.inferredType)}.`})}function cc(e,t){var i,o;let r=e.argument.name,n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();n&&((o=n.getDeepFieldValue(e.argumentPath))==null||o.markAsError()),t.addErrorMessage(s=>{let a=[`Invalid value for argument \`${s.bold(r)}\``];if(e.underlyingError&&a.push(`: ${e.underlyingError}`),a.push("."),e.argument.typeNames.length>0){let u=$r("or",e.argument.typeNames.map(l=>s.green(l)));a.push(` Expected ${u}.`)}return a.join("")})}function pc(e,t){var o;let r=e.argument.name,n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath),a=s==null?void 0:s.value;a==null||a.markAsError(),a instanceof z&&(i=a.text)}t.addErrorMessage(s=>{let a=["Unable to fit value"];return i&&a.push(s.red(i)),a.push(`into a 64-bit signed integer for field \`${s.bold(r)}\``),a.join(" ")})}function fc(e,t){var i,o;let r=e.argumentPath[e.argumentPath.length-1],n=(i=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:i.asObject();if(n){let s=(o=n.getDeepFieldValue(e.argumentPath))==null?void 0:o.asObject();s&&As(s,e.inputType)}t.addErrorMessage(s=>{let a=[`Argument \`${s.bold(r)}\` of type ${s.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?a.push(`${s.green("at least one of")} ${$r("or",e.constraints.requiredFields.map(u=>`\`${s.bold(u)}\``))} arguments.`):a.push(`${s.green("at least one")} argument.`):a.push(`${s.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),a.push(tr(s)),a.join(" ")})}function mc(e,t){var o,s;let r=e.argumentPath[e.argumentPath.length-1],n=(o=t.arguments.getDeepSubSelectionValue(e.selectionPath))==null?void 0:o.asObject(),i=[];if(n){let a=(s=n.getDeepFieldValue(e.argumentPath))==null?void 0:s.asObject();a&&(a.markAsError(),i=Object.keys(a.getFields()))}t.addErrorMessage(a=>{let u=[`Argument \`${a.bold(r)}\` of type ${a.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?u.push(`${a.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?u.push(`${a.green("at most one")} argument,`):u.push(`${a.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),u.push(`but you provided ${$r("and",i.map(l=>a.red(l)))}. Please choose`),e.constraints.maxFieldCount===1?u.push("one."):u.push(`${e.constraints.maxFieldCount}.`),u.join(" ")})}function Cs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,"true"))}function dc(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new le(r.name,"true"))}function gc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new le(r.name,"true"))}function hc(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function As(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new le(r.name,r.typeNames.join(" | ")))}function Br(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function tr({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function $r(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var yc=3;function wc(e,t){let r=1/0,n;for(let i of t){let o=(0,Ps.default)(e,i);o>yc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){var r;return(r=this.model)==null?void 0:r.fields.find(n=>n.name===t)}nestSelection(t){let r=this.findField(t),n=(r==null?void 0:r.kind)==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};d();c();p();f();m();var ks=e=>({command:e});d();c();p();f();m();d();c();p();f();m();var Ds=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);d();c();p();f();m();function rr(e){try{return Os(e,"fast")}catch(t){return Os(e,"slow")}}function Os(e,t){return JSON.stringify(e.map(r=>Sc(r,t)))}function Sc(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:lt(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ye.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Ic(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Ns(e):e}function Ic(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Ns(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ms);let t={};for(let r of Object.keys(e))t[r]=Ms(e[r]);return t}function Ms(e){return typeof e=="bigint"?e.toString():Ns(e)}var kc=/^(\s*alter\s)/i,_s=re("prisma:client");function Jn(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&kc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Qn=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:rr(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:rr(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:rr(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Ds(r),i={values:rr(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i!=null&&i.values?_s(`prisma.${e}(${n}, ${i.values})`):_s(`prisma.${e}(${n})`),{query:n,parameters:i}},Fs={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Ls={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};d();c();p();f();m();function Gn(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||(o==null?void 0:o.kind)==="itx"?n!=null?n:n=Bs(r(o)):Bs(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function Bs(e){return typeof e.then=="function"?e:Promise.resolve(e)}d();c();p();f();m();var $s={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Hn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){var t,r;return(r=(t=globalThis.PRISMA_INSTRUMENTATION)==null?void 0:t.helper)!=null?r:$s}};function qs(e){return e.includes("tracing")?new Hn:$s}d();c();p();f();m();function Us(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i==null?void 0:i(n)}}}d();c();p();f();m();var Dc=["$connect","$disconnect","$on","$transaction","$use","$extends"],Vs=Dc;d();c();p();f();m();function js(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}d();c();p();f();m();var Ur=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};d();c();p();f();m();var Qs=Ue(eo());d();c();p();f();m();function Vr(e){return typeof e.batchRequestIdx=="number"}d();c();p();f();m();function jr(e){return e===null?e:Array.isArray(e)?e.map(jr):typeof e=="object"?Oc(e)?Mc(e):ot(e,jr):e}function Oc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Mc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ye(t);case"Json":return JSON.parse(t);default:je(t,"Unknown tagged value")}}d();c();p();f();m();function Js(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Wn(e.query.arguments)),t.push(Wn(e.query.selection)),t.join("")}function Wn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Wn(n)})`:r}).join(" ")})`}d();c();p();f();m();var Nc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Kn(e){return Nc[e]}d();c();p();f();m();var Jr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),u=this.client._tracingHelper.getTraceParent(s),l=n.some(h=>Kn(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:u,transaction:Fc(o),containsWrite:l,customDataProxyFetch:i})).map((h,x)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[x],h)}catch(S){return S}})}),singleLoader:async n=>{var s;let i=((s=n.transaction)==null?void 0:s.kind)==="itx"?Gs(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Kn(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>{var i;return(i=n.transaction)!=null&&i.id?`transaction-${n.transaction.id}`:Js(n.protocolQuery)},batchOrder(n,i){var o,s;return((o=n.transaction)==null?void 0:o.kind)==="batch"&&((s=i.transaction)==null?void 0:s.kind)==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n==null?void 0:n.data,o=n==null?void 0:n.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(_c(t),Lc(t,i)||t instanceof Pe)throw t;if(t instanceof K&&Bc(t)){let u=Hs(t.meta);qr({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=yt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let u=s?{modelName:s,...t.meta}:t.meta;throw new K(a,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ve(a,this.client._clientVersion);if(t instanceof oe)throw new oe(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof G)throw new G(a,this.client._clientVersion);if(t instanceof ve)throw new ve(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Qs.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=jr(Rn(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function Fc(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Gs(e)};je(e,"Unknown transaction kind")}}function Gs(e){return{id:e.id,payload:e.payload}}function Lc(e,t){return Vr(e)&&(t==null?void 0:t.kind)==="batch"&&e.batchRequestIdx!==t.index}function Bc(e){return e.code==="P2009"||e.code==="P2012"}function Hs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Hs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}d();c();p();f();m();var Ws="5.14.0";var Ks=Ws;d();c();p();f();m();function zs(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=Ys(t[n]);return r})}function Ys({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return w.Buffer.from(t,"base64");case"decimal":return new ye(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(Ys);default:return t}}d();c();p();f();m();var ta=Ue(Un());d();c();p();f();m();var J=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};_(J,"PrismaClientConstructorValidationError");var Zs=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Xs=["pretty","colorless","minimal"],ea=["info","query","warn","error"],qc={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=Pt(r,t)||` Available datasources: ${t.join(", ")}`;throw new J(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new J(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new J(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new J('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!_r(t).includes("driverAdapters"))throw new J('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Rt()==="binary")throw new J('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e!="undefined"&&typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new J(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Xs.includes(e)){let t=Pt(e,Xs);throw new J(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new J(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!ea.includes(r)){let n=Pt(r,ea);throw new J(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Pt(i,o);throw new J(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new J(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new J(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new J(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new J(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Pt(r,t);throw new J(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ra(e,t){for(let[r,n]of Object.entries(e)){if(!Zs.includes(r)){let i=Pt(r,Zs);throw new J(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}qc[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new J('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Pt(e,t){if(t.length===0||typeof e!="string")return"";let r=Uc(e,t);return r?` Did you mean "${r}"?`:""}function Uc(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,ta.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},u=l=>{o||(o=!0,r(l))};for(let l=0;l{n[l]=g,a()},g=>{if(!Vr(g)){u(g);return}g.batchRequestIdx===l?u(g):(i||(i=g),a())})})}var Le=re("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Vc={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},jc=Symbol.for("prisma.client.transaction.id"),Jc={id:0,nextId(){return++this.id}};function sa(e){class t{constructor(n){this._originalClient=this;this._middlewares=new Ur;this._createPrismaPromise=Gn();this.$extends=Vo;var u,l,g,h,x,S,C,A,D,O,B,M,I,X;e=(g=(l=(u=n==null?void 0:n.__internal)==null?void 0:u.configOverride)==null?void 0:l.call(u,e))!=null?g:e,os(e),n&&ra(n,e);let i=n!=null&&n.adapter?hn(n.adapter):void 0,o=new lr().on("error",()=>{});this._extensions=Or.empty(),this._previewFeatures=_r(e),this._clientVersion=(h=e.clientVersion)!=null?h:Ks,this._activeProvider=e.activeProvider,this._tracingHelper=qs(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&At.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&At.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=(x=e.injectableEdgeEnv)==null?void 0:x.call(e);try{let L=n!=null?n:{},Ye=(S=L.__internal)!=null?S:{},Be=Ye.debug===!0;Be&&re.enable("prisma:client");let fe=At.resolve(e.dirname,e.relativePath);bi.existsSync(fe)||(fe=e.dirname),Le("dirname",e.dirname),Le("relativePath",e.relativePath),Le("cwd",fe);let $e=Ye.engine||{};if(L.errorFormat?this._errorFormat=L.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:fe,dirname:e.dirname,enableDebugLogs:Be,allowTriggerPanic:$e.allowTriggerPanic,datamodelPath:At.join(e.dirname,(C=e.filename)!=null?C:"schema.prisma"),prismaPath:(A=$e.binaryPath)!=null?A:void 0,engineEndpoint:$e.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:L.log&&js(L.log),logQueries:L.log&&!!(typeof L.log=="string"?L.log==="query":L.log.find(Q=>typeof Q=="string"?Q==="query":Q.level==="query")),env:(D=a==null?void 0:a.parsed)!=null?D:{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:ss(L,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:(B=(O=L.transactionOptions)==null?void 0:O.maxWait)!=null?B:2e3,timeout:(I=(M=L.transactionOptions)==null?void 0:M.timeout)!=null?I:5e3,isolationLevel:(X=L.transactionOptions)==null?void 0:X.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:wt,getBatchRequestPayload:dr,prismaGraphQLToJSError:$t,PrismaClientUnknownRequestError:oe,PrismaClientInitializationError:G,PrismaClientKnownRequestError:K,debug:re("prisma:client:accelerateEngine"),engineVersion:oa.version,clientVersion:e.clientVersion}},Le("clientVersion",e.clientVersion),this._engine=hs(e,this._engineConfig),this._requestHandler=new Qr(this,o),L.log)for(let Q of L.log){let Re=typeof Q=="string"?Q:Q.emit==="stdout"?Q.level:null;Re&&this.$on(Re,qe=>{var Ze;it.log(`${(Ze=it.tags[Re])!=null?Ze:""}`,qe.message||qe.query)})}this._metrics=new st(this._engine)}catch(L){throw L.clientVersion=this._clientVersion,L}return this._appliedParent=qt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{ji()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=ia(n,i);return Jn(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Y("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Jn(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Y(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:ks,callsite:Fe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Qn({clientMethod:i,activeProvider:a}),callsite:Fe(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(zs)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...ia(n,i));throw new Y("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Jc.nextId(),s=Us(n.length),a=n.map((u,l)=>{var x,S,C;if((u==null?void 0:u[Symbol.toStringTag])!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=(x=i==null?void 0:i.isolationLevel)!=null?x:this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:l,isolationLevel:g,lock:s};return(C=(S=u.requestTransaction)==null?void 0:S.call(u,h))!=null?C:u});return na(a)}async _transactionWithCallback({callback:n,options:i}){var l,g,h;let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:(l=i==null?void 0:i.maxWait)!=null?l:this._engineConfig.transactionOptions.maxWait,timeout:(g=i==null?void 0:i.timeout)!=null?g:this._engineConfig.transactionOptions.timeout,isolationLevel:(h=i==null?void 0:i.isolationLevel)!=null?h:this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),u;try{let x={kind:"itx",...a};u=await n(this._createItxClient(x)),await this._engine.transaction("commit",o,a)}catch(x){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),x}return u}_createItxClient(n){return qt(ge(Uo(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>Gn(n)),ne(jc,()=>n.id),at(Vs)]))}$transaction(n,i){var a;let o;typeof n=="function"?((a=this._engineConfig.adapter)==null?void 0:a.adapterName)==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){var l;n.otelParentCtx=this._tracingHelper.getActiveContext();let i=(l=n.middlewareArgsMapper)!=null?l:Vc,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,u=async g=>{let h=this._middlewares.get(++a);if(h)return this._tracingHelper.runInChildSpan(s.middleware,O=>h(g,B=>(O==null||O.end(),u(B))));let{runInTransaction:x,args:S,...C}=g,A={...n,...C};S&&(A.args=i.middlewareArgsToRequestArgs(S)),n.transaction!==void 0&&x===!1&&delete A.transaction;let D=await Ko(this,A);return A.model?Qo({result:D,modelName:A.model,args:A.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):D};return this._tracingHelper.runInChildSpan(s.operation,()=>u(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:u,argsMapper:l,transaction:g,unpacker:h,otelParentCtx:x,customDataProxyFetch:S}){try{n=l?l(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>Rs({modelName:u,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return re.enabled("prisma:client")&&(Le("Prisma Client call:"),Le(`prisma.${i}(${ko(n)})`),Le("Generated request:"),Le(JSON.stringify(A,null,2)+` -`)),(g==null?void 0:g.kind)==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:u,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:x,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:S})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new Y("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){var i;return!!((i=this._engineConfig.previewFeatures)!=null&&i.includes(n))}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function ia(e,t){return Qc(e)?[new se(e,t),Fs]:[e,Ls]}function Qc(e){return Array.isArray(e)&&Array.isArray(e.raw)}d();c();p();f();m();var Gc=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function aa(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!Gc.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}d();c();p();f();m();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=edge.js.map diff --git a/integration-tests/tests/prisma/sqlite/client/runtime/index-browser.d.ts b/integration-tests/tests/prisma/sqlite/client/runtime/index-browser.d.ts deleted file mode 100644 index f033b86a5..000000000 --- a/integration-tests/tests/prisma/sqlite/client/runtime/index-browser.d.ts +++ /dev/null @@ -1,365 +0,0 @@ -declare class AnyNull extends NullTypesEnumValue { -} - -declare type Args = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : any; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof A]: Exact; -} : W) : never) | (A extends Narrowable ? A : never); - -export declare function getRuntime(): GetRuntimeOutput; - -declare type GetRuntimeOutput = { - id: Runtime; - prettyName: string; - isEdge: boolean; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -declare type Narrowable = string | number | bigint | boolean | []; - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * Base class for unique values of object-valued enums. - */ -declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -declare namespace Public { - export { - validator - } -} -export { Public } - -declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown"; - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -export { } diff --git a/integration-tests/tests/prisma/sqlite/client/runtime/index-browser.js b/integration-tests/tests/prisma/sqlite/client/runtime/index-browser.js deleted file mode 100644 index 4f8241715..000000000 --- a/integration-tests/tests/prisma/sqlite/client/runtime/index-browser.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict";var de=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var je=Object.prototype.hasOwnProperty;var Ce=(e,n)=>{for(var i in n)de(e,i,{get:n[i],enumerable:!0})},Xe=(e,n,i,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Je(n))!je.call(e,r)&&r!==i&&de(e,r,{get:()=>n[r],enumerable:!(t=Ge(n,r))||t.enumerable});return e};var Ke=e=>Xe(de({},"__esModule",{value:!0}),e);var Xn={};Ce(Xn,{Decimal:()=>We,Public:()=>he,getRuntime:()=>Ae,makeStrictEnum:()=>Pe,objectEnumValues:()=>Oe});module.exports=Ke(Xn);var he={};Ce(he,{validator:()=>Me});function Me(...e){return n=>n}var ne=Symbol(),pe=new WeakMap,ge=class{constructor(n){n===ne?pe.set(this,"Prisma.".concat(this._getName())):pe.set(this,"new Prisma.".concat(this._getNamespace(),".").concat(this._getName(),"()"))}_getName(){return this.constructor.name}toString(){return pe.get(this)}},J=class extends ge{_getNamespace(){return"NullTypes"}},j=class extends J{};me(j,"DbNull");var X=class extends J{};me(X,"JsonNull");var K=class extends J{};me(K,"AnyNull");var Oe={classes:{DbNull:j,JsonNull:X,AnyNull:K},instances:{DbNull:new j(ne),JsonNull:new X(ne),AnyNull:new K(ne)}};function me(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0})}var Qe=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Pe(e){return new Proxy(e,{get(n,i){if(i in n)return n[i];if(!Qe.has(i))throw new TypeError("Invalid enum value: ".concat(String(i)))}})}var Ye="Cloudflare-Workers",xe="node";function be(){var e,n,i;return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":((e=globalThis.navigator)==null?void 0:e.userAgent)===Ye?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":((i=(n=globalThis.process)==null?void 0:n.release)==null?void 0:i.name)===xe?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var ze={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Ae(){let e=be();return{id:e,prettyName:ze[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var H=9e15,V=1e9,we="0123456789abcdef",te="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",re="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ne={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-H,maxE:H,crypto:!1},Te,Z,w=!0,oe="[DecimalError] ",$=oe+"Invalid argument: ",Le=oe+"Precision limit exceeded",De=oe+"crypto unavailable",Fe="[object Decimal]",A=Math.floor,M=Math.pow,ye=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,en=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,nn=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ie=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,D=1e7,m=7,tn=9007199254740991,rn=te.length-1,ve=re.length-1,h={toStringTag:Fe};h.absoluteValue=h.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),p(e)};h.ceil=function(){return p(new this.constructor(this),this.e+1,2)};h.clampedTo=h.clamp=function(e,n){var i,t=this,r=t.constructor;if(e=new r(e),n=new r(n),!e.s||!n.s)return new r(NaN);if(e.gt(n))throw Error($+n);return i=t.cmp(e),i<0?e:t.cmp(n)>0?n:new r(t)};h.comparedTo=h.cmp=function(e){var n,i,t,r,s=this,o=s.d,u=(e=new s.constructor(e)).d,l=s.s,f=e.s;if(!o||!u)return!l||!f?NaN:l!==f?l:o===u?0:!o^l<0?1:-1;if(!o[0]||!u[0])return o[0]?l:u[0]?-f:0;if(l!==f)return l;if(s.e!==e.e)return s.e>e.e^l<0?1:-1;for(t=o.length,r=u.length,n=0,i=tu[n]^l<0?1:-1;return t===r?0:t>r^l<0?1:-1};h.cosine=h.cos=function(){var e,n,i=this,t=i.constructor;return i.d?i.d[0]?(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=sn(t,Ve(t,i)),t.precision=e,t.rounding=n,p(Z==2||Z==3?i.neg():i,e,n,!0)):new t(1):new t(NaN)};h.cubeRoot=h.cbrt=function(){var e,n,i,t,r,s,o,u,l,f,c=this,a=c.constructor;if(!c.isFinite()||c.isZero())return new a(c);for(w=!1,s=c.s*M(c.s*c,1/3),!s||Math.abs(s)==1/0?(i=O(c.d),e=c.e,(s=(e-i.length+1)%3)&&(i+=s==1||s==-2?"0":"00"),s=M(i,1/3),e=A((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?i="5e"+e:(i=s.toExponential(),i=i.slice(0,i.indexOf("e")+1)+e),t=new a(i),t.s=c.s):t=new a(s.toString()),o=(e=a.precision)+3;;)if(u=t,l=u.times(u).times(u),f=l.plus(c),t=S(f.plus(c).times(u),f.plus(l),o+2,1),O(u.d).slice(0,o)===(i=O(t.d)).slice(0,o))if(i=i.slice(o-3,o+1),i=="9999"||!r&&i=="4999"){if(!r&&(p(u,e+1,0),u.times(u).times(u).eq(c))){t=u;break}o+=4,r=1}else{(!+i||!+i.slice(1)&&i.charAt(0)=="5")&&(p(t,e+1,1),n=!t.times(t).times(t).eq(c));break}return w=!0,p(t,e,a.rounding,n)};h.decimalPlaces=h.dp=function(){var e,n=this.d,i=NaN;if(n){if(e=n.length-1,i=(e-A(this.e/m))*m,e=n[e],e)for(;e%10==0;e/=10)i--;i<0&&(i=0)}return i};h.dividedBy=h.div=function(e){return S(this,new this.constructor(e))};h.dividedToIntegerBy=h.divToInt=function(e){var n=this,i=n.constructor;return p(S(n,new i(e),0,1,1),i.precision,i.rounding)};h.equals=h.eq=function(e){return this.cmp(e)===0};h.floor=function(){return p(new this.constructor(this),this.e+1,3)};h.greaterThan=h.gt=function(e){return this.cmp(e)>0};h.greaterThanOrEqualTo=h.gte=function(e){var n=this.cmp(e);return n==1||n===0};h.hyperbolicCosine=h.cosh=function(){var e,n,i,t,r,s=this,o=s.constructor,u=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return u;i=o.precision,t=o.rounding,o.precision=i+Math.max(s.e,s.sd())+4,o.rounding=1,r=s.d.length,r<32?(e=Math.ceil(r/3),n=(1/fe(4,e)).toString()):(e=16,n="2.3283064365386962890625e-10"),s=W(o,1,s.times(n),new o(1),!0);for(var l,f=e,c=new o(8);f--;)l=s.times(s),s=u.minus(l.times(c.minus(l.times(c))));return p(s,o.precision=i,o.rounding=t,!0)};h.hyperbolicSine=h.sinh=function(){var e,n,i,t,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(n=s.precision,i=s.rounding,s.precision=n+Math.max(r.e,r.sd())+4,s.rounding=1,t=r.d.length,t<3)r=W(s,2,r,r,!0);else{e=1.4*Math.sqrt(t),e=e>16?16:e|0,r=r.times(1/fe(5,e)),r=W(s,2,r,r,!0);for(var o,u=new s(5),l=new s(16),f=new s(20);e--;)o=r.times(r),r=r.times(u.plus(o.times(l.times(o).plus(f))))}return s.precision=n,s.rounding=i,p(r,n,i,!0)};h.hyperbolicTangent=h.tanh=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+7,t.rounding=1,S(i.sinh(),i.cosh(),t.precision=e,t.rounding=n)):new t(i.s)};h.inverseCosine=h.acos=function(){var e,n=this,i=n.constructor,t=n.abs().cmp(1),r=i.precision,s=i.rounding;return t!==-1?t===0?n.isNeg()?L(i,r,s):new i(0):new i(NaN):n.isZero()?L(i,r+4,s).times(.5):(i.precision=r+6,i.rounding=1,n=n.asin(),e=L(i,r+4,s).times(.5),i.precision=r,i.rounding=s,e.minus(n))};h.inverseHyperbolicCosine=h.acosh=function(){var e,n,i=this,t=i.constructor;return i.lte(1)?new t(i.eq(1)?0:NaN):i.isFinite()?(e=t.precision,n=t.rounding,t.precision=e+Math.max(Math.abs(i.e),i.sd())+4,t.rounding=1,w=!1,i=i.times(i).minus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln()):new t(i)};h.inverseHyperbolicSine=h.asinh=function(){var e,n,i=this,t=i.constructor;return!i.isFinite()||i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+2*Math.max(Math.abs(i.e),i.sd())+6,t.rounding=1,w=!1,i=i.times(i).plus(1).sqrt().plus(i),w=!0,t.precision=e,t.rounding=n,i.ln())};h.inverseHyperbolicTangent=h.atanh=function(){var e,n,i,t,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=s.precision,n=s.rounding,t=r.sd(),Math.max(t,e)<2*-r.e-1?p(new s(r),e,n,!0):(s.precision=i=t-r.e,r=S(r.plus(1),new s(1).minus(r),i+e,1),s.precision=e+4,s.rounding=1,r=r.ln(),s.precision=e,s.rounding=n,r.times(.5))):new s(NaN)};h.inverseSine=h.asin=function(){var e,n,i,t,r=this,s=r.constructor;return r.isZero()?new s(r):(n=r.abs().cmp(1),i=s.precision,t=s.rounding,n!==-1?n===0?(e=L(s,i+4,t).times(.5),e.s=r.s,e):new s(NaN):(s.precision=i+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=i,s.rounding=t,r.times(2)))};h.inverseTangent=h.atan=function(){var e,n,i,t,r,s,o,u,l,f=this,c=f.constructor,a=c.precision,d=c.rounding;if(f.isFinite()){if(f.isZero())return new c(f);if(f.abs().eq(1)&&a+4<=ve)return o=L(c,a+4,d).times(.25),o.s=f.s,o}else{if(!f.s)return new c(NaN);if(a+4<=ve)return o=L(c,a+4,d).times(.5),o.s=f.s,o}for(c.precision=u=a+10,c.rounding=1,i=Math.min(28,u/m+2|0),e=i;e;--e)f=f.div(f.times(f).plus(1).sqrt().plus(1));for(w=!1,n=Math.ceil(u/m),t=1,l=f.times(f),o=new c(f),r=f;e!==-1;)if(r=r.times(l),s=o.minus(r.div(t+=2)),r=r.times(l),o=s.plus(r.div(t+=2)),o.d[n]!==void 0)for(e=n;o.d[e]===s.d[e]&&e--;);return i&&(o=o.times(2<this.d.length-2};h.isNaN=function(){return!this.s};h.isNegative=h.isNeg=function(){return this.s<0};h.isPositive=h.isPos=function(){return this.s>0};h.isZero=function(){return!!this.d&&this.d[0]===0};h.lessThan=h.lt=function(e){return this.cmp(e)<0};h.lessThanOrEqualTo=h.lte=function(e){return this.cmp(e)<1};h.logarithm=h.log=function(e){var n,i,t,r,s,o,u,l,f=this,c=f.constructor,a=c.precision,d=c.rounding,g=5;if(e==null)e=new c(10),n=!0;else{if(e=new c(e),i=e.d,e.s<0||!i||!i[0]||e.eq(1))return new c(NaN);n=e.eq(10)}if(i=f.d,f.s<0||!i||!i[0]||f.eq(1))return new c(i&&!i[0]?-1/0:f.s!=1?NaN:i?0:1/0);if(n)if(i.length>1)s=!0;else{for(r=i[0];r%10===0;)r/=10;s=r!==1}if(w=!1,u=a+g,o=B(f,u),t=n?se(c,u+10):B(e,u),l=S(o,t,u,1),Q(l.d,r=a,d))do if(u+=10,o=B(f,u),t=n?se(c,u+10):B(e,u),l=S(o,t,u,1),!s){+O(l.d).slice(r+1,r+15)+1==1e14&&(l=p(l,a+1,0));break}while(Q(l.d,r+=10,d));return w=!0,p(l,a,d)};h.minus=h.sub=function(e){var n,i,t,r,s,o,u,l,f,c,a,d,g=this,v=g.constructor;if(e=new v(e),!g.d||!e.d)return!g.s||!e.s?e=new v(NaN):g.d?e.s=-e.s:e=new v(e.d||g.s!==e.s?g:NaN),e;if(g.s!=e.s)return e.s=-e.s,g.plus(e);if(f=g.d,d=e.d,u=v.precision,l=v.rounding,!f[0]||!d[0]){if(d[0])e.s=-e.s;else if(f[0])e=new v(g);else return new v(l===3?-0:0);return w?p(e,u,l):e}if(i=A(e.e/m),c=A(g.e/m),f=f.slice(),s=c-i,s){for(a=s<0,a?(n=f,s=-s,o=d.length):(n=d,i=c,o=f.length),t=Math.max(Math.ceil(u/m),o)+2,s>t&&(s=t,n.length=1),n.reverse(),t=s;t--;)n.push(0);n.reverse()}else{for(t=f.length,o=d.length,a=t0;--t)f[o++]=0;for(t=d.length;t>s;){if(f[--t]o?s+1:o+1,r>o&&(r=o,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for(o=f.length,r=c.length,o-r<0&&(r=o,i=c,c=f,f=i),n=0;r;)n=(f[--r]=f[r]+c[r]+n)/D|0,f[r]%=D;for(n&&(f.unshift(n),++t),o=f.length;f[--o]==0;)f.pop();return e.d=f,e.e=ue(f,t),w?p(e,u,l):e};h.precision=h.sd=function(e){var n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error($+e);return i.d?(n=Ze(i.d),e&&i.e+1>n&&(n=i.e+1)):n=NaN,n};h.round=function(){var e=this,n=e.constructor;return p(new n(e),e.e+1,n.rounding)};h.sine=h.sin=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+Math.max(i.e,i.sd())+m,t.rounding=1,i=un(t,Ve(t,i)),t.precision=e,t.rounding=n,p(Z>2?i.neg():i,e,n,!0)):new t(NaN)};h.squareRoot=h.sqrt=function(){var e,n,i,t,r,s,o=this,u=o.d,l=o.e,f=o.s,c=o.constructor;if(f!==1||!u||!u[0])return new c(!f||f<0&&(!u||u[0])?NaN:u?o:1/0);for(w=!1,f=Math.sqrt(+o),f==0||f==1/0?(n=O(u),(n.length+l)%2==0&&(n+="0"),f=Math.sqrt(n),l=A((l+1)/2)-(l<0||l%2),f==1/0?n="5e"+l:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+l),t=new c(n)):t=new c(f.toString()),i=(l=c.precision)+3;;)if(s=t,t=s.plus(S(o,s,i+2,1)).times(.5),O(s.d).slice(0,i)===(n=O(t.d)).slice(0,i))if(n=n.slice(i-3,i+1),n=="9999"||!r&&n=="4999"){if(!r&&(p(s,l+1,0),s.times(s).eq(o))){t=s;break}i+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(p(t,l+1,1),e=!t.times(t).eq(o));break}return w=!0,p(t,l,c.rounding,e)};h.tangent=h.tan=function(){var e,n,i=this,t=i.constructor;return i.isFinite()?i.isZero()?new t(i):(e=t.precision,n=t.rounding,t.precision=e+10,t.rounding=1,i=i.sin(),i.s=1,i=S(i,new t(1).minus(i.times(i)).sqrt(),e+10,0),t.precision=e,t.rounding=n,p(Z==2||Z==4?i.neg():i,e,n,!0)):new t(NaN)};h.times=h.mul=function(e){var n,i,t,r,s,o,u,l,f,c=this,a=c.constructor,d=c.d,g=(e=new a(e)).d;if(e.s*=c.s,!d||!d[0]||!g||!g[0])return new a(!e.s||d&&!d[0]&&!g||g&&!g[0]&&!d?NaN:!d||!g?e.s/0:e.s*0);for(i=A(c.e/m)+A(e.e/m),l=d.length,f=g.length,l=0;){for(n=0,r=l+t;r>t;)u=s[r]+g[t]*d[r-t-1]+n,s[r--]=u%D|0,n=u/D|0;s[r]=(s[r]+n)%D|0}for(;!s[--o];)s.pop();return n?++i:s.shift(),e.d=s,e.e=ue(s,i),w?p(e,a.precision,a.rounding):e};h.toBinary=function(e,n){return ke(this,2,e,n)};h.toDecimalPlaces=h.toDP=function(e,n){var i=this,t=i.constructor;return i=new t(i),e===void 0?i:(R(e,0,V),n===void 0?n=t.rounding:R(n,0,8),p(i,e+i.e+1,n))};h.toExponential=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=F(t,!0):(R(e,0,V),n===void 0?n=r.rounding:R(n,0,8),t=p(new r(t),e+1,n),i=F(t,!0,e+1)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toFixed=function(e,n){var i,t,r=this,s=r.constructor;return e===void 0?i=F(r):(R(e,0,V),n===void 0?n=s.rounding:R(n,0,8),t=p(new s(r),e+r.e+1,n),i=F(t,!1,e+t.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i};h.toFraction=function(e){var n,i,t,r,s,o,u,l,f,c,a,d,g=this,v=g.d,N=g.constructor;if(!v)return new N(g);if(f=i=new N(1),t=l=new N(0),n=new N(t),s=n.e=Ze(v)-g.e-1,o=s%m,n.d[0]=M(10,o<0?m+o:o),e==null)e=s>0?n:f;else{if(u=new N(e),!u.isInt()||u.lt(f))throw Error($+u);e=u.gt(n)?s>0?n:f:u}for(w=!1,u=new N(O(v)),c=N.precision,N.precision=s=v.length*m*2;a=S(u,n,0,1,1),r=i.plus(a.times(t)),r.cmp(e)!=1;)i=t,t=r,r=f,f=l.plus(a.times(r)),l=r,r=n,n=u.minus(a.times(r)),u=r;return r=S(e.minus(i),t,0,1,1),l=l.plus(r.times(f)),i=i.plus(r.times(t)),l.s=f.s=g.s,d=S(f,t,s,1).minus(g).abs().cmp(S(l,i,s,1).minus(g).abs())<1?[f,t]:[l,i],N.precision=c,w=!0,d};h.toHexadecimal=h.toHex=function(e,n){return ke(this,16,e,n)};h.toNearest=function(e,n){var i=this,t=i.constructor;if(i=new t(i),e==null){if(!i.d)return i;e=new t(1),n=t.rounding}else{if(e=new t(e),n===void 0?n=t.rounding:R(n,0,8),!i.d)return e.s?i:e;if(!e.d)return e.s&&(e.s=i.s),e}return e.d[0]?(w=!1,i=S(i,e,0,n,1).times(e),w=!0,p(i)):(e.s=i.s,i=e),i};h.toNumber=function(){return+this};h.toOctal=function(e,n){return ke(this,8,e,n)};h.toPower=h.pow=function(e){var n,i,t,r,s,o,u=this,l=u.constructor,f=+(e=new l(e));if(!u.d||!e.d||!u.d[0]||!e.d[0])return new l(M(+u,f));if(u=new l(u),u.eq(1))return u;if(t=l.precision,s=l.rounding,e.eq(1))return p(u,t,s);if(n=A(e.e/m),n>=e.d.length-1&&(i=f<0?-f:f)<=tn)return r=Ue(l,u,i,t),e.s<0?new l(1).div(r):p(r,t,s);if(o=u.s,o<0){if(nl.maxE+1||n0?o/0:0):(w=!1,l.rounding=u.s=1,i=Math.min(12,(n+"").length),r=Ee(e.times(B(u,t+i)),t),r.d&&(r=p(r,t+5,1),Q(r.d,t,s)&&(n=t+10,r=p(Ee(e.times(B(u,n+i)),n),n+5,1),+O(r.d).slice(t+1,t+15)+1==1e14&&(r=p(r,t+1,0)))),r.s=o,w=!0,l.rounding=s,p(r,t,s))};h.toPrecision=function(e,n){var i,t=this,r=t.constructor;return e===void 0?i=F(t,t.e<=r.toExpNeg||t.e>=r.toExpPos):(R(e,1,V),n===void 0?n=r.rounding:R(n,0,8),t=p(new r(t),e,n),i=F(t,e<=t.e||t.e<=r.toExpNeg,e)),t.isNeg()&&!t.isZero()?"-"+i:i};h.toSignificantDigits=h.toSD=function(e,n){var i=this,t=i.constructor;return e===void 0?(e=t.precision,n=t.rounding):(R(e,1,V),n===void 0?n=t.rounding:R(n,0,8)),p(new t(i),e,n)};h.toString=function(){var e=this,n=e.constructor,i=F(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()&&!e.isZero()?"-"+i:i};h.truncated=h.trunc=function(){return p(new this.constructor(this),this.e+1,1)};h.valueOf=h.toJSON=function(){var e=this,n=e.constructor,i=F(e,e.e<=n.toExpNeg||e.e>=n.toExpPos);return e.isNeg()?"-"+i:i};function O(e){var n,i,t,r=e.length-1,s="",o=e[0];if(r>0){for(s+=o,n=1;ni)throw Error($+e)}function Q(e,n,i,t){var r,s,o,u;for(s=e[0];s>=10;s/=10)--n;return--n<0?(n+=m,r=0):(r=Math.ceil((n+1)/m),n%=m),s=M(10,m-n),u=e[r]%s|0,t==null?n<3?(n==0?u=u/100|0:n==1&&(u=u/10|0),o=i<4&&u==99999||i>3&&u==49999||u==5e4||u==0):o=(i<4&&u+1==s||i>3&&u+1==s/2)&&(e[r+1]/s/100|0)==M(10,n-2)-1||(u==s/2||u==0)&&(e[r+1]/s/100|0)==0:n<4?(n==0?u=u/1e3|0:n==1?u=u/100|0:n==2&&(u=u/10|0),o=(t||i<4)&&u==9999||!t&&i>3&&u==4999):o=((t||i<4)&&u+1==s||!t&&i>3&&u+1==s/2)&&(e[r+1]/s/1e3|0)==M(10,n-3)-1,o}function ie(e,n,i){for(var t,r=[0],s,o=0,u=e.length;oi-1&&(r[t+1]===void 0&&(r[t+1]=0),r[t+1]+=r[t]/i|0,r[t]%=i)}return r.reverse()}function sn(e,n){var i,t,r;if(n.isZero())return n;t=n.d.length,t<32?(i=Math.ceil(t/3),r=(1/fe(4,i)).toString()):(i=16,r="2.3283064365386962890625e-10"),e.precision+=i,n=W(e,1,n.times(r),new e(1));for(var s=i;s--;){var o=n.times(n);n=o.times(o).minus(o).times(8).plus(1)}return e.precision-=i,n}var S=function(){function e(t,r,s){var o,u=0,l=t.length;for(t=t.slice();l--;)o=t[l]*r+u,t[l]=o%s|0,u=o/s|0;return u&&t.unshift(u),t}function n(t,r,s,o){var u,l;if(s!=o)l=s>o?1:-1;else for(u=l=0;ur[u]?1:-1;break}return l}function i(t,r,s,o){for(var u=0;s--;)t[s]-=u,u=t[s]1;)t.shift()}return function(t,r,s,o,u,l){var f,c,a,d,g,v,N,_,C,q,E,P,x,I,le,z,G,ce,T,y,ee=t.constructor,ae=t.s==r.s?1:-1,b=t.d,k=r.d;if(!b||!b[0]||!k||!k[0])return new ee(!t.s||!r.s||(b?k&&b[0]==k[0]:!k)?NaN:b&&b[0]==0||!k?ae*0:ae/0);for(l?(g=1,c=t.e-r.e):(l=D,g=m,c=A(t.e/g)-A(r.e/g)),T=k.length,G=b.length,C=new ee(ae),q=C.d=[],a=0;k[a]==(b[a]||0);a++);if(k[a]>(b[a]||0)&&c--,s==null?(I=s=ee.precision,o=ee.rounding):u?I=s+(t.e-r.e)+1:I=s,I<0)q.push(1),v=!0;else{if(I=I/g+2|0,a=0,T==1){for(d=0,k=k[0],I++;(a1&&(k=e(k,d,l),b=e(b,d,l),T=k.length,G=b.length),z=T,E=b.slice(0,T),P=E.length;P=l/2&&++ce;do d=0,f=n(k,E,T,P),f<0?(x=E[0],T!=P&&(x=x*l+(E[1]||0)),d=x/ce|0,d>1?(d>=l&&(d=l-1),N=e(k,d,l),_=N.length,P=E.length,f=n(N,E,_,P),f==1&&(d--,i(N,T<_?y:k,_,l))):(d==0&&(f=d=1),N=k.slice()),_=N.length,_=10;d/=10)a++;C.e=a+c*g-1,p(C,u?s+C.e+1:s,o,v)}return C}}();function p(e,n,i,t){var r,s,o,u,l,f,c,a,d,g=e.constructor;e:if(n!=null){if(a=e.d,!a)return e;for(r=1,u=a[0];u>=10;u/=10)r++;if(s=n-r,s<0)s+=m,o=n,c=a[d=0],l=c/M(10,r-o-1)%10|0;else if(d=Math.ceil((s+1)/m),u=a.length,d>=u)if(t){for(;u++<=d;)a.push(0);c=l=0,r=1,s%=m,o=s-m+1}else break e;else{for(c=u=a[d],r=1;u>=10;u/=10)r++;s%=m,o=s-m+r,l=o<0?0:c/M(10,r-o-1)%10|0}if(t=t||n<0||a[d+1]!==void 0||(o<0?c:c%M(10,r-o-1)),f=i<4?(l||t)&&(i==0||i==(e.s<0?3:2)):l>5||l==5&&(i==4||t||i==6&&(s>0?o>0?c/M(10,r-o):0:a[d-1])%10&1||i==(e.s<0?8:7)),n<1||!a[0])return a.length=0,f?(n-=e.e+1,a[0]=M(10,(m-n%m)%m),e.e=-n||0):a[0]=e.e=0,e;if(s==0?(a.length=d,u=1,d--):(a.length=d+1,u=M(10,m-s),a[d]=o>0?(c/M(10,r-o)%M(10,o)|0)*u:0),f)for(;;)if(d==0){for(s=1,o=a[0];o>=10;o/=10)s++;for(o=a[0]+=u,u=1;o>=10;o/=10)u++;s!=u&&(e.e++,a[0]==D&&(a[0]=1));break}else{if(a[d]+=u,a[d]!=D)break;a[d--]=0,u=1}for(s=a.length;a[--s]===0;)a.pop()}return w&&(e.e>g.maxE?(e.d=null,e.e=NaN):e.e0?s=s.charAt(0)+"."+s.slice(1)+U(t):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+U(-r-1)+s,i&&(t=i-o)>0&&(s+=U(t))):r>=o?(s+=U(r+1-o),i&&(t=i-r-1)>0&&(s=s+"."+U(t))):((t=r+1)0&&(r+1===o&&(s+="."),s+=U(t))),s}function ue(e,n){var i=e[0];for(n*=m;i>=10;i/=10)n++;return n}function se(e,n,i){if(n>rn)throw w=!0,i&&(e.precision=i),Error(Le);return p(new e(te),n,1,!0)}function L(e,n,i){if(n>ve)throw Error(Le);return p(new e(re),n,i,!0)}function Ze(e){var n=e.length-1,i=n*m+1;if(n=e[n],n){for(;n%10==0;n/=10)i--;for(n=e[0];n>=10;n/=10)i++}return i}function U(e){for(var n="";e--;)n+="0";return n}function Ue(e,n,i,t){var r,s=new e(1),o=Math.ceil(t/m+4);for(w=!1;;){if(i%2&&(s=s.times(n),Re(s.d,o)&&(r=!0)),i=A(i/2),i===0){i=s.d.length-1,r&&s.d[i]===0&&++s.d[i];break}n=n.times(n),Re(n.d,o)}return w=!0,s}function _e(e){return e.d[e.d.length-1]&1}function Be(e,n,i){for(var t,r=new e(n[0]),s=0;++s17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(n==null?(w=!1,l=v):l=n,u=new d(.03125);e.e>-2;)e=e.times(u),a+=5;for(t=Math.log(M(2,a))/Math.LN10*2+5|0,l+=t,i=s=o=new d(1),d.precision=l;;){if(s=p(s.times(e),l,1),i=i.times(++c),u=o.plus(S(s,i,l,1)),O(u.d).slice(0,l)===O(o.d).slice(0,l)){for(r=a;r--;)o=p(o.times(o),l,1);if(n==null)if(f<3&&Q(o.d,l-t,g,f))d.precision=l+=10,i=s=u=new d(1),c=0,f++;else return p(o,d.precision=v,g,w=!0);else return d.precision=v,o}o=u}}function B(e,n){var i,t,r,s,o,u,l,f,c,a,d,g=1,v=10,N=e,_=N.d,C=N.constructor,q=C.rounding,E=C.precision;if(N.s<0||!_||!_[0]||!N.e&&_[0]==1&&_.length==1)return new C(_&&!_[0]?-1/0:N.s!=1?NaN:_?0:N);if(n==null?(w=!1,c=E):c=n,C.precision=c+=v,i=O(_),t=i.charAt(0),Math.abs(s=N.e)<15e14){for(;t<7&&t!=1||t==1&&i.charAt(1)>3;)N=N.times(e),i=O(N.d),t=i.charAt(0),g++;s=N.e,t>1?(N=new C("0."+i),s++):N=new C(t+"."+i.slice(1))}else return f=se(C,c+2,E).times(s+""),N=B(new C(t+"."+i.slice(1)),c-v).plus(f),C.precision=E,n==null?p(N,E,q,w=!0):N;for(a=N,l=o=N=S(N.minus(1),N.plus(1),c,1),d=p(N.times(N),c,1),r=3;;){if(o=p(o.times(d),c,1),f=l.plus(S(o,new C(r),c,1)),O(f.d).slice(0,c)===O(l.d).slice(0,c))if(l=l.times(2),s!==0&&(l=l.plus(se(C,c+2,E).times(s+""))),l=S(l,new C(g),c,1),n==null)if(Q(l.d,c-v,q,u))C.precision=c+=v,f=o=N=S(a.minus(1),a.plus(1),c,1),d=p(N.times(N),c,1),r=u=1;else return p(l,C.precision=E,q,w=!0);else return C.precision=E,l;l=f,r+=2}}function $e(e){return String(e.s*e.s/0)}function Se(e,n){var i,t,r;for((i=n.indexOf("."))>-1&&(n=n.replace(".","")),(t=n.search(/e/i))>0?(i<0&&(i=t),i+=+n.slice(t+1),n=n.substring(0,t)):i<0&&(i=n.length),t=0;n.charCodeAt(t)===48;t++);for(r=n.length;n.charCodeAt(r-1)===48;--r);if(n=n.slice(t,r),n){if(r-=t,e.e=i=i-t-1,e.d=[],t=(i+1)%m,i<0&&(t+=m),te.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Ie.test(n))return Se(e,n)}else if(n==="Infinity"||n==="NaN")return+n||(e.s=NaN),e.e=NaN,e.d=null,e;if(en.test(n))i=16,n=n.toLowerCase();else if(ye.test(n))i=2;else if(nn.test(n))i=8;else throw Error($+n);for(s=n.search(/p/i),s>0?(l=+n.slice(s+1),n=n.substring(2,s)):n=n.slice(2),s=n.indexOf("."),o=s>=0,t=e.constructor,o&&(n=n.replace(".",""),u=n.length,s=u-s,r=Ue(t,new t(i),s,s*2)),f=ie(n,i,D),c=f.length-1,s=c;f[s]===0;--s)f.pop();return s<0?new t(e.s*0):(e.e=ue(f,c),e.d=f,w=!1,o&&(e=S(e,r,u*4)),l&&(e=e.times(Math.abs(l)<54?M(2,l):Y.pow(2,l))),w=!0,e)}function un(e,n){var i,t=n.d.length;if(t<3)return n.isZero()?n:W(e,2,n,n);i=1.4*Math.sqrt(t),i=i>16?16:i|0,n=n.times(1/fe(5,i)),n=W(e,2,n,n);for(var r,s=new e(5),o=new e(16),u=new e(20);i--;)r=n.times(n),n=n.times(s.plus(r.times(o.times(r).minus(u))));return n}function W(e,n,i,t,r){var s,o,u,l,f=1,c=e.precision,a=Math.ceil(c/m);for(w=!1,l=i.times(i),u=new e(t);;){if(o=S(u.times(l),new e(n++*n++),c,1),u=r?t.plus(o):t.minus(o),t=S(o.times(l),new e(n++*n++),c,1),o=u.plus(t),o.d[a]!==void 0){for(s=a;o.d[s]===u.d[s]&&s--;);if(s==-1)break}s=u,u=t,t=o,o=s,f++}return w=!0,o.d.length=a+1,o}function fe(e,n){for(var i=e;--n;)i*=e;return i}function Ve(e,n){var i,t=n.s<0,r=L(e,e.precision,1),s=r.times(.5);if(n=n.abs(),n.lte(s))return Z=t?4:1,n;if(i=n.divToInt(r),i.isZero())Z=t?3:2;else{if(n=n.minus(i.times(r)),n.lte(s))return Z=_e(i)?t?2:3:t?4:1,n;Z=_e(i)?t?1:4:t?3:2}return n.minus(r).abs()}function ke(e,n,i,t){var r,s,o,u,l,f,c,a,d,g=e.constructor,v=i!==void 0;if(v?(R(i,1,V),t===void 0?t=g.rounding:R(t,0,8)):(i=g.precision,t=g.rounding),!e.isFinite())c=$e(e);else{for(c=F(e),o=c.indexOf("."),v?(r=2,n==16?i=i*4-3:n==8&&(i=i*3-2)):r=n,o>=0&&(c=c.replace(".",""),d=new g(1),d.e=c.length-o,d.d=ie(F(d),10,r),d.e=d.d.length),a=ie(c,10,r),s=l=a.length;a[--l]==0;)a.pop();if(!a[0])c=v?"0p+0":"0";else{if(o<0?s--:(e=new g(e),e.d=a,e.e=s,e=S(e,d,i,t,0,r),a=e.d,s=e.e,f=Te),o=a[i],u=r/2,f=f||a[i+1]!==void 0,f=t<4?(o!==void 0||f)&&(t===0||t===(e.s<0?3:2)):o>u||o===u&&(t===4||f||t===6&&a[i-1]&1||t===(e.s<0?8:7)),a.length=i,f)for(;++a[--i]>r-1;)a[i]=0,i||(++s,a.unshift(1));for(l=a.length;!a[l-1];--l);for(o=0,c="";o1)if(n==16||n==8){for(o=n==16?4:3,--l;l%o;l++)c+="0";for(a=ie(c,r,n),l=a.length;!a[l-1];--l);for(o=1,c="1.";ol)for(s-=l;s--;)c+="0";else sn)return e.length=n,!0}function fn(e){return new this(e).abs()}function ln(e){return new this(e).acos()}function cn(e){return new this(e).acosh()}function an(e,n){return new this(e).plus(n)}function dn(e){return new this(e).asin()}function hn(e){return new this(e).asinh()}function pn(e){return new this(e).atan()}function gn(e){return new this(e).atanh()}function mn(e,n){e=new this(e),n=new this(n);var i,t=this.precision,r=this.rounding,s=t+4;return!e.s||!n.s?i=new this(NaN):!e.d&&!n.d?(i=L(this,s,1).times(n.s>0?.25:.75),i.s=e.s):!n.d||e.isZero()?(i=n.s<0?L(this,t,r):new this(0),i.s=e.s):!e.d||n.isZero()?(i=L(this,s,1).times(.5),i.s=e.s):n.s<0?(this.precision=s,this.rounding=1,i=this.atan(S(e,n,s,1)),n=L(this,s,1),this.precision=t,this.rounding=r,i=e.s<0?i.minus(n):i.plus(n)):i=this.atan(S(e,n,s,1)),i}function wn(e){return new this(e).cbrt()}function Nn(e){return p(e=new this(e),e.e+1,2)}function vn(e,n,i){return new this(e).clamp(n,i)}function En(e){if(!e||typeof e!="object")throw Error(oe+"Object expected");var n,i,t,r=e.defaults===!0,s=["precision",1,V,"rounding",0,8,"toExpNeg",-H,0,"toExpPos",0,H,"maxE",0,H,"minE",-H,0,"modulo",0,9];for(n=0;n=s[n+1]&&t<=s[n+2])this[i]=t;else throw Error($+i+": "+t);if(i="crypto",r&&(this[i]=Ne[i]),(t=e[i])!==void 0)if(t===!0||t===!1||t===0||t===1)if(t)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[i]=!0;else throw Error(De);else this[i]=!1;else throw Error($+i+": "+t);return this}function Sn(e){return new this(e).cos()}function kn(e){return new this(e).cosh()}function He(e){var n,i,t;function r(s){var o,u,l,f=this;if(!(f instanceof r))return new r(s);if(f.constructor=r,qe(s)){f.s=s.s,w?!s.d||s.e>r.maxE?(f.e=NaN,f.d=null):s.e=10;u/=10)o++;w?o>r.maxE?(f.e=NaN,f.d=null):o=429e7?n[s]=crypto.getRandomValues(new Uint32Array(1))[0]:u[s++]=r%1e7;else if(crypto.randomBytes){for(n=crypto.randomBytes(t*=4);s=214e7?crypto.randomBytes(4).copy(n,s):(u.push(r%1e7),s+=4);s=t/4}else throw Error(De);else for(;s=10;r/=10)t++;t - * MIT Licence - *) -*/ -//# sourceMappingURL=index-browser.js.map diff --git a/integration-tests/tests/prisma/sqlite/client/runtime/library.d.ts b/integration-tests/tests/prisma/sqlite/client/runtime/library.d.ts deleted file mode 100644 index 5e02beada..000000000 --- a/integration-tests/tests/prisma/sqlite/client/runtime/library.d.ts +++ /dev/null @@ -1,3193 +0,0 @@ -/** - * @param this - */ -declare function $extends(this: Client, extension: ExtensionArgs | ((client: Client) => Client)): Client; - -declare type AccelerateEngineConfig = { - inlineSchema: EngineConfig['inlineSchema']; - inlineSchemaHash: EngineConfig['inlineSchemaHash']; - env: EngineConfig['env']; - generator?: { - previewFeatures: string[]; - }; - inlineDatasources: EngineConfig['inlineDatasources']; - overrideDatasources: EngineConfig['overrideDatasources']; - clientVersion: EngineConfig['clientVersion']; - engineVersion: EngineConfig['engineVersion']; - logEmitter: EngineConfig['logEmitter']; - logQueries?: EngineConfig['logQueries']; - logLevel?: EngineConfig['logLevel']; - tracingHelper: EngineConfig['tracingHelper']; - accelerateUtils?: EngineConfig['accelerateUtils']; -}; - -export declare type Action = keyof typeof DMMF.ModelAction | 'executeRaw' | 'queryRaw' | 'runCommandRaw'; - -export declare type Aggregate = '_count' | '_max' | '_min' | '_avg' | '_sum'; - -export declare type AllModelsToStringIndex, K extends PropertyKey> = Args extends { - [P in K]: { - $allModels: infer AllModels; - }; -} ? { - [P in K]: Record; -} : {}; - -declare class AnyNull extends NullTypesEnumValue { -} - -export declare type Args = T extends { - [K: symbol]: { - types: { - operations: { - [K in F]: { - args: any; - }; - }; - }; - }; -} ? T[symbol]['types']['operations'][F]['args'] : any; - -export declare type Args_3 = Args; - -/** - * Attributes is a map from string to attribute values. - * - * Note: only the own enumerable keys are counted as valid attribute keys. - */ -declare interface Attributes { - [attributeKey: string]: AttributeValue | undefined; -} - -/** - * Attribute values may be any non-nullish primitive value except an object. - * - * null or undefined attribute values are invalid and will result in undefined behavior. - */ -declare type AttributeValue = string | number | boolean | Array | Array | Array; - -export declare type BaseDMMF = Pick; - -declare type BatchArgs = { - queries: BatchQuery[]; - transaction?: { - isolationLevel?: IsolationLevel; - }; -}; - -declare type BatchInternalParams = { - requests: RequestParams[]; - customDataProxyFetch?: CustomDataProxyFetch; -}; - -declare type BatchQuery = { - model: string | undefined; - operation: string; - args: JsArgs | RawQueryArgs; -}; - -declare type BatchQueryEngineResult = QueryEngineResult | Error; - -declare type BatchQueryOptionsCb = (args: BatchQueryOptionsCbArgs) => Promise; - -declare type BatchQueryOptionsCbArgs = { - args: BatchArgs; - query: (args: BatchArgs, __internalParams?: BatchInternalParams) => Promise; - __internalParams: BatchInternalParams; -}; - -declare type BatchTransactionOptions = { - isolationLevel?: Transaction_2.IsolationLevel; -}; - -declare interface BinaryTargetsEnvValue { - fromEnvVar: string | null; - value: string; - native?: boolean; -} - -export declare type Call = (F & { - params: P; -})['returns']; - -declare interface CallSite { - getLocation(): LocationInFile | null; -} - -export declare type Cast = A extends W ? A : W; - -declare type Client = ReturnType extends new () => infer T ? T : never; - -export declare type ClientArg = { - [MethodName in string]: unknown; -}; - -export declare type ClientArgs = { - client: ClientArg; -}; - -export declare type ClientBuiltInProp = keyof DynamicClientExtensionThisBuiltin; - -declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum]; - -declare const ColumnTypeEnum: { - readonly Int32: 0; - readonly Int64: 1; - readonly Float: 2; - readonly Double: 3; - readonly Numeric: 4; - readonly Boolean: 5; - readonly Character: 6; - readonly Text: 7; - readonly Date: 8; - readonly Time: 9; - readonly DateTime: 10; - readonly Json: 11; - readonly Enum: 12; - readonly Bytes: 13; - readonly Set: 14; - readonly Uuid: 15; - readonly Int32Array: 64; - readonly Int64Array: 65; - readonly FloatArray: 66; - readonly DoubleArray: 67; - readonly NumericArray: 68; - readonly BooleanArray: 69; - readonly CharacterArray: 70; - readonly TextArray: 71; - readonly DateArray: 72; - readonly TimeArray: 73; - readonly DateTimeArray: 74; - readonly JsonArray: 75; - readonly EnumArray: 76; - readonly BytesArray: 77; - readonly UuidArray: 78; - readonly UnknownNumber: 128; -}; - -export declare type Compute = T extends Function ? T : { - [K in keyof T]: T[K]; -} & unknown; - -export declare type ComputeDeep = T extends Function ? T : { - [K in keyof T]: ComputeDeep; -} & unknown; - -declare type ComputedField = { - name: string; - needs: string[]; - compute: ResultArgsFieldCompute; -}; - -declare type ComputedFieldsMap = { - [fieldName: string]: ComputedField; -}; - -declare type ConnectionInfo = { - schemaName?: string; -}; - -declare interface Context { - /** - * Get a value from the context. - * - * @param key key which identifies a context value - */ - getValue(key: symbol): unknown; - /** - * Create a new context which inherits from this context and has - * the given key set to the given value. - * - * @param key context key for which to set the value - * @param value value to set for the given key - */ - setValue(key: symbol, value: unknown): Context; - /** - * Return a new context which inherits from this context but does - * not contain a value for the given key. - * - * @param key context key for which to clear a value - */ - deleteValue(key: symbol): Context; -} - -declare type Context_2 = T extends { - [K: symbol]: { - ctx: infer C; - }; -} ? C & T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -} : T & { - /** - * @deprecated Use `$name` instead. - */ - name?: string; - $name?: string; - $parent?: unknown; -}; - -export declare type Count = { - [K in keyof O]: Count; -} & {}; - -declare type CustomDataProxyFetch = (fetch: Fetch) => Fetch; - -declare class DataLoader { - private options; - batches: { - [key: string]: Job[]; - }; - private tickActive; - constructor(options: DataLoaderOptions); - request(request: T): Promise; - private dispatchBatches; - get [Symbol.toStringTag](): string; -} - -declare type DataLoaderOptions = { - singleLoader: (request: T) => Promise; - batchLoader: (request: T[]) => Promise; - batchBy: (request: T) => string | undefined; - batchOrder: (requestA: T, requestB: T) => number; -}; - -declare type Datasource = { - url?: string; -}; - -declare type Datasources = { - [name in string]: Datasource; -}; - -declare class DbNull extends NullTypesEnumValue { -} - -export declare const Debug: typeof debugCreate & { - enable(namespace: any): void; - disable(): any; - enabled(namespace: string): boolean; - log: (...args: string[]) => void; - formatters: {}; -}; - -/** - * Create a new debug instance with the given namespace. - * - * @example - * ```ts - * import Debug from '@prisma/debug' - * const debug = Debug('prisma:client') - * debug('Hello World') - * ``` - */ -declare function debugCreate(namespace: string): ((...args: any[]) => void) & { - color: string; - enabled: boolean; - namespace: string; - log: (...args: string[]) => void; - extend: () => void; -}; - -export declare namespace Decimal { - export type Constructor = typeof Decimal; - export type Instance = Decimal; - export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; - export type Modulo = Rounding | 9; - export type Value = string | number | Decimal; - - // http://mikemcl.github.io/decimal.js/#constructor-properties - export interface Config { - precision?: number; - rounding?: Rounding; - toExpNeg?: number; - toExpPos?: number; - minE?: number; - maxE?: number; - crypto?: boolean; - modulo?: Modulo; - defaults?: boolean; - } -} - -export declare class Decimal { - readonly d: number[]; - readonly e: number; - readonly s: number; - - constructor(n: Decimal.Value); - - absoluteValue(): Decimal; - abs(): Decimal; - - ceil(): Decimal; - - clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal; - clamp(min: Decimal.Value, max: Decimal.Value): Decimal; - - comparedTo(n: Decimal.Value): number; - cmp(n: Decimal.Value): number; - - cosine(): Decimal; - cos(): Decimal; - - cubeRoot(): Decimal; - cbrt(): Decimal; - - decimalPlaces(): number; - dp(): number; - - dividedBy(n: Decimal.Value): Decimal; - div(n: Decimal.Value): Decimal; - - dividedToIntegerBy(n: Decimal.Value): Decimal; - divToInt(n: Decimal.Value): Decimal; - - equals(n: Decimal.Value): boolean; - eq(n: Decimal.Value): boolean; - - floor(): Decimal; - - greaterThan(n: Decimal.Value): boolean; - gt(n: Decimal.Value): boolean; - - greaterThanOrEqualTo(n: Decimal.Value): boolean; - gte(n: Decimal.Value): boolean; - - hyperbolicCosine(): Decimal; - cosh(): Decimal; - - hyperbolicSine(): Decimal; - sinh(): Decimal; - - hyperbolicTangent(): Decimal; - tanh(): Decimal; - - inverseCosine(): Decimal; - acos(): Decimal; - - inverseHyperbolicCosine(): Decimal; - acosh(): Decimal; - - inverseHyperbolicSine(): Decimal; - asinh(): Decimal; - - inverseHyperbolicTangent(): Decimal; - atanh(): Decimal; - - inverseSine(): Decimal; - asin(): Decimal; - - inverseTangent(): Decimal; - atan(): Decimal; - - isFinite(): boolean; - - isInteger(): boolean; - isInt(): boolean; - - isNaN(): boolean; - - isNegative(): boolean; - isNeg(): boolean; - - isPositive(): boolean; - isPos(): boolean; - - isZero(): boolean; - - lessThan(n: Decimal.Value): boolean; - lt(n: Decimal.Value): boolean; - - lessThanOrEqualTo(n: Decimal.Value): boolean; - lte(n: Decimal.Value): boolean; - - logarithm(n?: Decimal.Value): Decimal; - log(n?: Decimal.Value): Decimal; - - minus(n: Decimal.Value): Decimal; - sub(n: Decimal.Value): Decimal; - - modulo(n: Decimal.Value): Decimal; - mod(n: Decimal.Value): Decimal; - - naturalExponential(): Decimal; - exp(): Decimal; - - naturalLogarithm(): Decimal; - ln(): Decimal; - - negated(): Decimal; - neg(): Decimal; - - plus(n: Decimal.Value): Decimal; - add(n: Decimal.Value): Decimal; - - precision(includeZeros?: boolean): number; - sd(includeZeros?: boolean): number; - - round(): Decimal; - - sine() : Decimal; - sin() : Decimal; - - squareRoot(): Decimal; - sqrt(): Decimal; - - tangent() : Decimal; - tan() : Decimal; - - times(n: Decimal.Value): Decimal; - mul(n: Decimal.Value) : Decimal; - - toBinary(significantDigits?: number): string; - toBinary(significantDigits: number, rounding: Decimal.Rounding): string; - - toDecimalPlaces(decimalPlaces?: number): Decimal; - toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - toDP(decimalPlaces?: number): Decimal; - toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal; - - toExponential(decimalPlaces?: number): string; - toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFixed(decimalPlaces?: number): string; - toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string; - - toFraction(max_denominator?: Decimal.Value): Decimal[]; - - toHexadecimal(significantDigits?: number): string; - toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string; - toHex(significantDigits?: number): string; - toHex(significantDigits: number, rounding?: Decimal.Rounding): string; - - toJSON(): string; - - toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal; - - toNumber(): number; - - toOctal(significantDigits?: number): string; - toOctal(significantDigits: number, rounding: Decimal.Rounding): string; - - toPower(n: Decimal.Value): Decimal; - pow(n: Decimal.Value): Decimal; - - toPrecision(significantDigits?: number): string; - toPrecision(significantDigits: number, rounding: Decimal.Rounding): string; - - toSignificantDigits(significantDigits?: number): Decimal; - toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal; - toSD(significantDigits?: number): Decimal; - toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal; - - toString(): string; - - truncated(): Decimal; - trunc(): Decimal; - - valueOf(): string; - - static abs(n: Decimal.Value): Decimal; - static acos(n: Decimal.Value): Decimal; - static acosh(n: Decimal.Value): Decimal; - static add(x: Decimal.Value, y: Decimal.Value): Decimal; - static asin(n: Decimal.Value): Decimal; - static asinh(n: Decimal.Value): Decimal; - static atan(n: Decimal.Value): Decimal; - static atanh(n: Decimal.Value): Decimal; - static atan2(y: Decimal.Value, x: Decimal.Value): Decimal; - static cbrt(n: Decimal.Value): Decimal; - static ceil(n: Decimal.Value): Decimal; - static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal; - static clone(object?: Decimal.Config): Decimal.Constructor; - static config(object: Decimal.Config): Decimal.Constructor; - static cos(n: Decimal.Value): Decimal; - static cosh(n: Decimal.Value): Decimal; - static div(x: Decimal.Value, y: Decimal.Value): Decimal; - static exp(n: Decimal.Value): Decimal; - static floor(n: Decimal.Value): Decimal; - static hypot(...n: Decimal.Value[]): Decimal; - static isDecimal(object: any): object is Decimal; - static ln(n: Decimal.Value): Decimal; - static log(n: Decimal.Value, base?: Decimal.Value): Decimal; - static log2(n: Decimal.Value): Decimal; - static log10(n: Decimal.Value): Decimal; - static max(...n: Decimal.Value[]): Decimal; - static min(...n: Decimal.Value[]): Decimal; - static mod(x: Decimal.Value, y: Decimal.Value): Decimal; - static mul(x: Decimal.Value, y: Decimal.Value): Decimal; - static noConflict(): Decimal.Constructor; // Browser only - static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal; - static random(significantDigits?: number): Decimal; - static round(n: Decimal.Value): Decimal; - static set(object: Decimal.Config): Decimal.Constructor; - static sign(n: Decimal.Value): number; - static sin(n: Decimal.Value): Decimal; - static sinh(n: Decimal.Value): Decimal; - static sqrt(n: Decimal.Value): Decimal; - static sub(x: Decimal.Value, y: Decimal.Value): Decimal; - static sum(...n: Decimal.Value[]): Decimal; - static tan(n: Decimal.Value): Decimal; - static tanh(n: Decimal.Value): Decimal; - static trunc(n: Decimal.Value): Decimal; - - static readonly default?: Decimal.Constructor; - static readonly Decimal?: Decimal.Constructor; - - static readonly precision: number; - static readonly rounding: Decimal.Rounding; - static readonly toExpNeg: number; - static readonly toExpPos: number; - static readonly minE: number; - static readonly maxE: number; - static readonly crypto: boolean; - static readonly modulo: Decimal.Modulo; - - static readonly ROUND_UP: 0; - static readonly ROUND_DOWN: 1; - static readonly ROUND_CEIL: 2; - static readonly ROUND_FLOOR: 3; - static readonly ROUND_HALF_UP: 4; - static readonly ROUND_HALF_DOWN: 5; - static readonly ROUND_HALF_EVEN: 6; - static readonly ROUND_HALF_CEIL: 7; - static readonly ROUND_HALF_FLOOR: 8; - static readonly EUCLID: 9; -} - -/** - * Interface for any Decimal.js-like library - * Allows us to accept Decimal.js from different - * versions and some compatible alternatives - */ -export declare interface DecimalJsLike { - d: number[]; - e: number; - s: number; - toFixed(): string; -} - -export declare type DefaultArgs = InternalArgs<{}, {}, {}, {}>; - -export declare type DefaultSelection

= UnwrapPayload<{ - default: P; -}>['default']; - -export declare function defineDmmfProperty(target: object, runtimeDataModel: RuntimeDataModel): void; - -declare function defineExtension(ext: ExtensionArgs | ((client: Client) => Client)): (client: Client) => Client; - -declare const denylist: readonly ["$connect", "$disconnect", "$on", "$transaction", "$use", "$extends"]; - -export declare type DevTypeMapDef = { - meta: { - modelProps: string; - }; - model: { - [Model in PropertyKey]: { - [Operation in PropertyKey]: DevTypeMapFnDef; - }; - }; - other: { - [Operation in PropertyKey]: DevTypeMapFnDef; - }; -}; - -export declare type DevTypeMapFnDef = { - args: any; - result: any; - payload: OperationPayload; -}; - -export declare namespace DMMF { - export type Document = ReadonlyDeep_2<{ - datamodel: Datamodel; - schema: Schema; - mappings: Mappings; - }>; - export type Mappings = ReadonlyDeep_2<{ - modelOperations: ModelMapping[]; - otherOperations: { - read: string[]; - write: string[]; - }; - }>; - export type OtherOperationMappings = ReadonlyDeep_2<{ - read: string[]; - write: string[]; - }>; - export type DatamodelEnum = ReadonlyDeep_2<{ - name: string; - values: EnumValue[]; - dbName?: string | null; - documentation?: string; - }>; - export type SchemaEnum = ReadonlyDeep_2<{ - name: string; - values: string[]; - }>; - export type EnumValue = ReadonlyDeep_2<{ - name: string; - dbName: string | null; - }>; - export type Datamodel = ReadonlyDeep_2<{ - models: Model[]; - enums: DatamodelEnum[]; - types: Model[]; - }>; - export type uniqueIndex = ReadonlyDeep_2<{ - name: string; - fields: string[]; - }>; - export type PrimaryKey = ReadonlyDeep_2<{ - name: string | null; - fields: string[]; - }>; - export type Model = ReadonlyDeep_2<{ - name: string; - dbName: string | null; - fields: Field[]; - uniqueFields: string[][]; - uniqueIndexes: uniqueIndex[]; - documentation?: string; - primaryKey: PrimaryKey | null; - isGenerated?: boolean; - }>; - export type FieldKind = 'scalar' | 'object' | 'enum' | 'unsupported'; - export type FieldNamespace = 'model' | 'prisma'; - export type FieldLocation = 'scalar' | 'inputObjectTypes' | 'outputObjectTypes' | 'enumTypes' | 'fieldRefTypes'; - export type Field = ReadonlyDeep_2<{ - kind: FieldKind; - name: string; - isRequired: boolean; - isList: boolean; - isUnique: boolean; - isId: boolean; - isReadOnly: boolean; - isGenerated?: boolean; - isUpdatedAt?: boolean; - /** - * Describes the data type in the same the way it is defined in the Prisma schema: - * BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String, $ModelName - */ - type: string; - dbName?: string | null; - hasDefaultValue: boolean; - default?: FieldDefault | FieldDefaultScalar | FieldDefaultScalar[]; - relationFromFields?: string[]; - relationToFields?: string[]; - relationOnDelete?: string; - relationName?: string; - documentation?: string; - }>; - export type FieldDefault = ReadonlyDeep_2<{ - name: string; - args: any[]; - }>; - export type FieldDefaultScalar = string | boolean | number; - export type Schema = ReadonlyDeep_2<{ - rootQueryType?: string; - rootMutationType?: string; - inputObjectTypes: { - model?: InputType[]; - prisma: InputType[]; - }; - outputObjectTypes: { - model: OutputType[]; - prisma: OutputType[]; - }; - enumTypes: { - model?: SchemaEnum[]; - prisma: SchemaEnum[]; - }; - fieldRefTypes: { - prisma?: FieldRefType[]; - }; - }>; - export type Query = ReadonlyDeep_2<{ - name: string; - args: SchemaArg[]; - output: QueryOutput; - }>; - export type QueryOutput = ReadonlyDeep_2<{ - name: string; - isRequired: boolean; - isList: boolean; - }>; - export type TypeRef = { - isList: boolean; - type: string; - location: AllowedLocations; - namespace?: FieldNamespace; - }; - export type InputTypeRef = TypeRef<'scalar' | 'inputObjectTypes' | 'enumTypes' | 'fieldRefTypes'>; - export type SchemaArg = ReadonlyDeep_2<{ - name: string; - comment?: string; - isNullable: boolean; - isRequired: boolean; - inputTypes: InputTypeRef[]; - deprecation?: Deprecation; - }>; - export type OutputType = ReadonlyDeep_2<{ - name: string; - fields: SchemaField[]; - }>; - export type SchemaField = ReadonlyDeep_2<{ - name: string; - isNullable?: boolean; - outputType: OutputTypeRef; - args: SchemaArg[]; - deprecation?: Deprecation; - documentation?: string; - }>; - export type OutputTypeRef = TypeRef<'scalar' | 'outputObjectTypes' | 'enumTypes'>; - export type Deprecation = ReadonlyDeep_2<{ - sinceVersion: string; - reason: string; - plannedRemovalVersion?: string; - }>; - export type InputType = ReadonlyDeep_2<{ - name: string; - constraints: { - maxNumFields: number | null; - minNumFields: number | null; - fields?: string[]; - }; - meta?: { - source?: string; - }; - fields: SchemaArg[]; - }>; - export type FieldRefType = ReadonlyDeep_2<{ - name: string; - allowTypes: FieldRefAllowType[]; - fields: SchemaArg[]; - }>; - export type FieldRefAllowType = TypeRef<'scalar' | 'enumTypes'>; - export type ModelMapping = ReadonlyDeep_2<{ - model: string; - plural: string; - findUnique?: string | null; - findUniqueOrThrow?: string | null; - findFirst?: string | null; - findFirstOrThrow?: string | null; - findMany?: string | null; - create?: string | null; - createMany?: string | null; - createManyAndReturn?: string | null; - update?: string | null; - updateMany?: string | null; - upsert?: string | null; - delete?: string | null; - deleteMany?: string | null; - aggregate?: string | null; - groupBy?: string | null; - count?: string | null; - findRaw?: string | null; - aggregateRaw?: string | null; - }>; - export enum ModelAction { - findUnique = "findUnique", - findUniqueOrThrow = "findUniqueOrThrow", - findFirst = "findFirst", - findFirstOrThrow = "findFirstOrThrow", - findMany = "findMany", - create = "create", - createMany = "createMany", - createManyAndReturn = "createManyAndReturn", - update = "update", - updateMany = "updateMany", - upsert = "upsert", - delete = "delete", - deleteMany = "deleteMany", - groupBy = "groupBy", - count = "count",// TODO: count does not actually exist, why? - aggregate = "aggregate", - findRaw = "findRaw", - aggregateRaw = "aggregateRaw" - } -} - -export declare interface DriverAdapter extends Queryable { - /** - * Starts new transaction. - */ - startTransaction(): Promise>; - /** - * Optional method that returns extra connection info - */ - getConnectionInfo?(): Result_4; -} - -/** Client */ -export declare type DynamicClientExtensionArgs> = { - [P in keyof C_]: unknown; -} & { - [K: symbol]: { - ctx: Optional, ITXClientDenyList> & { - $parent: Optional, ITXClientDenyList>; - }; - }; -}; - -export declare type DynamicClientExtensionThis> = { - [P in keyof ExtArgs['client']]: Return; -} & { - [P in Exclude]: DynamicModelExtensionThis, ExtArgs>; -} & { - [P in Exclude]: >(...args: ToTuple) => PrismaPromise; -} & { - [P in Exclude]: DynamicClientExtensionThisBuiltin[P]; -} & { - [K: symbol]: { - types: TypeMap['other']; - }; -}; - -export declare type DynamicClientExtensionThisBuiltin> = { - $extends: ExtendsHook<'extends', TypeMapCb, ExtArgs>; - $transaction

[]>(arg: [...P], options?: { - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise>; - $transaction(fn: (client: Omit, ITXClientDenyList>) => Promise, options?: { - maxWait?: number; - timeout?: number; - isolationLevel?: TypeMap['meta']['txIsolationLevel']; - }): Promise; - $disconnect(): Promise; - $connect(): Promise; -}; - -/** Model */ -export declare type DynamicModelExtensionArgs> = { - [K in keyof M_]: K extends '$allModels' ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: {}; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof M_[K]]?: unknown; - } & { - [K: symbol]: { - ctx: DynamicModelExtensionThis, ExtArgs> & { - $parent: DynamicClientExtensionThis; - } & { - $name: ModelKey; - } & { - /** - * @deprecated Use `$name` instead. - */ - name: ModelKey; - }; - }; - } : never; -}; - -export declare type DynamicModelExtensionFluentApi = { - [K in keyof TypeMap['model'][M]['payload']['objects']]: (args?: Exact>) => PrismaPromise, [K]> | Null> & DynamicModelExtensionFluentApi>; -}; - -export declare type DynamicModelExtensionFnResult> = P extends FluentOperation ? DynamicModelExtensionFluentApi & PrismaPromise | Null> : PrismaPromise>; - -export declare type DynamicModelExtensionFnResultBase = GetResult; - -export declare type DynamicModelExtensionFnResultNull

= P extends 'findUnique' | 'findFirst' ? null : never; - -export declare type DynamicModelExtensionOperationFn = {} extends TypeMap['model'][M]['operations'][P]['args'] ? (args?: Exact) => DynamicModelExtensionFnResult : (args: Exact) => DynamicModelExtensionFnResult; - -export declare type DynamicModelExtensionThis> = { - [P in keyof ExtArgs['model'][Uncapitalize]]: Return][P]>; -} & { - [P in Exclude]>]: DynamicModelExtensionOperationFn; -} & { - [P in Exclude<'fields', keyof ExtArgs['model'][Uncapitalize]>]: TypeMap['model'][M]['fields']; -} & { - [K: symbol]: { - types: TypeMap['model'][M]; - }; -}; - -/** Query */ -export declare type DynamicQueryExtensionArgs = { - [K in keyof Q_]: K extends '$allOperations' ? (args: { - model?: string; - operation: string; - args: any; - query: (args: any) => PrismaPromise; - }) => Promise : K extends '$allModels' ? { - [P in keyof Q_[K] | keyof TypeMap['model'][keyof TypeMap['model']]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb : P extends keyof TypeMap['model'][keyof TypeMap['model']]['operations'] ? DynamicQueryExtensionCb : never; - } : K extends TypeMap['meta']['modelProps'] ? { - [P in keyof Q_[K] | keyof TypeMap['model'][ModelKey]['operations'] | '$allOperations']?: P extends '$allOperations' ? DynamicQueryExtensionCb, keyof TypeMap['model'][ModelKey]['operations']> : P extends keyof TypeMap['model'][ModelKey]['operations'] ? DynamicQueryExtensionCb, P> : never; - } : K extends keyof TypeMap['other']['operations'] ? DynamicQueryExtensionCb<[TypeMap], 0, 'other', K> : never; -}; - -export declare type DynamicQueryExtensionCb = >(args: A) => Promise; - -export declare type DynamicQueryExtensionCbArgs = (_1 extends unknown ? _2 extends unknown ? { - args: DynamicQueryExtensionCbArgsArgs; - model: _0 extends 0 ? undefined : _1; - operation: _2; - query: >(args: A) => PrismaPromise; -} : never : never) & { - query: (args: DynamicQueryExtensionCbArgsArgs) => PrismaPromise; -}; - -export declare type DynamicQueryExtensionCbArgsArgs = _2 extends '$queryRaw' | '$executeRaw' ? Sql : TypeMap[_0][_1]['operations'][_2]['args']; - -/** Result */ -export declare type DynamicResultExtensionArgs = { - [K in keyof R_]: { - [P in keyof R_[K]]?: { - needs?: DynamicResultExtensionNeeds, R_[K][P]>; - compute(data: DynamicResultExtensionData, R_[K][P]>): any; - }; - }; -}; - -export declare type DynamicResultExtensionData = GetFindResult; - -export declare type DynamicResultExtensionNeeds = { - [K in keyof S]: K extends keyof TypeMap['model'][M]['payload']['scalars'] ? S[K] : never; -} & { - [N in keyof TypeMap['model'][M]['payload']['scalars']]?: boolean; -}; - -/** - * Placeholder value for "no text". - */ -export declare const empty: Sql; - -export declare type EmptyToUnknown = T; - -declare interface Engine { - /** The name of the engine. This is meant to be consumed externally */ - readonly name: string; - onBeforeExit(callback: () => Promise): void; - start(): Promise; - stop(): Promise; - version(forceRun?: boolean): Promise | string; - request(query: JsonQuery, options: RequestOptions_2): Promise>; - requestBatch(queries: JsonQuery[], options: RequestBatchOptions): Promise[]>; - transaction(action: 'start', headers: Transaction_2.TransactionHeaders, options: Transaction_2.Options): Promise>; - transaction(action: 'commit', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; - transaction(action: 'rollback', headers: Transaction_2.TransactionHeaders, info: Transaction_2.InteractiveTransactionInfo): Promise; - metrics(options: MetricsOptionsJson): Promise; - metrics(options: MetricsOptionsPrometheus): Promise; - applyPendingMigrations(): Promise; -} - -declare interface EngineConfig { - cwd: string; - dirname: string; - datamodelPath: string; - enableDebugLogs?: boolean; - allowTriggerPanic?: boolean; - prismaPath?: string; - generator?: GeneratorConfig; - overrideDatasources: Datasources; - showColors?: boolean; - logQueries?: boolean; - logLevel?: 'info' | 'warn'; - env: Record; - flags?: string[]; - clientVersion: string; - engineVersion: string; - previewFeatures?: string[]; - engineEndpoint?: string; - activeProvider?: string; - logEmitter: LogEmitter; - transactionOptions: Transaction_2.Options; - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`. - * If set, this is only used in the library engine, and all queries would be performed through it, - * rather than Prisma's Rust drivers. - * @remarks only used by LibraryEngine.ts - */ - adapter?: ErrorCapturingDriverAdapter; - /** - * The contents of the schema encoded into a string - * @remarks only used by DataProxyEngine.ts - */ - inlineSchema: string; - /** - * The contents of the datasource url saved in a string - * @remarks only used by DataProxyEngine.ts - */ - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - /** - * The string hash that was produced for a given schema - * @remarks only used by DataProxyEngine.ts - */ - inlineSchemaHash: string; - /** - * The helper for interaction with OTEL tracing - * @remarks enabling is determined by the client and @prisma/instrumentation package - */ - tracingHelper: TracingHelper; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * Web Assembly module loading configuration - */ - engineWasm?: WasmLoadingConfig; - /** - * Allows Accelerate to use runtime utilities from the client. These are - * necessary for the AccelerateEngine to function correctly. - */ - accelerateUtils?: { - resolveDatasourceUrl: typeof resolveDatasourceUrl; - getBatchRequestPayload: typeof getBatchRequestPayload; - prismaGraphQLToJSError: typeof prismaGraphQLToJSError; - PrismaClientUnknownRequestError: typeof PrismaClientUnknownRequestError; - PrismaClientInitializationError: typeof PrismaClientInitializationError; - PrismaClientKnownRequestError: typeof PrismaClientKnownRequestError; - debug: (...args: any[]) => void; - engineVersion: string; - clientVersion: string; - }; -} - -declare type EngineEvent = E extends QueryEventType ? QueryEvent : LogEvent; - -declare type EngineEventType = QueryEventType | LogEventType; - -declare type EngineProtocol = 'graphql' | 'json'; - -declare type EngineSpan = { - span: boolean; - name: string; - trace_id: string; - span_id: string; - parent_span_id: string; - start_time: [number, number]; - end_time: [number, number]; - attributes?: Record; - links?: { - trace_id: string; - span_id: string; - }[]; -}; - -declare type EngineSpanEvent = { - span: boolean; - spans: EngineSpan[]; -}; - -declare interface EnvValue { - fromEnvVar: null | string; - value: null | string; -} - -export declare type Equals = (() => T extends A ? 1 : 2) extends (() => T extends B ? 1 : 2) ? 1 : 0; - -declare type Error_2 = { - kind: 'GenericJs'; - id: number; -} | { - kind: 'UnsupportedNativeDataType'; - type: string; -} | { - kind: 'Postgres'; - code: string; - severity: string; - message: string; - detail: string | undefined; - column: string | undefined; - hint: string | undefined; -} | { - kind: 'Mysql'; - code: number; - message: string; - state: string; -} | { - kind: 'Sqlite'; - /** - * Sqlite extended error code: https://www.sqlite.org/rescode.html - */ - extendedCode: number; - message: string; -}; - -declare interface ErrorCapturingDriverAdapter extends DriverAdapter { - readonly errorRegistry: ErrorRegistry; -} - -declare type ErrorFormat = 'pretty' | 'colorless' | 'minimal'; - -declare type ErrorRecord = { - error: unknown; -}; - -declare interface ErrorRegistry { - consumeError(id: number): ErrorRecord | undefined; -} - -declare interface ErrorWithBatchIndex { - batchRequestIdx?: number; -} - -declare type EventCallback = [E] extends ['beforeExit'] ? () => Promise : [E] extends [LogLevel] ? (event: EngineEvent) => void : never; - -export declare type Exact = (A extends unknown ? (W extends A ? { - [K in keyof A]: Exact; -} : W) : never) | (A extends Narrowable ? A : never); - -/** - * Defines Exception. - * - * string or an object with one of (message or name or code) and optional stack - */ -declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string; - -declare interface ExceptionWithCode { - code: string | number; - name?: string; - message?: string; - stack?: string; -} - -declare interface ExceptionWithMessage { - code?: string | number; - message: string; - name?: string; - stack?: string; -} - -declare interface ExceptionWithName { - code?: string | number; - message?: string; - name: string; - stack?: string; -} - -declare type ExtendedEventType = LogLevel | 'beforeExit'; - -declare type ExtendedSpanOptions = SpanOptions & { - /** The name of the span */ - name: string; - internal?: boolean; - middleware?: boolean; - /** Whether it propagates context (?=true) */ - active?: boolean; - /** The context to append the span to */ - context?: Context; -}; - -/** $extends, defineExtension */ -export declare interface ExtendsHook, TypeMap extends TypeMapDef = Call> { - extArgs: ExtArgs; - , MergedArgs extends InternalArgs = MergeExtArgs>(extension: ((client: DynamicClientExtensionThis) => { - $extends: { - extArgs: Args; - }; - }) | { - name?: string; - query?: DynamicQueryExtensionArgs; - result?: DynamicResultExtensionArgs & R; - model?: DynamicModelExtensionArgs & M; - client?: DynamicClientExtensionArgs & C; - }): { - extends: DynamicClientExtensionThis, TypeMapCb, MergedArgs>; - define: (client: any) => { - $extends: { - extArgs: Args; - }; - }; - }[Variant]; -} - -export declare type ExtensionArgs = Optional; - -declare namespace Extensions { - export { - defineExtension, - getExtensionContext - } -} -export { Extensions } - -declare namespace Extensions_2 { - export { - InternalArgs, - DefaultArgs, - GetPayloadResult, - GetSelect, - GetOmit, - DynamicQueryExtensionArgs, - DynamicQueryExtensionCb, - DynamicQueryExtensionCbArgs, - DynamicQueryExtensionCbArgsArgs, - DynamicResultExtensionArgs, - DynamicResultExtensionNeeds, - DynamicResultExtensionData, - DynamicModelExtensionArgs, - DynamicModelExtensionThis, - DynamicModelExtensionOperationFn, - DynamicModelExtensionFnResult, - DynamicModelExtensionFnResultBase, - DynamicModelExtensionFluentApi, - DynamicModelExtensionFnResultNull, - DynamicClientExtensionArgs, - DynamicClientExtensionThis, - ClientBuiltInProp, - DynamicClientExtensionThisBuiltin, - ExtendsHook, - MergeExtArgs, - AllModelsToStringIndex, - TypeMapDef, - DevTypeMapDef, - DevTypeMapFnDef, - TypeMapCbDef, - ModelKey, - RequiredExtensionArgs as UserArgs - } -} - -declare type Fetch = typeof nodeFetch; - -/** - * A reference to a specific field of a specific model - */ -export declare interface FieldRef { - readonly modelName: Model; - readonly name: string; - readonly typeName: FieldType; - readonly isList: boolean; -} - -export declare type FluentOperation = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'create' | 'update' | 'upsert' | 'delete'; - -export declare interface Fn { - params: Params; - returns: Returns; -} - -declare interface GeneratorConfig { - name: string; - output: EnvValue | null; - isCustomOutput?: boolean; - provider: EnvValue; - config: { - /** `output` is a reserved name and will only be available directly at `generator.output` */ - output?: never; - /** `provider` is a reserved name and will only be available directly at `generator.provider` */ - provider?: never; - /** `binaryTargets` is a reserved name and will only be available directly at `generator.binaryTargets` */ - binaryTargets?: never; - /** `previewFeatures` is a reserved name and will only be available directly at `generator.previewFeatures` */ - previewFeatures?: never; - } & { - [key: string]: string | string[] | undefined; - }; - binaryTargets: BinaryTargetsEnvValue[]; - previewFeatures: string[]; -} - -export declare type GetAggregateResult

= { - [K in keyof A as K extends Aggregate ? K : never]: K extends '_count' ? A[K] extends true ? number : Count : { - [J in keyof A[K] & string]: P['scalars'][J] | null; - }; -}; - -declare function getBatchRequestPayload(batch: JsonQuery[], transaction?: TransactionOptions_2): QueryEngineBatchRequest; - -export declare type GetBatchResult = { - count: number; -}; - -export declare type GetCountResult = A extends { - select: infer S; -} ? (S extends true ? number : Count) : number; - -declare function getExtensionContext(that: T): Context_2; - -export declare type GetFindResult

= A extends { - omit: infer Omission; -} ? Compute, TrueKeys>> : GetSelectIncludeResult; - -export declare type GetGroupByResult

= A extends { - by: string[]; -} ? Array & { - [K in A['by'][number]]: P['scalars'][K]; -}> : A extends { - by: string; -} ? Array & { - [K in A['by']]: P['scalars'][K]; -}> : {}[]; - -export declare type GetOmit = { - [K in (string extends keyof R ? never : keyof R) | BaseKeys]?: boolean; -}; - -export declare type GetPayloadResult, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = unknown extends R ? Base : { - [K in KR | keyof Base]: K extends KR ? R[K] extends () => { - compute: (...args: any) => infer C; - } ? C : never : Base[K]; -}; - -export declare function getPrismaClient(config: GetPrismaClientConfig): { - new (optionsArg?: PrismaClientOptions): { - _originalClient: any; - _runtimeDataModel: RuntimeDataModel; - _requestHandler: RequestHandler; - _connectionPromise?: Promise | undefined; - _disconnectionPromise?: Promise | undefined; - _engineConfig: EngineConfig; - _accelerateEngineConfig: AccelerateEngineConfig; - _clientVersion: string; - _errorFormat: ErrorFormat; - _tracingHelper: TracingHelper; - _metrics: MetricsClient; - _middlewares: MiddlewareHandler; - _previewFeatures: string[]; - _activeProvider: string; - _extensions: MergedExtensionsList; - _engine: Engine; - /** - * A fully constructed/applied Client that references the parent - * PrismaClient. This is used for Client extensions only. - */ - _appliedParent: any; - _createPrismaPromise: PrismaPromiseFactory; - /** - * Hook a middleware into the client - * @param middleware to hook - */ - $use(middleware: QueryMiddleware): void; - $on(eventType: E, callback: EventCallback): void; - $connect(): Promise; - /** - * Disconnect from the database - */ - $disconnect(): Promise; - /** - * Executes a raw query and always returns a number - */ - $executeRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; - /** - * Unsafe counterpart of `$executeRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $executeRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; - /** - * Executes a raw command only for MongoDB - * - * @param command - * @returns - */ - $runCommandRaw(command: Record): PrismaPromise_2; - /** - * Executes a raw query and returns selected data - */ - $queryRawInternal(transaction: PrismaPromiseTransaction | undefined, clientMethod: string, args: RawQueryArgs, middlewareArgsMapper?: MiddlewareArgsMapper): Promise; - /** - * Executes a raw query provided through a safe tag function - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRaw(query: TemplateStringsArray | Sql, ...values: any[]): PrismaPromise_2; - /** - * Unsafe counterpart of `$queryRaw` that is susceptible to SQL injections - * @see https://github.com/prisma/prisma/issues/7142 - * - * @param query - * @param values - * @returns - */ - $queryRawUnsafe(query: string, ...values: RawValue[]): PrismaPromise_2; - /** - * Execute a batch of requests in a transaction - * @param requests - * @param options - */ - _transactionWithArray({ promises, options, }: { - promises: Array>; - options?: BatchTransactionOptions; - }): Promise; - /** - * Perform a long-running transaction - * @param callback - * @param options - * @returns - */ - _transactionWithCallback({ callback, options, }: { - callback: (client: Client) => Promise; - options?: Options; - }): Promise; - _createItxClient(transaction: PrismaPromiseInteractiveTransaction): Client; - /** - * Execute queries within a transaction - * @param input a callback or a query list - * @param options to set timeouts (callback) - * @returns - */ - $transaction(input: any, options?: any): Promise; - /** - * Runs the middlewares over params before executing a request - * @param internalParams - * @returns - */ - _request(internalParams: InternalRequestParams): Promise; - _executeRequest({ args, clientMethod, dataPath, callsite, action, model, argsMapper, transaction, unpacker, otelParentCtx, customDataProxyFetch, }: InternalRequestParams): Promise; - readonly $metrics: MetricsClient; - /** - * Shortcut for checking a preview flag - * @param feature preview flag - * @returns - */ - _hasPreviewFlag(feature: string): boolean; - $applyPendingMigrations(): Promise; - $extends: typeof $extends; - readonly [Symbol.toStringTag]: string; - }; -}; - -/** - * Config that is stored into the generated client. When the generated client is - * loaded, this same config is passed to {@link getPrismaClient} which creates a - * closure with that config around a non-instantiated [[PrismaClient]]. - */ -declare type GetPrismaClientConfig = { - runtimeDataModel: RuntimeDataModel; - generator?: GeneratorConfig; - relativeEnvPaths: { - rootEnvPath?: string | null; - schemaEnvPath?: string | null; - }; - relativePath: string; - dirname: string; - filename?: string; - clientVersion: string; - engineVersion: string; - datasourceNames: string[]; - activeProvider: string; - /** - * The contents of the schema encoded into a string - * @remarks only used for the purpose of data proxy - */ - inlineSchema: string; - /** - * A special env object just for the data proxy edge runtime. - * Allows bundlers to inject their own env variables (Vercel). - * Allows platforms to declare global variables as env (Workers). - * @remarks only used for the purpose of data proxy - */ - injectableEdgeEnv?: () => LoadedEnv; - /** - * The contents of the datasource url saved in a string. - * This can either be an env var name or connection string. - * It is needed by the client to connect to the Data Proxy. - * @remarks only used for the purpose of data proxy - */ - inlineDatasources: { - [name in string]: { - url: EnvValue; - }; - }; - /** - * The string hash that was produced for a given schema - * @remarks only used for the purpose of data proxy - */ - inlineSchemaHash: string; - /** - * A marker to indicate that the client was not generated via `prisma - * generate` but was generated via `generate --postinstall` script instead. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - postinstall?: boolean; - /** - * Information about the CI where the Prisma Client has been generated. The - * name of the CI environment is stored at generation time because CI - * information is not always available at runtime. Moreover, the edge client - * has no notion of environment variables, so this works around that. - * @remarks used to error for Vercel/Netlify for schema caching issues - */ - ciName?: string; - /** - * Information about whether we have not found a schema.prisma file in the - * default location, and that we fell back to finding the schema.prisma file - * in the current working directory. This usually means it has been bundled. - */ - isBundled?: boolean; - /** - * A boolean that is `false` when the client was generated with --no-engine. At - * runtime, this means the client will be bound to be using the Data Proxy. - */ - copyEngine?: boolean; - /** - * Optional wasm loading configuration - */ - engineWasm?: WasmLoadingConfig; -}; - -export declare type GetResult

= { - findUnique: GetFindResult | null; - findUniqueOrThrow: GetFindResult; - findFirst: GetFindResult | null; - findFirstOrThrow: GetFindResult; - findMany: GetFindResult[]; - create: GetFindResult; - createMany: GetBatchResult; - createManyAndReturn: GetFindResult[]; - update: GetFindResult; - updateMany: GetBatchResult; - upsert: GetFindResult; - delete: GetFindResult; - deleteMany: GetBatchResult; - aggregate: GetAggregateResult; - count: GetCountResult; - groupBy: GetGroupByResult; - $queryRaw: unknown; - $executeRaw: number; - $queryRawUnsafe: unknown; - $executeRawUnsafe: number; - $runCommandRaw: JsonObject; - findRaw: JsonObject; - aggregateRaw: JsonObject; -}[O]; - -export declare function getRuntime(): GetRuntimeOutput; - -declare type GetRuntimeOutput = { - id: Runtime; - prettyName: string; - isEdge: boolean; -}; - -export declare type GetSelect, R extends InternalArgs['result'][string], KR extends keyof R = string extends keyof R ? never : keyof R> = { - [K in KR | keyof Base]?: K extends KR ? boolean : Base[K]; -}; - -export declare type GetSelectIncludeResult

= Equals extends 1 ? DefaultSelection

: A extends { - select: infer S extends object; -} & Record | { - include: infer I extends object; -} & Record ? { - [K in keyof S | keyof I as (S & I)[K] extends false | undefined | null ? never : K]: (S & I)[K] extends object ? P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? GetFindResult | SelectField & null : never : K extends '_count' ? Count> : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection[] : never : P extends SelectablePayloadFields ? O extends OperationPayload ? DefaultSelection | SelectField & null : never : P extends { - scalars: { - [k in K]: infer O; - }; - } ? O : K extends '_count' ? Count : never; -} & (A extends { - include: any; -} & Record ? DefaultSelection

: unknown) : DefaultSelection

; - -declare type HandleErrorParams = { - args: JsArgs; - error: any; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - modelName?: string; -}; - -/** - * Defines High-Resolution Time. - * - * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. - * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. - * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. - * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds: - * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. - * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: - * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000. - * This is represented in HrTime format as [1609504210, 150000000]. - */ -declare type HrTime = [number, number]; - -declare type InteractiveTransactionInfo = { - /** - * Transaction ID returned by the query engine. - */ - id: string; - /** - * Arbitrary payload the meaning of which depends on the `Engine` implementation. - * For example, `DataProxyEngine` needs to associate different API endpoints with transactions. - * In `LibraryEngine` and `BinaryEngine` it is currently not used. - */ - payload: Payload; -}; - -declare type InteractiveTransactionOptions = Transaction_2.InteractiveTransactionInfo; - -export declare type InternalArgs = { - result: { - [K in keyof R]: { - [P in keyof R[K]]: () => R[K][P]; - }; - }; - model: { - [K in keyof M]: { - [P in keyof M[K]]: () => M[K][P]; - }; - }; - query: { - [K in keyof Q]: { - [P in keyof Q[K]]: () => Q[K][P]; - }; - }; - client: { - [K in keyof C]: () => C[K]; - }; -}; - -declare type InternalRequestParams = { - /** - * The original client method being called. - * Even though the rootField / operation can be changed, - * this method stays as it is, as it's what the user's - * code looks like - */ - clientMethod: string; - /** - * Name of js model that triggered the request. Might be used - * for warnings or error messages - */ - jsModelName?: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - unpacker?: Unpacker; - otelParentCtx?: Context; - /** Used to "desugar" a user input into an "expanded" one */ - argsMapper?: (args?: UserArgs_2) => UserArgs_2; - /** Used to convert args for middleware and back */ - middlewareArgsMapper?: MiddlewareArgsMapper; - /** Used for Accelerate client extension via Data Proxy */ - customDataProxyFetch?: (fetch: Fetch) => Fetch; -} & Omit; - -declare enum IsolationLevel { - ReadUncommitted = "ReadUncommitted", - ReadCommitted = "ReadCommitted", - RepeatableRead = "RepeatableRead", - Snapshot = "Snapshot", - Serializable = "Serializable" -} - -export declare type ITXClientDenyList = (typeof denylist)[number]; - -export declare const itxClientDenyList: readonly (string | symbol)[]; - -declare interface Job { - resolve: (data: any) => void; - reject: (data: any) => void; - request: any; -} - -/** - * Create a SQL query for a list of values. - */ -export declare function join(values: readonly RawValue[], separator?: string, prefix?: string, suffix?: string): Sql; - -export declare type JsArgs = { - select?: Selection_2; - include?: Selection_2; - omit?: Omission; - [argName: string]: JsInputValue; -}; - -export declare type JsInputValue = null | undefined | string | number | boolean | bigint | Uint8Array | Date | DecimalJsLike | ObjectEnumValue | RawParameters | JsonConvertible | FieldRef | JsInputValue[] | { - [key: string]: JsInputValue; -}; - -declare type JsonArgumentValue = number | string | boolean | null | RawTaggedValue | JsonArgumentValue[] | { - [key: string]: JsonArgumentValue; -}; - -export declare interface JsonArray extends Array { -} - -declare type JsonBatchQuery = { - batch: JsonQuery[]; - transaction?: { - isolationLevel?: Transaction_2.IsolationLevel; - }; -}; - -export declare interface JsonConvertible { - toJSON(): unknown; -} - -declare type JsonFieldSelection = { - arguments?: Record | RawTaggedValue; - selection: JsonSelectionSet; -}; - -declare class JsonNull extends NullTypesEnumValue { -} - -export declare type JsonObject = { - [Key in string]?: JsonValue; -}; - -declare type JsonQuery = { - modelName?: string; - action: JsonQueryAction; - query: JsonFieldSelection; -}; - -declare type JsonQueryAction = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFirstOrThrow' | 'findMany' | 'createOne' | 'createMany' | 'createManyAndReturn' | 'updateOne' | 'updateMany' | 'deleteOne' | 'deleteMany' | 'upsertOne' | 'aggregate' | 'groupBy' | 'executeRaw' | 'queryRaw' | 'runCommandRaw' | 'findRaw' | 'aggregateRaw'; - -declare type JsonSelectionSet = { - $scalars?: boolean; - $composites?: boolean; -} & { - [fieldName: string]: boolean | JsonFieldSelection; -}; - -export declare type JsonValue = string | number | boolean | JsonObject | JsonArray | null; - -export declare type JsOutputValue = null | string | number | boolean | bigint | Uint8Array | Date | Decimal | JsOutputValue[] | { - [key: string]: JsOutputValue; -}; - -export declare type JsPromise = Promise & {}; - -declare type KnownErrorParams = { - code: string; - clientVersion: string; - meta?: Record; - batchRequestIdx?: number; -}; - -/** - * A pointer from the current {@link Span} to another span in the same trace or - * in a different trace. - * Few examples of Link usage. - * 1. Batch Processing: A batch of elements may contain elements associated - * with one or more traces/spans. Since there can only be one parent - * SpanContext, Link is used to keep reference to SpanContext of all - * elements in the batch. - * 2. Public Endpoint: A SpanContext in incoming client request on a public - * endpoint is untrusted from service provider perspective. In such case it - * is advisable to start a new trace with appropriate sampling decision. - * However, it is desirable to associate incoming SpanContext to new trace - * initiated on service provider side so two traces (from Client and from - * Service Provider) can be correlated. - */ -declare interface Link { - /** The {@link SpanContext} of a linked span. */ - context: SpanContext; - /** A set of {@link SpanAttributes} on the link. */ - attributes?: SpanAttributes; - /** Count of attributes of the link that were dropped due to collection limits */ - droppedAttributesCount?: number; -} - -declare type LoadedEnv = { - message?: string; - parsed: { - [x: string]: string; - }; -} | undefined; - -declare type LocationInFile = { - fileName: string; - lineNumber: number | null; - columnNumber: number | null; -}; - -declare type LogDefinition = { - level: LogLevel; - emit: 'stdout' | 'event'; -}; - -/** - * Typings for the events we emit. - * - * @remarks - * If this is updated, our edge runtime shim needs to be updated as well. - */ -declare type LogEmitter = { - on(event: E, listener: (event: EngineEvent) => void): LogEmitter; - emit(event: QueryEventType, payload: QueryEvent): boolean; - emit(event: LogEventType, payload: LogEvent): boolean; -}; - -declare type LogEvent = { - timestamp: Date; - message: string; - target: string; -}; - -declare type LogEventType = 'info' | 'warn' | 'error'; - -declare type LogLevel = 'info' | 'query' | 'warn' | 'error'; - -/** - * Generates more strict variant of an enum which, unlike regular enum, - * throws on non-existing property access. This can be useful in following situations: - * - we have an API, that accepts both `undefined` and `SomeEnumType` as an input - * - enum values are generated dynamically from DMMF. - * - * In that case, if using normal enums and no compile-time typechecking, using non-existing property - * will result in `undefined` value being used, which will be accepted. Using strict enum - * in this case will help to have a runtime exception, telling you that you are probably doing something wrong. - * - * Note: if you need to check for existence of a value in the enum you can still use either - * `in` operator or `hasOwnProperty` function. - * - * @param definition - * @returns - */ -export declare function makeStrictEnum>(definition: T): T; - -/** - * Class that holds the list of all extensions, applied to particular instance, - * as well as resolved versions of the components that need to apply on - * different levels. Main idea of this class: avoid re-resolving as much of the - * stuff as possible when new extensions are added while also delaying the - * resolve until the point it is actually needed. For example, computed fields - * of the model won't be resolved unless the model is actually queried. Neither - * adding extensions with `client` component only cause other components to - * recompute. - */ -declare class MergedExtensionsList { - private head?; - private constructor(); - static empty(): MergedExtensionsList; - static single(extension: ExtensionArgs): MergedExtensionsList; - isEmpty(): boolean; - append(extension: ExtensionArgs): MergedExtensionsList; - getAllComputedFields(dmmfModelName: string): ComputedFieldsMap | undefined; - getAllClientExtensions(): ClientArg | undefined; - getAllModelExtensions(dmmfModelName: string): ModelArg | undefined; - getAllQueryCallbacks(jsModelName: string, operation: string): any; - getAllBatchQueryCallbacks(): BatchQueryOptionsCb[]; -} - -export declare type MergeExtArgs, Args extends Record> = ComputeDeep & AllModelsToStringIndex>; - -export declare type Metric = { - key: string; - value: T; - labels: Record; - description: string; -}; - -export declare type MetricHistogram = { - buckets: MetricHistogramBucket[]; - sum: number; - count: number; -}; - -export declare type MetricHistogramBucket = [maxValue: number, count: number]; - -export declare type Metrics = { - counters: Metric[]; - gauges: Metric[]; - histograms: Metric[]; -}; - -export declare class MetricsClient { - private _engine; - constructor(engine: Engine); - /** - * Returns all metrics gathered up to this point in prometheus format. - * Result of this call can be exposed directly to prometheus scraping endpoint - * - * @param options - * @returns - */ - prometheus(options?: MetricsOptions): Promise; - /** - * Returns all metrics gathered up to this point in prometheus format. - * - * @param options - * @returns - */ - json(options?: MetricsOptions): Promise; -} - -declare type MetricsOptions = { - /** - * Labels to add to every metrics in key-value format - */ - globalLabels?: Record; -}; - -declare type MetricsOptionsCommon = { - globalLabels?: Record; -}; - -declare type MetricsOptionsJson = { - format: 'json'; -} & MetricsOptionsCommon; - -declare type MetricsOptionsPrometheus = { - format: 'prometheus'; -} & MetricsOptionsCommon; - -declare type MiddlewareArgsMapper = { - requestArgsToMiddlewareArgs(requestArgs: RequestArgs): MiddlewareArgs; - middlewareArgsToRequestArgs(middlewareArgs: MiddlewareArgs): RequestArgs; -}; - -declare class MiddlewareHandler { - private _middlewares; - use(middleware: M): void; - get(id: number): M | undefined; - has(id: number): boolean; - length(): number; -} - -export declare type ModelArg = { - [MethodName in string]: unknown; -}; - -export declare type ModelArgs = { - model: { - [ModelName in string]: ModelArg; - }; -}; - -export declare type ModelKey = M extends keyof TypeMap['model'] ? M : Capitalize; - -export declare type ModelQueryOptionsCb = (args: ModelQueryOptionsCbArgs) => Promise; - -export declare type ModelQueryOptionsCbArgs = { - model: string; - operation: string; - args: JsArgs; - query: (args: JsArgs) => Promise; -}; - -export declare type NameArgs = { - name?: string; -}; - -export declare type Narrow = { - [K in keyof A]: A[K] extends Function ? A[K] : Narrow; -} | (A extends Narrowable ? A : never); - -export declare type Narrowable = string | number | bigint | boolean | []; - -export declare type NeverToUnknown = [T] extends [never] ? unknown : T; - -/** - * Imitates `fetch` via `https` to only suit our needs, it does nothing more. - * This is because we cannot bundle `node-fetch` as it uses many other Node.js - * utilities, while also bloating our bundles. This approach is much leaner. - * @param url - * @param options - * @returns - */ -declare function nodeFetch(url: string, options?: RequestOptions): Promise; - -declare class NodeHeaders { - readonly headers: Map; - constructor(init?: Record); - append(name: string, value: string): void; - delete(name: string): void; - get(name: string): string | null; - has(name: string): boolean; - set(name: string, value: string): void; - forEach(callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any): void; -} - -/** - * @deprecated Please don´t rely on type checks to this error anymore. - * This will become a regular `PrismaClientKnownRequestError` with code `P2025` - * in the future major version of the client. - * Instead of `error instanceof Prisma.NotFoundError` use `error.code === "P2025"`. - */ -export declare class NotFoundError extends PrismaClientKnownRequestError { - constructor(message: string, clientVersion: string); -} - -declare class NullTypesEnumValue extends ObjectEnumValue { - _getNamespace(): string; -} - -/** - * List of Prisma enums that must use unique objects instead of strings as their values. - */ -export declare const objectEnumNames: string[]; - -/** - * Base class for unique values of object-valued enums. - */ -export declare abstract class ObjectEnumValue { - constructor(arg?: symbol); - abstract _getNamespace(): string; - _getName(): string; - toString(): string; -} - -export declare const objectEnumValues: { - classes: { - DbNull: typeof DbNull; - JsonNull: typeof JsonNull; - AnyNull: typeof AnyNull; - }; - instances: { - DbNull: DbNull; - JsonNull: JsonNull; - AnyNull: AnyNull; - }; -}; - -declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-pg-worker"]; - -export declare type Omission = Record; - -declare type Omit_2 = { - [P in keyof T as P extends K ? never : P]: T[P]; -}; -export { Omit_2 as Omit } - -export declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw'; - -export declare type OperationPayload = { - scalars: { - [ScalarName in string]: unknown; - }; - objects: { - [ObjectName in string]: unknown; - }; - composites: { - [CompositeName in string]: unknown; - }; -}; - -export declare type Optional = { - [P in K & keyof O]?: O[P]; -} & { - [P in Exclude]: O[P]; -}; - -export declare type OptionalFlat = { - [K in keyof T]?: T[K]; -}; - -export declare type OptionalKeys = { - [K in keyof O]-?: {} extends Pick_2 ? K : never; -}[keyof O]; - -declare type Options = { - maxWait?: number; - timeout?: number; - isolationLevel?: IsolationLevel; -}; - -declare type Options_2 = { - clientVersion: string; -}; - -export declare type Or = { - 0: { - 0: 0; - 1: 1; - }; - 1: { - 0: 1; - 1: 1; - }; -}[A][B]; - -export declare type PatchFlat = O1 & Omit_2; - -export declare type Path = O extends unknown ? P extends [infer K, ...infer R] ? K extends keyof O ? Path : Default : O : never; - -export declare type Payload = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? T[symbol]['types']['payload'] : any; - -export declare type PayloadToResult = RenameAndNestPayloadKeys

> = { - [K in keyof O]?: O[K][K] extends any[] ? PayloadToResult[] : O[K][K] extends object ? PayloadToResult : O[K][K]; -}; - -declare type Pick_2 = { - [P in keyof T as P extends K ? P : never]: T[P]; -}; -export { Pick_2 as Pick } - -export declare class PrismaClientInitializationError extends Error { - clientVersion: string; - errorCode?: string; - retryable?: boolean; - constructor(message: string, clientVersion: string, errorCode?: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientKnownRequestError extends Error implements ErrorWithBatchIndex { - code: string; - meta?: Record; - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { code, clientVersion, meta, batchRequestIdx }: KnownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare type PrismaClientOptions = { - /** - * Overwrites the primary datasource url from your schema.prisma file - */ - datasourceUrl?: string; - /** - * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale. - */ - adapter?: DriverAdapter | null; - /** - * Overwrites the datasource url from your schema.prisma file - */ - datasources?: Datasources; - /** - * @default "colorless" - */ - errorFormat?: ErrorFormat; - /** - * The default values for Transaction options - * maxWait ?= 2000 - * timeout ?= 5000 - */ - transactionOptions?: Transaction_2.Options; - /** - * @example - * \`\`\` - * // Defaults to stdout - * log: ['query', 'info', 'warn'] - * - * // Emit as events - * log: [ - * { emit: 'stdout', level: 'query' }, - * { emit: 'stdout', level: 'info' }, - * { emit: 'stdout', level: 'warn' } - * ] - * \`\`\` - * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). - */ - log?: Array; - /** - * @internal - * You probably don't want to use this. \`__internal\` is used by internal tooling. - */ - __internal?: { - debug?: boolean; - engine?: { - cwd?: string; - binaryPath?: string; - endpoint?: string; - allowTriggerPanic?: boolean; - }; - /** This can be used for testing purposes */ - configOverride?: (config: GetPrismaClientConfig) => GetPrismaClientConfig; - }; -}; - -export declare class PrismaClientRustPanicError extends Error { - clientVersion: string; - constructor(message: string, clientVersion: string); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientUnknownRequestError extends Error implements ErrorWithBatchIndex { - clientVersion: string; - batchRequestIdx?: number; - constructor(message: string, { clientVersion, batchRequestIdx }: UnknownErrorParams); - get [Symbol.toStringTag](): string; -} - -export declare class PrismaClientValidationError extends Error { - name: string; - clientVersion: string; - constructor(message: string, { clientVersion }: Options_2); - get [Symbol.toStringTag](): string; -} - -declare function prismaGraphQLToJSError({ error, user_facing_error }: RequestError, clientVersion: string, activeProvider: string): PrismaClientKnownRequestError | PrismaClientUnknownRequestError; - -export declare interface PrismaPromise extends Promise { - [Symbol.toStringTag]: 'PrismaPromise'; -} - -/** - * Prisma's `Promise` that is backwards-compatible. All additions on top of the - * original `Promise` are optional so that it can be backwards-compatible. - * @see [[createPrismaPromise]] - */ -declare interface PrismaPromise_2 extends Promise { - /** - * Extension of the original `.then` function - * @param onfulfilled same as regular promises - * @param onrejected same as regular promises - * @param transaction transaction options - */ - then(onfulfilled?: (value: A) => R1 | PromiseLike, onrejected?: (error: unknown) => R2 | PromiseLike, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.catch` function - * @param onrejected same as regular promises - * @param transaction transaction options - */ - catch(onrejected?: ((reason: any) => R | PromiseLike) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Extension of the original `.finally` function - * @param onfinally same as regular promises - * @param transaction transaction options - */ - finally(onfinally?: (() => void) | undefined | null, transaction?: PrismaPromiseTransaction): Promise; - /** - * Called when executing a batch of regular tx - * @param transaction transaction options for batch tx - */ - requestTransaction?(transaction: PrismaPromiseBatchTransaction): PromiseLike; -} - -declare type PrismaPromiseBatchTransaction = { - kind: 'batch'; - id: number; - isolationLevel?: IsolationLevel; - index: number; - lock: PromiseLike; -}; - -declare type PrismaPromiseCallback = (transaction?: PrismaPromiseTransaction) => PrismaPromise_2; - -/** - * Creates a [[PrismaPromise]]. It is Prisma's implementation of `Promise` which - * is essentially a proxy for `Promise`. All the transaction-compatible client - * methods return one, this allows for pre-preparing queries without executing - * them until `.then` is called. It's the foundation of Prisma's query batching. - * @param callback that will be wrapped within our promise implementation - * @see [[PrismaPromise]] - * @returns - */ -declare type PrismaPromiseFactory = (callback: PrismaPromiseCallback) => PrismaPromise_2; - -declare type PrismaPromiseInteractiveTransaction = { - kind: 'itx'; - id: string; - payload: PayloadType; -}; - -declare type PrismaPromiseTransaction = PrismaPromiseBatchTransaction | PrismaPromiseInteractiveTransaction; - -declare namespace Public { - export { - validator - } -} -export { Public } - -declare namespace Public_2 { - export { - Args, - Result, - Payload, - PrismaPromise, - Operation, - Exact - } -} - -declare type Query = { - sql: string; - args: Array; -}; - -declare interface Queryable { - readonly provider: 'mysql' | 'postgres' | 'sqlite'; - readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {}); - /** - * Execute a query given as SQL, interpolating the given parameters, - * and returning the type-aware result set of the query. - * - * This is the preferred way of executing `SELECT` queries. - */ - queryRaw(params: Query): Promise>; - /** - * Execute a query given as SQL, interpolating the given parameters, - * and returning the number of affected rows. - * - * This is the preferred way of executing `INSERT`, `UPDATE`, `DELETE` queries, - * as well as transactional queries. - */ - executeRaw(params: Query): Promise>; -} - -declare type QueryEngineBatchGraphQLRequest = { - batch: QueryEngineRequest[]; - transaction?: boolean; - isolationLevel?: Transaction_2.IsolationLevel; -}; - -declare type QueryEngineBatchRequest = QueryEngineBatchGraphQLRequest | JsonBatchQuery; - -declare type QueryEngineConfig = { - datamodel: string; - configDir: string; - logQueries: boolean; - ignoreEnvVarErrors: boolean; - datasourceOverrides: Record; - env: Record; - logLevel: QueryEngineLogLevel; - telemetry?: QueryEngineTelemetry; - engineProtocol: EngineProtocol; -}; - -declare interface QueryEngineConstructor { - new (config: QueryEngineConfig, logger: (log: string) => void, adapter?: ErrorCapturingDriverAdapter): QueryEngineInstance; -} - -declare type QueryEngineInstance = { - connect(headers: string): Promise; - disconnect(headers: string): Promise; - /** - * @param requestStr JSON.stringified `QueryEngineRequest | QueryEngineBatchRequest` - * @param headersStr JSON.stringified `QueryEngineRequestHeaders` - */ - query(requestStr: string, headersStr: string, transactionId?: string): Promise; - sdlSchema(): Promise; - dmmf(traceparent: string): Promise; - startTransaction(options: string, traceHeaders: string): Promise; - commitTransaction(id: string, traceHeaders: string): Promise; - rollbackTransaction(id: string, traceHeaders: string): Promise; - metrics(options: string): Promise; - applyPendingMigrations(): Promise; -}; - -declare type QueryEngineLogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'off'; - -declare type QueryEngineRequest = { - query: string; - variables: Object; -}; - -declare type QueryEngineResult = { - data: T; - elapsed: number; -}; - -declare type QueryEngineTelemetry = { - enabled: Boolean; - endpoint: string; -}; - -declare type QueryEvent = { - timestamp: Date; - query: string; - params: string; - duration: number; - target: string; -}; - -declare type QueryEventType = 'query'; - -declare type QueryMiddleware = (params: QueryMiddlewareParams, next: (params: QueryMiddlewareParams) => Promise) => Promise; - -declare type QueryMiddlewareParams = { - /** The model this is executed on */ - model?: string; - /** The action that is being handled */ - action: Action; - /** TODO what is this */ - dataPath: string[]; - /** TODO what is this */ - runInTransaction: boolean; - args?: UserArgs_2; -}; - -export declare type QueryOptions = { - query: { - [ModelName in string]: { - [ModelAction in string]: ModelQueryOptionsCb; - } | QueryOptionsCb; - }; -}; - -export declare type QueryOptionsCb = (args: QueryOptionsCbArgs) => Promise; - -export declare type QueryOptionsCbArgs = { - model?: string; - operation: string; - args: JsArgs | RawQueryArgs; - query: (args: JsArgs | RawQueryArgs) => Promise; -}; - -/** - * Create raw SQL statement. - */ -export declare function raw(value: string): Sql; - -export declare type RawParameters = { - __prismaRawParameters__: true; - values: string; -}; - -export declare type RawQueryArgs = Sql | [query: string, ...values: RawValue[]]; - -declare type RawTaggedValue = { - $type: 'Raw'; - value: unknown; -}; - -/** - * Supported value or SQL instance. - */ -export declare type RawValue = Value | Sql; - -export declare type ReadonlyDeep = { - readonly [K in keyof T]: ReadonlyDeep; -}; - -declare type ReadonlyDeep_2 = { - +readonly [K in keyof O]: ReadonlyDeep_2; -}; - -declare type Record_2 = { - [P in T]: U; -}; -export { Record_2 as Record } - -export declare type RenameAndNestPayloadKeys

= { - [K in keyof P as K extends 'scalars' | 'objects' | 'composites' ? keyof P[K] : never]: P[K]; -}; - -declare type RequestBatchOptions = { - transaction?: TransactionOptions_2; - traceparent?: string; - numTry?: number; - containsWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare interface RequestError { - error: string; - user_facing_error: { - is_panic: boolean; - message: string; - meta?: Record; - error_code?: string; - batch_request_idx?: number; - }; -} - -declare class RequestHandler { - client: Client; - dataloader: DataLoader; - private logEmitter?; - constructor(client: Client, logEmitter?: LogEmitter); - request(params: RequestParams): Promise; - mapQueryEngineResult({ dataPath, unpacker }: RequestParams, response: QueryEngineResult): any; - /** - * Handles the error and logs it, logging the error is done synchronously waiting for the event - * handlers to finish. - */ - handleAndLogRequestError(params: HandleErrorParams): never; - handleRequestError({ error, clientMethod, callsite, transaction, args, modelName }: HandleErrorParams): never; - sanitizeMessage(message: any): any; - unpack(data: unknown, dataPath: string[], unpacker?: Unpacker): any; - get [Symbol.toStringTag](): string; -} - -declare type RequestOptions = { - method?: string; - headers?: Record; - body?: string; -}; - -declare type RequestOptions_2 = { - traceparent?: string; - numTry?: number; - interactiveTransaction?: InteractiveTransactionOptions; - isWrite: boolean; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare type RequestParams = { - modelName?: string; - action: Action; - protocolQuery: JsonQuery; - dataPath: string[]; - clientMethod: string; - callsite?: CallSite; - transaction?: PrismaPromiseTransaction; - extensions: MergedExtensionsList; - args?: any; - headers?: Record; - unpacker?: Unpacker; - otelParentCtx?: Context; - otelChildCtx?: Context; - customDataProxyFetch?: (fetch: Fetch) => Fetch; -}; - -declare type RequestResponse = { - ok: boolean; - url: string; - statusText?: string; - status: number; - headers: NodeHeaders; - text: () => Promise; - json: () => Promise; -}; - -declare type RequiredExtensionArgs = NameArgs & ResultArgs & ModelArgs & ClientArgs & QueryOptions; -export { RequiredExtensionArgs } -export { RequiredExtensionArgs as UserArgs } - -export declare type RequiredKeys = { - [K in keyof O]-?: {} extends Pick_2 ? never : K; -}[keyof O]; - -declare function resolveDatasourceUrl({ inlineDatasources, overrideDatasources, env, clientVersion, }: { - inlineDatasources: GetPrismaClientConfig['inlineDatasources']; - overrideDatasources: Datasources; - env: Record; - clientVersion: string; -}): string; - -export declare type Result = T extends { - [K: symbol]: { - types: { - payload: any; - }; - }; -} ? GetResult : GetResult<{ - composites: {}; - objects: {}; - scalars: {}; -}, {}, F>; - -export declare type Result_2 = Result; - -declare namespace Result_3 { - export { - Operation, - FluentOperation, - Count, - TrueKeys, - GetFindResult, - GetSelectIncludeResult, - SelectablePayloadFields, - SelectField, - DefaultSelection, - UnwrapPayload, - GetCountResult, - Aggregate, - GetAggregateResult, - GetBatchResult, - GetGroupByResult, - GetResult - } -} - -declare type Result_4 = { - map(fn: (value: T) => U): Result_4; - flatMap(fn: (value: T) => Result_4): Result_4; -} & ({ - readonly ok: true; - readonly value: T; -} | { - readonly ok: false; - readonly error: Error_2; -}); - -export declare type ResultArg = { - [FieldName in string]: ResultFieldDefinition; -}; - -export declare type ResultArgs = { - result: { - [ModelName in string]: ResultArg; - }; -}; - -export declare type ResultArgsFieldCompute = (model: any) => unknown; - -export declare type ResultFieldDefinition = { - needs?: { - [FieldName in string]: boolean; - }; - compute: ResultArgsFieldCompute; -}; - -declare interface ResultSet { - /** - * List of column types appearing in a database query, in the same order as `columnNames`. - * They are used within the Query Engine to convert values from JS to Quaint values. - */ - columnTypes: Array; - /** - * List of column names appearing in a database query, in the same order as `columnTypes`. - */ - columnNames: Array; - /** - * List of rows retrieved from a database query. - * Each row is a list of values, whose length matches `columnNames` and `columnTypes`. - */ - rows: Array>; - /** - * The last ID of an `INSERT` statement, if any. - * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite. - */ - lastInsertId?: string; -} - -export declare type Return = T extends (...args: any[]) => infer R ? R : T; - -declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown"; - -declare type RuntimeDataModel = { - readonly models: Record; - readonly enums: Record; - readonly types: Record; -}; - -declare type RuntimeEnum = Omit; - -declare type RuntimeModel = Omit; - -export declare type Select = T extends U ? T : never; - -export declare type SelectablePayloadFields = { - objects: { - [k in K]: O; - }; -} | { - composites: { - [k in K]: O; - }; -}; - -export declare type SelectField

, K extends PropertyKey> = P extends { - objects: Record; -} ? P['objects'][K] : P extends { - composites: Record; -} ? P['composites'][K] : never; - -declare type Selection_2 = Record; -export { Selection_2 as Selection } - -/** - * An interface that represents a span. A span represents a single operation - * within a trace. Examples of span might include remote procedure calls or a - * in-process function calls to sub-components. A Trace has a single, top-level - * "root" Span that in turn may have zero or more child Spans, which in turn - * may have children. - * - * Spans are created by the {@link Tracer.startSpan} method. - */ -declare interface Span { - /** - * Returns the {@link SpanContext} object associated with this Span. - * - * Get an immutable, serializable identifier for this span that can be used - * to create new child spans. Returned SpanContext is usable even after the - * span ends. - * - * @returns the SpanContext object associated with this Span. - */ - spanContext(): SpanContext; - /** - * Sets an attribute to the span. - * - * Sets a single Attribute with the key and value passed as arguments. - * - * @param key the key for this attribute. - * @param value the value for this attribute. Setting a value null or - * undefined is invalid and will result in undefined behavior. - */ - setAttribute(key: string, value: SpanAttributeValue): this; - /** - * Sets attributes to the span. - * - * @param attributes the attributes that will be added. - * null or undefined attribute values - * are invalid and will result in undefined behavior. - */ - setAttributes(attributes: SpanAttributes): this; - /** - * Adds an event to the Span. - * - * @param name the name of the event. - * @param [attributesOrStartTime] the attributes that will be added; these are - * associated with this event. Can be also a start time - * if type is {@type TimeInput} and 3rd param is undefined - * @param [startTime] start time of the event. - */ - addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this; - /** - * Sets a status to the span. If used, this will override the default Span - * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value - * of previous calls to SetStatus on the Span. - * - * @param status the SpanStatus to set. - */ - setStatus(status: SpanStatus): this; - /** - * Updates the Span name. - * - * This will override the name provided via {@link Tracer.startSpan}. - * - * Upon this update, any sampling behavior based on Span name will depend on - * the implementation. - * - * @param name the Span name. - */ - updateName(name: string): this; - /** - * Marks the end of Span execution. - * - * Call to End of a Span MUST not have any effects on child spans. Those may - * still be running and can be ended later. - * - * Do not return `this`. The Span generally should not be used after it - * is ended so chaining is not desired in this context. - * - * @param [endTime] the time to set as Span's end time. If not provided, - * use the current time as the span's end time. - */ - end(endTime?: TimeInput): void; - /** - * Returns the flag whether this span will be recorded. - * - * @returns true if this Span is active and recording information like events - * with the `AddEvent` operation and attributes using `setAttributes`. - */ - isRecording(): boolean; - /** - * Sets exception as a span event - * @param exception the exception the only accepted values are string or Error - * @param [time] the time to set as Span's event time. If not provided, - * use the current time. - */ - recordException(exception: Exception, time?: TimeInput): void; -} - -/** - * @deprecated please use {@link Attributes} - */ -declare type SpanAttributes = Attributes; - -/** - * @deprecated please use {@link AttributeValue} - */ -declare type SpanAttributeValue = AttributeValue; - -declare type SpanCallback = (span?: Span, context?: Context) => R; - -/** - * A SpanContext represents the portion of a {@link Span} which must be - * serialized and propagated along side of a {@link Baggage}. - */ -declare interface SpanContext { - /** - * The ID of the trace that this span belongs to. It is worldwide unique - * with practically sufficient probability by being made as 16 randomly - * generated bytes, encoded as a 32 lowercase hex characters corresponding to - * 128 bits. - */ - traceId: string; - /** - * The ID of the Span. It is globally unique with practically sufficient - * probability by being made as 8 randomly generated bytes, encoded as a 16 - * lowercase hex characters corresponding to 64 bits. - */ - spanId: string; - /** - * Only true if the SpanContext was propagated from a remote parent. - */ - isRemote?: boolean; - /** - * Trace flags to propagate. - * - * It is represented as 1 byte (bitmap). Bit to represent whether trace is - * sampled or not. When set, the least significant bit documents that the - * caller may have recorded trace data. A caller who does not record trace - * data out-of-band leaves this flag unset. - * - * see {@link TraceFlags} for valid flag values. - */ - traceFlags: number; - /** - * Tracing-system-specific info to propagate. - * - * The tracestate field value is a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * More Info: https://www.w3.org/TR/trace-context/#tracestate-field - * - * Examples: - * Single tracing system (generic format): - * tracestate: rojo=00f067aa0ba902b7 - * Multiple tracing systems (with different formatting): - * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE - */ - traceState?: TraceState; -} - -declare enum SpanKind { - /** Default value. Indicates that the span is used internally. */ - INTERNAL = 0, - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SERVER = 1, - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - CLIENT = 2, - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - PRODUCER = 3, - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - CONSUMER = 4 -} - -/** - * Options needed for span creation - */ -declare interface SpanOptions { - /** - * The SpanKind of a span - * @default {@link SpanKind.INTERNAL} - */ - kind?: SpanKind; - /** A span's attributes */ - attributes?: SpanAttributes; - /** {@link Link}s span to other spans */ - links?: Link[]; - /** A manually specified start time for the created `Span` object. */ - startTime?: TimeInput; - /** The new span should be a root span. (Ignore parent from context). */ - root?: boolean; -} - -declare interface SpanStatus { - /** The status code of this message. */ - code: SpanStatusCode; - /** A developer-facing error message. */ - message?: string; -} - -/** - * An enumeration of status codes. - */ -declare enum SpanStatusCode { - /** - * The default status. - */ - UNSET = 0, - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - OK = 1, - /** - * The operation contains an error. - */ - ERROR = 2 -} - -/** - * A SQL instance can be nested within each other to build SQL strings. - */ -export declare class Sql { - readonly values: Value[]; - readonly strings: string[]; - constructor(rawStrings: readonly string[], rawValues: readonly RawValue[]); - get sql(): string; - get statement(): string; - get text(): string; - inspect(): { - sql: string; - statement: string; - text: string; - values: unknown[]; - }; -} - -/** - * Create a SQL object from a template string. - */ -export declare function sqltag(strings: readonly string[], ...values: readonly RawValue[]): Sql; - -/** - * Defines TimeInput. - * - * hrtime, epoch milliseconds, performance.now() or Date - */ -declare type TimeInput = HrTime | number | Date; - -export declare type ToTuple = T extends any[] ? T : [T]; - -declare interface TraceState { - /** - * Create a new TraceState which inherits from this TraceState and has the - * given key set. - * The new entry will always be added in the front of the list of states. - * - * @param key key of the TraceState entry. - * @param value value of the TraceState entry. - */ - set(key: string, value: string): TraceState; - /** - * Return a new TraceState which inherits from this TraceState but does not - * contain the given key. - * - * @param key the key for the TraceState entry to be removed. - */ - unset(key: string): TraceState; - /** - * Returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - * - * @param key with which the specified value is to be associated. - * @returns the value to which the specified key is mapped, or `undefined` if - * this map contains no mapping for the key. - */ - get(key: string): string | undefined; - /** - * Serializes the TraceState to a `list` as defined below. The `list` is a - * series of `list-members` separated by commas `,`, and a list-member is a - * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs - * surrounding `list-members` are ignored. There can be a maximum of 32 - * `list-members` in a `list`. - * - * @returns the serialized string. - */ - serialize(): string; -} - -declare interface TracingHelper { - isEnabled(): boolean; - getTraceParent(context?: Context): string; - createEngineSpan(engineSpanEvent: EngineSpanEvent): void; - getActiveContext(): Context | undefined; - runInChildSpan(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback): R; -} - -declare interface Transaction extends Queryable { - /** - * Transaction options. - */ - readonly options: TransactionOptions; - /** - * Commit the transaction. - */ - commit(): Promise>; - /** - * Rolls back the transaction. - */ - rollback(): Promise>; -} - -declare namespace Transaction_2 { - export { - IsolationLevel, - Options, - InteractiveTransactionInfo, - TransactionHeaders - } -} - -declare type TransactionHeaders = { - traceparent?: string; -}; - -declare type TransactionOptions = { - usePhantomQuery: boolean; -}; - -declare type TransactionOptions_2 = { - kind: 'itx'; - options: InteractiveTransactionOptions; -} | { - kind: 'batch'; - options: BatchTransactionOptions; -}; - -export declare type TrueKeys = { - [K in keyof T]: T[K] extends true ? K : never; -}[keyof T]; - -export declare type TypeMapCbDef = Fn<{ - extArgs: InternalArgs; -}, TypeMapDef>; - -/** Shared */ -export declare type TypeMapDef = Record; - -declare namespace Types { - export { - Result_3 as Result, - Extensions_2 as Extensions, - Utils, - Public_2 as Public, - OperationPayload as Payload - } -} -export { Types } - -declare type UnknownErrorParams = { - clientVersion: string; - batchRequestIdx?: number; -}; - -declare type Unpacker = (data: any) => any; - -export declare type UnwrapPayload

= {} extends P ? unknown : { - [K in keyof P]: P[K] extends { - scalars: infer S; - composites: infer C; - }[] ? Array> : P[K] extends { - scalars: infer S; - composites: infer C; - } | null ? S & UnwrapPayload | Select : never; -}; - -export declare type UnwrapPromise

= P extends Promise ? R : P; - -export declare type UnwrapTuple = { - [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends PrismaPromise ? X : UnwrapPromise : UnwrapPromise; -}; - -/** - * Input that flows from the user into the Client. - */ -declare type UserArgs_2 = any; - -declare namespace Utils { - export { - EmptyToUnknown, - NeverToUnknown, - PatchFlat, - Omit_2 as Omit, - Pick_2 as Pick, - ComputeDeep, - Compute, - OptionalFlat, - ReadonlyDeep, - Narrowable, - Narrow, - Exact, - Cast, - JsonObject, - JsonArray, - JsonValue, - Record_2 as Record, - UnwrapPromise, - UnwrapTuple, - Path, - Fn, - Call, - RequiredKeys, - OptionalKeys, - Optional, - Return, - ToTuple, - RenameAndNestPayloadKeys, - PayloadToResult, - Select, - Equals, - Or, - JsPromise - } -} - -declare function validator(): (select: Exact) => S; - -declare function validator, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): (select: Exact>) => S; - -declare function validator, O extends keyof C[M] & Operation, P extends keyof Args>(client: C, model: M, operation: O, prop: P): (select: Exact[P]>) => S; - -/** - * Values supported by SQL engine. - */ -export declare type Value = unknown; - -export declare function warnEnvConflicts(envPaths: any): void; - -export declare const warnOnce: (key: string, message: string, ...args: unknown[]) => void; - -declare type WasmLoadingConfig = { - /** - * WASM-bindgen runtime for corresponding module - */ - getRuntime: () => { - __wbg_set_wasm(exports: unknown): any; - QueryEngine: QueryEngineConstructor; - }; - /** - * Loads the raw wasm module for the wasm query engine. This configuration is - * generated specifically for each type of client, eg. Node.js client and Edge - * clients will have different implementations. - * @remarks this is a callback on purpose, we only load the wasm if needed. - * @remarks only used by LibraryEngine.ts - */ - getQueryEngineWasmModule: () => Promise; -}; - -export { } diff --git a/integration-tests/tests/prisma/sqlite/client/runtime/library.js b/integration-tests/tests/prisma/sqlite/client/runtime/library.js deleted file mode 100644 index 016f60e77..000000000 --- a/integration-tests/tests/prisma/sqlite/client/runtime/library.js +++ /dev/null @@ -1,140 +0,0 @@ -"use strict";var Ml=Object.create;var Ct=Object.defineProperty;var $l=Object.getOwnPropertyDescriptor;var ql=Object.getOwnPropertyNames;var jl=Object.getPrototypeOf,Vl=Object.prototype.hasOwnProperty;var Z=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Fr=(e,r)=>{for(var t in r)Ct(e,t,{get:r[t],enumerable:!0})},no=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of ql(r))!Vl.call(e,i)&&i!==t&&Ct(e,i,{get:()=>r[i],enumerable:!(n=$l(r,i))||n.enumerable});return e};var k=(e,r,t)=>(t=e!=null?Ml(jl(e)):{},no(r||!e||!e.__esModule?Ct(t,"default",{value:e,enumerable:!0}):t,e)),Bl=e=>no(Ct({},"__esModule",{value:!0}),e);var Ao=Z((Bd,Un)=>{"use strict";var v=Un.exports;Un.exports.default=v;var D="\x1B[",jr="\x1B]",mr="\x07",Ft=";",Ro=process.env.TERM_PROGRAM==="Apple_Terminal";v.cursorTo=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof r!="number"?D+(e+1)+"G":D+(r+1)+";"+(e+1)+"H"};v.cursorMove=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let t="";return e<0?t+=D+-e+"D":e>0&&(t+=D+e+"C"),r<0?t+=D+-r+"A":r>0&&(t+=D+r+"B"),t};v.cursorUp=(e=1)=>D+e+"A";v.cursorDown=(e=1)=>D+e+"B";v.cursorForward=(e=1)=>D+e+"C";v.cursorBackward=(e=1)=>D+e+"D";v.cursorLeft=D+"G";v.cursorSavePosition=Ro?"\x1B7":D+"s";v.cursorRestorePosition=Ro?"\x1B8":D+"u";v.cursorGetPosition=D+"6n";v.cursorNextLine=D+"E";v.cursorPrevLine=D+"F";v.cursorHide=D+"?25l";v.cursorShow=D+"?25h";v.eraseLines=e=>{let r="";for(let t=0;t[jr,"8",Ft,Ft,r,mr,e,jr,"8",Ft,Ft,mr].join("");v.image=(e,r={})=>{let t=`${jr}1337;File=inline=1`;return r.width&&(t+=`;width=${r.width}`),r.height&&(t+=`;height=${r.height}`),r.preserveAspectRatio===!1&&(t+=";preserveAspectRatio=0"),t+":"+e.toString("base64")+mr};v.iTerm={setCwd:(e=process.cwd())=>`${jr}50;CurrentDir=${e}${mr}`,annotation:(e,r={})=>{let t=`${jr}1337;`,n=typeof r.x<"u",i=typeof r.y<"u";if((n||i)&&!(n&&i&&typeof r.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),t+=r.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",r.length>0?t+=(n?[e,r.length,r.x,r.y]:[r.length,e]).join("|"):t+=e,t+mr}}});var Qn=Z((Ud,Io)=>{"use strict";Io.exports=(e,r=process.argv)=>{let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),i=r.indexOf("--");return n!==-1&&(i===-1||n{"use strict";var Ru=require("os"),_o=require("tty"),pe=Qn(),{env:G}=process,Ve;pe("no-color")||pe("no-colors")||pe("color=false")||pe("color=never")?Ve=0:(pe("color")||pe("colors")||pe("color=true")||pe("color=always"))&&(Ve=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?Ve=1:G.FORCE_COLOR==="false"?Ve=0:Ve=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function Gn(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Jn(e,r){if(Ve===0)return 0;if(pe("color=16m")||pe("color=full")||pe("color=truecolor"))return 3;if(pe("color=256"))return 2;if(e&&!r&&Ve===void 0)return 0;let t=Ve||0;if(G.TERM==="dumb")return t;if(process.platform==="win32"){let n=Ru.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in G)||G.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let n=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:t}function Au(e){let r=Jn(e,e&&e.isTTY);return Gn(r)}ko.exports={supportsColor:Au,stdout:Gn(Jn(!0,_o.isatty(1))),stderr:Gn(Jn(!0,_o.isatty(2)))}});var Fo=Z((Gd,Lo)=>{"use strict";var Iu=Do(),dr=Qn();function Oo(e){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let r=(e||"").split(".").map(t=>parseInt(t,10));return{major:r[0],minor:r[1],patch:r[2]}}function Hn(e){let{env:r}=process;if("FORCE_HYPERLINK"in r)return!(r.FORCE_HYPERLINK.length>0&&parseInt(r.FORCE_HYPERLINK,10)===0);if(dr("no-hyperlink")||dr("no-hyperlinks")||dr("hyperlink=false")||dr("hyperlink=never"))return!1;if(dr("hyperlink=true")||dr("hyperlink=always")||"NETLIFY"in r)return!0;if(!Iu.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in r||"TEAMCITY_VERSION"in r)return!1;if("TERM_PROGRAM"in r){let t=Oo(r.TERM_PROGRAM_VERSION);switch(r.TERM_PROGRAM){case"iTerm.app":return t.major===3?t.minor>=1:t.major>3;case"WezTerm":return t.major>=20200620;case"vscode":return t.major>1||t.major===1&&t.minor>=72}}if("VTE_VERSION"in r){if(r.VTE_VERSION==="0.50.0")return!1;let t=Oo(r.VTE_VERSION);return t.major>0||t.minor>=50}return!1}Lo.exports={supportsHyperlink:Hn,stdout:Hn(process.stdout),stderr:Hn(process.stderr)}});var Mo=Z((Jd,Vr)=>{"use strict";var _u=Ao(),Wn=Fo(),No=(e,r,{target:t="stdout",...n}={})=>Wn[t]?_u.link(e,r):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,r):`${e} (\u200B${r}\u200B)`;Vr.exports=(e,r,t={})=>No(e,r,t);Vr.exports.stderr=(e,r,t={})=>No(e,r,{target:"stderr",...t});Vr.exports.isSupported=Wn.stdout;Vr.exports.stderr.isSupported=Wn.stderr});var Yn=Z((tf,ku)=>{ku.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var zn=Z(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.enginesVersion=void 0;Nt.enginesVersion=Yn().prisma.enginesVersion});var Vo=Z((Pf,Lu)=>{Lu.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",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","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var Uo=Z((vf,$t)=>{"use strict";var Fu=require("fs"),Bo=require("path"),Nu=require("os"),Mu=Vo(),$u=Mu.version,qu=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function ju(e){let r={},t=e.toString();t=t.replace(/\r\n?/mg,` -`);let n;for(;(n=qu.exec(t))!=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,` -`),o=o.replace(/\\r/g,"\r")),r[i]=o}return r}function ri(e){console.log(`[dotenv@${$u}][DEBUG] ${e}`)}function Vu(e){return e[0]==="~"?Bo.join(Nu.homedir(),e.slice(1)):e}function Bu(e){let r=Bo.resolve(process.cwd(),".env"),t="utf8",n=!!(e&&e.debug),i=!!(e&&e.override);e&&(e.path!=null&&(r=Vu(e.path)),e.encoding!=null&&(t=e.encoding));try{let o=Mt.parse(Fu.readFileSync(r,{encoding:t}));return Object.keys(o).forEach(function(s){Object.prototype.hasOwnProperty.call(process.env,s)?(i===!0&&(process.env[s]=o[s]),n&&ri(i===!0?`"${s}" is already defined in \`process.env\` and WAS overwritten`:`"${s}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[s]=o[s]}),{parsed:o}}catch(o){return n&&ri(`Failed to load ${r} ${o.message}`),{error:o}}}var Mt={config:Bu,parse:ju};$t.exports.config=Mt.config;$t.exports.parse=Mt.parse;$t.exports=Mt});var Ko=Z((_f,Wo)=>{"use strict";Wo.exports=e=>{let r=e.match(/^[ \t]*(?=\S)/gm);return r?r.reduce((t,n)=>Math.min(t,n.length),1/0):0}});var zo=Z((kf,Yo)=>{"use strict";var Ju=Ko();Yo.exports=e=>{let r=Ju(e);if(r===0)return e;let t=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(t,"")}});var oi=Z((Mf,Zo)=>{"use strict";Zo.exports=(e,r=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof r!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``);if(typeof t.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(r===0)return e;let n=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,t.indent.repeat(r))}});var ts=Z((jf,rs)=>{"use strict";rs.exports=({onlyFirst:e=!1}={})=>{let r=["[\\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(r,e?void 0:"g")}});var ui=Z((Vf,ns)=>{"use strict";var ec=ts();ns.exports=e=>typeof e=="string"?e.replace(ec(),""):e});var is=Z((Qf,Vt)=>{"use strict";Vt.exports=(e={})=>{let r;if(e.repoUrl)r=e.repoUrl;else if(e.user&&e.repo)r=`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 t=new URL(`${r}/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(",")}t.searchParams.set(i,o)}}return t.toString()};Vt.exports.default=Vt.exports});var Wi=Z((DP,Ba)=>{"use strict";Ba.exports=function(){function e(r,t,n,i,o){return rn?n+1:r+1:i===o?t:t+1}return function(r,t){if(r===t)return 0;if(r.length>t.length){var n=r;r=t,t=n}for(var i=r.length,o=t.length;i>0&&r.charCodeAt(i-1)===t.charCodeAt(o-1);)i--,o--;for(var s=0;sFn,Decimal:()=>Te,Extensions:()=>kn,MetricsClient:()=>hr,NotFoundError:()=>Oe,PrismaClientInitializationError:()=>R,PrismaClientKnownRequestError:()=>V,PrismaClientRustPanicError:()=>le,PrismaClientUnknownRequestError:()=>B,PrismaClientValidationError:()=>W,Public:()=>Dn,Sql:()=>ie,defineDmmfProperty:()=>ss,empty:()=>ls,getPrismaClient:()=>Ll,getRuntime:()=>fn,join:()=>as,makeStrictEnum:()=>Fl,objectEnumValues:()=>Qt,raw:()=>Ei,sqltag:()=>bi,warnEnvConflicts:()=>Nl,warnOnce:()=>Hr});module.exports=Bl(fd);var kn={};Fr(kn,{defineExtension:()=>io,getExtensionContext:()=>oo});function io(e){return typeof e=="function"?e:r=>r.$extends(e)}function oo(e){return e}var Dn={};Fr(Dn,{validator:()=>so});function so(...e){return r=>r}var St={};Fr(St,{$:()=>po,bgBlack:()=>Zl,bgBlue:()=>tu,bgCyan:()=>iu,bgGreen:()=>eu,bgMagenta:()=>nu,bgRed:()=>Xl,bgWhite:()=>ou,bgYellow:()=>ru,black:()=>Wl,blue:()=>ze,bold:()=>H,cyan:()=>_e,dim:()=>Ie,gray:()=>Nr,green:()=>Me,grey:()=>zl,hidden:()=>Jl,inverse:()=>Gl,italic:()=>Ql,magenta:()=>Kl,red:()=>ue,reset:()=>Ul,strikethrough:()=>Hl,underline:()=>X,white:()=>Yl,yellow:()=>fe});var On,ao,lo,uo,co=!0;typeof process<"u"&&({FORCE_COLOR:On,NODE_DISABLE_COLORS:ao,NO_COLOR:lo,TERM:uo}=process.env||{},co=process.stdout&&process.stdout.isTTY);var po={enabled:!ao&&lo==null&&uo!=="dumb"&&(On!=null&&On!=="0"||co)};function N(e,r){let t=new RegExp(`\\x1b\\[${r}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${r}m`;return function(o){return!po.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(t,i+n):o)+i}}var Ul=N(0,0),H=N(1,22),Ie=N(2,22),Ql=N(3,23),X=N(4,24),Gl=N(7,27),Jl=N(8,28),Hl=N(9,29),Wl=N(30,39),ue=N(31,39),Me=N(32,39),fe=N(33,39),ze=N(34,39),Kl=N(35,39),_e=N(36,39),Yl=N(37,39),Nr=N(90,39),zl=N(90,39),Zl=N(40,49),Xl=N(41,49),eu=N(42,49),ru=N(43,49),tu=N(44,49),nu=N(45,49),iu=N(46,49),ou=N(47,49);var su=100,mo=["green","yellow","blue","magenta","cyan","red"],Mr=[],fo=Date.now(),au=0,Ln=typeof process<"u"?process.env:{};globalThis.DEBUG??(globalThis.DEBUG=Ln.DEBUG??"");globalThis.DEBUG_COLORS??(globalThis.DEBUG_COLORS=Ln.DEBUG_COLORS?Ln.DEBUG_COLORS==="true":!0);var $r={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let r=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),t=r.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=r.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return t&&!n},log:(...e)=>{let[r,t,...n]=e,i;typeof require=="function"&&typeof process<"u"&&typeof process.stderr<"u"&&typeof process.stderr.write=="function"?i=(...o)=>{try{let s=require("util");process.stderr.write(s.format(...o)+` -`)}catch{i=console.warn??console.log}}:i=console.warn??console.log,i(`${r} ${t}`,...n)},formatters:{}};function lu(e){let r={color:mo[au++%mo.length],enabled:$r.enabled(e),namespace:e,log:$r.log,extend:()=>{}},t=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=r;if(n.length!==0&&Mr.push([o,...n]),Mr.length>su&&Mr.shift(),$r.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:uu(c)),u=`+${Date.now()-fo}ms`;fo=Date.now(),globalThis.DEBUG_COLORS?a(St[s](H(o)),...l,St[s](u)):a(o,...l,u)}};return new Proxy(t,{get:(n,i)=>r[i],set:(n,i,o)=>r[i]=o})}var Fn=new Proxy(lu,{get:(e,r)=>$r[r],set:(e,r,t)=>$r[r]=t});function uu(e,r=2){let t=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(t.has(i))return"[Circular *]";t.add(i)}else if(typeof i=="bigint")return i.toString();return i},r)}function go(e=7500){let r=Mr.map(([t,...n])=>`${t} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(` -`);return r.length!!(e&&typeof e=="object"),It=e=>e&&!!e[ke],we=(e,r,t)=>{if(It(e)){let n=e[ke](),{matched:i,selections:o}=n.match(r);return i&&o&&Object.keys(o).forEach(s=>t(s,o[s])),i}if($n(e)){if(!$n(r))return!1;if(Array.isArray(e)){if(!Array.isArray(r))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];It(a)&&a[cu]?o.push(a):o.length?i.push(a):n.push(a)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(r.lengthwe(u,s[c],t))&&i.every((u,c)=>we(u,a[c],t))&&(o.length===0||we(o[0],l,t))}return e.length===r.length&&e.every((s,a)=>we(s,r[a],t))}return Object.keys(e).every(n=>{let i=e[n];return(n in r||It(o=i)&&o[ke]().matcherType==="optional")&&we(i,r[n],t);var o})}return Object.is(r,e)},je=e=>{var r,t,n;return $n(e)?It(e)?(r=(t=(n=e[ke]()).getSelectionKeys)==null?void 0:t.call(n))!=null?r:[]:Array.isArray(e)?qr(e,je):qr(Object.values(e),je):[]},qr=(e,r)=>e.reduce((t,n)=>t.concat(r(n)),[]);function ce(e){return Object.assign(e,{optional:()=>pu(e),and:r=>j(e,r),or:r=>mu(e,r),select:r=>r===void 0?Eo(e):Eo(r,e)})}function pu(e){return ce({[ke]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return r===void 0?(je(e).forEach(i=>n(i,void 0)),{matched:!0,selections:t}):{matched:we(e,r,n),selections:t}},getSelectionKeys:()=>je(e),matcherType:"optional"})})}function j(...e){return ce({[ke]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return{matched:e.every(i=>we(i,r,n)),selections:t}},getSelectionKeys:()=>qr(e,je),matcherType:"and"})})}function mu(...e){return ce({[ke]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return qr(e,je).forEach(i=>n(i,void 0)),{matched:e.some(i=>we(i,r,n)),selections:t}},getSelectionKeys:()=>qr(e,je),matcherType:"or"})})}function _(e){return{[ke]:()=>({match:r=>({matched:!!e(r)})})}}function Eo(...e){let r=typeof e[0]=="string"?e[0]:void 0,t=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return ce({[ke]:()=>({match:n=>{let i={[r??_t]:n};return{matched:t===void 0||we(t,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[r??_t].concat(t===void 0?[]:je(t))})})}function Ee(e){return typeof e=="number"}function Ze(e){return typeof e=="string"}function $e(e){return typeof e=="bigint"}var Rd=ce(_(function(e){return!0}));var Xe=e=>Object.assign(ce(e),{startsWith:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&n.startsWith(t)))));var t},endsWith:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&n.endsWith(t)))));var t},minLength:r=>Xe(j(e,(t=>_(n=>Ze(n)&&n.length>=t))(r))),maxLength:r=>Xe(j(e,(t=>_(n=>Ze(n)&&n.length<=t))(r))),includes:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&n.includes(t)))));var t},regex:r=>{return Xe(j(e,(t=r,_(n=>Ze(n)&&!!n.match(t)))));var t}}),Ad=Xe(_(Ze)),be=e=>Object.assign(ce(e),{between:(r,t)=>be(j(e,((n,i)=>_(o=>Ee(o)&&n<=o&&i>=o))(r,t))),lt:r=>be(j(e,(t=>_(n=>Ee(n)&&nbe(j(e,(t=>_(n=>Ee(n)&&n>t))(r))),lte:r=>be(j(e,(t=>_(n=>Ee(n)&&n<=t))(r))),gte:r=>be(j(e,(t=>_(n=>Ee(n)&&n>=t))(r))),int:()=>be(j(e,_(r=>Ee(r)&&Number.isInteger(r)))),finite:()=>be(j(e,_(r=>Ee(r)&&Number.isFinite(r)))),positive:()=>be(j(e,_(r=>Ee(r)&&r>0))),negative:()=>be(j(e,_(r=>Ee(r)&&r<0)))}),Id=be(_(Ee)),qe=e=>Object.assign(ce(e),{between:(r,t)=>qe(j(e,((n,i)=>_(o=>$e(o)&&n<=o&&i>=o))(r,t))),lt:r=>qe(j(e,(t=>_(n=>$e(n)&&nqe(j(e,(t=>_(n=>$e(n)&&n>t))(r))),lte:r=>qe(j(e,(t=>_(n=>$e(n)&&n<=t))(r))),gte:r=>qe(j(e,(t=>_(n=>$e(n)&&n>=t))(r))),positive:()=>qe(j(e,_(r=>$e(r)&&r>0))),negative:()=>qe(j(e,_(r=>$e(r)&&r<0)))}),_d=qe(_($e)),kd=ce(_(function(e){return typeof e=="boolean"})),Dd=ce(_(function(e){return typeof e=="symbol"})),Od=ce(_(function(e){return e==null})),Ld=ce(_(function(e){return e!=null}));var qn={matched:!1,value:void 0};function pr(e){return new jn(e,qn)}var jn=class e{constructor(r,t){this.input=void 0,this.state=void 0,this.input=r,this.state=t}with(...r){if(this.state.matched)return this;let t=r[r.length-1],n=[r[0]],i;r.length===3&&typeof r[1]=="function"?i=r[1]:r.length>2&&n.push(...r.slice(1,r.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>we(u,this.input,a))||i&&!i(this.input)?qn:{matched:!0,value:t(o?_t in s?s[_t]:s:this.input,this.input)};return new e(this.input,l)}when(r,t){if(this.state.matched)return this;let n=!!r(this.input);return new e(this.input,n?{matched:!0,value:t(this.input,this.input)}:qn)}otherwise(r){return this.state.matched?this.state.value:r(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let r;try{r=JSON.stringify(this.input)}catch{r=this.input}throw new Error(`Pattern matching error: no pattern matches value ${r}`)}run(){return this.exhaustive()}returnType(){return this}};var Po=require("util");var du={warn:fe("prisma:warn")},fu={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function kt(e,...r){fu.warn()&&console.warn(`${du.warn} ${e}`,...r)}var gu=(0,Po.promisify)(xo.default.exec),re=L("prisma:get-platform"),hu=["1.0.x","1.1.x","3.0.x"];async function vo(){let e=Ot.default.platform(),r=process.arch;if(e==="freebsd"){let s=await Lt("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:r}}}if(e!=="linux")return{platform:e,arch:r};let t=await Eu(),n=await Su(),i=wu({arch:r,archFromUname:n,familyDistro:t.familyDistro}),{libssl:o}=await xu(i);return{platform:"linux",libssl:o,arch:r,archFromUname:n,...t}}function yu(e){let r=/^ID="?([^"\n]*)"?$/im,t=/^ID_LIKE="?([^"\n]*)"?$/im,n=r.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=t.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=pr({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return re(`Found distro info: -${JSON.stringify(a,null,2)}`),a}async function Eu(){let e="/etc/os-release";try{let r=await Vn.default.readFile(e,{encoding:"utf-8"});return yu(r)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function bu(e){let r=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(r){let t=`${r[1]}.x`;return To(t)}}function bo(e){let r=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(r){let t=`${r[1]}${r[2]??".0"}.x`;return To(t)}}function To(e){let r=(()=>{if(So(e))return e;let t=e.split(".");return t[1]="0",t.join(".")})();if(hu.includes(r))return r}function wu(e){return pr(e).with({familyDistro:"musl"},()=>(re('Trying platform-specific paths for "alpine"'),["/lib"])).with({familyDistro:"debian"},({archFromUname:r})=>(re('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${r}-linux-gnu`,`/lib/${r}-linux-gnu`])).with({familyDistro:"rhel"},()=>(re('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:r,arch:t,archFromUname:n})=>(re(`Don't know any platform-specific paths for "${r}" on ${t} (${n})`),[]))}async function xu(e){let r='grep -v "libssl.so.0"',t=await wo(e);if(t){re(`Found libssl.so file using platform-specific paths: ${t}`);let o=bo(t);if(re(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}re('Falling back to "ldconfig" and other generic paths');let n=await Lt(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${r}`);if(n||(n=await wo(["/lib64","/usr/lib64","/lib"])),n){re(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=bo(n);if(re(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Lt("openssl version -v");if(i){re(`Found openssl binary with version: ${i}`);let o=bu(i);if(re(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return re("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function wo(e){for(let r of e){let t=await Pu(r);if(t)return t}}async function Pu(e){try{return(await Vn.default.readdir(e)).find(t=>t.startsWith("libssl.so.")&&!t.startsWith("libssl.so.0"))}catch(r){if(r.code==="ENOENT")return;throw r}}async function er(){let{binaryTarget:e}=await Co();return e}function vu(e){return e.binaryTarget!==void 0}async function Bn(){let{memoized:e,...r}=await Co();return r}var Dt={};async function Co(){if(vu(Dt))return Promise.resolve({...Dt,memoized:!0});let e=await vo(),r=Tu(e);return Dt={...e,binaryTarget:r},{...Dt,memoized:!1}}function Tu(e){let{platform:r,arch:t,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;r==="linux"&&!["x64","arm64"].includes(t)&&kt(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${t}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${n}".`);let l="1.1.x";if(r==="linux"&&i===void 0){let c=pr({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");kt(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}". -${c}`)}let u="debian";if(r==="linux"&&o===void 0&&re(`Distro is "${a}". Falling back to Prisma engines built for "${u}".`),r==="darwin"&&t==="arm64")return"darwin-arm64";if(r==="darwin")return"darwin";if(r==="win32")return"windows";if(r==="freebsd")return o;if(r==="openbsd")return"openbsd";if(r==="netbsd")return"netbsd";if(r==="linux"&&o==="nixos")return"linux-nixos";if(r==="linux"&&t==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(r==="linux"&&t==="arm")return`linux-arm-openssl-${i||l}`;if(r==="linux"&&o==="musl"){let c="linux-musl";return!i||So(i)?c:`${c}-openssl-${i}`}return r==="linux"&&o&&i?`${o}-openssl-${i}`:(r!=="linux"&&kt(`Prisma detected unknown OS "${r}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function Cu(e){try{return await e()}catch{return}}function Lt(e){return Cu(async()=>{let r=await gu(e);return re(`Command "${e}" successfully returned "${r.stdout}"`),r.stdout})}async function Su(){return typeof Ot.default.machine=="function"?Ot.default.machine():(await Lt("uname -m"))?.trim()}function So(e){return e.startsWith("1.")}var $o=k(Mo());function Kn(e){return(0,$o.default)(e,e,{fallback:X})}var Du=k(zn());var M=k(require("path")),Ou=k(zn()),df=L("prisma:engines");function qo(){return M.default.join(__dirname,"../")}var ff="libquery-engine";M.default.join(__dirname,"../query-engine-darwin");M.default.join(__dirname,"../query-engine-darwin-arm64");M.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");M.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");M.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");M.default.join(__dirname,"../query-engine-linux-static-x64");M.default.join(__dirname,"../query-engine-linux-static-arm64");M.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");M.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");M.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");M.default.join(__dirname,"../libquery_engine-darwin.dylib.node");M.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-linux-musl.so.node");M.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");M.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");M.default.join(__dirname,"../query_engine-windows.dll.node");var Zn=k(require("fs")),jo=L("chmodPlusX");function Xn(e){if(process.platform==="win32")return;let r=Zn.default.statSync(e),t=r.mode|64|8|1;if(r.mode===t){jo(`Execution permissions of ${e} are fine`);return}let n=t.toString(8).slice(-3);jo(`Have to call chmodPlusX on ${e}`),Zn.default.chmodSync(e,n)}function ei(e){let r=e.e,t=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=r.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${Kn("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${Ie(e.id)}\`).`,s=pr({message:r.message,code:r.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${t("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${t("libgcc_s")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libssl"),()=>{let a=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${t("libssl")}. Please install ${a} and try again.`}).when(({message:a})=>a.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${i}`).when(({message:a})=>e.platformInfo.platform==="linux"&&a.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${i}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${i}`);return`${o} -${s} - -Details: ${r.message}`}var ni=k(Uo()),qt=k(require("fs"));var fr=k(require("path"));function Qo(e){let r=e.ignoreProcessEnv?{}:process.env,t=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(r,p)?r[p]:e.parsed[p]||"",u=t(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(r,n)?r[n]:e.parsed[n];e.parsed[n]=t(i)}for(let n in e.parsed)r[n]=e.parsed[n];return e}var ti=L("prisma:tryLoadEnv");function Br({rootEnvPath:e,schemaEnvPath:r},t={conflictCheck:"none"}){let n=Go(e);t.conflictCheck!=="none"&&Uu(n,r,t.conflictCheck);let i=null;return Jo(n?.path,r)||(i=Go(r)),!n&&!i&&ti("No Environment variables loaded"),i?.dotenvResult.error?console.error(ue(H("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(` -`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function Uu(e,r,t){let n=e?.dotenvResult.parsed,i=!Jo(e?.path,r);if(n&&r&&i&&qt.default.existsSync(r)){let o=ni.default.parse(qt.default.readFileSync(r)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=fr.default.relative(process.cwd(),e.path),l=fr.default.relative(process.cwd(),r);if(t==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${X(a)} and ${X(l)} -Conflicting env vars: -${s.map(c=>` ${H(c)}`).join(` -`)} - -We suggest to move the contents of ${X(l)} to ${X(a)} to consolidate your env vars. -`;throw new Error(u)}else if(t==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>H(c)).join(", ")} in ${X(a)} and ${X(l)} -Env vars from ${X(l)} overwrite the ones from ${X(a)} - `;console.warn(`${fe("warn(prisma)")} ${u}`)}}}}function Go(e){if(Qu(e)){ti(`Environment variables loaded from ${e}`);let r=ni.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Qo(r),message:Ie(`Environment variables loaded from ${fr.default.relative(process.cwd(),e)}`),path:e}}else ti(`Environment variables not found at ${e}`);return null}function Jo(e,r){return e&&r&&fr.default.resolve(e)===fr.default.resolve(r)}function Qu(e){return!!(e&&qt.default.existsSync(e))}var Ho="library";function Ur(e){let r=Gu();return r||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Ho)}function Gu(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}var De;(r=>{let e;(b=>(b.findUnique="findUnique",b.findUniqueOrThrow="findUniqueOrThrow",b.findFirst="findFirst",b.findFirstOrThrow="findFirstOrThrow",b.findMany="findMany",b.create="create",b.createMany="createMany",b.createManyAndReturn="createManyAndReturn",b.update="update",b.updateMany="updateMany",b.upsert="upsert",b.delete="delete",b.deleteMany="deleteMany",b.groupBy="groupBy",b.count="count",b.aggregate="aggregate",b.findRaw="findRaw",b.aggregateRaw="aggregateRaw"))(e=r.ModelAction||(r.ModelAction={}))})(De||(De={}));var Qr=k(require("path"));function ii(e){return Qr.default.sep===Qr.default.posix.sep?e:e.split(Qr.default.sep).join(Qr.default.posix.sep)}var Xo=k(oi());function ai(e){return String(new si(e))}var si=class{constructor(r){this.config=r}toString(){let{config:r}=this,t=r.provider.fromEnvVar?`env("${r.provider.fromEnvVar}")`:r.provider.value,n=JSON.parse(JSON.stringify({provider:t,binaryTargets:Hu(r.binaryTargets)}));return`generator ${r.name} { -${(0,Xo.default)(Wu(n),2)} -}`}};function Hu(e){let r;if(e.length>0){let t=e.find(n=>n.fromEnvVar!==null);t?r=`env("${t.fromEnvVar}")`:r=e.map(n=>n.native?"native":n.value)}else r=void 0;return r}function Wu(e){let r=Object.keys(e).reduce((t,n)=>Math.max(t,n.length),0);return Object.entries(e).map(([t,n])=>`${t.padEnd(r)} = ${Ku(n)}`).join(` -`)}function Ku(e){return JSON.parse(JSON.stringify(e,(r,t)=>Array.isArray(t)?`[${t.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(t)))}var Jr={};Fr(Jr,{error:()=>Zu,info:()=>zu,log:()=>Yu,query:()=>Xu,should:()=>es,tags:()=>Gr,warn:()=>li});var Gr={error:ue("prisma:error"),warn:fe("prisma:warn"),info:_e("prisma:info"),query:ze("prisma:query")},es={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Yu(...e){console.log(...e)}function li(e,...r){es.warn()&&console.warn(`${Gr.warn} ${e}`,...r)}function zu(e,...r){console.info(`${Gr.info} ${e}`,...r)}function Zu(e,...r){console.error(`${Gr.error} ${e}`,...r)}function Xu(e,...r){console.log(`${Gr.query} ${e}`,...r)}function jt(e,r){if(!e)throw new Error(`${r}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function rr(e,r){throw new Error(r)}function ci(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var pi=(e,r)=>e.reduce((t,n)=>(t[r(n)]=n,t),{});function gr(e,r){let t={};for(let n of Object.keys(e))t[n]=r(e[n],n);return t}function mi(e,r){if(e.length===0)return;let t=e[0];for(let n=1;n{os.has(e)||(os.add(e),li(r,...t))};var V=class extends Error{constructor(r,{code:t,clientVersion:n,meta:i,batchRequestIdx:o}){super(r),this.name="PrismaClientKnownRequestError",this.code=t,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};w(V,"PrismaClientKnownRequestError");var Oe=class extends V{constructor(r,t){super(r,{code:"P2025",clientVersion:t}),this.name="NotFoundError"}};w(Oe,"NotFoundError");var R=class e extends Error{constructor(r,t,n){super(r),this.name="PrismaClientInitializationError",this.clientVersion=t,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};w(R,"PrismaClientInitializationError");var le=class extends Error{constructor(r,t){super(r),this.name="PrismaClientRustPanicError",this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};w(le,"PrismaClientRustPanicError");var B=class extends Error{constructor(r,{clientVersion:t,batchRequestIdx:n}){super(r),this.name="PrismaClientUnknownRequestError",this.clientVersion=t,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};w(B,"PrismaClientUnknownRequestError");var W=class extends Error{constructor(t,{clientVersion:n}){super(t);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};w(W,"PrismaClientValidationError");var hr=class{constructor(r){this._engine=r}prometheus(r){return this._engine.metrics({format:"prometheus",...r})}json(r){return this._engine.metrics({format:"json",...r})}};function Wr(e){let r;return{get(){return r||(r={value:e()}),r.value}}}function ss(e,r){let t=Wr(()=>rc(r));Object.defineProperty(e,"dmmf",{get:()=>t.get()})}function rc(e){return{datamodel:{models:di(e.models),enums:di(e.enums),types:di(e.types)}}}function di(e){return Object.entries(e).map(([r,t])=>({name:r,...t}))}var Ut=Symbol(),fi=new WeakMap,Le=class{constructor(r){r===Ut?fi.set(this,`Prisma.${this._getName()}`):fi.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return fi.get(this)}},Kr=class extends Le{_getNamespace(){return"NullTypes"}},Yr=class extends Kr{};gi(Yr,"DbNull");var zr=class extends Kr{};gi(zr,"JsonNull");var Zr=class extends Kr{};gi(Zr,"AnyNull");var Qt={classes:{DbNull:Yr,JsonNull:zr,AnyNull:Zr},instances:{DbNull:new Yr(Ut),JsonNull:new zr(Ut),AnyNull:new Zr(Ut)}};function gi(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}function Xr(e){return{ok:!1,error:e,map(){return Xr(e)},flatMap(){return Xr(e)}}}var hi=class{constructor(){this.registeredErrors=[]}consumeError(r){return this.registeredErrors[r]}registerNewError(r){let t=0;for(;this.registeredErrors[t]!==void 0;)t++;return this.registeredErrors[t]={error:r},t}},yi=e=>{let r=new hi,t=tr(r,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:r,queryRaw:tr(r,e.queryRaw.bind(e)),executeRaw:tr(r,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await t(...i)).map(s=>tc(r,s))};return e.getConnectionInfo&&(n.getConnectionInfo=nc(r,e.getConnectionInfo.bind(e))),n},tc=(e,r)=>({adapterName:r.adapterName,provider:r.provider,options:r.options,queryRaw:tr(e,r.queryRaw.bind(r)),executeRaw:tr(e,r.executeRaw.bind(r)),commit:tr(e,r.commit.bind(r)),rollback:tr(e,r.rollback.bind(r))});function tr(e,r){return async(...t)=>{try{return await r(...t)}catch(n){let i=e.registerNewError(n);return Xr({kind:"GenericJs",id:i})}}}function nc(e,r){return(...t)=>{try{return r(...t)}catch(n){let i=e.registerNewError(n);return Xr({kind:"GenericJs",id:i})}}}var _l=k(Yn());var kl=require("async_hooks"),Dl=require("events"),Ol=k(require("fs")),vt=k(require("path"));var ie=class e{constructor(r,t){if(r.length-1!==t.length)throw r.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${r.length} strings to have ${r.length-1} values`);let n=t.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=r[0];let i=0,o=0;for(;ie.getPropertyValue(t))},getPropertyDescriptor(t){return e.getPropertyDescriptor?.(t)}}}var Gt={enumerable:!0,configurable:!0,writable:!0};function Jt(e){let r=new Set(e);return{getOwnPropertyDescriptor:()=>Gt,has:(t,n)=>r.has(n),set:(t,n,i)=>r.add(n)&&Reflect.set(t,n,i),ownKeys:()=>[...r]}}var us=Symbol.for("nodejs.util.inspect.custom");function Pe(e,r){let t=ic(r),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=t.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=t.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=cs(Reflect.ownKeys(o),t),a=cs(Array.from(t.keys()),t);return[...new Set([...s,...a,...n])]},set(o,s,a){return t.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=t.get(s);return l?l.getPropertyDescriptor?{...Gt,...l?.getPropertyDescriptor(s)}:Gt:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[us]=function(){let o={...this};return delete o[us],o},i}function ic(e){let r=new Map;for(let t of e){let n=t.getKeys();for(let i of n)r.set(i,t)}return r}function cs(e,r){return e.filter(t=>r.get(t)?.has?.(t)??!0)}function yr(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Er(e,r){return{batch:e,transaction:r?.kind==="batch"?{isolationLevel:r.options.isolationLevel}:void 0}}var br=class{constructor(r=0,t){this.context=t;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=r}write(r){return typeof r=="string"?this.currentLine+=r:r.write(this),this}writeJoined(r,t){let n=t.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(r){return this.marginSymbol=r,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let r=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+r.slice(1):r}};function ps(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function wr(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Ht(e){return e.toString()!=="Invalid Date"}var xr=9e15,Ge=1e9,wi="0123456789abcdef",Kt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Yt="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",xi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-xr,maxE:xr,crypto:!1},gs,Fe,x=!0,Zt="[DecimalError] ",Qe=Zt+"Invalid argument: ",hs=Zt+"Precision limit exceeded",ys=Zt+"crypto unavailable",Es="[object Decimal]",ee=Math.floor,Q=Math.pow,oc=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,sc=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,ac=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,bs=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,he=1e7,E=7,lc=9007199254740991,uc=Kt.length-1,Pi=Yt.length-1,d={toStringTag:Es};d.absoluteValue=d.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};d.ceil=function(){return y(new this.constructor(this),this.e+1,2)};d.clampedTo=d.clamp=function(e,r){var t,n=this,i=n.constructor;if(e=new i(e),r=new i(r),!e.s||!r.s)return new i(NaN);if(e.gt(r))throw Error(Qe+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new i(n)};d.comparedTo=d.cmp=function(e){var r,t,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,r=0,t=na[r]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};d.cosine=d.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+E,n.rounding=1,t=cc(n,Ts(n,t)),n.precision=e,n.rounding=r,y(Fe==2||Fe==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};d.cubeRoot=d.cbrt=function(){var e,r,t,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(x=!1,o=c.s*Q(c.s*c,1/3),!o||Math.abs(o)==1/0?(t=K(c.d),e=c.e,(o=(e-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=Q(t,1/3),e=ee((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new p(t),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=F(u.plus(c).times(a),u.plus(l),s+2,1),K(a.d).slice(0,s)===(t=K(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,e+1,1),r=!n.times(n).times(n).eq(c));break}return x=!0,y(n,e,p.rounding,r)};d.decimalPlaces=d.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-ee(this.e/E))*E,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};d.dividedBy=d.div=function(e){return F(this,new this.constructor(e))};d.dividedToIntegerBy=d.divToInt=function(e){var r=this,t=r.constructor;return y(F(r,new t(e),0,1,1),t.precision,t.rounding)};d.equals=d.eq=function(e){return this.cmp(e)===0};d.floor=function(){return y(new this.constructor(this),this.e+1,3)};d.greaterThan=d.gt=function(e){return this.cmp(e)>0};d.greaterThanOrEqualTo=d.gte=function(e){var r=this.cmp(e);return r==1||r===0};d.hyperbolicCosine=d.cosh=function(){var e,r,t,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;t=s.precision,n=s.rounding,s.precision=t+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),r=(1/en(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),o=Pr(s,1,o.times(r),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return y(o,s.precision=t,s.rounding=n,!0)};d.hyperbolicSine=d.sinh=function(){var e,r,t,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(r=o.precision,t=o.rounding,o.precision=r+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=Pr(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/en(5,e)),i=Pr(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=r,o.rounding=t,y(i,r,t,!0)};d.hyperbolicTangent=d.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,F(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)};d.inverseCosine=d.acos=function(){var e,r=this,t=r.constructor,n=r.abs().cmp(1),i=t.precision,o=t.rounding;return n!==-1?n===0?r.isNeg()?ge(t,i,o):new t(0):new t(NaN):r.isZero()?ge(t,i+4,o).times(.5):(t.precision=i+6,t.rounding=1,r=r.asin(),e=ge(t,i+4,o).times(.5),t.precision=i,t.rounding=o,e.minus(r))};d.inverseHyperbolicCosine=d.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,x=!1,t=t.times(t).minus(1).sqrt().plus(t),x=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)};d.inverseHyperbolicSine=d.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,x=!1,t=t.times(t).plus(1).sqrt().plus(t),x=!0,n.precision=e,n.rounding=r,t.ln())};d.inverseHyperbolicTangent=d.atanh=function(){var e,r,t,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,r=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?y(new o(i),e,r,!0):(o.precision=t=n-i.e,i=F(i.plus(1),new o(1).minus(i),t+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=r,i.times(.5))):new o(NaN)};d.inverseSine=d.asin=function(){var e,r,t,n,i=this,o=i.constructor;return i.isZero()?new o(i):(r=i.abs().cmp(1),t=o.precision,n=o.rounding,r!==-1?r===0?(e=ge(o,t+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=t+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=n,i.times(2)))};d.inverseTangent=d.atan=function(){var e,r,t,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,m=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=Pi)return s=ge(c,p+4,m).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=Pi)return s=ge(c,p+4,m).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,t=Math.min(28,a/E+2|0),e=t;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(x=!1,r=Math.ceil(a/E),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===o.d[e]&&e--;);return t&&(s=s.times(2<this.d.length-2};d.isNaN=function(){return!this.s};d.isNegative=d.isNeg=function(){return this.s<0};d.isPositive=d.isPos=function(){return this.s>0};d.isZero=function(){return!!this.d&&this.d[0]===0};d.lessThan=d.lt=function(e){return this.cmp(e)<0};d.lessThanOrEqualTo=d.lte=function(e){return this.cmp(e)<1};d.logarithm=d.log=function(e){var r,t,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,m=c.rounding,f=5;if(e==null)e=new c(10),r=!0;else{if(e=new c(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new c(NaN);r=e.eq(10)}if(t=u.d,u.s<0||!t||!t[0]||u.eq(1))return new c(t&&!t[0]?-1/0:u.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)o=!0;else{for(i=t[0];i%10===0;)i/=10;o=i!==1}if(x=!1,a=p+f,s=Ue(u,a),n=r?zt(c,a+10):Ue(e,a),l=F(s,n,a,1),rt(l.d,i=p,m))do if(a+=10,s=Ue(u,a),n=r?zt(c,a+10):Ue(e,a),l=F(s,n,a,1),!o){+K(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(rt(l.d,i+=10,m));return x=!0,y(l,p,m)};d.minus=d.sub=function(e){var r,t,n,i,o,s,a,l,u,c,p,m,f=this,g=f.constructor;if(e=new g(e),!f.d||!e.d)return!f.s||!e.s?e=new g(NaN):f.d?e.s=-e.s:e=new g(e.d||f.s!==e.s?f:NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(u=f.d,m=e.d,a=g.precision,l=g.rounding,!u[0]||!m[0]){if(m[0])e.s=-e.s;else if(u[0])e=new g(f);else return new g(l===3?-0:0);return x?y(e,a,l):e}if(t=ee(e.e/E),c=ee(f.e/E),u=u.slice(),o=c-t,o){for(p=o<0,p?(r=u,o=-o,s=m.length):(r=m,t=c,s=u.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,r.length=1),r.reverse(),n=o;n--;)r.push(0);r.reverse()}else{for(n=u.length,s=m.length,p=n0;--n)u[s++]=0;for(n=m.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,t=c,c=u,u=t),r=0;i;)r=(u[--i]=u[i]+c[i]+r)/he|0,u[i]%=he;for(r&&(u.unshift(r),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=Xt(u,n),x?y(e,a,l):e};d.precision=d.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Qe+e);return t.d?(r=ws(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};d.round=function(){var e=this,r=e.constructor;return y(new r(e),e.e+1,r.rounding)};d.sine=d.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+E,n.rounding=1,t=mc(n,Ts(n,t)),n.precision=e,n.rounding=r,y(Fe>2?t.neg():t,e,r,!0)):new n(NaN)};d.squareRoot=d.sqrt=function(){var e,r,t,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(x=!1,u=Math.sqrt(+s),u==0||u==1/0?(r=K(a),(r.length+l)%2==0&&(r+="0"),u=Math.sqrt(r),l=ee((l+1)/2)-(l<0||l%2),u==1/0?r="5e"+l:(r=u.toExponential(),r=r.slice(0,r.indexOf("e")+1)+l),n=new c(r)):n=new c(u.toString()),t=(l=c.precision)+3;;)if(o=n,n=o.plus(F(s,o,t+2,1)).times(.5),K(o.d).slice(0,t)===(r=K(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}t+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return x=!0,y(n,l,c.rounding,e)};d.tangent=d.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=F(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,y(Fe==2||Fe==4?t.neg():t,e,r,!0)):new n(NaN)};d.times=d.mul=function(e){var r,t,n,i,o,s,a,l,u,c=this,p=c.constructor,m=c.d,f=(e=new p(e)).d;if(e.s*=c.s,!m||!m[0]||!f||!f[0])return new p(!e.s||m&&!m[0]&&!f||f&&!f[0]&&!m?NaN:!m||!f?e.s/0:e.s*0);for(t=ee(c.e/E)+ee(e.e/E),l=m.length,u=f.length,l=0;){for(r=0,i=l+n;i>n;)a=o[i]+f[n]*m[i-n-1]+r,o[i--]=a%he|0,r=a/he|0;o[i]=(o[i]+r)%he|0}for(;!o[--s];)o.pop();return r?++t:o.shift(),e.d=o,e.e=Xt(o,t),x?y(e,p.precision,p.rounding):e};d.toBinary=function(e,r){return Ci(this,2,e,r)};d.toDecimalPlaces=d.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(oe(e,0,Ge),r===void 0?r=n.rounding:oe(r,0,8),y(t,e+t.e+1,r))};d.toExponential=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=ve(n,!0):(oe(e,0,Ge),r===void 0?r=i.rounding:oe(r,0,8),n=y(new i(n),e+1,r),t=ve(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};d.toFixed=function(e,r){var t,n,i=this,o=i.constructor;return e===void 0?t=ve(i):(oe(e,0,Ge),r===void 0?r=o.rounding:oe(r,0,8),n=y(new o(i),e+i.e+1,r),t=ve(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};d.toFraction=function(e){var r,t,n,i,o,s,a,l,u,c,p,m,f=this,g=f.d,h=f.constructor;if(!g)return new h(f);if(u=t=new h(1),n=l=new h(0),r=new h(n),o=r.e=ws(g)-f.e-1,s=o%E,r.d[0]=Q(10,s<0?E+s:s),e==null)e=o>0?r:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error(Qe+a);e=a.gt(r)?o>0?r:u:a}for(x=!1,a=new h(K(g)),c=h.precision,h.precision=o=g.length*E*2;p=F(a,r,0,1,1),i=t.plus(p.times(n)),i.cmp(e)!=1;)t=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=r,r=a.minus(p.times(i)),a=i;return i=F(e.minus(t),n,0,1,1),l=l.plus(i.times(u)),t=t.plus(i.times(n)),l.s=u.s=f.s,m=F(u,n,o,1).minus(f).abs().cmp(F(l,t,o,1).minus(f).abs())<1?[u,n]:[l,t],h.precision=c,x=!0,m};d.toHexadecimal=d.toHex=function(e,r){return Ci(this,16,e,r)};d.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:oe(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(x=!1,t=F(t,e,0,r,1).times(e),x=!0,y(t)):(e.s=t.s,t=e),t};d.toNumber=function(){return+this};d.toOctal=function(e,r){return Ci(this,8,e,r)};d.toPower=d.pow=function(e){var r,t,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Q(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(r=ee(e.e/E),r>=e.d.length-1&&(t=u<0?-u:u)<=lc)return i=xs(l,a,t,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(rl.maxE+1||r0?s/0:0):(x=!1,l.rounding=a.s=1,t=Math.min(12,(r+"").length),i=vi(e.times(Ue(a,n+t)),n),i.d&&(i=y(i,n+5,1),rt(i.d,n,o)&&(r=n+10,i=y(vi(e.times(Ue(a,r+t)),r),r+5,1),+K(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,x=!0,l.rounding=o,y(i,n,o))};d.toPrecision=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=ve(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,Ge),r===void 0?r=i.rounding:oe(r,0,8),n=y(new i(n),e,r),t=ve(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t};d.toSignificantDigits=d.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(oe(e,1,Ge),r===void 0?r=n.rounding:oe(r,0,8)),y(new n(t),e,r)};d.toString=function(){var e=this,r=e.constructor,t=ve(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};d.truncated=d.trunc=function(){return y(new this.constructor(this),this.e+1,1)};d.valueOf=d.toJSON=function(){var e=this,r=e.constructor,t=ve(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function K(e){var r,t,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,r=1;rt)throw Error(Qe+e)}function rt(e,r,t,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--r;return--r<0?(r+=E,i=0):(i=Math.ceil((r+1)/E),r%=E),o=Q(10,E-r),a=e[i]%o|0,n==null?r<3?(r==0?a=a/100|0:r==1&&(a=a/10|0),s=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):s=(t<4&&a+1==o||t>3&&a+1==o/2)&&(e[i+1]/o/100|0)==Q(10,r-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:r<4?(r==0?a=a/1e3|0:r==1?a=a/100|0:r==2&&(a=a/10|0),s=(n||t<4)&&a==9999||!n&&t>3&&a==4999):s=((n||t<4)&&a+1==o||!n&&t>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==Q(10,r-3)-1,s}function Wt(e,r,t){for(var n,i=[0],o,s=0,a=e.length;st-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function cc(e,r){var t,n,i;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),i=(1/en(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=Pr(e,1,r.times(i),new e(1));for(var o=t;o--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var F=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function r(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function t(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,m,f,g,h,I,T,S,C,b,de,ae,Lr,U,ne,Ae,Y,cr,Tt=n.constructor,_n=n.s==i.s?1:-1,z=n.d,O=i.d;if(!z||!z[0]||!O||!O[0])return new Tt(!n.s||!i.s||(z?O&&z[0]==O[0]:!O)?NaN:z&&z[0]==0||!O?_n*0:_n/0);for(l?(f=1,c=n.e-i.e):(l=he,f=E,c=ee(n.e/f)-ee(i.e/f)),Y=O.length,ne=z.length,T=new Tt(_n),S=T.d=[],p=0;O[p]==(z[p]||0);p++);if(O[p]>(z[p]||0)&&c--,o==null?(ae=o=Tt.precision,s=Tt.rounding):a?ae=o+(n.e-i.e)+1:ae=o,ae<0)S.push(1),g=!0;else{if(ae=ae/f+2|0,p=0,Y==1){for(m=0,O=O[0],ae++;(p1&&(O=e(O,m,l),z=e(z,m,l),Y=O.length,ne=z.length),U=Y,C=z.slice(0,Y),b=C.length;b=l/2&&++Ae;do m=0,u=r(O,C,Y,b),u<0?(de=C[0],Y!=b&&(de=de*l+(C[1]||0)),m=de/Ae|0,m>1?(m>=l&&(m=l-1),h=e(O,m,l),I=h.length,b=C.length,u=r(h,C,I,b),u==1&&(m--,t(h,Y=10;m/=10)p++;T.e=p+c*f-1,y(T,a?o+T.e+1:o,s,g)}return T}}();function y(e,r,t,n){var i,o,s,a,l,u,c,p,m,f=e.constructor;e:if(r!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=r-i,o<0)o+=E,s=r,c=p[m=0],l=c/Q(10,i-s-1)%10|0;else if(m=Math.ceil((o+1)/E),a=p.length,m>=a)if(n){for(;a++<=m;)p.push(0);c=l=0,i=1,o%=E,s=o-E+1}else break e;else{for(c=a=p[m],i=1;a>=10;a/=10)i++;o%=E,s=o-E+i,l=s<0?0:c/Q(10,i-s-1)%10|0}if(n=n||r<0||p[m+1]!==void 0||(s<0?c:c%Q(10,i-s-1)),u=t<4?(l||n)&&(t==0||t==(e.s<0?3:2)):l>5||l==5&&(t==4||n||t==6&&(o>0?s>0?c/Q(10,i-s):0:p[m-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,u?(r-=e.e+1,p[0]=Q(10,(E-r%E)%E),e.e=-r||0):p[0]=e.e=0,e;if(o==0?(p.length=m,a=1,m--):(p.length=m+1,a=Q(10,E-o),p[m]=s>0?(c/Q(10,i-s)%Q(10,s)|0)*a:0),u)for(;;)if(m==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==he&&(p[0]=1));break}else{if(p[m]+=a,p[m]!=he)break;p[m--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return x&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Be(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Be(-i-1)+o,t&&(n=t-s)>0&&(o+=Be(n))):i>=s?(o+=Be(i+1-s),t&&(n=t-i-1)>0&&(o=o+"."+Be(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Be(n))),o}function Xt(e,r){var t=e[0];for(r*=E;t>=10;t/=10)r++;return r}function zt(e,r,t){if(r>uc)throw x=!0,t&&(e.precision=t),Error(hs);return y(new e(Kt),r,1,!0)}function ge(e,r,t){if(r>Pi)throw Error(hs);return y(new e(Yt),r,t,!0)}function ws(e){var r=e.length-1,t=r*E+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function Be(e){for(var r="";e--;)r+="0";return r}function xs(e,r,t,n){var i,o=new e(1),s=Math.ceil(n/E+4);for(x=!1;;){if(t%2&&(o=o.times(r),ds(o.d,s)&&(i=!0)),t=ee(t/2),t===0){t=o.d.length-1,i&&o.d[t]===0&&++o.d[t];break}r=r.times(r),ds(r.d,s)}return x=!0,o}function ms(e){return e.d[e.d.length-1]&1}function Ps(e,r,t){for(var n,i=new e(r[0]),o=0;++o17)return new m(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(r==null?(x=!1,l=g):l=r,a=new m(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(Q(2,p))/Math.LN10*2+5|0,l+=n,t=o=s=new m(1),m.precision=l;;){if(o=y(o.times(e),l,1),t=t.times(++c),a=s.plus(F(o,t,l,1)),K(a.d).slice(0,l)===K(s.d).slice(0,l)){for(i=p;i--;)s=y(s.times(s),l,1);if(r==null)if(u<3&&rt(s.d,l-n,f,u))m.precision=l+=10,t=o=a=new m(1),c=0,u++;else return y(s,m.precision=g,f,x=!0);else return m.precision=g,s}s=a}}function Ue(e,r){var t,n,i,o,s,a,l,u,c,p,m,f=1,g=10,h=e,I=h.d,T=h.constructor,S=T.rounding,C=T.precision;if(h.s<0||!I||!I[0]||!h.e&&I[0]==1&&I.length==1)return new T(I&&!I[0]?-1/0:h.s!=1?NaN:I?0:h);if(r==null?(x=!1,c=C):c=r,T.precision=c+=g,t=K(I),n=t.charAt(0),Math.abs(o=h.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)h=h.times(e),t=K(h.d),n=t.charAt(0),f++;o=h.e,n>1?(h=new T("0."+t),o++):h=new T(n+"."+t.slice(1))}else return u=zt(T,c+2,C).times(o+""),h=Ue(new T(n+"."+t.slice(1)),c-g).plus(u),T.precision=C,r==null?y(h,C,S,x=!0):h;for(p=h,l=s=h=F(h.minus(1),h.plus(1),c,1),m=y(h.times(h),c,1),i=3;;){if(s=y(s.times(m),c,1),u=l.plus(F(s,new T(i),c,1)),K(u.d).slice(0,c)===K(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(zt(T,c+2,C).times(o+""))),l=F(l,new T(f),c,1),r==null)if(rt(l.d,c-g,S,a))T.precision=c+=g,u=s=h=F(p.minus(1),p.plus(1),c,1),m=y(h.times(h),c,1),i=a=1;else return y(l,T.precision=C,S,x=!0);else return T.precision=C,l;l=u,i+=2}}function vs(e){return String(e.s*e.s/0)}function Ti(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(i=r.length;r.charCodeAt(i-1)===48;--i);if(r=r.slice(n,i),r){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%E,t<0&&(n+=E),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\d)_(?=\d)/g,"$1"),bs.test(r))return Ti(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(sc.test(r))t=16,r=r.toLowerCase();else if(oc.test(r))t=2;else if(ac.test(r))t=8;else throw Error(Qe+r);for(o=r.search(/p/i),o>0?(l=+r.slice(o+1),r=r.substring(2,o)):r=r.slice(2),o=r.indexOf("."),s=o>=0,n=e.constructor,s&&(r=r.replace(".",""),a=r.length,o=a-o,i=xs(n,new n(t),o,o*2)),u=Wt(r,t,he),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=Xt(u,c),e.d=u,x=!1,s&&(e=F(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?Q(2,l):ir.pow(2,l))),x=!0,e)}function mc(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:Pr(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/en(5,t)),r=Pr(e,2,r,r);for(var i,o=new e(5),s=new e(16),a=new e(20);t--;)i=r.times(r),r=r.times(o.plus(i.times(s.times(i).minus(a))));return r}function Pr(e,r,t,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/E);for(x=!1,l=t.times(t),a=new e(n);;){if(s=F(a.times(l),new e(r++*r++),c,1),a=i?n.plus(s):n.minus(s),n=F(s.times(l),new e(r++*r++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return x=!0,s.d.length=p+1,s}function en(e,r){for(var t=e;--r;)t*=e;return t}function Ts(e,r){var t,n=r.s<0,i=ge(e,e.precision,1),o=i.times(.5);if(r=r.abs(),r.lte(o))return Fe=n?4:1,r;if(t=r.divToInt(i),t.isZero())Fe=n?3:2;else{if(r=r.minus(t.times(i)),r.lte(o))return Fe=ms(t)?n?2:3:n?4:1,r;Fe=ms(t)?n?1:4:n?3:2}return r.minus(i).abs()}function Ci(e,r,t,n){var i,o,s,a,l,u,c,p,m,f=e.constructor,g=t!==void 0;if(g?(oe(t,1,Ge),n===void 0?n=f.rounding:oe(n,0,8)):(t=f.precision,n=f.rounding),!e.isFinite())c=vs(e);else{for(c=ve(e),s=c.indexOf("."),g?(i=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):i=r,s>=0&&(c=c.replace(".",""),m=new f(1),m.e=c.length-s,m.d=Wt(ve(m),10,i),m.e=m.d.length),p=Wt(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new f(e),e.d=p,e.e=o,e=F(e,m,t,n,0,i),p=e.d,o=e.e,u=gs),s=p[t],a=i/2,u=u||p[t+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[t-1]&1||n===(e.s<0?8:7)),p.length=t,u)for(;++p[--t]>i-1;)p[t]=0,t||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s1)if(r==16||r==8){for(s=r==16?4:3,--l;l%s;l++)c+="0";for(p=Wt(c,i,r),l=p.length;!p[l-1];--l);for(s=1,c="1.";sl)for(o-=l;o--;)c+="0";else or)return e.length=r,!0}function dc(e){return new this(e).abs()}function fc(e){return new this(e).acos()}function gc(e){return new this(e).acosh()}function hc(e,r){return new this(e).plus(r)}function yc(e){return new this(e).asin()}function Ec(e){return new this(e).asinh()}function bc(e){return new this(e).atan()}function wc(e){return new this(e).atanh()}function xc(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,o=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=ge(this,o,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?ge(this,n,i):new this(0),t.s=e.s):!e.d||r.isZero()?(t=ge(this,o,1).times(.5),t.s=e.s):r.s<0?(this.precision=o,this.rounding=1,t=this.atan(F(e,r,o,1)),r=ge(this,o,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(F(e,r,o,1)),t}function Pc(e){return new this(e).cbrt()}function vc(e){return y(e=new this(e),e.e+1,2)}function Tc(e,r,t){return new this(e).clamp(r,t)}function Cc(e){if(!e||typeof e!="object")throw Error(Zt+"Object expected");var r,t,n,i=e.defaults===!0,o=["precision",1,Ge,"rounding",0,8,"toExpNeg",-xr,0,"toExpPos",0,xr,"maxE",0,xr,"minE",-xr,0,"modulo",0,9];for(r=0;r=o[r+1]&&n<=o[r+2])this[t]=n;else throw Error(Qe+t+": "+n);if(t="crypto",i&&(this[t]=xi[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(ys);else this[t]=!1;else throw Error(Qe+t+": "+n);return this}function Sc(e){return new this(e).cos()}function Rc(e){return new this(e).cosh()}function Cs(e){var r,t,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,fs(o)){u.s=o.s,x?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;x?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?r[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(r,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(ys);else for(;o=10;i/=10)n++;n`}};function Tr(e){return e instanceof tt}var rn=class{constructor(r){this.value=r}write(r){r.write(this.value)}markAsError(){this.value.markAsError()}};var tn=e=>e,nn={bold:tn,red:tn,green:tn,dim:tn,enabled:!1},Ss={bold:H,red:ue,green:Me,dim:Ie,enabled:!0},Cr={write(e){e.writeLine(",")}};var Ce=class{constructor(r){this.contents=r;this.isUnderlined=!1;this.color=r=>r}underline(){return this.isUnderlined=!0,this}setColor(r){return this.color=r,this}write(r){let t=r.getCurrentLineLength();r.write(this.color(this.contents)),this.isUnderlined&&r.afterNextNewline(()=>{r.write(" ".repeat(t)).writeLine(this.color("~".repeat(this.contents.length)))})}};var Je=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var Sr=class extends Je{constructor(){super(...arguments);this.items=[]}addItem(t){return this.items.push(new rn(t)),this}getField(t){return this.items[t]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(t){if(this.items.length===0){this.writeEmpty(t);return}this.writeWithItems(t)}writeEmpty(t){let n=new Ce("[]");this.hasError&&n.setColor(t.context.colors.red).underline(),t.write(n)}writeWithItems(t){let{colors:n}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(Cr,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Rs=": ",on=class{constructor(r,t){this.name=r;this.value=t;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Rs.length}write(r){let t=new Ce(this.name);this.hasError&&t.underline().setColor(r.context.colors.red),r.write(t).write(Rs).write(this.value)}};var sn=class e extends Je{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(t){this.fields[t.name]=t}addSuggestion(t){this.suggestions.push(t)}getField(t){return this.fields[t]}getDeepField(t){let[n,...i]=t,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof Sr&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(t){return t.length===0?this:this.getDeepField(t)?.value}hasField(t){return!!this.getField(t)}removeAllFields(){this.fields={}}removeField(t){delete this.fields[t]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(t){return this.getField(t)?.value}getDeepSubSelectionValue(t){let n=this;for(let i of t){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(t){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of t){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(t){return this.getSelectionParent()?.value.fields[t].value}getPrintWidth(){let t=Object.values(this.fields);return t.length==0?2:Math.max(...t.map(i=>i.getPrintWidth()))+2}write(t){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(t);return}this.writeWithContents(t,n)}asObject(){return this}writeEmpty(t){let n=new Ce("{}");this.hasError&&n.setColor(t.context.colors.red).underline(),t.write(n)}writeWithContents(t,n){t.writeLine("{").withIndent(()=>{t.writeJoined(Cr,[...n,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var J=class extends Je{constructor(t){super();this.text=t}getPrintWidth(){return this.text.length}write(t){let n=new Ce(this.text);this.hasError&&n.underline().setColor(t.context.colors.red),t.write(n)}asObject(){}};var Si=class{constructor(r){this.errorMessages=[];this.arguments=r}write(r){r.write(this.arguments)}addErrorMessage(r){this.errorMessages.push(r)}renderAllMessages(r){return this.errorMessages.map(t=>t(r)).join(` -`)}};function an(e){return new Si(As(e))}function As(e){let r=new sn;for(let[t,n]of Object.entries(e)){let i=new on(t,Is(n));r.addField(i)}return r}function Is(e){if(typeof e=="string")return new J(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new J(String(e));if(typeof e=="bigint")return new J(`${e}n`);if(e===null)return new J("null");if(e===void 0)return new J("undefined");if(vr(e))return new J(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new J(`Buffer.alloc(${e.byteLength})`):new J(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let r=Ht(e)?e.toISOString():"Invalid Date";return new J(`new Date("${r}")`)}return e instanceof Le?new J(`Prisma.${e._getName()}`):Tr(e)?new J(`prisma.${ps(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?Xc(e):typeof e=="object"?As(e):new J(Object.prototype.toString.call(e))}function Xc(e){let r=new Sr;for(let t of e)r.addItem(Is(t));return r}function _s(e){if(e===void 0)return"";let r=an(e);return new br(0,{colors:nn}).write(r).toString()}var ep="P2037";function or({error:e,user_facing_error:r},t,n){return r.error_code?new V(rp(r,n),{code:r.error_code,clientVersion:t,meta:r.meta,batchRequestIdx:r.batch_request_idx}):new B(e,{clientVersion:t,batchRequestIdx:r.batch_request_idx})}function rp(e,r){let t=e.message;return(r==="postgresql"||r==="postgres"||r==="mysql")&&e.error_code===ep&&(t+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),t}var nt="";function ks(e){var r=e.split(` -`);return r.reduce(function(t,n){var i=ip(n)||sp(n)||up(n)||dp(n)||pp(n);return i&&t.push(i),t},[])}var tp=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,np=/\((\S*)(?::(\d+))(?::(\d+))\)/;function ip(e){var r=tp.exec(e);if(!r)return null;var t=r[2]&&r[2].indexOf("native")===0,n=r[2]&&r[2].indexOf("eval")===0,i=np.exec(r[2]);return n&&i!=null&&(r[2]=i[1],r[3]=i[2],r[4]=i[3]),{file:t?null:r[2],methodName:r[1]||nt,arguments:t?[r[2]]:[],lineNumber:r[3]?+r[3]:null,column:r[4]?+r[4]:null}}var op=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function sp(e){var r=op.exec(e);return r?{file:r[2],methodName:r[1]||nt,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null}var ap=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,lp=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function up(e){var r=ap.exec(e);if(!r)return null;var t=r[3]&&r[3].indexOf(" > eval")>-1,n=lp.exec(r[3]);return t&&n!=null&&(r[3]=n[1],r[4]=n[2],r[5]=null),{file:r[3],methodName:r[1]||nt,arguments:r[2]?r[2].split(","):[],lineNumber:r[4]?+r[4]:null,column:r[5]?+r[5]:null}}var cp=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function pp(e){var r=cp.exec(e);return r?{file:r[3],methodName:r[1]||nt,arguments:[],lineNumber:+r[4],column:r[5]?+r[5]:null}:null}var mp=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function dp(e){var r=mp.exec(e);return r?{file:r[2],methodName:r[1]||nt,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null}var Ri=class{getLocation(){return null}},Ai=class{constructor(){this._error=new Error}getLocation(){let r=this._error.stack;if(!r)return null;let n=ks(r).find(i=>{if(!i.file)return!1;let o=ii(i.file);return o!==""&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function He(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Ri:new Ai}var Ds={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Rr(e={}){let r=gp(e);return Object.entries(r).reduce((n,[i,o])=>(Ds[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function gp(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function ln(e={}){return r=>(typeof e._count=="boolean"&&(r._count=r._count._all),r)}function Os(e,r){let t=ln(e);return r({action:"aggregate",unpacker:t,argsMapper:Rr})(e)}function hp(e={}){let{select:r,...t}=e;return typeof r=="object"?Rr({...t,_count:r}):Rr({...t,_count:{_all:!0}})}function yp(e={}){return typeof e.select=="object"?r=>ln(e)(r)._count:r=>ln(e)(r)._count._all}function Ls(e,r){return r({action:"count",unpacker:yp(e),argsMapper:hp})(e)}function Ep(e={}){let r=Rr(e);if(Array.isArray(r.by))for(let t of r.by)typeof t=="string"&&(r.select[t]=!0);else typeof r.by=="string"&&(r.select[r.by]=!0);return r}function bp(e={}){return r=>(typeof e?._count=="boolean"&&r.forEach(t=>{t._count=t._count._all}),r)}function Fs(e,r){return r({action:"groupBy",unpacker:bp(e),argsMapper:Ep})(e)}function Ns(e,r,t){if(r==="aggregate")return n=>Os(n,t);if(r==="count")return n=>Ls(n,t);if(r==="groupBy")return n=>Fs(n,t)}function Ms(e,r){let t=r.fields.filter(i=>!i.relationName),n=pi(t,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new tt(e,o,s.type,s.isList,s.kind==="enum")},...Jt(Object.keys(n))})}var $s=e=>Array.isArray(e)?e:e.split("."),Ii=(e,r)=>$s(r).reduce((t,n)=>t&&t[n],e),qs=(e,r,t)=>$s(r).reduceRight((n,i,o,s)=>Object.assign({},Ii(e,s.slice(0,o)),{[i]:n}),t);function wp(e,r){return e===void 0||r===void 0?[]:[...r,"select",e]}function xp(e,r,t){return r===void 0?e??{}:qs(r,t,e||!0)}function _i(e,r,t,n,i,o){let a=e._runtimeDataModel.models[r].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=He(e._errorFormat),c=wp(n,i),p=xp(l,o,c),m=t({dataPath:c,callsite:u})(p),f=Pp(e,r);return new Proxy(m,{get(g,h){if(!f.includes(h))return g[h];let T=[a[h].type,t,h],S=[c,p];return _i(e,...T,...S)},...Jt([...f,...Object.getOwnPropertyNames(m)])})}}function Pp(e,r){return e._runtimeDataModel.models[r].fields.filter(t=>t.kind==="object").map(t=>t.name)}var Gs=k(oi());var Qs=k(require("fs"));var js={keyword:_e,entity:_e,value:e=>H(ze(e)),punctuation:ze,directive:_e,function:_e,variable:e=>H(ze(e)),string:e=>H(Me(e)),boolean:fe,number:_e,comment:Nr};var vp=e=>e,un={},Tp=0,P={manual:un.Prism&&un.Prism.manual,disableWorkerMessageHandler:un.Prism&&un.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof ye){let r=e;return new ye(r.type,P.util.encode(r.content),r.alias)}else return Array.isArray(e)?e.map(P.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Ae instanceof ye)continue;if(de&&U!=r.length-1){S.lastIndex=ne;var p=S.exec(e);if(!p)break;var c=p.index+(b?p[1].length:0),m=p.index+p[0].length,a=U,l=ne;for(let O=r.length;a=l&&(++U,ne=l);if(r[U]instanceof ye)continue;u=a-U,Ae=e.slice(ne,l),p.index-=ne}else{S.lastIndex=0;var p=S.exec(Ae),u=1}if(!p){if(o)break;continue}b&&(ae=p[1]?p[1].length:0);var c=p.index+ae,p=p[0].slice(ae),m=c+p.length,f=Ae.slice(0,c),g=Ae.slice(m);let Y=[U,u];f&&(++U,ne+=f.length,Y.push(f));let cr=new ye(h,C?P.tokenize(p,C):p,Lr,p,de);if(Y.push(cr),g&&Y.push(g),Array.prototype.splice.apply(r,Y),u!=1&&P.matchGrammar(e,r,t,U,ne,!0,h),o)break}}}},tokenize:function(e,r){let t=[e],n=r.rest;if(n){for(let i in n)r[i]=n[i];delete r.rest}return P.matchGrammar(e,t,r,0,0,!1),t},hooks:{all:{},add:function(e,r){let t=P.hooks.all;t[e]=t[e]||[],t[e].push(r)},run:function(e,r){let t=P.hooks.all[e];if(!(!t||!t.length))for(var n=0,i;i=t[n++];)i(r)}},Token:ye};P.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};P.languages.javascript=P.languages.extend("clike",{"class-name":[P.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});P.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;P.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:P.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:P.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:P.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:P.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});P.languages.markup&&P.languages.markup.tag.addInlined("script","javascript");P.languages.js=P.languages.javascript;P.languages.typescript=P.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});P.languages.ts=P.languages.typescript;function ye(e,r,t,n,i){this.type=e,this.content=r,this.alias=t,this.length=(n||"").length|0,this.greedy=!!i}ye.stringify=function(e,r){return typeof e=="string"?e:Array.isArray(e)?e.map(function(t){return ye.stringify(t,r)}).join(""):Cp(e.type)(e.content)};function Cp(e){return js[e]||vp}function Vs(e){return Sp(e,P.languages.javascript)}function Sp(e,r){return P.tokenize(e,r).map(n=>ye.stringify(n)).join("")}var Bs=k(zo());function Us(e){return(0,Bs.default)(e)}var cn=class e{static read(r){let t;try{t=Qs.default.readFileSync(r,"utf-8")}catch{return null}return e.fromContent(t)}static fromContent(r){let t=r.split(/\r?\n/);return new e(1,t)}constructor(r,t){this.firstLineNumber=r,this.lines=t}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(r,t){if(rthis.lines.length+this.firstLineNumber)return this;let n=r-this.firstLineNumber,i=[...this.lines];return i[n]=t(i[n]),new e(this.firstLineNumber,i)}mapLines(r){return new e(this.firstLineNumber,this.lines.map((t,n)=>r(t,this.firstLineNumber+n)))}lineAt(r){return this.lines[r-this.firstLineNumber]}prependSymbolAt(r,t){return this.mapLines((n,i)=>i===r?`${t} ${n}`:` ${n}`)}slice(r,t){let n=this.lines.slice(r-1,t).join(` -`);return new e(r,Us(n).split(` -`))}highlight(){let r=Vs(this.toString());return new e(this.firstLineNumber,r.split(` -`))}toString(){return this.lines.join(` -`)}};var Rp={red:ue,gray:Nr,dim:Ie,bold:H,underline:X,highlightSource:e=>e.highlight()},Ap={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Ip({message:e,originalMethod:r,isPanic:t,callArguments:n}){return{functionName:`prisma.${r}()`,message:e,isPanic:t??!1,callArguments:n}}function _p({callsite:e,message:r,originalMethod:t,isPanic:n,callArguments:i},o){let s=Ip({message:r,originalMethod:t,isPanic:n,callArguments:i});if(!e||typeof window<"u"||process.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=cn.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=Dp(c),m=kp(c);if(!m)return s;s.functionName=`${m.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,g=>g.slice(0,m.openingBraceIndex))),u=o.highlightSource(u);let f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,h)=>o.gray(String(h).padStart(f))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+f+1;g+=2,s.callArguments=(0,Gs.default)(i,g).slice(g)}}return s}function kp(e){let r=Object.keys(De.ModelAction).join("|"),n=new RegExp(String.raw`\.(${r})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function Dp(e){let r=0;for(let t=0;t{if("rejectOnNotFound"in n.args){let o=Ar({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new W(o,{clientVersion:r})}return await t(n).catch(o=>{throw o instanceof V&&o.code==="P2025"?new Oe(`No ${e} found`,r):o})}}function Se(e){return e.replace(/^./,r=>r.toLowerCase())}var Np=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Mp=["aggregate","count","groupBy"];function ki(e,r){let t=e._extensions.getAllModelExtensions(r)??{},n=[$p(e,r),jp(e,r),et(t),te("name",()=>r),te("$name",()=>r),te("$parent",()=>e._appliedParent)];return Pe({},n)}function $p(e,r){let t=Se(r),n=Object.keys(De.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=Js(o,r,e._clientVersion,s);let a=l=>u=>{let c=He(e._errorFormat);return e._createPrismaPromise(p=>{let m={args:u,dataPath:[],action:o,model:r,clientMethod:`${t}.${i}`,jsModelName:t,transaction:p,callsite:c};return s({...m,...l})})};return Np.includes(o)?_i(e,r,a):qp(i)?Ns(e,i,a):a({})}}}function qp(e){return Mp.includes(e)}function jp(e,r){return nr(te("fields",()=>{let t=e._runtimeDataModel.models[r];return Ms(r,t)}))}function Hs(e){return e.replace(/^./,r=>r.toUpperCase())}var Di=Symbol();function it(e){let r=[Vp(e),te(Di,()=>e),te("$parent",()=>e._appliedParent)],t=e._extensions.getAllClientExtensions();return t&&r.push(et(t)),Pe(e,r)}function Vp(e){let r=Object.keys(e._runtimeDataModel.models),t=r.map(Se),n=[...new Set(r.concat(t))];return nr({getKeys(){return n},getPropertyValue(i){let o=Hs(i);if(e._runtimeDataModel.models[o]!==void 0)return ki(e,o);if(e._runtimeDataModel.models[i]!==void 0)return ki(e,i)},getPropertyDescriptor(i){if(!t.includes(i))return{enumerable:!1}}})}function Ws(e){return e[Di]?e[Di]:e}function Ks(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let t=e.client.__AccelerateEngine;this._originalClient._engine=new t(this._originalClient._accelerateEngineConfig)}let r=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return it(r)}function Ys({result:e,modelName:r,select:t,omit:n,extensions:i}){let o=i.getAllComputedFields(r);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(c=>n[c]);u.length>0&&a.push(yr(u))}else if(t){if(!t[l.name])continue;let u=l.needs.filter(c=>!t[c]);u.length>0&&a.push(yr(u))}Bp(e,l.needs)&&s.push(Up(l,Pe(e,s)))}return s.length>0||a.length>0?Pe(e,[...s,...a]):e}function Bp(e,r){return r.every(t=>ci(e,t))}function Up(e,r){return nr(te(e.name,()=>e.compute(r)))}function pn({visitor:e,result:r,args:t,runtimeDataModel:n,modelName:i}){if(Array.isArray(r)){for(let s=0;sc.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};r[o]=pn({visitor:i,result:r[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Zs({result:e,modelName:r,args:t,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[r]?e:pn({result:e,args:t??{},modelName:r,runtimeDataModel:i,visitor:(s,a,l)=>Ys({result:s,modelName:Se(a),select:l.select,omit:l.omit,extensions:n})})}function Xs(e){if(e instanceof ie)return Qp(e);if(Array.isArray(e)){let t=[e[0]];for(let n=1;n{let o=r.customDataProxyFetch;return"transaction"in r&&i!==void 0&&(r.transaction?.kind==="batch"&&r.transaction.lock.then(),r.transaction=i),n===t.length?e._executeRequest(r):t[n]({model:r.model,operation:r.model?r.action:r.clientMethod,args:Xs(r.args??{}),__internalParams:r,query:(s,a=r)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=oa(o,l),a.args=s,ra(e,a,t,n+1)}})})}function ta(e,r){let{jsModelName:t,action:n,clientMethod:i}=r,o=t?n:i;if(e._extensions.isEmpty())return e._executeRequest(r);let s=e._extensions.getAllQueryCallbacks(t??"$none",o);return ra(e,r,s)}function na(e){return r=>{let t={requests:r},n=r[0].extensions.getAllBatchQueryCallbacks();return n.length?ia(t,n,0,e):e(t)}}function ia(e,r,t,n){if(t===r.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return r[t]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=oa(i,l),ia(a,r,t+1,n)}})}var ea=e=>e;function oa(e=ea,r=ea){return t=>e(r(t))}function aa(e,r,t){let n=Se(t);return!r.result||!(r.result.$allModels||r.result[n])?e:Gp({...e,...sa(r.name,e,r.result.$allModels),...sa(r.name,e,r.result[n])})}function Gp(e){let r=new xe,t=(n,i)=>r.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>t(o,i)):[n]));return gr(e,n=>({...n,needs:t(n.name,new Set)}))}function sa(e,r,t){return t?gr(t,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Jp(r,o,i)})):{}}function Jp(e,r,t){let n=e?.[r]?.compute;return n?i=>t({...i,[r]:n(i)}):t}function la(e,r){if(!r)return e;let t={...e};for(let n of Object.values(r))if(e[n.name])for(let i of n.needs)t[i]=!0;return t}function ua(e,r){if(!r)return e;let t={...e};for(let n of Object.values(r))if(!e[n.name])for(let i of n.needs)delete t[i];return t}var mn=class{constructor(r,t){this.extension=r;this.previous=t;this.computedFieldsCache=new xe;this.modelExtensionsCache=new xe;this.queryCallbacksCache=new xe;this.clientExtensions=Wr(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=Wr(()=>{let r=this.previous?.getAllBatchQueryCallbacks()??[],t=this.extension.query?.$__internalBatch;return t?r.concat(t):r})}getAllComputedFields(r){return this.computedFieldsCache.getOrCreate(r,()=>aa(this.previous?.getAllComputedFields(r),this.extension,r))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(r){return this.modelExtensionsCache.getOrCreate(r,()=>{let t=Se(r);return!this.extension.model||!(this.extension.model[t]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(r):{...this.previous?.getAllModelExtensions(r),...this.extension.model.$allModels,...this.extension.model[t]}})}getAllQueryCallbacks(r,t){return this.queryCallbacksCache.getOrCreate(`${r}:${t}`,()=>{let n=this.previous?.getAllQueryCallbacks(r,t)??[],i=[],o=this.extension.query;return!o||!(o[r]||o.$allModels||o[t]||o.$allOperations)?n:(o[r]!==void 0&&(o[r][t]!==void 0&&i.push(o[r][t]),o[r].$allOperations!==void 0&&i.push(o[r].$allOperations)),r!=="$none"&&o.$allModels!==void 0&&(o.$allModels[t]!==void 0&&i.push(o.$allModels[t]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[t]!==void 0&&i.push(o[t]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},dn=class e{constructor(r){this.head=r}static empty(){return new e}static single(r){return new e(new mn(r))}isEmpty(){return this.head===void 0}append(r){return new e(new mn(r,this.head))}getAllComputedFields(r){return this.head?.getAllComputedFields(r)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(r){return this.head?.getAllModelExtensions(r)}getAllQueryCallbacks(r,t){return this.head?.getAllQueryCallbacks(r,t)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var ca=L("prisma:client"),pa={Vercel:"vercel","Netlify CI":"netlify"};function ma({postinstall:e,ciName:r,clientVersion:t}){if(ca("checkPlatformCaching:postinstall",e),ca("checkPlatformCaching:ciName",r),e===!0&&r&&r in pa){let n=`Prisma has detected that this project was built on ${r}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${pa[r]}-build`;throw console.error(n),new R(n,t)}}function da(e,r){return e?e.datasources?e.datasources:e.datasourceUrl?{[r[0]]:{url:e.datasourceUrl}}:{}:{}}var Hp="Cloudflare-Workers",Wp="node";function fa(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Hp?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===Wp?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var Kp={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function fn(){let e=fa();return{id:e,prettyName:Kp[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var ba=k(require("fs")),st=k(require("path"));function gn(e){let{runtimeBinaryTarget:r}=e;return`Add "${r}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it: - -${Yp(e)}`}function Yp(e){let{generator:r,generatorBinaryTargets:t,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...t,i];return ai({...r,binaryTargets:o})}function We(e){let{runtimeBinaryTarget:r}=e;return`Prisma Client could not locate the Query Engine for runtime "${r}".`}function Ke(e){let{searchedLocations:r}=e;return`The following locations have been searched: -${[...new Set(r)].map(i=>` ${i}`).join(` -`)}`}function ga(e){let{runtimeBinaryTarget:r}=e;return`${We(e)} - -This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${r}". -${gn(e)} - -${Ke(e)}`}function hn(e){return`We would appreciate if you could take the time to share some information with us. -Please help us by answering a few questions: https://pris.ly/${e}`}function yn(e){let{errorStack:r}=e;return r?.match(/\/\.next|\/next@|\/next\//)?` - -We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function ha(e){let{queryEngineName:r}=e;return`${We(e)}${yn(e)} - -This is likely caused by a bundler that has not copied "${r}" next to the resulting bundle. -Ensure that "${r}" has been copied next to the bundle or in "${e.expectedLocation}". - -${hn("engine-not-found-bundler-investigation")} - -${Ke(e)}`}function ya(e){let{runtimeBinaryTarget:r,generatorBinaryTargets:t}=e,n=t.find(i=>i.native);return`${We(e)} - -This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${r}". -${gn(e)} - -${Ke(e)}`}function Ea(e){let{queryEngineName:r}=e;return`${We(e)}${yn(e)} - -This is likely caused by tooling that has not copied "${r}" to the deployment folder. -Ensure that you ran \`prisma generate\` and that "${r}" has been copied to "${e.expectedLocation}". - -${hn("engine-not-found-tooling-investigation")} - -${Ke(e)}`}var zp=L("prisma:client:engines:resolveEnginePath"),Zp=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function wa(e,r){let t={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??r.prismaPath;if(t!==void 0)return t;let{enginePath:n,searchedLocations:i}=await Xp(e,r);if(zp("enginePath",n),n!==void 0&&e==="binary"&&Xn(n),n!==void 0)return r.prismaPath=n;let o=await er(),s=r.generator?.binaryTargets??[],a=s.some(m=>m.native),l=!s.some(m=>m.value===o),u=__filename.match(Zp())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:r.generator,runtimeBinaryTarget:o,queryEngineName:xa(e,o),expectedLocation:st.default.relative(process.cwd(),r.dirname),errorStack:new Error().stack},p;throw a&&l?p=ya(c):l?p=ga(c):u?p=ha(c):p=Ea(c),new R(p,r.clientVersion)}async function Xp(engineType,config){let binaryTarget=await er(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,st.default.resolve(dirname,".."),config.generator?.output?.value??dirname,st.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(qo());for(let e of searchLocations){let r=xa(engineType,binaryTarget),t=st.default.join(e,r);if(searchedLocations.push(e),ba.default.existsSync(t))return{enginePath:t,searchedLocations}}return{enginePath:void 0,searchedLocations}}function xa(e,r){return e==="library"?At(r,"fs"):`query-engine-${r}${r==="windows"?".exe":""}`}var Oi=k(ui());function Pa(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,r=>`${r[0]}5`):""}function va(e){return e.split(` -`).map(r=>r.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` -`)}var Ta=k(is());function Ca({title:e,user:r="prisma",repo:t="prisma",template:n="bug_report.yml",body:i}){return(0,Ta.default)({user:r,repo:t,template:n,title:e,body:i})}function Sa({version:e,binaryTarget:r,title:t,description:n,engineVersion:i,database:o,query:s}){let a=go(6e3-(s?.length??0)),l=va((0,Oi.default)(a)),u=n?`# Description -\`\`\` -${n} -\`\`\``:"",c=(0,Oi.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: -## Versions - -| Name | Version | -|-----------------|--------------------| -| Node | ${process.version?.padEnd(19)}| -| OS | ${r?.padEnd(19)}| -| Prisma Client | ${e?.padEnd(19)}| -| Query Engine | ${i?.padEnd(19)}| -| Database | ${o?.padEnd(19)}| - -${u} - -## Logs -\`\`\` -${l} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?Pa(s):""} -\`\`\` -`),p=Ca({title:t,body:c});return`${t} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${X(p)} - -If you want the Prisma team to look into it, please open the link above \u{1F64F} -To increase the chance of success, please post your schema and a snippet of -how you used Prisma Client in the issue. -`}function Ir({inlineDatasources:e,overrideDatasources:r,env:t,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=r[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=t[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new R(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new R("error: Missing URL environment variable, value, or override.",n);return i}var En=class extends Error{constructor(r,t){super(r),this.clientVersion=t.clientVersion,this.cause=t.cause}get[Symbol.toStringTag](){return this.name}};var se=class extends En{constructor(r,t){super(r,t),this.isRetryable=t.isRetryable??!0}};function A(e,r){return{...e,isRetryable:r}}var _r=class extends se{constructor(t){super("This request must be retried",A(t,!0));this.name="ForcedRetryError";this.code="P5001"}};w(_r,"ForcedRetryError");var sr=class extends se{constructor(t,n){super(t,A(n,!1));this.name="InvalidDatasourceError";this.code="P6001"}};w(sr,"InvalidDatasourceError");var ar=class extends se{constructor(t,n){super(t,A(n,!1));this.name="NotImplementedYetError";this.code="P5004"}};w(ar,"NotImplementedYetError");var $=class extends se{constructor(r,t){super(r,t),this.response=t.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 lr=class extends ${constructor(t){super("Schema needs to be uploaded",A(t,!0));this.name="SchemaMissingError";this.code="P5005"}};w(lr,"SchemaMissingError");var Li="This request could not be understood by the server",at=class extends ${constructor(t,n,i){super(n||Li,A(t,!1));this.name="BadRequestError";this.code="P5000";i&&(this.code=i)}};w(at,"BadRequestError");var lt=class extends ${constructor(t,n){super("Engine not started: healthcheck timeout",A(t,!0));this.name="HealthcheckTimeoutError";this.code="P5013";this.logs=n}};w(lt,"HealthcheckTimeoutError");var ut=class extends ${constructor(t,n,i){super(n,A(t,!0));this.name="EngineStartupError";this.code="P5014";this.logs=i}};w(ut,"EngineStartupError");var ct=class extends ${constructor(t){super("Engine version is not supported",A(t,!1));this.name="EngineVersionNotSupportedError";this.code="P5012"}};w(ct,"EngineVersionNotSupportedError");var Fi="Request timed out",pt=class extends ${constructor(t,n=Fi){super(n,A(t,!1));this.name="GatewayTimeoutError";this.code="P5009"}};w(pt,"GatewayTimeoutError");var em="Interactive transaction error",mt=class extends ${constructor(t,n=em){super(n,A(t,!1));this.name="InteractiveTransactionError";this.code="P5015"}};w(mt,"InteractiveTransactionError");var rm="Request parameters are invalid",dt=class extends ${constructor(t,n=rm){super(n,A(t,!1));this.name="InvalidRequestError";this.code="P5011"}};w(dt,"InvalidRequestError");var Ni="Requested resource does not exist",ft=class extends ${constructor(t,n=Ni){super(n,A(t,!1));this.name="NotFoundError";this.code="P5003"}};w(ft,"NotFoundError");var Mi="Unknown server error",kr=class extends ${constructor(t,n,i){super(n||Mi,A(t,!0));this.name="ServerError";this.code="P5006";this.logs=i}};w(kr,"ServerError");var $i="Unauthorized, check your connection string",gt=class extends ${constructor(t,n=$i){super(n,A(t,!1));this.name="UnauthorizedError";this.code="P5007"}};w(gt,"UnauthorizedError");var qi="Usage exceeded, retry again later",ht=class extends ${constructor(t,n=qi){super(n,A(t,!0));this.name="UsageExceededError";this.code="P5008"}};w(ht,"UsageExceededError");async function tm(e){let r;try{r=await e.text()}catch{return{type:"EmptyError"}}try{let t=JSON.parse(r);if(typeof t=="string")switch(t){case"InternalDataProxyError":return{type:"DataProxyError",body:t};default:return{type:"UnknownTextError",body:t}}if(typeof t=="object"&&t!==null){if("is_panic"in t&&"message"in t&&"error_code"in t)return{type:"QueryEngineError",body:t};if("EngineNotStarted"in t||"InteractiveTransactionMisrouted"in t||"InvalidRequestError"in t){let n=Object.values(t)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:t}:{type:"DataProxyError",body:t}}}return{type:"UnknownJsonError",body:t}}catch{return r===""?{type:"EmptyError"}:{type:"UnknownTextError",body:r}}}async function yt(e,r){if(e.ok)return;let t={clientVersion:r,response:e},n=await tm(e);if(n.type==="QueryEngineError")throw new V(n.body.message,{code:n.body.error_code,clientVersion:r});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new kr(t,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new lr(t);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new ct(t);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new ut(t,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new R(i,r,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new lt(t,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 mt(t,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new dt(t,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new gt(t,Dr($i,n));if(e.status===404)return new ft(t,Dr(Ni,n));if(e.status===429)throw new ht(t,Dr(qi,n));if(e.status===504)throw new pt(t,Dr(Fi,n));if(e.status>=500)throw new kr(t,Dr(Mi,n));if(e.status>=400)throw new at(t,Dr(Li,n))}function Dr(e,r){return r.type==="EmptyError"?e:`${e}: ${JSON.stringify(r)}`}function Ra(e){let r=Math.pow(2,e)*50,t=Math.ceil(Math.random()*r)-Math.ceil(r/2),n=r+t;return new Promise(i=>setTimeout(()=>i(n),n))}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Aa(e){let r=new TextEncoder().encode(e),t="",n=r.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,t+=Ne[s]+Ne[a]+Ne[l]+Ne[u];return i==1?(c=r[o],s=(c&252)>>2,a=(c&3)<<4,t+=Ne[s]+Ne[a]+"=="):i==2&&(c=r[o]<<8|r[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,t+=Ne[s]+Ne[a]+Ne[l]+"="),t}function Ia(e){if(!!e.generator?.previewFeatures.some(t=>t.toLowerCase().includes("metrics")))throw new R("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 nm(e){return e[0]*1e3+e[1]/1e6}function _a(e){return new Date(nm(e))}var ka={"@prisma/debug":"workspace:*","@prisma/engines-version":"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Et=class extends se{constructor(t,n){super(`Cannot fetch data from service: -${t}`,A(n,!0));this.name="RequestError";this.code="P5010"}};w(Et,"RequestError");async function ur(e,r,t=n=>n){let n=r.clientVersion;try{return typeof fetch=="function"?await t(fetch)(e,r):await t(ji)(e,r)}catch(i){let o=i.message??"Unknown error";throw new Et(o,{clientVersion:n})}}function om(e){return{...e.headers,"Content-Type":"application/json"}}function sm(e){return{method:e.method,headers:om(e)}}function am(e,r){return{text:()=>Promise.resolve(Buffer.concat(e).toString()),json:()=>Promise.resolve().then(()=>JSON.parse(Buffer.concat(e).toString())),ok:r.statusCode>=200&&r.statusCode<=299,status:r.statusCode,url:r.url,headers:new Vi(r.headers)}}async function ji(e,r={}){let t=lm("https"),n=sm(r),i=[],{origin:o}=new URL(e);return new Promise((s,a)=>{let l=t.request(e,n,u=>{let{statusCode:c,headers:{location:p}}=u;c>=301&&c<=399&&p&&(p.startsWith("http")===!1?s(ji(`${o}${p}`,r)):s(ji(p,r))),u.on("data",m=>i.push(m)),u.on("end",()=>s(am(i,u))),u.on("error",a)});l.on("error",a),l.end(r.body??"")})}var lm=typeof require<"u"?require:()=>{},Vi=class{constructor(r={}){this.headers=new Map;for(let[t,n]of Object.entries(r))if(typeof n=="string")this.headers.set(t,n);else if(Array.isArray(n))for(let i of n)this.headers.set(t,i)}append(r,t){this.headers.set(r,t)}delete(r){this.headers.delete(r)}get(r){return this.headers.get(r)??null}has(r){return this.headers.has(r)}set(r,t){this.headers.set(r,t)}forEach(r,t){for(let[n,i]of this.headers)r.call(t,i,n,this)}};var um=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Da=L("prisma:client:dataproxyEngine");async function cm(e,r){let t=ka["@prisma/engines-version"],n=r.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.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&&um.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=t.split("-")??[],[a,l,u]=s.split("."),c=pm(`<=${a}.${l}.${u}`),p=await ur(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()||""}`);let m=await p.text();Da("length of body fetched from unpkg.com",m.length);let f;try{f=JSON.parse(m)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",m),g}return f.version}throw new ar("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function Oa(e,r){let t=await cm(e,r);return Da("version",t),t}function pm(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var La=3,Bi=L("prisma:client:dataproxyEngine"),Ui=class{constructor({apiKey:r,tracingHelper:t,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=r,this.tracingHelper=t,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:r,interactiveTransaction:t}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=r??this.tracingHelper.getTraceParent()),t&&(n["X-transaction-id"]=t.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let r=[];return this.tracingHelper.isEnabled()&&r.push("tracing"),this.logLevel&&r.push(this.logLevel),this.logQueries&&r.push("query"),r}},bt=class{constructor(r){this.name="DataProxyEngine";Ia(r),this.config=r,this.env={...r.env,...typeof process<"u"?process.env:{}},this.inlineSchema=Aa(r.inlineSchema),this.inlineDatasources=r.inlineDatasources,this.inlineSchemaHash=r.inlineSchemaHash,this.clientVersion=r.clientVersion,this.engineHash=r.engineVersion,this.logEmitter=r.logEmitter,this.tracingHelper=r.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[r,t]=this.extractHostAndApiKey();this.host=r,this.headerBuilder=new Ui({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await Oa(r,this.config),Bi("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(r){r?.logs?.length&&r.logs.forEach(t=>{switch(t.level){case"debug":case"error":case"trace":case"warn":case"info":break;case"query":{let n=typeof t.attributes.query=="string"?t.attributes.query:"";if(!this.tracingHelper.isEnabled()){let[i]=n.split("/* traceparent");n=i}this.logEmitter.emit("query",{query:n,timestamp:_a(t.timestamp),duration:Number(t.attributes.duration_ms),params:t.attributes.params,target:t.attributes.target})}}}),r?.traces?.length&&this.tracingHelper.createEngineSpan({span:!0,spans:r.traces})}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(r){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${r}`}async uploadSchema(){let r={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(r,async()=>{let t=await ur(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});t.ok||Bi("schema response status",t.status);let n=await yt(t,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(r,{traceparent:t,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:r,traceparent:t,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(r,{traceparent:t,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Er(r,n),{batchResult:a,elapsed:l}=await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:t});return a.map(u=>"errors"in u&&u.errors.length>0?or(u.errors[0],this.clientVersion,this.config.activeProvider):{data:u,elapsed:l})}requestInternal({body:r,traceparent:t,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 ur(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t,interactiveTransaction:i}),body:JSON.stringify(r),clientVersion:this.clientVersion},n);a.ok||Bi("graphql response status",a.status),await this.handleError(await yt(a,this.clientVersion));let l=await a.json(),u=l.extensions;if(u&&this.propagateResponseExtensions(u),l.errors)throw l.errors.length===1?or(l.errors[0],this.config.clientVersion,this.config.activeProvider):new B(l.errors,{clientVersion:this.config.clientVersion});return l}})}async transaction(r,t,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[r]} transaction`,callback:async({logHttpCall:o})=>{if(r==="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 ur(a,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await yt(l,this.clientVersion));let u=await l.json(),c=u.extensions;c&&this.propagateResponseExtensions(c);let p=u.id,m=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:m}}}else{let s=`${n.payload.endpoint}/${r}`;o(s);let a=await ur(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),clientVersion:this.clientVersion});await this.handleError(await yt(a,this.clientVersion));let u=(await a.json()).extensions;u&&this.propagateResponseExtensions(u);return}}})}extractHostAndApiKey(){let r={clientVersion:this.clientVersion},t=Object.keys(this.inlineDatasources)[0],n=Ir({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new sr(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:")throw new sr(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r);let l=a.get("api_key");if(l===null||l.length<1)throw new sr(`Error validating datasource \`${t}\`: the URL must contain a valid API key`,r);return[s,l]}metrics(){throw new ar("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(r){for(let t=0;;t++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${t})`,timestamp:new Date,target:""})};try{return await r.callback({logHttpCall:n})}catch(i){if(!(i instanceof se)||!i.isRetryable)throw i;if(t>=La)throw i instanceof _r?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${t+1}/${La} failed for ${r.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await Ra(t);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(r){if(r instanceof lr)throw await this.uploadSchema(),new _r({clientVersion:this.clientVersion,cause:r});if(r)throw r}applyPendingMigrations(){throw new Error("Method not implemented.")}};function Fa(e){if(e?.kind==="itx")return e.options.id}var Gi=k(require("os")),Na=k(require("path"));var Qi=Symbol("PrismaLibraryEngineCache");function mm(){let e=globalThis;return e[Qi]===void 0&&(e[Qi]={}),e[Qi]}function dm(e){let r=mm();if(r[e]!==void 0)return r[e];let t=Na.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=Gi.default.constants.dlopen.RTLD_LAZY|Gi.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,t,i),r[e]=n.exports,n.exports}var Ma={async loadLibrary(e){let r=await Bn(),t=await wa("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>dm(t))}catch(n){let i=ei({e:n,platformInfo:r,id:t});throw new R(i,e.clientVersion)}}};var Ji,$a={async loadLibrary(e){let{clientVersion:r,adapter:t,engineWasm:n}=e;if(t===void 0)throw new R(`The \`adapter\` option for \`PrismaClient\` is required in this context (${fn().prettyName})`,r);if(n===void 0)throw new R("WASM engine was unexpectedly `undefined`",r);Ji===void 0&&(Ji=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new R("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",r);let a={"./query_engine_bg.js":o},l=new WebAssembly.Instance(s,a);return o.__wbg_set_wasm(l.exports),o.QueryEngine})());let i=await Ji;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var fm="P2036",Re=L("prisma:client:libraryEngine");function gm(e){return e.item_type==="query"&&"query"in e}function hm(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var qa=[...Mn,"native"],ja=0,wt=class{constructor(r,t){this.name="LibraryEngine";this.libraryLoader=t??Ma,r.engineWasm!==void 0&&(this.libraryLoader=t??$a),this.config=r,this.libraryStarted=!1,this.logQueries=r.logQueries??!1,this.logLevel=r.logLevel??"error",this.logEmitter=r.logEmitter,this.datamodel=r.inlineSchema,r.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(r.overrideDatasources)[0],i=r.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary(),this.checkForTooManyEngines()}checkForTooManyEngines(){ja===10&&console.warn(`${fe("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(r,t,n){await this.start();let i=JSON.stringify(t),o;if(r==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else r==="commit"?o=await this.engine?.commitTransaction(n.id,i):r==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(ym(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new V(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(Re("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;Nn(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let r=await er();if(!qa.includes(r))throw new R(`Unknown ${ue("PRISMA_QUERY_ENGINE_LIBRARY")} ${ue(H(r))}. Possible binaryTargets: ${Me(qa.join(", "))} or a path to the query engine library. -You may have to run ${Me("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return r}}parseEngineResponse(r){if(!r)throw new B("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(r)}catch{throw new B("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let r=new WeakRef(this),{adapter:t}=this.config;t&&Re("Using driver adapter: %O",t),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{r.deref()?.logger(n)},t),ja++}catch(r){let t=r,n=this.parseInitError(t.message);throw typeof n=="string"?t:new R(n.message,this.config.clientVersion,n.error_code)}}}logger(r){let t=this.parseEngineResponse(r);if(t){if("span"in t){this.config.tracingHelper.createEngineSpan(t);return}t.level=t?.level.toLowerCase()??"unknown",gm(t)?this.logEmitter.emit("query",{timestamp:new Date,query:t.query,params:t.params,duration:Number(t.duration_ms),target:t.module_path}):hm(t)?this.loggerRustPanic=new le(Hi(this,`${t.message}: ${t.reason} in ${t.file}:${t.line}:${t.column}`),this.config.clientVersion):this.logEmitter.emit(t.level,{timestamp:new Date,message:t.message,target:t.module_path})}}parseInitError(r){try{return JSON.parse(r)}catch{}return r}parseRequestError(r){try{return JSON.parse(r)}catch{}return r}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Re(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let r=async()=>{Re("library starting");try{let t={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(t)),this.libraryStarted=!0,Re("library started")}catch(t){let n=this.parseInitError(t.message);throw typeof n=="string"?t:new R(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",r),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Re("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let r=async()=>{await new Promise(n=>setTimeout(n,5)),Re("library stopping");let t={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(t)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,Re("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",r),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(r){return this.library?.debugPanic(r)}async request(r,{traceparent:t,interactiveTransaction:n}){Re(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:t}),o=JSON.stringify(r);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new B(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof R)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new le(Hi(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new B(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(r,{transaction:t,traceparent:n}){Re("requestBatch");let i=Er(r,t);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Fa(t));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new B(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:l}=s;if(Array.isArray(a))return a.map(u=>u.errors&&u.errors.length>0?this.loggerRustPanic??this.buildQueryError(u.errors[0]):{data:u,elapsed:0});throw l&&l.length===1?new Error(l[0].error):new Error(JSON.stringify(s))}buildQueryError(r){if(r.user_facing_error.is_panic)return new le(Hi(this,r.user_facing_error.message),this.config.clientVersion);let t=this.getExternalAdapterError(r.user_facing_error);return t?t.error:or(r,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(r){if(r.error_code===fm&&this.config.adapter){let t=r.meta?.id;jt(typeof t=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(t);return jt(n,"External error with reported id was not registered"),n}}async metrics(r){await this.start();let t=await this.engine.metrics(JSON.stringify(r));return r.format==="prometheus"?t:this.parseEngineResponse(t)}};function ym(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function Hi(e,r){return Sa({binaryTarget:e.binaryTarget,title:r,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function Va({copyEngine:e=!0},r){let t;try{t=Ir({inlineDatasources:r.inlineDatasources,overrideDatasources:r.overrideDatasources,env:{...r.env,...process.env},clientVersion:r.clientVersion})}catch{}e&&t?.startsWith("prisma://")&&Hr("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Ur(r.generator),i=!!(t?.startsWith("prisma://")||!e),o=!!r.adapter,s=n==="library",a=n==="binary";if(i&&o||o&&!1){let l;throw e?t?.startsWith("prisma://")?l=["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."]:l=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:l=["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 W(l.join(` -`),{clientVersion:r.clientVersion})}if(i)return new bt(r);if(s)return new wt(r);throw new W("Invalid client engine type, please use `library` or `binary`",{clientVersion:r.clientVersion})}function bn({generator:e}){return e?.previewFeatures??[]}var Ha=k(Wi());function Ga(e,r){let t=Ja(e),n=Em(t),i=wm(n);i?wn(i,r):r.addErrorMessage(()=>"Unknown error")}function Ja(e){return e.errors.flatMap(r=>r.kind==="Union"?Ja(r):[r])}function Em(e){let r=new Map,t=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){t.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=r.get(i);o?r.set(i,{...n,argument:{...n.argument,typeNames:bm(o.argument.typeNames,n.argument.typeNames)}}):r.set(i,n)}return t.push(...r.values()),t}function bm(e,r){return[...new Set(e.concat(r))]}function wm(e){return mi(e,(r,t)=>{let n=Ua(r),i=Ua(t);return n!==i?n-i:Qa(r)-Qa(t)})}function Ua(e){let r=0;return Array.isArray(e.selectionPath)&&(r+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(r+=e.argumentPath.length),r}function Qa(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var me=class{constructor(r,t){this.name=r;this.value=t;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(r){let{colors:{green:t}}=r.context;r.addMarginSymbol(t(this.isRequired?"+":"?")),r.write(t(this.name)),this.isRequired||r.write(t("?")),r.write(t(": ")),typeof this.value=="string"?r.write(t(this.value)):r.write(this.value)}};var xn=class{constructor(){this.fields=[]}addField(r,t){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${r}: ${t}`))).addMarginSymbol(i(o("+")))}}),this}write(r){let{colors:{green:t}}=r.context;r.writeLine(t("{")).withIndent(()=>{r.writeJoined(Cr,this.fields).newLine()}).write(t("}")).addMarginSymbol(t("+"))}};function wn(e,r){switch(e.kind){case"MutuallyExclusiveFields":xm(e,r);break;case"IncludeOnScalar":Pm(e,r);break;case"EmptySelection":vm(e,r);break;case"UnknownSelectionField":Sm(e,r);break;case"UnknownArgument":Rm(e,r);break;case"UnknownInputField":Am(e,r);break;case"RequiredArgumentMissing":Im(e,r);break;case"InvalidArgumentType":_m(e,r);break;case"InvalidArgumentValue":km(e,r);break;case"ValueTooLarge":Dm(e,r);break;case"SomeFieldsMissing":Om(e,r);break;case"TooManyFieldsGiven":Lm(e,r);break;case"Union":Ga(e,r);break;default:throw new Error("not implemented: "+e.kind)}}function xm(e,r){let t=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();t&&(t.getField(e.firstField)?.markAsError(),t.getField(e.secondField)?.markAsError()),r.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Pm(e,r){let[t,n]=Pn(e.selectionPath),i=e.outputType,o=r.arguments.getDeepSelectionParent(t)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new me(s.name,"true"));r.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${xt(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function vm(e,r){let t=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(t){let n=t.getField("omit")?.value.asObject();if(n){Tm(e,r,n);return}}Cm(e,r)}function Tm(e,r,t){t.removeAllFields();for(let n of e.outputType.fields)t.addSuggestion(new me(n.name,"false"));r.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Cm(e,r){let t=e.outputType,n=r.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Ya(n,t)),r.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(t.name)} must not be empty. ${xt(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(t.name)} needs ${o.bold("at least one truthy value")}.`)}function Sm(e,r){let[t,n]=Pn(e.selectionPath),i=r.arguments.getDeepSubSelectionValue(t)?.asObject(),o;if(i){let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),l=i.getFieldValue("omit")?.asObject();s?.hasField(n)?(o="select",s.getField(n)?.markAsError(),Ya(s,e.outputType)):a?.hasField(n)?(o="include",a.getField(n)?.markAsError(),Fm(a,e.outputType)):l?.hasField(n)&&(o="omit",l.getField(n)?.markAsError(),Nm(l,e.outputType))}r.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(xt(s)),a.join(" ")})}function Rm(e,r){let t=e.argumentPath[0],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(t)?.markAsError(),Mm(n,e.arguments)),r.addErrorMessage(i=>Wa(i,t,e.arguments.map(o=>o.name)))}function Am(e,r){let[t,n]=Pn(e.argumentPath),i=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(t)?.asObject();o&&za(o,e.inputType)}r.addErrorMessage(o=>Wa(o,n,e.inputType.fields.map(s=>s.name)))}function Wa(e,r,t){let n=[`Unknown argument \`${e.red(r)}\`.`],i=qm(r,t);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),t.length>0&&n.push(xt(e)),n.join(" ")}function Im(e,r){let t;r.addErrorMessage(l=>t?.value instanceof J&&t.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Pn(e.argumentPath),s=new xn,a=n.getDeepFieldValue(i)?.asObject();if(a)if(t=a.getField(o),t&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new me(o,s).makeRequired())}else{let l=e.inputTypes.map(Ka).join(" | ");a.addSuggestion(new me(o,l).makeRequired())}}function Ka(e){return e.kind==="list"?`${Ka(e.elementType)}[]`:e.name}function _m(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),r.addErrorMessage(i=>{let o=vn("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(t)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function km(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),r.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(t)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=vn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Dm(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof J&&(i=s.text)}r.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(t)}\``),s.join(" ")})}function Om(e,r){let t=e.argumentPath[e.argumentPath.length-1],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&za(i,e.inputType)}r.addErrorMessage(i=>{let o=[`Argument \`${i.bold(t)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${vn("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(xt(i)),o.join(" ")})}function Lm(e,r){let t=e.argumentPath[e.argumentPath.length-1],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}r.addErrorMessage(o=>{let s=[`Argument \`${o.bold(t)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${vn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Ya(e,r){for(let t of r.fields)e.hasField(t.name)||e.addSuggestion(new me(t.name,"true"))}function Fm(e,r){for(let t of r.fields)t.isRelation&&!e.hasField(t.name)&&e.addSuggestion(new me(t.name,"true"))}function Nm(e,r){for(let t of r.fields)!e.hasField(t.name)&&!t.isRelation&&e.addSuggestion(new me(t.name,"true"))}function Mm(e,r){for(let t of r)e.hasField(t.name)||e.addSuggestion(new me(t.name,t.typeNames.join(" | ")))}function za(e,r){if(r.kind==="object")for(let t of r.fields)e.hasField(t.name)||e.addSuggestion(new me(t.name,t.typeNames.join(" | ")))}function Pn(e){let r=[...e],t=r.pop();if(!t)throw new Error("unexpected empty path");return[r,t]}function xt({green:e,enabled:r}){return"Available options are "+(r?`listed in ${e("green")}`:"marked with ?")+"."}function vn(e,r){if(r.length===1)return r[0];let t=[...r],n=t.pop();return`${t.join(", ")} ${e} ${n}`}var $m=3;function qm(e,r){let t=1/0,n;for(let i of r){let o=(0,Ha.default)(e,i);o>$m||o({name:r.name,typeName:"boolean",isRelation:r.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(r){return this.params.previewFeatures.includes(r)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(r){return this.model?.fields.find(t=>t.name===r)}nestSelection(r){let t=this.findField(r),n=t?.kind==="object"?t.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(r)})}nestArgument(r){return new e({...this.params,argumentPath:this.params.argumentPath.concat(r)})}};var rl=e=>({command:e});var tl=e=>e.strings.reduce((r,t,n)=>`${r}@P${n}${t}`);function Pt(e){try{return nl(e,"fast")}catch{return nl(e,"slow")}}function nl(e,r){return JSON.stringify(e.map(t=>Km(t,r)))}function Km(e,r){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:wr(e)?{prisma__type:"date",prisma__value:e.toJSON()}:Te.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Ym(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")}:typeof e=="object"&&r==="slow"?ol(e):e}function Ym(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function ol(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(il);let r={};for(let t of Object.keys(e))r[t]=il(e[t]);return r}function il(e){return typeof e=="bigint"?e.toString():ol(e)}var zm=/^(\s*alter\s)/i,sl=L("prisma:client");function zi(e,r,t,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&t.length>0&&zm.exec(r))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var Zi=({clientMethod:e,activeProvider:r})=>t=>{let n="",i;if(Array.isArray(t)){let[o,...s]=t;n=o,i={values:Pt(s||[]),__prismaRawParameters__:!0}}else switch(r){case"sqlite":case"mysql":{n=t.sql,i={values:Pt(t.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=t.text,i={values:Pt(t.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=tl(t),i={values:Pt(t.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${r} provider does not support ${e}`)}return i?.values?sl(`prisma.${e}(${n}, ${i.values})`):sl(`prisma.${e}(${n})`),{query:n,parameters:i}},al={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[r,...t]=e;return new ie(r,t)}},ll={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function Xi(e){return function(t){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??(n=ul(t(o))):ul(t(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function ul(e){return typeof e.then=="function"?e:Promise.resolve(e)}var cl={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,r){return r()}},eo=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(r){return this.getGlobalTracingHelper().getTraceParent(r)}createEngineSpan(r){return this.getGlobalTracingHelper().createEngineSpan(r)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(r,t){return this.getGlobalTracingHelper().runInChildSpan(r,t)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??cl}};function pl(e){return e.includes("tracing")?new eo:cl}function ml(e,r=()=>{}){let t,n=new Promise(i=>t=i);return{then(i){return--e===0&&t(r()),i?.(n)}}}var Zm=["$connect","$disconnect","$on","$transaction","$use","$extends"],dl=Zm;function fl(e){return typeof e=="string"?e:e.reduce((r,t)=>{let n=typeof t=="string"?t:t.level;return n==="query"?r:r&&(t==="info"||r==="info")?"info":n},void 0)}var Cn=class{constructor(){this._middlewares=[]}use(r){this._middlewares.push(r)}get(r){return this._middlewares[r]}has(r){return!!this._middlewares[r]}length(){return this._middlewares.length}};var hl=k(ui());function Sn(e){return typeof e.batchRequestIdx=="number"}function Rn(e){return e===null?e:Array.isArray(e)?e.map(Rn):typeof e=="object"?Xm(e)?ed(e):gr(e,Rn):e}function Xm(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function ed({$type:e,value:r}){switch(e){case"BigInt":return BigInt(r);case"Bytes":return Buffer.from(r,"base64");case"DateTime":return new Date(r);case"Decimal":return new Te(r);case"Json":return JSON.parse(r);default:rr(r,"Unknown tagged value")}}function gl(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let r=[];return e.modelName&&r.push(e.modelName),e.query.arguments&&r.push(ro(e.query.arguments)),r.push(ro(e.query.selection)),r.join("")}function ro(e){return`(${Object.keys(e).sort().map(t=>{let n=e[t];return typeof n=="object"&&n!==null?`(${t} ${ro(n)})`:t}).join(" ")})`}var rd={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function to(e){return rd[e]}var An=class{constructor(r){this.options=r;this.tickActive=!1;this.batches={}}request(r){let t=this.options.batchBy(r);return t?(this.batches[t]||(this.batches[t]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[t].push({request:r,resolve:n,reject:i})})):this.options.singleLoader(r)}dispatchBatches(){for(let r in this.batches){let t=this.batches[r];delete this.batches[r],t.length===1?this.options.singleLoader(t[0].request).then(n=>{n instanceof Error?t[0].reject(n):t[0].resolve(n)}).catch(n=>{t[0].reject(n)}):(t.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(t.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(p=>p.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(p=>to(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:nd(o),containsWrite:u,customDataProxyFetch:i})).map((p,m)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[m],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?yl(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:to(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:gl(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(r){try{return await this.dataloader.request(r)}catch(t){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=r;this.handleAndLogRequestError({error:t,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:r,unpacker:t},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,r,t);return process.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(r){try{this.handleRequestError(r)}catch(t){throw this.logEmitter&&this.logEmitter.emit("error",{message:t.message,target:r.clientMethod,timestamp:new Date}),t}}handleRequestError({error:r,clientMethod:t,callsite:n,transaction:i,args:o,modelName:s}){if(td(r),id(r,i)||r instanceof Oe)throw r;if(r instanceof V&&od(r)){let l=El(r.meta);Tn({args:o,errors:[l],callsite:n,errorFormat:this.client._errorFormat,originalMethod:t,clientVersion:this.client._clientVersion})}let a=r.message;if(n&&(a=Ar({callsite:n,originalMethod:t,isPanic:r.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),r.code){let l=s?{modelName:s,...r.meta}:r.meta;throw new V(a,{code:r.code,clientVersion:this.client._clientVersion,meta:l,batchRequestIdx:r.batchRequestIdx})}else{if(r.isPanic)throw new le(a,this.client._clientVersion);if(r instanceof B)throw new B(a,{clientVersion:this.client._clientVersion,batchRequestIdx:r.batchRequestIdx});if(r instanceof R)throw new R(a,this.client._clientVersion);if(r instanceof le)throw new le(a,this.client._clientVersion)}throw r.clientVersion=this.client._clientVersion,r}sanitizeMessage(r){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,hl.default)(r):r}unpack(r,t,n){if(!r||(r.data&&(r=r.data),!r))return r;let i=Object.values(r)[0],o=t.filter(a=>a!=="select"&&a!=="include"),s=Rn(Ii(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function nd(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:yl(e)};rr(e,"Unknown transaction kind")}}function yl(e){return{id:e.id,payload:e.payload}}function id(e,r){return Sn(e)&&r?.kind==="batch"&&e.batchRequestIdx!==r.index}function od(e){return e.code==="P2009"||e.code==="P2012"}function El(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(El)};if(Array.isArray(e.selectionPath)){let[,...r]=e.selectionPath;return{...e,selectionPath:r}}return e}var bl="5.14.0";var wl=bl;function xl(e){return e.map(r=>{let t={};for(let n of Object.keys(r))t[n]=Pl(r[n]);return t})}function Pl({prisma__type:e,prisma__value:r}){switch(e){case"bigint":return BigInt(r);case"bytes":return Buffer.from(r,"base64");case"decimal":return new Te(r);case"datetime":case"date":return new Date(r);case"time":return new Date(`1970-01-01T${r}Z`);case"array":return r.map(Pl);default:return r}}var Sl=k(Wi());var q=class extends Error{constructor(r){super(r+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};w(q,"PrismaClientConstructorValidationError");var vl=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Tl=["pretty","colorless","minimal"],Cl=["info","query","warn","error"],ad={datasources:(e,{datasourceNames:r})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[t,n]of Object.entries(e)){if(!r.includes(t)){let i=Or(t,r)||` Available datasources: ${r.join(", ")}`;throw new q(`Unknown datasource ${t} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new q(`Invalid value ${JSON.stringify(o)} for datasource "${t}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,r)=>{if(e===null)return;if(e===void 0)throw new q('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!bn(r).includes("driverAdapters"))throw new q('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Ur()==="binary")throw new q('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Tl.includes(e)){let r=Or(e,Tl);throw new q(`Invalid errorFormat ${e} provided to PrismaClient constructor.${r}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function r(t){if(typeof t=="string"&&!Cl.includes(t)){let n=Or(t,Cl);throw new q(`Invalid log level "${t}" provided to PrismaClient constructor.${n}`)}}for(let t of e){r(t);let n={level:r,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Or(i,o);throw new q(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(t&&typeof t=="object")for(let[i,o]of Object.entries(t))if(n[i])n[i](o);else throw new q(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let r=e.maxWait;if(r!=null&&r<=0)throw new q(`Invalid value ${r} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let t=e.timeout;if(t!=null&&t<=0)throw new q(`Invalid value ${t} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let r=["debug","engine","configOverride"];if(typeof e!="object")throw new q(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[t]of Object.entries(e))if(!r.includes(t)){let n=Or(t,r);throw new q(`Invalid property ${JSON.stringify(t)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Rl(e,r){for(let[t,n]of Object.entries(e)){if(!vl.includes(t)){let i=Or(t,vl);throw new q(`Unknown property ${t} provided to PrismaClient constructor.${i}`)}ad[t](n,r)}if(e.datasourceUrl&&e.datasources)throw new q('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Or(e,r){if(r.length===0||typeof e!="string")return"";let t=ld(e,r);return t?` Did you mean "${t}"?`:""}function ld(e,r){if(r.length===0)return null;let t=r.map(i=>({value:i,distance:(0,Sl.default)(e,i)}));t.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?t(i):r(n)))},l=u=>{o||(o=!0,t(u))};for(let u=0;u{n[u]=c,a()},c=>{if(!Sn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var Ye=L("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var ud={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},cd=Symbol.for("prisma.client.transaction.id"),pd={id:0,nextId(){return++this.id}};function Ll(e){class r{constructor(n){this._originalClient=this;this._middlewares=new Cn;this._createPrismaPromise=Xi();this.$extends=Ks;e=n?.__internal?.configOverride?.(e)??e,ma(e),n&&Rl(n,e);let i=n?.adapter?yi(n.adapter):void 0,o=new Dl.EventEmitter().on("error",()=>{});this._extensions=dn.empty(),this._previewFeatures=bn(e),this._clientVersion=e.clientVersion??wl,this._activeProvider=e.activeProvider,this._tracingHelper=pl(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&vt.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&vt.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=!i&&Br(s,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&L.enable("prisma:client");let p=vt.default.resolve(e.dirname,e.relativePath);Ol.default.existsSync(p)||(p=e.dirname),Ye("dirname",e.dirname),Ye("relativePath",e.relativePath),Ye("cwd",p);let m=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:process.env.NODE_ENV==="production"?this._errorFormat="minimal":process.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:m.allowTriggerPanic,datamodelPath:vt.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:m.binaryPath??void 0,engineEndpoint:m.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&fl(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(f=>typeof f=="string"?f==="query":f.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:da(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Ir,getBatchRequestPayload:Er,prismaGraphQLToJSError:or,PrismaClientUnknownRequestError:B,PrismaClientInitializationError:R,PrismaClientKnownRequestError:V,debug:L("prisma:client:accelerateEngine"),engineVersion:_l.version,clientVersion:e.clientVersion}},Ye("clientVersion",e.clientVersion),this._engine=Va(e,this._engineConfig),this._requestHandler=new In(this,o),l.log)for(let f of l.log){let g=typeof f=="string"?f:f.emit==="stdout"?f.level:null;g&&this.$on(g,h=>{Jr.log(`${Jr.tags[g]??""}`,h.message||h.query)})}this._metrics=new hr(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=it(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{ho()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Zi({clientMethod:i,activeProvider:a}),callsite:He(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Il(n,i);return zi(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new W("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(zi(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new W(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:rl,callsite:He(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:Zi({clientMethod:i,activeProvider:a}),callsite:He(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(xl)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Il(n,i));throw new W("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=pd.nextId(),s=ml(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let c=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return Al(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return it(Pe(Ws(this),[te("_appliedParent",()=>this._appliedParent._createItxClient(n)),te("_createPrismaPromise",()=>Xi(n)),te(cd,()=>n.id),yr(dl)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??ud,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,I=>c(u,T=>(I?.end(),l(T))));let{runInTransaction:p,args:m,...f}=u,g={...n,...f};m&&(g.args=i.middlewareArgsToRequestArgs(m)),n.transaction!==void 0&&p===!1&&delete g.transaction;let h=await ta(this,g);return g.model?Zs({result:h,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):h};return this._tracingHelper.runInChildSpan(s.operation,()=>new kl.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:m,customDataProxyFetch:f}){try{n=u?u(n):n;let g={name:"serialize"},h=this._tracingHelper.runInChildSpan(g,()=>Za({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return L.enabled("prisma:client")&&(Ye("Prisma Client call:"),Ye(`prisma.${i}(${_s(n)})`),Ye("Generated request:"),Ye(JSON.stringify(h,null,2)+` -`)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:h,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:c,unpacker:p,otelParentCtx:m,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:f})}catch(g){throw g.clientVersion=this._clientVersion,g}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new W("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return r}function Il(e,r){return md(e)?[new ie(e,r),al]:[e,ll]}function md(e){return Array.isArray(e)&&Array.isArray(e.raw)}var dd=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Fl(e){return new Proxy(e,{get(r,t){if(t in r)return r[t];if(!dd.has(t))throw new TypeError(`Invalid enum value: ${String(t)}`)}})}function Nl(e){Br(e,{conflictCheck:"warn"})}0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -/*! Bundled license information: - -decimal.js/decimal.mjs: - (*! - * decimal.js v10.4.3 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2022 Michael Mclaughlin - * MIT Licence - *) -*/ -//# sourceMappingURL=library.js.map diff --git a/integration-tests/tests/prisma/sqlite/client/runtime/react-native.js b/integration-tests/tests/prisma/sqlite/client/runtime/react-native.js deleted file mode 100644 index a800dbe8b..000000000 --- a/integration-tests/tests/prisma/sqlite/client/runtime/react-native.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict";var ea=Object.create;var Qt=Object.defineProperty;var ta=Object.getOwnPropertyDescriptor;var ra=Object.getOwnPropertyNames;var na=Object.getPrototypeOf,ia=Object.prototype.hasOwnProperty;var Se=(e,t)=>()=>(e&&(t=e(e=0)),t);var ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ye=(e,t)=>{for(var r in t)Qt(e,r,{get:t[r],enumerable:!0})},jn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ra(t))!ia.call(e,i)&&i!==r&&Qt(e,i,{get:()=>t[i],enumerable:!(n=ta(t,i))||n.enumerable});return e};var fe=(e,t,r)=>(r=e!=null?ea(na(e)):{},jn(t||!e||!e.__esModule?Qt(r,"default",{value:e,enumerable:!0}):r,e)),Dr=e=>jn(Qt({},"__esModule",{value:!0}),e);var y,c=Se(()=>{"use strict";y={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var x,p=Se(()=>{"use strict";x=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var E,f=Se(()=>{"use strict";E=()=>{};E.prototype=E});var b,d=Se(()=>{"use strict";b=class{constructor(t){this.value=t}deref(){return this.value}}});var oi=ce(tt=>{"use strict";m();c();p();f();d();var Jn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),oa=Jn(e=>{"use strict";e.byteLength=l,e.toByteArray=g,e.fromByteArray=R;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(o=0,s=i.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var F=C.indexOf("=");F===-1&&(F=A);var L=F===A?0:4-F%4;return[F,L]}function l(C){var A=a(C),F=A[0],L=A[1];return(F+L)*3/4-L}function u(C,A,F){return(A+F)*3/4-F}function g(C){var A,F=a(C),L=F[0],N=F[1],M=new n(u(C,L,N)),k=0,z=N>0?L-4:L,j;for(j=0;j>16&255,M[k++]=A>>8&255,M[k++]=A&255;return N===2&&(A=r[C.charCodeAt(j)]<<2|r[C.charCodeAt(j+1)]>>4,M[k++]=A&255),N===1&&(A=r[C.charCodeAt(j)]<<10|r[C.charCodeAt(j+1)]<<4|r[C.charCodeAt(j+2)]>>2,M[k++]=A>>8&255,M[k++]=A&255),M}function h(C){return t[C>>18&63]+t[C>>12&63]+t[C>>6&63]+t[C&63]}function v(C,A,F){for(var L,N=[],M=A;Mz?z:k+M));return L===1?(A=C[F-1],N.push(t[A>>2]+t[A<<4&63]+"==")):L===2&&(A=(C[F-2]<<8)+C[F-1],N.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),N.join("")}}),sa=Jn(e=>{e.read=function(t,r,n,i,o){var s,a,l=o*8-i-1,u=(1<>1,h=-7,v=n?o-1:0,R=n?-1:1,C=t[r+v];for(v+=R,s=C&(1<<-h)-1,C>>=-h,h+=l;h>0;s=s*256+t[r+v],v+=R,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=a*256+t[r+v],v+=R,h-=8);if(s===0)s=1-g;else{if(s===u)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-g}return(C?-1:1)*a*Math.pow(2,s-i)},e.write=function(t,r,n,i,o,s){var a,l,u,g=s*8-o-1,h=(1<>1,R=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=i?0:s-1,A=i?1:-1,F=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=h):(a=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+v>=1?r+=R/u:r+=R*Math.pow(2,1-v),r*u>=2&&(a++,u/=2),a+v>=h?(l=0,a=h):a+v>=1?(l=(r*u-1)*Math.pow(2,o),a=a+v):(l=r*Math.pow(2,v-1)*Math.pow(2,o),a=0));o>=8;t[n+C]=l&255,C+=A,l/=256,o-=8);for(a=a<0;t[n+C]=a&255,C+=A,a/=256,g-=8);t[n+C-A]|=F*128}}),Br=oa(),Xe=sa(),Un=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;tt.Buffer=T;tt.SlowBuffer=fa;tt.INSPECT_MAX_BYTES=50;var Jt=2147483647;tt.kMaxLength=Jt;T.TYPED_ARRAY_SUPPORT=aa();!T.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function aa(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(T.prototype,"parent",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.buffer}});Object.defineProperty(T.prototype,"offset",{enumerable:!0,get:function(){if(T.isBuffer(this))return this.byteOffset}});function Re(e){if(e>Jt)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,T.prototype),t}function T(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ur(e)}return Wn(e,t,r)}T.poolSize=8192;function Wn(e,t,r){if(typeof e=="string")return ua(e,t);if(ArrayBuffer.isView(e))return ca(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(ye(e,ArrayBuffer)||e&&ye(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ye(e,SharedArrayBuffer)||e&&ye(e.buffer,SharedArrayBuffer)))return Hn(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return T.from(n,t,r);let i=pa(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return T.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}T.from=function(e,t,r){return Wn(e,t,r)};Object.setPrototypeOf(T.prototype,Uint8Array.prototype);Object.setPrototypeOf(T,Uint8Array);function Gn(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function la(e,t,r){return Gn(e),e<=0?Re(e):t!==void 0?typeof r=="string"?Re(e).fill(t,r):Re(e).fill(t):Re(e)}T.alloc=function(e,t,r){return la(e,t,r)};function Ur(e){return Gn(e),Re(e<0?0:qr(e)|0)}T.allocUnsafe=function(e){return Ur(e)};T.allocUnsafeSlow=function(e){return Ur(e)};function ua(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!T.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=Kn(e,t)|0,n=Re(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function $r(e){let t=e.length<0?0:qr(e.length)|0,r=Re(t);for(let n=0;n=Jt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Jt.toString(16)+" bytes");return e|0}function fa(e){return+e!=e&&(e=0),T.alloc(+e)}T.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==T.prototype};T.compare=function(e,t){if(ye(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),ye(t,Uint8Array)&&(t=T.from(t,t.offset,t.byteLength)),!T.isBuffer(e)||!T.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);in.length?(T.isBuffer(o)||(o=T.from(o)),o.copy(n,i)):Uint8Array.prototype.set.call(n,o,i);else if(T.isBuffer(o))o.copy(n,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return n};function Kn(e,t){if(T.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ye(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return jr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ii(e).length;default:if(i)return n?-1:jr(e).length;t=(""+t).toLowerCase(),i=!0}}T.byteLength=Kn;function da(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Pa(this,t,r);case"utf8":case"utf-8":return Yn(this,t,r);case"ascii":return xa(this,t,r);case"latin1":case"binary":return va(this,t,r);case"base64":return ba(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ta(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}T.prototype._isBuffer=!0;function qe(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}T.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(e+=" ... "),""};Un&&(T.prototype[Un]=T.prototype.inspect);T.prototype.compare=function(e,t,r,n,i){if(ye(e,Uint8Array)&&(e=T.from(e,e.offset,e.byteLength)),!T.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),n===void 0&&(n=0),i===void 0&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let g=0;g2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Qr(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=T.from(t,n)),T.isBuffer(t))return t.length===0?-1:qn(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):qn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function qn(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function l(g,h){return o===1?g[h]:g.readUInt16BE(h*o)}let u;if(i){let g=-1;for(u=r;us&&(r=s-a),u=r;u>=0;u--){let g=!0;for(let h=0;hi&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,n===void 0&&(n="utf8")):(n=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((r===void 0||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return ma(this,e,t,r);case"utf8":case"utf-8":return ga(this,e,t,r);case"ascii":case"latin1":case"binary":return ha(this,e,t,r);case"base64":return ya(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wa(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};T.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ba(e,t,r){return t===0&&r===e.length?Br.fromByteArray(e):Br.fromByteArray(e.slice(t,r))}function Yn(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,u,g,h;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[i+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(s=h));break;case 3:l=e[i+1],u=e[i+2],(l&192)===128&&(u&192)===128&&(h=(o&15)<<12|(l&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:l=e[i+1],u=e[i+2],g=e[i+3],(l&192)===128&&(u&192)===128&&(g&192)===128&&(h=(o&15)<<18|(l&63)<<12|(u&63)<<6|g&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Ea(n)}var Vn=4096;function Ea(e){let t=e.length;if(t<=Vn)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn)&&(r=n);let i="";for(let o=t;or&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),tr)throw new RangeError("Trying to access beyond buffer length")}T.prototype.readUintLE=T.prototype.readUIntLE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n};T.prototype.readUint8=T.prototype.readUInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]};T.prototype.readUint16LE=T.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]|this[e+1]<<8};T.prototype.readUint16BE=T.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||W(e,2,this.length),this[e]<<8|this[e+1]};T.prototype.readUint32LE=T.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};T.prototype.readUint32BE=T.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};T.prototype.readBigUInt64LE=_e(function(e){e=e>>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(n)+(BigInt(i)<>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(n)<>>0,t=t>>>0,r||W(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n};T.prototype.readIntBE=function(e,t,r){e=e>>>0,t=t>>>0,r||W(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};T.prototype.readInt8=function(e,t){return e=e>>>0,t||W(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};T.prototype.readInt16LE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};T.prototype.readInt16BE=function(e,t){e=e>>>0,t||W(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};T.prototype.readInt32LE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};T.prototype.readInt32BE=function(e,t){return e=e>>>0,t||W(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};T.prototype.readBigInt64LE=_e(function(e){e=e>>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(n)<>>0,et(e,"offset");let t=this[e],r=this[e+7];(t===void 0||r===void 0)&&yt(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,t||W(e,4,this.length),Xe.read(this,e,!0,23,4)};T.prototype.readFloatBE=function(e,t){return e=e>>>0,t||W(e,4,this.length),Xe.read(this,e,!1,23,4)};T.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||W(e,8,this.length),Xe.read(this,e,!0,52,8)};T.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||W(e,8,this.length),Xe.read(this,e,!1,52,8)};function oe(e,t,r,n,i,o){if(!T.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}T.prototype.writeUintLE=T.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;oe(this,e,t,r,s,0)}let i=1,o=0;for(this[t]=e&255;++o>>0,r=r>>>0,!n){let s=Math.pow(2,8*r)-1;oe(this,e,t,r,s,0)}let i=r-1,o=1;for(this[t+i]=e&255;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r};T.prototype.writeUint8=T.prototype.writeUInt8=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,1,255,0),this[t]=e&255,t+1};T.prototype.writeUint16LE=T.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeUint16BE=T.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeUint32LE=T.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};T.prototype.writeUint32BE=T.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function Zn(e,t,r,n,i){ni(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function Xn(e,t,r,n,i){ni(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}T.prototype.writeBigUInt64LE=_e(function(e,t=0){return Zn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeBigUInt64BE=_e(function(e,t=0){return Xn(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});T.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);oe(this,e,t,r,a-1,-a)}let i=0,o=1,s=0;for(this[t]=e&255;++i>0)-s&255;return t+r};T.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t=t>>>0,!n){let a=Math.pow(2,8*r-1);oe(this,e,t,r,a-1,-a)}let i=r-1,o=1,s=0;for(this[t+i]=e&255;--i>=0&&(o*=256);)e<0&&s===0&&this[t+i+1]!==0&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r};T.prototype.writeInt8=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};T.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};T.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};T.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};T.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t>>>0,r||oe(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};T.prototype.writeBigInt64LE=_e(function(e,t=0){return Zn(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});T.prototype.writeBigInt64BE=_e(function(e,t=0){return Xn(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ei(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ti(e,t,r,n,i){return t=+t,r=r>>>0,i||ei(e,t,r,4,34028234663852886e22,-34028234663852886e22),Xe.write(e,t,r,n,23,4),r+4}T.prototype.writeFloatLE=function(e,t,r){return ti(this,e,t,!0,r)};T.prototype.writeFloatBE=function(e,t,r){return ti(this,e,t,!1,r)};function ri(e,t,r,n,i){return t=+t,r=r>>>0,i||ei(e,t,r,8,17976931348623157e292,-17976931348623157e292),Xe.write(e,t,r,n,52,8),r+8}T.prototype.writeDoubleLE=function(e,t,r){return ri(this,e,t,!0,r)};T.prototype.writeDoubleBE=function(e,t,r){return ri(this,e,t,!1,r)};T.prototype.copy=function(e,t,r,n){if(!T.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let i;if(typeof e=="number")for(i=t;i2**32?i=Qn(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Qn(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Qn(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Ca(e,t,r){et(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&yt(t,e.length-(r+1))}function ni(e,t,r,n,i,o){if(e>r||e3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new Ze.ERR_OUT_OF_RANGE("value",a,e)}Ca(n,i,o)}function et(e,t){if(typeof e!="number")throw new Ze.ERR_INVALID_ARG_TYPE(t,"number",e)}function yt(e,t,r){throw Math.floor(e)!==e?(et(e,r),new Ze.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new Ze.ERR_BUFFER_OUT_OF_BOUNDS:new Ze.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Aa=/[^+/0-9A-Za-z-_]/g;function Sa(e){if(e=e.split("=")[0],e=e.trim().replace(Aa,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function jr(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Ra(e){let t=[];for(let r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function ii(e){return Br.toByteArray(Sa(e))}function Wt(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ye(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Qr(e){return e!==e}var Oa=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function _e(e){return typeof BigInt>"u"?Fa:e}function Fa(){throw new Error("BigInt not supported")}});var w,m=Se(()=>{"use strict";w=fe(oi())});function Ma(){return!1}var _a,La,Gt,Gr=Se(()=>{"use strict";m();c();p();f();d();_a={},La={existsSync:Ma,promises:_a},Gt=La});var gi=ce((gf,mi)=>{"use strict";m();c();p();f();d();mi.exports=(zr(),Dr(Kr)).format});var Kr={};Ye(Kr,{default:()=>Xa,deprecate:()=>yi,format:()=>bi,inspect:()=>wi,promisify:()=>hi});function hi(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function yi(e,t){return(...r)=>(console.warn(t),e(...r))}function wi(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var bi,Za,Xa,zr=Se(()=>{"use strict";m();c();p();f();d();bi=gi(),Za={promisify:hi,deprecate:yi,inspect:wi,format:bi},Xa=Za});function il(...e){return e.join("/")}function ol(...e){return e.join("/")}var Ti,sl,al,we,en=Se(()=>{"use strict";m();c();p();f();d();Ti="/",sl={sep:Ti},al={resolve:il,posix:sl,join:ol,sep:Ti},we=al});var Ci=ce(()=>{"use strict";m();c();p();f();d()});var Ri=ce((fd,Si)=>{"use strict";m();c();p();f();d();Si.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Oi=ce((wd,ki)=>{"use strict";m();c();p();f();d();var ul=Ri();ki.exports=e=>{let t=ul(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}});var Kt,Fi=Se(()=>{"use strict";m();c();p();f();d();Kt=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var _i=ce((Yd,Mi)=>{"use strict";m();c();p();f();d();Mi.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 Ni=ce((um,Ii)=>{"use strict";m();c();p();f();d();Ii.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 nn=ce((gm,Di)=>{"use strict";m();c();p();f();d();var ml=Ni();Di.exports=e=>typeof e=="string"?e.replace(ml(),""):e});var Bi=ce((_m,Yt)=>{"use strict";m();c();p();f();d();Yt.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()};Yt.exports.default=Yt.exports});var qi=ce((ky,wl)=>{wl.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Vi=ce(()=>{"use strict";m();c();p();f();d()});var Fn=ce((cA,ls)=>{"use strict";m();c();p();f();d();ls.exports=function(){function e(t,r,n,i,o){return tn?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;sZr,Decimal:()=>ve,Extensions:()=>Jr,MetricsClient:()=>nt,NotFoundError:()=>Oe,PrismaClientInitializationError:()=>V,PrismaClientKnownRequestError:()=>G,PrismaClientRustPanicError:()=>ue,PrismaClientUnknownRequestError:()=>H,PrismaClientValidationError:()=>Y,Public:()=>Wr,Sql:()=>se,defineDmmfProperty:()=>Ui,empty:()=>Ji,getPrismaClient:()=>Ys,getRuntime:()=>Zo,join:()=>Qi,makeStrictEnum:()=>Zs,objectEnumValues:()=>Xt,raw:()=>dn,sqltag:()=>mn,warnEnvConflicts:()=>void 0,warnOnce:()=>St});module.exports=Dr(fp);m();c();p();f();d();var Jr={};Ye(Jr,{defineExtension:()=>si,getExtensionContext:()=>ai});m();c();p();f();d();m();c();p();f();d();function si(e){return typeof e=="function"?e:t=>t.$extends(e)}m();c();p();f();d();function ai(e){return e}var Wr={};Ye(Wr,{validator:()=>li});m();c();p();f();d();m();c();p();f();d();function li(...e){return t=>t}m();c();p();f();d();m();c();p();f();d();var Ht={};Ye(Ht,{$:()=>di,bgBlack:()=>Qa,bgBlue:()=>Ha,bgCyan:()=>za,bgGreen:()=>Wa,bgMagenta:()=>Ka,bgRed:()=>Ja,bgWhite:()=>Ya,bgYellow:()=>Ga,black:()=>ja,blue:()=>Je,bold:()=>de,cyan:()=>ke,dim:()=>wt,gray:()=>xt,green:()=>Et,grey:()=>Va,hidden:()=>Ba,inverse:()=>Da,italic:()=>Na,magenta:()=>Ua,red:()=>Ve,reset:()=>Ia,strikethrough:()=>$a,underline:()=>bt,white:()=>qa,yellow:()=>Qe});m();c();p();f();d();var Hr,ui,ci,pi,fi=!0;typeof y<"u"&&({FORCE_COLOR:Hr,NODE_DISABLE_COLORS:ui,NO_COLOR:ci,TERM:pi}=y.env||{},fi=y.stdout&&y.stdout.isTTY);var di={enabled:!ui&&ci==null&&pi!=="dumb"&&(Hr!=null&&Hr!=="0"||fi)};function U(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!di.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Ia=U(0,0),de=U(1,22),wt=U(2,22),Na=U(3,23),bt=U(4,24),Da=U(7,27),Ba=U(8,28),$a=U(9,29),ja=U(30,39),Ve=U(31,39),Et=U(32,39),Qe=U(33,39),Je=U(34,39),Ua=U(35,39),ke=U(36,39),qa=U(37,39),xt=U(90,39),Va=U(90,39),Qa=U(40,49),Ja=U(41,49),Wa=U(42,49),Ga=U(43,49),Ha=U(44,49),Ka=U(45,49),za=U(46,49),Ya=U(47,49);m();c();p();f();d();var el=100,Ei=["green","yellow","blue","magenta","cyan","red"],vt=[],xi=Date.now(),tl=0,Yr=typeof y<"u"?y.env:{};globalThis.DEBUG??=Yr.DEBUG??"";globalThis.DEBUG_COLORS??=Yr.DEBUG_COLORS?Yr.DEBUG_COLORS==="true":!0;var Pt={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,i;typeof require=="function"&&typeof y<"u"&&typeof y.stderr<"u"&&typeof y.stderr.write=="function"?i=(...o)=>{try{let s=(zr(),Dr(Kr));y.stderr.write(s.format(...o)+` -`)}catch{i=console.warn??console.log}}:i=console.warn??console.log,i(`${t} ${r}`,...n)},formatters:{}};function rl(e){let t={color:Ei[tl++%Ei.length],enabled:Pt.enabled(e),namespace:e,log:Pt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&vt.push([o,...n]),vt.length>el&&vt.shift(),Pt.enabled(o)||i){let l=n.map(g=>typeof g=="string"?g:nl(g)),u=`+${Date.now()-xi}ms`;xi=Date.now(),globalThis.DEBUG_COLORS?a(Ht[s](de(o)),...l,Ht[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Zr=new Proxy(rl,{get:(e,t)=>Pt[t],set:(e,t,r)=>Pt[t]=r});function nl(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function vi(e=7500){let t=vt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(` -`);return t.length{let e;(k=>(k.findUnique="findUnique",k.findUniqueOrThrow="findUniqueOrThrow",k.findFirst="findFirst",k.findFirstOrThrow="findFirstOrThrow",k.findMany="findMany",k.create="create",k.createMany="createMany",k.createManyAndReturn="createManyAndReturn",k.update="update",k.updateMany="updateMany",k.upsert="upsert",k.delete="delete",k.deleteMany="deleteMany",k.groupBy="groupBy",k.count="count",k.aggregate="aggregate",k.findRaw="findRaw",k.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Le||={});m();c();p();f();d();en();function tn(e){return we.sep===we.posix.sep?e:e.split(we.sep).join(we.posix.sep)}var At={};Ye(At,{error:()=>fl,info:()=>pl,log:()=>cl,query:()=>dl,should:()=>Li,tags:()=>Ct,warn:()=>rn});m();c();p();f();d();var Ct={error:Ve("prisma:error"),warn:Qe("prisma:warn"),info:ke("prisma:info"),query:Je("prisma:query")},Li={warn:()=>!y.env.PRISMA_DISABLE_WARNINGS};function cl(...e){console.log(...e)}function rn(e,...t){Li.warn()&&console.warn(`${Ct.warn} ${e}`,...t)}function pl(e,...t){console.info(`${Ct.info} ${e}`,...t)}function fl(e,...t){console.error(`${Ct.error} ${e}`,...t)}function dl(e,...t){console.log(`${Ct.query} ${e}`,...t)}m();c();p();f();d();function zt(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}m();c();p();f();d();function We(e,t){throw new Error(t)}m();c();p();f();d();function on(e,t){return Object.prototype.hasOwnProperty.call(e,t)}m();c();p();f();d();var sn=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});m();c();p();f();d();function rt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}m();c();p();f();d();function an(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{$i.has(e)||($i.add(e),rn(t,...r))};m();c();p();f();d();var G=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};re(G,"PrismaClientKnownRequestError");var Oe=class extends G{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};re(Oe,"NotFoundError");m();c();p();f();d();var V=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};re(V,"PrismaClientInitializationError");m();c();p();f();d();var ue=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};re(ue,"PrismaClientRustPanicError");m();c();p();f();d();var H=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};re(H,"PrismaClientUnknownRequestError");m();c();p();f();d();var Y=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};re(Y,"PrismaClientValidationError");m();c();p();f();d();var nt=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};m();c();p();f();d();m();c();p();f();d();function Rt(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Ui(e,t){let r=Rt(()=>gl(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function gl(e){return{datamodel:{models:ln(e.models),enums:ln(e.enums),types:ln(e.types)}}}function ln(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}m();c();p();f();d();var Zt=Symbol(),un=new WeakMap,Fe=class{constructor(t){t===Zt?un.set(this,`Prisma.${this._getName()}`):un.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return un.get(this)}},kt=class extends Fe{_getNamespace(){return"NullTypes"}},Ot=class extends kt{};cn(Ot,"DbNull");var Ft=class extends kt{};cn(Ft,"JsonNull");var Mt=class extends kt{};cn(Mt,"AnyNull");var Xt={classes:{DbNull:Ot,JsonNull:Ft,AnyNull:Mt},instances:{DbNull:new Ot(Zt),JsonNull:new Ft(Zt),AnyNull:new Mt(Zt)}};function cn(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();function _t(e){return{ok:!1,error:e,map(){return _t(e)},flatMap(){return _t(e)}}}var pn=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},fn=e=>{let t=new pn,r=Ge(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Ge(t,e.queryRaw.bind(e)),executeRaw:Ge(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>hl(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=yl(t,e.getConnectionInfo.bind(e))),n},hl=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Ge(e,t.queryRaw.bind(t)),executeRaw:Ge(e,t.executeRaw.bind(t)),commit:Ge(e,t.commit.bind(t)),rollback:Ge(e,t.rollback.bind(t))});function Ge(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}function yl(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return _t({kind:"GenericJs",id:i})}}}var zs=fe(qi());var wk=fe(Vi());Fi();Gr();en();m();c();p();f();d();var se=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}m();c();p();f();d();m();c();p();f();d();var er={enumerable:!0,configurable:!0,writable:!0};function tr(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>er,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Wi=Symbol.for("nodejs.util.inspect.custom");function Ee(e,t){let r=bl(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Gi(Reflect.ownKeys(o),r),a=Gi(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let l=r.get(s);return l?l.getPropertyDescriptor?{...er,...l?.getPropertyDescriptor(s)}:er:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[Wi]=function(){let o={...this};return delete o[Wi],o},i}function bl(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Gi(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}m();c();p();f();d();function it(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}m();c();p();f();d();function rr(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}m();c();p();f();d();m();c();p();f();d();var ot=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};m();c();p();f();d();m();c();p();f();d();function Hi(e){return e.substring(0,1).toLowerCase()+e.substring(1)}m();c();p();f();d();function st(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function nr(e){return e.toString()!=="Invalid Date"}m();c();p();f();d();m();c();p();f();d();var at=9e15,Be=1e9,gn="0123456789abcdef",or="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",sr="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",hn={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-at,maxE:at,crypto:!1},Zi,Me,I=!0,lr="[DecimalError] ",De=lr+"Invalid argument: ",Xi=lr+"Precision limit exceeded",eo=lr+"crypto unavailable",to="[object Decimal]",te=Math.floor,J=Math.pow,El=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,xl=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,vl=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ro=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,_=7,Pl=9007199254740991,Tl=or.length-1,yn=sr.length-1,S={toStringTag:to};S.absoluteValue=S.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),O(e)};S.ceil=function(){return O(new this.constructor(this),this.e+1,2)};S.clampedTo=S.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(De+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};S.comparedTo=S.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=na[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};S.cosine=S.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+_,n.rounding=1,r=Cl(n,ao(n,r)),n.precision=e,n.rounding=t,O(Me==2||Me==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};S.cubeRoot=S.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,g=this,h=g.constructor;if(!g.isFinite()||g.isZero())return new h(g);for(I=!1,o=g.s*J(g.s*g,1/3),!o||Math.abs(o)==1/0?(r=Z(g.d),e=g.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=J(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new h(r),n.s=g.s):n=new h(o.toString()),s=(e=h.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(g),n=$(u.plus(g).times(a),u.plus(l),s+2,1),Z(a.d).slice(0,s)===(r=Z(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(O(a,e+1,0),a.times(a).times(a).eq(g))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(O(n,e+1,1),t=!n.times(n).times(n).eq(g));break}return I=!0,O(n,e,h.rounding,t)};S.decimalPlaces=S.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-te(this.e/_))*_,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};S.dividedBy=S.div=function(e){return $(this,new this.constructor(e))};S.dividedToIntegerBy=S.divToInt=function(e){var t=this,r=t.constructor;return O($(t,new r(e),0,1,1),r.precision,r.rounding)};S.equals=S.eq=function(e){return this.cmp(e)===0};S.floor=function(){return O(new this.constructor(this),this.e+1,3)};S.greaterThan=S.gt=function(e){return this.cmp(e)>0};S.greaterThanOrEqualTo=S.gte=function(e){var t=this.cmp(e);return t==1||t===0};S.hyperbolicCosine=S.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/cr(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=lt(s,1,o.times(t),new s(1),!0);for(var l,u=e,g=new s(8);u--;)l=o.times(o),o=a.minus(l.times(g.minus(l.times(g))));return O(o,s.precision=r,s.rounding=n,!0)};S.hyperbolicSine=S.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=lt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/cr(5,e)),i=lt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,O(i,t,r,!0)};S.hyperbolicTangent=S.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,$(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};S.inverseCosine=S.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,o=r.rounding;return n!==-1?n===0?t.isNeg()?me(r,i,o):new r(0):new r(NaN):t.isZero()?me(r,i+4,o).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=me(r,i+4,o).times(.5),r.precision=i,r.rounding=o,e.minus(t))};S.inverseHyperbolicCosine=S.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,I=!1,r=r.times(r).minus(1).sqrt().plus(r),I=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};S.inverseHyperbolicSine=S.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,I=!1,r=r.times(r).plus(1).sqrt().plus(r),I=!0,n.precision=e,n.rounding=t,r.ln())};S.inverseHyperbolicTangent=S.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?O(new o(i),e,t,!0):(o.precision=r=n-i.e,i=$(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};S.inverseSine=S.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=me(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};S.inverseTangent=S.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding;if(u.isFinite()){if(u.isZero())return new g(u);if(u.abs().eq(1)&&h+4<=yn)return s=me(g,h+4,v).times(.25),s.s=u.s,s}else{if(!u.s)return new g(NaN);if(h+4<=yn)return s=me(g,h+4,v).times(.5),s.s=u.s,s}for(g.precision=a=h+10,g.rounding=1,r=Math.min(28,a/_+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(I=!1,t=Math.ceil(a/_),n=1,l=u.times(u),s=new g(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<this.d.length-2};S.isNaN=function(){return!this.s};S.isNegative=S.isNeg=function(){return this.s<0};S.isPositive=S.isPos=function(){return this.s>0};S.isZero=function(){return!!this.d&&this.d[0]===0};S.lessThan=S.lt=function(e){return this.cmp(e)<0};S.lessThanOrEqualTo=S.lte=function(e){return this.cmp(e)<1};S.logarithm=S.log=function(e){var t,r,n,i,o,s,a,l,u=this,g=u.constructor,h=g.precision,v=g.rounding,R=5;if(e==null)e=new g(10),t=!0;else{if(e=new g(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new g(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new g(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(I=!1,a=h+R,s=Ne(u,a),n=t?ar(g,a+10):Ne(e,a),l=$(s,n,a,1),It(l.d,i=h,v))do if(a+=10,s=Ne(u,a),n=t?ar(g,a+10):Ne(e,a),l=$(s,n,a,1),!o){+Z(l.d).slice(i+1,i+15)+1==1e14&&(l=O(l,h+1,0));break}while(It(l.d,i+=10,v));return I=!0,O(l,h,v)};S.minus=S.sub=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,R=this,C=R.constructor;if(e=new C(e),!R.d||!e.d)return!R.s||!e.s?e=new C(NaN):R.d?e.s=-e.s:e=new C(e.d||R.s!==e.s?R:NaN),e;if(R.s!=e.s)return e.s=-e.s,R.plus(e);if(u=R.d,v=e.d,a=C.precision,l=C.rounding,!u[0]||!v[0]){if(v[0])e.s=-e.s;else if(u[0])e=new C(R);else return new C(l===3?-0:0);return I?O(e,a,l):e}if(r=te(e.e/_),g=te(R.e/_),u=u.slice(),o=g-r,o){for(h=o<0,h?(t=u,o=-o,s=v.length):(t=v,r=g,s=u.length),n=Math.max(Math.ceil(a/_),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=v.length,h=n0;--n)u[s++]=0;for(n=v.length;n>o;){if(u[--n]s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=g.length,s-i<0&&(i=s,r=g,g=u,u=r),t=0;i;)t=(u[--i]=u[i]+g[i]+t)/ge|0,u[i]%=ge;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=ur(u,n),I?O(e,a,l):e};S.precision=S.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(De+e);return r.d?(t=no(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};S.round=function(){var e=this,t=e.constructor;return O(new t(e),e.e+1,t.rounding)};S.sine=S.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+_,n.rounding=1,r=Sl(n,ao(n,r)),n.precision=e,n.rounding=t,O(Me>2?r.neg():r,e,t,!0)):new n(NaN)};S.squareRoot=S.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,g=s.constructor;if(u!==1||!a||!a[0])return new g(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(I=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=Z(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=te((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new g(t)):n=new g(u.toString()),r=(l=g.precision)+3;;)if(o=n,n=o.plus($(s,o,r+2,1)).times(.5),Z(o.d).slice(0,r)===(t=Z(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(O(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(O(n,l+1,1),e=!n.times(n).eq(s));break}return I=!0,O(n,l,g.rounding,e)};S.tangent=S.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=$(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,O(Me==2||Me==4?r.neg():r,e,t,!0)):new n(NaN)};S.times=S.mul=function(e){var t,r,n,i,o,s,a,l,u,g=this,h=g.constructor,v=g.d,R=(e=new h(e)).d;if(e.s*=g.s,!v||!v[0]||!R||!R[0])return new h(!e.s||v&&!v[0]&&!R||R&&!R[0]&&!v?NaN:!v||!R?e.s/0:e.s*0);for(r=te(g.e/_)+te(e.e/_),l=v.length,u=R.length,l=0;){for(t=0,i=l+n;i>n;)a=o[i]+R[n]*v[i-n-1]+t,o[i--]=a%ge|0,t=a/ge|0;o[i]=(o[i]+t)%ge|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=ur(o,r),I?O(e,h.precision,h.rounding):e};S.toBinary=function(e,t){return En(this,2,e,t)};S.toDecimalPlaces=S.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ae(e,0,Be),t===void 0?t=n.rounding:ae(t,0,8),O(r,e+r.e+1,t))};S.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,!0):(ae(e,0,Be),t===void 0?t=i.rounding:ae(t,0,8),n=O(new i(n),e+1,t),r=xe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};S.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=xe(i):(ae(e,0,Be),t===void 0?t=o.rounding:ae(t,0,8),n=O(new o(i),e+i.e+1,t),r=xe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};S.toFraction=function(e){var t,r,n,i,o,s,a,l,u,g,h,v,R=this,C=R.d,A=R.constructor;if(!C)return new A(R);if(u=r=new A(1),n=l=new A(0),t=new A(n),o=t.e=no(C)-R.e-1,s=o%_,t.d[0]=J(10,s<0?_+s:s),e==null)e=o>0?t:u;else{if(a=new A(e),!a.isInt()||a.lt(u))throw Error(De+a);e=a.gt(t)?o>0?t:u:a}for(I=!1,a=new A(Z(C)),g=A.precision,A.precision=o=C.length*_*2;h=$(a,t,0,1,1),i=r.plus(h.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(h.times(i)),l=i,i=t,t=a.minus(h.times(i)),a=i;return i=$(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=R.s,v=$(u,n,o,1).minus(R).abs().cmp($(l,r,o,1).minus(R).abs())<1?[u,n]:[l,r],A.precision=g,I=!0,v};S.toHexadecimal=S.toHex=function(e,t){return En(this,16,e,t)};S.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:ae(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(I=!1,r=$(r,e,0,t,1).times(e),I=!0,O(r)):(e.s=r.s,r=e),r};S.toNumber=function(){return+this};S.toOctal=function(e,t){return En(this,8,e,t)};S.toPower=S.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(J(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return O(a,n,o);if(t=te(e.e/_),t>=e.d.length-1&&(r=u<0?-u:u)<=Pl)return i=io(l,a,r,n),e.s<0?new l(1).div(i):O(i,n,o);if(s=a.s,s<0){if(tl.maxE+1||t0?s/0:0):(I=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=wn(e.times(Ne(a,n+r)),n),i.d&&(i=O(i,n+5,1),It(i.d,n,o)&&(t=n+10,i=O(wn(e.times(Ne(a,t+r)),t),t+5,1),+Z(i.d).slice(n+1,n+15)+1==1e14&&(i=O(i,n+1,0)))),i.s=s,I=!0,l.rounding=o,O(i,n,o))};S.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=xe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ae(e,1,Be),t===void 0?t=i.rounding:ae(t,0,8),n=O(new i(n),e,t),r=xe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};S.toSignificantDigits=S.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ae(e,1,Be),t===void 0?t=n.rounding:ae(t,0,8)),O(new n(r),e,t)};S.toString=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};S.truncated=S.trunc=function(){return O(new this.constructor(this),this.e+1,1)};S.valueOf=S.toJSON=function(){var e=this,t=e.constructor,r=xe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function Z(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;tr)throw Error(De+e)}function It(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=_,i=0):(i=Math.ceil((t+1)/_),t%=_),o=J(10,_-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==J(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==J(10,t-3)-1,s}function ir(e,t,r){for(var n,i=[0],o,s=0,a=e.length;sr-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Cl(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/cr(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=lt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var $=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;ai[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,s,a,l){var u,g,h,v,R,C,A,F,L,N,M,k,z,j,ht,Q,ie,Ae,X,ze,Vt=n.constructor,Nr=n.s==i.s?1:-1,ee=n.d,B=i.d;if(!ee||!ee[0]||!B||!B[0])return new Vt(!n.s||!i.s||(ee?B&&ee[0]==B[0]:!B)?NaN:ee&&ee[0]==0||!B?Nr*0:Nr/0);for(l?(R=1,g=n.e-i.e):(l=ge,R=_,g=te(n.e/R)-te(i.e/R)),X=B.length,ie=ee.length,L=new Vt(Nr),N=L.d=[],h=0;B[h]==(ee[h]||0);h++);if(B[h]>(ee[h]||0)&&g--,o==null?(j=o=Vt.precision,s=Vt.rounding):a?j=o+(n.e-i.e)+1:j=o,j<0)N.push(1),C=!0;else{if(j=j/R+2|0,h=0,X==1){for(v=0,B=B[0],j++;(h1&&(B=e(B,v,l),ee=e(ee,v,l),X=B.length,ie=ee.length),Q=X,M=ee.slice(0,X),k=M.length;k=l/2&&++Ae;do v=0,u=t(B,M,X,k),u<0?(z=M[0],X!=k&&(z=z*l+(M[1]||0)),v=z/Ae|0,v>1?(v>=l&&(v=l-1),A=e(B,v,l),F=A.length,k=M.length,u=t(A,M,F,k),u==1&&(v--,r(A,X=10;v/=10)h++;L.e=h+g*R-1,O(L,a?o+L.e+1:o,s,C)}return L}}();function O(e,t,r,n){var i,o,s,a,l,u,g,h,v,R=e.constructor;e:if(t!=null){if(h=e.d,!h)return e;for(i=1,a=h[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=_,s=t,g=h[v=0],l=g/J(10,i-s-1)%10|0;else if(v=Math.ceil((o+1)/_),a=h.length,v>=a)if(n){for(;a++<=v;)h.push(0);g=l=0,i=1,o%=_,s=o-_+1}else break e;else{for(g=a=h[v],i=1;a>=10;a/=10)i++;o%=_,s=o-_+i,l=s<0?0:g/J(10,i-s-1)%10|0}if(n=n||t<0||h[v+1]!==void 0||(s<0?g:g%J(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?g/J(10,i-s):0:h[v-1])%10&1||r==(e.s<0?8:7)),t<1||!h[0])return h.length=0,u?(t-=e.e+1,h[0]=J(10,(_-t%_)%_),e.e=-t||0):h[0]=e.e=0,e;if(o==0?(h.length=v,a=1,v--):(h.length=v+1,a=J(10,_-o),h[v]=s>0?(g/J(10,i-s)%J(10,s)|0)*a:0),u)for(;;)if(v==0){for(o=1,s=h[0];s>=10;s/=10)o++;for(s=h[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,h[0]==ge&&(h[0]=1));break}else{if(h[v]+=a,h[v]!=ge)break;h[v--]=0,a=1}for(o=h.length;h[--o]===0;)h.pop()}return I&&(e.e>R.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Ie(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Ie(-i-1)+o,r&&(n=r-s)>0&&(o+=Ie(n))):i>=s?(o+=Ie(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+Ie(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=Ie(n))),o}function ur(e,t){var r=e[0];for(t*=_;r>=10;r/=10)t++;return t}function ar(e,t,r){if(t>Tl)throw I=!0,r&&(e.precision=r),Error(Xi);return O(new e(or),t,1,!0)}function me(e,t,r){if(t>yn)throw Error(Xi);return O(new e(sr),t,r,!0)}function no(e){var t=e.length-1,r=t*_+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Ie(e){for(var t="";e--;)t+="0";return t}function io(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/_+4);for(I=!1;;){if(r%2&&(o=o.times(t),zi(o.d,s)&&(i=!0)),r=te(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),zi(t.d,s)}return I=!0,o}function Ki(e){return e.d[e.d.length-1]&1}function oo(e,t,r){for(var n,i=new e(t[0]),o=0;++o17)return new v(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(I=!1,l=C):l=t,a=new v(.03125);e.e>-2;)e=e.times(a),h+=5;for(n=Math.log(J(2,h))/Math.LN10*2+5|0,l+=n,r=o=s=new v(1),v.precision=l;;){if(o=O(o.times(e),l,1),r=r.times(++g),a=s.plus($(o,r,l,1)),Z(a.d).slice(0,l)===Z(s.d).slice(0,l)){for(i=h;i--;)s=O(s.times(s),l,1);if(t==null)if(u<3&&It(s.d,l-n,R,u))v.precision=l+=10,r=o=a=new v(1),g=0,u++;else return O(s,v.precision=C,R,I=!0);else return v.precision=C,s}s=a}}function Ne(e,t){var r,n,i,o,s,a,l,u,g,h,v,R=1,C=10,A=e,F=A.d,L=A.constructor,N=L.rounding,M=L.precision;if(A.s<0||!F||!F[0]||!A.e&&F[0]==1&&F.length==1)return new L(F&&!F[0]?-1/0:A.s!=1?NaN:F?0:A);if(t==null?(I=!1,g=M):g=t,L.precision=g+=C,r=Z(F),n=r.charAt(0),Math.abs(o=A.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)A=A.times(e),r=Z(A.d),n=r.charAt(0),R++;o=A.e,n>1?(A=new L("0."+r),o++):A=new L(n+"."+r.slice(1))}else return u=ar(L,g+2,M).times(o+""),A=Ne(new L(n+"."+r.slice(1)),g-C).plus(u),L.precision=M,t==null?O(A,M,N,I=!0):A;for(h=A,l=s=A=$(A.minus(1),A.plus(1),g,1),v=O(A.times(A),g,1),i=3;;){if(s=O(s.times(v),g,1),u=l.plus($(s,new L(i),g,1)),Z(u.d).slice(0,g)===Z(l.d).slice(0,g))if(l=l.times(2),o!==0&&(l=l.plus(ar(L,g+2,M).times(o+""))),l=$(l,new L(R),g,1),t==null)if(It(l.d,g-C,N,a))L.precision=g+=C,u=s=A=$(h.minus(1),h.plus(1),g,1),v=O(A.times(A),g,1),i=a=1;else return O(l,L.precision=M,N,I=!0);else return L.precision=M,l;l=u,i+=2}}function so(e){return String(e.s*e.s/0)}function bn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%_,r<0&&(n+=_),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ro.test(t))return bn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(xl.test(t))r=16,t=t.toLowerCase();else if(El.test(t))r=2;else if(vl.test(t))r=8;else throw Error(De+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=io(n,new n(r),o,o*2)),u=ir(t,r,ge),g=u.length-1,o=g;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=ur(u,g),e.d=u,I=!1,s&&(e=$(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?J(2,l):Ke.pow(2,l))),I=!0,e)}function Sl(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:lt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/cr(5,r)),t=lt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function lt(e,t,r,n,i){var o,s,a,l,u=1,g=e.precision,h=Math.ceil(g/_);for(I=!1,l=r.times(r),a=new e(n);;){if(s=$(a.times(l),new e(t++*t++),g,1),a=i?n.plus(s):n.minus(s),n=$(s.times(l),new e(t++*t++),g,1),s=a.plus(n),s.d[h]!==void 0){for(o=h;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return I=!0,s.d.length=h+1,s}function cr(e,t){for(var r=e;--t;)r*=e;return r}function ao(e,t){var r,n=t.s<0,i=me(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Me=n?4:1,t;if(r=t.divToInt(i),r.isZero())Me=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Me=Ki(r)?n?2:3:n?4:1,t;Me=Ki(r)?n?1:4:n?3:2}return t.minus(i).abs()}function En(e,t,r,n){var i,o,s,a,l,u,g,h,v,R=e.constructor,C=r!==void 0;if(C?(ae(r,1,Be),n===void 0?n=R.rounding:ae(n,0,8)):(r=R.precision,n=R.rounding),!e.isFinite())g=so(e);else{for(g=xe(e),s=g.indexOf("."),C?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(g=g.replace(".",""),v=new R(1),v.e=g.length-s,v.d=ir(xe(v),10,i),v.e=v.d.length),h=ir(g,10,i),o=l=h.length;h[--l]==0;)h.pop();if(!h[0])g=C?"0p+0":"0";else{if(s<0?o--:(e=new R(e),e.d=h,e.e=o,e=$(e,v,r,n,0,i),h=e.d,o=e.e,u=Zi),s=h[r],a=i/2,u=u||h[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&h[r-1]&1||n===(e.s<0?8:7)),h.length=r,u)for(;++h[--r]>i-1;)h[r]=0,r||(++o,h.unshift(1));for(l=h.length;!h[l-1];--l);for(s=0,g="";s1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)g+="0";for(h=ir(g,i,t),l=h.length;!h[l-1];--l);for(s=1,g="1.";sl)for(o-=l;o--;)g+="0";else ot)return e.length=t,!0}function Rl(e){return new this(e).abs()}function kl(e){return new this(e).acos()}function Ol(e){return new this(e).acosh()}function Fl(e,t){return new this(e).plus(t)}function Ml(e){return new this(e).asin()}function _l(e){return new this(e).asinh()}function Ll(e){return new this(e).atan()}function Il(e){return new this(e).atanh()}function Nl(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=me(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?me(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=me(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan($(e,t,o,1)),t=me(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan($(e,t,o,1)),r}function Dl(e){return new this(e).cbrt()}function Bl(e){return O(e=new this(e),e.e+1,2)}function $l(e,t,r){return new this(e).clamp(t,r)}function jl(e){if(!e||typeof e!="object")throw Error(lr+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Be,"rounding",0,8,"toExpNeg",-at,0,"toExpPos",0,at,"maxE",0,at,"minE",-at,0,"modulo",0,9];for(t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(De+r+": "+n);if(r="crypto",i&&(this[r]=hn[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(eo);else this[r]=!1;else throw Error(De+r+": "+n);return this}function Ul(e){return new this(e).cos()}function ql(e){return new this(e).cosh()}function lo(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,Yi(o)){u.s=o.s,I?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e=10;a/=10)s++;I?s>i.maxE?(u.e=NaN,u.d=null):s=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(eo);else for(;o=10;i/=10)n++;n<_&&(r-=_-n)}return s.e=r,s.d=a,s}function nu(e){return O(e=new this(e),e.e+1,this.rounding)}function iu(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function ou(e){return new this(e).sin()}function su(e){return new this(e).sinh()}function au(e){return new this(e).sqrt()}function lu(e,t){return new this(e).sub(t)}function uu(){var e=0,t=arguments,r=new this(t[e]);for(I=!1;r.s&&++e`}};function ct(e){return e instanceof Nt}m();c();p();f();d();m();c();p();f();d();var pr=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};m();c();p();f();d();var fr=e=>e,dr={bold:fr,red:fr,green:fr,dim:fr,enabled:!1},uo={bold:de,red:Ve,green:Et,dim:wt,enabled:!0},pt={write(e){e.writeLine(",")}};m();c();p();f();d();var Pe=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};m();c();p();f();d();var $e=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var ft=class extends $e{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new pr(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new Pe("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(pt,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};m();c();p();f();d();var co=": ",mr=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+co.length}write(t){let r=new Pe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(co).write(this.value)}};m();c();p();f();d();var gr=class e extends $e{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let l;if(s.value instanceof e?l=s.value.getField(a):s.value instanceof ft&&(l=s.value.getField(Number(a))),!l)return;s=l}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new Pe("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(pt,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};m();c();p();f();d();var K=class extends $e{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Pe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var xn=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function hr(e){return new xn(po(e))}function po(e){let t=new gr;for(let[r,n]of Object.entries(e)){let i=new mr(r,fo(n));t.addField(i)}return t}function fo(e){if(typeof e=="string")return new K(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new K(String(e));if(typeof e=="bigint")return new K(`${e}n`);if(e===null)return new K("null");if(e===void 0)return new K("undefined");if(ut(e))return new K(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return w.Buffer.isBuffer(e)?new K(`Buffer.alloc(${e.byteLength})`):new K(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=nr(e)?e.toISOString():"Invalid Date";return new K(`new Date("${t}")`)}return e instanceof Fe?new K(`Prisma.${e._getName()}`):ct(e)?new K(`prisma.${Hi(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?mu(e):typeof e=="object"?po(e):new K(Object.prototype.toString.call(e))}function mu(e){let t=new ft;for(let r of e)t.addItem(fo(r));return t}function mo(e){if(e===void 0)return"";let t=hr(e);return new ot(0,{colors:dr}).write(t).toString()}m();c();p();f();d();var gu="P2037";function yr({error:e,user_facing_error:t},r,n){return t.error_code?new G(hu(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new H(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function hu(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===gu&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var Dt="";function go(e){var t=e.split(` -`);return t.reduce(function(r,n){var i=bu(n)||xu(n)||Tu(n)||Ru(n)||Au(n);return i&&r.push(i),r},[])}var yu=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,wu=/\((\S*)(?::(\d+))(?::(\d+))\)/;function bu(e){var t=yu.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=wu.exec(t[2]);return n&&i!=null&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{file:r?null:t[2],methodName:t[1]||Dt,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Eu=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function xu(e){var t=Eu.exec(e);return t?{file:t[2],methodName:t[1]||Dt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var vu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Pu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Tu(e){var t=vu.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=Pu.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||Dt,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Cu=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Au(e){var t=Cu.exec(e);return t?{file:t[3],methodName:t[1]||Dt,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Su=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Ru(e){var t=Su.exec(e);return t?{file:t[2],methodName:t[1]||Dt,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var vn=class{getLocation(){return null}},Pn=class{constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=go(t).find(i=>{if(!i.file)return!1;let o=tn(i.file);return o!==""&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.js")&&!o.startsWith("internal/")&&!i.methodName.includes("new ")&&!i.methodName.includes("getCallSite")&&!i.methodName.includes("Proxy.")&&i.methodName.split(".").length<4});return!n||!n.file?null:{fileName:n.file,lineNumber:n.lineNumber,columnNumber:n.column}}};function je(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new vn:new Pn}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var ho={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function dt(e={}){let t=Ou(e);return Object.entries(t).reduce((n,[i,o])=>(ho[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Ou(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function wr(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function yo(e,t){let r=wr(e);return t({action:"aggregate",unpacker:r,argsMapper:dt})(e)}m();c();p();f();d();function Fu(e={}){let{select:t,...r}=e;return typeof t=="object"?dt({...r,_count:t}):dt({...r,_count:{_all:!0}})}function Mu(e={}){return typeof e.select=="object"?t=>wr(e)(t)._count:t=>wr(e)(t)._count._all}function wo(e,t){return t({action:"count",unpacker:Mu(e),argsMapper:Fu})(e)}m();c();p();f();d();function _u(e={}){let t=dt(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function Lu(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function bo(e,t){return t({action:"groupBy",unpacker:Lu(e),argsMapper:_u})(e)}function Eo(e,t,r){if(t==="aggregate")return n=>yo(n,r);if(t==="count")return n=>wo(n,r);if(t==="groupBy")return n=>bo(n,r)}m();c();p();f();d();function xo(e,t){let r=t.fields.filter(i=>!i.relationName),n=sn(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new Nt(e,o,s.type,s.isList,s.kind==="enum")},...tr(Object.keys(n))})}m();c();p();f();d();m();c();p();f();d();var vo=e=>Array.isArray(e)?e:e.split("."),Tn=(e,t)=>vo(t).reduce((r,n)=>r&&r[n],e),Po=(e,t,r)=>vo(t).reduceRight((n,i,o,s)=>Object.assign({},Tn(e,s.slice(0,o)),{[i]:n}),r);function Iu(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Nu(e,t,r){return t===void 0?e??{}:Po(t,r,e||!0)}function Cn(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=je(e._errorFormat),g=Iu(n,i),h=Nu(l,o,g),v=r({dataPath:g,callsite:u})(h),R=Du(e,t);return new Proxy(v,{get(C,A){if(!R.includes(A))return C[A];let L=[a[A].type,r,A],N=[g,h];return Cn(e,...L,...N)},...tr([...R,...Object.getOwnPropertyNames(v)])})}}function Du(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}m();c();p();f();d();m();c();p();f();d();var Ro=fe(_i());m();c();p();f();d();Gr();m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var To={keyword:ke,entity:ke,value:e=>de(Je(e)),punctuation:Je,directive:ke,function:ke,variable:e=>de(Je(e)),string:e=>de(Et(e)),boolean:Qe,number:ke,comment:xt};var Bu=e=>e,br={},$u=0,D={manual:br.Prism&&br.Prism.manual,disableWorkerMessageHandler:br.Prism&&br.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof he){let t=e;return new he(t.type,D.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(D.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(Ae instanceof he)continue;if(z&&Q!=t.length-1){N.lastIndex=ie;var h=N.exec(e);if(!h)break;var g=h.index+(k?h[1].length:0),v=h.index+h[0].length,a=Q,l=ie;for(let B=t.length;a=l&&(++Q,ie=l);if(t[Q]instanceof he)continue;u=a-Q,Ae=e.slice(ie,l),h.index-=ie}else{N.lastIndex=0;var h=N.exec(Ae),u=1}if(!h){if(o)break;continue}k&&(j=h[1]?h[1].length:0);var g=h.index+j,h=h[0].slice(j),v=g+h.length,R=Ae.slice(0,g),C=Ae.slice(v);let X=[Q,u];R&&(++Q,ie+=R.length,X.push(R));let ze=new he(A,M?D.tokenize(h,M):h,ht,h,z);if(X.push(ze),C&&X.push(C),Array.prototype.splice.apply(t,X),u!=1&&D.matchGrammar(e,t,r,Q,ie,!0,A),o)break}}}},tokenize:function(e,t){let r=[e],n=t.rest;if(n){for(let i in n)t[i]=n[i];delete t.rest}return D.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=D.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=D.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:he};D.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/};D.languages.javascript=D.languages.extend("clike",{"class-name":[D.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/});D.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;D.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:D.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:D.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:D.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:D.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});D.languages.markup&&D.languages.markup.tag.addInlined("script","javascript");D.languages.js=D.languages.javascript;D.languages.typescript=D.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/});D.languages.ts=D.languages.typescript;function he(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}he.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return he.stringify(r,t)}).join(""):ju(e.type)(e.content)};function ju(e){return To[e]||Bu}function Co(e){return Uu(e,D.languages.javascript)}function Uu(e,t){return D.tokenize(e,t).map(n=>he.stringify(n)).join("")}m();c();p();f();d();var Ao=fe(Oi());function So(e){return(0,Ao.default)(e)}var Er=class e{static read(t){let r;try{r=Gt.readFileSync(t,"utf-8")}catch{return null}return e.fromContent(r)}static fromContent(t){let r=t.split(/\r?\n/);return new e(1,r)}constructor(t,r){this.firstLineNumber=t,this.lines=r}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(t,r){if(tthis.lines.length+this.firstLineNumber)return this;let n=t-this.firstLineNumber,i=[...this.lines];return i[n]=r(i[n]),new e(this.firstLineNumber,i)}mapLines(t){return new e(this.firstLineNumber,this.lines.map((r,n)=>t(r,this.firstLineNumber+n)))}lineAt(t){return this.lines[t-this.firstLineNumber]}prependSymbolAt(t,r){return this.mapLines((n,i)=>i===t?`${r} ${n}`:` ${n}`)}slice(t,r){let n=this.lines.slice(t-1,r).join(` -`);return new e(t,So(n).split(` -`))}highlight(){let t=Co(this.toString());return new e(this.firstLineNumber,t.split(` -`))}toString(){return this.lines.join(` -`)}};var qu={red:Ve,gray:xt,dim:wt,bold:de,underline:bt,highlightSource:e=>e.highlight()},Vu={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Qu({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Ju({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=Qu({message:t,originalMethod:r,isPanic:n,callArguments:i});if(!e||typeof window<"u"||y.env.NODE_ENV==="production")return s;let a=e.getLocation();if(!a||!a.lineNumber||!a.columnNumber)return s;let l=Math.max(1,a.lineNumber-3),u=Er.read(a.fileName)?.slice(l,a.lineNumber),g=u?.lineAt(a.lineNumber);if(u&&g){let h=Gu(g),v=Wu(g);if(!v)return s;s.functionName=`${v.code})`,s.location=a,n||(u=u.mapLineAt(a.lineNumber,C=>C.slice(0,v.openingBraceIndex))),u=o.highlightSource(u);let R=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((C,A)=>o.gray(String(A).padStart(R))+" "+C).mapLines(C=>o.dim(C)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let C=h+R+1;C+=2,s.callArguments=(0,Ro.default)(i,C).slice(C)}}return s}function Wu(e){let t=Object.keys(Le.ModelAction).join("|"),n=new RegExp(String.raw`\.(${t})\(`).exec(e);if(n){let i=n.index+n[0].length,o=e.lastIndexOf(" ",n.index)+1;return{code:e.slice(o,i),openingBraceIndex:i}}return null}function Gu(e){let t=0;for(let r=0;r{if("rejectOnNotFound"in n.args){let o=mt({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new Y(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof G&&o.code==="P2025"?new Oe(`No ${e} found`,t):o})}}m();c();p();f();d();function Te(e){return e.replace(/^./,t=>t.toLowerCase())}var Yu=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Zu=["aggregate","count","groupBy"];function An(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Xu(e,t),tc(e,t),Lt(r),ne("name",()=>t),ne("$name",()=>t),ne("$parent",()=>e._appliedParent)];return Ee({},n)}function Xu(e,t){let r=Te(t),n=Object.keys(Le.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=l=>e._request(l);s=ko(o,t,e._clientVersion,s);let a=l=>u=>{let g=je(e._errorFormat);return e._createPrismaPromise(h=>{let v={args:u,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:h,callsite:g};return s({...v,...l})})};return Yu.includes(o)?Cn(e,t,a):ec(i)?Eo(e,i,a):a({})}}}function ec(e){return Zu.includes(e)}function tc(e,t){return He(ne("fields",()=>{let r=e._runtimeDataModel.models[t];return xo(t,r)}))}m();c();p();f();d();function Oo(e){return e.replace(/^./,t=>t.toUpperCase())}var Sn=Symbol();function Bt(e){let t=[rc(e),ne(Sn,()=>e),ne("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(Lt(r)),Ee(e,t)}function rc(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Te),n=[...new Set(t.concat(r))];return He({getKeys(){return n},getPropertyValue(i){let o=Oo(i);if(e._runtimeDataModel.models[o]!==void 0)return An(e,o);if(e._runtimeDataModel.models[i]!==void 0)return An(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Fo(e){return e[Sn]?e[Sn]:e}function Mo(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return Bt(t)}m();c();p();f();d();m();c();p();f();d();function _o({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let l of Object.values(o)){if(n){if(n[l.name])continue;let u=l.needs.filter(g=>n[g]);u.length>0&&a.push(it(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(g=>!r[g]);u.length>0&&a.push(it(u))}nc(e,l.needs)&&s.push(ic(l,Ee(e,s)))}return s.length>0||a.length>0?Ee(e,[...s,...a]):e}function nc(e,t){return t.every(r=>on(e,r))}function ic(e,t){return He(ne(e.name,()=>e.compute(t)))}m();c();p();f();d();function xr({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sg.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};t[o]=xr({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Io({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:xr({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(s,a,l)=>_o({result:s,modelName:Te(a),select:l.select,omit:l.omit,extensions:n})})}m();c();p();f();d();m();c();p();f();d();function No(e){if(e instanceof se)return oc(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:No(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=qo(o,l),a.args=s,Bo(e,a,r,n+1)}})})}function $o(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return Bo(e,t,s)}function jo(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?Uo(r,n,0,e):e(r)}}function Uo(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let l=a.customDataProxyFetch;return a.customDataProxyFetch=qo(i,l),Uo(a,t,r+1,n)}})}var Do=e=>e;function qo(e=Do,t=Do){return r=>e(t(r))}m();c();p();f();d();m();c();p();f();d();function Qo(e,t,r){let n=Te(r);return!t.result||!(t.result.$allModels||t.result[n])?e:sc({...e,...Vo(t.name,e,t.result.$allModels),...Vo(t.name,e,t.result[n])})}function sc(e){let t=new be,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return rt(e,n=>({...n,needs:r(n.name,new Set)}))}function Vo(e,t,r){return r?rt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:ac(t,o,i)})):{}}function ac(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Jo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function Wo(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var vr=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new be;this.modelExtensionsCache=new be;this.queryCallbacksCache=new be;this.clientExtensions=Rt(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=Rt(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Qo(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Te(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Pr=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new vr(t))}isEmpty(){return this.head===void 0}append(t){return new e(new vr(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};m();c();p();f();d();var Go=le("prisma:client"),Ho={Vercel:"vercel","Netlify CI":"netlify"};function Ko({postinstall:e,ciName:t,clientVersion:r}){if(Go("checkPlatformCaching:postinstall",e),Go("checkPlatformCaching:ciName",t),e===!0&&t&&t in Ho){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${Ho[t]}-build`;throw console.error(n),new V(n,r)}}m();c();p();f();d();function zo(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var lc="Cloudflare-Workers",uc="node";function Yo(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===lc?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===uc?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var cc={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Zo(){let e=Yo();return{id:e,prettyName:cc[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}m();c();p();f();d();m();c();p();f();d();var Rn=fe(nn());m();c();p();f();d();function Xo(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}m();c();p();f();d();function es(e){return e.split(` -`).map(t=>t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/,"").replace(/\+\d+\s*ms$/,"")).join(` -`)}m();c();p();f();d();var pc=fe(Ci()),ts=fe(Bi());function rs({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,ts.default)({user:t,repo:r,template:n,title:e,body:i})}function ns({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=vi(6e3-(s?.length??0)),l=es((0,Rn.default)(a)),u=n?`# Description -\`\`\` -${n} -\`\`\``:"",g=(0,Rn.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report: -## Versions - -| Name | Version | -|-----------------|--------------------| -| Node | ${y.version?.padEnd(19)}| -| OS | ${t?.padEnd(19)}| -| Prisma Client | ${e?.padEnd(19)}| -| Query Engine | ${i?.padEnd(19)}| -| Database | ${o?.padEnd(19)}| - -${u} - -## Logs -\`\`\` -${l} -\`\`\` - -## Client Snippet -\`\`\`ts -// PLEASE FILL YOUR CODE SNIPPET HERE -\`\`\` - -## Schema -\`\`\`prisma -// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE -\`\`\` - -## Prisma Engine Query -\`\`\` -${s?Xo(s):""} -\`\`\` -`),h=rs({title:r,body:g});return`${r} - -This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic. - -${bt(h)} - -If you want the Prisma team to look into it, please open the link above \u{1F64F} -To increase the chance of success, please post your schema and a snippet of -how you used Prisma Client in the issue. -`}m();c();p();f();d();function Tr({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 V(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new V("error: Missing URL environment variable, value, or override.",n);return i}m();c();p();f();d();m();c();p();f();d();function is(e){if(e?.kind==="itx")return e.options.id}m();c();p();f();d();var kn=class{constructor(t,r,n){this.engineObject=__PrismaProxy.create({datamodel:t.datamodel,env:y.env,ignoreEnvVarErrors:!0,datasourceOverrides:t.datasourceOverrides??{},logLevel:t.logLevel,logQueries:t.logQueries??!1,logCallback:r})}async connect(t){return __PrismaProxy.connect(this.engineObject,t)}async disconnect(t){return __PrismaProxy.disconnect(this.engineObject,t)}query(t,r,n){return __PrismaProxy.execute(this.engineObject,t,r,n)}sdlSchema(){return Promise.resolve("{}")}dmmf(t){return Promise.resolve("{}")}async startTransaction(t,r){return __PrismaProxy.startTransaction(this.engineObject,t,r)}async commitTransaction(t,r){return __PrismaProxy.commitTransaction(this.engineObject,t,r)}async rollbackTransaction(t,r){return __PrismaProxy.rollbackTransaction(this.engineObject,t,r)}metrics(t){return Promise.resolve("{}")}async applyPendingMigrations(){return __PrismaProxy.applyPendingMigrations(this.engineObject)}},os={async loadLibrary(e){if(!__PrismaProxy)throw new V("__PrismaProxy not detected make sure React Native bindings are installed",e.clientVersion);return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:kn}}};var fc="P2036",Ce=le("prisma:client:libraryEngine");function dc(e){return e.item_type==="query"&&"query"in e}function mc(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var RC=[...Xr,"native"],ss=0,jt=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=os,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary(),this.checkForTooManyEngines()}checkForTooManyEngines(){ss===10&&console.warn(`${Qe("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async applyPendingMigrations(){await this.start(),await this.engine?.applyPendingMigrations()}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(gc(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new G(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(Ce("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new H("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new H("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new b(this),{adapter:r}=this.config;r&&Ce("Using driver adapter: %O",r),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:y.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{t.deref()?.logger(n)},r),ss++}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new V(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);if(r){if("span"in r){this.config.tracingHelper.createEngineSpan(r);return}r.level=r?.level.toLowerCase()??"unknown",dc(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):mc(r)?this.loggerRustPanic=new ue(On(this,`${r.message}: ${r.reason} in ${r.file}:${r.line}:${r.column}`),this.config.clientVersion):this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path})}}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Ce(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{Ce("library starting");try{let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,Ce("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new V(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Ce("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),Ce("library stopping");let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,Ce("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){Ce(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new H(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof V)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new ue(On(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new H(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){Ce("requestBatch");let i=rr(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),is(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new H(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:l}=s;if(Array.isArray(a))return a.map(u=>u.errors&&u.errors.length>0?this.loggerRustPanic??this.buildQueryError(u.errors[0]):{data:u,elapsed:0});throw l&&l.length===1?new Error(l[0].error):new Error(JSON.stringify(s))}buildQueryError(t){if(t.user_facing_error.is_panic)return new ue(On(this,t.user_facing_error.message),this.config.clientVersion);let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:yr(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===fc&&this.config.adapter){let r=t.meta?.id;zt(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return zt(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function gc(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function On(e,t){return ns({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function as({copyEngine:e=!0},t){let r;try{r=Tr({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...y.env},clientVersion:t.clientVersion})}catch{}e&&r?.startsWith("prisma://")&&St("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=Tt(t.generator),i=!!(r?.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o&&!1){let l;throw e?r?.startsWith("prisma://")?l=["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."]:l=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:l=["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(l.join(` -`),{clientVersion:t.clientVersion})}return new jt(t)}m();c();p();f();d();function Cr({generator:e}){return e?.previewFeatures??[]}m();c();p();f();d();m();c();p();f();d();m();c();p();f();d();var ds=fe(Fn());m();c();p();f();d();function ps(e,t){let r=fs(e),n=hc(r),i=wc(n);i?Ar(i,t):t.addErrorMessage(()=>"Unknown error")}function fs(e){return e.errors.flatMap(t=>t.kind==="Union"?fs(t):[t])}function hc(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:yc(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function yc(e,t){return[...new Set(e.concat(t))]}function wc(e){return an(e,(t,r)=>{let n=us(t),i=us(r);return n!==i?n-i:cs(t)-cs(r)})}function us(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function cs(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}m();c();p();f();d();var pe=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};m();c();p();f();d();var Sr=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(pt,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function Ar(e,t){switch(e.kind){case"MutuallyExclusiveFields":bc(e,t);break;case"IncludeOnScalar":Ec(e,t);break;case"EmptySelection":xc(e,t);break;case"UnknownSelectionField":Tc(e,t);break;case"UnknownArgument":Cc(e,t);break;case"UnknownInputField":Ac(e,t);break;case"RequiredArgumentMissing":Sc(e,t);break;case"InvalidArgumentType":Rc(e,t);break;case"InvalidArgumentValue":kc(e,t);break;case"ValueTooLarge":Oc(e,t);break;case"SomeFieldsMissing":Fc(e,t);break;case"TooManyFieldsGiven":Mc(e,t);break;case"Union":ps(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function bc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function Ec(e,t){let[r,n]=Rr(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new pe(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${Ut(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function xc(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(r){let n=r.getField("omit")?.value.asObject();if(n){vc(e,t,n);return}}Pc(e,t)}function vc(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new pe(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function Pc(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),hs(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${Ut(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Tc(e,t){let[r,n]=Rr(e.selectionPath),i=t.arguments.getDeepSubSelectionValue(r)?.asObject(),o;if(i){let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),l=i.getFieldValue("omit")?.asObject();s?.hasField(n)?(o="select",s.getField(n)?.markAsError(),hs(s,e.outputType)):a?.hasField(n)?(o="include",a.getField(n)?.markAsError(),_c(a,e.outputType)):l?.hasField(n)&&(o="omit",l.getField(n)?.markAsError(),Lc(l,e.outputType))}t.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(Ut(s)),a.join(" ")})}function Cc(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Ic(n,e.arguments)),t.addErrorMessage(i=>ms(i,r,e.arguments.map(o=>o.name)))}function Ac(e,t){let[r,n]=Rr(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&ys(o,e.inputType)}t.addErrorMessage(o=>ms(o,n,e.inputType.fields.map(s=>s.name)))}function ms(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Dc(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(Ut(e)),n.join(" ")}function Sc(e,t){let r;t.addErrorMessage(l=>r?.value instanceof K&&r.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Rr(e.argumentPath),s=new Sr,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let l of e.inputTypes[0].fields)s.addField(l.name,l.typeNames.join(" | "));a.addSuggestion(new pe(o,s).makeRequired())}else{let l=e.inputTypes.map(gs).join(" | ");a.addSuggestion(new pe(o,l).makeRequired())}}function gs(e){return e.kind==="list"?`${gs(e.elementType)}[]`:e.name}function Rc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=kr("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function kc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=kr("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function Oc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof K&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function Fc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&ys(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${kr("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(Ut(i)),o.join(" ")})}function Mc(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${kr("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function hs(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new pe(r.name,"true"))}function _c(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new pe(r.name,"true"))}function Lc(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new pe(r.name,"true"))}function Ic(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new pe(r.name,r.typeNames.join(" | ")))}function ys(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new pe(r.name,r.typeNames.join(" | ")))}function Rr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function Ut({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function kr(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var Nc=3;function Dc(e,t){let r=1/0,n;for(let i of t){let o=(0,ds.default)(e,i);o>Nc||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.model?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};m();c();p();f();d();var xs=e=>({command:e});m();c();p();f();d();m();c();p();f();d();var vs=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);m();c();p();f();d();function qt(e){try{return Ps(e,"fast")}catch{return Ps(e,"slow")}}function Ps(e,t){return JSON.stringify(e.map(r=>Gc(r,t)))}function Gc(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:st(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ve.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:w.Buffer.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Hc(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:w.Buffer.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Cs(e):e}function Hc(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Cs(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ts);let t={};for(let r of Object.keys(e))t[r]=Ts(e[r]);return t}function Ts(e){return typeof e=="bigint"?e.toString():Cs(e)}var Kc=/^(\s*alter\s)/i,As=le("prisma:client");function Ln(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Kc.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var In=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:qt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:qt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:qt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=vs(r),i={values:qt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?As(`prisma.${e}(${n}, ${i.values})`):As(`prisma.${e}(${n})`),{query:n,parameters:i}},Ss={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Rs={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};m();c();p();f();d();function Nn(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=ks(r(o)):ks(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function ks(e){return typeof e.then=="function"?e:Promise.resolve(e)}m();c();p();f();d();var Os={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Dn=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??Os}};function Fs(e){return e.includes("tracing")?new Dn:Os}m();c();p();f();d();function Ms(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}m();c();p();f();d();var zc=["$connect","$disconnect","$on","$transaction","$use","$extends"],_s=zc;m();c();p();f();d();function Ls(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}m();c();p();f();d();var Fr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};m();c();p();f();d();var Ns=fe(nn());m();c();p();f();d();function Mr(e){return typeof e.batchRequestIdx=="number"}m();c();p();f();d();function _r(e){return e===null?e:Array.isArray(e)?e.map(_r):typeof e=="object"?Yc(e)?Zc(e):rt(e,_r):e}function Yc(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Zc({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return w.Buffer.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ve(t);case"Json":return JSON.parse(t);default:We(t,"Unknown tagged value")}}m();c();p();f();d();function Is(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Bn(e.query.arguments)),t.push(Bn(e.query.selection)),t.join("")}function Bn(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Bn(n)})`:r}).join(" ")})`}m();c();p();f();d();var Xc={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function $n(e){return Xc[e]}m();c();p();f();d();var Lr=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,y.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(h=>h.protocolQuery),l=this.client._tracingHelper.getTraceParent(s),u=n.some(h=>$n(h.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:tp(o),containsWrite:u,customDataProxyFetch:i})).map((h,v)=>{if(h instanceof Error)return h;try{return this.mapQueryEngineResult(n[v],h)}catch(R){return R}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ds(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:$n(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Is(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return y.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(ep(t),rp(t,i)||t instanceof Oe)throw t;if(t instanceof G&&np(t)){let l=Bs(t.meta);Or({args:o,errors:[l],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=mt({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let l=s?{modelName:s,...t.meta}:t.meta;throw new G(a,{code:t.code,clientVersion:this.client._clientVersion,meta:l,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ue(a,this.client._clientVersion);if(t instanceof H)throw new H(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof V)throw new V(a,this.client._clientVersion);if(t instanceof ue)throw new ue(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Ns.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=_r(Tn(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function tp(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ds(e)};We(e,"Unknown transaction kind")}}function Ds(e){return{id:e.id,payload:e.payload}}function rp(e,t){return Mr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function np(e){return e.code==="P2009"||e.code==="P2012"}function Bs(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Bs)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}m();c();p();f();d();var $s="5.14.0";var js=$s;m();c();p();f();d();function Us(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=qs(t[n]);return r})}function qs({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return w.Buffer.from(t,"base64");case"decimal":return new ve(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(qs);default:return t}}m();c();p();f();d();var Ws=fe(Fn());m();c();p();f();d();var q=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};re(q,"PrismaClientConstructorValidationError");var Vs=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],Qs=["pretty","colorless","minimal"],Js=["info","query","warn","error"],op={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=gt(r,t)||` Available datasources: ${t.join(", ")}`;throw new q(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new q(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new q(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new q('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Cr(t).includes("driverAdapters"))throw new q('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Tt()==="binary")throw new q('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new q(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Qs.includes(e)){let t=gt(e,Qs);throw new q(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new q(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Js.includes(r)){let n=gt(r,Js);throw new q(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=gt(i,o);throw new q(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new q(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new q(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new q(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new q(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=gt(r,t);throw new q(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Gs(e,t){for(let[r,n]of Object.entries(e)){if(!Vs.includes(r)){let i=gt(r,Vs);throw new q(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}op[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new q('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function gt(e,t){if(t.length===0||typeof e!="string")return"";let r=sp(e,t);return r?` Did you mean "${r}"?`:""}function sp(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,Ws.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},l=u=>{o||(o=!0,r(u))};for(let u=0;u{n[u]=g,a()},g=>{if(!Mr(g)){l(g);return}g.batchRequestIdx===u?l(g):(i||(i=g),a())})})}var Ue=le("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var ap={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},lp=Symbol.for("prisma.client.transaction.id"),up={id:0,nextId(){return++this.id}};function Ys(e){class t{constructor(n){this._originalClient=this;this._middlewares=new Fr;this._createPrismaPromise=Nn();this.$extends=Mo;e=n?.__internal?.configOverride?.(e)??e,Ko(e),n&&Gs(n,e);let i=n?.adapter?fn(n.adapter):void 0,o=new Kt().on("error",()=>{});this._extensions=Pr.empty(),this._previewFeatures=Cr(e),this._clientVersion=e.clientVersion??js,this._activeProvider=e.activeProvider,this._tracingHelper=Fs(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&we.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&we.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},g=u.debug===!0;g&&le.enable("prisma:client");let h=we.resolve(e.dirname,e.relativePath);Gt.existsSync(h)||(h=e.dirname),Ue("dirname",e.dirname),Ue("relativePath",e.relativePath),Ue("cwd",h);let v=u.engine||{};if(l.errorFormat?this._errorFormat=l.errorFormat:y.env.NODE_ENV==="production"?this._errorFormat="minimal":y.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:h,dirname:e.dirname,enableDebugLogs:g,allowTriggerPanic:v.allowTriggerPanic,datamodelPath:we.join(e.dirname,e.filename??"schema.prisma"),prismaPath:v.binaryPath??void 0,engineEndpoint:v.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Ls(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(R=>typeof R=="string"?R==="query":R.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:zo(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Tr,getBatchRequestPayload:rr,prismaGraphQLToJSError:yr,PrismaClientUnknownRequestError:H,PrismaClientInitializationError:V,PrismaClientKnownRequestError:G,debug:le("prisma:client:accelerateEngine"),engineVersion:zs.version,clientVersion:e.clientVersion}},Ue("clientVersion",e.clientVersion),this._engine=as(e,this._engineConfig),this._requestHandler=new Ir(this,o),l.log)for(let R of l.log){let C=typeof R=="string"?R:R.emit==="stdout"?R.level:null;C&&this.$on(C,A=>{At.log(`${At.tags[C]??""}`,A.message||A.query)})}this._metrics=new nt(this._engine)}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=Bt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Pi()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:In({clientMethod:i,activeProvider:a}),callsite:je(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Ks(n,i);return Ln(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new Y("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(Ln(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new Y(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:xs,callsite:je(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:In({clientMethod:i,activeProvider:a}),callsite:je(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(Us)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Ks(n,i));throw new Y("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=up.nextId(),s=Ms(n.length),a=n.map((l,u)=>{if(l?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let g=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,h={kind:"batch",id:o,index:u,isolationLevel:g,lock:s};return l.requestTransaction?.(h)??l});return Hs(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return Bt(Ee(Fo(this),[ne("_appliedParent",()=>this._appliedParent._createItxClient(n)),ne("_createPrismaPromise",()=>Nn(n)),ne(lp,()=>n.id),it(_s)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??ap,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let g=this._middlewares.get(++a);if(g)return this._tracingHelper.runInChildSpan(s.middleware,F=>g(u,L=>(F?.end(),l(L))));let{runInTransaction:h,args:v,...R}=u,C={...n,...R};v&&(C.args=i.middlewareArgsToRequestArgs(v)),n.transaction!==void 0&&h===!1&&delete C.transaction;let A=await $o(this,C);return C.model?Io({result:A,modelName:C.model,args:C.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):A};return this._tracingHelper.runInChildSpan(s.operation,()=>l(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:g,unpacker:h,otelParentCtx:v,customDataProxyFetch:R}){try{n=u?u(n):n;let C={name:"serialize"},A=this._tracingHelper.runInChildSpan(C,()=>ws({modelName:l,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return le.enabled("prisma:client")&&(Ue("Prisma Client call:"),Ue(`prisma.${i}(${mo(n)})`),Ue("Generated request:"),Ue(JSON.stringify(A,null,2)+` -`)),g?.kind==="batch"&&await g.lock,this._requestHandler.request({protocolQuery:A,modelName:l,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:g,unpacker:h,otelParentCtx:v,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:R})}catch(C){throw C.clientVersion=this._clientVersion,C}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new Y("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Ks(e,t){return cp(e)?[new se(e,t),Ss]:[e,Rs]}function cp(e){return Array.isArray(e)&&Array.isArray(e.raw)}m();c();p();f();d();var pp=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Zs(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!pp.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}m();c();p();f();d();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=react-native.js.map diff --git a/integration-tests/tests/prisma/sqlite/client/runtime/wasm.js b/integration-tests/tests/prisma/sqlite/client/runtime/wasm.js deleted file mode 100644 index 8e5f78d07..000000000 --- a/integration-tests/tests/prisma/sqlite/client/runtime/wasm.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict";var ko=Object.create;var Et=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Mo=Object.getOwnPropertyNames;var Io=Object.getPrototypeOf,_o=Object.prototype.hasOwnProperty;var oe=(e,t)=>()=>(e&&(t=e(e=0)),t);var Te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ze=(e,t)=>{for(var r in t)Et(e,r,{get:t[r],enumerable:!0})},Kr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mo(t))!_o.call(e,i)&&i!==r&&Et(e,i,{get:()=>t[i],enumerable:!(n=Lo(t,i))||n.enumerable});return e};var _e=(e,t,r)=>(r=e!=null?ko(Io(e)):{},Kr(t||!e||!e.__esModule?Et(r,"default",{value:e,enumerable:!0}):r,e)),ar=e=>Kr(Et({},"__esModule",{value:!0}),e);function lr(e,t){if(t=t.toLowerCase(),t==="utf8"||t==="utf-8")return new h(Bo.encode(e));if(t==="base64"||t==="base64url")return e=e.replace(/-/g,"+").replace(/_/g,"/"),e=e.replace(/[^A-Za-z0-9+/]/g,""),new h([...atob(e)].map(r=>r.charCodeAt(0)));if(t==="binary"||t==="ascii"||t==="latin1"||t==="latin-1")return new h([...e].map(r=>r.charCodeAt(0)));if(t==="ucs2"||t==="ucs-2"||t==="utf16le"||t==="utf-16le"){let r=new h(e.length*2),n=new DataView(r.buffer);for(let i=0;ia.startsWith("get")||a.startsWith("set")),n=r.map(a=>a.replace("get","read").replace("set","write")),i=(a,f)=>function(v=0){return $(v,"offset"),Y(v,"offset"),q(v,"offset",this.length-1),new DataView(this.buffer)[r[a]](v,f)},o=(a,f)=>function(v,C=0){let T=r[a].match(/set(\w+\d+)/)[1].toLowerCase(),O=No[T];return $(C,"offset"),Y(C,"offset"),q(C,"offset",this.length-1),Fo(v,"value",O[0],O[1]),new DataView(this.buffer)[r[a]](C,v,f),C+parseInt(r[a].match(/\d+/)[0])/8},s=a=>{a.forEach(f=>{f.includes("Uint")&&(e[f.replace("Uint","UInt")]=e[f]),f.includes("Float64")&&(e[f.replace("Float64","Double")]=e[f]),f.includes("Float32")&&(e[f.replace("Float32","Float")]=e[f])})};n.forEach((a,f)=>{a.startsWith("read")&&(e[a]=i(f,!1),e[a+"LE"]=i(f,!0),e[a+"BE"]=i(f,!1)),a.startsWith("write")&&(e[a]=o(f,!1),e[a+"LE"]=o(f,!0),e[a+"BE"]=o(f,!1)),s([a,a+"LE",a+"BE"])})}function zr(e){throw new Error(`Buffer polyfill does not implement "${e}"`)}function xt(e,t){if(!(e instanceof Uint8Array))throw new TypeError(`The "${t}" argument must be an instance of Buffer or Uint8Array`)}function q(e,t,r=Vo+1){if(e<0||e>r){let n=new RangeError(`The value of "${t}" is out of range. It must be >= 0 && <= ${r}. Received ${e}`);throw n.code="ERR_OUT_OF_RANGE",n}}function $(e,t){if(typeof e!="number"){let r=new TypeError(`The "${t}" argument must be of type number. Received type ${typeof e}.`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function Y(e,t){if(!Number.isInteger(e)||Number.isNaN(e)){let r=new RangeError(`The value of "${t}" is out of range. It must be an integer. Received ${e}`);throw r.code="ERR_OUT_OF_RANGE",r}}function Fo(e,t,r,n){if(en){let i=new RangeError(`The value of "${t}" is out of range. It must be >= ${r} and <= ${n}. Received ${e}`);throw i.code="ERR_OUT_OF_RANGE",i}}function Hr(e,t){if(typeof e!="string"){let r=new TypeError(`The "${t}" argument must be of type string. Received type ${typeof e}`);throw r.code="ERR_INVALID_ARG_TYPE",r}}function qo(e,t="utf8"){return h.from(e,t)}var h,No,Bo,Uo,$o,Vo,y,ur,u=oe(()=>{"use strict";h=class e extends Uint8Array{constructor(){super(...arguments);this._isBuffer=!0}get offset(){return this.byteOffset}static alloc(r,n=0,i="utf8"){return Hr(i,"encoding"),e.allocUnsafe(r).fill(n,i)}static allocUnsafe(r){return e.from(r)}static allocUnsafeSlow(r){return e.from(r)}static isBuffer(r){return r&&!!r._isBuffer}static byteLength(r,n="utf8"){if(typeof r=="string")return lr(r,n).byteLength;if(r&&r.byteLength)return r.byteLength;let i=new TypeError('The "string" argument must be of type string or an instance of Buffer or ArrayBuffer.');throw i.code="ERR_INVALID_ARG_TYPE",i}static isEncoding(r){return $o.includes(r)}static compare(r,n){xt(r,"buff1"),xt(n,"buff2");for(let i=0;in[i])return 1}return r.length===n.length?0:r.length>n.length?1:-1}static from(r,n="utf8"){if(r&&typeof r=="object"&&r.type==="Buffer")return new e(r.data);if(typeof r=="number")return new e(new Uint8Array(r));if(typeof r=="string")return lr(r,n);if(ArrayBuffer.isView(r)){let{byteOffset:i,byteLength:o,buffer:s}=r;return"map"in r&&typeof r.map=="function"?new e(r.map(a=>a%256),i,o):new e(s,i,o)}if(r&&typeof r=="object"&&("length"in r||"byteLength"in r||"buffer"in r))return new e(r);throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}static concat(r,n){if(r.length===0)return e.alloc(0);let i=[].concat(...r.map(s=>[...s])),o=e.alloc(n!==void 0?n:i.length);return o.set(n!==void 0?i.slice(0,n):i),o}slice(r=0,n=this.length){return this.subarray(r,n)}subarray(r=0,n=this.length){return Object.setPrototypeOf(super.subarray(r,n),e.prototype)}reverse(){return super.reverse(),this}readIntBE(r,n){$(r,"offset"),Y(r,"offset"),q(r,"offset",this.length-1),$(n,"byteLength"),Y(n,"byteLength");let i=new DataView(this.buffer,r,n),o=0;for(let s=0;s=0;s--)o.setUint8(s,r&255),r=r/256;return n+i}writeUintBE(r,n,i){return this.writeUIntBE(r,n,i)}writeUIntLE(r,n,i){$(n,"offset"),Y(n,"offset"),q(n,"offset",this.length-1),$(i,"byteLength"),Y(i,"byteLength");let o=new DataView(this.buffer,n,i);for(let s=0;sn===r[i])}copy(r,n=0,i=0,o=this.length){q(n,"targetStart"),q(i,"sourceStart",this.length),q(o,"sourceEnd"),n>>>=0,i>>>=0,o>>>=0;let s=0;for(;i=this.length?this.length-f:r.length),f);return this}includes(r,n=null,i="utf-8"){return this.indexOf(r,n,i)!==-1}lastIndexOf(r,n=null,i="utf-8"){return this.indexOf(r,n,i,!0)}indexOf(r,n=null,i="utf-8",o=!1){let s=o?this.findLastIndex.bind(this):this.findIndex.bind(this);i=typeof n=="string"?n:i;let a=e.from(typeof r=="number"?[r]:r,i),f=typeof n=="string"?0:n;return f=typeof n=="number"?f:null,f=Number.isNaN(f)?null:f,f??=o?this.length:0,f=f<0?this.length+f:f,a.length===0&&o===!1?f>=this.length?this.length:f:a.length===0&&o===!0?(f>=this.length?this.length:f)||this.length:s((v,C)=>(o?C<=f:C>=f)&&this[C]===a[0]&&a.every((O,R)=>this[C+R]===O))}toString(r="utf8",n=0,i=this.length){if(n=n<0?0:n,r=r.toString().toLowerCase(),i<=0)return"";if(r==="utf8"||r==="utf-8")return Uo.decode(this.slice(n,i));if(r==="base64"||r==="base64url"){let o=btoa(this.reduce((s,a)=>s+ur(a),""));return r==="base64url"?o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):o}if(r==="binary"||r==="ascii"||r==="latin1"||r==="latin-1")return this.slice(n,i).reduce((o,s)=>o+ur(s&(r==="ascii"?127:255)),"");if(r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le"){let o=new DataView(this.buffer.slice(n,i));return Array.from({length:o.byteLength/2},(s,a)=>a*2+1o+s.toString(16).padStart(2,"0"),"");zr(`encoding "${r}"`)}toLocaleString(){return this.toString()}inspect(){return``}};No={int8:[-128,127],int16:[-32768,32767],int32:[-2147483648,2147483647],uint8:[0,255],uint16:[0,65535],uint32:[0,4294967295],float32:[-1/0,1/0],float64:[-1/0,1/0],bigint64:[-0x8000000000000000n,0x7fffffffffffffffn],biguint64:[0n,0xffffffffffffffffn]},Bo=new TextEncoder,Uo=new TextDecoder,$o=["utf8","utf-8","hex","base64","ascii","binary","base64url","ucs2","ucs-2","utf16le","utf-16le","latin1","latin-1"],Vo=4294967295;Do(h.prototype);y=new Proxy(qo,{construct(e,[t,r]){return h.from(t,r)},get(e,t){return h[t]}}),ur=String.fromCodePoint});var g,c=oe(()=>{"use strict";g={nextTick:(e,...t)=>{setTimeout(()=>{e(...t)},0)},env:{},version:"",cwd:()=>"/",stderr:{},argv:["/bin/node"]}});var E,m=oe(()=>{"use strict";E=globalThis.performance??(()=>{let e=Date.now();return{now:()=>Date.now()-e}})()});var w,p=oe(()=>{"use strict";w=()=>{};w.prototype=w});var b,d=oe(()=>{"use strict";b=class{constructor(t){this.value=t}deref(){return this.value}}});function en(e,t){var r,n,i,o,s,a,f,v,C=e.constructor,T=C.precision;if(!e.s||!t.s)return t.s||(t=new C(e)),B?_(t,T):t;if(f=e.d,v=t.d,s=e.e,i=t.e,f=f.slice(),o=s-i,o){for(o<0?(n=f,o=-o,a=v.length):(n=v,i=s,a=f.length),s=Math.ceil(T/F),a=s>a?s+1:a+1,o>a&&(o=a,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(a=f.length,o=v.length,a-o<0&&(o=a,n=v,v=f,f=n),r=0;o;)r=(f[--o]=f[o]+v[o]+r)/j|0,f[o]%=j;for(r&&(f.unshift(r),++i),a=f.length;f[--a]==0;)f.pop();return t.d=f,t.e=i,B?_(t,T):t}function le(e,t,r){if(e!==~~e||er)throw Error(Re+e)}function ae(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t16)throw Error(mr+V(e));if(!e.s)return new C(Z);for(t==null?(B=!1,a=T):a=t,s=new C(.03125);e.abs().gte(.1);)e=e.times(s),v+=5;for(n=Math.log(Ae(2,v))/Math.LN10*2+5|0,a+=n,r=i=o=new C(Z),C.precision=a;;){if(i=_(i.times(e),a),r=r.times(++f),s=o.plus(ge(i,r,a)),ae(s.d).slice(0,a)===ae(o.d).slice(0,a)){for(;v--;)o=_(o.times(o),a);return C.precision=T,t==null?(B=!0,_(o,T)):o}o=s}}function V(e){for(var t=e.e*F,r=e.d[0];r>=10;r/=10)t++;return t}function cr(e,t,r){if(t>e.LN10.sd())throw B=!0,r&&(e.precision=r),Error(te+"LN10 precision limit exceeded");return _(new e(e.LN10),t)}function we(e){for(var t="";e--;)t+="0";return t}function Ye(e,t){var r,n,i,o,s,a,f,v,C,T=1,O=10,R=e,L=R.d,S=R.constructor,M=S.precision;if(R.s<1)throw Error(te+(R.s?"NaN":"-Infinity"));if(R.eq(Z))return new S(0);if(t==null?(B=!1,v=M):v=t,R.eq(10))return t==null&&(B=!0),cr(S,v);if(v+=O,S.precision=v,r=ae(L),n=r.charAt(0),o=V(R),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)R=R.times(e),r=ae(R.d),n=r.charAt(0),T++;o=V(R),n>1?(R=new S("0."+r),o++):R=new S(n+"."+r.slice(1))}else return f=cr(S,v+2,M).times(o+""),R=Ye(new S(n+"."+r.slice(1)),v-O).plus(f),S.precision=M,t==null?(B=!0,_(R,M)):R;for(a=s=R=ge(R.minus(Z),R.plus(Z),v),C=_(R.times(R),v),i=3;;){if(s=_(s.times(C),v),f=a.plus(ge(s,new S(i),v)),ae(f.d).slice(0,v)===ae(a.d).slice(0,v))return a=a.times(2),o!==0&&(a=a.plus(cr(S,v+2,M).times(o+""))),a=ge(a,new S(T),v),S.precision=M,t==null?(B=!0,_(a,M)):a;a=f,i+=2}}function Yr(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Fe(r/F),e.d=[],n=(r+1)%F,r<0&&(n+=F),nPt||e.e<-Pt))throw Error(mr+r)}else e.s=0,e.e=0,e.d=[0];return e}function _(e,t,r){var n,i,o,s,a,f,v,C,T=e.d;for(s=1,o=T[0];o>=10;o/=10)s++;if(n=t-s,n<0)n+=F,i=t,v=T[C=0];else{if(C=Math.ceil((n+1)/F),o=T.length,C>=o)return e;for(v=o=T[C],s=1;o>=10;o/=10)s++;n%=F,i=n-F+s}if(r!==void 0&&(o=Ae(10,s-i-1),a=v/o%10|0,f=t<0||T[C+1]!==void 0||v%o,f=r<4?(a||f)&&(r==0||r==(e.s<0?3:2)):a>5||a==5&&(r==4||f||r==6&&(n>0?i>0?v/Ae(10,s-i):0:T[C-1])%10&1||r==(e.s<0?8:7))),t<1||!T[0])return f?(o=V(e),T.length=1,t=t-o-1,T[0]=Ae(10,(F-t%F)%F),e.e=Fe(-t/F)||0):(T.length=1,T[0]=e.e=e.s=0),e;if(n==0?(T.length=C,o=1,C--):(T.length=C+1,o=Ae(10,F-n),T[C]=i>0?(v/Ae(10,s-i)%Ae(10,i)|0)*o:0),f)for(;;)if(C==0){(T[0]+=o)==j&&(T[0]=1,++e.e);break}else{if(T[C]+=o,T[C]!=j)break;T[C--]=0,o=1}for(n=T.length;T[--n]===0;)T.pop();if(B&&(e.e>Pt||e.e<-Pt))throw Error(mr+V(e));return e}function rn(e,t){var r,n,i,o,s,a,f,v,C,T,O=e.constructor,R=O.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new O(e),B?_(t,R):t;if(f=e.d,T=t.d,n=t.e,v=e.e,f=f.slice(),s=v-n,s){for(C=s<0,C?(r=f,s=-s,a=T.length):(r=T,n=v,a=f.length),i=Math.max(Math.ceil(R/F),a)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=f.length,a=T.length,C=i0;--i)f[a++]=0;for(i=T.length;i>s;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+we(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+we(-i-1)+o,r&&(n=r-s)>0&&(o+=we(n))):i>=s?(o+=we(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+we(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=we(n))),e.s<0?"-"+o:o}function Xr(e,t){if(e.length>t)return e.length=t,!0}function nn(e){var t,r,n;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Re+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return Yr(s,o.toString())}else if(typeof o!="string")throw Error(Re+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,Qo.test(o))Yr(s,o);else throw Error(Re+o)}if(i.prototype=A,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=nn,i.config=i.set=Jo,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Re+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Re+r+": "+n);return this}var De,jo,pr,B,te,Re,mr,Fe,Ae,Qo,Z,j,F,Zr,Pt,A,ge,pr,vt,on=oe(()=>{"use strict";u();c();m();p();d();l();De=1e9,jo={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},B=!0,te="[DecimalError] ",Re=te+"Invalid argument: ",mr=te+"Exponent out of range: ",Fe=Math.floor,Ae=Math.pow,Qo=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,j=1e7,F=7,Zr=9007199254740991,Pt=Fe(Zr/F),A={};A.absoluteValue=A.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};A.comparedTo=A.cmp=function(e){var t,r,n,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};A.decimalPlaces=A.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*F;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};A.dividedBy=A.div=function(e){return ge(this,new this.constructor(e))};A.dividedToIntegerBy=A.idiv=function(e){var t=this,r=t.constructor;return _(ge(t,new r(e),0,1),r.precision)};A.equals=A.eq=function(e){return!this.cmp(e)};A.exponent=function(){return V(this)};A.greaterThan=A.gt=function(e){return this.cmp(e)>0};A.greaterThanOrEqualTo=A.gte=function(e){return this.cmp(e)>=0};A.isInteger=A.isint=function(){return this.e>this.d.length-2};A.isNegative=A.isneg=function(){return this.s<0};A.isPositive=A.ispos=function(){return this.s>0};A.isZero=function(){return this.s===0};A.lessThan=A.lt=function(e){return this.cmp(e)<0};A.lessThanOrEqualTo=A.lte=function(e){return this.cmp(e)<1};A.logarithm=A.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Z))throw Error(te+"NaN");if(r.s<1)throw Error(te+(r.s?"NaN":"-Infinity"));return r.eq(Z)?new n(0):(B=!1,t=ge(Ye(r,o),Ye(e,o),o),B=!0,_(t,i))};A.minus=A.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rn(t,e):en(t,(e.s=-e.s,e))};A.modulo=A.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(te+"NaN");return r.s?(B=!1,t=ge(r,e,0,1).times(e),B=!0,r.minus(t)):_(new n(r),i)};A.naturalExponential=A.exp=function(){return tn(this)};A.naturalLogarithm=A.ln=function(){return Ye(this)};A.negated=A.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};A.plus=A.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?en(t,e):rn(t,(e.s=-e.s,e))};A.precision=A.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Re+e);if(t=V(i)+1,n=i.d.length-1,r=n*F+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};A.squareRoot=A.sqrt=function(){var e,t,r,n,i,o,s,a=this,f=a.constructor;if(a.s<1){if(!a.s)return new f(0);throw Error(te+"NaN")}for(e=V(a),B=!1,i=Math.sqrt(+a),i==0||i==1/0?(t=ae(a.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Fe((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=s=r+3;;)if(o=n,n=o.plus(ge(a,o,s+2)).times(.5),ae(o.d).slice(0,s)===(t=ae(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(_(o,r+1,0),o.times(o).eq(a)){n=o;break}}else if(t!="9999")break;s+=4}return B=!0,_(n,r)};A.times=A.mul=function(e){var t,r,n,i,o,s,a,f,v,C=this,T=C.constructor,O=C.d,R=(e=new T(e)).d;if(!C.s||!e.s)return new T(0);for(e.s*=C.s,r=C.e+e.e,f=O.length,v=R.length,f=0;){for(t=0,i=f+n;i>n;)a=o[i]+R[n]*O[i-n-1]+t,o[i--]=a%j|0,t=a/j|0;o[i]=(o[i]+t)%j|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,B?_(e,T.precision):e};A.toDecimalPlaces=A.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(le(e,0,De),t===void 0?t=n.rounding:le(t,0,8),_(r,e+V(r)+1,t))};A.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Se(n,!0):(le(e,0,De),t===void 0?t=i.rounding:le(t,0,8),n=_(new i(n),e+1,t),r=Se(n,!0,e+1)),r};A.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?Se(i):(le(e,0,De),t===void 0?t=o.rounding:le(t,0,8),n=_(new o(i),e+V(i)+1,t),r=Se(n.abs(),!1,e+V(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};A.toInteger=A.toint=function(){var e=this,t=e.constructor;return _(new t(e),V(e)+1,t.rounding)};A.toNumber=function(){return+this};A.toPower=A.pow=function(e){var t,r,n,i,o,s,a=this,f=a.constructor,v=12,C=+(e=new f(e));if(!e.s)return new f(Z);if(a=new f(a),!a.s){if(e.s<1)throw Error(te+"Infinity");return a}if(a.eq(Z))return a;if(n=f.precision,e.eq(Z))return _(a,n);if(t=e.e,r=e.d.length-1,s=t>=r,o=a.s,s){if((r=C<0?-C:C)<=Zr){for(i=new f(Z),t=Math.ceil(n/F+4),B=!1;r%2&&(i=i.times(a),Xr(i.d,t)),r=Fe(r/2),r!==0;)a=a.times(a),Xr(a.d,t);return B=!0,e.s<0?new f(Z).div(i):_(i,n)}}else if(o<0)throw Error(te+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,a.s=1,B=!1,i=e.times(Ye(a,n+v)),B=!0,i=tn(i),i.s=o,i};A.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=V(i),n=Se(i,r<=o.toExpNeg||r>=o.toExpPos)):(le(e,1,De),t===void 0?t=o.rounding:le(t,0,8),i=_(new o(i),e,t),r=V(i),n=Se(i,e<=r||r<=o.toExpNeg,e)),n};A.toSignificantDigits=A.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(le(e,1,De),t===void 0?t=n.rounding:le(t,0,8)),_(new n(r),e,t)};A.toString=A.valueOf=A.val=A.toJSON=A[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=V(e),r=e.constructor;return Se(e,t<=r.toExpNeg||t>=r.toExpPos)};ge=function(){function e(n,i){var o,s=0,a=n.length;for(n=n.slice();a--;)o=n[a]*i+s,n[a]=o%j|0,s=o/j|0;return s&&n.unshift(s),n}function t(n,i,o,s){var a,f;if(o!=s)f=o>s?1:-1;else for(a=f=0;ai[a]?1:-1;break}return f}function r(n,i,o){for(var s=0;o--;)n[o]-=s,s=n[o]1;)n.shift()}return function(n,i,o,s){var a,f,v,C,T,O,R,L,S,M,ne,z,Ie,k,Ce,sr,ie,bt,wt=n.constructor,Oo=n.s==i.s?1:-1,se=n.d,U=i.d;if(!n.s)return new wt(n);if(!i.s)throw Error(te+"Division by zero");for(f=n.e-i.e,ie=U.length,Ce=se.length,R=new wt(Oo),L=R.d=[],v=0;U[v]==(se[v]||0);)++v;if(U[v]>(se[v]||0)&&--f,o==null?z=o=wt.precision:s?z=o+(V(n)-V(i))+1:z=o,z<0)return new wt(0);if(z=z/F+2|0,v=0,ie==1)for(C=0,U=U[0],z++;(v1&&(U=e(U,C),se=e(se,C),ie=U.length,Ce=se.length),k=ie,S=se.slice(0,ie),M=S.length;M=j/2&&++sr;do C=0,a=t(U,S,ie,M),a<0?(ne=S[0],ie!=M&&(ne=ne*j+(S[1]||0)),C=ne/sr|0,C>1?(C>=j&&(C=j-1),T=e(U,C),O=T.length,M=S.length,a=t(T,S,O,M),a==1&&(C--,r(T,ie{"use strict";on();P=class extends vt{static isDecimal(t){return t instanceof vt}static random(t=20){{let n=crypto.getRandomValues(new Uint8Array(t)).reduce((i,o)=>i+o,"");return new vt(`0.${n.slice(0,t)}`)}}},ue=P});function Wo(){return!1}var Go,Ko,un,cn=oe(()=>{"use strict";u();c();m();p();d();l();Go={},Ko={existsSync:Wo,promises:Go},un=Ko});var xn=Te((Au,En)=>{"use strict";u();c();m();p();d();l();En.exports=(yr(),ar(hr)).format});var hr={};ze(hr,{default:()=>Yo,deprecate:()=>vn,format:()=>Tn,inspect:()=>Cn,promisify:()=>Pn});function Pn(e){return(...t)=>new Promise((r,n)=>{e(...t,(i,o)=>{i?n(i):r(o)})})}function vn(e,t){return(...r)=>(console.warn(t),e(...r))}function Cn(e){return JSON.stringify(e,(t,r)=>typeof r=="function"?r.toString():typeof r=="bigint"?`${r}n`:r instanceof Error?{...r,message:r.message,stack:r.stack}:r)}var Tn,zo,Yo,yr=oe(()=>{"use strict";u();c();m();p();d();l();Tn=xn(),zo={promisify:Pn,deprecate:vn,inspect:Cn,format:Tn},Yo=zo});function rs(...e){return e.join("/")}function ns(...e){return e.join("/")}var On,is,os,Ze,kn=oe(()=>{"use strict";u();c();m();p();d();l();On="/",is={sep:On},os={resolve:rs,posix:is,join:ns,sep:On},Ze=os});var St,Mn=oe(()=>{"use strict";u();c();m();p();d();l();St=class{constructor(){this.events={}}on(t,r){return this.events[t]||(this.events[t]=[]),this.events[t].push(r),this}emit(t,...r){return this.events[t]?(this.events[t].forEach(n=>{n(...r)}),!0):!1}}});var _n=Te((Kc,In)=>{"use strict";u();c();m();p();d();l();In.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 Nn=Te((lm,Fn)=>{"use strict";u();c();m();p();d();l();Fn.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 Un=Te((gm,Bn)=>{"use strict";u();c();m();p();d();l();var ms=Nn();Bn.exports=e=>typeof e=="string"?e.replace(ms(),""):e});var jn=Te((Jf,gs)=>{gs.exports={name:"@prisma/engines-version",version:"5.14.0-25.e9771e62de70f79a5e1c604a2d7c8e2a0a874b48",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek ",prisma:{enginesVersion:"e9771e62de70f79a5e1c604a2d7c8e2a0a874b48"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.32",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var Qn=Te(()=>{"use strict";u();c();m();p();d();l()});var Ur=Te((ST,Fi)=>{"use strict";u();c();m();p();d();l();Fi.exports=function(){function e(t,r,n,i,o){return tn?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;swr,Decimal:()=>ue,Extensions:()=>dr,MetricsClient:()=>Ue,NotFoundError:()=>he,PrismaClientInitializationError:()=>I,PrismaClientKnownRequestError:()=>Q,PrismaClientRustPanicError:()=>ye,PrismaClientUnknownRequestError:()=>J,PrismaClientValidationError:()=>W,Public:()=>fr,Sql:()=>X,defineDmmfProperty:()=>qn,empty:()=>Wn,getPrismaClient:()=>Ao,getRuntime:()=>Pe,join:()=>Jn,makeStrictEnum:()=>Ro,objectEnumValues:()=>Lt,raw:()=>kr,sqltag:()=>Lr,warnEnvConflicts:()=>void 0,warnOnce:()=>nt});module.exports=ar(Ya);u();c();m();p();d();l();var dr={};ze(dr,{defineExtension:()=>sn,getExtensionContext:()=>an});u();c();m();p();d();l();u();c();m();p();d();l();function sn(e){return typeof e=="function"?e:t=>t.$extends(e)}u();c();m();p();d();l();function an(e){return e}var fr={};ze(fr,{validator:()=>ln});u();c();m();p();d();l();u();c();m();p();d();l();function ln(...e){return t=>t}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var gr,mn,pn,dn,fn=!0;typeof g<"u"&&({FORCE_COLOR:gr,NODE_DISABLE_COLORS:mn,NO_COLOR:pn,TERM:dn}=g.env||{},fn=g.stdout&&g.stdout.isTTY);var Ho={enabled:!mn&&pn==null&&dn!=="dumb"&&(gr!=null&&gr!=="0"||fn)};function D(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ho.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var ru=D(0,0),Ct=D(1,22),Tt=D(2,22),nu=D(3,23),gn=D(4,24),iu=D(7,27),ou=D(8,28),su=D(9,29),au=D(30,39),Ne=D(31,39),hn=D(32,39),At=D(33,39),yn=D(34,39),lu=D(35,39),bn=D(36,39),uu=D(37,39),wn=D(90,39),cu=D(90,39),mu=D(40,49),pu=D(41,49),du=D(42,49),fu=D(43,49),gu=D(44,49),hu=D(45,49),yu=D(46,49),bu=D(47,49);u();c();m();p();d();l();var Xo=100,An=["green","yellow","blue","magenta","cyan","red"],Rt=[],Rn=Date.now(),Zo=0,br=typeof g<"u"?g.env:{};globalThis.DEBUG??=br.DEBUG??"";globalThis.DEBUG_COLORS??=br.DEBUG_COLORS?br.DEBUG_COLORS==="true":!0;var Xe={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,i;typeof require=="function"&&typeof g<"u"&&typeof g.stderr<"u"&&typeof g.stderr.write=="function"?i=(...o)=>{try{let s=(yr(),ar(hr));g.stderr.write(s.format(...o)+` -`)}catch{i=console.warn??console.log}}:i=console.warn??console.log,i(`${t} ${r}`,...n)},formatters:{}};function es(e){let t={color:An[Zo++%An.length],enabled:Xe.enabled(e),namespace:e,log:Xe.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Rt.push([o,...n]),Rt.length>Xo&&Rt.shift(),Xe.enabled(o)||i){let f=n.map(C=>typeof C=="string"?C:ts(C)),v=`+${Date.now()-Rn}ms`;Rn=Date.now(),a(o,...f,v)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var wr=new Proxy(es,{get:(e,t)=>Xe[t],set:(e,t,r)=>Xe[t]=r});function ts(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 Sn(){Rt.length=0}var ee=wr;u();c();m();p();d();l();u();c();m();p();d();l();var Er=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];u();c();m();p();d();l();var Ln="library";function et(e){let t=ss();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":Ln)}function ss(){let e=g.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":void 0}u();c();m();p();d();l();u();c();m();p();d();l();var Oe;(t=>{let e;(k=>(k.findUnique="findUnique",k.findUniqueOrThrow="findUniqueOrThrow",k.findFirst="findFirst",k.findFirstOrThrow="findFirstOrThrow",k.findMany="findMany",k.create="create",k.createMany="createMany",k.createManyAndReturn="createManyAndReturn",k.update="update",k.updateMany="updateMany",k.upsert="upsert",k.delete="delete",k.deleteMany="deleteMany",k.groupBy="groupBy",k.count="count",k.aggregate="aggregate",k.findRaw="findRaw",k.aggregateRaw="aggregateRaw"))(e=t.ModelAction||={})})(Oe||={});var rt={};ze(rt,{error:()=>us,info:()=>ls,log:()=>as,query:()=>cs,should:()=>Dn,tags:()=>tt,warn:()=>xr});u();c();m();p();d();l();var tt={error:Ne("prisma:error"),warn:At("prisma:warn"),info:bn("prisma:info"),query:yn("prisma:query")},Dn={warn:()=>!g.env.PRISMA_DISABLE_WARNINGS};function as(...e){console.log(...e)}function xr(e,...t){Dn.warn()&&console.warn(`${tt.warn} ${e}`,...t)}function ls(e,...t){console.info(`${tt.info} ${e}`,...t)}function us(e,...t){console.error(`${tt.error} ${e}`,...t)}function cs(e,...t){console.log(`${tt.query} ${e}`,...t)}u();c();m();p();d();l();function Ot(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}u();c();m();p();d();l();function ke(e,t){throw new Error(t)}u();c();m();p();d();l();function Pr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}u();c();m();p();d();l();var vr=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});u();c();m();p();d();l();function Be(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}u();c();m();p();d();l();function Cr(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n{$n.has(e)||($n.add(e),xr(t,...r))};u();c();m();p();d();l();var Q=class extends Error{constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};K(Q,"PrismaClientKnownRequestError");var he=class extends Q{constructor(t,r){super(t,{code:"P2025",clientVersion:r}),this.name="NotFoundError"}};K(he,"NotFoundError");u();c();m();p();d();l();var I=class e extends Error{constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};K(I,"PrismaClientInitializationError");u();c();m();p();d();l();var ye=class extends Error{constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};K(ye,"PrismaClientRustPanicError");u();c();m();p();d();l();var J=class extends Error{constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};K(J,"PrismaClientUnknownRequestError");u();c();m();p();d();l();var W=class extends Error{constructor(r,{clientVersion:n}){super(r);this.name="PrismaClientValidationError";this.clientVersion=n}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};K(W,"PrismaClientValidationError");u();c();m();p();d();l();var Ue=class{constructor(t){this._engine=t}prometheus(t){return this._engine.metrics({format:"prometheus",...t})}json(t){return this._engine.metrics({format:"json",...t})}};u();c();m();p();d();l();u();c();m();p();d();l();function it(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function qn(e,t){let r=it(()=>ps(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function ps(e){throw new Error("Prisma.dmmf is not available when running in edge runtimes.")}function Tr(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}u();c();m();p();d();l();var kt=Symbol(),Ar=new WeakMap,be=class{constructor(t){t===kt?Ar.set(this,`Prisma.${this._getName()}`):Ar.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Ar.get(this)}},ot=class extends be{_getNamespace(){return"NullTypes"}},st=class extends ot{};Rr(st,"DbNull");var at=class extends ot{};Rr(at,"JsonNull");var lt=class extends ot{};Rr(lt,"AnyNull");var Lt={classes:{DbNull:st,JsonNull:at,AnyNull:lt},instances:{DbNull:new st(kt),JsonNull:new at(kt),AnyNull:new lt(kt)}};function Rr(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();function ut(e){return{ok:!1,error:e,map(){return ut(e)},flatMap(){return ut(e)}}}var Sr=class{constructor(){this.registeredErrors=[]}consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},Or=e=>{let t=new Sr,r=Le(t,e.startTransaction.bind(e)),n={adapterName:e.adapterName,errorRegistry:t,queryRaw:Le(t,e.queryRaw.bind(e)),executeRaw:Le(t,e.executeRaw.bind(e)),provider:e.provider,startTransaction:async(...i)=>(await r(...i)).map(s=>ds(t,s))};return e.getConnectionInfo&&(n.getConnectionInfo=fs(t,e.getConnectionInfo.bind(e))),n},ds=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:Le(e,t.queryRaw.bind(t)),executeRaw:Le(e,t.executeRaw.bind(t)),commit:Le(e,t.commit.bind(t)),rollback:Le(e,t.rollback.bind(t))});function Le(e,t){return async(...r)=>{try{return await t(...r)}catch(n){let i=e.registerNewError(n);return ut({kind:"GenericJs",id:i})}}}function fs(e,t){return(...r)=>{try{return t(...r)}catch(n){let i=e.registerNewError(n);return ut({kind:"GenericJs",id:i})}}}var To=_e(jn());var cO=_e(Qn());Mn();cn();kn();u();c();m();p();d();l();var X=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;ie.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}u();c();m();p();d();l();u();c();m();p();d();l();var Mt={enumerable:!0,configurable:!0,writable:!0};function It(e){let t=new Set(e);return{getOwnPropertyDescriptor:()=>Mt,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Gn=Symbol.for("nodejs.util.inspect.custom");function me(e,t){let r=hs(t),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=r.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Kn(Reflect.ownKeys(o),r),a=Kn(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.writable===!1?!1:(n.add(s),Reflect.set(o,s,a))},getOwnPropertyDescriptor(o,s){let a=Reflect.getOwnPropertyDescriptor(o,s);if(a&&!a.configurable)return a;let f=r.get(s);return f?f.getPropertyDescriptor?{...Mt,...f?.getPropertyDescriptor(s)}:Mt:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)}});return i[Gn]=function(){let o={...this};return delete o[Gn],o},i}function hs(e){let t=new Map;for(let r of e){let n=r.getKeys();for(let i of n)t.set(i,r)}return t}function Kn(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}u();c();m();p();d();l();function $e(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}u();c();m();p();d();l();function _t(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}u();c();m();p();d();l();u();c();m();p();d();l();var Ve=class{constructor(t=0,r){this.context=r;this.lines=[];this.currentLine="";this.currentIndent=0;this.currentIndent=t}write(t){return typeof t=="string"?this.currentLine+=t:t.write(this),this}writeJoined(t,r){let n=r.length-1;for(let i=0;i0&&this.currentIndent--,this}addMarginSymbol(t){return this.marginSymbol=t,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(` -`)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let t=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+t.slice(1):t}};u();c();m();p();d();l();u();c();m();p();d();l();function Hn(e){return e.substring(0,1).toLowerCase()+e.substring(1)}u();c();m();p();d();l();function qe(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Dt(e){return e.toString()!=="Invalid Date"}u();c();m();p();d();l();l();function je(e){return P.isDecimal(e)?!0:e!==null&&typeof e=="object"&&typeof e.s=="number"&&typeof e.e=="number"&&typeof e.toFixed=="function"&&Array.isArray(e.d)}u();c();m();p();d();l();var mt=class{constructor(t,r,n,i,o){this.modelName=t,this.name=r,this.typeName=n,this.isList=i,this.isEnum=o}_toGraphQLInputType(){let t=this.isList?"List":"",r=this.isEnum?"Enum":"";return`${t}${r}${this.typeName}FieldRefInput<${this.modelName}>`}};function Qe(e){return e instanceof mt}u();c();m();p();d();l();u();c();m();p();d();l();var Ft=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};u();c();m();p();d();l();var Nt=e=>e,Bt={bold:Nt,red:Nt,green:Nt,dim:Nt,enabled:!1},zn={bold:Ct,red:Ne,green:hn,dim:Tt,enabled:!0},Je={write(e){e.writeLine(",")}};u();c();m();p();d();l();var pe=class{constructor(t){this.contents=t;this.isUnderlined=!1;this.color=t=>t}underline(){return this.isUnderlined=!0,this}setColor(t){return this.color=t,this}write(t){let r=t.getCurrentLineLength();t.write(this.color(this.contents)),this.isUnderlined&&t.afterNextNewline(()=>{t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length)))})}};u();c();m();p();d();l();var Ee=class{constructor(){this.hasError=!1}markAsError(){return this.hasError=!0,this}};var We=class extends Ee{constructor(){super(...arguments);this.items=[]}addItem(r){return this.items.push(new Ft(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(n=>n.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let n=new pe("[]");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithItems(r){let{colors:n}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(Je,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(n.red("~".repeat(this.getPrintWidth())))})}asObject(){}};u();c();m();p();d();l();var Yn=": ",Ut=class{constructor(t,r){this.name=t;this.value=r;this.hasError=!1}markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+Yn.length}write(t){let r=new pe(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(Yn).write(this.value)}};u();c();m();p();d();l();var $t=class e extends Ee{constructor(){super(...arguments);this.fields={};this.suggestions=[]}addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[n,...i]=r,o=this.getField(n);if(!o)return;let s=o;for(let a of i){let f;if(s.value instanceof e?f=s.value.getField(a):s.value instanceof We&&(f=s.value.getField(Number(a))),!f)return;s=f}return s}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let n=this;for(let i of r){if(!(n instanceof e))return;let o=n.getSubSelectionValue(i);if(!o)return;n=o}return n}getDeepSelectionParent(r){let n=this.getSelectionParent();if(!n)return;let i=n;for(let o of r){let s=i.value.getFieldValue(o);if(!s||!(s instanceof e))return;let a=s.getSelectionParent();if(!a)return;i=a}return i}getSelectionParent(){let r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let n=this.getField("include")?.value.asObject();if(n)return{kind:"include",value:n}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(i=>i.getPrintWidth()))+2}write(r){let n=Object.values(this.fields);if(n.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,n)}asObject(){return this}writeEmpty(r){let n=new pe("{}");this.hasError&&n.setColor(r.context.colors.red).underline(),r.write(n)}writeWithContents(r,n){r.writeLine("{").withIndent(()=>{r.writeJoined(Je,[...n,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};u();c();m();p();d();l();var G=class extends Ee{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new pe(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var Mr=class{constructor(t){this.errorMessages=[];this.arguments=t}write(t){t.write(this.arguments)}addErrorMessage(t){this.errorMessages.push(t)}renderAllMessages(t){return this.errorMessages.map(r=>r(t)).join(` -`)}};function Vt(e){return new Mr(Xn(e))}function Xn(e){let t=new $t;for(let[r,n]of Object.entries(e)){let i=new Ut(r,Zn(n));t.addField(i)}return t}function Zn(e){if(typeof e=="string")return new G(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new G(String(e));if(typeof e=="bigint")return new G(`${e}n`);if(e===null)return new G("null");if(e===void 0)return new G("undefined");if(je(e))return new G(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return y.isBuffer(e)?new G(`Buffer.alloc(${e.byteLength})`):new G(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=Dt(e)?e.toISOString():"Invalid Date";return new G(`new Date("${t}")`)}return e instanceof be?new G(`Prisma.${e._getName()}`):Qe(e)?new G(`prisma.${Hn(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?bs(e):typeof e=="object"?Xn(e):new G(Object.prototype.toString.call(e))}function bs(e){let t=new We;for(let r of e)t.addItem(Zn(r));return t}function ei(e){if(e===void 0)return"";let t=Vt(e);return new Ve(0,{colors:Bt}).write(t).toString()}u();c();m();p();d();l();var ws="P2037";function qt({error:e,user_facing_error:t},r,n){return t.error_code?new Q(Es(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new J(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function Es(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===ws&&(r+=` -Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Ir=class{getLocation(){return null}};function xe(e){return typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new Ir}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var ti={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Ge(e={}){let t=Ps(e);return Object.entries(t).reduce((n,[i,o])=>(ti[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function Ps(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function jt(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function ri(e,t){let r=jt(e);return t({action:"aggregate",unpacker:r,argsMapper:Ge})(e)}u();c();m();p();d();l();function vs(e={}){let{select:t,...r}=e;return typeof t=="object"?Ge({...r,_count:t}):Ge({...r,_count:{_all:!0}})}function Cs(e={}){return typeof e.select=="object"?t=>jt(e)(t)._count:t=>jt(e)(t)._count._all}function ni(e,t){return t({action:"count",unpacker:Cs(e),argsMapper:vs})(e)}u();c();m();p();d();l();function Ts(e={}){let t=Ge(e);if(Array.isArray(t.by))for(let r of t.by)typeof r=="string"&&(t.select[r]=!0);else typeof t.by=="string"&&(t.select[t.by]=!0);return t}function As(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function ii(e,t){return t({action:"groupBy",unpacker:As(e),argsMapper:Ts})(e)}function oi(e,t,r){if(t==="aggregate")return n=>ri(n,r);if(t==="count")return n=>ni(n,r);if(t==="groupBy")return n=>ii(n,r)}u();c();m();p();d();l();function si(e,t){let r=t.fields.filter(i=>!i.relationName),n=vr(r,i=>i.name);return new Proxy({},{get(i,o){if(o in i||typeof o=="symbol")return i[o];let s=n[o];if(s)return new mt(e,o,s.type,s.isList,s.kind==="enum")},...It(Object.keys(n))})}u();c();m();p();d();l();u();c();m();p();d();l();var ai=e=>Array.isArray(e)?e:e.split("."),_r=(e,t)=>ai(t).reduce((r,n)=>r&&r[n],e),li=(e,t,r)=>ai(t).reduceRight((n,i,o,s)=>Object.assign({},_r(e,s.slice(0,o)),{[i]:n}),r);function Rs(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Ss(e,t,r){return t===void 0?e??{}:li(t,r,e||!0)}function Dr(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((f,v)=>({...f,[v.name]:v}),{});return f=>{let v=xe(e._errorFormat),C=Rs(n,i),T=Ss(f,o,C),O=r({dataPath:C,callsite:v})(T),R=Os(e,t);return new Proxy(O,{get(L,S){if(!R.includes(S))return L[S];let ne=[a[S].type,r,S],z=[C,T];return Dr(e,...ne,...z)},...It([...R,...Object.getOwnPropertyNames(O)])})}}function Os(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}u();c();m();p();d();l();u();c();m();p();d();l();var ks=_e(_n());var Ls={red:Ne,gray:wn,dim:Tt,bold:Ct,underline:gn,highlightSource:e=>e.highlight()},Ms={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Is({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function _s({functionName:e,location:t,message:r,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],f=t?" in":":";if(n?(a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)),a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${f}`))):a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${f}`)),t&&a.push(s.underline(Ds(t))),i){a.push("");let v=[i.toString()];o&&(v.push(o),v.push(s.dim(")"))),a.push(v.join("")),o&&a.push("")}else a.push(""),o&&a.push(o),a.push("");return a.push(r),a.join(` -`)}function Ds(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function Ke(e){let t=e.showColors?Ls:Ms,r;return typeof $getTemplateParameters<"u"?r=$getTemplateParameters(e,t):r=Is(e),_s(r,t)}function ui(e,t,r,n){return e===Oe.ModelAction.findFirstOrThrow||e===Oe.ModelAction.findUniqueOrThrow?Fs(t,r,n):n}function Fs(e,t,r){return async n=>{if("rejectOnNotFound"in n.args){let o=Ke({originalMethod:n.clientMethod,callsite:n.callsite,message:"'rejectOnNotFound' option is not supported"});throw new W(o,{clientVersion:t})}return await r(n).catch(o=>{throw o instanceof Q&&o.code==="P2025"?new he(`No ${e} found`,t):o})}}u();c();m();p();d();l();function de(e){return e.replace(/^./,t=>t.toLowerCase())}var Ns=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Bs=["aggregate","count","groupBy"];function Fr(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Us(e,t),Vs(e,t),ct(r),H("name",()=>t),H("$name",()=>t),H("$parent",()=>e._appliedParent)];return me({},n)}function Us(e,t){let r=de(t),n=Object.keys(Oe.ModelAction).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=f=>e._request(f);s=ui(o,t,e._clientVersion,s);let a=f=>v=>{let C=xe(e._errorFormat);return e._createPrismaPromise(T=>{let O={args:v,dataPath:[],action:o,model:t,clientMethod:`${r}.${i}`,jsModelName:r,transaction:T,callsite:C};return s({...O,...f})})};return Ns.includes(o)?Dr(e,t,a):$s(i)?oi(e,i,a):a({})}}}function $s(e){return Bs.includes(e)}function Vs(e,t){return Me(H("fields",()=>{let r=e._runtimeDataModel.models[t];return si(t,r)}))}u();c();m();p();d();l();function ci(e){return e.replace(/^./,t=>t.toUpperCase())}var Nr=Symbol();function pt(e){let t=[qs(e),H(Nr,()=>e),H("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(ct(r)),me(e,t)}function qs(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(de),n=[...new Set(t.concat(r))];return Me({getKeys(){return n},getPropertyValue(i){let o=ci(i);if(e._runtimeDataModel.models[o]!==void 0)return Fr(e,o);if(e._runtimeDataModel.models[i]!==void 0)return Fr(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function mi(e){return e[Nr]?e[Nr]:e}function pi(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return pt(t)}u();c();m();p();d();l();u();c();m();p();d();l();function di({result:e,modelName:t,select:r,omit:n,extensions:i}){let o=i.getAllComputedFields(t);if(!o)return e;let s=[],a=[];for(let f of Object.values(o)){if(n){if(n[f.name])continue;let v=f.needs.filter(C=>n[C]);v.length>0&&a.push($e(v))}else if(r){if(!r[f.name])continue;let v=f.needs.filter(C=>!r[C]);v.length>0&&a.push($e(v))}js(e,f.needs)&&s.push(Qs(f,me(e,s)))}return s.length>0||a.length>0?me(e,[...s,...a]):e}function js(e,t){return t.every(r=>Pr(e,r))}function Qs(e,t){return Me(H(e.name,()=>e.compute(t)))}u();c();m();p();d();l();function Qt({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;sC.name===o);if(!f||f.kind!=="object"||!f.relationName)continue;let v=typeof s=="object"?s:{};t[o]=Qt({visitor:i,result:t[o],args:v,modelName:f.type,runtimeDataModel:n})}}function gi({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Qt({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(s,a,f)=>di({result:s,modelName:de(a),select:f.select,omit:f.omit,extensions:n})})}u();c();m();p();d();l();u();c();m();p();d();l();l();function hi(e){if(e instanceof X)return Js(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.kind==="batch"&&t.transaction.lock.then(),t.transaction=i),n===r.length?e._executeRequest(t):r[n]({model:t.model,operation:t.model?t.action:t.clientMethod,args:hi(t.args??{}),__internalParams:t,query:(s,a=t)=>{let f=a.customDataProxyFetch;return a.customDataProxyFetch=Pi(o,f),a.args=s,bi(e,a,r,n+1)}})})}function wi(e,t){let{jsModelName:r,action:n,clientMethod:i}=t,o=r?n:i;if(e._extensions.isEmpty())return e._executeRequest(t);let s=e._extensions.getAllQueryCallbacks(r??"$none",o);return bi(e,t,s)}function Ei(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?xi(r,n,0,e):e(r)}}function xi(e,t,r,n){if(r===t.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return t[r]({args:{queries:e.requests.map(s=>({model:s.modelName,operation:s.action,args:s.args})),transaction:o?{isolationLevel:o.kind==="batch"?o.isolationLevel:void 0}:void 0},__internalParams:e,query(s,a=e){let f=a.customDataProxyFetch;return a.customDataProxyFetch=Pi(i,f),xi(a,t,r+1,n)}})}var yi=e=>e;function Pi(e=yi,t=yi){return r=>e(t(r))}u();c();m();p();d();l();u();c();m();p();d();l();function Ci(e,t,r){let n=de(r);return!t.result||!(t.result.$allModels||t.result[n])?e:Ws({...e,...vi(t.name,e,t.result.$allModels),...vi(t.name,e,t.result[n])})}function Ws(e){let t=new ce,r=(n,i)=>t.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>r(o,i)):[n]));return Be(e,n=>({...n,needs:r(n.name,new Set)}))}function vi(e,t,r){return r?Be(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:Gs(t,o,i)})):{}}function Gs(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function Ti(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(e[n.name])for(let i of n.needs)r[i]=!0;return r}function Ai(e,t){if(!t)return e;let r={...e};for(let n of Object.values(t))if(!e[n.name])for(let i of n.needs)delete r[i];return r}var Jt=class{constructor(t,r){this.extension=t;this.previous=r;this.computedFieldsCache=new ce;this.modelExtensionsCache=new ce;this.queryCallbacksCache=new ce;this.clientExtensions=it(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());this.batchCallbacks=it(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t})}getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>Ci(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=de(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],i=[],o=this.extension.query;return!o||!(o[t]||o.$allModels||o[r]||o.$allOperations)?n:(o[t]!==void 0&&(o[t][r]!==void 0&&i.push(o[t][r]),o[t].$allOperations!==void 0&&i.push(o[t].$allOperations)),t!=="$none"&&o.$allModels!==void 0&&(o.$allModels[r]!==void 0&&i.push(o.$allModels[r]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[r]!==void 0&&i.push(o[r]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},Wt=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Jt(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Jt(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};u();c();m();p();d();l();var Ri=ee("prisma:client"),Si={Vercel:"vercel","Netlify CI":"netlify"};function Oi({postinstall:e,ciName:t,clientVersion:r}){if(Ri("checkPlatformCaching:postinstall",e),Ri("checkPlatformCaching:ciName",t),e===!0&&t&&t in Si){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process. - -Learn how: https://pris.ly/d/${Si[t]}-build`;throw console.error(n),new I(n,r)}}u();c();m();p();d();l();function ki(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Ks="Cloudflare-Workers",Hs="node";function Li(){return typeof Netlify=="object"?"netlify":typeof EdgeRuntime=="string"?"edge-light":globalThis.navigator?.userAgent===Ks?"workerd":globalThis.Deno?"deno":globalThis.__lagon__?"lagon":globalThis.process?.release?.name===Hs?"node":globalThis.Bun?"bun":globalThis.fastly?"fastly":"unknown"}var zs={node:"Node.js",workerd:"Cloudflare Workers",deno:"Deno and Deno Deploy",netlify:"Netlify Edge Functions","edge-light":"Vercel Edge Functions or Edge Middleware"};function Pe(){let e=Li();return{id:e,prettyName:zs[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}u();c();m();p();d();l();u();c();m();p();d();l();function Gt({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 Pe().id==="workerd"?new I(`error: Environment variable not found: ${s.fromEnvVar}. - -In Cloudflare module Workers, environment variables are available only in the Worker's \`env\` parameter of \`fetch\`. -To solve this, provide the connection string directly: https://pris.ly/d/cloudflare-datasource-url`,n):new I(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new I("error: Missing URL environment variable, value, or override.",n);return i}u();c();m();p();d();l();u();c();m();p();d();l();function Mi(e){if(e?.kind==="itx")return e.options.id}u();c();m();p();d();l();var Br,Ii={async loadLibrary(e){let{clientVersion:t,adapter:r,engineWasm:n}=e;if(r===void 0)throw new I(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Pe().prettyName})`,t);if(n===void 0)throw new I("WASM engine was unexpectedly `undefined`",t);Br===void 0&&(Br=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new I("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let a={"./query_engine_bg.js":o},f=new WebAssembly.Instance(s,a);return o.__wbg_set_wasm(f.exports),o.QueryEngine})());let i=await Br;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var Ys="P2036",fe=ee("prisma:client:libraryEngine");function Xs(e){return e.item_type==="query"&&"query"in e}function Zs(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var MC=[...Er,"native"],_i=0,ft=class{constructor(t,r){this.name="LibraryEngine";this.libraryLoader=r??Ii,this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary(),this.checkForTooManyEngines()}checkForTooManyEngines(){_i===10&&console.warn(`${At("warn(prisma-client)")} This is the 10th instance of Prisma Client being started. Make sure this is intentional.`)}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(t,r,n){await this.start();let i=JSON.stringify(r),o;if(t==="start"){let a=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});o=await this.engine?.startTransaction(a,i)}else t==="commit"?o=await this.engine?.commitTransaction(n.id,i):t==="rollback"&&(o=await this.engine?.rollbackTransaction(n.id,i));let s=this.parseEngineResponse(o);if(ea(s)){let a=this.getExternalAdapterError(s);throw a?a.error:new Q(s.message,{code:s.error_code,clientVersion:this.config.clientVersion,meta:s.meta})}return s}async instantiateLibrary(){if(fe("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;this.binaryTarget=await this.getCurrentBinaryTarget(),await this.loadEngine(),this.version()}async getCurrentBinaryTarget(){}parseEngineResponse(t){if(!t)throw new J("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new J("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new b(this),{adapter:r}=this.config;r&&fe("Using driver adapter: %O",r),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:g.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{t.deref()?.logger(n)},r),_i++}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new I(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);if(r){if("span"in r){this.config.tracingHelper.createEngineSpan(r);return}r.level=r?.level.toLowerCase()??"unknown",Xs(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):(Zs(r),this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path}))}}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return fe(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{fe("library starting");try{let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,fe("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new I(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return fe("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),fe("library stopping");let r={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,fe("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){fe(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new J(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof I)throw s;s.code==="GenericFailure"&&s.message?.startsWith("PANIC:");let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new J(`${a.message} -${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){fe("requestBatch");let i=_t(t,r);await this.start(),this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Mi(r));let o=await this.executingQueryPromise,s=this.parseEngineResponse(o);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new J(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});let{batchResult:a,errors:f}=s;if(Array.isArray(a))return a.map(v=>v.errors&&v.errors.length>0?this.loggerRustPanic??this.buildQueryError(v.errors[0]):{data:v,elapsed:0});throw f&&f.length===1?new Error(f[0].error):new Error(JSON.stringify(s))}buildQueryError(t){t.user_facing_error.is_panic;let r=this.getExternalAdapterError(t.user_facing_error);return r?r.error:qt(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t){if(t.error_code===Ys&&this.config.adapter){let r=t.meta?.id;Ot(typeof r=="number","Malformed external JS error received from the engine");let n=this.config.adapter.errorRegistry.consumeError(r);return Ot(n,"External error with reported id was not registered"),n}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function ea(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}u();c();m();p();d();l();var gt="Accelerate has not been setup correctly. Make sure your client is using `.$extends(withAccelerate())`. See https://pris.ly/d/accelerate-getting-started",Kt=class{constructor(t){this.config=t;this.name="AccelerateEngine";this.resolveDatasourceUrl=this.config.accelerateUtils?.resolveDatasourceUrl;this.getBatchRequestPayload=this.config.accelerateUtils?.getBatchRequestPayload;this.prismaGraphQLToJSError=this.config.accelerateUtils?.prismaGraphQLToJSError;this.PrismaClientUnknownRequestError=this.config.accelerateUtils?.PrismaClientUnknownRequestError;this.PrismaClientInitializationError=this.config.accelerateUtils?.PrismaClientInitializationError;this.PrismaClientKnownRequestError=this.config.accelerateUtils?.PrismaClientKnownRequestError;this.debug=this.config.accelerateUtils?.debug;this.engineVersion=this.config.accelerateUtils?.engineVersion;this.clientVersion=this.config.accelerateUtils?.clientVersion}onBeforeExit(t){}async start(){}async stop(){}version(t){return"unknown"}transaction(t,r,n){throw new I(gt,this.config.clientVersion)}metrics(t){throw new I(gt,this.config.clientVersion)}request(t,r){throw new I(gt,this.config.clientVersion)}requestBatch(t,r){throw new I(gt,this.config.clientVersion)}applyPendingMigrations(){throw new I(gt,this.config.clientVersion)}};function Di({copyEngine:e=!0},t){let r;try{r=Gt({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...g.env},clientVersion:t.clientVersion})}catch{}e&&r?.startsWith("prisma://")&&nt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let n=et(t.generator),i=!!(r?.startsWith("prisma://")||!e),o=!!t.adapter,s=n==="library",a=n==="binary";if(i&&o||o&&!1){let f;throw e?r?.startsWith("prisma://")?f=["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."]:f=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:f=["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 W(f.join(` -`),{clientVersion:t.clientVersion})}if(o)return new ft(t);if(i)return new Kt(t);{let f=[`PrismaClient failed to initialize because it wasn't configured to run in this environment (${Pe().prettyName}).`,"In order to run Prisma Client in an edge runtime, you will need to configure one of the following options:","- Enable Driver Adapters: https://pris.ly/d/driver-adapters","- Enable Accelerate: https://pris.ly/d/accelerate"];throw new W(f.join(` -`),{clientVersion:t.clientVersion})}throw new W("Invalid client engine type, please use `library` or `binary`",{clientVersion:t.clientVersion})}u();c();m();p();d();l();function Ht({generator:e}){return e?.previewFeatures??[]}u();c();m();p();d();l();u();c();m();p();d();l();u();c();m();p();d();l();var Vi=_e(Ur());u();c();m();p();d();l();function Ui(e,t){let r=$i(e),n=ta(r),i=na(n);i?zt(i,t):t.addErrorMessage(()=>"Unknown error")}function $i(e){return e.errors.flatMap(t=>t.kind==="Union"?$i(t):[t])}function ta(e){let t=new Map,r=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){r.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=t.get(i);o?t.set(i,{...n,argument:{...n.argument,typeNames:ra(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function ra(e,t){return[...new Set(e.concat(t))]}function na(e){return Cr(e,(t,r)=>{let n=Ni(t),i=Ni(r);return n!==i?n-i:Bi(t)-Bi(r)})}function Ni(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Bi(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}u();c();m();p();d();l();var re=class{constructor(t,r){this.name=t;this.value=r;this.isRequired=!1}makeRequired(){return this.isRequired=!0,this}write(t){let{colors:{green:r}}=t.context;t.addMarginSymbol(r(this.isRequired?"+":"?")),t.write(r(this.name)),this.isRequired||t.write(r("?")),t.write(r(": ")),typeof this.value=="string"?t.write(r(this.value)):t.write(this.value)}};u();c();m();p();d();l();var Yt=class{constructor(){this.fields=[]}addField(t,r){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+")))}}),this}write(t){let{colors:{green:r}}=t.context;t.writeLine(r("{")).withIndent(()=>{t.writeJoined(Je,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function zt(e,t){switch(e.kind){case"MutuallyExclusiveFields":ia(e,t);break;case"IncludeOnScalar":oa(e,t);break;case"EmptySelection":sa(e,t);break;case"UnknownSelectionField":ua(e,t);break;case"UnknownArgument":ca(e,t);break;case"UnknownInputField":ma(e,t);break;case"RequiredArgumentMissing":pa(e,t);break;case"InvalidArgumentType":da(e,t);break;case"InvalidArgumentValue":fa(e,t);break;case"ValueTooLarge":ga(e,t);break;case"SomeFieldsMissing":ha(e,t);break;case"TooManyFieldsGiven":ya(e,t);break;case"Union":Ui(e,t);break;default:throw new Error("not implemented: "+e.kind)}}function ia(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.markAsError()),t.addErrorMessage(n=>`Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`)}function oa(e,t){let[r,n]=Xt(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new re(s.name,"true"));t.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${ht(s)}`:a+=".",a+=` -Note that ${s.bold("include")} statements only accept relation fields.`,a})}function sa(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(r){let n=r.getField("omit")?.value.asObject();if(n){aa(e,t,n);return}}la(e,t)}function aa(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new re(n.name,"false"));t.addErrorMessage(n=>`The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`)}function la(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),Qi(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${ht(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function ua(e,t){let[r,n]=Xt(e.selectionPath),i=t.arguments.getDeepSubSelectionValue(r)?.asObject(),o;if(i){let s=i.getFieldValue("select")?.asObject(),a=i.getFieldValue("include")?.asObject(),f=i.getFieldValue("omit")?.asObject();s?.hasField(n)?(o="select",s.getField(n)?.markAsError(),Qi(s,e.outputType)):a?.hasField(n)?(o="include",a.getField(n)?.markAsError(),ba(a,e.outputType)):f?.hasField(n)&&(o="omit",f.getField(n)?.markAsError(),wa(f,e.outputType))}t.addErrorMessage(s=>{let a=[`Unknown field ${s.red(`\`${n}\``)}`];return o&&a.push(`for ${s.bold(o)} statement`),a.push(`on model ${s.bold(`\`${e.outputType.name}\``)}.`),a.push(ht(s)),a.join(" ")})}function ca(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),Ea(n,e.arguments)),t.addErrorMessage(i=>qi(i,r,e.arguments.map(o=>o.name)))}function ma(e,t){let[r,n]=Xt(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&Ji(o,e.inputType)}t.addErrorMessage(o=>qi(o,n,e.inputType.fields.map(s=>s.name)))}function qi(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=Pa(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(ht(e)),n.join(" ")}function pa(e,t){let r;t.addErrorMessage(f=>r?.value instanceof G&&r.value.text==="null"?`Argument \`${f.green(o)}\` must not be ${f.red("null")}.`:`Argument \`${f.green(o)}\` is missing.`);let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=Xt(e.argumentPath),s=new Yt,a=n.getDeepFieldValue(i)?.asObject();if(a)if(r=a.getField(o),r&&a.removeField(o),e.inputTypes.length===1&&e.inputTypes[0].kind==="object"){for(let f of e.inputTypes[0].fields)s.addField(f.name,f.typeNames.join(" | "));a.addSuggestion(new re(o,s).makeRequired())}else{let f=e.inputTypes.map(ji).join(" | ");a.addSuggestion(new re(o,f).makeRequired())}}function ji(e){return e.kind==="list"?`${ji(e.elementType)}[]`:e.name}function da(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=Zt("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function fa(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),t.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(r)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=Zt("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function ga(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof G&&(i=s.text)}t.addErrorMessage(o=>{let s=["Unable to fit value"];return i&&s.push(o.red(i)),s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``),s.join(" ")})}function ha(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&Ji(i,e.inputType)}t.addErrorMessage(i=>{let o=[`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${Zt("or",e.constraints.requiredFields.map(s=>`\`${i.bold(s)}\``))} arguments.`):o.push(`${i.green("at least one")} argument.`):o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`),o.push(ht(i)),o.join(" ")})}function ya(e,t){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}t.addErrorMessage(o=>{let s=[`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1&&e.constraints.maxFieldCount==1?s.push(`${o.green("exactly one")} argument,`):e.constraints.maxFieldCount==1?s.push(`${o.green("at most one")} argument,`):s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`),s.push(`but you provided ${Zt("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function Qi(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new re(r.name,"true"))}function ba(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new re(r.name,"true"))}function wa(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new re(r.name,"true"))}function Ea(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new re(r.name,r.typeNames.join(" | ")))}function Ji(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new re(r.name,r.typeNames.join(" | ")))}function Xt(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function ht({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function Zt(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var xa=3;function Pa(e,t){let r=1/0,n;for(let i of t){let o=(0,Vi.default)(e,i);o>xa||o({name:t.name,typeName:"boolean",isRelation:t.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(t){return this.params.previewFeatures.includes(t)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.model?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};u();c();m();p();d();l();var Hi=e=>({command:e});u();c();m();p();d();l();u();c();m();p();d();l();var zi=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);u();c();m();p();d();l();l();function yt(e){try{return Yi(e,"fast")}catch{return Yi(e,"slow")}}function Yi(e,t){return JSON.stringify(e.map(r=>Ma(r,t)))}function Ma(e,t){return typeof e=="bigint"?{prisma__type:"bigint",prisma__value:e.toString()}:qe(e)?{prisma__type:"date",prisma__value:e.toJSON()}:ue.isDecimal(e)?{prisma__type:"decimal",prisma__value:e.toJSON()}:y.isBuffer(e)?{prisma__type:"bytes",prisma__value:e.toString("base64")}:Ia(e)||ArrayBuffer.isView(e)?{prisma__type:"bytes",prisma__value:y.from(e).toString("base64")}:typeof e=="object"&&t==="slow"?Zi(e):e}function Ia(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Zi(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Xi);let t={};for(let r of Object.keys(e))t[r]=Xi(e[r]);return t}function Xi(e){return typeof e=="bigint"?e.toString():Zi(e)}var _a=/^(\s*alter\s)/i,eo=ee("prisma:client");function qr(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&_a.exec(t))throw new Error(`Running ALTER using ${n} is not supported -Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization. - -Example: - await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`) - -More Information: https://pris.ly/d/execute-raw -`)}var jr=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:yt(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:yt(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:yt(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=zi(r),i={values:yt(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?eo(`prisma.${e}(${n}, ${i.values})`):eo(`prisma.${e}(${n})`),{query:n,parameters:i}},to={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new X(t,r)}},ro={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};u();c();m();p();d();l();function Qr(e){return function(r){let n,i=(o=e)=>{try{return o===void 0||o?.kind==="itx"?n??=no(r(o)):no(r(o))}catch(s){return Promise.reject(s)}};return{then(o,s){return i().then(o,s)},catch(o){return i().catch(o)},finally(o){return i().finally(o)},requestTransaction(o){let s=i(o);return s.requestTransaction?s.requestTransaction(o):s},[Symbol.toStringTag]:"PrismaPromise"}}}function no(e){return typeof e.then=="function"?e:Promise.resolve(e)}u();c();m();p();d();l();var io={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},async createEngineSpan(){},getActiveContext(){},runInChildSpan(e,t){return t()}},Jr=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}createEngineSpan(t){return this.getGlobalTracingHelper().createEngineSpan(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){return globalThis.PRISMA_INSTRUMENTATION?.helper??io}};function oo(e){return e.includes("tracing")?new Jr:io}u();c();m();p();d();l();function so(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}u();c();m();p();d();l();var Da=["$connect","$disconnect","$on","$transaction","$use","$extends"],ao=Da;u();c();m();p();d();l();function lo(e){return typeof e=="string"?e:e.reduce((t,r)=>{let n=typeof r=="string"?r:r.level;return n==="query"?t:t&&(r==="info"||t==="info")?"info":n},void 0)}u();c();m();p();d();l();var tr=class{constructor(){this._middlewares=[]}use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};u();c();m();p();d();l();var co=_e(Un());u();c();m();p();d();l();function rr(e){return typeof e.batchRequestIdx=="number"}u();c();m();p();d();l();l();function nr(e){return e===null?e:Array.isArray(e)?e.map(nr):typeof e=="object"?Fa(e)?Na(e):Be(e,nr):e}function Fa(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Na({$type:e,value:t}){switch(e){case"BigInt":return BigInt(t);case"Bytes":return y.from(t,"base64");case"DateTime":return new Date(t);case"Decimal":return new ue(t);case"Json":return JSON.parse(t);default:ke(t,"Unknown tagged value")}}u();c();m();p();d();l();function uo(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Wr(e.query.arguments)),t.push(Wr(e.query.selection)),t.join("")}function Wr(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Wr(n)})`:r}).join(" ")})`}u();c();m();p();d();l();var Ba={aggregate:!1,aggregateRaw:!1,createMany:!0,createManyAndReturn:!0,createOne:!0,deleteMany:!0,deleteOne:!0,executeRaw:!0,findFirst:!1,findFirstOrThrow:!1,findMany:!1,findRaw:!1,findUnique:!1,findUniqueOrThrow:!1,groupBy:!1,queryRaw:!1,runCommandRaw:!0,updateMany:!0,updateOne:!0,upsertOne:!0};function Gr(e){return Ba[e]}u();c();m();p();d();l();var ir=class{constructor(t){this.options=t;this.tickActive=!1;this.batches={}}request(t){let r=this.options.batchBy(t);return r?(this.batches[r]||(this.batches[r]=[],this.tickActive||(this.tickActive=!0,g.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[r].push({request:t,resolve:n,reject:i})})):this.options.singleLoader(t)}dispatchBatches(){for(let t in this.batches){let r=this.batches[t];delete this.batches[t],r.length===1?this.options.singleLoader(r[0].request).then(n=>{n instanceof Error?r[0].reject(n):r[0].resolve(n)}).catch(n=>{r[0].reject(n)}):(r.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(r.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i{for(let i=0;i{let{transaction:o,otelParentCtx:s}=n[0],a=n.map(T=>T.protocolQuery),f=this.client._tracingHelper.getTraceParent(s),v=n.some(T=>Gr(T.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:f,transaction:$a(o),containsWrite:v,customDataProxyFetch:i})).map((T,O)=>{if(T instanceof Error)return T;try{return this.mapQueryEngineResult(n[O],T)}catch(R){return R}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?mo(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:Gr(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:uo(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(t){try{return await this.dataloader.request(t)}catch(r){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=t;this.handleAndLogRequestError({error:r,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a})}}mapQueryEngineResult({dataPath:t,unpacker:r},n){let i=n?.data,o=n?.elapsed,s=this.unpack(i,t,r);return g.env.PRISMA_CLIENT_GET_TIME?{data:s,elapsed:o}:s}handleAndLogRequestError(t){try{this.handleRequestError(t)}catch(r){throw this.logEmitter&&this.logEmitter.emit("error",{message:r.message,target:t.clientMethod,timestamp:new Date}),r}}handleRequestError({error:t,clientMethod:r,callsite:n,transaction:i,args:o,modelName:s}){if(Ua(t),Va(t,i)||t instanceof he)throw t;if(t instanceof Q&&qa(t)){let f=po(t.meta);er({args:o,errors:[f],callsite:n,errorFormat:this.client._errorFormat,originalMethod:r,clientVersion:this.client._clientVersion})}let a=t.message;if(n&&(a=Ke({callsite:n,originalMethod:r,isPanic:t.isPanic,showColors:this.client._errorFormat==="pretty",message:a})),a=this.sanitizeMessage(a),t.code){let f=s?{modelName:s,...t.meta}:t.meta;throw new Q(a,{code:t.code,clientVersion:this.client._clientVersion,meta:f,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ye(a,this.client._clientVersion);if(t instanceof J)throw new J(a,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof I)throw new I(a,this.client._clientVersion);if(t instanceof ye)throw new ye(a,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,co.default)(t):t}unpack(t,r,n){if(!t||(t.data&&(t=t.data),!t))return t;let i=Object.values(t)[0],o=r.filter(a=>a!=="select"&&a!=="include"),s=nr(_r(i,o));return n?n(s):s}get[Symbol.toStringTag](){return"RequestHandler"}};function $a(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:mo(e)};ke(e,"Unknown transaction kind")}}function mo(e){return{id:e.id,payload:e.payload}}function Va(e,t){return rr(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function qa(e){return e.code==="P2009"||e.code==="P2012"}function po(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(po)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}u();c();m();p();d();l();var fo="5.14.0";var go=fo;u();c();m();p();d();l();l();function ho(e){return e.map(t=>{let r={};for(let n of Object.keys(t))r[n]=yo(t[n]);return r})}function yo({prisma__type:e,prisma__value:t}){switch(e){case"bigint":return BigInt(t);case"bytes":return y.from(t,"base64");case"decimal":return new ue(t);case"datetime":case"date":return new Date(t);case"time":return new Date(`1970-01-01T${t}Z`);case"array":return t.map(yo);default:return t}}u();c();m();p();d();l();var xo=_e(Ur());u();c();m();p();d();l();var N=class extends Error{constructor(t){super(t+` -Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};K(N,"PrismaClientConstructorValidationError");var bo=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","__internal"],wo=["pretty","colorless","minimal"],Eo=["info","query","warn","error"],Qa={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new N(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=He(r,t)||` Available datasources: ${t.join(", ")}`;throw new N(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new N(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new N(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new N(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor. -It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(e===null)return;if(e===void 0)throw new N('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Ht(t).includes("driverAdapters"))throw new N('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(et()==="binary")throw new N('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new N(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor. -Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new N(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!wo.includes(e)){let t=He(e,wo);throw new N(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new N(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Eo.includes(r)){let n=He(r,Eo);throw new N(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`)}}for(let r of e){t(r);let n={level:t,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=He(i,o);throw new N(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(r&&typeof r=="object")for(let[i,o]of Object.entries(r))if(n[i])n[i](o);else throw new N(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let t=e.maxWait;if(t!=null&&t<=0)throw new N(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let r=e.timeout;if(r!=null&&r<=0)throw new N(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new N(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=He(r,t);throw new N(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Po(e,t){for(let[r,n]of Object.entries(e)){if(!bo.includes(r)){let i=He(r,bo);throw new N(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Qa[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new N('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function He(e,t){if(t.length===0||typeof e!="string")return"";let r=Ja(e,t);return r?` Did you mean "${r}"?`:""}function Ja(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,xo.default)(e,i)}));r.sort((i,o)=>i.distance{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?r(i):t(n)))},f=v=>{o||(o=!0,r(v))};for(let v=0;v{n[v]=C,a()},C=>{if(!rr(C)){f(C);return}C.batchRequestIdx===v?f(C):(i||(i=C),a())})})}var ve=ee("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Wa={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Ga=Symbol.for("prisma.client.transaction.id"),Ka={id:0,nextId(){return++this.id}};function Ao(e){class t{constructor(n){this._originalClient=this;this._middlewares=new tr;this._createPrismaPromise=Qr();this.$extends=pi;e=n?.__internal?.configOverride?.(e)??e,Oi(e),n&&Po(n,e);let i=n?.adapter?Or(n.adapter):void 0,o=new St().on("error",()=>{});this._extensions=Wt.empty(),this._previewFeatures=Ht(e),this._clientVersion=e.clientVersion??go,this._activeProvider=e.activeProvider,this._tracingHelper=oo(this._previewFeatures);let s={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Ze.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Ze.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},a=e.injectableEdgeEnv?.();try{let f=n??{},v=f.__internal??{},C=v.debug===!0;C&&ee.enable("prisma:client");let T=Ze.resolve(e.dirname,e.relativePath);un.existsSync(T)||(T=e.dirname),ve("dirname",e.dirname),ve("relativePath",e.relativePath),ve("cwd",T);let O=v.engine||{};if(f.errorFormat?this._errorFormat=f.errorFormat:g.env.NODE_ENV==="production"?this._errorFormat="minimal":g.env.NO_COLOR?this._errorFormat="colorless":this._errorFormat="colorless",this._runtimeDataModel=e.runtimeDataModel,this._engineConfig={cwd:T,dirname:e.dirname,enableDebugLogs:C,allowTriggerPanic:O.allowTriggerPanic,datamodelPath:Ze.join(e.dirname,e.filename??"schema.prisma"),prismaPath:O.binaryPath??void 0,engineEndpoint:O.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:f.log&&lo(f.log),logQueries:f.log&&!!(typeof f.log=="string"?f.log==="query":f.log.find(R=>typeof R=="string"?R==="query":R.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:ki(f,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:f.transactionOptions?.maxWait??2e3,timeout:f.transactionOptions?.timeout??5e3,isolationLevel:f.transactionOptions?.isolationLevel},logEmitter:o,isBundled:e.isBundled,adapter:i},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:Gt,getBatchRequestPayload:_t,prismaGraphQLToJSError:qt,PrismaClientUnknownRequestError:J,PrismaClientInitializationError:I,PrismaClientKnownRequestError:Q,debug:ee("prisma:client:accelerateEngine"),engineVersion:To.version,clientVersion:e.clientVersion}},ve("clientVersion",e.clientVersion),this._engine=Di(e,this._engineConfig),this._requestHandler=new or(this,o),f.log)for(let R of f.log){let L=typeof R=="string"?R:R.emit==="stdout"?R.level:null;L&&this.$on(L,S=>{rt.log(`${rt.tags[L]??""}`,S.message||S.query)})}this._metrics=new Ue(this._engine)}catch(f){throw f.clientVersion=this._clientVersion,f}return this._appliedParent=pt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$on(n,i){n==="beforeExit"?this._engine.onBeforeExit(i):n&&this._engineConfig.logEmitter.on(n,i)}$connect(){try{return this._engine.start()}catch(n){throw n.clientVersion=this._clientVersion,n}}async $disconnect(){try{await this._engine.stop()}catch(n){throw n.clientVersion=this._clientVersion,n}finally{Sn()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:jr({clientMethod:i,activeProvider:a}),callsite:xe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=Co(n,i);return qr(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw``":"prisma.$executeRaw(sql``)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new W("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n",{clientVersion:this._clientVersion})})}$executeRawUnsafe(n,...i){return this._createPrismaPromise(o=>(qr(this._activeProvider,n,i,"prisma.$executeRawUnsafe(, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new W(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`,{clientVersion:this._clientVersion});return this._createPrismaPromise(i=>this._request({args:n,clientMethod:"$runCommandRaw",dataPath:[],action:"runCommandRaw",argsMapper:Hi,callsite:xe(this._errorFormat),transaction:i}))}async $queryRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"queryRaw",args:o,transaction:n,clientMethod:i,argsMapper:jr({clientMethod:i,activeProvider:a}),callsite:xe(this._errorFormat),dataPath:[],middlewareArgsMapper:s}).then(ho)}$queryRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0)return this.$queryRawInternal(o,"$queryRaw",...Co(n,i));throw new W("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n",{clientVersion:this._clientVersion})})}$queryRawUnsafe(n,...i){return this._createPrismaPromise(o=>this.$queryRawInternal(o,"$queryRawUnsafe",[n,...i]))}_transactionWithArray({promises:n,options:i}){let o=Ka.nextId(),s=so(n.length),a=n.map((f,v)=>{if(f?.[Symbol.toStringTag]!=="PrismaPromise")throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function.");let C=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,T={kind:"batch",id:o,index:v,isolationLevel:C,lock:s};return f.requestTransaction?.(T)??f});return vo(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),f;try{let v={kind:"itx",...a};f=await n(this._createItxClient(v)),await this._engine.transaction("commit",o,a)}catch(v){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),v}return f}_createItxClient(n){return pt(me(mi(this),[H("_appliedParent",()=>this._appliedParent._createItxClient(n)),H("_createPrismaPromise",()=>Qr(n)),H(Ga,()=>n.id),$e(ao)]))}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.adapterName==="@prisma/adapter-d1"?o=()=>{throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable.")}:o=()=>this._transactionWithCallback({callback:n,options:i}):o=()=>this._transactionWithArray({promises:n,options:i});let s={name:"transaction",attributes:{method:"$transaction"}};return this._tracingHelper.runInChildSpan(s,o)}_request(n){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Wa,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,f=async v=>{let C=this._middlewares.get(++a);if(C)return this._tracingHelper.runInChildSpan(s.middleware,M=>C(v,ne=>(M?.end(),f(ne))));let{runInTransaction:T,args:O,...R}=v,L={...n,...R};O&&(L.args=i.middlewareArgsToRequestArgs(O)),n.transaction!==void 0&&T===!1&&delete L.transaction;let S=await wi(this,L);return L.model?gi({result:S,modelName:L.model,args:L.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel}):S};return this._tracingHelper.runInChildSpan(s.operation,()=>f(o))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:f,argsMapper:v,transaction:C,unpacker:T,otelParentCtx:O,customDataProxyFetch:R}){try{n=v?v(n):n;let L={name:"serialize"},S=this._tracingHelper.runInChildSpan(L,()=>Wi({modelName:f,runtimeDataModel:this._runtimeDataModel,action:a,args:n,clientMethod:i,callsite:s,extensions:this._extensions,errorFormat:this._errorFormat,clientVersion:this._clientVersion,previewFeatures:this._previewFeatures}));return ee.enabled("prisma:client")&&(ve("Prisma Client call:"),ve(`prisma.${i}(${ei(n)})`),ve("Generated request:"),ve(JSON.stringify(S,null,2)+` -`)),C?.kind==="batch"&&await C.lock,this._requestHandler.request({protocolQuery:S,modelName:f,action:a,clientMethod:i,dataPath:o,callsite:s,args:n,extensions:this._extensions,transaction:C,unpacker:T,otelParentCtx:O,otelChildCtx:this._tracingHelper.getActiveContext(),customDataProxyFetch:R})}catch(L){throw L.clientVersion=this._clientVersion,L}}get $metrics(){if(!this._hasPreviewFlag("metrics"))throw new W("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:this._clientVersion});return this._metrics}_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}}return t}function Co(e,t){return Ha(e)?[new X(e,t),to]:[e,ro]}function Ha(e){return Array.isArray(e)&&Array.isArray(e.raw)}u();c();m();p();d();l();var za=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function Ro(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!za.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}u();c();m();p();d();l();l();0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,NotFoundError,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,defineDmmfProperty,empty,getPrismaClient,getRuntime,join,makeStrictEnum,objectEnumValues,raw,sqltag,warnEnvConflicts,warnOnce}); -//# sourceMappingURL=wasm.js.map diff --git a/integration-tests/tests/prisma/sqlite/client/schema.prisma b/integration-tests/tests/prisma/sqlite/client/schema.prisma deleted file mode 100644 index 40bae373c..000000000 --- a/integration-tests/tests/prisma/sqlite/client/schema.prisma +++ /dev/null @@ -1,20 +0,0 @@ -generator client { - provider = "prisma-client-js" - output = "./client" -} - -generator drizzle { - provider = "drizzle-prisma-generator" - output = "./drizzle" -} - -datasource db { - provider = "sqlite" - url = "file:./db.sqlite" -} - -model User { - id Int @id @default(autoincrement()) - email String @unique - name String? -} diff --git a/integration-tests/tests/prisma/sqlite/client/wasm.d.ts b/integration-tests/tests/prisma/sqlite/client/wasm.d.ts deleted file mode 100644 index 34c616106..000000000 --- a/integration-tests/tests/prisma/sqlite/client/wasm.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './index' \ No newline at end of file diff --git a/integration-tests/tests/prisma/sqlite/client/wasm.js b/integration-tests/tests/prisma/sqlite/client/wasm.js deleted file mode 100644 index e55c15f2f..000000000 --- a/integration-tests/tests/prisma/sqlite/client/wasm.js +++ /dev/null @@ -1,169 +0,0 @@ - -Object.defineProperty(exports, "__esModule", { value: true }); - -const { - Decimal, - objectEnumValues, - makeStrictEnum, - Public, - getRuntime, -} = require('./runtime/index-browser.js') - - -const Prisma = {} - -exports.Prisma = Prisma -exports.$Enums = {} - -/** - * Prisma Client JS version: 5.14.0 - * Query Engine version: e9771e62de70f79a5e1c604a2d7c8e2a0a874b48 - */ -Prisma.prismaVersion = { - client: "5.14.0", - engine: "e9771e62de70f79a5e1c604a2d7c8e2a0a874b48" -} - -Prisma.PrismaClientKnownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)}; -Prisma.PrismaClientUnknownRequestError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientRustPanicError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientInitializationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.PrismaClientValidationError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.NotFoundError = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.Decimal = Decimal - -/** - * Re-export of sql-template-tag - */ -Prisma.sql = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.empty = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.join = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.raw = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.validator = Public.validator - -/** -* Extensions -*/ -Prisma.getExtensionContext = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} -Prisma.defineExtension = () => { - const runtimeName = getRuntime().prettyName; - throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}). -In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`, -)} - -/** - * Shorthand utilities for JSON filtering - */ -Prisma.DbNull = objectEnumValues.instances.DbNull -Prisma.JsonNull = objectEnumValues.instances.JsonNull -Prisma.AnyNull = objectEnumValues.instances.AnyNull - -Prisma.NullTypes = { - DbNull: objectEnumValues.classes.DbNull, - JsonNull: objectEnumValues.classes.JsonNull, - AnyNull: objectEnumValues.classes.AnyNull -} - -/** - * Enums - */ - -exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ - Serializable: 'Serializable' -}); - -exports.Prisma.UserScalarFieldEnum = { - id: 'id', - email: 'email', - name: 'name' -}; - -exports.Prisma.SortOrder = { - asc: 'asc', - desc: 'desc' -}; - -exports.Prisma.NullsOrder = { - first: 'first', - last: 'last' -}; - - -exports.Prisma.ModelName = { - User: 'User' -}; - -/** - * This is a stub Prisma Client that will error at runtime if called. - */ -class PrismaClient { - constructor() { - return new Proxy(this, { - get(target, prop) { - let message - const runtime = getRuntime() - if (runtime.isEdge) { - message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either: -- Use Prisma Accelerate: https://pris.ly/d/accelerate -- Use Driver Adapters: https://pris.ly/d/driver-adapters -`; - } else { - message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).' - } - - message += ` -If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report` - - throw new Error(message) - } - }) - } -} - -exports.PrismaClient = PrismaClient - -Object.assign(exports, Prisma) diff --git a/integration-tests/tests/prisma/sqlite/drizzle/schema.ts b/integration-tests/tests/prisma/sqlite/drizzle/schema.ts deleted file mode 100644 index 710084d82..000000000 --- a/integration-tests/tests/prisma/sqlite/drizzle/schema.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { int, sqliteTable, text } from 'drizzle-orm/sqlite-core' - -export const User = sqliteTable('User', { - id: int('id').notNull().primaryKey(), - email: text('email').notNull().unique(), - name: text('name') -}); \ No newline at end of file diff --git a/integration-tests/tests/singlestore/test-docker.js b/integration-tests/tests/singlestore/test-docker.js index ec00dd191..f937ef99f 100644 --- a/integration-tests/tests/singlestore/test-docker.js +++ b/integration-tests/tests/singlestore/test-docker.js @@ -1,9 +1,9 @@ import Docker from 'dockerode'; import getPort from 'get-port'; -import { v4 as uuid } from 'uuid'; -import mysql from 'mysql2/promise'; +import * as mysql2 from 'mysql2/promise'; import path from 'path'; import { fileURLToPath } from 'url'; +import { v4 as uuid } from 'uuid'; const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file const __dirname = path.dirname(__filename); // get the name of the directory @@ -21,23 +21,23 @@ const image = 'ghcr.io/singlestore-labs/singlestoredb-dev:latest'; console.log('Pulling the SingleStoreDB Dev image...'); const pullStream = await docker.pull(image); await new Promise((resolve, reject) => - docker.modem.followProgress(pullStream, (err) => (err ? reject(err) : resolve(err))) + docker.modem.followProgress(pullStream, (err) => (err ? reject(err) : resolve(err))) ); console.log('Image pulled successfully.'); console.log('Creating the SingleStoreDB container...'); singlestoreContainer = await docker.createContainer({ - Image: image, - Env: ['ROOT_PASSWORD=singlestore'], - name: `drizzle-integration-tests-${uuid()}`, - HostConfig: { - AutoRemove: true, - PortBindings: { - '3306/tcp': [{ HostPort: `${port}` }], - '8080/tcp': [{ HostPort: '8080' }], - }, - Binds: [`${initSqlPath}:/init.sql`], - }, + Image: image, + Env: ['ROOT_PASSWORD=singlestore'], + name: `drizzle-integration-tests-${uuid()}`, + HostConfig: { + AutoRemove: true, + PortBindings: { + '3306/tcp': [{ HostPort: `${port}` }], + '8080/tcp': [{ HostPort: '8080' }], + }, + Binds: [`${initSqlPath}:/init.sql`], + }, }); console.log('Container created successfully.'); @@ -47,11 +47,11 @@ await new Promise((resolve) => setTimeout(resolve, 4000)); console.log('Container started.'); console.log('Connecting to the database...'); -const connection = await mysql.createConnection({ - host: 'localhost', - port: port, - user: 'root', - password: 'singlestore', +const connection = await mysql2.createConnection({ + host: 'localhost', + port: port, + user: 'root', + password: 'singlestore', }); console.log('Database connection established.'); diff --git a/integration-tests/vitest.config.ts b/integration-tests/vitest.config.ts index 0d6bfa4f0..0b0d5414b 100644 --- a/integration-tests/vitest.config.ts +++ b/integration-tests/vitest.config.ts @@ -14,7 +14,7 @@ export default defineConfig({ 'tests/imports/**/*', 'tests/extensions/vectors/**/*', 'tests/version.test.ts', - 'tests/singlestore/**/*.test.ts' + 'tests/singlestore/**/singlestore-custom.test.ts', ], exclude: [ ...(process.env.SKIP_EXTERNAL_DB_TESTS @@ -37,7 +37,6 @@ export default defineConfig({ // Have a strange "invalid SQL: ERROR: must be owner of schema public" error. Will need to check with xata team 'tests/pg/xata-http.test.ts', 'tests/pg/neon-http-batch.ts', - 'tests/singlestore/singlestore-proxy.test.ts' ], typecheck: { tsconfig: 'tsconfig.json', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a00bfe96..2efde2b79 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -45,15 +45,7 @@ importers: version: link:drizzle-orm/dist drizzle-orm-old: specifier: npm:drizzle-orm@^0.27.2 -<<<<<<< HEAD -<<<<<<< HEAD - version: drizzle-orm@0.27.2(@aws-sdk/client-rds-data@3.583.0)(@cloudflare/workers-types@4.20240524.0)(@libsql/client@0.5.6)(@neondatabase/serverless@0.9.3)(@opentelemetry/api@1.8.0)(@planetscale/database@1.18.0)(@types/better-sqlite3@7.6.10)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(@vercel/postgres@0.8.0)(better-sqlite3@9.6.0)(bun-types@1.0.3)(knex@2.5.1(better-sqlite3@9.6.0)(mysql2@3.11.0)(pg@8.11.5)(sqlite3@5.1.7))(kysely@0.25.0)(mysql2@3.11.0)(pg@8.11.5)(postgres@3.4.4)(sql.js@1.10.3)(sqlite3@5.1.7) -======= - version: drizzle-orm@0.27.2(@aws-sdk/client-rds-data@3.583.0)(@cloudflare/workers-types@4.20240524.0)(@libsql/client@0.6.0)(@neondatabase/serverless@0.9.3)(@opentelemetry/api@1.8.0)(@planetscale/database@1.18.0)(@types/better-sqlite3@7.6.10)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(@vercel/postgres@0.8.0)(better-sqlite3@10.0.0)(bun-types@1.0.3)(knex@3.1.0(better-sqlite3@10.0.0)(mysql2@3.9.8)(pg@8.11.5)(sqlite3@5.1.7))(kysely@0.27.3)(mysql2@3.9.8)(pg@8.11.5)(postgres@3.4.4)(sql.js@1.10.3)(sqlite3@5.1.7) ->>>>>>> 4bc4c8f6 (singlestore custom integration tests pass) -======= version: drizzle-orm@0.27.2(@aws-sdk/client-rds-data@3.583.0)(@cloudflare/workers-types@4.20240524.0)(@libsql/client@0.5.6(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3))(@neondatabase/serverless@0.9.3)(@opentelemetry/api@1.8.0)(@planetscale/database@1.18.0)(@types/better-sqlite3@7.6.10)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(@vercel/postgres@0.8.0)(better-sqlite3@9.6.0)(bun-types@1.0.3)(knex@2.5.1(better-sqlite3@9.6.0)(mysql2@3.11.0)(pg@8.11.5)(sqlite3@5.1.7))(kysely@0.25.0)(mysql2@3.11.0)(pg@8.11.5)(postgres@3.4.4)(sql.js@1.10.3)(sqlite3@5.1.7) ->>>>>>> 3877a72f (update brocli version) eslint: specifier: ^8.50.0 version: 8.50.0 @@ -100,13 +92,8 @@ importers: drizzle-kit: dependencies: '@drizzle-team/brocli': -<<<<<<< HEAD specifier: ^0.10.1 version: 0.10.1 -======= - specifier: ^0.10.0 - version: 0.10.0 ->>>>>>> 3877a72f (update brocli version) '@esbuild-kit/esm-loader': specifier: ^2.5.5 version: 2.5.5 @@ -1987,13 +1974,8 @@ packages: cpu: [x64] os: [win32] -<<<<<<< HEAD '@drizzle-team/brocli@0.10.1': resolution: {integrity: sha512-AHy0vjc+n/4w/8Mif+w86qpppHuF3AyXbcWW+R/W7GNA3F5/p2nuhlkCJaTXSLZheB4l1rtHzOfr9A7NwoR/Zg==} -======= - '@drizzle-team/brocli@0.10.0': - resolution: {integrity: sha512-razqxuTZizzm14gtockWvc3L0m320QuuzTgeNmX3e32dE5JWQ5jhb5tjnFpdkHFQGoYSDXrhEQgRPZ74kB+8cw==} ->>>>>>> 3877a72f (update brocli version) '@drizzle-team/studio@0.0.5': resolution: {integrity: sha512-ps5qF0tMxWRVu+V5gvCRrQNqlY92aTnIKdq27gm9LZMSdaKYZt6AVvSK1dlUMzs6Rt0Jm80b+eWct6xShBKhIw==} @@ -12390,11 +12372,7 @@ snapshots: '@dprint/win32-x64@0.46.3': optional: true -<<<<<<< HEAD '@drizzle-team/brocli@0.10.1': {} -======= - '@drizzle-team/brocli@0.10.0': {} ->>>>>>> 3877a72f (update brocli version) '@drizzle-team/studio@0.0.5': {} @@ -16349,11 +16327,7 @@ snapshots: transitivePeerDependencies: - supports-color -<<<<<<< HEAD - drizzle-orm@0.27.2(@aws-sdk/client-rds-data@3.583.0)(@cloudflare/workers-types@4.20240524.0)(@libsql/client@0.5.6)(@neondatabase/serverless@0.9.3)(@opentelemetry/api@1.8.0)(@planetscale/database@1.18.0)(@types/better-sqlite3@7.6.10)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(@vercel/postgres@0.8.0)(better-sqlite3@9.6.0)(bun-types@1.0.3)(knex@2.5.1(better-sqlite3@9.6.0)(mysql2@3.11.0)(pg@8.11.5)(sqlite3@5.1.7))(kysely@0.25.0)(mysql2@3.11.0)(pg@8.11.5)(postgres@3.4.4)(sql.js@1.10.3)(sqlite3@5.1.7): -======= drizzle-orm@0.27.2(@aws-sdk/client-rds-data@3.583.0)(@cloudflare/workers-types@4.20240524.0)(@libsql/client@0.5.6(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@6.0.3))(@neondatabase/serverless@0.9.3)(@opentelemetry/api@1.8.0)(@planetscale/database@1.18.0)(@types/better-sqlite3@7.6.10)(@types/pg@8.11.6)(@types/sql.js@1.4.9)(@vercel/postgres@0.8.0)(better-sqlite3@9.6.0)(bun-types@1.0.3)(knex@2.5.1(better-sqlite3@9.6.0)(mysql2@3.11.0)(pg@8.11.5)(sqlite3@5.1.7))(kysely@0.25.0)(mysql2@3.11.0)(pg@8.11.5)(postgres@3.4.4)(sql.js@1.10.3)(sqlite3@5.1.7): ->>>>>>> 3877a72f (update brocli version) optionalDependencies: '@aws-sdk/client-rds-data': 3.583.0 '@cloudflare/workers-types': 4.20240524.0 @@ -19040,7 +19014,6 @@ snapshots: seq-queue: 0.0.5 sqlstring: 2.3.3 -<<<<<<< HEAD mysql2@3.3.3: dependencies: denque: 2.1.0 @@ -19053,8 +19026,6 @@ snapshots: sqlstring: 2.3.3 optional: true -======= ->>>>>>> 3877a72f (update brocli version) mz@2.7.0: dependencies: any-promise: 1.3.0