@prisma-next/sql-runtime 0.1.0-dev.15 → 0.1.0-dev.17

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 (114) hide show
  1. package/dist/accelerate-EEKAFGN3-SHR4XFVV.js +137863 -0
  2. package/dist/accelerate-EEKAFGN3-SHR4XFVV.js.map +1 -0
  3. package/dist/amcheck-24VY6X5V.js +13 -0
  4. package/dist/amcheck-24VY6X5V.js.map +1 -0
  5. package/dist/bloom-VS74NLHT.js +13 -0
  6. package/dist/bloom-VS74NLHT.js.map +1 -0
  7. package/dist/btree_gin-WBC4EAAI.js +13 -0
  8. package/dist/btree_gin-WBC4EAAI.js.map +1 -0
  9. package/dist/btree_gist-UNC6QD3M.js +13 -0
  10. package/dist/btree_gist-UNC6QD3M.js.map +1 -0
  11. package/dist/chunk-3KTOEDFX.js +49 -0
  12. package/dist/chunk-3KTOEDFX.js.map +1 -0
  13. package/dist/chunk-47DZBRQC.js +1280 -0
  14. package/dist/chunk-47DZBRQC.js.map +1 -0
  15. package/dist/chunk-52N6AFZM.js +133 -0
  16. package/dist/chunk-52N6AFZM.js.map +1 -0
  17. package/dist/chunk-7D4SUZUM.js +38 -0
  18. package/dist/chunk-7D4SUZUM.js.map +1 -0
  19. package/dist/chunk-7UNP42HJ.js +455 -0
  20. package/dist/chunk-7UNP42HJ.js.map +1 -0
  21. package/dist/chunk-ECWIHLAT.js +37 -0
  22. package/dist/chunk-ECWIHLAT.js.map +1 -0
  23. package/dist/chunk-EI626SDC.js +105 -0
  24. package/dist/chunk-EI626SDC.js.map +1 -0
  25. package/dist/chunk-UKKOYUGL.js +578 -0
  26. package/dist/chunk-UKKOYUGL.js.map +1 -0
  27. package/dist/chunk-XPLNMXQV.js +1537 -0
  28. package/dist/chunk-XPLNMXQV.js.map +1 -0
  29. package/dist/citext-T7MXGUY7.js +13 -0
  30. package/dist/citext-T7MXGUY7.js.map +1 -0
  31. package/dist/client-5FENX6AW.js +299 -0
  32. package/dist/client-5FENX6AW.js.map +1 -0
  33. package/dist/cube-TFDQBZCI.js +13 -0
  34. package/dist/cube-TFDQBZCI.js.map +1 -0
  35. package/dist/dict_int-AEUOPGWP.js +13 -0
  36. package/dist/dict_int-AEUOPGWP.js.map +1 -0
  37. package/dist/dict_xsyn-DAAYX3FL.js +13 -0
  38. package/dist/dict_xsyn-DAAYX3FL.js.map +1 -0
  39. package/dist/dist-LBVX6BJW.js +189 -0
  40. package/dist/dist-LBVX6BJW.js.map +1 -0
  41. package/dist/dist-LCVVJCGI.js +570 -0
  42. package/dist/dist-LCVVJCGI.js.map +1 -0
  43. package/dist/dist-WLKUVDN2.js +5127 -0
  44. package/dist/dist-WLKUVDN2.js.map +1 -0
  45. package/dist/earthdistance-KIGTF4LE.js +13 -0
  46. package/dist/earthdistance-KIGTF4LE.js.map +1 -0
  47. package/dist/file_fdw-5N55UP6I.js +13 -0
  48. package/dist/file_fdw-5N55UP6I.js.map +1 -0
  49. package/dist/fuzzystrmatch-KN3YWBFP.js +13 -0
  50. package/dist/fuzzystrmatch-KN3YWBFP.js.map +1 -0
  51. package/dist/hstore-YX726NKN.js +13 -0
  52. package/dist/hstore-YX726NKN.js.map +1 -0
  53. package/dist/http-exception-FZY2H4OF.js +8 -0
  54. package/dist/http-exception-FZY2H4OF.js.map +1 -0
  55. package/dist/index.d.ts +7 -59
  56. package/dist/index.js +15 -439
  57. package/dist/index.js.map +1 -1
  58. package/dist/intarray-NKVXNO2D.js +13 -0
  59. package/dist/intarray-NKVXNO2D.js.map +1 -0
  60. package/dist/isn-FTEMJGEV.js +13 -0
  61. package/dist/isn-FTEMJGEV.js.map +1 -0
  62. package/dist/lo-DB7L4NGI.js +13 -0
  63. package/dist/lo-DB7L4NGI.js.map +1 -0
  64. package/dist/logger-WQ7SHNDD.js +68 -0
  65. package/dist/logger-WQ7SHNDD.js.map +1 -0
  66. package/dist/ltree-Z32TZT6W.js +13 -0
  67. package/dist/ltree-Z32TZT6W.js.map +1 -0
  68. package/dist/nodefs-NM46ACH7.js +31 -0
  69. package/dist/nodefs-NM46ACH7.js.map +1 -0
  70. package/dist/opfs-ahp-NJO33LVZ.js +332 -0
  71. package/dist/opfs-ahp-NJO33LVZ.js.map +1 -0
  72. package/dist/pageinspect-YP3IZR4X.js +13 -0
  73. package/dist/pageinspect-YP3IZR4X.js.map +1 -0
  74. package/dist/pg_buffercache-7TD5J2FB.js +13 -0
  75. package/dist/pg_buffercache-7TD5J2FB.js.map +1 -0
  76. package/dist/pg_dump-SG4KYBUB.js +2492 -0
  77. package/dist/pg_dump-SG4KYBUB.js.map +1 -0
  78. package/dist/pg_freespacemap-DZDNCPZK.js +13 -0
  79. package/dist/pg_freespacemap-DZDNCPZK.js.map +1 -0
  80. package/dist/pg_surgery-J2MUEWEP.js +13 -0
  81. package/dist/pg_surgery-J2MUEWEP.js.map +1 -0
  82. package/dist/pg_trgm-7VNQOYS6.js +13 -0
  83. package/dist/pg_trgm-7VNQOYS6.js.map +1 -0
  84. package/dist/pg_visibility-TTSIPHFL.js +13 -0
  85. package/dist/pg_visibility-TTSIPHFL.js.map +1 -0
  86. package/dist/pg_walinspect-KPFHSHRJ.js +13 -0
  87. package/dist/pg_walinspect-KPFHSHRJ.js.map +1 -0
  88. package/dist/proxy-signals-GUDAMDHV.js +39 -0
  89. package/dist/proxy-signals-GUDAMDHV.js.map +1 -0
  90. package/dist/seg-IYVDLE4O.js +13 -0
  91. package/dist/seg-IYVDLE4O.js.map +1 -0
  92. package/dist/sql-runtime-qPimiOqJ.d.ts +63 -0
  93. package/dist/tablefunc-EF4RCS7S.js +13 -0
  94. package/dist/tablefunc-EF4RCS7S.js.map +1 -0
  95. package/dist/tcn-3VT5BQYW.js +13 -0
  96. package/dist/tcn-3VT5BQYW.js.map +1 -0
  97. package/dist/test/utils.d.ts +60 -0
  98. package/dist/test/utils.js +24604 -0
  99. package/dist/test/utils.js.map +1 -0
  100. package/dist/tiny-CW6F4GX6.js +10 -0
  101. package/dist/tiny-CW6F4GX6.js.map +1 -0
  102. package/dist/tsm_system_rows-ES7KNUQH.js +13 -0
  103. package/dist/tsm_system_rows-ES7KNUQH.js.map +1 -0
  104. package/dist/tsm_system_time-76WEIMBG.js +13 -0
  105. package/dist/tsm_system_time-76WEIMBG.js.map +1 -0
  106. package/dist/unaccent-7RYF3R64.js +13 -0
  107. package/dist/unaccent-7RYF3R64.js.map +1 -0
  108. package/dist/utility-Q5A254LJ-J4HTKZPT.js +347 -0
  109. package/dist/utility-Q5A254LJ-J4HTKZPT.js.map +1 -0
  110. package/dist/uuid_ossp-4ETE4FPE.js +13 -0
  111. package/dist/uuid_ossp-4ETE4FPE.js.map +1 -0
  112. package/dist/vector-74GPNV7V.js +13 -0
  113. package/dist/vector-74GPNV7V.js.map +1 -0
  114. package/package.json +9 -9
