@pie-element/venn-classification 0.1.1-next.17 → 0.1.1-next.19

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.
@@ -5472,22 +5472,30 @@ function v() {
5472
5472
  return window.MathJax;
5473
5473
  }
5474
5474
  function y(e) {
5475
- let t = e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e;
5476
- for (let [e, n] of d) if (t.startsWith(e) && t.endsWith(n)) return t.substring(e.length, t.length - n.length);
5477
- return t;
5475
+ for (let [t, n] of d) if (e.startsWith(t) && e.endsWith(n)) return e.substring(t.length, e.length - n.length);
5476
+ return e;
5478
5477
  }
5479
5478
  function b(e) {
5479
+ return y(e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e);
5480
+ }
5481
+ var x = "mathjax_ignore";
5482
+ var S = "mathjax_process";
5483
+ function C(e, t) {
5484
+ let n = e.closest(`.${x}, .${S}`);
5485
+ return n !== null && t.contains(n) && !n.classList.contains(S);
5486
+ }
5487
+ function w(e) {
5480
5488
  for (let t of e.querySelectorAll("[data-latex]")) {
5481
- if (t.dataset.mathHandled || t.closest("mjx-container")) continue;
5482
- let e = t.textContent;
5483
- e && (t.textContent = `\\(${y(e)}\\)`.replace(u, "\\newline "), t.dataset.mathHandled = "true");
5489
+ if (t.dataset.mathHandled || t.closest("mjx-container") || C(t, e)) continue;
5490
+ let n = t.textContent;
5491
+ n && (t.textContent = `\\(${b(n)}\\)`.replace(u, "\\newline "), t.dataset.mathHandled = "true");
5484
5492
  }
5485
5493
  }
