@powerlines/deepkit 0.5.3 → 0.5.4

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 (45) hide show
  1. package/dist/capnp.cjs +47 -49
  2. package/dist/capnp.js +2 -4
  3. package/dist/chunk-23YNDVRG.js +34 -0
  4. package/dist/chunk-5MYRXRS2.cjs +2191 -0
  5. package/dist/{chunk-MSO7PT57.cjs → chunk-7FXYDYVQ.cjs} +128 -128
  6. package/dist/{chunk-B47NLUDW.cjs → chunk-7QZGCBH7.cjs} +2 -2
  7. package/dist/{chunk-47WBQTA6.js → chunk-ALM6UMVU.js} +1 -1
  8. package/dist/chunk-BLLXF42T.cjs +41 -0
  9. package/dist/{chunk-3PKIT7K2.cjs → chunk-CJMS4ES3.cjs} +4 -4
  10. package/dist/{chunk-JSH5MVQG.js → chunk-EJIBYA23.js} +2 -2
  11. package/dist/{chunk-GVS5O43Z.js → chunk-JE36RI7U.js} +2 -2
  12. package/dist/chunk-KGCRCOJQ.cjs +22 -0
  13. package/dist/chunk-SHUYVCID.js +4 -0
  14. package/dist/{chunk-XI47ZADG.js → chunk-TDYIUJGY.js} +9 -9
  15. package/dist/chunk-USNT2KNT.cjs +6 -0
  16. package/dist/chunk-WL27D7L7.js +2183 -0
  17. package/dist/chunk-XHSSGKUT.js +16 -0
  18. package/dist/{chunk-KDKCOXXC.cjs → chunk-YAEE7DDW.cjs} +5 -5
  19. package/dist/esbuild-plugin.cjs +5 -6
  20. package/dist/esbuild-plugin.js +4 -5
  21. package/dist/index.cjs +66 -68
  22. package/dist/index.js +8 -10
  23. package/dist/reflect-type.cjs +6 -8
  24. package/dist/reflect-type.js +5 -7
  25. package/dist/resolve-reflections.cjs +3 -3
  26. package/dist/resolve-reflections.js +2 -2
  27. package/dist/transformer.cjs +4 -5
  28. package/dist/transformer.js +2 -3
  29. package/dist/transpile.cjs +4 -5
  30. package/dist/transpile.js +3 -4
  31. package/dist/utilities.cjs +9 -11
  32. package/dist/utilities.js +2 -4
  33. package/package.json +4 -4
  34. package/dist/chunk-35PNVYKI.js +0 -187
  35. package/dist/chunk-3GQAWCBQ.js +0 -10
  36. package/dist/chunk-3GRTJOID.cjs +0 -193
  37. package/dist/chunk-4UQ4UDET.cjs +0 -19685
  38. package/dist/chunk-5NPGWGPO.cjs +0 -109
  39. package/dist/chunk-BGYQAVKQ.cjs +0 -13
  40. package/dist/chunk-F5QUFY7D.cjs +0 -135
  41. package/dist/chunk-KWUXT6EF.js +0 -127
  42. package/dist/chunk-O2LKJ62Q.cjs +0 -2863
  43. package/dist/chunk-U7WEV6HK.js +0 -19678
  44. package/dist/chunk-W423FBJ2.js +0 -2854
  45. package/dist/chunk-XU55W26B.js +0 -109
