@prisma/internals 6.3.0-integration-engines-6-3-0-6-integration-5-22-0-with-simplified-typeinfo-c7d99d9db5129d8b35986b8518c7f10bc8580e03.1 → 6.3.0-integration-simpler-typeinfo-query.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/{chunk-3DMEILBC.js → chunk-2DXAGCPS.js} +11 -11
  2. package/dist/{chunk-4B7QW7H5.js → chunk-2WJPHJ2I.js} +5 -5
  3. package/dist/{chunk-MGZOEY6N.js → chunk-3U2ANLD3.js} +6 -6
  4. package/dist/{chunk-MPJLR4LI.js → chunk-44JHENE6.js} +41 -14
  5. package/dist/{chunk-KQOJB3ZW.js → chunk-4NFLAUKD.js} +70 -70
  6. package/dist/chunk-4RWCRJYD.js +166 -0
  7. package/dist/{chunk-5MCWLJSR.js → chunk-5I4BOTBV.js} +9 -3
  8. package/dist/{chunk-ITRA3ERO.js → chunk-5R7AZFMV.js} +5 -5
  9. package/dist/{chunk-LDTCWMJN.js → chunk-5UJZARUY.js} +17 -17
  10. package/dist/{chunk-E2GS2B3X.js → chunk-67KWF6KB.js} +5 -5
  11. package/dist/{chunk-ZZLZJFQD.js → chunk-B44XJG7K.js} +5 -5
  12. package/dist/{chunk-6HMDWGVB.js → chunk-CKVVVLEH.js} +8 -8
  13. package/dist/{chunk-UWA3O2GR.js → chunk-COFXY6NH.js} +41 -14
  14. package/dist/chunk-D4MCOTL5.js +122 -0
  15. package/dist/{chunk-3M6SPBPE.js → chunk-DFG3425X.js} +16 -16
  16. package/dist/chunk-FPHZVRV4.js +110 -0
  17. package/dist/{chunk-S57RMXZW.js → chunk-FTS2IEWX.js} +5 -5
  18. package/dist/chunk-G7LL2H2O.js +54 -0
  19. package/dist/{chunk-25RJ7YTB.js → chunk-H3T4L34H.js} +83 -88
  20. package/dist/{chunk-3BND5XB4.js → chunk-HMGEWJDY.js} +47 -232
  21. package/dist/{chunk-77IC3DNO.js → chunk-IABMG3F4.js} +5 -5
  22. package/dist/{chunk-CXEMRKV4.js → chunk-IAEMHQAC.js} +8 -8
  23. package/dist/{chunk-CZDIXJEO.js → chunk-J3JE5NVO.js} +32 -56
  24. package/dist/{chunk-N6K7M2HZ.js → chunk-J4MA2JIK.js} +5 -5
  25. package/dist/{chunk-FQ3NGUFC.js → chunk-JBUUTZQL.js} +15 -15
  26. package/dist/chunk-JMZHUHCC.js +177 -0
  27. package/dist/{chunk-D6NVMO5B.js → chunk-KNNIRRTO.js} +5 -5
  28. package/dist/{chunk-PC7HPZQJ.js → chunk-KPVPQQGU.js} +5 -5
  29. package/dist/{chunk-PJLZHXCV.js → chunk-KROMVQBD.js} +9 -9
  30. package/dist/{chunk-Z74VDPVS.js → chunk-LXIE6UJ2.js} +961 -79
  31. package/dist/{chunk-NZDTAI2U.js → chunk-MUJIYA44.js} +5 -5
  32. package/dist/{chunk-CGFXOUVQ.js → chunk-OHBFHT5Q.js} +15 -15
  33. package/dist/{chunk-UPIULDLZ.js → chunk-OSOXVAZB.js} +11 -11
  34. package/dist/chunk-RQPDQSHK.js +1429 -0
  35. package/dist/{chunk-2XRDQCIA.js → chunk-S4LINK5Y.js} +5 -5
  36. package/dist/{chunk-D3VAE4HY.js → chunk-UR3LUZY3.js} +17 -17
  37. package/dist/{chunk-EKBX4J6O.js → chunk-V2VWODV3.js} +5 -5
  38. package/dist/{chunk-FT32HRUC.js → chunk-VFU3I6P6.js} +16 -16
  39. package/dist/{chunk-TR2BJI77.js → chunk-VJQK3LHU.js} +185 -74
  40. package/dist/{chunk-V2ZF7ETH.js → chunk-WCRKL55L.js} +7 -7
  41. package/dist/{chunk-C47SCASR.js → chunk-WMIBAVWZ.js} +5 -5
  42. package/dist/{chunk-DRPRJIUE.js → chunk-WYTN2XGW.js} +5 -5
  43. package/dist/{chunk-QTXYAZFX.js → chunk-XLYQ6PQW.js} +17 -17
  44. package/dist/{chunk-VRT7T6MF.js → chunk-YDZVEVUG.js} +73 -73
  45. package/dist/{chunk-ZKAW5JSN.js → chunk-ZA3RMW2P.js} +8 -5
  46. package/dist/cli/checkUnsupportedDataProxy.js +40 -41
  47. package/dist/cli/getSchema.js +45 -46
  48. package/dist/cli/hashes.js +40 -41
  49. package/dist/engine-commands/errorHelpers.js +4 -4
  50. package/dist/engine-commands/formatSchema.js +39 -40
  51. package/dist/engine-commands/getConfig.js +13 -13
  52. package/dist/engine-commands/getDmmf.js +10 -10
  53. package/dist/engine-commands/getEngineVersion.js +8 -8
  54. package/dist/engine-commands/getEnginesMetaInfo.js +10 -10
  55. package/dist/engine-commands/index.js +50 -51
  56. package/dist/engine-commands/lintSchema.js +8 -8
  57. package/dist/engine-commands/mergeSchemas.js +10 -10
  58. package/dist/engine-commands/queryEngineCommons.js +7 -7
  59. package/dist/engine-commands/relativizePathInPSLError.js +2 -2
  60. package/dist/engine-commands/validate.js +10 -10
  61. package/dist/errorReporting.js +6 -6
  62. package/dist/get-generators/generatorResolvers/generatorResolvers.js +39 -40
  63. package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.js +3 -3
  64. package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.js +4 -4
  65. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +39 -40
  66. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.d.ts +9 -0
  67. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.js +132 -0
  68. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.js +3 -3
  69. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +40 -41
  70. package/dist/get-generators/getGenerators.js +42 -43
  71. package/dist/get-generators/utils/getBinaryPathsByVersion.js +3 -3
  72. package/dist/getPackedPackage.js +2 -2
  73. package/dist/index.d.ts +0 -1
  74. package/dist/index.js +85 -87
  75. package/dist/{multipart-parser-32AROPTR.js → multipart-parser-LCETWFPE.js} +6 -9
  76. package/dist/resolveBinary.js +7 -7
  77. package/dist/schemaEngineCommands.js +8 -8
  78. package/dist/sendPanic.js +39 -40
  79. package/dist/tracing/types.d.ts +16 -26
  80. package/dist/utils/cloudflareD1.js +3 -3
  81. package/dist/utils/getCommandWithExecutor.js +3 -3
  82. package/dist/utils/getEnvPaths.js +39 -40
  83. package/dist/utils/getGitHubIssueUrl.js +4 -4
  84. package/dist/utils/getVersionFromPackageJson.js +3 -3
  85. package/dist/utils/handleEngineLoadingErrors.js +3 -3
  86. package/dist/utils/handlePanic.js +39 -40
  87. package/dist/utils/isCurrentBinInstalledGlobally.d.ts +1 -1
  88. package/dist/utils/isCurrentBinInstalledGlobally.js +2 -2
  89. package/dist/utils/load.js +4 -4
  90. package/dist/utils/loadEnvFile.js +39 -40
  91. package/dist/utils/tryLoadEnvs.js +5 -5
  92. package/dist/wasm.js +4 -4
  93. package/package.json +12 -12
  94. package/dist/chunk-BONFK27U.js +0 -47
  95. package/dist/chunk-PPCNLYSB.js +0 -47
  96. package/dist/cli/getTypescriptVersion.d.ts +0 -1
  97. package/dist/cli/getTypescriptVersion.js +0 -25
  98. package/dist/typescript-AILDXN3I.js +0 -205230
  99. package/dist/typescript-WN4QH2CP.js +0 -205192
