@nine-lab/nine-mu 0.1.408 → 0.1.410

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/nine-mu.js CHANGED
@@ -500,9 +500,9 @@ class ParseInputLazyPath {
500
500
  return this._cachedPath;
501
501
  }
502
502
  }
503
- const handleResult = (ctx, result2) => {
504
- if (isValid(result2)) {
505
- return { success: true, data: result2.value };
503
+ const handleResult = (ctx, result) => {
504
+ if (isValid(result)) {
505
+ return { success: true, data: result.value };
506
506
  } else {
507
507
  if (!ctx.common.issues.length) {
508
508
  throw new Error("Validation failed but no issues detected.");
@@ -573,21 +573,21 @@ let ZodType$1 = class ZodType {
573
573
  };
574
574
  }
575
575
  _parseSync(input) {
576
- const result2 = this._parse(input);
577
- if (isAsync(result2)) {
576
+ const result = this._parse(input);
577
+ if (isAsync(result)) {
578
578
  throw new Error("Synchronous parse encountered promise.");
579
579
  }
580
- return result2;
580
+ return result;
581
581
  }
582
582
  _parseAsync(input) {
583
- const result2 = this._parse(input);
584
- return Promise.resolve(result2);
583
+ const result = this._parse(input);
584
+ return Promise.resolve(result);
585
585
  }
586
586
  parse(data, params) {
587
- const result2 = this.safeParse(data, params);
588
- if (result2.success)
589
- return result2.data;
590
- throw result2.error;
587
+ const result = this.safeParse(data, params);
588
+ if (result.success)
589
+ return result.data;
590
+ throw result.error;
591
591
  }
592
592
  safeParse(data, params) {
593
593
  const ctx = {
@@ -602,8 +602,8 @@ let ZodType$1 = class ZodType {
602
602
  data,
603
603
  parsedType: getParsedType(data)
604
604
  };
605
- const result2 = this._parseSync({ data, path: ctx.path, parent: ctx });
606
- return handleResult(ctx, result2);
605
+ const result = this._parseSync({ data, path: ctx.path, parent: ctx });
606
+ return handleResult(ctx, result);
607
607
  }
608
608
  "~validate"(data) {
609
609
  var _a2, _b;
@@ -620,9 +620,9 @@ let ZodType$1 = class ZodType {
620
620
  };
621
621
  if (!this["~standard"].async) {
622
622
  try {
623
- const result2 = this._parseSync({ data, path: [], parent: ctx });
624
- return isValid(result2) ? {
625
- value: result2.value
623
+ const result = this._parseSync({ data, path: [], parent: ctx });
624
+ return isValid(result) ? {
625
+ value: result.value
626
626
  } : {
627
627
  issues: ctx.common.issues
628
628
  };
@@ -636,17 +636,17 @@ let ZodType$1 = class ZodType {
636
636
  };
637
637
  }
638
638
  }
639
- return this._parseAsync({ data, path: [], parent: ctx }).then((result2) => isValid(result2) ? {
640
- value: result2.value
639
+ return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
640
+ value: result.value
641
641
  } : {
642
642
  issues: ctx.common.issues
643
643
  });
644
644
  }
645
645
  async parseAsync(data, params) {
646
- const result2 = await this.safeParseAsync(data, params);
647
- if (result2.success)
648
- return result2.data;
649
- throw result2.error;
646
+ const result = await this.safeParseAsync(data, params);
647
+ if (result.success)
648
+ return result.data;
649
+ throw result.error;
650
650
  }
651
651
  async safeParseAsync(data, params) {
652
652
  const ctx = {
@@ -662,8 +662,8 @@ let ZodType$1 = class ZodType {
662
662
  parsedType: getParsedType(data)
663
663
  };
664
664
  const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
665
- const result2 = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
666
- return handleResult(ctx, result2);
665
+ const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
666
+ return handleResult(ctx, result);
667
667
  }
668
668
  refine(check2, message) {
669
669
  const getIssueProperties = (val) => {
@@ -676,13 +676,13 @@ let ZodType$1 = class ZodType {
676
676
  }
677
677
  };
678
678
  return this._refinement((val, ctx) => {
679
- const result2 = check2(val);
679
+ const result = check2(val);
680
680
  const setError = () => ctx.addIssue({
681
681
  code: ZodIssueCode.custom,
682
682
  ...getIssueProperties(val)
683
683
  });
684
- if (typeof Promise !== "undefined" && result2 instanceof Promise) {
685
- return result2.then((data) => {
684
+ if (typeof Promise !== "undefined" && result instanceof Promise) {
685
+ return result.then((data) => {
686
686
  if (!data) {
687
687
  setError();
688
688
  return false;
@@ -691,7 +691,7 @@ let ZodType$1 = class ZodType {
691
691
  }
692
692
  });
693
693
  }
694
- if (!result2) {
694
+ if (!result) {
695
695
  setError();
696
696
  return false;
697
697
  } else {
@@ -2186,14 +2186,14 @@ let ZodArray$1 = class ZodArray extends ZodType$1 {
2186
2186
  if (ctx.common.async) {
2187
2187
  return Promise.all([...ctx.data].map((item, i) => {
2188
2188
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2189
- })).then((result3) => {
2190
- return ParseStatus.mergeArray(status, result3);
2189
+ })).then((result2) => {
2190
+ return ParseStatus.mergeArray(status, result2);
2191
2191
  });
2192
2192
  }
2193
- const result2 = [...ctx.data].map((item, i) => {
2193
+ const result = [...ctx.data].map((item, i) => {
2194
2194
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
2195
2195
  });
2196
- return ParseStatus.mergeArray(status, result2);
2196
+ return ParseStatus.mergeArray(status, result);
2197
2197
  }
2198
2198
  get element() {
2199
2199
  return this._def.type;
@@ -2600,18 +2600,18 @@ let ZodUnion$1 = class ZodUnion extends ZodType$1 {
2600
2600
  const { ctx } = this._processInputParams(input);
2601
2601
  const options = this._def.options;
2602
2602
  function handleResults(results) {
2603
- for (const result2 of results) {
2604
- if (result2.result.status === "valid") {
2605
- return result2.result;
2603
+ for (const result of results) {
2604
+ if (result.result.status === "valid") {
2605
+ return result.result;
2606
2606
  }
2607
2607
  }
2608
- for (const result2 of results) {
2609
- if (result2.result.status === "dirty") {
2610
- ctx.common.issues.push(...result2.ctx.common.issues);
2611
- return result2.result;
2608
+ for (const result of results) {
2609
+ if (result.result.status === "dirty") {
2610
+ ctx.common.issues.push(...result.ctx.common.issues);
2611
+ return result.result;
2612
2612
  }
2613
2613
  }
2614
- const unionErrors = results.map((result2) => new ZodError(result2.ctx.common.issues));
2614
+ const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
2615
2615
  addIssueToContext(ctx, {
2616
2616
  code: ZodIssueCode.invalid_union,
2617
2617
  unionErrors
@@ -2649,15 +2649,15 @@ let ZodUnion$1 = class ZodUnion extends ZodType$1 {
2649
2649
  },
2650
2650
  parent: null
2651
2651
  };
2652
- const result2 = option._parseSync({
2652
+ const result = option._parseSync({
2653
2653
  data: ctx.data,
2654
2654
  path: ctx.path,
2655
2655
  parent: childCtx
2656
2656
  });
2657
- if (result2.status === "valid") {
2658
- return result2;
2659
- } else if (result2.status === "dirty" && !dirty) {
2660
- dirty = { result: result2, ctx: childCtx };
2657
+ if (result.status === "valid") {
2658
+ return result;
2659
+ } else if (result.status === "dirty" && !dirty) {
2660
+ dirty = { result, ctx: childCtx };
2661
2661
  }
2662
2662
  if (childCtx.common.issues.length) {
2663
2663
  issues.push(childCtx.common.issues);
@@ -3206,43 +3206,43 @@ class ZodEffects extends ZodType$1 {
3206
3206
  return Promise.resolve(processed).then(async (processed2) => {
3207
3207
  if (status.value === "aborted")
3208
3208
  return INVALID;
3209
- const result2 = await this._def.schema._parseAsync({
3209
+ const result = await this._def.schema._parseAsync({
3210
3210
  data: processed2,
3211
3211
  path: ctx.path,
3212
3212
  parent: ctx
3213
3213
  });
3214
- if (result2.status === "aborted")
3214
+ if (result.status === "aborted")
3215
3215
  return INVALID;
3216
- if (result2.status === "dirty")
3217
- return DIRTY(result2.value);
3216
+ if (result.status === "dirty")
3217
+ return DIRTY(result.value);
3218
3218
  if (status.value === "dirty")
3219
- return DIRTY(result2.value);
3220
- return result2;
3219
+ return DIRTY(result.value);
3220
+ return result;
3221
3221
  });
3222
3222
  } else {
3223
3223
  if (status.value === "aborted")
3224
3224
  return INVALID;
3225
- const result2 = this._def.schema._parseSync({
3225
+ const result = this._def.schema._parseSync({
3226
3226
  data: processed,
3227
3227
  path: ctx.path,
3228
3228
  parent: ctx
3229
3229
  });
3230
- if (result2.status === "aborted")
3230
+ if (result.status === "aborted")
3231
3231
  return INVALID;
3232
- if (result2.status === "dirty")
3233
- return DIRTY(result2.value);
3232
+ if (result.status === "dirty")
3233
+ return DIRTY(result.value);
3234
3234
  if (status.value === "dirty")
3235
- return DIRTY(result2.value);
3236
- return result2;
3235
+ return DIRTY(result.value);
3236
+ return result;
3237
3237
  }
3238
3238
  }
3239
3239
  if (effect.type === "refinement") {
3240
3240
  const executeRefinement = (acc) => {
3241
- const result2 = effect.refinement(acc, checkCtx);
3241
+ const result = effect.refinement(acc, checkCtx);
3242
3242
  if (ctx.common.async) {
3243
- return Promise.resolve(result2);
3243
+ return Promise.resolve(result);
3244
3244
  }
3245
- if (result2 instanceof Promise) {
3245
+ if (result instanceof Promise) {
3246
3246
  throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
3247
3247
  }
3248
3248
  return acc;
@@ -3280,18 +3280,18 @@ class ZodEffects extends ZodType$1 {
3280
3280
  });
3281
3281
  if (!isValid(base2))
3282
3282
  return INVALID;
3283
- const result2 = effect.transform(base2.value, checkCtx);
3284
- if (result2 instanceof Promise) {
3283
+ const result = effect.transform(base2.value, checkCtx);
3284
+ if (result instanceof Promise) {
3285
3285
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
3286
3286
  }
3287
- return { status: status.value, value: result2 };
3287
+ return { status: status.value, value: result };
3288
3288
  } else {
3289
3289
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base2) => {
3290
3290
  if (!isValid(base2))
3291
3291
  return INVALID;
3292
- return Promise.resolve(effect.transform(base2.value, checkCtx)).then((result2) => ({
3292
+ return Promise.resolve(effect.transform(base2.value, checkCtx)).then((result) => ({
3293
3293
  status: status.value,
3294
- value: result2
3294
+ value: result
3295
3295
  }));
3296
3296
  });
3297
3297
  }
@@ -3388,18 +3388,18 @@ let ZodCatch$1 = class ZodCatch extends ZodType$1 {
3388
3388
  issues: []
3389
3389
  }
3390
3390
  };
3391
- const result2 = this._def.innerType._parse({
3391
+ const result = this._def.innerType._parse({
3392
3392
  data: newCtx.data,
3393
3393
  path: newCtx.path,
3394
3394
  parent: {
3395
3395
  ...newCtx
3396
3396
  }
3397
3397
  });
3398
- if (isAsync(result2)) {
3399
- return result2.then((result3) => {
3398
+ if (isAsync(result)) {
3399
+ return result.then((result2) => {
3400
3400
  return {
3401
3401
  status: "valid",
3402
- value: result3.status === "valid" ? result3.value : this._def.catchValue({
3402
+ value: result2.status === "valid" ? result2.value : this._def.catchValue({
3403
3403
  get error() {
3404
3404
  return new ZodError(newCtx.common.issues);
3405
3405
  },
@@ -3410,7 +3410,7 @@ let ZodCatch$1 = class ZodCatch extends ZodType$1 {
3410
3410
  } else {
3411
3411
  return {
3412
3412
  status: "valid",
3413
- value: result2.status === "valid" ? result2.value : this._def.catchValue({
3413
+ value: result.status === "valid" ? result.value : this._def.catchValue({
3414
3414
  get error() {
3415
3415
  return new ZodError(newCtx.common.issues);
3416
3416
  },
@@ -3523,14 +3523,14 @@ class ZodPipeline extends ZodType$1 {
3523
3523
  }
3524
3524
  let ZodReadonly$1 = class ZodReadonly extends ZodType$1 {
3525
3525
  _parse(input) {
3526
- const result2 = this._def.innerType._parse(input);
3526
+ const result = this._def.innerType._parse(input);
3527
3527
  const freeze = (data) => {
3528
3528
  if (isValid(data)) {
3529
3529
  data.value = Object.freeze(data.value);
3530
3530
  }
3531
3531
  return data;
3532
3532
  };
3533
- return isAsync(result2) ? result2.then((data) => freeze(data)) : freeze(result2);
3533
+ return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
3534
3534
  }
3535
3535
  unwrap() {
3536
3536
  return this._def.innerType;
@@ -4032,50 +4032,50 @@ function formatError(error, _mapper) {
4032
4032
  }
4033
4033
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
4034
4034
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
4035
- const result2 = schema._zod.run({ value, issues: [] }, ctx);
4036
- if (result2 instanceof Promise) {
4035
+ const result = schema._zod.run({ value, issues: [] }, ctx);
4036
+ if (result instanceof Promise) {
4037
4037
  throw new $ZodAsyncError();
4038
4038
  }
4039
- if (result2.issues.length) {
4040
- const e = new ((_params == null ? void 0 : _params.Err) ?? _Err)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())));
4039
+ if (result.issues.length) {
4040
+ const e = new ((_params == null ? void 0 : _params.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
4041
4041
  captureStackTrace(e, _params == null ? void 0 : _params.callee);
4042
4042
  throw e;
4043
4043
  }
4044
- return result2.value;
4044
+ return result.value;
4045
4045
  };
4046
4046
  const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
4047
4047
  const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
4048
- let result2 = schema._zod.run({ value, issues: [] }, ctx);
4049
- if (result2 instanceof Promise)
4050
- result2 = await result2;
4051
- if (result2.issues.length) {
4052
- const e = new ((params == null ? void 0 : params.Err) ?? _Err)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())));
4048
+ let result = schema._zod.run({ value, issues: [] }, ctx);
4049
+ if (result instanceof Promise)
4050
+ result = await result;
4051
+ if (result.issues.length) {
4052
+ const e = new ((params == null ? void 0 : params.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
4053
4053
  captureStackTrace(e, params == null ? void 0 : params.callee);
4054
4054
  throw e;
4055
4055
  }
4056
- return result2.value;
4056
+ return result.value;
4057
4057
  };
4058
4058
  const _safeParse = (_Err) => (schema, value, _ctx) => {
4059
4059
  const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
4060
- const result2 = schema._zod.run({ value, issues: [] }, ctx);
4061
- if (result2 instanceof Promise) {
4060
+ const result = schema._zod.run({ value, issues: [] }, ctx);
4061
+ if (result instanceof Promise) {
4062
4062
  throw new $ZodAsyncError();
4063
4063
  }
4064
- return result2.issues.length ? {
4064
+ return result.issues.length ? {
4065
4065
  success: false,
4066
- error: new (_Err ?? $ZodError)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
4067
- } : { success: true, data: result2.value };
4066
+ error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
4067
+ } : { success: true, data: result.value };
4068
4068
  };
4069
4069
  const safeParse$2 = /* @__PURE__ */ _safeParse($ZodRealError);
4070
4070
  const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
4071
4071
  const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
4072
- let result2 = schema._zod.run({ value, issues: [] }, ctx);
4073
- if (result2 instanceof Promise)
4074
- result2 = await result2;
4075
- return result2.issues.length ? {
4072
+ let result = schema._zod.run({ value, issues: [] }, ctx);
4073
+ if (result instanceof Promise)
4074
+ result = await result;
4075
+ return result.issues.length ? {
4076
4076
  success: false,
4077
- error: new _Err(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
4078
- } : { success: true, data: result2.value };
4077
+ error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
4078
+ } : { success: true, data: result.value };
4079
4079
  };
4080
4080
  const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
4081
4081
  const cuid = /^[cC][^\s-]{8,}$/;
@@ -4620,13 +4620,13 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
4620
4620
  return payload;
4621
4621
  };
4622
4622
  inst._zod.run = (payload, ctx) => {
4623
- const result2 = inst._zod.parse(payload, ctx);
4624
- if (result2 instanceof Promise) {
4623
+ const result = inst._zod.parse(payload, ctx);
4624
+ if (result instanceof Promise) {
4625
4625
  if (ctx.async === false)
4626
4626
  throw new $ZodAsyncError();
4627
- return result2.then((result3) => runChecks(result3, checks, ctx));
4627
+ return result.then((result2) => runChecks(result2, checks, ctx));
4628
4628
  }
4629
- return runChecks(result2, checks, ctx);
4629
+ return runChecks(result, checks, ctx);
4630
4630
  };
4631
4631
  }
4632
4632
  inst["~standard"] = {
@@ -5028,11 +5028,11 @@ const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
5028
5028
  return payload;
5029
5029
  };
5030
5030
  });
5031
- function handleArrayResult(result2, final, index) {
5032
- if (result2.issues.length) {
5033
- final.issues.push(...prefixIssues(index, result2.issues));
5031
+ function handleArrayResult(result, final, index) {
5032
+ if (result.issues.length) {
5033
+ final.issues.push(...prefixIssues(index, result.issues));
5034
5034
  }
5035
- final.value[index] = result2.value;
5035
+ final.value[index] = result.value;
5036
5036
  }
5037
5037
  const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
5038
5038
  $ZodType.init(inst, def);
@@ -5051,14 +5051,14 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
5051
5051
  const proms = [];
5052
5052
  for (let i = 0; i < input.length; i++) {
5053
5053
  const item = input[i];
5054
- const result2 = def.element._zod.run({
5054
+ const result = def.element._zod.run({
5055
5055
  value: item,
5056
5056
  issues: []
5057
5057
  }, ctx);
5058
- if (result2 instanceof Promise) {
5059
- proms.push(result2.then((result3) => handleArrayResult(result3, payload, i)));
5058
+ if (result instanceof Promise) {
5059
+ proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
5060
5060
  } else {
5061
- handleArrayResult(result2, payload, i);
5061
+ handleArrayResult(result, payload, i);
5062
5062
  }
5063
5063
  }
5064
5064
  if (proms.length) {
@@ -5067,28 +5067,28 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
5067
5067
  return payload;
5068
5068
  };
5069
5069
  });
5070
- function handleObjectResult(result2, final, key) {
5071
- if (result2.issues.length) {
5072
- final.issues.push(...prefixIssues(key, result2.issues));
5070
+ function handleObjectResult(result, final, key) {
5071
+ if (result.issues.length) {
5072
+ final.issues.push(...prefixIssues(key, result.issues));
5073
5073
  }
5074
- final.value[key] = result2.value;
5074
+ final.value[key] = result.value;
5075
5075
  }
5076
- function handleOptionalObjectResult(result2, final, key, input) {
5077
- if (result2.issues.length) {
5076
+ function handleOptionalObjectResult(result, final, key, input) {
5077
+ if (result.issues.length) {
5078
5078
  if (input[key] === void 0) {
5079
5079
  if (key in input) {
5080
5080
  final.value[key] = void 0;
5081
5081
  } else {
5082
- final.value[key] = result2.value;
5082
+ final.value[key] = result.value;
5083
5083
  }
5084
5084
  } else {
5085
- final.issues.push(...prefixIssues(key, result2.issues));
5085
+ final.issues.push(...prefixIssues(key, result.issues));
5086
5086
  }
5087
- } else if (result2.value === void 0) {
5087
+ } else if (result.value === void 0) {
5088
5088
  if (key in input)
5089
5089
  final.value[key] = void 0;
5090
5090
  } else {
5091
- final.value[key] = result2.value;
5091
+ final.value[key] = result.value;
5092
5092
  }
5093
5093
  }
5094
5094
  const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
@@ -5254,9 +5254,9 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
5254
5254
  };
5255
5255
  });
5256
5256
  function handleUnionResults(results, final, inst, ctx) {
5257
- for (const result2 of results) {
5258
- if (result2.issues.length === 0) {
5259
- final.value = result2.value;
5257
+ for (const result of results) {
5258
+ if (result.issues.length === 0) {
5259
+ final.value = result.value;
5260
5260
  return final;
5261
5261
  }
5262
5262
  }
@@ -5264,7 +5264,7 @@ function handleUnionResults(results, final, inst, ctx) {
5264
5264
  code: "invalid_union",
5265
5265
  input: final.value,
5266
5266
  inst,
5267
- errors: results.map((result2) => result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
5267
+ errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
5268
5268
  });
5269
5269
  return final;
5270
5270
  }
@@ -5289,17 +5289,17 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
5289
5289
  let async = false;
5290
5290
  const results = [];
5291
5291
  for (const option of def.options) {
5292
- const result2 = option._zod.run({
5292
+ const result = option._zod.run({
5293
5293
  value: payload.value,
5294
5294
  issues: []
5295
5295
  }, ctx);
5296
- if (result2 instanceof Promise) {
5297
- results.push(result2);
5296
+ if (result instanceof Promise) {
5297
+ results.push(result);
5298
5298
  async = true;
5299
5299
  } else {
5300
- if (result2.issues.length === 0)
5301
- return result2;
5302
- results.push(result2);
5300
+ if (result.issues.length === 0)
5301
+ return result;
5302
+ results.push(result);
5303
5303
  }
5304
5304
  }
5305
5305
  if (!async)
@@ -5432,21 +5432,21 @@ function mergeValues(a, b) {
5432
5432
  }
5433
5433
  return { valid: false, mergeErrorPath: [] };
5434
5434
  }
5435
- function handleIntersectionResults(result2, left, right) {
5435
+ function handleIntersectionResults(result, left, right) {
5436
5436
  if (left.issues.length) {
5437
- result2.issues.push(...left.issues);
5437
+ result.issues.push(...left.issues);
5438
5438
  }
5439
5439
  if (right.issues.length) {
5440
- result2.issues.push(...right.issues);
5440
+ result.issues.push(...right.issues);
5441
5441
  }
5442
- if (aborted(result2))
5443
- return result2;
5442
+ if (aborted(result))
5443
+ return result;
5444
5444
  const merged = mergeValues(left.value, right.value);
5445
5445
  if (!merged.valid) {
5446
5446
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
5447
5447
  }
5448
- result2.value = merged.data;
5449
- return result2;
5448
+ result.value = merged.data;
5449
+ return result;
5450
5450
  }
5451
5451
  const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
5452
5452
  $ZodType.init(inst, def);
@@ -5467,19 +5467,19 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
5467
5467
  payload.value = {};
5468
5468
  for (const key of values) {
5469
5469
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
5470
- const result2 = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
5471
- if (result2 instanceof Promise) {
5472
- proms.push(result2.then((result3) => {
5473
- if (result3.issues.length) {
5474
- payload.issues.push(...prefixIssues(key, result3.issues));
5470
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
5471
+ if (result instanceof Promise) {
5472
+ proms.push(result.then((result2) => {
5473
+ if (result2.issues.length) {
5474
+ payload.issues.push(...prefixIssues(key, result2.issues));
5475
5475
  }
5476
- payload.value[key] = result3.value;
5476
+ payload.value[key] = result2.value;
5477
5477
  }));
5478
5478
  } else {
5479
- if (result2.issues.length) {
5480
- payload.issues.push(...prefixIssues(key, result2.issues));
5479
+ if (result.issues.length) {
5480
+ payload.issues.push(...prefixIssues(key, result.issues));
5481
5481
  }
5482
- payload.value[key] = result2.value;
5482
+ payload.value[key] = result.value;
5483
5483
  }
5484
5484
  }
5485
5485
  }
@@ -5519,19 +5519,19 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
5519
5519
  payload.value[keyResult.value] = keyResult.value;
5520
5520
  continue;
5521
5521
  }
5522
- const result2 = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
5523
- if (result2 instanceof Promise) {
5524
- proms.push(result2.then((result3) => {
5525
- if (result3.issues.length) {
5526
- payload.issues.push(...prefixIssues(key, result3.issues));
5522
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
5523
+ if (result instanceof Promise) {
5524
+ proms.push(result.then((result2) => {
5525
+ if (result2.issues.length) {
5526
+ payload.issues.push(...prefixIssues(key, result2.issues));
5527
5527
  }
5528
- payload.value[keyResult.value] = result3.value;
5528
+ payload.value[keyResult.value] = result2.value;
5529
5529
  }));
5530
5530
  } else {
5531
- if (result2.issues.length) {
5532
- payload.issues.push(...prefixIssues(key, result2.issues));
5531
+ if (result.issues.length) {
5532
+ payload.issues.push(...prefixIssues(key, result.issues));
5533
5533
  }
5534
- payload.value[keyResult.value] = result2.value;
5534
+ payload.value[keyResult.value] = result.value;
5535
5535
  }
5536
5536
  }
5537
5537
  }
@@ -5643,11 +5643,11 @@ const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
5643
5643
  payload.value = def.defaultValue;
5644
5644
  return payload;
5645
5645
  }
5646
- const result2 = def.innerType._zod.run(payload, ctx);
5647
- if (result2 instanceof Promise) {
5648
- return result2.then((result3) => handleDefaultResult(result3, def));
5646
+ const result = def.innerType._zod.run(payload, ctx);
5647
+ if (result instanceof Promise) {
5648
+ return result.then((result2) => handleDefaultResult(result2, def));
5649
5649
  }
5650
- return handleDefaultResult(result2, def);
5650
+ return handleDefaultResult(result, def);
5651
5651
  };
5652
5652
  });
5653
5653
  function handleDefaultResult(payload, def) {
@@ -5674,11 +5674,11 @@ const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, d
5674
5674
  return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
5675
5675
  });
5676
5676
  inst._zod.parse = (payload, ctx) => {
5677
- const result2 = def.innerType._zod.run(payload, ctx);
5678
- if (result2 instanceof Promise) {
5679
- return result2.then((result3) => handleNonOptionalResult(result3, inst));
5677
+ const result = def.innerType._zod.run(payload, ctx);
5678
+ if (result instanceof Promise) {
5679
+ return result.then((result2) => handleNonOptionalResult(result2, inst));
5680
5680
  }
5681
- return handleNonOptionalResult(result2, inst);
5681
+ return handleNonOptionalResult(result, inst);
5682
5682
  };
5683
5683
  });
5684
5684
  function handleNonOptionalResult(payload, inst) {
@@ -5698,15 +5698,15 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
5698
5698
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
5699
5699
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
5700
5700
  inst._zod.parse = (payload, ctx) => {
5701
- const result2 = def.innerType._zod.run(payload, ctx);
5702
- if (result2 instanceof Promise) {
5703
- return result2.then((result3) => {
5704
- payload.value = result3.value;
5705
- if (result3.issues.length) {
5701
+ const result = def.innerType._zod.run(payload, ctx);
5702
+ if (result instanceof Promise) {
5703
+ return result.then((result2) => {
5704
+ payload.value = result2.value;
5705
+ if (result2.issues.length) {
5706
5706
  payload.value = def.catchValue({
5707
5707
  ...payload,
5708
5708
  error: {
5709
- issues: result3.issues.map((iss) => finalizeIssue(iss, ctx, config()))
5709
+ issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
5710
5710
  },
5711
5711
  input: payload.value
5712
5712
  });
@@ -5715,12 +5715,12 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
5715
5715
  return payload;
5716
5716
  });
5717
5717
  }
5718
- payload.value = result2.value;
5719
- if (result2.issues.length) {
5718
+ payload.value = result.value;
5719
+ if (result.issues.length) {
5720
5720
  payload.value = def.catchValue({
5721
5721
  ...payload,
5722
5722
  error: {
5723
- issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
5723
+ issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
5724
5724
  },
5725
5725
  input: payload.value
5726
5726
  });
@@ -5755,11 +5755,11 @@ const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) =>
5755
5755
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
5756
5756
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
5757
5757
  inst._zod.parse = (payload, ctx) => {
5758
- const result2 = def.innerType._zod.run(payload, ctx);
5759
- if (result2 instanceof Promise) {
5760
- return result2.then(handleReadonlyResult);
5758
+ const result = def.innerType._zod.run(payload, ctx);
5759
+ if (result instanceof Promise) {
5760
+ return result.then(handleReadonlyResult);
5761
5761
  }
5762
- return handleReadonlyResult(result2);
5762
+ return handleReadonlyResult(result);
5763
5763
  };
5764
5764
  });
5765
5765
  function handleReadonlyResult(payload) {
@@ -5782,8 +5782,8 @@ const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
5782
5782
  return;
5783
5783
  };
5784
5784
  });
5785
- function handleRefineResult(result2, payload, input, inst) {
5786
- if (!result2) {
5785
+ function handleRefineResult(result, payload, input, inst) {
5786
+ if (!result) {
5787
5787
  const _iss = {
5788
5788
  code: "custom",
5789
5789
  input,
@@ -6288,12 +6288,12 @@ function isZ4Schema(s) {
6288
6288
  }
6289
6289
  function safeParse$1(schema, data) {
6290
6290
  if (isZ4Schema(schema)) {
6291
- const result3 = safeParse$2(schema, data);
6292
- return result3;
6291
+ const result2 = safeParse$2(schema, data);
6292
+ return result2;
6293
6293
  }
6294
6294
  const v3Schema = schema;
6295
- const result2 = v3Schema.safeParse(data);
6296
- return result2;
6295
+ const result = v3Schema.safeParse(data);
6296
+ return result;
6297
6297
  }
6298
6298
  function getObjectShape(schema) {
6299
6299
  var _a2, _b;
@@ -8553,11 +8553,11 @@ function getMethodLiteral(schema) {
8553
8553
  return value;
8554
8554
  }
8555
8555
  function parseWithCompat(schema, data) {
8556
- const result2 = safeParse$1(schema, data);
8557
- if (!result2.success) {
8558
- throw result2.error;
8556
+ const result = safeParse$1(schema, data);
8557
+ if (!result.success) {
8558
+ throw result.error;
8559
8559
  }
8560
- return result2.data;
8560
+ return result.data;
8561
8561
  }
8562
8562
  const DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
8563
8563
  class Protocol {
@@ -8634,12 +8634,12 @@ class Protocol {
8634
8634
  return await handleTaskResult();
8635
8635
  }
8636
8636
  if (isTerminal(task.status)) {
8637
- const result2 = await this._taskStore.getTaskResult(taskId, extra.sessionId);
8637
+ const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
8638
8638
  this._clearTaskQueue(taskId);
8639
8639
  return {
8640
- ...result2,
8640
+ ...result,
8641
8641
  _meta: {
8642
- ...result2._meta,
8642
+ ...result._meta,
8643
8643
  [RELATED_TASK_META_KEY]: {
8644
8644
  taskId
8645
8645
  }
@@ -8870,12 +8870,12 @@ class Protocol {
8870
8870
  if (taskCreationParams) {
8871
8871
  this.assertTaskHandlerCapability(request.method);
8872
8872
  }
8873
- }).then(() => handler(request, fullExtra)).then(async (result2) => {
8873
+ }).then(() => handler(request, fullExtra)).then(async (result) => {
8874
8874
  if (abortController.signal.aborted) {
8875
8875
  return;
8876
8876
  }
8877
8877
  const response = {
8878
- result: result2,
8878
+ result,
8879
8879
  jsonrpc: "2.0",
8880
8880
  id: request.id
8881
8881
  };
@@ -8961,9 +8961,9 @@ class Protocol {
8961
8961
  this._cleanupTimeout(messageId);
8962
8962
  let isTaskResponse = false;
8963
8963
  if (isJSONRPCResultResponse(response) && response.result && typeof response.result === "object") {
8964
- const result2 = response.result;
8965
- if (result2.task && typeof result2.task === "object") {
8966
- const task = result2.task;
8964
+ const result = response.result;
8965
+ if (result.task && typeof result.task === "object") {
8966
+ const task = result.task;
8967
8967
  if (typeof task.taskId === "string") {
8968
8968
  isTaskResponse = true;
8969
8969
  this._taskProgressTokens.set(task.taskId, messageId);
@@ -9022,8 +9022,8 @@ class Protocol {
9022
9022
  const { task } = options ?? {};
9023
9023
  if (!task) {
9024
9024
  try {
9025
- const result2 = await this.request(request, resultSchema, options);
9026
- yield { type: "result", result: result2 };
9025
+ const result = await this.request(request, resultSchema, options);
9026
+ yield { type: "result", result };
9027
9027
  } catch (error) {
9028
9028
  yield {
9029
9029
  type: "error",
@@ -9046,8 +9046,8 @@ class Protocol {
9046
9046
  yield { type: "taskStatus", task: task2 };
9047
9047
  if (isTerminal(task2.status)) {
9048
9048
  if (task2.status === "completed") {
9049
- const result2 = await this.getTaskResult({ taskId }, resultSchema, options);
9050
- yield { type: "result", result: result2 };
9049
+ const result = await this.getTaskResult({ taskId }, resultSchema, options);
9050
+ yield { type: "result", result };
9051
9051
  } else if (task2.status === "failed") {
9052
9052
  yield {
9053
9053
  type: "error",
@@ -9062,8 +9062,8 @@ class Protocol {
9062
9062
  return;
9063
9063
  }
9064
9064
  if (task2.status === "input_required") {
9065
- const result2 = await this.getTaskResult({ taskId }, resultSchema, options);
9066
- yield { type: "result", result: result2 };
9065
+ const result = await this.getTaskResult({ taskId }, resultSchema, options);
9066
+ yield { type: "result", result };
9067
9067
  return;
9068
9068
  }
9069
9069
  const pollInterval = task2.pollInterval ?? ((_a2 = this._options) == null ? void 0 : _a2.defaultTaskPollInterval) ?? 1e3;
@@ -9465,8 +9465,8 @@ class Protocol {
9465
9465
  }
9466
9466
  return task;
9467
9467
  },
9468
- storeTaskResult: async (taskId, status, result2) => {
9469
- await taskStore.storeTaskResult(taskId, status, result2, sessionId);
9468
+ storeTaskResult: async (taskId, status, result) => {
9469
+ await taskStore.storeTaskResult(taskId, status, result, sessionId);
9470
9470
  const task = await taskStore.getTask(taskId, sessionId);
9471
9471
  if (task) {
9472
9472
  const notification = TaskStatusNotificationSchema.parse({
@@ -9513,20 +9513,20 @@ function isPlainObject(value) {
9513
9513
  return value !== null && typeof value === "object" && !Array.isArray(value);
9514
9514
  }
9515
9515
  function mergeCapabilities(base2, additional) {
9516
- const result2 = { ...base2 };
9516
+ const result = { ...base2 };
9517
9517
  for (const key in additional) {
9518
9518
  const k = key;
9519
9519
  const addValue = additional[k];
9520
9520
  if (addValue === void 0)
9521
9521
  continue;
9522
- const baseValue = result2[k];
9522
+ const baseValue = result[k];
9523
9523
  if (isPlainObject(baseValue) && isPlainObject(addValue)) {
9524
- result2[k] = { ...baseValue, ...addValue };
9524
+ result[k] = { ...baseValue, ...addValue };
9525
9525
  } else {
9526
- result2[k] = addValue;
9526
+ result[k] = addValue;
9527
9527
  }
9528
9528
  }
9529
- return result2;
9529
+ return result;
9530
9530
  }
9531
9531
  function getDefaultExportFromCjs(x) {
9532
9532
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -11435,10 +11435,10 @@ function requireKeyword() {
11435
11435
  if (def.async && !schemaEnv.$async)
11436
11436
  throw new Error("async keyword in sync schema");
11437
11437
  }
11438
- function useKeyword(gen, keyword2, result2) {
11439
- if (result2 === void 0)
11438
+ function useKeyword(gen, keyword2, result) {
11439
+ if (result === void 0)
11440
11440
  throw new Error(`keyword "${keyword2}" failed to compile`);
11441
- return gen.scopeValue("keyword", typeof result2 == "function" ? { ref: result2 } : { ref: result2, code: (0, codegen_1.stringify)(result2) });
11441
+ return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
11442
11442
  }
11443
11443
  function validSchemaType(schema, schemaType, allowUndefined = false) {
11444
11444
  return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined");
@@ -16379,17 +16379,17 @@ class ExperimentalClientTasks {
16379
16379
  const validator = clientInternal.getToolOutputValidator(params.name);
16380
16380
  for await (const message of stream) {
16381
16381
  if (message.type === "result" && validator) {
16382
- const result2 = message.result;
16383
- if (!result2.structuredContent && !result2.isError) {
16382
+ const result = message.result;
16383
+ if (!result.structuredContent && !result.isError) {
16384
16384
  yield {
16385
16385
  type: "error",
16386
16386
  error: new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`)
16387
16387
  };
16388
16388
  return;
16389
16389
  }
16390
- if (result2.structuredContent) {
16390
+ if (result.structuredContent) {
16391
16391
  try {
16392
- const validationResult = validator(result2.structuredContent);
16392
+ const validationResult = validator(result.structuredContent);
16393
16393
  if (!validationResult.valid) {
16394
16394
  yield {
16395
16395
  type: "error",
@@ -16578,20 +16578,20 @@ class Client extends Protocol {
16578
16578
  var _a2, _b, _c, _d, _e, _f;
16579
16579
  if (config2.tools && ((_b = (_a2 = this._serverCapabilities) == null ? void 0 : _a2.tools) == null ? void 0 : _b.listChanged)) {
16580
16580
  this._setupListChangedHandler("tools", ToolListChangedNotificationSchema, config2.tools, async () => {
16581
- const result2 = await this.listTools();
16582
- return result2.tools;
16581
+ const result = await this.listTools();
16582
+ return result.tools;
16583
16583
  });
16584
16584
  }
16585
16585
  if (config2.prompts && ((_d = (_c = this._serverCapabilities) == null ? void 0 : _c.prompts) == null ? void 0 : _d.listChanged)) {
16586
16586
  this._setupListChangedHandler("prompts", PromptListChangedNotificationSchema, config2.prompts, async () => {
16587
- const result2 = await this.listPrompts();
16588
- return result2.prompts;
16587
+ const result = await this.listPrompts();
16588
+ return result.prompts;
16589
16589
  });
16590
16590
  }
16591
16591
  if (config2.resources && ((_f = (_e = this._serverCapabilities) == null ? void 0 : _e.resources) == null ? void 0 : _f.listChanged)) {
16592
16592
  this._setupListChangedHandler("resources", ResourceListChangedNotificationSchema, config2.resources, async () => {
16593
- const result2 = await this.listResources();
16594
- return result2.resources;
16593
+ const result = await this.listResources();
16594
+ return result.resources;
16595
16595
  });
16596
16596
  }
16597
16597
  }
@@ -16662,16 +16662,16 @@ class Client extends Protocol {
16662
16662
  if (params.mode === "url" && !supportsUrlMode) {
16663
16663
  throw new McpError(ErrorCode.InvalidParams, "Client does not support URL-mode elicitation requests");
16664
16664
  }
16665
- const result2 = await Promise.resolve(handler(request, extra));
16665
+ const result = await Promise.resolve(handler(request, extra));
16666
16666
  if (params.task) {
16667
- const taskValidationResult = safeParse$1(CreateTaskResultSchema, result2);
16667
+ const taskValidationResult = safeParse$1(CreateTaskResultSchema, result);
16668
16668
  if (!taskValidationResult.success) {
16669
16669
  const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
16670
16670
  throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
16671
16671
  }
16672
16672
  return taskValidationResult.data;
16673
16673
  }
16674
- const validationResult = safeParse$1(ElicitResultSchema, result2);
16674
+ const validationResult = safeParse$1(ElicitResultSchema, result);
16675
16675
  if (!validationResult.success) {
16676
16676
  const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
16677
16677
  throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation result: ${errorMessage}`);
@@ -16698,9 +16698,9 @@ class Client extends Protocol {
16698
16698
  throw new McpError(ErrorCode.InvalidParams, `Invalid sampling request: ${errorMessage}`);
16699
16699
  }
16700
16700
  const { params } = validatedRequest.data;
16701
- const result2 = await Promise.resolve(handler(request, extra));
16701
+ const result = await Promise.resolve(handler(request, extra));
16702
16702
  if (params.task) {
16703
- const taskValidationResult = safeParse$1(CreateTaskResultSchema, result2);
16703
+ const taskValidationResult = safeParse$1(CreateTaskResultSchema, result);
16704
16704
  if (!taskValidationResult.success) {
16705
16705
  const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
16706
16706
  throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
@@ -16709,7 +16709,7 @@ class Client extends Protocol {
16709
16709
  }
16710
16710
  const hasTools = params.tools || params.toolChoice;
16711
16711
  const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema;
16712
- const validationResult = safeParse$1(resultSchema, result2);
16712
+ const validationResult = safeParse$1(resultSchema, result);
16713
16713
  if (!validationResult.success) {
16714
16714
  const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
16715
16715
  throw new McpError(ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`);
@@ -16732,7 +16732,7 @@ class Client extends Protocol {
16732
16732
  return;
16733
16733
  }
16734
16734
  try {
16735
- const result2 = await this.request({
16735
+ const result = await this.request({
16736
16736
  method: "initialize",
16737
16737
  params: {
16738
16738
  protocolVersion: LATEST_PROTOCOL_VERSION,
@@ -16740,18 +16740,18 @@ class Client extends Protocol {
16740
16740
  clientInfo: this._clientInfo
16741
16741
  }
16742
16742
  }, InitializeResultSchema, options);
16743
- if (result2 === void 0) {
16744
- throw new Error(`Server sent invalid initialize result: ${result2}`);
16743
+ if (result === void 0) {
16744
+ throw new Error(`Server sent invalid initialize result: ${result}`);
16745
16745
  }
16746
- if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result2.protocolVersion)) {
16747
- throw new Error(`Server's protocol version is not supported: ${result2.protocolVersion}`);
16746
+ if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) {
16747
+ throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`);
16748
16748
  }
16749
- this._serverCapabilities = result2.capabilities;
16750
- this._serverVersion = result2.serverInfo;
16749
+ this._serverCapabilities = result.capabilities;
16750
+ this._serverVersion = result.serverInfo;
16751
16751
  if (transport.setProtocolVersion) {
16752
- transport.setProtocolVersion(result2.protocolVersion);
16752
+ transport.setProtocolVersion(result.protocolVersion);
16753
16753
  }
16754
- this._instructions = result2.instructions;
16754
+ this._instructions = result.instructions;
16755
16755
  await this.notification({
16756
16756
  method: "notifications/initialized"
16757
16757
  });
@@ -16911,15 +16911,15 @@ class Client extends Protocol {
16911
16911
  if (this.isToolTaskRequired(params.name)) {
16912
16912
  throw new McpError(ErrorCode.InvalidRequest, `Tool "${params.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);
16913
16913
  }
16914
- const result2 = await this.request({ method: "tools/call", params }, resultSchema, options);
16914
+ const result = await this.request({ method: "tools/call", params }, resultSchema, options);
16915
16915
  const validator = this.getToolOutputValidator(params.name);
16916
16916
  if (validator) {
16917
- if (!result2.structuredContent && !result2.isError) {
16917
+ if (!result.structuredContent && !result.isError) {
16918
16918
  throw new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`);
16919
16919
  }
16920
- if (result2.structuredContent) {
16920
+ if (result.structuredContent) {
16921
16921
  try {
16922
- const validationResult = validator(result2.structuredContent);
16922
+ const validationResult = validator(result.structuredContent);
16923
16923
  if (!validationResult.valid) {
16924
16924
  throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`);
16925
16925
  }
@@ -16931,7 +16931,7 @@ class Client extends Protocol {
16931
16931
  }
16932
16932
  }
16933
16933
  }
16934
- return result2;
16934
+ return result;
16935
16935
  }
16936
16936
  isToolTask(toolName) {
16937
16937
  var _a2, _b, _c, _d;
@@ -16977,9 +16977,9 @@ class Client extends Protocol {
16977
16977
  return this._cachedToolOutputValidators.get(toolName);
16978
16978
  }
16979
16979
  async listTools(params, options) {
16980
- const result2 = await this.request({ method: "tools/list", params }, ListToolsResultSchema, options);
16981
- this.cacheToolMetadata(result2.tools);
16982
- return result2;
16980
+ const result = await this.request({ method: "tools/list", params }, ListToolsResultSchema, options);
16981
+ this.cacheToolMetadata(result.tools);
16982
+ return result;
16983
16983
  }
16984
16984
  /**
16985
16985
  * Set up a single list changed handler.
@@ -17371,11 +17371,11 @@ class NineMuService {
17371
17371
  currentRoutes
17372
17372
  })
17373
17373
  });
17374
- const result2 = await response.json();
17375
- if (!result2.success) {
17376
- throw new Error(result2.error || "소스 생성 중 서버 오류가 발생했습니다.");
17374
+ const result = await response.json();
17375
+ if (!result.success) {
17376
+ throw new Error(result.error || "소스 생성 중 서버 오류가 발생했습니다.");
17377
17377
  }
17378
- return result2;
17378
+ return result;
17379
17379
  } catch (error) {
17380
17380
  trace.error("NineMu Service Error:", error);
17381
17381
  throw error;
@@ -17408,11 +17408,11 @@ class NineMuService {
17408
17408
  })
17409
17409
  });
17410
17410
  trace.log(response);
17411
- const result2 = await response.json();
17412
- if (!result2.success) {
17413
- throw new Error(result2.error || "소스 생성 중 서버 오류가 발생했습니다.");
17411
+ const result = await response.json();
17412
+ if (!result.success) {
17413
+ throw new Error(result.error || "소스 생성 중 서버 오류가 발생했습니다.");
17414
17414
  }
17415
- return result2;
17415
+ return result;
17416
17416
  } catch (error) {
17417
17417
  trace.error("NineMu Service Error:", error);
17418
17418
  throw error;
@@ -17512,7 +17512,7 @@ initActions_fn = function() {
17512
17512
  target.setAttribute("disabled", "disabled");
17513
17513
  __privateGet(this, _$nineChatMessage).add("me", userInput);
17514
17514
  __privateGet(this, _$nineChatMessage).add("ing", "");
17515
- const [result2, err] = await nine$1.safe(__privateGet(this, _manager).handleChatSubmit(target.value));
17515
+ const [result, err] = await nine$1.safe(__privateGet(this, _manager).handleChatSubmit(target.value));
17516
17516
  setTimeout(() => {
17517
17517
  target.value = "";
17518
17518
  });
@@ -17522,8 +17522,8 @@ initActions_fn = function() {
17522
17522
  trace.error(err);
17523
17523
  __privateGet(this, _$nineChatMessage).add("ai", err.message || "알 수 없는 오류가 발생했습니다. 다시 시도해주세요.");
17524
17524
  } else {
17525
- trace.log(result2);
17526
- const rawText = (_b = (_a2 = result2 == null ? void 0 : result2.content) == null ? void 0 : _a2[0]) == null ? void 0 : _b.text;
17525
+ trace.log(result);
17526
+ const rawText = (_b = (_a2 = result == null ? void 0 : result.content) == null ? void 0 : _a2[0]) == null ? void 0 : _b.text;
17527
17527
  const parsed = JSON.parse(rawText);
17528
17528
  if (parsed.message) {
17529
17529
  __privateGet(this, _manager).addChatHistory(parsed.message);
@@ -17540,7 +17540,7 @@ render_fn = function() {
17540
17540
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
17541
17541
  this.shadowRoot.innerHTML = `
17542
17542
  <style>
17543
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.407"}/dist/css/nine-mu.css";
17543
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.409"}/dist/css/nine-mu.css";
17544
17544
  ${customImport}
17545
17545
  </style>
17546
17546
  <div class="wrapper">
@@ -17849,16 +17849,16 @@ class TextLeaf extends Text {
17849
17849
  }
17850
17850
  sliceString(from, to = this.length, lineSep = "\n") {
17851
17851
  [from, to] = clip(this, from, to);
17852
- let result2 = "";
17852
+ let result = "";
17853
17853
  for (let pos = 0, i = 0; pos <= to && i < this.text.length; i++) {
17854
17854
  let line = this.text[i], end = pos + line.length;
17855
17855
  if (pos > from && i)
17856
- result2 += lineSep;
17856
+ result += lineSep;
17857
17857
  if (from < end && to > pos)
17858
- result2 += line.slice(Math.max(0, from - pos), to - pos);
17858
+ result += line.slice(Math.max(0, from - pos), to - pos);
17859
17859
  pos = end + 1;
17860
17860
  }
17861
- return result2;
17861
+ return result;
17862
17862
  }
17863
17863
  flatten(target) {
17864
17864
  for (let line of this.text)
@@ -17935,16 +17935,16 @@ class TextNode extends Text {
17935
17935
  }
17936
17936
  sliceString(from, to = this.length, lineSep = "\n") {
17937
17937
  [from, to] = clip(this, from, to);
17938
- let result2 = "";
17938
+ let result = "";
17939
17939
  for (let i = 0, pos = 0; i < this.children.length && pos <= to; i++) {
17940
17940
  let child = this.children[i], end = pos + child.length;
17941
17941
  if (pos > from && i)
17942
- result2 += lineSep;
17942
+ result += lineSep;
17943
17943
  if (from < end && to > pos)
17944
- result2 += child.sliceString(from - pos, to - pos, lineSep);
17944
+ result += child.sliceString(from - pos, to - pos, lineSep);
17945
17945
  pos = end + 1;
17946
17946
  }
17947
- return result2;
17947
+ return result;
17948
17948
  }
17949
17949
  flatten(target) {
17950
17950
  for (let child of this.children)
@@ -18253,21 +18253,21 @@ class ChangeDesc {
18253
18253
  The length of the document before the change.
18254
18254
  */
18255
18255
  get length() {
18256
- let result2 = 0;
18256
+ let result = 0;
18257
18257
  for (let i = 0; i < this.sections.length; i += 2)
18258
- result2 += this.sections[i];
18259
- return result2;
18258
+ result += this.sections[i];
18259
+ return result;
18260
18260
  }
18261
18261
  /**
18262
18262
  The length of the document after the change.
18263
18263
  */
18264
18264
  get newLength() {
18265
- let result2 = 0;
18265
+ let result = 0;
18266
18266
  for (let i = 0; i < this.sections.length; i += 2) {
18267
18267
  let ins = this.sections[i + 1];
18268
- result2 += ins < 0 ? this.sections[i] : ins;
18268
+ result += ins < 0 ? this.sections[i] : ins;
18269
18269
  }
18270
- return result2;
18270
+ return result;
18271
18271
  }
18272
18272
  /**
18273
18273
  False when there are actual changes in this set.
@@ -18377,12 +18377,12 @@ class ChangeDesc {
18377
18377
  @internal
18378
18378
  */
18379
18379
  toString() {
18380
- let result2 = "";
18380
+ let result = "";
18381
18381
  for (let i = 0; i < this.sections.length; ) {
18382
18382
  let len = this.sections[i++], ins = this.sections[i++];
18383
- result2 += (result2 ? " " : "") + len + (ins >= 0 ? ":" + ins : "");
18383
+ result += (result ? " " : "") + len + (ins >= 0 ? ":" + ins : "");
18384
18384
  }
18385
- return result2;
18385
+ return result;
18386
18386
  }
18387
18387
  /**
18388
18388
  Serialize this change desc to a JSON-representable value.
@@ -19450,16 +19450,16 @@ class Configuration {
19450
19450
  }
19451
19451
  }
19452
19452
  function flatten(extension, compartments, newCompartments) {
19453
- let result2 = [[], [], [], [], []];
19453
+ let result = [[], [], [], [], []];
19454
19454
  let seen = /* @__PURE__ */ new Map();
19455
19455
  function inner(ext, prec2) {
19456
19456
  let known = seen.get(ext);
19457
19457
  if (known != null) {
19458
19458
  if (known <= prec2)
19459
19459
  return;
19460
- let found = result2[known].indexOf(ext);
19460
+ let found = result[known].indexOf(ext);
19461
19461
  if (found > -1)
19462
- result2[known].splice(found, 1);
19462
+ result[known].splice(found, 1);
19463
19463
  if (ext instanceof CompartmentInstance)
19464
19464
  newCompartments.delete(ext.compartment);
19465
19465
  }
@@ -19476,11 +19476,11 @@ function flatten(extension, compartments, newCompartments) {
19476
19476
  } else if (ext instanceof PrecExtension) {
19477
19477
  inner(ext.inner, ext.prec);
19478
19478
  } else if (ext instanceof StateField) {
19479
- result2[prec2].push(ext);
19479
+ result[prec2].push(ext);
19480
19480
  if (ext.provides)
19481
19481
  inner(ext.provides, prec2);
19482
19482
  } else if (ext instanceof FacetProvider) {
19483
- result2[prec2].push(ext);
19483
+ result[prec2].push(ext);
19484
19484
  if (ext.facet.extensions)
19485
19485
  inner(ext.facet.extensions, Prec_.default);
19486
19486
  } else {
@@ -19491,7 +19491,7 @@ function flatten(extension, compartments, newCompartments) {
19491
19491
  }
19492
19492
  }
19493
19493
  inner(extension, Prec_.default);
19494
- return result2.reduce((a, b) => a.concat(b));
19494
+ return result.reduce((a, b) => a.concat(b));
19495
19495
  }
19496
19496
  function ensureAddr(state, addr) {
19497
19497
  if (addr & 1)
@@ -19601,13 +19601,13 @@ class StateEffect {
19601
19601
  static mapEffects(effects, mapping) {
19602
19602
  if (!effects.length)
19603
19603
  return effects;
19604
- let result2 = [];
19604
+ let result = [];
19605
19605
  for (let effect of effects) {
19606
19606
  let mapped = effect.map(mapping);
19607
19607
  if (mapped)
19608
- result2.push(mapped);
19608
+ result.push(mapped);
19609
19609
  }
19610
- return result2;
19610
+ return result;
19611
19611
  }
19612
19612
  }
19613
19613
  StateEffect.reconfigure = /* @__PURE__ */ StateEffect.define();
@@ -19705,7 +19705,7 @@ Transaction.userEvent = /* @__PURE__ */ Annotation.define();
19705
19705
  Transaction.addToHistory = /* @__PURE__ */ Annotation.define();
19706
19706
  Transaction.remote = /* @__PURE__ */ Annotation.define();
19707
19707
  function joinRanges(a, b) {
19708
- let result2 = [];
19708
+ let result = [];
19709
19709
  for (let iA = 0, iB = 0; ; ) {
19710
19710
  let from, to;
19711
19711
  if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) {
@@ -19715,11 +19715,11 @@ function joinRanges(a, b) {
19715
19715
  from = b[iB++];
19716
19716
  to = b[iB++];
19717
19717
  } else
19718
- return result2;
19719
- if (!result2.length || result2[result2.length - 1] < from)
19720
- result2.push(from, to);
19721
- else if (result2[result2.length - 1] < to)
19722
- result2[result2.length - 1] = to;
19718
+ return result;
19719
+ if (!result.length || result[result.length - 1] < from)
19720
+ result.push(from, to);
19721
+ else if (result[result.length - 1] < to)
19722
+ result[result.length - 1] = to;
19723
19723
  }
19724
19724
  }
19725
19725
  function mergeTransaction(a, b, sequential) {
@@ -19769,23 +19769,23 @@ function resolveTransaction(state, specs, filter) {
19769
19769
  }
19770
19770
  function filterTransaction(tr) {
19771
19771
  let state = tr.startState;
19772
- let result2 = true;
19772
+ let result = true;
19773
19773
  for (let filter of state.facet(changeFilter)) {
19774
19774
  let value = filter(tr);
19775
19775
  if (value === false) {
19776
- result2 = false;
19776
+ result = false;
19777
19777
  break;
19778
19778
  }
19779
19779
  if (Array.isArray(value))
19780
- result2 = result2 === true ? value : joinRanges(result2, value);
19780
+ result = result === true ? value : joinRanges(result, value);
19781
19781
  }
19782
- if (result2 !== true) {
19782
+ if (result !== true) {
19783
19783
  let changes, back;
19784
- if (result2 === false) {
19784
+ if (result === false) {
19785
19785
  back = tr.changes.invertedDesc;
19786
19786
  changes = ChangeSet.empty(state.doc.length);
19787
19787
  } else {
19788
- let filtered = tr.changes.filter(result2);
19788
+ let filtered = tr.changes.filter(result);
19789
19789
  changes = filtered.changes;
19790
19790
  back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;
19791
19791
  }
@@ -19953,14 +19953,14 @@ class EditorState {
19953
19953
  let changes = this.changes(result1.changes), ranges = [result1.range];
19954
19954
  let effects = asArray$1(result1.effects);
19955
19955
  for (let i = 1; i < sel.ranges.length; i++) {
19956
- let result2 = f(sel.ranges[i]);
19957
- let newChanges = this.changes(result2.changes), newMapped = newChanges.map(changes);
19956
+ let result = f(sel.ranges[i]);
19957
+ let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes);
19958
19958
  for (let j = 0; j < i; j++)
19959
19959
  ranges[j] = ranges[j].map(newMapped);
19960
19960
  let mapBy = changes.mapDesc(newChanges, true);
19961
- ranges.push(result2.range.map(mapBy));
19961
+ ranges.push(result.range.map(mapBy));
19962
19962
  changes = changes.compose(newMapped);
19963
- effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(result2.effects), mapBy));
19963
+ effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(result.effects), mapBy));
19964
19964
  }
19965
19965
  return {
19966
19966
  changes,
@@ -20009,7 +20009,7 @@ class EditorState {
20009
20009
  not use `doc` or `selection`) to fields.
20010
20010
  */
20011
20011
  toJSON(fields) {
20012
- let result2 = {
20012
+ let result = {
20013
20013
  doc: this.sliceDoc(),
20014
20014
  selection: this.selection.toJSON()
20015
20015
  };
@@ -20017,9 +20017,9 @@ class EditorState {
20017
20017
  for (let prop in fields) {
20018
20018
  let value = fields[prop];
20019
20019
  if (value instanceof StateField && this.config.address[value.id] != null)
20020
- result2[prop] = value.spec.toJSON(this.field(fields[prop]), this);
20020
+ result[prop] = value.spec.toJSON(this.field(fields[prop]), this);
20021
20021
  }
20022
- return result2;
20022
+ return result;
20023
20023
  }
20024
20024
  /**
20025
20025
  Deserialize a state from its JSON representation. When custom
@@ -20123,9 +20123,9 @@ class EditorState {
20123
20123
  languageDataAt(name2, pos, side = -1) {
20124
20124
  let values = [];
20125
20125
  for (let provider of this.facet(languageData)) {
20126
- for (let result2 of provider(this, pos, side)) {
20127
- if (Object.prototype.hasOwnProperty.call(result2, name2))
20128
- values.push(result2[name2]);
20126
+ for (let result of provider(this, pos, side)) {
20127
+ if (Object.prototype.hasOwnProperty.call(result, name2))
20128
+ values.push(result[name2]);
20129
20129
  }
20130
20130
  }
20131
20131
  return values;
@@ -20188,22 +20188,22 @@ EditorState.transactionFilter = transactionFilter;
20188
20188
  EditorState.transactionExtender = transactionExtender;
20189
20189
  Compartment.reconfigure = /* @__PURE__ */ StateEffect.define();
20190
20190
  function combineConfig(configs, defaults2, combine = {}) {
20191
- let result2 = {};
20191
+ let result = {};
20192
20192
  for (let config2 of configs)
20193
20193
  for (let key of Object.keys(config2)) {
20194
- let value = config2[key], current = result2[key];
20194
+ let value = config2[key], current = result[key];
20195
20195
  if (current === void 0)
20196
- result2[key] = value;
20196
+ result[key] = value;
20197
20197
  else if (current === value || value === void 0) ;
20198
20198
  else if (Object.hasOwnProperty.call(combine, key))
20199
- result2[key] = combine[key](current, value);
20199
+ result[key] = combine[key](current, value);
20200
20200
  else
20201
20201
  throw new Error("Config merge conflict for field " + key);
20202
20202
  }
20203
20203
  for (let key in defaults2)
20204
- if (result2[key] === void 0)
20205
- result2[key] = defaults2[key];
20206
- return result2;
20204
+ if (result[key] === void 0)
20205
+ result[key] = defaults2[key];
20206
+ return result;
20207
20207
  }
20208
20208
  class RangeValue {
20209
20209
  /**
@@ -20530,12 +20530,12 @@ class RangeSet {
20530
20530
  static join(sets) {
20531
20531
  if (!sets.length)
20532
20532
  return RangeSet.empty;
20533
- let result2 = sets[sets.length - 1];
20533
+ let result = sets[sets.length - 1];
20534
20534
  for (let i = sets.length - 2; i >= 0; i--) {
20535
20535
  for (let layer2 = sets[i]; layer2 != RangeSet.empty; layer2 = layer2.nextLayer)
20536
- result2 = new RangeSet(layer2.chunkPos, layer2.chunk, result2, Math.max(layer2.maxPoint, result2.maxPoint));
20536
+ result = new RangeSet(layer2.chunkPos, layer2.chunk, result, Math.max(layer2.maxPoint, result.maxPoint));
20537
20537
  }
20538
- return result2;
20538
+ return result;
20539
20539
  }
20540
20540
  }
20541
20541
  RangeSet.empty = /* @__PURE__ */ new RangeSet([], [], null, -1);
@@ -20643,9 +20643,9 @@ class RangeSetBuilder {
20643
20643
  this.finishChunk(false);
20644
20644
  if (this.chunks.length == 0)
20645
20645
  return next;
20646
- let result2 = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);
20646
+ let result = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);
20647
20647
  this.from = null;
20648
- return result2;
20648
+ return result;
20649
20649
  }
20650
20650
  }
20651
20651
  function findSharedChunks(a, b, textDiff) {
@@ -22002,10 +22002,10 @@ var Direction = /* @__PURE__ */ (function(Direction2) {
22002
22002
  })(Direction || (Direction = {}));
22003
22003
  const LTR = Direction.LTR, RTL = Direction.RTL;
22004
22004
  function dec(str) {
22005
- let result2 = [];
22005
+ let result = [];
22006
22006
  for (let i = 0; i < str.length; i++)
22007
- result2.push(1 << +str[i]);
22008
- return result2;
22007
+ result.push(1 << +str[i]);
22008
+ return result;
22009
22009
  }
22010
22010
  const LowTypes = /* @__PURE__ */ dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008");
22011
22011
  const ArabicTypes = /* @__PURE__ */ dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");
@@ -22518,13 +22518,13 @@ function getIsolatedRanges(view, line) {
22518
22518
  if (!isolates.length)
22519
22519
  return isolates;
22520
22520
  let sets = isolates.map((i) => i instanceof Function ? i(view) : i);
22521
- let result2 = [];
22521
+ let result = [];
22522
22522
  RangeSet.spans(sets, line.from, line.to, {
22523
22523
  point() {
22524
22524
  },
22525
22525
  span(fromDoc, toDoc, active, open) {
22526
22526
  let from = fromDoc - line.from, to = toDoc - line.from;
22527
- let level = result2;
22527
+ let level = result;
22528
22528
  for (let i = active.length - 1; i >= 0; i--, open--) {
22529
22529
  let direction = active[i].spec.bidiIsolate, update;
22530
22530
  if (direction == null)
@@ -22540,7 +22540,7 @@ function getIsolatedRanges(view, line) {
22540
22540
  }
22541
22541
  }
22542
22542
  });
22543
- return result2;
22543
+ return result;
22544
22544
  }
22545
22545
  const scrollMargins = /* @__PURE__ */ Facet.define();
22546
22546
  function getScrollMargins(view) {
@@ -22593,7 +22593,7 @@ class ChangedRange {
22593
22593
  static extendWithRanges(diff, ranges) {
22594
22594
  if (ranges.length == 0)
22595
22595
  return diff;
22596
- let result2 = [];
22596
+ let result = [];
22597
22597
  for (let dI = 0, rI = 0, off = 0; ; ) {
22598
22598
  let nextD = dI < diff.length ? diff[dI].fromB : 1e9;
22599
22599
  let nextR = rI < ranges.length ? ranges[rI] : 1e9;
@@ -22618,9 +22618,9 @@ class ChangedRange {
22618
22618
  break;
22619
22619
  }
22620
22620
  }
22621
- result2.push(new ChangedRange(fromA, toA, fromB, toB));
22621
+ result.push(new ChangedRange(fromA, toA, fromB, toB));
22622
22622
  }
22623
- return result2;
22623
+ return result;
22624
22624
  }
22625
22625
  }
22626
22626
  class ViewUpdate {
@@ -22896,9 +22896,9 @@ class DocTile extends CompositeTile {
22896
22896
  i = 0;
22897
22897
  } else {
22898
22898
  let end = pos + next.length;
22899
- let result2 = f(next, pos);
22900
- if (result2 !== void 0)
22901
- return result2;
22899
+ let result = f(next, pos);
22900
+ if (result !== void 0)
22901
+ return result;
22902
22902
  pos = end + next.breakAfter;
22903
22903
  }
22904
22904
  }
@@ -24243,7 +24243,7 @@ class DocView {
24243
24243
  return scan(tile, offset);
24244
24244
  }
24245
24245
  measureVisibleLineHeights(viewport) {
24246
- let result2 = [], { from, to } = viewport;
24246
+ let result = [], { from, to } = viewport;
24247
24247
  let contentWidth = this.view.contentDOM.clientWidth;
24248
24248
  let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1;
24249
24249
  let widest = -1, ltr = this.view.textDirection == Direction.LTR;
@@ -24261,8 +24261,8 @@ class DocView {
24261
24261
  scan(child, pos, childRect);
24262
24262
  } else if (pos >= from) {
24263
24263
  if (spaceAbove > 0)
24264
- result2.push(-spaceAbove);
24265
- result2.push(height + spaceAbove);
24264
+ result.push(-spaceAbove);
24265
+ result.push(height + spaceAbove);
24266
24266
  spaceAbove = 0;
24267
24267
  if (isWider) {
24268
24268
  let last = child.dom.lastChild;
@@ -24285,7 +24285,7 @@ class DocView {
24285
24285
  }
24286
24286
  };
24287
24287
  scan(this.tile, 0, null);
24288
- return result2;
24288
+ return result;
24289
24289
  }
24290
24290
  textDirectionAt(pos) {
24291
24291
  let { tile } = this.tile.resolveBlock(pos, 1);
@@ -25305,16 +25305,16 @@ function findDiff(a, b, preferredPos, preferredSide) {
25305
25305
  return { from, toA, toB };
25306
25306
  }
25307
25307
  function selectionPoints(view) {
25308
- let result2 = [];
25308
+ let result = [];
25309
25309
  if (view.root.activeElement != view.contentDOM)
25310
- return result2;
25310
+ return result;
25311
25311
  let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange;
25312
25312
  if (anchorNode) {
25313
- result2.push(new DOMPoint(anchorNode, anchorOffset));
25313
+ result.push(new DOMPoint(anchorNode, anchorOffset));
25314
25314
  if (focusNode != anchorNode || focusOffset != anchorOffset)
25315
- result2.push(new DOMPoint(focusNode, focusOffset));
25315
+ result.push(new DOMPoint(focusNode, focusOffset));
25316
25316
  }
25317
- return result2;
25317
+ return result;
25318
25318
  }
25319
25319
  function selectionFromPoints(points, base2) {
25320
25320
  if (points.length == 0)
@@ -25477,9 +25477,9 @@ function bindHandler(plugin, handler) {
25477
25477
  };
25478
25478
  }
25479
25479
  function computeHandlers(plugins) {
25480
- let result2 = /* @__PURE__ */ Object.create(null);
25480
+ let result = /* @__PURE__ */ Object.create(null);
25481
25481
  function record2(type2) {
25482
- return result2[type2] || (result2[type2] = { observers: [], handlers: [] });
25482
+ return result[type2] || (result[type2] = { observers: [], handlers: [] });
25483
25483
  }
25484
25484
  for (let plugin of plugins) {
25485
25485
  let spec = plugin.spec, handlers2 = spec && spec.plugin.domEventHandlers, observers2 = spec && spec.plugin.domEventObservers;
@@ -25500,7 +25500,7 @@ function computeHandlers(plugins) {
25500
25500
  record2(type2).handlers.push(handlers[type2]);
25501
25501
  for (let type2 in observers)
25502
25502
  record2(type2).observers.push(observers[type2]);
25503
- return result2;
25503
+ return result;
25504
25504
  }
25505
25505
  const PendingKeys = [
25506
25506
  { key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" },
@@ -26243,11 +26243,11 @@ class HeightMap {
26243
26243
  return HeightMap.of(nodes);
26244
26244
  }
26245
26245
  // Again, these are base cases, and are overridden for branch and gap nodes.
26246
- decomposeLeft(_to, result2) {
26247
- result2.push(this);
26246
+ decomposeLeft(_to, result) {
26247
+ result.push(this);
26248
26248
  }
26249
- decomposeRight(_from, result2) {
26250
- result2.push(this);
26249
+ decomposeRight(_from, result) {
26250
+ result.push(this);
26251
26251
  }
26252
26252
  applyChanges(decorations2, oldDoc, oracle, changes) {
26253
26253
  let me = this, doc2 = oracle.doc;
@@ -26490,11 +26490,11 @@ class HeightMapGap extends HeightMap {
26490
26490
  }
26491
26491
  return HeightMap.of(nodes);
26492
26492
  }
26493
- decomposeLeft(to, result2) {
26494
- result2.push(new HeightMapGap(to - 1), null);
26493
+ decomposeLeft(to, result) {
26494
+ result.push(new HeightMapGap(to - 1), null);
26495
26495
  }
26496
- decomposeRight(from, result2) {
26497
- result2.push(null, new HeightMapGap(this.length - from - 1));
26496
+ decomposeRight(from, result) {
26497
+ result.push(null, new HeightMapGap(this.length - from - 1));
26498
26498
  }
26499
26499
  updateHeight(oracle, offset = 0, force = false, measured) {
26500
26500
  let end = offset + this.length;
@@ -26522,10 +26522,10 @@ class HeightMapGap extends HeightMap {
26522
26522
  }
26523
26523
  if (pos <= end)
26524
26524
  nodes.push(null, new HeightMapGap(end - pos).updateHeight(oracle, pos));
26525
- let result2 = HeightMap.of(nodes);
26526
- if (singleHeight < 0 || Math.abs(result2.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon)
26525
+ let result = HeightMap.of(nodes);
26526
+ if (singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon)
26527
26527
  heightChangeFlag = true;
26528
- return replace(this, result2);
26528
+ return replace(this, result);
26529
26529
  } else if (force || this.outdated) {
26530
26530
  this.setHeight(oracle.heightForGap(offset, offset + this.length));
26531
26531
  this.outdated = false;
@@ -26585,43 +26585,43 @@ class HeightMapBranch extends HeightMap {
26585
26585
  return this.balanced(this.left.replace(from, to, nodes), this.right);
26586
26586
  if (from > this.left.length)
26587
26587
  return this.balanced(this.left, this.right.replace(from - rightStart, to - rightStart, nodes));
26588
- let result2 = [];
26588
+ let result = [];
26589
26589
  if (from > 0)
26590
- this.decomposeLeft(from, result2);
26591
- let left = result2.length;
26590
+ this.decomposeLeft(from, result);
26591
+ let left = result.length;
26592
26592
  for (let node of nodes)
26593
- result2.push(node);
26593
+ result.push(node);
26594
26594
  if (from > 0)
26595
- mergeGaps(result2, left - 1);
26595
+ mergeGaps(result, left - 1);
26596
26596
  if (to < this.length) {
26597
- let right = result2.length;
26598
- this.decomposeRight(to, result2);
26599
- mergeGaps(result2, right);
26597
+ let right = result.length;
26598
+ this.decomposeRight(to, result);
26599
+ mergeGaps(result, right);
26600
26600
  }
26601
- return HeightMap.of(result2);
26601
+ return HeightMap.of(result);
26602
26602
  }
26603
- decomposeLeft(to, result2) {
26603
+ decomposeLeft(to, result) {
26604
26604
  let left = this.left.length;
26605
26605
  if (to <= left)
26606
- return this.left.decomposeLeft(to, result2);
26607
- result2.push(this.left);
26606
+ return this.left.decomposeLeft(to, result);
26607
+ result.push(this.left);
26608
26608
  if (this.break) {
26609
26609
  left++;
26610
26610
  if (to >= left)
26611
- result2.push(null);
26611
+ result.push(null);
26612
26612
  }
26613
26613
  if (to > left)
26614
- this.right.decomposeLeft(to - left, result2);
26614
+ this.right.decomposeLeft(to - left, result);
26615
26615
  }
26616
- decomposeRight(from, result2) {
26616
+ decomposeRight(from, result) {
26617
26617
  let left = this.left.length, right = left + this.break;
26618
26618
  if (from >= right)
26619
- return this.right.decomposeRight(from - right, result2);
26619
+ return this.right.decomposeRight(from - right, result);
26620
26620
  if (from < left)
26621
- this.left.decomposeRight(from, result2);
26621
+ this.left.decomposeRight(from, result);
26622
26622
  if (this.break && from < right)
26623
- result2.push(null);
26624
- result2.push(this.right);
26623
+ result.push(null);
26624
+ result.push(this.right);
26625
26625
  }
26626
26626
  balanced(left, right) {
26627
26627
  if (left.size > 2 * right.size || right.size > 2 * left.size)
@@ -26994,13 +26994,13 @@ class ViewState {
26994
26994
  let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;
26995
26995
  this.contentDOMHeight = domRect.height;
26996
26996
  this.mustMeasureContent = false;
26997
- let result2 = 0, bias = 0;
26997
+ let result = 0, bias = 0;
26998
26998
  if (domRect.width && domRect.height) {
26999
26999
  let { scaleX, scaleY } = getScale(dom, domRect);
27000
27000
  if (scaleX > 5e-3 && Math.abs(this.scaleX - scaleX) > 5e-3 || scaleY > 5e-3 && Math.abs(this.scaleY - scaleY) > 5e-3) {
27001
27001
  this.scaleX = scaleX;
27002
27002
  this.scaleY = scaleY;
27003
- result2 |= 16;
27003
+ result |= 16;
27004
27004
  refresh = measureContent = true;
27005
27005
  }
27006
27006
  }
@@ -27009,13 +27009,13 @@ class ViewState {
27009
27009
  if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) {
27010
27010
  this.paddingTop = paddingTop;
27011
27011
  this.paddingBottom = paddingBottom;
27012
- result2 |= 16 | 2;
27012
+ result |= 16 | 2;
27013
27013
  }
27014
27014
  if (this.editorWidth != view.scrollDOM.clientWidth) {
27015
27015
  if (oracle.lineWrapping)
27016
27016
  measureContent = true;
27017
27017
  this.editorWidth = view.scrollDOM.clientWidth;
27018
- result2 |= 16;
27018
+ result |= 16;
27019
27019
  }
27020
27020
  let scrollParent = scrollableParents(this.view.contentDOM, false).y;
27021
27021
  if (scrollParent != this.scrollParent) {
@@ -27044,7 +27044,7 @@ class ViewState {
27044
27044
  if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
27045
27045
  this.contentDOMWidth = domRect.width;
27046
27046
  this.editorHeight = view.scrollDOM.clientHeight;
27047
- result2 |= 16;
27047
+ result |= 16;
27048
27048
  }
27049
27049
  if (measureContent) {
27050
27050
  let lineHeights = view.docView.measureVisibleLineHeights(this.viewport);
@@ -27055,7 +27055,7 @@ class ViewState {
27055
27055
  refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, Math.max(5, contentWidth / charWidth), lineHeights);
27056
27056
  if (refresh) {
27057
27057
  view.docView.minWidth = 0;
27058
- result2 |= 16;
27058
+ result |= 16;
27059
27059
  }
27060
27060
  }
27061
27061
  if (dTop > 0 && dBottom > 0)
@@ -27068,25 +27068,25 @@ class ViewState {
27068
27068
  this.heightMap = (refresh ? HeightMap.empty().applyChanges(this.stateDeco, Text.empty, this.heightOracle, [new ChangedRange(0, 0, 0, view.state.doc.length)]) : this.heightMap).updateHeight(oracle, 0, refresh, new MeasuredHeights(vp.from, heights));
27069
27069
  }
27070
27070
  if (heightChangeFlag)
27071
- result2 |= 2;
27071
+ result |= 2;
27072
27072
  }
27073
27073
  let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to);
27074
27074
  if (viewportChange) {
27075
- if (result2 & 2)
27076
- result2 |= this.updateScaler();
27075
+ if (result & 2)
27076
+ result |= this.updateScaler();
27077
27077
  this.viewport = this.getViewport(bias, this.scrollTarget);
27078
- result2 |= this.updateForViewport();
27078
+ result |= this.updateForViewport();
27079
27079
  }
27080
- if (result2 & 2 || viewportChange)
27080
+ if (result & 2 || viewportChange)
27081
27081
  this.updateViewportLines();
27082
27082
  if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
27083
27083
  this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps, view));
27084
- result2 |= this.computeVisibleRanges();
27084
+ result |= this.computeVisibleRanges();
27085
27085
  if (this.mustEnforceCursorAssoc) {
27086
27086
  this.mustEnforceCursorAssoc = false;
27087
27087
  view.docView.enforceCursorAssoc();
27088
27088
  }
27089
- return result2;
27089
+ return result;
27090
27090
  }
27091
27091
  get visibleTop() {
27092
27092
  return this.scaler.fromDOM(this.pixelViewport.top);
@@ -29283,10 +29283,10 @@ class EditorView {
29283
29283
  */
29284
29284
  static theme(spec, options) {
29285
29285
  let prefix = StyleModule.newName();
29286
- let result2 = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];
29286
+ let result = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];
29287
29287
  if (options && options.dark)
29288
- result2.push(darkTheme.of(true));
29289
- return result2;
29288
+ result.push(darkTheme.of(true));
29289
+ return result;
29290
29290
  }
29291
29291
  /**
29292
29292
  Create an extension that adds styles to the base theme. Like
@@ -29360,13 +29360,13 @@ class CachedOrder {
29360
29360
  static update(cache2, changes) {
29361
29361
  if (changes.empty && !cache2.some((c) => c.fresh))
29362
29362
  return cache2;
29363
- let result2 = [], lastDir = cache2.length ? cache2[cache2.length - 1].dir : Direction.LTR;
29363
+ let result = [], lastDir = cache2.length ? cache2[cache2.length - 1].dir : Direction.LTR;
29364
29364
  for (let i = Math.max(0, cache2.length - 10); i < cache2.length; i++) {
29365
29365
  let entry = cache2[i];
29366
29366
  if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to))
29367
- result2.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));
29367
+ result.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));
29368
29368
  }
29369
- return result2;
29369
+ return result;
29370
29370
  }
29371
29371
  }
29372
29372
  function attrsFromFacet(view, facet, base2) {
@@ -29380,9 +29380,9 @@ function attrsFromFacet(view, facet, base2) {
29380
29380
  const currentPlatform = browser.mac ? "mac" : browser.windows ? "win" : browser.linux ? "linux" : "key";
29381
29381
  function normalizeKeyName(name2, platform) {
29382
29382
  const parts = name2.split(/-(?!$)/);
29383
- let result2 = parts[parts.length - 1];
29384
- if (result2 == "Space")
29385
- result2 = " ";
29383
+ let result = parts[parts.length - 1];
29384
+ if (result == "Space")
29385
+ result = " ";
29386
29386
  let alt, ctrl, shift2, meta2;
29387
29387
  for (let i = 0; i < parts.length - 1; ++i) {
29388
29388
  const mod = parts[i];
@@ -29403,14 +29403,14 @@ function normalizeKeyName(name2, platform) {
29403
29403
  throw new Error("Unrecognized modifier name: " + mod);
29404
29404
  }
29405
29405
  if (alt)
29406
- result2 = "Alt-" + result2;
29406
+ result = "Alt-" + result;
29407
29407
  if (ctrl)
29408
- result2 = "Ctrl-" + result2;
29408
+ result = "Ctrl-" + result;
29409
29409
  if (meta2)
29410
- result2 = "Meta-" + result2;
29410
+ result = "Meta-" + result;
29411
29411
  if (shift2)
29412
- result2 = "Shift-" + result2;
29413
- return result2;
29412
+ result = "Shift-" + result;
29413
+ return result;
29414
29414
  }
29415
29415
  function modifiers(name2, event, shift2) {
29416
29416
  if (event.altKey)
@@ -29997,16 +29997,16 @@ function matchRanges(view, maxLength) {
29997
29997
  let visible = view.visibleRanges;
29998
29998
  if (visible.length == 1 && visible[0].from == view.viewport.from && visible[0].to == view.viewport.to)
29999
29999
  return visible;
30000
- let result2 = [];
30000
+ let result = [];
30001
30001
  for (let { from, to } of visible) {
30002
30002
  from = Math.max(view.state.doc.lineAt(from).from, from - maxLength);
30003
30003
  to = Math.min(view.state.doc.lineAt(to).to, to + maxLength);
30004
- if (result2.length && result2[result2.length - 1].to >= from)
30005
- result2[result2.length - 1].to = to;
30004
+ if (result.length && result[result.length - 1].to >= from)
30005
+ result[result.length - 1].to = to;
30006
30006
  else
30007
- result2.push({ from, to });
30007
+ result.push({ from, to });
30008
30008
  }
30009
- return result2;
30009
+ return result;
30010
30010
  }
30011
30011
  class MatchDecorator {
30012
30012
  /**
@@ -30804,10 +30804,10 @@ class HoverPlugin {
30804
30804
  };
30805
30805
  if (open && "then" in open) {
30806
30806
  let pending = this.pending = { pos };
30807
- open.then((result2) => {
30807
+ open.then((result) => {
30808
30808
  if (this.pending == pending) {
30809
30809
  this.pending = null;
30810
- done(result2);
30810
+ done(result);
30811
30811
  }
30812
30812
  }, (e) => logException(view.state, e, "hover tooltip"));
30813
30813
  } else {
@@ -31151,7 +31151,7 @@ const dialogField = /* @__PURE__ */ StateField.define({
31151
31151
  });
31152
31152
  const openDialogEffect = /* @__PURE__ */ StateEffect.define();
31153
31153
  const closeDialogEffect = /* @__PURE__ */ StateEffect.define();
31154
- function createDialog(view, config2, result2) {
31154
+ function createDialog(view, config2, result) {
31155
31155
  let content2 = config2.content ? config2.content(view, () => done(null)) : null;
31156
31156
  if (!content2) {
31157
31157
  content2 = crelt("form");
@@ -31197,7 +31197,7 @@ function createDialog(view, config2, result2) {
31197
31197
  function done(form) {
31198
31198
  if (panel.contains(panel.ownerDocument.activeElement))
31199
31199
  view.focus();
31200
- result2(form);
31200
+ result(form);
31201
31201
  }
31202
31202
  return {
31203
31203
  dom: panel,
@@ -31249,10 +31249,10 @@ const unfixGutters = /* @__PURE__ */ Facet.define({
31249
31249
  combine: (values) => values.some((x) => x)
31250
31250
  });
31251
31251
  function gutters(config2) {
31252
- let result2 = [
31252
+ let result = [
31253
31253
  gutterView
31254
31254
  ];
31255
- return result2;
31255
+ return result;
31256
31256
  }
31257
31257
  const gutterView = /* @__PURE__ */ ViewPlugin.fromClass(class {
31258
31258
  constructor(view) {
@@ -31586,12 +31586,12 @@ const lineNumberConfig = /* @__PURE__ */ Facet.define({
31586
31586
  combine(values) {
31587
31587
  return combineConfig(values, { formatNumber: String, domEventHandlers: {} }, {
31588
31588
  domEventHandlers(a, b) {
31589
- let result2 = Object.assign({}, a);
31589
+ let result = Object.assign({}, a);
31590
31590
  for (let event in b) {
31591
- let exists = result2[event], add2 = b[event];
31592
- result2[event] = exists ? (view, line, event2) => exists(view, line, event2) || add2(view, line, event2) : add2;
31591
+ let exists = result[event], add2 = b[event];
31592
+ result[event] = exists ? (view, line, event2) => exists(view, line, event2) || add2(view, line, event2) : add2;
31593
31593
  }
31594
- return result2;
31594
+ return result;
31595
31595
  }
31596
31596
  });
31597
31597
  }
@@ -31624,9 +31624,9 @@ const lineNumberGutter = /* @__PURE__ */ activeGutters.compute([lineNumberConfig
31624
31624
  },
31625
31625
  widgetMarker: (view, widget, block) => {
31626
31626
  for (let m of view.state.facet(lineNumberWidgetMarker)) {
31627
- let result2 = m(view, widget, block);
31628
- if (result2)
31629
- return result2;
31627
+ let result = m(view, widget, block);
31628
+ if (result)
31629
+ return result;
31630
31630
  }
31631
31631
  return null;
31632
31632
  },
@@ -31709,8 +31709,8 @@ class NodeProp {
31709
31709
  if (typeof match != "function")
31710
31710
  match = NodeType.match(match);
31711
31711
  return (type2) => {
31712
- let result2 = match(type2);
31713
- return result2 === void 0 ? null : [this, result2];
31712
+ let result = match(type2);
31713
+ return result === void 0 ? null : [this, result];
31714
31714
  };
31715
31715
  }
31716
31716
  }
@@ -32028,11 +32028,11 @@ class Tree {
32028
32028
  constructor.
32029
32029
  */
32030
32030
  get propValues() {
32031
- let result2 = [];
32031
+ let result = [];
32032
32032
  if (this.props)
32033
32033
  for (let id2 in this.props)
32034
- result2.push([+id2, this.props[id2]]);
32035
- return result2;
32034
+ result.push([+id2, this.props[id2]]);
32035
+ return result;
32036
32036
  }
32037
32037
  /**
32038
32038
  Balance the direct children of this tree, producing a copy of
@@ -32097,30 +32097,30 @@ class TreeBuffer {
32097
32097
  @internal
32098
32098
  */
32099
32099
  toString() {
32100
- let result2 = [];
32100
+ let result = [];
32101
32101
  for (let index = 0; index < this.buffer.length; ) {
32102
- result2.push(this.childString(index));
32102
+ result.push(this.childString(index));
32103
32103
  index = this.buffer[index + 3];
32104
32104
  }
32105
- return result2.join(",");
32105
+ return result.join(",");
32106
32106
  }
32107
32107
  /**
32108
32108
  @internal
32109
32109
  */
32110
32110
  childString(index) {
32111
32111
  let id2 = this.buffer[index], endIndex = this.buffer[index + 3];
32112
- let type2 = this.set.types[id2], result2 = type2.name;
32113
- if (/\W/.test(result2) && !type2.isError)
32114
- result2 = JSON.stringify(result2);
32112
+ let type2 = this.set.types[id2], result = type2.name;
32113
+ if (/\W/.test(result) && !type2.isError)
32114
+ result = JSON.stringify(result);
32115
32115
  index += 4;
32116
32116
  if (endIndex == index)
32117
- return result2;
32117
+ return result;
32118
32118
  let children = [];
32119
32119
  while (index < endIndex) {
32120
32120
  children.push(this.childString(index));
32121
32121
  index = this.buffer[index + 3];
32122
32122
  }
32123
- return result2 + "(" + children.join(",") + ")";
32123
+ return result + "(" + children.join(",") + ")";
32124
32124
  }
32125
32125
  /**
32126
32126
  @internal
@@ -32370,22 +32370,22 @@ class TreeNode extends BaseNode {
32370
32370
  }
32371
32371
  }
32372
32372
  function getChildren(node, type2, before, after) {
32373
- let cur2 = node.cursor(), result2 = [];
32373
+ let cur2 = node.cursor(), result = [];
32374
32374
  if (!cur2.firstChild())
32375
- return result2;
32375
+ return result;
32376
32376
  if (before != null)
32377
32377
  for (let found = false; !found; ) {
32378
32378
  found = cur2.type.is(before);
32379
32379
  if (!cur2.nextSibling())
32380
- return result2;
32380
+ return result;
32381
32381
  }
32382
32382
  for (; ; ) {
32383
32383
  if (after != null && cur2.type.is(after))
32384
- return result2;
32384
+ return result;
32385
32385
  if (cur2.type.is(type2))
32386
- result2.push(cur2.node);
32386
+ result.push(cur2.node);
32387
32387
  if (!cur2.nextSibling())
32388
- return after == null ? result2 : [];
32388
+ return after == null ? result : [];
32389
32389
  }
32390
32390
  }
32391
32391
  function matchNodeContext(node, context, i = context.length - 1) {
@@ -32832,14 +32832,14 @@ class TreeCursor {
32832
32832
  get node() {
32833
32833
  if (!this.buffer)
32834
32834
  return this._tree;
32835
- let cache2 = this.bufferNode, result2 = null, depth = 0;
32835
+ let cache2 = this.bufferNode, result = null, depth = 0;
32836
32836
  if (cache2 && cache2.context == this.buffer) {
32837
32837
  scan: for (let index = this.index, d = this.stack.length; d >= 0; ) {
32838
32838
  for (let c = cache2; c; c = c._parent)
32839
32839
  if (c.index == index) {
32840
32840
  if (index == this.index)
32841
32841
  return c;
32842
- result2 = c;
32842
+ result = c;
32843
32843
  depth = d + 1;
32844
32844
  break scan;
32845
32845
  }
@@ -32847,8 +32847,8 @@ class TreeCursor {
32847
32847
  }
32848
32848
  }
32849
32849
  for (let i = depth; i < this.stack.length; i++)
32850
- result2 = new BufferNode(this.buffer, result2, this.stack[i]);
32851
- return this.bufferNode = new BufferNode(this.buffer, result2, this.index);
32850
+ result = new BufferNode(this.buffer, result, this.stack[i]);
32851
+ return this.bufferNode = new BufferNode(this.buffer, result, this.index);
32852
32852
  }
32853
32853
  /**
32854
32854
  Get the [tree](#common.Tree) that represents the current node, if
@@ -33048,13 +33048,13 @@ function buildTree(data) {
33048
33048
  function findBufferSize(maxSize, inRepeat) {
33049
33049
  let fork = cursor.fork();
33050
33050
  let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength;
33051
- let result2 = { size: 0, start: 0, skip: 0 };
33051
+ let result = { size: 0, start: 0, skip: 0 };
33052
33052
  scan: for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) {
33053
33053
  let nodeSize2 = fork.size;
33054
33054
  if (fork.id == inRepeat && nodeSize2 >= 0) {
33055
- result2.size = size;
33056
- result2.start = start;
33057
- result2.skip = skip;
33055
+ result.size = size;
33056
+ result.start = start;
33057
+ result.skip = skip;
33058
33058
  skip += 4;
33059
33059
  size += 4;
33060
33060
  fork.next();
@@ -33082,11 +33082,11 @@ function buildTree(data) {
33082
33082
  skip += localSkipped;
33083
33083
  }
33084
33084
  if (inRepeat < 0 || size == maxSize) {
33085
- result2.size = size;
33086
- result2.start = start;
33087
- result2.skip = skip;
33085
+ result.size = size;
33086
+ result.start = start;
33087
+ result.skip = skip;
33088
33088
  }
33089
- return result2.size > 4 ? result2 : void 0;
33089
+ return result.size > 4 ? result : void 0;
33090
33090
  }
33091
33091
  function copyToBuffer(bufferStart, buffer2, index) {
33092
33092
  let { id: id2, start, end, size } = cursor;
@@ -33254,11 +33254,11 @@ class TreeFragment {
33254
33254
  true.
33255
33255
  */
33256
33256
  static addTree(tree, fragments = [], partial2 = false) {
33257
- let result2 = [new TreeFragment(0, tree.length, tree, 0, false, partial2)];
33257
+ let result = [new TreeFragment(0, tree.length, tree, 0, false, partial2)];
33258
33258
  for (let f of fragments)
33259
33259
  if (f.to > tree.length)
33260
- result2.push(f);
33261
- return result2;
33260
+ result.push(f);
33261
+ return result;
33262
33262
  }
33263
33263
  /**
33264
33264
  Apply a set of edits to an array of fragments, removing or
@@ -33268,7 +33268,7 @@ class TreeFragment {
33268
33268
  static applyChanges(fragments, changes, minGap = 128) {
33269
33269
  if (!changes.length)
33270
33270
  return fragments;
33271
- let result2 = [];
33271
+ let result = [];
33272
33272
  let fI = 1, nextF = fragments.length ? fragments[0] : null;
33273
33273
  for (let cI = 0, pos = 0, off = 0; ; cI++) {
33274
33274
  let nextC = cI < changes.length ? changes[cI] : null;
@@ -33281,7 +33281,7 @@ class TreeFragment {
33281
33281
  cut = fFrom >= fTo ? null : new TreeFragment(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC);
33282
33282
  }
33283
33283
  if (cut)
33284
- result2.push(cut);
33284
+ result.push(cut);
33285
33285
  if (nextF.to > nextPos)
33286
33286
  break;
33287
33287
  nextF = fI < fragments.length ? fragments[fI++] : null;
@@ -33291,7 +33291,7 @@ class TreeFragment {
33291
33291
  pos = nextC.toA;
33292
33292
  off = nextC.toA - nextC.toB;
33293
33293
  }
33294
- return result2;
33294
+ return result;
33295
33295
  }
33296
33296
  }
33297
33297
  class Parser {
@@ -33546,13 +33546,13 @@ function tagHighlighter(tags2, options) {
33546
33546
  };
33547
33547
  }
33548
33548
  function highlightTags(highlighters, tags2) {
33549
- let result2 = null;
33549
+ let result = null;
33550
33550
  for (let highlighter of highlighters) {
33551
33551
  let value = highlighter.style(tags2);
33552
33552
  if (value)
33553
- result2 = result2 ? result2 + " " + value : value;
33553
+ result = result ? result + " " + value : value;
33554
33554
  }
33555
- return result2;
33555
+ return result;
33556
33556
  }
33557
33557
  function highlightTree(tree, highlighter, putStyle, from = 0, to = tree.length) {
33558
33558
  let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);
@@ -34110,10 +34110,10 @@ class Language {
34110
34110
  return [{ from: 0, to: state.doc.length }];
34111
34111
  if (!lang || !lang.allowsNesting)
34112
34112
  return [];
34113
- let result2 = [];
34113
+ let result = [];
34114
34114
  let explore = (tree, from) => {
34115
34115
  if (tree.prop(languageDataProp) == this.data) {
34116
- result2.push({ from, to: from + tree.length });
34116
+ result.push({ from, to: from + tree.length });
34117
34117
  return;
34118
34118
  }
34119
34119
  let mount = tree.prop(NodeProp.mounted);
@@ -34121,14 +34121,14 @@ class Language {
34121
34121
  if (mount.tree.prop(languageDataProp) == this.data) {
34122
34122
  if (mount.overlay)
34123
34123
  for (let r of mount.overlay)
34124
- result2.push({ from: r.from + from, to: r.to + from });
34124
+ result.push({ from: r.from + from, to: r.to + from });
34125
34125
  else
34126
- result2.push({ from, to: from + tree.length });
34126
+ result.push({ from, to: from + tree.length });
34127
34127
  return;
34128
34128
  } else if (mount.overlay) {
34129
- let size = result2.length;
34129
+ let size = result.length;
34130
34130
  explore(mount.tree, mount.overlay[0].from + from);
34131
- if (result2.length > size)
34131
+ if (result.length > size)
34132
34132
  return;
34133
34133
  }
34134
34134
  }
@@ -34139,7 +34139,7 @@ class Language {
34139
34139
  }
34140
34140
  };
34141
34141
  explore(syntaxTree(state), 0);
34142
- return result2;
34142
+ return result;
34143
34143
  }
34144
34144
  /**
34145
34145
  Indicates whether this language allows nested languages. The
@@ -34598,25 +34598,25 @@ function getIndentUnit(state) {
34598
34598
  return unit.charCodeAt(0) == 9 ? state.tabSize * unit.length : unit.length;
34599
34599
  }
34600
34600
  function indentString(state, cols) {
34601
- let result2 = "", ts = state.tabSize, ch = state.facet(indentUnit)[0];
34601
+ let result = "", ts = state.tabSize, ch = state.facet(indentUnit)[0];
34602
34602
  if (ch == " ") {
34603
34603
  while (cols >= ts) {
34604
- result2 += " ";
34604
+ result += " ";
34605
34605
  cols -= ts;
34606
34606
  }
34607
34607
  ch = " ";
34608
34608
  }
34609
34609
  for (let i = 0; i < cols; i++)
34610
- result2 += ch;
34611
- return result2;
34610
+ result += ch;
34611
+ return result;
34612
34612
  }
34613
34613
  function getIndentation(context, pos) {
34614
34614
  if (context instanceof EditorState)
34615
34615
  context = new IndentContext(context);
34616
34616
  for (let service of context.state.facet(indentService)) {
34617
- let result2 = service(context, pos);
34618
- if (result2 !== void 0)
34619
- return result2;
34617
+ let result = service(context, pos);
34618
+ if (result !== void 0)
34619
+ return result;
34620
34620
  }
34621
34621
  let tree = syntaxTree(context.state);
34622
34622
  return tree.length >= pos ? syntaxIndentation(context, tree, pos) : null;
@@ -34666,11 +34666,11 @@ class IndentContext {
34666
34666
  */
34667
34667
  column(pos, bias = 1) {
34668
34668
  let { text, from } = this.lineAt(pos, bias);
34669
- let result2 = this.countColumn(text, pos - from);
34669
+ let result = this.countColumn(text, pos - from);
34670
34670
  let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;
34671
34671
  if (override > -1)
34672
- result2 += override - this.countColumn(text, text.search(/\S|$/));
34673
- return result2;
34672
+ result += override - this.countColumn(text, text.search(/\S|$/));
34673
+ return result;
34674
34674
  }
34675
34675
  /**
34676
34676
  Find the column position (taking tabs into account) of the given
@@ -35548,9 +35548,9 @@ class HistEvent {
35548
35548
  static fromTransaction(tr, selection) {
35549
35549
  let effects = none$1;
35550
35550
  for (let invert of tr.startState.facet(invertedEffects)) {
35551
- let result2 = invert(tr);
35552
- if (result2.length)
35553
- effects = effects.concat(result2);
35551
+ let result = invert(tr);
35552
+ if (result.length)
35553
+ effects = effects.concat(result);
35554
35554
  }
35555
35555
  if (!effects.length && tr.changes.empty)
35556
35556
  return null;
@@ -35611,9 +35611,9 @@ function addMappingToBranch(branch, mapping) {
35611
35611
  while (length) {
35612
35612
  let event = mapEvent(branch[length - 1], mapping, selections);
35613
35613
  if (event.changes && !event.changes.empty || event.effects.length) {
35614
- let result2 = branch.slice(0, length);
35615
- result2[length - 1] = event;
35616
- return result2;
35614
+ let result = branch.slice(0, length);
35615
+ result[length - 1] = event;
35616
+ return result;
35617
35617
  } else {
35618
35618
  mapping = event.mapped;
35619
35619
  length--;
@@ -36629,13 +36629,13 @@ function toCharEnd(text, pos) {
36629
36629
  const gotoLine = (view) => {
36630
36630
  let { state } = view;
36631
36631
  let line = String(state.doc.lineAt(view.state.selection.main.head).number);
36632
- let { close, result: result2 } = showDialog(view, {
36632
+ let { close, result } = showDialog(view, {
36633
36633
  label: state.phrase("Go to line"),
36634
36634
  input: { type: "text", name: "line", value: line },
36635
36635
  focus: true,
36636
36636
  submitLabel: state.phrase("go")
36637
36637
  });
36638
- result2.then((form) => {
36638
+ result.then((form) => {
36639
36639
  let match = form && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(form.elements["line"].value);
36640
36640
  if (!match) {
36641
36641
  view.dispatch({ effects: close });
@@ -36982,16 +36982,16 @@ class RegExpQuery extends QueryType {
36982
36982
  prevMatch(state, curFrom, curTo) {
36983
36983
  return this.prevMatchInRange(state, 0, curFrom) || this.prevMatchInRange(state, curTo, state.doc.length);
36984
36984
  }
36985
- getReplacement(result2) {
36985
+ getReplacement(result) {
36986
36986
  return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (m, i) => {
36987
36987
  if (i == "&")
36988
- return result2.match[0];
36988
+ return result.match[0];
36989
36989
  if (i == "$")
36990
36990
  return "$";
36991
36991
  for (let l = i.length; l > 0; l--) {
36992
36992
  let n = +i.slice(0, l);
36993
- if (n > 0 && n < result2.match.length)
36994
- return result2.match[n] + i.slice(l);
36993
+ if (n > 0 && n < result.match.length)
36994
+ return result.match[n] + i.slice(l);
36995
36995
  }
36996
36996
  return m;
36997
36997
  });
@@ -37712,8 +37712,8 @@ class Stack {
37712
37712
  }
37713
37713
  nextStates = best;
37714
37714
  }
37715
- let result2 = [];
37716
- for (let i = 0; i < nextStates.length && result2.length < 4; i += 2) {
37715
+ let result = [];
37716
+ for (let i = 0; i < nextStates.length && result.length < 4; i += 2) {
37717
37717
  let s = nextStates[i + 1];
37718
37718
  if (s == this.state)
37719
37719
  continue;
@@ -37723,9 +37723,9 @@ class Stack {
37723
37723
  stack.shiftContext(nextStates[i], this.pos);
37724
37724
  stack.reducePos = this.pos;
37725
37725
  stack.score -= 200;
37726
- result2.push(stack);
37726
+ result.push(stack);
37727
37727
  }
37728
- return result2;
37728
+ return result;
37729
37729
  }
37730
37730
  // Force a reduce, if possible. Return false if that can't
37731
37731
  // be done.
@@ -38086,17 +38086,17 @@ class InputStream {
38086
38086
  units, since the library does not track lookbehind.
38087
38087
  */
38088
38088
  peek(offset) {
38089
- let idx = this.chunkOff + offset, pos, result2;
38089
+ let idx = this.chunkOff + offset, pos, result;
38090
38090
  if (idx >= 0 && idx < this.chunk.length) {
38091
38091
  pos = this.pos + offset;
38092
- result2 = this.chunk.charCodeAt(idx);
38092
+ result = this.chunk.charCodeAt(idx);
38093
38093
  } else {
38094
38094
  let resolved = this.resolveOffset(offset, 1);
38095
38095
  if (resolved == null)
38096
38096
  return -1;
38097
38097
  pos = resolved;
38098
38098
  if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {
38099
- result2 = this.chunk2.charCodeAt(pos - this.chunk2Pos);
38099
+ result = this.chunk2.charCodeAt(pos - this.chunk2Pos);
38100
38100
  } else {
38101
38101
  let i = this.rangeIndex, range = this.range;
38102
38102
  while (range.to <= pos)
@@ -38104,12 +38104,12 @@ class InputStream {
38104
38104
  this.chunk2 = this.input.chunk(this.chunk2Pos = pos);
38105
38105
  if (pos + this.chunk2.length > range.to)
38106
38106
  this.chunk2 = this.chunk2.slice(0, range.to - pos);
38107
- result2 = this.chunk2.charCodeAt(0);
38107
+ result = this.chunk2.charCodeAt(0);
38108
38108
  }
38109
38109
  }
38110
38110
  if (pos >= this.token.lookAhead)
38111
38111
  this.token.lookAhead = pos + 1;
38112
- return result2;
38112
+ return result;
38113
38113
  }
38114
38114
  /**
38115
38115
  Accept a token. By default, the end of the token is set to the
@@ -38222,14 +38222,14 @@ class InputStream {
38222
38222
  return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);
38223
38223
  if (from >= this.range.from && to <= this.range.to)
38224
38224
  return this.input.read(from, to);
38225
- let result2 = "";
38225
+ let result = "";
38226
38226
  for (let r of this.ranges) {
38227
38227
  if (r.from >= to)
38228
38228
  break;
38229
38229
  if (r.to > from)
38230
- result2 += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
38230
+ result += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
38231
38231
  }
38232
- return result2;
38232
+ return result;
38233
38233
  }
38234
38234
  }
38235
38235
  class TokenGroup {
@@ -38512,12 +38512,12 @@ class TokenCache {
38512
38512
  let { parser: parser2 } = stack.p;
38513
38513
  for (let i = 0; i < parser2.specialized.length; i++)
38514
38514
  if (parser2.specialized[i] == token.value) {
38515
- let result2 = parser2.specializers[i](this.stream.read(token.start, token.end), stack);
38516
- if (result2 >= 0 && stack.p.parser.dialect.allows(result2 >> 1)) {
38517
- if ((result2 & 1) == 0)
38518
- token.value = result2 >> 1;
38515
+ let result = parser2.specializers[i](this.stream.read(token.start, token.end), stack);
38516
+ if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {
38517
+ if ((result & 1) == 0)
38518
+ token.value = result >> 1;
38519
38519
  else
38520
- token.extended = result2 >> 1;
38520
+ token.extended = result >> 1;
38521
38521
  break;
38522
38522
  }
38523
38523
  }
@@ -39019,28 +39019,28 @@ class LRParser extends Parser {
39019
39019
  4
39020
39020
  /* ParseState.DefaultReduce */
39021
39021
  );
39022
- let result2 = deflt ? action(deflt) : void 0;
39022
+ let result = deflt ? action(deflt) : void 0;
39023
39023
  for (let i = this.stateSlot(
39024
39024
  state,
39025
39025
  1
39026
39026
  /* ParseState.Actions */
39027
- ); result2 == null; i += 3) {
39027
+ ); result == null; i += 3) {
39028
39028
  if (this.data[i] == 65535) {
39029
39029
  if (this.data[i + 1] == 1)
39030
39030
  i = pair(this.data, i + 2);
39031
39031
  else
39032
39032
  break;
39033
39033
  }
39034
- result2 = action(pair(this.data, i + 1));
39034
+ result = action(pair(this.data, i + 1));
39035
39035
  }
39036
- return result2;
39036
+ return result;
39037
39037
  }
39038
39038
  /**
39039
39039
  Get the states that can follow this one through shift actions or
39040
39040
  goto jumps. @internal
39041
39041
  */
39042
39042
  nextStates(state) {
39043
- let result2 = [];
39043
+ let result = [];
39044
39044
  for (let i = this.stateSlot(
39045
39045
  state,
39046
39046
  1
@@ -39054,11 +39054,11 @@ class LRParser extends Parser {
39054
39054
  }
39055
39055
  if ((this.data[i + 2] & 65536 >> 16) == 0) {
39056
39056
  let value = this.data[i + 1];
39057
- if (!result2.some((v, i2) => i2 & 1 && v == value))
39058
- result2.push(this.data[i], value);
39057
+ if (!result.some((v, i2) => i2 & 1 && v == value))
39058
+ result.push(this.data[i], value);
39059
39059
  }
39060
39060
  }
39061
- return result2;
39061
+ return result;
39062
39062
  }
39063
39063
  /**
39064
39064
  Configure the parser. Returns a new parser instance that has the
@@ -39633,17 +39633,17 @@ class FuzzyMatcher {
39633
39633
  return chars.length == 2 ? null : this.result((any[0] ? -700 : 0) + -200 + -1100, any, word);
39634
39634
  }
39635
39635
  result(score2, positions, word) {
39636
- let result2 = [], i = 0;
39636
+ let result = [], i = 0;
39637
39637
  for (let pos of positions) {
39638
39638
  let to = pos + (this.astral ? codePointSize(codePointAt(word, pos)) : 1);
39639
- if (i && result2[i - 1] == pos)
39640
- result2[i - 1] = to;
39639
+ if (i && result[i - 1] == pos)
39640
+ result[i - 1] = to;
39641
39641
  else {
39642
- result2[i++] = pos;
39643
- result2[i++] = to;
39642
+ result[i++] = pos;
39643
+ result[i++] = to;
39644
39644
  }
39645
39645
  }
39646
- return this.ret(score2 - word.length, result2);
39646
+ return this.ret(score2 - word.length, result);
39647
39647
  }
39648
39648
  }
39649
39649
  class StrictMatcher {
@@ -40101,17 +40101,17 @@ function sortOptions(active, state) {
40101
40101
  option.score += sectionOrder[typeof section == "string" ? section : section.name];
40102
40102
  }
40103
40103
  }
40104
- let result2 = [], prev = null;
40104
+ let result = [], prev = null;
40105
40105
  let compare2 = conf.compareCompletions;
40106
40106
  for (let opt of options.sort((a, b) => b.score - a.score || compare2(a.completion, b.completion))) {
40107
40107
  let cur2 = opt.completion;
40108
40108
  if (!prev || prev.label != cur2.label || prev.detail != cur2.detail || prev.type != null && cur2.type != null && prev.type != cur2.type || prev.apply != cur2.apply || prev.boost != cur2.boost)
40109
- result2.push(opt);
40109
+ result.push(opt);
40110
40110
  else if (score(opt.completion) > score(prev))
40111
- result2[result2.length - 1] = opt;
40111
+ result[result.length - 1] = opt;
40112
40112
  prev = opt.completion;
40113
40113
  }
40114
- return result2;
40114
+ return result;
40115
40115
  }
40116
40116
  class CompletionDialog {
40117
40117
  constructor(options, attrs, tooltip, timestamp, selected, disabled) {
@@ -40223,14 +40223,14 @@ const baseAttrs = {
40223
40223
  };
40224
40224
  const noAttrs = {};
40225
40225
  function makeAttrs(id2, selected) {
40226
- let result2 = {
40226
+ let result = {
40227
40227
  "aria-autocomplete": "list",
40228
40228
  "aria-haspopup": "listbox",
40229
40229
  "aria-controls": id2
40230
40230
  };
40231
40231
  if (selected > -1)
40232
- result2["aria-activedescendant"] = id2 + "-" + selected;
40233
- return result2;
40232
+ result["aria-activedescendant"] = id2 + "-" + selected;
40233
+ return result;
40234
40234
  }
40235
40235
  const none = [];
40236
40236
  function getUpdateType(tr, conf) {
@@ -40297,10 +40297,10 @@ class ActiveSource {
40297
40297
  }
40298
40298
  }
40299
40299
  class ActiveResult extends ActiveSource {
40300
- constructor(source, explicit, limit2, result2, from, to) {
40300
+ constructor(source, explicit, limit2, result, from, to) {
40301
40301
  super(source, 3, explicit);
40302
40302
  this.limit = limit2;
40303
- this.result = result2;
40303
+ this.result = result;
40304
40304
  this.from = from;
40305
40305
  this.to = to;
40306
40306
  }
@@ -40311,29 +40311,29 @@ class ActiveResult extends ActiveSource {
40311
40311
  var _a2;
40312
40312
  if (!(type2 & 3))
40313
40313
  return this.map(tr.changes);
40314
- let result2 = this.result;
40315
- if (result2.map && !tr.changes.empty)
40316
- result2 = result2.map(result2, tr.changes);
40314
+ let result = this.result;
40315
+ if (result.map && !tr.changes.empty)
40316
+ result = result.map(result, tr.changes);
40317
40317
  let from = tr.changes.mapPos(this.from), to = tr.changes.mapPos(this.to, 1);
40318
40318
  let pos = cur(tr.state);
40319
- if (pos > to || !result2 || type2 & 2 && (cur(tr.startState) == this.from || pos < this.limit))
40319
+ if (pos > to || !result || type2 & 2 && (cur(tr.startState) == this.from || pos < this.limit))
40320
40320
  return new ActiveSource(
40321
40321
  this.source,
40322
40322
  type2 & 4 ? 1 : 0
40323
40323
  /* State.Inactive */
40324
40324
  );
40325
40325
  let limit2 = tr.changes.mapPos(this.limit);
40326
- if (checkValid(result2.validFor, tr.state, from, to))
40327
- return new ActiveResult(this.source, this.explicit, limit2, result2, from, to);
40328
- if (result2.update && (result2 = result2.update(result2, from, to, new CompletionContext(tr.state, pos, false))))
40329
- return new ActiveResult(this.source, this.explicit, limit2, result2, result2.from, (_a2 = result2.to) !== null && _a2 !== void 0 ? _a2 : cur(tr.state));
40326
+ if (checkValid(result.validFor, tr.state, from, to))
40327
+ return new ActiveResult(this.source, this.explicit, limit2, result, from, to);
40328
+ if (result.update && (result = result.update(result, from, to, new CompletionContext(tr.state, pos, false))))
40329
+ return new ActiveResult(this.source, this.explicit, limit2, result, result.from, (_a2 = result.to) !== null && _a2 !== void 0 ? _a2 : cur(tr.state));
40330
40330
  return new ActiveSource(this.source, 1, this.explicit);
40331
40331
  }
40332
40332
  map(mapping) {
40333
40333
  if (mapping.empty)
40334
40334
  return this;
40335
- let result2 = this.result.map ? this.result.map(this.result, mapping) : this.result;
40336
- if (!result2)
40335
+ let result = this.result.map ? this.result.map(this.result, mapping) : this.result;
40336
+ if (!result)
40337
40337
  return new ActiveSource(
40338
40338
  this.source,
40339
40339
  0
@@ -40370,16 +40370,16 @@ const completionState = /* @__PURE__ */ StateField.define({
40370
40370
  });
40371
40371
  function applyCompletion(view, option) {
40372
40372
  const apply = option.completion.apply || option.completion.label;
40373
- let result2 = view.state.field(completionState).active.find((a) => a.source == option.source);
40374
- if (!(result2 instanceof ActiveResult))
40373
+ let result = view.state.field(completionState).active.find((a) => a.source == option.source);
40374
+ if (!(result instanceof ActiveResult))
40375
40375
  return false;
40376
40376
  if (typeof apply == "string")
40377
40377
  view.dispatch({
40378
- ...insertCompletionText(view.state, apply, result2.from, result2.to),
40378
+ ...insertCompletionText(view.state, apply, result.from, result.to),
40379
40379
  annotations: pickedCompletion.of(option.completion)
40380
40380
  });
40381
40381
  else
40382
- apply(view, option.completion, result2.from, result2.to);
40382
+ apply(view, option.completion, result.from, result.to);
40383
40383
  return true;
40384
40384
  }
40385
40385
  const createTooltip = /* @__PURE__ */ completionTooltip(completionState, applyCompletion);
@@ -40501,9 +40501,9 @@ const completionPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
40501
40501
  let context = new CompletionContext(state, pos, active.explicit, this.view);
40502
40502
  let pending = new RunningQuery(active, context);
40503
40503
  this.running.push(pending);
40504
- Promise.resolve(active.source(context)).then((result2) => {
40504
+ Promise.resolve(active.source(context)).then((result) => {
40505
40505
  if (!pending.context.aborted) {
40506
- pending.done = result2 || null;
40506
+ pending.done = result || null;
40507
40507
  this.scheduleAccept();
40508
40508
  }
40509
40509
  }, (err) => {
@@ -40590,8 +40590,8 @@ const commitCharacters = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ EditorView
40590
40590
  if (!field || !field.open || field.open.disabled || field.open.selected < 0 || event.key.length > 1 || event.ctrlKey && !(windows && event.altKey) || event.metaKey)
40591
40591
  return false;
40592
40592
  let option = field.open.options[field.open.selected];
40593
- let result2 = field.active.find((a) => a.source == option.source);
40594
- let commitChars = option.completion.commitCharacters || result2.result.commitCharacters;
40593
+ let result = field.active.find((a) => a.source == option.source);
40594
+ let commitChars = option.completion.commitCharacters || result.result.commitCharacters;
40595
40595
  if (commitChars && commitChars.indexOf(event.key) > -1)
40596
40596
  applyCompletion(view, option);
40597
40597
  return false;
@@ -41386,9 +41386,9 @@ function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
41386
41386
  }
41387
41387
  function hideTooltip(tr, tooltip) {
41388
41388
  let from = tooltip.pos, to = tooltip.end || from;
41389
- let result2 = tr.state.facet(lintConfig).hideOn(tr, from, to);
41390
- if (result2 != null)
41391
- return result2;
41389
+ let result = tr.state.facet(lintConfig).hideOn(tr, from, to);
41390
+ if (result != null)
41391
+ return result;
41392
41392
  let line = tr.startState.doc.lineAt(tooltip.pos);
41393
41393
  return !!(tr.effects.some((e) => e.is(setDiagnosticsEffect)) || tr.changes.touchesRange(line.from, Math.max(line.to, to)));
41394
41394
  }
@@ -43790,7 +43790,7 @@ class NineDiff extends HTMLElement {
43790
43790
  const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
43791
43791
  this.shadowRoot.innerHTML = `
43792
43792
  <style>
43793
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.407"}/dist/css/nine-mu.css";
43793
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.409"}/dist/css/nine-mu.css";
43794
43794
  ${customImport}
43795
43795
  </style>
43796
43796
 
@@ -43930,7 +43930,7 @@ renderScaffolding_fn = function() {
43930
43930
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
43931
43931
  this.shadowRoot.innerHTML = `
43932
43932
  <style>
43933
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.407"}/dist/css/nine-mu.css";
43933
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.409"}/dist/css/nine-mu.css";
43934
43934
  ${customImport}
43935
43935
  </style>
43936
43936
 
@@ -44039,7 +44039,7 @@ render_fn2 = function() {
44039
44039
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
44040
44040
  this.shadowRoot.innerHTML = `
44041
44041
  <style>
44042
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.407"}/dist/css/nine-mu.css";
44042
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.409"}/dist/css/nine-mu.css";
44043
44043
  ${customImport}
44044
44044
  </style>
44045
44045
 
@@ -44369,7 +44369,7 @@ class ChatMessageBody extends HTMLElement {
44369
44369
  const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
44370
44370
  this.shadowRoot.innerHTML = `
44371
44371
  <style>
44372
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.407"}/dist/css/nine-mu.css";
44372
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.409"}/dist/css/nine-mu.css";
44373
44373
  ${customImport}
44374
44374
  </style>
44375
44375
 
@@ -44484,7 +44484,7 @@ render_fn3 = function() {
44484
44484
  const customImport = nine.cssPath ? `@import "${nine.cssPath}/nine-mu.css";` : "";
44485
44485
  this.shadowRoot.innerHTML = `
44486
44486
  <style>
44487
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.407"}/dist/css/nine-mu.css";
44487
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.409"}/dist/css/nine-mu.css";
44488
44488
  ${customImport}
44489
44489
  </style>
44490
44490
 
@@ -44520,9 +44520,9 @@ handleQuestion_fn = async function(question2) {
44520
44520
  });
44521
44521
  trace.log(response);
44522
44522
  if (response.list) {
44523
- const el = document.querySelector("nine-natual-query-result");
44524
- if (el) {
44525
- el.redraw(result.list);
44523
+ const $el = document.querySelector("nine-natural-query-result");
44524
+ if ($el) {
44525
+ $el.redraw(response.list);
44526
44526
  }
44527
44527
  }
44528
44528
  } catch (error) {
@@ -44638,7 +44638,7 @@ render_fn4 = function() {
44638
44638
  const customImport = nine$1.cssPath ? `@import "${nine$1.cssPath}/nine-mu.css";` : "";
44639
44639
  this.shadowRoot.innerHTML = `
44640
44640
  <style>
44641
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.407"}/dist/css/nine-mu.css";
44641
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.409"}/dist/css/nine-mu.css";
44642
44642
  ${customImport}
44643
44643
  </style>
44644
44644
 
@@ -44873,7 +44873,7 @@ function NineHook({ children, menuData, views, error404, onCatch, fallback, styl
44873
44873
  );
44874
44874
  }
44875
44875
  const NineMu = {
44876
- version: "0.1.407",
44876
+ version: "0.1.409",
44877
44877
  init: (config2) => {
44878
44878
  trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
44879
44879
  }