@@ -0,0 +1,2191 @@
1
+ 'use strict';
2
+
3
+ var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
4
+ var type = require('@powerlines/deepkit/vendor/type');
5
+ var buffer = require('buffer');
6
+ var isNull$1 = require('@stryke/type-checks/is-null');
7
+ var isString$1 = require('@stryke/type-checks/is-string');
8
+ var isUndefined$1 = require('@stryke/type-checks/is-undefined');
9
+
10
+ // ../../node_modules/.pnpm/@stryke+helpers@0.9.31/node_modules/@stryke/helpers/dist/get-unique.mjs
11
+ function t(e7, t7 = (e8) => e8) {
12
+ let n6 = /* @__PURE__ */ new Map();
13
+ for (let r5 of e7) {
14
+ let e8 = t7(r5);
15
+ n6.has(e8) || n6.set(e8, r5);
16
+ }
17
+ return [...n6.values()];
18
+ }
19
+ chunkUSNT2KNT_cjs.__name(t, "t");
20
+
21
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/type-checks/src/get-object-tag.mjs
22
+ var e = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => e7 == null ? e7 === void 0 ? `[object Undefined]` : `[object Null]` : Object.prototype.toString.call(e7), "e");
23
+
24
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/type-checks/src/is-plain-object.mjs
25
+ var t2 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => typeof e7 == `object` && !!e7, "t");
26
+ var n = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((n6) => {
27
+ if (!t2(n6) || e(n6) !== `[object Object]`) return false;
28
+ if (Object.getPrototypeOf(n6) === null) return true;
29
+ let r5 = n6;
30
+ for (; Object.getPrototypeOf(r5) !== null; ) r5 = Object.getPrototypeOf(r5);
31
+ return Object.getPrototypeOf(n6) === r5;
32
+ }, "n");
33
+
34
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/type-checks/src/is-object.mjs
35
+ var t3 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((t7) => {
36
+ try {
37
+ return typeof t7 == `object` || !!t7 && t7?.constructor === Object || n(t7);
38
+ } catch {
39
+ return false;
40
+ }
41
+ }, "t");
42
+
43
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/type-checks/src/is-string.mjs
44
+ var e2 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => {
45
+ try {
46
+ return typeof e7 == `string`;
47
+ } catch {
48
+ return false;
49
+ }
50
+ }, "e");
51
+
52
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/types/src/base.mjs
53
+ var e3 = ``;
54
+
55
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/utils/strip-comments.mjs
56
+ var t4 = Symbol(`singleComment`);
57
+ var n2 = Symbol(`multiComment`);
58
+ function r() {
59
+ return ``;
60
+ }
61
+ chunkUSNT2KNT_cjs.__name(r, "r");
62
+ function i(e7, t7, n6) {
63
+ return e7.slice(t7, n6).replace(/\S/g, ` `);
64
+ }
65
+ chunkUSNT2KNT_cjs.__name(i, "i");
66
+ function a(e7, t7) {
67
+ let n6 = t7 - 1, r5 = 0;
68
+ for (; e7[n6] === `\\`; ) --n6, r5 += 1;
69
+ return !!(r5 % 2);
70
+ }
71
+ chunkUSNT2KNT_cjs.__name(a, "a");
72
+ function o(o4, { whitespace: s = true, trailingCommas: c2 = false } = {}) {
73
+ if (typeof o4 != `string`) throw TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof o4}\``);
74
+ let l = s ? i : r, u = false, d = false, f = 0, p = ``, m = ``, h = -1;
75
+ for (let r5 = 0; r5 < o4.length; r5++) {
76
+ let i3 = o4[r5], s2 = o4[r5 + 1];
77
+ !d && i3 === `"` && (a(o4, r5) || (u = !u)), !u && (!d && i3 + (s2 ?? e3) === `//` ? (p += o4.slice(f, r5), f = r5, d = t4, r5++) : d === t4 && i3 + (s2 ?? e3) === `\r
78
+ ` ? (r5++, d = false, p += l(o4, f, r5), f = r5) : d === t4 && i3 === `
79
+ ` ? (d = false, p += l(o4, f, r5), f = r5) : !d && i3 + (s2 ?? e3) === `/*` ? (p += o4.slice(f, r5), f = r5, d = n2, r5++) : d === n2 && i3 + (s2 ?? e3) === `*/` ? (r5++, d = false, p += l(o4, f, r5 + 1), f = r5 + 1) : c2 && !d && (h === -1 ? i3 === `,` && (m += p + o4.slice(f, r5), p = ``, f = r5, h = r5) : i3 === `}` || i3 === `]` ? (p += o4.slice(f, r5), m += l(p, 0, 1) + p.slice(1), p = ``, f = r5, h = -1) : i3 !== ` ` && i3 !== ` ` && i3 !== `\r` && i3 !== `
80
+ ` && (p += o4.slice(f, r5), f = r5, h = -1)));
81
+ }
82
+ return m + p + (d ? l(o4.slice(f)) : o4.slice(f));
83
+ }
84
+ chunkUSNT2KNT_cjs.__name(o, "o");
85
+
86
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/utils/parse.mjs
87
+ var t5 = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/;
88
+ var n3 = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
89
+ var r2 = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
90
+ function i2(e7, t7) {
91
+ if (e7 === `__proto__` || e7 === `constructor` && t7 && typeof t7 == `object` && `prototype` in t7) {
92
+ console.warn(`Dropping "${e7}" key to prevent prototype pollution.`);
93
+ return;
94
+ }
95
+ return t7;
96
+ }
97
+ chunkUSNT2KNT_cjs.__name(i2, "i");
98
+ function a2(a3, o4 = {}) {
99
+ if (typeof a3 != `string`) return a3;
100
+ let s = o(a3);
101
+ if (s[0] === `"` && s[s.length - 1] === `"` && !s.includes(`\\`)) return s.slice(1, -1);
102
+ if (s = s.trim(), s.length <= 9) switch (s.toLowerCase()) {
103
+ case `true`:
104
+ return true;
105
+ case `false`:
106
+ return false;
107
+ case `undefined`:
108
+ return;
109
+ case `null`:
110
+ return null;
111
+ case `nan`:
112
+ return NaN;
113
+ case `infinity`:
114
+ return 1 / 0;
115
+ case `-infinity`:
116
+ return -1 / 0;
117
+ }
118
+ if (!r2.test(s)) {
119
+ if (o4.strict) throw Error(`Invalid JSON`);
120
+ return s;
121
+ }
122
+ try {
123
+ if (t5.test(s) || n3.test(s)) {
124
+ if (o4.strict) throw Error(`Possible prototype pollution`);
125
+ return JSON.parse(s, i2);
126
+ }
127
+ return JSON.parse(s);
128
+ } catch (e7) {
129
+ if (o4.strict) throw e7;
130
+ return a3;
131
+ }
132
+ }
133
+ chunkUSNT2KNT_cjs.__name(a2, "a");
134
+
135
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/utils/code-frames.mjs
136
+ var e4 = /\r\n|[\n\r\u2028\u2029]/;
137
+ function t6(e7, t7, n6 = {}) {
138
+ let r5 = { column: 0, line: -1, ...e7.start }, i3 = { ...r5, ...e7.end }, { linesAbove: a3 = 2, linesBelow: o4 = 3 } = n6 || {}, s = r5.line, c2 = r5.column, l = i3.line, u = i3.column, d = Math.max(s - (a3 + 1), 0), f = Math.min(t7.length, l + o4);
139
+ s === -1 && (d = 0), l === -1 && (f = t7.length);
140
+ let p = l - s, m = {};
141
+ if (p) for (let e8 = 0; e8 <= p; e8++) {
142
+ let n7 = e8 + s;
143
+ c2 ? e8 === 0 ? m[n7] = [c2, (t7[n7 - 1]?.length ?? 0) - c2 + 1] : e8 === p ? m[n7] = [0, u] : m[n7] = [0, t7[n7 - e8]?.length ?? 0] : m[n7] = true;
144
+ }
145
+ else c2 === u ? m[s] = c2 ? [c2, 0] : true : m[s] = [c2, u - c2];
146
+ return { start: d, end: f, markerLines: m };
147
+ }
148
+ chunkUSNT2KNT_cjs.__name(t6, "t");
149
+ function n4(n6, r5, i3 = {}) {
150
+ let { start: a3, end: o4, markerLines: s } = t6(r5, n6.split(e4), i3), c2 = String(o4).length;
151
+ return (i3.highlight ? i3.highlight(n6) : n6).split(e4).slice(a3, o4).map((e7, t7) => {
152
+ let n7 = a3 + 1 + t7, r6 = ` ${` ${n7}`.slice(-c2)} | `, i4 = !!(s[n7] ?? false);
153
+ if (i4) {
154
+ let t8 = ``;
155
+ if (Array.isArray(i4)) {
156
+ let n8 = e7.slice(0, Math.max(i4[0] - 1, 0)).replace(/[^\t]/g, ` `), a4 = i4[1] || 1;
157
+ t8 = [`
158
+ `, r6.replace(/\d/g, ` `), n8, `^`.repeat(a4)].join(``);
159
+ }
160
+ return [`>`, r6, e7, t8].join(``);
161
+ }
162
+ return ` ${r6}${e7}`;
163
+ }).join(`
164
+ `);
165
+ }
166
+ chunkUSNT2KNT_cjs.__name(n4, "n");
167
+
168
+ // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
169
+ function createScanner(text, ignoreTrivia = false) {
170
+ const len = text.length;
171
+ let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
172
+ function scanHexDigits(count, exact) {
173
+ let digits = 0;
174
+ let value2 = 0;
175
+ while (digits < count || !exact) {
176
+ let ch = text.charCodeAt(pos);
177
+ if (ch >= 48 && ch <= 57) {
178
+ value2 = value2 * 16 + ch - 48;
179
+ } else if (ch >= 65 && ch <= 70) {
180
+ value2 = value2 * 16 + ch - 65 + 10;
181
+ } else if (ch >= 97 && ch <= 102) {
182
+ value2 = value2 * 16 + ch - 97 + 10;
183
+ } else {
184
+ break;
185
+ }
186
+ pos++;
187
+ digits++;
188
+ }
189
+ if (digits < count) {
190
+ value2 = -1;
191
+ }
192
+ return value2;
193
+ }
194
+ chunkUSNT2KNT_cjs.__name(scanHexDigits, "scanHexDigits");
195
+ function setPosition(newPosition) {
196
+ pos = newPosition;
197
+ value = "";
198
+ tokenOffset = 0;
199
+ token = 16;
200
+ scanError = 0;
201
+ }
202
+ chunkUSNT2KNT_cjs.__name(setPosition, "setPosition");
203
+ function scanNumber() {
204
+ let start = pos;
205
+ if (text.charCodeAt(pos) === 48) {
206
+ pos++;
207
+ } else {
208
+ pos++;
209
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
210
+ pos++;
211
+ }
212
+ }
213
+ if (pos < text.length && text.charCodeAt(pos) === 46) {
214
+ pos++;
215
+ if (pos < text.length && isDigit(text.charCodeAt(pos))) {
216
+ pos++;
217
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
218
+ pos++;
219
+ }
220
+ } else {
221
+ scanError = 3;
222
+ return text.substring(start, pos);
223
+ }
224
+ }
225
+ let end = pos;
226
+ if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
227
+ pos++;
228
+ if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
229
+ pos++;
230
+ }
231
+ if (pos < text.length && isDigit(text.charCodeAt(pos))) {
232
+ pos++;
233
+ while (pos < text.length && isDigit(text.charCodeAt(pos))) {
234
+ pos++;
235
+ }
236
+ end = pos;
237
+ } else {
238
+ scanError = 3;
239
+ }
240
+ }
241
+ return text.substring(start, end);
242
+ }
243
+ chunkUSNT2KNT_cjs.__name(scanNumber, "scanNumber");
244
+ function scanString() {
245
+ let result = "", start = pos;
246
+ while (true) {
247
+ if (pos >= len) {
248
+ result += text.substring(start, pos);
249
+ scanError = 2;
250
+ break;
251
+ }
252
+ const ch = text.charCodeAt(pos);
253
+ if (ch === 34) {
254
+ result += text.substring(start, pos);
255
+ pos++;
256
+ break;
257
+ }
258
+ if (ch === 92) {
259
+ result += text.substring(start, pos);
260
+ pos++;
261
+ if (pos >= len) {
262
+ scanError = 2;
263
+ break;
264
+ }
265
+ const ch2 = text.charCodeAt(pos++);
266
+ switch (ch2) {
267
+ case 34:
268
+ result += '"';
269
+ break;
270
+ case 92:
271
+ result += "\\";
272
+ break;
273
+ case 47:
274
+ result += "/";
275
+ break;
276
+ case 98:
277
+ result += "\b";
278
+ break;
279
+ case 102:
280
+ result += "\f";
281
+ break;
282
+ case 110:
283
+ result += "\n";
284
+ break;
285
+ case 114:
286
+ result += "\r";
287
+ break;
288
+ case 116:
289
+ result += " ";
290
+ break;
291
+ case 117:
292
+ const ch3 = scanHexDigits(4, true);
293
+ if (ch3 >= 0) {
294
+ result += String.fromCharCode(ch3);
295
+ } else {
296
+ scanError = 4;
297
+ }
298
+ break;
299
+ default:
300
+ scanError = 5;
301
+ }
302
+ start = pos;
303
+ continue;
304
+ }
305
+ if (ch >= 0 && ch <= 31) {
306
+ if (isLineBreak(ch)) {
307
+ result += text.substring(start, pos);
308
+ scanError = 2;
309
+ break;
310
+ } else {
311
+ scanError = 6;
312
+ }
313
+ }
314
+ pos++;
315
+ }
316
+ return result;
317
+ }
318
+ chunkUSNT2KNT_cjs.__name(scanString, "scanString");
319
+ function scanNext() {
320
+ value = "";
321
+ scanError = 0;
322
+ tokenOffset = pos;
323
+ lineStartOffset = lineNumber;
324
+ prevTokenLineStartOffset = tokenLineStartOffset;
325
+ if (pos >= len) {
326
+ tokenOffset = len;
327
+ return token = 17;
328
+ }
329
+ let code = text.charCodeAt(pos);
330
+ if (isWhiteSpace(code)) {
331
+ do {
332
+ pos++;
333
+ value += String.fromCharCode(code);
334
+ code = text.charCodeAt(pos);
335
+ } while (isWhiteSpace(code));
336
+ return token = 15;
337
+ }
338
+ if (isLineBreak(code)) {
339
+ pos++;
340
+ value += String.fromCharCode(code);
341
+ if (code === 13 && text.charCodeAt(pos) === 10) {
342
+ pos++;
343
+ value += "\n";
344
+ }
345
+ lineNumber++;
346
+ tokenLineStartOffset = pos;
347
+ return token = 14;
348
+ }
349
+ switch (code) {
350
+ // tokens: []{}:,
351
+ case 123:
352
+ pos++;
353
+ return token = 1;
354
+ case 125:
355
+ pos++;
356
+ return token = 2;
357
+ case 91:
358
+ pos++;
359
+ return token = 3;
360
+ case 93:
361
+ pos++;
362
+ return token = 4;
363
+ case 58:
364
+ pos++;
365
+ return token = 6;
366
+ case 44:
367
+ pos++;
368
+ return token = 5;
369
+ // strings
370
+ case 34:
371
+ pos++;
372
+ value = scanString();
373
+ return token = 10;
374
+ // comments
375
+ case 47:
376
+ const start = pos - 1;
377
+ if (text.charCodeAt(pos + 1) === 47) {
378
+ pos += 2;
379
+ while (pos < len) {
380
+ if (isLineBreak(text.charCodeAt(pos))) {
381
+ break;
382
+ }
383
+ pos++;
384
+ }
385
+ value = text.substring(start, pos);
386
+ return token = 12;
387
+ }
388
+ if (text.charCodeAt(pos + 1) === 42) {
389
+ pos += 2;
390
+ const safeLength = len - 1;
391
+ let commentClosed = false;
392
+ while (pos < safeLength) {
393
+ const ch = text.charCodeAt(pos);
394
+ if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
395
+ pos += 2;
396
+ commentClosed = true;
397
+ break;
398
+ }
399
+ pos++;
400
+ if (isLineBreak(ch)) {
401
+ if (ch === 13 && text.charCodeAt(pos) === 10) {
402
+ pos++;
403
+ }
404
+ lineNumber++;
405
+ tokenLineStartOffset = pos;
406
+ }
407
+ }
408
+ if (!commentClosed) {
409
+ pos++;
410
+ scanError = 1;
411
+ }
412
+ value = text.substring(start, pos);
413
+ return token = 13;
414
+ }
415
+ value += String.fromCharCode(code);
416
+ pos++;
417
+ return token = 16;
418
+ // numbers
419
+ case 45:
420
+ value += String.fromCharCode(code);
421
+ pos++;
422
+ if (pos === len || !isDigit(text.charCodeAt(pos))) {
423
+ return token = 16;
424
+ }
425
+ // found a minus, followed by a number so
426
+ // we fall through to proceed with scanning
427
+ // numbers
428
+ case 48:
429
+ case 49:
430
+ case 50:
431
+ case 51:
432
+ case 52:
433
+ case 53:
434
+ case 54:
435
+ case 55:
436
+ case 56:
437
+ case 57:
438
+ value += scanNumber();
439
+ return token = 11;
440
+ // literals and unknown symbols
441
+ default:
442
+ while (pos < len && isUnknownContentCharacter(code)) {
443
+ pos++;
444
+ code = text.charCodeAt(pos);
445
+ }
446
+ if (tokenOffset !== pos) {
447
+ value = text.substring(tokenOffset, pos);
448
+ switch (value) {
449
+ case "true":
450
+ return token = 8;
451
+ case "false":
452
+ return token = 9;
453
+ case "null":
454
+ return token = 7;
455
+ }
456
+ return token = 16;
457
+ }
458
+ value += String.fromCharCode(code);
459
+ pos++;
460
+ return token = 16;
461
+ }
462
+ }
463
+ chunkUSNT2KNT_cjs.__name(scanNext, "scanNext");
464
+ function isUnknownContentCharacter(code) {
465
+ if (isWhiteSpace(code) || isLineBreak(code)) {
466
+ return false;
467
+ }
468
+ switch (code) {
469
+ case 125:
470
+ case 93:
471
+ case 123:
472
+ case 91:
473
+ case 34:
474
+ case 58:
475
+ case 44:
476
+ case 47:
477
+ return false;
478
+ }
479
+ return true;
480
+ }
481
+ chunkUSNT2KNT_cjs.__name(isUnknownContentCharacter, "isUnknownContentCharacter");
482
+ function scanNextNonTrivia() {
483
+ let result;
484
+ do {
485
+ result = scanNext();
486
+ } while (result >= 12 && result <= 15);
487
+ return result;
488
+ }
489
+ chunkUSNT2KNT_cjs.__name(scanNextNonTrivia, "scanNextNonTrivia");
490
+ return {
491
+ setPosition,
492
+ getPosition: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => pos, "getPosition"),
493
+ scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
494
+ getToken: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => token, "getToken"),
495
+ getTokenValue: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => value, "getTokenValue"),
496
+ getTokenOffset: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => tokenOffset, "getTokenOffset"),
497
+ getTokenLength: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => pos - tokenOffset, "getTokenLength"),
498
+ getTokenStartLine: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => lineStartOffset, "getTokenStartLine"),
499
+ getTokenStartCharacter: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => tokenOffset - prevTokenLineStartOffset, "getTokenStartCharacter"),
500
+ getTokenError: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => scanError, "getTokenError")
501
+ };
502
+ }
503
+ chunkUSNT2KNT_cjs.__name(createScanner, "createScanner");
504
+ function isWhiteSpace(ch) {
505
+ return ch === 32 || ch === 9;
506
+ }
507
+ chunkUSNT2KNT_cjs.__name(isWhiteSpace, "isWhiteSpace");
508
+ function isLineBreak(ch) {
509
+ return ch === 10 || ch === 13;
510
+ }
511
+ chunkUSNT2KNT_cjs.__name(isLineBreak, "isLineBreak");
512
+ function isDigit(ch) {
513
+ return ch >= 48 && ch <= 57;
514
+ }
515
+ chunkUSNT2KNT_cjs.__name(isDigit, "isDigit");
516
+ var CharacterCodes;
517
+ (function(CharacterCodes2) {
518
+ CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
519
+ CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
520
+ CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
521
+ CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
522
+ CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
523
+ CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
524
+ CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
525
+ CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
526
+ CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
527
+ CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
528
+ CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
529
+ CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
530
+ CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
531
+ CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
532
+ CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
533
+ CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
534
+ CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
535
+ CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
536
+ CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
537
+ CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
538
+ CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
539
+ CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
540
+ CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
541
+ CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
542
+ CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
543
+ CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
544
+ CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
545
+ CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
546
+ CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
547
+ CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
548
+ CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
549
+ CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
550
+ CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
551
+ CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
552
+ CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
553
+ CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
554
+ CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
555
+ CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
556
+ CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
557
+ CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
558
+ CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
559
+ CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
560
+ CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
561
+ CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
562
+ CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
563
+ CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
564
+ CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
565
+ CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
566
+ CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
567
+ CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
568
+ CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
569
+ CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
570
+ CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
571
+ CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
572
+ CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
573
+ CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
574
+ CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
575
+ CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
576
+ CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
577
+ CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
578
+ CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
579
+ CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
580
+ CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
581
+ CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
582
+ CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
583
+ CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
584
+ CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
585
+ CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
586
+ CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
587
+ CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
588
+ CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
589
+ CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
590
+ CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
591
+ CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
592
+ CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
593
+ CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
594
+ CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
595
+ CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
596
+ CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
597
+ CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
598
+ })(CharacterCodes || (CharacterCodes = {}));
599
+
600
+ // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/parser.js
601
+ var ParseOptions;
602
+ (function(ParseOptions2) {
603
+ ParseOptions2.DEFAULT = {
604
+ allowTrailingComma: false
605
+ };
606
+ })(ParseOptions || (ParseOptions = {}));
607
+ function parse(text, errors = [], options = ParseOptions.DEFAULT) {
608
+ let currentProperty = null;
609
+ let currentParent = [];
610
+ const previousParents = [];
611
+ function onValue(value) {
612
+ if (Array.isArray(currentParent)) {
613
+ currentParent.push(value);
614
+ } else if (currentProperty !== null) {
615
+ currentParent[currentProperty] = value;
616
+ }
617
+ }
618
+ chunkUSNT2KNT_cjs.__name(onValue, "onValue");
619
+ const visitor = {
620
+ onObjectBegin: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => {
621
+ const object = {};
622
+ onValue(object);
623
+ previousParents.push(currentParent);
624
+ currentParent = object;
625
+ currentProperty = null;
626
+ }, "onObjectBegin"),
627
+ onObjectProperty: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((name) => {
628
+ currentProperty = name;
629
+ }, "onObjectProperty"),
630
+ onObjectEnd: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => {
631
+ currentParent = previousParents.pop();
632
+ }, "onObjectEnd"),
633
+ onArrayBegin: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => {
634
+ const array = [];
635
+ onValue(array);
636
+ previousParents.push(currentParent);
637
+ currentParent = array;
638
+ currentProperty = null;
639
+ }, "onArrayBegin"),
640
+ onArrayEnd: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => {
641
+ currentParent = previousParents.pop();
642
+ }, "onArrayEnd"),
643
+ onLiteralValue: onValue,
644
+ onError: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((error, offset, length) => {
645
+ errors.push({
646
+ error,
647
+ offset,
648
+ length
649
+ });
650
+ }, "onError")
651
+ };
652
+ visit(text, visitor, options);
653
+ return currentParent[0];
654
+ }
655
+ chunkUSNT2KNT_cjs.__name(parse, "parse");
656
+ function visit(text, visitor, options = ParseOptions.DEFAULT) {
657
+ const _scanner = createScanner(text, false);
658
+ const _jsonPath = [];
659
+ function toNoArgVisit(visitFunction) {
660
+ return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
661
+ }
662
+ chunkUSNT2KNT_cjs.__name(toNoArgVisit, "toNoArgVisit");
663
+ function toNoArgVisitWithPath(visitFunction) {
664
+ return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
665
+ }
666
+ chunkUSNT2KNT_cjs.__name(toNoArgVisitWithPath, "toNoArgVisitWithPath");
667
+ function toOneArgVisit(visitFunction) {
668
+ return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
669
+ }
670
+ chunkUSNT2KNT_cjs.__name(toOneArgVisit, "toOneArgVisit");
671
+ function toOneArgVisitWithPath(visitFunction) {
672
+ return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
673
+ }
674
+ chunkUSNT2KNT_cjs.__name(toOneArgVisitWithPath, "toOneArgVisitWithPath");
675
+ const onObjectBegin = toNoArgVisitWithPath(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisitWithPath(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
676
+ const disallowComments = options && options.disallowComments;
677
+ const allowTrailingComma = options && options.allowTrailingComma;
678
+ function scanNext() {
679
+ while (true) {
680
+ const token = _scanner.scan();
681
+ switch (_scanner.getTokenError()) {
682
+ case 4:
683
+ handleError(
684
+ 14
685
+ /* ParseErrorCode.InvalidUnicode */
686
+ );
687
+ break;
688
+ case 5:
689
+ handleError(
690
+ 15
691
+ /* ParseErrorCode.InvalidEscapeCharacter */
692
+ );
693
+ break;
694
+ case 3:
695
+ handleError(
696
+ 13
697
+ /* ParseErrorCode.UnexpectedEndOfNumber */
698
+ );
699
+ break;
700
+ case 1:
701
+ if (!disallowComments) {
702
+ handleError(
703
+ 11
704
+ /* ParseErrorCode.UnexpectedEndOfComment */
705
+ );
706
+ }
707
+ break;
708
+ case 2:
709
+ handleError(
710
+ 12
711
+ /* ParseErrorCode.UnexpectedEndOfString */
712
+ );
713
+ break;
714
+ case 6:
715
+ handleError(
716
+ 16
717
+ /* ParseErrorCode.InvalidCharacter */
718
+ );
719
+ break;
720
+ }
721
+ switch (token) {
722
+ case 12:
723
+ case 13:
724
+ if (disallowComments) {
725
+ handleError(
726
+ 10
727
+ /* ParseErrorCode.InvalidCommentToken */
728
+ );
729
+ } else {
730
+ onComment();
731
+ }
732
+ break;
733
+ case 16:
734
+ handleError(
735
+ 1
736
+ /* ParseErrorCode.InvalidSymbol */
737
+ );
738
+ break;
739
+ case 15:
740
+ case 14:
741
+ break;
742
+ default:
743
+ return token;
744
+ }
745
+ }
746
+ }
747
+ chunkUSNT2KNT_cjs.__name(scanNext, "scanNext");
748
+ function handleError(error, skipUntilAfter = [], skipUntil = []) {
749
+ onError(error);
750
+ if (skipUntilAfter.length + skipUntil.length > 0) {
751
+ let token = _scanner.getToken();
752
+ while (token !== 17) {
753
+ if (skipUntilAfter.indexOf(token) !== -1) {
754
+ scanNext();
755
+ break;
756
+ } else if (skipUntil.indexOf(token) !== -1) {
757
+ break;
758
+ }
759
+ token = scanNext();
760
+ }
761
+ }
762
+ }
763
+ chunkUSNT2KNT_cjs.__name(handleError, "handleError");
764
+ function parseString(isValue) {
765
+ const value = _scanner.getTokenValue();
766
+ if (isValue) {
767
+ onLiteralValue(value);
768
+ } else {
769
+ onObjectProperty(value);
770
+ _jsonPath.push(value);
771
+ }
772
+ scanNext();
773
+ return true;
774
+ }
775
+ chunkUSNT2KNT_cjs.__name(parseString, "parseString");
776
+ function parseLiteral() {
777
+ switch (_scanner.getToken()) {
778
+ case 11:
779
+ const tokenValue = _scanner.getTokenValue();
780
+ let value = Number(tokenValue);
781
+ if (isNaN(value)) {
782
+ handleError(
783
+ 2
784
+ /* ParseErrorCode.InvalidNumberFormat */
785
+ );
786
+ value = 0;
787
+ }
788
+ onLiteralValue(value);
789
+ break;
790
+ case 7:
791
+ onLiteralValue(null);
792
+ break;
793
+ case 8:
794
+ onLiteralValue(true);
795
+ break;
796
+ case 9:
797
+ onLiteralValue(false);
798
+ break;
799
+ default:
800
+ return false;
801
+ }
802
+ scanNext();
803
+ return true;
804
+ }
805
+ chunkUSNT2KNT_cjs.__name(parseLiteral, "parseLiteral");
806
+ function parseProperty() {
807
+ if (_scanner.getToken() !== 10) {
808
+ handleError(3, [], [
809
+ 2,
810
+ 5
811
+ /* SyntaxKind.CommaToken */
812
+ ]);
813
+ return false;
814
+ }
815
+ parseString(false);
816
+ if (_scanner.getToken() === 6) {
817
+ onSeparator(":");
818
+ scanNext();
819
+ if (!parseValue()) {
820
+ handleError(4, [], [
821
+ 2,
822
+ 5
823
+ /* SyntaxKind.CommaToken */
824
+ ]);
825
+ }
826
+ } else {
827
+ handleError(5, [], [
828
+ 2,
829
+ 5
830
+ /* SyntaxKind.CommaToken */
831
+ ]);
832
+ }
833
+ _jsonPath.pop();
834
+ return true;
835
+ }
836
+ chunkUSNT2KNT_cjs.__name(parseProperty, "parseProperty");
837
+ function parseObject() {
838
+ onObjectBegin();
839
+ scanNext();
840
+ let needsComma = false;
841
+ while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
842
+ if (_scanner.getToken() === 5) {
843
+ if (!needsComma) {
844
+ handleError(4, [], []);
845
+ }
846
+ onSeparator(",");
847
+ scanNext();
848
+ if (_scanner.getToken() === 2 && allowTrailingComma) {
849
+ break;
850
+ }
851
+ } else if (needsComma) {
852
+ handleError(6, [], []);
853
+ }
854
+ if (!parseProperty()) {
855
+ handleError(4, [], [
856
+ 2,
857
+ 5
858
+ /* SyntaxKind.CommaToken */
859
+ ]);
860
+ }
861
+ needsComma = true;
862
+ }
863
+ onObjectEnd();
864
+ if (_scanner.getToken() !== 2) {
865
+ handleError(7, [
866
+ 2
867
+ /* SyntaxKind.CloseBraceToken */
868
+ ], []);
869
+ } else {
870
+ scanNext();
871
+ }
872
+ return true;
873
+ }
874
+ chunkUSNT2KNT_cjs.__name(parseObject, "parseObject");
875
+ function parseArray() {
876
+ onArrayBegin();
877
+ scanNext();
878
+ let isFirstElement = true;
879
+ let needsComma = false;
880
+ while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
881
+ if (_scanner.getToken() === 5) {
882
+ if (!needsComma) {
883
+ handleError(4, [], []);
884
+ }
885
+ onSeparator(",");
886
+ scanNext();
887
+ if (_scanner.getToken() === 4 && allowTrailingComma) {
888
+ break;
889
+ }
890
+ } else if (needsComma) {
891
+ handleError(6, [], []);
892
+ }
893
+ if (isFirstElement) {
894
+ _jsonPath.push(0);
895
+ isFirstElement = false;
896
+ } else {
897
+ _jsonPath[_jsonPath.length - 1]++;
898
+ }
899
+ if (!parseValue()) {
900
+ handleError(4, [], [
901
+ 4,
902
+ 5
903
+ /* SyntaxKind.CommaToken */
904
+ ]);
905
+ }
906
+ needsComma = true;
907
+ }
908
+ onArrayEnd();
909
+ if (!isFirstElement) {
910
+ _jsonPath.pop();
911
+ }
912
+ if (_scanner.getToken() !== 4) {
913
+ handleError(8, [
914
+ 4
915
+ /* SyntaxKind.CloseBracketToken */
916
+ ], []);
917
+ } else {
918
+ scanNext();
919
+ }
920
+ return true;
921
+ }
922
+ chunkUSNT2KNT_cjs.__name(parseArray, "parseArray");
923
+ function parseValue() {
924
+ switch (_scanner.getToken()) {
925
+ case 3:
926
+ return parseArray();
927
+ case 1:
928
+ return parseObject();
929
+ case 10:
930
+ return parseString(true);
931
+ default:
932
+ return parseLiteral();
933
+ }
934
+ }
935
+ chunkUSNT2KNT_cjs.__name(parseValue, "parseValue");
936
+ scanNext();
937
+ if (_scanner.getToken() === 17) {
938
+ if (options.allowEmptyContent) {
939
+ return true;
940
+ }
941
+ handleError(4, [], []);
942
+ return false;
943
+ }
944
+ if (!parseValue()) {
945
+ handleError(4, [], []);
946
+ return false;
947
+ }
948
+ if (_scanner.getToken() !== 17) {
949
+ handleError(9, [], []);
950
+ }
951
+ return true;
952
+ }
953
+ chunkUSNT2KNT_cjs.__name(visit, "visit");
954
+
955
+ // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js
956
+ var ScanError;
957
+ (function(ScanError2) {
958
+ ScanError2[ScanError2["None"] = 0] = "None";
959
+ ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
960
+ ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
961
+ ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
962
+ ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
963
+ ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
964
+ ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
965
+ })(ScanError || (ScanError = {}));
966
+ var SyntaxKind;
967
+ (function(SyntaxKind2) {
968
+ SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
969
+ SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
970
+ SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
971
+ SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
972
+ SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
973
+ SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
974
+ SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
975
+ SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
976
+ SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
977
+ SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
978
+ SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
979
+ SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
980
+ SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
981
+ SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
982
+ SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
983
+ SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
984
+ SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
985
+ })(SyntaxKind || (SyntaxKind = {}));
986
+ var parse2 = parse;
987
+ var ParseErrorCode;
988
+ (function(ParseErrorCode2) {
989
+ ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
990
+ ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
991
+ ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
992
+ ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
993
+ ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
994
+ ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
995
+ ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
996
+ ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
997
+ ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
998
+ ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
999
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
1000
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
1001
+ ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
1002
+ ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
1003
+ ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
1004
+ ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
1005
+ })(ParseErrorCode || (ParseErrorCode = {}));
1006
+ function printParseErrorCode(code) {
1007
+ switch (code) {
1008
+ case 1:
1009
+ return "InvalidSymbol";
1010
+ case 2:
1011
+ return "InvalidNumberFormat";
1012
+ case 3:
1013
+ return "PropertyNameExpected";
1014
+ case 4:
1015
+ return "ValueExpected";
1016
+ case 5:
1017
+ return "ColonExpected";
1018
+ case 6:
1019
+ return "CommaExpected";
1020
+ case 7:
1021
+ return "CloseBraceExpected";
1022
+ case 8:
1023
+ return "CloseBracketExpected";
1024
+ case 9:
1025
+ return "EndOfFileExpected";
1026
+ case 10:
1027
+ return "InvalidCommentToken";
1028
+ case 11:
1029
+ return "UnexpectedEndOfComment";
1030
+ case 12:
1031
+ return "UnexpectedEndOfString";
1032
+ case 13:
1033
+ return "UnexpectedEndOfNumber";
1034
+ case 14:
1035
+ return "InvalidUnicode";
1036
+ case 15:
1037
+ return "InvalidEscapeCharacter";
1038
+ case 16:
1039
+ return "InvalidCharacter";
1040
+ }
1041
+ return "<unknown ParseErrorCode>";
1042
+ }
1043
+ chunkUSNT2KNT_cjs.__name(printParseErrorCode, "printParseErrorCode");
1044
+
1045
+ // ../../node_modules/.pnpm/lines-and-columns@2.0.4/node_modules/lines-and-columns/build/index.mjs
1046
+ var LF = "\n";
1047
+ var CR = "\r";
1048
+ var LinesAndColumns = (
1049
+ /** @class */
1050
+ (function() {
1051
+ function LinesAndColumns2(string) {
1052
+ this.length = string.length;
1053
+ var offsets = [0];
1054
+ for (var offset = 0; offset < string.length; ) {
1055
+ switch (string[offset]) {
1056
+ case LF:
1057
+ offset += LF.length;
1058
+ offsets.push(offset);
1059
+ break;
1060
+ case CR:
1061
+ offset += CR.length;
1062
+ if (string[offset] === LF) {
1063
+ offset += LF.length;
1064
+ }
1065
+ offsets.push(offset);
1066
+ break;
1067
+ default:
1068
+ offset++;
1069
+ break;
1070
+ }
1071
+ }
1072
+ this.offsets = offsets;
1073
+ }
1074
+ chunkUSNT2KNT_cjs.__name(LinesAndColumns2, "LinesAndColumns");
1075
+ LinesAndColumns2.prototype.locationForIndex = function(index) {
1076
+ if (index < 0 || index > this.length) {
1077
+ return null;
1078
+ }
1079
+ var line = 0;
1080
+ var offsets = this.offsets;
1081
+ while (offsets[line + 1] <= index) {
1082
+ line++;
1083
+ }
1084
+ var column = index - offsets[line];
1085
+ return { line, column };
1086
+ };
1087
+ LinesAndColumns2.prototype.indexForLocation = function(location) {
1088
+ var line = location.line, column = location.column;
1089
+ if (line < 0 || line >= this.offsets.length) {
1090
+ return null;
1091
+ }
1092
+ if (column < 0 || column > this.lengthOfLine(line)) {
1093
+ return null;
1094
+ }
1095
+ return this.offsets[line] + column;
1096
+ };
1097
+ LinesAndColumns2.prototype.lengthOfLine = function(line) {
1098
+ var offset = this.offsets[line];
1099
+ var nextOffset = line === this.offsets.length - 1 ? this.length : this.offsets[line + 1];
1100
+ return nextOffset - offset;
1101
+ };
1102
+ return LinesAndColumns2;
1103
+ })()
1104
+ );
1105
+
1106
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/utils/parse-error.mjs
1107
+ function r3(r5, i3) {
1108
+ let { error: a3, offset: o4, length: s } = i3, c2 = new LinesAndColumns(r5).locationForIndex(o4), l = c2?.line ?? 0, u = c2?.column ?? 0;
1109
+ return l++, u++, `${printParseErrorCode(a3)} in JSON at ${l}:${u}
1110
+ ${n4(r5, { start: { line: l, column: u }, end: { line: l, column: u + s } })}
1111
+ `;
1112
+ }
1113
+ chunkUSNT2KNT_cjs.__name(r3, "r");
1114
+
1115
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/type-checks/src/is-number.mjs
1116
+ var e5 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => {
1117
+ try {
1118
+ return e7 instanceof Number || typeof e7 == `number` || Number(e7) === e7;
1119
+ } catch {
1120
+ return false;
1121
+ }
1122
+ }, "e");
1123
+
1124
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/type-checks/src/is-undefined.mjs
1125
+ var e6 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => e7 === void 0, "e");
1126
+
1127
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/utils/stringify.mjs
1128
+ var n5 = `@/#$ :;,.!?&=+-*%^~|\\"'\`{}[]()<>`.split(``);
1129
+ var r4 = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((i3, a3 = 2) => {
1130
+ let o4 = e5(a3) ? ` `.repeat(a3) : a3;
1131
+ switch (i3) {
1132
+ case null:
1133
+ return `null`;
1134
+ case void 0:
1135
+ return `"undefined"`;
1136
+ case true:
1137
+ return `true`;
1138
+ case false:
1139
+ return `false`;
1140
+ case 1 / 0:
1141
+ return `infinity`;
1142
+ case -1 / 0:
1143
+ return `-infinity`;
1144
+ }
1145
+ if (Array.isArray(i3)) return `[${o4}${i3.map((e7) => r4(e7, o4)).join(`,${o4}`)}${o4}]`;
1146
+ if (i3 instanceof Uint8Array) return i3.toString();
1147
+ switch (typeof i3) {
1148
+ case `number`:
1149
+ return `${i3}`;
1150
+ case `string`:
1151
+ return JSON.stringify(i3);
1152
+ case `object`:
1153
+ return `{${o4}${Object.keys(i3).filter((e7) => !e6(i3[e7])).map((e7) => `${n5.some((t7) => e7.includes(t7)) ? `"${e7}"` : e7}: ${o4}${r4(i3[e7], o4)}`).join(`,${o4}`)}${o4}}`;
1154
+ default:
1155
+ return `null`;
1156
+ }
1157
+ }, "r");
1158
+
1159
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.js
1160
+ var DoubleIndexedKV = class {
1161
+ static {
1162
+ chunkUSNT2KNT_cjs.__name(this, "DoubleIndexedKV");
1163
+ }
1164
+ constructor() {
1165
+ this.keyToValue = /* @__PURE__ */ new Map();
1166
+ this.valueToKey = /* @__PURE__ */ new Map();
1167
+ }
1168
+ set(key, value) {
1169
+ this.keyToValue.set(key, value);
1170
+ this.valueToKey.set(value, key);
1171
+ }
1172
+ getByKey(key) {
1173
+ return this.keyToValue.get(key);
1174
+ }
1175
+ getByValue(value) {
1176
+ return this.valueToKey.get(value);
1177
+ }
1178
+ clear() {
1179
+ this.keyToValue.clear();
1180
+ this.valueToKey.clear();
1181
+ }
1182
+ };
1183
+
1184
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.js
1185
+ var Registry = class {
1186
+ static {
1187
+ chunkUSNT2KNT_cjs.__name(this, "Registry");
1188
+ }
1189
+ constructor(generateIdentifier) {
1190
+ this.generateIdentifier = generateIdentifier;
1191
+ this.kv = new DoubleIndexedKV();
1192
+ }
1193
+ register(value, identifier) {
1194
+ if (this.kv.getByValue(value)) {
1195
+ return;
1196
+ }
1197
+ if (!identifier) {
1198
+ identifier = this.generateIdentifier(value);
1199
+ }
1200
+ this.kv.set(identifier, value);
1201
+ }
1202
+ clear() {
1203
+ this.kv.clear();
1204
+ }
1205
+ getIdentifier(value) {
1206
+ return this.kv.getByValue(value);
1207
+ }
1208
+ getValue(identifier) {
1209
+ return this.kv.getByKey(identifier);
1210
+ }
1211
+ };
1212
+
1213
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.js
1214
+ var ClassRegistry = class extends Registry {
1215
+ static {
1216
+ chunkUSNT2KNT_cjs.__name(this, "ClassRegistry");
1217
+ }
1218
+ constructor() {
1219
+ super((c2) => c2.name);
1220
+ this.classToAllowedProps = /* @__PURE__ */ new Map();
1221
+ }
1222
+ register(value, options) {
1223
+ if (typeof options === "object") {
1224
+ if (options.allowProps) {
1225
+ this.classToAllowedProps.set(value, options.allowProps);
1226
+ }
1227
+ super.register(value, options.identifier);
1228
+ } else {
1229
+ super.register(value, options);
1230
+ }
1231
+ }
1232
+ getAllowedProps(value) {
1233
+ return this.classToAllowedProps.get(value);
1234
+ }
1235
+ };
1236
+
1237
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.js
1238
+ function valuesOfObj(record) {
1239
+ if ("values" in Object) {
1240
+ return Object.values(record);
1241
+ }
1242
+ const values = [];
1243
+ for (const key in record) {
1244
+ if (record.hasOwnProperty(key)) {
1245
+ values.push(record[key]);
1246
+ }
1247
+ }
1248
+ return values;
1249
+ }
1250
+ chunkUSNT2KNT_cjs.__name(valuesOfObj, "valuesOfObj");
1251
+ function find(record, predicate) {
1252
+ const values = valuesOfObj(record);
1253
+ if ("find" in values) {
1254
+ return values.find(predicate);
1255
+ }
1256
+ const valuesNotNever = values;
1257
+ for (let i3 = 0; i3 < valuesNotNever.length; i3++) {
1258
+ const value = valuesNotNever[i3];
1259
+ if (predicate(value)) {
1260
+ return value;
1261
+ }
1262
+ }
1263
+ return void 0;
1264
+ }
1265
+ chunkUSNT2KNT_cjs.__name(find, "find");
1266
+ function forEach(record, run) {
1267
+ Object.entries(record).forEach(([key, value]) => run(value, key));
1268
+ }
1269
+ chunkUSNT2KNT_cjs.__name(forEach, "forEach");
1270
+ function includes(arr, value) {
1271
+ return arr.indexOf(value) !== -1;
1272
+ }
1273
+ chunkUSNT2KNT_cjs.__name(includes, "includes");
1274
+ function findArr(record, predicate) {
1275
+ for (let i3 = 0; i3 < record.length; i3++) {
1276
+ const value = record[i3];
1277
+ if (predicate(value)) {
1278
+ return value;
1279
+ }
1280
+ }
1281
+ return void 0;
1282
+ }
1283
+ chunkUSNT2KNT_cjs.__name(findArr, "findArr");
1284
+
1285
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.js
1286
+ var CustomTransformerRegistry = class {
1287
+ static {
1288
+ chunkUSNT2KNT_cjs.__name(this, "CustomTransformerRegistry");
1289
+ }
1290
+ constructor() {
1291
+ this.transfomers = {};
1292
+ }
1293
+ register(transformer) {
1294
+ this.transfomers[transformer.name] = transformer;
1295
+ }
1296
+ findApplicable(v) {
1297
+ return find(this.transfomers, (transformer) => transformer.isApplicable(v));
1298
+ }
1299
+ findByName(name) {
1300
+ return this.transfomers[name];
1301
+ }
1302
+ };
1303
+
1304
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.js
1305
+ var getType = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => Object.prototype.toString.call(payload).slice(8, -1), "getType");
1306
+ var isUndefined = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "undefined", "isUndefined");
1307
+ var isNull = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload === null, "isNull");
1308
+ var isPlainObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => {
1309
+ if (typeof payload !== "object" || payload === null) return false;
1310
+ if (payload === Object.prototype) return false;
1311
+ if (Object.getPrototypeOf(payload) === null) return true;
1312
+ return Object.getPrototypeOf(payload) === Object.prototype;
1313
+ }, "isPlainObject");
1314
+ var isEmptyObject = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => isPlainObject(payload) && Object.keys(payload).length === 0, "isEmptyObject");
1315
+ var isArray = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => Array.isArray(payload), "isArray");
1316
+ var isString = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "string", "isString");
1317
+ var isNumber = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "number" && !isNaN(payload), "isNumber");
1318
+ var isBoolean = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "boolean", "isBoolean");
1319
+ var isRegExp = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload instanceof RegExp, "isRegExp");
1320
+ var isMap = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload instanceof Map, "isMap");
1321
+ var isSet = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload instanceof Set, "isSet");
1322
+ var isSymbol = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => getType(payload) === "Symbol", "isSymbol");
1323
+ var isDate = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload instanceof Date && !isNaN(payload.valueOf()), "isDate");
1324
+ var isError = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload instanceof Error, "isError");
1325
+ var isNaNValue = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "number" && isNaN(payload), "isNaNValue");
1326
+ var isPrimitive = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload), "isPrimitive");
1327
+ var isBigint = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => typeof payload === "bigint", "isBigint");
1328
+ var isInfinite = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload === Infinity || payload === -Infinity, "isInfinite");
1329
+ var isTypedArray = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView), "isTypedArray");
1330
+ var isURL = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((payload) => payload instanceof URL, "isURL");
1331
+
1332
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.js
1333
+ var escapeKey = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((key) => key.replace(/\./g, "\\."), "escapeKey");
1334
+ var stringifyPath = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((path) => path.map(String).map(escapeKey).join("."), "stringifyPath");
1335
+ var parsePath = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((string) => {
1336
+ const result = [];
1337
+ let segment = "";
1338
+ for (let i3 = 0; i3 < string.length; i3++) {
1339
+ let char = string.charAt(i3);
1340
+ const isEscapedDot = char === "\\" && string.charAt(i3 + 1) === ".";
1341
+ if (isEscapedDot) {
1342
+ segment += ".";
1343
+ i3++;
1344
+ continue;
1345
+ }
1346
+ const isEndOfSegment = char === ".";
1347
+ if (isEndOfSegment) {
1348
+ result.push(segment);
1349
+ segment = "";
1350
+ continue;
1351
+ }
1352
+ segment += char;
1353
+ }
1354
+ const lastSegment = segment;
1355
+ result.push(lastSegment);
1356
+ return result;
1357
+ }, "parsePath");
1358
+
1359
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.js
1360
+ function simpleTransformation(isApplicable, annotation, transform, untransform) {
1361
+ return {
1362
+ isApplicable,
1363
+ annotation,
1364
+ transform,
1365
+ untransform
1366
+ };
1367
+ }
1368
+ chunkUSNT2KNT_cjs.__name(simpleTransformation, "simpleTransformation");
1369
+ var simpleRules = [
1370
+ simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
1371
+ simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
1372
+ if (typeof BigInt !== "undefined") {
1373
+ return BigInt(v);
1374
+ }
1375
+ console.error("Please add a BigInt polyfill.");
1376
+ return v;
1377
+ }),
1378
+ simpleTransformation(isDate, "Date", (v) => v.toISOString(), (v) => new Date(v)),
1379
+ simpleTransformation(isError, "Error", (v, superJson) => {
1380
+ const baseError = {
1381
+ name: v.name,
1382
+ message: v.message
1383
+ };
1384
+ superJson.allowedErrorProps.forEach((prop) => {
1385
+ baseError[prop] = v[prop];
1386
+ });
1387
+ return baseError;
1388
+ }, (v, superJson) => {
1389
+ const e7 = new Error(v.message);
1390
+ e7.name = v.name;
1391
+ e7.stack = v.stack;
1392
+ superJson.allowedErrorProps.forEach((prop) => {
1393
+ e7[prop] = v[prop];
1394
+ });
1395
+ return e7;
1396
+ }),
1397
+ simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
1398
+ const body = regex.slice(1, regex.lastIndexOf("/"));
1399
+ const flags = regex.slice(regex.lastIndexOf("/") + 1);
1400
+ return new RegExp(body, flags);
1401
+ }),
1402
+ simpleTransformation(
1403
+ isSet,
1404
+ "set",
1405
+ // (sets only exist in es6+)
1406
+ // eslint-disable-next-line es5/no-es6-methods
1407
+ (v) => [
1408
+ ...v.values()
1409
+ ],
1410
+ (v) => new Set(v)
1411
+ ),
1412
+ simpleTransformation(isMap, "map", (v) => [
1413
+ ...v.entries()
1414
+ ], (v) => new Map(v)),
1415
+ simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
1416
+ if (isNaNValue(v)) {
1417
+ return "NaN";
1418
+ }
1419
+ if (v > 0) {
1420
+ return "Infinity";
1421
+ } else {
1422
+ return "-Infinity";
1423
+ }
1424
+ }, Number),
1425
+ simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
1426
+ return "-0";
1427
+ }, Number),
1428
+ simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
1429
+ ];
1430
+ function compositeTransformation(isApplicable, annotation, transform, untransform) {
1431
+ return {
1432
+ isApplicable,
1433
+ annotation,
1434
+ transform,
1435
+ untransform
1436
+ };
1437
+ }
1438
+ chunkUSNT2KNT_cjs.__name(compositeTransformation, "compositeTransformation");
1439
+ var symbolRule = compositeTransformation((s, superJson) => {
1440
+ if (isSymbol(s)) {
1441
+ const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
1442
+ return isRegistered;
1443
+ }
1444
+ return false;
1445
+ }, (s, superJson) => {
1446
+ const identifier = superJson.symbolRegistry.getIdentifier(s);
1447
+ return [
1448
+ "symbol",
1449
+ identifier
1450
+ ];
1451
+ }, (v) => v.description, (_, a3, superJson) => {
1452
+ const value = superJson.symbolRegistry.getValue(a3[1]);
1453
+ if (!value) {
1454
+ throw new Error("Trying to deserialize unknown symbol");
1455
+ }
1456
+ return value;
1457
+ });
1458
+ var constructorToName = [
1459
+ Int8Array,
1460
+ Uint8Array,
1461
+ Int16Array,
1462
+ Uint16Array,
1463
+ Int32Array,
1464
+ Uint32Array,
1465
+ Float32Array,
1466
+ Float64Array,
1467
+ Uint8ClampedArray
1468
+ ].reduce((obj, ctor) => {
1469
+ obj[ctor.name] = ctor;
1470
+ return obj;
1471
+ }, {});
1472
+ var typedArrayRule = compositeTransformation(isTypedArray, (v) => [
1473
+ "typed-array",
1474
+ v.constructor.name
1475
+ ], (v) => [
1476
+ ...v
1477
+ ], (v, a3) => {
1478
+ const ctor = constructorToName[a3[1]];
1479
+ if (!ctor) {
1480
+ throw new Error("Trying to deserialize unknown typed array");
1481
+ }
1482
+ return new ctor(v);
1483
+ });
1484
+ function isInstanceOfRegisteredClass(potentialClass, superJson) {
1485
+ if (potentialClass?.constructor) {
1486
+ const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
1487
+ return isRegistered;
1488
+ }
1489
+ return false;
1490
+ }
1491
+ chunkUSNT2KNT_cjs.__name(isInstanceOfRegisteredClass, "isInstanceOfRegisteredClass");
1492
+ var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
1493
+ const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
1494
+ return [
1495
+ "class",
1496
+ identifier
1497
+ ];
1498
+ }, (clazz, superJson) => {
1499
+ const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
1500
+ if (!allowedProps) {
1501
+ return {
1502
+ ...clazz
1503
+ };
1504
+ }
1505
+ const result = {};
1506
+ allowedProps.forEach((prop) => {
1507
+ result[prop] = clazz[prop];
1508
+ });
1509
+ return result;
1510
+ }, (v, a3, superJson) => {
1511
+ const clazz = superJson.classRegistry.getValue(a3[1]);
1512
+ if (!clazz) {
1513
+ throw new Error(`Trying to deserialize unknown class '${a3[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
1514
+ }
1515
+ return Object.assign(Object.create(clazz.prototype), v);
1516
+ });
1517
+ var customRule = compositeTransformation((value, superJson) => {
1518
+ return !!superJson.customTransformerRegistry.findApplicable(value);
1519
+ }, (value, superJson) => {
1520
+ const transformer = superJson.customTransformerRegistry.findApplicable(value);
1521
+ return [
1522
+ "custom",
1523
+ transformer.name
1524
+ ];
1525
+ }, (value, superJson) => {
1526
+ const transformer = superJson.customTransformerRegistry.findApplicable(value);
1527
+ return transformer.serialize(value);
1528
+ }, (v, a3, superJson) => {
1529
+ const transformer = superJson.customTransformerRegistry.findByName(a3[1]);
1530
+ if (!transformer) {
1531
+ throw new Error("Trying to deserialize unknown custom value");
1532
+ }
1533
+ return transformer.deserialize(v);
1534
+ });
1535
+ var compositeRules = [
1536
+ classRule,
1537
+ symbolRule,
1538
+ customRule,
1539
+ typedArrayRule
1540
+ ];
1541
+ var transformValue = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value, superJson) => {
1542
+ const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
1543
+ if (applicableCompositeRule) {
1544
+ return {
1545
+ value: applicableCompositeRule.transform(value, superJson),
1546
+ type: applicableCompositeRule.annotation(value, superJson)
1547
+ };
1548
+ }
1549
+ const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
1550
+ if (applicableSimpleRule) {
1551
+ return {
1552
+ value: applicableSimpleRule.transform(value, superJson),
1553
+ type: applicableSimpleRule.annotation
1554
+ };
1555
+ }
1556
+ return void 0;
1557
+ }, "transformValue");
1558
+ var simpleRulesByAnnotation = {};
1559
+ simpleRules.forEach((rule) => {
1560
+ simpleRulesByAnnotation[rule.annotation] = rule;
1561
+ });
1562
+ var untransformValue = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((json, type, superJson) => {
1563
+ if (isArray(type)) {
1564
+ switch (type[0]) {
1565
+ case "symbol":
1566
+ return symbolRule.untransform(json, type, superJson);
1567
+ case "class":
1568
+ return classRule.untransform(json, type, superJson);
1569
+ case "custom":
1570
+ return customRule.untransform(json, type, superJson);
1571
+ case "typed-array":
1572
+ return typedArrayRule.untransform(json, type, superJson);
1573
+ default:
1574
+ throw new Error("Unknown transformation: " + type);
1575
+ }
1576
+ } else {
1577
+ const transformation = simpleRulesByAnnotation[type];
1578
+ if (!transformation) {
1579
+ throw new Error("Unknown transformation: " + type);
1580
+ }
1581
+ return transformation.untransform(json, superJson);
1582
+ }
1583
+ }, "untransformValue");
1584
+
1585
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.js
1586
+ var getNthKey = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((value, n6) => {
1587
+ if (n6 > value.size) throw new Error("index out of bounds");
1588
+ const keys = value.keys();
1589
+ while (n6 > 0) {
1590
+ keys.next();
1591
+ n6--;
1592
+ }
1593
+ return keys.next().value;
1594
+ }, "getNthKey");
1595
+ function validatePath(path) {
1596
+ if (includes(path, "__proto__")) {
1597
+ throw new Error("__proto__ is not allowed as a property");
1598
+ }
1599
+ if (includes(path, "prototype")) {
1600
+ throw new Error("prototype is not allowed as a property");
1601
+ }
1602
+ if (includes(path, "constructor")) {
1603
+ throw new Error("constructor is not allowed as a property");
1604
+ }
1605
+ }
1606
+ chunkUSNT2KNT_cjs.__name(validatePath, "validatePath");
1607
+ var getDeep = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((object, path) => {
1608
+ validatePath(path);
1609
+ for (let i3 = 0; i3 < path.length; i3++) {
1610
+ const key = path[i3];
1611
+ if (isSet(object)) {
1612
+ object = getNthKey(object, +key);
1613
+ } else if (isMap(object)) {
1614
+ const row = +key;
1615
+ const type = +path[++i3] === 0 ? "key" : "value";
1616
+ const keyOfRow = getNthKey(object, row);
1617
+ switch (type) {
1618
+ case "key":
1619
+ object = keyOfRow;
1620
+ break;
1621
+ case "value":
1622
+ object = object.get(keyOfRow);
1623
+ break;
1624
+ }
1625
+ } else {
1626
+ object = object[key];
1627
+ }
1628
+ }
1629
+ return object;
1630
+ }, "getDeep");
1631
+ var setDeep = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((object, path, mapper) => {
1632
+ validatePath(path);
1633
+ if (path.length === 0) {
1634
+ return mapper(object);
1635
+ }
1636
+ let parent = object;
1637
+ for (let i3 = 0; i3 < path.length - 1; i3++) {
1638
+ const key = path[i3];
1639
+ if (isArray(parent)) {
1640
+ const index = +key;
1641
+ parent = parent[index];
1642
+ } else if (isPlainObject(parent)) {
1643
+ parent = parent[key];
1644
+ } else if (isSet(parent)) {
1645
+ const row = +key;
1646
+ parent = getNthKey(parent, row);
1647
+ } else if (isMap(parent)) {
1648
+ const isEnd = i3 === path.length - 2;
1649
+ if (isEnd) {
1650
+ break;
1651
+ }
1652
+ const row = +key;
1653
+ const type = +path[++i3] === 0 ? "key" : "value";
1654
+ const keyOfRow = getNthKey(parent, row);
1655
+ switch (type) {
1656
+ case "key":
1657
+ parent = keyOfRow;
1658
+ break;
1659
+ case "value":
1660
+ parent = parent.get(keyOfRow);
1661
+ break;
1662
+ }
1663
+ }
1664
+ }
1665
+ const lastKey = path[path.length - 1];
1666
+ if (isArray(parent)) {
1667
+ parent[+lastKey] = mapper(parent[+lastKey]);
1668
+ } else if (isPlainObject(parent)) {
1669
+ parent[lastKey] = mapper(parent[lastKey]);
1670
+ }
1671
+ if (isSet(parent)) {
1672
+ const oldValue = getNthKey(parent, +lastKey);
1673
+ const newValue = mapper(oldValue);
1674
+ if (oldValue !== newValue) {
1675
+ parent.delete(oldValue);
1676
+ parent.add(newValue);
1677
+ }
1678
+ }
1679
+ if (isMap(parent)) {
1680
+ const row = +path[path.length - 2];
1681
+ const keyToRow = getNthKey(parent, row);
1682
+ const type = +lastKey === 0 ? "key" : "value";
1683
+ switch (type) {
1684
+ case "key": {
1685
+ const newKey = mapper(keyToRow);
1686
+ parent.set(newKey, parent.get(keyToRow));
1687
+ if (newKey !== keyToRow) {
1688
+ parent.delete(keyToRow);
1689
+ }
1690
+ break;
1691
+ }
1692
+ case "value": {
1693
+ parent.set(keyToRow, mapper(parent.get(keyToRow)));
1694
+ break;
1695
+ }
1696
+ }
1697
+ }
1698
+ return object;
1699
+ }, "setDeep");
1700
+
1701
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.js
1702
+ function traverse(tree, walker2, origin = []) {
1703
+ if (!tree) {
1704
+ return;
1705
+ }
1706
+ if (!isArray(tree)) {
1707
+ forEach(tree, (subtree, key) => traverse(subtree, walker2, [
1708
+ ...origin,
1709
+ ...parsePath(key)
1710
+ ]));
1711
+ return;
1712
+ }
1713
+ const [nodeValue, children] = tree;
1714
+ if (children) {
1715
+ forEach(children, (child, key) => {
1716
+ traverse(child, walker2, [
1717
+ ...origin,
1718
+ ...parsePath(key)
1719
+ ]);
1720
+ });
1721
+ }
1722
+ walker2(nodeValue, origin);
1723
+ }
1724
+ chunkUSNT2KNT_cjs.__name(traverse, "traverse");
1725
+ function applyValueAnnotations(plain, annotations, superJson) {
1726
+ traverse(annotations, (type, path) => {
1727
+ plain = setDeep(plain, path, (v) => untransformValue(v, type, superJson));
1728
+ });
1729
+ return plain;
1730
+ }
1731
+ chunkUSNT2KNT_cjs.__name(applyValueAnnotations, "applyValueAnnotations");
1732
+ function applyReferentialEqualityAnnotations(plain, annotations) {
1733
+ function apply(identicalPaths, path) {
1734
+ const object = getDeep(plain, parsePath(path));
1735
+ identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
1736
+ plain = setDeep(plain, identicalObjectPath, () => object);
1737
+ });
1738
+ }
1739
+ chunkUSNT2KNT_cjs.__name(apply, "apply");
1740
+ if (isArray(annotations)) {
1741
+ const [root, other] = annotations;
1742
+ root.forEach((identicalPath) => {
1743
+ plain = setDeep(plain, parsePath(identicalPath), () => plain);
1744
+ });
1745
+ if (other) {
1746
+ forEach(other, apply);
1747
+ }
1748
+ } else {
1749
+ forEach(annotations, apply);
1750
+ }
1751
+ return plain;
1752
+ }
1753
+ chunkUSNT2KNT_cjs.__name(applyReferentialEqualityAnnotations, "applyReferentialEqualityAnnotations");
1754
+ var isDeep = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((object, superJson) => isPlainObject(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson), "isDeep");
1755
+ function addIdentity(object, path, identities) {
1756
+ const existingSet = identities.get(object);
1757
+ if (existingSet) {
1758
+ existingSet.push(path);
1759
+ } else {
1760
+ identities.set(object, [
1761
+ path
1762
+ ]);
1763
+ }
1764
+ }
1765
+ chunkUSNT2KNT_cjs.__name(addIdentity, "addIdentity");
1766
+ function generateReferentialEqualityAnnotations(identitites, dedupe) {
1767
+ const result = {};
1768
+ let rootEqualityPaths = void 0;
1769
+ identitites.forEach((paths) => {
1770
+ if (paths.length <= 1) {
1771
+ return;
1772
+ }
1773
+ if (!dedupe) {
1774
+ paths = paths.map((path) => path.map(String)).sort((a3, b) => a3.length - b.length);
1775
+ }
1776
+ const [representativePath, ...identicalPaths] = paths;
1777
+ if (representativePath.length === 0) {
1778
+ rootEqualityPaths = identicalPaths.map(stringifyPath);
1779
+ } else {
1780
+ result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
1781
+ }
1782
+ });
1783
+ if (rootEqualityPaths) {
1784
+ if (isEmptyObject(result)) {
1785
+ return [
1786
+ rootEqualityPaths
1787
+ ];
1788
+ } else {
1789
+ return [
1790
+ rootEqualityPaths,
1791
+ result
1792
+ ];
1793
+ }
1794
+ } else {
1795
+ return isEmptyObject(result) ? void 0 : result;
1796
+ }
1797
+ }
1798
+ chunkUSNT2KNT_cjs.__name(generateReferentialEqualityAnnotations, "generateReferentialEqualityAnnotations");
1799
+ var walker = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((object, identities, superJson, dedupe, path = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
1800
+ const primitive = isPrimitive(object);
1801
+ if (!primitive) {
1802
+ addIdentity(object, path, identities);
1803
+ const seen = seenObjects.get(object);
1804
+ if (seen) {
1805
+ return dedupe ? {
1806
+ transformedValue: null
1807
+ } : seen;
1808
+ }
1809
+ }
1810
+ if (!isDeep(object, superJson)) {
1811
+ const transformed2 = transformValue(object, superJson);
1812
+ const result2 = transformed2 ? {
1813
+ transformedValue: transformed2.value,
1814
+ annotations: [
1815
+ transformed2.type
1816
+ ]
1817
+ } : {
1818
+ transformedValue: object
1819
+ };
1820
+ if (!primitive) {
1821
+ seenObjects.set(object, result2);
1822
+ }
1823
+ return result2;
1824
+ }
1825
+ if (includes(objectsInThisPath, object)) {
1826
+ return {
1827
+ transformedValue: null
1828
+ };
1829
+ }
1830
+ const transformationResult = transformValue(object, superJson);
1831
+ const transformed = transformationResult?.value ?? object;
1832
+ const transformedValue = isArray(transformed) ? [] : {};
1833
+ const innerAnnotations = {};
1834
+ forEach(transformed, (value, index) => {
1835
+ if (index === "__proto__" || index === "constructor" || index === "prototype") {
1836
+ throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
1837
+ }
1838
+ const recursiveResult = walker(value, identities, superJson, dedupe, [
1839
+ ...path,
1840
+ index
1841
+ ], [
1842
+ ...objectsInThisPath,
1843
+ object
1844
+ ], seenObjects);
1845
+ transformedValue[index] = recursiveResult.transformedValue;
1846
+ if (isArray(recursiveResult.annotations)) {
1847
+ innerAnnotations[index] = recursiveResult.annotations;
1848
+ } else if (isPlainObject(recursiveResult.annotations)) {
1849
+ forEach(recursiveResult.annotations, (tree, key) => {
1850
+ innerAnnotations[escapeKey(index) + "." + key] = tree;
1851
+ });
1852
+ }
1853
+ });
1854
+ const result = isEmptyObject(innerAnnotations) ? {
1855
+ transformedValue,
1856
+ annotations: !!transformationResult ? [
1857
+ transformationResult.type
1858
+ ] : void 0
1859
+ } : {
1860
+ transformedValue,
1861
+ annotations: !!transformationResult ? [
1862
+ transformationResult.type,
1863
+ innerAnnotations
1864
+ ] : innerAnnotations
1865
+ };
1866
+ if (!primitive) {
1867
+ seenObjects.set(object, result);
1868
+ }
1869
+ return result;
1870
+ }, "walker");
1871
+
1872
+ // ../../node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.js
1873
+ function getType2(payload) {
1874
+ return Object.prototype.toString.call(payload).slice(8, -1);
1875
+ }
1876
+ chunkUSNT2KNT_cjs.__name(getType2, "getType");
1877
+ function isArray2(payload) {
1878
+ return getType2(payload) === "Array";
1879
+ }
1880
+ chunkUSNT2KNT_cjs.__name(isArray2, "isArray");
1881
+ function isPlainObject2(payload) {
1882
+ if (getType2(payload) !== "Object") return false;
1883
+ const prototype = Object.getPrototypeOf(payload);
1884
+ return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
1885
+ }
1886
+ chunkUSNT2KNT_cjs.__name(isPlainObject2, "isPlainObject");
1887
+ function isNull2(payload) {
1888
+ return getType2(payload) === "Null";
1889
+ }
1890
+ chunkUSNT2KNT_cjs.__name(isNull2, "isNull");
1891
+ function isOneOf(a3, b, c2, d, e7) {
1892
+ return (value) => a3(value) || b(value) || !!c2 && c2(value) || !!d && d(value) || !!e7 && e7(value);
1893
+ }
1894
+ chunkUSNT2KNT_cjs.__name(isOneOf, "isOneOf");
1895
+ function isUndefined2(payload) {
1896
+ return getType2(payload) === "Undefined";
1897
+ }
1898
+ chunkUSNT2KNT_cjs.__name(isUndefined2, "isUndefined");
1899
+
1900
+ // ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
1901
+ function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
1902
+ const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
1903
+ if (propType === "enumerable") carry[key] = newVal;
1904
+ if (includeNonenumerable && propType === "nonenumerable") {
1905
+ Object.defineProperty(carry, key, {
1906
+ value: newVal,
1907
+ enumerable: false,
1908
+ writable: true,
1909
+ configurable: true
1910
+ });
1911
+ }
1912
+ }
1913
+ chunkUSNT2KNT_cjs.__name(assignProp, "assignProp");
1914
+ function copy(target, options = {}) {
1915
+ if (isArray2(target)) {
1916
+ return target.map((item) => copy(item, options));
1917
+ }
1918
+ if (!isPlainObject2(target)) {
1919
+ return target;
1920
+ }
1921
+ const props = Object.getOwnPropertyNames(target);
1922
+ const symbols = Object.getOwnPropertySymbols(target);
1923
+ return [
1924
+ ...props,
1925
+ ...symbols
1926
+ ].reduce((carry, key) => {
1927
+ if (isArray2(options.props) && !options.props.includes(key)) {
1928
+ return carry;
1929
+ }
1930
+ const val = target[key];
1931
+ const newVal = copy(val, options);
1932
+ assignProp(carry, key, newVal, target, options.nonenumerable);
1933
+ return carry;
1934
+ }, {});
1935
+ }
1936
+ chunkUSNT2KNT_cjs.__name(copy, "copy");
1937
+
1938
+ // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.js
1939
+ var SuperJSON = class {
1940
+ static {
1941
+ chunkUSNT2KNT_cjs.__name(this, "SuperJSON");
1942
+ }
1943
+ /**
1944
+ * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
1945
+ */
1946
+ constructor({ dedupe = false } = {}) {
1947
+ this.classRegistry = new ClassRegistry();
1948
+ this.symbolRegistry = new Registry((s) => s.description ?? "");
1949
+ this.customTransformerRegistry = new CustomTransformerRegistry();
1950
+ this.allowedErrorProps = [];
1951
+ this.dedupe = dedupe;
1952
+ }
1953
+ serialize(object) {
1954
+ const identities = /* @__PURE__ */ new Map();
1955
+ const output = walker(object, identities, this, this.dedupe);
1956
+ const res = {
1957
+ json: output.transformedValue
1958
+ };
1959
+ if (output.annotations) {
1960
+ res.meta = {
1961
+ ...res.meta,
1962
+ values: output.annotations
1963
+ };
1964
+ }
1965
+ const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
1966
+ if (equalityAnnotations) {
1967
+ res.meta = {
1968
+ ...res.meta,
1969
+ referentialEqualities: equalityAnnotations
1970
+ };
1971
+ }
1972
+ return res;
1973
+ }
1974
+ deserialize(payload) {
1975
+ const { json, meta } = payload;
1976
+ let result = copy(json);
1977
+ if (meta?.values) {
1978
+ result = applyValueAnnotations(result, meta.values, this);
1979
+ }
1980
+ if (meta?.referentialEqualities) {
1981
+ result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
1982
+ }
1983
+ return result;
1984
+ }
1985
+ stringify(object) {
1986
+ return JSON.stringify(this.serialize(object));
1987
+ }
1988
+ parse(string) {
1989
+ return this.deserialize(JSON.parse(string));
1990
+ }
1991
+ registerClass(v, options) {
1992
+ this.classRegistry.register(v, options);
1993
+ }
1994
+ registerSymbol(v, identifier) {
1995
+ this.symbolRegistry.register(v, identifier);
1996
+ }
1997
+ registerCustom(transformer, name) {
1998
+ this.customTransformerRegistry.register({
1999
+ name,
2000
+ ...transformer
2001
+ });
2002
+ }
2003
+ allowErrorProps(...props) {
2004
+ this.allowedErrorProps.push(...props);
2005
+ }
2006
+ };
2007
+ SuperJSON.defaultInstance = new SuperJSON();
2008
+ SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
2009
+ SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
2010
+ SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
2011
+ SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
2012
+ SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
2013
+ SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
2014
+ SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
2015
+ SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
2016
+ SuperJSON.serialize;
2017
+ SuperJSON.deserialize;
2018
+ SuperJSON.stringify;
2019
+ SuperJSON.parse;
2020
+ SuperJSON.registerClass;
2021
+ SuperJSON.registerCustom;
2022
+ SuperJSON.registerSymbol;
2023
+ SuperJSON.allowErrorProps;
2024
+
2025
+ // ../../node_modules/.pnpm/@stryke+json@0.9.32/node_modules/@stryke/json/dist/storm-json.mjs
2026
+ var c = class o3 extends SuperJSON {
2027
+ static {
2028
+ chunkUSNT2KNT_cjs.__name(this, "o");
2029
+ }
2030
+ static #e;
2031
+ static get instance() {
2032
+ return o3.#e ||= new o3(), o3.#e;
2033
+ }
2034
+ static deserialize(e7) {
2035
+ return o3.instance.deserialize(e7);
2036
+ }
2037
+ static serialize(e7) {
2038
+ return o3.instance.serialize(e7);
2039
+ }
2040
+ static parse(e7) {
2041
+ return a2(e7);
2042
+ }
2043
+ static stringify(e7, t7) {
2044
+ let n6 = o3.instance.customTransformerRegistry.findApplicable(e7), r5 = e7;
2045
+ return n6 && n6.isApplicable(e7) && (r5 = n6.serialize(r5)), r4(r5);
2046
+ }
2047
+ static parseJson(e7, t7) {
2048
+ try {
2049
+ if (t7?.expectComments === false) return o3.instance.parse(e7);
2050
+ } catch {
2051
+ }
2052
+ let n6 = [], i3 = parse2(e7, n6, { allowTrailingComma: true, ...t7 });
2053
+ if (n6.length > 0 && n6[0]) throw Error(r3(e7, n6[0]));
2054
+ return i3;
2055
+ }
2056
+ static register(e7, t7, n6, r5) {
2057
+ o3.instance.registerCustom({ isApplicable: r5, serialize: t7, deserialize: n6 }, e7);
2058
+ }
2059
+ static registerClass(n6, r5) {
2060
+ o3.instance.registerClass(n6, { identifier: e2(r5) ? r5 : r5?.identifier || n6.name, allowProps: r5 && t3(r5) && r5?.allowProps && Array.isArray(r5.allowProps) ? r5.allowProps : [`__typename`] });
2061
+ }
2062
+ constructor() {
2063
+ super({ dedupe: true });
2064
+ }
2065
+ };
2066
+ c.instance.registerCustom({ isApplicable: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => buffer.Buffer.isBuffer(e7), "isApplicable"), serialize: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => e7.toString(`base64`), "serialize"), deserialize: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((e7) => buffer.Buffer.from(e7, `base64`), "deserialize") }, `Bytes`);
2067
+ function stringifyDefaultValue(property, value) {
2068
+ return stringifyValue(property.type, value ?? property.getDefaultValue());
2069
+ }
2070
+ chunkUSNT2KNT_cjs.__name(stringifyDefaultValue, "stringifyDefaultValue");
2071
+ function stringifyStringValue(value) {
2072
+ return `"${String(value).replaceAll('"', '\\"')}"`;
2073
+ }
2074
+ chunkUSNT2KNT_cjs.__name(stringifyStringValue, "stringifyStringValue");
2075
+ function stringifyValue(type$1, value) {
2076
+ return isUndefined$1.isUndefined(value) ? "undefined" : isNull$1.isNull(value) ? "null" : type$1.kind === type.ReflectionKind.boolean ? String(value).trim().toLowerCase() === "true" ? "true" : "false" : type$1.kind === type.ReflectionKind.string || type$1.kind === type.ReflectionKind.literal && isString$1.isString(type$1.literal) ? stringifyStringValue(value) : type$1.kind === type.ReflectionKind.enum ? getEnumReflectionType(type$1).kind === type.ReflectionKind.string ? stringifyStringValue(value) : `${String(value)}` : type$1.kind === type.ReflectionKind.union ? isStringUnion(type$1) ? stringifyStringValue(value) : `${String(value)}` : type$1.kind === type.ReflectionKind.array ? stringifyStringValue(c.stringify(value)) : type$1.kind === type.ReflectionKind.object || type$1.kind === type.ReflectionKind.objectLiteral ? c.stringify(value) : type$1.kind === type.ReflectionKind.property || type$1.kind === type.ReflectionKind.parameter ? stringifyValue(type$1.type, value) : String(value);
2077
+ }
2078
+ chunkUSNT2KNT_cjs.__name(stringifyValue, "stringifyValue");
2079
+ function getEnumReflectionType(type$1) {
2080
+ if (type$1.kind !== type.ReflectionKind.enum) {
2081
+ throw new Error(`Expected a TypeEnum, but received ${type$1.kind}.`);
2082
+ }
2083
+ const unique = t(type$1.values.filter((value) => value !== void 0 && value !== null), (enumMember) => isString$1.isString(enumMember) ? {
2084
+ kind: type.ReflectionKind.string
2085
+ } : {
2086
+ kind: type.ReflectionKind.number
2087
+ });
2088
+ if (unique.length === 0) {
2089
+ throw new Error(`No valid enum members could be found.`);
2090
+ }
2091
+ return unique[0] && isString$1.isString(unique[0]) ? {
2092
+ kind: type.ReflectionKind.string
2093
+ } : {
2094
+ kind: type.ReflectionKind.number
2095
+ };
2096
+ }
2097
+ chunkUSNT2KNT_cjs.__name(getEnumReflectionType, "getEnumReflectionType");
2098
+ function getUnionTypes(type$1) {
2099
+ if (type$1.kind === type.ReflectionKind.union && type$1.types.length > 0) {
2100
+ return t(type$1.types, (member) => member.kind);
2101
+ }
2102
+ throw new Error(`Expected a TypeUnion, but received ${type$1.kind}.`);
2103
+ }
2104
+ chunkUSNT2KNT_cjs.__name(getUnionTypes, "getUnionTypes");
2105
+ function isStringUnion(type$1) {
2106
+ return getUnionTypes(type$1).some((member) => member.kind === type.ReflectionKind.string || member.kind === type.ReflectionKind.literal && isString$1.isString(member.literal));
2107
+ }
2108
+ chunkUSNT2KNT_cjs.__name(isStringUnion, "isStringUnion");
2109
+ function kindToName(kind) {
2110
+ if (kind === type.ReflectionKind.void) {
2111
+ return "void";
2112
+ } else if (kind === type.ReflectionKind.never) {
2113
+ return "never";
2114
+ } else if (kind === type.ReflectionKind.null) {
2115
+ return "null";
2116
+ } else if (kind === type.ReflectionKind.undefined) {
2117
+ return "undefined";
2118
+ } else if (kind === type.ReflectionKind.symbol) {
2119
+ return "symbol";
2120
+ } else if (kind === type.ReflectionKind.bigint) {
2121
+ return "bigint";
2122
+ } else if (kind === type.ReflectionKind.number) {
2123
+ return "number";
2124
+ } else if (kind === type.ReflectionKind.string) {
2125
+ return "string";
2126
+ } else if (kind === type.ReflectionKind.boolean) {
2127
+ return "boolean";
2128
+ } else if (kind === type.ReflectionKind.literal) {
2129
+ return "literal";
2130
+ } else if (kind === type.ReflectionKind.class) {
2131
+ return "class";
2132
+ } else if (kind === type.ReflectionKind.array) {
2133
+ return "array";
2134
+ } else if (kind === type.ReflectionKind.object) {
2135
+ return "object";
2136
+ } else if (kind === type.ReflectionKind.objectLiteral) {
2137
+ return "objectLiteral";
2138
+ } else if (kind === type.ReflectionKind.union) {
2139
+ return "union";
2140
+ } else if (kind === type.ReflectionKind.enum) {
2141
+ return "enum";
2142
+ } else if (kind === type.ReflectionKind.regexp) {
2143
+ return "regexp";
2144
+ } else if (kind === type.ReflectionKind.templateLiteral) {
2145
+ return "templateLiteral";
2146
+ } else if (kind === type.ReflectionKind.property) {
2147
+ return "property";
2148
+ } else if (kind === type.ReflectionKind.method) {
2149
+ return "method";
2150
+ } else if (kind === type.ReflectionKind.function) {
2151
+ return "function";
2152
+ } else if (kind === type.ReflectionKind.parameter) {
2153
+ return "parameter";
2154
+ } else if (kind === type.ReflectionKind.promise) {
2155
+ return "promise";
2156
+ } else if (kind === type.ReflectionKind.typeParameter) {
2157
+ return "typeParameter";
2158
+ } else if (kind === type.ReflectionKind.tuple) {
2159
+ return "tuple";
2160
+ } else if (kind === type.ReflectionKind.tupleMember) {
2161
+ return "tupleMember";
2162
+ } else if (kind === type.ReflectionKind.enumMember) {
2163
+ return "enumMember";
2164
+ } else if (kind === type.ReflectionKind.rest) {
2165
+ return "rest";
2166
+ } else if (kind === type.ReflectionKind.indexSignature) {
2167
+ return "indexSignature";
2168
+ } else if (kind === type.ReflectionKind.propertySignature) {
2169
+ return "propertySignature";
2170
+ } else if (kind === type.ReflectionKind.methodSignature) {
2171
+ return "methodSignature";
2172
+ } else if (kind === type.ReflectionKind.infer) {
2173
+ return "infer";
2174
+ } else if (kind === type.ReflectionKind.callSignature) {
2175
+ return "callSignature";
2176
+ } else if (kind === type.ReflectionKind.any) {
2177
+ return "any";
2178
+ } else if (kind === type.ReflectionKind.intersection) {
2179
+ return "intersection";
2180
+ }
2181
+ return "unknown";
2182
+ }
2183
+ chunkUSNT2KNT_cjs.__name(kindToName, "kindToName");
2184
+
2185
+ exports.getEnumReflectionType = getEnumReflectionType;
2186
+ exports.getUnionTypes = getUnionTypes;
2187
+ exports.isStringUnion = isStringUnion;
2188
+ exports.kindToName = kindToName;
2189
+ exports.stringifyDefaultValue = stringifyDefaultValue;
2190
+ exports.stringifyStringValue = stringifyStringValue;
2191
+ exports.stringifyValue = stringifyValue;