@stackable-labs/embeddables 2.16.0 → 2.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.js CHANGED
@@ -5,7 +5,7 @@ import * as In from "react-dom";
5
5
  import Si from "react-dom";
6
6
  const gd = () => {
7
7
  try {
8
- return "16668cc0-2cb4-4147-931a-46da4242a948";
8
+ return "5fc08ef5-7031-4aa0-a8ce-1a6284ba5076";
9
9
  } catch {
10
10
  return "dev";
11
11
  }
@@ -685,7 +685,7 @@ const Tt = {
685
685
  }
686
686
  return r;
687
687
  }, Pd = ({ target: e, context: t, className: n }) => {
688
- const { extensions: o, components: r, ready: s, extensionGroups: i } = fr(), [a, c] = le({}), d = ke(""), u = Ke(() => o.filter((E) => E.enabled && E.manifest.targets.includes(e)), [o.map((E) => E.id).join(","), e]), l = Ke(() => Ti(r, { surfaceId: e, logPrefix: "[ExtensionStack]" }), [e, r]);
688
+ const { extensions: o, components: r, ready: s, extensionGroups: i } = fr(), [a, c] = le({}), d = ke(""), u = Ke(() => o.filter((E) => E.enabled && E.manifest.targets.includes(e)), [o.map((E) => `${E.id}:${E.enabled ? 1 : 0}`).join(","), e]), l = Ke(() => Ti(r, { surfaceId: e, logPrefix: "[ExtensionStack]" }), [e, r]);
689
689
  ae(() => {
690
690
  const E = u.map((C) => C.id).join(",");
691
691
  if (d.current !== E && (d.current = E, c({})), !s || u.length === 0)
@@ -723,9 +723,9 @@ const Tt = {
723
723
  }
724
724
  };
725
725
  return window.addEventListener("message", k), u.forEach((C) => {
726
- var I;
726
+ var P;
727
727
  const N = He(C.id);
728
- (I = N == null ? void 0 : N.iframe.contentWindow) == null || I.postMessage(
728
+ (P = N == null ? void 0 : N.iframe.contentWindow) == null || P.postMessage(
729
729
  { type: "surface-render", surfaceId: e, context: t },
730
730
  "*"
731
731
  );
@@ -739,10 +739,12 @@ const Tt = {
739
739
  if (v.current === E)
740
740
  return;
741
741
  v.current = E;
742
- const k = {};
743
- for (const C of i ?? [])
744
- !C.collapsible || C.extensionIds.length === 0 ? k[C.id] = /* @__PURE__ */ new Set() : C.oneAtATime ? k[C.id] = /* @__PURE__ */ new Set([C.extensionIds[0]]) : k[C.id] = new Set(C.extensionIds);
745
- h(k);
742
+ const k = new Set(u.map((N) => N.id)), C = {};
743
+ for (const N of i ?? []) {
744
+ const P = N.extensionIds.filter((_) => k.has(_));
745
+ !N.collapsible || P.length <= 1 ? C[N.id] = /* @__PURE__ */ new Set() : N.oneAtATime ? C[N.id] = /* @__PURE__ */ new Set([P[0]]) : C[N.id] = new Set(P);
746
+ }
747
+ h(C);
746
748
  }, [i]), !s || u.length === 0)
747
749
  return null;
748
750
  const g = Ad(u, i);
@@ -752,7 +754,7 @@ const Tt = {
752
754
  const C = b[E.id];
753
755
  if (!C)
754
756
  return null;
755
- const N = p[k.id] ?? /* @__PURE__ */ new Set(), I = k.collapsible ? N.has(E.id) : !0, _ = I && (!k.oneAtATime || N.size > 1), R = !I, A = k.collapsible && (_ || R), M = E.manifest.name, H = () => {
757
+ const N = p[k.id] ?? /* @__PURE__ */ new Set(), P = k.collapsible ? N.has(E.id) : !0, _ = P && (!k.oneAtATime || N.size > 1), R = !P, A = k.collapsible && (_ || R), M = E.manifest.name, H = () => {
756
758
  k.collapsible && h((L) => {
757
759
  const U = new Set(L[k.id] ?? []);
758
760
  if (U.has(E.id)) {
@@ -774,7 +776,7 @@ const Tt = {
774
776
  "w-full flex items-center gap-2 px-2 py-1.5 text-sm transition-colors",
775
777
  "hover:bg-zinc-50/50 disabled:cursor-default disabled:hover:bg-transparent"
776
778
  ].join(" "),
777
- "aria-expanded": I,
779
+ "aria-expanded": P,
778
780
  children: [
779
781
  /* @__PURE__ */ f("span", { className: "flex-1 text-left truncate", children: M }),
780
782
  A && /* @__PURE__ */ f(
@@ -789,14 +791,14 @@ const Tt = {
789
791
  strokeWidth: "2",
790
792
  strokeLinecap: "round",
791
793
  strokeLinejoin: "round",
792
- className: `text-zinc-400 transition-transform ${I ? "rotate-180" : ""}`,
794
+ className: `text-zinc-400 transition-transform ${P ? "rotate-180" : ""}`,
793
795
  children: /* @__PURE__ */ f("polyline", { points: "6 9 12 15 18 9" })
794
796
  }
795
797
  )
796
798
  ]
797
799
  }
798
800
  ),
799
- I && /* @__PURE__ */ f("div", { "data-extension-surface": E.id, children: C })
801
+ P && /* @__PURE__ */ f("div", { "data-extension-surface": E.id, children: C })
800
802
  ] }, `ext-row:${E.id}`);
801
803
  }, w = [];
802
804
  let x, S = [];
@@ -818,7 +820,7 @@ const Tt = {
818
820
  w.push(
819
821
  /* @__PURE__ */ K("div", { "data-extension-group": k.id, className: "flex flex-col", children: [
820
822
  k.label && /* @__PURE__ */ f("div", { className: "text-[11px] font-medium uppercase tracking-wide text-zinc-500/70 px-2 pt-2 pb-1", children: k.label }),
821
- k.collapsible ? S.map(({ ext: C }) => y(C, k)) : S.map(({ ext: C }) => {
823
+ k.collapsible && S.length > 1 ? S.map(({ ext: C }) => y(C, k)) : S.map(({ ext: C }) => {
822
824
  const N = b[C.id];
823
825
  return N ? /* @__PURE__ */ f(B.Fragment, { children: N }, C.id) : null;
824
826
  })
@@ -1119,7 +1121,7 @@ function eu(e) {
1119
1121
  }
1120
1122
  const tu = (e) => {
1121
1123
  var t, n, o, r, s, i, a, c, d;
1122
- const { invert: u, toast: l, unstyled: p, interacting: h, setHeights: v, visibleToasts: g, heights: b, index: y, toasts: w, expanded: x, removeToast: S, defaultRichColors: T, closeButton: E, style: k, cancelButtonStyle: C, actionButtonStyle: N, className: I = "", descriptionClassName: _ = "", duration: R, position: A, gap: M, expandByDefault: H, classNames: L, icons: U, closeButtonAriaLabel: j = "Close toast" } = e, [te, V] = B.useState(null), [z, F] = B.useState(null), [P, D] = B.useState(!1), [O, W] = B.useState(!1), [$, q] = B.useState(!1), [Z, ne] = B.useState(!1), [re, Q] = B.useState(!1), [ue, fe] = B.useState(0), [ft, Qe] = B.useState(0), Ae = B.useRef(l.duration || R || Jr), on = B.useRef(null), ye = B.useRef(null), od = y === 0, rd = y + 1 <= g, Ce = l.type, kt = l.dismissible !== !1, sd = l.className || "", id = l.descriptionClassName || "", rn = B.useMemo(() => b.findIndex((se) => se.toastId === l.id) || 0, [
1124
+ const { invert: u, toast: l, unstyled: p, interacting: h, setHeights: v, visibleToasts: g, heights: b, index: y, toasts: w, expanded: x, removeToast: S, defaultRichColors: T, closeButton: E, style: k, cancelButtonStyle: C, actionButtonStyle: N, className: P = "", descriptionClassName: _ = "", duration: R, position: A, gap: M, expandByDefault: H, classNames: L, icons: U, closeButtonAriaLabel: j = "Close toast" } = e, [te, V] = B.useState(null), [z, F] = B.useState(null), [I, D] = B.useState(!1), [O, W] = B.useState(!1), [$, q] = B.useState(!1), [Z, ne] = B.useState(!1), [re, Q] = B.useState(!1), [ue, fe] = B.useState(0), [ft, Qe] = B.useState(0), Ae = B.useRef(l.duration || R || Jr), on = B.useRef(null), ye = B.useRef(null), od = y === 0, rd = y + 1 <= g, Ce = l.type, kt = l.dismissible !== !1, sd = l.className || "", id = l.descriptionClassName || "", rn = B.useMemo(() => b.findIndex((se) => se.toastId === l.id) || 0, [
1123
1125
  b,
1124
1126
  l.id
1125
1127
  ]), ad = B.useMemo(() => {
@@ -1161,7 +1163,7 @@ const tu = (e) => {
1161
1163
  v,
1162
1164
  l.id
1163
1165
  ]), B.useLayoutEffect(() => {
1164
- if (!P) return;
1166
+ if (!I) return;
1165
1167
  const se = ye.current, me = se.style.height;
1166
1168
  se.style.height = "auto";
1167
1169
  const ge = se.getBoundingClientRect().height;
@@ -1177,7 +1179,7 @@ const tu = (e) => {
1177
1179
  ...Se
1178
1180
  ]);
1179
1181
  }, [
1180
- P,
1182
+ I,
1181
1183
  l.title,
1182
1184
  l.description,
1183
1185
  v,
@@ -1242,11 +1244,11 @@ const tu = (e) => {
1242
1244
  return /* @__PURE__ */ B.createElement("li", {
1243
1245
  tabIndex: 0,
1244
1246
  ref: ye,
1245
- className: De(I, sd, L == null ? void 0 : L.toast, l == null || (t = l.classNames) == null ? void 0 : t.toast, L == null ? void 0 : L.default, L == null ? void 0 : L[Ce], l == null || (n = l.classNames) == null ? void 0 : n[Ce]),
1247
+ className: De(P, sd, L == null ? void 0 : L.toast, l == null || (t = l.classNames) == null ? void 0 : t.toast, L == null ? void 0 : L.default, L == null ? void 0 : L[Ce], l == null || (n = l.classNames) == null ? void 0 : n[Ce]),
1246
1248
  "data-sonner-toast": "",
1247
1249
  "data-rich-colors": (Yr = l.richColors) != null ? Yr : T,
1248
1250
  "data-styled": !(l.jsx || l.unstyled || p),
1249
- "data-mounted": P,
1251
+ "data-mounted": I,
1250
1252
  "data-promise": !!l.promise,
1251
1253
  "data-swiped": re,
1252
1254
  "data-removed": O,
@@ -1261,7 +1263,7 @@ const tu = (e) => {
1261
1263
  "data-invert": dd,
1262
1264
  "data-swipe-out": Z,
1263
1265
  "data-swipe-direction": z,
1264
- "data-expanded": !!(x || H && P),
1266
+ "data-expanded": !!(x || H && I),
1265
1267
  "data-testid": l.testId,
1266
1268
  style: {
1267
1269
  "--index": y,
@@ -1399,24 +1401,24 @@ const ou = /* @__PURE__ */ B.forwardRef(function(t, n) {
1399
1401
  const { id: o, invert: r, position: s = "bottom-right", hotkey: i = [
1400
1402
  "altKey",
1401
1403
  "KeyT"
1402
- ], expand: a, closeButton: c, className: d, offset: u, mobileOffset: l, theme: p = "light", richColors: h, duration: v, style: g, visibleToasts: b = Gd, toastOptions: y, dir: w = Qr(), gap: x = Zd, icons: S, containerAriaLabel: T = "Notifications" } = t, [E, k] = B.useState([]), C = B.useMemo(() => o ? E.filter((P) => P.toasterId === o) : E.filter((P) => !P.toasterId), [
1404
+ ], expand: a, closeButton: c, className: d, offset: u, mobileOffset: l, theme: p = "light", richColors: h, duration: v, style: g, visibleToasts: b = Gd, toastOptions: y, dir: w = Qr(), gap: x = Zd, icons: S, containerAriaLabel: T = "Notifications" } = t, [E, k] = B.useState([]), C = B.useMemo(() => o ? E.filter((I) => I.toasterId === o) : E.filter((I) => !I.toasterId), [
1403
1405
  E,
1404
1406
  o
1405
1407
  ]), N = B.useMemo(() => Array.from(new Set([
1406
1408
  s
1407
- ].concat(C.filter((P) => P.position).map((P) => P.position)))), [
1409
+ ].concat(C.filter((I) => I.position).map((I) => I.position)))), [
1408
1410
  C,
1409
1411
  s
1410
- ]), [I, _] = B.useState([]), [R, A] = B.useState(!1), [M, H] = B.useState(!1), [L, U] = B.useState(p !== "system" ? p : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), j = B.useRef(null), te = i.join("+").replace(/Key/g, "").replace(/Digit/g, ""), V = B.useRef(null), z = B.useRef(!1), F = B.useCallback((P) => {
1412
+ ]), [P, _] = B.useState([]), [R, A] = B.useState(!1), [M, H] = B.useState(!1), [L, U] = B.useState(p !== "system" ? p : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), j = B.useRef(null), te = i.join("+").replace(/Key/g, "").replace(/Digit/g, ""), V = B.useRef(null), z = B.useRef(!1), F = B.useCallback((I) => {
1411
1413
  k((D) => {
1412
1414
  var O;
1413
- return (O = D.find((W) => W.id === P.id)) != null && O.delete || we.dismiss(P.id), D.filter(({ id: W }) => W !== P.id);
1415
+ return (O = D.find((W) => W.id === I.id)) != null && O.delete || we.dismiss(I.id), D.filter(({ id: W }) => W !== I.id);
1414
1416
  });
1415
1417
  }, []);
1416
- return B.useEffect(() => we.subscribe((P) => {
1417
- if (P.dismiss) {
1418
+ return B.useEffect(() => we.subscribe((I) => {
1419
+ if (I.dismiss) {
1418
1420
  requestAnimationFrame(() => {
1419
- k((D) => D.map((O) => O.id === P.id ? {
1421
+ k((D) => D.map((O) => O.id === I.id ? {
1420
1422
  ...O,
1421
1423
  delete: !0
1422
1424
  } : O));
@@ -1426,16 +1428,16 @@ const ou = /* @__PURE__ */ B.forwardRef(function(t, n) {
1426
1428
  setTimeout(() => {
1427
1429
  Si.flushSync(() => {
1428
1430
  k((D) => {
1429
- const O = D.findIndex((W) => W.id === P.id);
1431
+ const O = D.findIndex((W) => W.id === I.id);
1430
1432
  return O !== -1 ? [
1431
1433
  ...D.slice(0, O),
1432
1434
  {
1433
1435
  ...D[O],
1434
- ...P
1436
+ ...I
1435
1437
  },
1436
1438
  ...D.slice(O + 1)
1437
1439
  ] : [
1438
- P,
1440
+ I,
1439
1441
  ...D
1440
1442
  ];
1441
1443
  });
@@ -1449,13 +1451,13 @@ const ou = /* @__PURE__ */ B.forwardRef(function(t, n) {
1449
1451
  return;
1450
1452
  }
1451
1453
  if (p === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? U("dark") : U("light")), typeof window > "u") return;
1452
- const P = window.matchMedia("(prefers-color-scheme: dark)");
1454
+ const I = window.matchMedia("(prefers-color-scheme: dark)");
1453
1455
  try {
1454
- P.addEventListener("change", ({ matches: D }) => {
1456
+ I.addEventListener("change", ({ matches: D }) => {
1455
1457
  U(D ? "dark" : "light");
1456
1458
  });
1457
1459
  } catch {
1458
- P.addListener(({ matches: O }) => {
1460
+ I.addListener(({ matches: O }) => {
1459
1461
  try {
1460
1462
  U(O ? "dark" : "light");
1461
1463
  } catch (W) {
@@ -1470,7 +1472,7 @@ const ou = /* @__PURE__ */ B.forwardRef(function(t, n) {
1470
1472
  }, [
1471
1473
  E
1472
1474
  ]), B.useEffect(() => {
1473
- const P = (D) => {
1475
+ const I = (D) => {
1474
1476
  var O;
1475
1477
  if (i.every((q) => D[q] || D.code === q)) {
1476
1478
  var $;
@@ -1478,7 +1480,7 @@ const ou = /* @__PURE__ */ B.forwardRef(function(t, n) {
1478
1480
  }
1479
1481
  D.code === "Escape" && (document.activeElement === j.current || (O = j.current) != null && O.contains(document.activeElement)) && A(!1);
1480
1482
  };
1481
- return document.addEventListener("keydown", P), () => document.removeEventListener("keydown", P);
1483
+ return document.addEventListener("keydown", I), () => document.removeEventListener("keydown", I);
1482
1484
  }, [
1483
1485
  i
1484
1486
  ]), B.useEffect(() => {
@@ -1499,11 +1501,11 @@ const ou = /* @__PURE__ */ B.forwardRef(function(t, n) {
1499
1501
  "aria-relevant": "additions text",
1500
1502
  "aria-atomic": "false",
1501
1503
  suppressHydrationWarning: !0
1502
- }, N.map((P, D) => {
1504
+ }, N.map((I, D) => {
1503
1505
  var O;
1504
- const [W, $] = P.split("-");
1506
+ const [W, $] = I.split("-");
1505
1507
  return C.length ? /* @__PURE__ */ B.createElement("ol", {
1506
- key: P,
1508
+ key: I,
1507
1509
  dir: w === "auto" ? Qr() : w,
1508
1510
  tabIndex: -1,
1509
1511
  ref: j,
@@ -1513,7 +1515,7 @@ const ou = /* @__PURE__ */ B.forwardRef(function(t, n) {
1513
1515
  "data-y-position": W,
1514
1516
  "data-x-position": $,
1515
1517
  style: {
1516
- "--front-toast-height": `${((O = I[0]) == null ? void 0 : O.height) || 0}px`,
1518
+ "--front-toast-height": `${((O = P[0]) == null ? void 0 : O.height) || 0}px`,
1517
1519
  "--width": `${Xd}px`,
1518
1520
  "--gap": `${x}px`,
1519
1521
  ...g,
@@ -1537,7 +1539,7 @@ const ou = /* @__PURE__ */ B.forwardRef(function(t, n) {
1537
1539
  q.target instanceof HTMLElement && q.target.dataset.dismissible === "false" || H(!0);
1538
1540
  },
1539
1541
  onPointerUp: () => H(!1)
1540
- }, C.filter((q) => !q.position && D === 0 || q.position === P).map((q, Z) => {
1542
+ }, C.filter((q) => !q.position && D === 0 || q.position === I).map((q, Z) => {
1541
1543
  var ne, re;
1542
1544
  return /* @__PURE__ */ B.createElement(tu, {
1543
1545
  key: q.id,
@@ -1552,7 +1554,7 @@ const ou = /* @__PURE__ */ B.forwardRef(function(t, n) {
1552
1554
  visibleToasts: b,
1553
1555
  closeButton: (re = y == null ? void 0 : y.closeButton) != null ? re : c,
1554
1556
  interacting: M,
1555
- position: P,
1557
+ position: I,
1556
1558
  style: y == null ? void 0 : y.style,
1557
1559
  unstyled: y == null ? void 0 : y.unstyled,
1558
1560
  classNames: y == null ? void 0 : y.classNames,
@@ -1561,7 +1563,7 @@ const ou = /* @__PURE__ */ B.forwardRef(function(t, n) {
1561
1563
  closeButtonAriaLabel: y == null ? void 0 : y.closeButtonAriaLabel,
1562
1564
  removeToast: F,
1563
1565
  toasts: C.filter((Q) => Q.position == q.position),
1564
- heights: I.filter((Q) => Q.position == q.position),
1566
+ heights: P.filter((Q) => Q.position == q.position),
1565
1567
  setHeights: _,
1566
1568
  expandByDefault: a,
1567
1569
  gap: x,
@@ -2641,13 +2643,13 @@ const Lf = (e, t) => {
2641
2643
  "bottom-left",
2642
2644
  // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
2643
2645
  "left-bottom"
2644
- ], T = () => [...S(), Y, G], E = () => ["auto", "hidden", "clip", "visible", "scroll"], k = () => ["auto", "contain", "none"], C = () => [Y, G, c], N = () => [tt, "full", "auto", ...C()], I = () => [nt, "none", "subgrid", Y, G], _ = () => ["auto", {
2646
+ ], T = () => [...S(), Y, G], E = () => ["auto", "hidden", "clip", "visible", "scroll"], k = () => ["auto", "contain", "none"], C = () => [Y, G, c], N = () => [tt, "full", "auto", ...C()], P = () => [nt, "none", "subgrid", Y, G], _ = () => ["auto", {
2645
2647
  span: ["full", nt, Y, G]
2646
2648
  }, nt, Y, G], R = () => [nt, "auto", Y, G], A = () => ["auto", "min", "max", "fr", Y, G], M = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], H = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], L = () => ["auto", ...C()], U = () => [tt, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...C()], j = () => [tt, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...C()], te = () => [tt, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...C()], V = () => [e, Y, G], z = () => [...S(), cs, as, {
2647
2649
  position: [Y, G]
2648
2650
  }], F = () => ["no-repeat", {
2649
2651
  repeat: ["", "x", "y", "space", "round"]
2650
- }], P = () => ["auto", "cover", "contain", vp, fp, {
2652
+ }], I = () => ["auto", "cover", "contain", vp, fp, {
2651
2653
  size: [Y, G]
2652
2654
  }], D = () => [so, jt, mt], O = () => [
2653
2655
  // Deprecated since Tailwind CSS v4.0.0
@@ -2995,7 +2997,7 @@ const Lf = (e, t) => {
2995
2997
  * @see https://tailwindcss.com/docs/grid-template-columns
2996
2998
  */
2997
2999
  "grid-cols": [{
2998
- "grid-cols": I()
3000
+ "grid-cols": P()
2999
3001
  }],
3000
3002
  /**
3001
3003
  * Grid Column Start / End
@@ -3023,7 +3025,7 @@ const Lf = (e, t) => {
3023
3025
  * @see https://tailwindcss.com/docs/grid-template-rows
3024
3026
  */
3025
3027
  "grid-rows": [{
3026
- "grid-rows": I()
3028
+ "grid-rows": P()
3027
3029
  }],
3028
3030
  /**
3029
3031
  * Grid Row Start / End
@@ -3733,7 +3735,7 @@ const Lf = (e, t) => {
3733
3735
  * @see https://tailwindcss.com/docs/background-size
3734
3736
  */
3735
3737
  "bg-size": [{
3736
- bg: P()
3738
+ bg: I()
3737
3739
  }],
3738
3740
  /**
3739
3741
  * Background Image
@@ -4438,7 +4440,7 @@ const Lf = (e, t) => {
4438
4440
  * @see https://tailwindcss.com/docs/mask-size
4439
4441
  */
4440
4442
  "mask-size": [{
4441
- mask: P()
4443
+ mask: I()
4442
4444
  }],
4443
4445
  /**
4444
4446
  * Mask Type
@@ -5801,11 +5803,11 @@ var Kp = "DismissableLayer", Yo = "dismissableLayer.update", Yp = "dismissableLa
5801
5803
  onDismiss: a,
5802
5804
  ...c
5803
5805
  } = e, d = m.useContext(ua), [u, l] = m.useState(null), p = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = m.useState({}), v = ce(t, (k) => l(k)), g = Array.from(d.layers), [b] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), y = g.indexOf(b), w = u ? g.indexOf(u) : -1, x = d.layersWithOutsidePointerEventsDisabled.size > 0, S = w >= y, T = Qp((k) => {
5804
- const C = k.target, N = [...d.branches].some((I) => I.contains(C));
5806
+ const C = k.target, N = [...d.branches].some((P) => P.contains(C));
5805
5807
  !S || N || (r == null || r(k), i == null || i(k), k.defaultPrevented || a == null || a());
5806
5808
  }, p), E = em((k) => {
5807
5809
  const C = k.target;
5808
- [...d.branches].some((I) => I.contains(C)) || (s == null || s(k), i == null || i(k), k.defaultPrevented || a == null || a());
5810
+ [...d.branches].some((P) => P.contains(C)) || (s == null || s(k), i == null || i(k), k.defaultPrevented || a == null || a());
5809
5811
  }, p);
5810
5812
  return Gp((k) => {
5811
5813
  w === d.layers.size - 1 && (o == null || o(k), !k.defaultPrevented && a && (k.preventDefault(), a()));
@@ -6455,8 +6457,8 @@ function Um(e) {
6455
6457
  var y = pn(g), w = n.current, x = "deltaX" in g ? g.deltaX : w[0] - y[0], S = "deltaY" in g ? g.deltaY : w[1] - y[1], T, E = g.target, k = Math.abs(x) > Math.abs(S) ? "h" : "v";
6456
6458
  if ("touches" in g && k === "h" && E.type === "range")
6457
6459
  return !1;
6458
- var C = window.getSelection(), N = C && C.anchorNode, I = N ? N === E || N.contains(E) : !1;
6459
- if (I)
6460
+ var C = window.getSelection(), N = C && C.anchorNode, P = N ? N === E || N.contains(E) : !1;
6461
+ if (P)
6460
6462
  return !1;
6461
6463
  var _ = xs(k, E);
6462
6464
  if (!_)
@@ -7246,7 +7248,7 @@ const Ch = 50, Sh = async (e, t, n) => {
7246
7248
  }, h = Tr(r), v = Rr(h), g = await i.getDimensions(d), b = h === "y", y = b ? "top" : "left", w = b ? "bottom" : "right", x = b ? "clientHeight" : "clientWidth", S = s.reference[v] + s.reference[h] - p[h] - s.floating[v], T = p[h] - s.reference[h], E = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(d));
7247
7249
  let k = E ? E[x] : 0;
7248
7250
  (!k || !await (i.isElement == null ? void 0 : i.isElement(E))) && (k = a.floating[x] || s.floating[v]);
7249
- const C = S / 2 - T / 2, N = k / 2 - g[v] / 2 - 1, I = at(l[y], N), _ = at(l[w], N), R = I, A = k - g[v] - _, M = k / 2 - g[v] / 2 + C, H = Zo(R, M, A), L = !c.arrow && Ht(r) != null && M !== H && s.reference[v] / 2 - (M < R ? I : _) - g[v] / 2 < 0, U = L ? M < R ? M - R : M - A : 0;
7251
+ const C = S / 2 - T / 2, N = k / 2 - g[v] / 2 - 1, P = at(l[y], N), _ = at(l[w], N), R = P, A = k - g[v] - _, M = k / 2 - g[v] / 2 + C, H = Zo(R, M, A), L = !c.arrow && Ht(r) != null && M !== H && s.reference[v] / 2 - (M < R ? P : _) - g[v] / 2 < 0, U = L ? M < R ? M - R : M - A : 0;
7250
7252
  return {
7251
7253
  [h]: p[h] + U,
7252
7254
  data: {
@@ -7286,12 +7288,12 @@ const Ch = 50, Sh = async (e, t, n) => {
7286
7288
  const y = Ze(r), w = Ve(a), x = Ze(a) === a, S = await (c.isRTL == null ? void 0 : c.isRTL(d.floating)), T = p || (x || !g ? [En(a)] : hh(a)), E = v !== "none";
7287
7289
  !p && E && T.push(...yh(a, g, v, S));
7288
7290
  const k = [a, ...T], C = await c.detectOverflow(t, b), N = [];
7289
- let I = ((o = s.flip) == null ? void 0 : o.overflows) || [];
7291
+ let P = ((o = s.flip) == null ? void 0 : o.overflows) || [];
7290
7292
  if (u && N.push(C[y]), l) {
7291
7293
  const M = mh(r, i, S);
7292
7294
  N.push(C[M[0]], C[M[1]]);
7293
7295
  }
7294
- if (I = [...I, {
7296
+ if (P = [...P, {
7295
7297
  placement: r,
7296
7298
  overflows: N
7297
7299
  }], !N.every((M) => M <= 0)) {
@@ -7299,22 +7301,22 @@ const Ch = 50, Sh = async (e, t, n) => {
7299
7301
  const M = (((_ = s.flip) == null ? void 0 : _.index) || 0) + 1, H = k[M];
7300
7302
  if (H && (!(l === "alignment" ? w !== Ve(H) : !1) || // We leave the current main axis only if every placement on that axis
7301
7303
  // overflows the main axis.
7302
- I.every((j) => Ve(j.placement) === w ? j.overflows[0] > 0 : !0)))
7304
+ P.every((j) => Ve(j.placement) === w ? j.overflows[0] > 0 : !0)))
7303
7305
  return {
7304
7306
  data: {
7305
7307
  index: M,
7306
- overflows: I
7308
+ overflows: P
7307
7309
  },
7308
7310
  reset: {
7309
7311
  placement: H
7310
7312
  }
7311
7313
  };
7312
- let L = (R = I.filter((U) => U.overflows[0] <= 0).sort((U, j) => U.overflows[1] - j.overflows[1])[0]) == null ? void 0 : R.placement;
7314
+ let L = (R = P.filter((U) => U.overflows[0] <= 0).sort((U, j) => U.overflows[1] - j.overflows[1])[0]) == null ? void 0 : R.placement;
7313
7315
  if (!L)
7314
7316
  switch (h) {
7315
7317
  case "bestFit": {
7316
7318
  var A;
7317
- const U = (A = I.filter((j) => {
7319
+ const U = (A = P.filter((j) => {
7318
7320
  if (E) {
7319
7321
  const te = Ve(j.placement);
7320
7322
  return te === w || // Create a bias to the `y` side axis due to horizontal
@@ -7567,8 +7569,8 @@ const Th = function(e) {
7567
7569
  const w = g - u.top - u.bottom, x = v - u.left - u.right, S = at(g - u[b], w), T = at(v - u[y], x), E = !t.middlewareData.shift;
7568
7570
  let k = S, C = T;
7569
7571
  if ((n = t.middlewareData.shift) != null && n.enabled.x && (C = x), (o = t.middlewareData.shift) != null && o.enabled.y && (k = w), E && !p) {
7570
- const I = Ee(u.left, 0), _ = Ee(u.right, 0), R = Ee(u.top, 0), A = Ee(u.bottom, 0);
7571
- h ? C = v - 2 * (I !== 0 || _ !== 0 ? I + _ : Ee(u.left, u.right)) : k = g - 2 * (R !== 0 || A !== 0 ? R + A : Ee(u.top, u.bottom));
7572
+ const P = Ee(u.left, 0), _ = Ee(u.right, 0), R = Ee(u.top, 0), A = Ee(u.bottom, 0);
7573
+ h ? C = v - 2 * (P !== 0 || _ !== 0 ? P + _ : Ee(u.left, u.right)) : k = g - 2 * (R !== 0 || A !== 0 ? R + A : Ee(u.top, u.bottom));
7572
7574
  }
7573
7575
  await c({
7574
7576
  ...t,
@@ -8157,7 +8159,7 @@ function ag(e) {
8157
8159
  j !== E.current && (E.current = j, g(j));
8158
8160
  }, []), x = m.useCallback((j) => {
8159
8161
  j !== k.current && (k.current = j, y(j));
8160
- }, []), S = s || v, T = i || b, E = m.useRef(null), k = m.useRef(null), C = m.useRef(u), N = c != null, I = bo(c), _ = bo(r), R = bo(d), A = m.useCallback(() => {
8162
+ }, []), S = s || v, T = i || b, E = m.useRef(null), k = m.useRef(null), C = m.useRef(u), N = c != null, P = bo(c), _ = bo(r), R = bo(d), A = m.useCallback(() => {
8161
8163
  if (!E.current || !k.current)
8162
8164
  return;
8163
8165
  const j = {
@@ -8190,11 +8192,11 @@ function ag(e) {
8190
8192
  M.current = !1;
8191
8193
  }), []), wn(() => {
8192
8194
  if (S && (E.current = S), T && (k.current = T), S && T) {
8193
- if (I.current)
8194
- return I.current(S, T, A);
8195
+ if (P.current)
8196
+ return P.current(S, T, A);
8195
8197
  A();
8196
8198
  }
8197
- }, [S, T, A, I, N]);
8199
+ }, [S, T, A, P, N]);
8198
8200
  const H = m.useMemo(() => ({
8199
8201
  reference: E,
8200
8202
  floating: k,
@@ -8348,8 +8350,8 @@ var Mr = "PopperContent", [yg, wg] = Xa(Mr), tc = m.forwardRef(
8348
8350
  updatePositionStrategy: h = "optimized",
8349
8351
  onPlaced: v,
8350
8352
  ...g
8351
- } = e, b = Za(Mr, n), [y, w] = m.useState(null), x = ce(t, (ue) => w(ue)), [S, T] = m.useState(null), E = Dn(S), k = (E == null ? void 0 : E.width) ?? 0, C = (E == null ? void 0 : E.height) ?? 0, N = o + (s !== "center" ? "-" + s : ""), I = typeof u == "number" ? u : { top: 0, right: 0, bottom: 0, left: 0, ...u }, _ = Array.isArray(d) ? d : [d], R = _.length > 0, A = {
8352
- padding: I,
8353
+ } = e, b = Za(Mr, n), [y, w] = m.useState(null), x = ce(t, (ue) => w(ue)), [S, T] = m.useState(null), E = Dn(S), k = (E == null ? void 0 : E.width) ?? 0, C = (E == null ? void 0 : E.height) ?? 0, N = o + (s !== "center" ? "-" + s : ""), P = typeof u == "number" ? u : { top: 0, right: 0, bottom: 0, left: 0, ...u }, _ = Array.isArray(d) ? d : [d], R = _.length > 0, A = {
8354
+ padding: P,
8353
8355
  boundary: _.filter(Cg),
8354
8356
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
8355
8357
  altBoundary: R
@@ -8387,7 +8389,7 @@ var Mr = "PopperContent", [yg, wg] = Xa(Mr), tc = m.forwardRef(
8387
8389
  de(() => {
8388
8390
  U && (z == null || z());
8389
8391
  }, [U, z]);
8390
- const F = ($ = j.arrow) == null ? void 0 : $.x, P = (q = j.arrow) == null ? void 0 : q.y, D = ((Z = j.arrow) == null ? void 0 : Z.centerOffset) !== 0, [O, W] = m.useState();
8392
+ const F = ($ = j.arrow) == null ? void 0 : $.x, I = (q = j.arrow) == null ? void 0 : q.y, D = ((Z = j.arrow) == null ? void 0 : Z.centerOffset) !== 0, [O, W] = m.useState();
8391
8393
  return de(() => {
8392
8394
  y && W(window.getComputedStyle(y).zIndex);
8393
8395
  }, [y]), /* @__PURE__ */ f(
@@ -8421,7 +8423,7 @@ var Mr = "PopperContent", [yg, wg] = Xa(Mr), tc = m.forwardRef(
8421
8423
  placedSide: te,
8422
8424
  onArrowChange: T,
8423
8425
  arrowX: F,
8424
- arrowY: P,
8426
+ arrowY: I,
8425
8427
  shouldHideArrow: D,
8426
8428
  children: /* @__PURE__ */ f(
8427
8429
  J.div,
@@ -8577,8 +8579,8 @@ var Ag = m.forwardRef((e, t) => {
8577
8579
  onFocus: ee(e.onFocus, (C) => {
8578
8580
  const N = !T.current;
8579
8581
  if (C.target === C.currentTarget && N && !y) {
8580
- const I = new CustomEvent(yo, Eg);
8581
- if (C.currentTarget.dispatchEvent(I), !I.defaultPrevented) {
8582
+ const P = new CustomEvent(yo, Eg);
8583
+ if (C.currentTarget.dispatchEvent(P), !P.defaultPrevented) {
8582
8584
  const _ = S().filter((L) => L.focusable), R = _.find((L) => L.active), A = _.find((L) => L.id === g), H = [R, A, ..._].filter(
8583
8585
  Boolean
8584
8586
  ).map((L) => L.ref.current);
@@ -8995,13 +8997,13 @@ var Dr = "ScrollArea", [Mc] = xe(Dr), [ov, Te] = Mc(Dr), Lc = m.forwardRef(
8995
8997
  dir: r,
8996
8998
  scrollHideDelay: s = 600,
8997
8999
  ...i
8998
- } = e, [a, c] = m.useState(null), [d, u] = m.useState(null), [l, p] = m.useState(null), [h, v] = m.useState(null), [g, b] = m.useState(null), [y, w] = m.useState(0), [x, S] = m.useState(0), [T, E] = m.useState(!1), [k, C] = m.useState(!1), N = ce(t, (_) => c(_)), I = Qt(r);
9000
+ } = e, [a, c] = m.useState(null), [d, u] = m.useState(null), [l, p] = m.useState(null), [h, v] = m.useState(null), [g, b] = m.useState(null), [y, w] = m.useState(0), [x, S] = m.useState(0), [T, E] = m.useState(!1), [k, C] = m.useState(!1), N = ce(t, (_) => c(_)), P = Qt(r);
8999
9001
  return /* @__PURE__ */ f(
9000
9002
  ov,
9001
9003
  {
9002
9004
  scope: n,
9003
9005
  type: o,
9004
- dir: I,
9006
+ dir: P,
9005
9007
  scrollHideDelay: s,
9006
9008
  scrollArea: a,
9007
9009
  viewport: d,
@@ -9021,7 +9023,7 @@ var Dr = "ScrollArea", [Mc] = xe(Dr), [ov, Te] = Mc(Dr), Lc = m.forwardRef(
9021
9023
  children: /* @__PURE__ */ f(
9022
9024
  J.div,
9023
9025
  {
9024
- dir: I,
9026
+ dir: P,
9025
9027
  ...i,
9026
9028
  ref: N,
9027
9029
  style: {
@@ -9320,14 +9322,14 @@ var rv = m.forwardRef((e, t) => {
9320
9322
  } = e, h = Te(We, n), [v, g] = m.useState(null), b = ce(t, (N) => g(N)), y = m.useRef(null), w = m.useRef(""), x = h.viewport, S = o.content - o.viewport, T = be(u), E = be(c), k = Gn(l, 10);
9321
9323
  function C(N) {
9322
9324
  if (y.current) {
9323
- const I = N.clientX - y.current.left, _ = N.clientY - y.current.top;
9324
- d({ x: I, y: _ });
9325
+ const P = N.clientX - y.current.left, _ = N.clientY - y.current.top;
9326
+ d({ x: P, y: _ });
9325
9327
  }
9326
9328
  }
9327
9329
  return m.useEffect(() => {
9328
- const N = (I) => {
9329
- const _ = I.target;
9330
- (v == null ? void 0 : v.contains(_)) && T(I, S);
9330
+ const N = (P) => {
9331
+ const _ = P.target;
9332
+ (v == null ? void 0 : v.contains(_)) && T(P, S);
9331
9333
  };
9332
9334
  return document.addEventListener("wheel", N, { passive: !1 }), () => document.removeEventListener("wheel", N, { passive: !1 });
9333
9335
  }, [x, v, S, T]), m.useEffect(E, [o, E]), Ft(v, k), Ft(h.content, k), /* @__PURE__ */ f(
@@ -9351,8 +9353,8 @@ var rv = m.forwardRef((e, t) => {
9351
9353
  }),
9352
9354
  onPointerMove: ee(e.onPointerMove, C),
9353
9355
  onPointerUp: ee(e.onPointerUp, (N) => {
9354
- const I = N.target;
9355
- I.hasPointerCapture(N.pointerId) && I.releasePointerCapture(N.pointerId), document.body.style.webkitUserSelect = w.current, h.viewport && (h.viewport.style.scrollBehavior = ""), y.current = null;
9356
+ const P = N.target;
9357
+ P.hasPointerCapture(N.pointerId) && P.releasePointerCapture(N.pointerId), document.body.style.webkitUserSelect = w.current, h.viewport && (h.viewport.style.scrollBehavior = ""), y.current = null;
9356
9358
  })
9357
9359
  }
9358
9360
  )
@@ -9518,7 +9520,7 @@ var pv = Lc, mv = zc, hv = Vc, gv = [" ", "Enter", "ArrowUp", "ArrowDown"], vv =
9518
9520
  defaultProp: r ?? !1,
9519
9521
  onChange: s,
9520
9522
  caller: bt
9521
- }), [N, I] = Ye({
9523
+ }), [N, P] = Ye({
9522
9524
  prop: i,
9523
9525
  defaultProp: a,
9524
9526
  onChange: c,
@@ -9537,7 +9539,7 @@ var pv = Lc, mv = zc, hv = Vc, gv = [" ", "Enter", "ArrowUp", "ArrowDown"], vv =
9537
9539
  onValueNodeHasChildrenChange: T,
9538
9540
  contentId: Ct(),
9539
9541
  value: N,
9540
- onValueChange: I,
9542
+ onValueChange: P,
9541
9543
  open: k,
9542
9544
  onOpenChange: C,
9543
9545
  dir: E,
@@ -9569,7 +9571,7 @@ var pv = Lc, mv = zc, hv = Vc, gv = [" ", "Enter", "ArrowUp", "ArrowDown"], vv =
9569
9571
  name: u,
9570
9572
  autoComplete: l,
9571
9573
  value: N,
9572
- onChange: (L) => I(L.target.value),
9574
+ onChange: (L) => P(L.target.value),
9573
9575
  disabled: p,
9574
9576
  form: v,
9575
9577
  children: [
@@ -9692,7 +9694,7 @@ var _e = 10, [el, ut] = Ut(yt), Ev = "SelectContentImpl", kv = /* @__PURE__ */ X
9692
9694
  avoidCollisions: b,
9693
9695
  //
9694
9696
  ...y
9695
- } = e, w = dt(yt, n), [x, S] = m.useState(null), [T, E] = m.useState(null), k = ce(t, ($) => S($)), [C, N] = m.useState(null), [I, _] = m.useState(
9697
+ } = e, w = dt(yt, n), [x, S] = m.useState(null), [T, E] = m.useState(null), k = ce(t, ($) => S($)), [C, N] = m.useState(null), [P, _] = m.useState(
9696
9698
  null
9697
9699
  ), R = Yn(n), [A, M] = m.useState(!1), H = m.useRef(!1);
9698
9700
  m.useEffect(() => {
@@ -9744,7 +9746,7 @@ var _e = 10, [el, ut] = Ut(yt), Ev = "SelectContentImpl", kv = /* @__PURE__ */ X
9744
9746
  (w.value !== void 0 && w.value === q || ne) && (N($), ne && (H.current = !0));
9745
9747
  },
9746
9748
  [w.value]
9747
- ), P = m.useCallback(() => x == null ? void 0 : x.focus(), [x]), D = m.useCallback(
9749
+ ), I = m.useCallback(() => x == null ? void 0 : x.focus(), [x]), D = m.useCallback(
9748
9750
  ($, q, Z) => {
9749
9751
  const ne = !H.current && !Z;
9750
9752
  (w.value !== void 0 && w.value === q || ne) && _($);
@@ -9771,10 +9773,10 @@ var _e = 10, [el, ut] = Ut(yt), Ev = "SelectContentImpl", kv = /* @__PURE__ */ X
9771
9773
  onViewportChange: E,
9772
9774
  itemRefCallback: F,
9773
9775
  selectedItem: C,
9774
- onItemLeave: P,
9776
+ onItemLeave: I,
9775
9777
  itemTextRefCallback: D,
9776
9778
  focusSelectedItem: U,
9777
- selectedItemText: I,
9779
+ selectedItemText: P,
9778
9780
  position: o,
9779
9781
  isPositioned: A,
9780
9782
  searchRef: V,
@@ -9844,9 +9846,9 @@ tl.displayName = Ev;
9844
9846
  var Nv = "SelectItemAlignedPosition", nl = m.forwardRef((e, t) => {
9845
9847
  const { __scopeSelect: n, onPlaced: o, ...r } = e, s = dt(yt, n), i = ut(yt, n), [a, c] = m.useState(null), [d, u] = m.useState(null), l = ce(t, (k) => u(k)), p = Yn(n), h = m.useRef(!1), v = m.useRef(!0), { viewport: g, selectedItem: b, selectedItemText: y, focusSelectedItem: w } = i, x = m.useCallback(() => {
9846
9848
  if (s.trigger && s.valueNode && a && d && g && b && y) {
9847
- const k = s.trigger.getBoundingClientRect(), C = d.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), I = y.getBoundingClientRect();
9849
+ const k = s.trigger.getBoundingClientRect(), C = d.getBoundingClientRect(), N = s.valueNode.getBoundingClientRect(), P = y.getBoundingClientRect();
9848
9850
  if (s.dir !== "rtl") {
9849
- const re = I.left - C.left, Q = N.left - re, ue = k.left - Q, fe = k.width + ue, ft = Math.max(fe, C.width), Qe = window.innerWidth - _e, Ae = tr(Q, [
9851
+ const re = P.left - C.left, Q = N.left - re, ue = k.left - Q, fe = k.width + ue, ft = Math.max(fe, C.width), Qe = window.innerWidth - _e, Ae = tr(Q, [
9850
9852
  _e,
9851
9853
  // Prevents the content from going off the starting edge of the
9852
9854
  // viewport. It may still go off the ending edge, but this can be
@@ -9857,20 +9859,20 @@ var Nv = "SelectItemAlignedPosition", nl = m.forwardRef((e, t) => {
9857
9859
  ]);
9858
9860
  a.style.minWidth = fe + "px", a.style.left = Ae + "px";
9859
9861
  } else {
9860
- const re = C.right - I.right, Q = window.innerWidth - N.right - re, ue = window.innerWidth - k.right - Q, fe = k.width + ue, ft = Math.max(fe, C.width), Qe = window.innerWidth - _e, Ae = tr(Q, [
9862
+ const re = C.right - P.right, Q = window.innerWidth - N.right - re, ue = window.innerWidth - k.right - Q, fe = k.width + ue, ft = Math.max(fe, C.width), Qe = window.innerWidth - _e, Ae = tr(Q, [
9861
9863
  _e,
9862
9864
  Math.max(_e, Qe - ft)
9863
9865
  ]);
9864
9866
  a.style.minWidth = fe + "px", a.style.right = Ae + "px";
9865
9867
  }
9866
- const _ = p(), R = window.innerHeight - _e * 2, A = g.scrollHeight, M = window.getComputedStyle(d), H = parseInt(M.borderTopWidth, 10), L = parseInt(M.paddingTop, 10), U = parseInt(M.borderBottomWidth, 10), j = parseInt(M.paddingBottom, 10), te = H + L + A + j + U, V = Math.min(b.offsetHeight * 5, te), z = window.getComputedStyle(g), F = parseInt(z.paddingTop, 10), P = parseInt(z.paddingBottom, 10), D = k.top + k.height / 2 - _e, O = R - D, W = b.offsetHeight / 2, $ = b.offsetTop + W, q = H + L + $, Z = te - q;
9868
+ const _ = p(), R = window.innerHeight - _e * 2, A = g.scrollHeight, M = window.getComputedStyle(d), H = parseInt(M.borderTopWidth, 10), L = parseInt(M.paddingTop, 10), U = parseInt(M.borderBottomWidth, 10), j = parseInt(M.paddingBottom, 10), te = H + L + A + j + U, V = Math.min(b.offsetHeight * 5, te), z = window.getComputedStyle(g), F = parseInt(z.paddingTop, 10), I = parseInt(z.paddingBottom, 10), D = k.top + k.height / 2 - _e, O = R - D, W = b.offsetHeight / 2, $ = b.offsetTop + W, q = H + L + $, Z = te - q;
9867
9869
  if (q <= D) {
9868
9870
  const re = _.length > 0 && b === _[_.length - 1].ref.current;
9869
9871
  a.style.bottom = "0px";
9870
9872
  const Q = d.clientHeight - g.offsetTop - g.offsetHeight, ue = Math.max(
9871
9873
  O,
9872
9874
  W + // viewport might have padding bottom, include it to avoid a scrollable viewport
9873
- (re ? P : 0) + Q + U
9875
+ (re ? I : 0) + Q + U
9874
9876
  ), fe = q + ue;
9875
9877
  a.style.height = fe + "px";
9876
9878
  } else {
@@ -12624,11 +12626,11 @@ function C0() {
12624
12626
  for (let E = 0; E < y.length; E++) {
12625
12627
  const k = y[E], C = [];
12626
12628
  for (let N = 0; N < k.length; N++) {
12627
- const I = k[N], _ = "" + E + N;
12628
- C.push(_), x[_] = { node: I, lastCount: 0 }, S[_] = {};
12629
+ const P = k[N], _ = "" + E + N;
12630
+ C.push(_), x[_] = { node: P, lastCount: 0 }, S[_] = {};
12629
12631
  for (let R = 0; R < T.length; R++) {
12630
12632
  const A = T[R];
12631
- x[A] && x[A].node.mode === I.mode ? (S[A][_] = p(x[A].lastCount + I.length, I.mode) - p(x[A].lastCount, I.mode), x[A].lastCount += I.length) : (x[A] && (x[A].lastCount = I.length), S[A][_] = p(I.length, I.mode) + 4 + t.getCharCountIndicator(I.mode, w));
12633
+ x[A] && x[A].node.mode === P.mode ? (S[A][_] = p(x[A].lastCount + P.length, P.mode) - p(x[A].lastCount, P.mode), x[A].lastCount += P.length) : (x[A] && (x[A].lastCount = P.length), S[A][_] = p(P.length, P.mode) + 4 + t.getCharCountIndicator(P.mode, w));
12632
12634
  }
12633
12635
  }
12634
12636
  T = C;
@@ -12677,8 +12679,8 @@ function S0() {
12677
12679
  const e = St(), t = jr(), n = a0(), o = c0(), r = l0(), s = d0(), i = u0(), a = jl(), c = m0(), d = h0(), u = g0(), l = Et(), p = C0();
12678
12680
  function h(E, k) {
12679
12681
  const C = E.size, N = s.getPositions(k);
12680
- for (let I = 0; I < N.length; I++) {
12681
- const _ = N[I][0], R = N[I][1];
12682
+ for (let P = 0; P < N.length; P++) {
12683
+ const _ = N[P][0], R = N[P][1];
12682
12684
  for (let A = -1; A <= 7; A++)
12683
12685
  if (!(_ + A <= -1 || C <= _ + A))
12684
12686
  for (let M = -1; M <= 7; M++)
@@ -12695,37 +12697,37 @@ function S0() {
12695
12697
  function g(E, k) {
12696
12698
  const C = r.getPositions(k);
12697
12699
  for (let N = 0; N < C.length; N++) {
12698
- const I = C[N][0], _ = C[N][1];
12700
+ const P = C[N][0], _ = C[N][1];
12699
12701
  for (let R = -2; R <= 2; R++)
12700
12702
  for (let A = -2; A <= 2; A++)
12701
- R === -2 || R === 2 || A === -2 || A === 2 || R === 0 && A === 0 ? E.set(I + R, _ + A, !0, !0) : E.set(I + R, _ + A, !1, !0);
12703
+ R === -2 || R === 2 || A === -2 || A === 2 || R === 0 && A === 0 ? E.set(P + R, _ + A, !0, !0) : E.set(P + R, _ + A, !1, !0);
12702
12704
  }
12703
12705
  }
12704
12706
  function b(E, k) {
12705
12707
  const C = E.size, N = d.getEncodedBits(k);
12706
- let I, _, R;
12708
+ let P, _, R;
12707
12709
  for (let A = 0; A < 18; A++)
12708
- I = Math.floor(A / 3), _ = A % 3 + C - 8 - 3, R = (N >> A & 1) === 1, E.set(I, _, R, !0), E.set(_, I, R, !0);
12710
+ P = Math.floor(A / 3), _ = A % 3 + C - 8 - 3, R = (N >> A & 1) === 1, E.set(P, _, R, !0), E.set(_, P, R, !0);
12709
12711
  }
12710
12712
  function y(E, k, C) {
12711
- const N = E.size, I = u.getEncodedBits(k, C);
12713
+ const N = E.size, P = u.getEncodedBits(k, C);
12712
12714
  let _, R;
12713
12715
  for (_ = 0; _ < 15; _++)
12714
- R = (I >> _ & 1) === 1, _ < 6 ? E.set(_, 8, R, !0) : _ < 8 ? E.set(_ + 1, 8, R, !0) : E.set(N - 15 + _, 8, R, !0), _ < 8 ? E.set(8, N - _ - 1, R, !0) : _ < 9 ? E.set(8, 15 - _ - 1 + 1, R, !0) : E.set(8, 15 - _ - 1, R, !0);
12716
+ R = (P >> _ & 1) === 1, _ < 6 ? E.set(_, 8, R, !0) : _ < 8 ? E.set(_ + 1, 8, R, !0) : E.set(N - 15 + _, 8, R, !0), _ < 8 ? E.set(8, N - _ - 1, R, !0) : _ < 9 ? E.set(8, 15 - _ - 1 + 1, R, !0) : E.set(8, 15 - _ - 1, R, !0);
12715
12717
  E.set(N - 8, 8, 1, !0);
12716
12718
  }
12717
12719
  function w(E, k) {
12718
12720
  const C = E.size;
12719
- let N = -1, I = C - 1, _ = 7, R = 0;
12721
+ let N = -1, P = C - 1, _ = 7, R = 0;
12720
12722
  for (let A = C - 1; A > 0; A -= 2)
12721
12723
  for (A === 6 && A--; ; ) {
12722
12724
  for (let M = 0; M < 2; M++)
12723
- if (!E.isReserved(I, A - M)) {
12725
+ if (!E.isReserved(P, A - M)) {
12724
12726
  let H = !1;
12725
- R < k.length && (H = (k[R] >>> _ & 1) === 1), E.set(I, A - M, H), _--, _ === -1 && (R++, _ = 7);
12727
+ R < k.length && (H = (k[R] >>> _ & 1) === 1), E.set(P, A - M, H), _--, _ === -1 && (R++, _ = 7);
12726
12728
  }
12727
- if (I += N, I < 0 || C <= I) {
12728
- I -= N, N = -N;
12729
+ if (P += N, P < 0 || C <= P) {
12730
+ P -= N, N = -N;
12729
12731
  break;
12730
12732
  }
12731
12733
  }
@@ -12735,7 +12737,7 @@ function S0() {
12735
12737
  C.forEach(function(M) {
12736
12738
  N.put(M.mode.bit, 4), N.put(M.getLength(), l.getCharCountIndicator(M.mode, E)), M.write(N);
12737
12739
  });
12738
- const I = e.getSymbolTotalCodewords(E), _ = a.getTotalCodewordsCount(E, k), R = (I - _) * 8;
12740
+ const P = e.getSymbolTotalCodewords(E), _ = a.getTotalCodewordsCount(E, k), R = (P - _) * 8;
12739
12741
  for (N.getLengthInBits() + 4 <= R && N.put(0, 4); N.getLengthInBits() % 8 !== 0; )
12740
12742
  N.putBit(0);
12741
12743
  const A = (R - N.getLengthInBits()) / 8;
@@ -12744,18 +12746,18 @@ function S0() {
12744
12746
  return S(N, E, k);
12745
12747
  }
12746
12748
  function S(E, k, C) {
12747
- const N = e.getSymbolTotalCodewords(k), I = a.getTotalCodewordsCount(k, C), _ = N - I, R = a.getBlocksCount(k, C), A = N % R, M = R - A, H = Math.floor(N / R), L = Math.floor(_ / R), U = L + 1, j = H - L, te = new c(j);
12749
+ const N = e.getSymbolTotalCodewords(k), P = a.getTotalCodewordsCount(k, C), _ = N - P, R = a.getBlocksCount(k, C), A = N % R, M = R - A, H = Math.floor(N / R), L = Math.floor(_ / R), U = L + 1, j = H - L, te = new c(j);
12748
12750
  let V = 0;
12749
12751
  const z = new Array(R), F = new Array(R);
12750
- let P = 0;
12752
+ let I = 0;
12751
12753
  const D = new Uint8Array(E.buffer);
12752
12754
  for (let Z = 0; Z < R; Z++) {
12753
12755
  const ne = Z < M ? L : U;
12754
- z[Z] = D.slice(V, V + ne), F[Z] = te.encode(z[Z]), V += ne, P = Math.max(P, ne);
12756
+ z[Z] = D.slice(V, V + ne), F[Z] = te.encode(z[Z]), V += ne, I = Math.max(I, ne);
12755
12757
  }
12756
12758
  const O = new Uint8Array(N);
12757
12759
  let W = 0, $, q;
12758
- for ($ = 0; $ < P; $++)
12760
+ for ($ = 0; $ < I; $++)
12759
12761
  for (q = 0; q < R; q++)
12760
12762
  $ < z[q].length && (O[W++] = z[q][$]);
12761
12763
  for ($ = 0; $ < j; $++)
@@ -12764,19 +12766,19 @@ function S0() {
12764
12766
  return O;
12765
12767
  }
12766
12768
  function T(E, k, C, N) {
12767
- let I;
12769
+ let P;
12768
12770
  if (Array.isArray(E))
12769
- I = p.fromArray(E);
12771
+ P = p.fromArray(E);
12770
12772
  else if (typeof E == "string") {
12771
12773
  let H = k;
12772
12774
  if (!H) {
12773
12775
  const L = p.rawSplit(E);
12774
12776
  H = d.getBestVersionForData(L, C);
12775
12777
  }
12776
- I = p.fromString(E, H || 40);
12778
+ P = p.fromString(E, H || 40);
12777
12779
  } else
12778
12780
  throw new Error("Invalid data");
12779
- const _ = d.getBestVersionForData(I, C);
12781
+ const _ = d.getBestVersionForData(P, C);
12780
12782
  if (!_)
12781
12783
  throw new Error("The amount of data is too big to be stored in a QR Code");
12782
12784
  if (!k)
@@ -12788,7 +12790,7 @@ The chosen QR Code version cannot contain this amount of data.
12788
12790
  Minimum version required to store current data is: ` + _ + `.
12789
12791
  `
12790
12792
  );
12791
- const R = x(k, C, I), A = e.getSymbolSize(k), M = new o(A);
12793
+ const R = x(k, C, P), A = e.getSymbolSize(k), M = new o(A);
12792
12794
  return h(M, k), v(M), g(M, k), y(M, C, 0), k >= 7 && b(M, k), w(M, R), isNaN(N) && (N = i.getBestMask(
12793
12795
  M,
12794
12796
  y.bind(null, M, C)
@@ -12797,14 +12799,14 @@ Minimum version required to store current data is: ` + _ + `.
12797
12799
  version: k,
12798
12800
  errorCorrectionLevel: C,
12799
12801
  maskPattern: N,
12800
- segments: I
12802
+ segments: P
12801
12803
  };
12802
12804
  }
12803
12805
  return xo.create = function(k, C) {
12804
12806
  if (typeof k > "u" || k === "")
12805
12807
  throw new Error("No input text");
12806
- let N = t.M, I, _;
12807
- return typeof C < "u" && (N = t.from(C.errorCorrectionLevel, t.M), I = d.from(C.version), _ = i.from(C.maskPattern), C.toSJISFunc && e.setToSJISFunction(C.toSJISFunc)), T(k, I, N, _);
12808
+ let N = t.M, P, _;
12809
+ return typeof C < "u" && (N = t.from(C.errorCorrectionLevel, t.M), P = d.from(C.version), _ = i.from(C.maskPattern), C.toSJISFunc && e.setToSJISFunction(C.toSJISFunc)), T(k, P, N, _);
12808
12810
  }, xo;
12809
12811
  }
12810
12812
  var $o = {}, Ho = {}, fi;
@@ -13905,14 +13907,14 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
13905
13907
  ae(() => {
13906
13908
  window.stackable || (window.stackable = {
13907
13909
  emit: (z, F = {}) => {
13908
- const [P, ...D] = z.split(":"), O = D.join(":");
13909
- window.dispatchEvent(new CustomEvent(`stackable:${P}`, {
13910
+ const [I, ...D] = z.split(":"), O = D.join(":");
13911
+ window.dispatchEvent(new CustomEvent(`stackable:${I}`, {
13910
13912
  detail: { eventName: O, data: F }
13911
13913
  }));
13912
13914
  }
13913
13915
  });
13914
13916
  }, []);
13915
- const C = ke(null), N = ke(/* @__PURE__ */ new Set()), I = Ke(() => c.filter((z) => z.manifest.permissions.includes("extend:identity")).map((z) => z.id), [c]);
13917
+ const C = ke(null), N = ke(/* @__PURE__ */ new Set()), P = Ke(() => c.filter((z) => z.manifest.permissions.includes("extend:identity")).map((z) => z.id), [c]);
13916
13918
  ae(() => {
13917
13919
  (async () => {
13918
13920
  const F = e;
@@ -13925,15 +13927,15 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
13925
13927
  console.warn("[ExtensionSetup] apiBase and appId are required to load extensions"), d([]), x(!0);
13926
13928
  return;
13927
13929
  }
13928
- const P = await fetch(Gt(n, `/instances/${o}/${F}`));
13929
- if (!P.ok) {
13930
+ const I = await fetch(Gt(n, `/instances/${o}/${F}`));
13931
+ if (!I.ok) {
13930
13932
  console.warn(`[ExtensionSetup] Instance not found or failed to load: ${F}`), d([]), x(!0);
13931
13933
  return;
13932
13934
  }
13933
- const { extensions: D, extensionGroups: O } = await P.json(), W = Ai(typeof window < "u" ? window.location.search : ""), $ = await au(D, W), { tokens: q, errors: Z } = await Vy($, n, o, F, W);
13935
+ const { extensions: D, extensionGroups: O } = await I.json(), W = Ai(typeof window < "u" ? window.location.search : ""), $ = await au(D, W), { tokens: q, errors: Z } = await Vy($, n, o, F, W);
13934
13936
  d($), l(O), h(W), g(new Map(q)), y(Z);
13935
- } catch (P) {
13936
- console.error("Failed to load extensions:", P);
13937
+ } catch (I) {
13938
+ console.error("Failed to load extensions:", I);
13937
13939
  } finally {
13938
13940
  x(!0);
13939
13941
  }
@@ -13942,7 +13944,7 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
13942
13944
  if (!n || !o || c.length === 0)
13943
13945
  return;
13944
13946
  const F = setInterval(async () => {
13945
- const P = [];
13947
+ const I = [];
13946
13948
  await Promise.all(
13947
13949
  c.filter((D) => {
13948
13950
  var O;
@@ -13961,13 +13963,13 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
13961
13963
  });
13962
13964
  if (Z.ok) {
13963
13965
  const { token: ne, encryptionKey: re, settings: Q } = await Z.json();
13964
- P.push([D.id, { token: ne, encryptionKey: re, settings: Q }]);
13966
+ I.push([D.id, { token: ne, encryptionKey: re, settings: Q }]);
13965
13967
  } else
13966
13968
  console.warn(`[embeddables] Proxy token refresh failed for extension ${D.id} (${Z.status}) — using stale token`);
13967
13969
  })
13968
- ), P.length > 0 && g((D) => {
13970
+ ), I.length > 0 && g((D) => {
13969
13971
  const O = new Map(D);
13970
- for (const [W, $] of P)
13972
+ for (const [W, $] of I)
13971
13973
  O.set(W, $);
13972
13974
  return O;
13973
13975
  });
@@ -13977,10 +13979,10 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
13977
13979
  if (v.size === 0)
13978
13980
  return;
13979
13981
  const z = (F) => {
13980
- const P = F.data;
13981
- if ((P == null ? void 0 : P.type) !== "extension-ready")
13982
+ const I = F.data;
13983
+ if ((I == null ? void 0 : I.type) !== "extension-ready")
13982
13984
  return;
13983
- const D = P.extensionId, O = c.find((q) => q.id === D);
13985
+ const D = I.extensionId, O = c.find((q) => q.id === D);
13984
13986
  if (!(O != null && O.bundleUrl))
13985
13987
  return;
13986
13988
  const W = p.find((q) => q.extensionId === D);
@@ -13992,8 +13994,8 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
13992
13994
  return window.addEventListener("message", z), () => window.removeEventListener("message", z);
13993
13995
  }, [c, p, v]);
13994
13996
  const _ = ve((z, F) => {
13995
- const P = Ot();
13996
- for (const [D, O] of P) {
13997
+ const I = Ot();
13998
+ for (const [D, O] of I) {
13997
13999
  if (!O.manifest.permissions.includes("events:identity"))
13998
14000
  continue;
13999
14001
  const W = O.manifest.events ?? [];
@@ -14005,11 +14007,11 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14005
14007
  }
14006
14008
  }, []), R = ve((z) => {
14007
14009
  const F = Ot();
14008
- for (const [P, D] of F) {
14010
+ for (const [I, D] of F) {
14009
14011
  if (!D.manifest.permissions.includes("events:messaging"))
14010
14012
  continue;
14011
14013
  const O = D.manifest.events ?? [];
14012
- !O.includes("messaging") && !O.includes("messaging:postback") && !O.includes(`messaging:postback:${z.data.actionName}`) || Fe(P, {
14014
+ !O.includes("messaging") && !O.includes("messaging:postback") && !O.includes(`messaging:postback:${z.data.actionName}`) || Fe(I, {
14013
14015
  type: "extension-event",
14014
14016
  eventType: "messaging",
14015
14017
  payload: z
@@ -14017,18 +14019,18 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14017
14019
  }
14018
14020
  }, []), A = ve((z) => {
14019
14021
  const F = Ot();
14020
- for (const [P, D] of F) {
14022
+ for (const [I, D] of F) {
14021
14023
  if (!D.manifest.permissions.includes("events:activity"))
14022
14024
  continue;
14023
14025
  const O = D.manifest.events ?? [];
14024
- !O.includes("activity") && !O.includes(`activity:${z.eventName}`) || Fe(P, {
14026
+ !O.includes("activity") && !O.includes(`activity:${z.eventName}`) || Fe(I, {
14025
14027
  type: "extension-event",
14026
14028
  eventType: "activity",
14027
14029
  payload: z
14028
14030
  });
14029
14031
  }
14030
14032
  }, []), M = ve(async (z) => {
14031
- const F = Ot(), P = [];
14033
+ const F = Ot(), I = [];
14032
14034
  for (const [O, W] of F) {
14033
14035
  if (!W.manifest.permissions.includes("extend:identity"))
14034
14036
  continue;
@@ -14045,11 +14047,11 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14045
14047
  claims: z
14046
14048
  });
14047
14049
  });
14048
- P.push($);
14050
+ I.push($);
14049
14051
  }
14050
- if (P.length === 0)
14052
+ if (I.length === 0)
14051
14053
  return {};
14052
- const D = await Promise.all(P);
14054
+ const D = await Promise.all(I);
14053
14055
  return Object.assign({}, ...D);
14054
14056
  }, []), H = ve(async (z) => {
14055
14057
  if (!n || !o || !e)
@@ -14057,47 +14059,47 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14057
14059
  const F = Gt(n, `/instances/${o}/${e}/identity`);
14058
14060
  console.log("[embeddables] Calling identity sign:", { url: F, claims: Object.keys(z) });
14059
14061
  try {
14060
- const P = await fetch(F, {
14062
+ const I = await fetch(F, {
14061
14063
  method: "POST",
14062
14064
  headers: { "Content-Type": "application/json" },
14063
14065
  body: JSON.stringify(z)
14064
14066
  });
14065
- if (!P.ok)
14066
- return console.warn(`[embeddables] Identity sign failed (${P.status})`), null;
14067
- const { token: D } = await P.json();
14067
+ if (!I.ok)
14068
+ return console.warn(`[embeddables] Identity sign failed (${I.status})`), null;
14069
+ const { token: D } = await I.json();
14068
14070
  return D;
14069
- } catch (P) {
14070
- return console.warn("[embeddables] Identity sign request failed:", P), null;
14071
+ } catch (I) {
14072
+ return console.warn("[embeddables] Identity sign request failed:", I), null;
14071
14073
  }
14072
14074
  }, [n, o, e]), L = ve((z) => {
14073
14075
  const F = window.zE;
14074
- F && F("messenger", "loginUser", async (P) => {
14075
- P(z);
14076
+ F && F("messenger", "loginUser", async (I) => {
14077
+ I(z);
14076
14078
  });
14077
14079
  }, []), U = ve(() => {
14078
14080
  const z = window.zE;
14079
14081
  z && z("messenger", "logoutUser");
14080
14082
  }, []), j = ve((z) => {
14081
14083
  console.log("[embeddables] Running sign lifecycle for user:", z.id);
14082
- const { email: F, name: P } = z, D = { external_id: String(z.id) };
14084
+ const { email: F, name: I } = z, D = { external_id: String(z.id) };
14083
14085
  (async () => {
14084
- const O = await M({ ...D, email: F, name: P });
14086
+ const O = await M({ ...D, email: F, name: I });
14085
14087
  console.log("[embeddables] Enriched claims:", O);
14086
14088
  const W = await H({
14087
14089
  ...D,
14088
14090
  ...O,
14089
14091
  email: F,
14090
- name: P
14092
+ name: I
14091
14093
  });
14092
14094
  console.log("[embeddables] Sign result:", { hasToken: !!W }), W && L(W);
14093
14095
  })();
14094
14096
  }, [M, H, L]), te = ve((z) => {
14095
- if (I.length > 0 && N.current.size < I.length) {
14096
- console.log(`[embeddables] Deferring sign lifecycle — waiting for extend:identity extensions: ${N.current.size}/${I.length} ready`), C.current = z;
14097
+ if (P.length > 0 && N.current.size < P.length) {
14098
+ console.log(`[embeddables] Deferring sign lifecycle — waiting for extend:identity extensions: ${N.current.size}/${P.length} ready`), C.current = z;
14097
14099
  return;
14098
14100
  }
14099
14101
  console.log("[embeddables] No extend:identity extensions (or all ready) — signing immediately"), j(z);
14100
- }, [I, j]);
14102
+ }, [P, j]);
14101
14103
  ae(() => {
14102
14104
  if (!w) {
14103
14105
  console.log("[embeddables] Identity effect skipped — extensions not loaded yet");
@@ -14115,22 +14117,22 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14115
14117
  }
14116
14118
  };
14117
14119
  T((F) => {
14118
- var P, D;
14119
- return F.authenticated && ((P = F.user) == null ? void 0 : P.id) === ((D = z.user) == null ? void 0 : D.id) ? F : (console.log("[embeddables] Identity state changed (props), starting sign lifecycle"), te(z.user), _("login", z), z);
14120
+ var I, D;
14121
+ return F.authenticated && ((I = F.user) == null ? void 0 : I.id) === ((D = z.user) == null ? void 0 : D.id) ? F : (console.log("[embeddables] Identity state changed (props), starting sign lifecycle"), te(z.user), _("login", z), z);
14120
14122
  });
14121
14123
  } else {
14122
14124
  if (s === void 0)
14123
14125
  return;
14124
14126
  T((z) => z.authenticated ? (console.log("[embeddables] Customer props cleared, logging out"), U(), _("logout", { authenticated: !1, user: null }), { authenticated: !1, user: null }) : z);
14125
14127
  }
14126
- }, [w, s, i, a, I, te, _, U]), ae(() => {
14128
+ }, [w, s, i, a, P, te, _, U]), ae(() => {
14127
14129
  if (!w || s !== void 0)
14128
14130
  return;
14129
14131
  const z = () => {
14130
- const P = document.getElementById("stackable-identity");
14131
- if (P)
14132
+ const I = document.getElementById("stackable-identity");
14133
+ if (I)
14132
14134
  try {
14133
- const D = JSON.parse(P.textContent ?? "{}"), O = {
14135
+ const D = JSON.parse(I.textContent ?? "{}"), O = {
14134
14136
  authenticated: !0,
14135
14137
  user: {
14136
14138
  id: String(D.customerId ?? ""),
@@ -14156,10 +14158,10 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14156
14158
  if (!S.authenticated)
14157
14159
  return;
14158
14160
  const z = (F) => {
14159
- const P = F.data;
14160
- if ((P == null ? void 0 : P.type) !== "extension-ready")
14161
+ const I = F.data;
14162
+ if ((I == null ? void 0 : I.type) !== "extension-ready")
14161
14163
  return;
14162
- const D = P.extensionId, O = c.find(($) => $.id === D);
14164
+ const D = I.extensionId, O = c.find(($) => $.id === D);
14163
14165
  if (!(O != null && O.manifest.permissions.includes("events:identity")))
14164
14166
  return;
14165
14167
  const W = O.manifest.events ?? [];
@@ -14171,14 +14173,14 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14171
14173
  };
14172
14174
  return window.addEventListener("message", z), () => window.removeEventListener("message", z);
14173
14175
  }, [S, c]), ae(() => {
14174
- if (I.length === 0)
14176
+ if (P.length === 0)
14175
14177
  return;
14176
- const z = (P) => {
14177
- const D = P.data;
14178
+ const z = (I) => {
14179
+ const D = I.data;
14178
14180
  if ((D == null ? void 0 : D.type) !== "extension-ready")
14179
14181
  return;
14180
14182
  const O = D.extensionId;
14181
- if (I.includes(O) && (N.current.add(O), console.log(`[embeddables] extend:identity extension ready: ${O} (${N.current.size}/${I.length})`), N.current.size >= I.length && C.current)) {
14183
+ if (P.includes(O) && (N.current.add(O), console.log(`[embeddables] extend:identity extension ready: ${O} (${N.current.size}/${P.length})`), N.current.size >= P.length && C.current)) {
14182
14184
  console.log("[embeddables] All extend:identity extensions ready, running deferred sign lifecycle");
14183
14185
  const W = C.current;
14184
14186
  C.current = null, j(W);
@@ -14187,38 +14189,38 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14187
14189
  window.addEventListener("message", z);
14188
14190
  const F = setTimeout(() => {
14189
14191
  if (C.current) {
14190
- console.warn(`[embeddables] extend:identity timeout (5s) — signing with ${N.current.size}/${I.length} extensions ready`);
14191
- const P = C.current;
14192
- C.current = null, j(P);
14192
+ console.warn(`[embeddables] extend:identity timeout (5s) — signing with ${N.current.size}/${P.length} extensions ready`);
14193
+ const I = C.current;
14194
+ C.current = null, j(I);
14193
14195
  }
14194
14196
  }, 5e3);
14195
14197
  return () => {
14196
14198
  window.removeEventListener("message", z), clearTimeout(F);
14197
14199
  };
14198
- }, [I, j]), ae(() => {
14200
+ }, [P, j]), ae(() => {
14199
14201
  const z = (F) => {
14200
- const { detail: P } = F;
14201
- P != null && P.eventName && (P.eventName === "postback" ? R({
14202
+ const { detail: I } = F;
14203
+ I != null && I.eventName && (I.eventName === "postback" ? R({
14202
14204
  eventName: "postback",
14203
14205
  data: {
14204
- actionName: P.data.actionName,
14205
- conversationId: P.data.conversationId ?? "",
14206
+ actionName: I.data.actionName,
14207
+ conversationId: I.data.conversationId ?? "",
14206
14208
  timestamp: oo((/* @__PURE__ */ new Date()).toISOString())
14207
14209
  }
14208
- }) : P.eventName === "context" && k((D) => ({ ...D, ...P.data })));
14210
+ }) : I.eventName === "context" && k((D) => ({ ...D, ...I.data })));
14209
14211
  };
14210
14212
  return window.addEventListener("stackable:messaging", z), () => window.removeEventListener("stackable:messaging", z);
14211
14213
  }, [R]), ae(() => {
14212
14214
  const z = (F) => {
14213
- const { detail: P } = F;
14214
- P != null && P.eventName && A({
14215
- eventName: P.eventName,
14216
- data: P.data ?? {}
14215
+ const { detail: I } = F;
14216
+ I != null && I.eventName && A({
14217
+ eventName: I.eventName,
14218
+ data: I.data ?? {}
14217
14219
  });
14218
14220
  };
14219
14221
  return window.addEventListener("stackable:activity", z), () => window.removeEventListener("stackable:activity", z);
14220
14222
  }, [A]), ae(() => {
14221
- var P;
14223
+ var I;
14222
14224
  if (!w)
14223
14225
  return;
14224
14226
  const z = {
@@ -14231,7 +14233,7 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14231
14233
  for (const [D, O] of F) {
14232
14234
  if (!O.manifest.permissions.includes("context:read"))
14233
14235
  continue;
14234
- const W = (P = v.get(D)) == null ? void 0 : P.settings, $ = W ? { ...z, settings: W } : z;
14236
+ const W = (I = v.get(D)) == null ? void 0 : I.settings, $ = W ? { ...z, settings: W } : z;
14235
14237
  Fe(D, { type: "context-push", context: $ });
14236
14238
  }
14237
14239
  }, [w, s, i, a, S, E, v]);
@@ -14240,8 +14242,8 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14240
14242
  // TODO(data.query-deprecation): Remove when data.query is deprecated — host-native ecommerce route replaced by extension + data.fetch
14241
14243
  "data.query": async (z) => Jl(z, t),
14242
14244
  "data.fetch": async (z, F) => {
14243
- const P = v.get(z);
14244
- if (!P)
14245
+ const I = v.get(z);
14246
+ if (!I)
14245
14247
  return {
14246
14248
  status: 0,
14247
14249
  ok: !1,
@@ -14260,7 +14262,7 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14260
14262
  "Content-Type": "application/json",
14261
14263
  "X-Extension-Id": z,
14262
14264
  "X-Application-Id": o ?? "",
14263
- Authorization: `Bearer ${P.token}`
14265
+ Authorization: `Bearer ${I.token}`
14264
14266
  },
14265
14267
  body: JSON.stringify(D)
14266
14268
  }), $ = await W.json();
@@ -14271,7 +14273,7 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14271
14273
  };
14272
14274
  },
14273
14275
  "actions.toast": async (z, F) => {
14274
- const P = {
14276
+ const I = {
14275
14277
  ...F.description && { description: F.description },
14276
14278
  ...F.duration && { duration: F.duration },
14277
14279
  ...F.position && { position: F.position },
@@ -14287,29 +14289,29 @@ const Ge = (e) => e == null ? void 0 : e === !0 || e === "true", Yl = {
14287
14289
  loading: F.loading ?? F.message,
14288
14290
  success: F.success ?? F.message,
14289
14291
  error: F.error ?? "Something went wrong",
14290
- ...P
14292
+ ...I
14291
14293
  });
14292
14294
  return;
14293
14295
  }
14294
14296
  switch (F.type) {
14295
14297
  case "success": {
14296
- At.success(F.message, P);
14298
+ At.success(F.message, I);
14297
14299
  break;
14298
14300
  }
14299
14301
  case "error": {
14300
- At.error(F.message, P);
14302
+ At.error(F.message, I);
14301
14303
  break;
14302
14304
  }
14303
14305
  case "warning": {
14304
- At.warning(F.message, P);
14306
+ At.warning(F.message, I);
14305
14307
  break;
14306
14308
  }
14307
14309
  case "info": {
14308
- At.info(F.message, P);
14310
+ At.info(F.message, I);
14309
14311
  break;
14310
14312
  }
14311
14313
  default:
14312
- At(F.message, P);
14314
+ At(F.message, I);
14313
14315
  }
14314
14316
  },
14315
14317
  "actions.invoke": async (z) => (window.dispatchEvent(new CustomEvent(`stackable:action:${z.action}`, { detail: z })), { success: !0 }),
@@ -14802,7 +14804,7 @@ const Ky = ({ ...e }) => {
14802
14804
  M.disconnect();
14803
14805
  };
14804
14806
  }, []);
14805
- const I = ve((R) => {
14807
+ const P = ve((R) => {
14806
14808
  if (R.detail === 2) {
14807
14809
  y(a);
14808
14810
  return;
@@ -14950,7 +14952,7 @@ const Ky = ({ ...e }) => {
14950
14952
  p ? "top-0 bottom-0 w-3 -ml-2.5 cursor-col-resize" : "w-full h-3 -mt-2.5 cursor-row-resize"
14951
14953
  ),
14952
14954
  style: p ? { left: `${b}%` } : { top: `${b}%` },
14953
- onMouseDown: I,
14955
+ onMouseDown: P,
14954
14956
  role: "separator",
14955
14957
  "aria-label": "Resize panels",
14956
14958
  "aria-orientation": p ? "vertical" : "horizontal",