@@ -26,19 +26,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_3M6SPBPE_exports = {};
30
- __export(chunk_3M6SPBPE_exports, {
29
+ var chunk_DFG3425X_exports = {};
30
+ __export(chunk_DFG3425X_exports, {
31
31
  ValidateError: () => ValidateError,
32
32
  validate: () => validate
33
33
  });
34
- module.exports = __toCommonJS(chunk_3M6SPBPE_exports);
34
+ module.exports = __toCommonJS(chunk_DFG3425X_exports);
35
35
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
36
- var import_chunk_CXEMRKV4 = require("./chunk-CXEMRKV4.js");
37
- var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_E2GS2B3X = require("./chunk-E2GS2B3X.js");
36
+ var import_chunk_IAEMHQAC = require("./chunk-IAEMHQAC.js");
37
+ var import_chunk_WMIBAVWZ = require("./chunk-WMIBAVWZ.js");
38
+ var import_chunk_67KWF6KB = require("./chunk-67KWF6KB.js");
39
39
  var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
40
- var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
41
- var import_chunk_NZDTAI2U = require("./chunk-NZDTAI2U.js");
40
+ var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
41
+ var import_chunk_MUJIYA44 = require("./chunk-MUJIYA44.js");
42
42
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
43
43
  var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
44
44
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
@@ -48,11 +48,11 @@ var import_function = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_PFLLVW
48
48
  var debug = (0, import_debug.default)("prisma:validate");
49
49
  var ValidateError = class extends Error {
50
50
  constructor(params) {
51
- const constructedErrorMessage = (0, import_chunk_25RJ7YTB.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
51
+ const constructedErrorMessage = (0, import_chunk_H3T4L34H.$)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
52
52
  const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
53
53
  return `${reason}
54
54
  ${errorCodeMessage}
55
- ${(0, import_chunk_C47SCASR.relativizePathInPSLError)(message)}`;
55
+ ${(0, import_chunk_WMIBAVWZ.relativizePathInPSLError)(message)}`;
56
56
  }).with({ _tag: "unparsed" }, ({ message, reason }) => {
57
57
  const detailsHeader = (0, import_chunk_PG5FDKSF.red)((0, import_chunk_PG5FDKSF.bold)("Details:"));
58
58
  return `${reason}
@@ -60,25 +60,25 @@ ${detailsHeader} ${message}`;
60
60
  }).exhaustive();
61
61
  const errorMessageWithContext = `${constructedErrorMessage}
62
62
  [Context: validate]`;
63
- super((0, import_chunk_E2GS2B3X.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
+ super((0, import_chunk_67KWF6KB.addVersionDetailsToErrorMessage)(errorMessageWithContext));
64
64
  this.name = "ValidateError";
65
65
  }
66
66
  };
67
67
  function validate(options) {
68
- const debugErrorType = (0, import_chunk_CXEMRKV4.createDebugErrorType)(debug, "validateWasm");
68
+ const debugErrorType = (0, import_chunk_IAEMHQAC.createDebugErrorType)(debug, "validateWasm");
69
69
  debug(`Using validate Wasm`);
70
70
  const validateEither = (0, import_function.pipe)(
71
71
  (0, import_chunk_7MD6344A.tryCatch)(
72
72
  () => {
73
73
  if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
74
74
  debug("Triggering a Rust panic...");
75
- import_chunk_NZDTAI2U.prismaSchemaWasm.debug_panic();
75
+ import_chunk_MUJIYA44.prismaSchemaWasm.debug_panic();
76
76
  }
77
77
  const params = JSON.stringify({
78
78
  prismaSchema: options.schemas,
79
79
  noColor: Boolean(process.env.NO_COLOR)
80
80
  });
81
- import_chunk_NZDTAI2U.prismaSchemaWasm.validate(params);
81
+ import_chunk_MUJIYA44.prismaSchemaWasm.validate(params);
82
82
  },
83
83
  (e) => ({
84
84
  type: "wasm-error",
@@ -90,7 +90,7 @@ function validate(options) {
90
90
  if ((0, import_chunk_7MD6344A.isRight)(validateEither)) {
91
91
  return;
92
92
  }
93
- const error = (0, import_chunk_25RJ7YTB.z)(validateEither.left).with({ type: "wasm-error" }, (e) => {
93
+ const error = (0, import_chunk_H3T4L34H.$)(validateEither.left).with({ type: "wasm-error" }, (e) => {
94
94
  debugErrorType(e);
95
95
  console.error("");
96
96
  if ((0, import_chunk_A4QWQE3W.isWasmPanic)(e.error)) {
@@ -113,7 +113,7 @@ function validate(options) {
113
113
  return panic;
114
114
  }
115
115
  const errorOutput = e.error.message;
116
- return new ValidateError((0, import_chunk_CXEMRKV4.parseQueryEngineError)({ errorOutput, reason: e.reason }));
116
+ return new ValidateError((0, import_chunk_IAEMHQAC.parseQueryEngineError)({ errorOutput, reason: e.reason }));
117
117
  }).exhaustive();
118
118
  throw error;
119
119
  }
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_FPHZVRV4_exports = {};
30
+ __export(chunk_FPHZVRV4_exports, {
31
+ BinaryType: () => import_fetch_engine.BinaryType,
32
+ engineEnvVarMap: () => import_fetch_engine.engineEnvVarMap,
33
+ maybeCopyToTmp: () => maybeCopyToTmp,
34
+ resolveBinary: () => resolveBinary,
35
+ safeResolveBinary: () => safeResolveBinary
36
+ });
37
+ module.exports = __toCommonJS(chunk_FPHZVRV4_exports);
38
+ var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
39
+ var import_chunk_RQPDQSHK = require("./chunk-RQPDQSHK.js");
40
+ var import_chunk_TWSLDIFL = require("./chunk-TWSLDIFL.js");
41
+ var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
42
+ var import_chunk_TZCE3PWZ = require("./chunk-TZCE3PWZ.js");
43
+ var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
44
+ var import_engines = require("@prisma/engines");
45
+ var import_fetch_engine = require("@prisma/fetch-engine");
46
+ var import_get_platform = require("@prisma/get-platform");
47
+ var import_fs = __toESM2(require("fs"));
48
+ var import_path = __toESM2(require("path"));
49
+ var import_fs_extra = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_RQPDQSHK.require_lib)());
50
+ var import_temp_dir = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_TZCE3PWZ.require_temp_dir)());
51
+ async function getBinaryName(name) {
52
+ const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
53
+ const extension = binaryTarget === "windows" ? ".exe" : "";
54
+ if (name === import_fetch_engine.BinaryType.QueryEngineLibrary) {
55
+ return (0, import_get_platform.getNodeAPIName)(binaryTarget, "fs");
56
+ }
57
+ return `${name}-${binaryTarget}${extension}`;
58
+ }
59
+ async function resolveBinary(name, proposedPath) {
60
+ if (proposedPath && !proposedPath.match(import_chunk_M3GBKLGE.vercelPkgPathRegex) && import_fs.default.existsSync(proposedPath)) {
61
+ return proposedPath;
62
+ }
63
+ const pathFromEnvVar = (0, import_fetch_engine.getBinaryEnvVarPath)(name);
64
+ if (pathFromEnvVar !== null) {
65
+ return pathFromEnvVar.path;
66
+ }
67
+ const binaryName = await getBinaryName(name);
68
+ const prismaPath = import_path.default.join((0, import_engines.getEnginesPath)(), binaryName);
69
+ if (import_fs.default.existsSync(prismaPath)) {
70
+ return maybeCopyToTmp(prismaPath);
71
+ }
72
+ const prismaPath2 = import_path.default.join(__dirname, "..", binaryName);
73
+ if (import_fs.default.existsSync(prismaPath2)) {
74
+ return maybeCopyToTmp(prismaPath2);
75
+ }
76
+ const prismaPath3 = import_path.default.join(__dirname, "../..", binaryName);
77
+ if (import_fs.default.existsSync(prismaPath3)) {
78
+ return maybeCopyToTmp(prismaPath3);
79
+ }
80
+ const prismaPath4 = import_path.default.join(__dirname, "../runtime", binaryName);
81
+ if (import_fs.default.existsSync(prismaPath4)) {
82
+ return maybeCopyToTmp(prismaPath4);
83
+ }
84
+ throw new Error(
85
+ `Could not find ${name} binary. Searched in:
86
+ - ${prismaPath}
87
+ - ${prismaPath2}
88
+ - ${prismaPath3}
89
+ - ${prismaPath4}`
90
+ );
91
+ }
92
+ function safeResolveBinary(name, proposedPath) {
93
+ return (0, import_chunk_7MD6344A.tryCatch2)(
94
+ () => resolveBinary(name, proposedPath),
95
+ (error) => error
96
+ );
97
+ }
98
+ async function maybeCopyToTmp(file) {
99
+ const dir = eval("__dirname");
100
+ if (dir.match(import_chunk_M3GBKLGE.vercelPkgPathRegex)) {
101
+ const targetDir = import_path.default.join(import_temp_dir.default, "prisma-binaries");
102
+ await (0, import_fs_extra.ensureDir)(targetDir);
103
+ const target = import_path.default.join(targetDir, import_path.default.basename(file));
104
+ const data = await import_fs.default.promises.readFile(file);
105
+ await import_fs.default.promises.writeFile(target, data);
106
+ (0, import_chunk_TWSLDIFL.chmodPlusX)(target);
107
+ return target;
108
+ }
109
+ return file;
110
+ }
@@ -16,13 +16,13 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_S57RMXZW_exports = {};
20
- __export(chunk_S57RMXZW_exports, {
19
+ var chunk_FTS2IEWX_exports = {};
20
+ __export(chunk_FTS2IEWX_exports, {
21
21
  isYarnUsed: () => isYarnUsed
22
22
  });
23
- module.exports = __toCommonJS(chunk_S57RMXZW_exports);
24
- var import_chunk_VRT7T6MF = require("./chunk-VRT7T6MF.js");
23
+ module.exports = __toCommonJS(chunk_FTS2IEWX_exports);
24
+ var import_chunk_YDZVEVUG = require("./chunk-YDZVEVUG.js");
25
25
  async function isYarnUsed(baseDir) {
26
- const packageManager = await (0, import_chunk_VRT7T6MF.detect)({ cwd: baseDir, autoInstall: false, programmatic: true });
26
+ const packageManager = await (0, import_chunk_YDZVEVUG.detect)({ cwd: baseDir, autoInstall: false, programmatic: true });
27
27
  return packageManager === "yarn" || packageManager === "yarn@berry";
28
28
  }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chunk_G7LL2H2O_exports = {};
20
+ __export(chunk_G7LL2H2O_exports, {
21
+ getEngineVersion: () => getEngineVersion,
22
+ safeGetEngineVersion: () => safeGetEngineVersion
23
+ });
24
+ module.exports = __toCommonJS(chunk_G7LL2H2O_exports);
25
+ var import_chunk_S4LINK5Y = require("./chunk-S4LINK5Y.js");
26
+ var import_chunk_7XNZDY2V = require("./chunk-7XNZDY2V.js");
27
+ var import_chunk_FPHZVRV4 = require("./chunk-FPHZVRV4.js");
28
+ var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
29
+ var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
30
+ var import_engines = require("@prisma/engines");
31
+ var import_fetch_engine = require("@prisma/fetch-engine");
32
+ var import_get_platform = require("@prisma/get-platform");
33
+ var import_execa = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_7XNZDY2V.require_execa)());
34
+ async function getEngineVersion(enginePath, binaryName) {
35
+ if (!binaryName) {
36
+ binaryName = (0, import_engines.getCliQueryEngineBinaryType)();
37
+ }
38
+ enginePath = await (0, import_chunk_FPHZVRV4.resolveBinary)(binaryName, enginePath);
39
+ const platformInfo = await (0, import_get_platform.getPlatformInfo)();
40
+ if (binaryName === import_fetch_engine.BinaryType.QueryEngineLibrary) {
41
+ (0, import_get_platform.assertNodeAPISupported)();
42
+ const QE = (0, import_chunk_S4LINK5Y.loadLibrary)(enginePath, platformInfo);
43
+ return `${import_fetch_engine.BinaryType.QueryEngineLibrary} ${QE.version().commit}`;
44
+ } else {
45
+ const { stdout } = await (0, import_execa.default)(enginePath, ["--version"]);
46
+ return stdout;
47
+ }
48
+ }
49
+ function safeGetEngineVersion(enginePath, binaryName) {
50
+ return (0, import_chunk_7MD6344A.tryCatch2)(
51
+ () => getEngineVersion(enginePath, binaryName),
52
+ (error) => error
53
+ );
54
+ }
@@ -16,69 +16,69 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_25RJ7YTB_exports = {};
20
- __export(chunk_25RJ7YTB_exports, {
21
- N: () => N,
22
- z: () => z
19
+ var chunk_H3T4L34H_exports = {};
20
+ __export(chunk_H3T4L34H_exports, {
21
+ $: () => $,
22
+ N: () => N
23
23
  });
24
- module.exports = __toCommonJS(chunk_25RJ7YTB_exports);
24
+ module.exports = __toCommonJS(chunk_H3T4L34H_exports);
25
25
  var t = Symbol.for("@ts-pattern/matcher");
26
26
  var e = Symbol.for("@ts-pattern/isVariadic");
27
27
  var n = "@ts-pattern/anonymous-select-key";
28
28
  var r = (t2) => Boolean(t2 && "object" == typeof t2);
29
29
  var i = (e2) => e2 && !!e2[t];
30
- var s = (n2, o2, c2) => {
30
+ var o = (n2, s2, c2) => {
31
31
  if (i(n2)) {
32
- const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(o2);
32
+ const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(s2);
33
33
  return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
34
34
  }
35
35
  if (r(n2)) {
36
- if (!r(o2)) return false;
36
+ if (!r(s2)) return false;
37
37
  if (Array.isArray(n2)) {
38
- if (!Array.isArray(o2)) return false;
38
+ if (!Array.isArray(s2)) return false;
39
39
  let t2 = [], r2 = [], a2 = [];
40
- for (const s2 of n2.keys()) {
41
- const o3 = n2[s2];
42
- i(o3) && o3[e] ? a2.push(o3) : a2.length ? r2.push(o3) : t2.push(o3);
40
+ for (const o2 of n2.keys()) {
41
+ const s3 = n2[o2];
42
+ i(s3) && s3[e] ? a2.push(s3) : a2.length ? r2.push(s3) : t2.push(s3);
43
43
  }
44
44
  if (a2.length) {
45
45
  if (a2.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
46
- if (o2.length < t2.length + r2.length) return false;
47
- const e2 = o2.slice(0, t2.length), n3 = 0 === r2.length ? [] : o2.slice(-r2.length), i2 = o2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
48
- return t2.every((t3, n4) => s(t3, e2[n4], c2)) && r2.every((t3, e3) => s(t3, n3[e3], c2)) && (0 === a2.length || s(a2[0], i2, c2));
46
+ if (s2.length < t2.length + r2.length) return false;
47
+ const e2 = s2.slice(0, t2.length), n3 = 0 === r2.length ? [] : s2.slice(-r2.length), i2 = s2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
48
+ return t2.every((t3, n4) => o(t3, e2[n4], c2)) && r2.every((t3, e3) => o(t3, n3[e3], c2)) && (0 === a2.length || o(a2[0], i2, c2));
49
49
  }
50
- return n2.length === o2.length && n2.every((t3, e2) => s(t3, o2[e2], c2));
50
+ return n2.length === s2.length && n2.every((t3, e2) => o(t3, s2[e2], c2));
51
51
  }
52
- return Reflect.ownKeys(n2).every((e2) => {
52
+ return Object.keys(n2).every((e2) => {
53
53
  const r2 = n2[e2];
54
- return (e2 in o2 || i(a2 = r2) && "optional" === a2[t]().matcherType) && s(r2, o2[e2], c2);
54
+ return (e2 in s2 || i(a2 = r2) && "optional" === a2[t]().matcherType) && o(r2, s2[e2], c2);
55
55
  var a2;
56
56
  });
57
57
  }
58
- return Object.is(o2, n2);
58
+ return Object.is(s2, n2);
59
59
  };
60
- var o = (e2) => {
61
- var n2, s2, a2;
62
- return r(e2) ? i(e2) ? null != (n2 = null == (s2 = (a2 = e2[t]()).getSelectionKeys) ? void 0 : s2.call(a2)) ? n2 : [] : Array.isArray(e2) ? c(e2, o) : c(Object.values(e2), o) : [];
60
+ var s = (e2) => {
61
+ var n2, o2, a2;
62
+ return r(e2) ? i(e2) ? null != (n2 = null == (o2 = (a2 = e2[t]()).getSelectionKeys) ? void 0 : o2.call(a2)) ? n2 : [] : Array.isArray(e2) ? c(e2, s) : c(Object.values(e2), s) : [];
63
63
  };
64
64
  var c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
65
65
  function a(...t2) {
66
66
  if (1 === t2.length) {
67
67
  const [e2] = t2;
68
- return (t3) => s(e2, t3, () => {
68
+ return (t3) => o(e2, t3, () => {
69
69
  });
70
70
  }
71
71
  if (2 === t2.length) {
72
72
  const [e2, n2] = t2;
73
- return s(e2, n2, () => {
73
+ return o(e2, n2, () => {
74
74
  });
75
75
  }
76
76
  throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t2.length}.`);
77
77
  }
78
78
  function u(t2) {
79
- return Object.assign(t2, { optional: () => h(t2), and: (e2) => m(t2, e2), or: (e2) => d(t2, e2), select: (e2) => void 0 === e2 ? y(t2) : y(e2, t2) });
79
+ return Object.assign(t2, { optional: () => l(t2), and: (e2) => m(t2, e2), or: (e2) => d(t2, e2), select: (e2) => void 0 === e2 ? p(t2) : p(e2, t2) });
80
80
  }
81
- function l(t2) {
81
+ function h(t2) {
82
82
  return Object.assign(((t3) => Object.assign(t3, { [Symbol.iterator]() {
83
83
  let n2 = 0;
84
84
  const r2 = [{ value: Object.assign(t3, { [e]: true }), done: false }, { done: true, value: void 0 }];
@@ -86,16 +86,16 @@ function l(t2) {
86
86
  var t4;
87
87
  return null != (t4 = r2[n2++]) ? t4 : r2.at(-1);
88
88
  } };
89
- } }))(t2), { optional: () => l(h(t2)), select: (e2) => l(void 0 === e2 ? y(t2) : y(e2, t2)) });
89
+ } }))(t2), { optional: () => h(l(t2)), select: (e2) => h(void 0 === e2 ? p(t2) : p(e2, t2)) });
90
90
  }
