@stackable-labs/embeddables 1.83.3 → 1.84.0
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 +545 -530
- package/dist/stackable-widget.external.js +7 -7
- package/dist/stackable-widget.js +11 -11
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as kn from "react-dom";
|
|
|
5
5
|
import hs from "react-dom";
|
|
6
6
|
const nl = () => {
|
|
7
7
|
try {
|
|
8
|
-
return "
|
|
8
|
+
return "ec4bb3a4-4213-4000-818d-f0f7e06b1c72";
|
|
9
9
|
} catch {
|
|
10
10
|
return "dev";
|
|
11
11
|
}
|
|
@@ -402,7 +402,7 @@ const yt = {
|
|
|
402
402
|
c = await e["actions.invoke"](r.payload);
|
|
403
403
|
break;
|
|
404
404
|
case "context.read":
|
|
405
|
-
c = await e["context.read"]();
|
|
405
|
+
c = await e["context.read"](s);
|
|
406
406
|
break;
|
|
407
407
|
case "extend.identity":
|
|
408
408
|
c = e["extend.identity"] ? await e["extend.identity"](s, r.payload) : null;
|
|
@@ -550,30 +550,30 @@ const yt = {
|
|
|
550
550
|
return;
|
|
551
551
|
const y = (w) => {
|
|
552
552
|
const x = w.data;
|
|
553
|
-
if (!(!x || typeof x != "object" || !m.some((
|
|
554
|
-
const
|
|
555
|
-
return
|
|
553
|
+
if (!(!x || typeof x != "object" || !m.some((R) => {
|
|
554
|
+
const T = Nt(R.id);
|
|
555
|
+
return T && w.source === T.iframe.contentWindow;
|
|
556
556
|
}))) {
|
|
557
557
|
if (x.type === "surface-update" && x.surfaceId === e) {
|
|
558
|
-
const
|
|
559
|
-
const E = Nt(
|
|
558
|
+
const R = m.find((N) => {
|
|
559
|
+
const E = Nt(N.id);
|
|
560
560
|
return E && w.source === E.iframe.contentWindow;
|
|
561
561
|
});
|
|
562
|
-
if (!
|
|
562
|
+
if (!R)
|
|
563
563
|
return;
|
|
564
|
-
const
|
|
565
|
-
u((
|
|
566
|
-
...
|
|
567
|
-
[
|
|
564
|
+
const T = h(x.tree, w.source ?? null);
|
|
565
|
+
u((N) => ({
|
|
566
|
+
...N,
|
|
567
|
+
[R.id]: T
|
|
568
568
|
}));
|
|
569
569
|
}
|
|
570
570
|
if (x.type === "surface-ready" && x.surfaceId === e && t) {
|
|
571
|
-
const
|
|
572
|
-
m.forEach((
|
|
571
|
+
const R = gl(t);
|
|
572
|
+
m.forEach((T) => {
|
|
573
573
|
var E;
|
|
574
|
-
const
|
|
575
|
-
(E =
|
|
576
|
-
{ type: "context-update", surfaceId: e, context:
|
|
574
|
+
const N = Nt(T.id);
|
|
575
|
+
(E = N == null ? void 0 : N.iframe.contentWindow) == null || E.postMessage(
|
|
576
|
+
{ type: "context-update", surfaceId: e, context: R },
|
|
577
577
|
"*"
|
|
578
578
|
);
|
|
579
579
|
});
|
|
@@ -603,14 +603,14 @@ const yt = {
|
|
|
603
603
|
}) : /* @__PURE__ */ f(I.Fragment, { children: v.children }, v.id), C = /* @__PURE__ */ f(I.Fragment, { children: x }, `extension:${v.id}`);
|
|
604
604
|
if (y === 0 || !o)
|
|
605
605
|
return [C];
|
|
606
|
-
const
|
|
606
|
+
const R = w[y - 1], T = typeof o == "function" ? o({
|
|
607
607
|
index: y,
|
|
608
608
|
total: w.length,
|
|
609
|
-
previousExtensionId:
|
|
609
|
+
previousExtensionId: R.id,
|
|
610
610
|
extensionId: v.id
|
|
611
611
|
}) : o;
|
|
612
612
|
return [
|
|
613
|
-
/* @__PURE__ */ f(I.Fragment, { children:
|
|
613
|
+
/* @__PURE__ */ f(I.Fragment, { children: T }, `separator:${R.id}:${v.id}:${y}`),
|
|
614
614
|
C
|
|
615
615
|
];
|
|
616
616
|
}) : r;
|
|
@@ -904,15 +904,15 @@ function Bl(e) {
|
|
|
904
904
|
}
|
|
905
905
|
const Hl = (e) => {
|
|
906
906
|
var t, n, o, r, s, a, i, c, d;
|
|
907
|
-
const { invert: u, toast: l, unstyled: m, interacting: h, setHeights: b, visibleToasts: g, heights: v, index: y, toasts: w, expanded: x, removeToast: C, defaultRichColors:
|
|
907
|
+
const { invert: u, toast: l, unstyled: m, interacting: h, setHeights: b, visibleToasts: g, heights: v, index: y, toasts: w, expanded: x, removeToast: C, defaultRichColors: R, closeButton: T, style: N, cancelButtonStyle: E, actionButtonStyle: L, className: W = "", descriptionClassName: M = "", duration: F, position: H, gap: O, expandByDefault: K, classNames: A, icons: D, closeButtonAriaLabel: U = "Close toast" } = e, [k, S] = I.useState(null), [_, $] = I.useState(null), [P, z] = I.useState(!1), [B, J] = I.useState(!1), [j, Y] = I.useState(!1), [ee, te] = I.useState(!1), [se, oe] = I.useState(!1), [ue, fe] = I.useState(0), [at, Ke] = I.useState(0), Te = I.useRef(l.duration || F || wr), Zt = I.useRef(null), ye = I.useRef(null), Wc = y === 0, Uc = y + 1 <= g, Se = l.type, gt = l.dismissible !== !1, jc = l.className || "", Gc = l.descriptionClassName || "", Jt = I.useMemo(() => v.findIndex((ne) => ne.toastId === l.id) || 0, [
|
|
908
908
|
v,
|
|
909
909
|
l.id
|
|
910
910
|
]), Yc = I.useMemo(() => {
|
|
911
911
|
var ne;
|
|
912
|
-
return (ne = l.closeButton) != null ? ne :
|
|
912
|
+
return (ne = l.closeButton) != null ? ne : T;
|
|
913
913
|
}, [
|
|
914
914
|
l.closeButton,
|
|
915
|
-
|
|
915
|
+
T
|
|
916
916
|
]), fr = I.useMemo(() => l.duration || F || wr, [
|
|
917
917
|
l.duration,
|
|
918
918
|
F
|
|
@@ -928,7 +928,7 @@ const Hl = (e) => {
|
|
|
928
928
|
}, [
|
|
929
929
|
fr
|
|
930
930
|
]), I.useEffect(() => {
|
|
931
|
-
|
|
931
|
+
z(!0);
|
|
932
932
|
}, []), I.useEffect(() => {
|
|
933
933
|
const ne = ye.current;
|
|
934
934
|
if (ne) {
|
|
@@ -946,7 +946,7 @@ const Hl = (e) => {
|
|
|
946
946
|
b,
|
|
947
947
|
l.id
|
|
948
948
|
]), I.useLayoutEffect(() => {
|
|
949
|
-
if (!
|
|
949
|
+
if (!P) return;
|
|
950
950
|
const ne = ye.current, me = ne.style.height;
|
|
951
951
|
ne.style.height = "auto";
|
|
952
952
|
const ge = ne.getBoundingClientRect().height;
|
|
@@ -962,7 +962,7 @@ const Hl = (e) => {
|
|
|
962
962
|
...Ce
|
|
963
963
|
]);
|
|
964
964
|
}, [
|
|
965
|
-
|
|
965
|
+
P,
|
|
966
966
|
l.title,
|
|
967
967
|
l.description,
|
|
968
968
|
b,
|
|
@@ -1013,12 +1013,12 @@ const Hl = (e) => {
|
|
|
1013
1013
|
if (D != null && D.loading) {
|
|
1014
1014
|
var me;
|
|
1015
1015
|
return /* @__PURE__ */ I.createElement("div", {
|
|
1016
|
-
className: ze(
|
|
1016
|
+
className: ze(A == null ? void 0 : A.loader, l == null || (me = l.classNames) == null ? void 0 : me.loader, "sonner-loader"),
|
|
1017
1017
|
"data-visible": Se === "loading"
|
|
1018
1018
|
}, D.loading);
|
|
1019
1019
|
}
|
|
1020
1020
|
return /* @__PURE__ */ I.createElement(wl, {
|
|
1021
|
-
className: ze(
|
|
1021
|
+
className: ze(A == null ? void 0 : A.loader, l == null || (ne = l.classNames) == null ? void 0 : ne.loader),
|
|
1022
1022
|
visible: Se === "loading"
|
|
1023
1023
|
});
|
|
1024
1024
|
}
|
|
@@ -1027,11 +1027,11 @@ const Hl = (e) => {
|
|
|
1027
1027
|
return /* @__PURE__ */ I.createElement("li", {
|
|
1028
1028
|
tabIndex: 0,
|
|
1029
1029
|
ref: ye,
|
|
1030
|
-
className: ze(W, jc,
|
|
1030
|
+
className: ze(W, jc, A == null ? void 0 : A.toast, l == null || (t = l.classNames) == null ? void 0 : t.toast, A == null ? void 0 : A.default, A == null ? void 0 : A[Se], l == null || (n = l.classNames) == null ? void 0 : n[Se]),
|
|
1031
1031
|
"data-sonner-toast": "",
|
|
1032
|
-
"data-rich-colors": (gr = l.richColors) != null ? gr :
|
|
1032
|
+
"data-rich-colors": (gr = l.richColors) != null ? gr : R,
|
|
1033
1033
|
"data-styled": !(l.jsx || l.unstyled || m),
|
|
1034
|
-
"data-mounted":
|
|
1034
|
+
"data-mounted": P,
|
|
1035
1035
|
"data-promise": !!l.promise,
|
|
1036
1036
|
"data-swiped": se,
|
|
1037
1037
|
"data-removed": B,
|
|
@@ -1045,8 +1045,8 @@ const Hl = (e) => {
|
|
|
1045
1045
|
"data-type": Se,
|
|
1046
1046
|
"data-invert": Xc,
|
|
1047
1047
|
"data-swipe-out": ee,
|
|
1048
|
-
"data-swipe-direction":
|
|
1049
|
-
"data-expanded": !!(x || K &&
|
|
1048
|
+
"data-swipe-direction": _,
|
|
1049
|
+
"data-expanded": !!(x || K && P),
|
|
1050
1050
|
"data-testid": l.testId,
|
|
1051
1051
|
style: {
|
|
1052
1052
|
"--index": y,
|
|
@@ -1054,7 +1054,7 @@ const Hl = (e) => {
|
|
|
1054
1054
|
"--z-index": w.length - y,
|
|
1055
1055
|
"--offset": `${B ? ue : vt.current}px`,
|
|
1056
1056
|
"--initial-height": K ? "auto" : `${at}px`,
|
|
1057
|
-
...
|
|
1057
|
+
...N,
|
|
1058
1058
|
...l.style
|
|
1059
1059
|
},
|
|
1060
1060
|
onDragEnd: () => {
|
|
@@ -1070,9 +1070,9 @@ const Hl = (e) => {
|
|
|
1070
1070
|
var ne, me, ge;
|
|
1071
1071
|
if (ee || !gt) return;
|
|
1072
1072
|
bt.current = null;
|
|
1073
|
-
const Ce = Number(((ne = ye.current) == null ? void 0 : ne.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), Qt = Number(((me = ye.current) == null ? void 0 : me.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), he = (/* @__PURE__ */ new Date()).getTime() - ((ge = Zt.current) == null ? void 0 : ge.getTime()), Ne =
|
|
1073
|
+
const Ce = Number(((ne = ye.current) == null ? void 0 : ne.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), Qt = Number(((me = ye.current) == null ? void 0 : me.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), he = (/* @__PURE__ */ new Date()).getTime() - ((ge = Zt.current) == null ? void 0 : ge.getTime()), Ne = k === "x" ? Ce : Qt, en = Math.abs(Ne) / he;
|
|
1074
1074
|
if (Math.abs(Ne) >= $l || en > 0.11) {
|
|
1075
|
-
fe(vt.current), l.onDismiss == null || l.onDismiss.call(l, l),
|
|
1075
|
+
fe(vt.current), l.onDismiss == null || l.onDismiss.call(l, l), $(k === "x" ? Ce > 0 ? "right" : "left" : Qt > 0 ? "down" : "up"), Xe(), te(!0);
|
|
1076
1076
|
return;
|
|
1077
1077
|
} else {
|
|
1078
1078
|
var Pe, Ae;
|
|
@@ -1086,13 +1086,13 @@ const Hl = (e) => {
|
|
|
1086
1086
|
const he = ne.clientY - bt.current.y, Ne = ne.clientX - bt.current.x;
|
|
1087
1087
|
var en;
|
|
1088
1088
|
const Pe = (en = e.swipeDirections) != null ? en : Bl(H);
|
|
1089
|
-
!
|
|
1089
|
+
!k && (Math.abs(Ne) > 1 || Math.abs(he) > 1) && S(Math.abs(Ne) > Math.abs(he) ? "x" : "y");
|
|
1090
1090
|
let Ae = {
|
|
1091
1091
|
x: 0,
|
|
1092
1092
|
y: 0
|
|
1093
1093
|
};
|
|
1094
1094
|
const br = (it) => 1 / (1.5 + Math.abs(it) / 20);
|
|
1095
|
-
if (
|
|
1095
|
+
if (k === "y") {
|
|
1096
1096
|
if (Pe.includes("top") || Pe.includes("bottom"))
|
|
1097
1097
|
if (Pe.includes("top") && he < 0 || Pe.includes("bottom") && he > 0)
|
|
1098
1098
|
Ae.y = he;
|
|
@@ -1100,7 +1100,7 @@ const Hl = (e) => {
|
|
|
1100
1100
|
const it = he * br(he);
|
|
1101
1101
|
Ae.y = Math.abs(it) < Math.abs(he) ? it : he;
|
|
1102
1102
|
}
|
|
1103
|
-
} else if (
|
|
1103
|
+
} else if (k === "x" && (Pe.includes("left") || Pe.includes("right")))
|
|
1104
1104
|
if (Pe.includes("left") && Ne < 0 || Pe.includes("right") && Ne > 0)
|
|
1105
1105
|
Ae.x = Ne;
|
|
1106
1106
|
else {
|
|
@@ -1117,19 +1117,19 @@ const Hl = (e) => {
|
|
|
1117
1117
|
} : () => {
|
|
1118
1118
|
Xe(), l.onDismiss == null || l.onDismiss.call(l, l);
|
|
1119
1119
|
},
|
|
1120
|
-
className: ze(
|
|
1120
|
+
className: ze(A == null ? void 0 : A.closeButton, l == null || (o = l.classNames) == null ? void 0 : o.closeButton)
|
|
1121
1121
|
}, (vr = D == null ? void 0 : D.close) != null ? vr : kl) : null, (Se || l.icon || l.promise) && l.icon !== null && ((D == null ? void 0 : D[Se]) !== null || l.icon) ? /* @__PURE__ */ I.createElement("div", {
|
|
1122
1122
|
"data-icon": "",
|
|
1123
|
-
className: ze(
|
|
1123
|
+
className: ze(A == null ? void 0 : A.icon, l == null || (r = l.classNames) == null ? void 0 : r.icon)
|
|
1124
1124
|
}, l.promise || l.type === "loading" && !l.icon ? l.icon || Zc() : null, l.type !== "loading" ? Jc : null) : null, /* @__PURE__ */ I.createElement("div", {
|
|
1125
1125
|
"data-content": "",
|
|
1126
|
-
className: ze(
|
|
1126
|
+
className: ze(A == null ? void 0 : A.content, l == null || (s = l.classNames) == null ? void 0 : s.content)
|
|
1127
1127
|
}, /* @__PURE__ */ I.createElement("div", {
|
|
1128
1128
|
"data-title": "",
|
|
1129
|
-
className: ze(
|
|
1129
|
+
className: ze(A == null ? void 0 : A.title, l == null || (a = l.classNames) == null ? void 0 : a.title)
|
|
1130
1130
|
}, l.jsx ? l.jsx : typeof l.title == "function" ? l.title() : l.title), l.description ? /* @__PURE__ */ I.createElement("div", {
|
|
1131
1131
|
"data-description": "",
|
|
1132
|
-
className: ze(M, Gc,
|
|
1132
|
+
className: ze(M, Gc, A == null ? void 0 : A.description, l == null || (i = l.classNames) == null ? void 0 : i.description)
|
|
1133
1133
|
}, typeof l.description == "function" ? l.description() : l.description) : null), /* @__PURE__ */ I.isValidElement(l.cancel) ? l.cancel : l.cancel && nn(l.cancel) ? /* @__PURE__ */ I.createElement("button", {
|
|
1134
1134
|
"data-button": !0,
|
|
1135
1135
|
"data-cancel": !0,
|
|
@@ -1137,7 +1137,7 @@ const Hl = (e) => {
|
|
|
1137
1137
|
onClick: (ne) => {
|
|
1138
1138
|
nn(l.cancel) && gt && (l.cancel.onClick == null || l.cancel.onClick.call(l.cancel, ne), Xe());
|
|
1139
1139
|
},
|
|
1140
|
-
className: ze(
|
|
1140
|
+
className: ze(A == null ? void 0 : A.cancelButton, l == null || (c = l.classNames) == null ? void 0 : c.cancelButton)
|
|
1141
1141
|
}, l.cancel.label) : null, /* @__PURE__ */ I.isValidElement(l.action) ? l.action : l.action && nn(l.action) ? /* @__PURE__ */ I.createElement("button", {
|
|
1142
1142
|
"data-button": !0,
|
|
1143
1143
|
"data-action": !0,
|
|
@@ -1145,7 +1145,7 @@ const Hl = (e) => {
|
|
|
1145
1145
|
onClick: (ne) => {
|
|
1146
1146
|
nn(l.action) && (l.action.onClick == null || l.action.onClick.call(l.action, ne), !ne.defaultPrevented && Xe());
|
|
1147
1147
|
},
|
|
1148
|
-
className: ze(
|
|
1148
|
+
className: ze(A == null ? void 0 : A.actionButton, l == null || (d = l.classNames) == null ? void 0 : d.actionButton)
|
|
1149
1149
|
}, l.action.label) : null);
|
|
1150
1150
|
};
|
|
1151
1151
|
function xr() {
|
|
@@ -1184,24 +1184,24 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1184
1184
|
const { id: o, invert: r, position: s = "bottom-right", hotkey: a = [
|
|
1185
1185
|
"altKey",
|
|
1186
1186
|
"KeyT"
|
|
1187
|
-
], expand: i, closeButton: c, className: d, offset: u, mobileOffset: l, theme: m = "light", richColors: h, duration: b, style: g, visibleToasts: v = Ml, toastOptions: y, dir: w = xr(), gap: x = zl, icons: C, containerAriaLabel:
|
|
1188
|
-
|
|
1187
|
+
], expand: i, closeButton: c, className: d, offset: u, mobileOffset: l, theme: m = "light", richColors: h, duration: b, style: g, visibleToasts: v = Ml, toastOptions: y, dir: w = xr(), gap: x = zl, icons: C, containerAriaLabel: R = "Notifications" } = t, [T, N] = I.useState([]), E = I.useMemo(() => o ? T.filter((P) => P.toasterId === o) : T.filter((P) => !P.toasterId), [
|
|
1188
|
+
T,
|
|
1189
1189
|
o
|
|
1190
1190
|
]), L = I.useMemo(() => Array.from(new Set([
|
|
1191
1191
|
s
|
|
1192
|
-
].concat(E.filter((
|
|
1192
|
+
].concat(E.filter((P) => P.position).map((P) => P.position)))), [
|
|
1193
1193
|
E,
|
|
1194
1194
|
s
|
|
1195
|
-
]), [W, M] = I.useState([]), [F, H] = I.useState(!1), [O, K] = I.useState(!1), [
|
|
1196
|
-
|
|
1195
|
+
]), [W, M] = I.useState([]), [F, H] = I.useState(!1), [O, K] = I.useState(!1), [A, D] = I.useState(m !== "system" ? m : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), U = I.useRef(null), k = a.join("+").replace(/Key/g, "").replace(/Digit/g, ""), S = I.useRef(null), _ = I.useRef(!1), $ = I.useCallback((P) => {
|
|
1196
|
+
N((z) => {
|
|
1197
1197
|
var B;
|
|
1198
|
-
return (B =
|
|
1198
|
+
return (B = z.find((J) => J.id === P.id)) != null && B.delete || we.dismiss(P.id), z.filter(({ id: J }) => J !== P.id);
|
|
1199
1199
|
});
|
|
1200
1200
|
}, []);
|
|
1201
|
-
return I.useEffect(() => we.subscribe((
|
|
1202
|
-
if (
|
|
1201
|
+
return I.useEffect(() => we.subscribe((P) => {
|
|
1202
|
+
if (P.dismiss) {
|
|
1203
1203
|
requestAnimationFrame(() => {
|
|
1204
|
-
|
|
1204
|
+
N((z) => z.map((B) => B.id === P.id ? {
|
|
1205
1205
|
...B,
|
|
1206
1206
|
delete: !0
|
|
1207
1207
|
} : B));
|
|
@@ -1210,37 +1210,37 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1210
1210
|
}
|
|
1211
1211
|
setTimeout(() => {
|
|
1212
1212
|
hs.flushSync(() => {
|
|
1213
|
-
|
|
1214
|
-
const B =
|
|
1213
|
+
N((z) => {
|
|
1214
|
+
const B = z.findIndex((J) => J.id === P.id);
|
|
1215
1215
|
return B !== -1 ? [
|
|
1216
|
-
|
|
1216
|
+
...z.slice(0, B),
|
|
1217
1217
|
{
|
|
1218
|
-
|
|
1219
|
-
...
|
|
1218
|
+
...z[B],
|
|
1219
|
+
...P
|
|
1220
1220
|
},
|
|
1221
|
-
|
|
1221
|
+
...z.slice(B + 1)
|
|
1222
1222
|
] : [
|
|
1223
|
-
|
|
1224
|
-
|
|
1223
|
+
P,
|
|
1224
|
+
...z
|
|
1225
1225
|
];
|
|
1226
1226
|
});
|
|
1227
1227
|
});
|
|
1228
1228
|
});
|
|
1229
1229
|
}), [
|
|
1230
|
-
|
|
1230
|
+
T
|
|
1231
1231
|
]), I.useEffect(() => {
|
|
1232
1232
|
if (m !== "system") {
|
|
1233
1233
|
D(m);
|
|
1234
1234
|
return;
|
|
1235
1235
|
}
|
|
1236
1236
|
if (m === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? D("dark") : D("light")), typeof window > "u") return;
|
|
1237
|
-
const
|
|
1237
|
+
const P = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1238
1238
|
try {
|
|
1239
|
-
|
|
1240
|
-
D(
|
|
1239
|
+
P.addEventListener("change", ({ matches: z }) => {
|
|
1240
|
+
D(z ? "dark" : "light");
|
|
1241
1241
|
});
|
|
1242
1242
|
} catch {
|
|
1243
|
-
|
|
1243
|
+
P.addListener(({ matches: B }) => {
|
|
1244
1244
|
try {
|
|
1245
1245
|
D(B ? "dark" : "light");
|
|
1246
1246
|
} catch (J) {
|
|
@@ -1251,19 +1251,19 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1251
1251
|
}, [
|
|
1252
1252
|
m
|
|
1253
1253
|
]), I.useEffect(() => {
|
|
1254
|
-
|
|
1254
|
+
T.length <= 1 && H(!1);
|
|
1255
1255
|
}, [
|
|
1256
|
-
|
|
1256
|
+
T
|
|
1257
1257
|
]), I.useEffect(() => {
|
|
1258
|
-
const
|
|
1258
|
+
const P = (z) => {
|
|
1259
1259
|
var B;
|
|
1260
|
-
if (a.every((Y) =>
|
|
1260
|
+
if (a.every((Y) => z[Y] || z.code === Y)) {
|
|
1261
1261
|
var j;
|
|
1262
1262
|
H(!0), (j = U.current) == null || j.focus();
|
|
1263
1263
|
}
|
|
1264
|
-
|
|
1264
|
+
z.code === "Escape" && (document.activeElement === U.current || (B = U.current) != null && B.contains(document.activeElement)) && H(!1);
|
|
1265
1265
|
};
|
|
1266
|
-
return document.addEventListener("keydown",
|
|
1266
|
+
return document.addEventListener("keydown", P), () => document.removeEventListener("keydown", P);
|
|
1267
1267
|
}, [
|
|
1268
1268
|
a
|
|
1269
1269
|
]), I.useEffect(() => {
|
|
@@ -1271,30 +1271,30 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1271
1271
|
return () => {
|
|
1272
1272
|
S.current && (S.current.focus({
|
|
1273
1273
|
preventScroll: !0
|
|
1274
|
-
}), S.current = null,
|
|
1274
|
+
}), S.current = null, _.current = !1);
|
|
1275
1275
|
};
|
|
1276
1276
|
}, [
|
|
1277
1277
|
U.current
|
|
1278
1278
|
]), // Remove item from normal navigation flow, only available via hotkey
|
|
1279
1279
|
/* @__PURE__ */ I.createElement("section", {
|
|
1280
1280
|
ref: n,
|
|
1281
|
-
"aria-label": `${
|
|
1281
|
+
"aria-label": `${R} ${k}`,
|
|
1282
1282
|
tabIndex: -1,
|
|
1283
1283
|
"aria-live": "polite",
|
|
1284
1284
|
"aria-relevant": "additions text",
|
|
1285
1285
|
"aria-atomic": "false",
|
|
1286
1286
|
suppressHydrationWarning: !0
|
|
1287
|
-
}, L.map((
|
|
1287
|
+
}, L.map((P, z) => {
|
|
1288
1288
|
var B;
|
|
1289
|
-
const [J, j] =
|
|
1289
|
+
const [J, j] = P.split("-");
|
|
1290
1290
|
return E.length ? /* @__PURE__ */ I.createElement("ol", {
|
|
1291
|
-
key:
|
|
1291
|
+
key: P,
|
|
1292
1292
|
dir: w === "auto" ? xr() : w,
|
|
1293
1293
|
tabIndex: -1,
|
|
1294
1294
|
ref: U,
|
|
1295
1295
|
className: d,
|
|
1296
1296
|
"data-sonner-toaster": !0,
|
|
1297
|
-
"data-sonner-theme":
|
|
1297
|
+
"data-sonner-theme": A,
|
|
1298
1298
|
"data-y-position": J,
|
|
1299
1299
|
"data-x-position": j,
|
|
1300
1300
|
style: {
|
|
@@ -1305,12 +1305,12 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1305
1305
|
...Vl(u, l)
|
|
1306
1306
|
},
|
|
1307
1307
|
onBlur: (Y) => {
|
|
1308
|
-
|
|
1308
|
+
_.current && !Y.currentTarget.contains(Y.relatedTarget) && (_.current = !1, S.current && (S.current.focus({
|
|
1309
1309
|
preventScroll: !0
|
|
1310
1310
|
}), S.current = null));
|
|
1311
1311
|
},
|
|
1312
1312
|
onFocus: (Y) => {
|
|
1313
|
-
Y.target instanceof HTMLElement && Y.target.dataset.dismissible === "false" ||
|
|
1313
|
+
Y.target instanceof HTMLElement && Y.target.dataset.dismissible === "false" || _.current || (_.current = !0, S.current = Y.relatedTarget);
|
|
1314
1314
|
},
|
|
1315
1315
|
onMouseEnter: () => H(!0),
|
|
1316
1316
|
onMouseMove: () => H(!0),
|
|
@@ -1322,7 +1322,7 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1322
1322
|
Y.target instanceof HTMLElement && Y.target.dataset.dismissible === "false" || K(!0);
|
|
1323
1323
|
},
|
|
1324
1324
|
onPointerUp: () => K(!1)
|
|
1325
|
-
}, E.filter((Y) => !Y.position &&
|
|
1325
|
+
}, E.filter((Y) => !Y.position && z === 0 || Y.position === P).map((Y, ee) => {
|
|
1326
1326
|
var te, se;
|
|
1327
1327
|
return /* @__PURE__ */ I.createElement(Hl, {
|
|
1328
1328
|
key: Y.id,
|
|
@@ -1337,14 +1337,14 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1337
1337
|
visibleToasts: v,
|
|
1338
1338
|
closeButton: (se = y == null ? void 0 : y.closeButton) != null ? se : c,
|
|
1339
1339
|
interacting: O,
|
|
1340
|
-
position:
|
|
1340
|
+
position: P,
|
|
1341
1341
|
style: y == null ? void 0 : y.style,
|
|
1342
1342
|
unstyled: y == null ? void 0 : y.unstyled,
|
|
1343
1343
|
classNames: y == null ? void 0 : y.classNames,
|
|
1344
1344
|
cancelButtonStyle: y == null ? void 0 : y.cancelButtonStyle,
|
|
1345
1345
|
actionButtonStyle: y == null ? void 0 : y.actionButtonStyle,
|
|
1346
1346
|
closeButtonAriaLabel: y == null ? void 0 : y.closeButtonAriaLabel,
|
|
1347
|
-
removeToast:
|
|
1347
|
+
removeToast: $,
|
|
1348
1348
|
toasts: E.filter((oe) => oe.position == Y.position),
|
|
1349
1349
|
heights: W.filter((oe) => oe.position == Y.position),
|
|
1350
1350
|
setHeights: M,
|
|
@@ -2246,10 +2246,10 @@ const au = (e, t) => {
|
|
|
2246
2246
|
if (a.indexOf(C) > -1)
|
|
2247
2247
|
continue;
|
|
2248
2248
|
a.push(C);
|
|
2249
|
-
const
|
|
2250
|
-
for (let
|
|
2251
|
-
const
|
|
2252
|
-
a.push(x +
|
|
2249
|
+
const R = r(y, v);
|
|
2250
|
+
for (let T = 0; T < R.length; ++T) {
|
|
2251
|
+
const N = R[T];
|
|
2252
|
+
a.push(x + N);
|
|
2253
2253
|
}
|
|
2254
2254
|
c = u + (c.length > 0 ? " " + c : c);
|
|
2255
2255
|
}
|
|
@@ -2312,15 +2312,15 @@ const au = (e, t) => {
|
|
|
2312
2312
|
"bottom-left",
|
|
2313
2313
|
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
2314
2314
|
"left-bottom"
|
|
2315
|
-
],
|
|
2315
|
+
], R = () => [...C(), G, V], T = () => ["auto", "hidden", "clip", "visible", "scroll"], N = () => ["auto", "contain", "none"], E = () => [G, V, c], L = () => [Ze, "full", "auto", ...E()], W = () => [Je, "none", "subgrid", G, V], M = () => ["auto", {
|
|
2316
2316
|
span: ["full", Je, G, V]
|
|
2317
|
-
}, Je, G, V], F = () => [Je, "auto", G, V], H = () => ["auto", "min", "max", "fr", G, V], O = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], K = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"],
|
|
2317
|
+
}, Je, G, V], F = () => [Je, "auto", G, V], H = () => ["auto", "min", "max", "fr", G, V], O = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], K = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], A = () => ["auto", ...E()], D = () => [Ze, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...E()], U = () => [Ze, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...E()], k = () => [Ze, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...E()], S = () => [e, G, V], _ = () => [...C(), Ar, Pr, {
|
|
2318
2318
|
position: [G, V]
|
|
2319
|
-
}],
|
|
2319
|
+
}], $ = () => ["no-repeat", {
|
|
2320
2320
|
repeat: ["", "x", "y", "space", "round"]
|
|
2321
|
-
}],
|
|
2321
|
+
}], P = () => ["auto", "cover", "contain", Wu, $u, {
|
|
2322
2322
|
size: [G, V]
|
|
2323
|
-
}],
|
|
2323
|
+
}], z = () => [Jn, zt, ct], B = () => [
|
|
2324
2324
|
// Deprecated since Tailwind CSS v4.0.0
|
|
2325
2325
|
"",
|
|
2326
2326
|
"none",
|
|
@@ -2459,49 +2459,49 @@ const au = (e, t) => {
|
|
|
2459
2459
|
* @see https://tailwindcss.com/docs/object-position
|
|
2460
2460
|
*/
|
|
2461
2461
|
"object-position": [{
|
|
2462
|
-
object:
|
|
2462
|
+
object: R()
|
|
2463
2463
|
}],
|
|
2464
2464
|
/**
|
|
2465
2465
|
* Overflow
|
|
2466
2466
|
* @see https://tailwindcss.com/docs/overflow
|
|
2467
2467
|
*/
|
|
2468
2468
|
overflow: [{
|
|
2469
|
-
overflow:
|
|
2469
|
+
overflow: T()
|
|
2470
2470
|
}],
|
|
2471
2471
|
/**
|
|
2472
2472
|
* Overflow X
|
|
2473
2473
|
* @see https://tailwindcss.com/docs/overflow
|
|
2474
2474
|
*/
|
|
2475
2475
|
"overflow-x": [{
|
|
2476
|
-
"overflow-x":
|
|
2476
|
+
"overflow-x": T()
|
|
2477
2477
|
}],
|
|
2478
2478
|
/**
|
|
2479
2479
|
* Overflow Y
|
|
2480
2480
|
* @see https://tailwindcss.com/docs/overflow
|
|
2481
2481
|
*/
|
|
2482
2482
|
"overflow-y": [{
|
|
2483
|
-
"overflow-y":
|
|
2483
|
+
"overflow-y": T()
|
|
2484
2484
|
}],
|
|
2485
2485
|
/**
|
|
2486
2486
|
* Overscroll Behavior
|
|
2487
2487
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
2488
2488
|
*/
|
|
2489
2489
|
overscroll: [{
|
|
2490
|
-
overscroll:
|
|
2490
|
+
overscroll: N()
|
|
2491
2491
|
}],
|
|
2492
2492
|
/**
|
|
2493
2493
|
* Overscroll Behavior X
|
|
2494
2494
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
2495
2495
|
*/
|
|
2496
2496
|
"overscroll-x": [{
|
|
2497
|
-
"overscroll-x":
|
|
2497
|
+
"overscroll-x": N()
|
|
2498
2498
|
}],
|
|
2499
2499
|
/**
|
|
2500
2500
|
* Overscroll Behavior Y
|
|
2501
2501
|
* @see https://tailwindcss.com/docs/overscroll-behavior
|
|
2502
2502
|
*/
|
|
2503
2503
|
"overscroll-y": [{
|
|
2504
|
-
"overscroll-y":
|
|
2504
|
+
"overscroll-y": N()
|
|
2505
2505
|
}],
|
|
2506
2506
|
/**
|
|
2507
2507
|
* Position
|
|
@@ -2909,77 +2909,77 @@ const au = (e, t) => {
|
|
|
2909
2909
|
* @see https://tailwindcss.com/docs/margin
|
|
2910
2910
|
*/
|
|
2911
2911
|
m: [{
|
|
2912
|
-
m:
|
|
2912
|
+
m: A()
|
|
2913
2913
|
}],
|
|
2914
2914
|
/**
|
|
2915
2915
|
* Margin Inline
|
|
2916
2916
|
* @see https://tailwindcss.com/docs/margin
|
|
2917
2917
|
*/
|
|
2918
2918
|
mx: [{
|
|
2919
|
-
mx:
|
|
2919
|
+
mx: A()
|
|
2920
2920
|
}],
|
|
2921
2921
|
/**
|
|
2922
2922
|
* Margin Block
|
|
2923
2923
|
* @see https://tailwindcss.com/docs/margin
|
|
2924
2924
|
*/
|
|
2925
2925
|
my: [{
|
|
2926
|
-
my:
|
|
2926
|
+
my: A()
|
|
2927
2927
|
}],
|
|
2928
2928
|
/**
|
|
2929
2929
|
* Margin Inline Start
|
|
2930
2930
|
* @see https://tailwindcss.com/docs/margin
|
|
2931
2931
|
*/
|
|
2932
2932
|
ms: [{
|
|
2933
|
-
ms:
|
|
2933
|
+
ms: A()
|
|
2934
2934
|
}],
|
|
2935
2935
|
/**
|
|
2936
2936
|
* Margin Inline End
|
|
2937
2937
|
* @see https://tailwindcss.com/docs/margin
|
|
2938
2938
|
*/
|
|
2939
2939
|
me: [{
|
|
2940
|
-
me:
|
|
2940
|
+
me: A()
|
|
2941
2941
|
}],
|
|
2942
2942
|
/**
|
|
2943
2943
|
* Margin Block Start
|
|
2944
2944
|
* @see https://tailwindcss.com/docs/margin
|
|
2945
2945
|
*/
|
|
2946
2946
|
mbs: [{
|
|
2947
|
-
mbs:
|
|
2947
|
+
mbs: A()
|
|
2948
2948
|
}],
|
|
2949
2949
|
/**
|
|
2950
2950
|
* Margin Block End
|
|
2951
2951
|
* @see https://tailwindcss.com/docs/margin
|
|
2952
2952
|
*/
|
|
2953
2953
|
mbe: [{
|
|
2954
|
-
mbe:
|
|
2954
|
+
mbe: A()
|
|
2955
2955
|
}],
|
|
2956
2956
|
/**
|
|
2957
2957
|
* Margin Top
|
|
2958
2958
|
* @see https://tailwindcss.com/docs/margin
|
|
2959
2959
|
*/
|
|
2960
2960
|
mt: [{
|
|
2961
|
-
mt:
|
|
2961
|
+
mt: A()
|
|
2962
2962
|
}],
|
|
2963
2963
|
/**
|
|
2964
2964
|
* Margin Right
|
|
2965
2965
|
* @see https://tailwindcss.com/docs/margin
|
|
2966
2966
|
*/
|
|
2967
2967
|
mr: [{
|
|
2968
|
-
mr:
|
|
2968
|
+
mr: A()
|
|
2969
2969
|
}],
|
|
2970
2970
|
/**
|
|
2971
2971
|
* Margin Bottom
|
|
2972
2972
|
* @see https://tailwindcss.com/docs/margin
|
|
2973
2973
|
*/
|
|
2974
2974
|
mb: [{
|
|
2975
|
-
mb:
|
|
2975
|
+
mb: A()
|
|
2976
2976
|
}],
|
|
2977
2977
|
/**
|
|
2978
2978
|
* Margin Left
|
|
2979
2979
|
* @see https://tailwindcss.com/docs/margin
|
|
2980
2980
|
*/
|
|
2981
2981
|
ml: [{
|
|
2982
|
-
ml:
|
|
2982
|
+
ml: A()
|
|
2983
2983
|
}],
|
|
2984
2984
|
/**
|
|
2985
2985
|
* Space Between X
|
|
@@ -3041,21 +3041,21 @@ const au = (e, t) => {
|
|
|
3041
3041
|
* @see https://tailwindcss.com/docs/height
|
|
3042
3042
|
*/
|
|
3043
3043
|
"block-size": [{
|
|
3044
|
-
block: ["auto", ...
|
|
3044
|
+
block: ["auto", ...k()]
|
|
3045
3045
|
}],
|
|
3046
3046
|
/**
|
|
3047
3047
|
* Min-Block Size
|
|
3048
3048
|
* @see https://tailwindcss.com/docs/min-height
|
|
3049
3049
|
*/
|
|
3050
3050
|
"min-block-size": [{
|
|
3051
|
-
"min-block": ["auto", ...
|
|
3051
|
+
"min-block": ["auto", ...k()]
|
|
3052
3052
|
}],
|
|
3053
3053
|
/**
|
|
3054
3054
|
* Max-Block Size
|
|
3055
3055
|
* @see https://tailwindcss.com/docs/max-height
|
|
3056
3056
|
*/
|
|
3057
3057
|
"max-block-size": [{
|
|
3058
|
-
"max-block": ["none", ...
|
|
3058
|
+
"max-block": ["none", ...k()]
|
|
3059
3059
|
}],
|
|
3060
3060
|
/**
|
|
3061
3061
|
* Width
|
|
@@ -3390,21 +3390,21 @@ const au = (e, t) => {
|
|
|
3390
3390
|
* @see https://tailwindcss.com/docs/background-position
|
|
3391
3391
|
*/
|
|
3392
3392
|
"bg-position": [{
|
|
3393
|
-
bg:
|
|
3393
|
+
bg: _()
|
|
3394
3394
|
}],
|
|
3395
3395
|
/**
|
|
3396
3396
|
* Background Repeat
|
|
3397
3397
|
* @see https://tailwindcss.com/docs/background-repeat
|
|
3398
3398
|
*/
|
|
3399
3399
|
"bg-repeat": [{
|
|
3400
|
-
bg:
|
|
3400
|
+
bg: $()
|
|
3401
3401
|
}],
|
|
3402
3402
|
/**
|
|
3403
3403
|
* Background Size
|
|
3404
3404
|
* @see https://tailwindcss.com/docs/background-size
|
|
3405
3405
|
*/
|
|
3406
3406
|
"bg-size": [{
|
|
3407
|
-
bg:
|
|
3407
|
+
bg: P()
|
|
3408
3408
|
}],
|
|
3409
3409
|
/**
|
|
3410
3410
|
* Background Image
|
|
@@ -3431,21 +3431,21 @@ const au = (e, t) => {
|
|
|
3431
3431
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3432
3432
|
*/
|
|
3433
3433
|
"gradient-from-pos": [{
|
|
3434
|
-
from:
|
|
3434
|
+
from: z()
|
|
3435
3435
|
}],
|
|
3436
3436
|
/**
|
|
3437
3437
|
* Gradient Color Stops Via Position
|
|
3438
3438
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3439
3439
|
*/
|
|
3440
3440
|
"gradient-via-pos": [{
|
|
3441
|
-
via:
|
|
3441
|
+
via: z()
|
|
3442
3442
|
}],
|
|
3443
3443
|
/**
|
|
3444
3444
|
* Gradient Color Stops To Position
|
|
3445
3445
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3446
3446
|
*/
|
|
3447
3447
|
"gradient-to-pos": [{
|
|
3448
|
-
to:
|
|
3448
|
+
to: z()
|
|
3449
3449
|
}],
|
|
3450
3450
|
/**
|
|
3451
3451
|
* Gradient Color Stops From
|
|
@@ -4095,21 +4095,21 @@ const au = (e, t) => {
|
|
|
4095
4095
|
* @see https://tailwindcss.com/docs/mask-position
|
|
4096
4096
|
*/
|
|
4097
4097
|
"mask-position": [{
|
|
4098
|
-
mask:
|
|
4098
|
+
mask: _()
|
|
4099
4099
|
}],
|
|
4100
4100
|
/**
|
|
4101
4101
|
* Mask Repeat
|
|
4102
4102
|
* @see https://tailwindcss.com/docs/mask-repeat
|
|
4103
4103
|
*/
|
|
4104
4104
|
"mask-repeat": [{
|
|
4105
|
-
mask:
|
|
4105
|
+
mask: $()
|
|
4106
4106
|
}],
|
|
4107
4107
|
/**
|
|
4108
4108
|
* Mask Size
|
|
4109
4109
|
* @see https://tailwindcss.com/docs/mask-size
|
|
4110
4110
|
*/
|
|
4111
4111
|
"mask-size": [{
|
|
4112
|
-
mask:
|
|
4112
|
+
mask: P()
|
|
4113
4113
|
}],
|
|
4114
4114
|
/**
|
|
4115
4115
|
* Mask Type
|
|
@@ -4406,7 +4406,7 @@ const au = (e, t) => {
|
|
|
4406
4406
|
* @see https://tailwindcss.com/docs/perspective-origin
|
|
4407
4407
|
*/
|
|
4408
4408
|
"perspective-origin": [{
|
|
4409
|
-
"perspective-origin":
|
|
4409
|
+
"perspective-origin": R()
|
|
4410
4410
|
}],
|
|
4411
4411
|
/**
|
|
4412
4412
|
* Rotate
|
|
@@ -4502,7 +4502,7 @@ const au = (e, t) => {
|
|
|
4502
4502
|
* @see https://tailwindcss.com/docs/transform-origin
|
|
4503
4503
|
*/
|
|
4504
4504
|
"transform-origin": [{
|
|
4505
|
-
origin:
|
|
4505
|
+
origin: R()
|
|
4506
4506
|
}],
|
|
4507
4507
|
/**
|
|
4508
4508
|
* Transform Style
|
|
@@ -5183,8 +5183,8 @@ function Zs(e) {
|
|
|
5183
5183
|
d.displayName = i;
|
|
5184
5184
|
const u = e + "CollectionItemSlot", l = "data-radix-collection-item", m = /* @__PURE__ */ Wt(u), h = I.forwardRef(
|
|
5185
5185
|
(g, v) => {
|
|
5186
|
-
const { scope: y, children: w, ...x } = g, C = I.useRef(null),
|
|
5187
|
-
return I.useEffect(() => (
|
|
5186
|
+
const { scope: y, children: w, ...x } = g, C = I.useRef(null), R = ie(v, C), T = s(u, y);
|
|
5187
|
+
return I.useEffect(() => (T.itemMap.set(C, { ref: C, ...x }), () => void T.itemMap.delete(C))), /* @__PURE__ */ f(m, { [l]: "", ref: R, children: w });
|
|
5188
5188
|
}
|
|
5189
5189
|
);
|
|
5190
5190
|
h.displayName = u;
|
|
@@ -5195,7 +5195,7 @@ function Zs(e) {
|
|
|
5195
5195
|
if (!w) return [];
|
|
5196
5196
|
const x = Array.from(w.querySelectorAll(`[${l}]`));
|
|
5197
5197
|
return Array.from(v.itemMap.values()).sort(
|
|
5198
|
-
(
|
|
5198
|
+
(T, N) => x.indexOf(T.ref.current) - x.indexOf(N.ref.current)
|
|
5199
5199
|
);
|
|
5200
5200
|
}, [v.collectionRef, v.itemMap]);
|
|
5201
5201
|
}
|
|
@@ -5471,15 +5471,15 @@ var xf = "DismissableLayer", yo = "dismissableLayer.update", Sf = "dismissableLa
|
|
|
5471
5471
|
onInteractOutside: a,
|
|
5472
5472
|
onDismiss: i,
|
|
5473
5473
|
...c
|
|
5474
|
-
} = e, d = p.useContext(na), [u, l] = p.useState(null), m = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = p.useState({}), b = ie(t, (
|
|
5475
|
-
const E =
|
|
5476
|
-
!C || L || (r == null || r(
|
|
5477
|
-
}, m),
|
|
5478
|
-
const E =
|
|
5479
|
-
[...d.branches].some((W) => W.contains(E)) || (s == null || s(
|
|
5474
|
+
} = e, d = p.useContext(na), [u, l] = p.useState(null), m = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = p.useState({}), b = ie(t, (N) => l(N)), g = Array.from(d.layers), [v] = [...d.layersWithOutsidePointerEventsDisabled].slice(-1), y = g.indexOf(v), w = u ? g.indexOf(u) : -1, x = d.layersWithOutsidePointerEventsDisabled.size > 0, C = w >= y, R = Nf((N) => {
|
|
5475
|
+
const E = N.target, L = [...d.branches].some((W) => W.contains(E));
|
|
5476
|
+
!C || L || (r == null || r(N), a == null || a(N), N.defaultPrevented || i == null || i());
|
|
5477
|
+
}, m), T = Rf((N) => {
|
|
5478
|
+
const E = N.target;
|
|
5479
|
+
[...d.branches].some((W) => W.contains(E)) || (s == null || s(N), a == null || a(N), N.defaultPrevented || i == null || i());
|
|
5480
5480
|
}, m);
|
|
5481
|
-
return wf((
|
|
5482
|
-
w === d.layers.size - 1 && (o == null || o(
|
|
5481
|
+
return wf((N) => {
|
|
5482
|
+
w === d.layers.size - 1 && (o == null || o(N), !N.defaultPrevented && i && (N.preventDefault(), i()));
|
|
5483
5483
|
}, m), p.useEffect(() => {
|
|
5484
5484
|
if (u)
|
|
5485
5485
|
return n && (d.layersWithOutsidePointerEventsDisabled.size === 0 && (Or = m.body.style.pointerEvents, m.body.style.pointerEvents = "none"), d.layersWithOutsidePointerEventsDisabled.add(u)), d.layers.add(u), Lr(), () => {
|
|
@@ -5488,8 +5488,8 @@ var xf = "DismissableLayer", yo = "dismissableLayer.update", Sf = "dismissableLa
|
|
|
5488
5488
|
}, [u, m, n, d]), p.useEffect(() => () => {
|
|
5489
5489
|
u && (d.layers.delete(u), d.layersWithOutsidePointerEventsDisabled.delete(u), Lr());
|
|
5490
5490
|
}, [u, d]), p.useEffect(() => {
|
|
5491
|
-
const
|
|
5492
|
-
return document.addEventListener(yo,
|
|
5491
|
+
const N = () => h({});
|
|
5492
|
+
return document.addEventListener(yo, N), () => document.removeEventListener(yo, N);
|
|
5493
5493
|
}, []), /* @__PURE__ */ f(
|
|
5494
5494
|
Z.div,
|
|
5495
5495
|
{
|
|
@@ -5499,11 +5499,11 @@ var xf = "DismissableLayer", yo = "dismissableLayer.update", Sf = "dismissableLa
|
|
|
5499
5499
|
pointerEvents: x ? C ? "auto" : "none" : void 0,
|
|
5500
5500
|
...e.style
|
|
5501
5501
|
},
|
|
5502
|
-
onFocusCapture: Q(e.onFocusCapture,
|
|
5503
|
-
onBlurCapture: Q(e.onBlurCapture,
|
|
5502
|
+
onFocusCapture: Q(e.onFocusCapture, T.onFocusCapture),
|
|
5503
|
+
onBlurCapture: Q(e.onBlurCapture, T.onBlurCapture),
|
|
5504
5504
|
onPointerDownCapture: Q(
|
|
5505
5505
|
e.onPointerDownCapture,
|
|
5506
|
-
|
|
5506
|
+
R.onPointerDownCapture
|
|
5507
5507
|
)
|
|
5508
5508
|
}
|
|
5509
5509
|
);
|
|
@@ -5601,8 +5601,8 @@ var Qn = "focusScope.autoFocusOnMount", eo = "focusScope.autoFocusOnUnmount", Dr
|
|
|
5601
5601
|
C !== null && (i.contains(C) || Qe(l.current, { select: !0 }));
|
|
5602
5602
|
}, y = function(x) {
|
|
5603
5603
|
if (document.activeElement === document.body)
|
|
5604
|
-
for (const
|
|
5605
|
-
|
|
5604
|
+
for (const R of x)
|
|
5605
|
+
R.removedNodes.length > 0 && Qe(i);
|
|
5606
5606
|
};
|
|
5607
5607
|
document.addEventListener("focusin", g), document.addEventListener("focusout", v);
|
|
5608
5608
|
const w = new MutationObserver(y);
|
|
@@ -5872,12 +5872,12 @@ var ca = jf(), oo = function() {
|
|
|
5872
5872
|
onScrollCapture: oo,
|
|
5873
5873
|
onWheelCapture: oo,
|
|
5874
5874
|
onTouchMoveCapture: oo
|
|
5875
|
-
}), r = o[0], s = o[1], a = e.forwardProps, i = e.children, c = e.className, d = e.removeScrollBar, u = e.enabled, l = e.shards, m = e.sideCar, h = e.noRelative, b = e.noIsolation, g = e.inert, v = e.allowPinchZoom, y = e.as, w = y === void 0 ? "div" : y, x = e.gapMode, C = aa(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]),
|
|
5875
|
+
}), r = o[0], s = o[1], a = e.forwardProps, i = e.children, c = e.className, d = e.removeScrollBar, u = e.enabled, l = e.shards, m = e.sideCar, h = e.noRelative, b = e.noIsolation, g = e.inert, v = e.allowPinchZoom, y = e.as, w = y === void 0 ? "div" : y, x = e.gapMode, C = aa(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), R = m, T = Vf([n, t]), N = Fe(Fe({}, C), r);
|
|
5876
5876
|
return p.createElement(
|
|
5877
5877
|
p.Fragment,
|
|
5878
5878
|
null,
|
|
5879
|
-
u && p.createElement(
|
|
5880
|
-
a ? p.cloneElement(p.Children.only(i), Fe(Fe({},
|
|
5879
|
+
u && p.createElement(R, { sideCar: ca, removeScrollBar: d, shards: l, noRelative: h, noIsolation: b, inert: g, setCallbacks: s, allowPinchZoom: !!v, lockRef: n, gapMode: x }),
|
|
5880
|
+
a ? p.cloneElement(p.Children.only(i), Fe(Fe({}, N), { ref: T })) : p.createElement(w, Fe({}, N, { className: c, ref: T }), i)
|
|
5881
5881
|
);
|
|
5882
5882
|
});
|
|
5883
5883
|
Pn.defaultProps = {
|
|
@@ -6123,34 +6123,34 @@ function gp(e) {
|
|
|
6123
6123
|
var i = p.useCallback(function(g, v) {
|
|
6124
6124
|
if ("touches" in g && g.touches.length === 2 || g.type === "wheel" && g.ctrlKey)
|
|
6125
6125
|
return !a.current.allowPinchZoom;
|
|
6126
|
-
var y = cn(g), w = n.current, x = "deltaX" in g ? g.deltaX : w[0] - y[0], C = "deltaY" in g ? g.deltaY : w[1] - y[1],
|
|
6127
|
-
if ("touches" in g &&
|
|
6126
|
+
var y = cn(g), w = n.current, x = "deltaX" in g ? g.deltaX : w[0] - y[0], C = "deltaY" in g ? g.deltaY : w[1] - y[1], R, T = g.target, N = Math.abs(x) > Math.abs(C) ? "h" : "v";
|
|
6127
|
+
if ("touches" in g && N === "h" && T.type === "range")
|
|
6128
6128
|
return !1;
|
|
6129
|
-
var E = window.getSelection(), L = E && E.anchorNode, W = L ? L ===
|
|
6129
|
+
var E = window.getSelection(), L = E && E.anchorNode, W = L ? L === T || L.contains(T) : !1;
|
|
6130
6130
|
if (W)
|
|
6131
6131
|
return !1;
|
|
6132
|
-
var M = Wr(
|
|
6132
|
+
var M = Wr(N, T);
|
|
6133
6133
|
if (!M)
|
|
6134
6134
|
return !0;
|
|
6135
|
-
if (M ?
|
|
6135
|
+
if (M ? R = N : (R = N === "v" ? "h" : "v", M = Wr(N, T)), !M)
|
|
6136
6136
|
return !1;
|
|
6137
|
-
if (!o.current && "changedTouches" in g && (x || C) && (o.current =
|
|
6137
|
+
if (!o.current && "changedTouches" in g && (x || C) && (o.current = R), !R)
|
|
6138
6138
|
return !0;
|
|
6139
|
-
var F = o.current ||
|
|
6139
|
+
var F = o.current || R;
|
|
6140
6140
|
return fp(F, v, g, F === "h" ? x : C);
|
|
6141
6141
|
}, []), c = p.useCallback(function(g) {
|
|
6142
6142
|
var v = g;
|
|
6143
6143
|
if (!(!St.length || St[St.length - 1] !== s)) {
|
|
6144
|
-
var y = "deltaY" in v ? Ur(v) : cn(v), w = t.current.filter(function(
|
|
6145
|
-
return
|
|
6144
|
+
var y = "deltaY" in v ? Ur(v) : cn(v), w = t.current.filter(function(R) {
|
|
6145
|
+
return R.name === v.type && (R.target === v.target || v.target === R.shadowParent) && pp(R.delta, y);
|
|
6146
6146
|
})[0];
|
|
6147
6147
|
if (w && w.should) {
|
|
6148
6148
|
v.cancelable && v.preventDefault();
|
|
6149
6149
|
return;
|
|
6150
6150
|
}
|
|
6151
6151
|
if (!w) {
|
|
6152
|
-
var x = (a.current.shards || []).map(jr).filter(Boolean).filter(function(
|
|
6153
|
-
return
|
|
6152
|
+
var x = (a.current.shards || []).map(jr).filter(Boolean).filter(function(R) {
|
|
6153
|
+
return R.contains(v.target);
|
|
6154
6154
|
}), C = x.length > 0 ? i(v, x[0]) : !a.current.noIsolation;
|
|
6155
6155
|
C && v.cancelable && v.preventDefault();
|
|
6156
6156
|
}
|
|
@@ -6578,13 +6578,13 @@ var Na = "CheckboxBubbleInput", Ra = p.forwardRef(
|
|
|
6578
6578
|
p.useEffect(() => {
|
|
6579
6579
|
const w = m;
|
|
6580
6580
|
if (!w) return;
|
|
6581
|
-
const x = window.HTMLInputElement.prototype,
|
|
6581
|
+
const x = window.HTMLInputElement.prototype, R = Object.getOwnPropertyDescriptor(
|
|
6582
6582
|
x,
|
|
6583
6583
|
"checked"
|
|
6584
|
-
).set,
|
|
6585
|
-
if (g !== s &&
|
|
6586
|
-
const
|
|
6587
|
-
w.indeterminate = et(s),
|
|
6584
|
+
).set, T = !r.current;
|
|
6585
|
+
if (g !== s && R) {
|
|
6586
|
+
const N = new Event("click", { bubbles: T });
|
|
6587
|
+
w.indeterminate = et(s), R.call(w, et(s) ? !1 : s), w.dispatchEvent(N);
|
|
6588
6588
|
}
|
|
6589
6589
|
}, [m, g, s, r]);
|
|
6590
6590
|
const y = p.useRef(et(s) ? !1 : s);
|
|
@@ -6812,17 +6812,17 @@ async function Yp(e, t) {
|
|
|
6812
6812
|
} : {
|
|
6813
6813
|
x: 1,
|
|
6814
6814
|
y: 1
|
|
6815
|
-
},
|
|
6815
|
+
}, R = yn(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
6816
6816
|
elements: i,
|
|
6817
6817
|
rect: w,
|
|
6818
6818
|
offsetParent: x,
|
|
6819
6819
|
strategy: c
|
|
6820
6820
|
}) : w);
|
|
6821
6821
|
return {
|
|
6822
|
-
top: (y.top -
|
|
6823
|
-
bottom: (
|
|
6824
|
-
left: (y.left -
|
|
6825
|
-
right: (
|
|
6822
|
+
top: (y.top - R.top + b.top) / C.y,
|
|
6823
|
+
bottom: (R.bottom - y.bottom + b.bottom) / C.y,
|
|
6824
|
+
left: (y.left - R.left + b.left) / C.x,
|
|
6825
|
+
right: (R.right - y.right + b.right) / C.x
|
|
6826
6826
|
};
|
|
6827
6827
|
}
|
|
6828
6828
|
const qp = 50, Kp = async (e, t, n) => {
|
|
@@ -6854,8 +6854,8 @@ const qp = 50, Kp = async (e, t, n) => {
|
|
|
6854
6854
|
} = v, {
|
|
6855
6855
|
x,
|
|
6856
6856
|
y: C,
|
|
6857
|
-
data:
|
|
6858
|
-
reset:
|
|
6857
|
+
data: R,
|
|
6858
|
+
reset: T
|
|
6859
6859
|
} = await w({
|
|
6860
6860
|
x: u,
|
|
6861
6861
|
y: l,
|
|
@@ -6872,12 +6872,12 @@ const qp = 50, Kp = async (e, t, n) => {
|
|
|
6872
6872
|
});
|
|
6873
6873
|
u = x ?? u, l = C ?? l, b[y] = {
|
|
6874
6874
|
...b[y],
|
|
6875
|
-
...
|
|
6876
|
-
},
|
|
6875
|
+
...R
|
|
6876
|
+
}, T && h < qp && (h++, typeof T == "object" && (T.placement && (m = T.placement), T.rects && (d = T.rects === !0 ? await a.getElementRects({
|
|
6877
6877
|
reference: e,
|
|
6878
6878
|
floating: t,
|
|
6879
6879
|
strategy: r
|
|
6880
|
-
}) :
|
|
6880
|
+
}) : T.rects), {
|
|
6881
6881
|
x: u,
|
|
6882
6882
|
y: l
|
|
6883
6883
|
} = Zr(d, m, c)), g = -1);
|
|
@@ -6910,20 +6910,20 @@ const qp = 50, Kp = async (e, t, n) => {
|
|
|
6910
6910
|
const l = Pa(u), m = {
|
|
6911
6911
|
x: n,
|
|
6912
6912
|
y: o
|
|
6913
|
-
}, h = Xo(r), b = Ko(h), g = await a.getDimensions(d), v = h === "y", y = v ? "top" : "left", w = v ? "bottom" : "right", x = v ? "clientHeight" : "clientWidth", C = s.reference[b] + s.reference[h] - m[h] - s.floating[b],
|
|
6914
|
-
let
|
|
6915
|
-
(!
|
|
6916
|
-
const E = C / 2 -
|
|
6913
|
+
}, h = Xo(r), b = Ko(h), g = await a.getDimensions(d), v = h === "y", y = v ? "top" : "left", w = v ? "bottom" : "right", x = v ? "clientHeight" : "clientWidth", C = s.reference[b] + s.reference[h] - m[h] - s.floating[b], R = m[h] - s.reference[h], T = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(d));
|
|
6914
|
+
let N = T ? T[x] : 0;
|
|
6915
|
+
(!N || !await (a.isElement == null ? void 0 : a.isElement(T))) && (N = i.floating[x] || s.floating[b]);
|
|
6916
|
+
const E = C / 2 - R / 2, L = N / 2 - g[b] / 2 - 1, W = tt(l[y], L), M = tt(l[w], L), F = W, H = N - g[b] - M, O = N / 2 - g[b] / 2 + E, K = xo(F, O, H), A = !c.arrow && Mt(r) != null && O !== K && s.reference[b] / 2 - (O < F ? W : M) - g[b] / 2 < 0, D = A ? O < F ? O - F : O - H : 0;
|
|
6917
6917
|
return {
|
|
6918
6918
|
[h]: m[h] + D,
|
|
6919
6919
|
data: {
|
|
6920
6920
|
[h]: K,
|
|
6921
6921
|
centerOffset: O - K - D,
|
|
6922
|
-
...
|
|
6922
|
+
...A && {
|
|
6923
6923
|
alignmentOffset: D
|
|
6924
6924
|
}
|
|
6925
6925
|
},
|
|
6926
|
-
reset:
|
|
6926
|
+
reset: A
|
|
6927
6927
|
};
|
|
6928
6928
|
}
|
|
6929
6929
|
}), Zp = function(e) {
|
|
@@ -6950,9 +6950,9 @@ const qp = 50, Kp = async (e, t, n) => {
|
|
|
6950
6950
|
} = Ge(e, t);
|
|
6951
6951
|
if ((n = s.arrow) != null && n.alignmentOffset)
|
|
6952
6952
|
return {};
|
|
6953
|
-
const y = Ye(r), w = Be(i), x = Ye(i) === i, C = await (c.isRTL == null ? void 0 : c.isRTL(d.floating)),
|
|
6954
|
-
!m &&
|
|
6955
|
-
const
|
|
6953
|
+
const y = Ye(r), w = Be(i), x = Ye(i) === i, C = await (c.isRTL == null ? void 0 : c.isRTL(d.floating)), R = m || (x || !g ? [bn(i)] : Hp(i)), T = b !== "none";
|
|
6954
|
+
!m && T && R.push(...jp(i, g, b, C));
|
|
6955
|
+
const N = [i, ...R], E = await c.detectOverflow(t, v), L = [];
|
|
6956
6956
|
let W = ((o = s.flip) == null ? void 0 : o.overflows) || [];
|
|
6957
6957
|
if (u && L.push(E[y]), l) {
|
|
6958
6958
|
const O = Bp(r, a, C);
|
|
@@ -6963,7 +6963,7 @@ const qp = 50, Kp = async (e, t, n) => {
|
|
|
6963
6963
|
overflows: L
|
|
6964
6964
|
}], !L.every((O) => O <= 0)) {
|
|
6965
6965
|
var M, F;
|
|
6966
|
-
const O = (((M = s.flip) == null ? void 0 : M.index) || 0) + 1, K =
|
|
6966
|
+
const O = (((M = s.flip) == null ? void 0 : M.index) || 0) + 1, K = N[O];
|
|
6967
6967
|
if (K && (!(l === "alignment" ? w !== Be(K) : !1) || // We leave the current main axis only if every placement on that axis
|
|
6968
6968
|
// overflows the main axis.
|
|
6969
6969
|
W.every((U) => Be(U.placement) === w ? U.overflows[0] > 0 : !0)))
|
|
@@ -6976,31 +6976,31 @@ const qp = 50, Kp = async (e, t, n) => {
|
|
|
6976
6976
|
placement: K
|
|
6977
6977
|
}
|
|
6978
6978
|
};
|
|
6979
|
-
let
|
|
6980
|
-
if (!
|
|
6979
|
+
let A = (F = W.filter((D) => D.overflows[0] <= 0).sort((D, U) => D.overflows[1] - U.overflows[1])[0]) == null ? void 0 : F.placement;
|
|
6980
|
+
if (!A)
|
|
6981
6981
|
switch (h) {
|
|
6982
6982
|
case "bestFit": {
|
|
6983
6983
|
var H;
|
|
6984
6984
|
const D = (H = W.filter((U) => {
|
|
6985
|
-
if (
|
|
6986
|
-
const
|
|
6987
|
-
return
|
|
6985
|
+
if (T) {
|
|
6986
|
+
const k = Be(U.placement);
|
|
6987
|
+
return k === w || // Create a bias to the `y` side axis due to horizontal
|
|
6988
6988
|
// reading directions favoring greater width.
|
|
6989
|
-
|
|
6989
|
+
k === "y";
|
|
6990
6990
|
}
|
|
6991
6991
|
return !0;
|
|
6992
|
-
}).map((U) => [U.placement, U.overflows.filter((
|
|
6993
|
-
D && (
|
|
6992
|
+
}).map((U) => [U.placement, U.overflows.filter((k) => k > 0).reduce((k, S) => k + S, 0)]).sort((U, k) => U[1] - k[1])[0]) == null ? void 0 : H[0];
|
|
6993
|
+
D && (A = D);
|
|
6994
6994
|
break;
|
|
6995
6995
|
}
|
|
6996
6996
|
case "initialPlacement":
|
|
6997
|
-
|
|
6997
|
+
A = i;
|
|
6998
6998
|
break;
|
|
6999
6999
|
}
|
|
7000
|
-
if (r !==
|
|
7000
|
+
if (r !== A)
|
|
7001
7001
|
return {
|
|
7002
7002
|
reset: {
|
|
7003
|
-
placement:
|
|
7003
|
+
placement: A
|
|
7004
7004
|
}
|
|
7005
7005
|
};
|
|
7006
7006
|
}
|
|
@@ -7196,13 +7196,13 @@ const em = function(e) {
|
|
|
7196
7196
|
...g
|
|
7197
7197
|
};
|
|
7198
7198
|
if (c) {
|
|
7199
|
-
const x = m === "y" ? "height" : "width", C = s.reference[m] - s.floating[x] + v.mainAxis,
|
|
7200
|
-
h < C ? h = C : h >
|
|
7199
|
+
const x = m === "y" ? "height" : "width", C = s.reference[m] - s.floating[x] + v.mainAxis, R = s.reference[m] + s.reference[x] - v.mainAxis;
|
|
7200
|
+
h < C ? h = C : h > R && (h = R);
|
|
7201
7201
|
}
|
|
7202
7202
|
if (d) {
|
|
7203
7203
|
var y, w;
|
|
7204
|
-
const x = m === "y" ? "width" : "height", C = Aa.has(Ye(r)),
|
|
7205
|
-
b <
|
|
7204
|
+
const x = m === "y" ? "width" : "height", C = Aa.has(Ye(r)), R = s.reference[l] - s.floating[x] + (C && ((y = a.offset) == null ? void 0 : y[l]) || 0) + (C ? 0 : v.crossAxis), T = s.reference[l] + s.reference[x] + (C ? 0 : ((w = a.offset) == null ? void 0 : w[l]) || 0) - (C ? v.crossAxis : 0);
|
|
7205
|
+
b < R ? b = R : b > T && (b = T);
|
|
7206
7206
|
}
|
|
7207
7207
|
return {
|
|
7208
7208
|
[m]: h,
|
|
@@ -7231,16 +7231,16 @@ const em = function(e) {
|
|
|
7231
7231
|
} = s.floating;
|
|
7232
7232
|
let v, y;
|
|
7233
7233
|
l === "top" || l === "bottom" ? (v = l, y = m === (await (a.isRTL == null ? void 0 : a.isRTL(i.floating)) ? "start" : "end") ? "left" : "right") : (y = l, v = m === "end" ? "top" : "bottom");
|
|
7234
|
-
const w = g - u.top - u.bottom, x = b - u.left - u.right, C = tt(g - u[v], w),
|
|
7235
|
-
let
|
|
7236
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (E = x), (o = t.middlewareData.shift) != null && o.enabled.y && (
|
|
7234
|
+
const w = g - u.top - u.bottom, x = b - u.left - u.right, C = tt(g - u[v], w), R = tt(b - u[y], x), T = !t.middlewareData.shift;
|
|
7235
|
+
let N = C, E = R;
|
|
7236
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (E = x), (o = t.middlewareData.shift) != null && o.enabled.y && (N = w), T && !m) {
|
|
7237
7237
|
const W = Ee(u.left, 0), M = Ee(u.right, 0), F = Ee(u.top, 0), H = Ee(u.bottom, 0);
|
|
7238
|
-
h ? E = b - 2 * (W !== 0 || M !== 0 ? W + M : Ee(u.left, u.right)) :
|
|
7238
|
+
h ? E = b - 2 * (W !== 0 || M !== 0 ? W + M : Ee(u.left, u.right)) : N = g - 2 * (F !== 0 || H !== 0 ? F + H : Ee(u.top, u.bottom));
|
|
7239
7239
|
}
|
|
7240
7240
|
await c({
|
|
7241
7241
|
...t,
|
|
7242
7242
|
availableWidth: E,
|
|
7243
|
-
availableHeight:
|
|
7243
|
+
availableHeight: N
|
|
7244
7244
|
});
|
|
7245
7245
|
const L = await a.getDimensions(i.floating);
|
|
7246
7246
|
return b !== L.width || g !== L.height ? {
|
|
@@ -7679,25 +7679,25 @@ function Sm(e, t) {
|
|
|
7679
7679
|
threshold: Ee(0, tt(1, c)) || 1
|
|
7680
7680
|
};
|
|
7681
7681
|
let C = !0;
|
|
7682
|
-
function
|
|
7683
|
-
const
|
|
7684
|
-
if (
|
|
7682
|
+
function R(T) {
|
|
7683
|
+
const N = T[0].intersectionRatio;
|
|
7684
|
+
if (N !== c) {
|
|
7685
7685
|
if (!C)
|
|
7686
7686
|
return a();
|
|
7687
|
-
|
|
7687
|
+
N ? a(!1, N) : o = setTimeout(() => {
|
|
7688
7688
|
a(!1, 1e-7);
|
|
7689
7689
|
}, 1e3);
|
|
7690
7690
|
}
|
|
7691
|
-
|
|
7691
|
+
N === 1 && !$a(d, e.getBoundingClientRect()) && a(), C = !1;
|
|
7692
7692
|
}
|
|
7693
7693
|
try {
|
|
7694
|
-
n = new IntersectionObserver(
|
|
7694
|
+
n = new IntersectionObserver(R, {
|
|
7695
7695
|
...x,
|
|
7696
7696
|
// Handle <iframe>s
|
|
7697
7697
|
root: r.ownerDocument
|
|
7698
7698
|
});
|
|
7699
7699
|
} catch {
|
|
7700
|
-
n = new IntersectionObserver(
|
|
7700
|
+
n = new IntersectionObserver(R, x);
|
|
7701
7701
|
}
|
|
7702
7702
|
n.observe(e);
|
|
7703
7703
|
}
|
|
@@ -7821,20 +7821,20 @@ function Mm(e) {
|
|
|
7821
7821
|
}), [m, h] = p.useState(o);
|
|
7822
7822
|
wn(m, o) || h(o);
|
|
7823
7823
|
const [b, g] = p.useState(null), [v, y] = p.useState(null), w = p.useCallback((U) => {
|
|
7824
|
-
U !==
|
|
7824
|
+
U !== T.current && (T.current = U, g(U));
|
|
7825
7825
|
}, []), x = p.useCallback((U) => {
|
|
7826
|
-
U !==
|
|
7827
|
-
}, []), C = s || b,
|
|
7828
|
-
if (!
|
|
7826
|
+
U !== N.current && (N.current = U, y(U));
|
|
7827
|
+
}, []), C = s || b, R = a || v, T = p.useRef(null), N = p.useRef(null), E = p.useRef(u), L = c != null, W = uo(c), M = uo(r), F = uo(d), H = p.useCallback(() => {
|
|
7828
|
+
if (!T.current || !N.current)
|
|
7829
7829
|
return;
|
|
7830
7830
|
const U = {
|
|
7831
7831
|
placement: t,
|
|
7832
7832
|
strategy: n,
|
|
7833
7833
|
middleware: m
|
|
7834
7834
|
};
|
|
7835
|
-
M.current && (U.platform = M.current), Am(
|
|
7835
|
+
M.current && (U.platform = M.current), Am(T.current, N.current, U).then((k) => {
|
|
7836
7836
|
const S = {
|
|
7837
|
-
...
|
|
7837
|
+
...k,
|
|
7838
7838
|
// The floating element's position may be recomputed while it's closed
|
|
7839
7839
|
// but still mounted (such as when transitioning out). To ensure
|
|
7840
7840
|
// `isPositioned` will be `false` initially on the next open, avoid
|
|
@@ -7856,48 +7856,48 @@ function Mm(e) {
|
|
|
7856
7856
|
mn(() => (O.current = !0, () => {
|
|
7857
7857
|
O.current = !1;
|
|
7858
7858
|
}), []), mn(() => {
|
|
7859
|
-
if (C && (
|
|
7859
|
+
if (C && (T.current = C), R && (N.current = R), C && R) {
|
|
7860
7860
|
if (W.current)
|
|
7861
|
-
return W.current(C,
|
|
7861
|
+
return W.current(C, R, H);
|
|
7862
7862
|
H();
|
|
7863
7863
|
}
|
|
7864
|
-
}, [C,
|
|
7864
|
+
}, [C, R, H, W, L]);
|
|
7865
7865
|
const K = p.useMemo(() => ({
|
|
7866
|
-
reference:
|
|
7867
|
-
floating:
|
|
7866
|
+
reference: T,
|
|
7867
|
+
floating: N,
|
|
7868
7868
|
setReference: w,
|
|
7869
7869
|
setFloating: x
|
|
7870
|
-
}), [w, x]),
|
|
7870
|
+
}), [w, x]), A = p.useMemo(() => ({
|
|
7871
7871
|
reference: C,
|
|
7872
|
-
floating:
|
|
7873
|
-
}), [C,
|
|
7872
|
+
floating: R
|
|
7873
|
+
}), [C, R]), D = p.useMemo(() => {
|
|
7874
7874
|
const U = {
|
|
7875
7875
|
position: n,
|
|
7876
7876
|
left: 0,
|
|
7877
7877
|
top: 0
|
|
7878
7878
|
};
|
|
7879
|
-
if (!
|
|
7879
|
+
if (!A.floating)
|
|
7880
7880
|
return U;
|
|
7881
|
-
const
|
|
7881
|
+
const k = ss(A.floating, u.x), S = ss(A.floating, u.y);
|
|
7882
7882
|
return i ? {
|
|
7883
7883
|
...U,
|
|
7884
|
-
transform: "translate(" +
|
|
7885
|
-
...Fa(
|
|
7884
|
+
transform: "translate(" + k + "px, " + S + "px)",
|
|
7885
|
+
...Fa(A.floating) >= 1.5 && {
|
|
7886
7886
|
willChange: "transform"
|
|
7887
7887
|
}
|
|
7888
7888
|
} : {
|
|
7889
7889
|
position: n,
|
|
7890
|
-
left:
|
|
7890
|
+
left: k,
|
|
7891
7891
|
top: S
|
|
7892
7892
|
};
|
|
7893
|
-
}, [n, i,
|
|
7893
|
+
}, [n, i, A.floating, u.x, u.y]);
|
|
7894
7894
|
return p.useMemo(() => ({
|
|
7895
7895
|
...u,
|
|
7896
7896
|
update: H,
|
|
7897
7897
|
refs: K,
|
|
7898
|
-
elements:
|
|
7898
|
+
elements: A,
|
|
7899
7899
|
floatingStyles: D
|
|
7900
|
-
}), [u, H, K,
|
|
7900
|
+
}), [u, H, K, A, D]);
|
|
7901
7901
|
}
|
|
7902
7902
|
const Om = (e) => {
|
|
7903
7903
|
function t(n) {
|
|
@@ -8015,12 +8015,12 @@ var tr = "PopperContent", [jm, Gm] = Ha(tr), Ga = p.forwardRef(
|
|
|
8015
8015
|
updatePositionStrategy: h = "optimized",
|
|
8016
8016
|
onPlaced: b,
|
|
8017
8017
|
...g
|
|
8018
|
-
} = e, v = Va(tr, n), [y, w] = p.useState(null), x = ie(t, (ue) => w(ue)), [C,
|
|
8018
|
+
} = e, v = Va(tr, n), [y, w] = p.useState(null), x = ie(t, (ue) => w(ue)), [C, R] = p.useState(null), T = _n(C), N = (T == null ? void 0 : T.width) ?? 0, E = (T == null ? void 0 : T.height) ?? 0, L = o + (s !== "center" ? "-" + s : ""), W = typeof u == "number" ? u : { top: 0, right: 0, bottom: 0, left: 0, ...u }, M = Array.isArray(d) ? d : [d], F = M.length > 0, H = {
|
|
8019
8019
|
padding: W,
|
|
8020
8020
|
boundary: M.filter(qm),
|
|
8021
8021
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
8022
8022
|
altBoundary: F
|
|
8023
|
-
}, { refs: O, floatingStyles: K, placement:
|
|
8023
|
+
}, { refs: O, floatingStyles: K, placement: A, isPositioned: D, middlewareData: U } = Mm({
|
|
8024
8024
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
8025
8025
|
strategy: "fixed",
|
|
8026
8026
|
placement: L,
|
|
@@ -8047,14 +8047,14 @@ var tr = "PopperContent", [jm, Gm] = Ha(tr), Ga = p.forwardRef(
|
|
|
8047
8047
|
}
|
|
8048
8048
|
}),
|
|
8049
8049
|
C && Hm({ element: C, padding: i }),
|
|
8050
|
-
Km({ arrowWidth:
|
|
8050
|
+
Km({ arrowWidth: N, arrowHeight: E }),
|
|
8051
8051
|
m && Bm({ strategy: "referenceHidden", ...H })
|
|
8052
8052
|
]
|
|
8053
|
-
}), [
|
|
8053
|
+
}), [k, S] = Ka(A), _ = be(b);
|
|
8054
8054
|
de(() => {
|
|
8055
|
-
D && (
|
|
8056
|
-
}, [D,
|
|
8057
|
-
const
|
|
8055
|
+
D && (_ == null || _());
|
|
8056
|
+
}, [D, _]);
|
|
8057
|
+
const $ = (j = U.arrow) == null ? void 0 : j.x, P = (Y = U.arrow) == null ? void 0 : Y.y, z = ((ee = U.arrow) == null ? void 0 : ee.centerOffset) !== 0, [B, J] = p.useState();
|
|
8058
8058
|
return de(() => {
|
|
8059
8059
|
y && J(window.getComputedStyle(y).zIndex);
|
|
8060
8060
|
}, [y]), /* @__PURE__ */ f(
|
|
@@ -8085,15 +8085,15 @@ var tr = "PopperContent", [jm, Gm] = Ha(tr), Ga = p.forwardRef(
|
|
|
8085
8085
|
jm,
|
|
8086
8086
|
{
|
|
8087
8087
|
scope: n,
|
|
8088
|
-
placedSide:
|
|
8089
|
-
onArrowChange:
|
|
8090
|
-
arrowX:
|
|
8091
|
-
arrowY:
|
|
8092
|
-
shouldHideArrow:
|
|
8088
|
+
placedSide: k,
|
|
8089
|
+
onArrowChange: R,
|
|
8090
|
+
arrowX: $,
|
|
8091
|
+
arrowY: P,
|
|
8092
|
+
shouldHideArrow: z,
|
|
8093
8093
|
children: /* @__PURE__ */ f(
|
|
8094
8094
|
Z.div,
|
|
8095
8095
|
{
|
|
8096
|
-
"data-side":
|
|
8096
|
+
"data-side": k,
|
|
8097
8097
|
"data-align": S,
|
|
8098
8098
|
...g,
|
|
8099
8099
|
ref: x,
|
|
@@ -8204,7 +8204,7 @@ var th = p.forwardRef((e, t) => {
|
|
|
8204
8204
|
defaultProp: i ?? null,
|
|
8205
8205
|
onChange: c,
|
|
8206
8206
|
caller: Kt
|
|
8207
|
-
}), [y, w] = p.useState(!1), x = be(d), C = ei(n),
|
|
8207
|
+
}), [y, w] = p.useState(!1), x = be(d), C = ei(n), R = p.useRef(!1), [T, N] = p.useState(0);
|
|
8208
8208
|
return p.useEffect(() => {
|
|
8209
8209
|
const E = m.current;
|
|
8210
8210
|
if (E)
|
|
@@ -8223,36 +8223,36 @@ var th = p.forwardRef((e, t) => {
|
|
|
8223
8223
|
),
|
|
8224
8224
|
onItemShiftTab: p.useCallback(() => w(!0), []),
|
|
8225
8225
|
onFocusableItemAdd: p.useCallback(
|
|
8226
|
-
() =>
|
|
8226
|
+
() => N((E) => E + 1),
|
|
8227
8227
|
[]
|
|
8228
8228
|
),
|
|
8229
8229
|
onFocusableItemRemove: p.useCallback(
|
|
8230
|
-
() =>
|
|
8230
|
+
() => N((E) => E - 1),
|
|
8231
8231
|
[]
|
|
8232
8232
|
),
|
|
8233
8233
|
children: /* @__PURE__ */ f(
|
|
8234
8234
|
Z.div,
|
|
8235
8235
|
{
|
|
8236
|
-
tabIndex: y ||
|
|
8236
|
+
tabIndex: y || T === 0 ? -1 : 0,
|
|
8237
8237
|
"data-orientation": o,
|
|
8238
8238
|
...l,
|
|
8239
8239
|
ref: h,
|
|
8240
8240
|
style: { outline: "none", ...e.style },
|
|
8241
8241
|
onMouseDown: Q(e.onMouseDown, () => {
|
|
8242
|
-
|
|
8242
|
+
R.current = !0;
|
|
8243
8243
|
}),
|
|
8244
8244
|
onFocus: Q(e.onFocus, (E) => {
|
|
8245
|
-
const L = !
|
|
8245
|
+
const L = !R.current;
|
|
8246
8246
|
if (E.target === E.currentTarget && L && !y) {
|
|
8247
8247
|
const W = new CustomEvent(fo, Xm);
|
|
8248
8248
|
if (E.currentTarget.dispatchEvent(W), !W.defaultPrevented) {
|
|
8249
|
-
const M = C().filter((
|
|
8249
|
+
const M = C().filter((A) => A.focusable), F = M.find((A) => A.active), H = M.find((A) => A.id === g), K = [F, H, ...M].filter(
|
|
8250
8250
|
Boolean
|
|
8251
|
-
).map((
|
|
8251
|
+
).map((A) => A.ref.current);
|
|
8252
8252
|
ri(K, u);
|
|
8253
8253
|
}
|
|
8254
8254
|
}
|
|
8255
|
-
|
|
8255
|
+
R.current = !1;
|
|
8256
8256
|
}),
|
|
8257
8257
|
onBlur: Q(e.onBlur, () => w(!1))
|
|
8258
8258
|
}
|
|
@@ -8662,7 +8662,7 @@ var sr = "ScrollArea", [Ei] = xe(sr), [Ph, Re] = Ei(sr), ki = p.forwardRef(
|
|
|
8662
8662
|
dir: r,
|
|
8663
8663
|
scrollHideDelay: s = 600,
|
|
8664
8664
|
...a
|
|
8665
|
-
} = e, [i, c] = p.useState(null), [d, u] = p.useState(null), [l, m] = p.useState(null), [h, b] = p.useState(null), [g, v] = p.useState(null), [y, w] = p.useState(0), [x, C] = p.useState(0), [
|
|
8665
|
+
} = e, [i, c] = p.useState(null), [d, u] = p.useState(null), [l, m] = p.useState(null), [h, b] = p.useState(null), [g, v] = p.useState(null), [y, w] = p.useState(0), [x, C] = p.useState(0), [R, T] = p.useState(!1), [N, E] = p.useState(!1), L = ie(t, (M) => c(M)), W = Yt(r);
|
|
8666
8666
|
return /* @__PURE__ */ f(
|
|
8667
8667
|
Ph,
|
|
8668
8668
|
{
|
|
@@ -8677,11 +8677,11 @@ var sr = "ScrollArea", [Ei] = xe(sr), [Ph, Re] = Ei(sr), ki = p.forwardRef(
|
|
|
8677
8677
|
onContentChange: m,
|
|
8678
8678
|
scrollbarX: h,
|
|
8679
8679
|
onScrollbarXChange: b,
|
|
8680
|
-
scrollbarXEnabled:
|
|
8681
|
-
onScrollbarXEnabledChange:
|
|
8680
|
+
scrollbarXEnabled: R,
|
|
8681
|
+
onScrollbarXEnabledChange: T,
|
|
8682
8682
|
scrollbarY: g,
|
|
8683
8683
|
onScrollbarYChange: v,
|
|
8684
|
-
scrollbarYEnabled:
|
|
8684
|
+
scrollbarYEnabled: N,
|
|
8685
8685
|
onScrollbarYEnabledChange: E,
|
|
8686
8686
|
onCornerWidthChange: w,
|
|
8687
8687
|
onCornerHeightChange: C,
|
|
@@ -8984,7 +8984,7 @@ var Ah = p.forwardRef((e, t) => {
|
|
|
8984
8984
|
onWheelScroll: u,
|
|
8985
8985
|
onResize: l,
|
|
8986
8986
|
...m
|
|
8987
|
-
} = e, h = Re(We, n), [b, g] = p.useState(null), v = ie(t, (L) => g(L)), y = p.useRef(null), w = p.useRef(""), x = h.viewport, C = o.content - o.viewport,
|
|
8987
|
+
} = e, h = Re(We, n), [b, g] = p.useState(null), v = ie(t, (L) => g(L)), y = p.useRef(null), w = p.useRef(""), x = h.viewport, C = o.content - o.viewport, R = be(u), T = be(c), N = Hn(l, 10);
|
|
8988
8988
|
function E(L) {
|
|
8989
8989
|
if (y.current) {
|
|
8990
8990
|
const W = L.clientX - y.current.left, M = L.clientY - y.current.top;
|
|
@@ -8994,10 +8994,10 @@ var Ah = p.forwardRef((e, t) => {
|
|
|
8994
8994
|
return p.useEffect(() => {
|
|
8995
8995
|
const L = (W) => {
|
|
8996
8996
|
const M = W.target;
|
|
8997
|
-
(b == null ? void 0 : b.contains(M)) &&
|
|
8997
|
+
(b == null ? void 0 : b.contains(M)) && R(W, C);
|
|
8998
8998
|
};
|
|
8999
8999
|
return document.addEventListener("wheel", L, { passive: !1 }), () => document.removeEventListener("wheel", L, { passive: !1 });
|
|
9000
|
-
}, [x, b, C,
|
|
9000
|
+
}, [x, b, C, R]), p.useEffect(T, [o, T]), _t(b, N), _t(h.content, N), /* @__PURE__ */ f(
|
|
9001
9001
|
Oh,
|
|
9002
9002
|
{
|
|
9003
9003
|
scope: n,
|
|
@@ -9005,7 +9005,7 @@ var Ah = p.forwardRef((e, t) => {
|
|
|
9005
9005
|
hasThumb: r,
|
|
9006
9006
|
onThumbChange: be(s),
|
|
9007
9007
|
onThumbPointerUp: be(a),
|
|
9008
|
-
onThumbPositionChange:
|
|
9008
|
+
onThumbPositionChange: T,
|
|
9009
9009
|
onThumbPointerDown: be(i),
|
|
9010
9010
|
children: /* @__PURE__ */ f(
|
|
9011
9011
|
Z.div,
|
|
@@ -9180,7 +9180,7 @@ var Fh = ki, Bh = Ri, Hh = Mi, Vh = [" ", "Enter", "ArrowUp", "ArrowDown"], Wh =
|
|
|
9180
9180
|
disabled: m,
|
|
9181
9181
|
required: h,
|
|
9182
9182
|
form: b
|
|
9183
|
-
} = e, g = Un(t), [v, y] = p.useState(null), [w, x] = p.useState(null), [C,
|
|
9183
|
+
} = e, g = Un(t), [v, y] = p.useState(null), [w, x] = p.useState(null), [C, R] = p.useState(!1), T = Yt(d), [N, E] = je({
|
|
9184
9184
|
prop: o,
|
|
9185
9185
|
defaultProp: r ?? !1,
|
|
9186
9186
|
onChange: s,
|
|
@@ -9190,7 +9190,7 @@ var Fh = ki, Bh = Ri, Hh = Mi, Vh = [" ", "Enter", "ArrowUp", "ArrowDown"], Wh =
|
|
|
9190
9190
|
defaultProp: i,
|
|
9191
9191
|
onChange: c,
|
|
9192
9192
|
caller: ft
|
|
9193
|
-
}), M = p.useRef(null), F = v ? b || !!v.closest("form") : !0, [H, O] = p.useState(/* @__PURE__ */ new Set()), K = Array.from(H).map((
|
|
9193
|
+
}), M = p.useRef(null), F = v ? b || !!v.closest("form") : !0, [H, O] = p.useState(/* @__PURE__ */ new Set()), K = Array.from(H).map((A) => A.props.value).join(";");
|
|
9194
9194
|
return /* @__PURE__ */ f(Xa, { ...g, children: /* @__PURE__ */ q(
|
|
9195
9195
|
jh,
|
|
9196
9196
|
{
|
|
@@ -9201,13 +9201,13 @@ var Fh = ki, Bh = Ri, Hh = Mi, Vh = [" ", "Enter", "ArrowUp", "ArrowDown"], Wh =
|
|
|
9201
9201
|
valueNode: w,
|
|
9202
9202
|
onValueNodeChange: x,
|
|
9203
9203
|
valueNodeHasChildren: C,
|
|
9204
|
-
onValueNodeHasChildrenChange:
|
|
9204
|
+
onValueNodeHasChildrenChange: R,
|
|
9205
9205
|
contentId: ht(),
|
|
9206
9206
|
value: L,
|
|
9207
9207
|
onValueChange: W,
|
|
9208
|
-
open:
|
|
9208
|
+
open: N,
|
|
9209
9209
|
onOpenChange: E,
|
|
9210
|
-
dir:
|
|
9210
|
+
dir: T,
|
|
9211
9211
|
triggerPointerDownPosRef: M,
|
|
9212
9212
|
disabled: m,
|
|
9213
9213
|
children: [
|
|
@@ -9215,13 +9215,13 @@ var Fh = ki, Bh = Ri, Hh = Mi, Vh = [" ", "Enter", "ArrowUp", "ArrowDown"], Wh =
|
|
|
9215
9215
|
Gh,
|
|
9216
9216
|
{
|
|
9217
9217
|
scope: e.__scopeSelect,
|
|
9218
|
-
onNativeOptionAdd: p.useCallback((
|
|
9219
|
-
O((D) => new Set(D).add(
|
|
9218
|
+
onNativeOptionAdd: p.useCallback((A) => {
|
|
9219
|
+
O((D) => new Set(D).add(A));
|
|
9220
9220
|
}, []),
|
|
9221
|
-
onNativeOptionRemove: p.useCallback((
|
|
9221
|
+
onNativeOptionRemove: p.useCallback((A) => {
|
|
9222
9222
|
O((D) => {
|
|
9223
9223
|
const U = new Set(D);
|
|
9224
|
-
return U.delete(
|
|
9224
|
+
return U.delete(A), U;
|
|
9225
9225
|
});
|
|
9226
9226
|
}, []),
|
|
9227
9227
|
children: n
|
|
@@ -9236,7 +9236,7 @@ var Fh = ki, Bh = Ri, Hh = Mi, Vh = [" ", "Enter", "ArrowUp", "ArrowDown"], Wh =
|
|
|
9236
9236
|
name: u,
|
|
9237
9237
|
autoComplete: l,
|
|
9238
9238
|
value: L,
|
|
9239
|
-
onChange: (
|
|
9239
|
+
onChange: (A) => W(A.target.value),
|
|
9240
9240
|
disabled: m,
|
|
9241
9241
|
form: b,
|
|
9242
9242
|
children: [
|
|
@@ -9359,59 +9359,59 @@ var _e = 10, [ji, st] = Lt(pt), Xh = "SelectContentImpl", Zh = /* @__PURE__ */ W
|
|
|
9359
9359
|
avoidCollisions: v,
|
|
9360
9360
|
//
|
|
9361
9361
|
...y
|
|
9362
|
-
} = e, w = rt(pt, n), [x, C] = p.useState(null), [
|
|
9362
|
+
} = e, w = rt(pt, n), [x, C] = p.useState(null), [R, T] = p.useState(null), N = ie(t, (j) => C(j)), [E, L] = p.useState(null), [W, M] = p.useState(
|
|
9363
9363
|
null
|
|
9364
9364
|
), F = Wn(n), [H, O] = p.useState(!1), K = p.useRef(!1);
|
|
9365
9365
|
p.useEffect(() => {
|
|
9366
9366
|
if (x) return Sp(x);
|
|
9367
9367
|
}, [x]), Df();
|
|
9368
|
-
const
|
|
9368
|
+
const A = p.useCallback(
|
|
9369
9369
|
(j) => {
|
|
9370
9370
|
const [Y, ...ee] = F().map((oe) => oe.ref.current), [te] = ee.slice(-1), se = document.activeElement;
|
|
9371
9371
|
for (const oe of j)
|
|
9372
|
-
if (oe === se || (oe == null || oe.scrollIntoView({ block: "nearest" }), oe === Y &&
|
|
9372
|
+
if (oe === se || (oe == null || oe.scrollIntoView({ block: "nearest" }), oe === Y && R && (R.scrollTop = 0), oe === te && R && (R.scrollTop = R.scrollHeight), oe == null || oe.focus(), document.activeElement !== se)) return;
|
|
9373
9373
|
},
|
|
9374
|
-
[F,
|
|
9374
|
+
[F, R]
|
|
9375
9375
|
), D = p.useCallback(
|
|
9376
|
-
() =>
|
|
9377
|
-
[
|
|
9376
|
+
() => A([E, x]),
|
|
9377
|
+
[A, E, x]
|
|
9378
9378
|
);
|
|
9379
9379
|
p.useEffect(() => {
|
|
9380
9380
|
H && D();
|
|
9381
9381
|
}, [H, D]);
|
|
9382
|
-
const { onOpenChange: U, triggerPointerDownPosRef:
|
|
9382
|
+
const { onOpenChange: U, triggerPointerDownPosRef: k } = w;
|
|
9383
9383
|
p.useEffect(() => {
|
|
9384
9384
|
if (x) {
|
|
9385
9385
|
let j = { x: 0, y: 0 };
|
|
9386
9386
|
const Y = (te) => {
|
|
9387
9387
|
var se, oe;
|
|
9388
9388
|
j = {
|
|
9389
|
-
x: Math.abs(Math.round(te.pageX) - (((se =
|
|
9390
|
-
y: Math.abs(Math.round(te.pageY) - (((oe =
|
|
9389
|
+
x: Math.abs(Math.round(te.pageX) - (((se = k.current) == null ? void 0 : se.x) ?? 0)),
|
|
9390
|
+
y: Math.abs(Math.round(te.pageY) - (((oe = k.current) == null ? void 0 : oe.y) ?? 0))
|
|
9391
9391
|
};
|
|
9392
9392
|
}, ee = (te) => {
|
|
9393
|
-
j.x <= 10 && j.y <= 10 ? te.preventDefault() : x.contains(te.target) || U(!1), document.removeEventListener("pointermove", Y),
|
|
9393
|
+
j.x <= 10 && j.y <= 10 ? te.preventDefault() : x.contains(te.target) || U(!1), document.removeEventListener("pointermove", Y), k.current = null;
|
|
9394
9394
|
};
|
|
9395
|
-
return
|
|
9395
|
+
return k.current !== null && (document.addEventListener("pointermove", Y), document.addEventListener("pointerup", ee, { capture: !0, once: !0 })), () => {
|
|
9396
9396
|
document.removeEventListener("pointermove", Y), document.removeEventListener("pointerup", ee, { capture: !0 });
|
|
9397
9397
|
};
|
|
9398
9398
|
}
|
|
9399
|
-
}, [x, U,
|
|
9399
|
+
}, [x, U, k]), p.useEffect(() => {
|
|
9400
9400
|
const j = () => U(!1);
|
|
9401
9401
|
return window.addEventListener("blur", j), window.addEventListener("resize", j), () => {
|
|
9402
9402
|
window.removeEventListener("blur", j), window.removeEventListener("resize", j);
|
|
9403
9403
|
};
|
|
9404
9404
|
}, [U]);
|
|
9405
|
-
const [S,
|
|
9405
|
+
const [S, _] = ic((j) => {
|
|
9406
9406
|
const Y = F().filter((se) => !se.disabled), ee = Y.find((se) => se.ref.current === document.activeElement), te = cc(Y, j, ee);
|
|
9407
9407
|
te && setTimeout(() => te.ref.current.focus());
|
|
9408
|
-
}),
|
|
9408
|
+
}), $ = p.useCallback(
|
|
9409
9409
|
(j, Y, ee) => {
|
|
9410
9410
|
const te = !K.current && !ee;
|
|
9411
9411
|
(w.value !== void 0 && w.value === Y || te) && (L(j), te && (K.current = !0));
|
|
9412
9412
|
},
|
|
9413
9413
|
[w.value]
|
|
9414
|
-
),
|
|
9414
|
+
), P = p.useCallback(() => x == null ? void 0 : x.focus(), [x]), z = p.useCallback(
|
|
9415
9415
|
(j, Y, ee) => {
|
|
9416
9416
|
const te = !K.current && !ee;
|
|
9417
9417
|
(w.value !== void 0 && w.value === Y || te) && M(j);
|
|
@@ -9434,12 +9434,12 @@ var _e = 10, [ji, st] = Lt(pt), Xh = "SelectContentImpl", Zh = /* @__PURE__ */ W
|
|
|
9434
9434
|
{
|
|
9435
9435
|
scope: n,
|
|
9436
9436
|
content: x,
|
|
9437
|
-
viewport:
|
|
9438
|
-
onViewportChange:
|
|
9439
|
-
itemRefCallback:
|
|
9437
|
+
viewport: R,
|
|
9438
|
+
onViewportChange: T,
|
|
9439
|
+
itemRefCallback: $,
|
|
9440
9440
|
selectedItem: E,
|
|
9441
|
-
onItemLeave:
|
|
9442
|
-
itemTextRefCallback:
|
|
9441
|
+
onItemLeave: P,
|
|
9442
|
+
itemTextRefCallback: z,
|
|
9443
9443
|
focusSelectedItem: D,
|
|
9444
9444
|
selectedItemText: W,
|
|
9445
9445
|
position: o,
|
|
@@ -9477,7 +9477,7 @@ var _e = 10, [ji, st] = Lt(pt), Xh = "SelectContentImpl", Zh = /* @__PURE__ */ W
|
|
|
9477
9477
|
...y,
|
|
9478
9478
|
...J,
|
|
9479
9479
|
onPlaced: () => O(!0),
|
|
9480
|
-
ref:
|
|
9480
|
+
ref: N,
|
|
9481
9481
|
style: {
|
|
9482
9482
|
// flex layout so we can place the scroll buttons properly
|
|
9483
9483
|
display: "flex",
|
|
@@ -9488,13 +9488,13 @@ var _e = 10, [ji, st] = Lt(pt), Xh = "SelectContentImpl", Zh = /* @__PURE__ */ W
|
|
|
9488
9488
|
},
|
|
9489
9489
|
onKeyDown: Q(y.onKeyDown, (j) => {
|
|
9490
9490
|
const Y = j.ctrlKey || j.altKey || j.metaKey;
|
|
9491
|
-
if (j.key === "Tab" && j.preventDefault(), !Y && j.key.length === 1 &&
|
|
9491
|
+
if (j.key === "Tab" && j.preventDefault(), !Y && j.key.length === 1 && _(j.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(j.key)) {
|
|
9492
9492
|
let te = F().filter((se) => !se.disabled).map((se) => se.ref.current);
|
|
9493
9493
|
if (["ArrowUp", "End"].includes(j.key) && (te = te.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(j.key)) {
|
|
9494
9494
|
const se = j.target, oe = te.indexOf(se);
|
|
9495
9495
|
te = te.slice(oe + 1);
|
|
9496
9496
|
}
|
|
9497
|
-
setTimeout(() =>
|
|
9497
|
+
setTimeout(() => A(te)), j.preventDefault();
|
|
9498
9498
|
}
|
|
9499
9499
|
})
|
|
9500
9500
|
}
|
|
@@ -9509,11 +9509,11 @@ var _e = 10, [ji, st] = Lt(pt), Xh = "SelectContentImpl", Zh = /* @__PURE__ */ W
|
|
|
9509
9509
|
);
|
|
9510
9510
|
Gi.displayName = Xh;
|
|
9511
9511
|
var Jh = "SelectItemAlignedPosition", Yi = p.forwardRef((e, t) => {
|
|
9512
|
-
const { __scopeSelect: n, onPlaced: o, ...r } = e, s = rt(pt, n), a = st(pt, n), [i, c] = p.useState(null), [d, u] = p.useState(null), l = ie(t, (
|
|
9512
|
+
const { __scopeSelect: n, onPlaced: o, ...r } = e, s = rt(pt, n), a = st(pt, n), [i, c] = p.useState(null), [d, u] = p.useState(null), l = ie(t, (N) => u(N)), m = Wn(n), h = p.useRef(!1), b = p.useRef(!0), { viewport: g, selectedItem: v, selectedItemText: y, focusSelectedItem: w } = a, x = p.useCallback(() => {
|
|
9513
9513
|
if (s.trigger && s.valueNode && i && d && g && v && y) {
|
|
9514
|
-
const
|
|
9514
|
+
const N = s.trigger.getBoundingClientRect(), E = d.getBoundingClientRect(), L = s.valueNode.getBoundingClientRect(), W = y.getBoundingClientRect();
|
|
9515
9515
|
if (s.dir !== "rtl") {
|
|
9516
|
-
const se = W.left - E.left, oe = L.left - se, ue =
|
|
9516
|
+
const se = W.left - E.left, oe = L.left - se, ue = N.left - oe, fe = N.width + ue, at = Math.max(fe, E.width), Ke = window.innerWidth - _e, Te = ko(oe, [
|
|
9517
9517
|
_e,
|
|
9518
9518
|
// Prevents the content from going off the starting edge of the
|
|
9519
9519
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -9524,31 +9524,31 @@ var Jh = "SelectItemAlignedPosition", Yi = p.forwardRef((e, t) => {
|
|
|
9524
9524
|
]);
|
|
9525
9525
|
i.style.minWidth = fe + "px", i.style.left = Te + "px";
|
|
9526
9526
|
} else {
|
|
9527
|
-
const se = E.right - W.right, oe = window.innerWidth - L.right - se, ue = window.innerWidth -
|
|
9527
|
+
const se = E.right - W.right, oe = window.innerWidth - L.right - se, ue = window.innerWidth - N.right - oe, fe = N.width + ue, at = Math.max(fe, E.width), Ke = window.innerWidth - _e, Te = ko(oe, [
|
|
9528
9528
|
_e,
|
|
9529
9529
|
Math.max(_e, Ke - at)
|
|
9530
9530
|
]);
|
|
9531
9531
|
i.style.minWidth = fe + "px", i.style.right = Te + "px";
|
|
9532
9532
|
}
|
|
9533
|
-
const M = m(), F = window.innerHeight - _e * 2, H = g.scrollHeight, O = window.getComputedStyle(d), K = parseInt(O.borderTopWidth, 10),
|
|
9534
|
-
if (Y <=
|
|
9533
|
+
const M = m(), F = window.innerHeight - _e * 2, H = g.scrollHeight, O = window.getComputedStyle(d), K = parseInt(O.borderTopWidth, 10), A = parseInt(O.paddingTop, 10), D = parseInt(O.borderBottomWidth, 10), U = parseInt(O.paddingBottom, 10), k = K + A + H + U + D, S = Math.min(v.offsetHeight * 5, k), _ = window.getComputedStyle(g), $ = parseInt(_.paddingTop, 10), P = parseInt(_.paddingBottom, 10), z = N.top + N.height / 2 - _e, B = F - z, J = v.offsetHeight / 2, j = v.offsetTop + J, Y = K + A + j, ee = k - Y;
|
|
9534
|
+
if (Y <= z) {
|
|
9535
9535
|
const se = M.length > 0 && v === M[M.length - 1].ref.current;
|
|
9536
9536
|
i.style.bottom = "0px";
|
|
9537
9537
|
const oe = d.clientHeight - g.offsetTop - g.offsetHeight, ue = Math.max(
|
|
9538
9538
|
B,
|
|
9539
9539
|
J + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
9540
|
-
(se ?
|
|
9540
|
+
(se ? P : 0) + oe + D
|
|
9541
9541
|
), fe = Y + ue;
|
|
9542
9542
|
i.style.height = fe + "px";
|
|
9543
9543
|
} else {
|
|
9544
9544
|
const se = M.length > 0 && v === M[0].ref.current;
|
|
9545
9545
|
i.style.top = "0px";
|
|
9546
9546
|
const ue = Math.max(
|
|
9547
|
-
|
|
9547
|
+
z,
|
|
9548
9548
|
K + g.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
9549
|
-
(se ?
|
|
9549
|
+
(se ? $ : 0) + J
|
|
9550
9550
|
) + ee;
|
|
9551
|
-
i.style.height = ue + "px", g.scrollTop = Y -
|
|
9551
|
+
i.style.height = ue + "px", g.scrollTop = Y - z + g.offsetTop;
|
|
9552
9552
|
}
|
|
9553
9553
|
i.style.margin = `${_e}px 0`, i.style.minHeight = S + "px", i.style.maxHeight = F + "px", o == null || o(), requestAnimationFrame(() => h.current = !0);
|
|
9554
9554
|
}
|
|
@@ -9565,13 +9565,13 @@ var Jh = "SelectItemAlignedPosition", Yi = p.forwardRef((e, t) => {
|
|
|
9565
9565
|
o
|
|
9566
9566
|
]);
|
|
9567
9567
|
de(() => x(), [x]);
|
|
9568
|
-
const [C,
|
|
9568
|
+
const [C, R] = p.useState();
|
|
9569
9569
|
de(() => {
|
|
9570
|
-
d &&
|
|
9570
|
+
d && R(window.getComputedStyle(d).zIndex);
|
|
9571
9571
|
}, [d]);
|
|
9572
|
-
const
|
|
9573
|
-
(
|
|
9574
|
-
|
|
9572
|
+
const T = p.useCallback(
|
|
9573
|
+
(N) => {
|
|
9574
|
+
N && b.current === !0 && (x(), w == null || w(), b.current = !1);
|
|
9575
9575
|
},
|
|
9576
9576
|
[x, w]
|
|
9577
9577
|
);
|
|
@@ -9581,7 +9581,7 @@ var Jh = "SelectItemAlignedPosition", Yi = p.forwardRef((e, t) => {
|
|
|
9581
9581
|
scope: n,
|
|
9582
9582
|
contentWrapper: i,
|
|
9583
9583
|
shouldExpandOnScrollRef: h,
|
|
9584
|
-
onScrollButtonChange:
|
|
9584
|
+
onScrollButtonChange: T,
|
|
9585
9585
|
children: /* @__PURE__ */ f(
|
|
9586
9586
|
"div",
|
|
9587
9587
|
{
|
|
@@ -10289,15 +10289,15 @@ var jt = "Tooltip", [Hg, Xt] = Yn(jt), Rc = (e) => {
|
|
|
10289
10289
|
} = e, c = dr(jt, e.__scopeTooltip), d = qn(t), [u, l] = p.useState(null), m = ht(), h = p.useRef(0), b = a ?? c.disableHoverableContent, g = i ?? c.delayDuration, v = p.useRef(!1), [y, w] = je({
|
|
10290
10290
|
prop: o,
|
|
10291
10291
|
defaultProp: r ?? !1,
|
|
10292
|
-
onChange: (
|
|
10293
|
-
|
|
10292
|
+
onChange: (N) => {
|
|
10293
|
+
N ? (c.onOpen(), document.dispatchEvent(new CustomEvent(_o))) : c.onClose(), s == null || s(N);
|
|
10294
10294
|
},
|
|
10295
10295
|
caller: jt
|
|
10296
10296
|
}), x = p.useMemo(() => y ? v.current ? "delayed-open" : "instant-open" : "closed", [y]), C = p.useCallback(() => {
|
|
10297
10297
|
window.clearTimeout(h.current), h.current = 0, v.current = !1, w(!0);
|
|
10298
|
-
}, [w]), N = p.useCallback(() => {
|
|
10299
|
-
window.clearTimeout(h.current), h.current = 0, w(!1);
|
|
10300
10298
|
}, [w]), R = p.useCallback(() => {
|
|
10299
|
+
window.clearTimeout(h.current), h.current = 0, w(!1);
|
|
10300
|
+
}, [w]), T = p.useCallback(() => {
|
|
10301
10301
|
window.clearTimeout(h.current), h.current = window.setTimeout(() => {
|
|
10302
10302
|
v.current = !0, w(!0), h.current = 0;
|
|
10303
10303
|
}, g);
|
|
@@ -10314,13 +10314,13 @@ var jt = "Tooltip", [Hg, Xt] = Yn(jt), Rc = (e) => {
|
|
|
10314
10314
|
trigger: u,
|
|
10315
10315
|
onTriggerChange: l,
|
|
10316
10316
|
onTriggerEnter: p.useCallback(() => {
|
|
10317
|
-
c.isOpenDelayedRef.current ?
|
|
10318
|
-
}, [c.isOpenDelayedRef,
|
|
10317
|
+
c.isOpenDelayedRef.current ? T() : C();
|
|
10318
|
+
}, [c.isOpenDelayedRef, T, C]),
|
|
10319
10319
|
onTriggerLeave: p.useCallback(() => {
|
|
10320
|
-
b ?
|
|
10321
|
-
}, [
|
|
10320
|
+
b ? R() : (window.clearTimeout(h.current), h.current = 0);
|
|
10321
|
+
}, [R, b]),
|
|
10322
10322
|
onOpen: C,
|
|
10323
|
-
onClose:
|
|
10323
|
+
onClose: R,
|
|
10324
10324
|
disableHoverableContent: b,
|
|
10325
10325
|
children: n
|
|
10326
10326
|
}
|
|
@@ -10373,8 +10373,8 @@ var It = "TooltipContent", Ac = p.forwardRef(
|
|
|
10373
10373
|
i(null), l(!1);
|
|
10374
10374
|
}, [l]), h = p.useCallback(
|
|
10375
10375
|
(b, g) => {
|
|
10376
|
-
const v = b.currentTarget, y = { x: b.clientX, y: b.clientY }, w = qg(y, v.getBoundingClientRect()), x = Kg(y, w), C = Xg(g.getBoundingClientRect()),
|
|
10377
|
-
i(
|
|
10376
|
+
const v = b.currentTarget, y = { x: b.clientX, y: b.clientY }, w = qg(y, v.getBoundingClientRect()), x = Kg(y, w), C = Xg(g.getBoundingClientRect()), R = Jg([...x, ...C]);
|
|
10377
|
+
i(R), l(!0);
|
|
10378
10378
|
},
|
|
10379
10379
|
[l]
|
|
10380
10380
|
);
|
|
@@ -11813,7 +11813,10 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
11813
11813
|
}, Ob = 800, Ft = (e, t) => e ? `${e.replace(/\/$/, "")}${t}` : t, Lb = async (e, t, n, o, r) => {
|
|
11814
11814
|
const s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
11815
11815
|
return await Promise.all(
|
|
11816
|
-
e.filter((i) =>
|
|
11816
|
+
e.filter((i) => {
|
|
11817
|
+
var c;
|
|
11818
|
+
return i.manifest.permissions.includes("data:fetch") || (((c = i.manifest.settingsSchema) == null ? void 0 : c.length) ?? 0) > 0;
|
|
11819
|
+
}).map(async (i) => {
|
|
11817
11820
|
const c = r.find((h) => h.extensionId === i.id), d = c == null ? void 0 : c.token, u = c == null ? void 0 : c.mode, l = Ft(t, "/proxy-token"), m = await fetch(l, {
|
|
11818
11821
|
method: "POST",
|
|
11819
11822
|
headers: { "Content-Type": "application/json" },
|
|
@@ -11848,18 +11851,18 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
11848
11851
|
customerEmail: a,
|
|
11849
11852
|
customerName: i
|
|
11850
11853
|
}) => {
|
|
11851
|
-
const [c, d] = le([]), [u, l] = le([]), [m, h] = le(/* @__PURE__ */ new Map()), [b, g] = le(/* @__PURE__ */ new Map()), [v, y] = le(!1), [w, x] = le({ authenticated: !1, user: null }), [C,
|
|
11854
|
+
const [c, d] = le([]), [u, l] = le([]), [m, h] = le(/* @__PURE__ */ new Map()), [b, g] = le(/* @__PURE__ */ new Map()), [v, y] = le(!1), [w, x] = le({ authenticated: !1, user: null }), [C, R] = le(void 0);
|
|
11852
11855
|
ce(() => {
|
|
11853
11856
|
window.stackable || (window.stackable = {
|
|
11854
|
-
emit: (
|
|
11855
|
-
const [
|
|
11856
|
-
window.dispatchEvent(new CustomEvent(`stackable:${
|
|
11857
|
-
detail: { eventName:
|
|
11857
|
+
emit: (k, S = {}) => {
|
|
11858
|
+
const [_, ...$] = k.split(":"), P = $.join(":");
|
|
11859
|
+
window.dispatchEvent(new CustomEvent(`stackable:${_}`, {
|
|
11860
|
+
detail: { eventName: P, data: S }
|
|
11858
11861
|
}));
|
|
11859
11862
|
}
|
|
11860
11863
|
});
|
|
11861
11864
|
}, []);
|
|
11862
|
-
const
|
|
11865
|
+
const T = Me(null), N = Me(/* @__PURE__ */ new Set()), E = Vt(() => c.filter((k) => k.manifest.permissions.includes("extend:identity")).map((k) => k.id), [c]);
|
|
11863
11866
|
ce(() => {
|
|
11864
11867
|
(async () => {
|
|
11865
11868
|
const S = e;
|
|
@@ -11872,15 +11875,15 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
11872
11875
|
console.warn("[ExtensionSetup] apiBase and appId are required to load extensions"), d([]), y(!0);
|
|
11873
11876
|
return;
|
|
11874
11877
|
}
|
|
11875
|
-
const
|
|
11876
|
-
if (!
|
|
11878
|
+
const _ = await fetch(Ft(n, `/instances/${o}/${S}`));
|
|
11879
|
+
if (!_.ok) {
|
|
11877
11880
|
console.warn(`[ExtensionSetup] Instance not found or failed to load: ${S}`), d([]), y(!0);
|
|
11878
11881
|
return;
|
|
11879
11882
|
}
|
|
11880
|
-
const
|
|
11881
|
-
d(
|
|
11882
|
-
} catch (
|
|
11883
|
-
console.error("Failed to load extensions:",
|
|
11883
|
+
const $ = await _.json(), P = ws(typeof window < "u" ? window.location.search : ""), z = await Yl($, P), { tokens: B, errors: J } = await Lb(z, n, o, S, P);
|
|
11884
|
+
d(z), l(P), h(new Map(B)), g(J);
|
|
11885
|
+
} catch (_) {
|
|
11886
|
+
console.error("Failed to load extensions:", _);
|
|
11884
11887
|
} finally {
|
|
11885
11888
|
y(!0);
|
|
11886
11889
|
}
|
|
@@ -11889,158 +11892,161 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
11889
11892
|
if (!n || !o || c.length === 0)
|
|
11890
11893
|
return;
|
|
11891
11894
|
const S = setInterval(async () => {
|
|
11892
|
-
const
|
|
11895
|
+
const _ = [];
|
|
11893
11896
|
await Promise.all(
|
|
11894
|
-
c.filter((
|
|
11895
|
-
|
|
11897
|
+
c.filter(($) => {
|
|
11898
|
+
var P;
|
|
11899
|
+
return $.manifest.permissions.includes("data:fetch") || (((P = $.manifest.settingsSchema) == null ? void 0 : P.length) ?? 0) > 0;
|
|
11900
|
+
}).map(async ($) => {
|
|
11901
|
+
const P = u.find((Y) => Y.extensionId === $.id), z = P == null ? void 0 : P.token, B = P == null ? void 0 : P.mode, J = Ft(n, "/proxy-token"), j = await fetch(J, {
|
|
11896
11902
|
method: "POST",
|
|
11897
11903
|
headers: { "Content-Type": "application/json" },
|
|
11898
11904
|
body: JSON.stringify({
|
|
11899
11905
|
appId: o,
|
|
11900
|
-
extensionId:
|
|
11906
|
+
extensionId: $.id,
|
|
11901
11907
|
...B && { mode: B },
|
|
11902
|
-
|
|
11908
|
+
...z && { devSessionToken: z }
|
|
11903
11909
|
})
|
|
11904
11910
|
});
|
|
11905
11911
|
if (j.ok) {
|
|
11906
11912
|
const { token: Y, encryptionKey: ee } = await j.json();
|
|
11907
|
-
|
|
11913
|
+
_.push([$.id, { token: Y, encryptionKey: ee }]);
|
|
11908
11914
|
} else
|
|
11909
|
-
console.warn(`[embeddables] Proxy token refresh failed for extension ${
|
|
11915
|
+
console.warn(`[embeddables] Proxy token refresh failed for extension ${$.id} (${j.status}) — using stale token`);
|
|
11910
11916
|
})
|
|
11911
|
-
),
|
|
11912
|
-
const
|
|
11913
|
-
for (const [
|
|
11914
|
-
|
|
11915
|
-
return
|
|
11917
|
+
), _.length > 0 && h(($) => {
|
|
11918
|
+
const P = new Map($);
|
|
11919
|
+
for (const [z, B] of _)
|
|
11920
|
+
P.set(z, B);
|
|
11921
|
+
return P;
|
|
11916
11922
|
});
|
|
11917
11923
|
}, 3300 * 1e3);
|
|
11918
11924
|
return () => clearInterval(S);
|
|
11919
11925
|
}, [c, u, n, o]), ce(() => {
|
|
11920
11926
|
if (m.size === 0)
|
|
11921
11927
|
return;
|
|
11922
|
-
const
|
|
11923
|
-
const
|
|
11924
|
-
if ((
|
|
11928
|
+
const k = (S) => {
|
|
11929
|
+
const _ = S.data;
|
|
11930
|
+
if ((_ == null ? void 0 : _.type) !== "extension-ready")
|
|
11925
11931
|
return;
|
|
11926
|
-
const
|
|
11927
|
-
if (!(
|
|
11932
|
+
const $ = _.extensionId, P = c.find((J) => J.id === $);
|
|
11933
|
+
if (!(P != null && P.bundleUrl))
|
|
11928
11934
|
return;
|
|
11929
|
-
const
|
|
11930
|
-
if (Ul(
|
|
11935
|
+
const z = u.find((J) => J.extensionId === $);
|
|
11936
|
+
if (Ul(P.bundleUrl) && (z == null ? void 0 : z.mode) !== "staging")
|
|
11931
11937
|
return;
|
|
11932
|
-
const B = m.get(
|
|
11933
|
-
B && $e(
|
|
11938
|
+
const B = m.get($);
|
|
11939
|
+
B && $e($, { type: "extension-encryption-key", encryptionKey: B.encryptionKey });
|
|
11934
11940
|
};
|
|
11935
|
-
return window.addEventListener("message",
|
|
11941
|
+
return window.addEventListener("message", k), () => window.removeEventListener("message", k);
|
|
11936
11942
|
}, [c, u, m]);
|
|
11937
|
-
const L = ve((
|
|
11938
|
-
const
|
|
11939
|
-
for (const [
|
|
11940
|
-
if (!
|
|
11943
|
+
const L = ve((k, S) => {
|
|
11944
|
+
const _ = kt();
|
|
11945
|
+
for (const [$, P] of _) {
|
|
11946
|
+
if (!P.manifest.permissions.includes("events:identity"))
|
|
11941
11947
|
continue;
|
|
11942
|
-
const
|
|
11943
|
-
|
|
11948
|
+
const z = P.manifest.events ?? [];
|
|
11949
|
+
!z.includes("identity") && !z.includes(`identity:${k}`) || $e($, {
|
|
11944
11950
|
type: "extension-event",
|
|
11945
11951
|
eventType: "identity",
|
|
11946
|
-
payload: { eventName:
|
|
11952
|
+
payload: { eventName: k, data: { state: S, timestamp: Zn((/* @__PURE__ */ new Date()).toISOString()) } }
|
|
11947
11953
|
});
|
|
11948
11954
|
}
|
|
11949
|
-
}, []), W = ve((
|
|
11955
|
+
}, []), W = ve((k) => {
|
|
11950
11956
|
const S = kt();
|
|
11951
|
-
for (const [
|
|
11952
|
-
if (
|
|
11957
|
+
for (const [_, $] of S) {
|
|
11958
|
+
if (!$.manifest.permissions.includes("events:messaging"))
|
|
11953
11959
|
continue;
|
|
11954
|
-
const
|
|
11955
|
-
!
|
|
11960
|
+
const P = $.manifest.events ?? [];
|
|
11961
|
+
!P.includes("messaging") && !P.includes("messaging:postback") && !P.includes(`messaging:postback:${k.data.actionName}`) || $e(_, {
|
|
11956
11962
|
type: "extension-event",
|
|
11957
11963
|
eventType: "messaging",
|
|
11958
|
-
payload:
|
|
11964
|
+
payload: k
|
|
11959
11965
|
});
|
|
11960
11966
|
}
|
|
11961
|
-
}, []), M = ve((
|
|
11967
|
+
}, []), M = ve((k) => {
|
|
11962
11968
|
const S = kt();
|
|
11963
|
-
for (const [
|
|
11964
|
-
if (
|
|
11969
|
+
for (const [_, $] of S) {
|
|
11970
|
+
if (!$.manifest.permissions.includes("events:activity"))
|
|
11965
11971
|
continue;
|
|
11966
|
-
const
|
|
11967
|
-
!
|
|
11972
|
+
const P = $.manifest.events ?? [];
|
|
11973
|
+
!P.includes("activity") && !P.includes(`activity:${k.eventName}`) || $e(_, {
|
|
11968
11974
|
type: "extension-event",
|
|
11969
11975
|
eventType: "activity",
|
|
11970
|
-
payload:
|
|
11976
|
+
payload: k
|
|
11971
11977
|
});
|
|
11972
11978
|
}
|
|
11973
|
-
}, []), F = ve(async (
|
|
11974
|
-
const S = kt(),
|
|
11975
|
-
for (const [
|
|
11976
|
-
if (
|
|
11979
|
+
}, []), F = ve(async (k) => {
|
|
11980
|
+
const S = kt(), _ = [];
|
|
11981
|
+
for (const [P, z] of S) {
|
|
11982
|
+
if (!z.manifest.permissions.includes("extend:identity"))
|
|
11977
11983
|
continue;
|
|
11978
11984
|
const B = new Promise((J) => {
|
|
11979
|
-
const j = `enrich_${
|
|
11985
|
+
const j = `enrich_${P}_${Date.now()}`, Y = (ee) => {
|
|
11980
11986
|
const te = ee.data;
|
|
11981
11987
|
(te == null ? void 0 : te.type) !== "extend-identity-response" || te.id !== j || (window.removeEventListener("message", Y), te.additionalClaims ? J(te.additionalClaims) : J({}));
|
|
11982
11988
|
};
|
|
11983
11989
|
window.addEventListener("message", Y), setTimeout(() => {
|
|
11984
11990
|
window.removeEventListener("message", Y), J({});
|
|
11985
|
-
}, 5e3), $e(
|
|
11991
|
+
}, 5e3), $e(P, {
|
|
11986
11992
|
type: "extend-identity-request",
|
|
11987
11993
|
id: j,
|
|
11988
|
-
claims:
|
|
11994
|
+
claims: k
|
|
11989
11995
|
});
|
|
11990
11996
|
});
|
|
11991
|
-
|
|
11997
|
+
_.push(B);
|
|
11992
11998
|
}
|
|
11993
|
-
if (
|
|
11999
|
+
if (_.length === 0)
|
|
11994
12000
|
return {};
|
|
11995
|
-
const
|
|
11996
|
-
return Object.assign({},
|
|
11997
|
-
}, []), H = ve(async (
|
|
12001
|
+
const $ = await Promise.all(_);
|
|
12002
|
+
return Object.assign({}, ...$);
|
|
12003
|
+
}, []), H = ve(async (k) => {
|
|
11998
12004
|
if (!n || !o || !e)
|
|
11999
12005
|
return console.warn("[embeddables] signIdentity skipped — missing:", { apiBase: !!n, appId: !!o, instanceId: !!e }), null;
|
|
12000
12006
|
const S = Ft(n, `/instances/${o}/${e}/identity`);
|
|
12001
|
-
console.log("[embeddables] Calling identity sign:", { url: S, claims: Object.keys(
|
|
12007
|
+
console.log("[embeddables] Calling identity sign:", { url: S, claims: Object.keys(k) });
|
|
12002
12008
|
try {
|
|
12003
|
-
const
|
|
12009
|
+
const _ = await fetch(S, {
|
|
12004
12010
|
method: "POST",
|
|
12005
12011
|
headers: { "Content-Type": "application/json" },
|
|
12006
|
-
body: JSON.stringify(
|
|
12012
|
+
body: JSON.stringify(k)
|
|
12007
12013
|
});
|
|
12008
|
-
if (!
|
|
12009
|
-
return console.warn(`[embeddables] Identity sign failed (${
|
|
12010
|
-
const { token:
|
|
12011
|
-
return
|
|
12012
|
-
} catch (
|
|
12013
|
-
return console.warn("[embeddables] Identity sign request failed:",
|
|
12014
|
-
}
|
|
12015
|
-
}, [n, o, e]), O = ve((
|
|
12014
|
+
if (!_.ok)
|
|
12015
|
+
return console.warn(`[embeddables] Identity sign failed (${_.status})`), null;
|
|
12016
|
+
const { token: $ } = await _.json();
|
|
12017
|
+
return $;
|
|
12018
|
+
} catch (_) {
|
|
12019
|
+
return console.warn("[embeddables] Identity sign request failed:", _), null;
|
|
12020
|
+
}
|
|
12021
|
+
}, [n, o, e]), O = ve((k) => {
|
|
12016
12022
|
const S = window.zE;
|
|
12017
|
-
S && S("messenger", "loginUser", async (
|
|
12018
|
-
|
|
12023
|
+
S && S("messenger", "loginUser", async (_) => {
|
|
12024
|
+
_(k);
|
|
12019
12025
|
});
|
|
12020
12026
|
}, []), K = ve(() => {
|
|
12021
|
-
const
|
|
12022
|
-
|
|
12023
|
-
}, []),
|
|
12024
|
-
console.log("[embeddables] Running sign lifecycle for user:",
|
|
12025
|
-
const { email: S, name:
|
|
12027
|
+
const k = window.zE;
|
|
12028
|
+
k && k("messenger", "logoutUser");
|
|
12029
|
+
}, []), A = ve((k) => {
|
|
12030
|
+
console.log("[embeddables] Running sign lifecycle for user:", k.id);
|
|
12031
|
+
const { email: S, name: _ } = k, $ = { external_id: String(k.id) };
|
|
12026
12032
|
(async () => {
|
|
12027
|
-
const
|
|
12028
|
-
console.log("[embeddables] Enriched claims:",
|
|
12029
|
-
const
|
|
12030
|
-
|
|
12031
|
-
...
|
|
12033
|
+
const P = await F({ ...$, email: S, name: _ });
|
|
12034
|
+
console.log("[embeddables] Enriched claims:", P);
|
|
12035
|
+
const z = await H({
|
|
12036
|
+
...$,
|
|
12037
|
+
...P,
|
|
12032
12038
|
email: S,
|
|
12033
|
-
name:
|
|
12039
|
+
name: _
|
|
12034
12040
|
});
|
|
12035
|
-
console.log("[embeddables] Sign result:", { hasToken:
|
|
12041
|
+
console.log("[embeddables] Sign result:", { hasToken: !!z }), z && O(z);
|
|
12036
12042
|
})();
|
|
12037
|
-
}, [F, H, O]), D = ve((
|
|
12038
|
-
if (E.length > 0 &&
|
|
12039
|
-
console.log(`[embeddables] Deferring sign lifecycle — waiting for extend:identity extensions: ${
|
|
12043
|
+
}, [F, H, O]), D = ve((k) => {
|
|
12044
|
+
if (E.length > 0 && N.current.size < E.length) {
|
|
12045
|
+
console.log(`[embeddables] Deferring sign lifecycle — waiting for extend:identity extensions: ${N.current.size}/${E.length} ready`), T.current = k;
|
|
12040
12046
|
return;
|
|
12041
12047
|
}
|
|
12042
|
-
console.log("[embeddables] No extend:identity extensions (or all ready) — signing immediately"),
|
|
12043
|
-
}, [E,
|
|
12048
|
+
console.log("[embeddables] No extend:identity extensions (or all ready) — signing immediately"), A(k);
|
|
12049
|
+
}, [E, A]);
|
|
12044
12050
|
ce(() => {
|
|
12045
12051
|
if (!v) {
|
|
12046
12052
|
console.log("[embeddables] Identity effect skipped — extensions not loaded yet");
|
|
@@ -12048,7 +12054,7 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12048
12054
|
}
|
|
12049
12055
|
if (console.log("[embeddables] Identity effect running", { initialized: v, customerId: !!s, extendExtensions: E.length }), s) {
|
|
12050
12056
|
console.log("[embeddables] Identity from props:", { customerId: s, customerEmail: a, customerName: i });
|
|
12051
|
-
const
|
|
12057
|
+
const k = {
|
|
12052
12058
|
authenticated: !0,
|
|
12053
12059
|
user: {
|
|
12054
12060
|
id: String(s),
|
|
@@ -12058,128 +12064,133 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12058
12064
|
}
|
|
12059
12065
|
};
|
|
12060
12066
|
x((S) => {
|
|
12061
|
-
var
|
|
12062
|
-
return S.authenticated && ((
|
|
12067
|
+
var _, $;
|
|
12068
|
+
return S.authenticated && ((_ = S.user) == null ? void 0 : _.id) === (($ = k.user) == null ? void 0 : $.id) ? S : (console.log("[embeddables] Identity state changed (props), starting sign lifecycle"), D(k.user), L("login", k), k);
|
|
12063
12069
|
});
|
|
12064
12070
|
} else {
|
|
12065
12071
|
if (s === void 0)
|
|
12066
12072
|
return;
|
|
12067
|
-
x((
|
|
12073
|
+
x((k) => k.authenticated ? (console.log("[embeddables] Customer props cleared, logging out"), K(), L("logout", { authenticated: !1, user: null }), { authenticated: !1, user: null }) : k);
|
|
12068
12074
|
}
|
|
12069
12075
|
}, [v, s, a, i, E, D, L, K]), ce(() => {
|
|
12070
12076
|
if (!v || s !== void 0)
|
|
12071
12077
|
return;
|
|
12072
|
-
const
|
|
12073
|
-
const
|
|
12074
|
-
if (
|
|
12078
|
+
const k = () => {
|
|
12079
|
+
const _ = document.getElementById("stackable-identity");
|
|
12080
|
+
if (_)
|
|
12075
12081
|
try {
|
|
12076
|
-
const
|
|
12082
|
+
const $ = JSON.parse(_.textContent ?? "{}"), P = {
|
|
12077
12083
|
authenticated: !0,
|
|
12078
12084
|
user: {
|
|
12079
|
-
id: String(
|
|
12080
|
-
email:
|
|
12081
|
-
name:
|
|
12085
|
+
id: String($.customerId ?? ""),
|
|
12086
|
+
email: $.customerEmail,
|
|
12087
|
+
name: $.customerName,
|
|
12082
12088
|
provider: "shopify"
|
|
12083
12089
|
}
|
|
12084
12090
|
};
|
|
12085
|
-
x((
|
|
12091
|
+
x((z) => {
|
|
12086
12092
|
var B, J;
|
|
12087
|
-
return
|
|
12093
|
+
return z.authenticated && ((B = z.user) == null ? void 0 : B.id) === ((J = P.user) == null ? void 0 : J.id) ? z : (console.log("[embeddables] Identity state changed (DOM), starting sign lifecycle"), D(P.user), L("login", P), P);
|
|
12088
12094
|
});
|
|
12089
12095
|
} catch {
|
|
12090
12096
|
console.warn("[embeddables] Failed to parse #stackable-identity JSON");
|
|
12091
12097
|
}
|
|
12092
12098
|
else
|
|
12093
|
-
x((
|
|
12099
|
+
x(($) => $.authenticated ? (K(), L("logout", { authenticated: !1, user: null }), { authenticated: !1, user: null }) : $);
|
|
12094
12100
|
};
|
|
12095
|
-
|
|
12096
|
-
const S = new MutationObserver(
|
|
12101
|
+
k();
|
|
12102
|
+
const S = new MutationObserver(k);
|
|
12097
12103
|
return S.observe(document.head, { childList: !0, subtree: !0 }), S.observe(document.body, { childList: !0, subtree: !0 }), () => S.disconnect();
|
|
12098
12104
|
}, [v, s, D, L, K]), ce(() => {
|
|
12099
12105
|
if (!w.authenticated)
|
|
12100
12106
|
return;
|
|
12101
|
-
const
|
|
12102
|
-
const
|
|
12103
|
-
if ((
|
|
12107
|
+
const k = (S) => {
|
|
12108
|
+
const _ = S.data;
|
|
12109
|
+
if ((_ == null ? void 0 : _.type) !== "extension-ready")
|
|
12104
12110
|
return;
|
|
12105
|
-
const
|
|
12106
|
-
if (!(
|
|
12111
|
+
const $ = _.extensionId, P = c.find((B) => B.id === $);
|
|
12112
|
+
if (!(P != null && P.manifest.permissions.includes("events:identity")))
|
|
12107
12113
|
return;
|
|
12108
|
-
const
|
|
12109
|
-
|
|
12114
|
+
const z = P.manifest.events ?? [];
|
|
12115
|
+
!z.includes("identity") && !z.includes("identity:login") || $e($, {
|
|
12110
12116
|
type: "extension-event",
|
|
12111
12117
|
eventType: "identity",
|
|
12112
12118
|
payload: { eventName: "login", data: { state: w, timestamp: Zn((/* @__PURE__ */ new Date()).toISOString()) } }
|
|
12113
12119
|
});
|
|
12114
12120
|
};
|
|
12115
|
-
return window.addEventListener("message",
|
|
12121
|
+
return window.addEventListener("message", k), () => window.removeEventListener("message", k);
|
|
12116
12122
|
}, [w, c]), ce(() => {
|
|
12117
12123
|
if (E.length === 0)
|
|
12118
12124
|
return;
|
|
12119
|
-
const
|
|
12120
|
-
const
|
|
12121
|
-
if ((
|
|
12125
|
+
const k = (_) => {
|
|
12126
|
+
const $ = _.data;
|
|
12127
|
+
if (($ == null ? void 0 : $.type) !== "extension-ready")
|
|
12122
12128
|
return;
|
|
12123
|
-
const
|
|
12124
|
-
if (E.includes(
|
|
12129
|
+
const P = $.extensionId;
|
|
12130
|
+
if (E.includes(P) && (N.current.add(P), console.log(`[embeddables] extend:identity extension ready: ${P} (${N.current.size}/${E.length})`), N.current.size >= E.length && T.current)) {
|
|
12125
12131
|
console.log("[embeddables] All extend:identity extensions ready, running deferred sign lifecycle");
|
|
12126
|
-
const
|
|
12127
|
-
|
|
12132
|
+
const z = T.current;
|
|
12133
|
+
T.current = null, A(z);
|
|
12128
12134
|
}
|
|
12129
12135
|
};
|
|
12130
|
-
window.addEventListener("message",
|
|
12136
|
+
window.addEventListener("message", k);
|
|
12131
12137
|
const S = setTimeout(() => {
|
|
12132
|
-
if (
|
|
12133
|
-
console.warn(`[embeddables] extend:identity timeout (5s) — signing with ${
|
|
12134
|
-
const
|
|
12135
|
-
|
|
12138
|
+
if (T.current) {
|
|
12139
|
+
console.warn(`[embeddables] extend:identity timeout (5s) — signing with ${N.current.size}/${E.length} extensions ready`);
|
|
12140
|
+
const _ = T.current;
|
|
12141
|
+
T.current = null, A(_);
|
|
12136
12142
|
}
|
|
12137
12143
|
}, 5e3);
|
|
12138
12144
|
return () => {
|
|
12139
|
-
window.removeEventListener("message",
|
|
12145
|
+
window.removeEventListener("message", k), clearTimeout(S);
|
|
12140
12146
|
};
|
|
12141
|
-
}, [E,
|
|
12142
|
-
const
|
|
12143
|
-
const { detail:
|
|
12144
|
-
|
|
12147
|
+
}, [E, A]), ce(() => {
|
|
12148
|
+
const k = (S) => {
|
|
12149
|
+
const { detail: _ } = S;
|
|
12150
|
+
_ != null && _.eventName && (_.eventName === "postback" ? W({
|
|
12145
12151
|
eventName: "postback",
|
|
12146
12152
|
data: {
|
|
12147
|
-
actionName:
|
|
12148
|
-
conversationId:
|
|
12153
|
+
actionName: _.data.actionName,
|
|
12154
|
+
conversationId: _.data.conversationId ?? "",
|
|
12149
12155
|
timestamp: Zn((/* @__PURE__ */ new Date()).toISOString())
|
|
12150
12156
|
}
|
|
12151
|
-
}) :
|
|
12157
|
+
}) : _.eventName === "context" && R(($) => ({ ...$, ..._.data })));
|
|
12152
12158
|
};
|
|
12153
|
-
return window.addEventListener("stackable:messaging",
|
|
12159
|
+
return window.addEventListener("stackable:messaging", k), () => window.removeEventListener("stackable:messaging", k);
|
|
12154
12160
|
}, [W]), ce(() => {
|
|
12155
|
-
const
|
|
12156
|
-
const { detail:
|
|
12157
|
-
|
|
12158
|
-
eventName:
|
|
12159
|
-
data:
|
|
12161
|
+
const k = (S) => {
|
|
12162
|
+
const { detail: _ } = S;
|
|
12163
|
+
_ != null && _.eventName && M({
|
|
12164
|
+
eventName: _.eventName,
|
|
12165
|
+
data: _.data ?? {}
|
|
12160
12166
|
});
|
|
12161
12167
|
};
|
|
12162
|
-
return window.addEventListener("stackable:activity",
|
|
12168
|
+
return window.addEventListener("stackable:activity", k), () => window.removeEventListener("stackable:activity", k);
|
|
12163
12169
|
}, [M]), ce(() => {
|
|
12170
|
+
var _;
|
|
12164
12171
|
if (!v)
|
|
12165
12172
|
return;
|
|
12166
|
-
const
|
|
12173
|
+
const k = {
|
|
12167
12174
|
customerId: s ?? "",
|
|
12168
12175
|
customerEmail: a ?? "",
|
|
12169
12176
|
customerName: i ?? "",
|
|
12170
12177
|
messaging: C,
|
|
12171
12178
|
identity: w
|
|
12172
12179
|
}, S = kt();
|
|
12173
|
-
for (const [
|
|
12174
|
-
|
|
12180
|
+
for (const [$, P] of S) {
|
|
12181
|
+
if (!P.manifest.permissions.includes("context:read"))
|
|
12182
|
+
continue;
|
|
12183
|
+
const z = (_ = m.get($)) == null ? void 0 : _.settings, B = z ? { ...k, settings: z } : k;
|
|
12184
|
+
$e($, { type: "context-push", context: B });
|
|
12185
|
+
}
|
|
12175
12186
|
}, [v, s, a, i, w, C]);
|
|
12176
12187
|
const U = Vt(
|
|
12177
12188
|
() => ({
|
|
12178
12189
|
// TODO(data.query-deprecation): Remove when data.query is deprecated — host-native ecommerce route replaced by extension + data.fetch
|
|
12179
|
-
"data.query": async (
|
|
12180
|
-
"data.fetch": async (
|
|
12181
|
-
const
|
|
12182
|
-
if (!
|
|
12190
|
+
"data.query": async (k) => $c(k, t),
|
|
12191
|
+
"data.fetch": async (k, S) => {
|
|
12192
|
+
const _ = m.get(k);
|
|
12193
|
+
if (!_)
|
|
12183
12194
|
return {
|
|
12184
12195
|
status: 0,
|
|
12185
12196
|
ok: !1,
|
|
@@ -12187,29 +12198,29 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12187
12198
|
error: "data.fetch: proxy token unavailable — ensure the extension has data:fetch permission and allowedDomains configured"
|
|
12188
12199
|
}
|
|
12189
12200
|
};
|
|
12190
|
-
const
|
|
12201
|
+
const $ = Db(S) ? S : {
|
|
12191
12202
|
url: S.url,
|
|
12192
12203
|
method: S.method ?? "GET",
|
|
12193
12204
|
headers: S.headers ?? {},
|
|
12194
12205
|
body: S.body ?? null
|
|
12195
|
-
},
|
|
12206
|
+
}, P = Ft(n, "/proxy"), z = await fetch(P, {
|
|
12196
12207
|
method: "POST",
|
|
12197
12208
|
headers: {
|
|
12198
12209
|
"Content-Type": "application/json",
|
|
12199
|
-
"X-Extension-Id":
|
|
12210
|
+
"X-Extension-Id": k,
|
|
12200
12211
|
"X-Application-Id": o ?? "",
|
|
12201
|
-
Authorization: `Bearer ${
|
|
12212
|
+
Authorization: `Bearer ${_.token}`
|
|
12202
12213
|
},
|
|
12203
|
-
body: JSON.stringify(
|
|
12204
|
-
}), B = await
|
|
12214
|
+
body: JSON.stringify($)
|
|
12215
|
+
}), B = await z.json();
|
|
12205
12216
|
return {
|
|
12206
|
-
status: B.status ??
|
|
12207
|
-
ok: B.ok ??
|
|
12217
|
+
status: B.status ?? z.status,
|
|
12218
|
+
ok: B.ok ?? z.ok,
|
|
12208
12219
|
data: B.data
|
|
12209
12220
|
};
|
|
12210
12221
|
},
|
|
12211
|
-
"actions.toast": async (
|
|
12212
|
-
const
|
|
12222
|
+
"actions.toast": async (k, S) => {
|
|
12223
|
+
const _ = {
|
|
12213
12224
|
...S.description && { description: S.description },
|
|
12214
12225
|
...S.duration && { duration: S.duration },
|
|
12215
12226
|
...S.position && { position: S.position },
|
|
@@ -12217,49 +12228,53 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12217
12228
|
...S.closeButton != null && { closeButton: S.closeButton }
|
|
12218
12229
|
};
|
|
12219
12230
|
if (S.fetch) {
|
|
12220
|
-
const
|
|
12221
|
-
U["data.fetch"](
|
|
12222
|
-
|
|
12223
|
-
]).then(([
|
|
12224
|
-
wt.promise(
|
|
12231
|
+
const $ = (z) => new Promise((B) => setTimeout(B, z)), P = Promise.all([
|
|
12232
|
+
U["data.fetch"](k, S.fetch),
|
|
12233
|
+
$(Ob)
|
|
12234
|
+
]).then(([z]) => z);
|
|
12235
|
+
wt.promise(P, {
|
|
12225
12236
|
loading: S.loading ?? S.message,
|
|
12226
12237
|
success: S.success ?? S.message,
|
|
12227
12238
|
error: S.error ?? "Something went wrong",
|
|
12228
|
-
...
|
|
12239
|
+
..._
|
|
12229
12240
|
});
|
|
12230
12241
|
return;
|
|
12231
12242
|
}
|
|
12232
12243
|
switch (S.type) {
|
|
12233
12244
|
case "success": {
|
|
12234
|
-
wt.success(S.message,
|
|
12245
|
+
wt.success(S.message, _);
|
|
12235
12246
|
break;
|
|
12236
12247
|
}
|
|
12237
12248
|
case "error": {
|
|
12238
|
-
wt.error(S.message,
|
|
12249
|
+
wt.error(S.message, _);
|
|
12239
12250
|
break;
|
|
12240
12251
|
}
|
|
12241
12252
|
case "warning": {
|
|
12242
|
-
wt.warning(S.message,
|
|
12253
|
+
wt.warning(S.message, _);
|
|
12243
12254
|
break;
|
|
12244
12255
|
}
|
|
12245
12256
|
case "info": {
|
|
12246
|
-
wt.info(S.message,
|
|
12257
|
+
wt.info(S.message, _);
|
|
12247
12258
|
break;
|
|
12248
12259
|
}
|
|
12249
12260
|
default:
|
|
12250
|
-
wt(S.message,
|
|
12261
|
+
wt(S.message, _);
|
|
12251
12262
|
}
|
|
12252
12263
|
},
|
|
12253
|
-
"actions.invoke": async (
|
|
12254
|
-
"context.read": async () =>
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12264
|
+
"actions.invoke": async (k) => (window.dispatchEvent(new CustomEvent(`stackable:action:${k.action}`, { detail: k })), { success: !0 }),
|
|
12265
|
+
"context.read": async (k) => {
|
|
12266
|
+
var S;
|
|
12267
|
+
return {
|
|
12268
|
+
customerId: s ?? "",
|
|
12269
|
+
customerEmail: a ?? "",
|
|
12270
|
+
customerName: i ?? "",
|
|
12271
|
+
// TODO: consider consolidating customerId/customerEmail/customerName
|
|
12272
|
+
// inside identity object (breaking change for extensions reading top-level fields)
|
|
12273
|
+
identity: w,
|
|
12274
|
+
messaging: C,
|
|
12275
|
+
...((S = m.get(k)) == null ? void 0 : S.settings) && { settings: m.get(k).settings }
|
|
12276
|
+
};
|
|
12277
|
+
}
|
|
12263
12278
|
}),
|
|
12264
12279
|
[n, o, t, s, a, i, m, w, C]
|
|
12265
12280
|
);
|
|
@@ -12559,11 +12574,11 @@ const Hb = ({ ...e }) => {
|
|
|
12559
12574
|
conversationList: { hideHeader: !0, hideNewConversationButton: !0 }
|
|
12560
12575
|
}), !0), []);
|
|
12561
12576
|
ce(() => {
|
|
12562
|
-
var K,
|
|
12563
|
-
const M = document.querySelector('script[src*="zdassets.com/ekr/snippet"]'), F = (
|
|
12577
|
+
var K, A;
|
|
12578
|
+
const M = document.querySelector('script[src*="zdassets.com/ekr/snippet"]'), F = (A = (K = M == null ? void 0 : M.src) == null ? void 0 : K.match(/key=([a-f0-9-]+)/)) == null ? void 0 : A[1];
|
|
12564
12579
|
if (F && fetch(`https://ekr.zdassets.com/compose/${F}`).then((D) => D.text()).then((D) => {
|
|
12565
|
-
var
|
|
12566
|
-
const U = (
|
|
12580
|
+
var k;
|
|
12581
|
+
const U = (k = D.match(/appId['"]?\s*:\s*['"]([a-f0-9]+)['"]/)) == null ? void 0 : k[1];
|
|
12567
12582
|
U && po({ appId: U });
|
|
12568
12583
|
}).catch(() => {
|
|
12569
12584
|
}), C()) {
|
|
@@ -12579,52 +12594,52 @@ const Hb = ({ ...e }) => {
|
|
|
12579
12594
|
clearInterval(H), clearTimeout(O);
|
|
12580
12595
|
};
|
|
12581
12596
|
}, [C]);
|
|
12582
|
-
const
|
|
12597
|
+
const R = ve((M) => {
|
|
12583
12598
|
!window.zE || !M.length || (console.log("[ZendeskMessenger] setConversationTags", M, { zE: !!window.zE }), window.zE("messenger:set", "conversationTags", M));
|
|
12584
|
-
}, []),
|
|
12599
|
+
}, []), T = ve((M) => {
|
|
12585
12600
|
!window.zE || !M.length || (console.log("[ZendeskMessenger] setConversationFields", M, { zE: !!window.zE }), window.zE("messenger:set", "conversationFields", M));
|
|
12586
|
-
}, []),
|
|
12601
|
+
}, []), N = ve((M) => {
|
|
12587
12602
|
if (!window.zE)
|
|
12588
12603
|
return;
|
|
12589
12604
|
const { tags: F = [], fields: H = [], ...O } = M ?? {};
|
|
12590
|
-
|
|
12591
|
-
}, [
|
|
12605
|
+
R(F), T(H), window.zE("messenger:ui", "newConversation", Object.keys(O).length ? O : void 0);
|
|
12606
|
+
}, [R, T]), E = ve((M) => {
|
|
12592
12607
|
const { detail: F } = M;
|
|
12593
|
-
F != null && F.payload &&
|
|
12594
|
-
}, [
|
|
12608
|
+
F != null && F.payload && N(F.payload);
|
|
12609
|
+
}, [N]);
|
|
12595
12610
|
ce(() => (window.addEventListener(`${Et}:${yt.NEW_CONVERSATION}`, E), () => {
|
|
12596
12611
|
window.removeEventListener(`${Et}:${yt.NEW_CONVERSATION}`, E);
|
|
12597
12612
|
}), [E]), ce(() => {
|
|
12598
12613
|
const M = (H) => {
|
|
12599
12614
|
const { detail: O } = H;
|
|
12600
|
-
O != null && O.payload &&
|
|
12615
|
+
O != null && O.payload && R(O.payload);
|
|
12601
12616
|
}, F = (H) => {
|
|
12602
12617
|
const { detail: O } = H;
|
|
12603
|
-
O != null && O.payload &&
|
|
12618
|
+
O != null && O.payload && T(O.payload);
|
|
12604
12619
|
};
|
|
12605
12620
|
return window.addEventListener(`${Et}:${yt.SET_CONVERSATION_TAGS}`, M), window.addEventListener(`${Et}:${yt.SET_CONVERSATION_FIELDS}`, F), () => {
|
|
12606
12621
|
window.removeEventListener(`${Et}:${yt.SET_CONVERSATION_TAGS}`, M), window.removeEventListener(`${Et}:${yt.SET_CONVERSATION_FIELDS}`, F);
|
|
12607
12622
|
};
|
|
12608
|
-
}, [
|
|
12623
|
+
}, [R, T]), ce(() => {
|
|
12609
12624
|
if (y !== "ready" || !window.zE)
|
|
12610
12625
|
return;
|
|
12611
12626
|
const M = window.zE("messenger:on", "conversationStarted", (O) => {
|
|
12612
|
-
var
|
|
12613
|
-
const K = (D = (
|
|
12627
|
+
var A, D;
|
|
12628
|
+
const K = (D = (A = O == null ? void 0 : O.payload) == null ? void 0 : A.conversation) == null ? void 0 : D.id;
|
|
12614
12629
|
K && po({ conversationId: K });
|
|
12615
12630
|
}), F = window.zE("messenger:on", "messagesShown", (O) => {
|
|
12616
|
-
var
|
|
12617
|
-
const K = (D = (
|
|
12631
|
+
var A, D;
|
|
12632
|
+
const K = (D = (A = O == null ? void 0 : O.payload) == null ? void 0 : A.conversation) == null ? void 0 : D.id;
|
|
12618
12633
|
K && po({ conversationId: K });
|
|
12619
12634
|
}), H = window.zE("messenger:on", "postbackButtonClicked", (O) => {
|
|
12620
|
-
var
|
|
12635
|
+
var A;
|
|
12621
12636
|
const K = O == null ? void 0 : O.payload;
|
|
12622
12637
|
K != null && K.actionName && window.dispatchEvent(new CustomEvent("stackable:messaging", {
|
|
12623
12638
|
detail: {
|
|
12624
12639
|
eventName: "postback",
|
|
12625
12640
|
data: {
|
|
12626
12641
|
actionName: K.actionName,
|
|
12627
|
-
conversationId: ((
|
|
12642
|
+
conversationId: ((A = K.conversation) == null ? void 0 : A.id) ?? ""
|
|
12628
12643
|
}
|
|
12629
12644
|
}
|
|
12630
12645
|
}));
|
|
@@ -12641,9 +12656,9 @@ const Hb = ({ ...e }) => {
|
|
|
12641
12656
|
const O = x.current.getBoundingClientRect();
|
|
12642
12657
|
if ((l ? O.width : O.height) === 0)
|
|
12643
12658
|
return;
|
|
12644
|
-
const
|
|
12659
|
+
const A = l ? (H.clientX - O.left) / O.width * 100 : (H.clientY - O.top) / O.height * 100, D = Math.max(
|
|
12645
12660
|
mo,
|
|
12646
|
-
Math.min(ho,
|
|
12661
|
+
Math.min(ho, A)
|
|
12647
12662
|
);
|
|
12648
12663
|
v(D);
|
|
12649
12664
|
}, F = () => {
|
|
@@ -12693,7 +12708,7 @@ const Hb = ({ ...e }) => {
|
|
|
12693
12708
|
y === "ready" && /* @__PURE__ */ f(
|
|
12694
12709
|
"button",
|
|
12695
12710
|
{
|
|
12696
|
-
onClick: () =>
|
|
12711
|
+
onClick: () => N({}),
|
|
12697
12712
|
className: "rounded-md border border-transparent p-1.5 text-muted-foreground transition-colors hover:cursor-pointer hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
12698
12713
|
title: "New Conversation",
|
|
12699
12714
|
children: /* @__PURE__ */ f(Yd, { className: "h-4 w-4" })
|