@stackable-labs/embeddables 1.86.0 → 1.86.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react.js +119 -118
- package/dist/stackable-widget.external.js +6 -6
- package/dist/stackable-widget.js +8 -8
- 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 "9294d4ba-b080-4f5f-8b61-03af88280354";
|
|
9
9
|
} catch {
|
|
10
10
|
return "dev";
|
|
11
11
|
}
|
|
@@ -910,7 +910,7 @@ function Bl(e) {
|
|
|
910
910
|
}
|
|
911
911
|
const Hl = (e) => {
|
|
912
912
|
var t, n, o, r, s, a, i, c, d;
|
|
913
|
-
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:
|
|
913
|
+
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: z, closeButtonAriaLabel: U = "Close toast" } = e, [k, S] = I.useState(null), [_, $] = I.useState(null), [P, D] = 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, [
|
|
914
914
|
v,
|
|
915
915
|
l.id
|
|
916
916
|
]), Yc = I.useMemo(() => {
|
|
@@ -934,7 +934,7 @@ const Hl = (e) => {
|
|
|
934
934
|
}, [
|
|
935
935
|
fr
|
|
936
936
|
]), I.useEffect(() => {
|
|
937
|
-
|
|
937
|
+
D(!0);
|
|
938
938
|
}, []), I.useEffect(() => {
|
|
939
939
|
const ne = ye.current;
|
|
940
940
|
if (ne) {
|
|
@@ -1016,19 +1016,19 @@ const Hl = (e) => {
|
|
|
1016
1016
|
]);
|
|
1017
1017
|
function Zc() {
|
|
1018
1018
|
var ne;
|
|
1019
|
-
if (
|
|
1019
|
+
if (z != null && z.loading) {
|
|
1020
1020
|
var me;
|
|
1021
1021
|
return /* @__PURE__ */ I.createElement("div", {
|
|
1022
1022
|
className: ze(A == null ? void 0 : A.loader, l == null || (me = l.classNames) == null ? void 0 : me.loader, "sonner-loader"),
|
|
1023
1023
|
"data-visible": Se === "loading"
|
|
1024
|
-
},
|
|
1024
|
+
}, z.loading);
|
|
1025
1025
|
}
|
|
1026
1026
|
return /* @__PURE__ */ I.createElement(wl, {
|
|
1027
1027
|
className: ze(A == null ? void 0 : A.loader, l == null || (ne = l.classNames) == null ? void 0 : ne.loader),
|
|
1028
1028
|
visible: Se === "loading"
|
|
1029
1029
|
});
|
|
1030
1030
|
}
|
|
1031
|
-
const Jc = l.icon || (
|
|
1031
|
+
const Jc = l.icon || (z == null ? void 0 : z[Se]) || bl(Se);
|
|
1032
1032
|
var gr, vr;
|
|
1033
1033
|
return /* @__PURE__ */ I.createElement("li", {
|
|
1034
1034
|
tabIndex: 0,
|
|
@@ -1124,7 +1124,7 @@ const Hl = (e) => {
|
|
|
1124
1124
|
Xe(), l.onDismiss == null || l.onDismiss.call(l, l);
|
|
1125
1125
|
},
|
|
1126
1126
|
className: ze(A == null ? void 0 : A.closeButton, l == null || (o = l.classNames) == null ? void 0 : o.closeButton)
|
|
1127
|
-
}, (vr =
|
|
1127
|
+
}, (vr = z == null ? void 0 : z.close) != null ? vr : kl) : null, (Se || l.icon || l.promise) && l.icon !== null && ((z == null ? void 0 : z[Se]) !== null || l.icon) ? /* @__PURE__ */ I.createElement("div", {
|
|
1128
1128
|
"data-icon": "",
|
|
1129
1129
|
className: ze(A == null ? void 0 : A.icon, l == null || (r = l.classNames) == null ? void 0 : r.icon)
|
|
1130
1130
|
}, l.promise || l.type === "loading" && !l.icon ? l.icon || Zc() : null, l.type !== "loading" ? Jc : null) : null, /* @__PURE__ */ I.createElement("div", {
|
|
@@ -1198,16 +1198,16 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1198
1198
|
].concat(E.filter((P) => P.position).map((P) => P.position)))), [
|
|
1199
1199
|
E,
|
|
1200
1200
|
s
|
|
1201
|
-
]), [W, M] = I.useState([]), [F, H] = I.useState(!1), [O, K] = I.useState(!1), [A,
|
|
1202
|
-
N((
|
|
1201
|
+
]), [W, M] = I.useState([]), [F, H] = I.useState(!1), [O, K] = I.useState(!1), [A, z] = 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) => {
|
|
1202
|
+
N((D) => {
|
|
1203
1203
|
var B;
|
|
1204
|
-
return (B =
|
|
1204
|
+
return (B = D.find((J) => J.id === P.id)) != null && B.delete || we.dismiss(P.id), D.filter(({ id: J }) => J !== P.id);
|
|
1205
1205
|
});
|
|
1206
1206
|
}, []);
|
|
1207
1207
|
return I.useEffect(() => we.subscribe((P) => {
|
|
1208
1208
|
if (P.dismiss) {
|
|
1209
1209
|
requestAnimationFrame(() => {
|
|
1210
|
-
N((
|
|
1210
|
+
N((D) => D.map((B) => B.id === P.id ? {
|
|
1211
1211
|
...B,
|
|
1212
1212
|
delete: !0
|
|
1213
1213
|
} : B));
|
|
@@ -1216,18 +1216,18 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1216
1216
|
}
|
|
1217
1217
|
setTimeout(() => {
|
|
1218
1218
|
hs.flushSync(() => {
|
|
1219
|
-
N((
|
|
1220
|
-
const B =
|
|
1219
|
+
N((D) => {
|
|
1220
|
+
const B = D.findIndex((J) => J.id === P.id);
|
|
1221
1221
|
return B !== -1 ? [
|
|
1222
|
-
...
|
|
1222
|
+
...D.slice(0, B),
|
|
1223
1223
|
{
|
|
1224
|
-
...
|
|
1224
|
+
...D[B],
|
|
1225
1225
|
...P
|
|
1226
1226
|
},
|
|
1227
|
-
...
|
|
1227
|
+
...D.slice(B + 1)
|
|
1228
1228
|
] : [
|
|
1229
1229
|
P,
|
|
1230
|
-
...
|
|
1230
|
+
...D
|
|
1231
1231
|
];
|
|
1232
1232
|
});
|
|
1233
1233
|
});
|
|
@@ -1236,19 +1236,19 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1236
1236
|
T
|
|
1237
1237
|
]), I.useEffect(() => {
|
|
1238
1238
|
if (m !== "system") {
|
|
1239
|
-
|
|
1239
|
+
z(m);
|
|
1240
1240
|
return;
|
|
1241
1241
|
}
|
|
1242
|
-
if (m === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ?
|
|
1242
|
+
if (m === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? z("dark") : z("light")), typeof window > "u") return;
|
|
1243
1243
|
const P = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1244
1244
|
try {
|
|
1245
|
-
P.addEventListener("change", ({ matches:
|
|
1246
|
-
D
|
|
1245
|
+
P.addEventListener("change", ({ matches: D }) => {
|
|
1246
|
+
z(D ? "dark" : "light");
|
|
1247
1247
|
});
|
|
1248
1248
|
} catch {
|
|
1249
1249
|
P.addListener(({ matches: B }) => {
|
|
1250
1250
|
try {
|
|
1251
|
-
|
|
1251
|
+
z(B ? "dark" : "light");
|
|
1252
1252
|
} catch (J) {
|
|
1253
1253
|
console.error(J);
|
|
1254
1254
|
}
|
|
@@ -1261,13 +1261,13 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1261
1261
|
}, [
|
|
1262
1262
|
T
|
|
1263
1263
|
]), I.useEffect(() => {
|
|
1264
|
-
const P = (
|
|
1264
|
+
const P = (D) => {
|
|
1265
1265
|
var B;
|
|
1266
|
-
if (a.every((Y) =>
|
|
1266
|
+
if (a.every((Y) => D[Y] || D.code === Y)) {
|
|
1267
1267
|
var j;
|
|
1268
1268
|
H(!0), (j = U.current) == null || j.focus();
|
|
1269
1269
|
}
|
|
1270
|
-
|
|
1270
|
+
D.code === "Escape" && (document.activeElement === U.current || (B = U.current) != null && B.contains(document.activeElement)) && H(!1);
|
|
1271
1271
|
};
|
|
1272
1272
|
return document.addEventListener("keydown", P), () => document.removeEventListener("keydown", P);
|
|
1273
1273
|
}, [
|
|
@@ -1290,7 +1290,7 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1290
1290
|
"aria-relevant": "additions text",
|
|
1291
1291
|
"aria-atomic": "false",
|
|
1292
1292
|
suppressHydrationWarning: !0
|
|
1293
|
-
}, L.map((P,
|
|
1293
|
+
}, L.map((P, D) => {
|
|
1294
1294
|
var B;
|
|
1295
1295
|
const [J, j] = P.split("-");
|
|
1296
1296
|
return E.length ? /* @__PURE__ */ I.createElement("ol", {
|
|
@@ -1328,7 +1328,7 @@ const Wl = /* @__PURE__ */ I.forwardRef(function(t, n) {
|
|
|
1328
1328
|
Y.target instanceof HTMLElement && Y.target.dataset.dismissible === "false" || K(!0);
|
|
1329
1329
|
},
|
|
1330
1330
|
onPointerUp: () => K(!1)
|
|
1331
|
-
}, E.filter((Y) => !Y.position &&
|
|
1331
|
+
}, E.filter((Y) => !Y.position && D === 0 || Y.position === P).map((Y, ee) => {
|
|
1332
1332
|
var te, se;
|
|
1333
1333
|
return /* @__PURE__ */ I.createElement(Hl, {
|
|
1334
1334
|
key: Y.id,
|
|
@@ -2320,13 +2320,13 @@ const au = (e, t) => {
|
|
|
2320
2320
|
"left-bottom"
|
|
2321
2321
|
], 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", {
|
|
2322
2322
|
span: ["full", Je, G, V]
|
|
2323
|
-
}, 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()],
|
|
2323
|
+
}, 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()], z = () => [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, {
|
|
2324
2324
|
position: [G, V]
|
|
2325
2325
|
}], $ = () => ["no-repeat", {
|
|
2326
2326
|
repeat: ["", "x", "y", "space", "round"]
|
|
2327
2327
|
}], P = () => ["auto", "cover", "contain", Wu, $u, {
|
|
2328
2328
|
size: [G, V]
|
|
2329
|
-
}],
|
|
2329
|
+
}], D = () => [Jn, zt, ct], B = () => [
|
|
2330
2330
|
// Deprecated since Tailwind CSS v4.0.0
|
|
2331
2331
|
"",
|
|
2332
2332
|
"none",
|
|
@@ -3019,7 +3019,7 @@ const au = (e, t) => {
|
|
|
3019
3019
|
* @see https://tailwindcss.com/docs/width#setting-both-width-and-height
|
|
3020
3020
|
*/
|
|
3021
3021
|
size: [{
|
|
3022
|
-
size:
|
|
3022
|
+
size: z()
|
|
3023
3023
|
}],
|
|
3024
3024
|
/**
|
|
3025
3025
|
* Inline Size
|
|
@@ -3068,7 +3068,7 @@ const au = (e, t) => {
|
|
|
3068
3068
|
* @see https://tailwindcss.com/docs/width
|
|
3069
3069
|
*/
|
|
3070
3070
|
w: [{
|
|
3071
|
-
w: [i, "screen", ...
|
|
3071
|
+
w: [i, "screen", ...z()]
|
|
3072
3072
|
}],
|
|
3073
3073
|
/**
|
|
3074
3074
|
* Min-Width
|
|
@@ -3080,7 +3080,7 @@ const au = (e, t) => {
|
|
|
3080
3080
|
"screen",
|
|
3081
3081
|
/** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
|
|
3082
3082
|
"none",
|
|
3083
|
-
...
|
|
3083
|
+
...z()
|
|
3084
3084
|
]
|
|
3085
3085
|
}],
|
|
3086
3086
|
/**
|
|
@@ -3098,7 +3098,7 @@ const au = (e, t) => {
|
|
|
3098
3098
|
{
|
|
3099
3099
|
screen: [a]
|
|
3100
3100
|
},
|
|
3101
|
-
...
|
|
3101
|
+
...z()
|
|
3102
3102
|
]
|
|
3103
3103
|
}],
|
|
3104
3104
|
/**
|
|
@@ -3106,21 +3106,21 @@ const au = (e, t) => {
|
|
|
3106
3106
|
* @see https://tailwindcss.com/docs/height
|
|
3107
3107
|
*/
|
|
3108
3108
|
h: [{
|
|
3109
|
-
h: ["screen", "lh", ...
|
|
3109
|
+
h: ["screen", "lh", ...z()]
|
|
3110
3110
|
}],
|
|
3111
3111
|
/**
|
|
3112
3112
|
* Min-Height
|
|
3113
3113
|
* @see https://tailwindcss.com/docs/min-height
|
|
3114
3114
|
*/
|
|
3115
3115
|
"min-h": [{
|
|
3116
|
-
"min-h": ["screen", "lh", "none", ...
|
|
3116
|
+
"min-h": ["screen", "lh", "none", ...z()]
|
|
3117
3117
|
}],
|
|
3118
3118
|
/**
|
|
3119
3119
|
* Max-Height
|
|
3120
3120
|
* @see https://tailwindcss.com/docs/max-height
|
|
3121
3121
|
*/
|
|
3122
3122
|
"max-h": [{
|
|
3123
|
-
"max-h": ["screen", "lh", ...
|
|
3123
|
+
"max-h": ["screen", "lh", ...z()]
|
|
3124
3124
|
}],
|
|
3125
3125
|
// ------------------
|
|
3126
3126
|
// --- Typography ---
|
|
@@ -3437,21 +3437,21 @@ const au = (e, t) => {
|
|
|
3437
3437
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3438
3438
|
*/
|
|
3439
3439
|
"gradient-from-pos": [{
|
|
3440
|
-
from:
|
|
3440
|
+
from: D()
|
|
3441
3441
|
}],
|
|
3442
3442
|
/**
|
|
3443
3443
|
* Gradient Color Stops Via Position
|
|
3444
3444
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3445
3445
|
*/
|
|
3446
3446
|
"gradient-via-pos": [{
|
|
3447
|
-
via:
|
|
3447
|
+
via: D()
|
|
3448
3448
|
}],
|
|
3449
3449
|
/**
|
|
3450
3450
|
* Gradient Color Stops To Position
|
|
3451
3451
|
* @see https://tailwindcss.com/docs/gradient-color-stops
|
|
3452
3452
|
*/
|
|
3453
3453
|
"gradient-to-pos": [{
|
|
3454
|
-
to:
|
|
3454
|
+
to: D()
|
|
3455
3455
|
}],
|
|
3456
3456
|
/**
|
|
3457
3457
|
* Gradient Color Stops From
|
|
@@ -6919,14 +6919,14 @@ const qp = 50, Kp = async (e, t, n) => {
|
|
|
6919
6919
|
}, 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));
|
|
6920
6920
|
let N = T ? T[x] : 0;
|
|
6921
6921
|
(!N || !await (a.isElement == null ? void 0 : a.isElement(T))) && (N = i.floating[x] || s.floating[b]);
|
|
6922
|
-
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,
|
|
6922
|
+
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, z = A ? O < F ? O - F : O - H : 0;
|
|
6923
6923
|
return {
|
|
6924
|
-
[h]: m[h] +
|
|
6924
|
+
[h]: m[h] + z,
|
|
6925
6925
|
data: {
|
|
6926
6926
|
[h]: K,
|
|
6927
|
-
centerOffset: O - K -
|
|
6927
|
+
centerOffset: O - K - z,
|
|
6928
6928
|
...A && {
|
|
6929
|
-
alignmentOffset:
|
|
6929
|
+
alignmentOffset: z
|
|
6930
6930
|
}
|
|
6931
6931
|
},
|
|
6932
6932
|
reset: A
|
|
@@ -6982,12 +6982,12 @@ const qp = 50, Kp = async (e, t, n) => {
|
|
|
6982
6982
|
placement: K
|
|
6983
6983
|
}
|
|
6984
6984
|
};
|
|
6985
|
-
let A = (F = W.filter((
|
|
6985
|
+
let A = (F = W.filter((z) => z.overflows[0] <= 0).sort((z, U) => z.overflows[1] - U.overflows[1])[0]) == null ? void 0 : F.placement;
|
|
6986
6986
|
if (!A)
|
|
6987
6987
|
switch (h) {
|
|
6988
6988
|
case "bestFit": {
|
|
6989
6989
|
var H;
|
|
6990
|
-
const
|
|
6990
|
+
const z = (H = W.filter((U) => {
|
|
6991
6991
|
if (T) {
|
|
6992
6992
|
const k = Be(U.placement);
|
|
6993
6993
|
return k === w || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -6996,7 +6996,7 @@ const qp = 50, Kp = async (e, t, n) => {
|
|
|
6996
6996
|
}
|
|
6997
6997
|
return !0;
|
|
6998
6998
|
}).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];
|
|
6999
|
-
|
|
6999
|
+
z && (A = z);
|
|
7000
7000
|
break;
|
|
7001
7001
|
}
|
|
7002
7002
|
case "initialPlacement":
|
|
@@ -7876,7 +7876,7 @@ function Mm(e) {
|
|
|
7876
7876
|
}), [w, x]), A = p.useMemo(() => ({
|
|
7877
7877
|
reference: C,
|
|
7878
7878
|
floating: R
|
|
7879
|
-
}), [C, R]),
|
|
7879
|
+
}), [C, R]), z = p.useMemo(() => {
|
|
7880
7880
|
const U = {
|
|
7881
7881
|
position: n,
|
|
7882
7882
|
left: 0,
|
|
@@ -7902,8 +7902,8 @@ function Mm(e) {
|
|
|
7902
7902
|
update: H,
|
|
7903
7903
|
refs: K,
|
|
7904
7904
|
elements: A,
|
|
7905
|
-
floatingStyles:
|
|
7906
|
-
}), [u, H, K, A,
|
|
7905
|
+
floatingStyles: z
|
|
7906
|
+
}), [u, H, K, A, z]);
|
|
7907
7907
|
}
|
|
7908
7908
|
const Om = (e) => {
|
|
7909
7909
|
function t(n) {
|
|
@@ -8026,7 +8026,7 @@ var tr = "PopperContent", [jm, Gm] = Ha(tr), Ga = p.forwardRef(
|
|
|
8026
8026
|
boundary: M.filter(qm),
|
|
8027
8027
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
8028
8028
|
altBoundary: F
|
|
8029
|
-
}, { refs: O, floatingStyles: K, placement: A, isPositioned:
|
|
8029
|
+
}, { refs: O, floatingStyles: K, placement: A, isPositioned: z, middlewareData: U } = Mm({
|
|
8030
8030
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
8031
8031
|
strategy: "fixed",
|
|
8032
8032
|
placement: L,
|
|
@@ -8058,9 +8058,9 @@ var tr = "PopperContent", [jm, Gm] = Ha(tr), Ga = p.forwardRef(
|
|
|
8058
8058
|
]
|
|
8059
8059
|
}), [k, S] = Ka(A), _ = be(b);
|
|
8060
8060
|
de(() => {
|
|
8061
|
-
|
|
8062
|
-
}, [
|
|
8063
|
-
const $ = (j = U.arrow) == null ? void 0 : j.x, P = (Y = U.arrow) == null ? void 0 : Y.y,
|
|
8061
|
+
z && (_ == null || _());
|
|
8062
|
+
}, [z, _]);
|
|
8063
|
+
const $ = (j = U.arrow) == null ? void 0 : j.x, P = (Y = U.arrow) == null ? void 0 : Y.y, D = ((ee = U.arrow) == null ? void 0 : ee.centerOffset) !== 0, [B, J] = p.useState();
|
|
8064
8064
|
return de(() => {
|
|
8065
8065
|
y && J(window.getComputedStyle(y).zIndex);
|
|
8066
8066
|
}, [y]), /* @__PURE__ */ f(
|
|
@@ -8070,7 +8070,7 @@ var tr = "PopperContent", [jm, Gm] = Ha(tr), Ga = p.forwardRef(
|
|
|
8070
8070
|
"data-radix-popper-content-wrapper": "",
|
|
8071
8071
|
style: {
|
|
8072
8072
|
...K,
|
|
8073
|
-
transform:
|
|
8073
|
+
transform: z ? K.transform : "translate(0, -200%)",
|
|
8074
8074
|
// keep off the page when measuring
|
|
8075
8075
|
minWidth: "max-content",
|
|
8076
8076
|
zIndex: B,
|
|
@@ -8095,7 +8095,7 @@ var tr = "PopperContent", [jm, Gm] = Ha(tr), Ga = p.forwardRef(
|
|
|
8095
8095
|
onArrowChange: R,
|
|
8096
8096
|
arrowX: $,
|
|
8097
8097
|
arrowY: P,
|
|
8098
|
-
shouldHideArrow:
|
|
8098
|
+
shouldHideArrow: D,
|
|
8099
8099
|
children: /* @__PURE__ */ f(
|
|
8100
8100
|
Z.div,
|
|
8101
8101
|
{
|
|
@@ -8107,7 +8107,7 @@ var tr = "PopperContent", [jm, Gm] = Ha(tr), Ga = p.forwardRef(
|
|
|
8107
8107
|
...g.style,
|
|
8108
8108
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
8109
8109
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
8110
|
-
animation:
|
|
8110
|
+
animation: z ? void 0 : "none"
|
|
8111
8111
|
}
|
|
8112
8112
|
}
|
|
8113
8113
|
)
|
|
@@ -9222,11 +9222,11 @@ var Fh = ki, Bh = Ri, Hh = Mi, Vh = [" ", "Enter", "ArrowUp", "ArrowDown"], Wh =
|
|
|
9222
9222
|
{
|
|
9223
9223
|
scope: e.__scopeSelect,
|
|
9224
9224
|
onNativeOptionAdd: p.useCallback((A) => {
|
|
9225
|
-
O((
|
|
9225
|
+
O((z) => new Set(z).add(A));
|
|
9226
9226
|
}, []),
|
|
9227
9227
|
onNativeOptionRemove: p.useCallback((A) => {
|
|
9228
|
-
O((
|
|
9229
|
-
const U = new Set(
|
|
9228
|
+
O((z) => {
|
|
9229
|
+
const U = new Set(z);
|
|
9230
9230
|
return U.delete(A), U;
|
|
9231
9231
|
});
|
|
9232
9232
|
}, []),
|
|
@@ -9378,13 +9378,13 @@ var _e = 10, [ji, st] = Lt(pt), Xh = "SelectContentImpl", Zh = /* @__PURE__ */ W
|
|
|
9378
9378
|
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;
|
|
9379
9379
|
},
|
|
9380
9380
|
[F, R]
|
|
9381
|
-
),
|
|
9381
|
+
), z = p.useCallback(
|
|
9382
9382
|
() => A([E, x]),
|
|
9383
9383
|
[A, E, x]
|
|
9384
9384
|
);
|
|
9385
9385
|
p.useEffect(() => {
|
|
9386
|
-
H &&
|
|
9387
|
-
}, [H,
|
|
9386
|
+
H && z();
|
|
9387
|
+
}, [H, z]);
|
|
9388
9388
|
const { onOpenChange: U, triggerPointerDownPosRef: k } = w;
|
|
9389
9389
|
p.useEffect(() => {
|
|
9390
9390
|
if (x) {
|
|
@@ -9417,7 +9417,7 @@ var _e = 10, [ji, st] = Lt(pt), Xh = "SelectContentImpl", Zh = /* @__PURE__ */ W
|
|
|
9417
9417
|
(w.value !== void 0 && w.value === Y || te) && (L(j), te && (K.current = !0));
|
|
9418
9418
|
},
|
|
9419
9419
|
[w.value]
|
|
9420
|
-
), P = p.useCallback(() => x == null ? void 0 : x.focus(), [x]),
|
|
9420
|
+
), P = p.useCallback(() => x == null ? void 0 : x.focus(), [x]), D = p.useCallback(
|
|
9421
9421
|
(j, Y, ee) => {
|
|
9422
9422
|
const te = !K.current && !ee;
|
|
9423
9423
|
(w.value !== void 0 && w.value === Y || te) && M(j);
|
|
@@ -9445,8 +9445,8 @@ var _e = 10, [ji, st] = Lt(pt), Xh = "SelectContentImpl", Zh = /* @__PURE__ */ W
|
|
|
9445
9445
|
itemRefCallback: $,
|
|
9446
9446
|
selectedItem: E,
|
|
9447
9447
|
onItemLeave: P,
|
|
9448
|
-
itemTextRefCallback:
|
|
9449
|
-
focusSelectedItem:
|
|
9448
|
+
itemTextRefCallback: D,
|
|
9449
|
+
focusSelectedItem: z,
|
|
9450
9450
|
selectedItemText: W,
|
|
9451
9451
|
position: o,
|
|
9452
9452
|
isPositioned: H,
|
|
@@ -9536,25 +9536,25 @@ var Jh = "SelectItemAlignedPosition", Yi = p.forwardRef((e, t) => {
|
|
|
9536
9536
|
]);
|
|
9537
9537
|
i.style.minWidth = fe + "px", i.style.right = Te + "px";
|
|
9538
9538
|
}
|
|
9539
|
-
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),
|
|
9540
|
-
if (Y <=
|
|
9539
|
+
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), z = parseInt(O.borderBottomWidth, 10), U = parseInt(O.paddingBottom, 10), k = K + A + H + U + z, S = Math.min(v.offsetHeight * 5, k), _ = window.getComputedStyle(g), $ = parseInt(_.paddingTop, 10), P = parseInt(_.paddingBottom, 10), D = N.top + N.height / 2 - _e, B = F - D, J = v.offsetHeight / 2, j = v.offsetTop + J, Y = K + A + j, ee = k - Y;
|
|
9540
|
+
if (Y <= D) {
|
|
9541
9541
|
const se = M.length > 0 && v === M[M.length - 1].ref.current;
|
|
9542
9542
|
i.style.bottom = "0px";
|
|
9543
9543
|
const oe = d.clientHeight - g.offsetTop - g.offsetHeight, ue = Math.max(
|
|
9544
9544
|
B,
|
|
9545
9545
|
J + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
9546
|
-
(se ? P : 0) + oe +
|
|
9546
|
+
(se ? P : 0) + oe + z
|
|
9547
9547
|
), fe = Y + ue;
|
|
9548
9548
|
i.style.height = fe + "px";
|
|
9549
9549
|
} else {
|
|
9550
9550
|
const se = M.length > 0 && v === M[0].ref.current;
|
|
9551
9551
|
i.style.top = "0px";
|
|
9552
9552
|
const ue = Math.max(
|
|
9553
|
-
|
|
9553
|
+
D,
|
|
9554
9554
|
K + g.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
9555
9555
|
(se ? $ : 0) + J
|
|
9556
9556
|
) + ee;
|
|
9557
|
-
i.style.height = ue + "px", g.scrollTop = Y -
|
|
9557
|
+
i.style.height = ue + "px", g.scrollTop = Y - D + g.offsetTop;
|
|
9558
9558
|
}
|
|
9559
9559
|
i.style.margin = `${_e}px 0`, i.style.minHeight = S + "px", i.style.maxHeight = F + "px", o == null || o(), requestAnimationFrame(() => h.current = !0);
|
|
9560
9560
|
}
|
|
@@ -11828,15 +11828,15 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
11828
11828
|
headers: { "Content-Type": "application/json" },
|
|
11829
11829
|
body: JSON.stringify({
|
|
11830
11830
|
appId: n,
|
|
11831
|
-
extensionId: i.id,
|
|
11832
11831
|
instanceId: o,
|
|
11832
|
+
extensionId: i.id,
|
|
11833
11833
|
...u && { mode: u },
|
|
11834
11834
|
...d && { devSessionToken: d }
|
|
11835
11835
|
})
|
|
11836
11836
|
});
|
|
11837
11837
|
if (m.ok) {
|
|
11838
|
-
const { token: h, encryptionKey: b } = await m.json();
|
|
11839
|
-
s.set(i.id, { token: h, encryptionKey: b });
|
|
11838
|
+
const { token: h, encryptionKey: b, settings: g } = await m.json();
|
|
11839
|
+
console.log(`[embeddables] proxyToken response for ${i.id}:`, { hasToken: !!h, hasEncKey: !!b, settings: g }), s.set(i.id, { token: h, encryptionKey: b, settings: g });
|
|
11840
11840
|
} else {
|
|
11841
11841
|
let h = `Proxy token failed (${m.status})`;
|
|
11842
11842
|
u && !d ? h = "Session token missing — re-run CLI" : u && (h = "Session expired or invalid — re-run CLI"), a.set(i.id, h), console.warn(`[embeddables] Failed to obtain proxy token for extension ${i.id} (${m.status}) — ${h}`);
|
|
@@ -11886,8 +11886,8 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
11886
11886
|
console.warn(`[ExtensionSetup] Instance not found or failed to load: ${S}`), d([]), y(!0);
|
|
11887
11887
|
return;
|
|
11888
11888
|
}
|
|
11889
|
-
const $ = await _.json(), P = ws(typeof window < "u" ? window.location.search : ""),
|
|
11890
|
-
d(
|
|
11889
|
+
const $ = await _.json(), P = ws(typeof window < "u" ? window.location.search : ""), D = await Yl($, P), { tokens: B, errors: J } = await Lb(D, n, o, S, P);
|
|
11890
|
+
d(D), l(P), h(new Map(B)), g(J);
|
|
11891
11891
|
} catch (_) {
|
|
11892
11892
|
console.error("Failed to load extensions:", _);
|
|
11893
11893
|
} finally {
|
|
@@ -11904,31 +11904,32 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
11904
11904
|
var P;
|
|
11905
11905
|
return $.manifest.permissions.includes("data:fetch") || (((P = $.manifest.settingsSchema) == null ? void 0 : P.length) ?? 0) > 0;
|
|
11906
11906
|
}).map(async ($) => {
|
|
11907
|
-
const P = u.find((Y) => Y.extensionId === $.id),
|
|
11907
|
+
const P = u.find((Y) => Y.extensionId === $.id), D = P == null ? void 0 : P.token, B = P == null ? void 0 : P.mode, J = Ft(n, "/proxy-token"), j = await fetch(J, {
|
|
11908
11908
|
method: "POST",
|
|
11909
11909
|
headers: { "Content-Type": "application/json" },
|
|
11910
11910
|
body: JSON.stringify({
|
|
11911
11911
|
appId: o,
|
|
11912
11912
|
extensionId: $.id,
|
|
11913
|
+
instanceId: e,
|
|
11913
11914
|
...B && { mode: B },
|
|
11914
|
-
...
|
|
11915
|
+
...D && { devSessionToken: D }
|
|
11915
11916
|
})
|
|
11916
11917
|
});
|
|
11917
11918
|
if (j.ok) {
|
|
11918
|
-
const { token: Y, encryptionKey: ee } = await j.json();
|
|
11919
|
-
_.push([$.id, { token: Y, encryptionKey: ee }]);
|
|
11919
|
+
const { token: Y, encryptionKey: ee, settings: te } = await j.json();
|
|
11920
|
+
_.push([$.id, { token: Y, encryptionKey: ee, settings: te }]);
|
|
11920
11921
|
} else
|
|
11921
11922
|
console.warn(`[embeddables] Proxy token refresh failed for extension ${$.id} (${j.status}) — using stale token`);
|
|
11922
11923
|
})
|
|
11923
11924
|
), _.length > 0 && h(($) => {
|
|
11924
11925
|
const P = new Map($);
|
|
11925
|
-
for (const [
|
|
11926
|
-
P.set(
|
|
11926
|
+
for (const [D, B] of _)
|
|
11927
|
+
P.set(D, B);
|
|
11927
11928
|
return P;
|
|
11928
11929
|
});
|
|
11929
11930
|
}, 3300 * 1e3);
|
|
11930
11931
|
return () => clearInterval(S);
|
|
11931
|
-
}, [c, u, n, o]), ce(() => {
|
|
11932
|
+
}, [c, u, n, o, e]), ce(() => {
|
|
11932
11933
|
if (m.size === 0)
|
|
11933
11934
|
return;
|
|
11934
11935
|
const k = (S) => {
|
|
@@ -11938,8 +11939,8 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
11938
11939
|
const $ = _.extensionId, P = c.find((J) => J.id === $);
|
|
11939
11940
|
if (!(P != null && P.bundleUrl))
|
|
11940
11941
|
return;
|
|
11941
|
-
const
|
|
11942
|
-
if (Ul(P.bundleUrl) && (
|
|
11942
|
+
const D = u.find((J) => J.extensionId === $);
|
|
11943
|
+
if (Ul(P.bundleUrl) && (D == null ? void 0 : D.mode) !== "staging")
|
|
11943
11944
|
return;
|
|
11944
11945
|
const B = m.get($);
|
|
11945
11946
|
B && $e($, { type: "extension-encryption-key", encryptionKey: B.encryptionKey });
|
|
@@ -11951,8 +11952,8 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
11951
11952
|
for (const [$, P] of _) {
|
|
11952
11953
|
if (!P.manifest.permissions.includes("events:identity"))
|
|
11953
11954
|
continue;
|
|
11954
|
-
const
|
|
11955
|
-
!
|
|
11955
|
+
const D = P.manifest.events ?? [];
|
|
11956
|
+
!D.includes("identity") && !D.includes(`identity:${k}`) || $e($, {
|
|
11956
11957
|
type: "extension-event",
|
|
11957
11958
|
eventType: "identity",
|
|
11958
11959
|
payload: { eventName: k, data: { state: S, timestamp: Zn((/* @__PURE__ */ new Date()).toISOString()) } }
|
|
@@ -11984,8 +11985,8 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
11984
11985
|
}
|
|
11985
11986
|
}, []), F = ve(async (k) => {
|
|
11986
11987
|
const S = kt(), _ = [];
|
|
11987
|
-
for (const [P,
|
|
11988
|
-
if (!
|
|
11988
|
+
for (const [P, D] of S) {
|
|
11989
|
+
if (!D.manifest.permissions.includes("extend:identity"))
|
|
11989
11990
|
continue;
|
|
11990
11991
|
const B = new Promise((J) => {
|
|
11991
11992
|
const j = `enrich_${P}_${Date.now()}`, Y = (ee) => {
|
|
@@ -12038,15 +12039,15 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12038
12039
|
(async () => {
|
|
12039
12040
|
const P = await F({ ...$, email: S, name: _ });
|
|
12040
12041
|
console.log("[embeddables] Enriched claims:", P);
|
|
12041
|
-
const
|
|
12042
|
+
const D = await H({
|
|
12042
12043
|
...$,
|
|
12043
12044
|
...P,
|
|
12044
12045
|
email: S,
|
|
12045
12046
|
name: _
|
|
12046
12047
|
});
|
|
12047
|
-
console.log("[embeddables] Sign result:", { hasToken: !!
|
|
12048
|
+
console.log("[embeddables] Sign result:", { hasToken: !!D }), D && O(D);
|
|
12048
12049
|
})();
|
|
12049
|
-
}, [F, H, O]),
|
|
12050
|
+
}, [F, H, O]), z = ve((k) => {
|
|
12050
12051
|
if (E.length > 0 && N.current.size < E.length) {
|
|
12051
12052
|
console.log(`[embeddables] Deferring sign lifecycle — waiting for extend:identity extensions: ${N.current.size}/${E.length} ready`), T.current = k;
|
|
12052
12053
|
return;
|
|
@@ -12071,14 +12072,14 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12071
12072
|
};
|
|
12072
12073
|
x((S) => {
|
|
12073
12074
|
var _, $;
|
|
12074
|
-
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"),
|
|
12075
|
+
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"), z(k.user), L("login", k), k);
|
|
12075
12076
|
});
|
|
12076
12077
|
} else {
|
|
12077
12078
|
if (s === void 0)
|
|
12078
12079
|
return;
|
|
12079
12080
|
x((k) => k.authenticated ? (console.log("[embeddables] Customer props cleared, logging out"), K(), L("logout", { authenticated: !1, user: null }), { authenticated: !1, user: null }) : k);
|
|
12080
12081
|
}
|
|
12081
|
-
}, [v, s, a, i, E,
|
|
12082
|
+
}, [v, s, a, i, E, z, L, K]), ce(() => {
|
|
12082
12083
|
if (!v || s !== void 0)
|
|
12083
12084
|
return;
|
|
12084
12085
|
const k = () => {
|
|
@@ -12094,9 +12095,9 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12094
12095
|
provider: "shopify"
|
|
12095
12096
|
}
|
|
12096
12097
|
};
|
|
12097
|
-
x((
|
|
12098
|
+
x((D) => {
|
|
12098
12099
|
var B, J;
|
|
12099
|
-
return
|
|
12100
|
+
return D.authenticated && ((B = D.user) == null ? void 0 : B.id) === ((J = P.user) == null ? void 0 : J.id) ? D : (console.log("[embeddables] Identity state changed (DOM), starting sign lifecycle"), z(P.user), L("login", P), P);
|
|
12100
12101
|
});
|
|
12101
12102
|
} catch {
|
|
12102
12103
|
console.warn("[embeddables] Failed to parse #stackable-identity JSON");
|
|
@@ -12107,7 +12108,7 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12107
12108
|
k();
|
|
12108
12109
|
const S = new MutationObserver(k);
|
|
12109
12110
|
return S.observe(document.head, { childList: !0, subtree: !0 }), S.observe(document.body, { childList: !0, subtree: !0 }), () => S.disconnect();
|
|
12110
|
-
}, [v, s,
|
|
12111
|
+
}, [v, s, z, L, K]), ce(() => {
|
|
12111
12112
|
if (!w.authenticated)
|
|
12112
12113
|
return;
|
|
12113
12114
|
const k = (S) => {
|
|
@@ -12117,8 +12118,8 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12117
12118
|
const $ = _.extensionId, P = c.find((B) => B.id === $);
|
|
12118
12119
|
if (!(P != null && P.manifest.permissions.includes("events:identity")))
|
|
12119
12120
|
return;
|
|
12120
|
-
const
|
|
12121
|
-
!
|
|
12121
|
+
const D = P.manifest.events ?? [];
|
|
12122
|
+
!D.includes("identity") && !D.includes("identity:login") || $e($, {
|
|
12122
12123
|
type: "extension-event",
|
|
12123
12124
|
eventType: "identity",
|
|
12124
12125
|
payload: { eventName: "login", data: { state: w, timestamp: Zn((/* @__PURE__ */ new Date()).toISOString()) } }
|
|
@@ -12135,8 +12136,8 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12135
12136
|
const P = $.extensionId;
|
|
12136
12137
|
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)) {
|
|
12137
12138
|
console.log("[embeddables] All extend:identity extensions ready, running deferred sign lifecycle");
|
|
12138
|
-
const
|
|
12139
|
-
T.current = null, A(
|
|
12139
|
+
const D = T.current;
|
|
12140
|
+
T.current = null, A(D);
|
|
12140
12141
|
}
|
|
12141
12142
|
};
|
|
12142
12143
|
window.addEventListener("message", k);
|
|
@@ -12186,10 +12187,10 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12186
12187
|
for (const [$, P] of S) {
|
|
12187
12188
|
if (!P.manifest.permissions.includes("context:read"))
|
|
12188
12189
|
continue;
|
|
12189
|
-
const
|
|
12190
|
-
$e($, { type: "context-push", context: B });
|
|
12190
|
+
const D = (_ = m.get($)) == null ? void 0 : _.settings, B = D ? { ...k, settings: D } : k;
|
|
12191
|
+
console.log(`[embeddables] context-push for ${$}:`, { hasSettings: !!D, settings: D }), $e($, { type: "context-push", context: B });
|
|
12191
12192
|
}
|
|
12192
|
-
}, [v, s, a, i, w, C]);
|
|
12193
|
+
}, [v, s, a, i, w, C, m]);
|
|
12193
12194
|
const U = Vt(
|
|
12194
12195
|
() => ({
|
|
12195
12196
|
// TODO(data.query-deprecation): Remove when data.query is deprecated — host-native ecommerce route replaced by extension + data.fetch
|
|
@@ -12209,7 +12210,7 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12209
12210
|
method: S.method ?? "GET",
|
|
12210
12211
|
headers: S.headers ?? {},
|
|
12211
12212
|
body: S.body ?? null
|
|
12212
|
-
}, P = Ft(n, "/proxy"),
|
|
12213
|
+
}, P = Ft(n, "/proxy"), D = await fetch(P, {
|
|
12213
12214
|
method: "POST",
|
|
12214
12215
|
headers: {
|
|
12215
12216
|
"Content-Type": "application/json",
|
|
@@ -12218,10 +12219,10 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12218
12219
|
Authorization: `Bearer ${_.token}`
|
|
12219
12220
|
},
|
|
12220
12221
|
body: JSON.stringify($)
|
|
12221
|
-
}), B = await
|
|
12222
|
+
}), B = await D.json();
|
|
12222
12223
|
return {
|
|
12223
|
-
status: B.status ??
|
|
12224
|
-
ok: B.ok ??
|
|
12224
|
+
status: B.status ?? D.status,
|
|
12225
|
+
ok: B.ok ?? D.ok,
|
|
12225
12226
|
data: B.data
|
|
12226
12227
|
};
|
|
12227
12228
|
},
|
|
@@ -12234,10 +12235,10 @@ const Dt = (e) => e == null ? void 0 : e === !0 || e === "true", Lc = {
|
|
|
12234
12235
|
...S.closeButton != null && { closeButton: S.closeButton }
|
|
12235
12236
|
};
|
|
12236
12237
|
if (S.fetch) {
|
|
12237
|
-
const $ = (
|
|
12238
|
+
const $ = (D) => new Promise((B) => setTimeout(B, D)), P = Promise.all([
|
|
12238
12239
|
U["data.fetch"](k, S.fetch),
|
|
12239
12240
|
$(Ob)
|
|
12240
|
-
]).then(([
|
|
12241
|
+
]).then(([D]) => D);
|
|
12241
12242
|
wt.promise(P, {
|
|
12242
12243
|
loading: S.loading ?? S.message,
|
|
12243
12244
|
success: S.success ?? S.message,
|
|
@@ -12582,9 +12583,9 @@ const Hb = ({ ...e }) => {
|
|
|
12582
12583
|
ce(() => {
|
|
12583
12584
|
var K, A;
|
|
12584
12585
|
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];
|
|
12585
|
-
if (F && fetch(`https://ekr.zdassets.com/compose/${F}`).then((
|
|
12586
|
+
if (F && fetch(`https://ekr.zdassets.com/compose/${F}`).then((z) => z.text()).then((z) => {
|
|
12586
12587
|
var k;
|
|
12587
|
-
const U = (k =
|
|
12588
|
+
const U = (k = z.match(/appId['"]?\s*:\s*['"]([a-f0-9]+)['"]/)) == null ? void 0 : k[1];
|
|
12588
12589
|
U && po({ appId: U });
|
|
12589
12590
|
}).catch(() => {
|
|
12590
12591
|
}), C()) {
|
|
@@ -12594,7 +12595,7 @@ const Hb = ({ ...e }) => {
|
|
|
12594
12595
|
const H = setInterval(() => {
|
|
12595
12596
|
C() && (w("ready"), clearInterval(H));
|
|
12596
12597
|
}, 100), O = setTimeout(() => {
|
|
12597
|
-
clearInterval(H), w((
|
|
12598
|
+
clearInterval(H), w((z) => z === "ready" ? z : (console.warn("Zendesk widget failed to load after 10 seconds"), "error"));
|
|
12598
12599
|
}, 1e4);
|
|
12599
12600
|
return () => {
|
|
12600
12601
|
clearInterval(H), clearTimeout(O);
|
|
@@ -12630,12 +12631,12 @@ const Hb = ({ ...e }) => {
|
|
|
12630
12631
|
if (y !== "ready" || !window.zE)
|
|
12631
12632
|
return;
|
|
12632
12633
|
const M = window.zE("messenger:on", "conversationStarted", (O) => {
|
|
12633
|
-
var A,
|
|
12634
|
-
const K = (
|
|
12634
|
+
var A, z;
|
|
12635
|
+
const K = (z = (A = O == null ? void 0 : O.payload) == null ? void 0 : A.conversation) == null ? void 0 : z.id;
|
|
12635
12636
|
K && po({ conversationId: K });
|
|
12636
12637
|
}), F = window.zE("messenger:on", "messagesShown", (O) => {
|
|
12637
|
-
var A,
|
|
12638
|
-
const K = (
|
|
12638
|
+
var A, z;
|
|
12639
|
+
const K = (z = (A = O == null ? void 0 : O.payload) == null ? void 0 : A.conversation) == null ? void 0 : z.id;
|
|
12639
12640
|
K && po({ conversationId: K });
|
|
12640
12641
|
}), H = window.zE("messenger:on", "postbackButtonClicked", (O) => {
|
|
12641
12642
|
var A;
|
|
@@ -12662,11 +12663,11 @@ const Hb = ({ ...e }) => {
|
|
|
12662
12663
|
const O = x.current.getBoundingClientRect();
|
|
12663
12664
|
if ((l ? O.width : O.height) === 0)
|
|
12664
12665
|
return;
|
|
12665
|
-
const A = l ? (H.clientX - O.left) / O.width * 100 : (H.clientY - O.top) / O.height * 100,
|
|
12666
|
+
const A = l ? (H.clientX - O.left) / O.width * 100 : (H.clientY - O.top) / O.height * 100, z = Math.max(
|
|
12666
12667
|
mo,
|
|
12667
12668
|
Math.min(ho, A)
|
|
12668
12669
|
);
|
|
12669
|
-
v(
|
|
12670
|
+
v(z);
|
|
12670
12671
|
}, F = () => {
|
|
12671
12672
|
u(!1), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
12672
12673
|
};
|