91
- function h(e2) {
91
+ function l(e2) {
92
92
  return u({ [t]: () => ({ match: (t2) => {
93
93
  let n2 = {};
94
94
  const r2 = (t3, e3) => {
95
95
  n2[t3] = e3;
96
96
  };
97
- return void 0 === t2 ? (o(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: s(e2, t2, r2), selections: n2 };
98
- }, getSelectionKeys: () => o(e2), matcherType: "optional" }) });
97
+ return void 0 === t2 ? (s(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: o(e2, t2, r2), selections: n2 };
98
+ }, getSelectionKeys: () => s(e2), matcherType: "optional" }) });
99
99
  }
100
100
  var f = (t2, e2) => {
101
101
  for (const n2 of t2) if (!e2(n2)) return false;
@@ -111,8 +111,8 @@ function m(...e2) {
111
111
  const r2 = (t3, e3) => {
112
112
  n2[t3] = e3;
113
113
  };
114
- return { matched: e2.every((e3) => s(e3, t2, r2)), selections: n2 };
115
- }, getSelectionKeys: () => c(e2, o), matcherType: "and" }) });
114
+ return { matched: e2.every((e3) => o(e3, t2, r2)), selections: n2 };
115
+ }, getSelectionKeys: () => c(e2, s), matcherType: "and" }) });
116
116
  }
