@nine-lab/nine-mu 0.1.182 → 0.1.184

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
@@ -455,50 +455,50 @@ function formatError(error, _mapper) {
455
455
  }
456
456
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
457
457
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
458
- const result2 = schema._zod.run({ value, issues: [] }, ctx);
459
- if (result2 instanceof Promise) {
458
+ const result = schema._zod.run({ value, issues: [] }, ctx);
459
+ if (result instanceof Promise) {
460
460
  throw new $ZodAsyncError();
461
461
  }
462
- if (result2.issues.length) {
463
- const e = new ((_params == null ? void 0 : _params.Err) ?? _Err)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())));
462
+ if (result.issues.length) {
463
+ const e = new ((_params == null ? void 0 : _params.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
464
464
  captureStackTrace(e, _params == null ? void 0 : _params.callee);
465
465
  throw e;
466
466
  }
467
- return result2.value;
467
+ return result.value;
468
468
  };
469
469
  const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
470
470
  const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
471
- let result2 = schema._zod.run({ value, issues: [] }, ctx);
472
- if (result2 instanceof Promise)
473
- result2 = await result2;
474
- if (result2.issues.length) {
475
- const e = new ((params == null ? void 0 : params.Err) ?? _Err)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())));
471
+ let result = schema._zod.run({ value, issues: [] }, ctx);
472
+ if (result instanceof Promise)
473
+ result = await result;
474
+ if (result.issues.length) {
475
+ const e = new ((params == null ? void 0 : params.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
476
476
  captureStackTrace(e, params == null ? void 0 : params.callee);
477
477
  throw e;
478
478
  }
479
- return result2.value;
479
+ return result.value;
480
480
  };
481
481
  const _safeParse = (_Err) => (schema, value, _ctx) => {
482
482
  const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
483
- const result2 = schema._zod.run({ value, issues: [] }, ctx);
484
- if (result2 instanceof Promise) {
483
+ const result = schema._zod.run({ value, issues: [] }, ctx);
484
+ if (result instanceof Promise) {
485
485
  throw new $ZodAsyncError();
486
486
  }
487
- return result2.issues.length ? {
487
+ return result.issues.length ? {
488
488
  success: false,
489
- error: new (_Err ?? $ZodError)(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
490
- } : { success: true, data: result2.value };
489
+ error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
490
+ } : { success: true, data: result.value };
491
491
  };
492
492
  const safeParse$2 = /* @__PURE__ */ _safeParse($ZodRealError);
493
493
  const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
494
494
  const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
495
- let result2 = schema._zod.run({ value, issues: [] }, ctx);
496
- if (result2 instanceof Promise)
497
- result2 = await result2;
498
- return result2.issues.length ? {
495
+ let result = schema._zod.run({ value, issues: [] }, ctx);
496
+ if (result instanceof Promise)
497
+ result = await result;
498
+ return result.issues.length ? {
499
499
  success: false,
500
- error: new _Err(result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
501
- } : { success: true, data: result2.value };
500
+ error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
501
+ } : { success: true, data: result.value };
502
502
  };
503
503
  const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
504
504
  const cuid = /^[cC][^\s-]{8,}$/;
@@ -1043,13 +1043,13 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1043
1043
  return payload;
1044
1044
  };
1045
1045
  inst._zod.run = (payload, ctx) => {
1046
- const result2 = inst._zod.parse(payload, ctx);
1047
- if (result2 instanceof Promise) {
1046
+ const result = inst._zod.parse(payload, ctx);
1047
+ if (result instanceof Promise) {
1048
1048
  if (ctx.async === false)
1049
1049
  throw new $ZodAsyncError();
1050
- return result2.then((result3) => runChecks(result3, checks, ctx));
1050
+ return result.then((result2) => runChecks(result2, checks, ctx));
1051
1051
  }
1052
- return runChecks(result2, checks, ctx);
1052
+ return runChecks(result, checks, ctx);
1053
1053
  };
1054
1054
  }
1055
1055
  inst["~standard"] = {
@@ -1451,11 +1451,11 @@ const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
1451
1451
  return payload;
1452
1452
  };
1453
1453
  });
