@pie-element/venn-classification 0.1.1-next.13 → 0.1.1-next.15

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.
@@ -1,4 +1,4 @@
1
- import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, U as g, V as _, _ as v, a as y, b, c as x, d as S, f as C, g as w, h as T, i as E, j as D, k as O, l as k, m as A, n as j, o as M, p as N, r as P, s as F, t as ee, u as I, v as L, w as R, x as z, y as te, z as B } from "../VennClassification-D7bxMPcn.js";
1
+ import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, M as l, N as u, O as d, P as f, R as p, S as m, T as h, U as g, V as _, _ as v, a as y, b, c as x, d as S, f as C, g as w, h as T, i as E, j as D, k as O, l as k, m as A, n as j, o as M, p as N, r as P, s as F, t as ee, u as I, v as L, w as R, x as z, y as te, z as B } from "../VennClassification-Dk8fAui3.js";
2
2
  import { _ as ne, g as re, h as ie, i as ae, m as oe, n as se, p as V, v as H, y as ce } from "../controller-bkBJ6-j1.js";
3
3
  import { Editor as le } from "@tiptap/core";
4
4
  import ue from "@tiptap/starter-kit";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../VennClassification-D7bxMPcn.js";
1
+ import { t as e } from "../VennClassification-Dk8fAui3.js";
2
2
  import { c as t } from "../controller-bkBJ6-j1.js";
3
3
  //#region ../../lib-svelte/delivery-events/dist/index2.js