117
117
  function d(...e2) {
118
118
  return u({ [t]: () => ({ match: (t2) => {
@@ -120,20 +120,20 @@ function d(...e2) {
120
120
  const r2 = (t3, e3) => {
121
121
  n2[t3] = e3;
122
122
  };
123
- return c(e2, o).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => s(e3, t2, r2)), selections: n2 };
124
- }, getSelectionKeys: () => c(e2, o), matcherType: "or" }) });
123
+ return c(e2, s).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => o(e3, t2, r2)), selections: n2 };
124
+ }, getSelectionKeys: () => c(e2, s), matcherType: "or" }) });
125
125
  }
126
- function p(e2) {
126
+ function y(e2) {
127
127
  return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
128
128
  }
129
- function y(...e2) {
129
+ function p(...e2) {
130
130
  const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
131
131
  return u({ [t]: () => ({ match: (t2) => {
132
132
  let e3 = { [null != r2 ? r2 : n]: t2 };
133
- return { matched: void 0 === i2 || s(i2, t2, (t3, n2) => {
133
+ return { matched: void 0 === i2 || o(i2, t2, (t3, n2) => {
134
134
  e3[t3] = n2;
135
135
  }), selections: e3 };
136
- }, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : o(i2)) }) });
136
+ }, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : s(i2)) }) });
137
137
  }
