@stryke/prisma-trpc-generator 0.12.1 → 0.12.2

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.
package/dist/generator.js CHANGED
@@ -35,9 +35,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
35
35
  mod
36
36
  ));
37
37
 
38
- // ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.8_@types+node@24.0.1__@swc+core@1.11.9_@swc+he_7b8a61ecf73b9cb272fb34724baab5c1/node_modules/tsup/assets/esm_shims.js
38
+ // ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.8_@types+node@24.0.3__@swc+core@1.11.9_@swc+he_84b5ca65b673a98125863760c0a2754a/node_modules/tsup/assets/esm_shims.js
39
39
  var init_esm_shims = __esm({
40
- "../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.8_@types+node@24.0.1__@swc+core@1.11.9_@swc+he_7b8a61ecf73b9cb272fb34724baab5c1/node_modules/tsup/assets/esm_shims.js"() {
40
+ "../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.8_@types+node@24.0.3__@swc+core@1.11.9_@swc+he_84b5ca65b673a98125863760c0a2754a/node_modules/tsup/assets/esm_shims.js"() {
41
41
  "use strict";
42
42
  }
43
43
  });
@@ -673,84 +673,6 @@ var require_pluralize = __commonJS({
673
673
  }
674
674
  });
675
675
 
676
- // ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
677
- function isPlainObject(value) {
678
- if (value === null || typeof value !== "object") {
679
- return false;
680
- }
681
- const prototype = Object.getPrototypeOf(value);
682
- if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
683
- return false;
684
- }
685
- if (Symbol.iterator in value) {
686
- return false;
687
- }
688
- if (Symbol.toStringTag in value) {
689
- return Object.prototype.toString.call(value) === "[object Module]";
690
- }
691
- return true;
692
- }
693
- function _defu(baseObject, defaults, namespace = ".", merger) {
694
- if (!isPlainObject(defaults)) {
695
- return _defu(baseObject, {}, namespace, merger);
696
- }
697
- const object = Object.assign({}, defaults);
698
- for (const key in baseObject) {
699
- if (key === "__proto__" || key === "constructor") {
700
- continue;
701
- }
702
- const value = baseObject[key];
703
- if (value === null || value === void 0) {
704
- continue;
705
- }
706
- if (merger && merger(object, key, value, namespace)) {
707
- continue;
708
- }
709
- if (Array.isArray(value) && Array.isArray(object[key])) {
710
- object[key] = [...value, ...object[key]];
711
- } else if (isPlainObject(value) && isPlainObject(object[key])) {
712
- object[key] = _defu(
713
- value,
714
- object[key],
715
- (namespace ? `${namespace}.` : "") + key.toString(),
716
- merger
717
- );
718
- } else {
719
- object[key] = value;
720
- }
721
- }
722
- return object;
723
- }
724
- function createDefu(merger) {
725
- return (...arguments_) => (
726
- // eslint-disable-next-line unicorn/no-array-reduce
727
- arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
728
- );
729
- }
730
- var defu, defuFn, defuArrayFn;
731
- var init_defu = __esm({
732
- "../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs"() {
733
- "use strict";
734
- init_esm_shims();
735
- __name(isPlainObject, "isPlainObject");
736
- __name(_defu, "_defu");
737
- __name(createDefu, "createDefu");
738
- defu = createDefu();
739
- defuFn = createDefu((object, key, currentValue) => {
740
- if (object[key] !== void 0 && typeof currentValue === "function") {
741
- object[key] = currentValue(object[key]);
742
- return true;
743
- }
744
- });
745
- defuArrayFn = createDefu((object, key, currentValue) => {
746
- if (Array.isArray(object[key]) && typeof currentValue === "function") {
747
- object[key] = currentValue(object[key]);
748
- return true;
749
- }
750
- });
751
- }
752
- });
753
-
754
676
  // src/generator.ts
755
677
  init_esm_shims();
756
678
 
@@ -972,13 +894,13 @@ var util;
972
894
  });
973
895
  };
974
896
  util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
975
- const keys2 = [];
897
+ const keys = [];
976
898
  for (const key in object) {
977
899
  if (Object.prototype.hasOwnProperty.call(object, key)) {
978
- keys2.push(key);
900
+ keys.push(key);
979
901
  }
980
902
  }
981
- return keys2;
903
+ return keys;
982
904
  };