1454
- function handleArrayResult(result2, final, index) {
1455
- if (result2.issues.length) {
1456
- final.issues.push(...prefixIssues(index, result2.issues));
1454
+ function handleArrayResult(result, final, index) {
1455
+ if (result.issues.length) {
1456
+ final.issues.push(...prefixIssues(index, result.issues));
1457
1457
  }
1458
- final.value[index] = result2.value;
1458
+ final.value[index] = result.value;
1459
1459
  }
1460
1460
  const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1461
1461
  $ZodType.init(inst, def);
@@ -1474,14 +1474,14 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1474
1474
  const proms = [];
1475
1475
  for (let i = 0; i < input.length; i++) {
1476
1476
  const item = input[i];
1477
- const result2 = def.element._zod.run({
1477
+ const result = def.element._zod.run({
1478
1478
  value: item,
1479
1479
  issues: []
1480
1480
  }, ctx);
1481
- if (result2 instanceof Promise) {
1482
- proms.push(result2.then((result3) => handleArrayResult(result3, payload, i)));
1481
+ if (result instanceof Promise) {
1482
+ proms.push(result.then((result2) => handleArrayResult(result2, payload, i)));
1483
1483
  } else {
1484
- handleArrayResult(result2, payload, i);
1484
+ handleArrayResult(result, payload, i);
1485
1485
  }
1486
1486
  }
1487
1487
  if (proms.length) {
@@ -1490,28 +1490,28 @@ const $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1490
1490
  return payload;
1491
1491
  };
1492
1492
  });
1493
- function handleObjectResult(result2, final, key) {
1494
- if (result2.issues.length) {
1495
- final.issues.push(...prefixIssues(key, result2.issues));
1493
+ function handleObjectResult(result, final, key) {
1494
+ if (result.issues.length) {
1495
+ final.issues.push(...prefixIssues(key, result.issues));
1496
1496
  }
1497
- final.value[key] = result2.value;
1497
+ final.value[key] = result.value;
1498
1498
  }
1499
- function handleOptionalObjectResult(result2, final, key, input) {
1500
- if (result2.issues.length) {
1499
+ function handleOptionalObjectResult(result, final, key, input) {
1500
+ if (result.issues.length) {
1501
1501
  if (input[key] === void 0) {
1502
1502
  if (key in input) {
1503
1503
  final.value[key] = void 0;
1504
1504
  } else {
1505
- final.value[key] = result2.value;
1505
+ final.value[key] = result.value;
1506
1506
  }
1507
1507
  } else {
1508
- final.issues.push(...prefixIssues(key, result2.issues));
1508
+ final.issues.push(...prefixIssues(key, result.issues));
1509
1509
  }
1510
- } else if (result2.value === void 0) {
1510
+ } else if (result.value === void 0) {
1511
1511
  if (key in input)
1512
1512
  final.value[key] = void 0;
1513
1513
  } else {
1514
- final.value[key] = result2.value;
1514
+ final.value[key] = result.value;
1515
1515
  }
1516
1516
  }
1517
1517
  const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
@@ -1677,9 +1677,9 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1677
1677
  };
1678
1678
  });
1679
1679
  function handleUnionResults(results, final, inst, ctx) {
1680
- for (const result2 of results) {
1681
- if (result2.issues.length === 0) {
1682
- final.value = result2.value;
1680
+ for (const result of results) {
1681
+ if (result.issues.length === 0) {
1682
+ final.value = result.value;
1683
1683
  return final;
1684
1684
  }
1685
1685
  }
@@ -1687,7 +1687,7 @@ function handleUnionResults(results, final, inst, ctx) {
1687
1687
  code: "invalid_union",
1688
1688
  input: final.value,
1689
1689
  inst,
1690
- errors: results.map((result2) => result2.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1690
+ errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1691
1691
  });
1692
1692
  return final;
1693
1693
  }
@@ -1712,17 +1712,17 @@ const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
1712
1712
  let async = false;
1713
1713
  const results = [];
1714
1714
  for (const option of def.options) {
1715
- const result2 = option._zod.run({
1715
+ const result = option._zod.run({
1716
1716
  value: payload.value,
1717
1717
  issues: []
1718
1718
  }, ctx);
1719
- if (result2 instanceof Promise) {
1720
- results.push(result2);
1719
+ if (result instanceof Promise) {
1720
+ results.push(result);
1721
1721
  async = true;
1722
1722
  } else {
1723
- if (result2.issues.length === 0)
1724
- return result2;
1725
- results.push(result2);
1723
+ if (result.issues.length === 0)
1724
+ return result;
1725
+ results.push(result);
1726
1726
  }
1727
1727
  }
1728
1728
  if (!async)
@@ -1855,21 +1855,21 @@ function mergeValues(a, b) {
1855
1855
  }
1856
1856
  return { valid: false, mergeErrorPath: [] };
1857
1857
  }
1858
- function handleIntersectionResults(result2, left, right) {
1858
+ function handleIntersectionResults(result, left, right) {
1859
1859
  if (left.issues.length) {
1860
- result2.issues.push(...left.issues);
1860
+ result.issues.push(...left.issues);
1861
1861
  }
1862
1862
  if (right.issues.length) {
1863
- result2.issues.push(...right.issues);
1863
+ result.issues.push(...right.issues);
1864
1864
  }
1865
- if (aborted(result2))
1866
- return result2;
1865
+ if (aborted(result))
1866
+ return result;
1867
1867
  const merged = mergeValues(left.value, right.value);
1868
1868
  if (!merged.valid) {
1869
1869
  throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
1870
1870
  }
1871
- result2.value = merged.data;
1872
- return result2;
1871
+ result.value = merged.data;
1872
+ return result;
1873
1873
  }
1874
1874
  const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
1875
1875
  $ZodType.init(inst, def);
@@ -1890,19 +1890,19 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
1890
1890
  payload.value = {};
1891
1891
  for (const key of values) {
1892
1892
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
1893
- const result2 = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1894
- if (result2 instanceof Promise) {
1895
- proms.push(result2.then((result3) => {
1896
- if (result3.issues.length) {
1897
- payload.issues.push(...prefixIssues(key, result3.issues));
1893
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1894
+ if (result instanceof Promise) {
1895
+ proms.push(result.then((result2) => {
1896
+ if (result2.issues.length) {
1897
+ payload.issues.push(...prefixIssues(key, result2.issues));
1898
1898
  }
1899
- payload.value[key] = result3.value;
1899
+ payload.value[key] = result2.value;
1900
1900
  }));
1901
1901
  } else {
1902
- if (result2.issues.length) {
1903
- payload.issues.push(...prefixIssues(key, result2.issues));
1902
+ if (result.issues.length) {
1903
+ payload.issues.push(...prefixIssues(key, result.issues));
1904
1904
  }
1905
- payload.value[key] = result2.value;
1905
+ payload.value[key] = result.value;
1906
1906
  }
1907
1907
  }
1908
1908
  }
@@ -1942,19 +1942,19 @@ const $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
1942
1942
  payload.value[keyResult.value] = keyResult.value;
1943
1943
  continue;
1944
1944
  }
1945
- const result2 = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1946
- if (result2 instanceof Promise) {
1947
- proms.push(result2.then((result3) => {
1948
- if (result3.issues.length) {
1949
- payload.issues.push(...prefixIssues(key, result3.issues));
1945
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
1946
+ if (result instanceof Promise) {
1947
+ proms.push(result.then((result2) => {
1948
+ if (result2.issues.length) {
1949
+ payload.issues.push(...prefixIssues(key, result2.issues));
1950
1950
  }
1951
- payload.value[keyResult.value] = result3.value;
1951
+ payload.value[keyResult.value] = result2.value;
1952
1952
  }));
1953
1953
  } else {
1954
- if (result2.issues.length) {
1955
- payload.issues.push(...prefixIssues(key, result2.issues));
1954
+ if (result.issues.length) {
1955
+ payload.issues.push(...prefixIssues(key, result.issues));
1956
1956
  }
1957
- payload.value[keyResult.value] = result2.value;
1957
+ payload.value[keyResult.value] = result.value;
1958
1958
  }
1959
1959
  }
1960
1960
  }
@@ -2066,11 +2066,11 @@ const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
2066
2066
  payload.value = def.defaultValue;
2067
2067
  return payload;
2068
2068
  }
2069
- const result2 = def.innerType._zod.run(payload, ctx);
2070
- if (result2 instanceof Promise) {
2071
- return result2.then((result3) => handleDefaultResult(result3, def));
2069
+ const result = def.innerType._zod.run(payload, ctx);
2070
+ if (result instanceof Promise) {
2071
+ return result.then((result2) => handleDefaultResult(result2, def));
2072
2072
  }
2073
- return handleDefaultResult(result2, def);
2073
+ return handleDefaultResult(result, def);
2074
2074
  };
2075
2075
  });
2076
2076
  function handleDefaultResult(payload, def) {
@@ -2097,11 +2097,11 @@ const $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, d
2097
2097
  return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
2098
2098
  });
2099
2099
  inst._zod.parse = (payload, ctx) => {
2100
- const result2 = def.innerType._zod.run(payload, ctx);
2101
- if (result2 instanceof Promise) {
2102
- return result2.then((result3) => handleNonOptionalResult(result3, inst));
2100
+ const result = def.innerType._zod.run(payload, ctx);
2101
+ if (result instanceof Promise) {
2102
+ return result.then((result2) => handleNonOptionalResult(result2, inst));
2103
2103
  }
2104
- return handleNonOptionalResult(result2, inst);
2104
+ return handleNonOptionalResult(result, inst);
2105
2105
  };
2106
2106
  });
2107
2107
  function handleNonOptionalResult(payload, inst) {
@@ -2121,15 +2121,15 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2121
2121
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2122
2122
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2123
2123
  inst._zod.parse = (payload, ctx) => {
2124
- const result2 = def.innerType._zod.run(payload, ctx);
2125
- if (result2 instanceof Promise) {
2126
- return result2.then((result3) => {
2127
- payload.value = result3.value;
2128
- if (result3.issues.length) {
2124
+ const result = def.innerType._zod.run(payload, ctx);
2125
+ if (result instanceof Promise) {
2126
+ return result.then((result2) => {
2127
+ payload.value = result2.value;
2128
+ if (result2.issues.length) {
2129
2129
  payload.value = def.catchValue({
2130
2130
  ...payload,
2131
2131
  error: {
2132
- issues: result3.issues.map((iss) => finalizeIssue(iss, ctx, config()))
2132
+ issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
2133
2133
  },
2134
2134
  input: payload.value
2135
2135
  });
@@ -2138,12 +2138,12 @@ const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2138
2138
  return payload;
2139
2139
  });
2140
2140
  }
2141
- payload.value = result2.value;
2142
- if (result2.issues.length) {
2141
+ payload.value = result.value;
2142
+ if (result.issues.length) {
2143
2143
  payload.value = def.catchValue({
2144
2144
  ...payload,
2145
2145
  error: {
2146
- issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config()))
2146
+ issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config()))
2147
2147
  },
2148
2148
  input: payload.value
2149
2149
  });
@@ -2178,11 +2178,11 @@ const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) =>
2178
2178
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2179
2179
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2180
2180
  inst._zod.parse = (payload, ctx) => {
2181
- const result2 = def.innerType._zod.run(payload, ctx);
2182
- if (result2 instanceof Promise) {
2183
- return result2.then(handleReadonlyResult);
2181
+ const result = def.innerType._zod.run(payload, ctx);
2182
+ if (result instanceof Promise) {
2183
+ return result.then(handleReadonlyResult);
2184
2184
  }
2185
- return handleReadonlyResult(result2);
2185
+ return handleReadonlyResult(result);
2186
2186
  };
2187
2187
  });
2188
2188
  function handleReadonlyResult(payload) {
@@ -2205,8 +2205,8 @@ const $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
2205
2205
  return;
2206
2206
  };
2207
2207
  });
2208
- function handleRefineResult(result2, payload, input, inst) {
2209
- if (!result2) {
2208
+ function handleRefineResult(result, payload, input, inst) {
2209
+ if (!result) {
2210
2210
  const _iss = {
2211
2211
  code: "custom",
2212
2212
  input,
@@ -2711,12 +2711,12 @@ function isZ4Schema(s) {
2711
2711
  }
2712
2712
  function safeParse$1(schema, data) {
2713
2713
  if (isZ4Schema(schema)) {
2714
- const result3 = safeParse$2(schema, data);
2715
- return result3;
2714
+ const result2 = safeParse$2(schema, data);
2715
+ return result2;
2716
2716
  }
2717
2717
  const v3Schema = schema;
2718
- const result2 = v3Schema.safeParse(data);
2719
- return result2;
2718
+ const result = v3Schema.safeParse(data);
2719
+ return result;
2720
2720
  }
2721
2721
  function getObjectShape(schema) {
2722
2722
  var _a2, _b;
@@ -4976,11 +4976,11 @@ function getMethodLiteral(schema) {
4976
4976
  return value;
4977
4977
  }
4978
4978
  function parseWithCompat(schema, data) {
4979
- const result2 = safeParse$1(schema, data);
4980
- if (!result2.success) {
4981
- throw result2.error;
4979
+ const result = safeParse$1(schema, data);
4980
+ if (!result.success) {
4981
+ throw result.error;
4982
4982
  }
4983
- return result2.data;
4983
+ return result.data;
4984
4984
  }
4985
4985
  const DEFAULT_REQUEST_TIMEOUT_MSEC = 6e4;
4986
4986
  class Protocol {
@@ -5057,12 +5057,12 @@ class Protocol {
5057
5057
  return await handleTaskResult();
5058
5058
  }
5059
5059
  if (isTerminal(task.status)) {
5060
- const result2 = await this._taskStore.getTaskResult(taskId, extra.sessionId);
5060
+ const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
5061
5061
  this._clearTaskQueue(taskId);
5062
5062
  return {
5063
- ...result2,
5063
+ ...result,
5064
5064
  _meta: {
5065
- ...result2._meta,
5065
+ ...result._meta,
5066
5066
  [RELATED_TASK_META_KEY]: {
5067
5067
  taskId
5068
5068
  }
@@ -5293,12 +5293,12 @@ class Protocol {
5293
5293
  if (taskCreationParams) {
5294
5294
  this.assertTaskHandlerCapability(request.method);
5295
5295
  }
5296
- }).then(() => handler(request, fullExtra)).then(async (result2) => {
5296
+ }).then(() => handler(request, fullExtra)).then(async (result) => {
5297
5297
  if (abortController.signal.aborted) {
5298
5298
  return;
5299
5299
  }
5300
5300
  const response = {
5301
- result: result2,
5301
+ result,
5302
5302
  jsonrpc: "2.0",
5303
5303
  id: request.id
5304
5304
  };
@@ -5384,9 +5384,9 @@ class Protocol {
5384
5384
  this._cleanupTimeout(messageId);
5385
5385
  let isTaskResponse = false;
5386
5386
  if (isJSONRPCResultResponse(response) && response.result && typeof response.result === "object") {
5387
- const result2 = response.result;
5388
- if (result2.task && typeof result2.task === "object") {
5389
- const task = result2.task;
5387
+ const result = response.result;
5388
+ if (result.task && typeof result.task === "object") {
5389
+ const task = result.task;
5390
5390
  if (typeof task.taskId === "string") {
5391
5391
  isTaskResponse = true;
5392
5392
  this._taskProgressTokens.set(task.taskId, messageId);
@@ -5445,8 +5445,8 @@ class Protocol {
5445
5445
  const { task } = options ?? {};
5446
5446
  if (!task) {
5447
5447
  try {
5448
- const result2 = await this.request(request, resultSchema, options);
5449
- yield { type: "result", result: result2 };
5448
+ const result = await this.request(request, resultSchema, options);
5449
+ yield { type: "result", result };
5450
5450
  } catch (error) {
5451
5451
  yield {
5452
5452
  type: "error",
@@ -5469,8 +5469,8 @@ class Protocol {
5469
5469
  yield { type: "taskStatus", task: task2 };
5470
5470
  if (isTerminal(task2.status)) {
5471
5471
  if (task2.status === "completed") {
5472
- const result2 = await this.getTaskResult({ taskId }, resultSchema, options);
5473
- yield { type: "result", result: result2 };
5472
+ const result = await this.getTaskResult({ taskId }, resultSchema, options);
5473
+ yield { type: "result", result };
5474
5474
  } else if (task2.status === "failed") {
5475
5475
  yield {
5476
5476
  type: "error",
@@ -5485,8 +5485,8 @@ class Protocol {
5485
5485
  return;
5486
5486
  }
5487
5487
  if (task2.status === "input_required") {
5488
- const result2 = await this.getTaskResult({ taskId }, resultSchema, options);
5489
- yield { type: "result", result: result2 };
5488
+ const result = await this.getTaskResult({ taskId }, resultSchema, options);
5489
+ yield { type: "result", result };
5490
5490
  return;
5491
5491
  }
5492
5492
  const pollInterval = task2.pollInterval ?? ((_a2 = this._options) == null ? void 0 : _a2.defaultTaskPollInterval) ?? 1e3;
@@ -5888,8 +5888,8 @@ class Protocol {
5888
5888
  }
5889
5889
  return task;
5890
5890
  },
5891
- storeTaskResult: async (taskId, status, result2) => {
5892
- await taskStore.storeTaskResult(taskId, status, result2, sessionId);
5891
+ storeTaskResult: async (taskId, status, result) => {
5892
+ await taskStore.storeTaskResult(taskId, status, result, sessionId);
5893
5893
  const task = await taskStore.getTask(taskId, sessionId);
5894
5894
  if (task) {
5895
5895
  const notification = TaskStatusNotificationSchema.parse({
@@ -5936,20 +5936,20 @@ function isPlainObject(value) {
5936
5936
  return value !== null && typeof value === "object" && !Array.isArray(value);
5937
5937
  }
5938
5938
  function mergeCapabilities(base2, additional) {
5939
- const result2 = { ...base2 };
5939
+ const result = { ...base2 };
5940
5940
  for (const key in additional) {
5941
5941
  const k = key;
5942
5942
  const addValue = additional[k];
5943
5943
  if (addValue === void 0)
5944
5944
  continue;
5945
- const baseValue = result2[k];
5945
+ const baseValue = result[k];
5946
5946
  if (isPlainObject(baseValue) && isPlainObject(addValue)) {
5947
- result2[k] = { ...baseValue, ...addValue };
5947
+ result[k] = { ...baseValue, ...addValue };
5948
5948
  } else {
5949
- result2[k] = addValue;
5949
+ result[k] = addValue;
5950
5950
  }
5951
5951
  }
5952
- return result2;
5952
+ return result;
5953
5953
  }
5954
5954
  function getDefaultExportFromCjs(x) {
5955
5955
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -7858,10 +7858,10 @@ function requireKeyword() {
7858
7858
  if (def.async && !schemaEnv.$async)
7859
7859
  throw new Error("async keyword in sync schema");
7860
7860
  }
7861
- function useKeyword(gen, keyword2, result2) {
7862
- if (result2 === void 0)
7861
+ function useKeyword(gen, keyword2, result) {
7862
+ if (result === void 0)
7863
7863
  throw new Error(`keyword "${keyword2}" failed to compile`);
7864
- return gen.scopeValue("keyword", typeof result2 == "function" ? { ref: result2 } : { ref: result2, code: (0, codegen_1.stringify)(result2) });
7864
+ return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
7865
7865
  }
7866
7866
  function validSchemaType(schema, schemaType, allowUndefined = false) {
7867
7867
  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");
@@ -12802,17 +12802,17 @@ class ExperimentalClientTasks {
12802
12802
  const validator = clientInternal.getToolOutputValidator(params.name);
12803
12803
  for await (const message of stream) {
12804
12804
  if (message.type === "result" && validator) {
12805
- const result2 = message.result;
12806
- if (!result2.structuredContent && !result2.isError) {
12805
+ const result = message.result;
12806
+ if (!result.structuredContent && !result.isError) {
12807
12807
  yield {
12808
12808
  type: "error",
12809
12809
  error: new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`)
12810
12810
  };
12811
12811
  return;
12812
12812
  }
12813
- if (result2.structuredContent) {
12813
+ if (result.structuredContent) {
12814
12814
  try {
12815
- const validationResult = validator(result2.structuredContent);
12815
+ const validationResult = validator(result.structuredContent);
12816
12816
  if (!validationResult.valid) {
12817
12817
  yield {
12818
12818
  type: "error",
@@ -13001,20 +13001,20 @@ class Client extends Protocol {
13001
13001
  var _a2, _b, _c, _d, _e, _f;
13002
13002
  if (config2.tools && ((_b = (_a2 = this._serverCapabilities) == null ? void 0 : _a2.tools) == null ? void 0 : _b.listChanged)) {
13003
13003
  this._setupListChangedHandler("tools", ToolListChangedNotificationSchema, config2.tools, async () => {
13004
- const result2 = await this.listTools();
13005
- return result2.tools;
13004
+ const result = await this.listTools();
13005
+ return result.tools;
13006
13006
  });
13007
13007
  }
13008
13008
  if (config2.prompts && ((_d = (_c = this._serverCapabilities) == null ? void 0 : _c.prompts) == null ? void 0 : _d.listChanged)) {
13009
13009
  this._setupListChangedHandler("prompts", PromptListChangedNotificationSchema, config2.prompts, async () => {
13010
- const result2 = await this.listPrompts();
13011
- return result2.prompts;
13010
+ const result = await this.listPrompts();
13011
+ return result.prompts;
13012
13012
  });
13013
13013
  }
13014
13014
  if (config2.resources && ((_f = (_e = this._serverCapabilities) == null ? void 0 : _e.resources) == null ? void 0 : _f.listChanged)) {
13015
13015
  this._setupListChangedHandler("resources", ResourceListChangedNotificationSchema, config2.resources, async () => {
13016
- const result2 = await this.listResources();
13017
- return result2.resources;
13016
+ const result = await this.listResources();
13017
+ return result.resources;
13018
13018
  });
13019
13019
  }
13020
13020
  }
@@ -13085,16 +13085,16 @@ class Client extends Protocol {
13085
13085
  if (params.mode === "url" && !supportsUrlMode) {
13086
13086
  throw new McpError(ErrorCode.InvalidParams, "Client does not support URL-mode elicitation requests");
13087
13087
  }
13088
- const result2 = await Promise.resolve(handler(request, extra));
13088
+ const result = await Promise.resolve(handler(request, extra));
13089
13089
  if (params.task) {
13090
- const taskValidationResult = safeParse$1(CreateTaskResultSchema, result2);
13090
+ const taskValidationResult = safeParse$1(CreateTaskResultSchema, result);
13091
13091
  if (!taskValidationResult.success) {
13092
13092
  const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
13093
13093
  throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
13094
13094
  }
13095
13095
  return taskValidationResult.data;
13096
13096
  }
13097
- const validationResult = safeParse$1(ElicitResultSchema, result2);
13097
+ const validationResult = safeParse$1(ElicitResultSchema, result);
13098
13098
  if (!validationResult.success) {
13099
13099
  const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
13100
13100
  throw new McpError(ErrorCode.InvalidParams, `Invalid elicitation result: ${errorMessage}`);
@@ -13121,9 +13121,9 @@ class Client extends Protocol {
13121
13121
  throw new McpError(ErrorCode.InvalidParams, `Invalid sampling request: ${errorMessage}`);
13122
13122
  }
13123
13123
  const { params } = validatedRequest.data;
13124
- const result2 = await Promise.resolve(handler(request, extra));
13124
+ const result = await Promise.resolve(handler(request, extra));
13125
13125
  if (params.task) {
13126
- const taskValidationResult = safeParse$1(CreateTaskResultSchema, result2);
13126
+ const taskValidationResult = safeParse$1(CreateTaskResultSchema, result);
13127
13127
  if (!taskValidationResult.success) {
13128
13128
  const errorMessage = taskValidationResult.error instanceof Error ? taskValidationResult.error.message : String(taskValidationResult.error);
13129
13129
  throw new McpError(ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
@@ -13132,7 +13132,7 @@ class Client extends Protocol {
13132
13132
  }
13133
13133
  const hasTools = params.tools || params.toolChoice;
13134
13134
  const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema;
13135
- const validationResult = safeParse$1(resultSchema, result2);
13135
+ const validationResult = safeParse$1(resultSchema, result);
13136
13136
  if (!validationResult.success) {
13137
13137
  const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
13138
13138
  throw new McpError(ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`);
@@ -13155,7 +13155,7 @@ class Client extends Protocol {
13155
13155
  return;
13156
13156
  }
13157
13157
  try {
13158
- const result2 = await this.request({
13158
+ const result = await this.request({
13159
13159
  method: "initialize",
13160
13160
  params: {
13161
13161
  protocolVersion: LATEST_PROTOCOL_VERSION,
@@ -13163,18 +13163,18 @@ class Client extends Protocol {
13163
13163
  clientInfo: this._clientInfo
13164
13164
  }
13165
13165
  }, InitializeResultSchema, options);
13166
- if (result2 === void 0) {
13167
- throw new Error(`Server sent invalid initialize result: ${result2}`);
13166
+ if (result === void 0) {
13167
+ throw new Error(`Server sent invalid initialize result: ${result}`);
13168
13168
  }
13169
- if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result2.protocolVersion)) {
13170
- throw new Error(`Server's protocol version is not supported: ${result2.protocolVersion}`);
13169
+ if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) {
13170
+ throw new Error(`Server's protocol version is not supported: ${result.protocolVersion}`);
13171
13171
  }
13172
- this._serverCapabilities = result2.capabilities;
13173
- this._serverVersion = result2.serverInfo;
13172
+ this._serverCapabilities = result.capabilities;
13173
+ this._serverVersion = result.serverInfo;
13174
13174
  if (transport.setProtocolVersion) {
13175
- transport.setProtocolVersion(result2.protocolVersion);
13175
+ transport.setProtocolVersion(result.protocolVersion);
13176
13176
  }
13177
- this._instructions = result2.instructions;
13177
+ this._instructions = result.instructions;
13178
13178
  await this.notification({
13179
13179
  method: "notifications/initialized"
13180
13180
  });
@@ -13334,15 +13334,15 @@ class Client extends Protocol {
13334
13334
  if (this.isToolTaskRequired(params.name)) {
13335
13335
  throw new McpError(ErrorCode.InvalidRequest, `Tool "${params.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);
13336
13336
  }
13337
- const result2 = await this.request({ method: "tools/call", params }, resultSchema, options);
13337
+ const result = await this.request({ method: "tools/call", params }, resultSchema, options);
13338
13338
  const validator = this.getToolOutputValidator(params.name);
13339
13339
  if (validator) {
13340
- if (!result2.structuredContent && !result2.isError) {
13340
+ if (!result.structuredContent && !result.isError) {
13341
13341
  throw new McpError(ErrorCode.InvalidRequest, `Tool ${params.name} has an output schema but did not return structured content`);
13342
13342
  }
13343
- if (result2.structuredContent) {
13343
+ if (result.structuredContent) {
13344
13344
  try {
13345
- const validationResult = validator(result2.structuredContent);
13345
+ const validationResult = validator(result.structuredContent);
13346
13346
  if (!validationResult.valid) {
13347
13347
  throw new McpError(ErrorCode.InvalidParams, `Structured content does not match the tool's output schema: ${validationResult.errorMessage}`);
13348
13348
  }
@@ -13354,7 +13354,7 @@ class Client extends Protocol {
13354
13354
  }
13355
13355
  }
13356
13356
  }
13357
- return result2;
13357
+ return result;
13358
13358
  }
13359
13359
  isToolTask(toolName) {
13360
13360
  var _a2, _b, _c, _d;
@@ -13400,9 +13400,9 @@ class Client extends Protocol {
13400
13400
  return this._cachedToolOutputValidators.get(toolName);
13401
13401
  }
13402
13402
  async listTools(params, options) {
13403
- const result2 = await this.request({ method: "tools/list", params }, ListToolsResultSchema, options);
13404
- this.cacheToolMetadata(result2.tools);
13405
- return result2;
13403
+ const result = await this.request({ method: "tools/list", params }, ListToolsResultSchema, options);
13404
+ this.cacheToolMetadata(result.tools);
13405
+ return result;
13406
13406
  }
13407
13407
  /**
13408
13408
  * Set up a single list changed handler.
@@ -13521,7 +13521,7 @@ class NineChatManager {
13521
13521
  return await __privateMethod(this, _NineChatManager_instances, callTool_fn).call(this, "system-brain", {
13522
13522
  user_input: v,
13523
13523
  chat_history: formattedHistory,
13524
- routes: __privateMethod(this, _NineChatManager_instances, getRoutes_fn).call(this),
13524
+ routes: await __privateMethod(this, _NineChatManager_instances, getRoutes_fn).call(this),
13525
13525
  current_path: "/group_member/student_management"
13526
13526
  });
13527
13527
  });
@@ -13549,10 +13549,10 @@ class NineChatManager {
13549
13549
  // 실시간 경로 주입
13550
13550
  }
13551
13551
  });
13552
- const result2 = JSON.parse(response.content[0].text);
13553
- console.log("AI Response:", result2);
13554
- __privateMethod(this, _NineChatManager_instances, pushMessage_fn).call(this, "assistant", result2.message, result2);
13555
- if (__privateGet(this, _onAction)) __privateGet(this, _onAction).call(this, result2);
13552
+ const result = JSON.parse(response.content[0].text);
13553
+ console.log("AI Response:", result);
13554
+ __privateMethod(this, _NineChatManager_instances, pushMessage_fn).call(this, "assistant", result.message, result);
13555
+ if (__privateGet(this, _onAction)) __privateGet(this, _onAction).call(this, result);
13556
13556
  __privateMethod(this, _NineChatManager_instances, updateStatus_fn).call(this, "준비 완료");
13557
13557
  } catch (err) {
13558
13558
  trace.error("❌ Ask Error:", err);
@@ -13575,7 +13575,7 @@ class NineChatManager {
13575
13575
  }
13576
13576
  // 💡 이전 대화들을 저장할 메모리 창고
13577
13577
  addChatHistory(message) {
13578
- __privateGet(this, _chatHistory).push({ role: "ai", text: result.message });
13578
+ __privateGet(this, _chatHistory).push({ role: "ai", text: message });
13579
13579
  }
13580
13580
  }
13581
13581
  _mcpClient = new WeakMap();
@@ -13605,15 +13605,15 @@ fetchRoutes_fn = async function() {
13605
13605
  const r = await fetch("/admin/prompts/data/routes.json");
13606
13606
  return r.ok ? await r.json() : [];
13607
13607
  };
13608
- pushMessage_fn = function(role, content2, result2 = null) {
13608
+ pushMessage_fn = function(role, content2, result = null) {
13609
13609
  var _a2;
13610
13610
  if (__privateGet(this, _onMessage)) {
13611
13611
  __privateGet(this, _onMessage).call(this, {
13612
13612
  role,
13613
13613
  content: content2,
13614
- intent: result2 == null ? void 0 : result2.intent,
13615
- required_args: (_a2 = result2 == null ? void 0 : result2.action) == null ? void 0 : _a2.required_args,
13616
- action: result2 == null ? void 0 : result2.action
13614
+ intent: result == null ? void 0 : result.intent,
13615
+ required_args: (_a2 = result == null ? void 0 : result.action) == null ? void 0 : _a2.required_args,
13616
+ action: result == null ? void 0 : result.action
13617
13617
  });
13618
13618
  }
13619
13619
  };
@@ -13658,11 +13658,11 @@ class NineMuService {
13658
13658
  currentRoutes
13659
13659
  })
13660
13660
  });
13661
- const result2 = await response.json();
13662
- if (!result2.success) {
13663
- throw new Error(result2.error || "소스 생성 중 서버 오류가 발생했습니다.");
13661
+ const result = await response.json();
13662
+ if (!result.success) {
13663
+ throw new Error(result.error || "소스 생성 중 서버 오류가 발생했습니다.");
13664
13664
  }
13665
- return result2;
13665
+ return result;
13666
13666
  } catch (error) {
13667
13667
  trace.error("NineMu Service Error:", error);
13668
13668
  throw error;
@@ -13695,11 +13695,11 @@ class NineMuService {
13695
13695
  })
13696
13696
  });
13697
13697
  trace.log(response);
13698
- const result2 = await response.json();
13699
- if (!result2.success) {
13700
- throw new Error(result2.error || "소스 생성 중 서버 오류가 발생했습니다.");
13698
+ const result = await response.json();
13699
+ if (!result.success) {
13700
+ throw new Error(result.error || "소스 생성 중 서버 오류가 발생했습니다.");
13701
13701
  }
13702
- return result2;
13702
+ return result;
13703
13703
  } catch (error) {
13704
13704
  trace.error("NineMu Service Error:", error);
13705
13705
  throw error;
@@ -13752,10 +13752,10 @@ class NineChat extends HTMLElement {
13752
13752
  const command2 = "";
13753
13753
  const targets = "";
13754
13754
  try {
13755
- const result2 = await __privateGet(this, _service).generateAll(command2, targets, __privateGet(this, _routes));
13755
+ const result = await __privateGet(this, _service).generateAll(command2, targets, __privateGet(this, _routes));
13756
13756
  $status.textContent = "✅ 완료";
13757
13757
  nine.alert("소스 생성 성공").rgb();
13758
- this.dispatchEvent(new CustomEvent("nine-mu-completed", { detail: result2, bubbles: true }));
13758
+ this.dispatchEvent(new CustomEvent("nine-mu-completed", { detail: result, bubbles: true }));
13759
13759
  } catch (err) {
13760
13760
  $status.textContent = "❌ 실패";
13761
13761
  nine.alert(err.message).rgb().shake();
@@ -13818,7 +13818,7 @@ initActions_fn = function() {
13818
13818
  target.setAttribute("disabled", "disabled");
13819
13819
  __privateGet(this, _$nineChatMessage).add("me", userInput);
13820
13820
  __privateGet(this, _$nineChatMessage).add("ing", "");
13821
- const [result2, err] = await nine.safe(__privateGet(this, _manager).handleChatSubmit(target.value));
13821
+ const [result, err] = await nine.safe(__privateGet(this, _manager).handleChatSubmit(target.value));
13822
13822
  setTimeout(() => {
13823
13823
  target.value = "";
13824
13824
  });
@@ -13828,9 +13828,9 @@ initActions_fn = function() {
13828
13828
  trace.error(err);
13829
13829
  __privateGet(this, _$nineChatMessage).add("ai", err.message || "알 수 없는 오류가 발생했습니다. 다시 시도해주세요.");
13830
13830
  } else {
13831
- trace.log(result2);
13832
- __privateGet(this, _manager).addChatHistory(result2.message);
13833
- __privateGet(this, _$nineChatMessage).add("ai", result2.message);
13831
+ trace.log(result);
13832
+ __privateGet(this, _manager).addChatHistory(result.message);
13833
+ __privateGet(this, _$nineChatMessage).add("ai", result.message);
13834
13834
  }
13835
13835
  }
13836
13836
  });
@@ -13840,7 +13840,7 @@ render_fn = function() {
13840
13840
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
13841
13841
  this.shadowRoot.innerHTML = `
13842
13842
  <style>
13843
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.181"}/dist/css/nine-mu.css";
13843
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.183"}/dist/css/nine-mu.css";
13844
13844
  ${customImport}
13845
13845
  </style>
13846
13846
  <div class="wrapper">
@@ -14153,16 +14153,16 @@ class TextLeaf extends Text {
14153
14153
  }
14154
14154
  sliceString(from, to = this.length, lineSep = "\n") {
14155
14155
  [from, to] = clip(this, from, to);
14156
- let result2 = "";
14156
+ let result = "";
14157
14157
  for (let pos = 0, i = 0; pos <= to && i < this.text.length; i++) {
14158
14158
  let line = this.text[i], end = pos + line.length;
14159
14159
  if (pos > from && i)
14160
- result2 += lineSep;
14160
+ result += lineSep;
14161
14161
  if (from < end && to > pos)
14162
- result2 += line.slice(Math.max(0, from - pos), to - pos);
14162
+ result += line.slice(Math.max(0, from - pos), to - pos);
14163
14163
  pos = end + 1;
14164
14164
  }
14165
- return result2;
14165
+ return result;
14166
14166
  }
14167
14167
  flatten(target) {
14168
14168
  for (let line of this.text)
@@ -14239,16 +14239,16 @@ class TextNode extends Text {
14239
14239
  }
14240
14240
  sliceString(from, to = this.length, lineSep = "\n") {
14241
14241
  [from, to] = clip(this, from, to);
14242
- let result2 = "";
14242
+ let result = "";
14243
14243
  for (let i = 0, pos = 0; i < this.children.length && pos <= to; i++) {
14244
14244
  let child = this.children[i], end = pos + child.length;
14245
14245
  if (pos > from && i)
14246
- result2 += lineSep;
14246
+ result += lineSep;
14247
14247
  if (from < end && to > pos)
14248
- result2 += child.sliceString(from - pos, to - pos, lineSep);
14248
+ result += child.sliceString(from - pos, to - pos, lineSep);
14249
14249
  pos = end + 1;
14250
14250
  }
14251
- return result2;
14251
+ return result;
14252
14252
  }
14253
14253
  flatten(target) {
14254
14254
  for (let child of this.children)
@@ -14557,21 +14557,21 @@ class ChangeDesc {
14557
14557
  The length of the document before the change.
14558
14558
  */
14559
14559
  get length() {
14560
- let result2 = 0;
14560
+ let result = 0;
14561
14561
  for (let i = 0; i < this.sections.length; i += 2)
14562
- result2 += this.sections[i];
14563
- return result2;
14562
+ result += this.sections[i];
14563
+ return result;
14564
14564
  }
14565
14565
  /**
14566
14566
  The length of the document after the change.
14567
14567
  */
14568
14568
  get newLength() {
14569
- let result2 = 0;
14569
+ let result = 0;
14570
14570
  for (let i = 0; i < this.sections.length; i += 2) {
14571
14571
  let ins = this.sections[i + 1];
14572
- result2 += ins < 0 ? this.sections[i] : ins;
14572
+ result += ins < 0 ? this.sections[i] : ins;
14573
14573
  }
14574
- return result2;
14574
+ return result;
14575
14575
  }
14576
14576
  /**
14577
14577
  False when there are actual changes in this set.
@@ -14681,12 +14681,12 @@ class ChangeDesc {
14681
14681
  @internal
14682
14682
  */
14683
14683
  toString() {
14684
- let result2 = "";
14684
+ let result = "";
14685
14685
  for (let i = 0; i < this.sections.length; ) {
14686
14686
  let len = this.sections[i++], ins = this.sections[i++];
14687
- result2 += (result2 ? " " : "") + len + (ins >= 0 ? ":" + ins : "");
14687
+ result += (result ? " " : "") + len + (ins >= 0 ? ":" + ins : "");
14688
14688
  }
14689
- return result2;
14689
+ return result;
14690
14690
  }
14691
14691
  /**
14692
14692
  Serialize this change desc to a JSON-representable value.
@@ -15754,16 +15754,16 @@ class Configuration {
15754
15754
  }
15755
15755
  }
15756
15756
  function flatten(extension, compartments, newCompartments) {
15757
- let result2 = [[], [], [], [], []];
15757
+ let result = [[], [], [], [], []];
15758
15758
  let seen = /* @__PURE__ */ new Map();
15759
15759
  function inner(ext, prec2) {
15760
15760
  let known = seen.get(ext);
15761
15761
  if (known != null) {
15762
15762
  if (known <= prec2)
15763
15763
  return;
15764
- let found = result2[known].indexOf(ext);
15764
+ let found = result[known].indexOf(ext);
15765
15765
  if (found > -1)
15766
- result2[known].splice(found, 1);
15766
+ result[known].splice(found, 1);
15767
15767
  if (ext instanceof CompartmentInstance)
15768
15768
  newCompartments.delete(ext.compartment);
15769
15769
  }
@@ -15780,11 +15780,11 @@ function flatten(extension, compartments, newCompartments) {
15780
15780
  } else if (ext instanceof PrecExtension) {
15781
15781
  inner(ext.inner, ext.prec);
15782
15782
  } else if (ext instanceof StateField) {
15783
- result2[prec2].push(ext);
15783
+ result[prec2].push(ext);
15784
15784
  if (ext.provides)
15785
15785
  inner(ext.provides, prec2);
15786
15786
  } else if (ext instanceof FacetProvider) {
15787
- result2[prec2].push(ext);
15787
+ result[prec2].push(ext);
15788
15788
  if (ext.facet.extensions)
15789
15789
  inner(ext.facet.extensions, Prec_.default);
15790
15790
  } else {
@@ -15795,7 +15795,7 @@ function flatten(extension, compartments, newCompartments) {
15795
15795
  }
15796
15796
  }
15797
15797
  inner(extension, Prec_.default);
15798
- return result2.reduce((a, b) => a.concat(b));
15798
+ return result.reduce((a, b) => a.concat(b));
15799
15799
  }
15800
15800
  function ensureAddr(state, addr) {
15801
15801
  if (addr & 1)
@@ -15905,13 +15905,13 @@ class StateEffect {
15905
15905
  static mapEffects(effects, mapping) {
15906
15906
  if (!effects.length)
15907
15907
  return effects;
15908
- let result2 = [];
15908
+ let result = [];
15909
15909
  for (let effect of effects) {
15910
15910
  let mapped = effect.map(mapping);
15911
15911
  if (mapped)
15912
- result2.push(mapped);
15912
+ result.push(mapped);
15913
15913
  }
15914
- return result2;
15914
+ return result;
15915
15915
  }
15916
15916
  }
15917
15917
  StateEffect.reconfigure = /* @__PURE__ */ StateEffect.define();
@@ -16009,7 +16009,7 @@ Transaction.userEvent = /* @__PURE__ */ Annotation.define();
16009
16009
  Transaction.addToHistory = /* @__PURE__ */ Annotation.define();
16010
16010
  Transaction.remote = /* @__PURE__ */ Annotation.define();
16011
16011
  function joinRanges(a, b) {
16012
- let result2 = [];
16012
+ let result = [];
16013
16013
  for (let iA = 0, iB = 0; ; ) {
16014
16014
  let from, to;
16015
16015
  if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) {
@@ -16019,11 +16019,11 @@ function joinRanges(a, b) {
16019
16019
  from = b[iB++];
16020
16020
  to = b[iB++];
16021
16021
  } else
16022
- return result2;
16023
- if (!result2.length || result2[result2.length - 1] < from)
16024
- result2.push(from, to);
16025
- else if (result2[result2.length - 1] < to)
16026
- result2[result2.length - 1] = to;
16022
+ return result;
16023
+ if (!result.length || result[result.length - 1] < from)
16024
+ result.push(from, to);
16025
+ else if (result[result.length - 1] < to)
16026
+ result[result.length - 1] = to;
16027
16027
  }
16028
16028
  }
16029
16029
  function mergeTransaction(a, b, sequential) {
@@ -16073,23 +16073,23 @@ function resolveTransaction(state, specs, filter) {
16073
16073
  }
16074
16074
  function filterTransaction(tr) {
16075
16075
  let state = tr.startState;
16076
- let result2 = true;
16076
+ let result = true;
16077
16077
  for (let filter of state.facet(changeFilter)) {
16078
16078
  let value = filter(tr);
16079
16079
  if (value === false) {
16080
- result2 = false;
16080
+ result = false;
16081
16081
  break;
16082
16082
  }
16083
16083
  if (Array.isArray(value))
16084
- result2 = result2 === true ? value : joinRanges(result2, value);
16084
+ result = result === true ? value : joinRanges(result, value);
16085
16085
  }
16086
- if (result2 !== true) {
16086
+ if (result !== true) {
16087
16087
  let changes, back;
16088
- if (result2 === false) {
16088
+ if (result === false) {
16089
16089
  back = tr.changes.invertedDesc;
16090
16090
  changes = ChangeSet.empty(state.doc.length);
16091
16091
  } else {
16092
- let filtered = tr.changes.filter(result2);
16092
+ let filtered = tr.changes.filter(result);
16093
16093
  changes = filtered.changes;
16094
16094
  back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;
16095
16095
  }
@@ -16257,14 +16257,14 @@ class EditorState {
16257
16257
  let changes = this.changes(result1.changes), ranges = [result1.range];
16258
16258
  let effects = asArray$1(result1.effects);
16259
16259
  for (let i = 1; i < sel.ranges.length; i++) {
16260
- let result2 = f(sel.ranges[i]);
16261
- let newChanges = this.changes(result2.changes), newMapped = newChanges.map(changes);
16260
+ let result = f(sel.ranges[i]);
16261
+ let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes);
16262
16262
  for (let j = 0; j < i; j++)
16263
16263
  ranges[j] = ranges[j].map(newMapped);
16264
16264
  let mapBy = changes.mapDesc(newChanges, true);
16265
- ranges.push(result2.range.map(mapBy));
16265
+ ranges.push(result.range.map(mapBy));
16266
16266
  changes = changes.compose(newMapped);
16267
- effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(result2.effects), mapBy));
16267
+ effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(result.effects), mapBy));
16268
16268
  }
16269
16269
  return {
16270
16270
  changes,
@@ -16313,7 +16313,7 @@ class EditorState {
16313
16313
  not use `doc` or `selection`) to fields.
16314
16314
  */
16315
16315
  toJSON(fields) {
16316
- let result2 = {
16316
+ let result = {
16317
16317
  doc: this.sliceDoc(),
16318
16318
  selection: this.selection.toJSON()
16319
16319
  };
@@ -16321,9 +16321,9 @@ class EditorState {
16321
16321
  for (let prop in fields) {
16322
16322
  let value = fields[prop];
16323
16323
  if (value instanceof StateField && this.config.address[value.id] != null)
16324
- result2[prop] = value.spec.toJSON(this.field(fields[prop]), this);
16324
+ result[prop] = value.spec.toJSON(this.field(fields[prop]), this);
16325
16325
  }
16326
- return result2;
16326
+ return result;
16327
16327
  }
16328
16328
  /**
16329
16329
  Deserialize a state from its JSON representation. When custom
@@ -16427,9 +16427,9 @@ class EditorState {
16427
16427
  languageDataAt(name2, pos, side = -1) {
16428
16428
  let values = [];
16429
16429
  for (let provider of this.facet(languageData)) {
16430
- for (let result2 of provider(this, pos, side)) {
16431
- if (Object.prototype.hasOwnProperty.call(result2, name2))
16432
- values.push(result2[name2]);
16430
+ for (let result of provider(this, pos, side)) {
16431
+ if (Object.prototype.hasOwnProperty.call(result, name2))
16432
+ values.push(result[name2]);
16433
16433
  }
16434
16434
  }
16435
16435
  return values;
@@ -16492,22 +16492,22 @@ EditorState.transactionFilter = transactionFilter;
16492
16492
  EditorState.transactionExtender = transactionExtender;
16493
16493
  Compartment.reconfigure = /* @__PURE__ */ StateEffect.define();
16494
16494
  function combineConfig(configs, defaults2, combine = {}) {
16495
- let result2 = {};
16495
+ let result = {};
16496
16496
  for (let config2 of configs)
16497
16497
  for (let key of Object.keys(config2)) {
16498
- let value = config2[key], current = result2[key];
16498
+ let value = config2[key], current = result[key];
16499
16499
  if (current === void 0)
16500
- result2[key] = value;
16500
+ result[key] = value;
16501
16501
  else if (current === value || value === void 0) ;
16502
16502
  else if (Object.hasOwnProperty.call(combine, key))
16503
- result2[key] = combine[key](current, value);
16503
+ result[key] = combine[key](current, value);
16504
16504
  else
16505
16505
  throw new Error("Config merge conflict for field " + key);
16506
16506
  }
16507
16507
  for (let key in defaults2)
16508
- if (result2[key] === void 0)
16509
- result2[key] = defaults2[key];
16510
- return result2;
16508
+ if (result[key] === void 0)
16509
+ result[key] = defaults2[key];
16510
+ return result;
16511
16511
  }
16512
16512
  class RangeValue {
16513
16513
  /**
@@ -16834,12 +16834,12 @@ class RangeSet {
16834
16834
  static join(sets) {
16835
16835
  if (!sets.length)
16836
16836
  return RangeSet.empty;
16837
- let result2 = sets[sets.length - 1];
16837
+ let result = sets[sets.length - 1];
16838
16838
  for (let i = sets.length - 2; i >= 0; i--) {
16839
16839
  for (let layer2 = sets[i]; layer2 != RangeSet.empty; layer2 = layer2.nextLayer)
16840
- result2 = new RangeSet(layer2.chunkPos, layer2.chunk, result2, Math.max(layer2.maxPoint, result2.maxPoint));
16840
+ result = new RangeSet(layer2.chunkPos, layer2.chunk, result, Math.max(layer2.maxPoint, result.maxPoint));
16841
16841
  }
16842
- return result2;
16842
+ return result;
16843
16843
  }
16844
16844
  }
16845
16845
  RangeSet.empty = /* @__PURE__ */ new RangeSet([], [], null, -1);
@@ -16947,9 +16947,9 @@ class RangeSetBuilder {
16947
16947
  this.finishChunk(false);
16948
16948
  if (this.chunks.length == 0)
16949
16949
  return next;
16950
- let result2 = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);
16950
+ let result = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);
16951
16951
  this.from = null;
16952
- return result2;
16952
+ return result;
16953
16953
  }
16954
16954
  }
16955
16955
  function findSharedChunks(a, b, textDiff) {
@@ -18306,10 +18306,10 @@ var Direction = /* @__PURE__ */ (function(Direction2) {
18306
18306
  })(Direction || (Direction = {}));
18307
18307
  const LTR = Direction.LTR, RTL = Direction.RTL;
18308
18308
  function dec(str) {
18309
- let result2 = [];
18309
+ let result = [];
18310
18310
  for (let i = 0; i < str.length; i++)
18311
- result2.push(1 << +str[i]);
18312
- return result2;
18311
+ result.push(1 << +str[i]);
18312
+ return result;
18313
18313
  }
18314
18314
  const LowTypes = /* @__PURE__ */ dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008");
18315
18315
  const ArabicTypes = /* @__PURE__ */ dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");
@@ -18822,13 +18822,13 @@ function getIsolatedRanges(view, line) {
18822
18822
  if (!isolates.length)
18823
18823
  return isolates;
18824
18824
  let sets = isolates.map((i) => i instanceof Function ? i(view) : i);
18825
- let result2 = [];
18825
+ let result = [];
18826
18826
  RangeSet.spans(sets, line.from, line.to, {
18827
18827
  point() {
18828
18828
  },
18829
18829
  span(fromDoc, toDoc, active, open) {
18830
18830
  let from = fromDoc - line.from, to = toDoc - line.from;
18831
- let level = result2;
18831
+ let level = result;
18832
18832
  for (let i = active.length - 1; i >= 0; i--, open--) {
18833
18833
  let direction = active[i].spec.bidiIsolate, update;
18834
18834
  if (direction == null)
@@ -18844,7 +18844,7 @@ function getIsolatedRanges(view, line) {
18844
18844
  }
18845
18845
  }
18846
18846
  });
18847
- return result2;
18847
+ return result;
18848
18848
  }
18849
18849
  const scrollMargins = /* @__PURE__ */ Facet.define();
18850
18850
  function getScrollMargins(view) {
@@ -18897,7 +18897,7 @@ class ChangedRange {
18897
18897
  static extendWithRanges(diff, ranges) {
18898
18898
  if (ranges.length == 0)
18899
18899
  return diff;
18900
- let result2 = [];
18900
+ let result = [];
18901
18901
  for (let dI = 0, rI = 0, off = 0; ; ) {
18902
18902
  let nextD = dI < diff.length ? diff[dI].fromB : 1e9;
18903
18903
  let nextR = rI < ranges.length ? ranges[rI] : 1e9;
@@ -18922,9 +18922,9 @@ class ChangedRange {
18922
18922
  break;
18923
18923
  }
18924
18924
  }
18925
- result2.push(new ChangedRange(fromA, toA, fromB, toB));
18925
+ result.push(new ChangedRange(fromA, toA, fromB, toB));
18926
18926
  }
18927
- return result2;
18927
+ return result;
18928
18928
  }
18929
18929
  }
18930
18930
  class ViewUpdate {
@@ -19200,9 +19200,9 @@ class DocTile extends CompositeTile {
19200
19200
  i = 0;
19201
19201
  } else {
19202
19202
  let end = pos + next.length;
19203
- let result2 = f(next, pos);
19204
- if (result2 !== void 0)
19205
- return result2;
19203
+ let result = f(next, pos);
19204
+ if (result !== void 0)
19205
+ return result;
19206
19206
  pos = end + next.breakAfter;
19207
19207
  }
19208
19208
  }
@@ -20547,7 +20547,7 @@ class DocView {
20547
20547
  return scan(tile, offset);
20548
20548
  }
20549
20549
  measureVisibleLineHeights(viewport) {
20550
- let result2 = [], { from, to } = viewport;
20550
+ let result = [], { from, to } = viewport;
20551
20551
  let contentWidth = this.view.contentDOM.clientWidth;
20552
20552
  let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1;
20553
20553
  let widest = -1, ltr = this.view.textDirection == Direction.LTR;
@@ -20565,8 +20565,8 @@ class DocView {
20565
20565
  scan(child, pos, childRect);
20566
20566
  } else if (pos >= from) {
20567
20567
  if (spaceAbove > 0)
20568
- result2.push(-spaceAbove);
20569
- result2.push(height + spaceAbove);
20568
+ result.push(-spaceAbove);
20569
+ result.push(height + spaceAbove);
20570
20570
  spaceAbove = 0;
20571
20571
  if (isWider) {
20572
20572
  let last = child.dom.lastChild;
@@ -20589,7 +20589,7 @@ class DocView {
20589
20589
  }
20590
20590
  };
20591
20591
  scan(this.tile, 0, null);
20592
- return result2;
20592
+ return result;
20593
20593
  }
20594
20594
  textDirectionAt(pos) {
20595
20595
  let { tile } = this.tile.resolveBlock(pos, 1);
@@ -21609,16 +21609,16 @@ function findDiff(a, b, preferredPos, preferredSide) {
21609
21609
  return { from, toA, toB };
21610
21610
  }
21611
21611
  function selectionPoints(view) {
21612
- let result2 = [];
21612
+ let result = [];
21613
21613
  if (view.root.activeElement != view.contentDOM)
21614
- return result2;
21614
+ return result;
21615
21615
  let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange;
21616
21616
  if (anchorNode) {
21617
- result2.push(new DOMPoint(anchorNode, anchorOffset));
21617
+ result.push(new DOMPoint(anchorNode, anchorOffset));
21618
21618
  if (focusNode != anchorNode || focusOffset != anchorOffset)
21619
- result2.push(new DOMPoint(focusNode, focusOffset));
21619
+ result.push(new DOMPoint(focusNode, focusOffset));
21620
21620
  }
21621
- return result2;
21621
+ return result;
21622
21622
  }
21623
21623
  function selectionFromPoints(points, base2) {
21624
21624
  if (points.length == 0)
@@ -21781,9 +21781,9 @@ function bindHandler(plugin, handler) {
21781
21781
  };
21782
21782
  }
21783
21783
  function computeHandlers(plugins) {
21784
- let result2 = /* @__PURE__ */ Object.create(null);
21784
+ let result = /* @__PURE__ */ Object.create(null);
21785
21785
  function record2(type2) {
21786
- return result2[type2] || (result2[type2] = { observers: [], handlers: [] });
21786
+ return result[type2] || (result[type2] = { observers: [], handlers: [] });
21787
21787
  }
21788
21788
  for (let plugin of plugins) {
21789
21789
  let spec = plugin.spec, handlers2 = spec && spec.plugin.domEventHandlers, observers2 = spec && spec.plugin.domEventObservers;
@@ -21804,7 +21804,7 @@ function computeHandlers(plugins) {
21804
21804
  record2(type2).handlers.push(handlers[type2]);
21805
21805
  for (let type2 in observers)
21806
21806
  record2(type2).observers.push(observers[type2]);
21807
- return result2;
21807
+ return result;
21808
21808
  }
21809
21809
  const PendingKeys = [
21810
21810
  { key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" },
@@ -22547,11 +22547,11 @@ class HeightMap {
22547
22547
  return HeightMap.of(nodes);
22548
22548
  }
22549
22549
  // Again, these are base cases, and are overridden for branch and gap nodes.
22550
- decomposeLeft(_to, result2) {
22551
- result2.push(this);
22550
+ decomposeLeft(_to, result) {
22551
+ result.push(this);
22552
22552
  }
22553
- decomposeRight(_from, result2) {
22554
- result2.push(this);
22553
+ decomposeRight(_from, result) {
22554
+ result.push(this);
22555
22555
  }
22556
22556
  applyChanges(decorations2, oldDoc, oracle, changes) {
22557
22557
  let me = this, doc2 = oracle.doc;
@@ -22794,11 +22794,11 @@ class HeightMapGap extends HeightMap {
22794
22794
  }
22795
22795
  return HeightMap.of(nodes);
22796
22796
  }
22797
- decomposeLeft(to, result2) {
22798
- result2.push(new HeightMapGap(to - 1), null);
22797
+ decomposeLeft(to, result) {
22798
+ result.push(new HeightMapGap(to - 1), null);
22799
22799
  }
22800
- decomposeRight(from, result2) {
22801
- result2.push(null, new HeightMapGap(this.length - from - 1));
22800
+ decomposeRight(from, result) {
22801
+ result.push(null, new HeightMapGap(this.length - from - 1));
22802
22802
  }
22803
22803
  updateHeight(oracle, offset = 0, force = false, measured) {
22804
22804
  let end = offset + this.length;
@@ -22826,10 +22826,10 @@ class HeightMapGap extends HeightMap {
22826
22826
  }
22827
22827
  if (pos <= end)
22828
22828
  nodes.push(null, new HeightMapGap(end - pos).updateHeight(oracle, pos));
22829
- let result2 = HeightMap.of(nodes);
22830
- if (singleHeight < 0 || Math.abs(result2.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon)
22829
+ let result = HeightMap.of(nodes);
22830
+ if (singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon)
22831
22831
  heightChangeFlag = true;
22832
- return replace(this, result2);
22832
+ return replace(this, result);
22833
22833
  } else if (force || this.outdated) {
22834
22834
  this.setHeight(oracle.heightForGap(offset, offset + this.length));
22835
22835
  this.outdated = false;
@@ -22889,43 +22889,43 @@ class HeightMapBranch extends HeightMap {
22889
22889
  return this.balanced(this.left.replace(from, to, nodes), this.right);
22890
22890
  if (from > this.left.length)
22891
22891
  return this.balanced(this.left, this.right.replace(from - rightStart, to - rightStart, nodes));
22892
- let result2 = [];
22892
+ let result = [];
22893
22893
  if (from > 0)
22894
- this.decomposeLeft(from, result2);
22895
- let left = result2.length;
22894
+ this.decomposeLeft(from, result);
22895
+ let left = result.length;
22896
22896
  for (let node of nodes)
22897
- result2.push(node);
22897
+ result.push(node);
22898
22898
  if (from > 0)
22899
- mergeGaps(result2, left - 1);
22899
+ mergeGaps(result, left - 1);
22900
22900
  if (to < this.length) {
22901
- let right = result2.length;
22902
- this.decomposeRight(to, result2);
22903
- mergeGaps(result2, right);
22901
+ let right = result.length;
22902
+ this.decomposeRight(to, result);
22903
+ mergeGaps(result, right);
22904
22904
  }
22905
- return HeightMap.of(result2);
22905
+ return HeightMap.of(result);
22906
22906
  }
22907
- decomposeLeft(to, result2) {
22907
+ decomposeLeft(to, result) {
22908
22908
  let left = this.left.length;
22909
22909
  if (to <= left)
22910
- return this.left.decomposeLeft(to, result2);
22911
- result2.push(this.left);
22910
+ return this.left.decomposeLeft(to, result);
22911
+ result.push(this.left);
22912
22912
  if (this.break) {
22913
22913
  left++;
22914
22914
  if (to >= left)
22915
- result2.push(null);
22915
+ result.push(null);
22916
22916
  }
22917
22917
  if (to > left)
22918
- this.right.decomposeLeft(to - left, result2);
22918
+ this.right.decomposeLeft(to - left, result);
22919
22919
  }
22920
- decomposeRight(from, result2) {
22920
+ decomposeRight(from, result) {
22921
22921
  let left = this.left.length, right = left + this.break;
22922
22922
  if (from >= right)
22923
- return this.right.decomposeRight(from - right, result2);
22923
+ return this.right.decomposeRight(from - right, result);
22924
22924
  if (from < left)
22925
- this.left.decomposeRight(from, result2);
22925
+ this.left.decomposeRight(from, result);
22926
22926
  if (this.break && from < right)
22927
- result2.push(null);
22928
- result2.push(this.right);
22927
+ result.push(null);
22928
+ result.push(this.right);
22929
22929
  }
22930
22930
  balanced(left, right) {
22931
22931
  if (left.size > 2 * right.size || right.size > 2 * left.size)
@@ -23298,13 +23298,13 @@ class ViewState {
23298
23298
  let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;
23299
23299
  this.contentDOMHeight = domRect.height;
23300
23300
  this.mustMeasureContent = false;
23301
- let result2 = 0, bias = 0;
23301
+ let result = 0, bias = 0;
23302
23302
  if (domRect.width && domRect.height) {
23303
23303
  let { scaleX, scaleY } = getScale(dom, domRect);
23304
23304
  if (scaleX > 5e-3 && Math.abs(this.scaleX - scaleX) > 5e-3 || scaleY > 5e-3 && Math.abs(this.scaleY - scaleY) > 5e-3) {
23305
23305
  this.scaleX = scaleX;
23306
23306
  this.scaleY = scaleY;
23307
- result2 |= 16;
23307
+ result |= 16;
23308
23308
  refresh = measureContent = true;
23309
23309
  }
23310
23310
  }
@@ -23313,13 +23313,13 @@ class ViewState {
23313
23313
  if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) {
23314
23314
  this.paddingTop = paddingTop;
23315
23315
  this.paddingBottom = paddingBottom;
23316
- result2 |= 16 | 2;
23316
+ result |= 16 | 2;
23317
23317
  }
23318
23318
  if (this.editorWidth != view.scrollDOM.clientWidth) {
23319
23319
  if (oracle.lineWrapping)
23320
23320
  measureContent = true;
23321
23321
  this.editorWidth = view.scrollDOM.clientWidth;
23322
- result2 |= 16;
23322
+ result |= 16;
23323
23323
  }
23324
23324
  let scrollParent = scrollableParents(this.view.contentDOM, false).y;
23325
23325
  if (scrollParent != this.scrollParent) {
@@ -23348,7 +23348,7 @@ class ViewState {
23348
23348
  if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
23349
23349
  this.contentDOMWidth = domRect.width;
23350
23350
  this.editorHeight = view.scrollDOM.clientHeight;
23351
- result2 |= 16;
23351
+ result |= 16;
23352
23352
  }
23353
23353
  if (measureContent) {
23354
23354
  let lineHeights = view.docView.measureVisibleLineHeights(this.viewport);
@@ -23359,7 +23359,7 @@ class ViewState {
23359
23359
  refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, Math.max(5, contentWidth / charWidth), lineHeights);
23360
23360
  if (refresh) {
23361
23361
  view.docView.minWidth = 0;
23362
- result2 |= 16;
23362
+ result |= 16;
23363
23363
  }
23364
23364
  }
23365
23365
  if (dTop > 0 && dBottom > 0)
@@ -23372,25 +23372,25 @@ class ViewState {
23372
23372
  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));
23373
23373
  }
23374
23374
  if (heightChangeFlag)
23375
- result2 |= 2;
23375
+ result |= 2;
23376
23376
  }
23377
23377
  let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to);
23378
23378
  if (viewportChange) {
23379
- if (result2 & 2)
23380
- result2 |= this.updateScaler();
23379
+ if (result & 2)
23380
+ result |= this.updateScaler();
23381
23381
  this.viewport = this.getViewport(bias, this.scrollTarget);
23382
- result2 |= this.updateForViewport();
23382
+ result |= this.updateForViewport();
23383
23383
  }
23384
- if (result2 & 2 || viewportChange)
23384
+ if (result & 2 || viewportChange)
23385
23385
  this.updateViewportLines();
23386
23386
  if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
23387
23387
  this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps, view));
23388
- result2 |= this.computeVisibleRanges();
23388
+ result |= this.computeVisibleRanges();
23389
23389
  if (this.mustEnforceCursorAssoc) {
23390
23390
  this.mustEnforceCursorAssoc = false;
23391
23391
  view.docView.enforceCursorAssoc();
23392
23392
  }
23393
- return result2;
23393
+ return result;
23394
23394
  }
23395
23395
  get visibleTop() {
23396
23396
  return this.scaler.fromDOM(this.pixelViewport.top);
@@ -25587,10 +25587,10 @@ class EditorView {
25587
25587
  */
25588
25588
  static theme(spec, options) {
25589
25589
  let prefix = StyleModule.newName();
25590
- let result2 = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];
25590
+ let result = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];
25591
25591
  if (options && options.dark)
25592
- result2.push(darkTheme.of(true));
25593
- return result2;
25592
+ result.push(darkTheme.of(true));
25593
+ return result;
25594
25594
  }
25595
25595
  /**
25596
25596
  Create an extension that adds styles to the base theme. Like
@@ -25664,13 +25664,13 @@ class CachedOrder {
25664
25664
  static update(cache2, changes) {
25665
25665
  if (changes.empty && !cache2.some((c) => c.fresh))
25666
25666
  return cache2;
25667
- let result2 = [], lastDir = cache2.length ? cache2[cache2.length - 1].dir : Direction.LTR;
25667
+ let result = [], lastDir = cache2.length ? cache2[cache2.length - 1].dir : Direction.LTR;
25668
25668
  for (let i = Math.max(0, cache2.length - 10); i < cache2.length; i++) {
25669
25669
  let entry = cache2[i];
25670
25670
  if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to))
25671
- result2.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));
25671
+ result.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));
25672
25672
  }
25673
- return result2;
25673
+ return result;
25674
25674
  }
25675
25675
  }
25676
25676
  function attrsFromFacet(view, facet, base2) {
@@ -25684,9 +25684,9 @@ function attrsFromFacet(view, facet, base2) {
25684
25684
  const currentPlatform = browser.mac ? "mac" : browser.windows ? "win" : browser.linux ? "linux" : "key";
25685
25685
  function normalizeKeyName(name2, platform) {
25686
25686
  const parts = name2.split(/-(?!$)/);
25687
- let result2 = parts[parts.length - 1];
25688
- if (result2 == "Space")
25689
- result2 = " ";
25687
+ let result = parts[parts.length - 1];
25688
+ if (result == "Space")
25689
+ result = " ";
25690
25690
  let alt, ctrl, shift2, meta2;
25691
25691
  for (let i = 0; i < parts.length - 1; ++i) {
25692
25692
  const mod = parts[i];
@@ -25707,14 +25707,14 @@ function normalizeKeyName(name2, platform) {
25707
25707
  throw new Error("Unrecognized modifier name: " + mod);
25708
25708
  }
25709
25709
  if (alt)
25710
- result2 = "Alt-" + result2;
25710
+ result = "Alt-" + result;
25711
25711
  if (ctrl)
25712
- result2 = "Ctrl-" + result2;
25712
+ result = "Ctrl-" + result;
25713
25713
  if (meta2)
25714
- result2 = "Meta-" + result2;
25714
+ result = "Meta-" + result;
25715
25715
  if (shift2)
25716
- result2 = "Shift-" + result2;
25717
- return result2;
25716
+ result = "Shift-" + result;
25717
+ return result;
25718
25718
  }
25719
25719
  function modifiers(name2, event, shift2) {
25720
25720
  if (event.altKey)
@@ -26301,16 +26301,16 @@ function matchRanges(view, maxLength) {
26301
26301
  let visible = view.visibleRanges;
26302
26302
  if (visible.length == 1 && visible[0].from == view.viewport.from && visible[0].to == view.viewport.to)
26303
26303
  return visible;
26304
- let result2 = [];
26304
+ let result = [];
26305
26305
  for (let { from, to } of visible) {
26306
26306
  from = Math.max(view.state.doc.lineAt(from).from, from - maxLength);
26307
26307
  to = Math.min(view.state.doc.lineAt(to).to, to + maxLength);
26308
- if (result2.length && result2[result2.length - 1].to >= from)
26309
- result2[result2.length - 1].to = to;
26308
+ if (result.length && result[result.length - 1].to >= from)
26309
+ result[result.length - 1].to = to;
26310
26310
  else
26311
- result2.push({ from, to });
26311
+ result.push({ from, to });
26312
26312
  }
26313
- return result2;
26313
+ return result;
26314
26314
  }
26315
26315
  class MatchDecorator {
26316
26316
  /**
@@ -27108,10 +27108,10 @@ class HoverPlugin {
27108
27108
  };
27109
27109
  if (open && "then" in open) {
27110
27110
  let pending = this.pending = { pos };
27111
- open.then((result2) => {
27111
+ open.then((result) => {
27112
27112
  if (this.pending == pending) {
27113
27113
  this.pending = null;
27114
- done(result2);
27114
+ done(result);
27115
27115
  }
27116
27116
  }, (e) => logException(view.state, e, "hover tooltip"));
27117
27117
  } else {
@@ -27455,7 +27455,7 @@ const dialogField = /* @__PURE__ */ StateField.define({
27455
27455
  });
27456
27456
  const openDialogEffect = /* @__PURE__ */ StateEffect.define();
27457
27457
  const closeDialogEffect = /* @__PURE__ */ StateEffect.define();
27458
- function createDialog(view, config2, result2) {
27458
+ function createDialog(view, config2, result) {
27459
27459
  let content2 = config2.content ? config2.content(view, () => done(null)) : null;
27460
27460
  if (!content2) {
27461
27461
  content2 = crelt("form");
@@ -27501,7 +27501,7 @@ function createDialog(view, config2, result2) {
27501
27501
  function done(form) {
27502
27502
  if (panel.contains(panel.ownerDocument.activeElement))
27503
27503
  view.focus();
27504
- result2(form);
27504
+ result(form);
27505
27505
  }
27506
27506
  return {
27507
27507
  dom: panel,
@@ -27553,10 +27553,10 @@ const unfixGutters = /* @__PURE__ */ Facet.define({
27553
27553
  combine: (values) => values.some((x) => x)
27554
27554
  });
27555
27555
  function gutters(config2) {
27556
- let result2 = [
27556
+ let result = [
27557
27557
  gutterView
27558
27558
  ];
27559
- return result2;
27559
+ return result;
27560
27560
  }
27561
27561
  const gutterView = /* @__PURE__ */ ViewPlugin.fromClass(class {
27562
27562
  constructor(view) {
@@ -27890,12 +27890,12 @@ const lineNumberConfig = /* @__PURE__ */ Facet.define({
27890
27890
  combine(values) {
27891
27891
  return combineConfig(values, { formatNumber: String, domEventHandlers: {} }, {
27892
27892
  domEventHandlers(a, b) {
27893
- let result2 = Object.assign({}, a);
27893
+ let result = Object.assign({}, a);
27894
27894
  for (let event in b) {
27895
- let exists = result2[event], add2 = b[event];
27896
- result2[event] = exists ? (view, line, event2) => exists(view, line, event2) || add2(view, line, event2) : add2;
27895
+ let exists = result[event], add2 = b[event];
27896
+ result[event] = exists ? (view, line, event2) => exists(view, line, event2) || add2(view, line, event2) : add2;
27897
27897
  }
27898
- return result2;
27898
+ return result;
27899
27899
  }
27900
27900
  });
27901
27901
  }
@@ -27928,9 +27928,9 @@ const lineNumberGutter = /* @__PURE__ */ activeGutters.compute([lineNumberConfig
27928
27928
  },
27929
27929
  widgetMarker: (view, widget, block) => {
27930
27930
  for (let m of view.state.facet(lineNumberWidgetMarker)) {
27931
- let result2 = m(view, widget, block);
27932
- if (result2)
27933
- return result2;
27931
+ let result = m(view, widget, block);
27932
+ if (result)
27933
+ return result;
27934
27934
  }
27935
27935
  return null;
27936
27936
  },
@@ -28013,8 +28013,8 @@ class NodeProp {
28013
28013
  if (typeof match != "function")
28014
28014
  match = NodeType.match(match);
28015
28015
  return (type2) => {
28016
- let result2 = match(type2);
28017
- return result2 === void 0 ? null : [this, result2];
28016
+ let result = match(type2);
28017
+ return result === void 0 ? null : [this, result];
28018
28018
  };
28019
28019
  }
28020
28020
  }
@@ -28332,11 +28332,11 @@ class Tree {
28332
28332
  constructor.
28333
28333
  */
28334
28334
  get propValues() {
28335
- let result2 = [];
28335
+ let result = [];
28336
28336
  if (this.props)
28337
28337
  for (let id2 in this.props)
28338
- result2.push([+id2, this.props[id2]]);
28339
- return result2;
28338
+ result.push([+id2, this.props[id2]]);
28339
+ return result;
28340
28340
  }
28341
28341
  /**
28342
28342
  Balance the direct children of this tree, producing a copy of
@@ -28401,30 +28401,30 @@ class TreeBuffer {
28401
28401
  @internal
28402
28402
  */
28403
28403
  toString() {
28404
- let result2 = [];
28404
+ let result = [];
28405
28405
  for (let index = 0; index < this.buffer.length; ) {
28406
- result2.push(this.childString(index));
28406
+ result.push(this.childString(index));
28407
28407
  index = this.buffer[index + 3];
28408
28408
  }
28409
- return result2.join(",");
28409
+ return result.join(",");
28410
28410
  }
28411
28411
  /**
28412
28412
  @internal
28413
28413
  */
28414
28414
  childString(index) {
28415
28415
  let id2 = this.buffer[index], endIndex = this.buffer[index + 3];
28416
- let type2 = this.set.types[id2], result2 = type2.name;
28417
- if (/\W/.test(result2) && !type2.isError)
28418
- result2 = JSON.stringify(result2);
28416
+ let type2 = this.set.types[id2], result = type2.name;
28417
+ if (/\W/.test(result) && !type2.isError)
28418
+ result = JSON.stringify(result);
28419
28419
  index += 4;
28420
28420
  if (endIndex == index)
28421
- return result2;
28421
+ return result;
28422
28422
  let children = [];
28423
28423
  while (index < endIndex) {
28424
28424
  children.push(this.childString(index));
28425
28425
  index = this.buffer[index + 3];
28426
28426
  }
28427
- return result2 + "(" + children.join(",") + ")";
28427
+ return result + "(" + children.join(",") + ")";
28428
28428
  }
28429
28429
  /**
28430
28430
  @internal
@@ -28674,22 +28674,22 @@ class TreeNode extends BaseNode {
28674
28674
  }
28675
28675
  }
28676
28676
  function getChildren(node, type2, before, after) {
28677
- let cur2 = node.cursor(), result2 = [];
28677
+ let cur2 = node.cursor(), result = [];
28678
28678
  if (!cur2.firstChild())
28679
- return result2;
28679
+ return result;
28680
28680
  if (before != null)
28681
28681
  for (let found = false; !found; ) {
28682
28682
  found = cur2.type.is(before);
28683
28683
  if (!cur2.nextSibling())
28684
- return result2;
28684
+ return result;
28685
28685
  }
28686
28686
  for (; ; ) {
28687
28687
  if (after != null && cur2.type.is(after))
28688
- return result2;
28688
+ return result;
28689
28689
  if (cur2.type.is(type2))
28690
- result2.push(cur2.node);
28690
+ result.push(cur2.node);
28691
28691
  if (!cur2.nextSibling())
28692
- return after == null ? result2 : [];
28692
+ return after == null ? result : [];
28693
28693
  }
28694
28694
  }
28695
28695
  function matchNodeContext(node, context, i = context.length - 1) {
@@ -29136,14 +29136,14 @@ class TreeCursor {
29136
29136
  get node() {
29137
29137
  if (!this.buffer)
29138
29138
  return this._tree;
29139
- let cache2 = this.bufferNode, result2 = null, depth = 0;
29139
+ let cache2 = this.bufferNode, result = null, depth = 0;
29140
29140
  if (cache2 && cache2.context == this.buffer) {
29141
29141
  scan: for (let index = this.index, d = this.stack.length; d >= 0; ) {
29142
29142
  for (let c = cache2; c; c = c._parent)
29143
29143
  if (c.index == index) {
29144
29144
  if (index == this.index)
29145
29145
  return c;
29146
- result2 = c;
29146
+ result = c;
29147
29147
  depth = d + 1;
29148
29148
  break scan;
29149
29149
  }
@@ -29151,8 +29151,8 @@ class TreeCursor {
29151
29151
  }
29152
29152
  }
29153
29153
  for (let i = depth; i < this.stack.length; i++)
29154
- result2 = new BufferNode(this.buffer, result2, this.stack[i]);
29155
- return this.bufferNode = new BufferNode(this.buffer, result2, this.index);
29154
+ result = new BufferNode(this.buffer, result, this.stack[i]);
29155
+ return this.bufferNode = new BufferNode(this.buffer, result, this.index);
29156
29156
  }
29157
29157
  /**
29158
29158
  Get the [tree](#common.Tree) that represents the current node, if
@@ -29352,13 +29352,13 @@ function buildTree(data) {
29352
29352
  function findBufferSize(maxSize, inRepeat) {
29353
29353
  let fork = cursor.fork();
29354
29354
  let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength;
29355
- let result2 = { size: 0, start: 0, skip: 0 };
29355
+ let result = { size: 0, start: 0, skip: 0 };
29356
29356
  scan: for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) {
29357
29357
  let nodeSize2 = fork.size;
29358
29358
  if (fork.id == inRepeat && nodeSize2 >= 0) {
29359
- result2.size = size;
29360
- result2.start = start;
29361
- result2.skip = skip;
29359
+ result.size = size;
29360
+ result.start = start;
29361
+ result.skip = skip;
29362
29362
  skip += 4;
29363
29363
  size += 4;
29364
29364
  fork.next();
@@ -29386,11 +29386,11 @@ function buildTree(data) {
29386
29386
  skip += localSkipped;
29387
29387
  }
29388
29388
  if (inRepeat < 0 || size == maxSize) {
29389
- result2.size = size;
29390
- result2.start = start;
29391
- result2.skip = skip;
29389
+ result.size = size;
29390
+ result.start = start;
29391
+ result.skip = skip;
29392
29392
  }
29393
- return result2.size > 4 ? result2 : void 0;
29393
+ return result.size > 4 ? result : void 0;
29394
29394
  }
29395
29395
  function copyToBuffer(bufferStart, buffer2, index) {
29396
29396
  let { id: id2, start, end, size } = cursor;
@@ -29558,11 +29558,11 @@ class TreeFragment {
29558
29558
  true.
29559
29559
  */
29560
29560
  static addTree(tree, fragments = [], partial2 = false) {
29561
- let result2 = [new TreeFragment(0, tree.length, tree, 0, false, partial2)];
29561
+ let result = [new TreeFragment(0, tree.length, tree, 0, false, partial2)];
29562
29562
  for (let f of fragments)
29563
29563
  if (f.to > tree.length)
29564
- result2.push(f);
29565
- return result2;
29564
+ result.push(f);
29565
+ return result;
29566
29566
  }
29567
29567
  /**
29568
29568
  Apply a set of edits to an array of fragments, removing or
@@ -29572,7 +29572,7 @@ class TreeFragment {
29572
29572
  static applyChanges(fragments, changes, minGap = 128) {
29573
29573
  if (!changes.length)
29574
29574
  return fragments;
29575
- let result2 = [];
29575
+ let result = [];
29576
29576
  let fI = 1, nextF = fragments.length ? fragments[0] : null;
29577
29577
  for (let cI = 0, pos = 0, off = 0; ; cI++) {
29578
29578
  let nextC = cI < changes.length ? changes[cI] : null;
@@ -29585,7 +29585,7 @@ class TreeFragment {
29585
29585
  cut = fFrom >= fTo ? null : new TreeFragment(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC);
29586
29586
  }
29587
29587
  if (cut)
29588
- result2.push(cut);
29588
+ result.push(cut);
29589
29589
  if (nextF.to > nextPos)
29590
29590
  break;
29591
29591
  nextF = fI < fragments.length ? fragments[fI++] : null;
@@ -29595,7 +29595,7 @@ class TreeFragment {
29595
29595
  pos = nextC.toA;
29596
29596
  off = nextC.toA - nextC.toB;
29597
29597
  }
29598
- return result2;
29598
+ return result;
29599
29599
  }
29600
29600
  }
29601
29601
  class Parser {
@@ -29850,13 +29850,13 @@ function tagHighlighter(tags2, options) {
29850
29850
  };
29851
29851
  }
29852
29852
  function highlightTags(highlighters, tags2) {
29853
- let result2 = null;
29853
+ let result = null;
29854
29854
  for (let highlighter of highlighters) {
29855
29855
  let value = highlighter.style(tags2);
29856
29856
  if (value)
29857
- result2 = result2 ? result2 + " " + value : value;
29857
+ result = result ? result + " " + value : value;
29858
29858
  }
29859
- return result2;
29859
+ return result;
29860
29860
  }
29861
29861
  function highlightTree(tree, highlighter, putStyle, from = 0, to = tree.length) {
29862
29862
  let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);
@@ -30414,10 +30414,10 @@ class Language {
30414
30414
  return [{ from: 0, to: state.doc.length }];
30415
30415
  if (!lang || !lang.allowsNesting)
30416
30416
  return [];
30417
- let result2 = [];
30417
+ let result = [];
30418
30418
  let explore = (tree, from) => {
30419
30419
  if (tree.prop(languageDataProp) == this.data) {
30420
- result2.push({ from, to: from + tree.length });
30420
+ result.push({ from, to: from + tree.length });
30421
30421
  return;
30422
30422
  }
30423
30423
  let mount = tree.prop(NodeProp.mounted);
@@ -30425,14 +30425,14 @@ class Language {
30425
30425
  if (mount.tree.prop(languageDataProp) == this.data) {
30426
30426
  if (mount.overlay)
30427
30427
  for (let r of mount.overlay)
30428
- result2.push({ from: r.from + from, to: r.to + from });
30428
+ result.push({ from: r.from + from, to: r.to + from });
30429
30429
  else
30430
- result2.push({ from, to: from + tree.length });
30430
+ result.push({ from, to: from + tree.length });
30431
30431
  return;
30432
30432
  } else if (mount.overlay) {
30433
- let size = result2.length;
30433
+ let size = result.length;
30434
30434
  explore(mount.tree, mount.overlay[0].from + from);
30435
- if (result2.length > size)
30435
+ if (result.length > size)
30436
30436
  return;
30437
30437
  }
30438
30438
  }
@@ -30443,7 +30443,7 @@ class Language {
30443
30443
  }
30444
30444
  };
30445
30445
  explore(syntaxTree(state), 0);
30446
- return result2;
30446
+ return result;
30447
30447
  }
30448
30448
  /**
30449
30449
  Indicates whether this language allows nested languages. The
@@ -30902,25 +30902,25 @@ function getIndentUnit(state) {
30902
30902
  return unit.charCodeAt(0) == 9 ? state.tabSize * unit.length : unit.length;
30903
30903
  }
30904
30904
  function indentString(state, cols) {
30905
- let result2 = "", ts = state.tabSize, ch = state.facet(indentUnit)[0];
30905
+ let result = "", ts = state.tabSize, ch = state.facet(indentUnit)[0];
30906
30906
  if (ch == " ") {
30907
30907
  while (cols >= ts) {
30908
- result2 += " ";
30908
+ result += " ";
30909
30909
  cols -= ts;
30910
30910
  }
30911
30911
  ch = " ";
30912
30912
  }
30913
30913
  for (let i = 0; i < cols; i++)
30914
- result2 += ch;
30915
- return result2;
30914
+ result += ch;
30915
+ return result;
30916
30916
  }
30917
30917
  function getIndentation(context, pos) {
30918
30918
  if (context instanceof EditorState)
30919
30919
  context = new IndentContext(context);
30920
30920
  for (let service of context.state.facet(indentService)) {
30921
- let result2 = service(context, pos);
30922
- if (result2 !== void 0)
30923
- return result2;
30921
+ let result = service(context, pos);
30922
+ if (result !== void 0)
30923
+ return result;
30924
30924
  }
30925
30925
  let tree = syntaxTree(context.state);
30926
30926
  return tree.length >= pos ? syntaxIndentation(context, tree, pos) : null;
@@ -30970,11 +30970,11 @@ class IndentContext {
30970
30970
  */
30971
30971
  column(pos, bias = 1) {
30972
30972
  let { text, from } = this.lineAt(pos, bias);
30973
- let result2 = this.countColumn(text, pos - from);
30973
+ let result = this.countColumn(text, pos - from);
30974
30974
  let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;
30975
30975
  if (override > -1)
30976
- result2 += override - this.countColumn(text, text.search(/\S|$/));
30977
- return result2;
30976
+ result += override - this.countColumn(text, text.search(/\S|$/));
30977
+ return result;
30978
30978
  }
30979
30979
  /**
30980
30980
  Find the column position (taking tabs into account) of the given
@@ -31852,9 +31852,9 @@ class HistEvent {
31852
31852
  static fromTransaction(tr, selection) {
31853
31853
  let effects = none$1;
31854
31854
  for (let invert of tr.startState.facet(invertedEffects)) {
31855
- let result2 = invert(tr);
31856
- if (result2.length)
31857
- effects = effects.concat(result2);
31855
+ let result = invert(tr);
31856
+ if (result.length)
31857
+ effects = effects.concat(result);
31858
31858
  }
31859
31859
  if (!effects.length && tr.changes.empty)
31860
31860
  return null;
@@ -31915,9 +31915,9 @@ function addMappingToBranch(branch, mapping) {
31915
31915
  while (length) {
31916
31916
  let event = mapEvent(branch[length - 1], mapping, selections);
31917
31917
  if (event.changes && !event.changes.empty || event.effects.length) {
31918
- let result2 = branch.slice(0, length);
31919
- result2[length - 1] = event;
31920
- return result2;
31918
+ let result = branch.slice(0, length);
31919
+ result[length - 1] = event;
31920
+ return result;
31921
31921
  } else {
31922
31922
  mapping = event.mapped;
31923
31923
  length--;
@@ -32933,13 +32933,13 @@ function toCharEnd(text, pos) {
32933
32933
  const gotoLine = (view) => {
32934
32934
  let { state } = view;
32935
32935
  let line = String(state.doc.lineAt(view.state.selection.main.head).number);
32936
- let { close, result: result2 } = showDialog(view, {
32936
+ let { close, result } = showDialog(view, {
32937
32937
  label: state.phrase("Go to line"),
32938
32938
  input: { type: "text", name: "line", value: line },
32939
32939
  focus: true,
32940
32940
  submitLabel: state.phrase("go")
32941
32941
  });
32942
- result2.then((form) => {
32942
+ result.then((form) => {
32943
32943
  let match = form && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(form.elements["line"].value);
32944
32944
  if (!match) {
32945
32945
  view.dispatch({ effects: close });
@@ -33286,16 +33286,16 @@ class RegExpQuery extends QueryType {
33286
33286
  prevMatch(state, curFrom, curTo) {
33287
33287
  return this.prevMatchInRange(state, 0, curFrom) || this.prevMatchInRange(state, curTo, state.doc.length);
33288
33288
  }
33289
- getReplacement(result2) {
33289
+ getReplacement(result) {
33290
33290
  return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (m, i) => {
33291
33291
  if (i == "&")
33292
- return result2.match[0];
33292
+ return result.match[0];
33293
33293
  if (i == "$")
33294
33294
  return "$";
33295
33295
  for (let l = i.length; l > 0; l--) {
33296
33296
  let n = +i.slice(0, l);
33297
- if (n > 0 && n < result2.match.length)
33298
- return result2.match[n] + i.slice(l);
33297
+ if (n > 0 && n < result.match.length)
33298
+ return result.match[n] + i.slice(l);
33299
33299
  }
33300
33300
  return m;
33301
33301
  });
@@ -34016,8 +34016,8 @@ class Stack {
34016
34016
  }
34017
34017
  nextStates = best;
34018
34018
  }
34019
- let result2 = [];
34020
- for (let i = 0; i < nextStates.length && result2.length < 4; i += 2) {
34019
+ let result = [];
34020
+ for (let i = 0; i < nextStates.length && result.length < 4; i += 2) {
34021
34021
  let s = nextStates[i + 1];
34022
34022
  if (s == this.state)
34023
34023
  continue;
@@ -34027,9 +34027,9 @@ class Stack {
34027
34027
  stack.shiftContext(nextStates[i], this.pos);
34028
34028
  stack.reducePos = this.pos;
34029
34029
  stack.score -= 200;
34030
- result2.push(stack);
34030
+ result.push(stack);
34031
34031
  }
34032
- return result2;
34032
+ return result;
34033
34033
  }
34034
34034
  // Force a reduce, if possible. Return false if that can't
34035
34035
  // be done.
@@ -34390,17 +34390,17 @@ class InputStream {
34390
34390
  units, since the library does not track lookbehind.
34391
34391
  */
34392
34392
  peek(offset) {
34393
- let idx = this.chunkOff + offset, pos, result2;
34393
+ let idx = this.chunkOff + offset, pos, result;
34394
34394
  if (idx >= 0 && idx < this.chunk.length) {
34395
34395
  pos = this.pos + offset;
34396
- result2 = this.chunk.charCodeAt(idx);
34396
+ result = this.chunk.charCodeAt(idx);
34397
34397
  } else {
34398
34398
  let resolved = this.resolveOffset(offset, 1);
34399
34399
  if (resolved == null)
34400
34400
  return -1;
34401
34401
  pos = resolved;
34402
34402
  if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {
34403
- result2 = this.chunk2.charCodeAt(pos - this.chunk2Pos);
34403
+ result = this.chunk2.charCodeAt(pos - this.chunk2Pos);
34404
34404
  } else {
34405
34405
  let i = this.rangeIndex, range = this.range;
34406
34406
  while (range.to <= pos)
@@ -34408,12 +34408,12 @@ class InputStream {
34408
34408
  this.chunk2 = this.input.chunk(this.chunk2Pos = pos);
34409
34409
  if (pos + this.chunk2.length > range.to)
34410
34410
  this.chunk2 = this.chunk2.slice(0, range.to - pos);
34411
- result2 = this.chunk2.charCodeAt(0);
34411
+ result = this.chunk2.charCodeAt(0);
34412
34412
  }
34413
34413
  }
34414
34414
  if (pos >= this.token.lookAhead)
34415
34415
  this.token.lookAhead = pos + 1;
34416
- return result2;
34416
+ return result;
34417
34417
  }
34418
34418
  /**
34419
34419
  Accept a token. By default, the end of the token is set to the
@@ -34526,14 +34526,14 @@ class InputStream {
34526
34526
  return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);
34527
34527
  if (from >= this.range.from && to <= this.range.to)
34528
34528
  return this.input.read(from, to);
34529
- let result2 = "";
34529
+ let result = "";
34530
34530
  for (let r of this.ranges) {
34531
34531
  if (r.from >= to)
34532
34532
  break;
34533
34533
  if (r.to > from)
34534
- result2 += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
34534
+ result += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
34535
34535
  }
34536
- return result2;
34536
+ return result;
34537
34537
  }
34538
34538
  }
34539
34539
  class TokenGroup {
@@ -34816,12 +34816,12 @@ class TokenCache {
34816
34816
  let { parser: parser2 } = stack.p;
34817
34817
  for (let i = 0; i < parser2.specialized.length; i++)
34818
34818
  if (parser2.specialized[i] == token.value) {
34819
- let result2 = parser2.specializers[i](this.stream.read(token.start, token.end), stack);
34820
- if (result2 >= 0 && stack.p.parser.dialect.allows(result2 >> 1)) {
34821
- if ((result2 & 1) == 0)
34822
- token.value = result2 >> 1;
34819
+ let result = parser2.specializers[i](this.stream.read(token.start, token.end), stack);
34820
+ if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {
34821
+ if ((result & 1) == 0)
34822
+ token.value = result >> 1;
34823
34823
  else
34824
- token.extended = result2 >> 1;
34824
+ token.extended = result >> 1;
34825
34825
  break;
34826
34826
  }
34827
34827
  }
@@ -35323,28 +35323,28 @@ class LRParser extends Parser {
35323
35323
  4
35324
35324
  /* ParseState.DefaultReduce */
35325
35325
  );
35326
- let result2 = deflt ? action(deflt) : void 0;
35326
+ let result = deflt ? action(deflt) : void 0;
35327
35327
  for (let i = this.stateSlot(
35328
35328
  state,
35329
35329
  1
35330
35330
  /* ParseState.Actions */
35331
- ); result2 == null; i += 3) {
35331
+ ); result == null; i += 3) {
35332
35332
  if (this.data[i] == 65535) {
35333
35333
  if (this.data[i + 1] == 1)
35334
35334
  i = pair(this.data, i + 2);
35335
35335
  else
35336
35336
  break;
35337
35337
  }
35338
- result2 = action(pair(this.data, i + 1));
35338
+ result = action(pair(this.data, i + 1));
35339
35339
  }
35340
- return result2;
35340
+ return result;
35341
35341
  }
35342
35342
  /**
35343
35343
  Get the states that can follow this one through shift actions or
35344
35344
  goto jumps. @internal
35345
35345
  */
35346
35346
  nextStates(state) {
35347
- let result2 = [];
35347
+ let result = [];
35348
35348
  for (let i = this.stateSlot(
35349
35349
  state,
35350
35350
  1
@@ -35358,11 +35358,11 @@ class LRParser extends Parser {
35358
35358
  }
35359
35359
  if ((this.data[i + 2] & 65536 >> 16) == 0) {
35360
35360
  let value = this.data[i + 1];
35361
- if (!result2.some((v, i2) => i2 & 1 && v == value))
35362
- result2.push(this.data[i], value);
35361
+ if (!result.some((v, i2) => i2 & 1 && v == value))
35362
+ result.push(this.data[i], value);
35363
35363
  }
35364
35364
  }
35365
- return result2;
35365
+ return result;
35366
35366
  }
35367
35367
  /**
35368
35368
  Configure the parser. Returns a new parser instance that has the
@@ -35937,17 +35937,17 @@ class FuzzyMatcher {
35937
35937
  return chars.length == 2 ? null : this.result((any[0] ? -700 : 0) + -200 + -1100, any, word);
35938
35938
  }
35939
35939
  result(score2, positions, word) {
35940
- let result2 = [], i = 0;
35940
+ let result = [], i = 0;
35941
35941
  for (let pos of positions) {
35942
35942
  let to = pos + (this.astral ? codePointSize(codePointAt(word, pos)) : 1);
35943
- if (i && result2[i - 1] == pos)
35944
- result2[i - 1] = to;
35943
+ if (i && result[i - 1] == pos)
35944
+ result[i - 1] = to;
35945
35945
  else {
35946
- result2[i++] = pos;
35947
- result2[i++] = to;
35946
+ result[i++] = pos;
35947
+ result[i++] = to;
35948
35948
  }
35949
35949
  }
35950
- return this.ret(score2 - word.length, result2);
35950
+ return this.ret(score2 - word.length, result);
35951
35951
  }
35952
35952
  }
35953
35953
  class StrictMatcher {
@@ -36405,17 +36405,17 @@ function sortOptions(active, state) {
36405
36405
  option.score += sectionOrder[typeof section == "string" ? section : section.name];
36406
36406
  }
36407
36407
  }
36408
- let result2 = [], prev = null;
36408
+ let result = [], prev = null;
36409
36409
  let compare2 = conf.compareCompletions;
36410
36410
  for (let opt of options.sort((a, b) => b.score - a.score || compare2(a.completion, b.completion))) {
36411
36411
  let cur2 = opt.completion;
36412
36412
  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)
36413
- result2.push(opt);
36413
+ result.push(opt);
36414
36414
  else if (score(opt.completion) > score(prev))
36415
- result2[result2.length - 1] = opt;
36415
+ result[result.length - 1] = opt;
36416
36416
  prev = opt.completion;
36417
36417
  }
36418
- return result2;
36418
+ return result;
36419
36419
  }
36420
36420
  class CompletionDialog {
36421
36421
  constructor(options, attrs, tooltip, timestamp, selected, disabled) {
@@ -36527,14 +36527,14 @@ const baseAttrs = {
36527
36527
  };
36528
36528
  const noAttrs = {};
36529
36529
  function makeAttrs(id2, selected) {
36530
- let result2 = {
36530
+ let result = {
36531
36531
  "aria-autocomplete": "list",
36532
36532
  "aria-haspopup": "listbox",
36533
36533
  "aria-controls": id2
36534
36534
  };
36535
36535
  if (selected > -1)
36536
- result2["aria-activedescendant"] = id2 + "-" + selected;
36537
- return result2;
36536
+ result["aria-activedescendant"] = id2 + "-" + selected;
36537
+ return result;
36538
36538
  }
36539
36539
  const none = [];
36540
36540
  function getUpdateType(tr, conf) {
@@ -36601,10 +36601,10 @@ class ActiveSource {
36601
36601
  }
36602
36602
  }
36603
36603
  class ActiveResult extends ActiveSource {
36604
- constructor(source, explicit, limit2, result2, from, to) {
36604
+ constructor(source, explicit, limit2, result, from, to) {
36605
36605
  super(source, 3, explicit);
36606
36606
  this.limit = limit2;
36607
- this.result = result2;
36607
+ this.result = result;
36608
36608
  this.from = from;
36609
36609
  this.to = to;
36610
36610
  }
@@ -36615,29 +36615,29 @@ class ActiveResult extends ActiveSource {
36615
36615
  var _a2;
36616
36616
  if (!(type2 & 3))
36617
36617
  return this.map(tr.changes);
36618
- let result2 = this.result;
36619
- if (result2.map && !tr.changes.empty)
36620
- result2 = result2.map(result2, tr.changes);
36618
+ let result = this.result;
36619
+ if (result.map && !tr.changes.empty)
36620
+ result = result.map(result, tr.changes);
36621
36621
  let from = tr.changes.mapPos(this.from), to = tr.changes.mapPos(this.to, 1);
36622
36622
  let pos = cur(tr.state);
36623
- if (pos > to || !result2 || type2 & 2 && (cur(tr.startState) == this.from || pos < this.limit))
36623
+ if (pos > to || !result || type2 & 2 && (cur(tr.startState) == this.from || pos < this.limit))
36624
36624
  return new ActiveSource(
36625
36625
  this.source,
36626
36626
  type2 & 4 ? 1 : 0
36627
36627
  /* State.Inactive */
36628
36628
  );
36629
36629
  let limit2 = tr.changes.mapPos(this.limit);
36630
- if (checkValid(result2.validFor, tr.state, from, to))
36631
- return new ActiveResult(this.source, this.explicit, limit2, result2, from, to);
36632
- if (result2.update && (result2 = result2.update(result2, from, to, new CompletionContext(tr.state, pos, false))))
36633
- return new ActiveResult(this.source, this.explicit, limit2, result2, result2.from, (_a2 = result2.to) !== null && _a2 !== void 0 ? _a2 : cur(tr.state));
36630
+ if (checkValid(result.validFor, tr.state, from, to))
36631
+ return new ActiveResult(this.source, this.explicit, limit2, result, from, to);
36632
+ if (result.update && (result = result.update(result, from, to, new CompletionContext(tr.state, pos, false))))
36633
+ return new ActiveResult(this.source, this.explicit, limit2, result, result.from, (_a2 = result.to) !== null && _a2 !== void 0 ? _a2 : cur(tr.state));
36634
36634
  return new ActiveSource(this.source, 1, this.explicit);
36635
36635
  }
36636
36636
  map(mapping) {
36637
36637
  if (mapping.empty)
36638
36638
  return this;
36639
- let result2 = this.result.map ? this.result.map(this.result, mapping) : this.result;
36640
- if (!result2)
36639
+ let result = this.result.map ? this.result.map(this.result, mapping) : this.result;
36640
+ if (!result)
36641
36641
  return new ActiveSource(
36642
36642
  this.source,
36643
36643
  0
@@ -36674,16 +36674,16 @@ const completionState = /* @__PURE__ */ StateField.define({
36674
36674
  });
36675
36675
  function applyCompletion(view, option) {
36676
36676
  const apply = option.completion.apply || option.completion.label;
36677
- let result2 = view.state.field(completionState).active.find((a) => a.source == option.source);
36678
- if (!(result2 instanceof ActiveResult))
36677
+ let result = view.state.field(completionState).active.find((a) => a.source == option.source);
36678
+ if (!(result instanceof ActiveResult))
36679
36679
  return false;
36680
36680
  if (typeof apply == "string")
36681
36681
  view.dispatch({
36682
- ...insertCompletionText(view.state, apply, result2.from, result2.to),
36682
+ ...insertCompletionText(view.state, apply, result.from, result.to),
36683
36683
  annotations: pickedCompletion.of(option.completion)
36684
36684
  });
36685
36685
  else
36686
- apply(view, option.completion, result2.from, result2.to);
36686
+ apply(view, option.completion, result.from, result.to);
36687
36687
  return true;
36688
36688
  }
36689
36689
  const createTooltip = /* @__PURE__ */ completionTooltip(completionState, applyCompletion);
@@ -36805,9 +36805,9 @@ const completionPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
36805
36805
  let context = new CompletionContext(state, pos, active.explicit, this.view);
36806
36806
  let pending = new RunningQuery(active, context);
36807
36807
  this.running.push(pending);
36808
- Promise.resolve(active.source(context)).then((result2) => {
36808
+ Promise.resolve(active.source(context)).then((result) => {
36809
36809
  if (!pending.context.aborted) {
36810
- pending.done = result2 || null;
36810
+ pending.done = result || null;
36811
36811
  this.scheduleAccept();
36812
36812
  }
36813
36813
  }, (err) => {
@@ -36894,8 +36894,8 @@ const commitCharacters = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ EditorView
36894
36894
  if (!field || !field.open || field.open.disabled || field.open.selected < 0 || event.key.length > 1 || event.ctrlKey && !(windows && event.altKey) || event.metaKey)
36895
36895
  return false;
36896
36896
  let option = field.open.options[field.open.selected];
36897
- let result2 = field.active.find((a) => a.source == option.source);
36898
- let commitChars = option.completion.commitCharacters || result2.result.commitCharacters;
36897
+ let result = field.active.find((a) => a.source == option.source);
36898
+ let commitChars = option.completion.commitCharacters || result.result.commitCharacters;
36899
36899
  if (commitChars && commitChars.indexOf(event.key) > -1)
36900
36900
  applyCompletion(view, option);
36901
36901
  return false;
@@ -37690,9 +37690,9 @@ function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
37690
37690
  }
37691
37691
  function hideTooltip(tr, tooltip) {
37692
37692
  let from = tooltip.pos, to = tooltip.end || from;
37693
- let result2 = tr.state.facet(lintConfig).hideOn(tr, from, to);
37694
- if (result2 != null)
37695
- return result2;
37693
+ let result = tr.state.facet(lintConfig).hideOn(tr, from, to);
37694
+ if (result != null)
37695
+ return result;
37696
37696
  let line = tr.startState.doc.lineAt(tooltip.pos);
37697
37697
  return !!(tr.effects.some((e) => e.is(setDiagnosticsEffect)) || tr.changes.touchesRange(line.from, Math.max(line.to, to)));
37698
37698
  }
@@ -40059,7 +40059,7 @@ class NineDiff extends HTMLElement {
40059
40059
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
40060
40060
  this.shadowRoot.innerHTML = `
40061
40061
  <style>
40062
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.181"}/dist/css/nine-mu.css";
40062
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.183"}/dist/css/nine-mu.css";
40063
40063
  ${customImport}
40064
40064
  </style>
40065
40065
 
@@ -40169,7 +40169,7 @@ render_fn2 = function() {
40169
40169
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
40170
40170
  this.shadowRoot.innerHTML = `
40171
40171
  <style>
40172
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.181"}/dist/css/nine-mu.css";
40172
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.183"}/dist/css/nine-mu.css";
40173
40173
  ${customImport}
40174
40174
  </style>
40175
40175
 
@@ -40496,7 +40496,7 @@ class ChatMessageBody extends HTMLElement {
40496
40496
  const customImport = this.getAttribute("css-path") ? `@import "${this.getAttribute("css-path")}";` : "";
40497
40497
  this.shadowRoot.innerHTML = `
40498
40498
  <style>
40499
- @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.181"}/dist/css/nine-mu.css";
40499
+ @import "https://cdn.jsdelivr.net/npm/@nine-lab/nine-mu@${"0.1.183"}/dist/css/nine-mu.css";
40500
40500
  ${customImport}
40501
40501
  </style>
40502
40502
 
@@ -40590,7 +40590,7 @@ if (!customElements.get("nine-chat-progress")) {
40590
40590
  customElements.define("nine-chat-progress", ProgressMessage);
40591
40591
  }
40592
40592
  const NineMu = {
40593
- version: "0.1.181",
40593
+ version: "0.1.183",
40594
40594
  init: (config2) => {
40595
40595
  trace$1.log("🛠️ Nine-Mu Engine initialized", config2);
40596
40596
  }