138
138
  function v(t2) {
139
139
  return "number" == typeof t2;
@@ -144,54 +144,54 @@ function b(t2) {
144
144
  function w(t2) {
145
145
  return "bigint" == typeof t2;
146
146
  }
147
- var S = u(p(function(t2) {
147
+ var S = u(y(function(t2) {
148
148
  return true;
149
149
  }));
150
150
  var O = S;
151
151
  var j = (t2) => Object.assign(u(t2), { startsWith: (e2) => {
152
- return j(m(t2, (n2 = e2, p((t3) => b(t3) && t3.startsWith(n2)))));
152
+ return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.startsWith(n2)))));
153
153
  var n2;
154
154
  }, endsWith: (e2) => {
155
- return j(m(t2, (n2 = e2, p((t3) => b(t3) && t3.endsWith(n2)))));
155
+ return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.endsWith(n2)))));
156
156
  var n2;
157
- }, minLength: (e2) => j(m(t2, ((t3) => p((e3) => b(e3) && e3.length >= t3))(e2))), length: (e2) => j(m(t2, ((t3) => p((e3) => b(e3) && e3.length === t3))(e2))), maxLength: (e2) => j(m(t2, ((t3) => p((e3) => b(e3) && e3.length <= t3))(e2))), includes: (e2) => {
158
- return j(m(t2, (n2 = e2, p((t3) => b(t3) && t3.includes(n2)))));
157
+ }, minLength: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length >= t3))(e2))), length: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length === t3))(e2))), maxLength: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length <= t3))(e2))), includes: (e2) => {
158
+ return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.includes(n2)))));
159
159
  var n2;
