@neobiotechlabs/neobiotech-dev-agent 0.1.9 → 0.1.10

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/index.js CHANGED
@@ -7,11 +7,11 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
8
  var __getProtoOf = Object.getPrototypeOf;
9
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
11
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
12
- }) : x2)(function(x2) {
10
+ var __require = /* @__PURE__ */ ((x3) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x3, {
11
+ get: (a, b2) => (typeof require !== "undefined" ? require : a)[b2]
12
+ }) : x3)(function(x3) {
13
13
  if (typeof require !== "undefined") return require.apply(this, arguments);
14
- throw Error('Dynamic require of "' + x2 + '" is not supported');
14
+ throw Error('Dynamic require of "' + x3 + '" is not supported');
15
15
  });
16
16
  var __esm = (fn, res) => function __init() {
17
17
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
@@ -97,7 +97,7 @@ var require_code = __commonJS({
97
97
  };
98
98
  exports._Code = _Code;
99
99
  exports.nil = new _Code("");
100
- function _(strs, ...args) {
100
+ function _2(strs, ...args) {
101
101
  const code = [strs[0]];
102
102
  let i2 = 0;
103
103
  while (i2 < args.length) {
@@ -106,7 +106,7 @@ var require_code = __commonJS({
106
106
  }
107
107
  return new _Code(code);
108
108
  }
109
- exports._ = _;
109
+ exports._ = _2;
110
110
  var plus = new _Code("+");
111
111
  function str(strs, ...args) {
112
112
  const expr = [safeStringify(strs[0])];
@@ -143,41 +143,41 @@ var require_code = __commonJS({
143
143
  i2++;
144
144
  }
145
145
  }
146
- function mergeExprItems(a, b) {
147
- if (b === '""')
146
+ function mergeExprItems(a, b2) {
147
+ if (b2 === '""')
148
148
  return a;
149
149
  if (a === '""')
150
- return b;
150
+ return b2;
151
151
  if (typeof a == "string") {
152
- if (b instanceof Name || a[a.length - 1] !== '"')
152
+ if (b2 instanceof Name || a[a.length - 1] !== '"')
153
153
  return;
154
- if (typeof b != "string")
155
- return `${a.slice(0, -1)}${b}"`;
156
- if (b[0] === '"')
157
- return a.slice(0, -1) + b.slice(1);
154
+ if (typeof b2 != "string")
155
+ return `${a.slice(0, -1)}${b2}"`;
156
+ if (b2[0] === '"')
157
+ return a.slice(0, -1) + b2.slice(1);
158
158
  return;
159
159
  }
160
- if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
161
- return `"${a}${b.slice(1)}`;
160
+ if (typeof b2 == "string" && b2[0] === '"' && !(a instanceof Name))
161
+ return `"${a}${b2.slice(1)}`;
162
162
  return;
163
163
  }
164
164
  function strConcat(c1, c2) {
165
165
  return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`;
166
166
  }
167
167
  exports.strConcat = strConcat;
168
- function interpolate(x2) {
169
- return typeof x2 == "number" || typeof x2 == "boolean" || x2 === null ? x2 : safeStringify(Array.isArray(x2) ? x2.join(",") : x2);
168
+ function interpolate(x3) {
169
+ return typeof x3 == "number" || typeof x3 == "boolean" || x3 === null ? x3 : safeStringify(Array.isArray(x3) ? x3.join(",") : x3);
170
170
  }
171
- function stringify(x2) {
172
- return new _Code(safeStringify(x2));
171
+ function stringify(x3) {
172
+ return new _Code(safeStringify(x3));
173
173
  }
174
174
  exports.stringify = stringify;
175
- function safeStringify(x2) {
176
- return JSON.stringify(x2).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
175
+ function safeStringify(x3) {
176
+ return JSON.stringify(x3).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
177
177
  }
178
178
  exports.safeStringify = safeStringify;
179
179
  function getProperty(key) {
180
- return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`;
180
+ return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _2`[${key}]`;
181
181
  }
182
182
  exports.getProperty = getProperty;
183
183
  function getEsmExportName(key) {
@@ -1036,8 +1036,8 @@ var require_codegen = __commonJS({
1036
1036
  for (const n in from)
1037
1037
  names[n] = (names[n] || 0) - (from[n] || 0);
1038
1038
  }
1039
- function not(x2) {
1040
- return typeof x2 == "boolean" || typeof x2 == "number" || x2 === null ? !x2 : (0, code_1._)`!${par(x2)}`;
1039
+ function not(x3) {
1040
+ return typeof x3 == "boolean" || typeof x3 == "number" || x3 === null ? !x3 : (0, code_1._)`!${par(x3)}`;
1041
1041
  }
1042
1042
  exports.not = not;
1043
1043
  var andCode = mappend(exports.operators.AND);
@@ -1051,10 +1051,10 @@ var require_codegen = __commonJS({
1051
1051
  }
1052
1052
  exports.or = or;
1053
1053
  function mappend(op) {
1054
- return (x2, y) => x2 === code_1.nil ? y : y === code_1.nil ? x2 : (0, code_1._)`${par(x2)} ${op} ${par(y)}`;
1054
+ return (x3, y2) => x3 === code_1.nil ? y2 : y2 === code_1.nil ? x3 : (0, code_1._)`${par(x3)} ${op} ${par(y2)}`;
1055
1055
  }
1056
- function par(x2) {
1057
- return x2 instanceof code_1.Name ? x2 : (0, code_1._)`(${x2})`;
1056
+ function par(x3) {
1057
+ return x3 instanceof code_1.Name ? x3 : (0, code_1._)`(${x3})`;
1058
1058
  }
1059
1059
  }
1060
1060
  });
@@ -1144,8 +1144,8 @@ var require_util = __commonJS({
1144
1144
  exports.unescapeJsonPointer = unescapeJsonPointer;
1145
1145
  function eachItem(xs, f3) {
1146
1146
  if (Array.isArray(xs)) {
1147
- for (const x2 of xs)
1148
- f3(x2);
1147
+ for (const x3 of xs)
1148
+ f3(x3);
1149
1149
  } else {
1150
1150
  f3(xs);
1151
1151
  }
@@ -1335,7 +1335,7 @@ var require_errors = __commonJS({
1335
1335
  gen.return(false);
1336
1336
  }
1337
1337
  }
1338
- var E = {
1338
+ var E2 = {
1339
1339
  keyword: new codegen_1.Name("keyword"),
1340
1340
  schemaPath: new codegen_1.Name("schemaPath"),
1341
1341
  // also used in JTD errors
@@ -1369,20 +1369,20 @@ var require_errors = __commonJS({
1369
1369
  if (schemaPath) {
1370
1370
  schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;
1371
1371
  }
1372
- return [E.schemaPath, schPath];
1372
+ return [E2.schemaPath, schPath];
1373
1373
  }
1374
1374
  function extraErrorProps(cxt, { params, message }, keyValues) {
1375
1375
  const { keyword, data, schemaValue, it } = cxt;
1376
1376
  const { opts, propertyName, topSchemaRef, schemaPath } = it;
1377
- keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]);
1377
+ keyValues.push([E2.keyword, keyword], [E2.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]);
1378
1378
  if (opts.messages) {
1379
- keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]);
1379
+ keyValues.push([E2.message, typeof message == "function" ? message(cxt) : message]);
1380
1380
  }
1381
1381
  if (opts.verbose) {
1382
- keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
1382
+ keyValues.push([E2.schema, schemaValue], [E2.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
1383
1383
  }
1384
1384
  if (propertyName)
1385
- keyValues.push([E.propertyName, propertyName]);
1385
+ keyValues.push([E2.propertyName, propertyName]);
1386
1386
  }
1387
1387
  }
1388
1388
  });
@@ -1446,8 +1446,8 @@ var require_rules = __commonJS({
1446
1446
  exports.getRules = exports.isJSONType = void 0;
1447
1447
  var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
1448
1448
  var jsonTypes = new Set(_jsonTypes);
1449
- function isJSONType(x2) {
1450
- return typeof x2 == "string" && jsonTypes.has(x2);
1449
+ function isJSONType(x3) {
1450
+ return typeof x3 == "string" && jsonTypes.has(x3);
1451
1451
  }
1452
1452
  exports.isJSONType = isJSONType;
1453
1453
  function getRules() {
@@ -1938,7 +1938,7 @@ var require_keyword = __commonJS({
1938
1938
  return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
1939
1939
  }
1940
1940
  function validSchemaType(schema, schemaType, allowUndefined = false) {
1941
- 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");
1941
+ return !schemaType.length || schemaType.some((st2) => st2 === "array" ? Array.isArray(schema) : st2 === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st2 || allowUndefined && typeof schema == "undefined");
1942
1942
  }
1943
1943
  exports.validSchemaType = validSchemaType;
1944
1944
  function validateKeywordUsage({ schema, opts, self: self2, errSchemaPath }, def, keyword) {
@@ -2051,33 +2051,33 @@ var require_subschema = __commonJS({
2051
2051
  var require_fast_deep_equal = __commonJS({
2052
2052
  "node_modules/fast-deep-equal/index.js"(exports, module) {
2053
2053
  "use strict";
2054
- module.exports = function equal(a, b) {
2055
- if (a === b) return true;
2056
- if (a && b && typeof a == "object" && typeof b == "object") {
2057
- if (a.constructor !== b.constructor) return false;
2054
+ module.exports = function equal(a, b2) {
2055
+ if (a === b2) return true;
2056
+ if (a && b2 && typeof a == "object" && typeof b2 == "object") {
2057
+ if (a.constructor !== b2.constructor) return false;
2058
2058
  var length, i2, keys;
2059
2059
  if (Array.isArray(a)) {
2060
2060
  length = a.length;
2061
- if (length != b.length) return false;
2061
+ if (length != b2.length) return false;
2062
2062
  for (i2 = length; i2-- !== 0; )
2063
- if (!equal(a[i2], b[i2])) return false;
2063
+ if (!equal(a[i2], b2[i2])) return false;
2064
2064
  return true;
2065
2065
  }
2066
- if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
2067
- if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
2068
- if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
2066
+ if (a.constructor === RegExp) return a.source === b2.source && a.flags === b2.flags;
2067
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b2.valueOf();
2068
+ if (a.toString !== Object.prototype.toString) return a.toString() === b2.toString();
2069
2069
  keys = Object.keys(a);
2070
2070
  length = keys.length;
2071
- if (length !== Object.keys(b).length) return false;
2071
+ if (length !== Object.keys(b2).length) return false;
2072
2072
  for (i2 = length; i2-- !== 0; )
2073
- if (!Object.prototype.hasOwnProperty.call(b, keys[i2])) return false;
2073
+ if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false;
2074
2074
  for (i2 = length; i2-- !== 0; ) {
2075
2075
  var key = keys[i2];
2076
- if (!equal(a[key], b[key])) return false;
2076
+ if (!equal(a[key], b2[key])) return false;
2077
2077
  }
2078
2078
  return true;
2079
2079
  }
2080
- return a !== a && b !== b;
2080
+ return a !== a && b2 !== b2;
2081
2081
  };
2082
2082
  }
2083
2083
  });
@@ -2274,7 +2274,7 @@ var require_resolve = __commonJS({
2274
2274
  const pathPrefix = getFullPath(uriResolver, schId, false);
2275
2275
  const localRefs = {};
2276
2276
  const schemaRefs = /* @__PURE__ */ new Set();
2277
- traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
2277
+ traverse(schema, { allKeys: true }, (sch, jsonPtr, _2, parentJsonPtr) => {
2278
2278
  if (parentJsonPtr === void 0)
2279
2279
  return;
2280
2280
  const fullPath = pathPrefix + jsonPtr;
@@ -2735,8 +2735,8 @@ var require_validate = __commonJS({
2735
2735
  if (schemaType.length) {
2736
2736
  if (!(schemaCode instanceof codegen_1.Name))
2737
2737
  throw new Error("ajv implementation error");
2738
- const st = Array.isArray(schemaType) ? schemaType : [schemaType];
2739
- return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
2738
+ const st2 = Array.isArray(schemaType) ? schemaType : [schemaType];
2739
+ return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st2, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
2740
2740
  }
2741
2741
  return codegen_1.nil;
2742
2742
  }
@@ -4011,14 +4011,14 @@ var require_core = __commonJS({
4011
4011
  };
4012
4012
  var MAX_EXPRESSION = 200;
4013
4013
  function requiredOptions(o) {
4014
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
4014
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
4015
4015
  const s2 = o.strict;
4016
4016
  const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;
4017
4017
  const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
4018
4018
  const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
4019
4019
  const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
4020
4020
  return {
4021
- strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s2) !== null && _f !== void 0 ? _f : true,
4021
+ strictSchema: (_f = (_e2 = o.strictSchema) !== null && _e2 !== void 0 ? _e2 : s2) !== null && _f !== void 0 ? _f : true,
4022
4022
  strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s2) !== null && _h !== void 0 ? _h : true,
4023
4023
  strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s2) !== null && _k !== void 0 ? _k : "log",
4024
4024
  strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s2) !== null && _m !== void 0 ? _m : "log",
@@ -4086,17 +4086,17 @@ var require_core = __commonJS({
4086
4086
  return this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : void 0;
4087
4087
  }
4088
4088
  validate(schemaKeyRef, data) {
4089
- let v;
4089
+ let v2;
4090
4090
  if (typeof schemaKeyRef == "string") {
4091
- v = this.getSchema(schemaKeyRef);
4092
- if (!v)
4091
+ v2 = this.getSchema(schemaKeyRef);
4092
+ if (!v2)
4093
4093
  throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
4094
4094
  } else {
4095
- v = this.compile(schemaKeyRef);
4095
+ v2 = this.compile(schemaKeyRef);
4096
4096
  }
4097
- const valid = v(data);
4098
- if (!("$async" in v))
4099
- this.errors = v.errors;
4097
+ const valid = v2(data);
4098
+ if (!("$async" in v2))
4099
+ this.errors = v2.errors;
4100
4100
  return valid;
4101
4101
  }
4102
4102
  compile(schema, _meta) {
@@ -4590,8 +4590,8 @@ var require_ref = __commonJS({
4590
4590
  return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async);
4591
4591
  }
4592
4592
  function callValidate(sch) {
4593
- const v = getValidate(cxt, sch);
4594
- callRef(cxt, v, sch, sch.$async);
4593
+ const v2 = getValidate(cxt, sch);
4594
+ callRef(cxt, v2, sch, sch.$async);
4595
4595
  }
4596
4596
  function inlineRefSchema(sch) {
4597
4597
  const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
@@ -4613,7 +4613,7 @@ var require_ref = __commonJS({
4613
4613
  return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`;
4614
4614
  }
4615
4615
  exports.getValidate = getValidate;
4616
- function callRef(cxt, v, sch, $async) {
4616
+ function callRef(cxt, v2, sch, $async) {
4617
4617
  const { gen, it } = cxt;
4618
4618
  const { allErrors, schemaEnv: env, opts } = it;
4619
4619
  const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
@@ -4626,8 +4626,8 @@ var require_ref = __commonJS({
4626
4626
  throw new Error("async schema referenced by sync schema");
4627
4627
  const valid = gen.let("valid");
4628
4628
  gen.try(() => {
4629
- gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
4630
- addEvaluatedFrom(v);
4629
+ gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v2, passCxt)}`);
4630
+ addEvaluatedFrom(v2);
4631
4631
  if (!allErrors)
4632
4632
  gen.assign(valid, true);
4633
4633
  }, (e2) => {
@@ -4639,7 +4639,7 @@ var require_ref = __commonJS({
4639
4639
  cxt.ok(valid);
4640
4640
  }
4641
4641
  function callSyncRef() {
4642
- cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
4642
+ cxt.result((0, code_1.callValidateCode)(cxt, v2, passCxt), () => addEvaluatedFrom(v2), () => addErrorsFrom(v2));
4643
4643
  }
4644
4644
  function addErrorsFrom(source) {
4645
4645
  const errs = (0, codegen_1._)`${source}.errors`;
@@ -5015,8 +5015,8 @@ var require_uniqueItems = __commonJS({
5015
5015
  var util_1 = require_util();
5016
5016
  var equal_1 = require_equal();
5017
5017
  var error2 = {
5018
- message: ({ params: { i: i2, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i2} are identical)`,
5019
- params: ({ params: { i: i2, j } }) => (0, codegen_1._)`{i: ${i2}, j: ${j}}`
5018
+ message: ({ params: { i: i2, j: j2 } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j2} and ${i2} are identical)`,
5019
+ params: ({ params: { i: i2, j: j2 } }) => (0, codegen_1._)`{i: ${i2}, j: ${j2}}`
5020
5020
  };
5021
5021
  var def = {
5022
5022
  keyword: "uniqueItems",
@@ -5034,15 +5034,15 @@ var require_uniqueItems = __commonJS({
5034
5034
  cxt.ok(valid);
5035
5035
  function validateUniqueItems() {
5036
5036
  const i2 = gen.let("i", (0, codegen_1._)`${data}.length`);
5037
- const j = gen.let("j");
5038
- cxt.setParams({ i: i2, j });
5037
+ const j2 = gen.let("j");
5038
+ cxt.setParams({ i: i2, j: j2 });
5039
5039
  gen.assign(valid, true);
5040
- gen.if((0, codegen_1._)`${i2} > 1`, () => (canOptimize() ? loopN : loopN2)(i2, j));
5040
+ gen.if((0, codegen_1._)`${i2} > 1`, () => (canOptimize() ? loopN : loopN2)(i2, j2));
5041
5041
  }
5042
5042
  function canOptimize() {
5043
5043
  return itemTypes.length > 0 && !itemTypes.some((t2) => t2 === "object" || t2 === "array");
5044
5044
  }
5045
- function loopN(i2, j) {
5045
+ function loopN(i2, j2) {
5046
5046
  const item = gen.name("item");
5047
5047
  const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
5048
5048
  const indices = gen.const("indices", (0, codegen_1._)`{}`);
@@ -5052,16 +5052,16 @@ var require_uniqueItems = __commonJS({
5052
5052
  if (itemTypes.length > 1)
5053
5053
  gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`);
5054
5054
  gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => {
5055
- gen.assign(j, (0, codegen_1._)`${indices}[${item}]`);
5055
+ gen.assign(j2, (0, codegen_1._)`${indices}[${item}]`);
5056
5056
  cxt.error();
5057
5057
  gen.assign(valid, false).break();
5058
5058
  }).code((0, codegen_1._)`${indices}[${item}] = ${i2}`);
5059
5059
  });
5060
5060
  }
5061
- function loopN2(i2, j) {
5061
+ function loopN2(i2, j2) {
5062
5062
  const eql = (0, util_1.useFunc)(gen, equal_1.default);
5063
5063
  const outer = gen.name("outer");
5064
- gen.label(outer).for((0, codegen_1._)`;${i2}--;`, () => gen.for((0, codegen_1._)`${j} = ${i2}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i2}], ${data}[${j}])`, () => {
5064
+ gen.label(outer).for((0, codegen_1._)`;${i2}--;`, () => gen.for((0, codegen_1._)`${j2} = ${i2}; ${j2}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i2}], ${data}[${j2}])`, () => {
5065
5065
  cxt.error();
5066
5066
  gen.assign(valid, false).break(outer);
5067
5067
  })));
@@ -5138,7 +5138,7 @@ var require_enum = __commonJS({
5138
5138
  cxt.pass(valid);
5139
5139
  function loopEnum() {
5140
5140
  gen.assign(valid, false);
5141
- gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
5141
+ gen.forOf("v", schemaCode, (v2) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v2})`, () => gen.assign(valid, true).break()));
5142
5142
  }
5143
5143
  function equalCode(vSchema, i2) {
5144
5144
  const sch = schema[i2];
@@ -5285,10 +5285,10 @@ var require_items = __commonJS({
5285
5285
  });
5286
5286
  function checkStrictTuple(sch) {
5287
5287
  const { opts, errSchemaPath } = it;
5288
- const l = schArr.length;
5289
- const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
5288
+ const l3 = schArr.length;
5289
+ const fullTuple = l3 === sch.minItems && (l3 === sch.maxItems || sch[extraItems] === false);
5290
5290
  if (opts.strictTuples && !fullTuple) {
5291
- const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
5291
+ const msg = `"${keyword}" is ${l3}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
5292
5292
  (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
5293
5293
  }
5294
5294
  }
@@ -6524,7 +6524,7 @@ var require_ajv = __commonJS({
6524
6524
  var Ajv2 = class extends core_1.default {
6525
6525
  _addVocabularies() {
6526
6526
  super._addVocabularies();
6527
- draft7_1.default.forEach((v) => this.addVocabulary(v));
6527
+ draft7_1.default.forEach((v2) => this.addVocabulary(v2));
6528
6528
  if (this.opts.discriminator)
6529
6529
  this.addKeyword(discriminator_1.default);
6530
6530
  }
@@ -6952,8 +6952,8 @@ var require_ponyfill_es2018 = __commonJS({
6952
6952
  function noop2() {
6953
6953
  return void 0;
6954
6954
  }
6955
- function typeIsObject(x2) {
6956
- return typeof x2 === "object" && x2 !== null || typeof x2 === "function";
6955
+ function typeIsObject(x3) {
6956
+ return typeof x3 === "object" && x3 !== null || typeof x3 === "function";
6957
6957
  }
6958
6958
  const rethrowAssertionErrorRejection = noop2;
6959
6959
  function setFunctionName(fn, name) {
@@ -7004,15 +7004,15 @@ var require_ponyfill_es2018 = __commonJS({
7004
7004
  }
7005
7005
  return _queueMicrotask(callback);
7006
7006
  };
7007
- function reflectCall(F2, V, args) {
7008
- if (typeof F2 !== "function") {
7007
+ function reflectCall(F3, V2, args) {
7008
+ if (typeof F3 !== "function") {
7009
7009
  throw new TypeError("Argument is not a function");
7010
7010
  }
7011
- return Function.prototype.apply.call(F2, V, args);
7011
+ return Function.prototype.apply.call(F3, V2, args);
7012
7012
  }
7013
- function promiseCall(F2, V, args) {
7013
+ function promiseCall(F3, V2, args) {
7014
7014
  try {
7015
- return promiseResolvedWith(reflectCall(F2, V, args));
7015
+ return promiseResolvedWith(reflectCall(F3, V2, args));
7016
7016
  } catch (value) {
7017
7017
  return promiseRejectedWith(value);
7018
7018
  }
@@ -7175,71 +7175,71 @@ var require_ponyfill_es2018 = __commonJS({
7175
7175
  reader._closedPromise_resolve = void 0;
7176
7176
  reader._closedPromise_reject = void 0;
7177
7177
  }
7178
- const NumberIsFinite = Number.isFinite || function(x2) {
7179
- return typeof x2 === "number" && isFinite(x2);
7178
+ const NumberIsFinite = Number.isFinite || function(x3) {
7179
+ return typeof x3 === "number" && isFinite(x3);
7180
7180
  };
7181
- const MathTrunc = Math.trunc || function(v) {
7182
- return v < 0 ? Math.ceil(v) : Math.floor(v);
7181
+ const MathTrunc = Math.trunc || function(v2) {
7182
+ return v2 < 0 ? Math.ceil(v2) : Math.floor(v2);
7183
7183
  };
7184
- function isDictionary(x2) {
7185
- return typeof x2 === "object" || typeof x2 === "function";
7184
+ function isDictionary(x3) {
7185
+ return typeof x3 === "object" || typeof x3 === "function";
7186
7186
  }
7187
7187
  function assertDictionary(obj, context) {
7188
7188
  if (obj !== void 0 && !isDictionary(obj)) {
7189
7189
  throw new TypeError(`${context} is not an object.`);
7190
7190
  }
7191
7191
  }
7192
- function assertFunction(x2, context) {
7193
- if (typeof x2 !== "function") {
7192
+ function assertFunction(x3, context) {
7193
+ if (typeof x3 !== "function") {
7194
7194
  throw new TypeError(`${context} is not a function.`);
7195
7195
  }
7196
7196
  }
7197
- function isObject2(x2) {
7198
- return typeof x2 === "object" && x2 !== null || typeof x2 === "function";
7197
+ function isObject2(x3) {
7198
+ return typeof x3 === "object" && x3 !== null || typeof x3 === "function";
7199
7199
  }
7200
- function assertObject(x2, context) {
7201
- if (!isObject2(x2)) {
7200
+ function assertObject(x3, context) {
7201
+ if (!isObject2(x3)) {
7202
7202
  throw new TypeError(`${context} is not an object.`);
7203
7203
  }
7204
7204
  }
7205
- function assertRequiredArgument(x2, position, context) {
7206
- if (x2 === void 0) {
7205
+ function assertRequiredArgument(x3, position, context) {
7206
+ if (x3 === void 0) {
7207
7207
  throw new TypeError(`Parameter ${position} is required in '${context}'.`);
7208
7208
  }
7209
7209
  }
7210
- function assertRequiredField(x2, field, context) {
7211
- if (x2 === void 0) {
7210
+ function assertRequiredField(x3, field, context) {
7211
+ if (x3 === void 0) {
7212
7212
  throw new TypeError(`${field} is required in '${context}'.`);
7213
7213
  }
7214
7214
  }
7215
7215
  function convertUnrestrictedDouble(value) {
7216
7216
  return Number(value);
7217
7217
  }
7218
- function censorNegativeZero(x2) {
7219
- return x2 === 0 ? 0 : x2;
7218
+ function censorNegativeZero(x3) {
7219
+ return x3 === 0 ? 0 : x3;
7220
7220
  }
7221
- function integerPart(x2) {
7222
- return censorNegativeZero(MathTrunc(x2));
7221
+ function integerPart(x3) {
7222
+ return censorNegativeZero(MathTrunc(x3));
7223
7223
  }
7224
7224
  function convertUnsignedLongLongWithEnforceRange(value, context) {
7225
7225
  const lowerBound = 0;
7226
7226
  const upperBound = Number.MAX_SAFE_INTEGER;
7227
- let x2 = Number(value);
7228
- x2 = censorNegativeZero(x2);
7229
- if (!NumberIsFinite(x2)) {
7227
+ let x3 = Number(value);
7228
+ x3 = censorNegativeZero(x3);
7229
+ if (!NumberIsFinite(x3)) {
7230
7230
  throw new TypeError(`${context} is not a finite number`);
7231
7231
  }
7232
- x2 = integerPart(x2);
7233
- if (x2 < lowerBound || x2 > upperBound) {
7232
+ x3 = integerPart(x3);
7233
+ if (x3 < lowerBound || x3 > upperBound) {
7234
7234
  throw new TypeError(`${context} is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`);
7235
7235
  }
7236
- if (!NumberIsFinite(x2) || x2 === 0) {
7236
+ if (!NumberIsFinite(x3) || x3 === 0) {
7237
7237
  return 0;
7238
7238
  }
7239
- return x2;
7239
+ return x3;
7240
7240
  }
7241
- function assertReadableStream(x2, context) {
7242
- if (!IsReadableStream(x2)) {
7241
+ function assertReadableStream(x3, context) {
7242
+ if (!IsReadableStream(x3)) {
7243
7243
  throw new TypeError(`${context} is not a ReadableStream.`);
7244
7244
  }
7245
7245
  }
@@ -7363,14 +7363,14 @@ var require_ponyfill_es2018 = __commonJS({
7363
7363
  configurable: true
7364
7364
  });
7365
7365
  }
7366
- function IsReadableStreamDefaultReader(x2) {
7367
- if (!typeIsObject(x2)) {
7366
+ function IsReadableStreamDefaultReader(x3) {
7367
+ if (!typeIsObject(x3)) {
7368
7368
  return false;
7369
7369
  }
7370
- if (!Object.prototype.hasOwnProperty.call(x2, "_readRequests")) {
7370
+ if (!Object.prototype.hasOwnProperty.call(x3, "_readRequests")) {
7371
7371
  return false;
7372
7372
  }
7373
- return x2 instanceof ReadableStreamDefaultReader;
7373
+ return x3 instanceof ReadableStreamDefaultReader;
7374
7374
  }
7375
7375
  function ReadableStreamDefaultReaderRead(reader, readRequest) {
7376
7376
  const stream = reader._ownerReadableStream;
@@ -7485,15 +7485,15 @@ var require_ponyfill_es2018 = __commonJS({
7485
7485
  iterator._asyncIteratorImpl = impl;
7486
7486
  return iterator;
7487
7487
  }
7488
- function IsReadableStreamAsyncIterator(x2) {
7489
- if (!typeIsObject(x2)) {
7488
+ function IsReadableStreamAsyncIterator(x3) {
7489
+ if (!typeIsObject(x3)) {
7490
7490
  return false;
7491
7491
  }
7492
- if (!Object.prototype.hasOwnProperty.call(x2, "_asyncIteratorImpl")) {
7492
+ if (!Object.prototype.hasOwnProperty.call(x3, "_asyncIteratorImpl")) {
7493
7493
  return false;
7494
7494
  }
7495
7495
  try {
7496
- return x2._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl;
7496
+ return x3._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl;
7497
7497
  } catch (_a2) {
7498
7498
  return false;
7499
7499
  }
@@ -7501,8 +7501,8 @@ var require_ponyfill_es2018 = __commonJS({
7501
7501
  function streamAsyncIteratorBrandCheckException(name) {
7502
7502
  return new TypeError(`ReadableStreamAsyncIterator.${name} can only be used on a ReadableSteamAsyncIterator`);
7503
7503
  }
7504
- const NumberIsNaN = Number.isNaN || function(x2) {
7505
- return x2 !== x2;
7504
+ const NumberIsNaN = Number.isNaN || function(x3) {
7505
+ return x3 !== x3;
7506
7506
  };
7507
7507
  var _a, _b, _c;
7508
7508
  function CreateArrayFromList(elements) {
@@ -7511,23 +7511,23 @@ var require_ponyfill_es2018 = __commonJS({
7511
7511
  function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) {
7512
7512
  new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);
7513
7513
  }
7514
- let TransferArrayBuffer = (O) => {
7515
- if (typeof O.transfer === "function") {
7514
+ let TransferArrayBuffer = (O2) => {
7515
+ if (typeof O2.transfer === "function") {
7516
7516
  TransferArrayBuffer = (buffer) => buffer.transfer();
7517
7517
  } else if (typeof structuredClone === "function") {
7518
7518
  TransferArrayBuffer = (buffer) => structuredClone(buffer, { transfer: [buffer] });
7519
7519
  } else {
7520
7520
  TransferArrayBuffer = (buffer) => buffer;
7521
7521
  }
7522
- return TransferArrayBuffer(O);
7522
+ return TransferArrayBuffer(O2);
7523
7523
  };
7524
- let IsDetachedBuffer = (O) => {
7525
- if (typeof O.detached === "boolean") {
7524
+ let IsDetachedBuffer = (O2) => {
7525
+ if (typeof O2.detached === "boolean") {
7526
7526
  IsDetachedBuffer = (buffer) => buffer.detached;
7527
7527
  } else {
7528
7528
  IsDetachedBuffer = (buffer) => buffer.byteLength === 0;
7529
7529
  }
7530
- return IsDetachedBuffer(O);
7530
+ return IsDetachedBuffer(O2);
7531
7531
  };
7532
7532
  function ArrayBufferSlice(buffer, begin, end) {
7533
7533
  if (buffer.slice) {
@@ -7595,20 +7595,20 @@ var require_ponyfill_es2018 = __commonJS({
7595
7595
  function IteratorValue(iterResult) {
7596
7596
  return iterResult.value;
7597
7597
  }
7598
- function IsNonNegativeNumber(v) {
7599
- if (typeof v !== "number") {
7598
+ function IsNonNegativeNumber(v2) {
7599
+ if (typeof v2 !== "number") {
7600
7600
  return false;
7601
7601
  }
7602
- if (NumberIsNaN(v)) {
7602
+ if (NumberIsNaN(v2)) {
7603
7603
  return false;
7604
7604
  }
7605
- if (v < 0) {
7605
+ if (v2 < 0) {
7606
7606
  return false;
7607
7607
  }
7608
7608
  return true;
7609
7609
  }
7610
- function CloneAsUint8Array(O) {
7611
- const buffer = ArrayBufferSlice(O.buffer, O.byteOffset, O.byteOffset + O.byteLength);
7610
+ function CloneAsUint8Array(O2) {
7611
+ const buffer = ArrayBufferSlice(O2.buffer, O2.byteOffset, O2.byteOffset + O2.byteLength);
7612
7612
  return new Uint8Array(buffer);
7613
7613
  }
7614
7614
  function DequeueValue(container) {
@@ -7841,23 +7841,23 @@ var require_ponyfill_es2018 = __commonJS({
7841
7841
  configurable: true
7842
7842
  });
7843
7843
  }
7844
- function IsReadableByteStreamController(x2) {
7845
- if (!typeIsObject(x2)) {
7844
+ function IsReadableByteStreamController(x3) {
7845
+ if (!typeIsObject(x3)) {
7846
7846
  return false;
7847
7847
  }
7848
- if (!Object.prototype.hasOwnProperty.call(x2, "_controlledReadableByteStream")) {
7848
+ if (!Object.prototype.hasOwnProperty.call(x3, "_controlledReadableByteStream")) {
7849
7849
  return false;
7850
7850
  }
7851
- return x2 instanceof ReadableByteStreamController;
7851
+ return x3 instanceof ReadableByteStreamController;
7852
7852
  }
7853
- function IsReadableStreamBYOBRequest(x2) {
7854
- if (!typeIsObject(x2)) {
7853
+ function IsReadableStreamBYOBRequest(x3) {
7854
+ if (!typeIsObject(x3)) {
7855
7855
  return false;
7856
7856
  }
7857
- if (!Object.prototype.hasOwnProperty.call(x2, "_associatedReadableByteStreamController")) {
7857
+ if (!Object.prototype.hasOwnProperty.call(x3, "_associatedReadableByteStreamController")) {
7858
7858
  return false;
7859
7859
  }
7860
- return x2 instanceof ReadableStreamBYOBRequest;
7860
+ return x3 instanceof ReadableStreamBYOBRequest;
7861
7861
  }
7862
7862
  function ReadableByteStreamControllerCallPullIfNeeded(controller) {
7863
7863
  const shouldPull = ReadableByteStreamControllerShouldCallPull(controller);
@@ -8489,14 +8489,14 @@ var require_ponyfill_es2018 = __commonJS({
8489
8489
  configurable: true
8490
8490
  });
8491
8491
  }
8492
- function IsReadableStreamBYOBReader(x2) {
8493
- if (!typeIsObject(x2)) {
8492
+ function IsReadableStreamBYOBReader(x3) {
8493
+ if (!typeIsObject(x3)) {
8494
8494
  return false;
8495
8495
  }
8496
- if (!Object.prototype.hasOwnProperty.call(x2, "_readIntoRequests")) {
8496
+ if (!Object.prototype.hasOwnProperty.call(x3, "_readIntoRequests")) {
8497
8497
  return false;
8498
8498
  }
8499
- return x2 instanceof ReadableStreamBYOBReader;
8499
+ return x3 instanceof ReadableStreamBYOBReader;
8500
8500
  }
8501
8501
  function ReadableStreamBYOBReaderRead(reader, view, min, readIntoRequest) {
8502
8502
  const stream = reader._ownerReadableStream;
@@ -8583,8 +8583,8 @@ var require_ponyfill_es2018 = __commonJS({
8583
8583
  assertFunction(fn, context);
8584
8584
  return (chunk, controller) => promiseCall(fn, original, [chunk, controller]);
8585
8585
  }
8586
- function assertWritableStream(x2, context) {
8587
- if (!IsWritableStream(x2)) {
8586
+ function assertWritableStream(x3, context) {
8587
+ if (!IsWritableStream(x3)) {
8588
8588
  throw new TypeError(`${context} is not a WritableStream.`);
8589
8589
  }
8590
8590
  }
@@ -8722,14 +8722,14 @@ var require_ponyfill_es2018 = __commonJS({
8722
8722
  stream._pendingAbortRequest = void 0;
8723
8723
  stream._backpressure = false;
8724
8724
  }
8725
- function IsWritableStream(x2) {
8726
- if (!typeIsObject(x2)) {
8725
+ function IsWritableStream(x3) {
8726
+ if (!typeIsObject(x3)) {
8727
8727
  return false;
8728
8728
  }
8729
- if (!Object.prototype.hasOwnProperty.call(x2, "_writableStreamController")) {
8729
+ if (!Object.prototype.hasOwnProperty.call(x3, "_writableStreamController")) {
8730
8730
  return false;
8731
8731
  }
8732
- return x2 instanceof WritableStream;
8732
+ return x3 instanceof WritableStream;
8733
8733
  }
8734
8734
  function IsWritableStreamLocked(stream) {
8735
8735
  if (stream._writer === void 0) {
@@ -9072,14 +9072,14 @@ var require_ponyfill_es2018 = __commonJS({
9072
9072
  configurable: true
9073
9073
  });
9074
9074
  }
9075
- function IsWritableStreamDefaultWriter(x2) {
9076
- if (!typeIsObject(x2)) {
9075
+ function IsWritableStreamDefaultWriter(x3) {
9076
+ if (!typeIsObject(x3)) {
9077
9077
  return false;
9078
9078
  }
9079
- if (!Object.prototype.hasOwnProperty.call(x2, "_ownerWritableStream")) {
9079
+ if (!Object.prototype.hasOwnProperty.call(x3, "_ownerWritableStream")) {
9080
9080
  return false;
9081
9081
  }
9082
- return x2 instanceof WritableStreamDefaultWriter;
9082
+ return x3 instanceof WritableStreamDefaultWriter;
9083
9083
  }
9084
9084
  function WritableStreamDefaultWriterAbort(writer, reason) {
9085
9085
  const stream = writer._ownerWritableStream;
@@ -9223,14 +9223,14 @@ var require_ponyfill_es2018 = __commonJS({
9223
9223
  configurable: true
9224
9224
  });
9225
9225
  }
9226
- function IsWritableStreamDefaultController(x2) {
9227
- if (!typeIsObject(x2)) {
9226
+ function IsWritableStreamDefaultController(x3) {
9227
+ if (!typeIsObject(x3)) {
9228
9228
  return false;
9229
9229
  }
9230
- if (!Object.prototype.hasOwnProperty.call(x2, "_controlledWritableStream")) {
9230
+ if (!Object.prototype.hasOwnProperty.call(x3, "_controlledWritableStream")) {
9231
9231
  return false;
9232
9232
  }
9233
- return x2 instanceof WritableStreamDefaultController;
9233
+ return x3 instanceof WritableStreamDefaultController;
9234
9234
  }
9235
9235
  function SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {
9236
9236
  controller._controlledWritableStream = stream;
@@ -9773,14 +9773,14 @@ var require_ponyfill_es2018 = __commonJS({
9773
9773
  configurable: true
9774
9774
  });
9775
9775
  }
9776
- function IsReadableStreamDefaultController(x2) {
9777
- if (!typeIsObject(x2)) {
9776
+ function IsReadableStreamDefaultController(x3) {
9777
+ if (!typeIsObject(x3)) {
9778
9778
  return false;
9779
9779
  }
9780
- if (!Object.prototype.hasOwnProperty.call(x2, "_controlledReadableStream")) {
9780
+ if (!Object.prototype.hasOwnProperty.call(x3, "_controlledReadableStream")) {
9781
9781
  return false;
9782
9782
  }
9783
- return x2 instanceof ReadableStreamDefaultController;
9783
+ return x3 instanceof ReadableStreamDefaultController;
9784
9784
  }
9785
9785
  function ReadableStreamDefaultControllerCallPullIfNeeded(controller) {
9786
9786
  const shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);
@@ -10603,14 +10603,14 @@ var require_ponyfill_es2018 = __commonJS({
10603
10603
  stream._storedError = void 0;
10604
10604
  stream._disturbed = false;
10605
10605
  }
10606
- function IsReadableStream(x2) {
10607
- if (!typeIsObject(x2)) {
10606
+ function IsReadableStream(x3) {
10607
+ if (!typeIsObject(x3)) {
10608
10608
  return false;
10609
10609
  }
10610
- if (!Object.prototype.hasOwnProperty.call(x2, "_readableStreamController")) {
10610
+ if (!Object.prototype.hasOwnProperty.call(x3, "_readableStreamController")) {
10611
10611
  return false;
10612
10612
  }
10613
- return x2 instanceof ReadableStream2;
10613
+ return x3 instanceof ReadableStream2;
10614
10614
  }
10615
10615
  function IsReadableStreamLocked(stream) {
10616
10616
  if (stream._reader === void 0) {
@@ -10720,14 +10720,14 @@ var require_ponyfill_es2018 = __commonJS({
10720
10720
  function byteLengthBrandCheckException(name) {
10721
10721
  return new TypeError(`ByteLengthQueuingStrategy.prototype.${name} can only be used on a ByteLengthQueuingStrategy`);
10722
10722
  }
10723
- function IsByteLengthQueuingStrategy(x2) {
10724
- if (!typeIsObject(x2)) {
10723
+ function IsByteLengthQueuingStrategy(x3) {
10724
+ if (!typeIsObject(x3)) {
10725
10725
  return false;
10726
10726
  }
10727
- if (!Object.prototype.hasOwnProperty.call(x2, "_byteLengthQueuingStrategyHighWaterMark")) {
10727
+ if (!Object.prototype.hasOwnProperty.call(x3, "_byteLengthQueuingStrategyHighWaterMark")) {
10728
10728
  return false;
10729
10729
  }
10730
- return x2 instanceof ByteLengthQueuingStrategy;
10730
+ return x3 instanceof ByteLengthQueuingStrategy;
10731
10731
  }
10732
10732
  const countSizeFunction = () => {
10733
10733
  return 1;
@@ -10772,14 +10772,14 @@ var require_ponyfill_es2018 = __commonJS({
10772
10772
  function countBrandCheckException(name) {
10773
10773
  return new TypeError(`CountQueuingStrategy.prototype.${name} can only be used on a CountQueuingStrategy`);
10774
10774
  }
10775
- function IsCountQueuingStrategy(x2) {
10776
- if (!typeIsObject(x2)) {
10775
+ function IsCountQueuingStrategy(x3) {
10776
+ if (!typeIsObject(x3)) {
10777
10777
  return false;
10778
10778
  }
10779
- if (!Object.prototype.hasOwnProperty.call(x2, "_countQueuingStrategyHighWaterMark")) {
10779
+ if (!Object.prototype.hasOwnProperty.call(x3, "_countQueuingStrategyHighWaterMark")) {
10780
10780
  return false;
10781
10781
  }
10782
- return x2 instanceof CountQueuingStrategy;
10782
+ return x3 instanceof CountQueuingStrategy;
10783
10783
  }
10784
10784
  function convertTransformer(original, context) {
10785
10785
  assertDictionary(original, context);
@@ -10900,14 +10900,14 @@ var require_ponyfill_es2018 = __commonJS({
10900
10900
  TransformStreamSetBackpressure(stream, true);
10901
10901
  stream._transformStreamController = void 0;
10902
10902
  }
10903
- function IsTransformStream(x2) {
10904
- if (!typeIsObject(x2)) {
10903
+ function IsTransformStream(x3) {
10904
+ if (!typeIsObject(x3)) {
10905
10905
  return false;
10906
10906
  }
10907
- if (!Object.prototype.hasOwnProperty.call(x2, "_transformStreamController")) {
10907
+ if (!Object.prototype.hasOwnProperty.call(x3, "_transformStreamController")) {
10908
10908
  return false;
10909
10909
  }
10910
- return x2 instanceof TransformStream;
10910
+ return x3 instanceof TransformStream;
10911
10911
  }
10912
10912
  function TransformStreamError(stream, e2) {
10913
10913
  ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e2);
@@ -10988,14 +10988,14 @@ var require_ponyfill_es2018 = __commonJS({
10988
10988
  configurable: true
10989
10989
  });
10990
10990
  }
10991
- function IsTransformStreamDefaultController(x2) {
10992
- if (!typeIsObject(x2)) {
10991
+ function IsTransformStreamDefaultController(x3) {
10992
+ if (!typeIsObject(x3)) {
10993
10993
  return false;
10994
10994
  }
10995
- if (!Object.prototype.hasOwnProperty.call(x2, "_controlledTransformStream")) {
10995
+ if (!Object.prototype.hasOwnProperty.call(x3, "_controlledTransformStream")) {
10996
10996
  return false;
10997
10997
  }
10998
- return x2 instanceof TransformStreamDefaultController;
10998
+ return x3 instanceof TransformStreamDefaultController;
10999
10999
  }
11000
11000
  function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm) {
11001
11001
  controller._controlledTransformStream = stream;
@@ -11286,12 +11286,12 @@ async function* toIterator(parts, clone3 = true) {
11286
11286
  yield part;
11287
11287
  }
11288
11288
  } else {
11289
- let position = 0, b = (
11289
+ let position = 0, b2 = (
11290
11290
  /** @type {Blob} */
11291
11291
  part
11292
11292
  );
11293
- while (position !== b.size) {
11294
- const chunk = b.slice(position, Math.min(b.size, position + POOL_SIZE));
11293
+ while (position !== b2.size) {
11294
+ const chunk = b2.slice(position, Math.min(b2.size, position + POOL_SIZE));
11295
11295
  const buffer = await chunk.arrayBuffer();
11296
11296
  position += buffer.byteLength;
11297
11297
  yield new Uint8Array(buffer);
@@ -11515,18 +11515,18 @@ var init_file = __esm({
11515
11515
  });
11516
11516
 
11517
11517
  // node_modules/formdata-polyfill/esm.min.js
11518
- function formDataToBlob(F2, B = fetch_blob_default) {
11519
- var b = `${r()}${r()}`.replace(/\./g, "").slice(-28).padStart(32, "-"), c = [], p = `--${b}\r
11518
+ function formDataToBlob(F3, B2 = fetch_blob_default) {
11519
+ var b2 = `${r()}${r()}`.replace(/\./g, "").slice(-28).padStart(32, "-"), c = [], p = `--${b2}\r
11520
11520
  Content-Disposition: form-data; name="`;
11521
- F2.forEach((v, n) => typeof v == "string" ? c.push(p + e(n) + `"\r
11521
+ F3.forEach((v2, n) => typeof v2 == "string" ? c.push(p + e(n) + `"\r
11522
11522
  \r
11523
- ${v.replace(/\r(?!\n)|(?<!\r)\n/g, "\r\n")}\r
11524
- `) : c.push(p + e(n) + `"; filename="${e(v.name, 1)}"\r
11525
- Content-Type: ${v.type || "application/octet-stream"}\r
11523
+ ${v2.replace(/\r(?!\n)|(?<!\r)\n/g, "\r\n")}\r
11524
+ `) : c.push(p + e(n) + `"; filename="${e(v2.name, 1)}"\r
11525
+ Content-Type: ${v2.type || "application/octet-stream"}\r
11526
11526
  \r
11527
- `, v, "\r\n"));
11528
- c.push(`--${b}--`);
11529
- return new B(c, { type: "multipart/form-data; boundary=" + b });
11527
+ `, v2, "\r\n"));
11528
+ c.push(`--${b2}--`);
11529
+ return new B2(c, { type: "multipart/form-data; boundary=" + b2 });
11530
11530
  }
11531
11531
  var t, i, h, r, m, f, e, x, FormData;
11532
11532
  var init_esm_min = __esm({
@@ -11537,7 +11537,7 @@ var init_esm_min = __esm({
11537
11537
  ({ toStringTag: t, iterator: i, hasInstance: h } = Symbol);
11538
11538
  r = Math.random;
11539
11539
  m = "append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(",");
11540
- f = (a, b, c) => (a += "", /^(Blob|File)$/.test(b && b[t]) ? [(c = c !== void 0 ? c + "" : b[t] == "File" ? b.name : "blob", a), b.name !== c || b[t] == "blob" ? new file_default([b], c, b) : b] : [a, b + ""]);
11540
+ f = (a, b2, c) => (a += "", /^(Blob|File)$/.test(b2 && b2[t]) ? [(c = c !== void 0 ? c + "" : b2[t] == "File" ? b2.name : "blob", a), b2.name !== c || b2[t] == "blob" ? new file_default([b2], c, b2) : b2] : [a, b2 + ""]);
11541
11541
  e = (c, f3) => (f3 ? c : c.replace(/\r?\n|\r/g, "\r\n")).replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22");
11542
11542
  x = (n, a, e2) => {
11543
11543
  if (a.length < e2) {
@@ -11556,7 +11556,7 @@ var init_esm_min = __esm({
11556
11556
  return this.entries();
11557
11557
  }
11558
11558
  static [h](o) {
11559
- return o && typeof o === "object" && o[t] === "FormData" && !m.some((m2) => typeof o[m2] != "function");
11559
+ return o && typeof o === "object" && o[t] === "FormData" && !m.some((m3) => typeof o[m3] != "function");
11560
11560
  }
11561
11561
  append(...a) {
11562
11562
  x("append", arguments, 2);
@@ -11565,39 +11565,39 @@ var init_esm_min = __esm({
11565
11565
  delete(a) {
11566
11566
  x("delete", arguments, 1);
11567
11567
  a += "";
11568
- this.#d = this.#d.filter(([b]) => b !== a);
11568
+ this.#d = this.#d.filter(([b2]) => b2 !== a);
11569
11569
  }
11570
11570
  get(a) {
11571
11571
  x("get", arguments, 1);
11572
11572
  a += "";
11573
- for (var b = this.#d, l = b.length, c = 0; c < l; c++) if (b[c][0] === a) return b[c][1];
11573
+ for (var b2 = this.#d, l3 = b2.length, c = 0; c < l3; c++) if (b2[c][0] === a) return b2[c][1];
11574
11574
  return null;
11575
11575
  }
11576
- getAll(a, b) {
11576
+ getAll(a, b2) {
11577
11577
  x("getAll", arguments, 1);
11578
- b = [];
11578
+ b2 = [];
11579
11579
  a += "";
11580
- this.#d.forEach((c) => c[0] === a && b.push(c[1]));
11581
- return b;
11580
+ this.#d.forEach((c) => c[0] === a && b2.push(c[1]));
11581
+ return b2;
11582
11582
  }
11583
11583
  has(a) {
11584
11584
  x("has", arguments, 1);
11585
11585
  a += "";
11586
- return this.#d.some((b) => b[0] === a);
11586
+ return this.#d.some((b2) => b2[0] === a);
11587
11587
  }
11588
- forEach(a, b) {
11588
+ forEach(a, b2) {
11589
11589
  x("forEach", arguments, 1);
11590
- for (var [c, d] of this) a.call(b, d, c, this);
11590
+ for (var [c, d2] of this) a.call(b2, d2, c, this);
11591
11591
  }
11592
11592
  set(...a) {
11593
11593
  x("set", arguments, 2);
11594
- var b = [], c = true;
11594
+ var b2 = [], c = true;
11595
11595
  a = f(...a);
11596
- this.#d.forEach((d) => {
11597
- d[0] === a[0] ? c && (c = !b.push(a)) : b.push(d);
11596
+ this.#d.forEach((d2) => {
11597
+ d2[0] === a[0] ? c && (c = !b2.push(a)) : b2.push(d2);
11598
11598
  });
11599
- c && b.push(a);
11600
- this.#d = b;
11599
+ c && b2.push(a);
11600
+ this.#d = b2;
11601
11601
  }
11602
11602
  *entries() {
11603
11603
  yield* this.#d;
@@ -11720,14 +11720,14 @@ __export(multipart_parser_exports, {
11720
11720
  toFormData: () => toFormData
11721
11721
  });
11722
11722
  function _fileName(headerValue) {
11723
- const m2 = headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
11724
- if (!m2) {
11723
+ const m3 = headerValue.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);
11724
+ if (!m3) {
11725
11725
  return;
11726
11726
  }
11727
- const match = m2[2] || m2[3] || "";
11727
+ const match = m3[2] || m3[3] || "";
11728
11728
  let filename = match.slice(match.lastIndexOf("\\") + 1);
11729
11729
  filename = filename.replace(/%22/g, '"');
11730
- filename = filename.replace(/&#(\d{4});/g, (m3, code) => {
11730
+ filename = filename.replace(/&#(\d{4});/g, (m4, code) => {
11731
11731
  return String.fromCharCode(code);
11732
11732
  });
11733
11733
  return filename;
@@ -11736,11 +11736,11 @@ async function toFormData(Body2, ct) {
11736
11736
  if (!/multipart/i.test(ct)) {
11737
11737
  throw new TypeError("Failed to fetch");
11738
11738
  }
11739
- const m2 = ct.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
11740
- if (!m2) {
11739
+ const m3 = ct.match(/boundary=(?:"([^"]+)"|([^;]+))/i);
11740
+ if (!m3) {
11741
11741
  throw new TypeError("no or bad content-type header, no multipart boundary");
11742
11742
  }
11743
- const parser = new MultipartParser(m2[1] || m2[2]);
11743
+ const parser = new MultipartParser(m3[1] || m3[2]);
11744
11744
  let headerField;
11745
11745
  let headerValue;
11746
11746
  let entryValue;
@@ -11785,9 +11785,9 @@ async function toFormData(Body2, ct) {
11785
11785
  headerValue += decoder.decode();
11786
11786
  headerField = headerField.toLowerCase();
11787
11787
  if (headerField === "content-disposition") {
11788
- const m3 = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
11789
- if (m3) {
11790
- entryName = m3[2] || m3[3] || "";
11788
+ const m4 = headerValue.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);
11789
+ if (m4) {
11790
+ entryName = m4[2] || m4[3] || "";
11791
11791
  }
11792
11792
  filename = _fileName(headerValue);
11793
11793
  if (filename) {
@@ -13364,7 +13364,7 @@ function blockToMarkdown(block) {
13364
13364
  const marker = block.type === "bulletList" ? "- " : "1. ";
13365
13365
  const items = Array.isArray(block.content) ? block.content : [];
13366
13366
  return items.filter((i2) => i2?.type === "listItem").map((i2) => {
13367
- const para = (i2.content || []).find((b) => b?.type === "paragraph");
13367
+ const para = (i2.content || []).find((b2) => b2?.type === "paragraph");
13368
13368
  return marker + inlineToMarkdown(para?.content);
13369
13369
  }).join("\n");
13370
13370
  }
@@ -13374,7 +13374,7 @@ function blockToMarkdown(block) {
13374
13374
  }
13375
13375
  case "blockquote": {
13376
13376
  const inner = inlineToMarkdown(block.content);
13377
- return inner.split("\n").map((l) => "> " + l).join("\n");
13377
+ return inner.split("\n").map((l3) => "> " + l3).join("\n");
13378
13378
  }
13379
13379
  default:
13380
13380
  return inlineToMarkdown(block.content);
@@ -13389,7 +13389,7 @@ function inlineNodeToMarkdown(node) {
13389
13389
  switch (node.type) {
13390
13390
  case "text": {
13391
13391
  let t2 = node.text || "";
13392
- const marks = Array.isArray(node.marks) ? node.marks.map((m2) => m2?.type) : [];
13392
+ const marks = Array.isArray(node.marks) ? node.marks.map((m3) => m3?.type) : [];
13393
13393
  if (marks.includes("code")) return "`" + t2 + "`";
13394
13394
  if (marks.includes("strong")) t2 = "**" + t2 + "**";
13395
13395
  if (marks.includes("em")) t2 = "*" + t2 + "*";
@@ -13412,6 +13412,1465 @@ var init_adf = __esm({
13412
13412
  }
13413
13413
  });
13414
13414
 
13415
+ // node_modules/marked/lib/marked.esm.js
13416
+ function M() {
13417
+ return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
13418
+ }
13419
+ function N(l3) {
13420
+ T = l3;
13421
+ }
13422
+ function E(l3) {
13423
+ let e2 = [];
13424
+ return (t2) => {
13425
+ let n = Math.max(0, Math.min(3, t2 - 1)), s2 = e2[n];
13426
+ return s2 || (s2 = l3(n), e2[n] = s2), s2;
13427
+ };
13428
+ }
13429
+ function d(l3, e2 = "") {
13430
+ let t2 = typeof l3 == "string" ? l3 : l3.source, n = { replace: (s2, r2) => {
13431
+ let i2 = typeof r2 == "string" ? r2 : r2.source;
13432
+ return i2 = i2.replace(m2.caret, "$1"), t2 = t2.replace(s2, i2), n;
13433
+ }, getRegex: () => new RegExp(t2, e2) };
13434
+ return n;
13435
+ }
13436
+ function O(l3, e2) {
13437
+ if (e2) {
13438
+ if (m2.escapeTest.test(l3)) return l3.replace(m2.escapeReplace, ge);
13439
+ } else if (m2.escapeTestNoEncode.test(l3)) return l3.replace(m2.escapeReplaceNoEncode, ge);
13440
+ return l3;
13441
+ }
13442
+ function V(l3) {
13443
+ try {
13444
+ l3 = encodeURI(l3).replace(m2.percentDecode, "%");
13445
+ } catch {
13446
+ return null;
13447
+ }
13448
+ return l3;
13449
+ }
13450
+ function Y(l3, e2) {
13451
+ let t2 = l3.replace(m2.findPipe, (r2, i2, o) => {
13452
+ let u = false, a = i2;
13453
+ for (; --a >= 0 && o[a] === "\\"; ) u = !u;
13454
+ return u ? "|" : " |";
13455
+ }), n = t2.split(m2.splitPipe), s2 = 0;
13456
+ if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e2) if (n.length > e2) n.splice(e2);
13457
+ else for (; n.length < e2; ) n.push("");
13458
+ for (; s2 < n.length; s2++) n[s2] = n[s2].trim().replace(m2.slashPipe, "|");
13459
+ return n;
13460
+ }
13461
+ function $(l3, e2, t2) {
13462
+ let n = l3.length;
13463
+ if (n === 0) return "";
13464
+ let s2 = 0;
13465
+ for (; s2 < n; ) {
13466
+ let r2 = l3.charAt(n - s2 - 1);
13467
+ if (r2 === e2 && !t2) s2++;
13468
+ else if (r2 !== e2 && t2) s2++;
13469
+ else break;
13470
+ }
13471
+ return l3.slice(0, n - s2);
13472
+ }
13473
+ function ee(l3) {
13474
+ let e2 = l3.split(`
13475
+ `), t2 = e2.length - 1;
13476
+ for (; t2 >= 0 && m2.blankLine.test(e2[t2]); ) t2--;
13477
+ return e2.length - t2 <= 2 ? l3 : e2.slice(0, t2 + 1).join(`
13478
+ `);
13479
+ }
13480
+ function fe(l3, e2) {
13481
+ if (l3.indexOf(e2[1]) === -1) return -1;
13482
+ let t2 = 0;
13483
+ for (let n = 0; n < l3.length; n++) if (l3[n] === "\\") n++;
13484
+ else if (l3[n] === e2[0]) t2++;
13485
+ else if (l3[n] === e2[1] && (t2--, t2 < 0)) return n;
13486
+ return t2 > 0 ? -2 : -1;
13487
+ }
13488
+ function me(l3, e2 = 0) {
13489
+ let t2 = e2, n = "";
13490
+ for (let s2 of l3) if (s2 === " ") {
13491
+ let r2 = 4 - t2 % 4;
13492
+ n += " ".repeat(r2), t2 += r2;
13493
+ } else n += s2, t2++;
13494
+ return n;
13495
+ }
13496
+ function xe(l3, e2, t2, n, s2) {
13497
+ let r2 = e2.href, i2 = e2.title || null, o = l3[1].replace(s2.other.outputLinkReplace, "$1");
13498
+ n.state.inLink = true;
13499
+ let u = { type: l3[0].charAt(0) === "!" ? "image" : "link", raw: t2, href: r2, title: i2, text: o, tokens: n.inlineTokens(o) };
13500
+ return n.state.inLink = false, u;
13501
+ }
13502
+ function st(l3, e2, t2) {
13503
+ let n = l3.match(t2.other.indentCodeCompensation);
13504
+ if (n === null) return e2;
13505
+ let s2 = n[1];
13506
+ return e2.split(`
13507
+ `).map((r2) => {
13508
+ let i2 = r2.match(t2.other.beginningSpace);
13509
+ if (i2 === null) return r2;
13510
+ let [o] = i2;
13511
+ return o.length >= s2.length ? r2.slice(s2.length) : r2;
13512
+ }).join(`
13513
+ `);
13514
+ }
13515
+ function g(l3, e2) {
13516
+ return z.parse(l3, e2);
13517
+ }
13518
+ var T, _, Te, m2, Oe, we, ye, B, Pe, j, oe, ae, Se, F2, $e, U, Le, _e, H, K, ze, le, Me, W, se, Ee, Ie, Ae, Ce, ue, Be, I, Z2, X, De, pe, qe, ve, He, ce, Ze, Ge, he, Ne, Qe, je, Fe, Ue, Ke, We, Xe, Je, Ve, v, Ye, ke, de, et, ie, J, tt, Q, nt, D, A2, rt, ge, w, x2, y, L, b, P, q, z, Ft, Ut, Kt, Wt, Xt, Vt, Yt;
13519
+ var init_marked_esm = __esm({
13520
+ "node_modules/marked/lib/marked.esm.js"() {
13521
+ "use strict";
13522
+ T = M();
13523
+ _ = { exec: () => null };
13524
+ Te = ((l3 = "") => {
13525
+ try {
13526
+ return !!new RegExp("(?<=1)(?<!1)" + l3);
13527
+ } catch {
13528
+ return false;
13529
+ }
13530
+ })();
13531
+ m2 = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (l3) => new RegExp(`^( {0,3}${l3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: E((l3) => new RegExp(`^ {0,${l3}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: E((l3) => new RegExp(`^ {0,${l3}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: E((l3) => new RegExp(`^ {0,${l3}}(?:\`\`\`|~~~)`)), headingBeginRegex: E((l3) => new RegExp(`^ {0,${l3}}#`)), htmlBeginRegex: E((l3) => new RegExp(`^ {0,${l3}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: E((l3) => new RegExp(`^ {0,${l3}}>`)) };
13532
+ Oe = /^(?:[ \t]*(?:\n|$))+/;
13533
+ we = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
13534
+ ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
13535
+ B = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
13536
+ Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
13537
+ j = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
13538
+ oe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
13539
+ ae = d(oe).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
13540
+ Se = d(oe).replace(/bull/g, j).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
13541
+ F2 = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
13542
+ $e = /^[^\n]+/;
13543
+ U = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
13544
+ Le = d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", U).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
13545
+ _e = d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, j).getRegex();
13546
+ H = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
13547
+ K = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
13548
+ ze = d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", K).replace("tag", H).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
13549
+ le = d(F2).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex();
13550
+ Me = d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", le).getRegex();
13551
+ W = { blockquote: Me, code: we, def: Le, fences: ye, heading: Pe, hr: B, html: ze, lheading: ae, list: _e, newline: Oe, paragraph: le, table: _, text: $e };
13552
+ se = d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex();
13553
+ Ee = { ...W, lheading: Se, table: se, paragraph: d(F2).replace("hr", B).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", se).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", H).getRegex() };
13554
+ Ie = { ...W, html: d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", K).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: d(F2).replace("hr", B).replace("heading", ` *#{1,6} *[^
13555
+ ]`).replace("lheading", ae).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
13556
+ Ae = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
13557
+ Ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
13558
+ ue = /^( {2,}|\\)\n(?!\s*$)/;
13559
+ Be = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
13560
+ I = /[\p{P}\p{S}]/u;
13561
+ Z2 = /[\s\p{P}\p{S}]/u;
13562
+ X = /[^\s\p{P}\p{S}]/u;
13563
+ De = d(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Z2).getRegex();
13564
+ pe = /(?!~)[\p{P}\p{S}]/u;
13565
+ qe = /(?!~)[\s\p{P}\p{S}]/u;
13566
+ ve = /(?:[^\s\p{P}\p{S}]|~)/u;
13567
+ He = d(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Te ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
13568
+ ce = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
13569
+ Ze = d(ce, "u").replace(/punct/g, I).getRegex();
13570
+ Ge = d(ce, "u").replace(/punct/g, pe).getRegex();
13571
+ he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
13572
+ Ne = d(he, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z2).replace(/punct/g, I).getRegex();
13573
+ Qe = d(he, "gu").replace(/notPunctSpace/g, ve).replace(/punctSpace/g, qe).replace(/punct/g, pe).getRegex();
13574
+ je = d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z2).replace(/punct/g, I).getRegex();
13575
+ Fe = d(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, I).getRegex();
13576
+ Ue = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)";
13577
+ Ke = d(Ue, "gu").replace(/notPunctSpace/g, X).replace(/punctSpace/g, Z2).replace(/punct/g, I).getRegex();
13578
+ We = d(/\\(punct)/, "gu").replace(/punct/g, I).getRegex();
13579
+ Xe = d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
13580
+ Je = d(K).replace("(?:-->|$)", "-->").getRegex();
13581
+ Ve = d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
13582
+ v = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/;
13583
+ Ye = d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", v).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
13584
+ ke = d(/^!?\[(label)\]\[(ref)\]/).replace("label", v).replace("ref", U).getRegex();
13585
+ de = d(/^!?\[(ref)\](?:\[\])?/).replace("ref", U).getRegex();
13586
+ et = d("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", de).getRegex();
13587
+ ie = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
13588
+ J = { _backpedal: _, anyPunctuation: We, autolink: Xe, blockSkip: He, br: ue, code: Ce, del: _, delLDelim: _, delRDelim: _, emStrongLDelim: Ze, emStrongRDelimAst: Ne, emStrongRDelimUnd: je, escape: Ae, link: Ye, nolink: de, punctuation: De, reflink: ke, reflinkSearch: et, tag: Ve, text: Be, url: _ };
13589
+ tt = { ...J, link: d(/^!?\[(label)\]\((.*?)\)/).replace("label", v).getRegex(), reflink: d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", v).getRegex() };
13590
+ Q = { ...J, emStrongRDelimAst: Qe, emStrongLDelim: Ge, delLDelim: Fe, delRDelim: Ke, url: d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ie).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ie).getRegex() };
13591
+ nt = { ...Q, br: d(ue).replace("{2,}", "*").getRegex(), text: d(Q.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
13592
+ D = { normal: W, gfm: Ee, pedantic: Ie };
13593
+ A2 = { normal: J, gfm: Q, breaks: nt, pedantic: tt };
13594
+ rt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
13595
+ ge = (l3) => rt[l3];
13596
+ w = class {
13597
+ options;
13598
+ rules;
13599
+ lexer;
13600
+ constructor(e2) {
13601
+ this.options = e2 || T;
13602
+ }
13603
+ space(e2) {
13604
+ let t2 = this.rules.block.newline.exec(e2);
13605
+ if (t2 && t2[0].length > 0) return { type: "space", raw: t2[0] };
13606
+ }
13607
+ code(e2) {
13608
+ let t2 = this.rules.block.code.exec(e2);
13609
+ if (t2) {
13610
+ let n = this.options.pedantic ? t2[0] : ee(t2[0]), s2 = n.replace(this.rules.other.codeRemoveIndent, "");
13611
+ return { type: "code", raw: n, codeBlockStyle: "indented", text: s2 };
13612
+ }
13613
+ }
13614
+ fences(e2) {
13615
+ let t2 = this.rules.block.fences.exec(e2);
13616
+ if (t2) {
13617
+ let n = t2[0], s2 = st(n, t2[3] || "", this.rules);
13618
+ return { type: "code", raw: n, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: s2 };
13619
+ }
13620
+ }
13621
+ heading(e2) {
13622
+ let t2 = this.rules.block.heading.exec(e2);
13623
+ if (t2) {
13624
+ let n = t2[2].trim();
13625
+ if (this.rules.other.endingHash.test(n)) {
13626
+ let s2 = $(n, "#");
13627
+ (this.options.pedantic || !s2 || this.rules.other.endingSpaceChar.test(s2)) && (n = s2.trim());
13628
+ }
13629
+ return { type: "heading", raw: $(t2[0], `
13630
+ `), depth: t2[1].length, text: n, tokens: this.lexer.inline(n) };
13631
+ }
13632
+ }
13633
+ hr(e2) {
13634
+ let t2 = this.rules.block.hr.exec(e2);
13635
+ if (t2) return { type: "hr", raw: $(t2[0], `
13636
+ `) };
13637
+ }
13638
+ blockquote(e2) {
13639
+ let t2 = this.rules.block.blockquote.exec(e2);
13640
+ if (t2) {
13641
+ let n = $(t2[0], `
13642
+ `).split(`
13643
+ `), s2 = "", r2 = "", i2 = [];
13644
+ for (; n.length > 0; ) {
13645
+ let o = false, u = [], a;
13646
+ for (a = 0; a < n.length; a++) if (this.rules.other.blockquoteStart.test(n[a])) u.push(n[a]), o = true;
13647
+ else if (!o) u.push(n[a]);
13648
+ else break;
13649
+ n = n.slice(a);
13650
+ let c = u.join(`
13651
+ `), p = c.replace(this.rules.other.blockquoteSetextReplace, `
13652
+ $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
13653
+ s2 = s2 ? `${s2}
13654
+ ${c}` : c, r2 = r2 ? `${r2}
13655
+ ${p}` : p;
13656
+ let k = this.lexer.state.top;
13657
+ if (this.lexer.state.top = true, this.lexer.blockTokens(p, i2, true), this.lexer.state.top = k, n.length === 0) break;
13658
+ let h2 = i2.at(-1);
13659
+ if (h2?.type === "code") break;
13660
+ if (h2?.type === "blockquote") {
13661
+ let R = h2, f3 = R.raw + `
13662
+ ` + n.join(`
13663
+ `), S2 = this.blockquote(f3);
13664
+ i2[i2.length - 1] = S2, s2 = s2.substring(0, s2.length - R.raw.length) + S2.raw, r2 = r2.substring(0, r2.length - R.text.length) + S2.text;
13665
+ break;
13666
+ } else if (h2?.type === "list") {
13667
+ let R = h2, f3 = R.raw + `
13668
+ ` + n.join(`
13669
+ `), S2 = this.list(f3);
13670
+ i2[i2.length - 1] = S2, s2 = s2.substring(0, s2.length - h2.raw.length) + S2.raw, r2 = r2.substring(0, r2.length - R.raw.length) + S2.raw, n = f3.substring(i2.at(-1).raw.length).split(`
13671
+ `);
13672
+ continue;
13673
+ }
13674
+ }
13675
+ return { type: "blockquote", raw: s2, tokens: i2, text: r2 };
13676
+ }
13677
+ }
13678
+ list(e2) {
13679
+ let t2 = this.rules.block.list.exec(e2);
13680
+ if (t2) {
13681
+ let n = t2[1].trim(), s2 = n.length > 1, r2 = { type: "list", raw: "", ordered: s2, start: s2 ? +n.slice(0, -1) : "", loose: false, items: [] };
13682
+ n = s2 ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s2 ? n : "[*+-]");
13683
+ let i2 = this.rules.other.listItemRegex(n), o = false;
13684
+ for (; e2; ) {
13685
+ let a = false, c = "", p = "";
13686
+ if (!(t2 = i2.exec(e2)) || this.rules.block.hr.test(e2)) break;
13687
+ c = t2[0], e2 = e2.substring(c.length);
13688
+ let k = me(t2[2].split(`
13689
+ `, 1)[0], t2[1].length), h2 = e2.split(`
13690
+ `, 1)[0], R = !k.trim(), f3 = 0;
13691
+ if (this.options.pedantic ? (f3 = 2, p = k.trimStart()) : R ? f3 = t2[1].length + 1 : (f3 = k.search(this.rules.other.nonSpaceChar), f3 = f3 > 4 ? 1 : f3, p = k.slice(f3), f3 += t2[1].length), R && this.rules.other.blankLine.test(h2) && (c += h2 + `
13692
+ `, e2 = e2.substring(h2.length + 1), a = true), !a) {
13693
+ let S2 = this.rules.other.nextBulletRegex(f3), te = this.rules.other.hrRegex(f3), ne = this.rules.other.fencesBeginRegex(f3), re = this.rules.other.headingBeginRegex(f3), be = this.rules.other.htmlBeginRegex(f3), Re = this.rules.other.blockquoteBeginRegex(f3);
13694
+ for (; e2; ) {
13695
+ let G = e2.split(`
13696
+ `, 1)[0], C;
13697
+ if (h2 = G, this.options.pedantic ? (h2 = h2.replace(this.rules.other.listReplaceNesting, " "), C = h2) : C = h2.replace(this.rules.other.tabCharGlobal, " "), ne.test(h2) || re.test(h2) || be.test(h2) || Re.test(h2) || S2.test(h2) || te.test(h2)) break;
13698
+ if (C.search(this.rules.other.nonSpaceChar) >= f3 || !h2.trim()) p += `
13699
+ ` + C.slice(f3);
13700
+ else {
13701
+ if (R || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ne.test(k) || re.test(k) || te.test(k)) break;
13702
+ p += `
13703
+ ` + h2;
13704
+ }
13705
+ R = !h2.trim(), c += G + `
13706
+ `, e2 = e2.substring(G.length + 1), k = C.slice(f3);
13707
+ }
13708
+ }
13709
+ r2.loose || (o ? r2.loose = true : this.rules.other.doubleBlankLine.test(c) && (o = true)), r2.items.push({ type: "list_item", raw: c, task: !!this.options.gfm && this.rules.other.listIsTask.test(p), loose: false, text: p, tokens: [] }), r2.raw += c;
13710
+ }
13711
+ let u = r2.items.at(-1);
13712
+ if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
13713
+ else return;
13714
+ r2.raw = r2.raw.trimEnd();
13715
+ for (let a of r2.items) {
13716
+ this.lexer.state.top = false, a.tokens = this.lexer.blockTokens(a.text, []);
13717
+ let c = a.tokens[0];
13718
+ if (a.task && (c?.type === "text" || c?.type === "paragraph")) {
13719
+ a.text = a.text.replace(this.rules.other.listReplaceTask, ""), c.raw = c.raw.replace(this.rules.other.listReplaceTask, ""), c.text = c.text.replace(this.rules.other.listReplaceTask, "");
13720
+ for (let k = this.lexer.inlineQueue.length - 1; k >= 0; k--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
13721
+ this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
13722
+ break;
13723
+ }
13724
+ let p = this.rules.other.listTaskCheckbox.exec(a.raw);
13725
+ if (p) {
13726
+ let k = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
13727
+ a.checked = k.checked, r2.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = k.raw + a.tokens[0].raw, a.tokens[0].text = k.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(k)) : a.tokens.unshift({ type: "paragraph", raw: k.raw, text: k.raw, tokens: [k] }) : a.tokens.unshift(k);
13728
+ }
13729
+ } else a.task && (a.task = false);
13730
+ if (!r2.loose) {
13731
+ let p = a.tokens.filter((h2) => h2.type === "space"), k = p.length > 0 && p.some((h2) => this.rules.other.anyLine.test(h2.raw));
13732
+ r2.loose = k;
13733
+ }
13734
+ }
13735
+ if (r2.loose) for (let a of r2.items) {
13736
+ a.loose = true;
13737
+ for (let c of a.tokens) c.type === "text" && (c.type = "paragraph");
13738
+ }
13739
+ return r2;
13740
+ }
13741
+ }
13742
+ html(e2) {
13743
+ let t2 = this.rules.block.html.exec(e2);
13744
+ if (t2) {
13745
+ let n = ee(t2[0]);
13746
+ return { type: "html", block: true, raw: n, pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: n };
13747
+ }
13748
+ }
13749
+ def(e2) {
13750
+ let t2 = this.rules.block.def.exec(e2);
13751
+ if (t2) {
13752
+ let n = t2[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s2 = t2[2] ? t2[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r2 = t2[3] ? t2[3].substring(1, t2[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t2[3];
13753
+ return { type: "def", tag: n, raw: $(t2[0], `
13754
+ `), href: s2, title: r2 };
13755
+ }
13756
+ }
13757
+ table(e2) {
13758
+ let t2 = this.rules.block.table.exec(e2);
13759
+ if (!t2 || !this.rules.other.tableDelimiter.test(t2[2])) return;
13760
+ let n = Y(t2[1]), s2 = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), r2 = t2[3]?.trim() ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split(`
13761
+ `) : [], i2 = { type: "table", raw: $(t2[0], `
13762
+ `), header: [], align: [], rows: [] };
13763
+ if (n.length === s2.length) {
13764
+ for (let o of s2) this.rules.other.tableAlignRight.test(o) ? i2.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? i2.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? i2.align.push("left") : i2.align.push(null);
13765
+ for (let o = 0; o < n.length; o++) i2.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: true, align: i2.align[o] });
13766
+ for (let o of r2) i2.rows.push(Y(o, i2.header.length).map((u, a) => ({ text: u, tokens: this.lexer.inline(u), header: false, align: i2.align[a] })));
13767
+ return i2;
13768
+ }
13769
+ }
13770
+ lheading(e2) {
13771
+ let t2 = this.rules.block.lheading.exec(e2);
13772
+ if (t2) {
13773
+ let n = t2[1].trim();
13774
+ return { type: "heading", raw: $(t2[0], `
13775
+ `), depth: t2[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
13776
+ }
13777
+ }
13778
+ paragraph(e2) {
13779
+ let t2 = this.rules.block.paragraph.exec(e2);
13780
+ if (t2) {
13781
+ let n = t2[1].charAt(t2[1].length - 1) === `
13782
+ ` ? t2[1].slice(0, -1) : t2[1];
13783
+ return { type: "paragraph", raw: t2[0], text: n, tokens: this.lexer.inline(n) };
13784
+ }
13785
+ }
13786
+ text(e2) {
13787
+ let t2 = this.rules.block.text.exec(e2);
13788
+ if (t2) return { type: "text", raw: t2[0], text: t2[0], tokens: this.lexer.inline(t2[0]) };
13789
+ }
13790
+ escape(e2) {
13791
+ let t2 = this.rules.inline.escape.exec(e2);
13792
+ if (t2) return { type: "escape", raw: t2[0], text: t2[1] };
13793
+ }
13794
+ tag(e2) {
13795
+ let t2 = this.rules.inline.tag.exec(e2);
13796
+ if (t2) return !this.lexer.state.inLink && this.rules.other.startATag.test(t2[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t2[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t2[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t2[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t2[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t2[0] };
13797
+ }
13798
+ link(e2) {
13799
+ let t2 = this.rules.inline.link.exec(e2);
13800
+ if (t2) {
13801
+ let n = t2[2].trim();
13802
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
13803
+ if (!this.rules.other.endAngleBracket.test(n)) return;
13804
+ let i2 = $(n.slice(0, -1), "\\");
13805
+ if ((n.length - i2.length) % 2 === 0) return;
13806
+ } else {
13807
+ let i2 = fe(t2[2], "()");
13808
+ if (i2 === -2) return;
13809
+ if (i2 > -1) {
13810
+ let u = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + i2;
13811
+ t2[2] = t2[2].substring(0, i2), t2[0] = t2[0].substring(0, u).trim(), t2[3] = "";
13812
+ }
13813
+ }
13814
+ let s2 = t2[2], r2 = "";
13815
+ if (this.options.pedantic) {
13816
+ let i2 = this.rules.other.pedanticHrefTitle.exec(s2);
13817
+ i2 && (s2 = i2[1], r2 = i2[3]);
13818
+ } else r2 = t2[3] ? t2[3].slice(1, -1) : "";
13819
+ return s2 = s2.trim(), this.rules.other.startAngleBracket.test(s2) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s2 = s2.slice(1) : s2 = s2.slice(1, -1)), xe(t2, { href: s2 && s2.replace(this.rules.inline.anyPunctuation, "$1"), title: r2 && r2.replace(this.rules.inline.anyPunctuation, "$1") }, t2[0], this.lexer, this.rules);
13820
+ }
13821
+ }
13822
+ reflink(e2, t2) {
13823
+ let n;
13824
+ if ((n = this.rules.inline.reflink.exec(e2)) || (n = this.rules.inline.nolink.exec(e2))) {
13825
+ let s2 = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), r2 = t2[s2.toLowerCase()];
13826
+ if (!r2) {
13827
+ let i2 = n[0].charAt(0);
13828
+ return { type: "text", raw: i2, text: i2 };
13829
+ }
13830
+ return xe(n, r2, n[0], this.lexer, this.rules);
13831
+ }
13832
+ }
13833
+ emStrong(e2, t2, n = "") {
13834
+ let s2 = this.rules.inline.emStrongLDelim.exec(e2);
13835
+ if (!s2 || !s2[1] && !s2[2] && !s2[3] && !s2[4] || s2[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
13836
+ if (!(s2[1] || s2[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
13837
+ let i2 = [...s2[0]].length - 1, o, u, a = i2, c = 0, p = s2[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
13838
+ for (p.lastIndex = 0, t2 = t2.slice(-1 * e2.length + i2); (s2 = p.exec(t2)) !== null; ) {
13839
+ if (o = s2[1] || s2[2] || s2[3] || s2[4] || s2[5] || s2[6], !o) continue;
13840
+ if (u = [...o].length, s2[3] || s2[4]) {
13841
+ a += u;
13842
+ continue;
13843
+ } else if ((s2[5] || s2[6]) && i2 % 3 && !((i2 + u) % 3)) {
13844
+ c += u;
13845
+ continue;
13846
+ }
13847
+ if (a -= u, a > 0) continue;
13848
+ u = Math.min(u, u + a + c);
13849
+ let k = [...s2[0]][0].length, h2 = e2.slice(0, i2 + s2.index + k + u);
13850
+ if (Math.min(i2, u) % 2) {
13851
+ let f3 = h2.slice(1, -1);
13852
+ return { type: "em", raw: h2, text: f3, tokens: this.lexer.inlineTokens(f3) };
13853
+ }
13854
+ let R = h2.slice(2, -2);
13855
+ return { type: "strong", raw: h2, text: R, tokens: this.lexer.inlineTokens(R) };
13856
+ }
13857
+ }
13858
+ }
13859
+ codespan(e2) {
13860
+ let t2 = this.rules.inline.code.exec(e2);
13861
+ if (t2) {
13862
+ let n = t2[2].replace(this.rules.other.newLineCharGlobal, " "), s2 = this.rules.other.nonSpaceChar.test(n), r2 = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
13863
+ return s2 && r2 && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t2[0], text: n };
13864
+ }
13865
+ }
13866
+ br(e2) {
13867
+ let t2 = this.rules.inline.br.exec(e2);
13868
+ if (t2) return { type: "br", raw: t2[0] };
13869
+ }
13870
+ del(e2, t2, n = "") {
13871
+ let s2 = this.rules.inline.delLDelim.exec(e2);
13872
+ if (!s2) return;
13873
+ if (!(s2[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
13874
+ let i2 = [...s2[0]].length - 1, o, u, a = i2, c = this.rules.inline.delRDelim;
13875
+ for (c.lastIndex = 0, t2 = t2.slice(-1 * e2.length + i2); (s2 = c.exec(t2)) !== null; ) {
13876
+ if (o = s2[1] || s2[2] || s2[3] || s2[4] || s2[5] || s2[6], !o || (u = [...o].length, u !== i2)) continue;
13877
+ if (s2[3] || s2[4]) {
13878
+ a += u;
13879
+ continue;
13880
+ }
13881
+ if (a -= u, a > 0) continue;
13882
+ u = Math.min(u, u + a);
13883
+ let p = [...s2[0]][0].length, k = e2.slice(0, i2 + s2.index + p + u), h2 = k.slice(i2, -i2);
13884
+ return { type: "del", raw: k, text: h2, tokens: this.lexer.inlineTokens(h2) };
13885
+ }
13886
+ }
13887
+ }
13888
+ autolink(e2) {
13889
+ let t2 = this.rules.inline.autolink.exec(e2);
13890
+ if (t2) {
13891
+ let n, s2;
13892
+ return t2[2] === "@" ? (n = t2[1], s2 = "mailto:" + n) : (n = t2[1], s2 = n), { type: "link", raw: t2[0], text: n, href: s2, tokens: [{ type: "text", raw: n, text: n }] };
13893
+ }
13894
+ }
13895
+ url(e2) {
13896
+ let t2;
13897
+ if (t2 = this.rules.inline.url.exec(e2)) {
13898
+ let n, s2;
13899
+ if (t2[2] === "@") n = t2[0], s2 = "mailto:" + n;
13900
+ else {
13901
+ let r2;
13902
+ do
13903
+ r2 = t2[0], t2[0] = this.rules.inline._backpedal.exec(t2[0])?.[0] ?? "";
13904
+ while (r2 !== t2[0]);
13905
+ n = t2[0], t2[1] === "www." ? s2 = "http://" + t2[0] : s2 = t2[0];
13906
+ }
13907
+ return { type: "link", raw: t2[0], text: n, href: s2, tokens: [{ type: "text", raw: n, text: n }] };
13908
+ }
13909
+ }
13910
+ inlineText(e2) {
13911
+ let t2 = this.rules.inline.text.exec(e2);
13912
+ if (t2) {
13913
+ let n = this.lexer.state.inRawBlock;
13914
+ return { type: "text", raw: t2[0], text: t2[0], escaped: n };
13915
+ }
13916
+ }
13917
+ };
13918
+ x2 = class l {
13919
+ tokens;
13920
+ options;
13921
+ state;
13922
+ inlineQueue;
13923
+ tokenizer;
13924
+ constructor(e2) {
13925
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e2 || T, this.options.tokenizer = this.options.tokenizer || new w(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
13926
+ let t2 = { other: m2, block: D.normal, inline: A2.normal };
13927
+ this.options.pedantic ? (t2.block = D.pedantic, t2.inline = A2.pedantic) : this.options.gfm && (t2.block = D.gfm, this.options.breaks ? t2.inline = A2.breaks : t2.inline = A2.gfm), this.tokenizer.rules = t2;
13928
+ }
13929
+ static get rules() {
13930
+ return { block: D, inline: A2 };
13931
+ }
13932
+ static lex(e2, t2) {
13933
+ return new l(t2).lex(e2);
13934
+ }
13935
+ static lexInline(e2, t2) {
13936
+ return new l(t2).inlineTokens(e2);
13937
+ }
13938
+ lex(e2) {
13939
+ e2 = e2.replace(m2.carriageReturn, `
13940
+ `), this.blockTokens(e2, this.tokens);
13941
+ for (let t2 = 0; t2 < this.inlineQueue.length; t2++) {
13942
+ let n = this.inlineQueue[t2];
13943
+ this.inlineTokens(n.src, n.tokens);
13944
+ }
13945
+ return this.inlineQueue = [], this.tokens;
13946
+ }
13947
+ blockTokens(e2, t2 = [], n = false) {
13948
+ this.tokenizer.lexer = this, this.options.pedantic && (e2 = e2.replace(m2.tabCharGlobal, " ").replace(m2.spaceLine, ""));
13949
+ let s2 = 1 / 0;
13950
+ for (; e2; ) {
13951
+ if (e2.length < s2) s2 = e2.length;
13952
+ else {
13953
+ this.infiniteLoopError(e2.charCodeAt(0));
13954
+ break;
13955
+ }
13956
+ let r2;
13957
+ if (this.options.extensions?.block?.some((o) => (r2 = o.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(r2.raw.length), t2.push(r2), true) : false)) continue;
13958
+ if (r2 = this.tokenizer.space(e2)) {
13959
+ e2 = e2.substring(r2.raw.length);
13960
+ let o = t2.at(-1);
13961
+ r2.raw.length === 1 && o !== void 0 ? o.raw += `
13962
+ ` : t2.push(r2);
13963
+ continue;
13964
+ }
13965
+ if (r2 = this.tokenizer.code(e2)) {
13966
+ e2 = e2.substring(r2.raw.length);
13967
+ let o = t2.at(-1);
13968
+ o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(`
13969
+ `) ? "" : `
13970
+ `) + r2.raw, o.text += `
13971
+ ` + r2.text, this.inlineQueue.at(-1).src = o.text) : t2.push(r2);
13972
+ continue;
13973
+ }
13974
+ if (r2 = this.tokenizer.fences(e2)) {
13975
+ e2 = e2.substring(r2.raw.length), t2.push(r2);
13976
+ continue;
13977
+ }
13978
+ if (r2 = this.tokenizer.heading(e2)) {
13979
+ e2 = e2.substring(r2.raw.length), t2.push(r2);
13980
+ continue;
13981
+ }
13982
+ if (r2 = this.tokenizer.hr(e2)) {
13983
+ e2 = e2.substring(r2.raw.length), t2.push(r2);
13984
+ continue;
13985
+ }
13986
+ if (r2 = this.tokenizer.blockquote(e2)) {
13987
+ e2 = e2.substring(r2.raw.length), t2.push(r2);
13988
+ continue;
13989
+ }
13990
+ if (r2 = this.tokenizer.list(e2)) {
13991
+ e2 = e2.substring(r2.raw.length), t2.push(r2);
13992
+ continue;
13993
+ }
13994
+ if (r2 = this.tokenizer.html(e2)) {
13995
+ e2 = e2.substring(r2.raw.length), t2.push(r2);
13996
+ continue;
13997
+ }
13998
+ if (r2 = this.tokenizer.def(e2)) {
13999
+ e2 = e2.substring(r2.raw.length);
14000
+ let o = t2.at(-1);
14001
+ o?.type === "paragraph" || o?.type === "text" ? (o.raw += (o.raw.endsWith(`
14002
+ `) ? "" : `
14003
+ `) + r2.raw, o.text += `
14004
+ ` + r2.raw, this.inlineQueue.at(-1).src = o.text) : this.tokens.links[r2.tag] || (this.tokens.links[r2.tag] = { href: r2.href, title: r2.title }, t2.push(r2));
14005
+ continue;
14006
+ }
14007
+ if (r2 = this.tokenizer.table(e2)) {
14008
+ e2 = e2.substring(r2.raw.length), t2.push(r2);
14009
+ continue;
14010
+ }
14011
+ if (r2 = this.tokenizer.lheading(e2)) {
14012
+ e2 = e2.substring(r2.raw.length), t2.push(r2);
14013
+ continue;
14014
+ }
14015
+ let i2 = e2;
14016
+ if (this.options.extensions?.startBlock) {
14017
+ let o = 1 / 0, u = e2.slice(1), a;
14018
+ this.options.extensions.startBlock.forEach((c) => {
14019
+ a = c.call({ lexer: this }, u), typeof a == "number" && a >= 0 && (o = Math.min(o, a));
14020
+ }), o < 1 / 0 && o >= 0 && (i2 = e2.substring(0, o + 1));
14021
+ }
14022
+ if (this.state.top && (r2 = this.tokenizer.paragraph(i2))) {
14023
+ let o = t2.at(-1);
14024
+ n && o?.type === "paragraph" ? (o.raw += (o.raw.endsWith(`
14025
+ `) ? "" : `
14026
+ `) + r2.raw, o.text += `
14027
+ ` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t2.push(r2), n = i2.length !== e2.length, e2 = e2.substring(r2.raw.length);
14028
+ continue;
14029
+ }
14030
+ if (r2 = this.tokenizer.text(e2)) {
14031
+ e2 = e2.substring(r2.raw.length);
14032
+ let o = t2.at(-1);
14033
+ o?.type === "text" ? (o.raw += (o.raw.endsWith(`
14034
+ `) ? "" : `
14035
+ `) + r2.raw, o.text += `
14036
+ ` + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = o.text) : t2.push(r2);
14037
+ continue;
14038
+ }
14039
+ if (e2) {
14040
+ this.infiniteLoopError(e2.charCodeAt(0));
14041
+ break;
14042
+ }
14043
+ }
14044
+ return this.state.top = true, t2;
14045
+ }
14046
+ inline(e2, t2 = []) {
14047
+ return this.inlineQueue.push({ src: e2, tokens: t2 }), t2;
14048
+ }
14049
+ inlineTokens(e2, t2 = []) {
14050
+ this.tokenizer.lexer = this;
14051
+ let n = e2, s2 = null;
14052
+ if (this.tokens.links) {
14053
+ let a = Object.keys(this.tokens.links);
14054
+ if (a.length > 0) for (; (s2 = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) a.includes(s2[0].slice(s2[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, s2.index) + "[" + "a".repeat(s2[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
14055
+ }
14056
+ for (; (s2 = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, s2.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
14057
+ let r2;
14058
+ for (; (s2 = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) r2 = s2[2] ? s2[2].length : 0, n = n.slice(0, s2.index + r2) + "[" + "a".repeat(s2[0].length - r2 - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
14059
+ n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
14060
+ let i2 = false, o = "", u = 1 / 0;
14061
+ for (; e2; ) {
14062
+ if (e2.length < u) u = e2.length;
14063
+ else {
14064
+ this.infiniteLoopError(e2.charCodeAt(0));
14065
+ break;
14066
+ }
14067
+ i2 || (o = ""), i2 = false;
14068
+ let a;
14069
+ if (this.options.extensions?.inline?.some((p) => (a = p.call({ lexer: this }, e2, t2)) ? (e2 = e2.substring(a.raw.length), t2.push(a), true) : false)) continue;
14070
+ if (a = this.tokenizer.escape(e2)) {
14071
+ e2 = e2.substring(a.raw.length), t2.push(a);
14072
+ continue;
14073
+ }
14074
+ if (a = this.tokenizer.tag(e2)) {
14075
+ e2 = e2.substring(a.raw.length), t2.push(a);
14076
+ continue;
14077
+ }
14078
+ if (a = this.tokenizer.link(e2)) {
14079
+ e2 = e2.substring(a.raw.length), t2.push(a);
14080
+ continue;
14081
+ }
14082
+ if (a = this.tokenizer.reflink(e2, this.tokens.links)) {
14083
+ e2 = e2.substring(a.raw.length);
14084
+ let p = t2.at(-1);
14085
+ a.type === "text" && p?.type === "text" ? (p.raw += a.raw, p.text += a.text) : t2.push(a);
14086
+ continue;
14087
+ }
14088
+ if (a = this.tokenizer.emStrong(e2, n, o)) {
14089
+ e2 = e2.substring(a.raw.length), t2.push(a);
14090
+ continue;
14091
+ }
14092
+ if (a = this.tokenizer.codespan(e2)) {
14093
+ e2 = e2.substring(a.raw.length), t2.push(a);
14094
+ continue;
14095
+ }
14096
+ if (a = this.tokenizer.br(e2)) {
14097
+ e2 = e2.substring(a.raw.length), t2.push(a);
14098
+ continue;
14099
+ }
14100
+ if (a = this.tokenizer.del(e2, n, o)) {
14101
+ e2 = e2.substring(a.raw.length), t2.push(a);
14102
+ continue;
14103
+ }
14104
+ if (a = this.tokenizer.autolink(e2)) {
14105
+ e2 = e2.substring(a.raw.length), t2.push(a);
14106
+ continue;
14107
+ }
14108
+ if (!this.state.inLink && (a = this.tokenizer.url(e2))) {
14109
+ e2 = e2.substring(a.raw.length), t2.push(a);
14110
+ continue;
14111
+ }
14112
+ let c = e2;
14113
+ if (this.options.extensions?.startInline) {
14114
+ let p = 1 / 0, k = e2.slice(1), h2;
14115
+ this.options.extensions.startInline.forEach((R) => {
14116
+ h2 = R.call({ lexer: this }, k), typeof h2 == "number" && h2 >= 0 && (p = Math.min(p, h2));
14117
+ }), p < 1 / 0 && p >= 0 && (c = e2.substring(0, p + 1));
14118
+ }
14119
+ if (a = this.tokenizer.inlineText(c)) {
14120
+ e2 = e2.substring(a.raw.length), a.raw.slice(-1) !== "_" && (o = a.raw.slice(-1)), i2 = true;
14121
+ let p = t2.at(-1);
14122
+ p?.type === "text" ? (p.raw += a.raw, p.text += a.text) : t2.push(a);
14123
+ continue;
14124
+ }
14125
+ if (e2) {
14126
+ this.infiniteLoopError(e2.charCodeAt(0));
14127
+ break;
14128
+ }
14129
+ }
14130
+ return t2;
14131
+ }
14132
+ infiniteLoopError(e2) {
14133
+ let t2 = "Infinite loop on byte: " + e2;
14134
+ if (this.options.silent) console.error(t2);
14135
+ else throw new Error(t2);
14136
+ }
14137
+ };
14138
+ y = class {
14139
+ options;
14140
+ parser;
14141
+ constructor(e2) {
14142
+ this.options = e2 || T;
14143
+ }
14144
+ space(e2) {
14145
+ return "";
14146
+ }
14147
+ code({ text: e2, lang: t2, escaped: n }) {
14148
+ let s2 = (t2 || "").match(m2.notSpaceStart)?.[0], r2 = e2.replace(m2.endingNewline, "") + `
14149
+ `;
14150
+ return s2 ? '<pre><code class="language-' + O(s2) + '">' + (n ? r2 : O(r2, true)) + `</code></pre>
14151
+ ` : "<pre><code>" + (n ? r2 : O(r2, true)) + `</code></pre>
14152
+ `;
14153
+ }
14154
+ blockquote({ tokens: e2 }) {
14155
+ return `<blockquote>
14156
+ ${this.parser.parse(e2)}</blockquote>
14157
+ `;
14158
+ }
14159
+ html({ text: e2 }) {
14160
+ return e2;
14161
+ }
14162
+ def(e2) {
14163
+ return "";
14164
+ }
14165
+ heading({ tokens: e2, depth: t2 }) {
14166
+ return `<h${t2}>${this.parser.parseInline(e2)}</h${t2}>
14167
+ `;
14168
+ }
14169
+ hr(e2) {
14170
+ return `<hr>
14171
+ `;
14172
+ }
14173
+ list(e2) {
14174
+ let t2 = e2.ordered, n = e2.start, s2 = "";
14175
+ for (let o = 0; o < e2.items.length; o++) {
14176
+ let u = e2.items[o];
14177
+ s2 += this.listitem(u);
14178
+ }
14179
+ let r2 = t2 ? "ol" : "ul", i2 = t2 && n !== 1 ? ' start="' + n + '"' : "";
14180
+ return "<" + r2 + i2 + `>
14181
+ ` + s2 + "</" + r2 + `>
14182
+ `;
14183
+ }
14184
+ listitem(e2) {
14185
+ return `<li>${this.parser.parse(e2.tokens)}</li>
14186
+ `;
14187
+ }
14188
+ checkbox({ checked: e2 }) {
14189
+ return "<input " + (e2 ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
14190
+ }
14191
+ paragraph({ tokens: e2 }) {
14192
+ return `<p>${this.parser.parseInline(e2)}</p>
14193
+ `;
14194
+ }
14195
+ table(e2) {
14196
+ let t2 = "", n = "";
14197
+ for (let r2 = 0; r2 < e2.header.length; r2++) n += this.tablecell(e2.header[r2]);
14198
+ t2 += this.tablerow({ text: n });
14199
+ let s2 = "";
14200
+ for (let r2 = 0; r2 < e2.rows.length; r2++) {
14201
+ let i2 = e2.rows[r2];
14202
+ n = "";
14203
+ for (let o = 0; o < i2.length; o++) n += this.tablecell(i2[o]);
14204
+ s2 += this.tablerow({ text: n });
14205
+ }
14206
+ return s2 && (s2 = `<tbody>${s2}</tbody>`), `<table>
14207
+ <thead>
14208
+ ` + t2 + `</thead>
14209
+ ` + s2 + `</table>
14210
+ `;
14211
+ }
14212
+ tablerow({ text: e2 }) {
14213
+ return `<tr>
14214
+ ${e2}</tr>
14215
+ `;
14216
+ }
14217
+ tablecell(e2) {
14218
+ let t2 = this.parser.parseInline(e2.tokens), n = e2.header ? "th" : "td";
14219
+ return (e2.align ? `<${n} align="${e2.align}">` : `<${n}>`) + t2 + `</${n}>
14220
+ `;
14221
+ }
14222
+ strong({ tokens: e2 }) {
14223
+ return `<strong>${this.parser.parseInline(e2)}</strong>`;
14224
+ }
14225
+ em({ tokens: e2 }) {
14226
+ return `<em>${this.parser.parseInline(e2)}</em>`;
14227
+ }
14228
+ codespan({ text: e2 }) {
14229
+ return `<code>${O(e2, true)}</code>`;
14230
+ }
14231
+ br(e2) {
14232
+ return "<br>";
14233
+ }
14234
+ del({ tokens: e2 }) {
14235
+ return `<del>${this.parser.parseInline(e2)}</del>`;
14236
+ }
14237
+ link({ href: e2, title: t2, tokens: n }) {
14238
+ let s2 = this.parser.parseInline(n), r2 = V(e2);
14239
+ if (r2 === null) return s2;
14240
+ e2 = r2;
14241
+ let i2 = '<a href="' + e2 + '"';
14242
+ return t2 && (i2 += ' title="' + O(t2) + '"'), i2 += ">" + s2 + "</a>", i2;
14243
+ }
14244
+ image({ href: e2, title: t2, text: n, tokens: s2 }) {
14245
+ s2 && (n = this.parser.parseInline(s2, this.parser.textRenderer));
14246
+ let r2 = V(e2);
14247
+ if (r2 === null) return O(n);
14248
+ e2 = r2;
14249
+ let i2 = `<img src="${e2}" alt="${O(n)}"`;
14250
+ return t2 && (i2 += ` title="${O(t2)}"`), i2 += ">", i2;
14251
+ }
14252
+ text(e2) {
14253
+ return "tokens" in e2 && e2.tokens ? this.parser.parseInline(e2.tokens) : "escaped" in e2 && e2.escaped ? e2.text : O(e2.text);
14254
+ }
14255
+ };
14256
+ L = class {
14257
+ strong({ text: e2 }) {
14258
+ return e2;
14259
+ }
14260
+ em({ text: e2 }) {
14261
+ return e2;
14262
+ }
14263
+ codespan({ text: e2 }) {
14264
+ return e2;
14265
+ }
14266
+ del({ text: e2 }) {
14267
+ return e2;
14268
+ }
14269
+ html({ text: e2 }) {
14270
+ return e2;
14271
+ }
14272
+ text({ text: e2 }) {
14273
+ return e2;
14274
+ }
14275
+ link({ text: e2 }) {
14276
+ return "" + e2;
14277
+ }
14278
+ image({ text: e2 }) {
14279
+ return "" + e2;
14280
+ }
14281
+ br() {
14282
+ return "";
14283
+ }
14284
+ checkbox({ raw: e2 }) {
14285
+ return e2;
14286
+ }
14287
+ };
14288
+ b = class l2 {
14289
+ options;
14290
+ renderer;
14291
+ textRenderer;
14292
+ constructor(e2) {
14293
+ this.options = e2 || T, this.options.renderer = this.options.renderer || new y(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new L();
14294
+ }
14295
+ static parse(e2, t2) {
14296
+ return new l2(t2).parse(e2);
14297
+ }
14298
+ static parseInline(e2, t2) {
14299
+ return new l2(t2).parseInline(e2);
14300
+ }
14301
+ parse(e2) {
14302
+ this.renderer.parser = this;
14303
+ let t2 = "";
14304
+ for (let n = 0; n < e2.length; n++) {
14305
+ let s2 = e2[n];
14306
+ if (this.options.extensions?.renderers?.[s2.type]) {
14307
+ let i2 = s2, o = this.options.extensions.renderers[i2.type].call({ parser: this }, i2);
14308
+ if (o !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(i2.type)) {
14309
+ t2 += o || "";
14310
+ continue;
14311
+ }
14312
+ }
14313
+ let r2 = s2;
14314
+ switch (r2.type) {
14315
+ case "space": {
14316
+ t2 += this.renderer.space(r2);
14317
+ break;
14318
+ }
14319
+ case "hr": {
14320
+ t2 += this.renderer.hr(r2);
14321
+ break;
14322
+ }
14323
+ case "heading": {
14324
+ t2 += this.renderer.heading(r2);
14325
+ break;
14326
+ }
14327
+ case "code": {
14328
+ t2 += this.renderer.code(r2);
14329
+ break;
14330
+ }
14331
+ case "table": {
14332
+ t2 += this.renderer.table(r2);
14333
+ break;
14334
+ }
14335
+ case "blockquote": {
14336
+ t2 += this.renderer.blockquote(r2);
14337
+ break;
14338
+ }
14339
+ case "list": {
14340
+ t2 += this.renderer.list(r2);
14341
+ break;
14342
+ }
14343
+ case "checkbox": {
14344
+ t2 += this.renderer.checkbox(r2);
14345
+ break;
14346
+ }
14347
+ case "html": {
14348
+ t2 += this.renderer.html(r2);
14349
+ break;
14350
+ }
14351
+ case "def": {
14352
+ t2 += this.renderer.def(r2);
14353
+ break;
14354
+ }
14355
+ case "paragraph": {
14356
+ t2 += this.renderer.paragraph(r2);
14357
+ break;
14358
+ }
14359
+ case "text": {
14360
+ t2 += this.renderer.text(r2);
14361
+ break;
14362
+ }
14363
+ default: {
14364
+ let i2 = 'Token with "' + r2.type + '" type was not found.';
14365
+ if (this.options.silent) return console.error(i2), "";
14366
+ throw new Error(i2);
14367
+ }
14368
+ }
14369
+ }
14370
+ return t2;
14371
+ }
14372
+ parseInline(e2, t2 = this.renderer) {
14373
+ this.renderer.parser = this;
14374
+ let n = "";
14375
+ for (let s2 = 0; s2 < e2.length; s2++) {
14376
+ let r2 = e2[s2];
14377
+ if (this.options.extensions?.renderers?.[r2.type]) {
14378
+ let o = this.options.extensions.renderers[r2.type].call({ parser: this }, r2);
14379
+ if (o !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r2.type)) {
14380
+ n += o || "";
14381
+ continue;
14382
+ }
14383
+ }
14384
+ let i2 = r2;
14385
+ switch (i2.type) {
14386
+ case "escape": {
14387
+ n += t2.text(i2);
14388
+ break;
14389
+ }
14390
+ case "html": {
14391
+ n += t2.html(i2);
14392
+ break;
14393
+ }
14394
+ case "link": {
14395
+ n += t2.link(i2);
14396
+ break;
14397
+ }
14398
+ case "image": {
14399
+ n += t2.image(i2);
14400
+ break;
14401
+ }
14402
+ case "checkbox": {
14403
+ n += t2.checkbox(i2);
14404
+ break;
14405
+ }
14406
+ case "strong": {
14407
+ n += t2.strong(i2);
14408
+ break;
14409
+ }
14410
+ case "em": {
14411
+ n += t2.em(i2);
14412
+ break;
14413
+ }
14414
+ case "codespan": {
14415
+ n += t2.codespan(i2);
14416
+ break;
14417
+ }
14418
+ case "br": {
14419
+ n += t2.br(i2);
14420
+ break;
14421
+ }
14422
+ case "del": {
14423
+ n += t2.del(i2);
14424
+ break;
14425
+ }
14426
+ case "text": {
14427
+ n += t2.text(i2);
14428
+ break;
14429
+ }
14430
+ default: {
14431
+ let o = 'Token with "' + i2.type + '" type was not found.';
14432
+ if (this.options.silent) return console.error(o), "";
14433
+ throw new Error(o);
14434
+ }
14435
+ }
14436
+ }
14437
+ return n;
14438
+ }
14439
+ };
14440
+ P = class {
14441
+ options;
14442
+ block;
14443
+ constructor(e2) {
14444
+ this.options = e2 || T;
14445
+ }
14446
+ static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
14447
+ static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
14448
+ preprocess(e2) {
14449
+ return e2;
14450
+ }
14451
+ postprocess(e2) {
14452
+ return e2;
14453
+ }
14454
+ processAllTokens(e2) {
14455
+ return e2;
14456
+ }
14457
+ emStrongMask(e2) {
14458
+ return e2;
14459
+ }
14460
+ provideLexer(e2 = this.block) {
14461
+ return e2 ? x2.lex : x2.lexInline;
14462
+ }
14463
+ provideParser(e2 = this.block) {
14464
+ return e2 ? b.parse : b.parseInline;
14465
+ }
14466
+ };
14467
+ q = class {
14468
+ defaults = M();
14469
+ options = this.setOptions;
14470
+ parse = this.parseMarkdown(true);
14471
+ parseInline = this.parseMarkdown(false);
14472
+ Parser = b;
14473
+ Renderer = y;
14474
+ TextRenderer = L;
14475
+ Lexer = x2;
14476
+ Tokenizer = w;
14477
+ Hooks = P;
14478
+ constructor(...e2) {
14479
+ this.use(...e2);
14480
+ }
14481
+ walkTokens(e2, t2) {
14482
+ let n = [];
14483
+ for (let s2 of e2) switch (n = n.concat(t2.call(this, s2)), s2.type) {
14484
+ case "table": {
14485
+ let r2 = s2;
14486
+ for (let i2 of r2.header) n = n.concat(this.walkTokens(i2.tokens, t2));
14487
+ for (let i2 of r2.rows) for (let o of i2) n = n.concat(this.walkTokens(o.tokens, t2));
14488
+ break;
14489
+ }
14490
+ case "list": {
14491
+ let r2 = s2;
14492
+ n = n.concat(this.walkTokens(r2.items, t2));
14493
+ break;
14494
+ }
14495
+ default: {
14496
+ let r2 = s2;
14497
+ this.defaults.extensions?.childTokens?.[r2.type] ? this.defaults.extensions.childTokens[r2.type].forEach((i2) => {
14498
+ let o = r2[i2].flat(1 / 0);
14499
+ n = n.concat(this.walkTokens(o, t2));
14500
+ }) : r2.tokens && (n = n.concat(this.walkTokens(r2.tokens, t2)));
14501
+ }
14502
+ }
14503
+ return n;
14504
+ }
14505
+ use(...e2) {
14506
+ let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} };
14507
+ return e2.forEach((n) => {
14508
+ let s2 = { ...n };
14509
+ if (s2.async = this.defaults.async || s2.async || false, n.extensions && (n.extensions.forEach((r2) => {
14510
+ if (!r2.name) throw new Error("extension name required");
14511
+ if ("renderer" in r2) {
14512
+ let i2 = t2.renderers[r2.name];
14513
+ i2 ? t2.renderers[r2.name] = function(...o) {
14514
+ let u = r2.renderer.apply(this, o);
14515
+ return u === false && (u = i2.apply(this, o)), u;
14516
+ } : t2.renderers[r2.name] = r2.renderer;
14517
+ }
14518
+ if ("tokenizer" in r2) {
14519
+ if (!r2.level || r2.level !== "block" && r2.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
14520
+ let i2 = t2[r2.level];
14521
+ i2 ? i2.unshift(r2.tokenizer) : t2[r2.level] = [r2.tokenizer], r2.start && (r2.level === "block" ? t2.startBlock ? t2.startBlock.push(r2.start) : t2.startBlock = [r2.start] : r2.level === "inline" && (t2.startInline ? t2.startInline.push(r2.start) : t2.startInline = [r2.start]));
14522
+ }
14523
+ "childTokens" in r2 && r2.childTokens && (t2.childTokens[r2.name] = r2.childTokens);
14524
+ }), s2.extensions = t2), n.renderer) {
14525
+ let r2 = this.defaults.renderer || new y(this.defaults);
14526
+ for (let i2 in n.renderer) {
14527
+ if (!(i2 in r2)) throw new Error(`renderer '${i2}' does not exist`);
14528
+ if (["options", "parser"].includes(i2)) continue;
14529
+ let o = i2, u = n.renderer[o], a = r2[o];
14530
+ r2[o] = (...c) => {
14531
+ let p = u.apply(r2, c);
14532
+ return p === false && (p = a.apply(r2, c)), p || "";
14533
+ };
14534
+ }
14535
+ s2.renderer = r2;
14536
+ }
14537
+ if (n.tokenizer) {
14538
+ let r2 = this.defaults.tokenizer || new w(this.defaults);
14539
+ for (let i2 in n.tokenizer) {
14540
+ if (!(i2 in r2)) throw new Error(`tokenizer '${i2}' does not exist`);
14541
+ if (["options", "rules", "lexer"].includes(i2)) continue;
14542
+ let o = i2, u = n.tokenizer[o], a = r2[o];
14543
+ r2[o] = (...c) => {
14544
+ let p = u.apply(r2, c);
14545
+ return p === false && (p = a.apply(r2, c)), p;
14546
+ };
14547
+ }
14548
+ s2.tokenizer = r2;
14549
+ }
14550
+ if (n.hooks) {
14551
+ let r2 = this.defaults.hooks || new P();
14552
+ for (let i2 in n.hooks) {
14553
+ if (!(i2 in r2)) throw new Error(`hook '${i2}' does not exist`);
14554
+ if (["options", "block"].includes(i2)) continue;
14555
+ let o = i2, u = n.hooks[o], a = r2[o];
14556
+ P.passThroughHooks.has(i2) ? r2[o] = (c) => {
14557
+ if (this.defaults.async && P.passThroughHooksRespectAsync.has(i2)) return (async () => {
14558
+ let k = await u.call(r2, c);
14559
+ return a.call(r2, k);
14560
+ })();
14561
+ let p = u.call(r2, c);
14562
+ return a.call(r2, p);
14563
+ } : r2[o] = (...c) => {
14564
+ if (this.defaults.async) return (async () => {
14565
+ let k = await u.apply(r2, c);
14566
+ return k === false && (k = await a.apply(r2, c)), k;
14567
+ })();
14568
+ let p = u.apply(r2, c);
14569
+ return p === false && (p = a.apply(r2, c)), p;
14570
+ };
14571
+ }
14572
+ s2.hooks = r2;
14573
+ }
14574
+ if (n.walkTokens) {
14575
+ let r2 = this.defaults.walkTokens, i2 = n.walkTokens;
14576
+ s2.walkTokens = function(o) {
14577
+ let u = [];
14578
+ return u.push(i2.call(this, o)), r2 && (u = u.concat(r2.call(this, o))), u;
14579
+ };
14580
+ }
14581
+ this.defaults = { ...this.defaults, ...s2 };
14582
+ }), this;
14583
+ }
14584
+ setOptions(e2) {
14585
+ return this.defaults = { ...this.defaults, ...e2 }, this;
14586
+ }
14587
+ lexer(e2, t2) {
14588
+ return x2.lex(e2, t2 ?? this.defaults);
14589
+ }
14590
+ parser(e2, t2) {
14591
+ return b.parse(e2, t2 ?? this.defaults);
14592
+ }
14593
+ parseMarkdown(e2) {
14594
+ return (n, s2) => {
14595
+ let r2 = { ...s2 }, i2 = { ...this.defaults, ...r2 }, o = this.onError(!!i2.silent, !!i2.async);
14596
+ if (this.defaults.async === true && r2.async === false) return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
14597
+ if (typeof n > "u" || n === null) return o(new Error("marked(): input parameter is undefined or null"));
14598
+ if (typeof n != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
14599
+ if (i2.hooks && (i2.hooks.options = i2, i2.hooks.block = e2), i2.async) return (async () => {
14600
+ let u = i2.hooks ? await i2.hooks.preprocess(n) : n, c = await (i2.hooks ? await i2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(u, i2), p = i2.hooks ? await i2.hooks.processAllTokens(c) : c;
14601
+ i2.walkTokens && await Promise.all(this.walkTokens(p, i2.walkTokens));
14602
+ let h2 = await (i2.hooks ? await i2.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(p, i2);
14603
+ return i2.hooks ? await i2.hooks.postprocess(h2) : h2;
14604
+ })().catch(o);
14605
+ try {
14606
+ i2.hooks && (n = i2.hooks.preprocess(n));
14607
+ let a = (i2.hooks ? i2.hooks.provideLexer(e2) : e2 ? x2.lex : x2.lexInline)(n, i2);
14608
+ i2.hooks && (a = i2.hooks.processAllTokens(a)), i2.walkTokens && this.walkTokens(a, i2.walkTokens);
14609
+ let p = (i2.hooks ? i2.hooks.provideParser(e2) : e2 ? b.parse : b.parseInline)(a, i2);
14610
+ return i2.hooks && (p = i2.hooks.postprocess(p)), p;
14611
+ } catch (u) {
14612
+ return o(u);
14613
+ }
14614
+ };
14615
+ }
14616
+ onError(e2, t2) {
14617
+ return (n) => {
14618
+ if (n.message += `
14619
+ Please report this to https://github.com/markedjs/marked.`, e2) {
14620
+ let s2 = "<p>An error occurred:</p><pre>" + O(n.message + "", true) + "</pre>";
14621
+ return t2 ? Promise.resolve(s2) : s2;
14622
+ }
14623
+ if (t2) return Promise.reject(n);
14624
+ throw n;
14625
+ };
14626
+ }
14627
+ };
14628
+ z = new q();
14629
+ g.options = g.setOptions = function(l3) {
14630
+ return z.setOptions(l3), g.defaults = z.defaults, N(g.defaults), g;
14631
+ };
14632
+ g.getDefaults = M;
14633
+ g.defaults = T;
14634
+ g.use = function(...l3) {
14635
+ return z.use(...l3), g.defaults = z.defaults, N(g.defaults), g;
14636
+ };
14637
+ g.walkTokens = function(l3, e2) {
14638
+ return z.walkTokens(l3, e2);
14639
+ };
14640
+ g.parseInline = z.parseInline;
14641
+ g.Parser = b;
14642
+ g.parser = b.parse;
14643
+ g.Renderer = y;
14644
+ g.TextRenderer = L;
14645
+ g.Lexer = x2;
14646
+ g.lexer = x2.lex;
14647
+ g.Tokenizer = w;
14648
+ g.Hooks = P;
14649
+ g.parse = g;
14650
+ Ft = g.options;
14651
+ Ut = g.setOptions;
14652
+ Kt = g.use;
14653
+ Wt = g.walkTokens;
14654
+ Xt = g.parseInline;
14655
+ Vt = b.parse;
14656
+ Yt = x2.lex;
14657
+ }
14658
+ });
14659
+
14660
+ // src/utils/markdown.ts
14661
+ var markdown_exports = {};
14662
+ __export(markdown_exports, {
14663
+ markdownToAdf: () => markdownToAdf,
14664
+ markdownToStorageFormat: () => markdownToStorageFormat
14665
+ });
14666
+ function stripFrontmatter(md) {
14667
+ return md.replace(FRONTMATTER_RE, "");
14668
+ }
14669
+ function inlineTokensToAdf(tokens, parentMarks) {
14670
+ if (!Array.isArray(tokens)) return [];
14671
+ const out = [];
14672
+ for (const raw of tokens) {
14673
+ const tok = raw;
14674
+ if (!tok || typeof tok !== "object") continue;
14675
+ switch (tok.type) {
14676
+ case "strong":
14677
+ out.push(...inlineTokensToAdf(tok.tokens, [...parentMarks, { type: "strong" }]));
14678
+ break;
14679
+ case "em":
14680
+ out.push(...inlineTokensToAdf(tok.tokens, [...parentMarks, { type: "em" }]));
14681
+ break;
14682
+ case "del":
14683
+ out.push(...inlineTokensToAdf(tok.tokens, [...parentMarks, { type: "strike" }]));
14684
+ break;
14685
+ case "codespan":
14686
+ out.push({ type: "text", text: String(tok.text ?? ""), marks: [...parentMarks, { type: "code" }] });
14687
+ break;
14688
+ case "text":
14689
+ case "escape":
14690
+ out.push({ type: "text", text: String(tok.text ?? ""), marks: parentMarks.length ? parentMarks : void 0 });
14691
+ break;
14692
+ case "link":
14693
+ out.push(...inlineTokensToAdf(tok.tokens, parentMarks));
14694
+ break;
14695
+ case "image":
14696
+ if (tok.text) out.push({ type: "text", text: String(tok.text), marks: parentMarks.length ? parentMarks : void 0 });
14697
+ break;
14698
+ case "br":
14699
+ out.push({ type: "text", text: "\n", marks: parentMarks.length ? parentMarks : void 0 });
14700
+ break;
14701
+ case "html":
14702
+ out.push({ type: "text", text: String(tok.text ?? "").replace(/<[^>]+>/g, ""), marks: parentMarks.length ? parentMarks : void 0 });
14703
+ break;
14704
+ default:
14705
+ if (tok.text) out.push({ type: "text", text: String(tok.text), marks: parentMarks.length ? parentMarks : void 0 });
14706
+ }
14707
+ }
14708
+ return out;
14709
+ }
14710
+ function splitHardBreaks(nodes) {
14711
+ const out = [];
14712
+ for (const node of nodes) {
14713
+ if (!node.text.includes("\n")) {
14714
+ out.push(node);
14715
+ continue;
14716
+ }
14717
+ const parts = node.text.split("\n");
14718
+ for (let i2 = 0; i2 < parts.length; i2++) {
14719
+ if (parts[i2]) out.push({ type: "text", text: parts[i2], marks: node.marks });
14720
+ if (i2 < parts.length - 1) out.push({ type: "hardBreak" });
14721
+ }
14722
+ }
14723
+ return out;
14724
+ }
14725
+ function paragraphFromTokens(text, tokens) {
14726
+ const inline = inlineTokensToAdf(tokens, []);
14727
+ const content = inline.length ? splitHardBreaks(inline) : text ? [{ type: "text", text }] : [];
14728
+ return { type: "paragraph", content };
14729
+ }
14730
+ function listItemToBlocks(item) {
14731
+ const subs = Array.isArray(item?.tokens) ? item.tokens : [];
14732
+ const blocks = [];
14733
+ for (const sub of subs) {
14734
+ const b2 = tokenToAdfBlock(sub);
14735
+ if (b2) blocks.push(b2);
14736
+ }
14737
+ if (!blocks.length) {
14738
+ blocks.push({ type: "paragraph", content: item?.text ? [{ type: "text", text: String(item.text) }] : [] });
14739
+ }
14740
+ return blocks;
14741
+ }
14742
+ function tableToAdf(t2) {
14743
+ const headerCells = (t2.header || []).map((c) => ({
14744
+ type: "tableHeader",
14745
+ attrs: {},
14746
+ content: [paragraphFromTokens(c?.text, c?.tokens)]
14747
+ }));
14748
+ const rows = (t2.rows || []).map((row) => ({
14749
+ type: "tableRow",
14750
+ content: row.map((c) => ({
14751
+ type: "tableCell",
14752
+ attrs: {},
14753
+ content: [paragraphFromTokens(c?.text, c?.tokens)]
14754
+ }))
14755
+ }));
14756
+ return {
14757
+ type: "table",
14758
+ attrs: {},
14759
+ content: [{ type: "tableRow", content: headerCells }, ...rows]
14760
+ };
14761
+ }
14762
+ function tokenToAdfBlock(tok) {
14763
+ if (!tok || typeof tok !== "object") return null;
14764
+ switch (tok.type) {
14765
+ case "heading":
14766
+ return {
14767
+ type: "heading",
14768
+ attrs: { level: Math.min(Math.max(Number(tok.depth) || 1, 1), 6) },
14769
+ content: inlineTokensToAdf(tok.tokens, [])
14770
+ };
14771
+ case "paragraph":
14772
+ return paragraphFromTokens(tok.text, tok.tokens);
14773
+ case "code":
14774
+ return {
14775
+ type: "codeBlock",
14776
+ content: [{ type: "text", text: String(tok.text ?? "") }],
14777
+ attrs: tok.lang ? { language: String(tok.lang) } : void 0
14778
+ };
14779
+ case "blockquote": {
14780
+ const inner = [];
14781
+ for (const sub of tok.tokens || []) {
14782
+ const b2 = tokenToAdfBlock(sub);
14783
+ if (b2) inner.push(b2);
14784
+ }
14785
+ return { type: "blockquote", content: inner };
14786
+ }
14787
+ case "list": {
14788
+ const items = (tok.items || []).map((item) => ({
14789
+ type: "listItem",
14790
+ content: listItemToBlocks(item)
14791
+ }));
14792
+ return { type: tok.ordered ? "orderedList" : "bulletList", content: items };
14793
+ }
14794
+ case "table":
14795
+ return tableToAdf(tok);
14796
+ case "hr":
14797
+ return { type: "rule" };
14798
+ default:
14799
+ return null;
14800
+ }
14801
+ }
14802
+ function markdownToAdf(md) {
14803
+ const tokens = g.lexer(stripFrontmatter(md ?? ""));
14804
+ const content = [];
14805
+ for (const tok of tokens) {
14806
+ const block = tokenToAdfBlock(tok);
14807
+ if (block) content.push(block);
14808
+ }
14809
+ if (!content.length) content.push({ type: "paragraph", content: [] });
14810
+ return { type: "doc", version: 1, content };
14811
+ }
14812
+ function escapeHtml(s2) {
14813
+ return s2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
14814
+ }
14815
+ function inlineToHtml(text) {
14816
+ const html = g.parseInline(text ?? "");
14817
+ return (typeof html === "string" ? html : "").replace(/<br\s*\/?>/gi, "<br/>");
14818
+ }
14819
+ function listItemToHtml(item) {
14820
+ const subs = Array.isArray(item?.tokens) ? item.tokens : [];
14821
+ const paras = subs.filter((t2) => t2?.type === "paragraph");
14822
+ if (paras.length) return paras.map((p) => inlineToHtml(p.text)).join("<br/>");
14823
+ return inlineToHtml(item?.text);
14824
+ }
14825
+ function tokenToStorageHtml(tok) {
14826
+ if (!tok || typeof tok !== "object") return "";
14827
+ switch (tok.type) {
14828
+ case "heading":
14829
+ return `<h${tok.depth}>${inlineToHtml(tok.text)}</h${tok.depth}>`;
14830
+ case "paragraph":
14831
+ return `<p>${inlineToHtml(tok.text)}</p>`;
14832
+ case "code": {
14833
+ const langParam = tok.lang ? `<ac:parameter ac:name="language">${escapeHtml(String(tok.lang))}</ac:parameter>` : "";
14834
+ return `<ac:structured-macro ac:name="code">${langParam}<ac:plain-text-body><![CDATA[${tok.text ?? ""}]]></ac:plain-text-body></ac:structured-macro>`;
14835
+ }
14836
+ case "list": {
14837
+ const tag = tok.ordered ? "ol" : "ul";
14838
+ const items = (tok.items || []).map((i2) => `<li>${listItemToHtml(i2)}</li>`).join("");
14839
+ return `<${tag}>${items}</${tag}>`;
14840
+ }
14841
+ case "blockquote":
14842
+ return `<blockquote>${(tok.tokens || []).map((t2) => tokenToStorageHtml(t2)).join("")}</blockquote>`;
14843
+ case "table": {
14844
+ const header = (tok.header || []).map((c) => `<th>${inlineToHtml(c.text)}</th>`).join("");
14845
+ const rows = (tok.rows || []).map(
14846
+ (row) => `<tr>${row.map((c) => `<td>${inlineToHtml(c.text)}</td>`).join("")}</tr>`
14847
+ ).join("");
14848
+ return `<table><tbody><tr>${header}</tr>${rows}</tbody></table>`;
14849
+ }
14850
+ case "hr":
14851
+ return "<hr/>";
14852
+ default:
14853
+ return "";
14854
+ }
14855
+ }
14856
+ function markdownToStorageFormat(md) {
14857
+ const tokens = g.lexer(stripFrontmatter(md ?? ""));
14858
+ const parts = [];
14859
+ for (const tok of tokens) {
14860
+ const html = tokenToStorageHtml(tok);
14861
+ if (html) parts.push(html);
14862
+ }
14863
+ return parts.join("\n") || "<p></p>";
14864
+ }
14865
+ var FRONTMATTER_RE;
14866
+ var init_markdown = __esm({
14867
+ "src/utils/markdown.ts"() {
14868
+ "use strict";
14869
+ init_marked_esm();
14870
+ FRONTMATTER_RE = /^---\r?\n[\s\S]*?\r?\n---\r?\n?/;
14871
+ }
14872
+ });
14873
+
13415
14874
  // src/utils/jira-fields.ts
13416
14875
  function inferFieldFormat(type, custom3, hasAllowedValues = false) {
13417
14876
  if (type === "doc") return "adf";
@@ -13456,6 +14915,7 @@ var init_jira_client = __esm({
13456
14915
  "use strict";
13457
14916
  init_src();
13458
14917
  init_adf();
14918
+ init_markdown();
13459
14919
  init_jira_fields();
13460
14920
  JiraClient = class {
13461
14921
  baseUrl;
@@ -13505,7 +14965,7 @@ var init_jira_client = __esm({
13505
14965
  return this.request(`/issue/${key}`, { method: "PUT", body: { fields } });
13506
14966
  }
13507
14967
  async addComment(key, body) {
13508
- return this.request(`/issue/${key}/comment`, { method: "POST", body: { body: textToAdf(body) } });
14968
+ return this.request(`/issue/${key}/comment`, { method: "POST", body: { body: markdownToAdf(body) } });
13509
14969
  }
13510
14970
  async createLink(linkType, inwardKey, outwardKey) {
13511
14971
  return this.request("/issueLink", {
@@ -13835,16 +15295,16 @@ var require_errors2 = __commonJS({
13835
15295
  // Comment can be max 65535 bytes long (NOTE: some non-US characters may take more space)
13836
15296
  EXTRA_FIELD_PARSE_ERROR: "Extra field parsing error"
13837
15297
  };
13838
- function E(message) {
15298
+ function E2(message) {
13839
15299
  return function(...args) {
13840
15300
  if (args.length) {
13841
- message = message.replace(/\{(\d)\}/g, (_, n) => args[n] || "");
15301
+ message = message.replace(/\{(\d)\}/g, (_2, n) => args[n] || "");
13842
15302
  }
13843
15303
  return new Error("ADM-ZIP: " + message);
13844
15304
  };
13845
15305
  }
13846
15306
  for (const msg of Object.keys(errors)) {
13847
- exports[msg] = E(errors[msg]);
15307
+ exports[msg] = E2(errors[msg]);
13848
15308
  }
13849
15309
  }
13850
15310
  });
@@ -14073,8 +15533,8 @@ var require_utils2 = __commonJS({
14073
15533
  Utils.sanitize = function(prefix, name) {
14074
15534
  prefix = pth.resolve(pth.normalize(prefix));
14075
15535
  var parts = name.split("/");
14076
- for (var i2 = 0, l = parts.length; i2 < l; i2++) {
14077
- var path2 = pth.normalize(pth.join(prefix, parts.slice(i2, l).join(pth.sep)));
15536
+ for (var i2 = 0, l3 = parts.length; i2 < l3; i2++) {
15537
+ var path2 = pth.normalize(pth.join(prefix, parts.slice(i2, l3).join(pth.sep)));
14078
15538
  if (path2 === prefix || path2.startsWith(prefix + pth.sep)) {
14079
15539
  return path2;
14080
15540
  }
@@ -14547,45 +16007,45 @@ var require_mainHeader = __commonJS({
14547
16007
  },
14548
16008
  toBinary: function() {
14549
16009
  if (!needsZip64()) {
14550
- var b = Buffer.alloc(Constants.ENDHDR + _commentLength);
14551
- b.writeUInt32LE(Constants.ENDSIG, 0);
14552
- b.writeUInt32LE(0, 4);
14553
- b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);
14554
- b.writeUInt16LE(_totalEntries, Constants.ENDTOT);
14555
- b.writeUInt32LE(_size2, Constants.ENDSIZ);
14556
- b.writeUInt32LE(_offset, Constants.ENDOFF);
14557
- b.writeUInt16LE(_commentLength, Constants.ENDCOM);
14558
- b.fill(" ", Constants.ENDHDR);
14559
- return b;
14560
- }
14561
- var b = Buffer.alloc(this.mainHeaderSize);
16010
+ var b2 = Buffer.alloc(Constants.ENDHDR + _commentLength);
16011
+ b2.writeUInt32LE(Constants.ENDSIG, 0);
16012
+ b2.writeUInt32LE(0, 4);
16013
+ b2.writeUInt16LE(_volumeEntries, Constants.ENDSUB);
16014
+ b2.writeUInt16LE(_totalEntries, Constants.ENDTOT);
16015
+ b2.writeUInt32LE(_size2, Constants.ENDSIZ);
16016
+ b2.writeUInt32LE(_offset, Constants.ENDOFF);
16017
+ b2.writeUInt16LE(_commentLength, Constants.ENDCOM);
16018
+ b2.fill(" ", Constants.ENDHDR);
16019
+ return b2;
16020
+ }
16021
+ var b2 = Buffer.alloc(this.mainHeaderSize);
14562
16022
  let offset = 0;
14563
- b.writeUInt32LE(Constants.ZIP64SIG, offset);
14564
- Utils.writeBigUInt64LE(b, Constants.ZIP64HDR - Constants.ZIP64LEAD, offset + Constants.ZIP64SIZE);
14565
- b.writeUInt16LE(45, offset + Constants.ZIP64VEM);
14566
- b.writeUInt16LE(45, offset + Constants.ZIP64VER);
14567
- b.writeUInt32LE(0, offset + Constants.ZIP64DSK);
14568
- b.writeUInt32LE(0, offset + Constants.ZIP64DSKDIR);
14569
- Utils.writeBigUInt64LE(b, _volumeEntries, offset + Constants.ZIP64SUB);
14570
- Utils.writeBigUInt64LE(b, _totalEntries, offset + Constants.ZIP64TOT);
14571
- Utils.writeBigUInt64LE(b, _size2, offset + Constants.ZIP64SIZB);
14572
- Utils.writeBigUInt64LE(b, _offset, offset + Constants.ZIP64OFF);
16023
+ b2.writeUInt32LE(Constants.ZIP64SIG, offset);
16024
+ Utils.writeBigUInt64LE(b2, Constants.ZIP64HDR - Constants.ZIP64LEAD, offset + Constants.ZIP64SIZE);
16025
+ b2.writeUInt16LE(45, offset + Constants.ZIP64VEM);
16026
+ b2.writeUInt16LE(45, offset + Constants.ZIP64VER);
16027
+ b2.writeUInt32LE(0, offset + Constants.ZIP64DSK);
16028
+ b2.writeUInt32LE(0, offset + Constants.ZIP64DSKDIR);
16029
+ Utils.writeBigUInt64LE(b2, _volumeEntries, offset + Constants.ZIP64SUB);
16030
+ Utils.writeBigUInt64LE(b2, _totalEntries, offset + Constants.ZIP64TOT);
16031
+ Utils.writeBigUInt64LE(b2, _size2, offset + Constants.ZIP64SIZB);
16032
+ Utils.writeBigUInt64LE(b2, _offset, offset + Constants.ZIP64OFF);
14573
16033
  const zip64EndOffset = _offset + _size2;
14574
16034
  offset += Constants.ZIP64HDR;
14575
- b.writeUInt32LE(Constants.END64SIG, offset);
14576
- b.writeUInt32LE(0, offset + Constants.END64START);
14577
- Utils.writeBigUInt64LE(b, zip64EndOffset, offset + Constants.END64OFF);
14578
- b.writeUInt32LE(1, offset + Constants.END64NUMDISKS);
16035
+ b2.writeUInt32LE(Constants.END64SIG, offset);
16036
+ b2.writeUInt32LE(0, offset + Constants.END64START);
16037
+ Utils.writeBigUInt64LE(b2, zip64EndOffset, offset + Constants.END64OFF);
16038
+ b2.writeUInt32LE(1, offset + Constants.END64NUMDISKS);
14579
16039
  offset += Constants.END64HDR;
14580
- b.writeUInt32LE(Constants.ENDSIG, offset);
14581
- b.writeUInt32LE(0, offset + 4);
14582
- b.writeUInt16LE(Math.min(_volumeEntries, Constants.EF_ZIP64_OR_16), offset + Constants.ENDSUB);
14583
- b.writeUInt16LE(Math.min(_totalEntries, Constants.EF_ZIP64_OR_16), offset + Constants.ENDTOT);
14584
- b.writeUInt32LE(Math.min(_size2, Constants.EF_ZIP64_OR_32), offset + Constants.ENDSIZ);
14585
- b.writeUInt32LE(Math.min(_offset, Constants.EF_ZIP64_OR_32), offset + Constants.ENDOFF);
14586
- b.writeUInt16LE(_commentLength, offset + Constants.ENDCOM);
14587
- b.fill(" ", offset + Constants.ENDHDR);
14588
- return b;
16040
+ b2.writeUInt32LE(Constants.ENDSIG, offset);
16041
+ b2.writeUInt32LE(0, offset + 4);
16042
+ b2.writeUInt16LE(Math.min(_volumeEntries, Constants.EF_ZIP64_OR_16), offset + Constants.ENDSUB);
16043
+ b2.writeUInt16LE(Math.min(_totalEntries, Constants.EF_ZIP64_OR_16), offset + Constants.ENDTOT);
16044
+ b2.writeUInt32LE(Math.min(_size2, Constants.EF_ZIP64_OR_32), offset + Constants.ENDSIZ);
16045
+ b2.writeUInt32LE(Math.min(_offset, Constants.EF_ZIP64_OR_32), offset + Constants.ENDOFF);
16046
+ b2.writeUInt16LE(_commentLength, offset + Constants.ENDCOM);
16047
+ b2.fill(" ", offset + Constants.ENDHDR);
16048
+ return b2;
14589
16049
  },
14590
16050
  toJSON: function() {
14591
16051
  const offset = function(nr, len) {
@@ -14694,7 +16154,7 @@ var require_zipcrypto = __commonJS({
14694
16154
  var { randomFillSync } = __require("crypto");
14695
16155
  var Errors = require_errors2();
14696
16156
  var crctable = new Uint32Array(256).map((t2, crc) => {
14697
- for (let j = 0; j < 8; j++) {
16157
+ for (let j2 = 0; j2 < 8; j2++) {
14698
16158
  if (0 !== (crc & 1)) {
14699
16159
  crc = crc >>> 1 ^ 3988292384;
14700
16160
  } else {
@@ -14703,7 +16163,7 @@ var require_zipcrypto = __commonJS({
14703
16163
  }
14704
16164
  return crc >>> 0;
14705
16165
  });
14706
- var uMul = (a, b) => Math.imul(a, b) >>> 0;
16166
+ var uMul = (a, b2) => Math.imul(a, b2) >>> 0;
14707
16167
  var crc32update = (pCrc32, bval) => {
14708
16168
  return crctable[(pCrc32 ^ bval) & 255] ^ pCrc32 >>> 8;
14709
16169
  };
@@ -15241,7 +16701,7 @@ var require_zipFile = __commonJS({
15241
16701
  }
15242
16702
  function sortEntries() {
15243
16703
  if (entryList.length > 1 && !noSort) {
15244
- entryList.sort((a, b) => a.entryName.toLowerCase().localeCompare(b.entryName.toLowerCase()));
16704
+ entryList.sort((a, b2) => a.entryName.toLowerCase().localeCompare(b2.entryName.toLowerCase()));
15245
16705
  }
15246
16706
  }
15247
16707
  return {
@@ -16399,7 +17859,7 @@ __export(external_exports, {
16399
17859
  // node_modules/zod/v3/helpers/util.js
16400
17860
  var util;
16401
17861
  (function(util2) {
16402
- util2.assertEqual = (_) => {
17862
+ util2.assertEqual = (_2) => {
16403
17863
  };
16404
17864
  function assertIs2(_arg) {
16405
17865
  }
@@ -16449,7 +17909,7 @@ var util;
16449
17909
  return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
16450
17910
  }
16451
17911
  util2.joinValues = joinValues2;
16452
- util2.jsonStringifyReplacer = (_, value) => {
17912
+ util2.jsonStringifyReplacer = (_2, value) => {
16453
17913
  if (typeof value === "bigint") {
16454
17914
  return value.toString();
16455
17915
  }
@@ -16776,7 +18236,7 @@ var makeIssue = (params) => {
16776
18236
  };
16777
18237
  }
16778
18238
  let errorMessage = "";
16779
- const maps = errorMaps.filter((m2) => !!m2).slice().reverse();
18239
+ const maps = errorMaps.filter((m3) => !!m3).slice().reverse();
16780
18240
  for (const map of maps) {
16781
18241
  errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
16782
18242
  }
@@ -16802,7 +18262,7 @@ function addIssueToContext(ctx2, issueData) {
16802
18262
  // then global override map
16803
18263
  overrideMap === en_default ? void 0 : en_default
16804
18264
  // then global default map
16805
- ].filter((x2) => !!x2)
18265
+ ].filter((x3) => !!x3)
16806
18266
  });
16807
18267
  ctx2.common.issues.push(issue2);
16808
18268
  }
@@ -16865,10 +18325,10 @@ var INVALID = Object.freeze({
16865
18325
  });
16866
18326
  var DIRTY = (value) => ({ status: "dirty", value });
16867
18327
  var OK = (value) => ({ status: "valid", value });
16868
- var isAborted = (x2) => x2.status === "aborted";
16869
- var isDirty = (x2) => x2.status === "dirty";
16870
- var isValid = (x2) => x2.status === "valid";
16871
- var isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise;
18328
+ var isAborted = (x3) => x3.status === "aborted";
18329
+ var isDirty = (x3) => x3.status === "dirty";
18330
+ var isValid = (x3) => x3.status === "valid";
18331
+ var isAsync = (x3) => typeof Promise !== "undefined" && x3 instanceof Promise;
16872
18332
 
16873
18333
  // node_modules/zod/v3/helpers/errorUtil.js
16874
18334
  var errorUtil;
@@ -19188,17 +20648,17 @@ var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
19188
20648
  });
19189
20649
  }
19190
20650
  };
19191
- function mergeValues(a, b) {
20651
+ function mergeValues(a, b2) {
19192
20652
  const aType = getParsedType(a);
19193
- const bType = getParsedType(b);
19194
- if (a === b) {
20653
+ const bType = getParsedType(b2);
20654
+ if (a === b2) {
19195
20655
  return { valid: true, data: a };
19196
20656
  } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
19197
- const bKeys = util.objectKeys(b);
20657
+ const bKeys = util.objectKeys(b2);
19198
20658
  const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
19199
- const newObj = { ...a, ...b };
20659
+ const newObj = { ...a, ...b2 };
19200
20660
  for (const key of sharedKeys) {
19201
- const sharedValue = mergeValues(a[key], b[key]);
20661
+ const sharedValue = mergeValues(a[key], b2[key]);
19202
20662
  if (!sharedValue.valid) {
19203
20663
  return { valid: false };
19204
20664
  }
@@ -19206,13 +20666,13 @@ function mergeValues(a, b) {
19206
20666
  }
19207
20667
  return { valid: true, data: newObj };
19208
20668
  } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
19209
- if (a.length !== b.length) {
20669
+ if (a.length !== b2.length) {
19210
20670
  return { valid: false };
19211
20671
  }
19212
20672
  const newArray = [];
19213
20673
  for (let index = 0; index < a.length; index++) {
19214
20674
  const itemA = a[index];
19215
- const itemB = b[index];
20675
+ const itemB = b2[index];
19216
20676
  const sharedValue = mergeValues(itemA, itemB);
19217
20677
  if (!sharedValue.valid) {
19218
20678
  return { valid: false };
@@ -19220,7 +20680,7 @@ function mergeValues(a, b) {
19220
20680
  newArray.push(sharedValue.data);
19221
20681
  }
19222
20682
  return { valid: true, data: newArray };
19223
- } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
20683
+ } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b2) {
19224
20684
  return { valid: true, data: a };
19225
20685
  } else {
19226
20686
  return { valid: false };
@@ -19316,7 +20776,7 @@ var ZodTuple = class _ZodTuple extends ZodType {
19316
20776
  if (!schema)
19317
20777
  return null;
19318
20778
  return schema._parse(new ParseInputLazyPath(ctx2, item, ctx2.path, itemIndex));
19319
- }).filter((x2) => !!x2);
20779
+ }).filter((x3) => !!x3);
19320
20780
  if (ctx2.common.async) {
19321
20781
  return Promise.all(items).then((results) => {
19322
20782
  return ParseStatus.mergeArray(status, results);
@@ -19569,7 +21029,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
19569
21029
  return makeIssue({
19570
21030
  data: args,
19571
21031
  path: ctx2.path,
19572
- errorMaps: [ctx2.common.contextualErrorMap, ctx2.schemaErrorMap, getErrorMap(), en_default].filter((x2) => !!x2),
21032
+ errorMaps: [ctx2.common.contextualErrorMap, ctx2.schemaErrorMap, getErrorMap(), en_default].filter((x3) => !!x3),
19573
21033
  issueData: {
19574
21034
  code: ZodIssueCode.invalid_arguments,
19575
21035
  argumentsError: error2
@@ -19580,7 +21040,7 @@ var ZodFunction = class _ZodFunction extends ZodType {
19580
21040
  return makeIssue({
19581
21041
  data: returns,
19582
21042
  path: ctx2.path,
19583
- errorMaps: [ctx2.common.contextualErrorMap, ctx2.schemaErrorMap, getErrorMap(), en_default].filter((x2) => !!x2),
21043
+ errorMaps: [ctx2.common.contextualErrorMap, ctx2.schemaErrorMap, getErrorMap(), en_default].filter((x3) => !!x3),
19584
21044
  issueData: {
19585
21045
  code: ZodIssueCode.invalid_return_type,
19586
21046
  returnTypeError: error2
@@ -19590,29 +21050,29 @@ var ZodFunction = class _ZodFunction extends ZodType {
19590
21050
  const params = { errorMap: ctx2.common.contextualErrorMap };
19591
21051
  const fn = ctx2.data;
19592
21052
  if (this._def.returns instanceof ZodPromise) {
19593
- const me = this;
21053
+ const me2 = this;
19594
21054
  return OK(async function(...args) {
19595
21055
  const error2 = new ZodError([]);
19596
- const parsedArgs = await me._def.args.parseAsync(args, params).catch((e2) => {
21056
+ const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e2) => {
19597
21057
  error2.addIssue(makeArgsIssue(args, e2));
19598
21058
  throw error2;
19599
21059
  });
19600
21060
  const result = await Reflect.apply(fn, this, parsedArgs);
19601
- const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e2) => {
21061
+ const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e2) => {
19602
21062
  error2.addIssue(makeReturnsIssue(result, e2));
19603
21063
  throw error2;
19604
21064
  });
19605
21065
  return parsedReturns;
19606
21066
  });
19607
21067
  } else {
19608
- const me = this;
21068
+ const me2 = this;
19609
21069
  return OK(function(...args) {
19610
- const parsedArgs = me._def.args.safeParse(args, params);
21070
+ const parsedArgs = me2._def.args.safeParse(args, params);
19611
21071
  if (!parsedArgs.success) {
19612
21072
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
19613
21073
  }
19614
21074
  const result = Reflect.apply(fn, this, parsedArgs.data);
19615
- const parsedReturns = me._def.returns.safeParse(result, params);
21075
+ const parsedReturns = me2._def.returns.safeParse(result, params);
19616
21076
  if (!parsedReturns.success) {
19617
21077
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
19618
21078
  }
@@ -20174,10 +21634,10 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
20174
21634
  }
20175
21635
  }
20176
21636
  }
20177
- static create(a, b) {
21637
+ static create(a, b2) {
20178
21638
  return new _ZodPipeline({
20179
21639
  in: a,
20180
- out: b,
21640
+ out: b2,
20181
21641
  typeName: ZodFirstPartyTypeKind.ZodPipeline
20182
21642
  });
20183
21643
  }
@@ -20340,18 +21800,18 @@ function $constructor(name, initializer3, params) {
20340
21800
  (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
20341
21801
  inst._zod.traits.add(name);
20342
21802
  initializer3(inst, def);
20343
- for (const k in _.prototype) {
21803
+ for (const k in _2.prototype) {
20344
21804
  if (!(k in inst))
20345
- Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
21805
+ Object.defineProperty(inst, k, { value: _2.prototype[k].bind(inst) });
20346
21806
  }
20347
- inst._zod.constr = _;
21807
+ inst._zod.constr = _2;
20348
21808
  inst._zod.def = def;
20349
21809
  }
20350
21810
  const Parent = params?.Parent ?? Object;
20351
21811
  class Definition extends Parent {
20352
21812
  }
20353
21813
  Object.defineProperty(Definition, "name", { value: name });
20354
- function _(def) {
21814
+ function _2(def) {
20355
21815
  var _a;
20356
21816
  const inst = params?.Parent ? new Definition() : this;
20357
21817
  init(inst, def);
@@ -20361,16 +21821,16 @@ function $constructor(name, initializer3, params) {
20361
21821
  }
20362
21822
  return inst;
20363
21823
  }
20364
- Object.defineProperty(_, "init", { value: init });
20365
- Object.defineProperty(_, Symbol.hasInstance, {
21824
+ Object.defineProperty(_2, "init", { value: init });
21825
+ Object.defineProperty(_2, Symbol.hasInstance, {
20366
21826
  value: (inst) => {
20367
21827
  if (params?.Parent && inst instanceof params.Parent)
20368
21828
  return true;
20369
21829
  return inst?._zod?.traits?.has(name);
20370
21830
  }
20371
21831
  });
20372
- Object.defineProperty(_, "name", { value: name });
20373
- return _;
21832
+ Object.defineProperty(_2, "name", { value: name });
21833
+ return _2;
20374
21834
  }
20375
21835
  var $ZodAsyncError = class extends Error {
20376
21836
  constructor() {
@@ -20448,17 +21908,17 @@ function assertIs(_arg) {
20448
21908
  function assertNever(_x) {
20449
21909
  throw new Error();
20450
21910
  }
20451
- function assert(_) {
21911
+ function assert(_2) {
20452
21912
  }
20453
21913
  function getEnumValues(entries) {
20454
- const numericValues = Object.values(entries).filter((v) => typeof v === "number");
20455
- const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
21914
+ const numericValues = Object.values(entries).filter((v2) => typeof v2 === "number");
21915
+ const values = Object.entries(entries).filter(([k, _2]) => numericValues.indexOf(+k) === -1).map(([_2, v2]) => v2);
20456
21916
  return values;
20457
21917
  }
20458
21918
  function joinValues(array2, separator = "|") {
20459
21919
  return array2.map((val) => stringifyPrimitive(val)).join(separator);
20460
21920
  }
20461
- function jsonStringifyReplacer(_, value) {
21921
+ function jsonStringifyReplacer(_2, value) {
20462
21922
  if (typeof value === "bigint")
20463
21923
  return value.toString();
20464
21924
  return value;
@@ -20503,9 +21963,9 @@ function defineLazy(object3, key, getter) {
20503
21963
  }
20504
21964
  throw new Error("cached value already set");
20505
21965
  },
20506
- set(v) {
21966
+ set(v2) {
20507
21967
  Object.defineProperty(object3, key, {
20508
- value: v
21968
+ value: v2
20509
21969
  // configurable: true,
20510
21970
  });
20511
21971
  },
@@ -20557,10 +22017,10 @@ var allowsEval = cached(() => {
20557
22017
  return false;
20558
22018
  }
20559
22019
  try {
20560
- const F2 = Function;
20561
- new F2("");
22020
+ const F3 = Function;
22021
+ new F3("");
20562
22022
  return true;
20563
- } catch (_) {
22023
+ } catch (_2) {
20564
22024
  return false;
20565
22025
  }
20566
22026
  });
@@ -20661,31 +22121,31 @@ function normalizeParams(_params) {
20661
22121
  function createTransparentProxy(getter) {
20662
22122
  let target;
20663
22123
  return new Proxy({}, {
20664
- get(_, prop, receiver) {
22124
+ get(_2, prop, receiver) {
20665
22125
  target ?? (target = getter());
20666
22126
  return Reflect.get(target, prop, receiver);
20667
22127
  },
20668
- set(_, prop, value, receiver) {
22128
+ set(_2, prop, value, receiver) {
20669
22129
  target ?? (target = getter());
20670
22130
  return Reflect.set(target, prop, value, receiver);
20671
22131
  },
20672
- has(_, prop) {
22132
+ has(_2, prop) {
20673
22133
  target ?? (target = getter());
20674
22134
  return Reflect.has(target, prop);
20675
22135
  },
20676
- deleteProperty(_, prop) {
22136
+ deleteProperty(_2, prop) {
20677
22137
  target ?? (target = getter());
20678
22138
  return Reflect.deleteProperty(target, prop);
20679
22139
  },
20680
- ownKeys(_) {
22140
+ ownKeys(_2) {
20681
22141
  target ?? (target = getter());
20682
22142
  return Reflect.ownKeys(target);
20683
22143
  },
20684
- getOwnPropertyDescriptor(_, prop) {
22144
+ getOwnPropertyDescriptor(_2, prop) {
20685
22145
  target ?? (target = getter());
20686
22146
  return Reflect.getOwnPropertyDescriptor(target, prop);
20687
22147
  },
20688
- defineProperty(_, prop, descriptor) {
22148
+ defineProperty(_2, prop, descriptor) {
20689
22149
  target ?? (target = getter());
20690
22150
  return Reflect.defineProperty(target, prop, descriptor);
20691
22151
  }
@@ -20764,15 +22224,15 @@ function extend(schema, shape) {
20764
22224
  };
20765
22225
  return clone(schema, def);
20766
22226
  }
20767
- function merge(a, b) {
22227
+ function merge(a, b2) {
20768
22228
  return clone(a, {
20769
22229
  ...a._zod.def,
20770
22230
  get shape() {
20771
- const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
22231
+ const _shape = { ...a._zod.def.shape, ...b2._zod.def.shape };
20772
22232
  assignProp(this, "shape", _shape);
20773
22233
  return _shape;
20774
22234
  },
20775
- catchall: b._zod.def.catchall,
22235
+ catchall: b2._zod.def.catchall,
20776
22236
  checks: []
20777
22237
  // delete existing checks
20778
22238
  });
@@ -20836,9 +22296,9 @@ function required(Class2, schema, mask) {
20836
22296
  checks: []
20837
22297
  });
20838
22298
  }
20839
- function aborted(x2, startIndex = 0) {
20840
- for (let i2 = startIndex; i2 < x2.issues.length; i2++) {
20841
- if (x2.issues[i2]?.continue !== true)
22299
+ function aborted(x3, startIndex = 0) {
22300
+ for (let i2 = startIndex; i2 < x3.issues.length; i2++) {
22301
+ if (x3.issues[i2]?.continue !== true)
20842
22302
  return true;
20843
22303
  }
20844
22304
  return false;
@@ -20896,7 +22356,7 @@ function issue(...args) {
20896
22356
  return { ...iss };
20897
22357
  }
20898
22358
  function cleanEnum(obj) {
20899
- return Object.entries(obj).filter(([k, _]) => {
22359
+ return Object.entries(obj).filter(([k, _2]) => {
20900
22360
  return Number.isNaN(Number.parseInt(k, 10));
20901
22361
  }).map((el) => el[1]);
20902
22362
  }
@@ -21495,19 +22955,19 @@ var Doc = class {
21495
22955
  return;
21496
22956
  }
21497
22957
  const content = arg;
21498
- const lines = content.split("\n").filter((x2) => x2);
21499
- const minIndent = Math.min(...lines.map((x2) => x2.length - x2.trimStart().length));
21500
- const dedented = lines.map((x2) => x2.slice(minIndent)).map((x2) => " ".repeat(this.indent * 2) + x2);
22958
+ const lines = content.split("\n").filter((x3) => x3);
22959
+ const minIndent = Math.min(...lines.map((x3) => x3.length - x3.trimStart().length));
22960
+ const dedented = lines.map((x3) => x3.slice(minIndent)).map((x3) => " ".repeat(this.indent * 2) + x3);
21501
22961
  for (const line of dedented) {
21502
22962
  this.content.push(line);
21503
22963
  }
21504
22964
  }
21505
22965
  compile() {
21506
- const F2 = Function;
22966
+ const F3 = Function;
21507
22967
  const args = this?.args;
21508
22968
  const content = this?.content ?? [``];
21509
- const lines = [...content.map((x2) => ` ${x2}`)];
21510
- return new F2(...args, lines.join("\n"));
22969
+ const lines = [...content.map((x3) => ` ${x3}`)];
22970
+ return new F3(...args, lines.join("\n"));
21511
22971
  }
21512
22972
  };
21513
22973
 
@@ -21552,13 +23012,13 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
21552
23012
  continue;
21553
23013
  }
21554
23014
  const currLen = payload.issues.length;
21555
- const _ = ch._zod.check(payload);
21556
- if (_ instanceof Promise && ctx2?.async === false) {
23015
+ const _2 = ch._zod.check(payload);
23016
+ if (_2 instanceof Promise && ctx2?.async === false) {
21557
23017
  throw new $ZodAsyncError();
21558
23018
  }
21559
- if (asyncResult || _ instanceof Promise) {
23019
+ if (asyncResult || _2 instanceof Promise) {
21560
23020
  asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
21561
- await _;
23021
+ await _2;
21562
23022
  const nextLen = payload.issues.length;
21563
23023
  if (nextLen === currLen)
21564
23024
  return;
@@ -21595,7 +23055,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
21595
23055
  try {
21596
23056
  const r2 = safeParse(inst, value);
21597
23057
  return r2.success ? { value: r2.data } : { issues: r2.error?.issues };
21598
- } catch (_) {
23058
+ } catch (_2) {
21599
23059
  return safeParseAsync(inst, value).then((r2) => r2.success ? { value: r2.data } : { issues: r2.error?.issues });
21600
23060
  }
21601
23061
  },
@@ -21606,11 +23066,11 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
21606
23066
  var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
21607
23067
  $ZodType.init(inst, def);
21608
23068
  inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag);
21609
- inst._zod.parse = (payload, _) => {
23069
+ inst._zod.parse = (payload, _2) => {
21610
23070
  if (def.coerce)
21611
23071
  try {
21612
23072
  payload.value = String(payload.value);
21613
- } catch (_2) {
23073
+ } catch (_3) {
21614
23074
  }
21615
23075
  if (typeof payload.value === "string")
21616
23076
  return payload;
@@ -21643,10 +23103,10 @@ var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
21643
23103
  v7: 7,
21644
23104
  v8: 8
21645
23105
  };
21646
- const v = versionMap[def.version];
21647
- if (v === void 0)
23106
+ const v2 = versionMap[def.version];
23107
+ if (v2 === void 0)
21648
23108
  throw new Error(`Invalid UUID version: "${def.version}"`);
21649
- def.pattern ?? (def.pattern = uuid(v));
23109
+ def.pattern ?? (def.pattern = uuid(v2));
21650
23110
  } else
21651
23111
  def.pattern ?? (def.pattern = uuid());
21652
23112
  $ZodStringFormat.init(inst, def);
@@ -21696,7 +23156,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
21696
23156
  payload.value = href;
21697
23157
  }
21698
23158
  return;
21699
- } catch (_) {
23159
+ } catch (_2) {
21700
23160
  payload.issues.push({
21701
23161
  code: "invalid_format",
21702
23162
  format: "url",
@@ -21909,7 +23369,7 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
21909
23369
  if (def.coerce)
21910
23370
  try {
21911
23371
  payload.value = Number(payload.value);
21912
- } catch (_) {
23372
+ } catch (_2) {
21913
23373
  }
21914
23374
  const input = payload.value;
21915
23375
  if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
@@ -21937,7 +23397,7 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
21937
23397
  if (def.coerce)
21938
23398
  try {
21939
23399
  payload.value = Boolean(payload.value);
21940
- } catch (_) {
23400
+ } catch (_2) {
21941
23401
  }
21942
23402
  const input = payload.value;
21943
23403
  if (typeof input === "boolean")
@@ -22072,8 +23532,8 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
22072
23532
  const field = shape[key]._zod;
22073
23533
  if (field.values) {
22074
23534
  propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
22075
- for (const v of field.values)
22076
- propValues[key].add(v);
23535
+ for (const v2 of field.values)
23536
+ propValues[key].add(v2);
22077
23537
  }
22078
23538
  }
22079
23539
  return propValues;
@@ -22274,10 +23734,10 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
22274
23734
  const pv = option._zod.propValues;
22275
23735
  if (!pv || Object.keys(pv).length === 0)
22276
23736
  throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
22277
- for (const [k, v] of Object.entries(pv)) {
23737
+ for (const [k, v2] of Object.entries(pv)) {
22278
23738
  if (!propValues[k])
22279
23739
  propValues[k] = /* @__PURE__ */ new Set();
22280
- for (const val of v) {
23740
+ for (const val of v2) {
22281
23741
  propValues[k].add(val);
22282
23742
  }
22283
23743
  }
@@ -22291,11 +23751,11 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
22291
23751
  const values = o._zod.propValues[def.discriminator];
22292
23752
  if (!values || values.size === 0)
22293
23753
  throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
22294
- for (const v of values) {
22295
- if (map.has(v)) {
22296
- throw new Error(`Duplicate discriminator value "${String(v)}"`);
23754
+ for (const v2 of values) {
23755
+ if (map.has(v2)) {
23756
+ throw new Error(`Duplicate discriminator value "${String(v2)}"`);
22297
23757
  }
22298
- map.set(v, o);
23758
+ map.set(v2, o);
22299
23759
  }
22300
23760
  }
22301
23761
  return map;
@@ -22344,19 +23804,19 @@ var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, d
22344
23804
  return handleIntersectionResults(payload, left, right);
22345
23805
  };
22346
23806
  });
22347
- function mergeValues2(a, b) {
22348
- if (a === b) {
23807
+ function mergeValues2(a, b2) {
23808
+ if (a === b2) {
22349
23809
  return { valid: true, data: a };
22350
23810
  }
22351
- if (a instanceof Date && b instanceof Date && +a === +b) {
23811
+ if (a instanceof Date && b2 instanceof Date && +a === +b2) {
22352
23812
  return { valid: true, data: a };
22353
23813
  }
22354
- if (isPlainObject(a) && isPlainObject(b)) {
22355
- const bKeys = Object.keys(b);
23814
+ if (isPlainObject(a) && isPlainObject(b2)) {
23815
+ const bKeys = Object.keys(b2);
22356
23816
  const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
22357
- const newObj = { ...a, ...b };
23817
+ const newObj = { ...a, ...b2 };
22358
23818
  for (const key of sharedKeys) {
22359
- const sharedValue = mergeValues2(a[key], b[key]);
23819
+ const sharedValue = mergeValues2(a[key], b2[key]);
22360
23820
  if (!sharedValue.valid) {
22361
23821
  return {
22362
23822
  valid: false,
@@ -22367,14 +23827,14 @@ function mergeValues2(a, b) {
22367
23827
  }
22368
23828
  return { valid: true, data: newObj };
22369
23829
  }
22370
- if (Array.isArray(a) && Array.isArray(b)) {
22371
- if (a.length !== b.length) {
23830
+ if (Array.isArray(a) && Array.isArray(b2)) {
23831
+ if (a.length !== b2.length) {
22372
23832
  return { valid: false, mergeErrorPath: [] };
22373
23833
  }
22374
23834
  const newArray = [];
22375
23835
  for (let index = 0; index < a.length; index++) {
22376
23836
  const itemA = a[index];
22377
- const itemB = b[index];
23837
+ const itemB = b2[index];
22378
23838
  const sharedValue = mergeValues2(itemA, itemB);
22379
23839
  if (!sharedValue.valid) {
22380
23840
  return {
@@ -22626,8 +24086,8 @@ var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
22626
24086
  var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
22627
24087
  $ZodType.init(inst, def);
22628
24088
  defineLazy(inst._zod, "values", () => {
22629
- const v = def.innerType._zod.values;
22630
- return v ? new Set([...v].filter((x2) => x2 !== void 0)) : void 0;
24089
+ const v2 = def.innerType._zod.values;
24090
+ return v2 ? new Set([...v2].filter((x3) => x3 !== void 0)) : void 0;
22631
24091
  });
22632
24092
  inst._zod.parse = (payload, ctx2) => {
22633
24093
  const result = def.innerType._zod.run(payload, ctx2);
@@ -22725,7 +24185,7 @@ function handleReadonlyResult(payload) {
22725
24185
  var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
22726
24186
  $ZodCheck.init(inst, def);
22727
24187
  $ZodType.init(inst, def);
22728
- inst._zod.parse = (payload, _) => {
24188
+ inst._zod.parse = (payload, _2) => {
22729
24189
  return payload;
22730
24190
  };
22731
24191
  inst._zod.check = (payload) => {
@@ -23548,11 +25008,11 @@ var JSONSchemaGenerator = class {
23548
25008
  }
23549
25009
  const allKeys = new Set(Object.keys(shape));
23550
25010
  const requiredKeys = new Set([...allKeys].filter((key) => {
23551
- const v = def.shape[key]._zod;
25011
+ const v2 = def.shape[key]._zod;
23552
25012
  if (this.io === "input") {
23553
- return v.optin === void 0;
25013
+ return v2.optin === void 0;
23554
25014
  } else {
23555
- return v.optout === void 0;
25015
+ return v2.optout === void 0;
23556
25016
  }
23557
25017
  }));
23558
25018
  if (requiredKeys.size > 0) {
@@ -23573,7 +25033,7 @@ var JSONSchemaGenerator = class {
23573
25033
  }
23574
25034
  case "union": {
23575
25035
  const json = _json;
23576
- json.anyOf = def.options.map((x2, i2) => this.process(x2, {
25036
+ json.anyOf = def.options.map((x3, i2) => this.process(x3, {
23577
25037
  ...params,
23578
25038
  path: [...params.path, "anyOf", i2]
23579
25039
  }));
@@ -23585,14 +25045,14 @@ var JSONSchemaGenerator = class {
23585
25045
  ...params,
23586
25046
  path: [...params.path, "allOf", 0]
23587
25047
  });
23588
- const b = this.process(def.right, {
25048
+ const b2 = this.process(def.right, {
23589
25049
  ...params,
23590
25050
  path: [...params.path, "allOf", 1]
23591
25051
  });
23592
25052
  const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
23593
25053
  const allOf = [
23594
25054
  ...isSimpleIntersection(a) ? a.allOf : [a],
23595
- ...isSimpleIntersection(b) ? b.allOf : [b]
25055
+ ...isSimpleIntersection(b2) ? b2.allOf : [b2]
23596
25056
  ];
23597
25057
  json.allOf = allOf;
23598
25058
  break;
@@ -23600,7 +25060,7 @@ var JSONSchemaGenerator = class {
23600
25060
  case "tuple": {
23601
25061
  const json = _json;
23602
25062
  json.type = "array";
23603
- const prefixItems = def.items.map((x2, i2) => this.process(x2, { ...params, path: [...params.path, "prefixItems", i2] }));
25063
+ const prefixItems = def.items.map((x3, i2) => this.process(x3, { ...params, path: [...params.path, "prefixItems", i2] }));
23604
25064
  if (this.target === "draft-2020-12") {
23605
25065
  json.prefixItems = prefixItems;
23606
25066
  } else {
@@ -23655,9 +25115,9 @@ var JSONSchemaGenerator = class {
23655
25115
  case "enum": {
23656
25116
  const json = _json;
23657
25117
  const values = getEnumValues(def.entries);
23658
- if (values.every((v) => typeof v === "number"))
25118
+ if (values.every((v2) => typeof v2 === "number"))
23659
25119
  json.type = "number";
23660
- if (values.every((v) => typeof v === "string"))
25120
+ if (values.every((v2) => typeof v2 === "string"))
23661
25121
  json.type = "string";
23662
25122
  json.enum = values;
23663
25123
  break;
@@ -23687,13 +25147,13 @@ var JSONSchemaGenerator = class {
23687
25147
  json.type = val === null ? "null" : typeof val;
23688
25148
  json.const = val;
23689
25149
  } else {
23690
- if (vals.every((v) => typeof v === "number"))
25150
+ if (vals.every((v2) => typeof v2 === "number"))
23691
25151
  json.type = "number";
23692
- if (vals.every((v) => typeof v === "string"))
25152
+ if (vals.every((v2) => typeof v2 === "string"))
23693
25153
  json.type = "string";
23694
- if (vals.every((v) => typeof v === "boolean"))
25154
+ if (vals.every((v2) => typeof v2 === "boolean"))
23695
25155
  json.type = "string";
23696
- if (vals.every((v) => v === null))
25156
+ if (vals.every((v2) => v2 === null))
23697
25157
  json.type = "null";
23698
25158
  json.enum = vals;
23699
25159
  }
@@ -23716,8 +25176,8 @@ var JSONSchemaGenerator = class {
23716
25176
  file.contentMediaType = mime[0];
23717
25177
  Object.assign(json, file);
23718
25178
  } else {
23719
- json.anyOf = mime.map((m2) => {
23720
- const mFile = { ...file, contentMediaType: m2 };
25179
+ json.anyOf = mime.map((m3) => {
25180
+ const mFile = { ...file, contentMediaType: m3 };
23721
25181
  return mFile;
23722
25182
  });
23723
25183
  }
@@ -24000,7 +25460,7 @@ function toJSONSchema(input, _params) {
24000
25460
  const gen2 = new JSONSchemaGenerator(_params);
24001
25461
  const defs = {};
24002
25462
  for (const entry of input._idmap.entries()) {
24003
- const [_, schema] = entry;
25463
+ const [_2, schema] = entry;
24004
25464
  gen2.process(schema);
24005
25465
  }
24006
25466
  const schemas = {};
@@ -24239,7 +25699,7 @@ function normalizeObjectSchema(schema) {
24239
25699
  const asV4 = schema;
24240
25700
  if (!asV3._def && !asV4._zod) {
24241
25701
  const values = Object.values(schema);
24242
- if (values.length > 0 && values.every((v) => typeof v === "object" && v !== null && (v._def !== void 0 || v._zod !== void 0 || typeof v.parse === "function"))) {
25702
+ if (values.length > 0 && values.every((v2) => typeof v2 === "object" && v2 !== null && (v2._def !== void 0 || v2._zod !== void 0 || typeof v2.parse === "function"))) {
24243
25703
  return objectFromShape(schema);
24244
25704
  }
24245
25705
  }
@@ -24806,7 +26266,7 @@ var ZodEnum2 = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
24806
26266
  };
24807
26267
  });
24808
26268
  function _enum(values, params) {
24809
- const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
26269
+ const entries = Array.isArray(values) ? Object.fromEntries(values.map((v2) => [v2, v2])) : values;
24810
26270
  return new ZodEnum2({
24811
26271
  type: "enum",
24812
26272
  entries,
@@ -25018,7 +26478,7 @@ var LATEST_PROTOCOL_VERSION = "2025-11-25";
25018
26478
  var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
25019
26479
  var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
25020
26480
  var JSONRPC_VERSION = "2.0";
25021
- var AssertObjectSchema = custom2((v) => v !== null && (typeof v === "object" || typeof v === "function"));
26481
+ var AssertObjectSchema = custom2((v2) => v2 !== null && (typeof v2 === "object" || typeof v2 === "function"));
25022
26482
  var ProgressTokenSchema = union([string2(), number2().int()]);
25023
26483
  var CursorSchema = string2();
25024
26484
  var TaskCreationParamsSchema = looseObject({
@@ -26829,7 +28289,7 @@ function parseIntersectionDef(def, refs) {
26829
28289
  ...refs,
26830
28290
  currentPath: [...refs.currentPath, "allOf", "1"]
26831
28291
  })
26832
- ].filter((x2) => !!x2);
28292
+ ].filter((x3) => !!x3);
26833
28293
  let unevaluatedProperties = refs.target === "jsonSchema2019-09" ? { unevaluatedProperties: false } : void 0;
26834
28294
  const mergedAllOf = [];
26835
28295
  allOf.forEach((schema) => {
@@ -27047,7 +28507,7 @@ function parseStringDef(def, refs) {
27047
28507
  case "trim":
27048
28508
  break;
27049
28509
  default:
27050
- /* @__PURE__ */ ((_) => {
28510
+ /* @__PURE__ */ ((_2) => {
27051
28511
  })(check2);
27052
28512
  }
27053
28513
  }
@@ -27069,7 +28529,7 @@ function escapeNonAlphaNumeric(source) {
27069
28529
  return result;
27070
28530
  }
27071
28531
  function addFormat(schema, value, message, refs) {
27072
- if (schema.format || schema.anyOf?.some((x2) => x2.format)) {
28532
+ if (schema.format || schema.anyOf?.some((x3) => x3.format)) {
27073
28533
  if (!schema.anyOf) {
27074
28534
  schema.anyOf = [];
27075
28535
  }
@@ -27097,7 +28557,7 @@ function addFormat(schema, value, message, refs) {
27097
28557
  }
27098
28558
  }
27099
28559
  function addPattern(schema, regex, message, refs) {
27100
- if (schema.pattern || schema.allOf?.some((x2) => x2.pattern)) {
28560
+ if (schema.pattern || schema.allOf?.some((x3) => x3.pattern)) {
27101
28561
  if (!schema.allOf) {
27102
28562
  schema.allOf = [];
27103
28563
  }
@@ -27323,17 +28783,17 @@ function parseUnionDef(def, refs) {
27323
28783
  if (refs.target === "openApi3")
27324
28784
  return asAnyOf(def, refs);
27325
28785
  const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
27326
- if (options.every((x2) => x2._def.typeName in primitiveMappings && (!x2._def.checks || !x2._def.checks.length))) {
27327
- const types3 = options.reduce((types4, x2) => {
27328
- const type = primitiveMappings[x2._def.typeName];
28786
+ if (options.every((x3) => x3._def.typeName in primitiveMappings && (!x3._def.checks || !x3._def.checks.length))) {
28787
+ const types3 = options.reduce((types4, x3) => {
28788
+ const type = primitiveMappings[x3._def.typeName];
27329
28789
  return type && !types4.includes(type) ? [...types4, type] : types4;
27330
28790
  }, []);
27331
28791
  return {
27332
28792
  type: types3.length > 1 ? types3 : types3[0]
27333
28793
  };
27334
- } else if (options.every((x2) => x2._def.typeName === "ZodLiteral" && !x2.description)) {
27335
- const types3 = options.reduce((acc, x2) => {
27336
- const type = typeof x2._def.value;
28794
+ } else if (options.every((x3) => x3._def.typeName === "ZodLiteral" && !x3.description)) {
28795
+ const types3 = options.reduce((acc, x3) => {
28796
+ const type = typeof x3._def.value;
27337
28797
  switch (type) {
27338
28798
  case "string":
27339
28799
  case "number":
@@ -27342,7 +28802,7 @@ function parseUnionDef(def, refs) {
27342
28802
  case "bigint":
27343
28803
  return [...acc, "integer"];
27344
28804
  case "object":
27345
- if (x2._def.value === null)
28805
+ if (x3._def.value === null)
27346
28806
  return [...acc, "null"];
27347
28807
  case "symbol":
27348
28808
  case "undefined":
@@ -27352,30 +28812,30 @@ function parseUnionDef(def, refs) {
27352
28812
  }
27353
28813
  }, []);
27354
28814
  if (types3.length === options.length) {
27355
- const uniqueTypes = types3.filter((x2, i2, a) => a.indexOf(x2) === i2);
28815
+ const uniqueTypes = types3.filter((x3, i2, a) => a.indexOf(x3) === i2);
27356
28816
  return {
27357
28817
  type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
27358
- enum: options.reduce((acc, x2) => {
27359
- return acc.includes(x2._def.value) ? acc : [...acc, x2._def.value];
28818
+ enum: options.reduce((acc, x3) => {
28819
+ return acc.includes(x3._def.value) ? acc : [...acc, x3._def.value];
27360
28820
  }, [])
27361
28821
  };
27362
28822
  }
27363
- } else if (options.every((x2) => x2._def.typeName === "ZodEnum")) {
28823
+ } else if (options.every((x3) => x3._def.typeName === "ZodEnum")) {
27364
28824
  return {
27365
28825
  type: "string",
27366
- enum: options.reduce((acc, x2) => [
28826
+ enum: options.reduce((acc, x3) => [
27367
28827
  ...acc,
27368
- ...x2._def.values.filter((x3) => !acc.includes(x3))
28828
+ ...x3._def.values.filter((x4) => !acc.includes(x4))
27369
28829
  ], [])
27370
28830
  };
27371
28831
  }
27372
28832
  return asAnyOf(def, refs);
27373
28833
  }
27374
28834
  var asAnyOf = (def, refs) => {
27375
- const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x2, i2) => parseDef(x2._def, {
28835
+ const anyOf = (def.options instanceof Map ? Array.from(def.options.values()) : def.options).map((x3, i2) => parseDef(x3._def, {
27376
28836
  ...refs,
27377
28837
  currentPath: [...refs.currentPath, "anyOf", `${i2}`]
27378
- })).filter((x2) => !!x2 && (!refs.strictUnions || typeof x2 === "object" && Object.keys(x2).length > 0));
28838
+ })).filter((x3) => !!x3 && (!refs.strictUnions || typeof x3 === "object" && Object.keys(x3).length > 0));
27379
28839
  return anyOf.length ? { anyOf } : void 0;
27380
28840
  };
27381
28841
 
@@ -27560,12 +29020,12 @@ var parsePipelineDef = (def, refs) => {
27560
29020
  ...refs,
27561
29021
  currentPath: [...refs.currentPath, "allOf", "0"]
27562
29022
  });
27563
- const b = parseDef(def.out._def, {
29023
+ const b2 = parseDef(def.out._def, {
27564
29024
  ...refs,
27565
29025
  currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"]
27566
29026
  });
27567
29027
  return {
27568
- allOf: [a, b].filter((x2) => x2 !== void 0)
29028
+ allOf: [a, b2].filter((x3) => x3 !== void 0)
27569
29029
  };
27570
29030
  };
27571
29031
 
@@ -27600,10 +29060,10 @@ function parseTupleDef(def, refs) {
27600
29060
  return {
27601
29061
  type: "array",
27602
29062
  minItems: def.items.length,
27603
- items: def.items.map((x2, i2) => parseDef(x2._def, {
29063
+ items: def.items.map((x3, i2) => parseDef(x3._def, {
27604
29064
  ...refs,
27605
29065
  currentPath: [...refs.currentPath, "items", `${i2}`]
27606
- })).reduce((acc, x2) => x2 === void 0 ? acc : [...acc, x2], []),
29066
+ })).reduce((acc, x3) => x3 === void 0 ? acc : [...acc, x3], []),
27607
29067
  additionalItems: parseDef(def.rest._def, {
27608
29068
  ...refs,
27609
29069
  currentPath: [...refs.currentPath, "additionalItems"]
@@ -27614,10 +29074,10 @@ function parseTupleDef(def, refs) {
27614
29074
  type: "array",
27615
29075
  minItems: def.items.length,
27616
29076
  maxItems: def.items.length,
27617
- items: def.items.map((x2, i2) => parseDef(x2._def, {
29077
+ items: def.items.map((x3, i2) => parseDef(x3._def, {
27618
29078
  ...refs,
27619
29079
  currentPath: [...refs.currentPath, "items", `${i2}`]
27620
- })).reduce((acc, x2) => x2 === void 0 ? acc : [...acc, x2], [])
29080
+ })).reduce((acc, x3) => x3 === void 0 ? acc : [...acc, x3], [])
27621
29081
  };
27622
29082
  }
27623
29083
  }
@@ -27711,7 +29171,7 @@ var selectParser = (def, typeName, refs) => {
27711
29171
  case ZodFirstPartyTypeKind.ZodSymbol:
27712
29172
  return void 0;
27713
29173
  default:
27714
- return /* @__PURE__ */ ((_) => void 0)(typeName);
29174
+ return /* @__PURE__ */ ((_2) => void 0)(typeName);
27715
29175
  }
27716
29176
  };
27717
29177
 
@@ -29918,7 +31378,7 @@ var McpServer = class {
29918
31378
  }
29919
31379
  });
29920
31380
  this.server.setRequestHandler(ListResourcesRequestSchema, async (request, extra) => {
29921
- const resources = Object.entries(this._registeredResources).filter(([_, resource]) => resource.enabled).map(([uri, resource]) => ({
31381
+ const resources = Object.entries(this._registeredResources).filter(([_2, resource]) => resource.enabled).map(([uri, resource]) => ({
29922
31382
  uri,
29923
31383
  name: resource.name,
29924
31384
  ...resource.metadata
@@ -30119,7 +31579,7 @@ var McpServer = class {
30119
31579
  };
30120
31580
  this._registeredResourceTemplates[name] = registeredResourceTemplate;
30121
31581
  const variableNames = template.uriTemplate.variableNames;
30122
- const hasCompleter = Array.isArray(variableNames) && variableNames.some((v) => !!template.completeCallback(v));
31582
+ const hasCompleter = Array.isArray(variableNames) && variableNames.some((v2) => !!template.completeCallback(v2));
30123
31583
  if (hasCompleter) {
30124
31584
  this.setCompletionRequestHandler();
30125
31585
  }
@@ -30236,7 +31696,7 @@ var McpServer = class {
30236
31696
  annotations = rest.shift();
30237
31697
  }
30238
31698
  } else if (typeof firstArg === "object" && firstArg !== null) {
30239
- if (Object.values(firstArg).some((v) => typeof v === "object" && v !== null)) {
31699
+ if (Object.values(firstArg).some((v2) => typeof v2 === "object" && v2 !== null)) {
30240
31700
  throw new Error(`Tool ${name} expected a Zod schema or ToolAnnotations, but received an unrecognized object`);
30241
31701
  }
30242
31702
  annotations = rest.shift();
@@ -30517,6 +31977,10 @@ var ConfluenceClient = class {
30517
31977
  authHeader() {
30518
31978
  return `Basic ${Buffer.from(`${this.auth.username}:${this.auth.password}`).toString("base64")}`;
30519
31979
  }
31980
+ /** Jira/Confluence 공통 base URL(트레일링 슬래시 제거). 툴에서 페이지 webui URL 조합용. */
31981
+ getBaseUrl() {
31982
+ return this.baseUrl;
31983
+ }
30520
31984
  async getPage(pageId, expand) {
30521
31985
  const params = expand?.length ? `?expand=${expand.join(",")}` : "";
30522
31986
  const resp = await fetch(
@@ -30791,7 +32255,7 @@ var XrayClient = class {
30791
32255
  };
30792
32256
 
30793
32257
  // src/tools/jira-crud.ts
30794
- init_jira_client();
32258
+ init_markdown();
30795
32259
  init_jira_fields();
30796
32260
  var registerJiraCrudTools = (ctx2) => {
30797
32261
  const { server: server2, jira: jira2 } = ctx2;
@@ -30814,7 +32278,7 @@ var registerJiraCrudTools = (ctx2) => {
30814
32278
  project: external_exports.string().describe("Project key (e.g. PROJ)"),
30815
32279
  summary: external_exports.string().describe("Issue summary/title"),
30816
32280
  issuetype: external_exports.string().describe("Issue type name (e.g. Task, Story, Bug, Requirement)"),
30817
- description: external_exports.string().optional().describe("Issue description (plain text, auto-converted to ADF)"),
32281
+ description: external_exports.string().optional().describe("Issue description (markdown or plain text, auto-converted to ADF: headings/lists/tables/code supported)"),
30818
32282
  assignee: external_exports.string().optional().describe("Assignee email or accountId"),
30819
32283
  labels: external_exports.array(external_exports.string()).optional().describe("Labels to apply"),
30820
32284
  priority: external_exports.string().optional().describe("Priority name (e.g. High, Medium, Low)"),
@@ -30828,7 +32292,7 @@ var registerJiraCrudTools = (ctx2) => {
30828
32292
  summary,
30829
32293
  issuetype: { name: issuetype }
30830
32294
  };
30831
- if (description) fields.description = textToAdf(description);
32295
+ if (description) fields.description = markdownToAdf(description);
30832
32296
  if (assignee) fields.assignee = { emailAddress: assignee };
30833
32297
  if (labels?.length) fields.labels = labels;
30834
32298
  if (priority) fields.priority = { name: priority };
@@ -30844,15 +32308,15 @@ var registerJiraCrudTools = (ctx2) => {
30844
32308
  const data = await jira2.createIssue(finalFields);
30845
32309
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
30846
32310
  });
30847
- server2.tool("jira_update_issue", "Update fields on a Jira issue. Rich-text customfields: pass their keys in rich_text_custom_fields (string values auto-converted to ADF), or set auto_detect_rich_text to infer them from the issue's field schema. description is accepted as plain text and auto-converted to ADF.", {
32311
+ server2.tool("jira_update_issue", "Update fields on a Jira issue. Rich-text customfields: pass their keys in rich_text_custom_fields (string values auto-converted to ADF), or set auto_detect_rich_text to infer them from the issue's field schema. description is accepted as markdown/plain text and auto-converted to ADF (headings/lists/tables/code supported).", {
30848
32312
  issue_key: external_exports.string().describe("Issue key (e.g. PROJ-123)"),
30849
32313
  fields: external_exports.record(external_exports.unknown()).describe("Fields to update as key-value pairs. Rich-text (ADF) fields should be listed in rich_text_custom_fields; otherwise pass a pre-built ADF object."),
30850
- description: external_exports.string().optional().describe("New description (plain text, auto-converted to ADF). Overrides fields.description if present."),
32314
+ description: external_exports.string().optional().describe("New description (markdown or plain text, auto-converted to ADF: headings/lists/tables/code supported). Overrides fields.description if present."),
30851
32315
  rich_text_custom_fields: external_exports.array(external_exports.string()).optional().describe("customfield keys whose plain-text values should be auto-converted to ADF. Discover ADF candidates via jira_get_issue_type_schema (inferredFormat: adf/adf-suspect)."),
30852
32316
  auto_detect_rich_text: external_exports.boolean().optional().describe("If true, detect ADF fields from the issue's issuetype schema and auto-convert (merged with rich_text_custom_fields). Adds extra API calls.")
30853
32317
  }, async ({ issue_key, fields, description, rich_text_custom_fields, auto_detect_rich_text }) => {
30854
32318
  const merged = { ...fields };
30855
- if (description !== void 0) merged.description = textToAdf(description);
32319
+ if (description !== void 0) merged.description = markdownToAdf(description);
30856
32320
  let adfKeys = rich_text_custom_fields || [];
30857
32321
  if (auto_detect_rich_text) {
30858
32322
  const issue2 = await jira2.getIssue(issue_key, ["issuetype", "project"]);
@@ -30924,6 +32388,7 @@ var registerJiraCrudTools = (ctx2) => {
30924
32388
  };
30925
32389
 
30926
32390
  // src/tools/confluence.ts
32391
+ init_markdown();
30927
32392
  var registerConfluenceTools = (ctx2) => {
30928
32393
  const { server: server2, confluence: confluence2 } = ctx2;
30929
32394
  server2.tool("confluence_get_page", "Get a Confluence page by ID", {
@@ -30975,6 +32440,43 @@ var registerConfluenceTools = (ctx2) => {
30975
32440
  const data = await confluence2.getPageChildren(page_id, limit);
30976
32441
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
30977
32442
  });
32443
+ server2.tool("confluence_publish_doc", "Publish a markdown document as a Confluence page. Markdown is converted to native Confluence storage format (headings/lists/tables/inline marks + code fences \u2192 code macro; YAML frontmatter auto-stripped). Create a new page, or update an existing one when page_id is provided (version auto-incremented). Use to publish doc_render output to Confluence after human review.", {
32444
+ space_key: external_exports.string().describe("Confluence space key (e.g. PROJ). Required even in update mode (returned for reference)."),
32445
+ title: external_exports.string().describe("Page title"),
32446
+ markdown: external_exports.string().describe("Document content in markdown. Headings (#), bullet/ordered lists, GFM tables, fenced code blocks, and inline marks (**bold**/*italic*/`code`) are supported."),
32447
+ parent_page_id: external_exports.string().optional().describe("Parent page ID \u2014 create mode only, nests the new page under this parent. Ignored in update mode."),
32448
+ page_id: external_exports.string().optional().describe("Existing page ID. When provided, the page is UPDATED (current version fetched then incremented). When omitted, a NEW page is created.")
32449
+ }, async ({ space_key, title, markdown, parent_page_id, page_id }) => {
32450
+ const body = markdownToStorageFormat(markdown);
32451
+ let result;
32452
+ let mode;
32453
+ if (page_id) {
32454
+ mode = "update";
32455
+ const current = await confluence2.getPage(page_id, ["version"]);
32456
+ const currentVersion = current?.version?.number ?? 0;
32457
+ result = await confluence2.updatePage(page_id, title, body, currentVersion);
32458
+ } else {
32459
+ mode = "create";
32460
+ result = await confluence2.createPage(space_key, title, body, parent_page_id);
32461
+ }
32462
+ const pageIdOut = result?.id ?? page_id;
32463
+ const webui = result?._links?.webui;
32464
+ const url = webui ? webui.startsWith("http") ? webui : `${confluence2.getBaseUrl()}${webui}` : void 0;
32465
+ return {
32466
+ content: [{
32467
+ type: "text",
32468
+ text: JSON.stringify({
32469
+ mode,
32470
+ page_id: pageIdOut,
32471
+ title,
32472
+ space_key,
32473
+ version: result?.version?.number,
32474
+ url,
32475
+ body_chars: body.length
32476
+ }, null, 2)
32477
+ }]
32478
+ };
32479
+ });
30978
32480
  };
30979
32481
 
30980
32482
  // src/config/project-config.ts
@@ -31068,7 +32570,7 @@ ${results.join("\n")}` }] };
31068
32570
  return { content: [{ type: "text", text: JSON.stringify({
31069
32571
  risk_model_key: config2.risk_model_key,
31070
32572
  risk_sets: config2.risk_sets,
31071
- classifiers: Object.fromEntries(Object.entries(config2.classifiers).map(([k, v]) => [k, { id: v.id, options: Object.keys(v.options) }]))
32573
+ classifiers: Object.fromEntries(Object.entries(config2.classifiers).map(([k, v2]) => [k, { id: v2.id, options: Object.keys(v2.options) }]))
31072
32574
  }, null, 2) }] };
31073
32575
  });
31074
32576
  server2.tool("risk_create_hazards", "Batch create Hazard tickets with Risk panel activation, risk values, and Risk Source links. Migrated from rmr_create_hazards.py.", {
@@ -31233,15 +32735,15 @@ function parseCvssVector(vector) {
31233
32735
  const colonIdx = part.indexOf(":");
31234
32736
  if (colonIdx > 0) {
31235
32737
  const k = part.substring(0, colonIdx);
31236
- const v = part.substring(colonIdx + 1);
31237
- if (k !== "CVSS") result[k] = v;
32738
+ const v2 = part.substring(colonIdx + 1);
32739
+ if (k !== "CVSS") result[k] = v2;
31238
32740
  }
31239
32741
  }
31240
32742
  return result;
31241
32743
  }
31242
32744
  function buildCvssVector(metrics) {
31243
- const base = BASE_METRICS.filter((m2) => metrics[m2]).map((m2) => `${m2}:${metrics[m2]}`).join("/");
31244
- const supp = SUPPLEMENTAL_METRICS.filter((m2) => metrics[m2] && metrics[m2] !== "X").map((m2) => `${m2}:${metrics[m2]}`).join("/");
32745
+ const base = BASE_METRICS.filter((m3) => metrics[m3]).map((m3) => `${m3}:${metrics[m3]}`).join("/");
32746
+ const supp = SUPPLEMENTAL_METRICS.filter((m3) => metrics[m3] && metrics[m3] !== "X").map((m3) => `${m3}:${metrics[m3]}`).join("/");
31245
32747
  return `CVSS:4.0/${base}${supp ? "/" + supp : ""}`;
31246
32748
  }
31247
32749
  function calculateCvssScore(metrics) {
@@ -31266,10 +32768,10 @@ function calculateCvssScore(metrics) {
31266
32768
  }
31267
32769
  function validateMetrics(metrics) {
31268
32770
  const errors = [];
31269
- for (const [k, v] of Object.entries(metrics)) {
32771
+ for (const [k, v2] of Object.entries(metrics)) {
31270
32772
  const valid = METRIC_VALUES[k];
31271
32773
  if (!valid) errors.push(`Unknown metric: ${k}`);
31272
- else if (!valid.includes(v)) errors.push(`Invalid value ${v} for ${k}. Valid: ${valid.join(", ")}`);
32774
+ else if (!valid.includes(v2)) errors.push(`Invalid value ${v2} for ${k}. Valid: ${valid.join(", ")}`);
31273
32775
  }
31274
32776
  return errors;
31275
32777
  }
@@ -31287,7 +32789,7 @@ ${errors.join("\n")}` }] };
31287
32789
  }
31288
32790
  const vector = buildCvssVector(metrics);
31289
32791
  const { score, severity } = calculateCvssScore(metrics);
31290
- const details = Object.entries(metrics).map(([k, v]) => ` ${k} = ${v} (${METRIC_LABELS[k] || k})`).join("\n");
32792
+ const details = Object.entries(metrics).map(([k, v2]) => ` ${k} = ${v2} (${METRIC_LABELS[k] || k})`).join("\n");
31291
32793
  return { content: [{ type: "text", text: `CVSS Vector: ${vector}
31292
32794
  Score: ${score} (${severity})
31293
32795
 
@@ -31331,7 +32833,7 @@ ${errors.join("\n")}` }] };
31331
32833
  let details = "";
31332
32834
  if (vector) {
31333
32835
  const metrics = parseCvssVector(vector);
31334
- details = "\n\nMetrics:\n" + Object.entries(metrics).map(([k, v]) => ` ${k} = ${v} (${METRIC_LABELS[k] || k})`).join("\n");
32836
+ details = "\n\nMetrics:\n" + Object.entries(metrics).map(([k, v2]) => ` ${k} = ${v2} (${METRIC_LABELS[k] || k})`).join("\n");
31335
32837
  }
31336
32838
  return { content: [{ type: "text", text: `${issue_key}: ${f3?.summary}
31337
32839
  CVSS Vector: ${vector}
@@ -31402,7 +32904,7 @@ var registerTraceabilityTools = (ctx2) => {
31402
32904
  `Subtasks: ${(f3.subtasks || []).map((s2) => s2.key).join(", ") || "(none)"}`,
31403
32905
  "",
31404
32906
  `Links (${links.length}):`,
31405
- ...links.map((l) => ` ${l.direction === "inward" ? "\u2190" : "\u2192"} [${l.link_type}] ${l.key}: ${l.summary}`)
32907
+ ...links.map((l3) => ` ${l3.direction === "inward" ? "\u2190" : "\u2192"} [${l3.link_type}] ${l3.key}: ${l3.summary}`)
31406
32908
  ];
31407
32909
  return { content: [{ type: "text", text: report.join("\n") }] };
31408
32910
  });
@@ -31414,14 +32916,14 @@ var registerTraceabilityTools = (ctx2) => {
31414
32916
  const missing = [];
31415
32917
  for (const gate of gates.issues || []) {
31416
32918
  const gateLinks = extractLinks(gate);
31417
- const documentKeys = gateLinks.filter((l) => l.link_type === "is blocked by").map((l) => l.key);
32919
+ const documentKeys = gateLinks.filter((l3) => l3.link_type === "is blocked by").map((l3) => l3.key);
31418
32920
  for (const docKey of documentKeys) {
31419
32921
  const docData = await jira2.getIssue(docKey, ["summary", "issuetype", "issuelinks"]);
31420
32922
  const docLinks = extractLinks(docData);
31421
32923
  const docType = docData.fields?.issuetype?.name;
31422
32924
  const docSummary = docData.fields?.summary || "";
31423
32925
  if (docType === "Document" && docSummary.includes("Risk Management Report")) {
31424
- const hasHazardLinks = docLinks.some((l) => l.link_type === "Relates");
32926
+ const hasHazardLinks = docLinks.some((l3) => l3.link_type === "Relates");
31425
32927
  if (!hasHazardLinks && documentKeys.length > 0) {
31426
32928
  missing.push({ source: docKey, target: "(any Hazard)", expected_link: "Relates" });
31427
32929
  }
@@ -31429,7 +32931,7 @@ var registerTraceabilityTools = (ctx2) => {
31429
32931
  }
31430
32932
  }
31431
32933
  return { content: [{ type: "text", text: missing.length > 0 ? `Missing links found:
31432
- ${missing.map((m2) => ` ${m2.source} \u2192 ${m2.target} [${m2.expected_link}]`).join("\n")}` : `No missing links found for Gate issues in ${projectKey}` }] };
32934
+ ${missing.map((m3) => ` ${m3.source} \u2192 ${m3.target} [${m3.expected_link}]`).join("\n")}` : `No missing links found for Gate issues in ${projectKey}` }] };
31433
32935
  });
31434
32936
  server2.tool("traceability_fix", "Automatically create missing traceability links", {
31435
32937
  links: external_exports.array(external_exports.object({
@@ -31439,12 +32941,12 @@ ${missing.map((m2) => ` ${m2.source} \u2192 ${m2.target} [${m2.expected_link}]`
31439
32941
  })).describe("Array of links to create")
31440
32942
  }, async ({ links: linksToCreate }) => {
31441
32943
  const results = [];
31442
- for (const l of linksToCreate) {
32944
+ for (const l3 of linksToCreate) {
31443
32945
  try {
31444
- await jira2.createLink(l.link_type, l.inward_key, l.outward_key);
31445
- results.push({ link: `${l.inward_key} \u2190[${l.link_type}]\u2192 ${l.outward_key}`, status: "created" });
32946
+ await jira2.createLink(l3.link_type, l3.inward_key, l3.outward_key);
32947
+ results.push({ link: `${l3.inward_key} \u2190[${l3.link_type}]\u2192 ${l3.outward_key}`, status: "created" });
31446
32948
  } catch (e2) {
31447
- results.push({ link: `${l.inward_key} \u2190[${l.link_type}]\u2192 ${l.outward_key}`, status: `failed: ${e2.message}` });
32949
+ results.push({ link: `${l3.inward_key} \u2190[${l3.link_type}]\u2192 ${l3.outward_key}`, status: `failed: ${e2.message}` });
31448
32950
  }
31449
32951
  }
31450
32952
  return { content: [{ type: "text", text: results.map((r2) => `${r2.status}: ${r2.link}`).join("\n") }] };
@@ -31583,12 +33085,12 @@ ${steps.map((s2) => `\u2022 ${s2}`).join("\n")}${LINK_GUIDE}` }] };
31583
33085
  phase: external_exports.number().optional().describe("Implementation phase number"),
31584
33086
  blocks: external_exports.array(external_exports.string()).optional().describe("Summary strings of tasks this blocks (for linking later)")
31585
33087
  }, async ({ project_key, summary, description, sds_key, dd_keys, phase, blocks }) => {
31586
- const { textToAdf: textToAdf2 } = await Promise.resolve().then(() => (init_jira_client(), jira_client_exports));
33088
+ const { markdownToAdf: markdownToAdf2 } = await Promise.resolve().then(() => (init_markdown(), markdown_exports));
31587
33089
  const issue2 = await jira2.createIssue({
31588
33090
  project: { key: project_key },
31589
33091
  summary,
31590
33092
  issuetype: { name: "Task" },
31591
- description: textToAdf2(description || summary)
33093
+ description: markdownToAdf2(description || summary)
31592
33094
  });
31593
33095
  const issueKey = issue2.key;
31594
33096
  await jira2.createLink("Relates", issueKey, sds_key);
@@ -31603,8 +33105,8 @@ ${steps.map((s2) => `\u2022 ${s2}`).join("\n")}${LINK_GUIDE}` }] };
31603
33105
  issue_key: external_exports.string().describe("Ticket key"),
31604
33106
  content: external_exports.string().describe("Document content (markdown or plain text)")
31605
33107
  }, async ({ issue_key, content }) => {
31606
- const { textToAdf: textToAdf2 } = await Promise.resolve().then(() => (init_jira_client(), jira_client_exports));
31607
- await jira2.updateIssue(issue_key, { description: textToAdf2(content) });
33108
+ const { markdownToAdf: markdownToAdf2 } = await Promise.resolve().then(() => (init_markdown(), markdown_exports));
33109
+ await jira2.updateIssue(issue_key, { description: markdownToAdf2(content) });
31608
33110
  return { content: [{ type: "text", text: `Updated ${issue_key} description (${content.length} chars)` }] };
31609
33111
  });
31610
33112
  };
@@ -31630,6 +33132,7 @@ var TOOL_CATALOG = [
31630
33132
  { name: "confluence_delete_page", description: "\uD398\uC774\uC9C0 \uC0AD\uC81C", category: "Confluence" },
31631
33133
  { name: "confluence_get_spaces", description: "\uC2A4\uD398\uC774\uC2A4 \uBAA9\uB85D", category: "Confluence" },
31632
33134
  { name: "confluence_get_page_children", description: "\uD558\uC704 \uD398\uC774\uC9C0 \uC870\uD68C", category: "Confluence" },
33135
+ { name: "confluence_publish_doc", description: "\uB9C8\uD06C\uB2E4\uC6B4 \uBB38\uC11C \u2192 Confluence \uD398\uC774\uC9C0 \uAC8C\uC7AC (create/update \uC790\uB3D9 \uBD84\uAE30, \uCF54\uB4DC\uD39C\uC2A4 \u2192 \uCF54\uB4DC \uB9E4\uD06C\uB85C)", category: "Confluence" },
31633
33136
  { name: "risk_get_config", description: "\uB9AC\uC2A4\uD06C \uAD00\uB9AC \uC124\uC815 \uC870\uD68C", category: "\uB9AC\uC2A4\uD06C \uAD00\uB9AC" },
31634
33137
  { name: "risk_activate_panel", description: "\uB9AC\uC2A4\uD06C \uD328\uB110 \uD65C\uC131\uD654", category: "\uB9AC\uC2A4\uD06C \uAD00\uB9AC" },
31635
33138
  { name: "risk_set_values", description: "\uB9AC\uC2A4\uD06C \uAC12(severity, p1, p2) \uC124\uC815", category: "\uB9AC\uC2A4\uD06C \uAD00\uB9AC" },
@@ -32331,9 +33834,9 @@ import path from "path";
32331
33834
  var VAR_RE = /\{([A-Z0-9_]+)\}/g;
32332
33835
  function extractVars(template) {
32333
33836
  const names = /* @__PURE__ */ new Set();
32334
- let m2;
32335
- while ((m2 = VAR_RE.exec(template)) !== null) {
32336
- names.add(m2[1]);
33837
+ let m3;
33838
+ while ((m3 = VAR_RE.exec(template)) !== null) {
33839
+ names.add(m3[1]);
32337
33840
  }
32338
33841
  return [...names];
32339
33842
  }
@@ -32349,13 +33852,13 @@ function renderTemplate(input) {
32349
33852
  const vars = extractVars(input.template);
32350
33853
  let rendered = input.template;
32351
33854
  const unresolved = [];
32352
- for (const v of vars) {
32353
- const resolver = META_RESOLVERS[v];
33855
+ for (const v2 of vars) {
33856
+ const resolver = META_RESOLVERS[v2];
32354
33857
  const val = resolver ? resolver(input) : void 0;
32355
33858
  if (val !== void 0 && val !== "") {
32356
- rendered = rendered.split(`{${v}}`).join(val);
33859
+ rendered = rendered.split(`{${v2}}`).join(val);
32357
33860
  } else {
32358
- unresolved.push(v);
33861
+ unresolved.push(v2);
32359
33862
  }
32360
33863
  }
32361
33864
  return { rendered, unresolved };
@@ -32462,7 +33965,7 @@ var registerDocRenderTools = (ctx2) => {
32462
33965
  "```",
32463
33966
  "",
32464
33967
  "## \uCC44\uC6CC\uC57C \uD560 placeholder \uBCC0\uC218 (\uD2F0\uCF13 \uB370\uC774\uD130\uB97C \uADFC\uAC70\uB85C \uC791\uC131)",
32465
- unresolved.length > 0 ? unresolved.map((v) => `- {${v}}`).join("\n") : "(\uC5C6\uC74C \u2014 \uBAA8\uB4E0 \uBCC0\uC218\uAC00 \uCE58\uD658\uB428)",
33968
+ unresolved.length > 0 ? unresolved.map((v2) => `- {${v2}}`).join("\n") : "(\uC5C6\uC74C \u2014 \uBAA8\uB4E0 \uBCC0\uC218\uAC00 \uCE58\uD658\uB428)",
32466
33969
  "",
32467
33970
  "## \uD2F0\uCF13 \uB370\uC774\uD130 (\uBE48\uCE78 \uC791\uC131\uC6A9 \uC7AC\uB8CC)",
32468
33971
  "```json",
@@ -32491,7 +33994,7 @@ var xrayClientSecret = process.env.XRAY_CLIENT_SECRET || "";
32491
33994
  var xray = xrayClientId && xrayClientSecret ? new XrayClient(xrayClientId, xrayClientSecret, jiraUrl, jiraEmail, jiraToken) : null;
32492
33995
  var server = new McpServer({
32493
33996
  name: "jira-confluence",
32494
- version: "0.1.0"
33997
+ version: "0.1.10"
32495
33998
  });
32496
33999
  var ctx = { server, jira, confluence, risk, xray };
32497
34000
  registerJiraCrudTools(ctx);