@pie-element/venn-classification 0.1.4-next.20261007184841 → 0.1.4

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.
@@ -8126,7 +8126,7 @@ var H$1 = [
8126
8126
  "style",
8127
8127
  "foreignobject"
8128
8128
  ];
8129
- var U = [
8129
+ var U$1 = [
8130
8130
  "onerror",
8131
8131
  "onload",
8132
8132
  "onclick",
@@ -8145,7 +8145,7 @@ var U = [
8145
8145
  "formaction",
8146
8146
  "xlink:href"
8147
8147
  ];
8148
- var W = /* @__PURE__ */ new Set([
8148
+ var W$1 = /* @__PURE__ */ new Set([
8149
8149
  "iframe",
8150
8150
  "object",
8151
8151
  "mstack",
@@ -8159,8 +8159,8 @@ var W = /* @__PURE__ */ new Set([
8159
8159
  "annotation",
8160
8160
  "none"
8161
8161
  ]);
8162
- var G = /^[a-z_][\w.-]*:[a-z][\w.-]*$/;
8163
- var K = [
8162
+ var G$1 = /^[a-z_][\w.-]*:[a-z][\w.-]*$/;
8163
+ var K$1 = [
8164
8164
  "alignment",
8165
8165
  "target",
8166
8166
  "allow",
@@ -8181,13 +8181,13 @@ var K = [
8181
8181
  "mslinethickness",
8182
8182
  "linebreak"
8183
8183
  ];
8184
- var q = /^\s*document\.getElementById\((['"])([^'"]+)\1\)\.play\(\)\s*;?\s*(?:return\s+false\s*;?\s*)?$/;
8185
- var J = "data-pie-play-audio";
8186
- var Y = {
8187
- ADD_TAGS: (e) => W.has(e) || G.test(e),
8188
- ADD_ATTR: K,
8184
+ var q$1 = /^\s*document\.getElementById\((['"])([^'"]+)\1\)\.play\(\)\s*;?\s*(?:return\s+false\s*;?\s*)?$/;
8185
+ var J$1 = "data-pie-play-audio";
8186
+ var Y$1 = {
8187
+ ADD_TAGS: (e) => W$1.has(e) || G$1.test(e),
8188
+ ADD_ATTR: K$1,
8189
8189
  FORBID_TAGS: H$1,
8190
- FORBID_ATTR: U,
8190
+ FORBID_ATTR: U$1,
8191
8191
  ALLOW_UNKNOWN_PROTOCOLS: !1,
8192
8192
  RETURN_TRUSTED_TYPE: !1
8193
8193
  };
@@ -8195,7 +8195,7 @@ var te$1 = !1;
8195
8195
  function ne$1(e) {
8196
8196
  for (let t of e.composedPath()) {
8197
8197
  if (!(t instanceof Element)) continue;
8198
- let n = t.getAttribute(J);
8198
+ let n = t.getAttribute(J$1);
8199
8199
  if (n === null) continue;
8200
8200
  e.preventDefault();
8201
8201
  let r = t.getRootNode().getElementById?.(n) ?? document.getElementById(n);
@@ -8203,25 +8203,25 @@ function ne$1(e) {
8203
8203
  return;
8204
8204
  }
8205
8205
  }
8206
- var X = null;
8206
+ var X$1 = null;
8207
8207
  function re$1() {
8208
- return X || (X = purify_default(window), X.addHook("beforeSanitizeAttributes", (e) => {
8208
+ return X$1 || (X$1 = purify_default(window), X$1.addHook("beforeSanitizeAttributes", (e) => {
8209
8209
  if (e.nodeName !== "A") return;
8210
- let t = q.exec(e.getAttribute("onclick") ?? "")?.[2];
8210
+ let t = q$1.exec(e.getAttribute("onclick") ?? "")?.[2];
8211
8211
  t !== void 0 && (e.removeAttribute("onclick"), e.setAttribute("data-pie-play-audio", t), te$1 || (te$1 = (document.addEventListener("click", ne$1), !0)));
8212
- }), X.addHook("afterSanitizeAttributes", v$1), X);
8212
+ }), X$1.addHook("afterSanitizeAttributes", v$1), X$1);
8213
8213
  }
8214
- var Z = 1e6;
8214
+ var Z$1 = 1e6;
8215
8215
  var Q$1 = /* @__PURE__ */ new Map();
8216
8216
  var $$1 = 0;
8217
8217
  function ie$1(t) {
8218
8218
  if (t == null || t === "" || !purify_default.isSupported) return "";
8219
8219
  let n = typeof t == "string" ? t : String(t), r = Q$1.get(n);
8220
8220
  if (r !== void 0) return r;
8221
- let i = String(re$1().sanitize(n, Y)), a = n.length + i.length;
8222
- if (a > Z) return i;
8221
+ let i = String(re$1().sanitize(n, Y$1)), a = n.length + i.length;
8222
+ if (a > Z$1) return i;
8223
8223
  for (let [e, t] of Q$1) {
8224
- if ($$1 + a <= Z) break;
8224
+ if ($$1 + a <= Z$1) break;
8225
8225
  Q$1.delete(e), $$1 -= e.length + t.length;
8226
8226
  }
8227
8227
  return Q$1.set(n, i), $$1 += a, i;
@@ -8370,82 +8370,82 @@ var oe = globalThis;
8370
8370
  var b = "PIE-MJX-CHTML-styles";
8371
8371
  var se = ["MJX-CHTML-styles", "MJX-SVG-styles"];
8372
8372
  var ce = re;
8373
- var x = "http://www.w3.org/1998/Math/MathML";
8374
- var le = /^([a-z_][\w.-]*):math$/;
8375
- var ue = /^[a-z][a-z0-9-]*$/;
8376
- function de(e) {
8373
+ var le = "http://www.w3.org/1998/Math/MathML";
8374
+ var ue = /^([a-z_][\w.-]*):math$/;
8375
+ var de = /^[a-z][a-z0-9-]*$/;
8376
+ function fe(e) {
8377
8377
  for (let t of e.querySelectorAll("*")) {
8378
- let n = le.exec(t.tagName.toLowerCase())?.[1];
8379
- !n || !e.contains(t) || t.closest("mjx-container") || t.replaceWith(S(t, `${n}:`));
8378
+ let n = ue.exec(t.tagName.toLowerCase())?.[1];
8379
+ !n || !e.contains(t) || t.closest("mjx-container") || t.replaceWith(pe(t, `${n}:`));
8380
8380
  }
8381
8381
  }
8382
- function S(e, t) {
8382
+ function pe(e, t) {
8383
8383
  let n = e.tagName.toLowerCase().slice(t.length);
8384
- if (!ue.test(n)) return e;
8385
- let r = e.ownerDocument.createElementNS(x, n);
8384
+ if (!de.test(n)) return e;
8385
+ let r = e.ownerDocument.createElementNS(le, n);
8386
8386
  for (let t of e.attributes) r.setAttribute(t.name, t.value);
8387
8387
  for (let n of [...e.childNodes]) {
8388
8388
  let e = n instanceof Element && n.tagName.toLowerCase().startsWith(t);
8389
- r.appendChild(e ? S(n, t) : n);
8389
+ r.appendChild(e ? pe(n, t) : n);
8390
8390
  }
8391
8391
  return r;
8392
8392
  }
8393
- var fe = /* @__PURE__ */ new Set([
8393
+ var me = /* @__PURE__ */ new Set([
8394
8394
  "updiagonalstrike",
8395
8395
  "downdiagonalstrike",
8396
8396
  "verticalstrike",
8397
8397
  "horizontalstrike"
8398
8398
  ]);
8399
- var pe = {
8399
+ var he = {
8400
8400
  thin: "0.035em",
8401
8401
  medium: "0.07em",
8402
8402
  thick: "0.14em"
8403
8403
  };
8404
- var me = {
8404
+ var ge = {
8405
8405
  tight: "0em",
8406
8406
  medium: "0.1em",
8407
8407
  loose: "0.2em"
8408
8408
  };
8409
- var he = /^(\d+(\.\d*)?|\.\d+)(em|ex|px|pt|pc|in|cm|mm)$/;
8410
- var ge = /^(#[0-9a-f]{3,8}|[a-z]+)$/i;
8411
- var _e$1 = /^(\d+(\.\d*)?|\.\d+)$/;
8412
- var ve = /* @__PURE__ */ new Set([
8409
+ var _e$1 = /^(\d+(\.\d*)?|\.\d+)(em|ex|px|pt|pc|in|cm|mm)$/;
8410
+ var ve = /^(#[0-9a-f]{3,8}|[a-z]+)$/i;
8411
+ var ye = /^(\d+(\.\d*)?|\.\d+)$/;
8412
+ var be = /* @__PURE__ */ new Set([
8413
8413
  "mn",
8414
8414
  "mo",
8415
8415
  "mi",
8416
8416
  "mtext"
8417
8417
  ]);
8418
- var ye = /* @__PURE__ */ new Set([
8418
+ var xe = /* @__PURE__ */ new Set([
8419
8419
  "stackalign",
8420
8420
  "charalign",
8421
8421
  "charspacing",
8422
8422
  "longdivstyle"
8423
8423
  ]);
8424
- function C(e, t, n = [], r = {}) {
8425
- let i = e.createElementNS(x, t);
8424
+ function x(e, t, n = [], r = {}) {
8425
+ let i = e.createElementNS(le, t);
8426
8426
  for (let [e, t] of Object.entries(r)) i.setAttribute(e, t);
8427
8427
  for (let e of n) e && i.appendChild(e);
8428
8428
  return i;
8429
8429
  }
8430
- function w(e, t) {
8431
- let n = C(e.document, "mo");
8430
+ function S(e, t) {
8431
+ let n = x(e.document, "mo");
8432
8432
  return n.textContent = t, n;
8433
8433
  }
8434
- function be(e) {
8435
- let t = C(e.document, "mn");
8436
- return t.textContent = "0", C(e.document, "mphantom", [t]);
8434
+ function Se(e) {
8435
+ let t = x(e.document, "mn");
8436
+ return t.textContent = "0", x(e.document, "mphantom", [t]);
8437
8437
  }
8438
- function T(e, t) {
8438
+ function C(e, t) {
8439
8439
  return e.getAttribute(t)?.trim().toLowerCase() || void 0;
8440
8440
  }
8441
- function E(e, t) {
8441
+ function w(e, t) {
8442
8442
  let n = Number.parseInt(e.getAttribute(t) ?? "", 10);
8443
8443
  return Number.isFinite(n) ? n : 0;
8444
8444
  }
8445
- function D(e) {
8445
+ function T(e) {
8446
8446
  return e.localName === "none" || e.localName === "mrow" && e.children.length === 0 && !e.textContent?.trim();
8447
8447
  }
8448
- function O(e, t, n = e) {
8448
+ function E(e, t, n = e) {
8449
8449
  switch (t) {
8450
8450
  case "left": return 0;
8451
8451
  case "center": return Math.floor(e / 2);
@@ -8453,14 +8453,14 @@ function O(e, t, n = e) {
8453
8453
  default: return n;
8454
8454
  }
8455
8455
  }
8456
- function k(e, t, n) {
8456
+ function D(e, t, n) {
8457
8457
  let r = [], i, a, o = (e, t) => {
8458
8458
  let s = (e) => t.reduceRight((e, t) => {
8459
8459
  let n = t.cloneNode(!1);
8460
8460
  return n.appendChild(e), n;
8461
8461
  }, e);
8462
8462
  if (e.localName === "mstyle") for (let n of [...e.children]) o(n, [...t, e]);
8463
- else if (D(e)) r.push(null);
8463
+ else if (T(e)) r.push(null);
8464
8464
  else if (e.localName === "mn" && e.children.length === 0) {
8465
8465
  let t = [...(e.textContent ?? "").trim()];
8466
8466
  for (let a of t) {
@@ -8469,28 +8469,28 @@ function k(e, t, n) {
8469
8469
  t.textContent = a, r.push(s(t));
8470
8470
  }
8471
8471
  t.length && (a ?? (a = r.length));
8472
- } else ve.has(e.localName) && e.textContent?.trim() === n.decimalPoint && (i ?? (i = r.length)), r.push(s(e));
8472
+ } else be.has(e.localName) && e.textContent?.trim() === n.decimalPoint && (i ?? (i = r.length)), r.push(s(e));
8473
8473
  };
8474
8474
  for (let t of e) o(t, []);
8475
8475
  return {
8476
8476
  kind: "digits",
8477
8477
  cells: r,
8478
- anchor: O(r.length, n.stackAlign, i ?? a),
8478
+ anchor: E(r.length, n.stackAlign, i ?? a),
8479
8479
  position: t
8480
8480
  };
8481
8481
  }
8482
- function xe(e) {
8483
- return (e ?? "").toLowerCase().split(/\s+/).filter((e) => fe.has(e));
8482
+ function O(e) {
8483
+ return (e ?? "").toLowerCase().split(/\s+/).filter((e) => me.has(e));
8484
8484
  }
8485
- function Se(e, t) {
8486
- let n = [...e.children].filter((e) => !D(e));
8487
- return n.length <= 1 ? n[0] ?? null : C(t.document, "mrow", n);
8485
+ function Ce(e, t) {
8486
+ let n = [...e.children].filter((e) => !T(e));
8487
+ return n.length <= 1 ? n[0] ?? null : x(t.document, "mrow", n);
8488
8488
  }
8489
- function Ce(e, t, n) {
8490
- let r = T(e, "location") ?? "n", i = xe(e.getAttribute("crossout")), a = [...e.children].map((e) => D(e) ? null : e.localName === "mscarry" ? {
8491
- content: Se(e, n),
8492
- location: T(e, "location") ?? r,
8493
- crossout: e.hasAttribute("crossout") ? xe(e.getAttribute("crossout")) : i
8489
+ function we(e, t, n) {
8490
+ let r = C(e, "location") ?? "n", i = O(e.getAttribute("crossout")), a = [...e.children].map((e) => T(e) ? null : e.localName === "mscarry" ? {
8491
+ content: Ce(e, n),
8492
+ location: C(e, "location") ?? r,
8493
+ crossout: e.hasAttribute("crossout") ? O(e.getAttribute("crossout")) : i
8494
8494
  } : {
8495
8495
  content: e,
8496
8496
  location: r,
@@ -8499,60 +8499,60 @@ function Ce(e, t, n) {
8499
8499
  return {
8500
8500
  kind: "carries",
8501
8501
  carries: a,
8502
- anchor: O(a.length, n.stackAlign),
8502
+ anchor: E(a.length, n.stackAlign),
8503
8503
  position: t,
8504
- scale: _e$1.test(o) ? o : "0.6"
8504
+ scale: ye.test(o) ? o : "0.6"
8505
8505
  };
8506
8506
  }
8507
- function we(e) {
8508
- let t = T(e, "mslinethickness") ?? "medium", n = pe[t] ?? (he.test(t) ? t : "0.07em"), r = e.getAttribute("mathcolor")?.trim() ?? "";
8509
- return `${n} solid ${ge.test(r) ? r : "currentColor"}`;
8507
+ function k(e) {
8508
+ let t = C(e, "mslinethickness") ?? "medium", n = he[t] ?? (_e$1.test(t) ? t : "0.07em"), r = e.getAttribute("mathcolor")?.trim() ?? "";
8509
+ return `${n} solid ${ve.test(r) ? r : "currentColor"}`;
8510
8510
  }
8511
8511
  function Te(e, t, n) {
8512
- let r = Math.max(0, E(e, "length"));
8512
+ let r = Math.max(0, w(e, "length"));
8513
8513
  return {
8514
8514
  kind: "line",
8515
8515
  length: r,
8516
- anchor: O(r, n.stackAlign),
8516
+ anchor: E(r, n.stackAlign),
8517
8517
  position: t,
8518
- border: we(e)
8518
+ border: k(e)
8519
8519
  };
8520
8520
  }
8521
8521
  function A(e, t, n, r, i) {
8522
8522
  e.forEach((e, a) => {
8523
- let o = t + a * n + E(e, "position");
8523
+ let o = t + a * n + w(e, "position");
8524
8524
  switch (e.localName) {
8525
8525
  case "msgroup":
8526
- A([...e.children], o, E(e, "shift"), r, i);
8526
+ A([...e.children], o, w(e, "shift"), r, i);
8527
8527
  break;
8528
8528
  case "msline":
8529
8529
  i.push(Te(e, o, r));
8530
8530
  break;
8531
8531
  case "mscarries":
8532
- i.push(Ce(e, o, r));
8532
+ i.push(we(e, o, r));
8533
8533
  break;
8534
8534
  case "msrow":
8535
8535
  case "mrow":
8536
- i.push(k([...e.children], o, r));
8536
+ i.push(D([...e.children], o, r));
8537
8537
  break;
8538
- default: i.push(k([e], o, r));
8538
+ default: i.push(D([e], o, r));
8539
8539
  }
8540
8540
  });
8541
8541
  }
8542
8542
  function j(e) {
8543
8543
  return -e.anchor - e.position;
8544
8544
  }
8545
- function Ee(e) {
8545
+ function M(e) {
8546
8546
  return e.kind === "digits" ? e.cells.length : e.kind === "carries" ? e.carries.length : e.length;
8547
8547
  }
8548
- function De(e) {
8549
- return j(e) + Ee(e) - 1;
8548
+ function N(e) {
8549
+ return j(e) + M(e) - 1;
8550
8550
  }
8551
- function Oe(e, t, n, r) {
8552
- let i = (e) => C(r.document, "mpadded", [t], {
8551
+ function Ee(e, t, n, r) {
8552
+ let i = (e) => x(r.document, "mpadded", [t], {
8553
8553
  width: "0",
8554
8554
  ...e ? { lspace: e } : {}
8555
- }), a = (e, t) => C(r.document, e, t);
8555
+ }), a = (e, t) => x(r.document, e, t);
8556
8556
  switch (n) {
8557
8557
  case "s": return a("munder", [e, i("-0.5width")]);
8558
8558
  case "ne": return a("msup", [e, i()]);
@@ -8574,41 +8574,41 @@ function Oe(e, t, n, r) {
8574
8574
  default: return a("mover", [e, i("-0.5width")]);
8575
8575
  }
8576
8576
  }
8577
- function ke(e, t, n) {
8578
- let r = C(n.document, "menclose", [e], {
8577
+ function De(e, t, n) {
8578
+ let r = x(n.document, "menclose", [e], {
8579
8579
  notation: t.join(" "),
8580
8580
  "data-padding": "0.1em",
8581
8581
  "data-thickness": "0.067em"
8582
8582
  }), i = t.some((e) => e.endsWith("diagonalstrike")) ? .167 : t.includes("horizontalstrike") ? .1 : 0;
8583
- return i ? C(n.document, "mpadded", [r], {
8583
+ return i ? x(n.document, "mpadded", [r], {
8584
8584
  lspace: `-${i}em`,
8585
8585
  width: `-${2 * i}em`
8586
8586
  }) : r;
8587
8587
  }
8588
- function Ae(e, t, n, r, i) {
8589
- let a = e && t.crossout.length ? ke(e, t.crossout, i) : e;
8588
+ function Oe(e, t, n, r, i) {
8589
+ let a = e && t.crossout.length ? De(e, t.crossout, i) : e;
8590
8590
  if (!t.content) return a;
8591
- let o = C(i.document, "mstyle", [t.content], { scriptsizemultiplier: r });
8592
- return Oe(a ?? be(i), o, n, i);
8591
+ let o = x(i.document, "mstyle", [t.content], { scriptsizemultiplier: r });
8592
+ return Ee(a ?? Se(i), o, n, i);
8593
8593
  }
8594
- function je(e, t) {
8594
+ function P(e, t) {
8595
8595
  return e.carries[t - j(e)] ?? null;
8596
8596
  }
8597
- function Me(e, t, n, r) {
8597
+ function ke(e, t, n, r) {
8598
8598
  let i = e.content;
8599
8599
  n.forEach((e, a) => {
8600
- let o = n.length - 1 - a, s = n[o], c = je(s, t), l = n.slice(0, o).some((e) => je(e, t));
8600
+ let o = n.length - 1 - a, s = n[o], c = P(s, t), l = n.slice(0, o).some((e) => P(e, t));
8601
8601
  if (!c && !l) return;
8602
8602
  let u = c ?? {
8603
- content: be(r),
8603
+ content: Se(r),
8604
8604
  location: "n",
8605
8605
  crossout: []
8606
8606
  }, d = a === 0 ? u.location : "n";
8607
- i = Ae(i, u, d, s.scale, r);
8607
+ i = Oe(i, u, d, s.scale, r);
8608
8608
  }), e.content = i;
8609
8609
  }
8610
- function Ne(e, t) {
8611
- let n = e.filter((e) => Ee(e) > 0), r = Math.min(0, ...n.map(j)), i = Math.max(r, ...n.map(De)) - r + 1, a = -r, o = [], s = /* @__PURE__ */ new Map(), c = () => Array.from({ length: i }, () => ({
8610
+ function F(e, t) {
8611
+ let n = e.filter((e) => M(e) > 0), r = Math.min(0, ...n.map(j)), i = Math.max(r, ...n.map(N)) - r + 1, a = -r, o = [], s = /* @__PURE__ */ new Map(), c = () => Array.from({ length: i }, () => ({
8612
8612
  content: null,
8613
8613
  borders: {}
8614
8614
  })), l = (e) => e.length === 0 ? Array.from({ length: i }, (e, t) => t) : Array.from({ length: e.length }, (t, n) => a + j(e) + n), u = [], d = [], f = (e) => {
@@ -8616,7 +8616,7 @@ function Ne(e, t) {
8616
8616
  e.cells.forEach((t, r) => {
8617
8617
  n[a + j(e) + r].content = t;
8618
8618
  }), u.length && n.forEach((e, n) => {
8619
- Me(e, n - a, u, t);
8619
+ ke(e, n - a, u, t);
8620
8620
  });
8621
8621
  for (let e of d) for (let t of l(e)) n[t].borders.top = e.border;
8622
8622
  u = [], d = [], s.set(e, o.length), o.push(n);
@@ -8636,43 +8636,43 @@ function Ne(e, t) {
8636
8636
  origin: a
8637
8637
  };
8638
8638
  }
8639
- function Pe(e, { rows: t }, n) {
8640
- let r = C(n.document, "mtable", t.map((e) => C(n.document, "mtr", e.map((e) => {
8639
+ function Ae(e, { rows: t }, n) {
8640
+ let r = x(n.document, "mtable", t.map((e) => x(n.document, "mtr", e.map((e) => {
8641
8641
  let t = Object.entries(e.borders).map(([e, t]) => `border-${e}:${t}`).join(";");
8642
- return C(n.document, "mtd", [e.content], {
8642
+ return x(n.document, "mtd", [e.content], {
8643
8643
  ...t ? { style: t } : {},
8644
8644
  ...e.align ? { columnalign: e.align } : {}
8645
8645
  });
8646
8646
  }))));
8647
- for (let { name: t, value: n } of [...e.attributes]) ye.has(t) || r.setAttribute(t, n);
8648
- let i = T(e, "charspacing") ?? "medium", a = T(e, "charalign");
8649
- return r.setAttribute("columnspacing", me[i] ?? (he.test(i) ? i : me.medium)), r.setAttribute("columnalign", a === "left" || a === "center" ? a : "right"), r.setAttribute("rowspacing", "0"), r.setAttribute("align", e.getAttribute("align") ?? "baseline"), r;
8647
+ for (let { name: t, value: n } of [...e.attributes]) xe.has(t) || r.setAttribute(t, n);
8648
+ let i = C(e, "charspacing") ?? "medium", a = C(e, "charalign");
8649
+ return r.setAttribute("columnspacing", ge[i] ?? (_e$1.test(i) ? i : ge.medium)), r.setAttribute("columnalign", a === "left" || a === "center" ? a : "right"), r.setAttribute("rowspacing", "0"), r.setAttribute("align", e.getAttribute("align") ?? "baseline"), r;
8650
8650
  }
8651
- function Fe(e) {
8651
+ function je(e) {
8652
8652
  return {
8653
8653
  document: e.ownerDocument,
8654
- stackAlign: T(e, "stackalign") ?? "decimalpoint",
8654
+ stackAlign: C(e, "stackalign") ?? "decimalpoint",
8655
8655
  decimalPoint: e.closest("[decimalpoint]")?.getAttribute("decimalpoint")?.trim().charAt(0) || "."
8656
8656
  };
8657
8657
  }
8658
- function Ie(e) {
8659
- let t = Fe(e), n = [];
8660
- return A([...e.children], 0, 0, t, n), Pe(e, Ne(n, t), t);
8658
+ function Me(e) {
8659
+ let t = je(e), n = [];
8660
+ return A([...e.children], 0, 0, t, n), Ae(e, F(n, t), t);
8661
8661
  }
8662
- function M(e, t, n, r, i, a) {
8662
+ function I(e, t, n, r, i, a) {
8663
8663
  for (let o = n; o <= r; o++) e[t][o].borders[i] = a;
8664
8664
  }
8665
- function Le(e, t) {
8666
- let n = w(t, ")");
8667
- return n.setAttribute("minsize", "1.2em"), [C(t.document, "mrow", [e, C(t.document, "mspace", [], { width: "0.2em" })]), C(t.document, "mpadded", [n], {
8665
+ function Ne(e, t) {
8666
+ let n = S(t, ")");
8667
+ return n.setAttribute("minsize", "1.2em"), [x(t.document, "mrow", [e, x(t.document, "mspace", [], { width: "0.2em" })]), x(t.document, "mpadded", [n], {
8668
8668
  voffset: "0.1em",
8669
8669
  lspace: "-0.15em",
8670
8670
  depth: "-0.2em",
8671
8671
  height: "-0.2em"
8672
8672
  })];
8673
8673
  }
8674
- function Re(e) {
8675
- let t = Fe(e), [n, r, ...i] = [...e.children], a = n && !D(n) ? n : null, o = r && !D(r) ? r : null, s = T(e, "longdivstyle") ?? "lefttop", c = we(e), l = [];
8674
+ function Pe(e) {
8675
+ let t = je(e), [n, r, ...i] = [...e.children], a = n && !T(n) ? n : null, o = r && !T(r) ? r : null, s = C(e, "longdivstyle") ?? "lefttop", c = k(e), l = [];
8676
8676
  A(i, 0, 0, t, l);
8677
8677
  let u = l.find((e) => e.kind === "digits");
8678
8678
  u || (u = {
@@ -8685,51 +8685,51 @@ function Re(e) {
8685
8685
  u.cells.unshift(...e), u.anchor += e.length;
8686
8686
  }, p = (...e) => {
8687
8687
  let n = e.flatMap((e) => e ? e.localName === "mrow" ? [...e.children] : [e] : []);
8688
- u.cells.push(...k(n, 0, t).cells);
8688
+ u.cells.push(...D(n, 0, t).cells);
8689
8689
  };
8690
8690
  switch (s) {
8691
8691
  case "left/\\right":
8692
- f(a, w(t, "/")), p(w(t, "\\"), o);
8692
+ f(a, S(t, "/")), p(S(t, "\\"), o);
8693
8693
  break;
8694
8694
  case "left)(right":
8695
- f(a, w(t, ")")), p(w(t, "("), o);
8695
+ f(a, S(t, ")")), p(S(t, "("), o);
8696
8696
  break;
8697
8697
  case ":right=right":
8698
- p(w(t, ":"), a, w(t, "="), o);
8698
+ p(S(t, ":"), a, S(t, "="), o);
8699
8699
  break;
8700
8700
  case "righttop":
8701
8701
  case "stackedleftlinetop":
8702
8702
  case "lefttop":
8703
- o && A([o], 0, 0, t, d), l.splice(l.indexOf(u), 0, ...d), s === "righttop" ? p(a) : s === "stackedleftlinetop" ? f(a) : f(...Le(a, t));
8703
+ o && A([o], 0, 0, t, d), l.splice(l.indexOf(u), 0, ...d), s === "righttop" ? p(a) : s === "stackedleftlinetop" ? f(a) : f(...Ne(a, t));
8704
8704
  break;
8705
8705
  }
8706
- let m = Ne(l, t), h = m.rows, g = m.rowOf.get(u) ?? 0, _ = (e) => m.origin + j(u) + e, v = Math.max(_(u.cells.length - 1), ...d.map((e) => m.origin + De(e)));
8706
+ let m = F(l, t), h = m.rows, g = m.rowOf.get(u) ?? 0, _ = (e) => m.origin + j(u) + e, v = Math.max(_(u.cells.length - 1), ...d.map((e) => m.origin + N(e)));
8707
8707
  switch (s) {
8708
8708
  case "left/\\right":
8709
8709
  case "left)(right":
8710
8710
  case ":right=right": break;
8711
8711
  case "righttop": {
8712
8712
  let e = h[g][_(u.cells.length - 1)];
8713
- e.borders.left = c, e.borders.bottom = c, M(h, g, _(0), _(u.cells.length - 1), "top", c);
8713
+ e.borders.left = c, e.borders.bottom = c, I(h, g, _(0), _(u.cells.length - 1), "top", c);
8714
8714
  break;
8715
8715
  }
8716
8716
  case "stackedleftlinetop": {
8717
8717
  let e = h[g][_(0)];
8718
- e.borders.right = c, e.borders.bottom = c, M(h, g, _(1), v, "top", c);
8718
+ e.borders.right = c, e.borders.bottom = c, I(h, g, _(1), v, "top", c);
8719
8719
  break;
8720
8720
  }
8721
8721
  case "stackedrightright":
8722
8722
  case "mediumstackedrightright":
8723
8723
  case "shortstackedrightright":
8724
8724
  case "stackedleftleft":
8725
- ze(h, g, s, a, o, c, t);
8725
+ Fe(h, g, s, a, o, c, t);
8726
8726
  break;
8727
- default: M(h, g, _(1), v, "top", c);
8727
+ default: I(h, g, _(1), v, "top", c);
8728
8728
  }
8729
- return Pe(e, m, t);
8729
+ return Ae(e, m, t);
8730
8730
  }
8731
- function ze(e, t, n, r, i, a, o) {
8732
- let s = n === "stackedleftleft", c = s ? "right" : "left", l = (e) => e && C(o.document, "mpadded", [e], {
8731
+ function Fe(e, t, n, r, i, a, o) {
8732
+ let s = n === "stackedleftleft", c = s ? "right" : "left", l = (e) => e && x(o.document, "mpadded", [e], {
8733
8733
  lspace: "0.2em",
8734
8734
  width: "+0.4em"
8735
8735
  });
@@ -8748,135 +8748,423 @@ function ze(e, t, n, r, i, a, o) {
8748
8748
  }) : o === t + 1 ? (u.content = l(i), n !== "shortstackedrightright" && (u.borders[c] = a)) : o > t + 1 && (n === "stackedrightright" || s) && (u.borders[c] = a), s ? e.unshift(u) : e.push(u);
8749
8749
  });
8750
8750
  }
8751
- function Be(e) {
8752
- for (let t of [...e.querySelectorAll("mstack, mlongdiv")]) !t.closest("math") || t.closest("mjx-container") || t.replaceWith(t.localName === "mstack" ? Ie(t) : Re(t));
8753
- }
8754
- var Ve = "PIE-MJX-explorer-styles";
8755
- var N = "var(--pie-text, black)";
8756
- var He = "var(--pie-background, #ffffff)";
8757
- var Ue = "var(--pie-border-dark, #66686A)";
8758
- var P = "var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565C0)))";
8759
- var F = `color-mix(in srgb, ${P} 15%, transparent)`;
8760
- var We = `
8751
+ function Ie(e) {
8752
+ for (let t of [...e.querySelectorAll("mstack, mlongdiv")]) !t.closest("math") || t.closest("mjx-container") || t.replaceWith(t.localName === "mstack" ? Me(t) : Pe(t));
8753
+ }
8754
+ var Le = "PIE-MJX-explorer-styles";
8755
+ var L = "var(--pie-text, black)";
8756
+ var Re = "var(--pie-background, #ffffff)";
8757
+ var ze = "var(--pie-border-dark, #66686A)";
8758
+ var R = "var(--pie-focus-outline, var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565C0)))";
8759
+ var z = `color-mix(in srgb, ${R} 15%, transparent)`;
8760
+ var Be = `
8761
8761
  :root mjx-container [data-sre-highlight-1]:not([data-mjx-collapsed], rect) {
8762
- color: ${N} !important;
8763
- fill: ${N} !important;
8762
+ color: ${L} !important;
8763
+ fill: ${L} !important;
8764
8764
  }
8765
8765
  :root mjx-container:not([data-mjx-clone-container]) [data-sre-highlight-1]:not([data-sre-enclosed], rect) {
8766
- background-color: ${F} !important;
8766
+ background-color: ${z} !important;
8767
8767
  }
8768
8768
  :root mjx-container rect[data-sre-highlight-1]:not([data-sre-enclosed]) {
8769
- fill: ${F} !important;
8769
+ fill: ${z} !important;
8770
8770
  }
8771
8771
  :root mjx-container .mjx-selected {
8772
- outline: 2px solid ${P} !important;
8772
+ outline: 2px solid ${R} !important;
8773
8773
  }
8774
8774
  :root mjx-container [data-sre-highlight-2] {
8775
- color: ${N} !important;
8775
+ color: ${L} !important;
8776
8776
  background-color: transparent !important;
8777
- fill: ${N} !important;
8778
- outline: 2px dashed ${P} !important;
8777
+ fill: ${L} !important;
8778
+ outline: 2px dashed ${R} !important;
8779
8779
  }
8780
8780
  :root mjx-container rect[data-sre-highlight-2] {
8781
8781
  fill: transparent !important;
8782
- stroke: ${P} !important;
8782
+ stroke: ${R} !important;
8783
8783
  stroke-width: 2px !important;
8784
8784
  vector-effect: non-scaling-stroke;
8785
8785
  }
8786
8786
  :root .MJX_LiveRegion, :root .MJX_HoverRegion, :root .MJX_ToolTip {
8787
- color: ${N} !important;
8788
- background-color: ${He} !important;
8789
- border-color: ${Ue} !important;
8787
+ color: ${L} !important;
8788
+ background-color: ${Re} !important;
8789
+ border-color: ${ze} !important;
8790
8790
  }
8791
8791
  :root .MJX_LiveRegion > div, :root .MJX_HoverRegion > div {
8792
- color: ${N} !important;
8793
- background-color: ${F} !important;
8792
+ color: ${L} !important;
8793
+ background-color: ${z} !important;
8794
8794
  }
8795
8795
  `;
8796
- function Ge(e = document) {
8796
+ function Ve(e = document) {
8797
8797
  if (e.getElementById("PIE-MJX-explorer-styles")) return;
8798
8798
  let t = e.createElement("style");
8799
- t.id = Ve, t.textContent = We, e.head.appendChild(t);
8799
+ t.id = Le, t.textContent = Be, e.head.appendChild(t);
8800
+ }
8801
+ var He = /[⁡-⁤]/g;
8802
+ var Ue = {
8803
+ "+": "positive",
8804
+ "-": "negative",
8805
+ "−": "negative",
8806
+ "±": "plus or minus",
8807
+ "∓": "minus or plus"
8808
+ };
8809
+ var We = {
8810
+ "(": "open parenthesis",
8811
+ "[": "open bracket",
8812
+ "{": "open brace",
8813
+ "⟨": "open angle bracket",
8814
+ "⌊": "open floor",
8815
+ "⌈": "open ceiling"
8816
+ };
8817
+ var Ge = {
8818
+ ")": "close parenthesis",
8819
+ "]": "close bracket",
8820
+ "}": "close brace",
8821
+ "⟩": "close angle bracket",
8822
+ "⌋": "close floor",
8823
+ "⌉": "close ceiling"
8824
+ };
8825
+ var B = {
8826
+ "!": "factorial",
8827
+ "%": "percent",
8828
+ "°": "degrees",
8829
+ "′": "prime",
8830
+ "″": "double prime"
8831
+ };
8832
+ var Ke = {
8833
+ "+": "plus",
8834
+ "-": "minus",
8835
+ "−": "minus",
8836
+ "±": "plus or minus",
8837
+ "∓": "minus or plus",
8838
+ "×": "times",
8839
+ "⋅": "times",
8840
+ "·": "times",
8841
+ "*": "times",
8842
+ "÷": "divided by",
8843
+ "/": "divided by",
8844
+ "=": "equals",
8845
+ "≠": "does not equal",
8846
+ "<": "is less than",
8847
+ ">": "is greater than",
8848
+ "≤": "is less than or equal to",
8849
+ "≥": "is greater than or equal to",
8850
+ "≈": "is approximately equal to",
8851
+ "≡": "is equivalent to",
8852
+ "∝": "is proportional to",
8853
+ "∈": "is an element of",
8854
+ "∉": "is not an element of",
8855
+ "⊂": "is a subset of",
8856
+ "⊆": "is a subset of or equal to",
8857
+ "∪": "union",
8858
+ "∩": "intersection",
8859
+ "→": "right arrow",
8860
+ "←": "left arrow",
8861
+ "⇒": "implies",
8862
+ "⇔": "if and only if",
8863
+ "∑": "sum",
8864
+ "∏": "product",
8865
+ "∫": "integral",
8866
+ "∞": "infinity",
8867
+ "∠": "angle",
8868
+ "⊥": "is perpendicular to",
8869
+ "∥": "is parallel to",
8870
+ "∴": "therefore",
8871
+ ",": "comma",
8872
+ ";": "semicolon",
8873
+ ":": "colon",
8874
+ "|": "vertical bar",
8875
+ "‖": "double vertical bar",
8876
+ ...We,
8877
+ ...Ge,
8878
+ ...B
8879
+ };
8880
+ var qe = /* @__PURE__ */ new Set(["|", "‖"]);
8881
+ var Je = /* @__PURE__ */ new Set([
8882
+ "∑",
8883
+ "∏",
8884
+ "∫",
8885
+ "∪",
8886
+ "∩"
8887
+ ]);
8888
+ var Ye = {
8889
+ α: "alpha",
8890
+ β: "beta",
8891
+ γ: "gamma",
8892
+ δ: "delta",
8893
+ ε: "epsilon",
8894
+ θ: "theta",
8895
+ λ: "lambda",
8896
+ μ: "mu",
8897
+ π: "pi",
8898
+ ρ: "rho",
8899
+ σ: "sigma",
8900
+ τ: "tau",
8901
+ φ: "phi",
8902
+ ω: "omega",
8903
+ Δ: "capital delta",
8904
+ Σ: "capital sigma",
8905
+ Ω: "capital omega",
8906
+ "∞": "infinity",
8907
+ sin: "sine",
8908
+ cos: "cosine",
8909
+ tan: "tangent",
8910
+ sec: "secant",
8911
+ csc: "cosecant",
8912
+ cot: "cotangent",
8913
+ ln: "natural log",
8914
+ lim: "limit"
8915
+ };
8916
+ var Xe = {
8917
+ "¯": "bar",
8918
+ "‾": "bar",
8919
+ "―": "bar",
8920
+ "^": "hat",
8921
+ ˆ: "hat",
8922
+ "~": "tilde",
8923
+ "˜": "tilde",
8924
+ "→": "vector",
8925
+ "⃗": "vector",
8926
+ "˙": "dot"
8927
+ };
8928
+ var V = (e) => (e.textContent ?? "").replace(He, "").replace(/\s+/g, " ").trim();
8929
+ var H = (e) => e.replace(/\s+/g, " ").trim();
8930
+ var U = (e) => [...e.children];
8931
+ function W(e) {
8932
+ return !e || [
8933
+ "mn",
8934
+ "mi",
8935
+ "mtext",
8936
+ "mo"
8937
+ ].includes(e.localName) ? !0 : ["mrow", "mstyle"].includes(e.localName) && e.children.length === 1 ? W(e.children[0]) : !1;
8938
+ }
8939
+ function Ze(e) {
8940
+ let t = e ? V(e) : "";
8941
+ return /^\d{1,3}$/.test(t) ? Number(t) : void 0;
8942
+ }
8943
+ function Qe(e) {
8944
+ return `${e}${e % 100 >= 11 && e % 100 <= 13 ? "th" : {
8945
+ 1: "st",
8946
+ 2: "nd",
8947
+ 3: "rd"
8948
+ }[e % 10] ?? "th"}`;
8949
+ }
8950
+ function $e(e) {
8951
+ return Ye[e] ?? e;
8952
+ }
8953
+ function G(e) {
8954
+ return Ke[e] ?? e;
8955
+ }
8956
+ function K(e) {
8957
+ let t = [], n = !1;
8958
+ for (let r of e) {
8959
+ if (r.localName !== "mo") {
8960
+ t.push(q(r)), n = !0;
8961
+ continue;
8962
+ }
8963
+ let e = V(r);
8964
+ e && (!n && Ue[e] ? t.push(Ue[e]) : e in B ? t.push(B[e]) : (t.push(G(e)), n = e in Ge || qe.has(e) && n));
8965
+ }
8966
+ return t.filter(Boolean).join(" ");
8967
+ }
8968
+ function et(e) {
8969
+ let [t, ...n] = e, r = n[n.length - 1], i = (e) => e?.localName === "mo" && ["|", "‖"].includes(V(e)), a = n.slice(0, -1);
8970
+ if (a.length && i(t) && i(r) && V(t) === V(r) && !a.some(i)) {
8971
+ let e = H(K(a));
8972
+ return V(t) === "|" ? `absolute value of ${e} end absolute value` : `norm of ${e} end norm`;
8973
+ }
8974
+ return K(e);
8975
+ }
8976
+ function tt(e, t) {
8977
+ let n = e ? q(e) : "", r = t ? q(t) : "";
8978
+ return W(e) && W(t) ? `${n} over ${r}` : `the fraction with numerator ${n} and denominator ${r}`;
8979
+ }
8980
+ function nt(e, t, n) {
8981
+ return n ? `${t} of ${e}` : `${t} of ${e} end root`;
8982
+ }
8983
+ function rt(e, t) {
8984
+ let n = t ? V(t) : "";
8985
+ if (t && W(t)) {
8986
+ if (n === "2") return `${e} squared`;
8987
+ if (n === "3") return `${e} cubed`;
8988
+ if (n in B) return `${e} ${B[n]}`;
8989
+ }
8990
+ let r = t ? q(t) : "";
8991
+ return W(t) ? `${e} to the power of ${r}` : `${e} to the power of ${r} end power`;
8992
+ }
8993
+ function it(e, t) {
8994
+ let n = t ? q(t) : "";
8995
+ return W(t) ? `${e} sub ${n}` : `${e} sub ${n} end sub`;
8996
+ }
8997
+ function at(e, t, n) {
8998
+ let r = V(e);
8999
+ if (r === "lim") return `limit as ${t ? q(t) : ""} of`;
9000
+ if (!Je.has(r)) return;
9001
+ let i = t ? `from ${q(t)}` : "", a = n ? `to ${q(n)}` : "";
9002
+ return `${G(r)} ${i} ${a} of`;
9003
+ }
9004
+ function ot(e) {
9005
+ let t = U(e).filter((e) => ["mtr", "mlabeledtr"].includes(e.localName)), n = t.map((e) => U(e).filter((e) => e.localName === "mtd")), r = Math.max(0, ...n.map((e) => e.length)), i = n.map((e, t) => `row ${t + 1}: ${e.map((e) => H(K(U(e)))).join(", ")}`);
9006
+ return `table with ${t.length} ${t.length === 1 ? "row" : "rows"} and ${r} ${r === 1 ? "column" : "columns"}. ${i.join(". ")}`;
8800
9007
  }
8801
- var I = Symbol.for("@pie-element/shared-math-rendering-mathjax/speech-worker-failed");
8802
- function Ke() {
9008
+ function st(e) {
9009
+ let t = e.getAttribute("open") ?? "(", n = e.getAttribute("close") ?? ")", r = (e.getAttribute("separators") ?? ",").replace(/\s+/g, "").split(""), i = U(e).map((e, t, n) => t < n.length - 1 ? `${q(e)} ${G(r[Math.min(t, r.length - 1)] ?? ",")}` : q(e));
9010
+ return [
9011
+ G(t),
9012
+ ...i,
9013
+ G(n)
9014
+ ].filter(Boolean).join(" ");
9015
+ }
9016
+ function q(e) {
9017
+ let t = U(e);
9018
+ switch (e.localName) {
9019
+ case "mi": return $e(V(e));
9020
+ case "mn":
9021
+ case "mtext":
9022
+ case "ms": return V(e);
9023
+ case "mo": return G(V(e));
9024
+ case "mspace":
9025
+ case "mphantom":
9026
+ case "annotation":
9027
+ case "annotation-xml": return "";
9028
+ case "semantics": return t[0] ? q(t[0]) : "";
9029
+ case "mfrac": return tt(t[0], t[1]);
9030
+ case "msqrt": return nt(H(K(t)), "square root", t.length === 1 && W(t[0]));
9031
+ case "mroot": {
9032
+ let e = Ze(t[1]), n = e === 2 ? "square root" : e === 3 ? "cube root" : e ? `${Qe(e)} root` : `root with index ${t[1] ? q(t[1]) : ""}`;
9033
+ return nt(t[0] ? q(t[0]) : "", n, W(t[0]));
9034
+ }
9035
+ case "msup": return rt(t[0] ? q(t[0]) : "", t[1]);
9036
+ case "msub": return it(t[0] ? q(t[0]) : "", t[1]);
9037
+ case "msubsup": return (t[0] ? at(t[0], t[1], t[2]) : void 0) || rt(it(t[0] ? q(t[0]) : "", t[1]), t[2]);
9038
+ case "munder":
9039
+ case "mover":
9040
+ case "munderover": {
9041
+ let [n, r, i] = t, a = e.localName === "mover" ? void 0 : r, o = e.localName === "munder" ? void 0 : e.localName === "mover" ? r : i, s = n ? at(n, a, o) : void 0;
9042
+ if (s) return s;
9043
+ let c = n ? q(n) : "", l = e.localName === "mover" && r ? Xe[V(r)] : void 0;
9044
+ return l ? l === "vector" ? `vector ${c}` : `${c} ${l}` : [
9045
+ c,
9046
+ a ? `with ${q(a)} below` : "",
9047
+ o ? `with ${q(o)} above` : ""
9048
+ ].filter(Boolean).join(" ");
9049
+ }
9050
+ case "mfenced": return st(e);
9051
+ case "mtable": return ot(e);
9052
+ case "mrow":
9053
+ case "math": return et(t);
9054
+ default: return t.length ? K(t) : V(e);
9055
+ }
9056
+ }
9057
+ function ct(e) {
9058
+ return H(q(e));
9059
+ }
9060
+ var lt = [
9061
+ "a[href]",
9062
+ "button",
9063
+ "label",
9064
+ "summary",
9065
+ ...[
9066
+ "button",
9067
+ "checkbox",
9068
+ "combobox",
9069
+ "link",
9070
+ "menuitem",
9071
+ "menuitemcheckbox",
9072
+ "menuitemradio",
9073
+ "option",
9074
+ "radio",
9075
+ "switch",
9076
+ "tab",
9077
+ "treeitem"
9078
+ ].map((e) => `[role="${e}"]`)
9079
+ ].join(", ");
9080
+ function ut(e) {
9081
+ if (e.hasAttribute("aria-label") || !e.closest(lt)) return;
9082
+ let t = e.querySelector("math"), n = t ? ct(t) : "";
9083
+ n && e.setAttribute("aria-label", n);
9084
+ }
9085
+ function J(e) {
9086
+ for (let t of e.querySelectorAll("mjx-container")) ut(t);
9087
+ }
9088
+ var dt = Symbol.for("@pie-element/shared-math-rendering-mathjax/speech-worker-failed");
9089
+ function ft() {
8803
9090
  let e = globalThis;
8804
- e[I] || (e[I] = !0, console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${t$3}`));
9091
+ e[dt] || (e[dt] = !0, console.warn(`[math-rendering] MathJax's speech worker did not start, so speech, braille and the explorer are off. A content security policy must allow blob: workers, and scripts and fetches from the asset root. See ${t$3}`));
8805
9092
  }
8806
- function qe(e) {
9093
+ function pt(e) {
8807
9094
  let t = e.webworker;
8808
9095
  if (!t || t.ready) return;
8809
9096
  e.options ?? (e.options = {});
8810
9097
  let n = e.options;
8811
- n.enableSpeech = !1, n.enableBraille = !1, n.speechError = () => {}, t.Post = () => Promise.reject(/* @__PURE__ */ Error("The speech worker did not start")), t.Terminate(), Ke();
9098
+ n.enableSpeech = !1, n.enableBraille = !1, n.speechError = () => {}, t.Post = () => Promise.reject(/* @__PURE__ */ Error("The speech worker did not start")), t.Terminate(), ft();
8812
9099
  }
8813
- function Je(e) {
9100
+ function mt(e) {
8814
9101
  let t = e?.adaptor, n = t?.createWorker;
8815
9102
  !e || !t || !n || (t.createWorker = async (r, i) => {
8816
9103
  let a = await n.call(t, r, i);
8817
- return a.addEventListener("error", () => qe(e), { once: !0 }), a;
9104
+ return a.addEventListener("error", () => pt(e), { once: !0 }), a;
8818
9105
  });
8819
9106
  }
8820
9107
  `${i}`;
8821
- var Ye = {
9108
+ var ht = {
8822
9109
  parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
8823
9110
  overarc: "\\overparen",
8824
9111
  napprox: "\\not\\approx",
8825
9112
  longdiv: "\\enclose{longdiv}",
8826
9113
  abs: ["\\left|#1\\right|", 1]
8827
9114
  };
8828
- var Xe = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)";
8829
- var Ze = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/;
8830
- var Qe = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/;
8831
- var $e = /\\embed\{newLine\}\[\]/g;
8832
- var et = [
9115
+ var gt = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)";
9116
+ var _t = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/;
9117
+ var vt = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/;
9118
+ var yt = /\\embed\{newLine\}\[\]/g;
9119
+ var bt = [
8833
9120
  ["$$", "$$"],
8834
9121
  ["$", "$"],
8835
9122
  ["\\[", "\\]"],
8836
9123
  ["\\(", "\\)"]
8837
9124
  ];
8838
- var L = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading");
8839
- var tt = "MJX-CHTML-styles";
8840
- var nt = "PIE-MJX-SVG-styles";
8841
- var R = "PIE-MathJax-Menu-Settings";
8842
- var rt = { "mjx-container[overflow=\"linebreak\"][display]": {
9125
+ var xt = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading");
9126
+ var St = "MJX-CHTML-styles";
9127
+ var Ct = "PIE-MJX-SVG-styles";
9128
+ var Y = "PIE-MathJax-Menu-Settings";
9129
+ var wt = { "mjx-container[overflow=\"linebreak\"][display]": {
8843
9130
  overflow: "auto clip",
8844
9131
  "min-width": "initial !important"
8845
9132
  } };
8846
- var it = 200;
8847
- var at = 201;
8848
- function z(e) {
9133
+ var Tt = 200;
9134
+ var Et = 201;
9135
+ var Dt = 202;
9136
+ function X(e) {
8849
9137
  let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
8850
9138
  for (let e of t) for (let t of [e, ...e.querySelectorAll("[data-latex],[data-latex-item]")]) t.removeAttribute("data-latex"), t.removeAttribute("data-latex-item");
8851
9139
  }
8852
- function B(e) {
8853
- for (let [t, n] of et) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
9140
+ function Ot(e) {
9141
+ for (let [t, n] of bt) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
8854
9142
  return e;
8855
9143
  }
8856
- function ot(e) {
8857
- return B(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
9144
+ function kt(e) {
9145
+ return Ot(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
8858
9146
  }
8859
- var st = "mathjax_ignore";
8860
- var V = "mathjax_process";
8861
- function ct(e, t) {
8862
- let n = e.closest(`.${st}, .${V}`);
8863
- return n !== null && t.contains(n) && !n.classList.contains(V);
9147
+ var At = "mathjax_ignore";
9148
+ var jt = "mathjax_process";
9149
+ function Mt(e, t) {
9150
+ let n = e.closest(`.${At}, .${jt}`);
9151
+ return n !== null && t.contains(n) && !n.classList.contains(jt);
8864
9152
  }
8865
- function lt(e) {
9153
+ function Nt(e) {
8866
9154
  for (let t of e.querySelectorAll("[data-latex]")) {
8867
- if (t.dataset.mathHandled || t.closest("mjx-container") || ct(t, e)) continue;
9155
+ if (t.dataset.mathHandled || t.closest("mjx-container") || Mt(t, e)) continue;
8868
9156
  let n = t.textContent;
8869
- n && (t.textContent = `\\(${ot(n)}\\)`.replace($e, "\\newline "), t.dataset.mathHandled = "true");
9157
+ n && (t.textContent = `\\(${kt(n)}\\)`.replace(yt, "\\newline "), t.dataset.mathHandled = "true");
8870
9158
  }
8871
9159
  }
8872
- function ut(e) {
9160
+ function Pt(e) {
8873
9161
  for (let t of e.querySelectorAll("math")) t.closest("mjx-container") || t.setAttribute("displaystyle", "true");
8874
9162
  }
8875
- function dt(e, t) {
9163
+ function Ft(e, t) {
8876
9164
  for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
8877
- return (t ? Qe : Ze).test(e.textContent ?? "");
9165
+ return (t ? vt : _t).test(e.textContent ?? "");
8878
9166
  }
8879
- function ft(e) {
9167
+ function It(e) {
8880
9168
  return new Promise((t, n) => {
8881
9169
  let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: a = !0, srcUrl: o } = e, s = d(e, import.meta.url), c = {
8882
9170
  loader: {
@@ -8884,17 +9172,17 @@ function ft(e) {
8884
9172
  failed: (e) => n(e),
8885
9173
  "output/svg": { ready: (e) => {
8886
9174
  let t = y();
8887
- return pt(t) && mt(t), e;
9175
+ return Lt(t) && Rt(t), e;
8888
9176
  } }
8889
9177
  },
8890
9178
  startup: {
8891
9179
  typeset: !1,
8892
9180
  ready: () => {
8893
- let e = y(), r = e?.startup, i = pt(e);
8894
- i && (mt(e), ht(e, s.speechLocales), f(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (gt(r?.document), r?.document?.addStyles?.(rt), Je(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
9181
+ let e = y(), r = e?.startup, i = Lt(e);
9182
+ i && (Rt(e), zt(e, s.speechLocales), f(e?._?.a11y?.sre_ts?.locales, s.speechLocales)), r?.defaultReady?.(), i && (Bt(r?.document), Vt(r?.document), r?.document?.addStyles?.(wt), mt(r?.document)), Promise.resolve(r?.promise).then(() => t(), n);
8895
9183
  }
8896
9184
  },
8897
- tex: { macros: { ...Ye } },
9185
+ tex: { macros: { ...ht } },
8898
9186
  output: { displayOverflow: "linebreak" },
8899
9187
  options: {
8900
9188
  enableMenu: i,
@@ -8906,7 +9194,7 @@ function ft(e) {
8906
9194
  a11y: { inTabOrder: !1 }
8907
9195
  }
8908
9196
  };
8909
- r && c.tex && (console.warn(Xe), c.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], c.tex.processEscapes = !0), a || (c.chtml = { fontURL: "" });
9197
+ r && c.tex && (console.warn(gt), c.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], c.tex.processEscapes = !0), a || (c.chtml = { fontURL: "" });
8910
9198
  let l = p(s.speechLocales);
8911
9199
  l && c.options && (c.options.sre = { locale: l }), ae(c, {
8912
9200
  ...s,
@@ -8916,77 +9204,86 @@ function ft(e) {
8916
9204
  }, n);
8917
9205
  });
8918
9206
  }
8919
- function pt(e) {
9207
+ function Lt(e) {
8920
9208
  return !!e?.version?.startsWith("4.");
8921
9209
  }
8922
- function mt(e) {
9210
+ function Rt(e) {
8923
9211
  let t = e?._?.output, n = t?.chtml_ts?.CHTML;
8924
9212
  n && (n.STYLESHEETID = b);
8925
9213
  let r = t?.svg_ts?.SVG;
8926
- r && (r.STYLESHEETID = nt);
9214
+ r && (r.STYLESHEETID = Ct);
8927
9215
  }
8928
- function ht(e, t) {
9216
+ function zt(e, t) {
8929
9217
  let n = e?._?.ui?.menu?.Menu?.Menu;
8930
9218
  if (n) {
8931
- n.MENU_STORAGE = R;
9219
+ n.MENU_STORAGE = Y;
8932
9220
  try {
8933
- let e = localStorage.getItem(R);
9221
+ let e = localStorage.getItem(Y);
8934
9222
  if (!e) return;
8935
9223
  let { assistiveMml: n, locale: r, ...i } = JSON.parse(e), a = r === void 0 || !t || t.has(r);
8936
9224
  if (n === void 0 && a) return;
8937
- a && r !== void 0 && (i.locale = r), Object.keys(i).length ? localStorage.setItem(R, JSON.stringify(i)) : localStorage.removeItem(R);
9225
+ a && r !== void 0 && (i.locale = r), Object.keys(i).length ? localStorage.setItem(Y, JSON.stringify(i)) : localStorage.removeItem(Y);
8938
9226
  } catch {}
8939
9227
  }
8940
9228
  }
8941
- function gt(e) {
9229
+ function Bt(e) {
8942
9230
  if (!e) return;
8943
9231
  let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
8944
9232
  let n = e.typesetRoot;
8945
- !n || t.has(n) || (z(n), t.add(n));
9233
+ !n || t.has(n) || (X(n), t.add(n));
8946
9234
  };
8947
- e.addRenderAction?.("pie-strip-latex", at, (e) => {
9235
+ e.addRenderAction?.("pie-strip-latex", Et, (e) => {
8948
9236
  for (let t of e.math ?? []) n(t);
8949
9237
  return !1;
8950
9238
  }, (e) => {
8951
9239
  let t = e.typesetRoot;
8952
- return t && z(t), !1;
9240
+ return t && X(t), !1;
8953
9241
  });
8954
9242
  let r = e.outputJax?.chtmlStyles;
8955
- r?.id === tt && (r.id = b), yt();
9243
+ r?.id === St && (r.id = b), Ut();
9244
+ }
9245
+ function Vt(e) {
9246
+ let t = (e) => {
9247
+ e.typesetRoot && ut(e.typesetRoot);
9248
+ };
9249
+ e?.addRenderAction?.("pie-name-math", Dt, (e) => {
9250
+ for (let n of e.math ?? []) t(n);
9251
+ return !1;
9252
+ }, (e) => (t(e), !1));
8956
9253
  }
8957
- function _t(e) {
9254
+ function Z(e) {
8958
9255
  return e instanceof HTMLStyleElement && se.includes(e.id);
8959
9256
  }
8960
- function vt(e) {
9257
+ function Ht(e) {
8961
9258
  ne("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
8962
9259
  }
8963
- function yt() {
8964
- let e = document.head, t = [...e.children].find(_t);
9260
+ function Ut() {
9261
+ let e = document.head, t = [...e.children].find(Z);
8965
9262
  if (t) {
8966
- vt(t);
9263
+ Ht(t);
8967
9264
  return;
8968
9265
  }
8969
9266
  let n = new MutationObserver((e) => {
8970
9267
  for (let t of e) {
8971
- let e = [...t.addedNodes].find(_t);
9268
+ let e = [...t.addedNodes].find(Z);
8972
9269
  if (e) {
8973
- vt(e), n.disconnect();
9270
+ Ht(e), n.disconnect();
8974
9271
  return;
8975
9272
  }
8976
9273
  }
8977
9274
  });
8978
9275
  n.observe(e, { childList: !0 });
8979
9276
  }
8980
- function bt(e) {
9277
+ function Wt(e) {
8981
9278
  let t = e?.math;
8982
9279
  if (!t?.remove) return;
8983
- let n = [...t].filter((e) => (e.state?.() ?? 0) >= it && e.typesetRoot?.isConnected === !1);
9280
+ let n = [...t].filter((e) => (e.state?.() ?? 0) >= Tt && e.typesetRoot?.isConnected === !1);
8984
9281
  if (n.length !== 0) {
8985
9282
  for (let e of [...n].reverse()) e.clear?.();
8986
9283
  t.remove(...n);
8987
9284
  }
8988
9285
  }
8989
- function xt(e) {
9286
+ function Gt(e) {
8990
9287
  return new Promise((t, n) => {
8991
9288
  let r = e.startup ?? {};
8992
9289
  e.startup = r;
@@ -8997,110 +9294,82 @@ function xt(e) {
8997
9294
  };
8998
9295
  });
8999
9296
  }
9000
- function St(e) {
9297
+ function Kt(e) {
9001
9298
  let t = y();
9002
- return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : xt(t) : ft(e);
9299
+ return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : Gt(t) : It(e);
9003
9300
  }
9004
- function Ct(e) {
9005
- return St(e).then(() => {
9301
+ function qt(e) {
9302
+ return Kt(e).then(() => {
9006
9303
  let e = y();
9007
9304
  e && typeof e.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
9008
9305
  });
9009
9306
  }
9010
- function wt(e) {
9011
- let t = oe, n = t[L];
9012
- return n || (n = Ct(e), t[L] = n), n;
9307
+ function Jt(e) {
9308
+ let t = oe, n = t[xt];
9309
+ return n || (n = qt(e), t[xt] = n), n;
9013
9310
  }
9014
- function Tt(e = {}) {
9311
+ function Yt(e = {}) {
9015
9312
  let t = e.useSingleDollar ?? !1;
9016
9313
  return async (n) => {
9017
9314
  if (typeof window > "u") return;
9018
9315
  let r = ce();
9019
- r && ne("mathjax-3-global", `window.MathJax is MathJax ${r}`), lt(n), de(n), ut(n), Be(n);
9020
- let i = wt(e);
9021
- if (!dt(n, t)) {
9316
+ r && ne("mathjax-3-global", `window.MathJax is MathJax ${r}`), Nt(n), fe(n), Pt(n), Ie(n);
9317
+ let i = Jt(e);
9318
+ if (!Ft(n, t)) {
9022
9319
  i.catch(() => {});
9023
9320
  return;
9024
9321
  }
9025
9322
  await i;
9026
9323
  let a = y();
9027
9324
  if (await a?.startup?.promise, typeof a?.typesetPromise == "function") {
9028
- Ge(), bt(a.startup?.document);
9325
+ Ve(), Wt(a.startup?.document);
9029
9326
  try {
9030
9327
  await a.typesetPromise([n]);
9031
9328
  } catch (e) {
9032
9329
  throw a.typesetClear?.([n]), e;
9033
9330
  }
9034
- z(n);
9331
+ X(n), J(n);
9035
9332
  }
9036
9333
  };
9037
9334
  }
9038
- var kt = {
9039
- "(": "open parenthesis",
9040
- "[": "open bracket",
9041
- "{": "open brace",
9042
- "⟨": "open angle bracket",
9043
- "⌊": "open floor",
9044
- "⌈": "open ceiling"
9045
- };
9046
- var At = {
9047
- ")": "close parenthesis",
9048
- "]": "close bracket",
9049
- "}": "close brace",
9050
- "⟩": "close angle bracket",
9051
- "⌋": "close floor",
9052
- "⌉": "close ceiling"
9053
- };
9054
- var H = {
9055
- "!": "factorial",
9056
- "%": "percent",
9057
- "°": "degrees",
9058
- "′": "prime",
9059
- "″": "double prime"
9060
- };
9061
- ({
9062
- ...kt,
9063
- ...At,
9064
- ...H
9065
- });
9066
- var $t = "@pie-lib/math-rendering";
9067
- var en = "@pie-lib/math-rendering@2";
9068
- var tn = "pie-print";
9069
- var nn = 50;
9070
- var rn = 1e4;
9071
- var an = null;
9072
- function on() {
9073
- return !!window[en]?.opts?.useSingleDollar;
9335
+ var Zt = "@pie-lib/math-rendering";
9336
+ var Qt = "@pie-lib/math-rendering@2";
9337
+ var $t = "pie-print";
9338
+ var en = 50;
9339
+ var tn = 1e4;
9340
+ var nn = null;
9341
+ function rn() {
9342
+ return !!window[Qt]?.opts?.useSingleDollar;
9074
9343
  }
9075
- function sn() {
9076
- return an || (an = Tt({ useSingleDollar: on() })), an;
9344
+ function an() {
9345
+ return nn || (nn = Yt({ useSingleDollar: rn() })), nn;
9077
9346
  }
9078
9347
  function Q() {
9079
9348
  if (typeof window > "u") return null;
9080
- let e = window[$t];
9349
+ let e = window[Zt];
9081
9350
  return typeof e?.renderMath == "function" && e.renderMath !== $ ? e : null;
9082
9351
  }
9083
- function cn(e) {
9352
+ function on(e) {
9084
9353
  let t = e;
9085
9354
  for (; t;) {
9086
- if (t instanceof Element && t.localName === tn) return t;
9355
+ if (t instanceof Element && t.localName === $t) return t;
9087
9356
  t = t instanceof ShadowRoot ? t.host : t.parentNode;
9088
9357
  }
9089
9358
  return null;
9090
9359
  }
9091
- function ln() {
9360
+ function sn() {
9092
9361
  let e = window.renderMath;
9093
9362
  return typeof e == "function" ? e : null;
9094
9363
  }
9095
- async function un(e) {
9096
- let t = cn(e);
9364
+ async function cn(e) {
9365
+ let t = on(e);
9097
9366
  if (!t) return null;
9098
- let n = ln();
9367
+ let n = sn();
9099
9368
  if (n || t.mathRenderingModuleUrlImported !== !0) return n;
9100
- let r = Date.now() + rn;
9369
+ let r = Date.now() + tn;
9101
9370
  for (; Date.now() < r;) {
9102
- await new Promise((e) => setTimeout(e, nn));
9103
- let e = ln();
9371
+ await new Promise((e) => setTimeout(e, en));
9372
+ let e = sn();
9104
9373
  if (e) return e;
9105
9374
  }
9106
9375
  return null;
@@ -9109,8 +9378,8 @@ var $ = async (e) => {
9109
9378
  if (typeof window > "u") return;
9110
9379
  let t = typeof e == "string", n;
9111
9380
  t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
9112
- let r = Q(), i = r || t ? null : await un(n);
9113
- return r ? await r.renderMath?.(n) : i && i !== $ ? await i(n) : await sn()(n), t ? n.innerHTML : void 0;
9381
+ let r = Q(), i = r || t ? null : await cn(n);
9382
+ return r ? (await r.renderMath?.(n), J(n)) : i && i !== $ ? (await i(n), J(n)) : await an()(n), t ? n.innerHTML : void 0;
9114
9383
  };
9115
9384
  //#endregion
9116
9385
  //#region ../../shared/translator/dist/en.js