160
160
  }, regex: (e2) => {
161
- return j(m(t2, (n2 = e2, p((t3) => b(t3) && Boolean(t3.match(n2))))));
161
+ return j(m(t2, (n2 = e2, y((t3) => b(t3) && Boolean(t3.match(n2))))));
162
162
  var n2;
163
163
  } });
164
- var K = j(p(b));
165
- var x = (t2) => Object.assign(u(t2), { between: (e2, n2) => x(m(t2, ((t3, e3) => p((n3) => v(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 < t3))(e2))), gt: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 > t3))(e2))), lte: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 <= t3))(e2))), gte: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 >= t3))(e2))), int: () => x(m(t2, p((t3) => v(t3) && Number.isInteger(t3)))), finite: () => x(m(t2, p((t3) => v(t3) && Number.isFinite(t3)))), positive: () => x(m(t2, p((t3) => v(t3) && t3 > 0))), negative: () => x(m(t2, p((t3) => v(t3) && t3 < 0))) });
166
- var E = x(p(v));
167
- var A = (t2) => Object.assign(u(t2), { between: (e2, n2) => A(m(t2, ((t3, e3) => p((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 >= t3))(e2))), positive: () => A(m(t2, p((t3) => w(t3) && t3 > 0))), negative: () => A(m(t2, p((t3) => w(t3) && t3 < 0))) });
168
- var P = A(p(w));
169
- var T = u(p(function(t2) {
164
+ var E = j(y(b));
165
+ var K = (t2) => Object.assign(u(t2), { between: (e2, n2) => K(m(t2, ((t3, e3) => y((n3) => v(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 < t3))(e2))), gt: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 > t3))(e2))), lte: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 <= t3))(e2))), gte: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 >= t3))(e2))), int: () => K(m(t2, y((t3) => v(t3) && Number.isInteger(t3)))), finite: () => K(m(t2, y((t3) => v(t3) && Number.isFinite(t3)))), positive: () => K(m(t2, y((t3) => v(t3) && t3 > 0))), negative: () => K(m(t2, y((t3) => v(t3) && t3 < 0))) });
166
+ var x = K(y(v));
167
+ var A = (t2) => Object.assign(u(t2), { between: (e2, n2) => A(m(t2, ((t3, e3) => y((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 >= t3))(e2))), positive: () => A(m(t2, y((t3) => w(t3) && t3 > 0))), negative: () => A(m(t2, y((t3) => w(t3) && t3 < 0))) });
168
+ var P = A(y(w));
169
+ var T = u(y(function(t2) {
170
170
  return "boolean" == typeof t2;
171
171
  }));
172
- var B = u(p(function(t2) {
172
+ var k = u(y(function(t2) {
173
173
  return "symbol" == typeof t2;
174
174
  }));
175
- var _ = u(p(function(t2) {
175
+ var B = u(y(function(t2) {
176
176
  return null == t2;
177
177
  }));
178
- var k = u(p(function(t2) {
178
+ var _ = u(y(function(t2) {
179
179
  return null != t2;
180
180
  }));
181
- var N = { __proto__: null, matcher: t, optional: h, array: function(...e2) {
182
- return l({ [t]: () => ({ match: (t2) => {
181
+ var N = { __proto__: null, matcher: t, optional: l, array: function(...e2) {
182
+ return h({ [t]: () => ({ match: (t2) => {
183
183
  if (!Array.isArray(t2)) return { matched: false };
184
184
  if (0 === e2.length) return { matched: true };
185
185
  const n2 = e2[0];
186
186
  let r2 = {};
187
- if (0 === t2.length) return o(n2).forEach((t3) => {
187
+ if (0 === t2.length) return s(n2).forEach((t3) => {
188
188
  r2[t3] = [];
189
189
  }), { matched: true, selections: r2 };
190
190
  const i2 = (t3, e3) => {
191
191
  r2[t3] = (r2[t3] || []).concat([e3]);
192
192
  };
193
- return { matched: t2.every((t3) => s(n2, t3, i2)), selections: r2 };
194
- }, getSelectionKeys: () => 0 === e2.length ? [] : o(e2[0]) }) });
193
+ return { matched: t2.every((t3) => o(n2, t3, i2)), selections: r2 };
194
+ }, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
195
195
  }, set: function(...e2) {
196
196
  return u({ [t]: () => ({ match: (t2) => {
197
197
  if (!(t2 instanceof Set)) return { matched: false };
@@ -201,8 +201,8 @@ var N = { __proto__: null, matcher: t, optional: h, array: function(...e2) {
201
201
  const r2 = (t3, e3) => {
202
202
  n2[t3] = (n2[t3] || []).concat([e3]);
203
203
  }, i2 = e2[0];
204
- return { matched: f(t2, (t3) => s(i2, t3, r2)), selections: n2 };
205
- }, getSelectionKeys: () => 0 === e2.length ? [] : o(e2[0]) }) });
204
+ return { matched: f(t2, (t3) => o(i2, t3, r2)), selections: n2 };
205
+ }, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
206
206
  }, map: function(...e2) {
207
207
  return u({ [t]: () => ({ match: (t2) => {
208
208
  if (!(t2 instanceof Map)) return { matched: false };
@@ -214,38 +214,27 @@ var N = { __proto__: null, matcher: t, optional: h, array: function(...e2) {
214
214
  if (0 === e2.length) return { matched: true };
215
215
  var i2;
216
216
  if (1 === e2.length) throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i2 = e2[0]) ? void 0 : i2.toString()}`);
217
- const [o2, c2] = e2;
217
+ const [s2, c2] = e2;
218
218
  return { matched: g(t2, (t3, e3) => {
219
- const n3 = s(o2, e3, r2), i3 = s(c2, t3, r2);
219
+ const n3 = o(s2, e3, r2), i3 = o(c2, t3, r2);
220
220
  return n3 && i3;
221
221
  }), selections: n2 };
222
- }, getSelectionKeys: () => 0 === e2.length ? [] : [...o(e2[0]), ...o(e2[1])] }) });
222
+ }, getSelectionKeys: () => 0 === e2.length ? [] : [...s(e2[0]), ...s(e2[1])] }) });
223
223
  }, intersection: m, union: d, not: function(e2) {
224
- return u({ [t]: () => ({ match: (t2) => ({ matched: !s(e2, t2, () => {
224
+ return u({ [t]: () => ({ match: (t2) => ({ matched: !o(e2, t2, () => {
225
225
  }) }), getSelectionKeys: () => [], matcherType: "not" }) });
226
- }, when: p, select: y, any: S, _: O, string: K, number: E, bigint: P, boolean: T, symbol: B, nullish: _, nonNullable: k, instanceOf: function(t2) {
227
- return u(p(/* @__PURE__ */ function(t3) {
226
+ }, when: y, select: p, any: S, _: O, string: E, number: x, bigint: P, boolean: T, symbol: k, nullish: B, nonNullable: _, instanceOf: function(t2) {
227
+ return u(y(/* @__PURE__ */ function(t3) {
228
228
  return (e2) => e2 instanceof t3;
229
229
  }(t2)));
230
230
  }, shape: function(t2) {
231
- return u(p(a(t2)));
231
+ return u(y(a(t2)));
232
232
  } };
233
- var W = class extends Error {
234
- constructor(t2) {
235
- let e2;
236
- try {
237
- e2 = JSON.stringify(t2);
238
- } catch (n2) {
239
- e2 = t2;
240
- }
241
- super(`Pattern matching error: no pattern matches value ${e2}`), this.input = void 0, this.input = t2;
242
- }
243
- };
244
- var $ = { matched: false, value: void 0 };
245
- function z(t2) {
246
- return new I(t2, $);
233
+ var W = { matched: false, value: void 0 };
234
+ function $(t2) {
235
+ return new z(t2, W);
247
236
  }
248
- var I = class _I {
237
+ var z = class _z {
249
238
  constructor(t2, e2) {
250
239
  this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
251
240
  }
@@ -254,23 +243,29 @@ var I = class _I {
254
243
  const e2 = t2[t2.length - 1], r2 = [t2[0]];
255
244
  let i2;
256
245
  3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
257
- let o2 = false, c2 = {};
246
+ let s2 = false, c2 = {};
258
247
  const a2 = (t3, e3) => {
259
- o2 = true, c2[t3] = e3;
260
- }, u2 = !r2.some((t3) => s(t3, this.input, a2)) || i2 && !Boolean(i2(this.input)) ? $ : { matched: true, value: e2(o2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
261
- return new _I(this.input, u2);
248
+ s2 = true, c2[t3] = e3;
249
+ }, u2 = !r2.some((t3) => o(t3, this.input, a2)) || i2 && !Boolean(i2(this.input)) ? W : { matched: true, value: e2(s2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
250
+ return new _z(this.input, u2);
262
251
  }
263
252
  when(t2, e2) {
264
253
  if (this.state.matched) return this;
265
254
  const n2 = Boolean(t2(this.input));
266
- return new _I(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : $);
255
+ return new _z(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : W);
267
256
  }
268
257
  otherwise(t2) {
269
258
  return this.state.matched ? this.state.value : t2(this.input);
270
259
  }
271
260
  exhaustive() {
272
261
  if (this.state.matched) return this.state.value;
273
- throw new W(this.input);
262
+ let t2;
263
+ try {
264
+ t2 = JSON.stringify(this.input);
265
+ } catch (e2) {
266
+ t2 = this.input;
267
+ }
268
+ throw new Error(`Pattern matching error: no pattern matches value ${t2}`);
274
269
  }
275
270
  run() {
276
271
  return this.exhaustive();