5486
- function x(e, t) {
5494
+ function T(e, t) {
5487
5495
  for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
5488
5496
  return (t ? l : c$1).test(e.textContent ?? "");
5489
5497
  }
5490
- function S(e) {
5498
+ function E(e) {
5491
5499
  return new Promise((t, n) => {
5492
5500
  let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: c = !0, srcUrl: l } = e, u = {
5493
5501
  loader: {
@@ -5498,7 +5506,7 @@ function S(e) {
5498
5506
  typeset: !1,
5499
5507
  ready: () => {
5500
5508
  let e = v(), r = e?.startup, i = !!e?.version?.startsWith("4.");
5501
- i && C(e), r?.defaultReady?.(), i && w(r?.document), Promise.resolve(r?.promise).then(() => t(), n);
5509
+ i && D(e), r?.defaultReady?.(), i && O(r?.document), Promise.resolve(r?.promise).then(() => t(), n);
5502
5510
  }
5503
5511
  },
5504
5512
  tex: { macros: { ...o } },
@@ -5516,11 +5524,11 @@ function S(e) {
5516
5524
  d.src = l || a, d.async = !0, d.onerror = () => n(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(d);
5517
5525
  });
5518
5526
  }
5519
- function C(e) {
5527
+ function D(e) {
5520
5528
  let t = e?._?.output?.chtml_ts?.CHTML;
5521
5529
  t && (t.STYLESHEETID = p);
5522
5530
  }
5523
- function w(e) {
5531
+ function O(e) {
5524
5532
  if (!e) return;
5525
5533
  let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
5526
5534
  let n = e.typesetRoot;
@@ -5534,32 +5542,32 @@ function w(e) {
5534
5542
  return t && _(t), !1;
5535
5543
  });
5536
5544
  let r = e.outputJax?.chtmlStyles;
5537
- r?.id === m && (r.id = p), D();
5545
+ r?.id === m && (r.id = p), j();
5538
5546
  }
5539
- function T(e) {
5547
+ function k(e) {
5540
5548
  return e instanceof HTMLStyleElement && h.includes(e.id);
5541
5549
  }
5542
- function E(e) {
5550
+ function A(e) {
5543
5551
  r$2("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
5544
5552
  }
5545
- function D() {
5546
- let e = document.head, t = [...e.children].find(T);
5553
+ function j() {
5554
+ let e = document.head, t = [...e.children].find(k);
5547
5555
  if (t) {
5548
- E(t);
5556
+ A(t);
5549
5557
  return;
5550
5558
  }
5551
5559
  let n = new MutationObserver((e) => {
5552
5560
  for (let t of e) {
5553
- let e = [...t.addedNodes].find(T);
5561
+ let e = [...t.addedNodes].find(k);
5554
5562
  if (e) {
5555
- E(e), n.disconnect();
5563
+ A(e), n.disconnect();
5556
5564
  return;
5557
5565
  }
5558
5566
  }
5559
5567
  });
5560
5568
  n.observe(e, { childList: !0 });
5561
5569
  }
5562
- function O(e) {
5570
+ function M(e) {
5563
5571
  return new Promise((t, n) => {
5564
5572
  let r = e.startup ?? {};
5565
5573
  e.startup = r;
@@ -5570,27 +5578,27 @@ function O(e) {
5570
5578
  };
5571
5579
  });
5572
5580
  }
5573
- function k(e) {
5581
+ function N(e) {
5574
5582
  let t = v();
5575
- return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : O(t) : S(e);
5583
+ return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : M(t) : E(e);
5576
5584
  }
5577
- function A(e) {
5578
- return k(e).then(() => {
5585
+ function P(e) {
5586
+ return N(e).then(() => {
5579
5587
  typeof v()?.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
5580
5588
  });
5581
5589
  }
5582
- function j(e) {
5590
+ function F(e) {
5583
5591
  let t = globalThis, n = t[f];
5584
- return n || (n = A(e), t[f] = n), n;
5592
+ return n || (n = P(e), t[f] = n), n;
5585
5593
  }
5586
- function M(e = {}) {
5594
+ function I(e = {}) {
5587
5595
  let t = e.useSingleDollar ?? !1;
5588
5596
  return async (n) => {
5589
5597
  if (typeof window > "u") return;
5590
5598
  let a = i();
5591
- a && r$2("mathjax-3-global", `window.MathJax is MathJax ${a}`), b(n);
5592
- let o = j(e);
5593
- if (!x(n, t)) {
5599
+ a && r$2("mathjax-3-global", `window.MathJax is MathJax ${a}`), w(n);
5600
+ let o = F(e);
5601
+ if (!T(n, t)) {
5594
5602
  o.catch(() => {});
5595
5603
  return;
5596
5604
  }
@@ -5599,26 +5607,54 @@ function M(e = {}) {
5599
5607
  await s?.startup?.promise, typeof s?.typesetPromise == "function" && (await s.typesetPromise([n]), _(n));
5600
5608
  };
5601
5609
  }
5602
- var P = "@pie-lib/math-rendering";
5603
- var F = "@pie-lib/math-rendering@2";
5604
- var I = null;
5605
- function L() {
5606
- return !!window[F]?.opts?.useSingleDollar;
5610
+ var R = "@pie-lib/math-rendering";
5611
+ var z = "@pie-lib/math-rendering@2";
5612
+ var B = "pie-print";
5613
+ var V = 50;
5614
+ var H = 1e4;
5615
+ var U = null;
5616
+ function W() {
5617
+ return !!window[z]?.opts?.useSingleDollar;
5607
5618
  }
5608
- function R() {
5609
- return I || (I = M({ useSingleDollar: L() })), I;
5619
+ function G() {
5620
+ return U || (U = I({ useSingleDollar: W() })), U;
5610
5621
  }
5611
- function z() {
5622
+ function K() {
5612
5623
  if (typeof window > "u") return null;
5613
- let e = window[P];
5614
- return typeof e?.renderMath == "function" ? e : null;
5624
+ let e = window[R];
5625
+ return typeof e?.renderMath == "function" && e.renderMath !== X ? e : null;
5626
+ }
5627
+ function q(e) {
5628
+ let t = e;
5629
+ for (; t;) {
5630
+ if (t instanceof Element && t.localName === B) return t;
5631
+ t = t instanceof ShadowRoot ? t.host : t.parentNode;
5632
+ }
5633
+ return null;
5634
+ }
5635
+ function J() {
5636
+ let e = window.renderMath;
5637
+ return typeof e == "function" ? e : null;
5638
+ }
5639
+ async function Y(e) {
5640
+ let t = q(e);
5641
+ if (!t) return null;
5642
+ let n = J();
5643
+ if (n || t.mathRenderingModuleUrlImported !== !0) return n;
5644
+ let r = Date.now() + H;
5645
+ for (; Date.now() < r;) {
5646
+ await new Promise((e) => setTimeout(e, V));
5647
+ let e = J();
5648
+ if (e) return e;
5649
+ }
5650
+ return null;
5615
5651
  }
5616
- var B = async (e) => {
5652
+ var X = async (e) => {
5617
5653
  if (typeof window > "u") return;
5618
5654
  let t = typeof e == "string", n;
5619
5655
  t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
5620
- let r = z();
5621
- return r ? await r.renderMath?.(n) : await R()(n), t ? n.innerHTML : void 0;
5656
+ let r = K(), i = r || t ? null : await Y(n);
5657
+ return r ? await r.renderMath?.(n) : i && i !== X ? await i(n) : await G()(n), t ? n.innerHTML : void 0;
5622
5658
  };
5623
5659
  //#endregion
5624
5660
  //#region ../../shared/translator/dist/en.js
@@ -9314,7 +9350,7 @@ function VennClassification($$anchor, $$props) {
9314
9350
  if (!containerEl) return;
9315
9351
  const warn = (err) => console.warn("venn-classification: MathJax render failed", err);
9316
9352
  try {
9317
- Promise.resolve(B(containerEl)).catch(warn);
9353
+ Promise.resolve(X(containerEl)).catch(warn);
9318
9354
  } catch (err) {
9319
9355
  warn(err);
9320
9356
  }