@@ -0,0 +1,1537 @@
1
+ // ../../../node_modules/.pnpm/@prisma+dev@0.19.1_typescript@5.9.3/node_modules/@prisma/dev/dist/chunk-ITQ6ILGR.js
2
+ import { createWriteStream as w, WriteStream as A } from "fs";
3
+ import { access as D, chmod as x, constants as P, mkdir as T, readdir as E, readFile as _, rm as F, writeFile as O } from "fs/promises";
4
+ import { promisify as v } from "util";
5
+ import { unzip as C } from "zlib";
6
+ import o from "path";
7
+ import g from "os";
8
+ import c from "process";
9
+
10
+ // ../../../node_modules/.pnpm/graphmatch@1.1.0/node_modules/graphmatch/dist/utils.js
11
+ var getNodes = (node) => {
12
+ const nodes = /* @__PURE__ */ new Set();
13
+ const queue = [node];
14
+ for (let i2 = 0; i2 < queue.length; i2++) {
15
+ const node2 = queue[i2];
16
+ if (nodes.has(node2))
17
+ continue;
18
+ nodes.add(node2);
19
+ const { children } = node2;
20
+ if (!children?.length)
21
+ continue;
22
+ for (let ci = 0, cl = children.length; ci < cl; ci++) {
23
+ queue.push(children[ci]);
24
+ }
25
+ }
26
+ return Array.from(nodes);
27
+ };
28
+ var getNodeFlags = (node) => {
29
+ let flags = "";
30
+ const nodes = getNodes(node);
31
+ for (let i2 = 0, l3 = nodes.length; i2 < l3; i2++) {
32
+ const node2 = nodes[i2];
33
+ if (!node2.regex)
34
+ continue;
35
+ const nodeFlags = node2.regex.flags;
36
+ flags || (flags = nodeFlags);
37
+ if (flags === nodeFlags)
38
+ continue;
39
+ throw new Error(`Inconsistent RegExp flags used: "${flags}" and "${nodeFlags}"`);
40
+ }
41
+ return flags;
42
+ };
43
+ var getNodeSourceWithCache = (node, partial, cache) => {
44
+ const cached = cache.get(node);
45
+ if (cached !== void 0)
46
+ return cached;
47
+ const isNodePartial = node.partial ?? partial;
48
+ let source = "";
49
+ if (node.regex) {
50
+ source += isNodePartial ? "(?:$|" : "";
51
+ source += node.regex.source;
52
+ }
53
+ if (node.children?.length) {
54
+ const children = uniq(node.children.map((node2) => getNodeSourceWithCache(node2, partial, cache)).filter(Boolean));
55
+ if (children?.length) {
56
+ const isSomeChildNonPartial = node.children.some((child) => !child.regex || !(child.partial ?? partial));
57
+ const needsWrapperGroup = children.length > 1 || isNodePartial && (!source.length || isSomeChildNonPartial);
58
+ source += needsWrapperGroup ? isNodePartial ? "(?:$|" : "(?:" : "";
59
+ source += children.join("|");
60
+ source += needsWrapperGroup ? ")" : "";
61
+ }
62
+ }
63
+ if (node.regex) {
64
+ source += isNodePartial ? ")" : "";
65
+ }
66
+ cache.set(node, source);
67
+ return source;
68
+ };
69
+ var getNodeSource = (node, partial) => {
70
+ const cache = /* @__PURE__ */ new Map();
71
+ const nodes = getNodes(node);
72
+ for (let i2 = nodes.length - 1; i2 >= 0; i2--) {
73
+ const source = getNodeSourceWithCache(nodes[i2], partial, cache);
74
+ if (i2 > 0)
75
+ continue;
76
+ return source;
77
+ }
78
+ return "";
79
+ };
80
+ var uniq = (values) => {
81
+ return Array.from(new Set(values));
82
+ };
83
+
84
+ // ../../../node_modules/.pnpm/graphmatch@1.1.0/node_modules/graphmatch/dist/index.js
85
+ var graphmatch = (node, input, options) => {
86
+ return graphmatch.compile(node, options).test(input);
87
+ };
88
+ graphmatch.compile = (node, options) => {
89
+ const partial = options?.partial ?? false;
90
+ const source = getNodeSource(node, partial);
91
+ const flags = getNodeFlags(node);
92
+ return new RegExp(`^(?:${source})$`, flags);
93
+ };
94
+ var dist_default = graphmatch;
95
+
96
+ // ../../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/compile/index.js
97
+ var compile = (node, options) => {
98
+ const re = dist_default.compile(node, options);
99
+ const source = `${re.source.slice(0, -1)}[\\\\/]?$`;
100
+ const flags = re.flags;
101
+ return new RegExp(source, flags);
102
+ };
103
+ var compile_default = compile;
104
+
105
+ // ../../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/merge/index.js
106
+ var merge = (res) => {
107
+ const source = res.map((re) => re.source).join("|") || "$^";
108
+ const flags = res[0]?.flags;
109
+ return new RegExp(source, flags);
110
+ };
111
+ var merge_default = merge;
112
+
113
+ // ../../../node_modules/.pnpm/grammex@3.1.12/node_modules/grammex/dist/utils.js
114
+ var isArray = (value) => {
115
+ return Array.isArray(value);
116
+ };
117
+ var isFunction = (value) => {
118
+ return typeof value === "function";
119
+ };
120
+ var isFunctionNullary = (value) => {
121
+ return value.length === 0;
122
+ };
123
+ var isFunctionStrictlyNullaryOrUnary = (() => {
124
+ const { toString } = Function.prototype;
125
+ const re = /(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;
126
+ return (value) => {
127
+ return (value.length === 0 || value.length === 1) && re.test(toString.call(value));
128
+ };
129
+ })();
130
+ var isNumber = (value) => {
131
+ return typeof value === "number";
132
+ };
133
+ var isObject = (value) => {
134
+ return typeof value === "object" && value !== null;
135
+ };
136
+ var isRegExp = (value) => {
137
+ return value instanceof RegExp;
138
+ };
139
+ var isRegExpCapturing = /* @__PURE__ */ (() => {
140
+ const sourceRe = /\\\(|\((?!\?(?::|=|!|<=|<!))/;
141
+ return (re) => {
142
+ return sourceRe.test(re.source);
143
+ };
144
+ })();
145
+ var isRegExpStatic = /* @__PURE__ */ (() => {
146
+ const sourceRe = /^[a-zA-Z0-9_-]+$/;
147
+ return (re) => {
148
+ return sourceRe.test(re.source) && !re.flags.includes("i");
149
+ };
150
+ })();
151
+ var isString = (value) => {
152
+ return typeof value === "string";
153
+ };
154
+ var isUndefined = (value) => {
155
+ return value === void 0;
156
+ };
157
+ var memoize = (fn) => {
158
+ const cache = /* @__PURE__ */ new Map();
159
+ return (arg) => {
160
+ const cached = cache.get(arg);
161
+ if (cached !== void 0)
162
+ return cached;
163
+ const value = fn(arg);
164
+ cache.set(arg, value);
165
+ return value;
166
+ };
167
+ };
168
+
169
+ // ../../../node_modules/.pnpm/grammex@3.1.12/node_modules/grammex/dist/index.js
170
+ var parse = (input, rule, options = {}) => {
171
+ const state = { cache: {}, input, index: 0, indexBacktrackMax: 0, options, output: [] };
172
+ const matched = resolve(rule)(state);
173
+ const indexMax = Math.max(state.index, state.indexBacktrackMax);
174
+ if (matched && state.index === input.length) {
175
+ return state.output;
176
+ } else {
177
+ throw new Error(`Failed to parse at index ${indexMax}`);
178
+ }
179
+ };
180
+ var match = (target, handler) => {
181
+ if (isArray(target)) {
182
+ return chars(target, handler);
183
+ } else if (isString(target)) {
184
+ return string(target, handler);
185
+ } else {
186
+ return regex(target, handler);
187
+ }
188
+ };
189
+ var chars = (target, handler) => {
190
+ const charCodes = {};
191
+ for (const char of target) {
192
+ if (char.length !== 1)
193
+ throw new Error(`Invalid character: "${char}"`);
194
+ const charCode = char.charCodeAt(0);
195
+ charCodes[charCode] = true;
196
+ }
197
+ return (state) => {
198
+ const input = state.input;
199
+ let indexStart = state.index;
200
+ let indexEnd = indexStart;
201
+ while (indexEnd < input.length) {
202
+ const charCode = input.charCodeAt(indexEnd);
203
+ if (!(charCode in charCodes))
204
+ break;
205
+ indexEnd += 1;
206
+ }
207
+ if (indexEnd > indexStart) {
208
+ if (!isUndefined(handler) && !state.options.silent) {
209
+ const target2 = input.slice(indexStart, indexEnd);
210
+ const output = isFunction(handler) ? handler(target2, input, `${indexStart}`) : handler;
211
+ if (!isUndefined(output)) {
212
+ state.output.push(output);
213
+ }
214
+ }
215
+ state.index = indexEnd;
216
+ }
217
+ return true;
218
+ };
219
+ };
220
+ var regex = (target, handler) => {
221
+ if (isRegExpStatic(target)) {
222
+ return string(target.source, handler);
223
+ } else {
224
+ const source = target.source;
225
+ const flags = target.flags.replace(/y|$/, "y");
226
+ const re = new RegExp(source, flags);
227
+ if (isRegExpCapturing(target) && isFunction(handler) && !isFunctionStrictlyNullaryOrUnary(handler)) {
228
+ return regexCapturing(re, handler);
229
+ } else {
230
+ return regexNonCapturing(re, handler);
231
+ }
232
+ }
233
+ };
234
+ var regexCapturing = (re, handler) => {
235
+ return (state) => {
236
+ const indexStart = state.index;
237
+ const input = state.input;
238
+ re.lastIndex = indexStart;
239
+ const match2 = re.exec(input);
240
+ if (match2) {
241
+ const indexEnd = re.lastIndex;
242
+ if (!state.options.silent) {
243
+ const output = handler(...match2, input, `${indexStart}`);
244
+ if (!isUndefined(output)) {
245
+ state.output.push(output);
246
+ }
247
+ }
248
+ state.index = indexEnd;
249
+ return true;
250
+ } else {
251
+ return false;
252
+ }
253
+ };
254
+ };
255
+ var regexNonCapturing = (re, handler) => {
256
+ return (state) => {
257
+ const indexStart = state.index;
258
+ const input = state.input;
259
+ re.lastIndex = indexStart;
260
+ const matched = re.test(input);
261
+ if (matched) {
262
+ const indexEnd = re.lastIndex;
263
+ if (!isUndefined(handler) && !state.options.silent) {
264
+ const output = isFunction(handler) ? handler(input.slice(indexStart, indexEnd), input, `${indexStart}`) : handler;
265
+ if (!isUndefined(output)) {
266
+ state.output.push(output);
267
+ }
268
+ }
269
+ state.index = indexEnd;
270
+ return true;
271
+ } else {
272
+ return false;
273
+ }
274
+ };
275
+ };
276
+ var string = (target, handler) => {
277
+ return (state) => {
278
+ const indexStart = state.index;
279
+ const input = state.input;
280
+ const matched = input.startsWith(target, indexStart);
281
+ if (matched) {
282
+ if (!isUndefined(handler) && !state.options.silent) {
283
+ const output = isFunction(handler) ? handler(target, input, `${indexStart}`) : handler;
284
+ if (!isUndefined(output)) {
285
+ state.output.push(output);
286
+ }
287
+ }
288
+ state.index += target.length;
289
+ return true;
290
+ } else {
291
+ return false;
292
+ }
293
+ };
294
+ };
295
+ var repeat = (rule, min, max, handler) => {
296
+ const erule = resolve(rule);
297
+ const isBacktrackable = min > 1;
298
+ return memoizable(handleable(backtrackable((state) => {
299
+ let repetitions = 0;
300
+ while (repetitions < max) {
301
+ const index = state.index;
302
+ const matched = erule(state);
303
+ if (!matched)
304
+ break;
305
+ repetitions += 1;
306
+ if (state.index === index)
307
+ break;
308
+ }
309
+ return repetitions >= min;
310
+ }, isBacktrackable), handler));
311
+ };
312
+ var optional = (rule, handler) => {
313
+ return repeat(rule, 0, 1, handler);
314
+ };
315
+ var star = (rule, handler) => {
316
+ return repeat(rule, 0, Infinity, handler);
317
+ };
318
+ var plus = (rule, handler) => {
319
+ return repeat(rule, 1, Infinity, handler);
320
+ };
321
+ var and = (rules, handler) => {
322
+ const erules = rules.map(resolve);
323
+ return memoizable(handleable(backtrackable((state) => {
324
+ for (let i2 = 0, l3 = erules.length; i2 < l3; i2++) {
325
+ if (!erules[i2](state))
326
+ return false;
327
+ }
328
+ return true;
329
+ }), handler));
330
+ };
331
+ var or = (rules, handler) => {
332
+ const erules = rules.map(resolve);
333
+ return memoizable(handleable((state) => {
334
+ for (let i2 = 0, l3 = erules.length; i2 < l3; i2++) {
335
+ if (erules[i2](state))
336
+ return true;
337
+ }
338
+ return false;
339
+ }, handler));
340
+ };
341
+ var backtrackable = (rule, enabled = true, force = false) => {
342
+ const erule = resolve(rule);
343
+ if (!enabled)
344
+ return erule;
345
+ return (state) => {
346
+ const index = state.index;
347
+ const length = state.output.length;
348
+ const matched = erule(state);
349
+ if (!matched && !force) {
350
+ state.indexBacktrackMax = Math.max(state.indexBacktrackMax, state.index);
351
+ }
352
+ if (!matched || force) {
353
+ state.index = index;
354
+ if (state.output.length !== length) {
355
+ state.output.length = length;
356
+ }
357
+ }
358
+ return matched;
359
+ };
360
+ };
361
+ var handleable = (rule, handler) => {
362
+ const erule = resolve(rule);
363
+ if (!handler)
364
+ return erule;
365
+ return (state) => {
366
+ if (state.options.silent)
367
+ return erule(state);
368
+ const length = state.output.length;
369
+ const matched = erule(state);
370
+ if (matched) {
371
+ const outputs = state.output.splice(length, Infinity);
372
+ const output = handler(outputs);
373
+ if (!isUndefined(output)) {
374
+ state.output.push(output);
375
+ }
376
+ return true;
377
+ } else {
378
+ return false;
379
+ }
380
+ };
381
+ };
382
+ var memoizable = /* @__PURE__ */ (() => {
383
+ let RULE_ID = 0;
384
+ return (rule) => {
385
+ const erule = resolve(rule);
386
+ const ruleId = RULE_ID += 1;
387
+ return (state) => {
388
+ var _a;
389
+ if (state.options.memoization === false)
390
+ return erule(state);
391
+ const indexStart = state.index;
392
+ const cache = (_a = state.cache)[ruleId] || (_a[ruleId] = { indexMax: -1, queue: [] });
393
+ const cacheQueue = cache.queue;
394
+ const isPotentiallyCached = indexStart <= cache.indexMax;
395
+ if (isPotentiallyCached) {
396
+ const cacheStore = cache.store || (cache.store = /* @__PURE__ */ new Map());
397
+ if (cacheQueue.length) {
398
+ for (let i2 = 0, l3 = cacheQueue.length; i2 < l3; i2 += 2) {
399
+ const key = cacheQueue[i2 * 2];
400
+ const value = cacheQueue[i2 * 2 + 1];
401
+ cacheStore.set(key, value);
402
+ }
403
+ cacheQueue.length = 0;
404
+ }
405
+ const cached = cacheStore.get(indexStart);
406
+ if (cached === false) {
407
+ return false;
408
+ } else if (isNumber(cached)) {
409
+ state.index = cached;
410
+ return true;
411
+ } else if (cached) {
412
+ state.index = cached.index;
413
+ if (cached.output?.length) {
414
+ state.output.push(...cached.output);
415
+ }
416
+ return true;
417
+ }
418
+ }
419
+ const lengthStart = state.output.length;
420
+ const matched = erule(state);
421
+ cache.indexMax = Math.max(cache.indexMax, indexStart);
422
+ if (matched) {
423
+ const indexEnd = state.index;
424
+ const lengthEnd = state.output.length;
425
+ if (lengthEnd > lengthStart) {
426
+ const output = state.output.slice(lengthStart, lengthEnd);
427
+ cacheQueue.push(indexStart, { index: indexEnd, output });
428
+ } else {
429
+ cacheQueue.push(indexStart, indexEnd);
430
+ }
431
+ return true;
432
+ } else {
433
+ cacheQueue.push(indexStart, false);
434
+ return false;
435
+ }
436
+ };
437
+ };
438
+ })();
439
+ var lazy = (getter) => {
440
+ let erule;
441
+ return (state) => {
442
+ erule || (erule = resolve(getter()));
443
+ return erule(state);
444
+ };
445
+ };
446
+ var resolve = memoize((rule) => {
447
+ if (isFunction(rule)) {
448
+ if (isFunctionNullary(rule)) {
449
+ return lazy(rule);
450
+ } else {
451
+ return rule;
452
+ }
453
+ }
454
+ if (isString(rule) || isRegExp(rule)) {
455
+ return match(rule);
456
+ }
457
+ if (isArray(rule)) {
458
+ return and(rule);
459
+ }
460
+ if (isObject(rule)) {
461
+ return or(Object.values(rule));
462
+ }
463
+ throw new Error("Invalid rule");
464
+ });
465
+
466
+ // ../../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/utils.js
467
+ var identity = (value) => {
468
+ return value;
469
+ };
470
+ var isString2 = (value) => {
471
+ return typeof value === "string";
472
+ };
473
+ var memoizeByObject = (fn) => {
474
+ const cacheFull = /* @__PURE__ */ new WeakMap();
475
+ const cachePartial = /* @__PURE__ */ new WeakMap();
476
+ return (globs, options) => {
477
+ const cache = options?.partial ? cachePartial : cacheFull;
478
+ const cached = cache.get(globs);
479
+ if (cached !== void 0)
480
+ return cached;
481
+ const result = fn(globs, options);
482
+ cache.set(globs, result);
483
+ return result;
484
+ };
485
+ };
486
+ var memoizeByPrimitive = (fn) => {
487
+ const cacheFull = {};
488
+ const cachePartial = {};
489
+ return (glob, options) => {
490
+ const cache = options?.partial ? cachePartial : cacheFull;
491
+ return cache[glob] ?? (cache[glob] = fn(glob, options));
492
+ };
493
+ };
494
+
495
+ // ../../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/normalize/grammar.js
496
+ var Escaped = match(/\\./, identity);
497
+ var Passthrough = match(/./, identity);
498
+ var StarStarStar = match(/\*\*\*+/, "*");
499
+ var StarStarNoLeft = match(/([^/{[(!])\*\*/, (_3, $1) => `${$1}*`);
500
+ var StarStarNoRight = match(/(^|.)\*\*(?=[^*/)\]}])/, (_3, $1) => `${$1}*`);
501
+ var Grammar = star(or([Escaped, StarStarStar, StarStarNoLeft, StarStarNoRight, Passthrough]));
502
+ var grammar_default = Grammar;
503
+
504
+ // ../../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/normalize/index.js
505
+ var normalize = (glob) => {
506
+ return parse(glob, grammar_default, { memoization: false }).join("");
507
+ };
508
+ var normalize_default = normalize;
509
+
510
+ // ../../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/range.js
511
+ var ALPHABET = "abcdefghijklmnopqrstuvwxyz";
512
+ var int2alpha = (int) => {
513
+ let alpha = "";
514
+ while (int > 0) {
515
+ const reminder = (int - 1) % 26;
516
+ alpha = ALPHABET[reminder] + alpha;
517
+ int = Math.floor((int - 1) / 26);
518
+ }
519
+ return alpha;
520
+ };
521
+ var alpha2int = (str) => {
522
+ let int = 0;
523
+ for (let i2 = 0, l3 = str.length; i2 < l3; i2++) {
524
+ int = int * 26 + ALPHABET.indexOf(str[i2]) + 1;
525
+ }
526
+ return int;
527
+ };
528
+ var makeRangeInt = (start, end) => {
529
+ if (end < start)
530
+ return makeRangeInt(end, start);
531
+ const range = [];
532
+ while (start <= end) {
533
+ range.push(start++);
534
+ }
535
+ return range;
536
+ };
537
+ var makeRangePaddedInt = (start, end, paddingLength) => {
538
+ return makeRangeInt(start, end).map((int) => String(int).padStart(paddingLength, "0"));
539
+ };
540
+ var makeRangeAlpha = (start, end) => {
541
+ return makeRangeInt(alpha2int(start), alpha2int(end)).map(int2alpha);
542
+ };
543
+
544
+ // ../../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/parse/utils.js
545
+ var regex2 = (source) => {
546
+ const regex4 = new RegExp(source, "s");
547
+ return { partial: false, regex: regex4, children: [] };
548
+ };
549
+ var alternation = (children) => {
550
+ return { children };
551
+ };
552
+ var sequence = /* @__PURE__ */ (() => {
553
+ const pushToLeaves = (parent, child, handled) => {
554
+ if (handled.has(parent))
555
+ return;
556
+ handled.add(parent);
557
+ const { children } = parent;
558
+ if (!children.length) {
559
+ children.push(child);
560
+ } else {
561
+ for (let i2 = 0, l3 = children.length; i2 < l3; i2++) {
562
+ pushToLeaves(children[i2], child, handled);
563
+ }
564
+ }
565
+ };
566
+ return (nodes) => {
567
+ if (!nodes.length) {
568
+ return alternation([]);
569
+ }
570
+ for (let i2 = nodes.length - 1; i2 >= 1; i2--) {
571
+ const handled = /* @__PURE__ */ new Set();
572
+ const parent = nodes[i2 - 1];
573
+ const child = nodes[i2];
574
+ pushToLeaves(parent, child, handled);
575
+ }
576
+ return nodes[0];
577
+ };
578
+ })();
579
+ var slash = () => {
580
+ const regex4 = new RegExp("[\\\\/]", "s");
581
+ return { regex: regex4, children: [] };
582
+ };
583
+
584
+ // ../../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/parse/grammar.js
585
+ var Escaped2 = match(/\\./, regex2);
586
+ var Escape = match(/[$.*+?^(){}[\]\|]/, (char) => regex2(`\\${char}`));
587
+ var Slash = match(/[\\\/]/, slash);
588
+ var Passthrough2 = match(/[^$.*+?^(){}[\]\|\\\/]+/, regex2);
589
+ var NegationOdd = match(/^(?:!!)*!(.*)$/, (_3, glob) => regex2(`(?!^${dist_default2.compile(glob).source}$).*?`));
590
+ var NegationEven = match(/^(!!)+/);
591
+ var Negation = or([NegationOdd, NegationEven]);
592
+ var StarStarBetween = match(/\/(\*\*\/)+/, () => alternation([sequence([slash(), regex2(".+?"), slash()]), slash()]));
593
+ var StarStarStart = match(/^(\*\*\/)+/, () => alternation([regex2("^"), sequence([regex2(".*?"), slash()])]));
594
+ var StarStarEnd = match(/\/(\*\*)$/, () => alternation([sequence([slash(), regex2(".*?")]), regex2("$")]));
595
+ var StarStarNone = match(/\*\*/, () => regex2(".*?"));
596
+ var StarStar = or([StarStarBetween, StarStarStart, StarStarEnd, StarStarNone]);
597
+ var StarDouble = match(/\*\/(?!\*\*\/|\*$)/, () => sequence([regex2("[^\\\\/]*?"), slash()]));
598
+ var StarSingle = match(/\*/, () => regex2("[^\\\\/]*"));
599
+ var Star = or([StarDouble, StarSingle]);
600
+ var Question = match("?", () => regex2("[^\\\\/]"));
601
+ var ClassOpen = match("[", identity);
602
+ var ClassClose = match("]", identity);
603
+ var ClassNegation = match(/[!^]/, "^\\\\/");
604
+ var ClassRange = match(/[a-z]-[a-z]|[0-9]-[0-9]/i, identity);
605
+ var ClassEscaped = match(/\\./, identity);
606
+ var ClassEscape = match(/[$.*+?^(){}[\|]/, (char) => `\\${char}`);
607
+ var ClassSlash = match(/[\\\/]/, "\\\\/");
608
+ var ClassPassthrough = match(/[^$.*+?^(){}[\]\|\\\/]+/, identity);
609
+ var ClassValue = or([ClassEscaped, ClassEscape, ClassSlash, ClassRange, ClassPassthrough]);
610
+ var Class = and([ClassOpen, optional(ClassNegation), star(ClassValue), ClassClose], (_3) => regex2(_3.join("")));
611
+ var RangeOpen = match("{", "(?:");
612
+ var RangeClose = match("}", ")");
613
+ var RangeNumeric = match(/(\d+)\.\.(\d+)/, (_3, $1, $2) => makeRangePaddedInt(+$1, +$2, Math.min($1.length, $2.length)).join("|"));
614
+ var RangeAlphaLower = match(/([a-z]+)\.\.([a-z]+)/, (_3, $1, $2) => makeRangeAlpha($1, $2).join("|"));
615
+ var RangeAlphaUpper = match(/([A-Z]+)\.\.([A-Z]+)/, (_3, $1, $2) => makeRangeAlpha($1.toLowerCase(), $2.toLowerCase()).join("|").toUpperCase());
616
+ var RangeValue = or([RangeNumeric, RangeAlphaLower, RangeAlphaUpper]);
617
+ var Range = and([RangeOpen, RangeValue, RangeClose], (_3) => regex2(_3.join("")));
618
+ var BracesOpen = match("{");
619
+ var BracesClose = match("}");
620
+ var BracesComma = match(",");
621
+ var BracesEscaped = match(/\\./, regex2);
622
+ var BracesEscape = match(/[$.*+?^(){[\]\|]/, (char) => regex2(`\\${char}`));
623
+ var BracesSlash = match(/[\\\/]/, slash);
624
+ var BracesPassthrough = match(/[^$.*+?^(){}[\]\|\\\/,]+/, regex2);
625
+ var BracesNested = lazy(() => Braces);
626
+ var BracesEmptyValue = match("", () => regex2("(?:)"));
627
+ var BracesFullValue = plus(or([StarStar, Star, Question, Class, Range, BracesNested, BracesEscaped, BracesEscape, BracesSlash, BracesPassthrough]), sequence);
628
+ var BracesValue = or([BracesFullValue, BracesEmptyValue]);
629
+ var Braces = and([BracesOpen, optional(and([BracesValue, star(and([BracesComma, BracesValue]))])), BracesClose], alternation);
630
+ var Grammar2 = star(or([Negation, StarStar, Star, Question, Class, Range, Braces, Escaped2, Escape, Slash, Passthrough2]), sequence);
631
+ var grammar_default2 = Grammar2;
632
+
633
+ // ../../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/parse/index.js
634
+ var _parse = (glob) => {
635
+ return parse(glob, grammar_default2, { memoization: false })[0];
636
+ };
637
+ var parse_default = _parse;
638
+
639
+ // ../../../node_modules/.pnpm/zeptomatch@2.1.0/node_modules/zeptomatch/dist/index.js
640
+ var zeptomatch = (glob, path, options) => {
641
+ return zeptomatch.compile(glob, options).test(path);
642
+ };
643
+ zeptomatch.compile = (() => {
644
+ const compileGlob = memoizeByPrimitive((glob, options) => {
645
+ return compile_default(parse_default(normalize_default(glob)), options);
646
+ });
647
+ const compileGlobs = memoizeByObject((globs, options) => {
648
+ return merge_default(globs.map((glob) => compileGlob(glob, options)));
649
+ });
650
+ return (glob, options) => {
651
+ if (isString2(glob)) {
652
+ return compileGlob(glob, options);
653
+ } else {
654
+ return compileGlobs(glob, options);
655
+ }
656
+ };
657
+ })();
658
+ var dist_default2 = zeptomatch;
659
+
660
+ // ../../../node_modules/.pnpm/@prisma+dev@0.19.1_typescript@5.9.3/node_modules/@prisma/dev/dist/chunk-ITQ6ILGR.js
661
+ var n = g.homedir();
662
+ var a = g.tmpdir();
663
+ var { env: e } = c;
664
+ var h = (t2) => {
665
+ let r4 = o.join(n, "Library");
666
+ return { data: o.join(r4, "Application Support", t2), config: o.join(r4, "Preferences", t2), cache: o.join(r4, "Caches", t2), log: o.join(r4, "Logs", t2), temp: o.join(a, t2) };
667
+ };
668
+ var y = (t2) => {
669
+ let r4 = e.APPDATA || o.join(n, "AppData", "Roaming"), i2 = e.LOCALAPPDATA || o.join(n, "AppData", "Local");
670
+ return { data: o.join(i2, t2, "Data"), config: o.join(r4, t2, "Config"), cache: o.join(i2, t2, "Cache"), log: o.join(i2, t2, "Log"), temp: o.join(a, t2) };
671
+ };
672
+ var j = (t2) => {
673
+ let r4 = o.basename(n);
674
+ return { data: o.join(e.XDG_DATA_HOME || o.join(n, ".local", "share"), t2), config: o.join(e.XDG_CONFIG_HOME || o.join(n, ".config"), t2), cache: o.join(e.XDG_CACHE_HOME || o.join(n, ".cache"), t2), log: o.join(e.XDG_STATE_HOME || o.join(n, ".local", "state"), t2), temp: o.join(a, r4, t2) };
675
+ };
676
+ function p(t2, { suffix: r4 = "nodejs" } = {}) {
677
+ if (typeof t2 != "string") throw new TypeError(`Expected a string, got ${typeof t2}`);
678
+ return r4 && (t2 += `-${r4}`), c.platform === "darwin" ? h(t2) : c.platform === "win32" ? y(t2) : j(t2);
679
+ }
680
+ var l = p("prisma-dev");
681
+ var G = v(C);
682
+ function z(t2, r4) {
683
+ return `${l.cache}/engine/${t2}/${r4}`;
684
+ }
685
+ function B(t2) {
686
+ return `${l.data}/${t2}`;
687
+ }
688
+ async function J(t2) {
689
+ try {
690
+ return await D(t2, P.F_OK), true;
691
+ } catch (r4) {
692
+ if (u(r4)) return false;
693
+ throw r4;
694
+ }
695
+ }
696
+ async function K(t2, r4) {
697
+ let i2 = await G(t2);
698
+ await O(r4, i2), await x(r4, "755");
699
+ }
700
+ async function q(t2, r4) {
701
+ await t2.stream().pipeTo(A.toWeb(w(r4, { encoding: "utf8" })));
702
+ }
703
+ function u(t2) {
704
+ return t2 != null && typeof t2 == "object" && "code" in t2 && t2.code === "ENOENT";
705
+ }
706
+ async function Q(t2) {
707
+ try {
708
+ return await _(t2, { encoding: "utf-8" });
709
+ } catch (r4) {
710
+ if (u(r4)) return null;
711
+ throw r4;
712
+ }
713
+ }
714
+ async function U(t2) {
715
+ await T(t2, { recursive: true });
716
+ }
717
+ async function V(t2, r4) {
718
+ try {
719
+ return (await E(t2, { withFileTypes: true })).reduce((f2, s) => (s.isDirectory() && !s.name.startsWith(".") && (!r4 || dist_default2(r4, s.name)) && f2.push(s.name), f2), []);
720
+ } catch (i2) {
721
+ if (u(i2)) return [];
722
+ throw i2;
723
+ }
724
+ }
725
+
726
+ // ../../../node_modules/.pnpm/valibot@1.2.0_typescript@5.9.3/node_modules/valibot/dist/index.mjs
727
+ var store$4;
728
+ // @__NO_SIDE_EFFECTS__
729
+ function getGlobalConfig(config$1) {
730
+ return {
731
+ lang: config$1?.lang ?? store$4?.lang,
732
+ message: config$1?.message,
733
+ abortEarly: config$1?.abortEarly ?? store$4?.abortEarly,
734
+ abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly
735
+ };
736
+ }
737
+ var store$3;
738
+ // @__NO_SIDE_EFFECTS__
739
+ function getGlobalMessage(lang) {
740
+ return store$3?.get(lang);
741
+ }
742
+ var store$2;
743
+ // @__NO_SIDE_EFFECTS__
744
+ function getSchemaMessage(lang) {
745
+ return store$2?.get(lang);
746
+ }
747
+ var store$1;
748
+ // @__NO_SIDE_EFFECTS__
749
+ function getSpecificMessage(reference, lang) {
750
+ return store$1?.get(reference)?.get(lang);
751
+ }
752
+ // @__NO_SIDE_EFFECTS__
753
+ function _stringify(input) {
754
+ const type = typeof input;
755
+ if (type === "string") return `"${input}"`;
756
+ if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
757
+ if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
758
+ return type;
759
+ }
760
+ function _addIssue(context, label, dataset, config$1, other) {
761
+ const input = other && "input" in other ? other.input : dataset.value;
762
+ const expected = other?.expected ?? context.expects ?? null;
763
+ const received = other?.received ?? /* @__PURE__ */ _stringify(input);
764
+ const issue = {
765
+ kind: context.kind,
766
+ type: context.type,
767
+ input,
768
+ expected,
769
+ received,
770
+ message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
771
+ requirement: context.requirement,
772
+ path: other?.path,
773
+ issues: other?.issues,
774
+ lang: config$1.lang,
775
+ abortEarly: config$1.abortEarly,
776
+ abortPipeEarly: config$1.abortPipeEarly
777
+ };
778
+ const isSchema = context.kind === "schema";
779
+ const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang);
780
+ if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
781
+ if (isSchema) dataset.typed = false;
782
+ if (dataset.issues) dataset.issues.push(issue);
783
+ else dataset.issues = [issue];
784
+ }
785
+ // @__NO_SIDE_EFFECTS__
786
+ function _getStandardProps(context) {
787
+ return {
788
+ version: 1,
789
+ vendor: "valibot",
790
+ validate(value$1) {
791
+ return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
792
+ }
793
+ };
794
+ }
795
+ // @__NO_SIDE_EFFECTS__
796
+ function _isValidObjectKey(object$1, key) {
797
+ return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
798
+ }
799
+ // @__NO_SIDE_EFFECTS__
800
+ function _joinExpects(values$1, separator) {
801
+ const list = [...new Set(values$1)];
802
+ if (list.length > 1) return `(${list.join(` ${separator} `)})`;
803
+ return list[0] ?? "never";
804
+ }
805
+ // @__NO_SIDE_EFFECTS__
806
+ function integer(message$1) {
807
+ return {
808
+ kind: "validation",
809
+ type: "integer",
810
+ reference: integer,
811
+ async: false,
812
+ expects: null,
813
+ requirement: Number.isInteger,
814
+ message: message$1,
815
+ "~run"(dataset, config$1) {
816
+ if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1);
817
+ return dataset;
818
+ }
819
+ };
820
+ }
821
+ // @__NO_SIDE_EFFECTS__
822
+ function minLength(requirement, message$1) {
823
+ return {
824
+ kind: "validation",
825
+ type: "min_length",
826
+ reference: minLength,
827
+ async: false,
828
+ expects: `>=${requirement}`,
829
+ requirement,
830
+ message: message$1,
831
+ "~run"(dataset, config$1) {
832
+ if (dataset.typed && dataset.value.length < this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` });
833
+ return dataset;
834
+ }
835
+ };
836
+ }
837
+ // @__NO_SIDE_EFFECTS__
838
+ function minValue(requirement, message$1) {
839
+ return {
840
+ kind: "validation",
841
+ type: "min_value",
842
+ reference: minValue,
843
+ async: false,
844
+ expects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`,
845
+ requirement,
846
+ message: message$1,
847
+ "~run"(dataset, config$1) {
848
+ if (dataset.typed && !(dataset.value >= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) });
849
+ return dataset;
850
+ }
851
+ };
852
+ }
853
+ // @__NO_SIDE_EFFECTS__
854
+ function parseJson(config$1, message$1) {
855
+ return {
856
+ kind: "transformation",
857
+ type: "parse_json",
858
+ reference: parseJson,
859
+ config: config$1,
860
+ message: message$1,
861
+ async: false,
862
+ "~run"(dataset, config$2) {
863
+ try {
864
+ dataset.value = JSON.parse(dataset.value, this.config?.reviver);
865
+ } catch (error) {
866
+ if (error instanceof Error) {
867
+ _addIssue(this, "JSON", dataset, config$2, { received: `"${error.message}"` });
868
+ dataset.typed = false;
869
+ } else throw error;
870
+ }
871
+ return dataset;
872
+ }
873
+ };
874
+ }
875
+ // @__NO_SIDE_EFFECTS__
876
+ function regex3(requirement, message$1) {
877
+ return {
878
+ kind: "validation",
879
+ type: "regex",
880
+ reference: regex3,
881
+ async: false,
882
+ expects: `${requirement}`,
883
+ requirement,
884
+ message: message$1,
885
+ "~run"(dataset, config$1) {
886
+ if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "format", dataset, config$1);
887
+ return dataset;
888
+ }
889
+ };
890
+ }
891
+ // @__NO_SIDE_EFFECTS__
892
+ function url(message$1) {
893
+ return {
894
+ kind: "validation",
895
+ type: "url",
896
+ reference: url,
897
+ async: false,
898
+ expects: null,
899
+ requirement(input) {
900
+ try {
901
+ new URL(input);
902
+ return true;
903
+ } catch {
904
+ return false;
905
+ }
906
+ },
907
+ message: message$1,
908
+ "~run"(dataset, config$1) {
909
+ if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "URL", dataset, config$1);
910
+ return dataset;
911
+ }
912
+ };
913
+ }
914
+ // @__NO_SIDE_EFFECTS__
915
+ function getFallback(schema, dataset, config$1) {
916
+ return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
917
+ }
918
+ // @__NO_SIDE_EFFECTS__
919
+ function getDefault(schema, dataset, config$1) {
920
+ return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
921
+ }
922
+ // @__NO_SIDE_EFFECTS__
923
+ function array(item, message$1) {
924
+ return {
925
+ kind: "schema",
926
+ type: "array",
927
+ reference: array,
928
+ expects: "Array",
929
+ async: false,
930
+ item,
931
+ message: message$1,
932
+ get "~standard"() {
933
+ return /* @__PURE__ */ _getStandardProps(this);
934
+ },
935
+ "~run"(dataset, config$1) {
936
+ const input = dataset.value;
937
+ if (Array.isArray(input)) {
938
+ dataset.typed = true;
939
+ dataset.value = [];
940
+ for (let key = 0; key < input.length; key++) {
941
+ const value$1 = input[key];
942
+ const itemDataset = this.item["~run"]({ value: value$1 }, config$1);
943
+ if (itemDataset.issues) {
944
+ const pathItem = {
945
+ type: "array",
946
+ origin: "value",
947
+ input,
948
+ key,
949
+ value: value$1
950
+ };
951
+ for (const issue of itemDataset.issues) {
952
+ if (issue.path) issue.path.unshift(pathItem);
953
+ else issue.path = [pathItem];
954
+ dataset.issues?.push(issue);
955
+ }
956
+ if (!dataset.issues) dataset.issues = itemDataset.issues;
957
+ if (config$1.abortEarly) {
958
+ dataset.typed = false;
959
+ break;
960
+ }
961
+ }
962
+ if (!itemDataset.typed) dataset.typed = false;
963
+ dataset.value.push(itemDataset.value);
964
+ }
965
+ } else _addIssue(this, "type", dataset, config$1);
966
+ return dataset;
967
+ }
968
+ };
969
+ }
970
+ // @__NO_SIDE_EFFECTS__
971
+ function literal(literal_, message$1) {
972
+ return {
973
+ kind: "schema",
974
+ type: "literal",
975
+ reference: literal,
976
+ expects: /* @__PURE__ */ _stringify(literal_),
977
+ async: false,
978
+ literal: literal_,
979
+ message: message$1,
980
+ get "~standard"() {
981
+ return /* @__PURE__ */ _getStandardProps(this);
982
+ },
983
+ "~run"(dataset, config$1) {
984
+ if (dataset.value === this.literal) dataset.typed = true;
985
+ else _addIssue(this, "type", dataset, config$1);
986
+ return dataset;
987
+ }
988
+ };
989
+ }
990
+ // @__NO_SIDE_EFFECTS__
991
+ function looseObject(entries$1, message$1) {
992
+ return {
993
+ kind: "schema",
994
+ type: "loose_object",
995
+ reference: looseObject,
996
+ expects: "Object",
997
+ async: false,
998
+ entries: entries$1,
999
+ message: message$1,
1000
+ get "~standard"() {
1001
+ return /* @__PURE__ */ _getStandardProps(this);
1002
+ },
1003
+ "~run"(dataset, config$1) {
1004
+ const input = dataset.value;
1005
+ if (input && typeof input === "object") {
1006
+ dataset.typed = true;
1007
+ dataset.value = {};
1008
+ for (const key in this.entries) {
1009
+ const valueSchema = this.entries[key];
1010
+ if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
1011
+ const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
1012
+ const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
1013
+ if (valueDataset.issues) {
1014
+ const pathItem = {
1015
+ type: "object",
1016
+ origin: "value",
1017
+ input,
1018
+ key,
1019
+ value: value$1
1020
+ };
1021
+ for (const issue of valueDataset.issues) {
1022
+ if (issue.path) issue.path.unshift(pathItem);
1023
+ else issue.path = [pathItem];
1024
+ dataset.issues?.push(issue);
1025
+ }
1026
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
1027
+ if (config$1.abortEarly) {
1028
+ dataset.typed = false;
1029
+ break;
1030
+ }
1031
+ }
1032
+ if (!valueDataset.typed) dataset.typed = false;
1033
+ dataset.value[key] = valueDataset.value;
1034
+ } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
1035
+ else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
1036
+ _addIssue(this, "key", dataset, config$1, {
1037
+ input: void 0,
1038
+ expected: `"${key}"`,
1039
+ path: [{
1040
+ type: "object",
1041
+ origin: "key",
1042
+ input,
1043
+ key,
1044
+ value: input[key]
1045
+ }]
1046
+ });
1047
+ if (config$1.abortEarly) break;
1048
+ }
1049
+ }
1050
+ if (!dataset.issues || !config$1.abortEarly) {
1051
+ for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
1052
+ }
1053
+ } else _addIssue(this, "type", dataset, config$1);
1054
+ return dataset;
1055
+ }
1056
+ };
1057
+ }
1058
+ // @__NO_SIDE_EFFECTS__
1059
+ function number(message$1) {
1060
+ return {
1061
+ kind: "schema",
1062
+ type: "number",
1063
+ reference: number,
1064
+ expects: "number",
1065
+ async: false,
1066
+ message: message$1,
1067
+ get "~standard"() {
1068
+ return /* @__PURE__ */ _getStandardProps(this);
1069
+ },
1070
+ "~run"(dataset, config$1) {
1071
+ if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
1072
+ else _addIssue(this, "type", dataset, config$1);
1073
+ return dataset;
1074
+ }
1075
+ };
1076
+ }
1077
+ // @__NO_SIDE_EFFECTS__
1078
+ function object(entries$1, message$1) {
1079
+ return {
1080
+ kind: "schema",
1081
+ type: "object",
1082
+ reference: object,
1083
+ expects: "Object",
1084
+ async: false,
1085
+ entries: entries$1,
1086
+ message: message$1,
1087
+ get "~standard"() {
1088
+ return /* @__PURE__ */ _getStandardProps(this);
1089
+ },
1090
+ "~run"(dataset, config$1) {
1091
+ const input = dataset.value;
1092
+ if (input && typeof input === "object") {
1093
+ dataset.typed = true;
1094
+ dataset.value = {};
1095
+ for (const key in this.entries) {
1096
+ const valueSchema = this.entries[key];
1097
+ if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
1098
+ const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
1099
+ const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
1100
+ if (valueDataset.issues) {
1101
+ const pathItem = {
1102
+ type: "object",
1103
+ origin: "value",
1104
+ input,
1105
+ key,
1106
+ value: value$1
1107
+ };
1108
+ for (const issue of valueDataset.issues) {
1109
+ if (issue.path) issue.path.unshift(pathItem);
1110
+ else issue.path = [pathItem];
1111
+ dataset.issues?.push(issue);
1112
+ }
1113
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
1114
+ if (config$1.abortEarly) {
1115
+ dataset.typed = false;
1116
+ break;
1117
+ }
1118
+ }
1119
+ if (!valueDataset.typed) dataset.typed = false;
1120
+ dataset.value[key] = valueDataset.value;
1121
+ } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
1122
+ else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
1123
+ _addIssue(this, "key", dataset, config$1, {
1124
+ input: void 0,
1125
+ expected: `"${key}"`,
1126
+ path: [{
1127
+ type: "object",
1128
+ origin: "key",
1129
+ input,
1130
+ key,
1131
+ value: input[key]
1132
+ }]
1133
+ });
1134
+ if (config$1.abortEarly) break;
1135
+ }
1136
+ }
1137
+ } else _addIssue(this, "type", dataset, config$1);
1138
+ return dataset;
1139
+ }
1140
+ };
1141
+ }
1142
+ // @__NO_SIDE_EFFECTS__
1143
+ function optional2(wrapped, default_) {
1144
+ return {
1145
+ kind: "schema",
1146
+ type: "optional",
1147
+ reference: optional2,
1148
+ expects: `(${wrapped.expects} | undefined)`,
1149
+ async: false,
1150
+ wrapped,
1151
+ default: default_,
1152
+ get "~standard"() {
1153
+ return /* @__PURE__ */ _getStandardProps(this);
1154
+ },
1155
+ "~run"(dataset, config$1) {
1156
+ if (dataset.value === void 0) {
1157
+ if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
1158
+ if (dataset.value === void 0) {
1159
+ dataset.typed = true;
1160
+ return dataset;
1161
+ }
1162
+ }
1163
+ return this.wrapped["~run"](dataset, config$1);
1164
+ }
1165
+ };
1166
+ }
1167
+ // @__NO_SIDE_EFFECTS__
1168
+ function string2(message$1) {
1169
+ return {
1170
+ kind: "schema",
1171
+ type: "string",
1172
+ reference: string2,
1173
+ expects: "string",
1174
+ async: false,
1175
+ message: message$1,
1176
+ get "~standard"() {
1177
+ return /* @__PURE__ */ _getStandardProps(this);
1178
+ },
1179
+ "~run"(dataset, config$1) {
1180
+ if (typeof dataset.value === "string") dataset.typed = true;
1181
+ else _addIssue(this, "type", dataset, config$1);
1182
+ return dataset;
1183
+ }
1184
+ };
1185
+ }
1186
+ // @__NO_SIDE_EFFECTS__
1187
+ function _subIssues(datasets) {
1188
+ let issues;
1189
+ if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);
1190
+ else issues = dataset.issues;
1191
+ return issues;
1192
+ }
1193
+ // @__NO_SIDE_EFFECTS__
1194
+ function union(options, message$1) {
1195
+ return {
1196
+ kind: "schema",
1197
+ type: "union",
1198
+ reference: union,
1199
+ expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
1200
+ async: false,
1201
+ options,
1202
+ message: message$1,
1203
+ get "~standard"() {
1204
+ return /* @__PURE__ */ _getStandardProps(this);
1205
+ },
1206
+ "~run"(dataset, config$1) {
1207
+ let validDataset;
1208
+ let typedDatasets;
1209
+ let untypedDatasets;
1210
+ for (const schema of this.options) {
1211
+ const optionDataset = schema["~run"]({ value: dataset.value }, config$1);
1212
+ if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
1213
+ else typedDatasets = [optionDataset];
1214
+ else {
1215
+ validDataset = optionDataset;
1216
+ break;
1217
+ }
1218
+ else if (untypedDatasets) untypedDatasets.push(optionDataset);
1219
+ else untypedDatasets = [optionDataset];
1220
+ }
1221
+ if (validDataset) return validDataset;
1222
+ if (typedDatasets) {
1223
+ if (typedDatasets.length === 1) return typedDatasets[0];
1224
+ _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
1225
+ dataset.typed = true;
1226
+ } else if (untypedDatasets?.length === 1) return untypedDatasets[0];
1227
+ else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
1228
+ return dataset;
1229
+ }
1230
+ };
1231
+ }
1232
+ // @__NO_SIDE_EFFECTS__
1233
+ function pipe(...pipe$1) {
1234
+ return {
1235
+ ...pipe$1[0],
1236
+ pipe: pipe$1,
1237
+ get "~standard"() {
1238
+ return /* @__PURE__ */ _getStandardProps(this);
1239
+ },
1240
+ "~run"(dataset, config$1) {
1241
+ for (const item of pipe$1) if (item.kind !== "metadata") {
1242
+ if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
1243
+ dataset.typed = false;
1244
+ break;
1245
+ }
1246
+ if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
1247
+ }
1248
+ return dataset;
1249
+ }
1250
+ };
1251
+ }
1252
+ // @__NO_SIDE_EFFECTS__
1253
+ function safeParse(schema, input, config$1) {
1254
+ const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
1255
+ return {
1256
+ typed: dataset.typed,
1257
+ success: !dataset.issues,
1258
+ output: dataset.value,
1259
+ issues: dataset.issues
1260
+ };
1261
+ }
1262
+
1263
+ // ../../../node_modules/.pnpm/@prisma+dev@0.19.1_typescript@5.9.3/node_modules/@prisma/dev/dist/chunk-7NDL3ECU.js
1264
+ import { spawn as U2 } from "child_process";
1265
+ import { once as F3 } from "events";
1266
+ import { mkdir as V3 } from "fs/promises";
1267
+ import { join as q2 } from "path";
1268
+ import { setTimeout as z2 } from "timers/promises";
1269
+
1270
+ // ../../../node_modules/.pnpm/std-env@3.10.0/node_modules/std-env/dist/index.mjs
1271
+ var r = /* @__PURE__ */ Object.create(null);
1272
+ var i = (e2) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e2 ? r : globalThis);
1273
+ var o2 = new Proxy(r, { get(e2, s) {
1274
+ return i()[s] ?? r[s];
1275
+ }, has(e2, s) {
1276
+ const E2 = i();
1277
+ return s in E2 || s in r;
1278
+ }, set(e2, s, E2) {
1279
+ const B2 = i(true);
1280
+ return B2[s] = E2, true;
1281
+ }, deleteProperty(e2, s) {
1282
+ if (!s) return false;
1283
+ const E2 = i(true);
1284
+ return delete E2[s], true;
1285
+ }, ownKeys() {
1286
+ const e2 = i(true);
1287
+ return Object.keys(e2);
1288
+ } });
1289
+ var t = typeof process < "u" && process.env && process.env.NODE_ENV || "";
1290
+ var f = [["APPVEYOR"], ["AWS_AMPLIFY", "AWS_APP_ID", { ci: true }], ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"], ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"], ["APPCIRCLE", "AC_APPCIRCLE"], ["BAMBOO", "bamboo_planKey"], ["BITBUCKET", "BITBUCKET_COMMIT"], ["BITRISE", "BITRISE_IO"], ["BUDDY", "BUDDY_WORKSPACE_ID"], ["BUILDKITE"], ["CIRCLE", "CIRCLECI"], ["CIRRUS", "CIRRUS_CI"], ["CLOUDFLARE_PAGES", "CF_PAGES", { ci: true }], ["CLOUDFLARE_WORKERS", "WORKERS_CI", { ci: true }], ["CODEBUILD", "CODEBUILD_BUILD_ARN"], ["CODEFRESH", "CF_BUILD_ID"], ["DRONE"], ["DRONE", "DRONE_BUILD_EVENT"], ["DSARI"], ["GITHUB_ACTIONS"], ["GITLAB", "GITLAB_CI"], ["GITLAB", "CI_MERGE_REQUEST_ID"], ["GOCD", "GO_PIPELINE_LABEL"], ["LAYERCI"], ["HUDSON", "HUDSON_URL"], ["JENKINS", "JENKINS_URL"], ["MAGNUM"], ["NETLIFY"], ["NETLIFY", "NETLIFY_LOCAL", { ci: false }], ["NEVERCODE"], ["RENDER"], ["SAIL", "SAILCI"], ["SEMAPHORE"], ["SCREWDRIVER"], ["SHIPPABLE"], ["SOLANO", "TDDIUM"], ["STRIDER"], ["TEAMCITY", "TEAMCITY_VERSION"], ["TRAVIS"], ["VERCEL", "NOW_BUILDER"], ["VERCEL", "VERCEL", { ci: false }], ["VERCEL", "VERCEL_ENV", { ci: false }], ["APPCENTER", "APPCENTER_BUILD_ID"], ["CODESANDBOX", "CODESANDBOX_SSE", { ci: false }], ["CODESANDBOX", "CODESANDBOX_HOST", { ci: false }], ["STACKBLITZ"], ["STORMKIT"], ["CLEAVR"], ["ZEABUR"], ["CODESPHERE", "CODESPHERE_APP_ID", { ci: true }], ["RAILWAY", "RAILWAY_PROJECT_ID"], ["RAILWAY", "RAILWAY_SERVICE_ID"], ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"], ["FIREBASE_APP_HOSTING", "FIREBASE_APP_HOSTING", { ci: true }]];
1291
+ function b() {
1292
+ if (globalThis.process?.env) for (const e2 of f) {
1293
+ const s = e2[1] || e2[0];
1294
+ if (globalThis.process?.env[s]) return { name: e2[0].toLowerCase(), ...e2[2] };
1295
+ }
1296
+ return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? { name: "stackblitz", ci: false } : { name: "", ci: false };
1297
+ }
1298
+ var l2 = b();
1299
+ var p2 = l2.name;
1300
+ function n2(e2) {
1301
+ return e2 ? e2 !== "false" : false;
1302
+ }
1303
+ var I = globalThis.process?.platform || "";
1304
+ var T2 = n2(o2.CI) || l2.ci !== false;
1305
+ var R = n2(globalThis.process?.stdout && globalThis.process?.stdout.isTTY);
1306
+ var d = n2(o2.DEBUG);
1307
+ var a2 = t === "test" || n2(o2.TEST);
1308
+ var v2 = n2(o2.MINIMAL) || T2 || a2 || !R;
1309
+ var A2 = /^win/i.test(I);
1310
+ var M = /^linux/i.test(I);
1311
+ var m = /^darwin/i.test(I);
1312
+ var Y = !n2(o2.NO_COLOR) && (n2(o2.FORCE_COLOR) || (R || A2) && o2.TERM !== "dumb" || T2);
1313
+ var C2 = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
1314
+ var V2 = Number(C2?.split(".")[0]) || null;
1315
+ var W = globalThis.process || /* @__PURE__ */ Object.create(null);
1316
+ var _2 = { versions: {} };
1317
+ var y2 = new Proxy(W, { get(e2, s) {
1318
+ if (s === "env") return o2;
1319
+ if (s in e2) return e2[s];
1320
+ if (s in _2) return _2[s];
1321
+ } });
1322
+ var O2 = globalThis.process?.release?.name === "node";
1323
+ var c2 = !!globalThis.Bun || !!globalThis.process?.versions?.bun;
1324
+ var D2 = !!globalThis.Deno;
1325
+ var L = !!globalThis.fastly;
1326
+ var S = !!globalThis.Netlify;
1327
+ var u2 = !!globalThis.EdgeRuntime;
1328
+ var N = globalThis.navigator?.userAgent === "Cloudflare-Workers";
1329
+ var F2 = [[S, "netlify"], [u2, "edge-light"], [N, "workerd"], [L, "fastly"], [D2, "deno"], [c2, "bun"], [O2, "node"]];
1330
+ function G2() {
1331
+ const e2 = F2.find((s) => s[0]);
1332
+ if (e2) return { name: e2[1] };
1333
+ }
1334
+ var P2 = G2();
1335
+ var K2 = P2?.name || "";
1336
+
1337
+ // ../../../node_modules/.pnpm/@prisma+dev@0.19.1_typescript@5.9.3/node_modules/@prisma/dev/dist/chunk-7NDL3ECU.js
1338
+ var S2 = /^(postgres|postgresql):\/\//;
1339
+ var N2 = pipe(string2(), parseJson(), object({ databaseUrl: pipe(string2(), url(), regex3(S2)), name: optional2(pipe(string2(), minLength(1))), shadowDatabaseUrl: pipe(string2(), url(), regex3(S2)) }));
1340
+ function Y2(r4) {
1341
+ return Buffer.from(JSON.stringify(Object.fromEntries(Object.entries(r4).sort(([[e2], [n3]]) => e2.localeCompare(n3)))), "utf8").toString("base64url");
1342
+ }
1343
+ function Q2(r4) {
1344
+ let e2 = Buffer.from(r4, "base64url").toString("utf8"), { issues: n3, output: s, success: t2 } = safeParse(N2, e2, { abortEarly: true });
1345
+ return t2 ? [null, s] : [n3];
1346
+ }
1347
+ var X = async (r4, e2) => {
1348
+ let { authorization: n3 } = r4, { HTTPException: s } = await import("./http-exception-FZY2H4OF.js");
1349
+ if (!n3) throw new s(401, { message: "Missing API Key" });
1350
+ let [t2, o3 = "", i2] = n3.split(" ");
1351
+ if (t2 !== "Bearer" || i2) throw new s(401, { message: "Invalid API Key" });
1352
+ let [a3, m2] = Q2(o3);
1353
+ if (a3) throw new s(401, { message: "Invalid API Key", cause: a3.join(", ") });
1354
+ let { databaseUrl: h2, name: c3, shadowDatabaseUrl: d2 } = m2, l3 = e2.get("name"), g2 = new URL(e2.req.url).port;
1355
+ if (!c3) throw new s(401, { message: `Wrong API Key; The Prisma Dev server running at port ${g2} requires an API Key from a newer version of \`prisma dev\`. Check the "${l3}" server's output for the updated \`DATABASE_URL\` value.` });
1356
+ if (c3 !== l3) throw new s(401, { message: `Wrong API Key; The Prisma Dev server running at port ${g2} is named "${l3}", but the API Key is for "${c3}"` });
1357
+ let { hostname: f2, port: E2 } = new URL(h2), { port: $ } = e2.get("db"), { hostname: C3, port: D3 } = new URL(d2), H = e2.get("shadowDBPort");
1358
+ if (f2 !== "localhost" || Number(E2) !== $ || C3 !== "localhost" || Number(D3) !== H) throw new s(401, { message: "Wrong API Key; Check your Prisma schema's `provider.url` value (probably defined in `.env`'s `DATABASE_URL` environment variable) is aligned with `prisma dev`'s output" });
1359
+ return { decodedAPIKey: m2 };
1360
+ };
1361
+ function O3(r4) {
1362
+ let e2, n3, s = new Promise((i2, a3) => {
1363
+ e2 = i2, n3 = a3;
1364
+ }), t2 = (i2) => {
1365
+ t2 = o3 = null, n3(i2), r4?.onRejected?.(i2), r4?.onFulfilled?.();
1366
+ }, o3 = (i2) => {
1367
+ o3 = t2 = null, e2(i2), r4?.onResolved?.(i2), r4?.onFulfilled?.();
1368
+ };
1369
+ return { isFulfilled: () => o3 === t2, promise: s, reject: (i2) => t2?.(i2), resolve: (i2) => o3?.(i2) };
1370
+ }
1371
+ var { PRISMA_DEV_FORCE_ENGINE_BINARY_DOWNLOAD: J2, PRISMA_DEV_FORCE_ENGINE_BINARY_PATH: G3, PRISMA_DEV_FORCE_NETWORK_DELAY_MS: I2 } = y2.env;
1372
+ var x2 = class r2 {
1373
+ static #t = /* @__PURE__ */ new Map();
1374
+ #e;
1375
+ #n;
1376
+ constructor(e2) {
1377
+ this.#e = e2, this.#n = null;
1378
+ }
1379
+ static async get(e2) {
1380
+ let { debug: n3 } = e2, s = `${e2.schemaHash}:${e2.clientVersion}`;
1381
+ try {
1382
+ let t2 = r2.#t.get(s);
1383
+ if (t2) return t2;
1384
+ let o3 = new r2(e2);
1385
+ return r2.#t.set(s, o3), n3 && console.debug("[Query Engine] starting...", e2), await o3.start(), n3 && console.debug("[Query Engine] started!"), o3;
1386
+ } finally {
1387
+ r2.stopAll(s);
1388
+ }
1389
+ }
1390
+ static async stopAll(e2) {
1391
+ let s = (await Promise.allSettled(Array.from(r2.#t.entries()).filter(([t2]) => t2 !== e2).map(async ([t2, o3]) => {
1392
+ try {
1393
+ await o3.stop();
1394
+ } finally {
1395
+ r2.#t.delete(t2);
1396
+ }
1397
+ }))).filter((t2) => t2.status === "rejected").map((t2) => t2.reason);
1398
+ if (s.length > 0) throw new AggregateError(s, "Failed to stop engines");
1399
+ }
1400
+ async commitTransaction(e2, n3) {
1401
+ return await this.#i(e2, n3, "commit");
1402
+ }
1403
+ async request(e2, n3) {
1404
+ let { url: s } = await this.start(), t2 = this.#s(n3), o3 = await fetch(s, { body: typeof e2 == "string" ? e2 : JSON.stringify(e2), headers: { ...t2, "Content-Type": "application/json" }, method: "POST" });
1405
+ if (!o3.ok) throw await u3.fromResponse(o3);
1406
+ return await o3.text();
1407
+ }
1408
+ async rollbackTransaction(e2, n3) {
1409
+ return await this.#i(e2, n3, "rollback");
1410
+ }
1411
+ async startTransaction(e2, n3) {
1412
+ let { url: s } = await this.start(), t2 = this.#s(n3), o3 = await fetch(`${s}/transaction/start`, { body: JSON.stringify(e2), headers: { ...t2, "Content-Type": "application/json" }, method: "POST" });
1413
+ if (!o3.ok) throw await u3.fromResponse(o3);
1414
+ return await o3.json();
1415
+ }
1416
+ async start() {
1417
+ if (this.#n != null) return await this.#n;
1418
+ let { promise: e2, reject: n3, resolve: s } = O3();
1419
+ this.#n = e2;
1420
+ let t2 = G3 || await this.#o();
1421
+ this.#e.debug && console.debug("[Query Engine] spinning up at path...", t2);
1422
+ let { proxySignals: o3 } = await import("./proxy-signals-GUDAMDHV.js"), i2 = U2(t2, ["--enable-raw-queries", "--enable-telemetry-in-response", "--port", "0"], { env: { LOG_QUERIES: "y", PRISMA_DML: this.#e.base64Schema, QE_LOG_LEVEL: "TRACE", RUST_BACKTRACE: "1", RUST_LOG: "info" }, stdio: ["ignore", "pipe", "pipe"], windowsHide: true });
1423
+ o3(i2), i2.stderr.setEncoding("utf8"), i2.stdout.setEncoding("utf8");
1424
+ let a3 = (c3) => {
1425
+ let d2 = c3.split(`
1426
+ `).find((E2) => E2.includes("Started query engine http server"));
1427
+ if (!d2) return;
1428
+ i2.stdout.removeListener("data", a3);
1429
+ let { fields: l3 } = JSON.parse(d2);
1430
+ if (l3 == null) return n3(new Error(`Unexpected data during initialization, "fields" are missing: ${c3}`));
1431
+ let { ip: g2, port: f2 } = l3;
1432
+ if (g2 == null || f2 == null) return n3(new Error(`This version of query-engine is not compatible with minippg, "ip" and "port" are missing in the startup log entry.
1433
+ Received data: ${c3}`));
1434
+ s({ childProcess: i2, url: `http://${g2}:${f2}` });
1435
+ }, m2 = (c3) => {
1436
+ this.#n = null, n3(new p3(String(c3))), i2.removeListener("exit", h2), i2.kill();
1437
+ };
1438
+ i2.once("error", m2);
1439
+ let h2 = (c3, d2) => {
1440
+ this.#n = null, n3(new p3(`Query Engine exited with code ${c3} and signal ${d2}`));
1441
+ };
1442
+ return i2.once("exit", h2), i2.stdout.on("data", a3), this.#e.debug && (i2.stderr.on("data", console.error.bind(console, "[Query Engine]")), i2.stdout.on("data", console.debug.bind(console, "[Query Engine]"))), await this.#n;
1443
+ }
1444
+ async stop() {
1445
+ if (this.#n == null) return;
1446
+ let { childProcess: e2 } = await this.#n;
1447
+ e2.exitCode == null && e2.signalCode == null && (this.#n = null, e2.kill(), await F3(e2, "exit"));
1448
+ }
1449
+ async #o() {
1450
+ this.#e.debug && console.debug("[Query Engine] getting engine commit hash...");
1451
+ let e2 = await this.#r();
1452
+ this.#e.debug && console.debug("[Query Engine] got engine commit hash", e2);
1453
+ let n3 = z(this.#e.clientVersion, e2);
1454
+ this.#e.debug && console.debug("[Query Engine] cache directory path", n3), await V3(n3, { recursive: true });
1455
+ let { binaryTarget: s } = this.#e.platform, t2 = s === "windows" ? ".exe" : "", o3 = q2(n3, `query-engine-${s}${t2}`);
1456
+ return this.#e.debug && console.debug("[Query Engine] binary path", o3), (J2 === "1" || await J(o3) === false) && await this.#a({ commitHash: e2, extension: t2, engineBinaryPath: o3 }), o3;
1457
+ }
1458
+ async #r() {
1459
+ let e2 = await fetch(`https://registry.npmjs.org/@prisma/client/${this.#e.clientVersion}`);
1460
+ if (!e2.ok) throw new Error(`Couldn't fetch package.json from npm registry, status code: ${e2.status}`);
1461
+ let s = (await e2.json()).devDependencies?.["@prisma/engines-version"];
1462
+ if (!s) throw new Error("Couldn't find engines version in package.json");
1463
+ let t2 = s.split(".").at(-1);
1464
+ if (!t2) throw new Error("Couldn't find commit hash in engines version");
1465
+ return t2;
1466
+ }
1467
+ async #a(e2) {
1468
+ let { commitHash: n3, extension: s, engineBinaryPath: t2 } = e2, { binaryTarget: o3 } = this.#e.platform, i2 = `https://binaries.prisma.sh/all_commits/${n3}/${o3}/query-engine${s}.gz`;
1469
+ this.#e.debug && console.debug("[Query Engine] downloading engine from url", i2);
1470
+ let a3 = await fetch(i2);
1471
+ if (!a3.ok) throw new Error(`Couldn't download engine. URL: ${i2}, status code: ${a3.status}`);
1472
+ I2 && await z2(Number(I2)), await K(await a3.arrayBuffer(), t2), this.#e.debug && console.debug("[Query Engine] downloaded and saved at", t2);
1473
+ }
1474
+ #s(e2) {
1475
+ let n3 = {};
1476
+ for (let [s, t2] of Object.entries(e2)) t2 != null && (n3[s] = t2);
1477
+ return n3;
1478
+ }
1479
+ async #i(e2, n3, s) {
1480
+ let { url: t2 } = await this.#n, o3 = this.#s(n3), i2 = await fetch(`${t2}/transaction/${e2}/${s}`, { headers: { ...o3, "Content-Type": "application/json" }, method: "POST" });
1481
+ if (!i2.ok) throw await u3.fromResponse(i2);
1482
+ try {
1483
+ return await i2.json();
1484
+ } catch {
1485
+ return {};
1486
+ }
1487
+ }
1488
+ };
1489
+ function ue(r4, e2) {
1490
+ return console.error(r4), r4 instanceof p3 ? e2.json({ EngineNotStarted: { reason: { EngineStartupError: { logs: [], msg: r4.message } } } }, 500) : r4 instanceof u3 ? e2.text(r4.responseBody, r4.statusCode) : e2.body(null, 500);
1491
+ }
1492
+ var p3 = class extends Error {
1493
+ name = "EngineStartError";
1494
+ };
1495
+ var u3 = class r3 extends Error {
1496
+ constructor(n3, s, t2) {
1497
+ super(`${n3}: Query Engine response status ${s}, body: ${t2}`);
1498
+ this.action = n3;
1499
+ this.statusCode = s;
1500
+ this.responseBody = t2;
1501
+ }
1502
+ name = "EngineHttpError";
1503
+ static async fromResponse(n3) {
1504
+ let s = new URL(n3.url), t2 = await n3.text();
1505
+ return new r3(s.pathname, n3.status, t2);
1506
+ }
1507
+ };
1508
+
1509
+ export {
1510
+ B,
1511
+ q,
1512
+ Q,
1513
+ U,
1514
+ V,
1515
+ y2 as y,
1516
+ integer,
1517
+ minLength,
1518
+ minValue,
1519
+ parseJson,
1520
+ url,
1521
+ array,
1522
+ literal,
1523
+ looseObject,
1524
+ number,
1525
+ object,
1526
+ optional2 as optional,
1527
+ string2 as string,
1528
+ union,
1529
+ pipe,
1530
+ safeParse,
1531
+ Y2 as Y,
1532
+ X,
1533
+ O3 as O,
1534
+ x2 as x,
1535
+ ue
1536
+ };
1537
+ //# sourceMappingURL=chunk-XPLNMXQV.js.map