983
905
  util2.find = (arr, checker) => {
984
906
  for (const item of arr) {
@@ -1370,9 +1292,9 @@ var ParseStatus = class _ParseStatus {
1370
1292
  }
1371
1293
  return { status: status.value, value: arrayValue };
1372
1294
  }
1373
- static async mergeObjectAsync(status, pairs2) {
1295
+ static async mergeObjectAsync(status, pairs) {
1374
1296
  const syncPairs = [];
1375
- for (const pair of pairs2) {
1297
+ for (const pair of pairs) {
1376
1298
  const key = await pair.key;
1377
1299
  const value = await pair.value;
1378
1300
  syncPairs.push({
@@ -1382,9 +1304,9 @@ var ParseStatus = class _ParseStatus {
1382
1304
  }
1383
1305
  return _ParseStatus.mergeObjectSync(status, syncPairs);
1384
1306
  }
1385
- static mergeObjectSync(status, pairs2) {
1307
+ static mergeObjectSync(status, pairs) {
1386
1308
  const finalObject = {};
1387
- for (const pair of pairs2) {
1309
+ for (const pair of pairs) {
1388
1310
  const { key, value } = pair;
1389
1311
  if (key.status === "aborted")
1390
1312
  return INVALID;
@@ -3272,8 +3194,8 @@ var ZodObject = class _ZodObject extends ZodType {
3272
3194
  if (this._cached !== null)
3273
3195
  return this._cached;
3274
3196
  const shape = this._def.shape();
3275
- const keys2 = util.objectKeys(shape);
3276
- return this._cached = { shape, keys: keys2 };
3197
+ const keys = util.objectKeys(shape);
3198
+ return this._cached = { shape, keys };
3277
3199
  }
3278
3200
  _parse(input) {
3279
3201
  const parsedType = this._getType(input);
@@ -3296,11 +3218,11 @@ var ZodObject = class _ZodObject extends ZodType {
3296
3218
  }
3297
3219
  }
3298
3220
  }
3299
- const pairs2 = [];
3221
+ const pairs = [];
3300
3222
  for (const key of shapeKeys) {
3301
3223
  const keyValidator = shape[key];
3302
3224
  const value = ctx.data[key];
3303
- pairs2.push({
3225
+ pairs.push({
3304
3226
  key: { status: "valid", value: key },
3305
3227
  value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
3306
3228
  alwaysSet: key in ctx.data
@@ -3310,7 +3232,7 @@ var ZodObject = class _ZodObject extends ZodType {
3310
3232
  const unknownKeys = this._def.unknownKeys;
3311
3233
  if (unknownKeys === "passthrough") {
3312
3234
  for (const key of extraKeys) {
3313
- pairs2.push({
3235
+ pairs.push({
3314
3236
  key: { status: "valid", value: key },
3315
3237
  value: { status: "valid", value: ctx.data[key] }
3316
3238
  });
@@ -3331,7 +3253,7 @@ var ZodObject = class _ZodObject extends ZodType {
3331
3253
  const catchall = this._def.catchall;
3332
3254
  for (const key of extraKeys) {
3333
3255
  const value = ctx.data[key];
3334
- pairs2.push({
3256
+ pairs.push({
3335
3257
  key: { status: "valid", value: key },
3336
3258
  value: catchall._parse(
3337
3259
  new ParseInputLazyPath(ctx, value, ctx.path, key)
@@ -3344,7 +3266,7 @@ var ZodObject = class _ZodObject extends ZodType {
3344
3266
  if (ctx.common.async) {
3345
3267
  return Promise.resolve().then(async () => {
3346
3268
  const syncPairs = [];
3347
- for (const pair of pairs2) {
3269
+ for (const pair of pairs) {
3348
3270
  const key = await pair.key;
3349
3271
  const value = await pair.value;
3350
3272
  syncPairs.push({
@@ -3358,7 +3280,7 @@ var ZodObject = class _ZodObject extends ZodType {
3358
3280
  return ParseStatus.mergeObjectSync(status, syncPairs);
3359
3281
  });
3360
3282
  } else {
3361
- return ParseStatus.mergeObjectSync(status, pairs2);
3283
+ return ParseStatus.mergeObjectSync(status, pairs);
3362
3284
  }
3363
3285
  }
3364
3286
  get shape() {
@@ -3989,20 +3911,20 @@ var ZodRecord = class _ZodRecord extends ZodType {
3989
3911
  });
3990
3912
  return INVALID;
3991
3913
  }
3992
- const pairs2 = [];
3914
+ const pairs = [];
3993
3915
  const keyType = this._def.keyType;
3994
3916
  const valueType = this._def.valueType;
3995
3917
  for (const key in ctx.data) {
3996
- pairs2.push({
3918
+ pairs.push({
3997
3919
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
3998
3920
  value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
3999
3921
  alwaysSet: key in ctx.data
4000
3922
  });
4001
3923
  }
4002
3924
  if (ctx.common.async) {
4003
- return ParseStatus.mergeObjectAsync(status, pairs2);
3925
+ return ParseStatus.mergeObjectAsync(status, pairs);
4004
3926
  } else {
4005
- return ParseStatus.mergeObjectSync(status, pairs2);
3927
+ return ParseStatus.mergeObjectSync(status, pairs);
4006
3928
  }
4007
3929
  }
4008
3930
  get element() {
@@ -4047,7 +3969,7 @@ var ZodMap = class extends ZodType {
4047
3969
  }
4048
3970
  const keyType = this._def.keyType;
4049
3971
  const valueType = this._def.valueType;
4050
- const pairs2 = [...ctx.data.entries()].map(([key, value], index) => {
3972
+ const pairs = [...ctx.data.entries()].map(([key, value], index) => {
4051
3973
  return {
4052
3974
  key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
4053
3975
  value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"]))
@@ -4056,7 +3978,7 @@ var ZodMap = class extends ZodType {
4056
3978
  if (ctx.common.async) {
4057
3979
  const finalMap = /* @__PURE__ */ new Map();
4058
3980
  return Promise.resolve().then(async () => {
4059
- for (const pair of pairs2) {
3981
+ for (const pair of pairs) {
4060
3982
  const key = await pair.key;
4061
3983
  const value = await pair.value;
4062
3984
  if (key.status === "aborted" || value.status === "aborted") {
@@ -4071,7 +3993,7 @@ var ZodMap = class extends ZodType {
4071
3993
  });
4072
3994
  } else {
4073
3995
  const finalMap = /* @__PURE__ */ new Map();
4074
- for (const pair of pairs2) {
3996
+ for (const pair of pairs) {
4075
3997
  const key = pair.key;
4076
3998
  const value = pair.value;
4077
3999
  if (key.status === "aborted" || value.status === "aborted") {
@@ -4883,13 +4805,13 @@ var ZodReadonly = class extends ZodType {
4883
4805
  }
4884
4806
  _parse(input) {
4885
4807
  const result = this._def.innerType._parse(input);
4886
- const freeze2 = /* @__PURE__ */ __name((data) => {
4808
+ const freeze = /* @__PURE__ */ __name((data) => {
4887
4809
  if (isValid(data)) {
4888
4810
  data.value = Object.freeze(data.value);
4889
4811
  }
4890
4812
  return data;
4891
4813
  }, "freeze");
4892
- return isAsync(result) ? result.then((data) => freeze2(data)) : freeze2(result);
4814
+ return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
4893
4815
  }
4894
4816
  unwrap() {
4895
4817
  return this._def.innerType;
@@ -5351,13 +5273,13 @@ __name(normalizeString2, "normalizeString");
5351
5273
  // ../path/src/get-workspace-root.ts
5352
5274
  init_esm_shims();
5353
5275
 
5354
- // ../../node_modules/.pnpm/@storm-software+config-tools@1.173.2/node_modules/@storm-software/config-tools/dist/index.js
5276
+ // ../../node_modules/.pnpm/@storm-software+config-tools@1.173.5/node_modules/@storm-software/config-tools/dist/index.js
5355
5277
  init_esm_shims();
5356
5278
 
5357
- // ../../node_modules/.pnpm/@storm-software+config-tools@1.173.2/node_modules/@storm-software/config-tools/dist/chunk-PTHGOJU6.js
5279
+ // ../../node_modules/.pnpm/@storm-software+config-tools@1.173.5/node_modules/@storm-software/config-tools/dist/chunk-PTHGOJU6.js
5358
5280
  init_esm_shims();
5359
5281
 
5360
- // ../../node_modules/.pnpm/@storm-software+config-tools@1.173.2/node_modules/@storm-software/config-tools/dist/chunk-6JBGUE4A.js
5282
+ // ../../node_modules/.pnpm/@storm-software+config-tools@1.173.5/node_modules/@storm-software/config-tools/dist/chunk-6JBGUE4A.js
5361
5283
  init_esm_shims();
5362
5284
  import { existsSync as existsSync2 } from "node:fs";
5363
5285
  import { join } from "node:path";
@@ -5379,7 +5301,7 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
5379
5301
  }
5380
5302
  __name(findFolderUp, "findFolderUp");
5381
5303
 
5382
- // ../../node_modules/.pnpm/@storm-software+config-tools@1.173.2/node_modules/@storm-software/config-tools/dist/chunk-7IMLZPZF.js
5304
+ // ../../node_modules/.pnpm/@storm-software+config-tools@1.173.5/node_modules/@storm-software/config-tools/dist/chunk-7IMLZPZF.js
5383
5305
  init_esm_shims();
5384
5306
  var _DRIVE_LETTER_START_RE2 = /^[A-Za-z]:\//;
5385
5307
  function normalizeWindowsPath3(input = "") {
@@ -5486,7 +5408,7 @@ var isAbsolute2 = /* @__PURE__ */ __name(function(p) {
5486
5408
  return _IS_ABSOLUTE_RE2.test(p);
5487
5409
  }, "isAbsolute");
5488
5410
 
5489
- // ../../node_modules/.pnpm/@storm-software+config-tools@1.173.2/node_modules/@storm-software/config-tools/dist/chunk-PTHGOJU6.js
5411
+ // ../../node_modules/.pnpm/@storm-software+config-tools@1.173.5/node_modules/@storm-software/config-tools/dist/chunk-PTHGOJU6.js
5490
5412
  var rootFiles = [
5491
5413
  "storm-workspace.json",
5492
5414
  "storm-workspace.json",
@@ -5537,1414 +5459,6 @@ function findWorkspaceRootSafe(pathInsideMonorepo) {
5537
5459
  }
5538
5460
  __name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
5539
5461
 
5540
- // ../../node_modules/.pnpm/@ltd+j-toml@1.38.0/node_modules/@ltd/j-toml/index.mjs
5541
- init_esm_shims();
5542
- var SyntaxError$1 = SyntaxError;
5543
- var RangeError$1 = RangeError;
5544
- var TypeError$1 = TypeError;
5545
- var Error$1 = { if: Error }.if;
5546
- var undefined$1 = void 0;
5547
- var BigInt$1 = typeof BigInt === "undefined" ? undefined$1 : BigInt;
5548
- var RegExp$1 = RegExp;
5549
- var WeakMap$1 = WeakMap;
5550
- var get = WeakMap.prototype.get;
5551
- var set = WeakMap.prototype.set;
5552
- var create$1 = Object.create;
5553
- var isSafeInteger = Number.isSafeInteger;
5554
- var getOwnPropertyNames = Object.getOwnPropertyNames;
5555
- var freeze = Object.freeze;
5556
- var isPrototypeOf = Object.prototype.isPrototypeOf;
5557
- var NULL = (
5558
- /* j-globals: null.prototype (internal) */
5559
- Object.seal ? /* @__PURE__ */ Object.preventExtensions(/* @__PURE__ */ Object.create(null)) : null
5560
- );
5561
- var bind = Function.prototype.bind;
5562
- var test = RegExp.prototype.test;
5563
- var exec = RegExp.prototype.exec;
5564
- var apply$1 = Reflect.apply;
5565
- var Proxy$1 = Proxy;
5566
- var assign$1 = Object.assign;
5567
- var Object$1 = Object;
5568
- var floor = Math.floor;
5569
- var isArray$1 = Array.isArray;
5570
- var Infinity2 = 1 / 0;
5571
- var fromCharCode = String.fromCharCode;
5572
- var Array$1 = Array;
5573
- var hasOwnProperty = Object.prototype.hasOwnProperty;
5574
- var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
5575
- var apply = Function.prototype.apply;
5576
- var isEnum = /* @__PURE__ */ propertyIsEnumerable.call.bind(propertyIsEnumerable);
5577
- var hasOwn = (
5578
- /* j-globals: Object.hasOwn (polyfill) */
5579
- Object$1.hasOwn || /* @__PURE__ */ function() {
5580
- return hasOwnProperty.bind ? hasOwnProperty.call.bind(hasOwnProperty) : /* @__PURE__ */ __name(function hasOwn2(object, key) {
5581
- return hasOwnProperty.call(object, key);
5582
- }, "hasOwn");
5583
- }()
5584
- );
5585
- var create = Object$1.create;
5586
- function Descriptor(source) {
5587
- var target = create(NULL);
5588
- if (hasOwn(source, "value")) {
5589
- target.value = source.value;
5590
- }
5591
- if (hasOwn(source, "writable")) {
5592
- target.writable = source.writable;
5593
- }
5594
- if (hasOwn(source, "get")) {
5595
- target.get = source.get;
5596
- }
5597
- if (hasOwn(source, "set")) {
5598
- target.set = source.set;
5599
- }
5600
- if (hasOwn(source, "enumerable")) {
5601
- target.enumerable = source.enumerable;
5602
- }
5603
- if (hasOwn(source, "configurable")) {
5604
- target.configurable = source.configurable;
5605
- }
5606
- return target;
5607
- }
5608
- __name(Descriptor, "Descriptor");
5609
- var Test = bind ? /* @__PURE__ */ bind.bind(test) : function(re) {
5610
- return function(string) {
5611
- return test.call(re, string);
5612
- };
5613
- };
5614
- var Exec = bind ? /* @__PURE__ */ bind.bind(exec) : function(re) {
5615
- return function(string) {
5616
- return exec.call(re, string);
5617
- };
5618
- };
5619
- function __PURE__(re) {
5620
- var test2 = re.test = Test(re);
5621
- var exec2 = re.exec = Exec(re);
5622
- var source = test2.source = exec2.source = re.source;
5623
- test2.unicode = exec2.unicode = re.unicode;
5624
- test2.ignoreCase = exec2.ignoreCase = re.ignoreCase;
5625
- test2.multiline = exec2.multiline = source.indexOf("^") < 0 && source.indexOf("$") < 0 ? null : re.multiline;
5626
- test2.dotAll = exec2.dotAll = source.indexOf(".") < 0 ? null : re.dotAll;
5627
- return re;
5628
- }
5629
- __name(__PURE__, "__PURE__");
5630
- function theRegExp(re) {
5631
- return /* @__PURE__ */ __PURE__(re);
5632
- }
5633
- __name(theRegExp, "theRegExp");
5634
- var NT = /[\n\t]+/g;
5635
- var ESCAPE = /\\./g;
5636
- function graveAccentReplacer($$) {
5637
- return $$ === "\\`" ? "`" : $$;
5638
- }
5639
- __name(graveAccentReplacer, "graveAccentReplacer");
5640
- var includes = "".includes ? function(that, searchString) {
5641
- return that.includes(searchString);
5642
- } : function(that, searchString) {
5643
- return that.indexOf(searchString) > -1;
5644
- };
5645
- function RE(template) {
5646
- var U = this.U;
5647
- var I = this.I;
5648
- var M = this.M;
5649
- var S = this.S;
5650
- var raw = template.raw;
5651
- var source = raw[0].replace(NT, "");
5652
- var index = 1;
5653
- var length = arguments.length;
5654
- while (index !== length) {
5655
- var value = arguments[index];
5656
- if (typeof value === "string") {
5657
- source += value;
5658
- } else {
5659
- var value_source = value.source;
5660
- if (typeof value_source !== "string") {
5661
- throw TypeError$1("source");
5662
- }
5663
- if (value.unicode === U) {
5664
- throw SyntaxError$1("unicode");
5665
- }
5666
- if (value.ignoreCase === I) {
5667
- throw SyntaxError$1("ignoreCase");
5668
- }
5669
- if (value.multiline === M && (includes(value_source, "^") || includes(value_source, "$"))) {
5670
- throw SyntaxError$1("multiline");
5671
- }
5672
- if (value.dotAll === S && includes(value_source, ".")) {
5673
- throw SyntaxError$1("dotAll");
5674
- }
5675
- source += value_source;
5676
- }
5677
- source += raw[index++].replace(NT, "");
5678
- }
5679
- var re = RegExp$1(U ? source = source.replace(ESCAPE, graveAccentReplacer) : source, this.flags);
5680
- var test2 = re.test = Test(re);
5681
- var exec2 = re.exec = Exec(re);
5682
- test2.source = exec2.source = source;
5683
- test2.unicode = exec2.unicode = !U;
5684
- test2.ignoreCase = exec2.ignoreCase = !I;
5685
- test2.multiline = exec2.multiline = includes(source, "^") || includes(source, "$") ? !M : null;
5686
- test2.dotAll = exec2.dotAll = includes(source, ".") ? !S : null;
5687
- return re;
5688
- }
5689
- __name(RE, "RE");
5690
- var RE_bind = bind && /* @__PURE__ */ bind.bind(RE);
5691
- function Context(flags) {
5692
- return {
5693
- U: !includes(flags, "u"),
5694
- I: !includes(flags, "i"),
5695
- M: !includes(flags, "m"),
5696
- S: !includes(flags, "s"),
5697
- flags
5698
- };
5699
- }
5700
- __name(Context, "Context");
5701
- var CONTEXT = /* @__PURE__ */ Context("");
5702
- var newRegExp = Proxy$1 ? /* @__PURE__ */ new Proxy$1(RE, {
5703
- apply: /* @__PURE__ */ __name(function(RE2, thisArg, args) {
5704
- return apply$1(RE2, CONTEXT, args);
5705
- }, "apply"),
5706
- get: /* @__PURE__ */ __name(function(RE2, flags) {
5707
- return RE_bind(Context(flags));
5708
- }, "get"),
5709
- defineProperty: /* @__PURE__ */ __name(function() {
5710
- return false;
5711
- }, "defineProperty"),
5712
- preventExtensions: /* @__PURE__ */ __name(function() {
5713
- return false;
5714
- }, "preventExtensions")
5715
- }) : /* @__PURE__ */ function() {
5716
- RE.apply = RE.apply;
5717
- var newRegExp2 = /* @__PURE__ */ __name(function() {
5718
- return RE.apply(CONTEXT, arguments);
5719
- }, "newRegExp");
5720
- var d2 = 1;
5721
- var g = d2 * 2;
5722
- var i = g * 2;
5723
- var m = i * 2;
5724
- var s = i * 2;
5725
- var u = s * 2;
5726
- var y = u * 2;
5727
- var flags = y * 2 - 1;
5728
- while (flags--) {
5729
- (function(context) {
5730
- newRegExp2[context.flags] = function() {
5731
- return RE.apply(context, arguments);
5732
- };
5733
- })(Context(
5734
- (flags & d2 ? "" : "d") + (flags & g ? "" : "g") + (flags & i ? "" : "i") + (flags & m ? "" : "m") + (flags & s ? "" : "s") + (flags & u ? "" : "u") + (flags & y ? "" : "y")
5735
- ));
5736
- }
5737
- return freeze ? freeze(newRegExp2) : newRegExp2;
5738
- }();
5739
- var clearRegExp = "$_" in RegExp$1 ? /* @__PURE__ */ function() {
5740
- var REGEXP = /^/;
5741
- REGEXP.test = REGEXP.test;
5742
- return /* @__PURE__ */ __name(function clearRegExp3(value) {
5743
- REGEXP.test("");
5744
- return value;
5745
- }, "clearRegExp");
5746
- }() : /* @__PURE__ */ __name(function clearRegExp2(value) {
5747
- return value;
5748
- }, "clearRegExp");
5749
- var NEED_TO_ESCAPE_IN_REGEXP = /^[$()*+\-.?[\\\]^{|]/;
5750
- var SURROGATE_PAIR = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/;
5751
- var GROUP = /* @__PURE__ */ create$1(NULL);
5752
- function groupify(branches, uFlag, noEscape) {
5753
- var group = create$1(NULL);
5754
- var appendBranch = uFlag ? appendPointBranch : appendCodeBranch;
5755
- for (var length = branches.length, index = 0; index < length; ++index) {
5756
- appendBranch(group, branches[index]);
5757
- }
5758
- return sourcify(group, !noEscape);
5759
- }
5760
- __name(groupify, "groupify");
5761
- function appendPointBranch(group, branch) {
5762
- if (branch) {
5763
- var character = SURROGATE_PAIR.test(branch) ? branch.slice(0, 2) : branch.charAt(0);
5764
- appendPointBranch(group[character] || (group[character] = create$1(NULL)), branch.slice(character.length));
5765
- } else {
5766
- group[""] = GROUP;
5767
- }
5768
- }
5769
- __name(appendPointBranch, "appendPointBranch");
5770
- function appendCodeBranch(group, branch) {
5771
- if (branch) {
5772
- var character = branch.charAt(0);
5773
- appendCodeBranch(group[character] || (group[character] = create$1(NULL)), branch.slice(1));
5774
- } else {
5775
- group[""] = GROUP;
5776
- }
5777
- }
5778
- __name(appendCodeBranch, "appendCodeBranch");
5779
- function sourcify(group, needEscape) {
5780
- var branches = [];
5781
- var singleCharactersBranch = [];
5782
- var noEmptyBranch = true;
5783
- for (var character in group) {
5784
- if (character) {
5785
- var sub_branches = sourcify(group[character], needEscape);
5786
- if (needEscape && NEED_TO_ESCAPE_IN_REGEXP.test(character)) {
5787
- character = "\\" + character;
5788
- }
5789
- sub_branches ? branches.push(character + sub_branches) : singleCharactersBranch.push(character);
5790
- } else {
5791
- noEmptyBranch = false;
5792
- }
5793
- }
5794
- singleCharactersBranch.length && branches.unshift(singleCharactersBranch.length === 1 ? singleCharactersBranch[0] : "[" + singleCharactersBranch.join("") + "]");
5795
- return branches.length === 0 ? "" : (branches.length === 1 && (singleCharactersBranch.length || noEmptyBranch) ? branches[0] : "(?:" + branches.join("|") + ")") + (noEmptyBranch ? "" : "?");
5796
- }
5797
- __name(sourcify, "sourcify");
5798
- var WeakSet$1 = WeakSet;
5799
- var has = WeakSet.prototype.has;
5800
- var add = WeakSet.prototype.add;
5801
- var del = WeakSet.prototype["delete"];
5802
- var keys = Object.keys;
5803
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
5804
- var Null$1 = (
5805
- /* j-globals: null (internal) */
5806
- /* @__PURE__ */ function() {
5807
- var assign = Object.assign || /* @__PURE__ */ __name(function assign2(target, source) {
5808
- var keys$1, index, key;
5809
- for (keys$1 = keys(source), index = 0; index < keys$1.length; ++index) {
5810
- key = keys$1[index];
5811
- target[key] = source[key];
5812
- }
5813
- if (getOwnPropertySymbols) {
5814
- for (keys$1 = getOwnPropertySymbols(source), index = 0; index < keys$1.length; ++index) {
5815
- key = keys$1[index];
5816
- if (isEnum(source, key)) {
5817
- target[key] = source[key];
5818
- }
5819
- }
5820
- }
5821
- return target;
5822
- }, "assign");
5823
- function Nullify(constructor) {
5824
- delete constructor.prototype.constructor;
5825
- freeze(constructor.prototype);
5826
- return constructor;
5827
- }
5828
- __name(Nullify, "Nullify");
5829
- function Null(origin) {
5830
- return origin === undefined$1 ? this : typeof origin === "function" ? /* @__PURE__ */ Nullify(origin) : /* @__PURE__ */ assign(/* @__PURE__ */ create(NULL), origin);
5831
- }
5832
- __name(Null, "Null");
5833
- delete Null.name;
5834
- Null.prototype = null;
5835
- freeze(Null);
5836
- return Null;
5837
- }()
5838
- );
5839
- var is = Object.is;
5840
- var Object_defineProperties = Object.defineProperties;
5841
- var fromEntries = Object.fromEntries;
5842
- var Reflect_construct = Reflect.construct;
5843
- var Reflect_defineProperty = Reflect.defineProperty;
5844
- var Reflect_deleteProperty = Reflect.deleteProperty;
5845
- var ownKeys = Reflect.ownKeys;
5846
- var Keeper = /* @__PURE__ */ __name(() => [], "Keeper");
5847
- var newWeakMap = /* @__PURE__ */ __name(() => {
5848
- const weakMap = new WeakMap$1();
5849
- weakMap.has = weakMap.has;
5850
- weakMap.get = weakMap.get;
5851
- weakMap.set = weakMap.set;
5852
- return weakMap;
5853
- }, "newWeakMap");
5854
- var target2keeper = /* @__PURE__ */ newWeakMap();
5855
- var proxy2target = /* @__PURE__ */ newWeakMap();
5856
- var target2proxy = /* @__PURE__ */ newWeakMap();
5857
- var handlers = /* @__PURE__ */ assign$1(create$1(NULL), {
5858
- defineProperty: /* @__PURE__ */ __name((target, key, descriptor) => {
5859
- if (hasOwn(target, key)) {
5860
- return Reflect_defineProperty(target, key, assign$1(create$1(NULL), descriptor));
5861
- }
5862
- if (Reflect_defineProperty(target, key, assign$1(create$1(NULL), descriptor))) {
5863
- const keeper = target2keeper.get(target);
5864
- keeper[keeper.length] = key;
5865
- return true;
5866
- }
5867
- return false;
5868
- }, "defineProperty"),
5869
- deleteProperty: /* @__PURE__ */ __name((target, key) => {
5870
- if (Reflect_deleteProperty(target, key)) {
5871
- const keeper = target2keeper.get(target);
5872
- const index = keeper.indexOf(key);
5873
- index < 0 || --keeper.copyWithin(index, index + 1).length;
5874
- return true;
5875
- }
5876
- return false;
5877
- }, "deleteProperty"),
5878
- ownKeys: /* @__PURE__ */ __name((target) => target2keeper.get(target), "ownKeys"),
5879
- construct: /* @__PURE__ */ __name((target, args, newTarget) => orderify(Reflect_construct(target, args, newTarget)), "construct"),
5880
- apply: /* @__PURE__ */ __name((target, thisArg, args) => orderify(apply$1(target, thisArg, args)), "apply")
5881
- });
5882
- var newProxy = /* @__PURE__ */ __name((target, keeper) => {
5883
- target2keeper.set(target, keeper);
5884
- const proxy = new Proxy$1(target, handlers);
5885
- proxy2target.set(proxy, target);
5886
- return proxy;
5887
- }, "newProxy");
5888
- var orderify = /* @__PURE__ */ __name((object) => {
5889
- if (proxy2target.has(object)) {
5890
- return object;
5891
- }
5892
- let proxy = target2proxy.get(object);
5893
- if (proxy) {
5894
- return proxy;
5895
- }
5896
- proxy = newProxy(object, assign$1(Keeper(), ownKeys(object)));
5897
- target2proxy.set(object, proxy);
5898
- return proxy;
5899
- }, "orderify");
5900
- var map_has = WeakMap.prototype.has;
5901
- var map_del = WeakMap.prototype["delete"];
5902
- var INLINES = new WeakMap$1();
5903
- var SECTIONS = new WeakSet$1();
5904
- var ofInline = /* @__PURE__ */ get.bind(INLINES);
5905
- var isSection = /* @__PURE__ */ has.bind(SECTIONS);
5906
- var tables = new WeakSet$1();
5907
- var implicitTables = new WeakSet$1();
5908
- var pairs = new WeakSet$1();
5909
- var NONE = [];
5910
- var sourcePath = "";
5911
- var sourceLines = NONE;
5912
- var lineIndex = -1;
5913
- var throws = /* @__PURE__ */ __name((error) => {
5914
- throw error;
5915
- }, "throws");
5916
- var where = /* @__PURE__ */ __name((pre, rowIndex = lineIndex, columnNumber = 0) => sourceLines === NONE ? "" : sourcePath ? `
5917
- at (${sourcePath}:${rowIndex + 1}:${columnNumber})` : `${pre}line ${rowIndex + 1}: ${sourceLines[rowIndex]}`, "where");
5918
- var Whitespace = /[ \t]/;
5919
- var { exec: VALUE_REST_exec } = /* @__PURE__ */ newRegExp.s`
5920
- ^
5921
- (
5922
- (?:\d\d\d\d-\d\d-\d\d \d)?
5923
- [\w\-+.:]+
5924
- )
5925
- ${Whitespace}*
5926
- (.*)
5927
- $`.valueOf();
5928
- var { exec: LITERAL_STRING_exec } = /* @__PURE__ */ newRegExp.s`
5929
- ^
5930
- '([^']*)'
5931
- ${Whitespace}*
5932
- (.*)`.valueOf();
5933
- var { exec: MULTI_LINE_LITERAL_STRING_0_1_2 } = /* @__PURE__ */ newRegExp.s`
5934
- ^
5935
- (.*?)
5936
- '''('{0,2})
5937
- ${Whitespace}*
5938
- (.*)`.valueOf();
5939
- var { exec: MULTI_LINE_LITERAL_STRING_0 } = /* @__PURE__ */ newRegExp.s`
5940
- ^
5941
- (.*?)
5942
- '''()
5943
- ${Whitespace}*
5944
- (.*)`.valueOf();
5945
- var Tag = /[^\x00-\x1F"#'()<>[\\\]`{}\x7F]+/;
5946
- var { exec: KEY_VALUE_PAIR_exec } = /* @__PURE__ */ newRegExp.s`
5947
- ^
5948
- ${Whitespace}*
5949
- =
5950
- ${Whitespace}*
5951
- (?:
5952
- <(${Tag})>
5953
- ${Whitespace}*
5954
- )?
5955
- (.*)
5956
- $`.valueOf();
5957
- var { exec: _VALUE_PAIR_exec } = /* @__PURE__ */ newRegExp.s`
5958
- ^
5959
- <(${Tag})>
5960
- ${Whitespace}*
5961
- (.*)
5962
- $`.valueOf();
5963
- var { exec: TAG_REST_exec } = /* @__PURE__ */ newRegExp.s`
5964
- ^
5965
- <(${Tag})>
5966
- ${Whitespace}*
5967
- (.*)
5968
- $`.valueOf();
5969
- var MULTI_LINE_BASIC_STRING = theRegExp(/[^\\"]+|\\.?|"(?!"")"?/sy);
5970
- var BASIC_STRING_TAB______ = theRegExp(/[^\\"\x00-\x08\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
5971
- var BASIC_STRING__________ = theRegExp(/[^\\"\x00-\x08\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
5972
- var BASIC_STRING_DEL______ = theRegExp(/[^\\"\x00-\x08\x0B-\x1F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
5973
- var BASIC_STRING_DEL_SLASH = theRegExp(/[^\\"\x00-\x08\x0B-\x1F]+|\\(?:[btnfr"\\/]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);
5974
- var { test: IS_DOT_KEY } = theRegExp(/^[ \t]*\./);
5975
- var { exec: BARE_KEY_STRICT } = theRegExp(/^[\w-]+/);
5976
- var { exec: BARE_KEY_FREE } = theRegExp(/^[^ \t#=[\]'".]+(?:[ \t]+[^ \t#=[\]'".]+)*/);
5977
- var { exec: LITERAL_KEY____ } = theRegExp(/^'[^'\x00-\x08\x0B-\x1F\x7F]*'/);
5978
- var { exec: LITERAL_KEY_DEL } = theRegExp(/^'[^'\x00-\x08\x0B-\x1F]*'/);
5979
- var { test: CONTROL_CHARACTER_EXCLUDE_TAB____ } = theRegExp(/[\x00-\x08\x0B-\x1F\x7F]/);
5980
- var { test: CONTROL_CHARACTER_EXCLUDE_TAB_DEL } = theRegExp(/[\x00-\x08\x0B-\x1F]/);
5981
- var NUM = /* @__PURE__ */ newRegExp`
5982
- (?:
5983
- 0
5984
- (?:
5985
- b[01][_01]*
5986
- |
5987
- o[0-7][_0-7]*
5988
- |
5989
- x[\dA-Fa-f][_\dA-Fa-f]*
5990
- |
5991
- (?:\.\d[_\d]*)?(?:[Ee]-?\d[_\d]*)?
5992
- )
5993
- |
5994
- [1-9][_\d]*
5995
- (?:\.\d[_\d]*)?(?:[Ee]-?\d[_\d]*)?
5996
- |
5997
- inf
5998
- |
5999
- nan
6000
- )
6001
- `.valueOf();
6002
- var { test: IS_AMAZING } = /* @__PURE__ */ newRegExp`
6003
- ^(?:
6004
- -?${NUM}
6005
- (?:-${NUM})*
6006
- |
6007
- true
6008
- |
6009
- false
6010
- )$
6011
- `.valueOf();
6012
- var { test: BAD_DXOB } = /* @__PURE__ */ newRegExp`_(?![\dA-Fa-f])`.valueOf();
6013
- var isAmazing = /* @__PURE__ */ __name((keys2) => IS_AMAZING(keys2) && !BAD_DXOB(keys2), "isAmazing");
6014
- var Keys = class KeysRegExp extends RegExp$1 {
6015
- static {
6016
- __name(this, "KeysRegExp");
6017
- }
6018
- constructor(keys2) {
6019
- super(`^${groupify(keys2)}$`);
6020
- let maxLength = -1;
6021
- for (let index = keys2.length; index; ) {
6022
- const { length } = keys2[--index];
6023
- if (length > maxLength) {
6024
- maxLength = length;
6025
- }
6026
- }
6027
- this.lastIndex = maxLength + 1;
6028
- return this;
6029
- }
6030
- test(key) {
6031
- return key.length < this.lastIndex && super.test(key);
6032
- }
6033
- };
6034
- var isKeys = /* @__PURE__ */ isPrototypeOf.bind(/* @__PURE__ */ freeze(Keys.prototype));
6035
- var zeroDatetime;
6036
- var arrayTypes = new WeakMap$1();
6037
- var arrayTypes_get = /* @__PURE__ */ get.bind(arrayTypes);
6038
- var arrayTypes_set = /* @__PURE__ */ set.bind(arrayTypes);
6039
- var As = /* @__PURE__ */ __name(() => {
6040
- const as = /* @__PURE__ */ __name((array) => {
6041
- const got = arrayTypes_get(array);
6042
- got ? got === as || throws(TypeError$1(`Types in Array must be same` + where(". Check "))) : arrayTypes_set(array, as);
6043
- return array;
6044
- }, "as");
6045
- return as;
6046
- }, "As");
6047
- var AS_TYPED = {
6048
- asNulls: As(),
6049
- asStrings: As(),
6050
- asTables: As(),
6051
- asArrays: As(),
6052
- asBooleans: As(),
6053
- asFloats: As(),
6054
- asIntegers: As(),
6055
- asOffsetDateTimes: As(),
6056
- asLocalDateTimes: As(),
6057
- asLocalDates: As(),
6058
- asLocalTimes: As()
6059
- };
6060
- var isView = ArrayBuffer.isView;
6061
- var TextDecoder$1 = TextDecoder;
6062
- var Symbol$1 = Symbol;
6063
- var previous = Symbol$1("previous");
6064
- var _literal = Symbol$1("_literal");
6065
- var arrays = new WeakSet$1();
6066
- var staticalArrays = new WeakSet$1();
6067
- var NativeDate = Date;
6068
- var parse$2 = Date.parse;
6069
- var preventExtensions = Object.preventExtensions;
6070
- var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
6071
- var defineProperties = (
6072
- /* j-globals: null.defineProperties (internal) */
6073
- /* @__PURE__ */ __name(function defineProperties2(object, descriptorMap) {
6074
- var created = create$1(NULL);
6075
- var names = keys(descriptorMap);
6076
- for (var length = names.length, index = 0; index < length; ++index) {
6077
- var name = names[index];
6078
- created[name] = Descriptor(descriptorMap[name]);
6079
- }
6080
- if (getOwnPropertySymbols) {
6081
- var symbols = getOwnPropertySymbols(descriptorMap);
6082
- for (length = symbols.length, index = 0; index < length; ++index) {
6083
- var symbol = symbols[index];
6084
- if (isEnum(descriptorMap, symbol)) {
6085
- created[symbol] = Descriptor(descriptorMap[symbol]);
6086
- }
6087
- }
6088
- }
6089
- return Object_defineProperties(object, created);
6090
- }, "defineProperties")
6091
- );
6092
- var fpc = /* @__PURE__ */ __name((c) => {
6093
- freeze(freeze(c).prototype);
6094
- return c;
6095
- }, "fpc");
6096
- var _29_ = /(?:0[1-9]|1\d|2\d)/;
6097
- var _30_ = /(?:0[1-9]|[12]\d|30)/;
6098
- var _31_ = /(?:0[1-9]|[12]\d|3[01])/;
6099
- var _23_ = /(?:[01]\d|2[0-3])/;
6100
- var _59_ = /[0-5]\d/;
6101
- var YMD = /* @__PURE__ */ newRegExp`
6102
- \d\d\d\d-
6103
- (?:
6104
- 0
6105
- (?:
6106
- [13578]-${_31_}
6107
- |
6108
- [469]-${_30_}
6109
- |
6110
- 2-${_29_}
6111
- )
6112
- |
6113
- 1
6114
- (?:
6115
- [02]-${_31_}
6116
- |
6117
- 1-${_30_}
6118
- )
6119
- )
6120
- `.valueOf();
6121
- var HMS = /* @__PURE__ */ newRegExp`
6122
- ${_23_}:${_59_}:${_59_}
6123
- `.valueOf();
6124
- var OFFSET$ = /(?:[Zz]|[+-]\d\d:\d\d)$/;
6125
- var { exec: Z_exec } = theRegExp(/(([+-])\d\d):(\d\d)$/);
6126
- var { exec: OFFSET_DATETIME_exec } = /* @__PURE__ */ newRegExp`
6127
- ^
6128
- ${YMD}
6129
- [Tt ]
6130
- ${HMS}
6131
- (?:\.\d{1,3}(\d*?)0*)?
6132
- (?:[Zz]|[+-]${_23_}:${_59_})
6133
- $`.valueOf();
6134
- var { exec: OFFSET_DATETIME_ZERO_exec } = /* @__PURE__ */ newRegExp`
6135
- ^
6136
- ${YMD}
6137
- [Tt ]
6138
- ${HMS}
6139
- ()
6140
- [Zz]
6141
- $`.valueOf();
6142
- var { test: IS_LOCAL_DATETIME } = /* @__PURE__ */ newRegExp`
6143
- ^
6144
- ${YMD}
6145
- [Tt ]
6146
- ${HMS}
6147
- (?:\.\d+)?
6148
- $`.valueOf();
6149
- var { test: IS_LOCAL_DATE } = /* @__PURE__ */ newRegExp`
6150
- ^
6151
- ${YMD}
6152
- $`.valueOf();
6153
- var { test: IS_LOCAL_TIME } = /* @__PURE__ */ newRegExp`
6154
- ^
6155
- ${HMS}
6156
- (?:\.\d+)?
6157
- $`.valueOf();
6158
- var T = /[ t]/;
6159
- var DELIMITER_DOT = /[-T:.]/g;
6160
- var DOT_ZERO = /\.?0+$/;
6161
- var ZERO = /\.(\d*?)0+$/;
6162
- var zeroReplacer = /* @__PURE__ */ __name((match, p1) => p1, "zeroReplacer");
6163
- var Datetime = /* @__PURE__ */ (() => {
6164
- const Datetime2 = /* @__PURE__ */ __name(function() {
6165
- return this;
6166
- }, "Datetime");
6167
- const descriptors = Null$1(null);
6168
- {
6169
- const descriptor = Null$1(null);
6170
- for (const key of ownKeys(NativeDate.prototype)) {
6171
- key === "constructor" || key === "toJSON" || (descriptors[key] = descriptor);
6172
- }
6173
- }
6174
- Datetime2.prototype = preventExtensions(create$1(NativeDate.prototype, descriptors));
6175
- return freeze(Datetime2);
6176
- })();
6177
- var Value = /* @__PURE__ */ __name((ISOString) => ISOString.replace(ZERO, zeroReplacer).replace(DELIMITER_DOT, ""), "Value");
6178
- var d = /./gs;
6179
- var d2u = /* @__PURE__ */ __name((d2) => "\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009"[d2], "d2u");
6180
- var ValueOFFSET = /* @__PURE__ */ __name((time, more) => time < 0 ? ("" + (time + 6216730554e4)).replace(d, d2u).padStart(14, "\u2000") + more.replace(d, d2u) + time : more ? (time + ".").padStart(16, "0") + more : ("" + time).padStart(15, "0"), "ValueOFFSET");
6181
- var validateLeap = /* @__PURE__ */ __name((literal) => {
6182
- if (literal.startsWith("02-29", 5)) {
6183
- const year = +literal.slice(0, 4);
6184
- return year & 3 ? false : year % 100 ? true : year % 400 ? false : year % 3200 ? true : false;
6185
- }
6186
- return true;
6187
- }, "validateLeap");
6188
- var { test: VALIDATE_LEAP } = /* @__PURE__ */ newRegExp.s`^.....(?:06.30|12.31).23:59:59`.valueOf();
6189
- var DATE$1 = /* @__PURE__ */ defineProperties(new NativeDate(0), /* @__PURE__ */ getOwnPropertyDescriptors(NativeDate.prototype));
6190
- var OffsetDateTime_ISOString = Symbol$1("OffsetDateTime_ISOString");
6191
- var OffsetDateTime_value = Symbol$1("OffsetDateTime_value");
6192
- var OffsetDateTime_use = /* @__PURE__ */ __name((that, $ = 0) => {
6193
- DATE$1.setTime(+that[OffsetDateTime_value] + $);
6194
- return DATE$1;
6195
- }, "OffsetDateTime_use");
6196
- var OffsetDateTime = /* @__PURE__ */ fpc(class OffsetDateTime2 extends Datetime {
6197
- static {
6198
- __name(this, "OffsetDateTime");
6199
- }
6200
- [OffsetDateTime_ISOString];
6201
- [OffsetDateTime_value];
6202
- get [Symbol$1.toStringTag]() {
6203
- return "OffsetDateTime";
6204
- }
6205
- valueOf() {
6206
- return this[OffsetDateTime_value];
6207
- }
6208
- toISOString() {
6209
- return this[OffsetDateTime_ISOString];
6210
- }
6211
- constructor(literal) {
6212
- validateLeap(literal) || throws(SyntaxError$1(`Invalid Offset Date-Time ${literal}` + where(" at ")));
6213
- const with60 = literal.startsWith("60", 17);
6214
- let without60 = with60 ? literal.slice(0, 17) + "59" + literal.slice(19) : literal;
6215
- const { 1: more = "" } = (zeroDatetime ? OFFSET_DATETIME_ZERO_exec(without60) : OFFSET_DATETIME_exec(without60)) || throws(SyntaxError$1(`Invalid Offset Date-Time ${literal}` + where(" at ")));
6216
- const time = parse$2(without60 = without60.replace(T, "T").replace("z", "Z"));
6217
- if (with60) {
6218
- DATE$1.setTime(time);
6219
- VALIDATE_LEAP(DATE$1.toISOString()) || throws(SyntaxError$1(`Invalid Offset Date-Time ${literal}` + where(" at ")));
6220
- }
6221
- super();
6222
- this[OffsetDateTime_ISOString] = without60;
6223
- this[OffsetDateTime_value] = ValueOFFSET(time, more);
6224
- return this;
6225
- }
6226
- getUTCFullYear() {
6227
- return OffsetDateTime_use(this).getUTCFullYear();
6228
- }
6229
- ///get year () :FullYear { return OffsetDateTime_get(this, 0, 4); }
6230
- ///set year (value :FullYear) { OffsetDateTime_set(this, 0, 4, value, true); }
6231
- getUTCMonth() {
6232
- return OffsetDateTime_use(this).getUTCMonth();
6233
- }
6234
- ///get month () { return OffsetDateTime_get(this, 5, 7); }
6235
- ///set month (value) { OffsetDateTime_set(this, 5, 7, value, true); }
6236
- getUTCDate() {
6237
- return OffsetDateTime_use(this).getUTCDate();
6238
- }
6239
- ///get day () :Date { return OffsetDateTime_get(this, 8, 10); }
6240
- ///set day (value :Date) { OffsetDateTime_set(this, 8, 10, value, true); }
6241
- getUTCHours() {
6242
- return OffsetDateTime_use(this).getUTCHours();
6243
- }
6244
- ///get hour () :Hours { return OffsetDateTime_get(this, 11, 13); }
6245
- ///set hour (value :Hours) { OffsetDateTime_set(this, 11, 13, value, true); }
6246
- getUTCMinutes() {
6247
- return OffsetDateTime_use(this).getUTCMinutes();
6248
- }
6249
- ///get minute () :Minutes { return OffsetDateTime_get(this, 14, 16); }
6250
- ///set minute (value :Minutes) { OffsetDateTime_set(this, 14, 16, value, true); }
6251
- getUTCSeconds() {
6252
- return OffsetDateTime_use(this).getUTCSeconds();
6253
- }
6254
- ///get second () :Seconds { return OffsetDateTime_get(this, 17, 19); }
6255
- ///set second (value :Seconds) { OffsetDateTime_set(this, 17, 19, value, true); }
6256
- getUTCMilliseconds() {
6257
- return OffsetDateTime_use(this).getUTCMilliseconds();
6258
- }
6259
- ///
6260
- ///get millisecond () :Milliseconds { return this[OffsetDateTime_value]%1000; }///
6261
- /*set millisecond (value :Milliseconds) {
6262
- this[OffsetDateTime_ISOString] = this[OffsetDateTime_ISOString].slice(0, 19) + ( value ? ( '.' + ( '' + value ).padStart(3, '0') ).replace(DOT_ZERO, '') : '' ) + this[OffsetDateTime_ISOString].slice(this[OffsetDateTime_ISOString].search(OFFSET$));
6263
- OffsetDateTime_set(this, 0, 0, 0, false);
6264
- }*/
6265
- //
6266
- ///get microsecond () :Milliseconds
6267
- ///set microsecond (value :Milliseconds)
6268
- ///get nanosecond () :Milliseconds
6269
- ///set nanosecond (value :Milliseconds)
6270
- getUTCDay() {
6271
- return OffsetDateTime_use(this).getUTCDay();
6272
- }
6273
- ///get dayOfWeek () { return OffsetDateTime_use(this, this.getTimezoneOffset()*60000).getUTCDay() || 7; }
6274
- getTimezoneOffset() {
6275
- const z2 = Z_exec(this[OffsetDateTime_ISOString]);
6276
- return z2 ? +z2[1] * 60 + +(z2[2] + z2[3]) : 0;
6277
- }
6278
- ///get offset () { return this[OffsetDateTime_ISOString].endsWith('Z') ? 'Z' : this[OffsetDateTime_ISOString].slice(-6); }
6279
- /*set offset (value) {
6280
- this[OffsetDateTime_ISOString] = this[OffsetDateTime_ISOString].slice(0, this[OffsetDateTime_ISOString].endsWith('Z') ? -1 : -6) + value;
6281
- OffsetDateTime_set(this, 0, 0, 0, true);
6282
- }*/
6283
- //
6284
- getTime() {
6285
- return floor(+this[OffsetDateTime_value]);
6286
- }
6287
- ///
6288
- /*setTime (this :OffsetDateTime, value :Time) :void {
6289
- value = DATE.setTime(value);
6290
- const z = Z_exec(this[OffsetDateTime_ISOString]);
6291
- DATE.setTime(value + ( z ? +z[1]*60 + +( z[2] + z[3] ) : 0 )*60000);
6292
- this[OffsetDateTime_ISOString] = z ? DATE.toISOString().slice(0, -1) + z[0] : DATE.toISOString();
6293
- this[OffsetDateTime_value] = ValueOFFSET(value, '');
6294
- ///return value;
6295
- }*/
6296
- });
6297
- var LocalDateTime_ISOString = Symbol$1("LocalDateTime_ISOString");
6298
- var LocalDateTime_value = Symbol$1("LocalDateTime_value");
6299
- var LocalDateTime_get = /* @__PURE__ */ __name((that, start, end) => +that[LocalDateTime_ISOString].slice(start, end), "LocalDateTime_get");
6300
- var LocalDateTime_set = /* @__PURE__ */ __name((that, start, end, value) => {
6301
- const string = "" + value;
6302
- const size = end - start;
6303
- if (string.length > size) {
6304
- throw RangeError$1();
6305
- }
6306
- that[LocalDateTime_value] = Value(
6307
- that[LocalDateTime_ISOString] = that[LocalDateTime_ISOString].slice(0, start) + string.padStart(size, "0") + that[LocalDateTime_ISOString].slice(end)
6308
- );
6309
- }, "LocalDateTime_set");
6310
- var LocalDateTime = /* @__PURE__ */ fpc(class LocalDateTime2 extends Datetime {
6311
- static {
6312
- __name(this, "LocalDateTime");
6313
- }
6314
- [LocalDateTime_ISOString];
6315
- [LocalDateTime_value];
6316
- get [Symbol$1.toStringTag]() {
6317
- return "LocalDateTime";
6318
- }
6319
- valueOf() {
6320
- return this[LocalDateTime_value];
6321
- }
6322
- toISOString() {
6323
- return this[LocalDateTime_ISOString];
6324
- }
6325
- constructor(literal) {
6326
- IS_LOCAL_DATETIME(literal) && validateLeap(literal) || throws(SyntaxError$1(`Invalid Local Date-Time ${literal}` + where(" at ")));
6327
- super();
6328
- this[LocalDateTime_value] = Value(
6329
- this[LocalDateTime_ISOString] = literal.replace(T, "T")
6330
- );
6331
- return this;
6332
- }
6333
- getFullYear() {
6334
- return LocalDateTime_get(this, 0, 4);
6335
- }
6336
- setFullYear(value) {
6337
- LocalDateTime_set(this, 0, 4, value);
6338
- }
6339
- getMonth() {
6340
- return LocalDateTime_get(this, 5, 7) - 1;
6341
- }
6342
- setMonth(value) {
6343
- LocalDateTime_set(this, 5, 7, value + 1);
6344
- }
6345
- getDate() {
6346
- return LocalDateTime_get(this, 8, 10);
6347
- }
6348
- setDate(value) {
6349
- LocalDateTime_set(this, 8, 10, value);
6350
- }
6351
- getHours() {
6352
- return LocalDateTime_get(this, 11, 13);
6353
- }
6354
- setHours(value) {
6355
- LocalDateTime_set(this, 11, 13, value);
6356
- }
6357
- getMinutes() {
6358
- return LocalDateTime_get(this, 14, 16);
6359
- }
6360
- setMinutes(value) {
6361
- LocalDateTime_set(this, 14, 16, value);
6362
- }
6363
- getSeconds() {
6364
- return LocalDateTime_get(this, 17, 19);
6365
- }
6366
- setSeconds(value) {
6367
- LocalDateTime_set(this, 17, 19, value);
6368
- }
6369
- getMilliseconds() {
6370
- return +this[LocalDateTime_value].slice(14, 17).padEnd(3, "0");
6371
- }
6372
- ///
6373
- setMilliseconds(value) {
6374
- this[LocalDateTime_value] = Value(
6375
- this[LocalDateTime_ISOString] = this[LocalDateTime_ISOString].slice(0, 19) + (value ? ("." + ("" + value).padStart(3, "0")).replace(DOT_ZERO, "") : "")
6376
- );
6377
- }
6378
- });
6379
- var LocalDate_ISOString = Symbol$1("LocalDate_ISOString");
6380
- var LocalDate_value = Symbol$1("LocalDate_value");
6381
- var LocalDate_get = /* @__PURE__ */ __name((that, start, end) => +that[LocalDate_ISOString].slice(start, end), "LocalDate_get");
6382
- var LocalDate_set = /* @__PURE__ */ __name((that, start, end, value) => {
6383
- const string = "" + value;
6384
- const size = end - start;
6385
- if (string.length > size) {
6386
- throw RangeError$1();
6387
- }
6388
- that[LocalDate_value] = Value(
6389
- that[LocalDate_ISOString] = that[LocalDate_ISOString].slice(0, start) + string.padStart(size, "0") + that[LocalDate_ISOString].slice(end)
6390
- );
6391
- }, "LocalDate_set");
6392
- var LocalDate = /* @__PURE__ */ fpc(class LocalDate2 extends Datetime {
6393
- static {
6394
- __name(this, "LocalDate");
6395
- }
6396
- [LocalDate_ISOString];
6397
- [LocalDate_value];
6398
- get [Symbol$1.toStringTag]() {
6399
- return "LocalDate";
6400
- }
6401
- valueOf() {
6402
- return this[LocalDate_value];
6403
- }
6404
- toISOString() {
6405
- return this[LocalDate_ISOString];
6406
- }
6407
- constructor(literal) {
6408
- IS_LOCAL_DATE(literal) && validateLeap(literal) || throws(SyntaxError$1(`Invalid Local Date ${literal}` + where(" at ")));
6409
- super();
6410
- this[LocalDate_value] = Value(
6411
- this[LocalDate_ISOString] = literal
6412
- );
6413
- return this;
6414
- }
6415
- getFullYear() {
6416
- return LocalDate_get(this, 0, 4);
6417
- }
6418
- setFullYear(value) {
6419
- LocalDate_set(this, 0, 4, value);
6420
- }
6421
- getMonth() {
6422
- return LocalDate_get(this, 5, 7) - 1;
6423
- }
6424
- setMonth(value) {
6425
- LocalDate_set(this, 5, 7, value + 1);
6426
- }
6427
- getDate() {
6428
- return LocalDate_get(this, 8, 10);
6429
- }
6430
- setDate(value) {
6431
- LocalDate_set(this, 8, 10, value);
6432
- }
6433
- });
6434
- var LocalTime_ISOString = Symbol$1("LocalTime_ISOString");
6435
- var LocalTime_value = Symbol$1("LocalTime_value");
6436
- var LocalTime_get = /* @__PURE__ */ __name((that, start, end) => +that[LocalTime_ISOString].slice(start, end), "LocalTime_get");
6437
- var LocalTime_set = /* @__PURE__ */ __name((that, start, end, value) => {
6438
- const string = "" + value;
6439
- const size = end - start;
6440
- if (string.length > size) {
6441
- throw RangeError$1();
6442
- }
6443
- that[LocalTime_value] = Value(
6444
- that[LocalTime_ISOString] = that[LocalTime_ISOString].slice(0, start) + string.padStart(2, "0") + that[LocalTime_ISOString].slice(end)
6445
- );
6446
- }, "LocalTime_set");
6447
- var LocalTime = /* @__PURE__ */ fpc(class LocalTime2 extends Datetime {
6448
- static {
6449
- __name(this, "LocalTime");
6450
- }
6451
- [LocalTime_ISOString];
6452
- [LocalTime_value];
6453
- get [Symbol$1.toStringTag]() {
6454
- return "LocalTime";
6455
- }
6456
- valueOf() {
6457
- return this[LocalTime_value];
6458
- }
6459
- toISOString() {
6460
- return this[LocalTime_ISOString];
6461
- }
6462
- constructor(literal) {
6463
- IS_LOCAL_TIME(literal) || throws(SyntaxError$1(`Invalid Local Time ${literal}` + where(" at ")));
6464
- super();
6465
- this[LocalTime_value] = Value(
6466
- this[LocalTime_ISOString] = literal
6467
- );
6468
- return this;
6469
- }
6470
- getHours() {
6471
- return LocalTime_get(this, 0, 2);
6472
- }
6473
- setHours(value) {
6474
- LocalTime_set(this, 0, 2, value);
6475
- }
6476
- getMinutes() {
6477
- return LocalTime_get(this, 3, 5);
6478
- }
6479
- setMinutes(value) {
6480
- LocalTime_set(this, 3, 5, value);
6481
- }
6482
- getSeconds() {
6483
- return LocalTime_get(this, 6, 8);
6484
- }
6485
- setSeconds(value) {
6486
- LocalTime_set(this, 6, 8, value);
6487
- }
6488
- getMilliseconds() {
6489
- return +this[LocalTime_value].slice(6, 9).padEnd(3, "0");
6490
- }
6491
- ///
6492
- setMilliseconds(value) {
6493
- this[LocalTime_value] = Value(
6494
- this[LocalTime_ISOString] = this[LocalTime_ISOString].slice(0, 8) + (value ? ("." + ("" + value).padStart(3, "0")).replace(DOT_ZERO, "") : "")
6495
- );
6496
- }
6497
- });
6498
- var fromCodePoint = String.fromCodePoint;
6499
- var INTEGER_D = /[-+]?(?:0|[1-9][_\d]*)/;
6500
- var { test: BAD_D } = /* @__PURE__ */ newRegExp`_(?!\d)`.valueOf();
6501
- var { test: IS_D_INTEGER } = /* @__PURE__ */ newRegExp`^${INTEGER_D}$`.valueOf();
6502
- var { test: IS_XOB_INTEGER } = theRegExp(/^0(?:x[\dA-Fa-f][_\dA-Fa-f]*|o[0-7][_0-7]*|b[01][_01]*)$/);
6503
- var { test: BAD_XOB } = /* @__PURE__ */ newRegExp`_(?![\dA-Fa-f])`.valueOf();
6504
- var MIN = BigInt$1 && -/* @__PURE__ */ BigInt$1("0x8000000000000000");
6505
- var NaN$1 = 0 / 0;
6506
- var _NaN = -NaN$1;
6507
- var _Infinity$1 = -Infinity2;
6508
- var { test: IS_FLOAT } = /* @__PURE__ */ newRegExp`
6509
- ^
6510
- ${INTEGER_D}
6511
- (?:
6512
- \.\d[_\d]*
6513
- (?:[eE][-+]?\d[_\d]*)?
6514
- |
6515
- [eE][-+]?\d[_\d]*
6516
- )
6517
- $`.valueOf();
6518
- var { test: IS_ZERO } = theRegExp(/^[-+]?0(?:\.0+)?(?:[eE][-+]?0+)?$/);
6519
- var { exec: NORMALIZED } = theRegExp(/^[-0]?(\d*)(?:\.(\d+))?(?:e\+?(-?\d+))?$/);
6520
- var { exec: ORIGINAL } = theRegExp(/^[-+]?0?(\d*)(?:\.(\d*?)0*)?(?:[eE]\+?(-?\d+))?$/);
6521
- var KEYS = /* @__PURE__ */ Null$1(null);
6522
- var commentForThis = Symbol$1("this");
6523
- var { test: includesNewline } = theRegExp(/\r?\n/g);
6524
- var getCOMMENT = /* @__PURE__ */ __name((table, keyComment) => {
6525
- if (keyComment in table) {
6526
- const comment = table[keyComment];
6527
- if (typeof comment !== "string") {
6528
- throw TypeError$1(`the value of comment must be a string, while "${comment === null ? "null" : typeof comment}" type is found`);
6529
- }
6530
- if (includesNewline(comment)) {
6531
- throw SyntaxError$1(`the value of comment must be a string and can not include newline`);
6532
- }
6533
- return ` #${comment}`;
6534
- }
6535
- return "";
6536
- }, "getCOMMENT");
6537
- var getComment = /* @__PURE__ */ __name((table, key) => key in KEYS ? getCOMMENT(table, KEYS[key]) : "", "getComment");
6538
- var { test: IS_OFFSET$ } = theRegExp(OFFSET$);
6539
- var { test: IS_EMPTY } = theRegExp(/^\[[\t ]*]/);
6540
- var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER;
6541
- var DATE = Date.prototype;
6542
- var valueOf$2 = String.prototype.valueOf;
6543
- var isString = (
6544
- /* j-globals: class.isString (internal) */
6545
- /* @__PURE__ */ function() {
6546
- if (apply.bind) {
6547
- var valueOf_apply = apply.bind(valueOf$2);
6548
- return /* @__PURE__ */ __name(function isString4(value) {
6549
- try {
6550
- valueOf_apply(value);
6551
- } catch (error) {
6552
- return false;
6553
- }
6554
- return true;
6555
- }, "isString");
6556
- }
6557
- return /* @__PURE__ */ __name(function isString4(value) {
6558
- try {
6559
- valueOf$2.apply(value);
6560
- } catch (error) {
6561
- return false;
6562
- }
6563
- return true;
6564
- }, "isString");
6565
- }()
6566
- );
6567
- var valueOf$1 = Number.prototype.valueOf;
6568
- var isNumber = (
6569
- /* j-globals: class.isNumber (internal) */
6570
- /* @__PURE__ */ function() {
6571
- if (apply.bind) {
6572
- var valueOf_apply = apply.bind(valueOf$1);
6573
- return /* @__PURE__ */ __name(function isNumber4(value) {
6574
- try {
6575
- valueOf_apply(value);
6576
- } catch (error) {
6577
- return false;
6578
- }
6579
- return true;
6580
- }, "isNumber");
6581
- }
6582
- return /* @__PURE__ */ __name(function isNumber4(value) {
6583
- try {
6584
- valueOf$1.apply(value);
6585
- } catch (error) {
6586
- return false;
6587
- }
6588
- return true;
6589
- }, "isNumber");
6590
- }()
6591
- );
6592
- var isBigInt = (
6593
- /* j-globals: class.isBigInt (internal) */
6594
- /* @__PURE__ */ function() {
6595
- if (typeof BigInt === "function") {
6596
- var valueOf_apply = apply.bind(BigInt.prototype.valueOf);
6597
- return /* @__PURE__ */ __name(function isBigInt2(value) {
6598
- try {
6599
- valueOf_apply(value);
6600
- } catch (error) {
6601
- return false;
6602
- }
6603
- return true;
6604
- }, "isBigInt");
6605
- }
6606
- return /* @__PURE__ */ __name(function isBigInt2() {
6607
- return false;
6608
- }, "isBigInt");
6609
- }()
6610
- );
6611
- var valueOf = BigInt.prototype.valueOf;
6612
- var isBoolean = (
6613
- /* j-globals: class.isBoolean (internal) */
6614
- /* @__PURE__ */ function() {
6615
- if (apply.bind) {
6616
- var valueOf_apply = apply.bind(valueOf);
6617
- return /* @__PURE__ */ __name(function isBoolean3(value) {
6618
- try {
6619
- valueOf_apply(value);
6620
- } catch (error) {
6621
- return false;
6622
- }
6623
- return true;
6624
- }, "isBoolean");
6625
- }
6626
- return /* @__PURE__ */ __name(function isBoolean3(value) {
6627
- try {
6628
- valueOf.apply(value);
6629
- } catch (error) {
6630
- return false;
6631
- }
6632
- return true;
6633
- }, "isBoolean");
6634
- }()
6635
- );
6636
- var ESCAPED = /* @__PURE__ */ Null$1({
6637
- .../* @__PURE__ */ fromEntries(/* @__PURE__ */ [...Array$1(32)].map((_, charCode) => [fromCharCode(charCode), "\\u" + charCode.toString(16).toUpperCase().padStart(4, "0")])),
6638
- "\b": "\\b",
6639
- " ": "\\t",
6640
- "\n": "\\n",
6641
- "\f": "\\f",
6642
- "\r": "\\r",
6643
- '"': '\\"',
6644
- '"""': '""\\"',
6645
- "\\": "\\\\",
6646
- "\x7F": "\\u007F"
6647
- });
6648
- var { test: NEED_BASIC } = theRegExp(/[\x00-\x08\x0A-\x1F'\x7F]/);
6649
- var BY_ESCAPE = /[^\x00-\x08\x0A-\x1F"\\\x7F]+|./gs;
6650
- var { test: NEED_ESCAPE } = theRegExp(/^[\x00-\x08\x0A-\x1F"\\\x7F]/);
6651
- var singlelineString = /* @__PURE__ */ __name((value) => {
6652
- if (NEED_BASIC(value)) {
6653
- const parts = value.match(BY_ESCAPE);
6654
- let index = parts.length;
6655
- do {
6656
- if (NEED_ESCAPE(parts[--index])) {
6657
- parts[index] = ESCAPED[parts[index]];
6658
- }
6659
- } while (index);
6660
- return `"${parts.join("")}"`;
6661
- }
6662
- return `'${value}'`;
6663
- }, "singlelineString");
6664
- var { test: NEED_MULTILINE_BASIC } = theRegExp(/[\x00-\x08\x0A-\x1F\x7F]|'''/);
6665
- var { test: multilineNeedBasic } = theRegExp(/[\x00-\x08\x0B-\x1F\x7F]|'''/);
6666
- var { test: REAL_MULTILINE_ESCAPE } = theRegExp(/[\x00-\x08\x0A-\x1F\\\x7F]|"""/);
6667
- var { test: NEED_MULTILINE_ESCAPE } = theRegExp(/^(?:[\x00-\x08\x0A-\x1F\\\x7F]|""")/);
6668
- var Float64Array$1 = Float64Array;
6669
- var Uint8Array$1 = Uint8Array;
6670
- var _Infinity = -Infinity2;
6671
- var { test: INTEGER_LIKE } = theRegExp(/^-?\d+$/);
6672
- var ensureFloat = /* @__PURE__ */ __name((literal) => INTEGER_LIKE(literal) ? literal + ".0" : literal, "ensureFloat");
6673
- var float64Array = new Float64Array$1([NaN$1]);
6674
- var uint8Array = new Uint8Array$1(float64Array.buffer);
6675
- var NaN_7 = uint8Array[7];
6676
- var float = NaN_7 === new Uint8Array$1(new Float64Array$1([-NaN$1]).buffer)[7] ? (value) => value ? value === Infinity2 ? "inf" : value === _Infinity ? "-inf" : ensureFloat("" + value) : value === value ? is(value, 0) ? "0.0" : "-0.0" : "nan" : (value) => value ? value === Infinity2 ? "inf" : value === _Infinity ? "-inf" : ensureFloat("" + value) : value === value ? is(value, 0) ? "0.0" : "-0.0" : (float64Array[0] = value, uint8Array[7]) === NaN_7 ? "nan" : "-nan";
6677
- var isDate = /* @__PURE__ */ isPrototypeOf.bind(DATE);
6678
- var { test: BARE } = theRegExp(/^[\w-]+$/);
6679
- var $Key$ = /* @__PURE__ */ __name((key) => BARE(key) ? key : singlelineString(key), "$Key$");
6680
- var FIRST = /[^.]+/;
6681
- var literalString = /* @__PURE__ */ __name((value) => `'${value}'`, "literalString");
6682
- var $Keys = /* @__PURE__ */ __name((keys2) => isAmazing(keys2) ? keys2.replace(FIRST, literalString) : keys2 === "null" ? `'null'` : keys2, "$Keys");
6683
- var TOMLSection = class extends Array$1 {
6684
- static {
6685
- __name(this, "TOMLSection");
6686
- }
6687
- document;
6688
- constructor(document) {
6689
- super();
6690
- this.document = document;
6691
- return this;
6692
- }
6693
- [Symbol$1.toPrimitive]() {
6694
- return this.join(this.document.newline);
6695
- }
6696
- appendNewline() {
6697
- this[this.length] = "";
6698
- }
6699
- set appendLine(source) {
6700
- this[this.length] = source;
6701
- }
6702
- set appendInline(source) {
6703
- this[this.length - 1] += source;
6704
- }
6705
- set appendInlineIf(source) {
6706
- source && (this[this.length - 1] += source);
6707
- }
6708
- ///
6709
- *assignBlock(documentKeys_, sectionKeys_, table, tableKeys) {
6710
- const { document } = this;
6711
- const { newlineUnderHeader, newlineUnderSectionButPair } = document;
6712
- const newlineAfterDotted = sectionKeys_ ? document.newlineUnderPairButDotted : false;
6713
- const newlineAfterPair = sectionKeys_ ? document.newlineUnderDotted : document.newlineUnderPair;
6714
- for (const tableKey of tableKeys) {
6715
- const value = table[tableKey];
6716
- const $key$ = $Key$(tableKey);
6717
- const documentKeys = documentKeys_ + $key$;
6718
- if (isArray$1(value)) {
6719
- const { length } = value;
6720
- if (length) {
6721
- let firstItem = value[0];
6722
- if (isSection(firstItem)) {
6723
- const tableHeader = `[[${documentKeys}]]`;
6724
- const documentKeys_2 = documentKeys + ".";
6725
- let index = 0;
6726
- let table2 = firstItem;
6727
- for (; ; ) {
6728
- const section = document.appendSection();
6729
- section[0] = tableHeader + getCOMMENT(table2, commentForThis);
6730
- if (newlineUnderHeader) {
6731
- section[1] = "";
6732
- yield section.assignBlock(documentKeys_2, ``, table2, getOwnPropertyNames(table2));
6733
- newlineUnderSectionButPair && section.length !== 2 && section.appendNewline();
6734
- } else {
6735
- yield section.assignBlock(documentKeys_2, ``, table2, getOwnPropertyNames(table2));
6736
- newlineUnderSectionButPair && section.appendNewline();
6737
- }
6738
- if (++index === length) {
6739
- break;
6740
- }
6741
- table2 = value[index];
6742
- if (!isSection(table2)) {
6743
- throw TypeError$1(`the first table item marked by Section() means the parent array is an array of tables, which can not include other types or table not marked by Section() any more in the rest items`);
6744
- }
6745
- }
6746
- continue;
6747
- } else {
6748
- let index = 1;
6749
- while (index !== length) {
6750
- if (isSection(value[index++])) {
6751
- throw TypeError$1(`if an array is not array of tables, it can not include any table that marked by Section()`);
6752
- }
6753
- }
6754
- }
6755
- }
6756
- } else {
6757
- if (isSection(value)) {
6758
- const section = document.appendSection();
6759
- section[0] = `[${documentKeys}]${document.preferCommentForThis ? getCOMMENT(value, commentForThis) || getComment(table, tableKey) : getComment(table, tableKey) || getCOMMENT(value, commentForThis)}`;
6760
- if (newlineUnderHeader) {
6761
- section[1] = "";
6762
- yield section.assignBlock(documentKeys + ".", ``, value, getOwnPropertyNames(value));
6763
- newlineUnderSectionButPair && section.length !== 2 && section.appendNewline();
6764
- } else {
6765
- yield section.assignBlock(documentKeys + ".", ``, value, getOwnPropertyNames(value));
6766
- newlineUnderSectionButPair && section.appendNewline();
6767
- }
6768
- continue;
6769
- }
6770
- }
6771
- const sectionKeys = sectionKeys_ + $key$;
6772
- this.appendLine = $Keys(sectionKeys) + " = ";
6773
- const valueKeysIfValueIsDottedTable = this.value("", value, true);
6774
- if (valueKeysIfValueIsDottedTable) {
6775
- --this.length;
6776
- yield this.assignBlock(documentKeys + ".", sectionKeys + ".", value, valueKeysIfValueIsDottedTable);
6777
- newlineAfterDotted && this.appendNewline();
6778
- } else {
6779
- this.appendInlineIf = getComment(table, tableKey);
6780
- newlineAfterPair && this.appendNewline();
6781
- }
6782
- }
6783
- }
6784
- value(indent, value, returnValueKeysIfValueIsDottedTable) {
6785
- switch (typeof value) {
6786
- case "object":
6787
- if (value === null) {
6788
- if (this.document.nullDisabled) {
6789
- throw TypeError$1(`toml can not stringify "null" type value without truthy options.xNull`);
6790
- }
6791
- this.appendInline = "null";
6792
- break;
6793
- }
6794
- const inlineMode = ofInline(value);
6795
- if (isArray$1(value)) {
6796
- if (inlineMode === undefined$1) {
6797
- this.staticArray(indent, value);
6798
- } else {
6799
- const { $singlelineArray = inlineMode } = this.document;
6800
- this.singlelineArray(indent, value, $singlelineArray);
6801
- }
6802
- break;
6803
- }
6804
- if (inlineMode !== undefined$1) {
6805
- inlineMode || this.document.multilineTableDisabled ? this.inlineTable(indent, value) : this.multilineTable(indent, value, this.document.multilineTableComma);
6806
- break;
6807
- }
6808
- if (isDate(value)) {
6809
- this.appendInline = value.toISOString().replace("T", this.document.T).replace("Z", this.document.Z);
6810
- break;
6811
- }
6812
- if (_literal in value) {
6813
- const literal = value[_literal];
6814
- if (typeof literal === "string") {
6815
- this.appendInline = literal;
6816
- } else if (isArray$1(literal)) {
6817
- const { length } = literal;
6818
- if (length) {
6819
- this.appendInline = literal[0];
6820
- let index = 1;
6821
- while (index !== length) {
6822
- this.appendLine = literal[index++];
6823
- }
6824
- } else {
6825
- throw TypeError$1(`literal value is broken`);
6826
- }
6827
- } else {
6828
- throw TypeError$1(`literal value is broken`);
6829
- }
6830
- break;
6831
- }
6832
- if (isString(value)) {
6833
- throw TypeError$1(`TOML.stringify refuse to handle [object String]`);
6834
- }
6835
- if (isNumber(value)) {
6836
- throw TypeError$1(`TOML.stringify refuse to handle [object Number]`);
6837
- }
6838
- if (isBigInt(value)) {
6839
- throw TypeError$1(`TOML.stringify refuse to handle [object BigInt]`);
6840
- }
6841
- if (isBoolean(value)) {
6842
- throw TypeError$1(`TOML.stringify refuse to handle [object Boolean]`);
6843
- }
6844
- if (returnValueKeysIfValueIsDottedTable) {
6845
- const keys2 = getOwnPropertyNames(value);
6846
- if (keys2.length) {
6847
- return keys2;
6848
- }
6849
- this.appendInline = "{ }";
6850
- } else {
6851
- this.inlineTable(indent, value);
6852
- }
6853
- break;
6854
- case "bigint":
6855
- this.appendInline = "" + value;
6856
- break;
6857
- case "number":
6858
- this.appendInline = this.document.asInteger(value) ? is(value, -0) ? "-0" : "" + value : float(value);
6859
- break;
6860
- case "string":
6861
- this.appendInline = singlelineString(value);
6862
- break;
6863
- case "boolean":
6864
- this.appendInline = value ? "true" : "false";
6865
- break;
6866
- default:
6867
- throw TypeError$1(`toml can not stringify "${typeof value}" type value`);
6868
- }
6869
- return null;
6870
- }
6871
- singlelineArray(indent, staticArray, inlineMode) {
6872
- const { length } = staticArray;
6873
- if (length) {
6874
- this.appendInline = inlineMode & 2 ? "[ " : "[";
6875
- this.value(indent, staticArray[0], false);
6876
- let index = 1;
6877
- while (index !== length) {
6878
- this.appendInline = ", ";
6879
- this.value(indent, staticArray[index++], false);
6880
- }
6881
- this.appendInline = inlineMode & 2 ? " ]" : "]";
6882
- } else {
6883
- this.appendInline = inlineMode & 1 ? "[ ]" : "[]";
6884
- }
6885
- }
6886
- staticArray(indent, staticArray) {
6887
- this.appendInline = "[";
6888
- const indent_ = indent + this.document.indent;
6889
- const { length } = staticArray;
6890
- let index = 0;
6891
- while (index !== length) {
6892
- this.appendLine = indent_;
6893
- this.value(indent_, staticArray[index++], false);
6894
- this.appendInline = ",";
6895
- }
6896
- this.appendLine = indent + "]";
6897
- }
6898
- inlineTable(indent, inlineTable) {
6899
- const keys2 = getOwnPropertyNames(inlineTable);
6900
- if (keys2.length) {
6901
- this.appendInline = "{ ";
6902
- this.assignInline(indent, inlineTable, ``, keys2);
6903
- this[this.length - 1] = this[this.length - 1].slice(0, -2) + " }";
6904
- } else {
6905
- this.appendInline = "{ }";
6906
- }
6907
- }
6908
- multilineTable(indent, inlineTable, comma) {
6909
- this.appendInline = "{";
6910
- this.assignMultiline(indent, inlineTable, ``, getOwnPropertyNames(inlineTable), comma);
6911
- this.appendLine = indent + "}";
6912
- }
6913
- assignInline(indent, inlineTable, keys_, keys2) {
6914
- for (const key of keys2) {
6915
- const value = inlineTable[key];
6916
- const keys3 = keys_ + $Key$(key);
6917
- const before_value = this.appendInline = $Keys(keys3) + " = ";
6918
- const valueKeysIfValueIsDottedTable = this.value(indent, value, true);
6919
- if (valueKeysIfValueIsDottedTable) {
6920
- this[this.length - 1] = this[this.length - 1].slice(0, -before_value.length);
6921
- this.assignInline(indent, value, keys3 + ".", valueKeysIfValueIsDottedTable);
6922
- } else {
6923
- this.appendInline = ", ";
6924
- }
6925
- }
6926
- }
6927
- assignMultiline(indent, inlineTable, keys_, keys2, comma) {
6928
- const indent_ = indent + this.document.indent;
6929
- for (const key of keys2) {
6930
- const value = inlineTable[key];
6931
- const keys3 = keys_ + $Key$(key);
6932
- this.appendLine = indent_ + $Keys(keys3) + " = ";
6933
- const valueKeysIfValueIsDottedTable = this.value(indent_, value, true);
6934
- if (valueKeysIfValueIsDottedTable) {
6935
- --this.length;
6936
- this.assignMultiline(indent, value, keys3 + ".", valueKeysIfValueIsDottedTable, comma);
6937
- } else {
6938
- comma ? this.appendInline = "," + getComment(inlineTable, key) : this.appendInlineIf = getComment(inlineTable, key);
6939
- }
6940
- }
6941
- }
6942
- };
6943
- var { test: IS_INDENT } = theRegExp(/^[\t ]*$/);
6944
- var linesFromStringify = new WeakSet$1();
6945
- var textDecoder = /* @__PURE__ */ new TextDecoder$1("utf-8", Null$1({ fatal: true, ignoreBOM: false }));
6946
- var { test: includesNonScalar } = theRegExp(/[\uD800-\uDFFF]/u);
6947
-
6948
5462
  // ../path/src/get-parent-path.ts
6949
5463
  init_esm_shims();
6950
5464
  var resolveParentPath = /* @__PURE__ */ __name((path6, count = 1) => {
@@ -8181,2419 +6695,6 @@ init_esm_shims();
8181
6695
 
8182
6696
  // ../fs/src/write-file.ts
8183
6697
  init_esm_shims();
8184
-
8185
- // ../json/src/storm-json.ts
8186
- init_esm_shims();
8187
-
8188
- // ../type-checks/src/is-object.ts
8189
- init_esm_shims();
8190
-
8191
- // ../type-checks/src/is-plain-object.ts
8192
- init_esm_shims();
8193
-
8194
- // ../type-checks/src/get-object-tag.ts
8195
- init_esm_shims();
8196
- var getObjectTag = /* @__PURE__ */ __name((value) => {
8197
- if (value == null) {
8198
- return value === void 0 ? "[object Undefined]" : "[object Null]";
8199
- }
8200
- return Object.prototype.toString.call(value);
8201
- }, "getObjectTag");
8202
-
8203
- // ../type-checks/src/is-plain-object.ts
8204
- var isObjectLike = /* @__PURE__ */ __name((obj) => {
8205
- return typeof obj === "object" && obj !== null;
8206
- }, "isObjectLike");
8207
- var isPlainObject2 = /* @__PURE__ */ __name((obj) => {
8208
- if (!isObjectLike(obj) || getObjectTag(obj) !== "[object Object]") {
8209
- return false;
8210
- }
8211
- if (Object.getPrototypeOf(obj) === null) {
8212
- return true;
8213
- }
8214
- let proto = obj;
8215
- while (Object.getPrototypeOf(proto) !== null) {
8216
- proto = Object.getPrototypeOf(proto);
8217
- }
8218
- return Object.getPrototypeOf(obj) === proto;
8219
- }, "isPlainObject");
8220
-
8221
- // ../type-checks/src/is-object.ts
8222
- var isObject = /* @__PURE__ */ __name((value) => {
8223
- try {
8224
- return typeof value === "object" || Boolean(value) && value?.constructor === Object || isPlainObject2(value);
8225
- } catch {
8226
- return false;
8227
- }
8228
- }, "isObject");
8229
-
8230
- // ../type-checks/src/is-string.ts
8231
- init_esm_shims();
8232
- var isString2 = /* @__PURE__ */ __name((value) => {
8233
- try {
8234
- return typeof value === "string";
8235
- } catch {
8236
- return false;
8237
- }
8238
- }, "isString");
8239
-
8240
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js
8241
- init_esm_shims();
8242
-
8243
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/format.js
8244
- init_esm_shims();
8245
-
8246
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
8247
- init_esm_shims();
8248
- function createScanner(text, ignoreTrivia = false) {
8249
- const len = text.length;
8250
- let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
8251
- function scanHexDigits(count, exact) {
8252
- let digits = 0;
8253
- let value2 = 0;
8254
- while (digits < count || !exact) {
8255
- let ch = text.charCodeAt(pos);
8256
- if (ch >= 48 && ch <= 57) {
8257
- value2 = value2 * 16 + ch - 48;
8258
- } else if (ch >= 65 && ch <= 70) {
8259
- value2 = value2 * 16 + ch - 65 + 10;
8260
- } else if (ch >= 97 && ch <= 102) {
8261
- value2 = value2 * 16 + ch - 97 + 10;
8262
- } else {
8263
- break;
8264
- }
8265
- pos++;
8266
- digits++;
8267
- }
8268
- if (digits < count) {
8269
- value2 = -1;
8270
- }
8271
- return value2;
8272
- }
8273
- __name(scanHexDigits, "scanHexDigits");
8274
- function setPosition(newPosition) {
8275
- pos = newPosition;
8276
- value = "";
8277
- tokenOffset = 0;
8278
- token = 16;
8279
- scanError = 0;
8280
- }
8281
- __name(setPosition, "setPosition");
8282
- function scanNumber() {
8283
- let start = pos;
8284
- if (text.charCodeAt(pos) === 48) {
8285
- pos++;
8286
- } else {
8287
- pos++;
8288
- while (pos < text.length && isDigit(text.charCodeAt(pos))) {
8289
- pos++;
8290
- }
8291
- }
8292
- if (pos < text.length && text.charCodeAt(pos) === 46) {
8293
- pos++;
8294
- if (pos < text.length && isDigit(text.charCodeAt(pos))) {
8295
- pos++;
8296
- while (pos < text.length && isDigit(text.charCodeAt(pos))) {
8297
- pos++;
8298
- }
8299
- } else {
8300
- scanError = 3;
8301
- return text.substring(start, pos);
8302
- }
8303
- }
8304
- let end = pos;
8305
- if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
8306
- pos++;
8307
- if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
8308
- pos++;
8309
- }
8310
- if (pos < text.length && isDigit(text.charCodeAt(pos))) {
8311
- pos++;
8312
- while (pos < text.length && isDigit(text.charCodeAt(pos))) {
8313
- pos++;
8314
- }
8315
- end = pos;
8316
- } else {
8317
- scanError = 3;
8318
- }
8319
- }
8320
- return text.substring(start, end);
8321
- }
8322
- __name(scanNumber, "scanNumber");
8323
- function scanString() {
8324
- let result = "", start = pos;
8325
- while (true) {
8326
- if (pos >= len) {
8327
- result += text.substring(start, pos);
8328
- scanError = 2;
8329
- break;
8330
- }
8331
- const ch = text.charCodeAt(pos);
8332
- if (ch === 34) {
8333
- result += text.substring(start, pos);
8334
- pos++;
8335
- break;
8336
- }
8337
- if (ch === 92) {
8338
- result += text.substring(start, pos);
8339
- pos++;
8340
- if (pos >= len) {
8341
- scanError = 2;
8342
- break;
8343
- }
8344
- const ch2 = text.charCodeAt(pos++);
8345
- switch (ch2) {
8346
- case 34:
8347
- result += '"';
8348
- break;
8349
- case 92:
8350
- result += "\\";
8351
- break;
8352
- case 47:
8353
- result += "/";
8354
- break;
8355
- case 98:
8356
- result += "\b";
8357
- break;
8358
- case 102:
8359
- result += "\f";
8360
- break;
8361
- case 110:
8362
- result += "\n";
8363
- break;
8364
- case 114:
8365
- result += "\r";
8366
- break;
8367
- case 116:
8368
- result += " ";
8369
- break;
8370
- case 117:
8371
- const ch3 = scanHexDigits(4, true);
8372
- if (ch3 >= 0) {
8373
- result += String.fromCharCode(ch3);
8374
- } else {
8375
- scanError = 4;
8376
- }
8377
- break;
8378
- default:
8379
- scanError = 5;
8380
- }
8381
- start = pos;
8382
- continue;
8383
- }
8384
- if (ch >= 0 && ch <= 31) {
8385
- if (isLineBreak(ch)) {
8386
- result += text.substring(start, pos);
8387
- scanError = 2;
8388
- break;
8389
- } else {
8390
- scanError = 6;
8391
- }
8392
- }
8393
- pos++;
8394
- }
8395
- return result;
8396
- }
8397
- __name(scanString, "scanString");
8398
- function scanNext() {
8399
- value = "";
8400
- scanError = 0;
8401
- tokenOffset = pos;
8402
- lineStartOffset = lineNumber;
8403
- prevTokenLineStartOffset = tokenLineStartOffset;
8404
- if (pos >= len) {
8405
- tokenOffset = len;
8406
- return token = 17;
8407
- }
8408
- let code = text.charCodeAt(pos);
8409
- if (isWhiteSpace(code)) {
8410
- do {
8411
- pos++;
8412
- value += String.fromCharCode(code);
8413
- code = text.charCodeAt(pos);
8414
- } while (isWhiteSpace(code));
8415
- return token = 15;
8416
- }
8417
- if (isLineBreak(code)) {
8418
- pos++;
8419
- value += String.fromCharCode(code);
8420
- if (code === 13 && text.charCodeAt(pos) === 10) {
8421
- pos++;
8422
- value += "\n";
8423
- }
8424
- lineNumber++;
8425
- tokenLineStartOffset = pos;
8426
- return token = 14;
8427
- }
8428
- switch (code) {
8429
- // tokens: []{}:,
8430
- case 123:
8431
- pos++;
8432
- return token = 1;
8433
- case 125:
8434
- pos++;
8435
- return token = 2;
8436
- case 91:
8437
- pos++;
8438
- return token = 3;
8439
- case 93:
8440
- pos++;
8441
- return token = 4;
8442
- case 58:
8443
- pos++;
8444
- return token = 6;
8445
- case 44:
8446
- pos++;
8447
- return token = 5;
8448
- // strings
8449
- case 34:
8450
- pos++;
8451
- value = scanString();
8452
- return token = 10;
8453
- // comments
8454
- case 47:
8455
- const start = pos - 1;
8456
- if (text.charCodeAt(pos + 1) === 47) {
8457
- pos += 2;
8458
- while (pos < len) {
8459
- if (isLineBreak(text.charCodeAt(pos))) {
8460
- break;
8461
- }
8462
- pos++;
8463
- }
8464
- value = text.substring(start, pos);
8465
- return token = 12;
8466
- }
8467
- if (text.charCodeAt(pos + 1) === 42) {
8468
- pos += 2;
8469
- const safeLength = len - 1;
8470
- let commentClosed = false;
8471
- while (pos < safeLength) {
8472
- const ch = text.charCodeAt(pos);
8473
- if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
8474
- pos += 2;
8475
- commentClosed = true;
8476
- break;
8477
- }
8478
- pos++;
8479
- if (isLineBreak(ch)) {
8480
- if (ch === 13 && text.charCodeAt(pos) === 10) {
8481
- pos++;
8482
- }
8483
- lineNumber++;
8484
- tokenLineStartOffset = pos;
8485
- }
8486
- }
8487
- if (!commentClosed) {
8488
- pos++;
8489
- scanError = 1;
8490
- }
8491
- value = text.substring(start, pos);
8492
- return token = 13;
8493
- }
8494
- value += String.fromCharCode(code);
8495
- pos++;
8496
- return token = 16;
8497
- // numbers
8498
- case 45:
8499
- value += String.fromCharCode(code);
8500
- pos++;
8501
- if (pos === len || !isDigit(text.charCodeAt(pos))) {
8502
- return token = 16;
8503
- }
8504
- // found a minus, followed by a number so
8505
- // we fall through to proceed with scanning
8506
- // numbers
8507
- case 48:
8508
- case 49:
8509
- case 50:
8510
- case 51:
8511
- case 52:
8512
- case 53:
8513
- case 54:
8514
- case 55:
8515
- case 56:
8516
- case 57:
8517
- value += scanNumber();
8518
- return token = 11;
8519
- // literals and unknown symbols
8520
- default:
8521
- while (pos < len && isUnknownContentCharacter(code)) {
8522
- pos++;
8523
- code = text.charCodeAt(pos);
8524
- }
8525
- if (tokenOffset !== pos) {
8526
- value = text.substring(tokenOffset, pos);
8527
- switch (value) {
8528
- case "true":
8529
- return token = 8;
8530
- case "false":
8531
- return token = 9;
8532
- case "null":
8533
- return token = 7;
8534
- }
8535
- return token = 16;
8536
- }
8537
- value += String.fromCharCode(code);
8538
- pos++;
8539
- return token = 16;
8540
- }
8541
- }
8542
- __name(scanNext, "scanNext");
8543
- function isUnknownContentCharacter(code) {
8544
- if (isWhiteSpace(code) || isLineBreak(code)) {
8545
- return false;
8546
- }
8547
- switch (code) {
8548
- case 125:
8549
- case 93:
8550
- case 123:
8551
- case 91:
8552
- case 34:
8553
- case 58:
8554
- case 44:
8555
- case 47:
8556
- return false;
8557
- }
8558
- return true;
8559
- }
8560
- __name(isUnknownContentCharacter, "isUnknownContentCharacter");
8561
- function scanNextNonTrivia() {
8562
- let result;
8563
- do {
8564
- result = scanNext();
8565
- } while (result >= 12 && result <= 15);
8566
- return result;
8567
- }
8568
- __name(scanNextNonTrivia, "scanNextNonTrivia");
8569
- return {
8570
- setPosition,
8571
- getPosition: /* @__PURE__ */ __name(() => pos, "getPosition"),
8572
- scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
8573
- getToken: /* @__PURE__ */ __name(() => token, "getToken"),
8574
- getTokenValue: /* @__PURE__ */ __name(() => value, "getTokenValue"),
8575
- getTokenOffset: /* @__PURE__ */ __name(() => tokenOffset, "getTokenOffset"),
8576
- getTokenLength: /* @__PURE__ */ __name(() => pos - tokenOffset, "getTokenLength"),
8577
- getTokenStartLine: /* @__PURE__ */ __name(() => lineStartOffset, "getTokenStartLine"),
8578
- getTokenStartCharacter: /* @__PURE__ */ __name(() => tokenOffset - prevTokenLineStartOffset, "getTokenStartCharacter"),
8579
- getTokenError: /* @__PURE__ */ __name(() => scanError, "getTokenError")
8580
- };
8581
- }
8582
- __name(createScanner, "createScanner");
8583
- function isWhiteSpace(ch) {
8584
- return ch === 32 || ch === 9;
8585
- }
8586
- __name(isWhiteSpace, "isWhiteSpace");
8587
- function isLineBreak(ch) {
8588
- return ch === 10 || ch === 13;
8589
- }
8590
- __name(isLineBreak, "isLineBreak");
8591
- function isDigit(ch) {
8592
- return ch >= 48 && ch <= 57;
8593
- }
8594
- __name(isDigit, "isDigit");
8595
- var CharacterCodes;
8596
- (function(CharacterCodes2) {
8597
- CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
8598
- CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
8599
- CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
8600
- CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
8601
- CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
8602
- CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
8603
- CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
8604
- CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
8605
- CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
8606
- CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
8607
- CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
8608
- CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
8609
- CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
8610
- CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
8611
- CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
8612
- CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
8613
- CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
8614
- CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
8615
- CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
8616
- CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
8617
- CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
8618
- CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
8619
- CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
8620
- CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
8621
- CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
8622
- CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
8623
- CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
8624
- CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
8625
- CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
8626
- CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
8627
- CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
8628
- CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
8629
- CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
8630
- CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
8631
- CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
8632
- CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
8633
- CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
8634
- CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
8635
- CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
8636
- CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
8637
- CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
8638
- CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
8639
- CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
8640
- CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
8641
- CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
8642
- CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
8643
- CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
8644
- CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
8645
- CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
8646
- CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
8647
- CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
8648
- CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
8649
- CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
8650
- CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
8651
- CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
8652
- CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
8653
- CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
8654
- CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
8655
- CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
8656
- CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
8657
- CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
8658
- CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
8659
- CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
8660
- CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
8661
- CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
8662
- CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
8663
- CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
8664
- CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
8665
- CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
8666
- CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
8667
- CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
8668
- CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
8669
- CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
8670
- CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
8671
- CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
8672
- CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
8673
- CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
8674
- CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
8675
- CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
8676
- CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
8677
- })(CharacterCodes || (CharacterCodes = {}));
8678
-
8679
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js
8680
- init_esm_shims();
8681
-
8682
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/parser.js
8683
- init_esm_shims();
8684
- var ParseOptions;
8685
- (function(ParseOptions2) {
8686
- ParseOptions2.DEFAULT = {
8687
- allowTrailingComma: false
8688
- };
8689
- })(ParseOptions || (ParseOptions = {}));
8690
- function parse(text, errors = [], options = ParseOptions.DEFAULT) {
8691
- let currentProperty = null;
8692
- let currentParent = [];
8693
- const previousParents = [];
8694
- function onValue(value) {
8695
- if (Array.isArray(currentParent)) {
8696
- currentParent.push(value);
8697
- } else if (currentProperty !== null) {
8698
- currentParent[currentProperty] = value;
8699
- }
8700
- }
8701
- __name(onValue, "onValue");
8702
- const visitor = {
8703
- onObjectBegin: /* @__PURE__ */ __name(() => {
8704
- const object = {};
8705
- onValue(object);
8706
- previousParents.push(currentParent);
8707
- currentParent = object;
8708
- currentProperty = null;
8709
- }, "onObjectBegin"),
8710
- onObjectProperty: /* @__PURE__ */ __name((name) => {
8711
- currentProperty = name;
8712
- }, "onObjectProperty"),
8713
- onObjectEnd: /* @__PURE__ */ __name(() => {
8714
- currentParent = previousParents.pop();
8715
- }, "onObjectEnd"),
8716
- onArrayBegin: /* @__PURE__ */ __name(() => {
8717
- const array = [];
8718
- onValue(array);
8719
- previousParents.push(currentParent);
8720
- currentParent = array;
8721
- currentProperty = null;
8722
- }, "onArrayBegin"),
8723
- onArrayEnd: /* @__PURE__ */ __name(() => {
8724
- currentParent = previousParents.pop();
8725
- }, "onArrayEnd"),
8726
- onLiteralValue: onValue,
8727
- onError: /* @__PURE__ */ __name((error, offset, length) => {
8728
- errors.push({
8729
- error,
8730
- offset,
8731
- length
8732
- });
8733
- }, "onError")
8734
- };
8735
- visit(text, visitor, options);
8736
- return currentParent[0];
8737
- }
8738
- __name(parse, "parse");
8739
- function visit(text, visitor, options = ParseOptions.DEFAULT) {
8740
- const _scanner = createScanner(text, false);
8741
- const _jsonPath = [];
8742
- function toNoArgVisit(visitFunction) {
8743
- return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
8744
- }
8745
- __name(toNoArgVisit, "toNoArgVisit");
8746
- function toNoArgVisitWithPath(visitFunction) {
8747
- return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
8748
- }
8749
- __name(toNoArgVisitWithPath, "toNoArgVisitWithPath");
8750
- function toOneArgVisit(visitFunction) {
8751
- return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
8752
- }
8753
- __name(toOneArgVisit, "toOneArgVisit");
8754
- function toOneArgVisitWithPath(visitFunction) {
8755
- return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
8756
- }
8757
- __name(toOneArgVisitWithPath, "toOneArgVisitWithPath");
8758
- 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);
8759
- const disallowComments = options && options.disallowComments;
8760
- const allowTrailingComma = options && options.allowTrailingComma;
8761
- function scanNext() {
8762
- while (true) {
8763
- const token = _scanner.scan();
8764
- switch (_scanner.getTokenError()) {
8765
- case 4:
8766
- handleError(
8767
- 14
8768
- /* ParseErrorCode.InvalidUnicode */
8769
- );
8770
- break;
8771
- case 5:
8772
- handleError(
8773
- 15
8774
- /* ParseErrorCode.InvalidEscapeCharacter */
8775
- );
8776
- break;
8777
- case 3:
8778
- handleError(
8779
- 13
8780
- /* ParseErrorCode.UnexpectedEndOfNumber */
8781
- );
8782
- break;
8783
- case 1:
8784
- if (!disallowComments) {
8785
- handleError(
8786
- 11
8787
- /* ParseErrorCode.UnexpectedEndOfComment */
8788
- );
8789
- }
8790
- break;
8791
- case 2:
8792
- handleError(
8793
- 12
8794
- /* ParseErrorCode.UnexpectedEndOfString */
8795
- );
8796
- break;
8797
- case 6:
8798
- handleError(
8799
- 16
8800
- /* ParseErrorCode.InvalidCharacter */
8801
- );
8802
- break;
8803
- }
8804
- switch (token) {
8805
- case 12:
8806
- case 13:
8807
- if (disallowComments) {
8808
- handleError(
8809
- 10
8810
- /* ParseErrorCode.InvalidCommentToken */
8811
- );
8812
- } else {
8813
- onComment();
8814
- }
8815
- break;
8816
- case 16:
8817
- handleError(
8818
- 1
8819
- /* ParseErrorCode.InvalidSymbol */
8820
- );
8821
- break;
8822
- case 15:
8823
- case 14:
8824
- break;
8825
- default:
8826
- return token;
8827
- }
8828
- }
8829
- }
8830
- __name(scanNext, "scanNext");
8831
- function handleError(error, skipUntilAfter = [], skipUntil = []) {
8832
- onError(error);
8833
- if (skipUntilAfter.length + skipUntil.length > 0) {
8834
- let token = _scanner.getToken();
8835
- while (token !== 17) {
8836
- if (skipUntilAfter.indexOf(token) !== -1) {
8837
- scanNext();
8838
- break;
8839
- } else if (skipUntil.indexOf(token) !== -1) {
8840
- break;
8841
- }
8842
- token = scanNext();
8843
- }
8844
- }
8845
- }
8846
- __name(handleError, "handleError");
8847
- function parseString(isValue) {
8848
- const value = _scanner.getTokenValue();
8849
- if (isValue) {
8850
- onLiteralValue(value);
8851
- } else {
8852
- onObjectProperty(value);
8853
- _jsonPath.push(value);
8854
- }
8855
- scanNext();
8856
- return true;
8857
- }
8858
- __name(parseString, "parseString");
8859
- function parseLiteral() {
8860
- switch (_scanner.getToken()) {
8861
- case 11:
8862
- const tokenValue = _scanner.getTokenValue();
8863
- let value = Number(tokenValue);
8864
- if (isNaN(value)) {
8865
- handleError(
8866
- 2
8867
- /* ParseErrorCode.InvalidNumberFormat */
8868
- );
8869
- value = 0;
8870
- }
8871
- onLiteralValue(value);
8872
- break;
8873
- case 7:
8874
- onLiteralValue(null);
8875
- break;
8876
- case 8:
8877
- onLiteralValue(true);
8878
- break;
8879
- case 9:
8880
- onLiteralValue(false);
8881
- break;
8882
- default:
8883
- return false;
8884
- }
8885
- scanNext();
8886
- return true;
8887
- }
8888
- __name(parseLiteral, "parseLiteral");
8889
- function parseProperty() {
8890
- if (_scanner.getToken() !== 10) {
8891
- handleError(3, [], [
8892
- 2,
8893
- 5
8894
- /* SyntaxKind.CommaToken */
8895
- ]);
8896
- return false;
8897
- }
8898
- parseString(false);
8899
- if (_scanner.getToken() === 6) {
8900
- onSeparator(":");
8901
- scanNext();
8902
- if (!parseValue()) {
8903
- handleError(4, [], [
8904
- 2,
8905
- 5
8906
- /* SyntaxKind.CommaToken */
8907
- ]);
8908
- }
8909
- } else {
8910
- handleError(5, [], [
8911
- 2,
8912
- 5
8913
- /* SyntaxKind.CommaToken */
8914
- ]);
8915
- }
8916
- _jsonPath.pop();
8917
- return true;
8918
- }
8919
- __name(parseProperty, "parseProperty");
8920
- function parseObject() {
8921
- onObjectBegin();
8922
- scanNext();
8923
- let needsComma = false;
8924
- while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
8925
- if (_scanner.getToken() === 5) {
8926
- if (!needsComma) {
8927
- handleError(4, [], []);
8928
- }
8929
- onSeparator(",");
8930
- scanNext();
8931
- if (_scanner.getToken() === 2 && allowTrailingComma) {
8932
- break;
8933
- }
8934
- } else if (needsComma) {
8935
- handleError(6, [], []);
8936
- }
8937
- if (!parseProperty()) {
8938
- handleError(4, [], [
8939
- 2,
8940
- 5
8941
- /* SyntaxKind.CommaToken */
8942
- ]);
8943
- }
8944
- needsComma = true;
8945
- }
8946
- onObjectEnd();
8947
- if (_scanner.getToken() !== 2) {
8948
- handleError(7, [
8949
- 2
8950
- /* SyntaxKind.CloseBraceToken */
8951
- ], []);
8952
- } else {
8953
- scanNext();
8954
- }
8955
- return true;
8956
- }
8957
- __name(parseObject, "parseObject");
8958
- function parseArray() {
8959
- onArrayBegin();
8960
- scanNext();
8961
- let isFirstElement = true;
8962
- let needsComma = false;
8963
- while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
8964
- if (_scanner.getToken() === 5) {
8965
- if (!needsComma) {
8966
- handleError(4, [], []);
8967
- }
8968
- onSeparator(",");
8969
- scanNext();
8970
- if (_scanner.getToken() === 4 && allowTrailingComma) {
8971
- break;
8972
- }
8973
- } else if (needsComma) {
8974
- handleError(6, [], []);
8975
- }
8976
- if (isFirstElement) {
8977
- _jsonPath.push(0);
8978
- isFirstElement = false;
8979
- } else {
8980
- _jsonPath[_jsonPath.length - 1]++;
8981
- }
8982
- if (!parseValue()) {
8983
- handleError(4, [], [
8984
- 4,
8985
- 5
8986
- /* SyntaxKind.CommaToken */
8987
- ]);
8988
- }
8989
- needsComma = true;
8990
- }
8991
- onArrayEnd();
8992
- if (!isFirstElement) {
8993
- _jsonPath.pop();
8994
- }
8995
- if (_scanner.getToken() !== 4) {
8996
- handleError(8, [
8997
- 4
8998
- /* SyntaxKind.CloseBracketToken */
8999
- ], []);
9000
- } else {
9001
- scanNext();
9002
- }
9003
- return true;
9004
- }
9005
- __name(parseArray, "parseArray");
9006
- function parseValue() {
9007
- switch (_scanner.getToken()) {
9008
- case 3:
9009
- return parseArray();
9010
- case 1:
9011
- return parseObject();
9012
- case 10:
9013
- return parseString(true);
9014
- default:
9015
- return parseLiteral();
9016
- }
9017
- }
9018
- __name(parseValue, "parseValue");
9019
- scanNext();
9020
- if (_scanner.getToken() === 17) {
9021
- if (options.allowEmptyContent) {
9022
- return true;
9023
- }
9024
- handleError(4, [], []);
9025
- return false;
9026
- }
9027
- if (!parseValue()) {
9028
- handleError(4, [], []);
9029
- return false;
9030
- }
9031
- if (_scanner.getToken() !== 17) {
9032
- handleError(9, [], []);
9033
- }
9034
- return true;
9035
- }
9036
- __name(visit, "visit");
9037
-
9038
- // ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js
9039
- var ScanError;
9040
- (function(ScanError2) {
9041
- ScanError2[ScanError2["None"] = 0] = "None";
9042
- ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
9043
- ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
9044
- ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
9045
- ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
9046
- ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
9047
- ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
9048
- })(ScanError || (ScanError = {}));
9049
- var SyntaxKind;
9050
- (function(SyntaxKind2) {
9051
- SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
9052
- SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
9053
- SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
9054
- SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
9055
- SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
9056
- SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
9057
- SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
9058
- SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
9059
- SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
9060
- SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
9061
- SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
9062
- SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
9063
- SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
9064
- SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
9065
- SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
9066
- SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
9067
- SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
9068
- })(SyntaxKind || (SyntaxKind = {}));
9069
- var parse2 = parse;
9070
- var ParseErrorCode;
9071
- (function(ParseErrorCode2) {
9072
- ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
9073
- ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
9074
- ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
9075
- ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
9076
- ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
9077
- ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
9078
- ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
9079
- ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
9080
- ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
9081
- ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
9082
- ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
9083
- ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
9084
- ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
9085
- ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
9086
- ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
9087
- ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
9088
- })(ParseErrorCode || (ParseErrorCode = {}));
9089
- function printParseErrorCode(code) {
9090
- switch (code) {
9091
- case 1:
9092
- return "InvalidSymbol";
9093
- case 2:
9094
- return "InvalidNumberFormat";
9095
- case 3:
9096
- return "PropertyNameExpected";
9097
- case 4:
9098
- return "ValueExpected";
9099
- case 5:
9100
- return "ColonExpected";
9101
- case 6:
9102
- return "CommaExpected";
9103
- case 7:
9104
- return "CloseBraceExpected";
9105
- case 8:
9106
- return "CloseBracketExpected";
9107
- case 9:
9108
- return "EndOfFileExpected";
9109
- case 10:
9110
- return "InvalidCommentToken";
9111
- case 11:
9112
- return "UnexpectedEndOfComment";
9113
- case 12:
9114
- return "UnexpectedEndOfString";
9115
- case 13:
9116
- return "UnexpectedEndOfNumber";
9117
- case 14:
9118
- return "InvalidUnicode";
9119
- case 15:
9120
- return "InvalidEscapeCharacter";
9121
- case 16:
9122
- return "InvalidCharacter";
9123
- }
9124
- return "<unknown ParseErrorCode>";
9125
- }
9126
- __name(printParseErrorCode, "printParseErrorCode");
9127
-
9128
- // ../json/src/storm-json.ts
9129
- import { Buffer as Buffer2 } from "node:buffer";
9130
-
9131
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.js
9132
- init_esm_shims();
9133
-
9134
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.js
9135
- init_esm_shims();
9136
-
9137
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.js
9138
- init_esm_shims();
9139
-
9140
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.js
9141
- init_esm_shims();
9142
- var DoubleIndexedKV = class {
9143
- static {
9144
- __name(this, "DoubleIndexedKV");
9145
- }
9146
- constructor() {
9147
- this.keyToValue = /* @__PURE__ */ new Map();
9148
- this.valueToKey = /* @__PURE__ */ new Map();
9149
- }
9150
- set(key, value) {
9151
- this.keyToValue.set(key, value);
9152
- this.valueToKey.set(value, key);
9153
- }
9154
- getByKey(key) {
9155
- return this.keyToValue.get(key);
9156
- }
9157
- getByValue(value) {
9158
- return this.valueToKey.get(value);
9159
- }
9160
- clear() {
9161
- this.keyToValue.clear();
9162
- this.valueToKey.clear();
9163
- }
9164
- };
9165
-
9166
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.js
9167
- var Registry = class {
9168
- static {
9169
- __name(this, "Registry");
9170
- }
9171
- constructor(generateIdentifier) {
9172
- this.generateIdentifier = generateIdentifier;
9173
- this.kv = new DoubleIndexedKV();
9174
- }
9175
- register(value, identifier) {
9176
- if (this.kv.getByValue(value)) {
9177
- return;
9178
- }
9179
- if (!identifier) {
9180
- identifier = this.generateIdentifier(value);
9181
- }
9182
- this.kv.set(identifier, value);
9183
- }
9184
- clear() {
9185
- this.kv.clear();
9186
- }
9187
- getIdentifier(value) {
9188
- return this.kv.getByValue(value);
9189
- }
9190
- getValue(identifier) {
9191
- return this.kv.getByKey(identifier);
9192
- }
9193
- };
9194
-
9195
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.js
9196
- var ClassRegistry = class extends Registry {
9197
- static {
9198
- __name(this, "ClassRegistry");
9199
- }
9200
- constructor() {
9201
- super((c) => c.name);
9202
- this.classToAllowedProps = /* @__PURE__ */ new Map();
9203
- }
9204
- register(value, options) {
9205
- if (typeof options === "object") {
9206
- if (options.allowProps) {
9207
- this.classToAllowedProps.set(value, options.allowProps);
9208
- }
9209
- super.register(value, options.identifier);
9210
- } else {
9211
- super.register(value, options);
9212
- }
9213
- }
9214
- getAllowedProps(value) {
9215
- return this.classToAllowedProps.get(value);
9216
- }
9217
- };
9218
-
9219
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.js
9220
- init_esm_shims();
9221
-
9222
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.js
9223
- init_esm_shims();
9224
- function valuesOfObj(record) {
9225
- if ("values" in Object) {
9226
- return Object.values(record);
9227
- }
9228
- const values = [];
9229
- for (const key in record) {
9230
- if (record.hasOwnProperty(key)) {
9231
- values.push(record[key]);
9232
- }
9233
- }
9234
- return values;
9235
- }
9236
- __name(valuesOfObj, "valuesOfObj");
9237
- function find(record, predicate) {
9238
- const values = valuesOfObj(record);
9239
- if ("find" in values) {
9240
- return values.find(predicate);
9241
- }
9242
- const valuesNotNever = values;
9243
- for (let i = 0; i < valuesNotNever.length; i++) {
9244
- const value = valuesNotNever[i];
9245
- if (predicate(value)) {
9246
- return value;
9247
- }
9248
- }
9249
- return void 0;
9250
- }
9251
- __name(find, "find");
9252
- function forEach(record, run) {
9253
- Object.entries(record).forEach(([key, value]) => run(value, key));
9254
- }
9255
- __name(forEach, "forEach");
9256
- function includes2(arr, value) {
9257
- return arr.indexOf(value) !== -1;
9258
- }
9259
- __name(includes2, "includes");
9260
- function findArr(record, predicate) {
9261
- for (let i = 0; i < record.length; i++) {
9262
- const value = record[i];
9263
- if (predicate(value)) {
9264
- return value;
9265
- }
9266
- }
9267
- return void 0;
9268
- }
9269
- __name(findArr, "findArr");
9270
-
9271
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.js
9272
- var CustomTransformerRegistry = class {
9273
- static {
9274
- __name(this, "CustomTransformerRegistry");
9275
- }
9276
- constructor() {
9277
- this.transfomers = {};
9278
- }
9279
- register(transformer) {
9280
- this.transfomers[transformer.name] = transformer;
9281
- }
9282
- findApplicable(v) {
9283
- return find(this.transfomers, (transformer) => transformer.isApplicable(v));
9284
- }
9285
- findByName(name) {
9286
- return this.transfomers[name];
9287
- }
9288
- };
9289
-
9290
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.js
9291
- init_esm_shims();
9292
-
9293
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.js
9294
- init_esm_shims();
9295
- var getType = /* @__PURE__ */ __name((payload) => Object.prototype.toString.call(payload).slice(8, -1), "getType");
9296
- var isUndefined = /* @__PURE__ */ __name((payload) => typeof payload === "undefined", "isUndefined");
9297
- var isNull = /* @__PURE__ */ __name((payload) => payload === null, "isNull");
9298
- var isPlainObject3 = /* @__PURE__ */ __name((payload) => {
9299
- if (typeof payload !== "object" || payload === null) return false;
9300
- if (payload === Object.prototype) return false;
9301
- if (Object.getPrototypeOf(payload) === null) return true;
9302
- return Object.getPrototypeOf(payload) === Object.prototype;
9303
- }, "isPlainObject");
9304
- var isEmptyObject = /* @__PURE__ */ __name((payload) => isPlainObject3(payload) && Object.keys(payload).length === 0, "isEmptyObject");
9305
- var isArray = /* @__PURE__ */ __name((payload) => Array.isArray(payload), "isArray");
9306
- var isString3 = /* @__PURE__ */ __name((payload) => typeof payload === "string", "isString");
9307
- var isNumber2 = /* @__PURE__ */ __name((payload) => typeof payload === "number" && !isNaN(payload), "isNumber");
9308
- var isBoolean2 = /* @__PURE__ */ __name((payload) => typeof payload === "boolean", "isBoolean");
9309
- var isRegExp = /* @__PURE__ */ __name((payload) => payload instanceof RegExp, "isRegExp");
9310
- var isMap = /* @__PURE__ */ __name((payload) => payload instanceof Map, "isMap");
9311
- var isSet = /* @__PURE__ */ __name((payload) => payload instanceof Set, "isSet");
9312
- var isSymbol = /* @__PURE__ */ __name((payload) => getType(payload) === "Symbol", "isSymbol");
9313
- var isDate2 = /* @__PURE__ */ __name((payload) => payload instanceof Date && !isNaN(payload.valueOf()), "isDate");
9314
- var isError = /* @__PURE__ */ __name((payload) => payload instanceof Error, "isError");
9315
- var isNaNValue = /* @__PURE__ */ __name((payload) => typeof payload === "number" && isNaN(payload), "isNaNValue");
9316
- var isPrimitive = /* @__PURE__ */ __name((payload) => isBoolean2(payload) || isNull(payload) || isUndefined(payload) || isNumber2(payload) || isString3(payload) || isSymbol(payload), "isPrimitive");
9317
- var isBigint = /* @__PURE__ */ __name((payload) => typeof payload === "bigint", "isBigint");
9318
- var isInfinite = /* @__PURE__ */ __name((payload) => payload === Infinity || payload === -Infinity, "isInfinite");
9319
- var isTypedArray = /* @__PURE__ */ __name((payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView), "isTypedArray");
9320
- var isURL = /* @__PURE__ */ __name((payload) => payload instanceof URL, "isURL");
9321
-
9322
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.js
9323
- init_esm_shims();
9324
- var escapeKey = /* @__PURE__ */ __name((key) => key.replace(/\./g, "\\."), "escapeKey");
9325
- var stringifyPath = /* @__PURE__ */ __name((path6) => path6.map(String).map(escapeKey).join("."), "stringifyPath");
9326
- var parsePath = /* @__PURE__ */ __name((string) => {
9327
- const result = [];
9328
- let segment = "";
9329
- for (let i = 0; i < string.length; i++) {
9330
- let char = string.charAt(i);
9331
- const isEscapedDot = char === "\\" && string.charAt(i + 1) === ".";
9332
- if (isEscapedDot) {
9333
- segment += ".";
9334
- i++;
9335
- continue;
9336
- }
9337
- const isEndOfSegment = char === ".";
9338
- if (isEndOfSegment) {
9339
- result.push(segment);
9340
- segment = "";
9341
- continue;
9342
- }
9343
- segment += char;
9344
- }
9345
- const lastSegment = segment;
9346
- result.push(lastSegment);
9347
- return result;
9348
- }, "parsePath");
9349
-
9350
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.js
9351
- init_esm_shims();
9352
- function simpleTransformation(isApplicable, annotation, transform, untransform) {
9353
- return {
9354
- isApplicable,
9355
- annotation,
9356
- transform,
9357
- untransform
9358
- };
9359
- }
9360
- __name(simpleTransformation, "simpleTransformation");
9361
- var simpleRules = [
9362
- simpleTransformation(isUndefined, "undefined", () => null, () => void 0),
9363
- simpleTransformation(isBigint, "bigint", (v) => v.toString(), (v) => {
9364
- if (typeof BigInt !== "undefined") {
9365
- return BigInt(v);
9366
- }
9367
- console.error("Please add a BigInt polyfill.");
9368
- return v;
9369
- }),
9370
- simpleTransformation(isDate2, "Date", (v) => v.toISOString(), (v) => new Date(v)),
9371
- simpleTransformation(isError, "Error", (v, superJson) => {
9372
- const baseError = {
9373
- name: v.name,
9374
- message: v.message
9375
- };
9376
- superJson.allowedErrorProps.forEach((prop) => {
9377
- baseError[prop] = v[prop];
9378
- });
9379
- return baseError;
9380
- }, (v, superJson) => {
9381
- const e = new Error(v.message);
9382
- e.name = v.name;
9383
- e.stack = v.stack;
9384
- superJson.allowedErrorProps.forEach((prop) => {
9385
- e[prop] = v[prop];
9386
- });
9387
- return e;
9388
- }),
9389
- simpleTransformation(isRegExp, "regexp", (v) => "" + v, (regex) => {
9390
- const body = regex.slice(1, regex.lastIndexOf("/"));
9391
- const flags = regex.slice(regex.lastIndexOf("/") + 1);
9392
- return new RegExp(body, flags);
9393
- }),
9394
- simpleTransformation(
9395
- isSet,
9396
- "set",
9397
- // (sets only exist in es6+)
9398
- // eslint-disable-next-line es5/no-es6-methods
9399
- (v) => [
9400
- ...v.values()
9401
- ],
9402
- (v) => new Set(v)
9403
- ),
9404
- simpleTransformation(isMap, "map", (v) => [
9405
- ...v.entries()
9406
- ], (v) => new Map(v)),
9407
- simpleTransformation((v) => isNaNValue(v) || isInfinite(v), "number", (v) => {
9408
- if (isNaNValue(v)) {
9409
- return "NaN";
9410
- }
9411
- if (v > 0) {
9412
- return "Infinity";
9413
- } else {
9414
- return "-Infinity";
9415
- }
9416
- }, Number),
9417
- simpleTransformation((v) => v === 0 && 1 / v === -Infinity, "number", () => {
9418
- return "-0";
9419
- }, Number),
9420
- simpleTransformation(isURL, "URL", (v) => v.toString(), (v) => new URL(v))
9421
- ];
9422
- function compositeTransformation(isApplicable, annotation, transform, untransform) {
9423
- return {
9424
- isApplicable,
9425
- annotation,
9426
- transform,
9427
- untransform
9428
- };
9429
- }
9430
- __name(compositeTransformation, "compositeTransformation");
9431
- var symbolRule = compositeTransformation((s, superJson) => {
9432
- if (isSymbol(s)) {
9433
- const isRegistered = !!superJson.symbolRegistry.getIdentifier(s);
9434
- return isRegistered;
9435
- }
9436
- return false;
9437
- }, (s, superJson) => {
9438
- const identifier = superJson.symbolRegistry.getIdentifier(s);
9439
- return [
9440
- "symbol",
9441
- identifier
9442
- ];
9443
- }, (v) => v.description, (_, a, superJson) => {
9444
- const value = superJson.symbolRegistry.getValue(a[1]);
9445
- if (!value) {
9446
- throw new Error("Trying to deserialize unknown symbol");
9447
- }
9448
- return value;
9449
- });
9450
- var constructorToName = [
9451
- Int8Array,
9452
- Uint8Array,
9453
- Int16Array,
9454
- Uint16Array,
9455
- Int32Array,
9456
- Uint32Array,
9457
- Float32Array,
9458
- Float64Array,
9459
- Uint8ClampedArray
9460
- ].reduce((obj, ctor) => {
9461
- obj[ctor.name] = ctor;
9462
- return obj;
9463
- }, {});
9464
- var typedArrayRule = compositeTransformation(isTypedArray, (v) => [
9465
- "typed-array",
9466
- v.constructor.name
9467
- ], (v) => [
9468
- ...v
9469
- ], (v, a) => {
9470
- const ctor = constructorToName[a[1]];
9471
- if (!ctor) {
9472
- throw new Error("Trying to deserialize unknown typed array");
9473
- }
9474
- return new ctor(v);
9475
- });
9476
- function isInstanceOfRegisteredClass(potentialClass, superJson) {
9477
- if (potentialClass?.constructor) {
9478
- const isRegistered = !!superJson.classRegistry.getIdentifier(potentialClass.constructor);
9479
- return isRegistered;
9480
- }
9481
- return false;
9482
- }
9483
- __name(isInstanceOfRegisteredClass, "isInstanceOfRegisteredClass");
9484
- var classRule = compositeTransformation(isInstanceOfRegisteredClass, (clazz, superJson) => {
9485
- const identifier = superJson.classRegistry.getIdentifier(clazz.constructor);
9486
- return [
9487
- "class",
9488
- identifier
9489
- ];
9490
- }, (clazz, superJson) => {
9491
- const allowedProps = superJson.classRegistry.getAllowedProps(clazz.constructor);
9492
- if (!allowedProps) {
9493
- return {
9494
- ...clazz
9495
- };
9496
- }
9497
- const result = {};
9498
- allowedProps.forEach((prop) => {
9499
- result[prop] = clazz[prop];
9500
- });
9501
- return result;
9502
- }, (v, a, superJson) => {
9503
- const clazz = superJson.classRegistry.getValue(a[1]);
9504
- if (!clazz) {
9505
- throw new Error(`Trying to deserialize unknown class '${a[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);
9506
- }
9507
- return Object.assign(Object.create(clazz.prototype), v);
9508
- });
9509
- var customRule = compositeTransformation((value, superJson) => {
9510
- return !!superJson.customTransformerRegistry.findApplicable(value);
9511
- }, (value, superJson) => {
9512
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
9513
- return [
9514
- "custom",
9515
- transformer.name
9516
- ];
9517
- }, (value, superJson) => {
9518
- const transformer = superJson.customTransformerRegistry.findApplicable(value);
9519
- return transformer.serialize(value);
9520
- }, (v, a, superJson) => {
9521
- const transformer = superJson.customTransformerRegistry.findByName(a[1]);
9522
- if (!transformer) {
9523
- throw new Error("Trying to deserialize unknown custom value");
9524
- }
9525
- return transformer.deserialize(v);
9526
- });
9527
- var compositeRules = [
9528
- classRule,
9529
- symbolRule,
9530
- customRule,
9531
- typedArrayRule
9532
- ];
9533
- var transformValue = /* @__PURE__ */ __name((value, superJson) => {
9534
- const applicableCompositeRule = findArr(compositeRules, (rule) => rule.isApplicable(value, superJson));
9535
- if (applicableCompositeRule) {
9536
- return {
9537
- value: applicableCompositeRule.transform(value, superJson),
9538
- type: applicableCompositeRule.annotation(value, superJson)
9539
- };
9540
- }
9541
- const applicableSimpleRule = findArr(simpleRules, (rule) => rule.isApplicable(value, superJson));
9542
- if (applicableSimpleRule) {
9543
- return {
9544
- value: applicableSimpleRule.transform(value, superJson),
9545
- type: applicableSimpleRule.annotation
9546
- };
9547
- }
9548
- return void 0;
9549
- }, "transformValue");
9550
- var simpleRulesByAnnotation = {};
9551
- simpleRules.forEach((rule) => {
9552
- simpleRulesByAnnotation[rule.annotation] = rule;
9553
- });
9554
- var untransformValue = /* @__PURE__ */ __name((json, type, superJson) => {
9555
- if (isArray(type)) {
9556
- switch (type[0]) {
9557
- case "symbol":
9558
- return symbolRule.untransform(json, type, superJson);
9559
- case "class":
9560
- return classRule.untransform(json, type, superJson);
9561
- case "custom":
9562
- return customRule.untransform(json, type, superJson);
9563
- case "typed-array":
9564
- return typedArrayRule.untransform(json, type, superJson);
9565
- default:
9566
- throw new Error("Unknown transformation: " + type);
9567
- }
9568
- } else {
9569
- const transformation = simpleRulesByAnnotation[type];
9570
- if (!transformation) {
9571
- throw new Error("Unknown transformation: " + type);
9572
- }
9573
- return transformation.untransform(json, superJson);
9574
- }
9575
- }, "untransformValue");
9576
-
9577
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.js
9578
- init_esm_shims();
9579
- var getNthKey = /* @__PURE__ */ __name((value, n) => {
9580
- if (n > value.size) throw new Error("index out of bounds");
9581
- const keys2 = value.keys();
9582
- while (n > 0) {
9583
- keys2.next();
9584
- n--;
9585
- }
9586
- return keys2.next().value;
9587
- }, "getNthKey");
9588
- function validatePath(path6) {
9589
- if (includes2(path6, "__proto__")) {
9590
- throw new Error("__proto__ is not allowed as a property");
9591
- }
9592
- if (includes2(path6, "prototype")) {
9593
- throw new Error("prototype is not allowed as a property");
9594
- }
9595
- if (includes2(path6, "constructor")) {
9596
- throw new Error("constructor is not allowed as a property");
9597
- }
9598
- }
9599
- __name(validatePath, "validatePath");
9600
- var getDeep = /* @__PURE__ */ __name((object, path6) => {
9601
- validatePath(path6);
9602
- for (let i = 0; i < path6.length; i++) {
9603
- const key = path6[i];
9604
- if (isSet(object)) {
9605
- object = getNthKey(object, +key);
9606
- } else if (isMap(object)) {
9607
- const row = +key;
9608
- const type = +path6[++i] === 0 ? "key" : "value";
9609
- const keyOfRow = getNthKey(object, row);
9610
- switch (type) {
9611
- case "key":
9612
- object = keyOfRow;
9613
- break;
9614
- case "value":
9615
- object = object.get(keyOfRow);
9616
- break;
9617
- }
9618
- } else {
9619
- object = object[key];
9620
- }
9621
- }
9622
- return object;
9623
- }, "getDeep");
9624
- var setDeep = /* @__PURE__ */ __name((object, path6, mapper) => {
9625
- validatePath(path6);
9626
- if (path6.length === 0) {
9627
- return mapper(object);
9628
- }
9629
- let parent = object;
9630
- for (let i = 0; i < path6.length - 1; i++) {
9631
- const key = path6[i];
9632
- if (isArray(parent)) {
9633
- const index = +key;
9634
- parent = parent[index];
9635
- } else if (isPlainObject3(parent)) {
9636
- parent = parent[key];
9637
- } else if (isSet(parent)) {
9638
- const row = +key;
9639
- parent = getNthKey(parent, row);
9640
- } else if (isMap(parent)) {
9641
- const isEnd = i === path6.length - 2;
9642
- if (isEnd) {
9643
- break;
9644
- }
9645
- const row = +key;
9646
- const type = +path6[++i] === 0 ? "key" : "value";
9647
- const keyOfRow = getNthKey(parent, row);
9648
- switch (type) {
9649
- case "key":
9650
- parent = keyOfRow;
9651
- break;
9652
- case "value":
9653
- parent = parent.get(keyOfRow);
9654
- break;
9655
- }
9656
- }
9657
- }
9658
- const lastKey = path6[path6.length - 1];
9659
- if (isArray(parent)) {
9660
- parent[+lastKey] = mapper(parent[+lastKey]);
9661
- } else if (isPlainObject3(parent)) {
9662
- parent[lastKey] = mapper(parent[lastKey]);
9663
- }
9664
- if (isSet(parent)) {
9665
- const oldValue = getNthKey(parent, +lastKey);
9666
- const newValue = mapper(oldValue);
9667
- if (oldValue !== newValue) {
9668
- parent.delete(oldValue);
9669
- parent.add(newValue);
9670
- }
9671
- }
9672
- if (isMap(parent)) {
9673
- const row = +path6[path6.length - 2];
9674
- const keyToRow = getNthKey(parent, row);
9675
- const type = +lastKey === 0 ? "key" : "value";
9676
- switch (type) {
9677
- case "key": {
9678
- const newKey = mapper(keyToRow);
9679
- parent.set(newKey, parent.get(keyToRow));
9680
- if (newKey !== keyToRow) {
9681
- parent.delete(keyToRow);
9682
- }
9683
- break;
9684
- }
9685
- case "value": {
9686
- parent.set(keyToRow, mapper(parent.get(keyToRow)));
9687
- break;
9688
- }
9689
- }
9690
- }
9691
- return object;
9692
- }, "setDeep");
9693
-
9694
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.js
9695
- function traverse(tree, walker2, origin = []) {
9696
- if (!tree) {
9697
- return;
9698
- }
9699
- if (!isArray(tree)) {
9700
- forEach(tree, (subtree, key) => traverse(subtree, walker2, [
9701
- ...origin,
9702
- ...parsePath(key)
9703
- ]));
9704
- return;
9705
- }
9706
- const [nodeValue, children] = tree;
9707
- if (children) {
9708
- forEach(children, (child, key) => {
9709
- traverse(child, walker2, [
9710
- ...origin,
9711
- ...parsePath(key)
9712
- ]);
9713
- });
9714
- }
9715
- walker2(nodeValue, origin);
9716
- }
9717
- __name(traverse, "traverse");
9718
- function applyValueAnnotations(plain, annotations, superJson) {
9719
- traverse(annotations, (type, path6) => {
9720
- plain = setDeep(plain, path6, (v) => untransformValue(v, type, superJson));
9721
- });
9722
- return plain;
9723
- }
9724
- __name(applyValueAnnotations, "applyValueAnnotations");
9725
- function applyReferentialEqualityAnnotations(plain, annotations) {
9726
- function apply2(identicalPaths, path6) {
9727
- const object = getDeep(plain, parsePath(path6));
9728
- identicalPaths.map(parsePath).forEach((identicalObjectPath) => {
9729
- plain = setDeep(plain, identicalObjectPath, () => object);
9730
- });
9731
- }
9732
- __name(apply2, "apply");
9733
- if (isArray(annotations)) {
9734
- const [root, other] = annotations;
9735
- root.forEach((identicalPath) => {
9736
- plain = setDeep(plain, parsePath(identicalPath), () => plain);
9737
- });
9738
- if (other) {
9739
- forEach(other, apply2);
9740
- }
9741
- } else {
9742
- forEach(annotations, apply2);
9743
- }
9744
- return plain;
9745
- }
9746
- __name(applyReferentialEqualityAnnotations, "applyReferentialEqualityAnnotations");
9747
- var isDeep = /* @__PURE__ */ __name((object, superJson) => isPlainObject3(object) || isArray(object) || isMap(object) || isSet(object) || isInstanceOfRegisteredClass(object, superJson), "isDeep");
9748
- function addIdentity(object, path6, identities) {
9749
- const existingSet = identities.get(object);
9750
- if (existingSet) {
9751
- existingSet.push(path6);
9752
- } else {
9753
- identities.set(object, [
9754
- path6
9755
- ]);
9756
- }
9757
- }
9758
- __name(addIdentity, "addIdentity");
9759
- function generateReferentialEqualityAnnotations(identitites, dedupe) {
9760
- const result = {};
9761
- let rootEqualityPaths = void 0;
9762
- identitites.forEach((paths) => {
9763
- if (paths.length <= 1) {
9764
- return;
9765
- }
9766
- if (!dedupe) {
9767
- paths = paths.map((path6) => path6.map(String)).sort((a, b) => a.length - b.length);
9768
- }
9769
- const [representativePath, ...identicalPaths] = paths;
9770
- if (representativePath.length === 0) {
9771
- rootEqualityPaths = identicalPaths.map(stringifyPath);
9772
- } else {
9773
- result[stringifyPath(representativePath)] = identicalPaths.map(stringifyPath);
9774
- }
9775
- });
9776
- if (rootEqualityPaths) {
9777
- if (isEmptyObject(result)) {
9778
- return [
9779
- rootEqualityPaths
9780
- ];
9781
- } else {
9782
- return [
9783
- rootEqualityPaths,
9784
- result
9785
- ];
9786
- }
9787
- } else {
9788
- return isEmptyObject(result) ? void 0 : result;
9789
- }
9790
- }
9791
- __name(generateReferentialEqualityAnnotations, "generateReferentialEqualityAnnotations");
9792
- var walker = /* @__PURE__ */ __name((object, identities, superJson, dedupe, path6 = [], objectsInThisPath = [], seenObjects = /* @__PURE__ */ new Map()) => {
9793
- const primitive = isPrimitive(object);
9794
- if (!primitive) {
9795
- addIdentity(object, path6, identities);
9796
- const seen = seenObjects.get(object);
9797
- if (seen) {
9798
- return dedupe ? {
9799
- transformedValue: null
9800
- } : seen;
9801
- }
9802
- }
9803
- if (!isDeep(object, superJson)) {
9804
- const transformed2 = transformValue(object, superJson);
9805
- const result2 = transformed2 ? {
9806
- transformedValue: transformed2.value,
9807
- annotations: [
9808
- transformed2.type
9809
- ]
9810
- } : {
9811
- transformedValue: object
9812
- };
9813
- if (!primitive) {
9814
- seenObjects.set(object, result2);
9815
- }
9816
- return result2;
9817
- }
9818
- if (includes2(objectsInThisPath, object)) {
9819
- return {
9820
- transformedValue: null
9821
- };
9822
- }
9823
- const transformationResult = transformValue(object, superJson);
9824
- const transformed = transformationResult?.value ?? object;
9825
- const transformedValue = isArray(transformed) ? [] : {};
9826
- const innerAnnotations = {};
9827
- forEach(transformed, (value, index) => {
9828
- if (index === "__proto__" || index === "constructor" || index === "prototype") {
9829
- throw new Error(`Detected property ${index}. This is a prototype pollution risk, please remove it from your object.`);
9830
- }
9831
- const recursiveResult = walker(value, identities, superJson, dedupe, [
9832
- ...path6,
9833
- index
9834
- ], [
9835
- ...objectsInThisPath,
9836
- object
9837
- ], seenObjects);
9838
- transformedValue[index] = recursiveResult.transformedValue;
9839
- if (isArray(recursiveResult.annotations)) {
9840
- innerAnnotations[index] = recursiveResult.annotations;
9841
- } else if (isPlainObject3(recursiveResult.annotations)) {
9842
- forEach(recursiveResult.annotations, (tree, key) => {
9843
- innerAnnotations[escapeKey(index) + "." + key] = tree;
9844
- });
9845
- }
9846
- });
9847
- const result = isEmptyObject(innerAnnotations) ? {
9848
- transformedValue,
9849
- annotations: !!transformationResult ? [
9850
- transformationResult.type
9851
- ] : void 0
9852
- } : {
9853
- transformedValue,
9854
- annotations: !!transformationResult ? [
9855
- transformationResult.type,
9856
- innerAnnotations
9857
- ] : innerAnnotations
9858
- };
9859
- if (!primitive) {
9860
- seenObjects.set(object, result);
9861
- }
9862
- return result;
9863
- }, "walker");
9864
-
9865
- // ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
9866
- init_esm_shims();
9867
-
9868
- // ../../node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.js
9869
- init_esm_shims();
9870
- function getType2(payload) {
9871
- return Object.prototype.toString.call(payload).slice(8, -1);
9872
- }
9873
- __name(getType2, "getType");
9874
- function isArray2(payload) {
9875
- return getType2(payload) === "Array";
9876
- }
9877
- __name(isArray2, "isArray");
9878
- function isPlainObject4(payload) {
9879
- if (getType2(payload) !== "Object") return false;
9880
- const prototype = Object.getPrototypeOf(payload);
9881
- return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
9882
- }
9883
- __name(isPlainObject4, "isPlainObject");
9884
- function isNull2(payload) {
9885
- return getType2(payload) === "Null";
9886
- }
9887
- __name(isNull2, "isNull");
9888
- function isOneOf(a, b, c, d2, e) {
9889
- return (value) => a(value) || b(value) || !!c && c(value) || !!d2 && d2(value) || !!e && e(value);
9890
- }
9891
- __name(isOneOf, "isOneOf");
9892
- function isUndefined2(payload) {
9893
- return getType2(payload) === "Undefined";
9894
- }
9895
- __name(isUndefined2, "isUndefined");
9896
- var isNullOrUndefined = isOneOf(isNull2, isUndefined2);
9897
-
9898
- // ../../node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.js
9899
- function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
9900
- const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
9901
- if (propType === "enumerable") carry[key] = newVal;
9902
- if (includeNonenumerable && propType === "nonenumerable") {
9903
- Object.defineProperty(carry, key, {
9904
- value: newVal,
9905
- enumerable: false,
9906
- writable: true,
9907
- configurable: true
9908
- });
9909
- }
9910
- }
9911
- __name(assignProp, "assignProp");
9912
- function copy(target, options = {}) {
9913
- if (isArray2(target)) {
9914
- return target.map((item) => copy(item, options));
9915
- }
9916
- if (!isPlainObject4(target)) {
9917
- return target;
9918
- }
9919
- const props = Object.getOwnPropertyNames(target);
9920
- const symbols = Object.getOwnPropertySymbols(target);
9921
- return [
9922
- ...props,
9923
- ...symbols
9924
- ].reduce((carry, key) => {
9925
- if (isArray2(options.props) && !options.props.includes(key)) {
9926
- return carry;
9927
- }
9928
- const val = target[key];
9929
- const newVal = copy(val, options);
9930
- assignProp(carry, key, newVal, target, options.nonenumerable);
9931
- return carry;
9932
- }, {});
9933
- }
9934
- __name(copy, "copy");
9935
-
9936
- // ../../node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.js
9937
- var SuperJSON = class {
9938
- static {
9939
- __name(this, "SuperJSON");
9940
- }
9941
- /**
9942
- * @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
9943
- */
9944
- constructor({ dedupe = false } = {}) {
9945
- this.classRegistry = new ClassRegistry();
9946
- this.symbolRegistry = new Registry((s) => s.description ?? "");
9947
- this.customTransformerRegistry = new CustomTransformerRegistry();
9948
- this.allowedErrorProps = [];
9949
- this.dedupe = dedupe;
9950
- }
9951
- serialize(object) {
9952
- const identities = /* @__PURE__ */ new Map();
9953
- const output = walker(object, identities, this, this.dedupe);
9954
- const res = {
9955
- json: output.transformedValue
9956
- };
9957
- if (output.annotations) {
9958
- res.meta = {
9959
- ...res.meta,
9960
- values: output.annotations
9961
- };
9962
- }
9963
- const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
9964
- if (equalityAnnotations) {
9965
- res.meta = {
9966
- ...res.meta,
9967
- referentialEqualities: equalityAnnotations
9968
- };
9969
- }
9970
- return res;
9971
- }
9972
- deserialize(payload) {
9973
- const { json, meta } = payload;
9974
- let result = copy(json);
9975
- if (meta?.values) {
9976
- result = applyValueAnnotations(result, meta.values, this);
9977
- }
9978
- if (meta?.referentialEqualities) {
9979
- result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
9980
- }
9981
- return result;
9982
- }
9983
- stringify(object) {
9984
- return JSON.stringify(this.serialize(object));
9985
- }
9986
- parse(string) {
9987
- return this.deserialize(JSON.parse(string));
9988
- }
9989
- registerClass(v, options) {
9990
- this.classRegistry.register(v, options);
9991
- }
9992
- registerSymbol(v, identifier) {
9993
- this.symbolRegistry.register(v, identifier);
9994
- }
9995
- registerCustom(transformer, name) {
9996
- this.customTransformerRegistry.register({
9997
- name,
9998
- ...transformer
9999
- });
10000
- }
10001
- allowErrorProps(...props) {
10002
- this.allowedErrorProps.push(...props);
10003
- }
10004
- };
10005
- SuperJSON.defaultInstance = new SuperJSON();
10006
- SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
10007
- SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
10008
- SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
10009
- SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
10010
- SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
10011
- SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
10012
- SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
10013
- SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
10014
- var serialize = SuperJSON.serialize;
10015
- var deserialize = SuperJSON.deserialize;
10016
- var stringify = SuperJSON.stringify;
10017
- var parse3 = SuperJSON.parse;
10018
- var registerClass = SuperJSON.registerClass;
10019
- var registerCustom = SuperJSON.registerCustom;
10020
- var registerSymbol = SuperJSON.registerSymbol;
10021
- var allowErrorProps = SuperJSON.allowErrorProps;
10022
-
10023
- // ../json/src/utils/parse.ts
10024
- init_esm_shims();
10025
-
10026
- // ../json/src/utils/strip-comments.ts
10027
- init_esm_shims();
10028
- var singleComment = Symbol("singleComment");
10029
- var multiComment = Symbol("multiComment");
10030
- function stripWithoutWhitespace() {
10031
- return "";
10032
- }
10033
- __name(stripWithoutWhitespace, "stripWithoutWhitespace");
10034
- function stripWithWhitespace(value, start, end) {
10035
- return value.slice(start, end).replace(/\S/g, " ");
10036
- }
10037
- __name(stripWithWhitespace, "stripWithWhitespace");
10038
- function isEscaped(value, quotePosition) {
10039
- let index = quotePosition - 1;
10040
- let backslashCount = 0;
10041
- while (value[index] === "\\") {
10042
- index -= 1;
10043
- backslashCount += 1;
10044
- }
10045
- return Boolean(backslashCount % 2);
10046
- }
10047
- __name(isEscaped, "isEscaped");
10048
- function stripComments2(value, { whitespace = true, trailingCommas = false } = {}) {
10049
- if (typeof value !== "string") {
10050
- throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof value}\``);
10051
- }
10052
- const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;
10053
- let isInsideString = false;
10054
- let isInsideComment = false;
10055
- let offset = 0;
10056
- let buffer = "";
10057
- let result = "";
10058
- let commaIndex = -1;
10059
- for (let index = 0; index < value.length; index++) {
10060
- const currentCharacter = value[index];
10061
- const nextCharacter = value[index + 1];
10062
- if (!isInsideComment && currentCharacter === '"') {
10063
- const escaped = isEscaped(value, index);
10064
- if (!escaped) {
10065
- isInsideString = !isInsideString;
10066
- }
10067
- }
10068
- if (isInsideString) {
10069
- continue;
10070
- }
10071
- if (!isInsideComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "//") {
10072
- buffer += value.slice(offset, index);
10073
- offset = index;
10074
- isInsideComment = singleComment;
10075
- index++;
10076
- } else if (isInsideComment === singleComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "\r\n") {
10077
- index++;
10078
- isInsideComment = false;
10079
- buffer += strip(value, offset, index);
10080
- offset = index;
10081
- } else if (isInsideComment === singleComment && currentCharacter === "\n") {
10082
- isInsideComment = false;
10083
- buffer += strip(value, offset, index);
10084
- offset = index;
10085
- } else if (!isInsideComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "/*") {
10086
- buffer += value.slice(offset, index);
10087
- offset = index;
10088
- isInsideComment = multiComment;
10089
- index++;
10090
- } else if (isInsideComment === multiComment && currentCharacter + (nextCharacter ?? EMPTY_STRING) === "*/") {
10091
- index++;
10092
- isInsideComment = false;
10093
- buffer += strip(value, offset, index + 1);
10094
- offset = index + 1;
10095
- } else if (trailingCommas && !isInsideComment) {
10096
- if (commaIndex !== -1) {
10097
- if (currentCharacter === "}" || currentCharacter === "]") {
10098
- buffer += value.slice(offset, index);
10099
- result += strip(buffer, 0, 1) + buffer.slice(1);
10100
- buffer = "";
10101
- offset = index;
10102
- commaIndex = -1;
10103
- } else if (currentCharacter !== " " && currentCharacter !== " " && currentCharacter !== "\r" && currentCharacter !== "\n") {
10104
- buffer += value.slice(offset, index);
10105
- offset = index;
10106
- commaIndex = -1;
10107
- }
10108
- } else if (currentCharacter === ",") {
10109
- result += buffer + value.slice(offset, index);
10110
- buffer = "";
10111
- offset = index;
10112
- commaIndex = index;
10113
- }
10114
- }
10115
- }
10116
- return result + buffer + (isInsideComment ? strip(value.slice(offset)) : value.slice(offset));
10117
- }
10118
- __name(stripComments2, "stripComments");
10119
-
10120
- // ../json/src/utils/parse.ts
10121
- var suspectProtoRx = /"(?:_|\\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*:/;
10122
- var suspectConstructorRx = /"(?: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*:/;
10123
- var JsonSigRx = /^\s*["[{]|^\s*-?\d{1,16}(?:\.\d{1,17})?(?:E[+-]?\d+)?\s*$/i;
10124
- function jsonParseTransform(key, value) {
10125
- if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
10126
- console.warn(`Dropping "${key}" key to prevent prototype pollution.`);
10127
- return;
10128
- }
10129
- return value;
10130
- }
10131
- __name(jsonParseTransform, "jsonParseTransform");
10132
- function parse4(value, options = {}) {
10133
- if (typeof value !== "string") {
10134
- return value;
10135
- }
10136
- let stripped = stripComments2(value);
10137
- if (stripped[0] === '"' && stripped[stripped.length - 1] === '"' && !stripped.includes("\\")) {
10138
- return stripped.slice(1, -1);
10139
- }
10140
- stripped = stripped.trim();
10141
- if (stripped.length <= 9) {
10142
- switch (stripped.toLowerCase()) {
10143
- case "true": {
10144
- return true;
10145
- }
10146
- case "false": {
10147
- return false;
10148
- }
10149
- case "undefined": {
10150
- return void 0;
10151
- }
10152
- case "null": {
10153
- return null;
10154
- }
10155
- case "nan": {
10156
- return Number.NaN;
10157
- }
10158
- case "infinity": {
10159
- return Number.POSITIVE_INFINITY;
10160
- }
10161
- case "-infinity": {
10162
- return Number.NEGATIVE_INFINITY;
10163
- }
10164
- }
10165
- }
10166
- if (!JsonSigRx.test(stripped)) {
10167
- if (options.strict) {
10168
- throw new Error("Invalid JSON");
10169
- }
10170
- return stripped;
10171
- }
10172
- try {
10173
- if (suspectProtoRx.test(stripped) || suspectConstructorRx.test(stripped)) {
10174
- if (options.strict) {
10175
- throw new Error("Possible prototype pollution");
10176
- }
10177
- return JSON.parse(stripped, jsonParseTransform);
10178
- }
10179
- return JSON.parse(stripped);
10180
- } catch (error) {
10181
- if (options.strict) {
10182
- throw error;
10183
- }
10184
- return value;
10185
- }
10186
- }
10187
- __name(parse4, "parse");
10188
-
10189
- // ../json/src/utils/parse-error.ts
10190
- init_esm_shims();
10191
-
10192
- // ../../node_modules/.pnpm/lines-and-columns@2.0.4/node_modules/lines-and-columns/build/index.mjs
10193
- init_esm_shims();
10194
- var LF = "\n";
10195
- var CR = "\r";
10196
- var LinesAndColumns = (
10197
- /** @class */
10198
- function() {
10199
- function LinesAndColumns2(string) {
10200
- this.length = string.length;
10201
- var offsets = [0];
10202
- for (var offset = 0; offset < string.length; ) {
10203
- switch (string[offset]) {
10204
- case LF:
10205
- offset += LF.length;
10206
- offsets.push(offset);
10207
- break;
10208
- case CR:
10209
- offset += CR.length;
10210
- if (string[offset] === LF) {
10211
- offset += LF.length;
10212
- }
10213
- offsets.push(offset);
10214
- break;
10215
- default:
10216
- offset++;
10217
- break;
10218
- }
10219
- }
10220
- this.offsets = offsets;
10221
- }
10222
- __name(LinesAndColumns2, "LinesAndColumns");
10223
- LinesAndColumns2.prototype.locationForIndex = function(index) {
10224
- if (index < 0 || index > this.length) {
10225
- return null;
10226
- }
10227
- var line = 0;
10228
- var offsets = this.offsets;
10229
- while (offsets[line + 1] <= index) {
10230
- line++;
10231
- }
10232
- var column = index - offsets[line];
10233
- return { line, column };
10234
- };
10235
- LinesAndColumns2.prototype.indexForLocation = function(location) {
10236
- var line = location.line, column = location.column;
10237
- if (line < 0 || line >= this.offsets.length) {
10238
- return null;
10239
- }
10240
- if (column < 0 || column > this.lengthOfLine(line)) {
10241
- return null;
10242
- }
10243
- return this.offsets[line] + column;
10244
- };
10245
- LinesAndColumns2.prototype.lengthOfLine = function(line) {
10246
- var offset = this.offsets[line];
10247
- var nextOffset = line === this.offsets.length - 1 ? this.length : this.offsets[line + 1];
10248
- return nextOffset - offset;
10249
- };
10250
- return LinesAndColumns2;
10251
- }()
10252
- );
10253
-
10254
- // ../json/src/utils/code-frames.ts
10255
- init_esm_shims();
10256
- var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
10257
- function getMarkerLines(loc, source, opts = {}) {
10258
- const startLoc = {
10259
- column: 0,
10260
- line: -1,
10261
- ...loc.start
10262
- };
10263
- const endLoc = {
10264
- ...startLoc,
10265
- ...loc.end
10266
- };
10267
- const { linesAbove = 2, linesBelow = 3 } = opts || {};
10268
- const startLine = startLoc.line;
10269
- const startColumn = startLoc.column;
10270
- const endLine = endLoc.line;
10271
- const endColumn = endLoc.column;
10272
- let start = Math.max(startLine - (linesAbove + 1), 0);
10273
- let end = Math.min(source.length, endLine + linesBelow);
10274
- if (startLine === -1) {
10275
- start = 0;
10276
- }
10277
- if (endLine === -1) {
10278
- end = source.length;
10279
- }
10280
- const lineDiff = endLine - startLine;
10281
- const markerLines = {};
10282
- if (lineDiff) {
10283
- for (let i = 0; i <= lineDiff; i++) {
10284
- const lineNumber = i + startLine;
10285
- if (!startColumn) {
10286
- markerLines[lineNumber] = true;
10287
- } else if (i === 0) {
10288
- const sourceLength = source[lineNumber - 1]?.length ?? 0;
10289
- markerLines[lineNumber] = [
10290
- startColumn,
10291
- sourceLength - startColumn + 1
10292
- ];
10293
- } else if (i === lineDiff) {
10294
- markerLines[lineNumber] = [
10295
- 0,
10296
- endColumn
10297
- ];
10298
- } else {
10299
- const sourceLength = source[lineNumber - i]?.length ?? 0;
10300
- markerLines[lineNumber] = [
10301
- 0,
10302
- sourceLength
10303
- ];
10304
- }
10305
- }
10306
- } else if (startColumn === endColumn) {
10307
- markerLines[startLine] = startColumn ? [
10308
- startColumn,
10309
- 0
10310
- ] : true;
10311
- } else {
10312
- markerLines[startLine] = [
10313
- startColumn,
10314
- endColumn - startColumn
10315
- ];
10316
- }
10317
- return {
10318
- start,
10319
- end,
10320
- markerLines
10321
- };
10322
- }
10323
- __name(getMarkerLines, "getMarkerLines");
10324
- function codeFrameColumns(rawLines, loc, opts = {}) {
10325
- const lines = rawLines.split(NEWLINE);
10326
- const { start, end, markerLines } = getMarkerLines(loc, lines, opts);
10327
- const numberMaxWidth = String(end).length;
10328
- const highlightedLines = opts.highlight ? opts.highlight(rawLines) : rawLines;
10329
- const frame = highlightedLines.split(NEWLINE).slice(start, end).map((line, index) => {
10330
- const number = start + 1 + index;
10331
- const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
10332
- const gutter = ` ${paddedNumber} | `;
10333
- const hasMarker = Boolean(markerLines[number] ?? false);
10334
- if (hasMarker) {
10335
- let markerLine = "";
10336
- if (Array.isArray(hasMarker)) {
10337
- const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
10338
- const numberOfMarkers = hasMarker[1] || 1;
10339
- markerLine = [
10340
- "\n ",
10341
- gutter.replace(/\d/g, " "),
10342
- markerSpacing,
10343
- "^".repeat(numberOfMarkers)
10344
- ].join("");
10345
- }
10346
- return [
10347
- ">",
10348
- gutter,
10349
- line,
10350
- markerLine
10351
- ].join("");
10352
- }
10353
- return ` ${gutter}${line}`;
10354
- }).join("\n");
10355
- return frame;
10356
- }
10357
- __name(codeFrameColumns, "codeFrameColumns");
10358
-
10359
- // ../json/src/utils/parse-error.ts
10360
- function formatParseError(input, parseError) {
10361
- const { error, offset, length } = parseError;
10362
- const result = new LinesAndColumns(input).locationForIndex(offset);
10363
- let line = result?.line ?? 0;
10364
- let column = result?.column ?? 0;
10365
- line++;
10366
- column++;
10367
- return `${printParseErrorCode(error)} in JSON at ${line}:${column}
10368
- ${codeFrameColumns(input, {
10369
- start: {
10370
- line,
10371
- column
10372
- },
10373
- end: {
10374
- line,
10375
- column: column + length
10376
- }
10377
- })}
10378
- `;
10379
- }
10380
- __name(formatParseError, "formatParseError");
10381
-
10382
- // ../json/src/utils/stringify.ts
10383
- init_esm_shims();
10384
-
10385
- // ../type-checks/src/is-number.ts
10386
- init_esm_shims();
10387
- var isNumber3 = /* @__PURE__ */ __name((value) => {
10388
- try {
10389
- return value instanceof Number || typeof value === "number" || Number(value) === value;
10390
- } catch {
10391
- return false;
10392
- }
10393
- }, "isNumber");
10394
-
10395
- // ../type-checks/src/is-undefined.ts
10396
- init_esm_shims();
10397
- var isUndefined3 = /* @__PURE__ */ __name((value) => {
10398
- return value === void 0;
10399
- }, "isUndefined");
10400
-
10401
- // ../json/src/utils/stringify.ts
10402
- var invalidKeyChars = [
10403
- "@",
10404
- "/",
10405
- "#",
10406
- "$",
10407
- " ",
10408
- ":",
10409
- ";",
10410
- ",",
10411
- ".",
10412
- "!",
10413
- "?",
10414
- "&",
10415
- "=",
10416
- "+",
10417
- "-",
10418
- "*",
10419
- "%",
10420
- "^",
10421
- "~",
10422
- "|",
10423
- "\\",
10424
- '"',
10425
- "'",
10426
- "`",
10427
- "{",
10428
- "}",
10429
- "[",
10430
- "]",
10431
- "(",
10432
- ")",
10433
- "<",
10434
- ">"
10435
- ];
10436
- var stringify2 = /* @__PURE__ */ __name((value, spacing = 2) => {
10437
- const space = isNumber3(spacing) ? " ".repeat(spacing) : spacing;
10438
- switch (value) {
10439
- case null: {
10440
- return "null";
10441
- }
10442
- case void 0: {
10443
- return '"undefined"';
10444
- }
10445
- case true: {
10446
- return "true";
10447
- }
10448
- case false: {
10449
- return "false";
10450
- }
10451
- case Number.POSITIVE_INFINITY: {
10452
- return "infinity";
10453
- }
10454
- case Number.NEGATIVE_INFINITY: {
10455
- return "-infinity";
10456
- }
10457
- }
10458
- if (Array.isArray(value)) {
10459
- return `[${space}${value.map((v) => stringify2(v, space)).join(`,${space}`)}${space}]`;
10460
- }
10461
- if (value instanceof Uint8Array) {
10462
- return value.toString();
10463
- }
10464
- switch (typeof value) {
10465
- case "number": {
10466
- return `${value}`;
10467
- }
10468
- case "string": {
10469
- return JSON.stringify(value);
10470
- }
10471
- case "object": {
10472
- const keys2 = Object.keys(value).filter((key) => !isUndefined3(value[key]));
10473
- return `{${space}${keys2.map((key) => `${invalidKeyChars.some((invalidKeyChar) => key.includes(invalidKeyChar)) ? `"${key}"` : key}: ${space}${stringify2(value[key], space)}`).join(`,${space}`)}${space}}`;
10474
- }
10475
- default:
10476
- return "null";
10477
- }
10478
- }, "stringify");
10479
-
10480
- // ../json/src/storm-json.ts
10481
- var StormJSON = class _StormJSON extends SuperJSON {
10482
- static {
10483
- __name(this, "StormJSON");
10484
- }
10485
- static #instance;
10486
- static get instance() {
10487
- if (!_StormJSON.#instance) {
10488
- _StormJSON.#instance = new _StormJSON();
10489
- }
10490
- return _StormJSON.#instance;
10491
- }
10492
- /**
10493
- * Deserialize the given value with superjson using the given metadata
10494
- */
10495
- static deserialize(payload) {
10496
- return _StormJSON.instance.deserialize(payload);
10497
- }
10498
- /**
10499
- * Serialize the given value with superjson
10500
- */
10501
- static serialize(object) {
10502
- return _StormJSON.instance.serialize(object);
10503
- }
10504
- /**
10505
- * Parse the given string value with superjson using the given metadata
10506
- *
10507
- * @param value - The string value to parse
10508
- * @returns The parsed data
10509
- */
10510
- static parse(value) {
10511
- return parse4(value);
10512
- }
10513
- /**
10514
- * Serializes the given data to a JSON string.
10515
- * By default the JSON string is formatted with a 2 space indentation to be easy readable.
10516
- *
10517
- * @param value - Object which should be serialized to JSON
10518
- * @param _options - JSON serialize options
10519
- * @returns the formatted JSON representation of the object
10520
- */
10521
- static stringify(value, _options) {
10522
- const customTransformer = _StormJSON.instance.customTransformerRegistry.findApplicable(value);
10523
- let result = value;
10524
- if (customTransformer && customTransformer.isApplicable(value)) {
10525
- result = customTransformer.serialize(result);
10526
- }
10527
- return stringify2(result);
10528
- }
10529
- /**
10530
- * Parses the given JSON string and returns the object the JSON content represents.
10531
- * By default javascript-style comments and trailing commas are allowed.
10532
- *
10533
- * @param strData - JSON content as string
10534
- * @param options - JSON parse options
10535
- * @returns Object the JSON content represents
10536
- */
10537
- static parseJson(strData, options) {
10538
- try {
10539
- if (options?.expectComments === false) {
10540
- return _StormJSON.instance.parse(strData);
10541
- }
10542
- } catch {
10543
- }
10544
- const errors = [];
10545
- const opts = {
10546
- allowTrailingComma: true,
10547
- ...options
10548
- };
10549
- const result = parse2(strData, errors, opts);
10550
- if (errors.length > 0 && errors[0]) {
10551
- throw new Error(formatParseError(strData, errors[0]));
10552
- }
10553
- return result;
10554
- }
10555
- /**
10556
- * Register a custom schema with superjson
10557
- *
10558
- * @param name - The name of the schema
10559
- * @param serialize - The function to serialize the schema
10560
- * @param deserialize - The function to deserialize the schema
10561
- * @param isApplicable - The function to check if the schema is applicable
10562
- */
10563
- static register(name, serialize2, deserialize2, isApplicable) {
10564
- _StormJSON.instance.registerCustom({
10565
- isApplicable,
10566
- serialize: serialize2,
10567
- deserialize: deserialize2
10568
- }, name);
10569
- }
10570
- /**
10571
- * Register a class with superjson
10572
- *
10573
- * @param classConstructor - The class constructor to register
10574
- */
10575
- static registerClass(classConstructor, options) {
10576
- _StormJSON.instance.registerClass(classConstructor, {
10577
- identifier: isString2(options) ? options : options?.identifier || classConstructor.name,
10578
- allowProps: options && isObject(options) && options?.allowProps && Array.isArray(options.allowProps) ? options.allowProps : [
10579
- "__typename"
10580
- ]
10581
- });
10582
- }
10583
- constructor() {
10584
- super({
10585
- dedupe: true
10586
- });
10587
- }
10588
- };
10589
- StormJSON.instance.registerCustom({
10590
- isApplicable: /* @__PURE__ */ __name((v) => Buffer2.isBuffer(v), "isApplicable"),
10591
- serialize: /* @__PURE__ */ __name((v) => v.toString("base64"), "serialize"),
10592
- deserialize: /* @__PURE__ */ __name((v) => Buffer2.from(v, "base64"), "deserialize")
10593
- }, "Bytes");
10594
-
10595
- // ../fs/src/write-file.ts
10596
- init_defu();
10597
6698
  import { writeFile as writeFileFs } from "node:fs/promises";
10598
6699
  var writeFile = /* @__PURE__ */ __name(async (filePath, content = "", options = {}) => {
10599
6700
  if (!filePath) {
@@ -10850,8 +6951,8 @@ function resolveMongoDbRawOperations(modelOperations) {
10850
6951
  const rawOpsMap = {};
10851
6952
  const rawOpsNames = [
10852
6953
  ...new Set(modelOperations.reduce((result, current) => {
10853
- const keys2 = Object.keys(current);
10854
- keys2?.forEach((key) => {
6954
+ const keys = Object.keys(current);
6955
+ keys?.forEach((key) => {
10855
6956
  if (key.includes("Raw")) {
10856
6957
  result.push(key);
10857
6958
  }
@@ -10997,8 +7098,8 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
10997
7098
  } else if (inputType.type === "Bytes") {
10998
7099
  result.push(this.wrapWithZodValidators("z.instanceof(Buffer)", field));
10999
7100
  } else if (!inputType.type.endsWith("FieldRefInput")) {
11000
- const isEnum2 = inputType.location === "enumTypes";
11001
- if (inputType.namespace === "prisma" || isEnum2) {
7101
+ const isEnum = inputType.location === "enumTypes";
7102
+ if (inputType.namespace === "prisma" || isEnum) {
11002
7103
  if (inputType.type !== this.name && typeof inputType.type === "string") {
11003
7104
  this.addSchemaImport(inputType.type);
11004
7105
  }
@@ -11042,12 +7143,12 @@ ${this.generateExportSchemaStatement(`${lowerCaseFirst(name)}`, `z.enum(${JSON.s
11042
7143
  this.schemaImports.add(name);
11043
7144
  }
11044
7145
  generatePrismaStringLine(field, inputType, inputsLength) {
11045
- const isEnum2 = inputType.location === "enumTypes";
7146
+ const isEnum = inputType.location === "enumTypes";
11046
7147
  const inputTypeString = inputType.type;
11047
7148
  const { isModelQueryType, modelName, queryName } = this.checkIsModelQueryType(inputTypeString);
11048
7149
  const objectSchemaLine = isModelQueryType ? this.resolveModelQuerySchemaName(modelName, queryName) : `${inputTypeString}ObjectSchema`;
11049
7150
  const enumSchemaLine = `${inputTypeString}Schema`;
11050
- const schema = inputType.type === this.name ? objectSchemaLine : isEnum2 ? enumSchemaLine : objectSchemaLine;
7151
+ const schema = inputType.type === this.name ? objectSchemaLine : isEnum ? enumSchemaLine : objectSchemaLine;
11051
7152
  const arr = inputType.isList ? ".array()" : "";
11052
7153
  const opt = !field.isRequired ? ".optional()" : "";
11053
7154
  return inputsLength === 1 ? ` ${field.name}: z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}` : `z.lazy(() => ${lowerCaseFirst(schema)})${arr}${opt}`;
@@ -12023,29 +8124,3 @@ getPrismaGeneratorHelper().then((helpers) => {
12023
8124
  }).catch((reason) => {
12024
8125
  console.error(`An error occured while generating prisma tRPC source code: ${reason}`);
12025
8126
  });
12026
- /*! Bundled license information:
12027
-
12028
- @ltd/j-toml/index.mjs:
12029
- (*!@preserve@license
12030
- * 模块名称:j-regexp
12031
- * 模块功能:可读性更好的正则表达式创建方式。从属于“简计划”。
12032
-      More readable way for creating RegExp. Belong to "Plan J".
12033
- * 模块版本:8.2.0
12034
- * 许可条款:LGPL-3.0
12035
- * 所属作者:龙腾道 <LongTengDao@LongTengDao.com> (www.LongTengDao.com)
12036
- * 问题反馈:https://GitHub.com/LongTengDao/j-regexp/issues
12037
- * 项目主页:https://GitHub.com/LongTengDao/j-regexp/
12038
- *)
12039
-
12040
- @ltd/j-toml/index.mjs:
12041
- (*!@preserve@license
12042
- * 模块名称:j-orderify
12043
- * 模块功能:返回一个能保证给定对象的属性按此后添加顺序排列的 proxy,即使键名是 symbol,或整数 string。从属于“简计划”。
12044
-      Return a proxy for given object, which can guarantee own keys are in setting order, even if the key name is symbol or int string. Belong to "Plan J".
12045
- * 模块版本:7.0.1
12046
- * 许可条款:LGPL-3.0
12047
- * 所属作者:龙腾道 <LongTengDao@LongTengDao.com> (www.LongTengDao.com)
12048
- * 问题反馈:https://GitHub.com/LongTengDao/j-orderify/issues
12049
- * 项目主页:https://GitHub.com/LongTengDao/j-orderify/
12050
- *)
12051
- */