4
4
  function n(e) {
@@ -5412,131 +5412,212 @@ function create_custom_element(Component, props_definition, slots, exports, shad
5412
5412
  }
5413
5413
  //#endregion
5414
5414
  //#region ../../shared/math-rendering-mathjax/dist/index.js
5415
- var e$3 = {
5415
+ var e$3 = "https://github.com/pie-framework/pie-players/blob/develop/docs/item-player/loading-strategies.md#one-mathjax-version-per-page";
5416
+ var t$3 = "pie-mathjax-version-conflict";
5417
+ var n = Symbol.for("@pie-element/shared-math-rendering-mathjax/unsupported-page");
5418
+ function r$2(r, i) {
5419
+ if (typeof window > "u") return;
5420
+ let a = globalThis;
5421
+ a[n] ?? (a[n] = {
5422
+ logged: !1,
5423
+ conditions: []
5424
+ });
5425
+ let o = a[n];
5426
+ if (o.conditions.includes(r)) return;
5427
+ o.conditions.push(r);
5428
+ let s = `[math-rendering] Unsupported page (${r}): ${i}. PIE supports one MathJax major version per page; with MathJax 3 and 4 on one page, math rendering is best effort and may break. See ${e$3}`;
5429
+ o.logged || (o.logged = !0, console.error(s)), window.dispatchEvent(new CustomEvent(t$3, { detail: {
5430
+ condition: r,
5431
+ message: s,
5432
+ docsUrl: e$3
5433
+ } }));
5434
+ }
5435
+ function i() {
5436
+ let e = window.MathJax?.version;
5437
+ return typeof e == "string" && e.startsWith("3.") ? e : void 0;
5438
+ }
5439
+ var a = "https://cdn.jsdelivr.net/npm/mathjax@4.1.3/tex-mml-chtml.js";
5440
+ var o = {
5416
5441
  parallelogram: "\\lower.2em{\\Huge\\unicode{x25B1}}",
5417
5442
  overarc: "\\overparen",
5418
5443
  napprox: "\\not\\approx",
5419
5444
  longdiv: "\\enclose{longdiv}",
5420
5445
  abs: ["\\left|#1\\right|", 1]
5421
5446
  };
5422
- var t$3 = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)";
5423
- var n = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/;
5424
- var r$2 = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/;
5425
- var i = /\\embed\{newLine\}\[\]/g;
5426
- var a = [
5447
+ var s$1 = "[math-rendering] using $ is not advisable, please use $$..$$ or \\(...\\)";
5448
+ var c$1 = /\\\(|\\\[|\$\$|\\\$|\\begin\{|\\(?:eq)?ref\{/;
5449
+ var l = /\\\(|\\\[|\$|\\begin\{|\\(?:eq)?ref\{/;
5450
+ var u = /\\embed\{newLine\}\[\]/g;
5451
+ var d = [
5427
5452
  ["$$", "$$"],
5428
5453
  ["$", "$"],
5429
5454
  ["\\[", "\\]"],
5430
5455
  ["\\(", "\\)"]
5431
5456
  ];
5432
- var o = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading");
5433
- function s$1() {
5457
+ var f = Symbol.for("@pie-element/shared-math-rendering-mathjax/loading");
5458
+ var p = "PIE-MJX-CHTML-styles";
5459
+ var m = "MJX-CHTML-styles";
5460
+ var h = [m, "MJX-SVG-styles"];
5461
+ var g = 201;
5462
+ function _(e) {
5463
+ let t = [...e.matches("mjx-container") ? [e] : [], ...e.querySelectorAll("mjx-container")];
5464
+ 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");
5465
+ }
5466
+ function v() {
5434
5467
  return window.MathJax;
5435
5468
  }
5436
- function c$1(e) {
5469
+ function y(e) {
5437
5470
  let t = e.includes("\\displaystyle") ? e.replace("\\displaystyle", "").trim() : e;
5438
- for (let [e, n] of a) if (t.startsWith(e) && t.endsWith(n)) return t.substring(e.length, t.length - n.length);
5471
+ for (let [e, n] of d) if (t.startsWith(e) && t.endsWith(n)) return t.substring(e.length, t.length - n.length);
5439
5472
  return t;
5440
5473
  }
5441
- function l(e) {
5474
+ function b(e) {
5442
5475
  for (let t of e.querySelectorAll("[data-latex]")) {
5443
5476
  if (t.dataset.mathHandled || t.closest("mjx-container")) continue;
5444
5477
  let e = t.textContent;
5445
- e && (t.textContent = `\\(${c$1(e)}\\)`.replace(i, "\\newline "), t.dataset.mathHandled = "true");
5478
+ e && (t.textContent = `\\(${y(e)}\\)`.replace(u, "\\newline "), t.dataset.mathHandled = "true");
5446
5479
  }
5447
5480
  }
5448
- function u(e, t) {
5481
+ function x(e, t) {
5449
5482
  for (let t of e.querySelectorAll("math")) if (!t.closest("mjx-assistive-mml")) return !0;
5450
- return (t ? r$2 : n).test(e.textContent ?? "");
5483
+ return (t ? l : c$1).test(e.textContent ?? "");
5451
5484
  }
5452
- function d(n) {
5453
- return new Promise((r, i) => {
5454
- let { useSingleDollar: a = !1, accessibility: o = !0, loadFonts: c = !0, srcUrl: l } = n, u = {
5485
+ function S(e) {
5486
+ return new Promise((t, n) => {
5487
+ let { useSingleDollar: r = !1, accessibility: i = !0, loadFonts: c = !0, srcUrl: l } = e, u = {
5455
5488
  loader: {
5456
- load: o ? ["a11y/assistive-mml"] : [],
5457
- failed: (e) => i(e)
5489
+ load: i ? ["a11y/assistive-mml"] : [],
5490
+ failed: (e) => n(e)
5458
5491
  },
5459
5492
  startup: {
5460
5493
  typeset: !1,
5461
5494
  ready: () => {
5462
- let e = s$1()?.startup;
5463
- e?.defaultReady?.(), Promise.resolve(e?.promise).then(() => r(), i);
5495
+ let e = v(), r = e?.startup, i = !!e?.version?.startsWith("4.");
5496
+ i && C(e), r?.defaultReady?.(), i && w(r?.document), Promise.resolve(r?.promise).then(() => t(), n);
5464
5497
  }
5465
5498
  },
5466
- tex: { macros: { ...e$3 } },
5499
+ tex: { macros: { ...o } },
5467
5500
  options: {
5468
- enableMenu: o,
5501
+ enableMenu: i,
5469
5502
  menuOptions: { settings: {
5470
- assistiveMml: o,
5503
+ assistiveMml: i,
5471
5504
  enrich: !1,
5472
5505
  inTabOrder: !1
5473
5506
  } }
5474
5507
  }
5475
5508
  };
5476
- a && u.tex && (console.warn(t$3), u.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], u.tex.processEscapes = !0), c || (u.chtml = { fontURL: "" }), window.MathJax = u;
5509
+ r && u.tex && (console.warn(s$1), u.tex.inlineMath = [["$", "$"], ["\\(", "\\)"]], u.tex.processEscapes = !0), c || (u.chtml = { fontURL: "" }), window.MathJax = u;
5477
5510
  let d = document.createElement("script");
5478
- d.src = l || "https://cdn.jsdelivr.net/npm/mathjax@4.1.3/tex-mml-chtml.js", d.async = !0, d.onerror = () => i(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(d);
5511
+ d.src = l || a, d.async = !0, d.onerror = () => n(/* @__PURE__ */ Error("Failed to load MathJax")), document.head.appendChild(d);
5479
5512
  });
5480
5513
  }
5481
- function f(e) {
5514
+ function C(e) {
5515
+ let t = e?._?.output?.chtml_ts?.CHTML;
5516
+ t && (t.STYLESHEETID = p);
5517
+ }
5518
+ function w(e) {
5519
+ if (!e) return;
5520
+ let t = /* @__PURE__ */ new WeakSet(), n = (e) => {
5521
+ let n = e.typesetRoot;
5522
+ !n || t.has(n) || (_(n), t.add(n));
5523
+ };
5524
+ e.addRenderAction?.("pie-strip-latex", g, (e) => {
5525
+ for (let t of e.math ?? []) n(t);
5526
+ return !1;
5527
+ }, (e) => {
5528
+ let t = e.typesetRoot;
5529
+ return t && _(t), !1;
5530
+ });
5531
+ let r = e.outputJax?.chtmlStyles;
5532
+ r?.id === m && (r.id = p), D();
5533
+ }
5534
+ function T(e) {
5535
+ return e instanceof HTMLStyleElement && h.includes(e.id);
5536
+ }
5537
+ function E(e) {
5538
+ r$2("foreign-output-stylesheet", `another MathJax added <style id="${e.id}"> to <head>`);
5539
+ }
5540
+ function D() {
5541
+ let e = document.head, t = [...e.children].find(T);
5542
+ if (t) {
5543
+ E(t);
5544
+ return;
5545
+ }
5546
+ let n = new MutationObserver((e) => {
5547
+ for (let t of e) {
5548
+ let e = [...t.addedNodes].find(T);
5549
+ if (e) {
5550
+ E(e), n.disconnect();
5551
+ return;
5552
+ }
5553
+ }
5554
+ });
5555
+ n.observe(e, { childList: !0 });
5556
+ }
5557
+ function O(e) {
5482
5558
  return new Promise((t, n) => {
5483
5559
  let r = e.startup ?? {};
5484
5560
  e.startup = r;
5485
5561
  let i = r.ready;
5486
5562
  r.ready = () => {
5487
- let e = s$1()?.startup;
5563
+ let e = v()?.startup;
5488
5564
  i ? i.call(r) : e?.defaultReady?.(), Promise.resolve(e?.promise).then(() => t(), n);
5489
5565
  };
5490
5566
  });
5491
5567
  }
5492
- function p(e) {
5493
- let t = s$1();
5494
- return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : f(t) : d(e);
5568
+ function k(e) {
5569
+ let t = v();
5570
+ return t ? t.version ? t.startup?.promise ? Promise.resolve(t.startup.promise).then(() => void 0) : Promise.resolve() : O(t) : S(e);
5495
5571
  }
5496
- function m(e) {
5497
- return p(e).then(() => {
5498
- typeof s$1()?.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
5572
+ function A(e) {
5573
+ return k(e).then(() => {
5574
+ typeof v()?.typesetPromise != "function" && console.warn("[mathjax-renderer] MathJax on this page has no typesetPromise; math stays untypeset.");
5499
5575
  });
5500
5576
  }
5501
- function h(e) {
5502
- let t = globalThis, n = t[o];
5503
- return n || (n = m(e), t[o] = n), n;
5577
+ function j(e) {
5578
+ let t = globalThis, n = t[f];
5579
+ return n || (n = A(e), t[f] = n), n;
5504
5580
  }
5505
- function g(e = {}) {
5581
+ function M(e = {}) {
5506
5582
  let t = e.useSingleDollar ?? !1;
5507
5583
  return async (n) => {
5508
5584
  if (typeof window > "u") return;
5509
- l(n);
5510
- let r = h(e);
5511
- if (!u(n, t)) {
5512
- r.catch(() => {});
5585
+ let a = i();
5586
+ a && r$2("mathjax-3-global", `window.MathJax is MathJax ${a}`), b(n);
5587
+ let o = j(e);
5588
+ if (!x(n, t)) {
5589
+ o.catch(() => {});
5513
5590
  return;
5514
5591
  }
5515
- await r;
5516
- let i = s$1();
5517
- await i?.startup?.promise, typeof i?.typesetPromise == "function" && await i.typesetPromise([n]);
5592
+ await o;
5593
+ let s = v();
5594
+ await s?.startup?.promise, typeof s?.typesetPromise == "function" && (await s.typesetPromise([n]), _(n));
5518
5595
  };
5519
5596
  }
5520
- var v = "@pie-lib/math-rendering";
5521
- var y = "@pie-lib/math-rendering@2";
5522
- var b = null;
5523
- function x() {
5524
- return !!window[y]?.opts?.useSingleDollar;
5597
+ var P = "@pie-lib/math-rendering";
5598
+ var F = "@pie-lib/math-rendering@2";
5599
+ var I = null;
5600
+ function L() {
5601
+ return !!window[F]?.opts?.useSingleDollar;
5525
5602
  }
5526
- function S() {
5527
- return b || (b = g({ useSingleDollar: x() })), b;
5603
+ function R() {
5604
+ return I || (I = M({ useSingleDollar: L() })), I;
5528
5605
  }
5529
- function C() {
5606
+ function z() {
5530
5607
  if (typeof window > "u") return null;
5531
- let e = window[v];
5608
+ let e = window[P];
5532
5609
  return typeof e?.renderMath == "function" ? e : null;
5533
5610
  }
5534
- var w = async (e) => {
5611
+ function B() {
5612
+ let e = i();
5613
+ e && r$2("legacy-renderer-delegation", `window['${P}'] renders this element's math with MathJax ${e}`);
5614
+ }
5615
+ var V = async (e) => {
5535
5616
  if (typeof window > "u") return;
5536
5617
  let t = typeof e == "string", n;
5537
5618
  t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
5538
- let r = C();
5539
- return r ? await r.renderMath?.(n) : await S()(n), t ? n.innerHTML : void 0;
5619
+ let r = z();
5620
+ return r ? (B(), await r.renderMath?.(n)) : await R()(n), t ? n.innerHTML : void 0;
5540
5621
  };
5541
5622
  //#endregion
5542
5623
  //#region ../../shared/translator/dist/en.js
@@ -9232,7 +9313,7 @@ function VennClassification($$anchor, $$props) {
9232
9313
  if (!containerEl) return;
9233
9314
  const warn = (err) => console.warn("venn-classification: MathJax render failed", err);
9234
9315
  try {
9235
- Promise.resolve(w(containerEl)).catch(warn);
9316
+ Promise.resolve(V(containerEl)).catch(warn);
9236
9317
  } catch (err) {
9237
9318
  warn(err);
9238
9319
  }