edhvault-mcp 0.2.21 → 0.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +758 -611
  3. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -24,9 +24,9 @@ var __export = (target, all) => {
24
24
  };
25
25
  var __copyProps = (to, from, except, desc) => {
26
26
  if (from && typeof from === "object" || typeof from === "function") {
27
- for (let key of __getOwnPropNames(from))
28
- if (!__hasOwnProp.call(to, key) && key !== except)
29
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
+ for (let key2 of __getOwnPropNames(from))
28
+ if (!__hasOwnProp.call(to, key2) && key2 !== except)
29
+ __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
30
30
  }
31
31
  return to;
32
32
  };
@@ -488,9 +488,9 @@ function reviver(_key, value) {
488
488
  }
489
489
  return value;
490
490
  }
491
- function loadJSON(key) {
491
+ function loadJSON(key2) {
492
492
  try {
493
- const raw = localStorage.getItem(PREFIX + key);
493
+ const raw = localStorage.getItem(PREFIX + key2);
494
494
  if (!raw) return void 0;
495
495
  return JSON.parse(raw, reviver);
496
496
  } catch {
@@ -511,35 +511,35 @@ function markStorageBlocked(which) {
511
511
  function isQuotaError(e) {
512
512
  return e instanceof DOMException && (e.code === 22 || e.code === 1014 || e.name === "QuotaExceededError" || e.name === "NS_ERROR_DOM_QUOTA_REACHED");
513
513
  }
514
- function notifyStorageFailure(key, e) {
514
+ function notifyStorageFailure(key2, e) {
515
515
  if (isQuotaError(e)) {
516
516
  quotaFailureObserved = true;
517
- setQuotaFailure({ key, at: Date.now() });
517
+ setQuotaFailure({ key: key2, at: Date.now() });
518
518
  } else {
519
- console.warn("storage save failed", key, e);
519
+ console.warn("storage save failed", key2, e);
520
520
  if (e instanceof DOMException) markStorageBlocked("localStorage");
521
521
  }
522
522
  }
523
523
  function noteStorageSuccess() {
524
524
  if (quotaFailure) setQuotaFailure(null);
525
525
  }
526
- function noteWrite(key) {
526
+ function noteWrite(key2) {
527
527
  if (writeNoticesMuted > 0) return;
528
528
  for (const l of writeListeners) {
529
529
  try {
530
- l(key);
530
+ l(key2);
531
531
  } catch {
532
532
  }
533
533
  }
534
534
  }
535
- function saveJSON(key, value) {
535
+ function saveJSON(key2, value) {
536
536
  try {
537
- localStorage.setItem(PREFIX + key, JSON.stringify(value, replacer));
537
+ localStorage.setItem(PREFIX + key2, JSON.stringify(value, replacer));
538
538
  noteStorageSuccess();
539
- noteWrite(key);
539
+ noteWrite(key2);
540
540
  return true;
541
541
  } catch (e) {
542
- notifyStorageFailure(key, e);
542
+ notifyStorageFailure(key2, e);
543
543
  return false;
544
544
  }
545
545
  }
@@ -582,9 +582,9 @@ function keyFromText(text) {
582
582
  const bytes = base64UrlToBytes(text);
583
583
  return bytes && bytes.length === KEY_BYTES ? bytes : null;
584
584
  }
585
- async function importKey(key, usage) {
586
- if (key.length !== KEY_BYTES) throw new SealedBoxError("malformed", "That key isn't valid.");
587
- return crypto.subtle.importKey("raw", key, { name: "AES-GCM" }, false, [usage]);
585
+ async function importKey(key2, usage) {
586
+ if (key2.length !== KEY_BYTES) throw new SealedBoxError("malformed", "That key isn't valid.");
587
+ return crypto.subtle.importKey("raw", key2, { name: "AES-GCM" }, false, [usage]);
588
588
  }
589
589
  function canGzip() {
590
590
  return typeof CompressionStream === "function" && typeof DecompressionStream === "function";
@@ -606,13 +606,13 @@ function additionalData(header, aad) {
606
606
  out.set(extra, header.length);
607
607
  return out;
608
608
  }
609
- async function seal(plain2, key, opts = {}) {
609
+ async function seal(plain2, key2, opts = {}) {
610
610
  const gzip = (opts.compress ?? true) && canGzip();
611
611
  const body = gzip ? await pipeThrough(plain2, new CompressionStream("gzip")) : plain2;
612
612
  const header = new Uint8Array([VERSION2, gzip ? FLAG_GZIP : 0]);
613
613
  const iv = new Uint8Array(IV_BYTES);
614
614
  crypto.getRandomValues(iv);
615
- const ck = await importKey(key, "encrypt");
615
+ const ck = await importKey(key2, "encrypt");
616
616
  const ct = new Uint8Array(
617
617
  await crypto.subtle.encrypt(
618
618
  { name: "AES-GCM", iv, additionalData: additionalData(header, opts.aad) },
@@ -626,7 +626,7 @@ async function seal(plain2, key, opts = {}) {
626
626
  out.set(ct, HEADER_BYTES + IV_BYTES);
627
627
  return out;
628
628
  }
629
- async function open(sealed, key, opts = {}) {
629
+ async function open(sealed, key2, opts = {}) {
630
630
  if (sealed.length < HEADER_BYTES + IV_BYTES + TAG_BYTES) {
631
631
  throw new SealedBoxError("malformed", "This data is too short to be a sealed box.");
632
632
  }
@@ -640,7 +640,7 @@ async function open(sealed, key, opts = {}) {
640
640
  }
641
641
  const iv = sealed.subarray(HEADER_BYTES, HEADER_BYTES + IV_BYTES);
642
642
  const ct = sealed.subarray(HEADER_BYTES + IV_BYTES);
643
- const ck = await importKey(key, "decrypt");
643
+ const ck = await importKey(key2, "decrypt");
644
644
  let body;
645
645
  try {
646
646
  body = new Uint8Array(
@@ -660,11 +660,11 @@ async function open(sealed, key, opts = {}) {
660
660
  throw new SealedBoxError("malformed", "The decrypted data couldn't be unpacked.");
661
661
  }
662
662
  }
663
- async function sealText(text, key, opts = {}) {
664
- return seal(new TextEncoder().encode(text), key, opts);
663
+ async function sealText(text, key2, opts = {}) {
664
+ return seal(new TextEncoder().encode(text), key2, opts);
665
665
  }
666
- async function openText(sealed, key, opts = {}) {
667
- return new TextDecoder().decode(await open(sealed, key, opts));
666
+ async function openText(sealed, key2, opts = {}) {
667
+ return new TextDecoder().decode(await open(sealed, key2, opts));
668
668
  }
669
669
  var VERSION2, FLAG_GZIP, HEADER_BYTES, IV_BYTES, TAG_BYTES, KEY_BYTES, KEY_TEXT_LENGTH, SealedBoxError;
670
670
  var init_sealedBox = __esm({
@@ -1827,15 +1827,15 @@ var require_code = __commonJS({
1827
1827
  return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
1828
1828
  }
1829
1829
  exports.safeStringify = safeStringify;
1830
- function getProperty(key) {
1831
- return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
1830
+ function getProperty(key2) {
1831
+ return typeof key2 == "string" && exports.IDENTIFIER.test(key2) ? new _Code(`.${key2}`) : _`[${key2}]`;
1832
1832
  }
1833
1833
  exports.getProperty = getProperty;
1834
- function getEsmExportName(key) {
1835
- if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
1836
- return new _Code(`${key}`);
1834
+ function getEsmExportName(key2) {
1835
+ if (typeof key2 == "string" && exports.IDENTIFIER.test(key2)) {
1836
+ return new _Code(`${key2}`);
1837
1837
  }
1838
- throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
1838
+ throw new Error(`CodeGen: invalid export name: ${key2}, use explicit $id name mapping`);
1839
1839
  }
1840
1840
  exports.getEsmExportName = getEsmExportName;
1841
1841
  function regexpCode(rx) {
@@ -2462,11 +2462,11 @@ var require_codegen = __commonJS({
2462
2462
  // returns code for object literal for the passed argument list of key-value pairs
2463
2463
  object(...keyValues) {
2464
2464
  const code = ["{"];
2465
- for (const [key, value] of keyValues) {
2465
+ for (const [key2, value] of keyValues) {
2466
2466
  if (code.length > 1)
2467
2467
  code.push(",");
2468
- code.push(key);
2469
- if (key !== value || this.opts.es5) {
2468
+ code.push(key2);
2469
+ if (key2 !== value || this.opts.es5) {
2470
2470
  code.push(":");
2471
2471
  (0, code_1.addCodeArg)(code, value);
2472
2472
  }
@@ -2741,17 +2741,17 @@ var require_util = __commonJS({
2741
2741
  if (typeof schema === "boolean")
2742
2742
  return;
2743
2743
  const rules = self2.RULES.keywords;
2744
- for (const key in schema) {
2745
- if (!rules[key])
2746
- checkStrictMode(it, `unknown keyword: "${key}"`);
2744
+ for (const key2 in schema) {
2745
+ if (!rules[key2])
2746
+ checkStrictMode(it, `unknown keyword: "${key2}"`);
2747
2747
  }
2748
2748
  }
2749
2749
  exports.checkUnknownRules = checkUnknownRules;
2750
2750
  function schemaHasRules(schema, rules) {
2751
2751
  if (typeof schema == "boolean")
2752
2752
  return !schema;
2753
- for (const key in schema)
2754
- if (rules[key])
2753
+ for (const key2 in schema)
2754
+ if (rules[key2])
2755
2755
  return true;
2756
2756
  return false;
2757
2757
  }
@@ -2759,8 +2759,8 @@ var require_util = __commonJS({
2759
2759
  function schemaHasRulesButRef(schema, RULES) {
2760
2760
  if (typeof schema == "boolean")
2761
2761
  return !schema;
2762
- for (const key in schema)
2763
- if (key !== "$ref" && RULES.all[key])
2762
+ for (const key2 in schema)
2763
+ if (key2 !== "$ref" && RULES.all[key2])
2764
2764
  return true;
2765
2765
  return false;
2766
2766
  }
@@ -3338,8 +3338,8 @@ var require_defaults = __commonJS({
3338
3338
  function assignDefaults(it, ty) {
3339
3339
  const { properties, items } = it.schema;
3340
3340
  if (ty === "object" && properties) {
3341
- for (const key in properties) {
3342
- assignDefault(it, key, properties[key].default);
3341
+ for (const key2 in properties) {
3342
+ assignDefault(it, key2, properties[key2].default);
3343
3343
  }
3344
3344
  } else if (ty === "array" && Array.isArray(items)) {
3345
3345
  items.forEach((sch, i) => assignDefault(it, i, sch.default));
@@ -3723,8 +3723,8 @@ var require_fast_deep_equal = __commonJS({
3723
3723
  for (i = length; i-- !== 0; )
3724
3724
  if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
3725
3725
  for (i = length; i-- !== 0; ) {
3726
- var key = keys[i];
3727
- if (!equal(a[key], b[key])) return false;
3726
+ var key2 = keys[i];
3727
+ if (!equal(a[key2], b[key2])) return false;
3728
3728
  }
3729
3729
  return true;
3730
3730
  }
@@ -3796,20 +3796,20 @@ var require_json_schema_traverse = __commonJS({
3796
3796
  function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
3797
3797
  if (schema && typeof schema == "object" && !Array.isArray(schema)) {
3798
3798
  pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
3799
- for (var key in schema) {
3800
- var sch = schema[key];
3799
+ for (var key2 in schema) {
3800
+ var sch = schema[key2];
3801
3801
  if (Array.isArray(sch)) {
3802
- if (key in traverse.arrayKeywords) {
3802
+ if (key2 in traverse.arrayKeywords) {
3803
3803
  for (var i = 0; i < sch.length; i++)
3804
- _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema, i);
3804
+ _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key2 + "/" + i, rootSchema, jsonPtr, key2, schema, i);
3805
3805
  }
3806
- } else if (key in traverse.propsKeywords) {
3806
+ } else if (key2 in traverse.propsKeywords) {
3807
3807
  if (sch && typeof sch == "object") {
3808
3808
  for (var prop in sch)
3809
- _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
3809
+ _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key2 + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key2, schema, prop);
3810
3810
  }
3811
- } else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) {
3812
- _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema);
3811
+ } else if (key2 in traverse.keywords || opts.allKeys && !(key2 in traverse.skipKeywords)) {
3812
+ _traverse(opts, pre, post, sch, jsonPtr + "/" + key2, rootSchema, jsonPtr, key2, schema);
3813
3813
  }
3814
3814
  }
3815
3815
  post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
@@ -3866,10 +3866,10 @@ var require_resolve = __commonJS({
3866
3866
  "$dynamicAnchor"
3867
3867
  ]);
3868
3868
  function hasRef(schema) {
3869
- for (const key in schema) {
3870
- if (REF_KEYWORDS.has(key))
3869
+ for (const key2 in schema) {
3870
+ if (REF_KEYWORDS.has(key2))
3871
3871
  return true;
3872
- const sch = schema[key];
3872
+ const sch = schema[key2];
3873
3873
  if (Array.isArray(sch) && sch.some(hasRef))
3874
3874
  return true;
3875
3875
  if (typeof sch == "object" && hasRef(sch))
@@ -3879,14 +3879,14 @@ var require_resolve = __commonJS({
3879
3879
  }
3880
3880
  function countKeys(schema) {
3881
3881
  let count2 = 0;
3882
- for (const key in schema) {
3883
- if (key === "$ref")
3882
+ for (const key2 in schema) {
3883
+ if (key2 === "$ref")
3884
3884
  return Infinity;
3885
3885
  count2++;
3886
- if (SIMPLE_INLINED.has(key))
3886
+ if (SIMPLE_INLINED.has(key2))
3887
3887
  continue;
3888
- if (typeof schema[key] == "object") {
3889
- (0, util_1.eachItem)(schema[key], (sch) => count2 += countKeys(sch));
3888
+ if (typeof schema[key2] == "object") {
3889
+ (0, util_1.eachItem)(schema[key2], (sch) => count2 += countKeys(sch));
3890
3890
  }
3891
3891
  if (count2 === Infinity)
3892
3892
  return Infinity;
@@ -4075,8 +4075,8 @@ var require_validate = __commonJS({
4075
4075
  function schemaCxtHasRules({ schema, self: self2 }) {
4076
4076
  if (typeof schema == "boolean")
4077
4077
  return !schema;
4078
- for (const key in schema)
4079
- if (self2.RULES.all[key])
4078
+ for (const key2 in schema)
4079
+ if (self2.RULES.all[key2])
4080
4080
  return true;
4081
4081
  return false;
4082
4082
  }
@@ -5805,7 +5805,7 @@ var require_core = __commonJS({
5805
5805
  }
5806
5806
  }
5807
5807
  // Adds schema to the instance
5808
- addSchema(schema, key, _meta, _validateSchema = this.opts.validateSchema) {
5808
+ addSchema(schema, key2, _meta, _validateSchema = this.opts.validateSchema) {
5809
5809
  if (Array.isArray(schema)) {
5810
5810
  for (const sch of schema)
5811
5811
  this.addSchema(sch, void 0, _meta, _validateSchema);
@@ -5819,15 +5819,15 @@ var require_core = __commonJS({
5819
5819
  throw new Error(`schema ${schemaId} must be string`);
5820
5820
  }
5821
5821
  }
5822
- key = (0, resolve_1.normalizeId)(key || id);
5823
- this._checkUnique(key);
5824
- this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);
5822
+ key2 = (0, resolve_1.normalizeId)(key2 || id);
5823
+ this._checkUnique(key2);
5824
+ this.schemas[key2] = this._addSchema(schema, _meta, key2, _validateSchema, true);
5825
5825
  return this;
5826
5826
  }
5827
5827
  // Add schema that will be used to validate other schemas
5828
5828
  // options in META_IGNORE_OPTIONS are alway set to false
5829
- addMetaSchema(schema, key, _validateSchema = this.opts.validateSchema) {
5830
- this.addSchema(schema, key, true, _validateSchema);
5829
+ addMetaSchema(schema, key2, _validateSchema = this.opts.validateSchema) {
5830
+ this.addSchema(schema, key2, true, _validateSchema);
5831
5831
  return this;
5832
5832
  }
5833
5833
  // Validate schema against its meta-schema
@@ -5983,14 +5983,14 @@ var require_core = __commonJS({
5983
5983
  let keywords = metaSchema;
5984
5984
  for (const seg of segments)
5985
5985
  keywords = keywords[seg];
5986
- for (const key in rules) {
5987
- const rule = rules[key];
5986
+ for (const key2 in rules) {
5987
+ const rule = rules[key2];
5988
5988
  if (typeof rule != "object")
5989
5989
  continue;
5990
5990
  const { $data } = rule.definition;
5991
- const schema = keywords[key];
5991
+ const schema = keywords[key2];
5992
5992
  if ($data && schema)
5993
- keywords[key] = schemaOrData(schema);
5993
+ keywords[key2] = schemaOrData(schema);
5994
5994
  }
5995
5995
  }
5996
5996
  return metaSchema;
@@ -6063,10 +6063,10 @@ var require_core = __commonJS({
6063
6063
  Ajv2.MissingRefError = ref_error_1.default;
6064
6064
  exports.default = Ajv2;
6065
6065
  function checkOptions(checkOpts, options, msg, log2 = "error") {
6066
- for (const key in checkOpts) {
6067
- const opt = key;
6066
+ for (const key2 in checkOpts) {
6067
+ const opt = key2;
6068
6068
  if (opt in options)
6069
- this.logger[log2](`${msg}: option ${key}. ${checkOpts[opt]}`);
6069
+ this.logger[log2](`${msg}: option ${key2}. ${checkOpts[opt]}`);
6070
6070
  }
6071
6071
  }
6072
6072
  function getSchEnv(keyRef) {
@@ -6080,8 +6080,8 @@ var require_core = __commonJS({
6080
6080
  if (Array.isArray(optsSchemas))
6081
6081
  this.addSchema(optsSchemas);
6082
6082
  else
6083
- for (const key in optsSchemas)
6084
- this.addSchema(optsSchemas[key], key);
6083
+ for (const key2 in optsSchemas)
6084
+ this.addSchema(optsSchemas[key2], key2);
6085
6085
  }
6086
6086
  function addInitialFormats() {
6087
6087
  for (const name in this.opts.formats) {
@@ -7129,11 +7129,11 @@ var require_dependencies = __commonJS({
7129
7129
  function splitDependencies({ schema }) {
7130
7130
  const propertyDeps = {};
7131
7131
  const schemaDeps = {};
7132
- for (const key in schema) {
7133
- if (key === "__proto__")
7132
+ for (const key2 in schema) {
7133
+ if (key2 === "__proto__")
7134
7134
  continue;
7135
- const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;
7136
- deps[key] = schema[key];
7135
+ const deps = Array.isArray(schema[key2]) ? propertyDeps : schemaDeps;
7136
+ deps[key2] = schema[key2];
7137
7137
  }
7138
7138
  return [propertyDeps, schemaDeps];
7139
7139
  }
@@ -7210,13 +7210,13 @@ var require_propertyNames = __commonJS({
7210
7210
  if ((0, util_1.alwaysValidSchema)(it, schema))
7211
7211
  return;
7212
7212
  const valid = gen.name("valid");
7213
- gen.forIn("key", data, (key) => {
7214
- cxt.setParams({ propertyName: key });
7213
+ gen.forIn("key", data, (key2) => {
7214
+ cxt.setParams({ propertyName: key2 });
7215
7215
  cxt.subschema({
7216
7216
  keyword: "propertyNames",
7217
- data: key,
7217
+ data: key2,
7218
7218
  dataTypes: ["string"],
7219
- propertyName: key,
7219
+ propertyName: key2,
7220
7220
  compositeRule: true
7221
7221
  }, valid);
7222
7222
  gen.if((0, codegen_1.not)(valid), () => {
@@ -7265,38 +7265,38 @@ var require_additionalProperties = __commonJS({
7265
7265
  checkAdditionalProperties();
7266
7266
  cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
7267
7267
  function checkAdditionalProperties() {
7268
- gen.forIn("key", data, (key) => {
7268
+ gen.forIn("key", data, (key2) => {
7269
7269
  if (!props.length && !patProps.length)
7270
- additionalPropertyCode(key);
7270
+ additionalPropertyCode(key2);
7271
7271
  else
7272
- gen.if(isAdditional(key), () => additionalPropertyCode(key));
7272
+ gen.if(isAdditional(key2), () => additionalPropertyCode(key2));
7273
7273
  });
7274
7274
  }
7275
- function isAdditional(key) {
7275
+ function isAdditional(key2) {
7276
7276
  let definedProp;
7277
7277
  if (props.length > 8) {
7278
7278
  const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
7279
- definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
7279
+ definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key2);
7280
7280
  } else if (props.length) {
7281
- definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`));
7281
+ definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key2} === ${p}`));
7282
7282
  } else {
7283
7283
  definedProp = codegen_1.nil;
7284
7284
  }
7285
7285
  if (patProps.length) {
7286
- definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
7286
+ definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key2})`));
7287
7287
  }
7288
7288
  return (0, codegen_1.not)(definedProp);
7289
7289
  }
7290
- function deleteAdditional(key) {
7291
- gen.code((0, codegen_1._)`delete ${data}[${key}]`);
7290
+ function deleteAdditional(key2) {
7291
+ gen.code((0, codegen_1._)`delete ${data}[${key2}]`);
7292
7292
  }
7293
- function additionalPropertyCode(key) {
7293
+ function additionalPropertyCode(key2) {
7294
7294
  if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) {
7295
- deleteAdditional(key);
7295
+ deleteAdditional(key2);
7296
7296
  return;
7297
7297
  }
7298
7298
  if (schema === false) {
7299
- cxt.setParams({ additionalProperty: key });
7299
+ cxt.setParams({ additionalProperty: key2 });
7300
7300
  cxt.error();
7301
7301
  if (!allErrors)
7302
7302
  gen.break();
@@ -7305,22 +7305,22 @@ var require_additionalProperties = __commonJS({
7305
7305
  if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
7306
7306
  const valid = gen.name("valid");
7307
7307
  if (opts.removeAdditional === "failing") {
7308
- applyAdditionalSchema(key, valid, false);
7308
+ applyAdditionalSchema(key2, valid, false);
7309
7309
  gen.if((0, codegen_1.not)(valid), () => {
7310
7310
  cxt.reset();
7311
- deleteAdditional(key);
7311
+ deleteAdditional(key2);
7312
7312
  });
7313
7313
  } else {
7314
- applyAdditionalSchema(key, valid);
7314
+ applyAdditionalSchema(key2, valid);
7315
7315
  if (!allErrors)
7316
7316
  gen.if((0, codegen_1.not)(valid), () => gen.break());
7317
7317
  }
7318
7318
  }
7319
7319
  }
7320
- function applyAdditionalSchema(key, valid, errors) {
7320
+ function applyAdditionalSchema(key2, valid, errors) {
7321
7321
  const subschema = {
7322
7322
  keyword: "additionalProperties",
7323
- dataProp: key,
7323
+ dataProp: key2,
7324
7324
  dataPropType: util_1.Type.Str
7325
7325
  };
7326
7326
  if (errors === false) {
@@ -7445,19 +7445,19 @@ var require_patternProperties = __commonJS({
7445
7445
  }
7446
7446
  }
7447
7447
  function validateProperties(pat) {
7448
- gen.forIn("key", data, (key) => {
7449
- gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
7448
+ gen.forIn("key", data, (key2) => {
7449
+ gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key2})`, () => {
7450
7450
  const alwaysValid = alwaysValidPatterns.includes(pat);
7451
7451
  if (!alwaysValid) {
7452
7452
  cxt.subschema({
7453
7453
  keyword: "patternProperties",
7454
7454
  schemaProp: pat,
7455
- dataProp: key,
7455
+ dataProp: key2,
7456
7456
  dataPropType: util_2.Type.Str
7457
7457
  }, valid);
7458
7458
  }
7459
7459
  if (it.opts.unevaluated && props !== true) {
7460
- gen.assign((0, codegen_1._)`${props}[${key}]`, true);
7460
+ gen.assign((0, codegen_1._)`${props}[${key2}]`, true);
7461
7461
  } else if (!alwaysValid && !it.allErrors) {
7462
7462
  gen.if((0, codegen_1.not)(valid), () => gen.break());
7463
7463
  }
@@ -8587,15 +8587,15 @@ function mergeDuplicates(entries2) {
8587
8587
  const merged = /* @__PURE__ */ new Map();
8588
8588
  for (const entry of entries2) {
8589
8589
  if (entry.quantity <= 0) continue;
8590
- const key = collectionStackKey(entry);
8591
- const existing = merged.get(key);
8590
+ const key2 = collectionStackKey(entry);
8591
+ const existing = merged.get(key2);
8592
8592
  if (existing) {
8593
8593
  existing.quantity += entry.quantity;
8594
8594
  if (entry.tags && entry.tags.length > 0) {
8595
8595
  existing.tags = unionTags(existing.tags, entry.tags);
8596
8596
  }
8597
8597
  } else {
8598
- merged.set(key, { ...entry });
8598
+ merged.set(key2, { ...entry });
8599
8599
  }
8600
8600
  }
8601
8601
  return Array.from(merged.values());
@@ -8604,9 +8604,9 @@ function unionTags(a, b) {
8604
8604
  const out = [...a ?? []];
8605
8605
  const seen = new Set(out.map((t) => t.toLowerCase()));
8606
8606
  for (const t of b) {
8607
- const key = t.toLowerCase();
8608
- if (!seen.has(key)) {
8609
- seen.add(key);
8607
+ const key2 = t.toLowerCase();
8608
+ if (!seen.has(key2)) {
8609
+ seen.add(key2);
8610
8610
  out.push(t);
8611
8611
  }
8612
8612
  }
@@ -9910,8 +9910,8 @@ var require_papaparse = __commonJS({
9910
9910
  if (typeof obj !== "object" || obj === null)
9911
9911
  return obj;
9912
9912
  var cpy = Array.isArray(obj) ? [] : {};
9913
- for (var key in obj)
9914
- cpy[key] = copy(obj[key]);
9913
+ for (var key2 in obj)
9914
+ cpy[key2] = copy(obj[key2]);
9915
9915
  return cpy;
9916
9916
  }
9917
9917
  function bindFunction(f, self2) {
@@ -9958,10 +9958,10 @@ async function fetchPrintings(identifiers, onProgress) {
9958
9958
  const result = /* @__PURE__ */ new Map();
9959
9959
  const toFetch = [];
9960
9960
  for (const id of identifiers) {
9961
- const key = printingKey(id.set, id.collector_number);
9962
- const cached2 = cache.get(key);
9961
+ const key2 = printingKey(id.set, id.collector_number);
9962
+ const cached2 = cache.get(key2);
9963
9963
  if (cached2) {
9964
- result.set(key, cached2);
9964
+ result.set(key2, cached2);
9965
9965
  } else {
9966
9966
  toFetch.push(id);
9967
9967
  }
@@ -10013,8 +10013,8 @@ async function fetchPrintings(identifiers, onProgress) {
10013
10013
  );
10014
10014
  let dataIdx = 0;
10015
10015
  for (const reqId of batch) {
10016
- const key = printingKey(reqId.set, reqId.collector_number);
10017
- if (notFound.has(key)) continue;
10016
+ const key2 = printingKey(reqId.set, reqId.collector_number);
10017
+ if (notFound.has(key2)) continue;
10018
10018
  const card = json3.data[dataIdx++];
10019
10019
  if (!card?.oracle_id) continue;
10020
10020
  const image = pickImage(card);
@@ -10027,8 +10027,8 @@ async function fetchPrintings(identifiers, onProgress) {
10027
10027
  priceUsd: parsePrice(card.prices?.usd),
10028
10028
  priceUsdFoil: parsePrice(card.prices?.usd_foil)
10029
10029
  };
10030
- result.set(key, record2);
10031
- cache.set(key, record2);
10030
+ result.set(key2, record2);
10031
+ cache.set(key2, record2);
10032
10032
  }
10033
10033
  } catch (e) {
10034
10034
  if (false) {
@@ -11962,13 +11962,13 @@ var require_react_development = __commonJS({
11962
11962
  }
11963
11963
  }
11964
11964
  }
11965
- var ReactElement = function(type, key, ref, self2, source, owner, props) {
11965
+ var ReactElement = function(type, key2, ref, self2, source, owner, props) {
11966
11966
  var element = {
11967
11967
  // This tag allows us to uniquely identify this as a React Element
11968
11968
  $$typeof: REACT_ELEMENT_TYPE,
11969
11969
  // Built-in properties that belong on the element
11970
11970
  type,
11971
- key,
11971
+ key: key2,
11972
11972
  ref,
11973
11973
  props,
11974
11974
  // Record the component responsible for creating this element.
@@ -12004,7 +12004,7 @@ var require_react_development = __commonJS({
12004
12004
  function createElement(type, config2, children) {
12005
12005
  var propName;
12006
12006
  var props = {};
12007
- var key = null;
12007
+ var key2 = null;
12008
12008
  var ref = null;
12009
12009
  var self2 = null;
12010
12010
  var source = null;
@@ -12019,7 +12019,7 @@ var require_react_development = __commonJS({
12019
12019
  {
12020
12020
  checkKeyStringCoercion(config2.key);
12021
12021
  }
12022
- key = "" + config2.key;
12022
+ key2 = "" + config2.key;
12023
12023
  }
12024
12024
  self2 = config2.__self === void 0 ? null : config2.__self;
12025
12025
  source = config2.__source === void 0 ? null : config2.__source;
@@ -12053,9 +12053,9 @@ var require_react_development = __commonJS({
12053
12053
  }
12054
12054
  }
12055
12055
  {
12056
- if (key || ref) {
12056
+ if (key2 || ref) {
12057
12057
  var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
12058
- if (key) {
12058
+ if (key2) {
12059
12059
  defineKeyPropWarningGetter(props, displayName);
12060
12060
  }
12061
12061
  if (ref) {
@@ -12063,7 +12063,7 @@ var require_react_development = __commonJS({
12063
12063
  }
12064
12064
  }
12065
12065
  }
12066
- return ReactElement(type, key, ref, self2, source, ReactCurrentOwner.current, props);
12066
+ return ReactElement(type, key2, ref, self2, source, ReactCurrentOwner.current, props);
12067
12067
  }
12068
12068
  function cloneAndReplaceKey(oldElement, newKey2) {
12069
12069
  var newElement = ReactElement(oldElement.type, newKey2, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
@@ -12075,7 +12075,7 @@ var require_react_development = __commonJS({
12075
12075
  }
12076
12076
  var propName;
12077
12077
  var props = assign({}, element.props);
12078
- var key = element.key;
12078
+ var key2 = element.key;
12079
12079
  var ref = element.ref;
12080
12080
  var self2 = element._self;
12081
12081
  var source = element._source;
@@ -12089,7 +12089,7 @@ var require_react_development = __commonJS({
12089
12089
  {
12090
12090
  checkKeyStringCoercion(config2.key);
12091
12091
  }
12092
- key = "" + config2.key;
12092
+ key2 = "" + config2.key;
12093
12093
  }
12094
12094
  var defaultProps;
12095
12095
  if (element.type && element.type.defaultProps) {
@@ -12115,20 +12115,20 @@ var require_react_development = __commonJS({
12115
12115
  }
12116
12116
  props.children = childArray;
12117
12117
  }
12118
- return ReactElement(element.type, key, ref, self2, source, owner, props);
12118
+ return ReactElement(element.type, key2, ref, self2, source, owner, props);
12119
12119
  }
12120
12120
  function isValidElement(object3) {
12121
12121
  return typeof object3 === "object" && object3 !== null && object3.$$typeof === REACT_ELEMENT_TYPE;
12122
12122
  }
12123
12123
  var SEPARATOR = ".";
12124
12124
  var SUBSEPARATOR = ":";
12125
- function escape2(key) {
12125
+ function escape2(key2) {
12126
12126
  var escapeRegex2 = /[=:]/g;
12127
12127
  var escaperLookup = {
12128
12128
  "=": "=0",
12129
12129
  ":": "=2"
12130
12130
  };
12131
- var escapedString = key.replace(escapeRegex2, function(match) {
12131
+ var escapedString = key2.replace(escapeRegex2, function(match) {
12132
12132
  return escaperLookup[match];
12133
12133
  });
12134
12134
  return "$" + escapedString;
@@ -13057,10 +13057,10 @@ var require_react_development = __commonJS({
13057
13057
  {
13058
13058
  var keys = Object.keys(fragment.props);
13059
13059
  for (var i = 0; i < keys.length; i++) {
13060
- var key = keys[i];
13061
- if (key !== "children" && key !== "key") {
13060
+ var key2 = keys[i];
13061
+ if (key2 !== "children" && key2 !== "key") {
13062
13062
  setCurrentlyValidatingElement$1(fragment);
13063
- error62("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
13063
+ error62("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key2);
13064
13064
  setCurrentlyValidatingElement$1(null);
13065
13065
  break;
13066
13066
  }
@@ -16124,13 +16124,13 @@ function withoutTag(name) {
16124
16124
  return name.replace(/\s*\((?:token|emblem)\)\s*$/i, "").trim();
16125
16125
  }
16126
16126
  function resolveCardName(index, name) {
16127
- const key = normalize2(withoutTag(name));
16128
- let card = index.byName.get(key);
16127
+ const key2 = normalize2(withoutTag(name));
16128
+ let card = index.byName.get(key2);
16129
16129
  if (card) return card;
16130
- card = index.byFaceName.get(key);
16130
+ card = index.byFaceName.get(key2);
16131
16131
  if (card) return card;
16132
- const split = key.split(/\s*\/\/\s*|\s*\/\s*/)[0];
16133
- if (split && split !== key) {
16132
+ const split = key2.split(/\s*\/\/\s*|\s*\/\s*/)[0];
16133
+ if (split && split !== key2) {
16134
16134
  card = index.byName.get(split);
16135
16135
  if (card) return card;
16136
16136
  card = index.byFaceName.get(split);
@@ -16148,7 +16148,7 @@ function resolveCardName(index, name) {
16148
16148
  card = index.byNormalizedFaceName.get(normSplit);
16149
16149
  if (card) return card;
16150
16150
  }
16151
- card = index.byAltName.get(key);
16151
+ card = index.byAltName.get(key2);
16152
16152
  if (card) return card;
16153
16153
  card = index.byNormalizedAltName.get(norm);
16154
16154
  if (card) return card;
@@ -17052,9 +17052,9 @@ var Library = class {
17052
17052
  }
17053
17053
  async key(scope, refresh = false) {
17054
17054
  const { token, keys } = await this.connect(refresh);
17055
- const key = keys[scope];
17056
- if (!key) throw new LibraryError("no-scope", noScopeMessage(scope));
17057
- return { token, key };
17055
+ const key2 = keys[scope];
17056
+ if (!key2) throw new LibraryError("no-scope", noScopeMessage(scope));
17057
+ return { token, key: key2 };
17058
17058
  }
17059
17059
  /** One part's index, at most FRESH_MS old unless `refresh`. */
17060
17060
  async view(scope, refresh = false) {
@@ -17074,7 +17074,7 @@ var Library = class {
17074
17074
  }
17075
17075
  }
17076
17076
  async viewOnce(scope, refresh) {
17077
- const { token, key } = await this.key(scope, refresh);
17077
+ const { token, key: key2 } = await this.key(scope, refresh);
17078
17078
  const part2 = this.parts.get(scope) ?? { index: null, etag: null, checkedAt: 0 };
17079
17079
  this.parts.set(scope, part2);
17080
17080
  if (part2.index && !refresh && this.now() - part2.checkedAt < this.freshMs) return part2.index;
@@ -17089,7 +17089,7 @@ var Library = class {
17089
17089
  part2.checkedAt = this.now();
17090
17090
  if (got.status === "ok") {
17091
17091
  try {
17092
- part2.index = await openViewIndex(got.sealed, key, scope);
17092
+ part2.index = await openViewIndex(got.sealed, key2, scope);
17093
17093
  } catch {
17094
17094
  throw new KeySwapped();
17095
17095
  }
@@ -17109,7 +17109,7 @@ var Library = class {
17109
17109
  }
17110
17110
  /** Object texts of one part by name, from the disk cache or batched reads. */
17111
17111
  async read(scope, list) {
17112
- const { token, key } = await this.key(scope);
17112
+ const { token, key: key2 } = await this.key(scope);
17113
17113
  const dir = this.dirOf(scope);
17114
17114
  mkdirSync3(dir, { recursive: true });
17115
17115
  const sealed = /* @__PURE__ */ new Map();
@@ -17133,7 +17133,7 @@ var Library = class {
17133
17133
  }
17134
17134
  }
17135
17135
  const out = /* @__PURE__ */ new Map();
17136
- for (const [name, bytes] of sealed) out.set(name, await openViewObject(bytes, key, scope, name));
17136
+ for (const [name, bytes] of sealed) out.set(name, await openViewObject(bytes, key2, scope, name));
17137
17137
  return out;
17138
17138
  }
17139
17139
  async partDecks(scope, refresh) {
@@ -17319,11 +17319,11 @@ var aadFor = (id, purpose) => purpose === "agent" ? `agent-pair:${id}` : `pair:$
17319
17319
  async function redeemPairCode(text, t = {}, purpose = "sync") {
17320
17320
  const code = normalizePairCode(text);
17321
17321
  if (!code) return { ok: false, reason: "format" };
17322
- const { id, key } = await derivePairKeys(code);
17322
+ const { id, key: key2 } = await derivePairKeys(code);
17323
17323
  const sealed = await takePair(id, t);
17324
17324
  if (!sealed) return { ok: false, reason: "not-found" };
17325
17325
  try {
17326
- const secret = secretFromLinkText(await openText(sealed, key, { aad: aadFor(id, purpose) }));
17326
+ const secret = secretFromLinkText(await openText(sealed, key2, { aad: aadFor(id, purpose) }));
17327
17327
  return secret ? { ok: true, secret } : { ok: false, reason: "damaged" };
17328
17328
  } catch {
17329
17329
  return { ok: false, reason: "damaged" };
@@ -17467,9 +17467,9 @@ var util;
17467
17467
  };
17468
17468
  util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object3) => {
17469
17469
  const keys = [];
17470
- for (const key in object3) {
17471
- if (Object.prototype.hasOwnProperty.call(object3, key)) {
17472
- keys.push(key);
17470
+ for (const key2 in object3) {
17471
+ if (Object.prototype.hasOwnProperty.call(object3, key2)) {
17472
+ keys.push(key2);
17473
17473
  }
17474
17474
  }
17475
17475
  return keys;
@@ -17876,10 +17876,10 @@ var ParseStatus = class _ParseStatus {
17876
17876
  static async mergeObjectAsync(status, pairs) {
17877
17877
  const syncPairs = [];
17878
17878
  for (const pair of pairs) {
17879
- const key = await pair.key;
17879
+ const key2 = await pair.key;
17880
17880
  const value = await pair.value;
17881
17881
  syncPairs.push({
17882
- key,
17882
+ key: key2,
17883
17883
  value
17884
17884
  });
17885
17885
  }
@@ -17888,17 +17888,17 @@ var ParseStatus = class _ParseStatus {
17888
17888
  static mergeObjectSync(status, pairs) {
17889
17889
  const finalObject = {};
17890
17890
  for (const pair of pairs) {
17891
- const { key, value } = pair;
17892
- if (key.status === "aborted")
17891
+ const { key: key2, value } = pair;
17892
+ if (key2.status === "aborted")
17893
17893
  return INVALID;
17894
17894
  if (value.status === "aborted")
17895
17895
  return INVALID;
17896
- if (key.status === "dirty")
17896
+ if (key2.status === "dirty")
17897
17897
  status.dirty();
17898
17898
  if (value.status === "dirty")
17899
17899
  status.dirty();
17900
- if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
17901
- finalObject[key.value] = value.value;
17900
+ if (key2.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
17901
+ finalObject[key2.value] = value.value;
17902
17902
  }
17903
17903
  }
17904
17904
  return { status: status.value, value: finalObject };
@@ -17923,12 +17923,12 @@ var errorUtil;
17923
17923
 
17924
17924
  // ../../commander/node_modules/zod/v3/types.js
17925
17925
  var ParseInputLazyPath = class {
17926
- constructor(parent, value, path, key) {
17926
+ constructor(parent, value, path, key2) {
17927
17927
  this._cachedPath = [];
17928
17928
  this.parent = parent;
17929
17929
  this.data = value;
17930
17930
  this._path = path;
17931
- this._key = key;
17931
+ this._key = key2;
17932
17932
  }
17933
17933
  get path() {
17934
17934
  if (!this._cachedPath.length) {
@@ -19673,9 +19673,9 @@ ZodArray.create = (schema, params) => {
19673
19673
  function deepPartialify(schema) {
19674
19674
  if (schema instanceof ZodObject) {
19675
19675
  const newShape = {};
19676
- for (const key in schema.shape) {
19677
- const fieldSchema = schema.shape[key];
19678
- newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
19676
+ for (const key2 in schema.shape) {
19677
+ const fieldSchema = schema.shape[key2];
19678
+ newShape[key2] = ZodOptional.create(deepPartialify(fieldSchema));
19679
19679
  }
19680
19680
  return new ZodObject({
19681
19681
  ...schema._def,
@@ -19726,29 +19726,29 @@ var ZodObject = class _ZodObject extends ZodType {
19726
19726
  const { shape, keys: shapeKeys } = this._getCached();
19727
19727
  const extraKeys = [];
19728
19728
  if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
19729
- for (const key in ctx.data) {
19730
- if (!shapeKeys.includes(key)) {
19731
- extraKeys.push(key);
19729
+ for (const key2 in ctx.data) {
19730
+ if (!shapeKeys.includes(key2)) {
19731
+ extraKeys.push(key2);
19732
19732
  }
19733
19733
  }
19734
19734
  }
19735
19735
  const pairs = [];
19736
- for (const key of shapeKeys) {
19737
- const keyValidator = shape[key];
19738
- const value = ctx.data[key];
19736
+ for (const key2 of shapeKeys) {
19737
+ const keyValidator = shape[key2];
19738
+ const value = ctx.data[key2];
19739
19739
  pairs.push({
19740
- key: { status: "valid", value: key },
19741
- value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
19742
- alwaysSet: key in ctx.data
19740
+ key: { status: "valid", value: key2 },
19741
+ value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key2)),
19742
+ alwaysSet: key2 in ctx.data
19743
19743
  });
19744
19744
  }
19745
19745
  if (this._def.catchall instanceof ZodNever) {
19746
19746
  const unknownKeys = this._def.unknownKeys;
19747
19747
  if (unknownKeys === "passthrough") {
19748
- for (const key of extraKeys) {
19748
+ for (const key2 of extraKeys) {
19749
19749
  pairs.push({
19750
- key: { status: "valid", value: key },
19751
- value: { status: "valid", value: ctx.data[key] }
19750
+ key: { status: "valid", value: key2 },
19751
+ value: { status: "valid", value: ctx.data[key2] }
19752
19752
  });
19753
19753
  }
19754
19754
  } else if (unknownKeys === "strict") {
@@ -19765,15 +19765,15 @@ var ZodObject = class _ZodObject extends ZodType {
19765
19765
  }
19766
19766
  } else {
19767
19767
  const catchall = this._def.catchall;
19768
- for (const key of extraKeys) {
19769
- const value = ctx.data[key];
19768
+ for (const key2 of extraKeys) {
19769
+ const value = ctx.data[key2];
19770
19770
  pairs.push({
19771
- key: { status: "valid", value: key },
19771
+ key: { status: "valid", value: key2 },
19772
19772
  value: catchall._parse(
19773
- new ParseInputLazyPath(ctx, value, ctx.path, key)
19773
+ new ParseInputLazyPath(ctx, value, ctx.path, key2)
19774
19774
  //, ctx.child(key), value, getParsedType(value)
19775
19775
  ),
19776
- alwaysSet: key in ctx.data
19776
+ alwaysSet: key2 in ctx.data
19777
19777
  });
19778
19778
  }
19779
19779
  }
@@ -19781,10 +19781,10 @@ var ZodObject = class _ZodObject extends ZodType {
19781
19781
  return Promise.resolve().then(async () => {
19782
19782
  const syncPairs = [];
19783
19783
  for (const pair of pairs) {
19784
- const key = await pair.key;
19784
+ const key2 = await pair.key;
19785
19785
  const value = await pair.value;
19786
19786
  syncPairs.push({
19787
- key,
19787
+ key: key2,
19788
19788
  value,
19789
19789
  alwaysSet: pair.alwaysSet
19790
19790
  });
@@ -19909,8 +19909,8 @@ var ZodObject = class _ZodObject extends ZodType {
19909
19909
  // }) as any;
19910
19910
  // return merged;
19911
19911
  // }
19912
- setKey(key, schema) {
19913
- return this.augment({ [key]: schema });
19912
+ setKey(key2, schema) {
19913
+ return this.augment({ [key2]: schema });
19914
19914
  }
19915
19915
  // merge<Incoming extends AnyZodObject>(
19916
19916
  // merging: Incoming
@@ -19941,9 +19941,9 @@ var ZodObject = class _ZodObject extends ZodType {
19941
19941
  }
19942
19942
  pick(mask) {
19943
19943
  const shape = {};
19944
- for (const key of util.objectKeys(mask)) {
19945
- if (mask[key] && this.shape[key]) {
19946
- shape[key] = this.shape[key];
19944
+ for (const key2 of util.objectKeys(mask)) {
19945
+ if (mask[key2] && this.shape[key2]) {
19946
+ shape[key2] = this.shape[key2];
19947
19947
  }
19948
19948
  }
19949
19949
  return new _ZodObject({
@@ -19953,9 +19953,9 @@ var ZodObject = class _ZodObject extends ZodType {
19953
19953
  }
19954
19954
  omit(mask) {
19955
19955
  const shape = {};
19956
- for (const key of util.objectKeys(this.shape)) {
19957
- if (!mask[key]) {
19958
- shape[key] = this.shape[key];
19956
+ for (const key2 of util.objectKeys(this.shape)) {
19957
+ if (!mask[key2]) {
19958
+ shape[key2] = this.shape[key2];
19959
19959
  }
19960
19960
  }
19961
19961
  return new _ZodObject({
@@ -19971,12 +19971,12 @@ var ZodObject = class _ZodObject extends ZodType {
19971
19971
  }
19972
19972
  partial(mask) {
19973
19973
  const newShape = {};
19974
- for (const key of util.objectKeys(this.shape)) {
19975
- const fieldSchema = this.shape[key];
19976
- if (mask && !mask[key]) {
19977
- newShape[key] = fieldSchema;
19974
+ for (const key2 of util.objectKeys(this.shape)) {
19975
+ const fieldSchema = this.shape[key2];
19976
+ if (mask && !mask[key2]) {
19977
+ newShape[key2] = fieldSchema;
19978
19978
  } else {
19979
- newShape[key] = fieldSchema.optional();
19979
+ newShape[key2] = fieldSchema.optional();
19980
19980
  }
19981
19981
  }
19982
19982
  return new _ZodObject({
@@ -19986,16 +19986,16 @@ var ZodObject = class _ZodObject extends ZodType {
19986
19986
  }
19987
19987
  required(mask) {
19988
19988
  const newShape = {};
19989
- for (const key of util.objectKeys(this.shape)) {
19990
- if (mask && !mask[key]) {
19991
- newShape[key] = this.shape[key];
19989
+ for (const key2 of util.objectKeys(this.shape)) {
19990
+ if (mask && !mask[key2]) {
19991
+ newShape[key2] = this.shape[key2];
19992
19992
  } else {
19993
- const fieldSchema = this.shape[key];
19993
+ const fieldSchema = this.shape[key2];
19994
19994
  let newField = fieldSchema;
19995
19995
  while (newField instanceof ZodOptional) {
19996
19996
  newField = newField._def.innerType;
19997
19997
  }
19998
- newShape[key] = newField;
19998
+ newShape[key2] = newField;
19999
19999
  }
20000
20000
  }
20001
20001
  return new _ZodObject({
@@ -20239,18 +20239,18 @@ function mergeValues(a, b) {
20239
20239
  return { valid: true, data: a };
20240
20240
  } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
20241
20241
  const bKeys = util.objectKeys(b);
20242
- const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
20242
+ const sharedKeys = util.objectKeys(a).filter((key2) => bKeys.indexOf(key2) !== -1);
20243
20243
  const newObj = { ...a, ...b };
20244
20244
  if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
20245
20245
  delete newObj.__proto__;
20246
- for (const key of sharedKeys) {
20247
- if (key === "__proto__")
20246
+ for (const key2 of sharedKeys) {
20247
+ if (key2 === "__proto__")
20248
20248
  continue;
20249
- const sharedValue = mergeValues(a[key], b[key]);
20249
+ const sharedValue = mergeValues(a[key2], b[key2]);
20250
20250
  if (!sharedValue.valid) {
20251
20251
  return { valid: false };
20252
20252
  }
20253
- newObj[key] = sharedValue.data;
20253
+ newObj[key2] = sharedValue.data;
20254
20254
  }
20255
20255
  return { valid: true, data: newObj };
20256
20256
  } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
@@ -20414,11 +20414,11 @@ var ZodRecord = class _ZodRecord extends ZodType {
20414
20414
  const pairs = [];
20415
20415
  const keyType = this._def.keyType;
20416
20416
  const valueType = this._def.valueType;
20417
- for (const key in ctx.data) {
20417
+ for (const key2 in ctx.data) {
20418
20418
  pairs.push({
20419
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
20420
- value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
20421
- alwaysSet: key in ctx.data
20419
+ key: keyType._parse(new ParseInputLazyPath(ctx, key2, ctx.path, key2)),
20420
+ value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key2], ctx.path, key2)),
20421
+ alwaysSet: key2 in ctx.data
20422
20422
  });
20423
20423
  }
20424
20424
  if (ctx.common.async) {
@@ -20466,9 +20466,9 @@ var ZodMap = class extends ZodType {
20466
20466
  }
20467
20467
  const keyType = this._def.keyType;
20468
20468
  const valueType = this._def.valueType;
20469
- const pairs = [...ctx.data.entries()].map(([key, value], index) => {
20469
+ const pairs = [...ctx.data.entries()].map(([key2, value], index) => {
20470
20470
  return {
20471
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
20471
+ key: keyType._parse(new ParseInputLazyPath(ctx, key2, ctx.path, [index, "key"])),
20472
20472
  value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"]))
20473
20473
  };
20474
20474
  });
@@ -20476,30 +20476,30 @@ var ZodMap = class extends ZodType {
20476
20476
  const finalMap = /* @__PURE__ */ new Map();
20477
20477
  return Promise.resolve().then(async () => {
20478
20478
  for (const pair of pairs) {
20479
- const key = await pair.key;
20479
+ const key2 = await pair.key;
20480
20480
  const value = await pair.value;
20481
- if (key.status === "aborted" || value.status === "aborted") {
20481
+ if (key2.status === "aborted" || value.status === "aborted") {
20482
20482
  return INVALID;
20483
20483
  }
20484
- if (key.status === "dirty" || value.status === "dirty") {
20484
+ if (key2.status === "dirty" || value.status === "dirty") {
20485
20485
  status.dirty();
20486
20486
  }
20487
- finalMap.set(key.value, value.value);
20487
+ finalMap.set(key2.value, value.value);
20488
20488
  }
20489
20489
  return { status: status.value, value: finalMap };
20490
20490
  });
20491
20491
  } else {
20492
20492
  const finalMap = /* @__PURE__ */ new Map();
20493
20493
  for (const pair of pairs) {
20494
- const key = pair.key;
20494
+ const key2 = pair.key;
20495
20495
  const value = pair.value;
20496
- if (key.status === "aborted" || value.status === "aborted") {
20496
+ if (key2.status === "aborted" || value.status === "aborted") {
20497
20497
  return INVALID;
20498
20498
  }
20499
- if (key.status === "dirty" || value.status === "dirty") {
20499
+ if (key2.status === "dirty" || value.status === "dirty") {
20500
20500
  status.dirty();
20501
20501
  }
20502
- finalMap.set(key.value, value.value);
20502
+ finalMap.set(key2.value, value.value);
20503
20503
  }
20504
20504
  return { status: status.value, value: finalMap };
20505
20505
  }
@@ -21788,9 +21788,9 @@ function floatSafeRemainder2(val, step) {
21788
21788
  return ratio - roundedRatio;
21789
21789
  }
21790
21790
  var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
21791
- function defineLazy(object3, key, getter) {
21791
+ function defineLazy(object3, key2, getter) {
21792
21792
  let value = void 0;
21793
- Object.defineProperty(object3, key, {
21793
+ Object.defineProperty(object3, key2, {
21794
21794
  get() {
21795
21795
  if (value === EVALUATING) {
21796
21796
  return void 0;
@@ -21802,7 +21802,7 @@ function defineLazy(object3, key, getter) {
21802
21802
  return value;
21803
21803
  },
21804
21804
  set(v) {
21805
- Object.defineProperty(object3, key, {
21805
+ Object.defineProperty(object3, key2, {
21806
21806
  value: v
21807
21807
  // configurable: true,
21808
21808
  });
@@ -21828,47 +21828,47 @@ function rawShape(def) {
21828
21828
  function sourceShape(schema) {
21829
21829
  return rawShape(schema._zod.def) ?? schema._zod.def.shape;
21830
21830
  }
21831
- function deferProp(target, key, getter) {
21832
- Object.defineProperty(target, key, {
21831
+ function deferProp(target, key2, getter) {
21832
+ Object.defineProperty(target, key2, {
21833
21833
  get() {
21834
21834
  const value = getter();
21835
- assignProp(this, key, value);
21835
+ assignProp(this, key2, value);
21836
21836
  return value;
21837
21837
  },
21838
21838
  enumerable: true,
21839
21839
  configurable: true
21840
21840
  });
21841
21841
  }
21842
- function putProp(target, key, value) {
21843
- if (key in target)
21844
- assignProp(target, key, value);
21842
+ function putProp(target, key2, value) {
21843
+ if (key2 in target)
21844
+ assignProp(target, key2, value);
21845
21845
  else
21846
- target[key] = value;
21846
+ target[key2] = value;
21847
21847
  }
21848
21848
  function mirrorShape(target, source, keys, wrap2) {
21849
21849
  const raw = sourceShape(source);
21850
- for (const key of keys) {
21851
- const desc = Object.getOwnPropertyDescriptor(raw, key);
21850
+ for (const key2 of keys) {
21851
+ const desc = Object.getOwnPropertyDescriptor(raw, key2);
21852
21852
  if (!desc.enumerable)
21853
21853
  continue;
21854
21854
  if (desc.get) {
21855
- deferProp(target, key, () => {
21856
- const value = source._zod.def.shape[key];
21857
- return wrap2 ? wrap2(value, key) : value;
21855
+ deferProp(target, key2, () => {
21856
+ const value = source._zod.def.shape[key2];
21857
+ return wrap2 ? wrap2(value, key2) : value;
21858
21858
  });
21859
21859
  } else
21860
- putProp(target, key, wrap2 ? wrap2(desc.value, key) : desc.value);
21860
+ putProp(target, key2, wrap2 ? wrap2(desc.value, key2) : desc.value);
21861
21861
  }
21862
21862
  }
21863
21863
  function mirrorProps(target, source) {
21864
- for (const key of Reflect.ownKeys(source)) {
21865
- const desc = Object.getOwnPropertyDescriptor(source, key);
21864
+ for (const key2 of Reflect.ownKeys(source)) {
21865
+ const desc = Object.getOwnPropertyDescriptor(source, key2);
21866
21866
  if (!desc.enumerable)
21867
21867
  continue;
21868
21868
  if (desc.get)
21869
- deferProp(target, key, () => source[key]);
21869
+ deferProp(target, key2, () => source[key2]);
21870
21870
  else
21871
- putProp(target, key, desc.value);
21871
+ putProp(target, key2, desc.value);
21872
21872
  }
21873
21873
  }
21874
21874
  function mergeDefs(...defs) {
@@ -21885,11 +21885,11 @@ function cloneDef(schema) {
21885
21885
  function getElementAtPath(obj, path) {
21886
21886
  if (!path)
21887
21887
  return obj;
21888
- return path.reduce((acc, key) => acc?.[key], obj);
21888
+ return path.reduce((acc, key2) => acc?.[key2], obj);
21889
21889
  }
21890
21890
  function promiseAllObject(promisesObj) {
21891
21891
  const keys = Object.keys(promisesObj);
21892
- const promises = keys.map((key) => promisesObj[key]);
21892
+ const promises = keys.map((key2) => promisesObj[key2]);
21893
21893
  return Promise.all(promises).then((results) => {
21894
21894
  const resolvedObj = {};
21895
21895
  for (let i = 0; i < keys.length; i++) {
@@ -21961,8 +21961,8 @@ function shallowClone(o) {
21961
21961
  }
21962
21962
  function numKeys(data) {
21963
21963
  let keyCount = 0;
21964
- for (const key in data) {
21965
- if (Object.prototype.hasOwnProperty.call(data, key)) {
21964
+ for (const key2 in data) {
21965
+ if (Object.prototype.hasOwnProperty.call(data, key2)) {
21966
21966
  keyCount++;
21967
21967
  }
21968
21968
  }
@@ -22116,12 +22116,12 @@ function pick(schema, mask) {
22116
22116
  function maskedKeys(schema, mask) {
22117
22117
  const raw = sourceShape(schema);
22118
22118
  const keys = [];
22119
- for (const key of Reflect.ownKeys(mask)) {
22120
- if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
22121
- throw new Error(`Unrecognized key: "${String(key)}"`);
22119
+ for (const key2 of Reflect.ownKeys(mask)) {
22120
+ if (!Object.getOwnPropertyDescriptor(raw, key2)?.enumerable) {
22121
+ throw new Error(`Unrecognized key: "${String(key2)}"`);
22122
22122
  }
22123
- if (mask[key])
22124
- keys.push(key);
22123
+ if (mask[key2])
22124
+ keys.push(key2);
22125
22125
  }
22126
22126
  return keys;
22127
22127
  }
@@ -22134,7 +22134,7 @@ function omit(schema, mask) {
22134
22134
  }
22135
22135
  const omitted = new Set(maskedKeys(schema, mask));
22136
22136
  const newShape = {};
22137
- mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
22137
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key2) => !omitted.has(key2)));
22138
22138
  return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
22139
22139
  }
22140
22140
  function extend(schema, shape) {
@@ -22145,8 +22145,8 @@ function extend(schema, shape) {
22145
22145
  const hasChecks = checks && checks.length > 0;
22146
22146
  if (hasChecks) {
22147
22147
  const existingShape = sourceShape(schema);
22148
- for (const key of Reflect.ownKeys(shape)) {
22149
- if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) {
22148
+ for (const key2 of Reflect.ownKeys(shape)) {
22149
+ if (Object.getOwnPropertyDescriptor(existingShape, key2) !== void 0) {
22150
22150
  throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
22151
22151
  }
22152
22152
  }
@@ -22193,15 +22193,15 @@ function partial(Class2, schema, mask, name = "partial") {
22193
22193
  }
22194
22194
  const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
22195
22195
  const newShape = {};
22196
- mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value, key) => selected && !selected.has(key) ? value : new Class2({ type: "optional", innerType: value })));
22196
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value, key2) => selected && !selected.has(key2) ? value : new Class2({ type: "optional", innerType: value })));
22197
22197
  return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
22198
22198
  }
22199
22199
  function required(Class2, schema, mask) {
22200
22200
  const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
22201
22201
  const newShape = {};
22202
- mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => (
22202
+ mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key2) => (
22203
22203
  // overwrite with non-optional
22204
- selected && !selected.has(key) ? value : new Class2({ type: "nonoptional", innerType: value })
22204
+ selected && !selected.has(key2) ? value : new Class2({ type: "nonoptional", innerType: value })
22205
22205
  ));
22206
22206
  return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
22207
22207
  }
@@ -22388,46 +22388,46 @@ var Class = class {
22388
22388
  }
22389
22389
  };
22390
22390
  function members(proto, table) {
22391
- for (const key in table) {
22392
- const desc = Object.getOwnPropertyDescriptor(table, key);
22391
+ for (const key2 in table) {
22392
+ const desc = Object.getOwnPropertyDescriptor(table, key2);
22393
22393
  if (desc.get)
22394
- Object.defineProperty(proto, key, { ...desc, enumerable: false });
22394
+ Object.defineProperty(proto, key2, { ...desc, enumerable: false });
22395
22395
  else
22396
- defineBound(proto, key, desc.value);
22396
+ defineBound(proto, key2, desc.value);
22397
22397
  }
22398
22398
  }
22399
- function own(inst, key, value, enumerable = true) {
22400
- Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
22399
+ function own(inst, key2, value, enumerable = true) {
22400
+ Object.defineProperty(inst, key2, { configurable: true, writable: true, enumerable, value });
22401
22401
  return value;
22402
22402
  }
22403
- function hide(inst, key, value) {
22404
- return own(inst, key, value, false);
22403
+ function hide(inst, key2, value) {
22404
+ return own(inst, key2, value, false);
22405
22405
  }
22406
22406
  // @__NO_SIDE_EFFECTS__
22407
22407
  function derived(computes, table) {
22408
- for (const key in computes) {
22409
- const compute = computes[key];
22410
- Object.defineProperty(table, key, {
22408
+ for (const key2 in computes) {
22409
+ const compute = computes[key2];
22410
+ Object.defineProperty(table, key2, {
22411
22411
  configurable: true,
22412
22412
  enumerable: true,
22413
22413
  get() {
22414
- return own(this, key, compute(this));
22414
+ return own(this, key2, compute(this));
22415
22415
  },
22416
22416
  set(value) {
22417
- own(this, key, value);
22417
+ own(this, key2, value);
22418
22418
  }
22419
22419
  });
22420
22420
  }
22421
22421
  return table;
22422
22422
  }
22423
- function defineBound(proto, key, fn) {
22424
- Object.defineProperty(proto, key, {
22423
+ function defineBound(proto, key2, fn) {
22424
+ Object.defineProperty(proto, key2, {
22425
22425
  configurable: true,
22426
22426
  get() {
22427
- return this == null ? fn : own(this, key, fn.bind(this));
22427
+ return this == null ? fn : own(this, key2, fn.bind(this));
22428
22428
  },
22429
22429
  set(value) {
22430
- own(this, key, value);
22430
+ own(this, key2, value);
22431
22431
  }
22432
22432
  });
22433
22433
  }
@@ -22444,53 +22444,53 @@ var breaker = {
22444
22444
  return void 0;
22445
22445
  }
22446
22446
  };
22447
- function defineLazyInternal(inst, key, compute) {
22447
+ function defineLazyInternal(inst, key2, compute) {
22448
22448
  const proto = Object.getPrototypeOf(inst._zod);
22449
- if (key in proto && installing !== inst._zod) {
22449
+ if (key2 in proto && installing !== inst._zod) {
22450
22450
  installing = void 0;
22451
22451
  return;
22452
22452
  }
22453
22453
  installing = inst._zod;
22454
- Object.defineProperty(proto, key, {
22454
+ Object.defineProperty(proto, key2, {
22455
22455
  configurable: true,
22456
22456
  get() {
22457
- Object.defineProperty(this, key, breaker);
22457
+ Object.defineProperty(this, key2, breaker);
22458
22458
  const outer = broke;
22459
22459
  broke = false;
22460
22460
  try {
22461
22461
  const value = compute(this);
22462
22462
  if (broke)
22463
- delete this[key];
22463
+ delete this[key2];
22464
22464
  else
22465
- Object.defineProperty(this, key, { configurable: true, writable: true, value });
22465
+ Object.defineProperty(this, key2, { configurable: true, writable: true, value });
22466
22466
  broke = broke || outer;
22467
22467
  return value;
22468
22468
  } catch (err) {
22469
- delete this[key];
22469
+ delete this[key2];
22470
22470
  broke = broke || outer;
22471
22471
  throw err;
22472
22472
  }
22473
22473
  },
22474
22474
  set(value) {
22475
- Object.defineProperty(this, key, { configurable: true, writable: true, value });
22475
+ Object.defineProperty(this, key2, { configurable: true, writable: true, value });
22476
22476
  }
22477
22477
  });
22478
22478
  }
22479
- function installLazyProp(inst, key, make, enumerable) {
22480
- const proto = claim(inst, key);
22479
+ function installLazyProp(inst, key2, make, enumerable) {
22480
+ const proto = claim(inst, key2);
22481
22481
  if (!proto)
22482
22482
  return;
22483
- Object.defineProperty(proto, key, {
22483
+ Object.defineProperty(proto, key2, {
22484
22484
  configurable: true,
22485
22485
  get() {
22486
22486
  const desc = { configurable: true, writable: true, enumerable, value: void 0 };
22487
- Object.defineProperty(this, key, desc);
22487
+ Object.defineProperty(this, key2, desc);
22488
22488
  desc.value = make(this);
22489
- Object.defineProperty(this, key, desc);
22489
+ Object.defineProperty(this, key2, desc);
22490
22490
  return desc.value;
22491
22491
  },
22492
22492
  set(value) {
22493
- Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });
22493
+ Object.defineProperty(this, key2, { configurable: true, writable: true, enumerable, value });
22494
22494
  }
22495
22495
  });
22496
22496
  }
@@ -22667,15 +22667,15 @@ var $ZodError = $constructor("$ZodError", initializer);
22667
22667
  var $ZodRealError = $constructor("$ZodError", initializer, void 0, {
22668
22668
  Parent: Error
22669
22669
  });
22670
- function node(obj, key, make) {
22671
- if (!Object.prototype.hasOwnProperty.call(obj, key)) {
22672
- if (key === "__proto__") {
22673
- Object.defineProperty(obj, key, { value: make(), writable: true, enumerable: true, configurable: true });
22670
+ function node(obj, key2, make) {
22671
+ if (!Object.prototype.hasOwnProperty.call(obj, key2)) {
22672
+ if (key2 === "__proto__") {
22673
+ Object.defineProperty(obj, key2, { value: make(), writable: true, enumerable: true, configurable: true });
22674
22674
  } else {
22675
- obj[key] = make();
22675
+ obj[key2] = make();
22676
22676
  }
22677
22677
  }
22678
- return obj[key];
22678
+ return obj[key2];
22679
22679
  }
22680
22680
  function flattenError(error62, mapper = (issue2) => issue2.message) {
22681
22681
  const fieldErrors = {};
@@ -23584,16 +23584,16 @@ var $ZodCheckProperties = /* @__PURE__ */ $constructor("$ZodCheckProperties", (i
23584
23584
  payload.issues.push({ expected: "object", code: "invalid_type", input: payload.value, inst });
23585
23585
  return void 0;
23586
23586
  }
23587
- entries2 ?? (entries2 = Reflect.ownKeys(def.shape).map((key) => [key, def.shape[key]]));
23587
+ entries2 ?? (entries2 = Reflect.ownKeys(def.shape).map((key2) => [key2, def.shape[key2]]));
23588
23588
  const input2 = payload.value;
23589
23589
  let proms;
23590
- for (const [key, schema] of entries2) {
23591
- const result = schema._zod.run({ value: input2[key], issues: [] }, {});
23590
+ for (const [key2, schema] of entries2) {
23591
+ const result = schema._zod.run({ value: input2[key2], issues: [] }, {});
23592
23592
  if (result instanceof Promise) {
23593
23593
  proms ?? (proms = []);
23594
- proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key)));
23594
+ proms.push(result.then((result2) => handleCheckPropertyResult(result2, payload, key2)));
23595
23595
  } else {
23596
- handleCheckPropertyResult(result, payload, key);
23596
+ handleCheckPropertyResult(result, payload, key2);
23597
23597
  }
23598
23598
  }
23599
23599
  if (proms)
@@ -24494,8 +24494,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
24494
24494
  };
24495
24495
  capSize(inst, arraySize);
24496
24496
  });
24497
- function handlePropertyResult(result, final, key, input2, optin, optout) {
24498
- const isPresent = key in input2;
24497
+ function handlePropertyResult(result, final, key2, input2, optin, optout) {
24498
+ const isPresent = key2 in input2;
24499
24499
  const isOptionalOut = optout === "optional";
24500
24500
  if (!isPresent && isOptionalOut && optin === "optional") {
24501
24501
  return;
@@ -24504,7 +24504,7 @@ function handlePropertyResult(result, final, key, input2, optin, optout) {
24504
24504
  if (optin !== void 0 && isOptionalOut && !isPresent) {
24505
24505
  return;
24506
24506
  }
24507
- final.issues.push(...prefixIssues(key, result.issues));
24507
+ final.issues.push(...prefixIssues(key2, result.issues));
24508
24508
  }
24509
24509
  if (!isPresent && optin === void 0) {
24510
24510
  if (!result.issues.length) {
@@ -24512,17 +24512,17 @@ function handlePropertyResult(result, final, key, input2, optin, optout) {
24512
24512
  code: "invalid_type",
24513
24513
  expected: "nonoptional",
24514
24514
  input: void 0,
24515
- path: [key]
24515
+ path: [key2]
24516
24516
  });
24517
24517
  }
24518
24518
  return;
24519
24519
  }
24520
24520
  if (result.value === void 0) {
24521
24521
  if (isPresent || optin === "defaulted" && !isOptionalOut) {
24522
- final.value[key] = void 0;
24522
+ final.value[key2] = void 0;
24523
24523
  }
24524
24524
  } else {
24525
- final.value[key] = result.value;
24525
+ final.value[key2] = result.value;
24526
24526
  }
24527
24527
  }
24528
24528
  var NO_SYMBOL_KEYS = [];
@@ -24555,28 +24555,28 @@ function handleCatchall(proms, input2, payload, ctx, def, inst, abortEarly) {
24555
24555
  const optin = _catchall.optin;
24556
24556
  const optout = _catchall.optout;
24557
24557
  let seen = 0;
24558
- for (const key in input2) {
24558
+ for (const key2 in input2) {
24559
24559
  if (abortEarly && payload.issues.length !== seen) {
24560
24560
  if (aborted(payload, seen))
24561
24561
  break;
24562
24562
  seen = payload.issues.length;
24563
24563
  }
24564
- if (keySet.has(key))
24564
+ if (keySet.has(key2))
24565
24565
  continue;
24566
- if (key === "__proto__") {
24566
+ if (key2 === "__proto__") {
24567
24567
  if (t === "never")
24568
- unrecognized.push(key);
24568
+ unrecognized.push(key2);
24569
24569
  continue;
24570
24570
  }
24571
24571
  if (t === "never") {
24572
- unrecognized.push(key);
24572
+ unrecognized.push(key2);
24573
24573
  continue;
24574
24574
  }
24575
- const r = _catchall.run({ value: input2[key], issues: [] }, ctx);
24575
+ const r = _catchall.run({ value: input2[key2], issues: [] }, ctx);
24576
24576
  if (r instanceof Promise) {
24577
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, optin, optout)));
24577
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2, input2, optin, optout)));
24578
24578
  } else {
24579
- handlePropertyResult(r, payload, key, input2, optin, optout);
24579
+ handlePropertyResult(r, payload, key2, input2, optin, optout);
24580
24580
  }
24581
24581
  }
24582
24582
  if (unrecognized.length) {
@@ -24613,16 +24613,16 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
24613
24613
  defineLazyInternal(inst, "propValues", (zod) => {
24614
24614
  const shape = zod.def.shape;
24615
24615
  const propValues = {};
24616
- for (const key in shape) {
24617
- const field = shape[key]._zod;
24616
+ for (const key2 in shape) {
24617
+ const field = shape[key2]._zod;
24618
24618
  if (field.values) {
24619
- if (!Object.prototype.hasOwnProperty.call(propValues, key)) {
24620
- assignProp(propValues, key, /* @__PURE__ */ new Set());
24619
+ if (!Object.prototype.hasOwnProperty.call(propValues, key2)) {
24620
+ assignProp(propValues, key2, /* @__PURE__ */ new Set());
24621
24621
  }
24622
24622
  for (const v of field.values)
24623
- propValues[key].add(v);
24623
+ propValues[key2].add(v);
24624
24624
  if (field.optin !== void 0)
24625
- propValues[key].add(void 0);
24625
+ propValues[key2].add(void 0);
24626
24626
  }
24627
24627
  }
24628
24628
  return propValues;
@@ -24649,22 +24649,22 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
24649
24649
  const shape = value.shape;
24650
24650
  const abortEarly = ctx?.abortEarly;
24651
24651
  let seen = payload.issues.length;
24652
- for (const key of value.allKeys) {
24652
+ for (const key2 of value.allKeys) {
24653
24653
  if (abortEarly && payload.issues.length !== seen) {
24654
24654
  if (aborted(payload, seen))
24655
24655
  break;
24656
24656
  seen = payload.issues.length;
24657
24657
  }
24658
- if (key === "__proto__")
24658
+ if (key2 === "__proto__")
24659
24659
  continue;
24660
- const el = shape[key];
24660
+ const el = shape[key2];
24661
24661
  const optin = el._zod.optin;
24662
24662
  const optout = el._zod.optout;
24663
- const r = el._zod.run({ value: input2[key], issues: [] }, ctx);
24663
+ const r = el._zod.run({ value: input2[key2], issues: [] }, ctx);
24664
24664
  if (r instanceof Promise) {
24665
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, optin, optout)));
24665
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2, input2, optin, optout)));
24666
24666
  } else {
24667
- handlePropertyResult(r, payload, key, input2, optin, optout);
24667
+ handlePropertyResult(r, payload, key2, input2, optin, optout);
24668
24668
  }
24669
24669
  }
24670
24670
  if (!catchall) {
@@ -24698,17 +24698,17 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
24698
24698
  doc.write(`const input = payload.value;`);
24699
24699
  const ids = /* @__PURE__ */ Object.create(null);
24700
24700
  let counter = 0;
24701
- for (const key of normalized.allKeys) {
24702
- ids[key] = `key_${counter++}`;
24701
+ for (const key2 of normalized.allKeys) {
24702
+ ids[key2] = `key_${counter++}`;
24703
24703
  }
24704
24704
  doc.write(memo2 ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
24705
- for (const key of normalized.allKeys) {
24706
- if (key === "__proto__")
24705
+ for (const key2 of normalized.allKeys) {
24706
+ if (key2 === "__proto__")
24707
24707
  continue;
24708
- const id = ids[key];
24709
- const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key);
24708
+ const id = ids[key2];
24709
+ const k = typeof key2 === "symbol" ? `syms[${syms.indexOf(key2)}]` : esc(key2);
24710
24710
  const isPresent = `${k} in input`;
24711
- const schema = shape[key];
24711
+ const schema = shape[key2];
24712
24712
  const optin = schema?._zod?.optin;
24713
24713
  const isOptionalIn = optin !== void 0;
24714
24714
  const isOptionalOut = schema?._zod?.optout === "optional";
@@ -25042,21 +25042,21 @@ function mergeValues2(a, b) {
25042
25042
  }
25043
25043
  if (isPlainObject(a) && isPlainObject(b)) {
25044
25044
  const bKeys = Object.keys(b);
25045
- const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
25045
+ const sharedKeys = Object.keys(a).filter((key2) => bKeys.indexOf(key2) !== -1);
25046
25046
  const newObj = { ...a, ...b };
25047
25047
  if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
25048
25048
  delete newObj.__proto__;
25049
- for (const key of sharedKeys) {
25050
- if (key === "__proto__")
25049
+ for (const key2 of sharedKeys) {
25050
+ if (key2 === "__proto__")
25051
25051
  continue;
25052
- const sharedValue = mergeValues2(a[key], b[key]);
25052
+ const sharedValue = mergeValues2(a[key2], b[key2]);
25053
25053
  if (!sharedValue.valid) {
25054
25054
  return {
25055
25055
  valid: false,
25056
- mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
25056
+ mergeErrorPath: [key2, ...sharedValue.mergeErrorPath]
25057
25057
  };
25058
25058
  }
25059
- newObj[key] = sharedValue.data;
25059
+ newObj[key2] = sharedValue.data;
25060
25060
  }
25061
25061
  return { valid: true, data: newObj };
25062
25062
  }
@@ -25215,9 +25215,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
25215
25215
  return handleTupleResults(itemResults, payload, items, input2, optoutStart);
25216
25216
  };
25217
25217
  });
25218
- function getTupleOptStart(items, key) {
25218
+ function getTupleOptStart(items, key2) {
25219
25219
  for (let i = items.length - 1; i >= 0; i--) {
25220
- const omittable = key === "optin" ? items[i]._zod.optin !== void 0 : items[i]._zod.optout === "optional";
25220
+ const omittable = key2 === "optin" ? items[i]._zod.optin !== void 0 : items[i]._zod.optout === "optional";
25221
25221
  if (!omittable)
25222
25222
  return i + 1;
25223
25223
  }
@@ -25275,12 +25275,12 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
25275
25275
  if (values && !def.partial) {
25276
25276
  payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
25277
25277
  const recordKeys = /* @__PURE__ */ new Set();
25278
- for (const key of values) {
25279
- if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
25280
- recordKeys.add(typeof key === "number" ? key.toString() : key);
25281
- if (key === "__proto__")
25278
+ for (const key2 of values) {
25279
+ if (typeof key2 === "string" || typeof key2 === "number" || typeof key2 === "symbol") {
25280
+ recordKeys.add(typeof key2 === "number" ? key2.toString() : key2);
25281
+ if (key2 === "__proto__")
25282
25282
  continue;
25283
- const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
25283
+ const keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
25284
25284
  if (keyResult instanceof Promise) {
25285
25285
  throw new Error("Async schemas not supported in object keys currently");
25286
25286
  }
@@ -25289,8 +25289,8 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
25289
25289
  code: "invalid_key",
25290
25290
  origin: "record",
25291
25291
  issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
25292
- input: key,
25293
- path: [key],
25292
+ input: key2,
25293
+ path: [key2],
25294
25294
  inst
25295
25295
  });
25296
25296
  continue;
@@ -25298,32 +25298,32 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
25298
25298
  const outKey = keyResult.value;
25299
25299
  if (outKey === "__proto__")
25300
25300
  continue;
25301
- const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
25301
+ const result = def.valueType._zod.run({ value: input2[key2], issues: [] }, ctx);
25302
25302
  if (result instanceof Promise) {
25303
25303
  proms.push(result.then((result2) => {
25304
25304
  if (result2.issues.length) {
25305
- payload.issues.push(...prefixIssues(key, result2.issues));
25305
+ payload.issues.push(...prefixIssues(key2, result2.issues));
25306
25306
  }
25307
25307
  payload.value[outKey] = result2.value;
25308
25308
  }));
25309
25309
  } else {
25310
25310
  if (result.issues.length) {
25311
- payload.issues.push(...prefixIssues(key, result.issues));
25311
+ payload.issues.push(...prefixIssues(key2, result.issues));
25312
25312
  }
25313
25313
  payload.value[outKey] = result.value;
25314
25314
  }
25315
25315
  }
25316
25316
  }
25317
25317
  let unrecognized;
25318
- for (const key in input2) {
25319
- if (!recordKeys.has(key)) {
25318
+ for (const key2 in input2) {
25319
+ if (!recordKeys.has(key2)) {
25320
25320
  if (def.mode === "loose") {
25321
- if (key === "__proto__")
25321
+ if (key2 === "__proto__")
25322
25322
  continue;
25323
- payload.value[key] = input2[key];
25323
+ payload.value[key2] = input2[key2];
25324
25324
  } else {
25325
25325
  unrecognized = unrecognized ?? [];
25326
- unrecognized.push(key);
25326
+ unrecognized.push(key2);
25327
25327
  }
25328
25328
  }
25329
25329
  }
@@ -25339,18 +25339,18 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
25339
25339
  } else {
25340
25340
  payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
25341
25341
  let unrecognized;
25342
- for (const key of Reflect.ownKeys(input2)) {
25343
- if (key === "__proto__")
25342
+ for (const key2 of Reflect.ownKeys(input2)) {
25343
+ if (key2 === "__proto__")
25344
25344
  continue;
25345
- if (!Object.prototype.propertyIsEnumerable.call(input2, key))
25345
+ if (!Object.prototype.propertyIsEnumerable.call(input2, key2))
25346
25346
  continue;
25347
- let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
25347
+ let keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
25348
25348
  if (keyResult instanceof Promise) {
25349
25349
  throw new Error("Async schemas not supported in object keys currently");
25350
25350
  }
25351
- const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length;
25351
+ const checkNumericKey = typeof key2 === "string" && number.test(key2) && keyResult.issues.length;
25352
25352
  if (checkNumericKey) {
25353
- const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
25353
+ const retryResult = def.keyType._zod.run({ value: Number(key2), issues: [] }, ctx);
25354
25354
  if (retryResult instanceof Promise) {
25355
25355
  throw new Error("Async schemas not supported in object keys currently");
25356
25356
  }
@@ -25360,17 +25360,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
25360
25360
  }
25361
25361
  if (keyResult.issues.length) {
25362
25362
  if (def.mode === "loose") {
25363
- payload.value[key] = input2[key];
25363
+ payload.value[key2] = input2[key2];
25364
25364
  } else if (values) {
25365
25365
  unrecognized = unrecognized ?? [];
25366
- unrecognized.push(key);
25366
+ unrecognized.push(key2);
25367
25367
  } else {
25368
25368
  payload.issues.push({
25369
25369
  code: "invalid_key",
25370
25370
  origin: "record",
25371
25371
  issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
25372
- input: key,
25373
- path: [key],
25372
+ input: key2,
25373
+ path: [key2],
25374
25374
  inst
25375
25375
  });
25376
25376
  }
@@ -25379,17 +25379,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
25379
25379
  const outKey = keyResult.value;
25380
25380
  if (outKey === "__proto__")
25381
25381
  continue;
25382
- const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
25382
+ const result = def.valueType._zod.run({ value: input2[key2], issues: [] }, ctx);
25383
25383
  if (result instanceof Promise) {
25384
25384
  proms.push(result.then((result2) => {
25385
25385
  if (result2.issues.length) {
25386
- payload.issues.push(...prefixIssues(key, result2.issues));
25386
+ payload.issues.push(...prefixIssues(key2, result2.issues));
25387
25387
  }
25388
25388
  payload.value[outKey] = result2.value;
25389
25389
  }));
25390
25390
  } else {
25391
25391
  if (result.issues.length) {
25392
- payload.issues.push(...prefixIssues(key, result.issues));
25392
+ payload.issues.push(...prefixIssues(key2, result.issues));
25393
25393
  }
25394
25394
  payload.value[outKey] = result.value;
25395
25395
  }
@@ -25429,20 +25429,20 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
25429
25429
  payload.value = memo2 ? memo2.alloc(inst, payload, /* @__PURE__ */ new Map(), ctx) : /* @__PURE__ */ new Map();
25430
25430
  const abortEarly = ctx?.abortEarly;
25431
25431
  let seen = payload.issues.length;
25432
- for (const [key, value] of input2) {
25432
+ for (const [key2, value] of input2) {
25433
25433
  if (abortEarly && payload.issues.length !== seen) {
25434
25434
  if (aborted(payload, seen))
25435
25435
  break;
25436
25436
  seen = payload.issues.length;
25437
25437
  }
25438
- const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
25438
+ const keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
25439
25439
  const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
25440
25440
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
25441
25441
  proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
25442
- handleMapResult(keyResult2, valueResult2, payload, key, input2, inst, ctx);
25442
+ handleMapResult(keyResult2, valueResult2, payload, key2, input2, inst, ctx);
25443
25443
  }));
25444
25444
  } else {
25445
- handleMapResult(keyResult, valueResult, payload, key, input2, inst, ctx);
25445
+ handleMapResult(keyResult, valueResult, payload, key2, input2, inst, ctx);
25446
25446
  }
25447
25447
  }
25448
25448
  if (proms.length)
@@ -25451,10 +25451,10 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
25451
25451
  };
25452
25452
  capSize(inst, mapSize);
25453
25453
  });
25454
- function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
25454
+ function handleMapResult(keyResult, valueResult, final, key2, input2, inst, ctx) {
25455
25455
  if (keyResult.issues.length) {
25456
- if (propertyKeyTypes.has(typeof key)) {
25457
- final.issues.push(...prefixIssues(key, keyResult.issues));
25456
+ if (propertyKeyTypes.has(typeof key2)) {
25457
+ final.issues.push(...prefixIssues(key2, keyResult.issues));
25458
25458
  } else {
25459
25459
  final.issues.push({
25460
25460
  code: "invalid_key",
@@ -25466,15 +25466,15 @@ function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx)
25466
25466
  }
25467
25467
  }
25468
25468
  if (valueResult.issues.length) {
25469
- if (propertyKeyTypes.has(typeof key)) {
25470
- final.issues.push(...prefixIssues(key, valueResult.issues));
25469
+ if (propertyKeyTypes.has(typeof key2)) {
25470
+ final.issues.push(...prefixIssues(key2, valueResult.issues));
25471
25471
  } else {
25472
25472
  final.issues.push({
25473
25473
  origin: "map",
25474
25474
  code: "invalid_element",
25475
25475
  input: input2,
25476
25476
  inst,
25477
- key,
25477
+ key: key2,
25478
25478
  issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
25479
25479
  });
25480
25480
  }
@@ -26149,8 +26149,8 @@ function isRecursive(inst, stack, resolve) {
26149
26149
  };
26150
26150
  const shape = (sh, spread) => {
26151
26151
  let answer = NONE;
26152
- for (const key of Reflect.ownKeys(sh)) {
26153
- const desc = Object.getOwnPropertyDescriptor(sh, key);
26152
+ for (const key2 of Reflect.ownKeys(sh)) {
26153
+ const desc = Object.getOwnPropertyDescriptor(sh, key2);
26154
26154
  if (spread && !desc.enumerable)
26155
26155
  continue;
26156
26156
  const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
@@ -26246,8 +26246,8 @@ function isRecursive(inst, stack, resolve) {
26246
26246
  break;
26247
26247
  default: {
26248
26248
  kind;
26249
- for (const key in def) {
26250
- const desc = Object.getOwnPropertyDescriptor(def, key);
26249
+ for (const key2 in def) {
26250
+ const desc = Object.getOwnPropertyDescriptor(def, key2);
26251
26251
  if (!desc || desc.get)
26252
26252
  continue;
26253
26253
  const value = desc.value;
@@ -34380,11 +34380,11 @@ function generatePropertiesChecks(doc, ctx, def, accessor) {
34380
34380
  }
34381
34381
  doc.write(`if (${accessor} == null) return INVALID;`);
34382
34382
  const shape = def.shape;
34383
- for (const key of Reflect.ownKeys(shape)) {
34384
- const keyExpr = typeof key === "symbol" ? addConstant(ctx, key) : esc(key);
34383
+ for (const key2 of Reflect.ownKeys(shape)) {
34384
+ const keyExpr = typeof key2 === "symbol" ? addConstant(ctx, key2) : esc(key2);
34385
34385
  const inputVar = newVar(ctx);
34386
34386
  doc.write(`const ${inputVar} = ${accessor}[${keyExpr}];`);
34387
- compileChild(doc, ctx, shape[key], inputVar, false);
34387
+ compileChild(doc, ctx, shape[key2], inputVar, false);
34388
34388
  }
34389
34389
  }
34390
34390
  function generatePropertyCheck(doc, ctx, def, accessor) {
@@ -34777,9 +34777,9 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
34777
34777
  throw new ZodCompileUnsupportedError('object shape key "__proto__"');
34778
34778
  }
34779
34779
  const propOutputs = /* @__PURE__ */ new Map();
34780
- for (const key of allKeys) {
34781
- const propSchema = propShape[key];
34782
- const kx = keyExpr(key);
34780
+ for (const key2 of allKeys) {
34781
+ const propSchema = propShape[key2];
34782
+ const kx = keyExpr(key2);
34783
34783
  const inputVar = newVar(ctx);
34784
34784
  doc.write(`const ${inputVar} = ${accessor}[${kx}];`);
34785
34785
  if (propSchema._zod.optin !== void 0) {
@@ -34800,14 +34800,14 @@ function generateObjectCheck(doc, ctx, schema, accessor, buildsValue = true) {
34800
34800
  } else {
34801
34801
  doc.write(`if (${outputVar2} === INVALID) return INVALID;`);
34802
34802
  }
34803
- propOutputs.set(key, outputVar2);
34803
+ propOutputs.set(key2, outputVar2);
34804
34804
  } else {
34805
34805
  if (requiresPresenceCheck(propSchema)) {
34806
34806
  doc.write(`if (!(${kx} in ${accessor})) return INVALID;`);
34807
34807
  }
34808
34808
  const outputAccessor = compileChild(doc, ctx, propSchema, inputVar, buildsValue);
34809
34809
  if (outputAccessor !== null)
34810
- propOutputs.set(key, outputAccessor);
34810
+ propOutputs.set(key2, outputAccessor);
34811
34811
  }
34812
34812
  }
34813
34813
  const catchall = def.catchall;
@@ -35228,9 +35228,9 @@ function generateTupleCheck(doc, ctx, schema, accessor) {
35228
35228
  }
35229
35229
  return outputVar;
35230
35230
  }
35231
- function getTupleOptStart2(items, key) {
35231
+ function getTupleOptStart2(items, key2) {
35232
35232
  for (let i = items.length - 1; i >= 0; i--) {
35233
- const omittable = key === "optin" ? items[i]._zod.optin !== void 0 : items[i]._zod.optout === "optional";
35233
+ const omittable = key2 === "optin" ? items[i]._zod.optin !== void 0 : items[i]._zod.optout === "optional";
35234
35234
  if (!omittable)
35235
35235
  return i + 1;
35236
35236
  }
@@ -35360,16 +35360,16 @@ function generateRecordCheck(doc, ctx, schema, accessor) {
35360
35360
  const keyValues = recordDef.partial ? void 0 : def.keyType._zod.values;
35361
35361
  if (keyValues) {
35362
35362
  const inputKeys = [];
35363
- for (const key of keyValues) {
35364
- if (!(typeof key === "string" || typeof key === "number" || typeof key === "symbol")) {
35365
- throw new ZodCompileUnsupportedError(`record key value ${String(key)}`);
35363
+ for (const key2 of keyValues) {
35364
+ if (!(typeof key2 === "string" || typeof key2 === "number" || typeof key2 === "symbol")) {
35365
+ throw new ZodCompileUnsupportedError(`record key value ${String(key2)}`);
35366
35366
  }
35367
- const inputKey = typeof key === "number" ? key.toString() : key;
35367
+ const inputKey = typeof key2 === "number" ? key2.toString() : key2;
35368
35368
  if (inputKey === "__proto__") {
35369
35369
  throw new ZodCompileUnsupportedError('record key "__proto__"');
35370
35370
  }
35371
35371
  inputKeys.push(inputKey);
35372
- const keyConst = addConstant(ctx, key);
35372
+ const keyConst = addConstant(ctx, key2);
35373
35373
  const outKey = generateCheck(doc, ctx, def.keyType, keyConst);
35374
35374
  const valueVar = newVar(ctx);
35375
35375
  doc.write(`const ${valueVar} = ${accessor}[${literalPropertyKey(ctx, inputKey)}];`);
@@ -35447,10 +35447,10 @@ function emitOwnKeys(doc, ctx, accessor, kVar, body, onSymbol) {
35447
35447
  });
35448
35448
  doc.write(`}`);
35449
35449
  }
35450
- function literalPropertyKey(ctx, key) {
35451
- if (typeof key === "string")
35452
- return esc(key);
35453
- return addConstant(ctx, key);
35450
+ function literalPropertyKey(ctx, key2) {
35451
+ if (typeof key2 === "string")
35452
+ return esc(key2);
35453
+ return addConstant(ctx, key2);
35454
35454
  }
35455
35455
  function generateMapCheck(doc, ctx, schema, accessor) {
35456
35456
  const def = schema._zod.def;
@@ -36679,9 +36679,9 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
36679
36679
  // ../../commander/node_modules/zod/v4/core/to-json-schema.js
36680
36680
  function assignProps(target, ...sources) {
36681
36681
  for (const source of sources) {
36682
- for (const key of Reflect.ownKeys(source)) {
36683
- if (Object.prototype.propertyIsEnumerable.call(source, key)) {
36684
- assignProp(target, key, source[key]);
36682
+ for (const key2 of Reflect.ownKeys(source)) {
36683
+ if (Object.prototype.propertyIsEnumerable.call(source, key2)) {
36684
+ assignProp(target, key2, source[key2]);
36685
36685
  }
36686
36686
  }
36687
36687
  }
@@ -36827,8 +36827,8 @@ function extractDefs(ctx, schema) {
36827
36827
  if (defId)
36828
36828
  seen.defId = defId;
36829
36829
  const schema2 = seen.schema;
36830
- for (const key in schema2) {
36831
- delete schema2[key];
36830
+ for (const key2 in schema2) {
36831
+ delete schema2[key2];
36832
36832
  }
36833
36833
  schema2.$ref = ref;
36834
36834
  };
@@ -36909,8 +36909,8 @@ function foldObjects(members2) {
36909
36909
  for (const member of members2) {
36910
36910
  if (typeof member !== "object" || member.type !== "object")
36911
36911
  return null;
36912
- for (const key in member) {
36913
- if (!FOLDABLE_KEYS.has(key))
36912
+ for (const key2 in member) {
36913
+ if (!FOLDABLE_KEYS.has(key2))
36914
36914
  return null;
36915
36915
  }
36916
36916
  objects.push(member);
@@ -36918,22 +36918,22 @@ function foldObjects(members2) {
36918
36918
  const properties = {};
36919
36919
  const required2 = /* @__PURE__ */ new Set();
36920
36920
  for (const object3 of objects) {
36921
- for (const key in object3.properties) {
36922
- if (Object.prototype.hasOwnProperty.call(properties, key))
36921
+ for (const key2 in object3.properties) {
36922
+ if (Object.prototype.hasOwnProperty.call(properties, key2))
36923
36923
  continue;
36924
36924
  const parts = [];
36925
36925
  for (const other of objects) {
36926
- const part2 = other.properties?.[key] ?? undeclaredConstraint(other);
36926
+ const part2 = other.properties?.[key2] ?? undeclaredConstraint(other);
36927
36927
  if (part2 === null || part2 === void 0)
36928
36928
  continue;
36929
36929
  if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part2)))
36930
36930
  parts.push(part2);
36931
36931
  }
36932
36932
  const merged = parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts };
36933
- assignProp(properties, key, merged);
36933
+ assignProp(properties, key2, merged);
36934
36934
  }
36935
- for (const key of object3.required ?? [])
36936
- required2.add(key);
36935
+ for (const key2 of object3.required ?? [])
36936
+ required2.add(key2);
36937
36937
  }
36938
36938
  const folded = { type: "object", properties };
36939
36939
  if (required2.size)
@@ -36958,8 +36958,8 @@ function foldIntersection(json3) {
36958
36958
  const allOf = json3.allOf;
36959
36959
  if (!Array.isArray(allOf) || allOf.length < 2)
36960
36960
  return;
36961
- for (const key of FOLDABLE_KEYS)
36962
- if (key in json3)
36961
+ for (const key2 of FOLDABLE_KEYS)
36962
+ if (key2 in json3)
36963
36963
  return;
36964
36964
  const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));
36965
36965
  let folded = null;
@@ -37006,20 +37006,20 @@ function finalize(ctx, schema) {
37006
37006
  assignProps(schema2, _cached);
37007
37007
  const isParentRef = zodSchema._zod.parent === ref;
37008
37008
  if (isParentRef) {
37009
- for (const key in schema2) {
37010
- if (key === "$ref" || key === "allOf")
37009
+ for (const key2 in schema2) {
37010
+ if (key2 === "$ref" || key2 === "allOf")
37011
37011
  continue;
37012
- if (!(key in _cached)) {
37013
- delete schema2[key];
37012
+ if (!(key2 in _cached)) {
37013
+ delete schema2[key2];
37014
37014
  }
37015
37015
  }
37016
37016
  }
37017
37017
  if (refSchema.$ref && refSeen.def) {
37018
- for (const key in schema2) {
37019
- if (key === "$ref" || key === "allOf")
37018
+ for (const key2 in schema2) {
37019
+ if (key2 === "$ref" || key2 === "allOf")
37020
37020
  continue;
37021
- if (key in refSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(refSeen.def[key])) {
37022
- delete schema2[key];
37021
+ if (key2 in refSeen.def && JSON.stringify(schema2[key2]) === JSON.stringify(refSeen.def[key2])) {
37022
+ delete schema2[key2];
37023
37023
  }
37024
37024
  }
37025
37025
  }
@@ -37031,11 +37031,11 @@ function finalize(ctx, schema) {
37031
37031
  if (parentSeen?.schema.$ref) {
37032
37032
  schema2.$ref = parentSeen.schema.$ref;
37033
37033
  if (parentSeen.def) {
37034
- for (const key in schema2) {
37035
- if (key === "$ref" || key === "allOf")
37034
+ for (const key2 in schema2) {
37035
+ if (key2 === "$ref" || key2 === "allOf")
37036
37036
  continue;
37037
- if (key in parentSeen.def && JSON.stringify(schema2[key]) === JSON.stringify(parentSeen.def[key])) {
37038
- delete schema2[key];
37037
+ if (key2 in parentSeen.def && JSON.stringify(schema2[key2]) === JSON.stringify(parentSeen.def[key2])) {
37038
+ delete schema2[key2];
37039
37039
  }
37040
37040
  }
37041
37041
  }
@@ -37168,8 +37168,8 @@ function isTransforming(_schema, _ctx) {
37168
37168
  return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
37169
37169
  }
37170
37170
  if (def.type === "object") {
37171
- for (const key in def.shape) {
37172
- if (isTransforming(def.shape[key], ctx))
37171
+ for (const key2 in def.shape) {
37172
+ if (isTransforming(def.shape[key2], ctx))
37173
37173
  return true;
37174
37174
  }
37175
37175
  return false;
@@ -37207,13 +37207,13 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
37207
37207
  };
37208
37208
 
37209
37209
  // ../../commander/node_modules/zod/v4/core/json-schema-processors.js
37210
- var narrowMin = (agg, key, value) => {
37211
- if (agg[key] === void 0 || value > agg[key])
37212
- agg[key] = value;
37210
+ var narrowMin = (agg, key2, value) => {
37211
+ if (agg[key2] === void 0 || value > agg[key2])
37212
+ agg[key2] = value;
37213
37213
  };
37214
- var narrowMax = (agg, key, value) => {
37215
- if (agg[key] === void 0 || value < agg[key])
37216
- agg[key] = value;
37214
+ var narrowMax = (agg, key2, value) => {
37215
+ if (agg[key2] === void 0 || value < agg[key2])
37216
+ agg[key2] = value;
37217
37217
  };
37218
37218
  var narrowBoth = (agg, value) => {
37219
37219
  narrowMin(agg, "minimum", value);
@@ -37551,17 +37551,17 @@ var objectProcessor = (schema, ctx, _json, params) => {
37551
37551
  }
37552
37552
  json3.type = "object";
37553
37553
  json3.properties = {};
37554
- for (const key in shape) {
37555
- assignProp(json3.properties, key, processSchema(shape[key], ctx, {
37554
+ for (const key2 in shape) {
37555
+ assignProp(json3.properties, key2, processSchema(shape[key2], ctx, {
37556
37556
  ...params,
37557
- path: [...params.path, "properties", key]
37557
+ path: [...params.path, "properties", key2]
37558
37558
  }));
37559
37559
  }
37560
37560
  const requiredKeys = [];
37561
- for (const key of Object.keys(shape)) {
37562
- const field = def.shape[key];
37561
+ for (const key2 of Object.keys(shape)) {
37562
+ const field = def.shape[key2];
37563
37563
  if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) {
37564
- requiredKeys.push(key);
37564
+ requiredKeys.push(key2);
37565
37565
  }
37566
37566
  }
37567
37567
  if (requiredKeys.length > 0) {
@@ -37936,9 +37936,9 @@ function toJSONSchema(input2, params) {
37936
37936
  };
37937
37937
  ctx2.external = external;
37938
37938
  for (const entry of registry2._idmap.entries()) {
37939
- const [key, schema] = entry;
37939
+ const [key2, schema] = entry;
37940
37940
  extractDefs(ctx2, schema);
37941
- assignProp(schemas, key, finalize(ctx2, schema));
37941
+ assignProp(schemas, key2, finalize(ctx2, schema));
37942
37942
  }
37943
37943
  if (Object.keys(defs).length > 0) {
37944
37944
  const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
@@ -38897,17 +38897,17 @@ __export(checks_exports2, {
38897
38897
 
38898
38898
  // ../../commander/node_modules/zod/v4/classic/errors.js
38899
38899
  var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
38900
- function _lazyMethod(proto, key, make) {
38901
- Object.defineProperty(proto, key, {
38900
+ function _lazyMethod(proto, key2, make) {
38901
+ Object.defineProperty(proto, key2, {
38902
38902
  configurable: true,
38903
38903
  enumerable: false,
38904
38904
  get() {
38905
38905
  const value = make(this);
38906
- Object.defineProperty(this, key, { value, configurable: true, writable: true });
38906
+ Object.defineProperty(this, key2, { value, configurable: true, writable: true });
38907
38907
  return value;
38908
38908
  },
38909
38909
  set(value) {
38910
- Object.defineProperty(this, key, { value, configurable: true, writable: true });
38910
+ Object.defineProperty(this, key2, { value, configurable: true, writable: true });
38911
38911
  }
38912
38912
  });
38913
38913
  }
@@ -40577,11 +40577,11 @@ function resolveRef(ref, ctx) {
40577
40577
  }
40578
40578
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
40579
40579
  if (path[0] === defsKey) {
40580
- const key = path[1] === void 0 ? void 0 : decodeJSONPointerSegment(path[1]);
40581
- if (!key || !ctx.defs[key]) {
40580
+ const key2 = path[1] === void 0 ? void 0 : decodeJSONPointerSegment(path[1]);
40581
+ if (!key2 || !ctx.defs[key2]) {
40582
40582
  throw new Error(`Reference not found: ${ref}`);
40583
40583
  }
40584
- return ctx.defs[key];
40584
+ return ctx.defs[key2];
40585
40585
  }
40586
40586
  throw new Error(`Reference not found: ${ref}`);
40587
40587
  }
@@ -40616,16 +40616,16 @@ function checkObjectGuards(objectSchema, guards) {
40616
40616
  });
40617
40617
  }
40618
40618
  if (guards.keySchema) {
40619
- for (const key of keys) {
40620
- const result = guards.keySchema.safeParse(key);
40619
+ for (const key2 of keys) {
40620
+ const result = guards.keySchema.safeParse(key2);
40621
40621
  if (result.success)
40622
40622
  continue;
40623
40623
  payload.issues.push({
40624
40624
  code: "invalid_key",
40625
40625
  origin: "record",
40626
40626
  issues: result.error.issues,
40627
- input: key,
40628
- path: [key],
40627
+ input: key2,
40628
+ path: [key2],
40629
40629
  continue: true
40630
40630
  });
40631
40631
  }
@@ -40650,20 +40650,20 @@ function canonicalKey(value, seen) {
40650
40650
  if (Array.isArray(value)) {
40651
40651
  const parts2 = [];
40652
40652
  for (const item of value) {
40653
- const key = canonicalKey(item, seen);
40654
- if (key === null)
40653
+ const key2 = canonicalKey(item, seen);
40654
+ if (key2 === null)
40655
40655
  return null;
40656
- parts2.push(key);
40656
+ parts2.push(key2);
40657
40657
  }
40658
40658
  return `a${parts2.length}:[${parts2.join(",")}]`;
40659
40659
  }
40660
40660
  const keys = Object.keys(value).sort();
40661
40661
  const parts = [];
40662
40662
  for (const k of keys) {
40663
- const key = canonicalKey(value[k], seen);
40664
- if (key === null)
40663
+ const key2 = canonicalKey(value[k], seen);
40664
+ if (key2 === null)
40665
40665
  return null;
40666
- parts.push(`${k.length}:${k}=${key}`);
40666
+ parts.push(`${k.length}:${k}=${key2}`);
40667
40667
  }
40668
40668
  return `o${parts.length}:{${parts.join(",")}}`;
40669
40669
  } finally {
@@ -40703,10 +40703,10 @@ function containsRef(value) {
40703
40703
  return value.some(containsRef);
40704
40704
  if (typeof value.$ref === "string")
40705
40705
  return true;
40706
- return Object.entries(value).some(([key, sub]) => {
40707
- if (SCHEMA_KEYWORDS.has(key))
40706
+ return Object.entries(value).some(([key2, sub]) => {
40707
+ if (SCHEMA_KEYWORDS.has(key2))
40708
40708
  return containsRef(sub);
40709
- if (!SCHEMA_MAP_KEYWORDS.has(key) || typeof sub !== "object" || sub === null)
40709
+ if (!SCHEMA_MAP_KEYWORDS.has(key2) || typeof sub !== "object" || sub === null)
40710
40710
  return false;
40711
40711
  return Object.values(sub).some(containsRef);
40712
40712
  });
@@ -40722,12 +40722,12 @@ function checkArrayGuards(arraySchema, guards) {
40722
40722
  if (guards.uniqueItems === true) {
40723
40723
  const firstSeen = /* @__PURE__ */ new Map();
40724
40724
  for (let i = 0; i < items.length; i++) {
40725
- const key = canonicalKey(items[i], /* @__PURE__ */ new Set());
40726
- if (key === null)
40725
+ const key2 = canonicalKey(items[i], /* @__PURE__ */ new Set());
40726
+ if (key2 === null)
40727
40727
  continue;
40728
- const first = firstSeen.get(key);
40728
+ const first = firstSeen.get(key2);
40729
40729
  if (first === void 0) {
40730
- firstSeen.set(key, i);
40730
+ firstSeen.set(key2, i);
40731
40731
  continue;
40732
40732
  }
40733
40733
  payload.issues.push({
@@ -40966,9 +40966,9 @@ function convertBaseSchema(schema, ctx) {
40966
40966
  const properties = schema.properties || {};
40967
40967
  const requiredSet = new Set(schema.required || []);
40968
40968
  const additionalSchema = typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : void 0;
40969
- for (const [key, propSchema] of Object.entries(properties)) {
40969
+ for (const [key2, propSchema] of Object.entries(properties)) {
40970
40970
  const propZodSchema = convertSchema(propSchema, ctx);
40971
- assignProp(shape, key, requiredSet.has(key) ? propZodSchema : propZodSchema.optional());
40971
+ assignProp(shape, key2, requiredSet.has(key2) ? propZodSchema : propZodSchema.optional());
40972
40972
  }
40973
40973
  if (schema.patternProperties) {
40974
40974
  const patternProps = schema.patternProperties;
@@ -41003,12 +41003,12 @@ function convertBaseSchema(schema, ctx) {
41003
41003
  if (!isPlainObject(payload.value))
41004
41004
  return;
41005
41005
  const unrecognized = [];
41006
- for (const key of Object.keys(payload.value)) {
41007
- if (propertyKeys.includes(key))
41006
+ for (const key2 of Object.keys(payload.value)) {
41007
+ if (propertyKeys.includes(key2))
41008
41008
  continue;
41009
- if (patterns.some((regex) => regex.test(key)))
41009
+ if (patterns.some((regex) => regex.test(key2)))
41010
41010
  continue;
41011
- unrecognized.push(key);
41011
+ unrecognized.push(key2);
41012
41012
  }
41013
41013
  if (unrecognized.length) {
41014
41014
  payload.issues.push({
@@ -41139,38 +41139,38 @@ function convertSchema(schema, ctx) {
41139
41139
  }
41140
41140
  const extraMeta = {};
41141
41141
  const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
41142
- for (const key of coreMetadataKeys) {
41143
- if (key in schema) {
41144
- extraMeta[key] = schema[key];
41142
+ for (const key2 of coreMetadataKeys) {
41143
+ if (key2 in schema) {
41144
+ extraMeta[key2] = schema[key2];
41145
41145
  }
41146
41146
  }
41147
41147
  const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
41148
- for (const key of contentMetadataKeys) {
41149
- if (key in schema) {
41150
- extraMeta[key] = schema[key];
41148
+ for (const key2 of contentMetadataKeys) {
41149
+ if (key2 in schema) {
41150
+ extraMeta[key2] = schema[key2];
41151
41151
  }
41152
41152
  }
41153
41153
  if (schema.type === "object" && schema.$ref === void 0) {
41154
41154
  if (schema.propertyNames !== void 0 && !containsRef(schema.propertyNames)) {
41155
41155
  extraMeta.propertyNames = schema.propertyNames;
41156
41156
  }
41157
- for (const key of ["minProperties", "maxProperties"]) {
41158
- if (schema[key] !== void 0)
41159
- extraMeta[key] = schema[key];
41157
+ for (const key2 of ["minProperties", "maxProperties"]) {
41158
+ if (schema[key2] !== void 0)
41159
+ extraMeta[key2] = schema[key2];
41160
41160
  }
41161
41161
  }
41162
41162
  if (schema.type === "array" && schema.$ref === void 0) {
41163
41163
  if (schema.contains !== void 0 && !containsRef(schema.contains)) {
41164
41164
  extraMeta.contains = schema.contains;
41165
41165
  }
41166
- for (const key of ["uniqueItems", "minContains", "maxContains"]) {
41167
- if (schema[key] !== void 0)
41168
- extraMeta[key] = schema[key];
41166
+ for (const key2 of ["uniqueItems", "minContains", "maxContains"]) {
41167
+ if (schema[key2] !== void 0)
41168
+ extraMeta[key2] = schema[key2];
41169
41169
  }
41170
41170
  }
41171
- for (const key of Object.keys(schema)) {
41172
- if (!RECOGNIZED_KEYS.has(key)) {
41173
- assignProp(extraMeta, key, schema[key]);
41171
+ for (const key2 of Object.keys(schema)) {
41172
+ if (!RECOGNIZED_KEYS.has(key2)) {
41173
+ assignProp(extraMeta, key2, schema[key2]);
41174
41174
  }
41175
41175
  }
41176
41176
  if (Object.keys(extraMeta).length > 0) {
@@ -42863,19 +42863,19 @@ var getRefs = (options) => {
42863
42863
  };
42864
42864
 
42865
42865
  // ../../commander/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
42866
- function addErrorMessage(res, key, errorMessage, refs2) {
42866
+ function addErrorMessage(res, key2, errorMessage, refs2) {
42867
42867
  if (!refs2?.errorMessages)
42868
42868
  return;
42869
42869
  if (errorMessage) {
42870
42870
  res.errorMessage = {
42871
42871
  ...res.errorMessage,
42872
- [key]: errorMessage
42872
+ [key2]: errorMessage
42873
42873
  };
42874
42874
  }
42875
42875
  }
42876
- function setResponseValueAndErrors(res, key, value, errorMessage, refs2) {
42877
- res[key] = value;
42878
- addErrorMessage(res, key, errorMessage, refs2);
42876
+ function setResponseValueAndErrors(res, key2, value, errorMessage, refs2) {
42877
+ res[key2] = value;
42878
+ addErrorMessage(res, key2, errorMessage, refs2);
42879
42879
  }
42880
42880
 
42881
42881
  // ../../commander/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
@@ -43467,11 +43467,11 @@ function parseRecordDef(def, refs2) {
43467
43467
  return {
43468
43468
  type: "object",
43469
43469
  required: def.keyType._def.values,
43470
- properties: def.keyType._def.values.reduce((acc, key) => ({
43470
+ properties: def.keyType._def.values.reduce((acc, key2) => ({
43471
43471
  ...acc,
43472
- [key]: parseDef(def.valueType._def, {
43472
+ [key2]: parseDef(def.valueType._def, {
43473
43473
  ...refs2,
43474
- currentPath: [...refs2.currentPath, "properties", key]
43474
+ currentPath: [...refs2.currentPath, "properties", key2]
43475
43475
  }) ?? parseAnyDef(refs2)
43476
43476
  }), {}),
43477
43477
  additionalProperties: refs2.rejectedAdditionalProperties
@@ -43538,10 +43538,10 @@ function parseMapDef(def, refs2) {
43538
43538
  // ../../commander/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js
43539
43539
  function parseNativeEnumDef(def) {
43540
43540
  const object3 = def.values;
43541
- const actualKeys = Object.keys(def.values).filter((key) => {
43542
- return typeof object3[object3[key]] !== "number";
43541
+ const actualKeys = Object.keys(def.values).filter((key2) => {
43542
+ return typeof object3[object3[key2]] !== "number";
43543
43543
  });
43544
- const actualValues = actualKeys.map((key) => object3[key]);
43544
+ const actualValues = actualKeys.map((key2) => object3[key2]);
43545
43545
  const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
43546
43546
  return {
43547
43547
  type: parsedTypes.length === 1 ? parsedTypes[0] === "string" ? "string" : "number" : ["string", "number"],
@@ -45095,8 +45095,8 @@ function isPlainObject2(value) {
45095
45095
  }
45096
45096
  function mergeCapabilities(base, additional) {
45097
45097
  const result = { ...base };
45098
- for (const key in additional) {
45099
- const k = key;
45098
+ for (const key2 in additional) {
45099
+ const k = key2;
45100
45100
  const addValue = additional[k];
45101
45101
  if (addValue === void 0)
45102
45102
  continue;
@@ -45900,12 +45900,12 @@ function toolInputElementCount(value, max) {
45900
45900
  stack.push(child);
45901
45901
  }
45902
45902
  } else {
45903
- for (const key in node2) {
45904
- if (!Object.prototype.hasOwnProperty.call(node2, key))
45903
+ for (const key2 in node2) {
45904
+ if (!Object.prototype.hasOwnProperty.call(node2, key2))
45905
45905
  continue;
45906
45906
  if (++count2 > max)
45907
45907
  return count2;
45908
- const child = node2[key];
45908
+ const child = node2[key2];
45909
45909
  if (child !== null && typeof child === "object")
45910
45910
  stack.push(child);
45911
45911
  }
@@ -46832,6 +46832,32 @@ var StdioServerTransport = class {
46832
46832
  }
46833
46833
  };
46834
46834
 
46835
+ // ../src/lib/deckPlan/carefulPlay.ts
46836
+ var CAREFUL = {
46837
+ pilot: { turns: 5, candidates: 8, reshuffles: 4 },
46838
+ /** Careful play's games: desktop, and a phone (or the MCP: one thread). */
46839
+ games: 2e3,
46840
+ phoneGames: 300,
46841
+ /** The desktop check behind the "leans on play" note: careful vs plain on
46842
+ * the same first `checkGames` games, and the gap that shows it. */
46843
+ checkGames: 400,
46844
+ gap: 0.05
46845
+ };
46846
+ function carefulInput(input2, games) {
46847
+ return { ...input2, opts: { ...input2.opts, trials: games, careful: { ...CAREFUL.pilot } } };
46848
+ }
46849
+ function range95(p, n) {
46850
+ const z2 = 1.96;
46851
+ const d = 1 + z2 * z2 / n;
46852
+ const c = (p + z2 * z2 / (2 * n)) / d;
46853
+ const h = z2 * Math.sqrt(p * (1 - p) / n + z2 * z2 / (4 * n * n)) / d;
46854
+ return [Math.max(0, Math.floor(100 * (c - h))), Math.min(100, Math.ceil(100 * (c + h)))];
46855
+ }
46856
+ function rangeText(p, n) {
46857
+ const [lo, hi] = range95(p, n);
46858
+ return `${lo} to ${hi}%`;
46859
+ }
46860
+
46835
46861
  // ../src/lib/parser/csv.ts
46836
46862
  init_normalize();
46837
46863
  var FIELD_ALIASES = {
@@ -47369,9 +47395,9 @@ async function fetchByIdentity(identities) {
47369
47395
  identities.map((i) => ({ set: i.set, collector_number: i.collectorNumber }))
47370
47396
  );
47371
47397
  const out = /* @__PURE__ */ new Map();
47372
- for (const [key, rec] of records) {
47398
+ for (const [key2, rec] of records) {
47373
47399
  if (rec.image)
47374
- out.set(key, {
47400
+ out.set(key2, {
47375
47401
  oracleId: rec.oracleId,
47376
47402
  image: rec.image,
47377
47403
  ...rec.backImage ? { backImage: rec.backImage } : {},
@@ -47457,9 +47483,9 @@ async function getBakedIdentityArt(identities) {
47457
47483
  for (const oid of Object.keys(loadedStructs)) {
47458
47484
  for (const st of loadedStructs[oid]) {
47459
47485
  if (!st.i) continue;
47460
- const key = printingKey(st.s, st.c);
47461
- if (index.has(key)) continue;
47462
- index.set(key, {
47486
+ const key2 = printingKey(st.s, st.c);
47487
+ if (index.has(key2)) continue;
47488
+ index.set(key2, {
47463
47489
  oracleId: oid,
47464
47490
  image: expandImageUrl(st.i),
47465
47491
  ...st.b ? { backImage: st.b } : {}
@@ -47483,11 +47509,11 @@ init_slug();
47483
47509
 
47484
47510
  // ../src/lib/ranking/findCardByName.ts
47485
47511
  function findCardByName(cards, name) {
47486
- const key = name.toLowerCase();
47487
- const direct = cards.byName.get(key) ?? cards.byFaceName.get(key);
47512
+ const key2 = name.toLowerCase();
47513
+ const direct = cards.byName.get(key2) ?? cards.byFaceName.get(key2);
47488
47514
  if (direct) return direct;
47489
47515
  const norm = normalizeName(name);
47490
- if (norm === key) return void 0;
47516
+ if (norm === key2) return void 0;
47491
47517
  return cards.byNormalizedName.get(norm) ?? cards.byNormalizedFaceName.get(norm);
47492
47518
  }
47493
47519
  function colorsFit(card, allowed) {
@@ -48105,8 +48131,8 @@ function isArchidektLinkList(input2) {
48105
48131
  function deckUrlHost(input2) {
48106
48132
  const m = input2.trim().match(/^https?:\/\/(?:www\.)?(moxfield|tappedout|aetherhub|deckstats)\./i);
48107
48133
  if (!m) return null;
48108
- const key = m[1].toLowerCase();
48109
- return { moxfield: "Moxfield", tappedout: "TappedOut", aetherhub: "AetherHub", deckstats: "Deckstats" }[key] ?? null;
48134
+ const key2 = m[1].toLowerCase();
48135
+ return { moxfield: "Moxfield", tappedout: "TappedOut", aetherhub: "AetherHub", deckstats: "Deckstats" }[key2] ?? null;
48110
48136
  }
48111
48137
  function buildImportNotices(stats, format, hasCommander, commanderKnown = false) {
48112
48138
  const notices = [];
@@ -48777,10 +48803,10 @@ async function resolveMissingArt(overrides, set3, get) {
48777
48803
  const next = new Map(get().resolvedArt);
48778
48804
  let added = 0;
48779
48805
  for (const w of wanted) {
48780
- const key = printingKey(w.set, w.collectorNumber);
48781
- const rec = baked.get(key) ?? live.get(key);
48806
+ const key2 = printingKey(w.set, w.collectorNumber);
48807
+ const rec = baked.get(key2) ?? live.get(key2);
48782
48808
  if (!rec || rec.oracleId !== w.oracleId || !rec.image) continue;
48783
- next.set(key, {
48809
+ next.set(key2, {
48784
48810
  image: rec.image,
48785
48811
  ...rec.backImage ? { backImage: rec.backImage } : {}
48786
48812
  });
@@ -48846,12 +48872,12 @@ function buildImportedCategoryState(tagAssignments) {
48846
48872
  let seq = 0;
48847
48873
  const categoryFor = (rawName) => {
48848
48874
  const name = rawName.trim();
48849
- const key = name.toLowerCase();
48850
- if (!key) return null;
48851
- let cat = byLower.get(key);
48875
+ const key2 = name.toLowerCase();
48876
+ if (!key2) return null;
48877
+ let cat = byLower.get(key2);
48852
48878
  if (!cat) {
48853
48879
  cat = { id: `cat_imp_${seq++}`, name };
48854
- byLower.set(key, cat);
48880
+ byLower.set(key2, cat);
48855
48881
  }
48856
48882
  return cat;
48857
48883
  };
@@ -49005,9 +49031,9 @@ function countTwoCardInfiniteCombos(included) {
49005
49031
  const seen = /* @__PURE__ */ new Set();
49006
49032
  for (const v of included) {
49007
49033
  if (!isTwoCardInfiniteCombo(v)) continue;
49008
- const key = comboKey(v);
49009
- if (!key || seen.has(key)) continue;
49010
- seen.add(key);
49034
+ const key2 = comboKey(v);
49035
+ if (!key2 || seen.has(key2)) continue;
49036
+ seen.add(key2);
49011
49037
  }
49012
49038
  return seen.size;
49013
49039
  }
@@ -49021,10 +49047,10 @@ function dedupeForSpellbook(cards) {
49021
49047
  if (!trimmed) continue;
49022
49048
  const qty = c.quantity ?? 1;
49023
49049
  if (qty <= 0) continue;
49024
- const key = trimmed.toLowerCase();
49025
- const prev = merged.get(key);
49050
+ const key2 = trimmed.toLowerCase();
49051
+ const prev = merged.get(key2);
49026
49052
  if (prev) prev.quantity += qty;
49027
- else merged.set(key, { card: trimmed, quantity: qty });
49053
+ else merged.set(key2, { card: trimmed, quantity: qty });
49028
49054
  }
49029
49055
  return [...merged.values()];
49030
49056
  }
@@ -49036,13 +49062,13 @@ function comboPiecesKey(v) {
49036
49062
  function comboResultCounts(variants) {
49037
49063
  const byResult = /* @__PURE__ */ new Map();
49038
49064
  for (const v of variants) {
49039
- const key = comboPiecesKey(v);
49065
+ const key2 = comboPiecesKey(v);
49040
49066
  for (const p of v.produces) {
49041
49067
  const name = p.feature.name?.trim();
49042
49068
  if (!name) continue;
49043
49069
  let set3 = byResult.get(name);
49044
49070
  if (!set3) byResult.set(name, set3 = /* @__PURE__ */ new Set());
49045
- set3.add(key);
49071
+ set3.add(key2);
49046
49072
  }
49047
49073
  }
49048
49074
  return [...byResult].map(([result, keys]) => ({ result, combos: keys.size })).sort((a, b) => b.combos - a.combos || a.result.localeCompare(b.result));
@@ -49476,12 +49502,12 @@ function buildSpellbookRequest(entries2) {
49476
49502
  const trimmed = (e.name ?? "").trim();
49477
49503
  if (!trimmed) continue;
49478
49504
  if (e.quantity <= 0) continue;
49479
- const key = trimmed.toLowerCase();
49480
- const prev = merged.get(key);
49505
+ const key2 = trimmed.toLowerCase();
49506
+ const prev = merged.get(key2);
49481
49507
  if (prev) {
49482
49508
  prev.quantity += e.quantity;
49483
49509
  } else {
49484
- merged.set(key, { card: trimmed, quantity: e.quantity });
49510
+ merged.set(key2, { card: trimmed, quantity: e.quantity });
49485
49511
  }
49486
49512
  }
49487
49513
  return [...merged.values()];
@@ -49916,10 +49942,10 @@ var DEFAULT_DIR = {
49916
49942
  price: "desc"
49917
49943
  };
49918
49944
  var byName = (a, b) => a.card.name.localeCompare(b.card.name);
49919
- function sortOverlapRows(rows, key, dir, owned) {
49945
+ function sortOverlapRows(rows, key2, dir, owned) {
49920
49946
  const sign = dir === "asc" ? 1 : -1;
49921
49947
  const cmp = (a, b) => {
49922
- switch (key) {
49948
+ switch (key2) {
49923
49949
  case "name":
49924
49950
  return sign * byName(a, b);
49925
49951
  case "in":
@@ -54657,8 +54683,8 @@ function planWishlist(entries2, ops, cards, now) {
54657
54683
  continue;
54658
54684
  }
54659
54685
  const ref = { slug: toEdhrecSlug(card.name), ...wishPrinting(op) };
54660
- const key = wishlistKey(ref);
54661
- const at = next.findIndex((e) => wishlistKey(e) === key);
54686
+ const key2 = wishlistKey(ref);
54687
+ const at = next.findIndex((e) => wishlistKey(e) === key2);
54662
54688
  const detail = printingText(op);
54663
54689
  lines.push({ sign: op.op === "add" ? "+" : "\u2212", name: card.name, ...detail ? { detail } : {} });
54664
54690
  if (op.op === "add") {
@@ -55265,11 +55291,11 @@ function parseCost(manaCost) {
55265
55291
  if (/^\d+$/.test(s)) generic += Number(s);
55266
55292
  else if (s.length === 1 && "WUBRG".includes(s)) pips[s] = (pips[s] ?? 0) + 1;
55267
55293
  else if (/^[WUBRG]\/[WUBRG]$/.test(s)) {
55268
- const key = [s[0], s[2]].sort((a, b) => "WUBRG".indexOf(a) - "WUBRG".indexOf(b)).join("");
55269
- pips[key] = (pips[key] ?? 0) + 1;
55294
+ const key2 = [s[0], s[2]].sort((a, b) => "WUBRG".indexOf(a) - "WUBRG".indexOf(b)).join("");
55295
+ pips[key2] = (pips[key2] ?? 0) + 1;
55270
55296
  } else if (/^2\/[WUBRG]$/.test(s)) {
55271
- const key = `2${s[2]}`;
55272
- pips[key] = (pips[key] ?? 0) + 1;
55297
+ const key2 = `2${s[2]}`;
55298
+ pips[key2] = (pips[key2] ?? 0) + 1;
55273
55299
  } else if (/\/P$/.test(s)) phyrexian += 1;
55274
55300
  else if (s === "C") pips.C = (pips.C ?? 0) + 1;
55275
55301
  else if (s !== "X" && s !== "Y" && s !== "Z") generic += 1;
@@ -57324,16 +57350,16 @@ function toughnessOf(c) {
57324
57350
  }
57325
57351
  function castTriggerSources(manaProfiles, commanderReads, finder) {
57326
57352
  const out = [];
57327
- const add = (p, by) => (p.castTriggers ?? []).forEach((t, key) => out.push({ by, key, t, match: t.finds.trim() ? finder(t.finds.trim()) : () => true }));
57353
+ const add = (p, by) => (p.castTriggers ?? []).forEach((t, key2) => out.push({ by, key: key2, t, match: t.finds.trim() ? finder(t.finds.trim()) : () => true }));
57328
57354
  manaProfiles.forEach((p, r) => add(p, r));
57329
57355
  (commanderReads ?? []).forEach((p, z2) => add(p, -1 - z2));
57330
57356
  return out;
57331
57357
  }
57332
57358
  function triggersOn(card, self2, sources) {
57333
- return sources.filter((s) => s.by !== self2 && s.match(card)).map(({ by, key, t }) => {
57359
+ return sources.filter((s) => s.by !== self2 && s.match(card)).map(({ by, key: key2, t }) => {
57334
57360
  const { finds: _f, ...what } = t;
57335
57361
  void _f;
57336
- return { by, key, ...what };
57362
+ return { by, key: key2, ...what };
57337
57363
  });
57338
57364
  }
57339
57365
  function zoneEngineProfiles({
@@ -58413,12 +58439,12 @@ function playGame(state, reqs, profiles, opts, prep = preparePlay(reqs, profiles
58413
58439
  for (const d of died)
58414
58440
  for (const s of watching) {
58415
58441
  const dd = s < 0 ? opts.commanders[-1 - s].profile.diesDraw : profiles[s].diesDraw;
58416
- dd.forEach((x, key) => {
58442
+ dd.forEach((x, key2) => {
58417
58443
  if (x.another && s === d) return;
58418
58444
  if (x.own && s !== d) return;
58419
58445
  if (x.type && s !== d && !(d < 0 ? opts.commanders[-1 - d].profile?.types : profiles[d].types)?.includes(x.type)) return;
58420
58446
  if (x.oncePerTurn) {
58421
- const k = `d${s}:${key}`;
58447
+ const k = `d${s}:${key2}`;
58422
58448
  if (firedOnce.has(k)) return;
58423
58449
  firedOnce.add(k);
58424
58450
  }
@@ -59597,11 +59623,11 @@ function playGame(state, reqs, profiles, opts, prep = preparePlay(reqs, profiles
59597
59623
  let n2 = 0;
59598
59624
  for (const s of watching) {
59599
59625
  const dd = s < 0 ? opts.commanders[-1 - s].profile.diesDraw : profiles[s].diesDraw;
59600
- dd.forEach((x, key) => {
59626
+ dd.forEach((x, key2) => {
59601
59627
  if (x.another && s === d) return;
59602
59628
  if (x.own && s !== d) return;
59603
59629
  if (x.type && s !== d && !profiles[d].types?.includes(x.type)) return;
59604
- if (x.oncePerTurn && firedOnce.has(`d${s}:${key}`)) return;
59630
+ if (x.oncePerTurn && firedOnce.has(`d${s}:${key2}`)) return;
59605
59631
  n2 += x.draws;
59606
59632
  });
59607
59633
  }
@@ -60115,12 +60141,40 @@ function playGame(state, reqs, profiles, opts, prep = preparePlay(reqs, profiles
60115
60141
  });
60116
60142
  return most;
60117
60143
  };
60144
+ function isSourceNow(i) {
60145
+ return !profiles[i].land && !profiles[i].target && // (A sunburst source waits for the colors it could have: not
60146
+ // Pentad Prism off Sol Ring's {C}{C} when your lands make two.)
60147
+ !sunburstWaits(i) && manaIfSoon(i) && (profiles[i].makes.length > 0 || // A boost or landfall (Leyline of Abundance, Lotus Cobra) is mana while it's out.
60148
+ !!profiles[i].boost || !!profiles[i].landfall?.length || (profiles[i].reduces?.amount ?? 0) > 0 || !!profiles[i].reduces?.pips || tableTreasure(profiles[i]) || (profiles[i].treasures ?? 0) > sizeOf(costNow(i)) || // Mana for every creature of yours (Cryptolith Rite), with one
60149
+ // out or in hand; and with one out, a cheap creature is a dork
60150
+ // (2 mana or less: a 6-drop isn't ramp for one mana a turn).
60151
+ !!profiles[i].grantsTapMana?.length && (hasCreatureOut() || hand.some((h) => h !== i && !!profiles[h].creature && !profiles[h].land)) || !!profiles[i].creature && sizeOf(costNow(i)) <= 2 && grantOut() || // (With Urza out, a cheap artifact taps for {U}.)
60152
+ !!profiles[i].artifact && sizeOf(costNow(i)) <= 2 && grantOut("artifact") || // A cheap artifact or creature that turns on a source out or in
60153
+ // hand (Mox Opal's third artifact, Springleaf Drum's creature).
60154
+ sizeOf(costNow(i)) <= 2 && turnsOn(i) || // Food is mana with a converter (Ninja Pizza, The Cabbage
60155
+ // Merchant): its makers, and the converter with Food to use.
60156
+ !!profiles[i].foods && (!!tokenOut((q) => !!q.foodMana) || hand.some((h) => h !== i && !!profiles[h].foodMana)) || !!profiles[i].foodMana && (foodCount >= profiles[i].foodMana.per || !!profiles[i].foodsPerRound?.length || hand.some((h) => h !== i && !!profiles[h].foods)) || // Treasure on attacking (Ragavan), with a creature to attack.
60157
+ !!profiles[i].combatTreasures && (profiles[i].combatTreasures.who === "self" || hasCreatureOut()) || // Land ramp (Rampant Growth) is a source too.
60158
+ !!profiles[i].rampLands || // A color fixer (Prismatic Omen, Abundant Growth) when a card
60159
+ // in hand wants a color no source of yours makes.
60160
+ !!profiles[i].fixesLands && hand.some((h) => h !== i && !profiles[h].land && Object.keys(profiles[h].pips).some((c) => c.length === 1 && c !== "C" && ![...online, ...pending].some((u) => u.includes(c)))) || // A cost that scales into mana (Everflowing Chalice), kicked
60161
+ // with what's there; a paid Treasure maker (Bucknard's Purse).
60162
+ !!profiles[i].scaling || !!profiles[i].paidTreasure || // A clone with a source of yours worth copying (Phyrexian
60163
+ // Metamorph on a Sol Ring): two mana or more, and half its own
60164
+ // cost; not a 4-mana Clone on a 1-mana dork.
60165
+ !!profiles[i].copiesSource && copyWorth(i) || // A basic to your hand (Thirsting Roots) when you hold no land.
60166
+ !!profiles[i].landsToHand && !hand.some((j) => j !== i && profiles[j].land) || // Your lands untapped (Spelunking), with a tapped one to play.
60167
+ !!profiles[i].landsEnterUntapped && hand.some((j) => j !== i && profiles[j].land && tappedIfPlayed(j)) || // Free casts every turn are the biggest ramp of all.
60168
+ !!profiles[i].freeCast?.each || // Extra land drops are ramp while you hold a land to play.
60169
+ !!(profiles[i].extraLandsEachTurn || profiles[i].extraLandsNow) && hand.some((j) => profiles[j].land));
60170
+ }
60118
60171
  const pickLand = (extra) => {
60119
60172
  let pick2 = -1;
60120
60173
  let lands = 0;
60121
60174
  const ok = (i) => profiles[i].land && !(extra && profiles[i].returnsLand);
60122
60175
  for (const i of hand) if (ok(i) && lands++ === 0) pick2 = i;
60123
60176
  if (lands > 1) {
60177
+ const slow = (i) => tappedIfPlayed(i) || !!profiles[i].creature;
60124
60178
  const want = wantedPips();
60125
60179
  const alone2 = (u) => u.includes(FILTER2) ? "C" : u.includes(RESTRICT) ? u.slice(0, u.indexOf(RESTRICT)).includes("C") ? "C" : "" : u;
60126
60180
  const out = (k) => online.reduce((a, u) => a + ([...k].some((c) => alone2(u).includes(c)) ? 1 : 0), 0);
@@ -60130,18 +60184,41 @@ function playGame(state, reqs, profiles, opts, prep = preparePlay(reqs, profiles
60130
60184
  const fills = Object.entries(want).some(([k, n2]) => (n2 ?? 0) > out(k) && [...k].some((c) => unit.includes(c))) ? 2 : 0;
60131
60185
  if (q.returnsLand) {
60132
60186
  if (landOut.size === 0) return -10;
60187
+ if (!untappedBuys) return 10;
60133
60188
  if (!reqs.some((r, k) => r.mode === "play" && r.byTurn === turn && short(k))) return 5;
60134
60189
  }
60135
60190
  const yields = q.manaIf?.kind === "perCreature" && !q.makesLater ? creatureCount() : q.manaIf?.kind === "artifacts" && !q.makesLater ? 1 : landUnitsNow(i).length;
60136
- const castsNow = !tappedIfPlayed(i) && hand.some((h) => {
60191
+ const castsNow = !slow(i) && hand.some((h) => {
60137
60192
  const qh = profiles[h];
60138
60193
  if (qh.land || qh.target || !(rowNeeds(h) || qh.makes.length > 0)) return false;
60139
60194
  const c = costNow(h);
60140
- const pool0 = [...online, ...pool.filter((u) => u === TREASURE)];
60141
- return !!payFrom([...pool0, ...landUnitsNow(i).map(alone2)], c.generic, c.pips, traitsOf(qh, !!qh.creature, false)) && !payFrom([...pool0, "C"], c.generic, c.pips, traitsOf(qh, !!qh.creature, false));
60195
+ const pool02 = [...online, ...pool.filter((u) => u === TREASURE)];
60196
+ return !!payFrom([...pool02, ...landUnitsNow(i).map(alone2)], c.generic, c.pips, traitsOf(qh, !!qh.creature, false)) && !payFrom([...pool02, "C"], c.generic, c.pips, traitsOf(qh, !!qh.creature, false));
60142
60197
  });
60143
- return (tappedIfPlayed(i) ? 0 : 4) + fills + (castsNow ? 3 : 0) + (yields - 1) + unit.length / 10;
60198
+ const handUse = q.tutorVia === "transmute" || !!q.landcycling;
60199
+ return (slow(i) ? untappedBuys || handUse ? 0 : 6 : 4) + fills + (castsNow ? 3 : 0) + (yields - 1) + unit.length / 10;
60144
60200
  };
60201
+ const pool0 = [...online, ...pool.filter((u) => u === TREASURE)];
60202
+ const castable = (h, extra2) => {
60203
+ const qh = profiles[h];
60204
+ const c = costNow(h);
60205
+ return !!payFrom([...pool0, ...extra2], c.generic, c.pips, traitsOf(qh, !!qh.creature, false));
60206
+ };
60207
+ const spells = hand.filter((h) => {
60208
+ const qh = profiles[h];
60209
+ return !qh.land && !qh.target && (rowNeeds(h) || isSourceNow(h));
60210
+ });
60211
+ const zoneCastable = (z2, extra2) => {
60212
+ const c = opts.commanders[z2];
60213
+ const q = c.profile;
60214
+ return !!payFrom([...pool0, ...extra2], Math.max(0, c.generic + 2 * (zoneCasts[z2] ?? 0) - cutOf(q?.cutBy)), lessPips(c.pips, q?.cutBy), q ? traitsOf(q, opts.commanders[z2].creature !== false, false) : void 0);
60215
+ };
60216
+ const inZone = opts.commanders.map((_, z2) => z2).filter((z2) => !zoneCast[z2]);
60217
+ const untappedBuys = hand.some((i) => {
60218
+ if (!ok(i) || slow(i)) return false;
60219
+ const units = landUnitsNow(i).map(alone2);
60220
+ return spells.some((h) => castable(h, units) && !castable(h, [])) || inZone.some((z2) => zoneCastable(z2, units) && !zoneCastable(z2, []));
60221
+ });
60145
60222
  let best = -Infinity;
60146
60223
  for (const i of hand) {
60147
60224
  if (!ok(i)) continue;
@@ -60951,35 +61028,21 @@ function playGame(state, reqs, profiles, opts, prep = preparePlay(reqs, profiles
60951
61028
  leave?.();
60952
61029
  if (!progress) {
60953
61030
  enter?.("2. mana sources and cost reducers, cheapest first");
60954
- const sources = hand.filter(
60955
- (i) => !profiles[i].land && !profiles[i].target && // (A sunburst source waits for the colors it could have: not
60956
- // Pentad Prism off Sol Ring's {C}{C} when your lands make two.)
60957
- !sunburstWaits(i) && manaIfSoon(i) && (profiles[i].makes.length > 0 || // A boost or landfall (Leyline of Abundance, Lotus Cobra) is mana while it's out.
60958
- !!profiles[i].boost || !!profiles[i].landfall?.length || (profiles[i].reduces?.amount ?? 0) > 0 || !!profiles[i].reduces?.pips || tableTreasure(profiles[i]) || (profiles[i].treasures ?? 0) > sizeOf(costNow(i)) || // Mana for every creature of yours (Cryptolith Rite), with one
60959
- // out or in hand; and with one out, a cheap creature is a dork
60960
- // (2 mana or less: a 6-drop isn't ramp for one mana a turn).
60961
- !!profiles[i].grantsTapMana?.length && (hasCreatureOut() || hand.some((h) => h !== i && !!profiles[h].creature && !profiles[h].land)) || !!profiles[i].creature && sizeOf(costNow(i)) <= 2 && grantOut() || // (With Urza out, a cheap artifact taps for {U}.)
60962
- !!profiles[i].artifact && sizeOf(costNow(i)) <= 2 && grantOut("artifact") || // A cheap artifact or creature that turns on a source out or in
60963
- // hand (Mox Opal's third artifact, Springleaf Drum's creature).
60964
- sizeOf(costNow(i)) <= 2 && turnsOn(i) || // Food is mana with a converter (Ninja Pizza, The Cabbage
60965
- // Merchant): its makers, and the converter with Food to use.
60966
- !!profiles[i].foods && (!!tokenOut((q) => !!q.foodMana) || hand.some((h) => h !== i && !!profiles[h].foodMana)) || !!profiles[i].foodMana && (foodCount >= profiles[i].foodMana.per || !!profiles[i].foodsPerRound?.length || hand.some((h) => h !== i && !!profiles[h].foods)) || // Treasure on attacking (Ragavan), with a creature to attack.
60967
- !!profiles[i].combatTreasures && (profiles[i].combatTreasures.who === "self" || hasCreatureOut()) || // Land ramp (Rampant Growth) is a source too.
60968
- !!profiles[i].rampLands || // A color fixer (Prismatic Omen, Abundant Growth) when a card
60969
- // in hand wants a color no source of yours makes.
60970
- !!profiles[i].fixesLands && hand.some((h) => h !== i && !profiles[h].land && Object.keys(profiles[h].pips).some((c) => c.length === 1 && c !== "C" && ![...online, ...pending].some((u) => u.includes(c)))) || // A cost that scales into mana (Everflowing Chalice), kicked
60971
- // with what's there; a paid Treasure maker (Bucknard's Purse).
60972
- !!profiles[i].scaling || !!profiles[i].paidTreasure || // A clone with a source of yours worth copying (Phyrexian
60973
- // Metamorph on a Sol Ring): two mana or more, and half its own
60974
- // cost; not a 4-mana Clone on a 1-mana dork.
60975
- !!profiles[i].copiesSource && copyWorth(i) || // A basic to your hand (Thirsting Roots) when you hold no land.
60976
- !!profiles[i].landsToHand && !hand.some((j) => j !== i && profiles[j].land) || // Your lands untapped (Spelunking), with a tapped one to play.
60977
- !!profiles[i].landsEnterUntapped && hand.some((j) => j !== i && profiles[j].land && tappedIfPlayed(j)) || // Free casts every turn are the biggest ramp of all.
60978
- !!profiles[i].freeCast?.each || // Extra land drops are ramp while you hold a land to play.
60979
- !!(profiles[i].extraLandsEachTurn || profiles[i].extraLandsNow) && hand.some((j) => profiles[j].land))
60980
- ).sort((a, b) => profiles[a].cost - profiles[b].cost);
61031
+ const sources = hand.filter(isSourceNow).sort((a, b) => profiles[a].cost - profiles[b].cost);
61032
+ const payNow = (units, i) => {
61033
+ const c = costNow(i);
61034
+ return payPool(units, c.generic, c.pips, traitsOf(profiles[i], !!profiles[i].creature, false));
61035
+ };
61036
+ const rampFirst = sources.find((i) => !!profiles[i].rampLands && !profiles[i].rampCost && !keptSource(i) && !!payNow(pool, i));
61037
+ const starves = (i) => {
61038
+ if (rampFirst === void 0 || i === rampFirst) return false;
61039
+ const left = payNow(pool, i);
61040
+ if (!left) return false;
61041
+ const q = profiles[i];
61042
+ return !payNow([...left, ...q.summoningSick || q.land ? [] : q.makes], rampFirst);
61043
+ };
60981
61044
  for (const i of sources) {
60982
- if (keptSource(i)) continue;
61045
+ if (keptSource(i) || starves(i)) continue;
60983
61046
  const sc = profiles[i].scaling;
60984
61047
  if (sc) {
60985
61048
  const base = sizeOf(costNow(i));
@@ -63002,14 +63065,14 @@ function deckLibrary(plan, index, commanderOracleIds) {
63002
63065
  const cards = [];
63003
63066
  const gaps = /* @__PURE__ */ new Map();
63004
63067
  let committed = 0;
63005
- forEachCommitted(plan, (side, key, copies) => {
63068
+ forEachCommitted(plan, (side, key2, copies) => {
63006
63069
  committed += copies;
63007
- const card = side === "main" ? index.byOracleId.get(key) : bySlug.get(key);
63070
+ const card = side === "main" ? index.byOracleId.get(key2) : bySlug.get(key2);
63008
63071
  if (!card) {
63009
- const k = `unknown:${key}`;
63072
+ const k = `unknown:${key2}`;
63010
63073
  const g = gaps.get(k);
63011
63074
  if (g) g.copies += copies;
63012
- else gaps.set(k, { name: side === "buy" ? key : null, copies, why: "unknown" });
63075
+ else gaps.set(k, { name: side === "buy" ? key2 : null, copies, why: "unknown" });
63013
63076
  return;
63014
63077
  }
63015
63078
  if (commanderOracleIds.has(card.oracleId)) {
@@ -63078,8 +63141,90 @@ init_manaOverrides();
63078
63141
  init_oddsPlans();
63079
63142
  init_countRows();
63080
63143
 
63144
+ // ../src/lib/deckPlan/searchPilot.ts
63145
+ var key = (v) => `${[...v.hand].sort((a, b) => a - b)}|${[...v.battlefield].sort((a, b) => a - b)}|${v.commandersOut}|${v.next}`;
63146
+ function mix(...xs) {
63147
+ let h = 2166136261;
63148
+ for (const x of xs) h = Math.imul(h ^ x >>> 0, 16777619) >>> 0;
63149
+ return h >>> 0;
63150
+ }
63151
+ function searchPilot(p, stats, onDecide) {
63152
+ return (g) => {
63153
+ const forceLand = /* @__PURE__ */ new Map();
63154
+ const castFirst = /* @__PURE__ */ new Map();
63155
+ const holdRest = /* @__PURE__ */ new Set();
63156
+ const hooks = () => ({ forceLand, castFirst, holdRest });
63157
+ const horizon = Math.min(8, Math.max(p.turns + 1, ...g.reqs.map((r) => r.byTurn)));
63158
+ const play = (order, h, stopAfter) => playGame({ hand: [...g.hand], order, next: OPENING_HAND }, g.reqs, g.profiles, { ...g.base, deep: { ...h, stopAfter } }, g.prep);
63159
+ const isTutor2 = (i) => g.reqs.some((r) => r.tutors?.[i] || r.chainTutors?.[i]);
63160
+ for (let t = 1; t <= p.turns; t++) {
63161
+ let view;
63162
+ let cands = [];
63163
+ let pick2 = -1;
63164
+ play(g.order, { ...hooks(), onTurn: (tt, v2) => tt === t && (view = v2), onLand: (tt, c, pk) => tt === t && (cands = c, pick2 = pk) }, t);
63165
+ if (!view) break;
63166
+ const here = key(view);
63167
+ const v = view;
63168
+ const out = [{ land: pick2, first: [], rest: false }];
63169
+ for (const c of cands) if (c !== pick2) out.push({ land: c, first: [], rest: false });
63170
+ v.commandersOut.forEach((o, z2) => !o && out.push({ land: pick2, first: [-1 - z2], rest: false }));
63171
+ const spells = [...new Set(v.hand)].filter((i) => !g.profiles[i].land && !isTutor2(i)).sort((a, b) => g.profiles[b].cost - g.profiles[a].cost || a - b);
63172
+ for (const i of spells) out.push({ land: pick2, first: [i], rest: false });
63173
+ out.push({ land: pick2, first: [], rest: true });
63174
+ const tried = out.slice(0, p.candidates);
63175
+ if (tried.length < 2) continue;
63176
+ const score = (c) => {
63177
+ const h = {
63178
+ forceLand: c.land >= 0 ? new Map([...forceLand, [t, c.land]]) : forceLand,
63179
+ castFirst: c.first.length ? new Map([...castFirst, [t, c.first]]) : castFirst,
63180
+ holdRest: c.rest ? /* @__PURE__ */ new Set([...holdRest, t]) : holdRest
63181
+ };
63182
+ let total = 0;
63183
+ let n = 0;
63184
+ for (let k = 0; k < p.reshuffles; k++) {
63185
+ const rnd = mulberry32(mix(p.seed, g.game, t, k));
63186
+ const rest = g.order.slice(v.next);
63187
+ for (let i = rest.length - 1; i > 0; i--) {
63188
+ const j = Math.floor(rnd() * (i + 1));
63189
+ [rest[i], rest[j]] = [rest[j], rest[i]];
63190
+ }
63191
+ const order = [...g.order.slice(0, v.next), ...rest];
63192
+ let same2 = true;
63193
+ let s = 0;
63194
+ stats.rollouts++;
63195
+ const r = play(order, {
63196
+ ...h,
63197
+ onTurn: (tt, w) => tt === t && key(w) !== here && (same2 = false),
63198
+ peek: (tt, online, want) => tt === horizon && (s += 10 * pipsCovered(online, want) + online.length)
63199
+ }, horizon);
63200
+ if (!same2) {
63201
+ stats.drift++;
63202
+ continue;
63203
+ }
63204
+ for (const m of r.metBy) if (m >= 1 && m <= horizon) s += 1e3 * (horizon + 1 - m);
63205
+ total += s;
63206
+ n++;
63207
+ }
63208
+ return n ? total / n : -Infinity;
63209
+ };
63210
+ stats.decisions++;
63211
+ let best = tried[0];
63212
+ let bestScore = score(best);
63213
+ for (const c of tried.slice(1)) {
63214
+ const sc = score(c);
63215
+ if (sc > bestScore) [best, bestScore] = [c, sc];
63216
+ }
63217
+ if (best !== tried[0]) stats.changed++;
63218
+ onDecide?.({ game: g.game, t, engineLand: pick2, chosen: best, changed: best !== tried[0] });
63219
+ if (best.land >= 0) forceLand.set(t, best.land);
63220
+ if (best.first.length) castFirst.set(t, best.first);
63221
+ if (best.rest) holdRest.add(t);
63222
+ }
63223
+ return hooks();
63224
+ };
63225
+ }
63226
+
63081
63227
  // ../src/lib/deckPlan/planOdds.ts
63082
- var DEEP_SIM = { turns: 5, trials: 5e3 };
63083
63228
  function planSeed(deckSize, reqs, opts = {}) {
63084
63229
  let h = 2166136261 ^ deckSize ^ (opts.mulligans ?? 0) << 8 ^ (opts.onDraw ? 1 << 12 : 0);
63085
63230
  for (const r of reqs) {
@@ -63162,6 +63307,7 @@ function simulatePlan(deckSize, planReqs, opts = {}) {
63162
63307
  const trials = opts.trials ?? 2e4;
63163
63308
  const firstGame = opts.firstGame ?? 0;
63164
63309
  const seed = opts.seed ?? planSeed(deckSize, reqs, opts);
63310
+ const choose = opts.choose ?? (opts.careful && opts.mana ? searchPilot({ ...opts.careful, seed }, { decisions: 0, changed: 0, rollouts: 0, drift: 0 }) : void 0);
63165
63311
  const onDraw = opts.onDraw ?? false;
63166
63312
  const maxMull = Math.max(0, opts.mulligans ?? 0);
63167
63313
  const useTutors = opts.useTutors ?? true;
@@ -63322,8 +63468,9 @@ function simulatePlan(deckSize, planReqs, opts = {}) {
63322
63468
  mulliganFor: r.mulliganFor ?? null
63323
63469
  }))
63324
63470
  } : null;
63471
+ const progressEvery = choose ? 10 : 1e3;
63325
63472
  for (let t = 0; t < trials; t++) {
63326
- if (opts.onProgress && t > 0 && t % 1e3 === 0) opts.onProgress(t, trials);
63473
+ if (opts.onProgress && t > 0 && t % progressEvery === 0) opts.onProgress(t, trials);
63327
63474
  let hand = [];
63328
63475
  let mulls = 0;
63329
63476
  const events = opts.trace?.pick(firstGame + t) ? [] : null;
@@ -63342,7 +63489,7 @@ function simulatePlan(deckSize, planReqs, opts = {}) {
63342
63489
  mullTotal += mulls;
63343
63490
  if (manaMode) {
63344
63491
  const forceLand = opts.deep ? deepLands(hand, order, manaReqs, opts.mana.profiles, { onDraw, commanders: opts.commanders ?? [], useTutors, untilTurn: curveTo, opponents: opts.opponents }, prep, opts.deep.turns ?? 5) : void 0;
63345
- const chosen = !forceLand && opts.choose ? opts.choose({ game: firstGame + t, hand, order, reqs: manaReqs, profiles: opts.mana.profiles, base: { onDraw, commanders: opts.commanders ?? [], useTutors, untilTurn: curveTo, opponents: opts.opponents }, prep }) : void 0;
63492
+ const chosen = !forceLand && choose ? choose({ game: firstGame + t, hand, order, reqs: manaReqs, profiles: opts.mana.profiles, base: { onDraw, commanders: opts.commanders ?? [], useTutors, untilTurn: curveTo, opponents: opts.opponents }, prep }) : void 0;
63346
63493
  const game = playGame(
63347
63494
  { hand, order, next: OPENING_HAND },
63348
63495
  manaReqs,
@@ -63800,21 +63947,21 @@ function partFrom(r, where, look) {
63800
63947
  const names = [...BUILT_IN.values(), ...look.tags.map((t) => t.name)];
63801
63948
  throw new PlanProblem(`No group "${r.group}". This deck has: ${names.join(", ")}.`);
63802
63949
  }
63803
- function rowFrom(r, key, look) {
63950
+ function rowFrom(r, key2, look) {
63804
63951
  if (!Number.isInteger(r.byTurn) || r.byTurn < 1 || r.byTurn > 10) throw new PlanProblem("byTurn is a turn from 1 to 10.");
63805
- const first = partFrom(r, `Row ${key}`, look);
63952
+ const first = partFrom(r, `Row ${key2}`, look);
63806
63953
  const off = (r.tutorsOff ?? []).map((n) => {
63807
63954
  const c = look.zone.find((z2) => z2.name.toLowerCase() === n.toLowerCase()) ?? look.deck.find((d) => d.name.toLowerCase() === n.toLowerCase()) ?? resolveCardName(look.catalog.index, n);
63808
63955
  if (!c || !(look.zone.includes(c) || look.deck.some((d) => d.oracleId === c.oracleId))) throw new PlanProblem(`tutorsOff: ${n} isn't in this deck.`);
63809
63956
  return c.oracleId;
63810
63957
  });
63811
- if (r.then && !validThen(r.then)) throw new PlanProblem(`Row ${key}: then is { kind: "cards", n }, { kind: "look", n, keep }, { kind: "mana", n } or { kind: "all" }.`);
63958
+ if (r.then && !validThen(r.then)) throw new PlanProblem(`Row ${key2}: then is { kind: "cards", n }, { kind: "look", n, keep }, { kind: "mana", n } or { kind: "all" }.`);
63812
63959
  return {
63813
- key,
63960
+ key: key2,
63814
63961
  source: first.source,
63815
63962
  atLeast: first.atLeast,
63816
- ...r.with?.length ? { with: r.with.map((p, i) => partFrom(p, `Row ${key}, with ${i + 1}`, look)) } : {},
63817
- ...r.or?.length ? { or: r.or.map((o, i) => o.map((p, j) => partFrom(p, `Row ${key}, or ${i + 1}.${j + 1}`, look))) } : {},
63963
+ ...r.with?.length ? { with: r.with.map((p, i) => partFrom(p, `Row ${key2}, with ${i + 1}`, look)) } : {},
63964
+ ...r.or?.length ? { or: r.or.map((o, i) => o.map((p, j) => partFrom(p, `Row ${key2}, or ${i + 1}.${j + 1}`, look))) } : {},
63818
63965
  byTurn: r.byTurn,
63819
63966
  mode: r.mode ?? "have",
63820
63967
  tutorsOff: [...new Set(off)],
@@ -63838,7 +63985,7 @@ function tableFrom(t, look) {
63838
63985
  return valid;
63839
63986
  }
63840
63987
  function runPlan(m, opts = {}) {
63841
- const o = opts.deep ? { ...m.input.opts, deep: { turns: DEEP_SIM.turns }, trials: DEEP_SIM.trials } : m.input.opts;
63988
+ const o = opts.careful && m.input.opts.mana ? carefulInput(m.input, CAREFUL.phoneGames).opts : m.input.opts;
63842
63989
  return simulatePlan(m.input.deckSize, m.input.reqs, o);
63843
63990
  }
63844
63991
  var pct = levelPct;
@@ -64067,8 +64214,8 @@ async function deckFrom(args, ctx, catalog) {
64067
64214
  }
64068
64215
  if (!catalog) throw new ToolProblem("The card data didn't load, and reading a list needs it. Try again in a moment.");
64069
64216
  const commander = typeof args.commander === "string" && args.commander.trim() ? args.commander.trim() : void 0;
64070
- const key = `${commander ?? ""}\0${list.trim()}`;
64071
- const hit = pastedCache.get(key);
64217
+ const key2 = `${commander ?? ""}\0${list.trim()}`;
64218
+ const hit = pastedCache.get(key2);
64072
64219
  let pasted = hit && Date.now() - hit.at < PASTED_TTL_MS && args.refresh !== true ? hit.deck : null;
64073
64220
  if (!pasted) {
64074
64221
  try {
@@ -64082,7 +64229,7 @@ async function deckFrom(args, ctx, catalog) {
64082
64229
  if (e instanceof PastedDeckProblem) throw new ToolProblem(e.message);
64083
64230
  throw e;
64084
64231
  }
64085
- pastedCache.set(key, { at: Date.now(), deck: pasted });
64232
+ pastedCache.set(key2, { at: Date.now(), deck: pasted });
64086
64233
  }
64087
64234
  return { id: "pasted", raw: { ...pasted.stored, name: pasted.name }, pasted };
64088
64235
  }
@@ -64095,8 +64242,8 @@ function curveOf(lines) {
64095
64242
  const curve = {};
64096
64243
  for (const l of lines) {
64097
64244
  if (isLand3(l.card)) continue;
64098
- const key = l.card.cmc >= 7 ? "7+" : String(l.card.cmc);
64099
- curve[key] = (curve[key] ?? 0) + l.qty;
64245
+ const key2 = l.card.cmc >= 7 ? "7+" : String(l.card.cmc);
64246
+ curve[key2] = (curve[key2] ?? 0) + l.qty;
64100
64247
  }
64101
64248
  return curve;
64102
64249
  }
@@ -64415,7 +64562,7 @@ var readInput = external_exports.object({
64415
64562
  });
64416
64563
  var planOdds = {
64417
64564
  name: "plan_odds",
64418
- description: "Odds a deck's plan comes together by turn N, from the same 20,000 seeded games as the Odds tab's Plan by turn: the deck's saved plan, or rows you give. Takes every Odds tab setting with the tab's meaning: per row AND / OR parts, have / play / graveyard, mulligan for it (one, one or a tutor, all, a 7 that casts it), tutors off, what it gives you; and the game's mulligans, play or draw, the land range to keep (keepLands), opponents, how many rows must come together (need), the table guesses, and the deep sim. Counts the user's own card reads and tutors, and lists what it had to assume (weAssume). Chances are whole percents with About on the total, the way the tab says them: a yardstick for comparing builds under simple play, not the chance at a real table (together.about says so; pass it on). Only the what-if difference keeps a tenth of a point. `reads` tries card reads for this run only (what-if, not saved).",
64565
+ description: "Odds a deck's plan comes together by turn N, from the same 20,000 seeded games as the Odds tab's Plan by turn: the deck's saved plan, or rows you give. Takes every Odds tab setting with the tab's meaning: per row AND / OR parts, have / play / graveyard, mulligan for it (one, one or a tutor, all, a 7 that casts it), tutors off, what it gives you; and the game's mulligans, play or draw, the land range to keep (keepLands), opponents, how many rows must come together (need), the table guesses, and careful play. Counts the user's own card reads and tutors, and lists what it had to assume (weAssume). Chances are whole percents with About on the total, the way the tab says them: a yardstick for comparing builds under simple play, not the chance at a real table (together.about says so; pass it on). Only the what-if difference keeps a tenth of a point. `reads` tries card reads for this run only (what-if, not saved).",
64419
64566
  input: {
64420
64567
  ...deckOrList,
64421
64568
  rows: external_exports.array(rowInput).max(8).optional().describe("Rows to ask about instead of the deck's saved plan."),
@@ -64426,7 +64573,7 @@ var planOdds = {
64426
64573
  keepLands: external_exports.tuple([external_exports.number().int().min(0).max(7), external_exports.number().int().min(0).max(7)]).optional().describe("Keep a 7 with this many lands, [min, max] (default [2, 5])."),
64427
64574
  need: external_exports.number().int().min(1).optional().describe("How many rows must come together in the same game (default: all of them)."),
64428
64575
  table: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.unknown())).optional().describe("What the other players give you, by card name, for this run: drawsPerRound / treasuresPerRound, each [{ from: turn, cards: n }] (Rhystic Study, Smothering Tithe). Replaces the plan's saved table guesses."),
64429
- deep: external_exports.boolean().optional().describe("The Odds tab's deep sim: early land drops chosen by playing ahead, on 5,000 games. Several times slower."),
64576
+ careful: external_exports.boolean().optional().describe("The Odds tab's careful play: tries several lines each turn (land drop, what to cast first) on reshuffles of the cards not yet seen, instead of plain play. Uses our card reads. 300 games here, so it gives a range; far slower (tens of seconds)."),
64430
64577
  curve: external_exports.boolean().optional().describe("Also give the odds turn by turn, 1 to 10."),
64431
64578
  reads: external_exports.array(readInput).max(20).optional().describe("Card reads to try for this run only. Nothing is saved."),
64432
64579
  refresh: refreshInput
@@ -64450,16 +64597,16 @@ var planOdds = {
64450
64597
  };
64451
64598
  const reads = Array.isArray(args.reads) ? args.reads : [];
64452
64599
  const m = planModel(id, asDeck(raw), catalog, lib, { ...given, reads });
64453
- const deep = args.deep === true;
64454
- const result = runPlan(m, { deep });
64600
+ const careful = args.careful === true;
64601
+ const result = runPlan(m, { careful });
64455
64602
  const answerAll = result.all;
64456
64603
  const answer = planAnswer(m, result, args.curve === true);
64457
- const yours = reads.length ? runPlan(planModel(id, asDeck(raw), catalog, lib, given), { deep }) : null;
64604
+ const yours = reads.length ? runPlan(planModel(id, asDeck(raw), catalog, lib, given), { careful }) : null;
64458
64605
  return json2({
64459
64606
  deck: viewDeck(id, asDeck(raw), null).name,
64460
64607
  ...pastedNote(src),
64461
64608
  ...answer,
64462
- ...deep ? { deepSim: "the deep sim: early land drops chosen by playing ahead, 5,000 games" } : {},
64609
+ ...careful ? { carefulPlay: { means: "careful play: tries several lines each turn instead of plain play; uses our card reads", games: result.trials, range: rangeText(result.all, result.trials) } } : {},
64463
64610
  // (The same seed, so the two runs play the same shuffles: the difference is
64464
64611
  // sharper than either number, and keeps its tenth of a point.)
64465
64612
  ...yours ? { withYourReads: { together: headlinePct(yours.all, yours.trials), triedReadsChangeIt: pointsChange(answerAll - yours.all) } } : {},
@@ -65442,8 +65589,8 @@ var overlapTool = {
65442
65589
  const at = unique.findIndex(([x]) => x === id);
65443
65590
  rows = rows.filter((e) => e.deckIndices.includes(at));
65444
65591
  }
65445
- const key = OVERLAP_SORTS.includes(args.sort) ? args.sort : "in";
65446
- if (args.sort) rows = sortOverlapRows(rows, key, DEFAULT_DIR[key], owned);
65592
+ const key2 = OVERLAP_SORTS.includes(args.sort) ? args.sort : "in";
65593
+ if (args.sort) rows = sortOverlapRows(rows, key2, DEFAULT_DIR[key2], owned);
65447
65594
  const summary = summarizeStickerShare(filterOverlap(tally, { minDecks, includeBasics: false }), owned);
65448
65595
  const cap2 = { summary: 40, standard: 150, full: 1e3 }[detailOf(args)];
65449
65596
  return json2({
@@ -66038,7 +66185,7 @@ var say = (m) => process.stderr.write(`${m}
66038
66185
  var transport = {
66039
66186
  fetchImpl: ((url2, init) => fetch(`${ORIGIN}${url2}`, {
66040
66187
  ...init,
66041
- headers: { ...Object.fromEntries(new Headers(init?.headers)), "user-agent": `edhvault-mcp/${"0.2.21"}` }
66188
+ headers: { ...Object.fromEntries(new Headers(init?.headers)), "user-agent": `edhvault-mcp/${"0.2.22"}` }
66042
66189
  }))
66043
66190
  };
66044
66191
  async function store(dir) {
@@ -66054,7 +66201,7 @@ async function secretFromEnv() {
66054
66201
  async function main() {
66055
66202
  const args = process.argv.slice(2);
66056
66203
  if (args.includes("--version")) {
66057
- say("0.2.21");
66204
+ say("0.2.22");
66058
66205
  return;
66059
66206
  }
66060
66207
  const dir = configDir();
@@ -66077,7 +66224,7 @@ async function main() {
66077
66224
  }
66078
66225
  const extras = extrasLoader({ dir, origin: ORIGIN });
66079
66226
  const fromEnv = await secretFromEnv();
66080
- await serve("0.2.21", {
66227
+ await serve("0.2.22", {
66081
66228
  // The saved login is read again when not connected and on refresh, so
66082
66229
  // `login` in another terminal works without restarting the AI tool.
66083
66230
  library: new Library({ secret: () => fromEnv ?? loadSecret(secrets), dir, transport }),