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

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.
@@ -2646,47 +2646,72 @@ function ga(e = {}) {
2646
2646
  await a?.startup?.promise, typeof a?.typesetPromise == "function" && (await a.typesetPromise([n]), ta(n));
2647
2647
  };
2648
2648
  }
2649
- var _a = "@pie-lib/math-rendering", va = "@pie-lib/math-rendering@2", ya = null;
2650
- function ba() {
2649
+ var _a = "@pie-lib/math-rendering", va = "@pie-lib/math-rendering@2", ya = "pie-print", ba = 50, xa = 1e4, Sa = null;
2650
+ function Ca() {
2651
2651
  return !!window[va]?.opts?.useSingleDollar;
2652
2652
  }
2653
- function xa() {
2654
- return ya ||= ga({ useSingleDollar: ba() }), ya;
2653
+ function wa() {
2654
+ return Sa ||= ga({ useSingleDollar: Ca() }), Sa;
2655
2655
  }
2656
- function Sa() {
2656
+ function Ta() {
2657
2657
  if (typeof window > "u") return null;
2658
2658
  let e = window[_a];
2659
2659
  return typeof e?.renderMath == "function" ? e : null;
2660
2660
  }
2661
- var Ca = async (e) => {
2661
+ function Ea(e) {
2662
+ let t = e;
2663
+ for (; t;) {
2664
+ if (t instanceof Element && t.localName === ya) return t;
2665
+ t = t instanceof ShadowRoot ? t.host : t.parentNode;
2666
+ }
2667
+ return null;
2668
+ }
2669
+ function Da() {
2670
+ let e = window.renderMath;
2671
+ return typeof e == "function" ? e : null;
2672
+ }
2673
+ async function Oa(e) {
2674
+ let t = Ea(e);
2675
+ if (!t) return null;
2676
+ let n = Da();
2677
+ if (n || t.mathRenderingModuleUrlImported !== !0) return n;
2678
+ let r = Date.now() + xa;
2679
+ for (; Date.now() < r;) {
2680
+ await new Promise((e) => setTimeout(e, ba));
2681
+ let e = Da();
2682
+ if (e) return e;
2683
+ }
2684
+ return null;
2685
+ }
2686
+ var ka = async (e) => {
2662
2687
  if (typeof window > "u") return;
2663
2688
  let t = typeof e == "string", n;
2664
2689
  t ? (n = document.createElement("div"), n.innerHTML = e) : n = e || document.body;
2665
- let r = Sa();
2666
- return r ? await r.renderMath?.(n) : await xa()(n), t ? n.innerHTML : void 0;
2690
+ let r = Ta(), i = r || t ? null : await Oa(n);
2691
+ return r ? await r.renderMath?.(n) : i ? await i(n) : await wa()(n), t ? n.innerHTML : void 0;
2667
2692
  };
2668
2693
  //#endregion
2669
2694
  //#region src/delivery/tile-accessible-name.ts
2670
- function wa(e) {
2695
+ function Aa(e) {
2671
2696
  return (e || "").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
2672
2697
  }
2673
- function Ta(e, n) {
2698
+ function ja(e, n) {
2674
2699
  let r = (e.imageAlt ?? "").trim();
2675
- return (e.imageUrl ?? "").trim() && r ? r : wa(e.label ?? "") || t("tileFallbackName", n);
2700
+ return (e.imageUrl ?? "").trim() && r ? r : Aa(e.label ?? "") || t("tileFallbackName", n);
2676
2701
  }
2677
- function Ea(e, n, r, i) {
2678
- let a = [Ta(e, i), n === null ? t("tileNotPlaced", i) : t("tileInRegion", i, { region: n })];
2702
+ function Ma(e, n, r, i) {
2703
+ let a = [ja(e, i), n === null ? t("tileNotPlaced", i) : t("tileInRegion", i, { region: n })];
2679
2704
  return r === "correct" && a.push(t("tileCorrect", i)), r === "incorrect" && a.push(t("tileIncorrect", i)), a.join(", ");
2680
2705
  }
2681
2706
  //#endregion
2682
2707
  //#region src/delivery/Tile.svelte
2683
- var Da = /* @__PURE__ */ Y("<img alt=\"\" class=\"tile-img svelte-1hgaksk\" aria-hidden=\"true\" draggable=\"false\"/>"), Oa = /* @__PURE__ */ Y("<span></span>"), ka = /* @__PURE__ */ Y("<span class=\"venn-badge venn-badge-correct svelte-1hgaksk\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z\"></path></svg></span>"), Aa = /* @__PURE__ */ Y("<span class=\"venn-badge venn-badge-incorrect svelte-1hgaksk\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"></path></svg></span>"), ja = /* @__PURE__ */ Y("<button type=\"button\"><span><!> <!></span> <!></button>"), Ma = {
2708
+ var Na = /* @__PURE__ */ Y("<img alt=\"\" class=\"tile-img svelte-1hgaksk\" aria-hidden=\"true\" draggable=\"false\"/>"), Pa = /* @__PURE__ */ Y("<span></span>"), Fa = /* @__PURE__ */ Y("<span class=\"venn-badge venn-badge-correct svelte-1hgaksk\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z\"></path></svg></span>"), Ia = /* @__PURE__ */ Y("<span class=\"venn-badge venn-badge-incorrect svelte-1hgaksk\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z\"></path></svg></span>"), La = /* @__PURE__ */ Y("<button type=\"button\"><span><!> <!></span> <!></button>"), Ra = {
2684
2709
  hash: "svelte-1hgaksk",
2685
2710
  code: ".venn-tile.svelte-1hgaksk {position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:64px;min-height:44px;padding:8px 14px;border:1.5px solid #334155;border-radius:10px;background:#ffffff;color:#0f172a;font-size:14px;font-weight:500;box-shadow:0 1px 2px rgba(15, 23, 42, 0.06);cursor:grab;touch-action:none;user-select:none;transition:box-shadow 120ms ease, transform 120ms ease, background 120ms ease;}.venn-tile.svelte-1hgaksk:focus-visible,\n .venn-tile.focused.svelte-1hgaksk {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.venn-tile.svelte-1hgaksk:hover:not(:disabled) {background:#f8fafc;}.venn-tile.held.svelte-1hgaksk {cursor:grabbing;box-shadow:0 6px 18px rgba(15, 23, 42, 0.18);transform:translateY(-1px);background:#eef2ff;}.venn-tile.invisible.svelte-1hgaksk {visibility:hidden;}.venn-tile.ghost.svelte-1hgaksk {pointer-events:none;cursor:grabbing;box-shadow:0 10px 24px rgba(15, 23, 42, 0.22);transform:rotate(-1.5deg);background:#ffffff;opacity:0.96;}.venn-tile.correct.svelte-1hgaksk {border-color:#0ea449;}.venn-tile.incorrect.svelte-1hgaksk {border-color:#bf0d00;}.venn-tile.svelte-1hgaksk:disabled {cursor:default;}.tile-body.svelte-1hgaksk {display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;pointer-events:none;max-width:220px;}.tile-body-image.svelte-1hgaksk {flex-direction:column;gap:4px;}.tile-img.svelte-1hgaksk {width:40px;height:40px;object-fit:contain;flex-shrink:0;}.tile-label.svelte-1hgaksk {pointer-events:none;text-align:center;line-height:1.25;word-break:break-word;}.tile-label-below.svelte-1hgaksk {font-size:12px;font-weight:600;}.venn-tile.fit.svelte-1hgaksk {box-sizing:border-box;width:100%;height:100%;min-width:0;min-height:0;padding:6px 10px;}.fit.svelte-1hgaksk .tile-body:where(.svelte-1hgaksk) {max-width:100%;max-height:100%;overflow:hidden;}.fit.svelte-1hgaksk .tile-label:where(.svelte-1hgaksk) {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;}.fit.svelte-1hgaksk .tile-label-below:where(.svelte-1hgaksk) {-webkit-line-clamp:1;line-clamp:1;}.venn-badge.svelte-1hgaksk {position:absolute;top:-8px;right:-8px;width:20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;color:#ffffff;}.venn-badge-correct.svelte-1hgaksk {background:#0ea449;}.venn-badge-incorrect.svelte-1hgaksk {background:#bf0d00;}\n @media (prefers-reduced-motion: reduce) {.venn-tile.svelte-1hgaksk {transition:none;}\n }"
2686
2711
  };
2687
- function Na(e, t) {
2688
- Xe(t, !0), si(e, Ma);
2689
- let n = $(t, "id", 7), r = $(t, "label", 7), i = $(t, "imageUrl", 7), a = $(t, "imageAlt", 7), o = $(t, "name", 7), s = $(t, "language", 7), c = $(t, "correctness", 7, "neutral"), l = $(t, "held", 7, !1), u = $(t, "invisible", 7, !1), d = $(t, "ghost", 7, !1), f = $(t, "disabled", 7, !1), p = $(t, "focused", 7, !1), m = $(t, "fit", 7, !1), h = $(t, "onpointerdown", 7), g = $(t, "onkeydown", 7), _ = $(t, "onkeyup", 7), v = $(t, "onfocus", 7), y = $(t, "onclick", 7), b = /* @__PURE__ */ I(() => o() ?? Ta({
2712
+ function za(e, t) {
2713
+ Xe(t, !0), si(e, Ra);
2714
+ let n = $(t, "id", 7), r = $(t, "label", 7), i = $(t, "imageUrl", 7), a = $(t, "imageAlt", 7), o = $(t, "name", 7), s = $(t, "language", 7), c = $(t, "correctness", 7, "neutral"), l = $(t, "held", 7, !1), u = $(t, "invisible", 7, !1), d = $(t, "ghost", 7, !1), f = $(t, "disabled", 7, !1), p = $(t, "focused", 7, !1), m = $(t, "fit", 7, !1), h = $(t, "onpointerdown", 7), g = $(t, "onkeydown", 7), _ = $(t, "onkeyup", 7), v = $(t, "onfocus", 7), y = $(t, "onclick", 7), b = /* @__PURE__ */ I(() => o() ?? ja({
2690
2715
  label: r(),
2691
2716
  imageUrl: i(),
2692
2717
  imageAlt: a()
@@ -2800,19 +2825,19 @@ function Na(e, t) {
2800
2825
  set onclick(e) {
2801
2826
  y(e), R();
2802
2827
  }
2803
- }, C = ja();
2828
+ }, C = La();
2804
2829
  let w;
2805
2830
  var te = H(C);
2806
2831
  let ne;
2807
2832
  var re = H(te), ie = (e) => {
2808
- var t = Da();
2833
+ var t = Na();
2809
2834
  W(() => Q(t, "src", i())), X(e, t);
2810
2835
  };
2811
2836
  Z(re, (e) => {
2812
2837
  J(x) && e(ie);
2813
2838
  });
2814
2839
  var T = U(re, 2), E = (e) => {
2815
- var t = Oa();
2840
+ var t = Pa();
2816
2841
  let n;
2817
2842
  oi(t, r, !0), N(t), W(() => n = pi(t, 1, "tile-label svelte-1hgaksk", null, n, { "tile-label-below": J(x) })), X(e, t);
2818
2843
  };
@@ -2820,9 +2845,9 @@ function Na(e, t) {
2820
2845
  J(S) && e(E);
2821
2846
  }), N(te);
2822
2847
  var ae = U(te, 2), oe = (e) => {
2823
- X(e, ka());
2848
+ X(e, Fa());
2824
2849
  }, se = (e) => {
2825
- X(e, Aa());
2850
+ X(e, Ia());
2826
2851
  };
2827
2852
  return Z(ae, (e) => {
2828
2853
  c() === "correct" ? e(oe) : c() === "incorrect" && e(se, 1);
@@ -2853,7 +2878,7 @@ Sr([
2853
2878
  "keydown",
2854
2879
  "keyup",
2855
2880
  "click"
2856
- ]), Li(Na, {
2881
+ ]), Li(za, {
2857
2882
  id: {},
2858
2883
  label: {},
2859
2884
  imageUrl: {},
@@ -2875,12 +2900,12 @@ Sr([
2875
2900
  }, [], [], { mode: "open" });
2876
2901
  //#endregion
2877
2902
  //#region src/delivery/Tray.svelte
2878
- var Pa = /* @__PURE__ */ Y("<div role=\"region\" data-region-key=\"tray\"><div class=\"tray-label svelte-1ogsh8s\"> </div> <div class=\"tray-items svelte-1ogsh8s\"><!></div></div>"), Fa = {
2903
+ var Ba = /* @__PURE__ */ Y("<div role=\"region\" data-region-key=\"tray\"><div class=\"tray-label svelte-1ogsh8s\"> </div> <div class=\"tray-items svelte-1ogsh8s\"><!></div></div>"), Va = {
2879
2904
  hash: "svelte-1ogsh8s",
2880
2905
  code: ".venn-tray.svelte-1ogsh8s {border:1.5px dashed #94a3b8;border-radius:12px;padding:14px 16px;background:#f8fafc;min-height:120px;transition:background 120ms ease, border-color 120ms ease;}.venn-tray.drop-target.svelte-1ogsh8s {background:#e0f2fe;border-color:#0ea5e9;}.venn-tray.focused.svelte-1ogsh8s {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.tray-label.svelte-1ogsh8s {font-size:12px;font-weight:600;color:#475569;text-transform:uppercase;letter-spacing:0.05em;margin-bottom:8px;}.tray-items.svelte-1ogsh8s {display:flex;flex-wrap:wrap;gap:10px;}\n @media (prefers-reduced-motion: reduce) {.venn-tray.svelte-1ogsh8s {transition:none;}\n }"
2881
2906
  };
2882
- function Ia(e, t) {
2883
- Xe(t, !0), si(e, Fa);
2907
+ function Ha(e, t) {
2908
+ Xe(t, !0), si(e, Va);
2884
2909
  let n = $(t, "isDropTarget", 7, !1), r = $(t, "focused", 7, !1), i = $(t, "label", 7), a = $(t, "onpointerenter", 7), o = $(t, "onpointerleave", 7), s = $(t, "children", 7);
2885
2910
  var c = {
2886
2911
  get isDropTarget() {
@@ -2919,7 +2944,7 @@ function Ia(e, t) {
2919
2944
  set children(e) {
2920
2945
  s(e), R();
2921
2946
  }
2922
- }, l = Pa();
2947
+ }, l = Ba();
2923
2948
  let u;
2924
2949
  var d = H(l), f = ln(d, !0), p = U(d, 2), m = H(p), h = (e) => {
2925
2950
  var t = Mr();
@@ -2938,7 +2963,7 @@ function Ia(e, t) {
2938
2963
  o()?.apply(this, e);
2939
2964
  }), X(e, l), Ze(c);
2940
2965
  }
2941
- Li(Ia, {
2966
+ Li(Ha, {
2942
2967
  isDropTarget: {},
2943
2968
  focused: {},
2944
2969
  label: {},
@@ -2948,12 +2973,12 @@ Li(Ia, {
2948
2973
  }, [], [], { mode: "open" });
2949
2974
  //#endregion
2950
2975
  //#region src/delivery/TeacherInstructions.svelte
2951
- var La = /* @__PURE__ */ Y("<div class=\"teacher-instructions pie-teacher-instructions svelte-1jhejbv\"><button type=\"button\" class=\"teacher-instructions-toggle pie-teacher-instructions-toggle svelte-1jhejbv\"> </button> <div class=\"teacher-instructions-content pie-teacher-instructions-content svelte-1jhejbv\"></div></div>"), Ra = {
2976
+ var Ua = /* @__PURE__ */ Y("<div class=\"teacher-instructions pie-teacher-instructions svelte-1jhejbv\"><button type=\"button\" class=\"teacher-instructions-toggle pie-teacher-instructions-toggle svelte-1jhejbv\"> </button> <div class=\"teacher-instructions-content pie-teacher-instructions-content svelte-1jhejbv\"></div></div>"), Wa = {
2952
2977
  hash: "svelte-1jhejbv",
2953
2978
  code: ".teacher-instructions.svelte-1jhejbv {margin-bottom:1rem;}.teacher-instructions-toggle.svelte-1jhejbv {padding:0;border:0;border-bottom:1px dotted currentColor;background:transparent;font:inherit;color:var(--pie-primary, #3f51b5);cursor:pointer;}.teacher-instructions-toggle.svelte-1jhejbv:focus-visible {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;}.teacher-instructions-content.svelte-1jhejbv {padding-top:1rem;}"
2954
2979
  };
2955
- function za(e, t) {
2956
- Xe(t, !0), si(e, Ra);
2980
+ function Ga(e, t) {
2981
+ Xe(t, !0), si(e, Wa);
2957
2982
  let n = $(t, "html", 7), r = $(t, "language", 7), i = /* @__PURE__ */ z(!1), a = `venn-teacher-instructions-${Math.random().toString(36).slice(2, 10)}`;
2958
2983
  var o = {
2959
2984
  get html() {
@@ -2968,37 +2993,37 @@ function za(e, t) {
2968
2993
  set language(e) {
2969
2994
  r(e), R();
2970
2995
  }
2971
- }, c = La(), l = H(c), u = ln(l, !0), d = U(l, 2);
2996
+ }, c = Ua(), l = H(c), u = ln(l, !0), d = U(l, 2);
2972
2997
  return oi(d, n, !0), N(d), N(c), W((e) => {
2973
2998
  Q(l, "aria-expanded", J(i)), Q(l, "aria-controls", a), zr(u, e), Q(d, "id", a), Q(d, "hidden", !J(i));
2974
2999
  }, [() => s(J(i) ? "hideTeacherInstructions" : "showTeacherInstructions", r())]), xr("click", l, () => B(i, !J(i))), X(e, c), Ze(o);
2975
3000
  }
2976
- Sr(["click"]), Li(za, {
3001
+ Sr(["click"]), Li(Ga, {
2977
3002
  html: {},
2978
3003
  language: {}
2979
3004
  }, [], [], { mode: "open" });
2980
3005
  //#endregion
2981
3006
  //#region src/delivery/layout.ts
2982
- var Ba = {
3007
+ var Ka = {
2983
3008
  w: 120,
2984
3009
  h: 52
2985
- }, Va = {
3010
+ }, qa = {
2986
3011
  w: 120,
2987
3012
  h: 84
2988
- }, Ha = .6;
2989
- function Ua(e) {
3013
+ }, Ja = .6;
3014
+ function Ya(e) {
2990
3015
  return Math.min(1, 44 / Math.min(e.w, e.h));
2991
3016
  }
2992
- var Wa = {
3017
+ var Xa = {
2993
3018
  side: 24,
2994
3019
  top: 40,
2995
3020
  radius: 236,
2996
3021
  centerDistance: 200,
2997
3022
  outsideGap: 12,
2998
3023
  outsideStripHeight: 136
2999
- }, Ga = .05;
3000
- function Ka(e = 1, t = 0) {
3001
- let n = Wa.side * e, r = Wa.radius * e, i = Wa.centerDistance * e, a = Wa.top * e + r, o = Wa.outsideGap * e, s = Math.max(Wa.outsideStripHeight * e, t);
3024
+ }, Za = .05;
3025
+ function Qa(e = 1, t = 0) {
3026
+ let n = Xa.side * e, r = Xa.radius * e, i = Xa.centerDistance * e, a = Xa.top * e + r, o = Xa.outsideGap * e, s = Math.max(Xa.outsideStripHeight * e, t);
3002
3027
  return {
3003
3028
  width: 2 * n + 2 * r + i,
3004
3029
  height: a + r + o + s,
@@ -3016,37 +3041,37 @@ function Ka(e = 1, t = 0) {
3016
3041
  }]
3017
3042
  };
3018
3043
  }
3019
- function qa() {
3020
- return Ka();
3044
+ function $a() {
3045
+ return Qa();
3021
3046
  }
3022
- function Ja(e, t) {
3023
- return `min(100%, max(min(720px, ${Ha * 100 * e.width / e.height}vh), ${e.width * Ua(t)}px))`;
3047
+ function eo(e, t) {
3048
+ return `min(100%, max(min(720px, ${Ja * 100 * e.width / e.height}vh), ${e.width * Ya(t)}px))`;
3024
3049
  }
3025
- function Ya(e, t, n) {
3026
- return e > 0 ? Math.max(Ua(n), Math.min(1, e / t.width)) : 1;
3050
+ function to(e, t, n) {
3051
+ return e > 0 ? Math.max(Ya(n), Math.min(1, e / t.width)) : 1;
3027
3052
  }
3028
- function Xa(e, t) {
3053
+ function no(e, t) {
3029
3054
  return Math.max(0, Math.floor((e + 8) / (t.w + 8) + 1e-9));
3030
3055
  }
3031
- function Za(e, t) {
3056
+ function ro(e, t) {
3032
3057
  return t > e.r ? -1 : Math.sqrt(e.r * e.r - t * t);
3033
3058
  }
3034
- function Qa(e, t, n) {
3035
- let r = Za(e, Math.max(Math.abs(t - e.cy), Math.abs(n - e.cy)));
3059
+ function io(e, t, n) {
3060
+ let r = ro(e, Math.max(Math.abs(t - e.cy), Math.abs(n - e.cy)));
3036
3061
  return r < 0 ? null : [e.cx - r, e.cx + r];
3037
3062
  }
3038
- function $a(e, t, n) {
3039
- return Za(e, t <= e.cy && e.cy <= n ? 0 : Math.min(Math.abs(t - e.cy), Math.abs(n - e.cy)));
3063
+ function ao(e, t, n) {
3064
+ return ro(e, t <= e.cy && e.cy <= n ? 0 : Math.min(Math.abs(t - e.cy), Math.abs(n - e.cy)));
3040
3065
  }
3041
- function eo(e, t, n, r, i) {
3042
- let a = Qa(t, r, i), o = Qa(n, r, i), s, c;
3066
+ function oo(e, t, n, r, i) {
3067
+ let a = io(t, r, i), o = io(n, r, i), s, c;
3043
3068
  if (e === "0") {
3044
3069
  if (!a) return null;
3045
- let e = $a(n, r, i);
3070
+ let e = ao(n, r, i);
3046
3071
  [s, c] = [a[0], e < 0 ? a[1] : Math.min(a[1], n.cx - e)];
3047
3072
  } else if (e === "1") {
3048
3073
  if (!o) return null;
3049
- let e = $a(t, r, i);
3074
+ let e = ao(t, r, i);
3050
3075
  [s, c] = [e < 0 ? o[0] : Math.max(o[0], t.cx + e), o[1]];
3051
3076
  } else {
3052
3077
  if (!a || !o) return null;
@@ -3054,14 +3079,14 @@ function eo(e, t, n, r, i) {
3054
3079
  }
3055
3080
  return c > s ? [s, c] : null;
3056
3081
  }
3057
- function to(e, t, n, r) {
3082
+ function so(e, t, n, r) {
3058
3083
  let i = r.h + 8, a = t.cy, o = Math.max(t.r, n.r);
3059
3084
  return [0, .5].map((s) => {
3060
3085
  let c = [], l = Math.ceil(o / i) + 1;
3061
3086
  for (let o = -l; o <= l; o++) {
3062
- let l = a + (o + s) * i, u = eo(e, t, n, l - r.h / 2 - 6, l + r.h / 2 + 6);
3087
+ let l = a + (o + s) * i, u = oo(e, t, n, l - r.h / 2 - 6, l + r.h / 2 + 6);
3063
3088
  if (!u) continue;
3064
- let d = u[0] + 6, f = u[1] - 6, p = Xa(f - d, r);
3089
+ let d = u[0] + 6, f = u[1] - 6, p = no(f - d, r);
3065
3090
  p > 0 && c.push({
3066
3091
  y: l,
3067
3092
  lo: d,
@@ -3072,11 +3097,11 @@ function to(e, t, n, r) {
3072
3097
  return c;
3073
3098
  });
3074
3099
  }
3075
- function no(e) {
3100
+ function co(e) {
3076
3101
  return e.reduce((e, t) => e + t.n, 0);
3077
3102
  }
3078
- function ro(e, t, n) {
3079
- let r = e.width - 6, i = Xa(r - 6, n), a = n.h + 8, o = e.height - t, s = i * Math.max(0, Math.floor((o - 12 + 8) / a + 1e-9)), c = {
3103
+ function lo(e, t, n) {
3104
+ let r = e.width - 6, i = no(r - 6, n), a = n.h + 8, o = e.height - t, s = i * Math.max(0, Math.floor((o - 12 + 8) / a + 1e-9)), c = {
3080
3105
  x: e.width / 2,
3081
3106
  y: t + o / 2
3082
3107
  };
@@ -3085,7 +3110,7 @@ function ro(e, t, n) {
3085
3110
  slots: (e) => {
3086
3111
  if (e <= 0) return [];
3087
3112
  let l = Math.min(e, s), u = i > 0 ? Math.ceil(l / i) : 0, d = t + (o - (u * a - 8)) / 2;
3088
- return co(so(Array.from({ length: u }, (e, t) => ({
3113
+ return ho(mo(Array.from({ length: u }, (e, t) => ({
3089
3114
  y: d + n.h / 2 + t * a,
3090
3115
  lo: 6,
3091
3116
  hi: r,
@@ -3094,20 +3119,20 @@ function ro(e, t, n) {
3094
3119
  }
3095
3120
  };
3096
3121
  }
3097
- function io(e) {
3122
+ function uo(e) {
3098
3123
  return {
3099
3124
  x: e.x + e.w / 2,
3100
3125
  y: e.y + e.h / 2
3101
3126
  };
3102
3127
  }
3103
- function ao(e, t, n) {
3128
+ function fo(e, t, n) {
3104
3129
  let r = t * n.w + (t - 1) * 8, i = (e.lo + e.hi) / 2 - r / 2 + n.w / 2;
3105
3130
  return Array.from({ length: t }, (t, r) => ({
3106
3131
  x: i + r * (n.w + 8),
3107
3132
  y: e.y
3108
3133
  }));
3109
3134
  }
3110
- function oo(e, t, n) {
3135
+ function po(e, t, n) {
3111
3136
  let r = [...e].sort((e, n) => Math.abs(e.y - t) - Math.abs(n.y - t) || e.y - n.y), i = [], a = 0;
3112
3137
  for (let e of r) {
3113
3138
  if (a >= n) break;
@@ -3115,39 +3140,39 @@ function oo(e, t, n) {
3115
3140
  }
3116
3141
  return i.sort((e, t) => e.y - t.y);
3117
3142
  }
3118
- function so(e, t, n) {
3143
+ function mo(e, t, n) {
3119
3144
  let r = [], i = t;
3120
3145
  for (let t of e) {
3121
3146
  let e = Math.min(t.n, i);
3122
- r.push(...ao(t, e, n)), i -= e;
3147
+ r.push(...fo(t, e, n)), i -= e;
3123
3148
  }
3124
3149
  return r;
3125
3150
  }
3126
- function co(e, t, n) {
3151
+ function ho(e, t, n) {
3127
3152
  let r = e[e.length - 1] ?? n;
3128
3153
  for (; e.length < t;) e.push({ ...r });
3129
3154
  return e;
3130
3155
  }
3131
- function lo(e, t, n, r) {
3132
- let i = Math.max(...e.map(no));
3156
+ function go(e, t, n, r) {
3157
+ let i = Math.max(...e.map(co));
3133
3158
  return (a) => {
3134
3159
  if (a <= 0) return [];
3135
3160
  let o = Math.min(a, i), s = null, c = [Infinity, Infinity];
3136
3161
  for (let n of e) {
3137
- if (no(n) < o) continue;
3138
- let e = oo(n, t, o), r = Math.abs(e.reduce((e, t) => e + t.y, 0) / e.length - t), i = [e.length, r];
3162
+ if (co(n) < o) continue;
3163
+ let e = po(n, t, o), r = Math.abs(e.reduce((e, t) => e + t.y, 0) / e.length - t), i = [e.length, r];
3139
3164
  (i[0] < c[0] || i[0] === c[0] && i[1] < c[1] - 1e-9) && (s = e, c = i);
3140
3165
  }
3141
- return co(s ? so(s, o, n) : [], a, r);
3166
+ return ho(s ? mo(s, o, n) : [], a, r);
3142
3167
  };
3143
3168
  }
3144
- function uo(e, t, n) {
3169
+ function _o(e, t, n) {
3145
3170
  let r = t.cy, i = 0, a = Math.min(t.r, n.r);
3146
3171
  for (let o = 0; o < 40; o++) {
3147
- let o = (i + a) / 2, s = eo(e, t, n, r - o, r + o);
3172
+ let o = (i + a) / 2, s = oo(e, t, n, r - o, r + o);
3148
3173
  s && s[1] - s[0] >= 2 * o ? i = o : a = o;
3149
3174
  }
3150
- let o = eo(e, t, n, r - i, r + i) ?? [0, 0];
3175
+ let o = oo(e, t, n, r - i, r + i) ?? [0, 0];
3151
3176
  return {
3152
3177
  x: o[0] + 1,
3153
3178
  y: r - i + 1,
@@ -3155,26 +3180,26 @@ function uo(e, t, n) {
3155
3180
  h: 2 * i - 2
3156
3181
  };
3157
3182
  }
3158
- function fo(e, t, n) {
3183
+ function vo(e, t, n) {
3159
3184
  let [r, i] = t.circles;
3160
- return Math.max(...to(e, r, i, n).map(no));
3185
+ return Math.max(...so(e, r, i, n).map(co));
3161
3186
  }
3162
- var po = [
3187
+ var yo = [
3163
3188
  "0",
3164
3189
  "0,1",
3165
3190
  "1"
3166
3191
  ];
3167
- function mo(e, t = Ba) {
3168
- let n = Ka();
3192
+ function bo(e, t = Ka) {
3193
+ let n = Qa();
3169
3194
  for (let r = 1;; r++) {
3170
3195
  let i = n;
3171
- if (po.every((n) => fo(n, i, t) >= (e[n] ?? 0))) break;
3172
- n = Ka(1 + r * Ga);
3196
+ if (yo.every((n) => vo(n, i, t) >= (e[n] ?? 0))) break;
3197
+ n = Qa(1 + r * Za);
3173
3198
  }
3174
- let r = e[""] ?? 0, i = Xa(n.width - 12, t), a = Math.ceil(r / i) * (t.h + 8) - 8 + 12;
3175
- return a > n.outsideStripHeight ? Ka(n.scale, a) : n;
3199
+ let r = e[""] ?? 0, i = no(n.width - 12, t), a = Math.ceil(r / i) * (t.h + 8) - 8 + 12;
3200
+ return a > n.outsideStripHeight ? Qa(n.scale, a) : n;
3176
3201
  }
3177
- function ho(e, t = qa(), n = Ba) {
3202
+ function xo(e, t = $a(), n = Ka) {
3178
3203
  if (e.circles?.length !== 2) throw Error(`buildLayout2Set requires exactly 2 circles (got ${e.circles?.length ?? 0})`);
3179
3204
  let [a, s] = t.circles, c = i(2), l = Math.max(a.cy + a.r, s.cy + s.r), u = Math.min(t.height - t.outsideStripHeight, l + t.outsideGap), d = (e, t, n) => (r, i) => {
3180
3205
  let a = r - e, o = i - t;
@@ -3190,11 +3215,11 @@ function ho(e, t = qa(), n = Ba) {
3190
3215
  y: u,
3191
3216
  w: t.width,
3192
3217
  h: t.height - u
3193
- }, {capacity: g, slots: _} = ro(t, u, n);
3218
+ }, {capacity: g, slots: _} = lo(t, u, n);
3194
3219
  else if (c === "0" || c === "1" || c === "0,1") {
3195
- d = c === "0" ? (e, t) => f(e, t) && !p(e, t) : c === "1" ? (e, t) => p(e, t) && !f(e, t) : (e, t) => f(e, t) && p(e, t), h = uo(c, a, s);
3196
- let e = to(c, a, s, n);
3197
- g = Math.max(...e.map(no)), _ = lo(e, a.cy, n, io(h));
3220
+ d = c === "0" ? (e, t) => f(e, t) && !p(e, t) : c === "1" ? (e, t) => p(e, t) && !f(e, t) : (e, t) => f(e, t) && p(e, t), h = _o(c, a, s);
3221
+ let e = so(c, a, s, n);
3222
+ g = Math.max(...e.map(co)), _ = go(e, a.cy, n, uo(h));
3198
3223
  } else d = () => !1, h = {
3199
3224
  x: 0,
3200
3225
  y: 0,
@@ -3216,7 +3241,7 @@ function ho(e, t = qa(), n = Ba) {
3216
3241
  outsideStripTop: u
3217
3242
  };
3218
3243
  }
3219
- function go(e, t, n) {
3244
+ function So(e, t, n) {
3220
3245
  for (let r of [
3221
3246
  "0,1",
3222
3247
  "0",
@@ -3230,7 +3255,7 @@ function go(e, t, n) {
3230
3255
  }
3231
3256
  //#endregion
3232
3257
  //#region src/delivery/dnd.ts
3233
- function _o({ model: t, session: r, tileId: i, placement: o }) {
3258
+ function Co({ model: t, session: r, tileId: i, placement: o }) {
3234
3259
  let s = a(r, t), c = {
3235
3260
  ...s,
3236
3261
  placements: {
@@ -3240,19 +3265,19 @@ function _o({ model: t, session: r, tileId: i, placement: o }) {
3240
3265
  };
3241
3266
  return c.completed = n(t, c), c;
3242
3267
  }
3243
- function vo(t, n) {
3268
+ function wo(t, n) {
3244
3269
  let r = t?.placements?.[n];
3245
3270
  return Array.isArray(r) ? e(r) : null;
3246
3271
  }
3247
- function yo(e, t, n) {
3248
- let r = vo(e, t);
3272
+ function To(e, t, n) {
3273
+ let r = wo(e, t);
3249
3274
  return r === null || n === null ? r === n : c(r, n);
3250
3275
  }
3251
- function bo(e, t) {
3276
+ function Eo(e, t) {
3252
3277
  let n = t?.placements ?? {};
3253
3278
  return (e.tiles || []).filter((e) => n[e.id] == null);
3254
3279
  }
3255
- function xo(t, n) {
3280
+ function Do(t, n) {
3256
3281
  let r = n?.placements ?? {}, i = {};
3257
3282
  for (let n of t.tiles || []) {
3258
3283
  let t = r[n.id];
@@ -3264,12 +3289,12 @@ function xo(t, n) {
3264
3289
  }
3265
3290
  //#endregion
3266
3291
  //#region src/delivery/VennClassification.svelte
3267
- var So = /* @__PURE__ */ Y("<div class=\"venn-prompt svelte-gkcqor\"></div>"), Co = /* @__PURE__ */ jr("<svg class=\"toggle-icon svelte-gkcqor\" preserveAspectRatio=\"xMinYMin meet\" version=\"1.1\" viewBox=\"-283 359 34 35\" aria-hidden=\"true\"><circle cx=\"-266\" cy=\"375.9\" r=\"14\" fill=\"#bce2ff\"></circle><path d=\"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\" fill=\"#bce2ff\"></path><polygon points=\"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\" fill=\"#1a9cff\"></polygon></svg>"), wo = /* @__PURE__ */ jr("<svg class=\"toggle-icon svelte-gkcqor\" preserveAspectRatio=\"xMinYMin meet\" version=\"1.1\" viewBox=\"-129.5 127 34 35\" aria-hidden=\"true\"><path style=\"fill: #D0CAC5; stroke: #E6E3E0; stroke-width: 0.75; stroke-miterlimit: 10;\" d=\"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z\"></path><path style=\"fill: #B3ABA4; stroke: #CDC7C2; stroke-width: 0.5; stroke-miterlimit: 10;\" d=\"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"></path><circle cx=\"-114.2\" cy=\"143.5\" r=\"14\" fill=\"white\"></circle><path d=\"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\" fill=\"#bce2ff\"></path><polygon points=\"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\" fill=\"#1a9cff\"></polygon></svg>"), To = /* @__PURE__ */ Y("<button type=\"button\" class=\"toggle-correct svelte-gkcqor\"><!> <span class=\"toggle-label svelte-gkcqor\"> </span></button>"), Eo = /* @__PURE__ */ Y("<div class=\"venn-error svelte-gkcqor\" role=\"alert\"> </div>"), Do = /* @__PURE__ */ jr("<circle fill=\"rgba(14, 165, 233, 0.12)\"></circle>"), Oo = /* @__PURE__ */ jr("<rect x=\"0\" y=\"0\"></rect>"), ko = /* @__PURE__ */ jr("<circle></circle>"), Ao = /* @__PURE__ */ jr("<circle fill=\"none\" stroke=\"#1e293b\"></circle>"), jo = /* @__PURE__ */ jr("<text font-weight=\"600\" fill=\"#0f172a\"> </text>"), Mo = /* @__PURE__ */ Y("<div class=\"region-aria svelte-gkcqor\" role=\"region\"></div>"), No = /* @__PURE__ */ Y("<div class=\"tile-wrapper svelte-gkcqor\"><!></div>"), Po = /* @__PURE__ */ Y("<div class=\"venn-diagram svelte-gkcqor\"><svg preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\" class=\"svelte-gkcqor\"><defs><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"black\"></rect><circle fill=\"white\"></circle><circle fill=\"black\"></circle></mask><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"black\"></rect><circle fill=\"white\"></circle><circle fill=\"black\"></circle></mask><clipPath clipPathUnits=\"userSpaceOnUse\"><circle></circle></clipPath><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"white\"></rect><circle fill=\"black\"></circle><circle fill=\"black\"></circle></mask></defs><rect fill=\"#ffffff\" stroke=\"#cbd5e1\"></rect><!><!><!><!><!><!><!><line stroke=\"#cbd5e1\"></line></svg> <div class=\"region-labels svelte-gkcqor\" aria-hidden=\"false\"></div> <div class=\"placed-tiles svelte-gkcqor\"></div></div> <!>", 1), Fo = /* @__PURE__ */ Y("<div class=\"drag-ghost svelte-gkcqor\"><!></div>"), Io = /* @__PURE__ */ Y("<div class=\"venn-root svelte-gkcqor\"><!> <!> <!> <!> <!> <div class=\"sr-only svelte-gkcqor\" aria-live=\"polite\" aria-atomic=\"true\"></div></div>"), Lo = {
3292
+ var Oo = /* @__PURE__ */ Y("<div class=\"venn-prompt svelte-gkcqor\"></div>"), ko = /* @__PURE__ */ jr("<svg class=\"toggle-icon svelte-gkcqor\" preserveAspectRatio=\"xMinYMin meet\" version=\"1.1\" viewBox=\"-283 359 34 35\" aria-hidden=\"true\"><circle cx=\"-266\" cy=\"375.9\" r=\"14\" fill=\"#bce2ff\"></circle><path d=\"M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z\" fill=\"#bce2ff\"></path><polygon points=\"-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6\" fill=\"#1a9cff\"></polygon></svg>"), Ao = /* @__PURE__ */ jr("<svg class=\"toggle-icon svelte-gkcqor\" preserveAspectRatio=\"xMinYMin meet\" version=\"1.1\" viewBox=\"-129.5 127 34 35\" aria-hidden=\"true\"><path style=\"fill: #D0CAC5; stroke: #E6E3E0; stroke-width: 0.75; stroke-miterlimit: 10;\" d=\"M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z\"></path><path style=\"fill: #B3ABA4; stroke: #CDC7C2; stroke-width: 0.5; stroke-miterlimit: 10;\" d=\"M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z\"></path><circle cx=\"-114.2\" cy=\"143.5\" r=\"14\" fill=\"white\"></circle><path d=\"M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z\" fill=\"#bce2ff\"></path><polygon points=\"-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2\" fill=\"#1a9cff\"></polygon></svg>"), jo = /* @__PURE__ */ Y("<button type=\"button\" class=\"toggle-correct svelte-gkcqor\"><!> <span class=\"toggle-label svelte-gkcqor\"> </span></button>"), Mo = /* @__PURE__ */ Y("<div class=\"venn-error svelte-gkcqor\" role=\"alert\"> </div>"), No = /* @__PURE__ */ jr("<circle fill=\"rgba(14, 165, 233, 0.12)\"></circle>"), Po = /* @__PURE__ */ jr("<rect x=\"0\" y=\"0\"></rect>"), Fo = /* @__PURE__ */ jr("<circle></circle>"), Io = /* @__PURE__ */ jr("<circle fill=\"none\" stroke=\"#1e293b\"></circle>"), Lo = /* @__PURE__ */ jr("<text font-weight=\"600\" fill=\"#0f172a\"> </text>"), Ro = /* @__PURE__ */ Y("<div class=\"region-aria svelte-gkcqor\" role=\"region\"></div>"), zo = /* @__PURE__ */ Y("<div class=\"tile-wrapper svelte-gkcqor\"><!></div>"), Bo = /* @__PURE__ */ Y("<div class=\"venn-diagram svelte-gkcqor\"><svg preserveAspectRatio=\"xMidYMid meet\" aria-hidden=\"true\" class=\"svelte-gkcqor\"><defs><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"black\"></rect><circle fill=\"white\"></circle><circle fill=\"black\"></circle></mask><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"black\"></rect><circle fill=\"white\"></circle><circle fill=\"black\"></circle></mask><clipPath clipPathUnits=\"userSpaceOnUse\"><circle></circle></clipPath><mask maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\"><rect x=\"0\" y=\"0\" fill=\"white\"></rect><circle fill=\"black\"></circle><circle fill=\"black\"></circle></mask></defs><rect fill=\"#ffffff\" stroke=\"#cbd5e1\"></rect><!><!><!><!><!><!><!><line stroke=\"#cbd5e1\"></line></svg> <div class=\"region-labels svelte-gkcqor\" aria-hidden=\"false\"></div> <div class=\"placed-tiles svelte-gkcqor\"></div></div> <!>", 1), Vo = /* @__PURE__ */ Y("<div class=\"drag-ghost svelte-gkcqor\"><!></div>"), Ho = /* @__PURE__ */ Y("<div class=\"venn-root svelte-gkcqor\"><!> <!> <!> <!> <!> <div class=\"sr-only svelte-gkcqor\" aria-live=\"polite\" aria-atomic=\"true\"></div></div>"), Uo = {
3268
3293
  hash: "svelte-gkcqor",
3269
3294
  code: ".venn-root.svelte-gkcqor {display:flex;flex-direction:column;gap:16px;padding:16px;color:#0f172a;font-family:system-ui, -apple-system, Segoe UI, Roboto, sans-serif;--vc-focus-ring: var(\n --pie-focus-outline,\n var(--pie-button-focus-outline, var(--pie-focus-checked-border, #1565c0))\n );}.venn-prompt.svelte-gkcqor {font-size:16px;line-height:1.5;}.venn-prompt.svelte-gkcqor p {margin:0 0 8px 0;}.toggle-correct.svelte-gkcqor {align-self:center;display:inline-flex;align-items:center;gap:8px;margin:0 0 4px 0;padding:0;background:transparent;border:0;color:inherit;font:inherit;font-size:14px;cursor:pointer;user-select:none;}.toggle-correct.svelte-gkcqor:focus-visible {outline:2px solid var(--vc-focus-ring, #1565c0);outline-offset:2px;border-radius:2px;}.toggle-icon.svelte-gkcqor {width:25px;height:25px;flex-shrink:0;}.toggle-label.svelte-gkcqor {line-height:1.2;}.toggle-correct.svelte-gkcqor:hover .toggle-label:where(.svelte-gkcqor),\n .toggle-correct.svelte-gkcqor:focus-visible .toggle-label:where(.svelte-gkcqor) {text-decoration:underline;}.venn-diagram.svelte-gkcqor {\n /*\n * Width and aspect ratio come from the geometry, inline. The width cap\n * keeps the diagram from dominating wide layouts, and the viewport-height\n * share keeps the prompt, toggle and tray in view in short windows, down\n * to the width that keeps tiles at 44 px (`diagramCssWidth`).\n */position:relative;margin:0 auto;}.venn-diagram.svelte-gkcqor svg:where(.svelte-gkcqor) {width:100%;height:100%;display:block;}.placed-tiles.svelte-gkcqor,\n .region-labels.svelte-gkcqor {position:absolute;inset:0;pointer-events:none;}.tile-wrapper.svelte-gkcqor {position:absolute;display:flex;pointer-events:auto;}.region-aria.svelte-gkcqor {position:absolute;width:1px;height:1px;transform:translate(-50%, -50%);opacity:0;pointer-events:none;}.venn-error.svelte-gkcqor {padding:12px 16px;border:1.5px solid #bf0d00;border-radius:8px;background:#fef2f2;color:#7f1d1d;font-size:14px;}\n /* Tailwind's `sr-only`, scoped: PIE players ship no Tailwind. */.sr-only.svelte-gkcqor {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;}.drag-ghost.svelte-gkcqor {position:fixed;top:0;left:0;transform:translate(-50%, -50%);pointer-events:none;z-index:1000;}"
3270
3295
  };
3271
- function Ro(e, n) {
3272
- Xe(n, !0), si(e, Lo);
3296
+ function Wo(e, n) {
3297
+ Xe(n, !0), si(e, Uo);
3273
3298
  let r = [{ label: "Set A" }, { label: "Set B" }], i = `venn-${Math.random().toString(36).slice(2, 10)}`, a = `${i}-mask-left-only`, c = `${i}-mask-right-only`, l = `${i}-mask-outside`, u = `${i}-clip-left`, d = null, f = /* @__PURE__ */ z(null), p = null, m = /* @__PURE__ */ z(!1), h = /* @__PURE__ */ z(null), g = /* @__PURE__ */ z(null), _ = /* @__PURE__ */ z(null), v = /* @__PURE__ */ z(null), y = /* @__PURE__ */ z(0), b = null, x = null, S = /* @__PURE__ */ I(() => n?.model?.circles ?? r), ee = /* @__PURE__ */ I(() => J(S).length === 2), C = /* @__PURE__ */ I(() => n?.model?.language), w = /* @__PURE__ */ I(() => ({
3274
3299
  circles: J(S),
3275
3300
  tiles: n?.model?.tiles ?? [],
@@ -3277,7 +3302,7 @@ function Ro(e, n) {
3277
3302
  language: J(C),
3278
3303
  scoringPolicy: "partialPerTile",
3279
3304
  promptEnabled: !0
3280
- })), te = /* @__PURE__ */ I(() => n?.model?.env?.mode === "evaluate"), ne = /* @__PURE__ */ I(() => n?.model?.disabled === !0), re = /* @__PURE__ */ I(() => n?.model?.prompt ?? null), T = /* @__PURE__ */ I(() => de(n?.session, n?.model, J(m))), E = /* @__PURE__ */ I(() => ({ placements: J(T) })), ae = /* @__PURE__ */ I(() => xo(J(w), J(E))), oe = /* @__PURE__ */ I(() => bo(J(w), J(E))), se = /* @__PURE__ */ I(() => (J(w).tiles ?? []).some((e) => (e.imageUrl ?? "").trim()) ? Va : Ba), D = /* @__PURE__ */ I(() => mo(Object.fromEntries(Object.entries(J(ae)).map(([e, t]) => [e, t.length])), J(se))), ce = /* @__PURE__ */ I(() => J(ee) ? ho(J(w), J(D), J(se)) : null), le = /* @__PURE__ */ I(() => Ya(J(y), J(D), J(se))), O = /* @__PURE__ */ I(() => [
3305
+ })), te = /* @__PURE__ */ I(() => n?.model?.env?.mode === "evaluate"), ne = /* @__PURE__ */ I(() => n?.model?.disabled === !0), re = /* @__PURE__ */ I(() => n?.model?.prompt ?? null), T = /* @__PURE__ */ I(() => de(n?.session, n?.model, J(m))), E = /* @__PURE__ */ I(() => ({ placements: J(T) })), ae = /* @__PURE__ */ I(() => Do(J(w), J(E))), oe = /* @__PURE__ */ I(() => Eo(J(w), J(E))), se = /* @__PURE__ */ I(() => (J(w).tiles ?? []).some((e) => (e.imageUrl ?? "").trim()) ? qa : Ka), D = /* @__PURE__ */ I(() => bo(Object.fromEntries(Object.entries(J(ae)).map(([e, t]) => [e, t.length])), J(se))), ce = /* @__PURE__ */ I(() => J(ee) ? xo(J(w), J(D), J(se)) : null), le = /* @__PURE__ */ I(() => to(J(y), J(D), J(se))), O = /* @__PURE__ */ I(() => [
3281
3306
  "0",
3282
3307
  "0,1",
3283
3308
  "1",
@@ -3321,7 +3346,7 @@ function Ro(e, n) {
3321
3346
  };
3322
3347
  }
3323
3348
  function me(e, t) {
3324
- let r = _o({
3349
+ let r = Co({
3325
3350
  model: J(w),
3326
3351
  session: n?.session,
3327
3352
  tileId: e,
@@ -3345,8 +3370,8 @@ function Ro(e, n) {
3345
3370
  b?.(), J(h) !== null && ve();
3346
3371
  }
3347
3372
  function be(e, r) {
3348
- let i = Ta(e, J(C)), a = r === "tray" ? null : r === null ? void 0 : ge(r)?.region;
3349
- if (a === void 0 || yo(n?.session, e.id, a)) {
3373
+ let i = ja(e, J(C)), a = r === "tray" ? null : r === null ? void 0 : ge(r)?.region;
3374
+ if (a === void 0 || To(n?.session, e.id, a)) {
3350
3375
  k(t("cancelled", J(C)));
3351
3376
  return;
3352
3377
  }
@@ -3360,7 +3385,7 @@ function Ro(e, n) {
3360
3385
  n.preventDefault(), b?.(), n.currentTarget.setPointerCapture?.(n.pointerId), B(h, e.id, !0), B(_, null), B(v, {
3361
3386
  x: n.clientX,
3362
3387
  y: n.clientY
3363
- }, !0), B(g, Se(n.clientX, n.clientY), !0), k(t("pickedUp", J(C), { name: Ta(e, J(C)) }));
3388
+ }, !0), B(g, Se(n.clientX, n.clientY), !0), k(t("pickedUp", J(C), { name: ja(e, J(C)) }));
3364
3389
  let r = (e) => {
3365
3390
  B(v, {
3366
3391
  x: e.clientX,
@@ -3381,7 +3406,7 @@ function Ro(e, n) {
3381
3406
  if (Ce(e, t)) return "tray";
3382
3407
  let n = pe(e, t);
3383
3408
  if (!n || !J(ce)) return null;
3384
- let r = go(J(ce), n.x, n.y);
3409
+ let r = So(J(ce), n.x, n.y);
3385
3410
  return r ? r.key : null;
3386
3411
  }
3387
3412
  function Ce(e, t) {
@@ -3403,9 +3428,9 @@ function Ro(e, n) {
3403
3428
  let t = J(_);
3404
3429
  ve(), be(e, t), we(e.id);
3405
3430
  } else {
3406
- let n = vo(J(E), e.id), r = n === null ? J(O)[0] ?? null : o(n);
3431
+ let n = wo(J(E), e.id), r = n === null ? J(O)[0] ?? null : o(n);
3407
3432
  B(h, e.id, !0), B(_, r, !0), k(t("pickedUpWithKeyboard", J(C), {
3408
- name: Ta(e, J(C)),
3433
+ name: ja(e, J(C)),
3409
3434
  target: _e(r ?? "")
3410
3435
  }));
3411
3436
  }
@@ -3457,7 +3482,7 @@ function Ro(e, n) {
3457
3482
  if (!d) return;
3458
3483
  let e = (e) => console.warn("venn-classification: MathJax render failed", e);
3459
3484
  try {
3460
- Promise.resolve(Ca(d)).catch(e);
3485
+ Promise.resolve(ka(d)).catch(e);
3461
3486
  } catch (t) {
3462
3487
  e(t);
3463
3488
  }
@@ -3468,8 +3493,8 @@ function Ro(e, n) {
3468
3493
  J(T), J(w).tiles?.length, fr().then(M);
3469
3494
  });
3470
3495
  let ke = /* @__PURE__ */ I(() => J(te) ? Object.values(n?.model?.correctness ?? {}).filter((e) => e === "incorrect" || e === "unanswered").length : 0), Ae = /* @__PURE__ */ I(() => J(h) === null ? J(g) ?? null : J(g) ?? J(_) ?? null), je = /* @__PURE__ */ I(() => J(Ae) === "0"), Me = /* @__PURE__ */ I(() => J(Ae) === "1"), Ne = /* @__PURE__ */ I(() => J(Ae) === "0,1"), Pe = /* @__PURE__ */ I(() => J(Ae) === ""), Fe = "rgba(37, 99, 235, 0.18)", Ie = /* @__PURE__ */ I(() => J(h) !== null && J(v) !== null ? he(J(h)) : null);
3471
- var Le = Io(), Re = H(Le), ze = (e) => {
3472
- za(e, {
3496
+ var Le = Ho(), Re = H(Le), ze = (e) => {
3497
+ Ga(e, {
3473
3498
  get html() {
3474
3499
  return n.model.teacherInstructions;
3475
3500
  },
@@ -3482,17 +3507,17 @@ function Ro(e, n) {
3482
3507
  n?.model?.teacherInstructions && e(ze);
3483
3508
  });
3484
3509
  var Be = U(Re, 2), Ve = (e) => {
3485
- var t = So();
3510
+ var t = Oo();
3486
3511
  oi(t, () => J(re), !0), N(t), X(e, t);
3487
3512
  };
3488
3513
  Z(Be, (e) => {
3489
3514
  J(re) && e(Ve);
3490
3515
  });
3491
3516
  var He = U(Be, 2), Ue = (e) => {
3492
- var t = To(), n = H(t), r = (e) => {
3493
- X(e, Co());
3517
+ var t = jo(), n = H(t), r = (e) => {
3518
+ X(e, ko());
3494
3519
  }, i = (e) => {
3495
- X(e, wo());
3520
+ X(e, Ao());
3496
3521
  };
3497
3522
  Z(n, (e) => {
3498
3523
  J(m) ? e(r) : e(i, -1);
@@ -3506,13 +3531,13 @@ function Ro(e, n) {
3506
3531
  J(te) && J(ke) > 0 && e(Ue);
3507
3532
  });
3508
3533
  var We = U(He, 2), Ge = (e) => {
3509
- var n = Eo(), r = ln(n, !0);
3534
+ var n = Mo(), r = ln(n, !0);
3510
3535
  W((e) => zr(r, e), [() => t("unsupportedCircles", J(C), {
3511
3536
  count: J(S).length,
3512
3537
  supported: 2
3513
3538
  })]), X(e, n);
3514
3539
  }, Ke = (e) => {
3515
- var n = Po(), r = cn(n);
3540
+ var n = Bo(), r = cn(n);
3516
3541
  let i;
3517
3542
  var o = H(r), s = H(o), d = H(s), p = H(d), m = U(p), b = U(m);
3518
3543
  N(d);
@@ -3522,13 +3547,13 @@ function Ro(e, n) {
3522
3547
  N(E), N(s);
3523
3548
  var k = U(s), pe = U(k);
3524
3549
  ei(pe, 17, () => J(D).circles, Xr, (e, t) => {
3525
- var n = Do();
3550
+ var n = No();
3526
3551
  W(() => {
3527
3552
  Q(n, "cx", J(t).cx), Q(n, "cy", J(t).cy), Q(n, "r", J(t).r);
3528
3553
  }), X(e, n);
3529
3554
  });
3530
3555
  var me = U(pe), he = (e) => {
3531
- var t = Oo();
3556
+ var t = Po();
3532
3557
  Q(t, "fill", Fe), W(() => {
3533
3558
  Q(t, "width", J(D).width), Q(t, "height", J(D).height), Q(t, "mask", `url(#${a})`);
3534
3559
  }), X(e, t);
@@ -3537,7 +3562,7 @@ function Ro(e, n) {
3537
3562
  J(je) && e(he);
3538
3563
  });
3539
3564
  var ge = U(me), _e = (e) => {
3540
- var t = Oo();
3565
+ var t = Po();
3541
3566
  Q(t, "fill", Fe), W(() => {
3542
3567
  Q(t, "width", J(D).width), Q(t, "height", J(D).height), Q(t, "mask", `url(#${c})`);
3543
3568
  }), X(e, t);
@@ -3546,7 +3571,7 @@ function Ro(e, n) {
3546
3571
  J(Me) && e(_e);
3547
3572
  });
3548
3573
  var ve = U(ge), ye = (e) => {
3549
- var t = ko();
3574
+ var t = Fo();
3550
3575
  Q(t, "fill", Fe), W(() => {
3551
3576
  Q(t, "cx", J(D).circles[1].cx), Q(t, "cy", J(D).circles[1].cy), Q(t, "r", J(D).circles[1].r), Q(t, "clip-path", `url(#${u})`);
3552
3577
  }), X(e, t);
@@ -3555,7 +3580,7 @@ function Ro(e, n) {
3555
3580
  J(Ne) && e(ye);
3556
3581
  });
3557
3582
  var be = U(ve), Se = (e) => {
3558
- var t = Oo();
3583
+ var t = Po();
3559
3584
  Q(t, "fill", Fe), W(() => {
3560
3585
  Q(t, "width", J(D).width), Q(t, "height", J(D).height), Q(t, "mask", `url(#${l})`);
3561
3586
  }), X(e, t);
@@ -3565,14 +3590,14 @@ function Ro(e, n) {
3565
3590
  });
3566
3591
  var Ce = U(be);
3567
3592
  ei(Ce, 17, () => J(D).circles, Xr, (e, t) => {
3568
- var n = Ao();
3593
+ var n = Io();
3569
3594
  W(() => {
3570
3595
  Q(n, "cx", J(t).cx), Q(n, "cy", J(t).cy), Q(n, "r", J(t).r), Q(n, "stroke-width", 2 * J(D).scale);
3571
3596
  }), X(e, n);
3572
3597
  });
3573
3598
  var we = U(Ce);
3574
3599
  ei(we, 17, () => J(D).circles, Xr, (e, t, n) => {
3575
- var r = jo();
3600
+ var r = Lo();
3576
3601
  Q(r, "text-anchor", n === 0 ? "start" : "end");
3577
3602
  var i = ln(r, !0);
3578
3603
  W((e, t) => {
@@ -3584,7 +3609,7 @@ function Ro(e, n) {
3584
3609
  var Oe = U(o, 2);
3585
3610
  ei(Oe, 21, () => J(ce).regions, Xr, (e, t) => {
3586
3611
  let n = /* @__PURE__ */ I(() => fe(J(t).hitRect.x + J(t).hitRect.w / 2, J(t).hitRect.y + J(t).hitRect.h / 2));
3587
- var r = Mo();
3612
+ var r = Ro();
3588
3613
  W(() => {
3589
3614
  Q(r, "aria-label", J(t).label), Q(r, "data-region-key", J(t).key), hi(r, `left: ${J(n).left ?? ""}%; top: ${J(n).top ?? ""}%;`);
3590
3615
  }), X(e, r);
@@ -3598,10 +3623,10 @@ function Ro(e, n) {
3598
3623
  var n = Mr();
3599
3624
  ei(cn(n), 19, i, (e) => e.id, (e, n, r) => {
3600
3625
  let i = /* @__PURE__ */ I(() => fe(J(t)[J(r)].x, J(t)[J(r)].y));
3601
- var o = No(), s = H(o);
3626
+ var o = zo(), s = H(o);
3602
3627
  {
3603
- let e = /* @__PURE__ */ I(() => Ea(J(n), J(a).label, j(J(n).id), J(C))), t = /* @__PURE__ */ I(() => j(J(n).id) ?? "neutral"), r = /* @__PURE__ */ I(() => J(h) === J(n).id), i = /* @__PURE__ */ I(() => J(h) === J(n).id && J(v) !== null);
3604
- Na(s, {
3628
+ let e = /* @__PURE__ */ I(() => Ma(J(n), J(a).label, j(J(n).id), J(C))), t = /* @__PURE__ */ I(() => j(J(n).id) ?? "neutral"), r = /* @__PURE__ */ I(() => J(h) === J(n).id), i = /* @__PURE__ */ I(() => J(h) === J(n).id && J(v) !== null);
3629
+ za(s, {
3605
3630
  fit: !0,
3606
3631
  get id() {
3607
3632
  return J(n).id;
@@ -3646,7 +3671,7 @@ function Ro(e, n) {
3646
3671
  var ke = U(r, 2);
3647
3672
  {
3648
3673
  let e = /* @__PURE__ */ I(() => J(g) === "tray" || J(h) !== null && J(_) === "tray"), n = /* @__PURE__ */ I(() => t("tray", J(C)));
3649
- Ia(ke, {
3674
+ Ha(ke, {
3650
3675
  get isDropTarget() {
3651
3676
  return J(e);
3652
3677
  },
@@ -3657,8 +3682,8 @@ function Ro(e, n) {
3657
3682
  var n = Mr();
3658
3683
  ei(cn(n), 17, () => J(oe), (e) => e.id, (e, t) => {
3659
3684
  {
3660
- let n = /* @__PURE__ */ I(() => Ea(J(t), null, j(J(t).id), J(C))), r = /* @__PURE__ */ I(() => j(J(t).id) ?? "neutral"), i = /* @__PURE__ */ I(() => J(h) === J(t).id), a = /* @__PURE__ */ I(() => J(h) === J(t).id && J(v) !== null);
3661
- Na(e, {
3685
+ let n = /* @__PURE__ */ I(() => Ma(J(t), null, j(J(t).id), J(C))), r = /* @__PURE__ */ I(() => j(J(t).id) ?? "neutral"), i = /* @__PURE__ */ I(() => J(h) === J(t).id), a = /* @__PURE__ */ I(() => J(h) === J(t).id && J(v) !== null);
3686
+ za(e, {
3662
3687
  get id() {
3663
3688
  return J(t).id;
3664
3689
  },
@@ -3702,14 +3727,14 @@ function Ro(e, n) {
3702
3727
  width: e,
3703
3728
  "aspect-ratio": `${J(D).width ?? ""} / ${J(D).height ?? ""}`
3704
3729
  }), Q(o, "viewBox", `0 0 ${J(D).width ?? ""} ${J(D).height ?? ""}`), Q(d, "id", a), Q(d, "width", J(D).width), Q(d, "height", J(D).height), Q(p, "width", J(D).width), Q(p, "height", J(D).height), Q(m, "cx", J(D).circles[0].cx), Q(m, "cy", J(D).circles[0].cy), Q(m, "r", J(D).circles[0].r), Q(b, "cx", J(D).circles[1].cx), Q(b, "cy", J(D).circles[1].cy), Q(b, "r", J(D).circles[1].r), Q(x, "id", c), Q(x, "width", J(D).width), Q(x, "height", J(D).height), Q(S, "width", J(D).width), Q(S, "height", J(D).height), Q(ee, "cx", J(D).circles[1].cx), Q(ee, "cy", J(D).circles[1].cy), Q(ee, "r", J(D).circles[1].r), Q(te, "cx", J(D).circles[0].cx), Q(te, "cy", J(D).circles[0].cy), Q(te, "r", J(D).circles[0].r), Q(re, "id", u), Q(T, "cx", J(D).circles[0].cx), Q(T, "cy", J(D).circles[0].cy), Q(T, "r", J(D).circles[0].r), Q(E, "id", l), Q(E, "width", J(D).width), Q(E, "height", J(D).height), Q(O, "width", J(D).width), Q(O, "height", J(D).height), Q(ue, "cx", J(D).circles[0].cx), Q(ue, "cy", J(D).circles[0].cy), Q(ue, "r", J(D).circles[0].r), Q(de, "cx", J(D).circles[1].cx), Q(de, "cy", J(D).circles[1].cy), Q(de, "r", J(D).circles[1].r), Q(k, "x", J(D).scale), Q(k, "y", J(D).scale), Q(k, "width", J(D).width - 2 * J(D).scale), Q(k, "height", J(D).height - 2 * J(D).scale), Q(k, "stroke-width", 1.5 * J(D).scale), Q(k, "rx", 12 * J(D).scale), Q(Te, "x1", 16 * J(D).scale), Q(Te, "x2", J(D).width - 16 * J(D).scale), Q(Te, "y1", J(ce).outsideStripTop), Q(Te, "y2", J(ce).outsideStripTop), Q(Te, "stroke-width", J(D).scale), Q(Te, "stroke-dasharray", `${4 * J(D).scale} ${6 * J(D).scale}`);
3705
- }, [() => Ja(J(D), J(se))]), Di(r, "clientWidth", (e) => B(y, e)), X(e, n);
3730
+ }, [() => eo(J(D), J(se))]), Di(r, "clientWidth", (e) => B(y, e)), X(e, n);
3706
3731
  };
3707
3732
  Z(We, (e) => {
3708
3733
  J(ce) ? e(Ke, -1) : e(Ge);
3709
3734
  });
3710
3735
  var qe = U(We, 2), Je = (e) => {
3711
- var t = Fo();
3712
- Na(H(t), {
3736
+ var t = Vo();
3737
+ za(H(t), {
3713
3738
  get id() {
3714
3739
  return J(Ie).id;
3715
3740
  },
@@ -3733,12 +3758,12 @@ function Ro(e, n) {
3733
3758
  J(Ie) && J(v) && e(Je);
3734
3759
  }), ki(U(qe, 2), (e) => p = e, () => p), N(Le), ki(Le, (e) => d = e, () => d), xr("focusout", Le, Oe), X(e, Le), Ze();
3735
3760
  }
3736
- Sr(["focusout", "click"]), Li(Ro, {
3761
+ Sr(["focusout", "click"]), Li(Wo, {
3737
3762
  model: { type: "Object" },
3738
3763
  session: { type: "Object" },
3739
3764
  onSessionChange: {}
3740
3765
  }, [], []);
3741
3766
  //#endregion
3742
- export { H as A, Xe as B, Mr as C, J as D, xr as E, B as F, N as H, z as I, R as L, ln as M, U as N, W as O, $t as P, I as R, X as S, Sr as T, ie as U, Ae as V, Z as _, ki as a, qr as b, Q as c, hi as d, pi as f, Xr as g, ei as h, $ as i, cn as j, xn as k, Si as l, oi as m, wa as n, Di as o, si as p, Li as r, bi as s, Ro as t, xi as u, Yr as v, Y as w, zr as x, Jr as y, Ze as z };
3767
+ export { H as A, Xe as B, Mr as C, J as D, xr as E, B as F, N as H, z as I, R as L, ln as M, U as N, W as O, $t as P, I as R, X as S, Sr as T, ie as U, Ae as V, Z as _, ki as a, qr as b, Q as c, hi as d, pi as f, Xr as g, ei as h, $ as i, cn as j, xn as k, Si as l, oi as m, Aa as n, Di as o, si as p, Li as r, bi as s, Wo as t, xi as u, Yr as v, Y as w, zr as x, Jr as y, Ze as z };
3743
3768
 
3744
- //# sourceMappingURL=VennClassification-DrP-zXoc.js.map
3769
+ //# sourceMappingURL=VennClassification-F4mRKoc5.js.map