@primestyleai/tryon 5.10.12 → 5.10.14
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/index.js +648 -639
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +11 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { P as an, L as _P, b as Qg, a as AP, c as Hg, A as zg, S as cg, i as pg } from "../index-DcgOUANg.js";
|
|
3
3
|
import { jsxs as P, jsx as A, Fragment as tA } from "react/jsx-runtime";
|
|
4
|
-
import { useState as j, useRef as iA, useCallback as
|
|
4
|
+
import { useState as j, useRef as iA, useCallback as UA, useEffect as JA, useMemo as wf } from "react";
|
|
5
5
|
import { createPortal as lP } from "react-dom";
|
|
6
6
|
const sP = 11, TP = 12, An = 13, fn = 14, Pn = 15, nn = 16, GP = 23, YP = 24, gn = 25, Bn = 26, en = 27, on = 28, wn = 0;
|
|
7
7
|
let HP = null, BP = null;
|
|
@@ -31,10 +31,10 @@ async function rP(f) {
|
|
|
31
31
|
const n = await Fn(f), g = HP.detect(n);
|
|
32
32
|
if (!g?.landmarks?.length || g.landmarks[0].length < 25)
|
|
33
33
|
return null;
|
|
34
|
-
const e = g.landmarks[0], B = e[sP], C = e[TP], D = e[GP], i = e[YP], o = (B.y + C.y) / 2, r = (D.y + i.y) / 2,
|
|
34
|
+
const e = g.landmarks[0], B = e[sP], C = e[TP], D = e[GP], i = e[YP], o = (B.y + C.y) / 2, r = (D.y + i.y) / 2, z = r - o, p = o + z * 0.28, T = Math.abs(C.x - B.x), F = Math.min(B.x, C.x) - T * 0.05, h = Math.max(B.x, C.x) + T * 0.05, W = Math.abs(i.x - D.x), t = Math.min(D.x, i.x) - W * 0.15, k = Math.max(D.x, i.x) + W * 0.15, u = p + (r - p) * 0.55, v = T * 0.85, I = (B.x + C.x + D.x + i.x) / 4, O = I - v / 2, N = I + v / 2;
|
|
35
35
|
return {
|
|
36
36
|
chest: { y: p, x1: F, x2: h },
|
|
37
|
-
waist: { y: u, x1: O, x2:
|
|
37
|
+
waist: { y: u, x1: O, x2: N },
|
|
38
38
|
hips: { y: r, x1: t, x2: k }
|
|
39
39
|
};
|
|
40
40
|
} catch (n) {
|
|
@@ -134,7 +134,7 @@ function Ug(f) {
|
|
|
134
134
|
}
|
|
135
135
|
function Dn(f, n, g) {
|
|
136
136
|
if (f.length < 4) return 0;
|
|
137
|
-
const e = (
|
|
137
|
+
const e = (z) => ({ x: z.x * n, y: z.y * g }), [B, C, D, i] = f.map(e), o = Math.hypot(B.x - D.x, B.y - D.y), r = Math.hypot(C.x - i.x, C.y - i.y);
|
|
138
138
|
return (o + r) / 2;
|
|
139
139
|
}
|
|
140
140
|
function Eg(f) {
|
|
@@ -166,7 +166,7 @@ function ag(f, n, g) {
|
|
|
166
166
|
const i = C > 0 ? vn / C : 0, o = (K, E) => Math.hypot(
|
|
167
167
|
(K.x - E.x) * n,
|
|
168
168
|
(K.y - E.y) * g
|
|
169
|
-
) * i, r = o(f.leftIrisCenter, f.rightIrisCenter), p = o(f.leftInnerEye, f.rightInnerEye) / 1.6, T = o(f.leftTragus, f.rightTragus), F = o(f.leftTragus, f.leftOuterEye), h = o(f.rightTragus, f.rightOuterEye), W = (F + h) / 2, t = T * 1.07, u = Math.abs((f.forehead.z ?? 0) - (f.chin.z ?? 0)) * n * i, v = Math.max(170, Math.min(210, u || 190)), I = t / 2, O = v / 2,
|
|
169
|
+
) * i, r = o(f.leftIrisCenter, f.rightIrisCenter), p = o(f.leftInnerEye, f.rightInnerEye) / 1.6, T = o(f.leftTragus, f.rightTragus), F = o(f.leftTragus, f.leftOuterEye), h = o(f.rightTragus, f.rightOuterEye), W = (F + h) / 2, t = T * 1.07, u = Math.abs((f.forehead.z ?? 0) - (f.chin.z ?? 0)) * n * i, v = Math.max(170, Math.min(210, u || 190)), I = t / 2, O = v / 2, N = Math.PI * Math.sqrt(2 * (I * I + O * O));
|
|
170
170
|
return {
|
|
171
171
|
measurements: {
|
|
172
172
|
irisDiameter: vn,
|
|
@@ -178,7 +178,7 @@ function ag(f, n, g) {
|
|
|
178
178
|
templeLength: Rf(W),
|
|
179
179
|
headWidth: Rf(t),
|
|
180
180
|
headDepth: Rf(v),
|
|
181
|
-
headCircumference: Rf(
|
|
181
|
+
headCircumference: Rf(N)
|
|
182
182
|
},
|
|
183
183
|
irisConfidence: D
|
|
184
184
|
};
|
|
@@ -259,7 +259,7 @@ function Cn(f, n) {
|
|
|
259
259
|
for (const D of Object.values(f.sections)) C(D.matchDetails);
|
|
260
260
|
if (B.length && (g.userMeasurementsText = B.join(", ")), n?.headers?.length && n.rows?.length) {
|
|
261
261
|
const D = n.headers, i = n.rows.slice(0, 20).map(
|
|
262
|
-
(o) => D.map((r,
|
|
262
|
+
(o) => D.map((r, z) => `${r} ${o[z] ?? "—"}`).join(", ")
|
|
263
263
|
);
|
|
264
264
|
g.sizeChartSummary = i.join(" | ");
|
|
265
265
|
}
|
|
@@ -492,7 +492,7 @@ async function Gn(f) {
|
|
|
492
492
|
return n("recommend returned no recommendedSize — bailing"), null;
|
|
493
493
|
const r = o.sections ? Object.fromEntries(
|
|
494
494
|
Object.entries(o.sections).map(([p, T]) => [p, T.recommendedSize])
|
|
495
|
-
) : void 0,
|
|
495
|
+
) : void 0, z = o.sections ? Object.fromEntries(
|
|
496
496
|
Object.entries(o.sections).map(([p, T]) => [
|
|
497
497
|
p,
|
|
498
498
|
{
|
|
@@ -512,7 +512,7 @@ async function Gn(f) {
|
|
|
512
512
|
recommendedSize: o.recommendedSize,
|
|
513
513
|
confidence: o.confidence,
|
|
514
514
|
sections: r,
|
|
515
|
-
sectionsFull:
|
|
515
|
+
sectionsFull: z,
|
|
516
516
|
recommendedLength: o.recommendedLength || void 0,
|
|
517
517
|
savedAt: Date.now()
|
|
518
518
|
}), {
|
|
@@ -6786,19 +6786,19 @@ function $g({ view: f, stepIndex: n }) {
|
|
|
6786
6786
|
return f === "error" || f === "idle" ? null : /* @__PURE__ */ A("div", { className: "ps-tryon-dots", children: Array.from({ length: sg }, (g, e) => e + 1).map((g) => /* @__PURE__ */ A("div", { className: `ps-tryon-dot${g < n ? " ps-done" : g === n ? " ps-active" : ""}` }, g)) });
|
|
6787
6787
|
}
|
|
6788
6788
|
function _g({ activeLocale: f, onSelect: n }) {
|
|
6789
|
-
const [g, e] = j(!1), B = iA(null), C = iA(null), [D, i] = j({ top: 0, right: 0 }), o = _P[f] || "English", r =
|
|
6789
|
+
const [g, e] = j(!1), B = iA(null), C = iA(null), [D, i] = j({ top: 0, right: 0 }), o = _P[f] || "English", r = UA(() => {
|
|
6790
6790
|
if (!B.current) return;
|
|
6791
|
-
const
|
|
6792
|
-
i({ top:
|
|
6791
|
+
const z = B.current.getBoundingClientRect();
|
|
6792
|
+
i({ top: z.bottom + 4, right: window.innerWidth - z.right });
|
|
6793
6793
|
}, []);
|
|
6794
6794
|
return JA(() => {
|
|
6795
6795
|
if (!g) return;
|
|
6796
6796
|
r();
|
|
6797
|
-
const
|
|
6797
|
+
const z = (p) => {
|
|
6798
6798
|
B.current?.contains(p.target) || C.current?.contains(p.target) || e(!1);
|
|
6799
6799
|
};
|
|
6800
|
-
return document.addEventListener("mousedown",
|
|
6801
|
-
document.removeEventListener("mousedown",
|
|
6800
|
+
return document.addEventListener("mousedown", z), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), () => {
|
|
6801
|
+
document.removeEventListener("mousedown", z), window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0);
|
|
6802
6802
|
};
|
|
6803
6803
|
}, [g, r]), /* @__PURE__ */ P(tA, { children: [
|
|
6804
6804
|
/* @__PURE__ */ P(
|
|
@@ -6829,20 +6829,20 @@ function _g({ activeLocale: f, onSelect: n }) {
|
|
|
6829
6829
|
// dropdown is portaled later than the overlay so it stacks on top.
|
|
6830
6830
|
zIndex: 2147483647
|
|
6831
6831
|
},
|
|
6832
|
-
children: /* @__PURE__ */ A("div", { className: "ps-tryon-lang-list", children: Qg.map((
|
|
6832
|
+
children: /* @__PURE__ */ A("div", { className: "ps-tryon-lang-list", children: Qg.map((z) => /* @__PURE__ */ P(
|
|
6833
6833
|
"button",
|
|
6834
6834
|
{
|
|
6835
|
-
className: `ps-tryon-lang-item${
|
|
6835
|
+
className: `ps-tryon-lang-item${z === f ? " ps-selected" : ""}`,
|
|
6836
6836
|
onClick: () => {
|
|
6837
|
-
n(
|
|
6837
|
+
n(z), e(!1);
|
|
6838
6838
|
},
|
|
6839
6839
|
children: [
|
|
6840
|
-
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-name", children: _P[
|
|
6841
|
-
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-code", children:
|
|
6842
|
-
|
|
6840
|
+
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-name", children: _P[z] || z }),
|
|
6841
|
+
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-code", children: z.toUpperCase() }),
|
|
6842
|
+
z === f && /* @__PURE__ */ A("span", { className: "ps-tryon-lang-check", children: /* @__PURE__ */ A(Ng, { size: 12 }) })
|
|
6843
6843
|
]
|
|
6844
6844
|
},
|
|
6845
|
-
|
|
6845
|
+
z
|
|
6846
6846
|
)) })
|
|
6847
6847
|
}
|
|
6848
6848
|
),
|
|
@@ -6865,7 +6865,7 @@ function un({
|
|
|
6865
6865
|
onCancel: g,
|
|
6866
6866
|
t: e
|
|
6867
6867
|
}) {
|
|
6868
|
-
const [B, C] = j(f?.name || ""), [D, i] = j(f?.gender || "male"), [o, r] = j(f?.sizingUnit || "cm"), [
|
|
6868
|
+
const [B, C] = j(f?.name || ""), [D, i] = j(f?.gender || "male"), [o, r] = j(f?.sizingUnit || "cm"), [z, p] = j(() => {
|
|
6869
6869
|
if (!f) return {};
|
|
6870
6870
|
const t = {};
|
|
6871
6871
|
for (const k of ["heightCm", "weightKg", "age"]) {
|
|
@@ -6877,7 +6877,7 @@ function un({
|
|
|
6877
6877
|
const t = [];
|
|
6878
6878
|
B.trim() || t.push(e("Profile Name"));
|
|
6879
6879
|
for (const u of T)
|
|
6880
|
-
parseFloat(
|
|
6880
|
+
parseFloat(z[u.key] || "") > 0 || t.push(e(u.label));
|
|
6881
6881
|
if (t.length > 0) {
|
|
6882
6882
|
h(e("Please fill in all fields"));
|
|
6883
6883
|
return;
|
|
@@ -6885,7 +6885,7 @@ function un({
|
|
|
6885
6885
|
h("");
|
|
6886
6886
|
const k = { name: B.trim(), gender: D, sizingUnit: o };
|
|
6887
6887
|
for (const u of T)
|
|
6888
|
-
k[u.key] = parseFloat(
|
|
6888
|
+
k[u.key] = parseFloat(z[u.key]);
|
|
6889
6889
|
n(k);
|
|
6890
6890
|
};
|
|
6891
6891
|
return /* @__PURE__ */ P("div", { className: "ps-tryon-profile-edit", children: [
|
|
@@ -6959,7 +6959,7 @@ function un({
|
|
|
6959
6959
|
type: "number",
|
|
6960
6960
|
className: "ps-tryon-sf-input",
|
|
6961
6961
|
placeholder: " ",
|
|
6962
|
-
value:
|
|
6962
|
+
value: z[t.key] || "",
|
|
6963
6963
|
onChange: (k) => {
|
|
6964
6964
|
p((u) => ({ ...u, [t.key]: k.target.value })), h("");
|
|
6965
6965
|
}
|
|
@@ -6984,7 +6984,7 @@ function PB({
|
|
|
6984
6984
|
restoreHistory: i,
|
|
6985
6985
|
t: o
|
|
6986
6986
|
}) {
|
|
6987
|
-
const [r,
|
|
6987
|
+
const [r, z] = j(!1);
|
|
6988
6988
|
if (!f) return null;
|
|
6989
6989
|
const p = (F) => !!(F.sizeGuide?.sections && Object.keys(F.sizeGuide.sections).length > 1), T = (F) => {
|
|
6990
6990
|
const h = {
|
|
@@ -6992,18 +6992,18 @@ function PB({
|
|
|
6992
6992
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
6993
6993
|
createdAt: Date.now()
|
|
6994
6994
|
};
|
|
6995
|
-
e((W) => [h, ...W]),
|
|
6995
|
+
e((W) => [h, ...W]), z(!1);
|
|
6996
6996
|
};
|
|
6997
6997
|
return /* @__PURE__ */ P("div", { className: `ps-tryon-drawer${f ? " ps-tryon-drawer-open" : ""}`, children: [
|
|
6998
6998
|
/* @__PURE__ */ P("div", { className: "ps-tryon-drawer-header", children: [
|
|
6999
6999
|
/* @__PURE__ */ A("button", { className: "ps-tryon-drawer-back", onClick: () => {
|
|
7000
|
-
|
|
7000
|
+
z(!1), n(null);
|
|
7001
7001
|
}, children: /* @__PURE__ */ A(kg, {}) }),
|
|
7002
7002
|
/* @__PURE__ */ A("span", { className: "ps-tryon-drawer-title", children: o(r ? "New Profile" : f === "profiles" ? "My Profiles" : "History") }),
|
|
7003
|
-
f === "profiles" && !r && /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-add-btn", onClick: () =>
|
|
7003
|
+
f === "profiles" && !r && /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-add-btn", onClick: () => z(!0), children: "+" })
|
|
7004
7004
|
] }),
|
|
7005
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: f === "profiles" && r ? /* @__PURE__ */ A(un, { onSave: T, onCancel: () =>
|
|
7006
|
-
/* @__PURE__ */ P("button", { className: "ps-tryon-drawer-create", onClick: () =>
|
|
7005
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: f === "profiles" && r ? /* @__PURE__ */ A(un, { onSave: T, onCancel: () => z(!1), t: o }) : f === "profiles" ? /* @__PURE__ */ P(tA, { children: [
|
|
7006
|
+
/* @__PURE__ */ P("button", { className: "ps-tryon-drawer-create", onClick: () => z(!0), children: [
|
|
7007
7007
|
"+ ",
|
|
7008
7008
|
o("Create New Profile")
|
|
7009
7009
|
] }),
|
|
@@ -7068,16 +7068,16 @@ function nB({
|
|
|
7068
7068
|
}, [f]), !f || typeof document > "u") return null;
|
|
7069
7069
|
const D = (o) => {
|
|
7070
7070
|
g((r) => r.map(
|
|
7071
|
-
(
|
|
7072
|
-
...
|
|
7071
|
+
(z) => z.id === f.id ? {
|
|
7072
|
+
...z,
|
|
7073
7073
|
...o,
|
|
7074
7074
|
// Keep id + createdAt + sizeHistory + measurements; bump lastEditedAt
|
|
7075
|
-
id:
|
|
7076
|
-
createdAt:
|
|
7077
|
-
sizeHistory:
|
|
7078
|
-
measurements:
|
|
7075
|
+
id: z.id,
|
|
7076
|
+
createdAt: z.createdAt,
|
|
7077
|
+
sizeHistory: z.sizeHistory,
|
|
7078
|
+
measurements: z.measurements,
|
|
7079
7079
|
lastEditedAt: Date.now()
|
|
7080
|
-
} :
|
|
7080
|
+
} : z
|
|
7081
7081
|
)), n(null);
|
|
7082
7082
|
}, i = () => n(null);
|
|
7083
7083
|
return lP(
|
|
@@ -7121,7 +7121,7 @@ function gB({
|
|
|
7121
7121
|
return `${T}'${F}"`;
|
|
7122
7122
|
}
|
|
7123
7123
|
return `${Math.round(p)} cm`;
|
|
7124
|
-
}, o = (p) => p ? `${Math.round(p)} ${C}` : "—", r = f.height ?? f.heightCm,
|
|
7124
|
+
}, o = (p) => p ? `${Math.round(p)} ${C}` : "—", r = f.height ?? f.heightCm, z = f.weight ?? f.weightKg;
|
|
7125
7125
|
return /* @__PURE__ */ A("div", { className: "ps-confirm-overlay", onClick: g, children: /* @__PURE__ */ P("div", { className: "ps-confirm-modal", onClick: (p) => p.stopPropagation(), children: [
|
|
7126
7126
|
/* @__PURE__ */ A(
|
|
7127
7127
|
"button",
|
|
@@ -7167,7 +7167,7 @@ function gB({
|
|
|
7167
7167
|
] }),
|
|
7168
7168
|
/* @__PURE__ */ P("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
|
|
7169
7169
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: e("Weight") }),
|
|
7170
|
-
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: o(
|
|
7170
|
+
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: o(z) })
|
|
7171
7171
|
] }),
|
|
7172
7172
|
f.age ? /* @__PURE__ */ P("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
|
|
7173
7173
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: e("Age") }),
|
|
@@ -7225,7 +7225,7 @@ function eB({
|
|
|
7225
7225
|
sizingUnit: i,
|
|
7226
7226
|
setSizingUnit: o,
|
|
7227
7227
|
formKey: r,
|
|
7228
|
-
setFormKey:
|
|
7228
|
+
setFormKey: z,
|
|
7229
7229
|
updateField: p,
|
|
7230
7230
|
setSizingMethod: T,
|
|
7231
7231
|
setSizingLoading: F,
|
|
@@ -7248,16 +7248,16 @@ function eB({
|
|
|
7248
7248
|
/* @__PURE__ */ A("h3", { className: "ps-bp-title", style: { fontSize: "1.1vw" }, children: t("Here's what we estimated") }),
|
|
7249
7249
|
/* @__PURE__ */ A("p", { className: "ps-bp-subtitle", children: t("Tap any value to adjust if needed") }),
|
|
7250
7250
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sf-fields", style: { flex: 1, overflowY: "auto" }, children: v.map((O) => {
|
|
7251
|
-
const
|
|
7251
|
+
const N = g[O.key], K = C.current[O.key] ? parseFloat(C.current[O.key]) : null, E = N || K;
|
|
7252
7252
|
if (!E) return null;
|
|
7253
|
-
const
|
|
7253
|
+
const BA = !N && !!K;
|
|
7254
7254
|
return C.current[O.key] || (C.current[O.key] = String(E)), /* @__PURE__ */ A("div", { className: "ps-tryon-sf-float-row", children: /* @__PURE__ */ P("div", { className: "ps-tryon-sf-float-field", children: [
|
|
7255
7255
|
/* @__PURE__ */ P("label", { className: "ps-tryon-sf-float-label", children: [
|
|
7256
7256
|
t(O.label),
|
|
7257
7257
|
" (",
|
|
7258
7258
|
k,
|
|
7259
7259
|
") ",
|
|
7260
|
-
|
|
7260
|
+
BA ? /* @__PURE__ */ A("span", { className: "ps-tryon-sf-entered-badge", children: t("ENTERED") }) : /* @__PURE__ */ A("span", { className: "ps-tryon-sf-estimated-badge", children: t("ESTIMATED") })
|
|
7261
7261
|
] }),
|
|
7262
7262
|
/* @__PURE__ */ A(
|
|
7263
7263
|
"input",
|
|
@@ -7407,8 +7407,8 @@ function iB({ t: f }) {
|
|
|
7407
7407
|
const D = setInterval(() => {
|
|
7408
7408
|
const i = (Date.now() - n.current) / 1e3, o = Math.min(95, i / wP * 100), r = Math.round(o);
|
|
7409
7409
|
if (e.current && (e.current.style.width = `${r}%`), C.current && (C.current.textContent = `${r}%`), g.current && (g.current.style.strokeDashoffset = String(IP * (1 - o / 100))), B.current) {
|
|
7410
|
-
const
|
|
7411
|
-
B.current.textContent = i >= wP ? "•••" : `~${
|
|
7410
|
+
const z = Math.max(0, wP - Math.floor(i));
|
|
7411
|
+
B.current.textContent = i >= wP ? "•••" : `~${z}s`;
|
|
7412
7412
|
}
|
|
7413
7413
|
}, 200);
|
|
7414
7414
|
return () => clearInterval(D);
|
|
@@ -7460,7 +7460,7 @@ function rn({
|
|
|
7460
7460
|
{ title: D("ESTIMATING BODY"), desc: D("Computing chest, waist, hips, sleeve and inseam from your basics."), viewfinderText: D("ESTIMATING BODY") },
|
|
7461
7461
|
{ title: D("MATCHING SIZE"), desc: D("Comparing your measurements to the garment's size guide."), viewfinderText: D("MATCHING SIZE") },
|
|
7462
7462
|
{ title: D("FINALIZING RESULT"), desc: D("Almost done — preparing your recommendation."), viewfinderText: D("FINALIZING") }
|
|
7463
|
-
], [
|
|
7463
|
+
], [z, p] = j({ w: 800, h: 1200 }), T = (t) => {
|
|
7464
7464
|
const k = t.currentTarget;
|
|
7465
7465
|
p({ w: k.naturalWidth || k.offsetWidth, h: k.naturalHeight || k.offsetHeight });
|
|
7466
7466
|
}, [F, h] = j(0);
|
|
@@ -7484,7 +7484,7 @@ function rn({
|
|
|
7484
7484
|
onLoad: T
|
|
7485
7485
|
}
|
|
7486
7486
|
),
|
|
7487
|
-
o && g && /* @__PURE__ */ A("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ A(CB, { landmarks: g, w:
|
|
7487
|
+
o && g && /* @__PURE__ */ A("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ A(CB, { landmarks: g, w: z.w, h: z.h }) })
|
|
7488
7488
|
] }),
|
|
7489
7489
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage", children: /* @__PURE__ */ P("div", { className: "ps-msc-stage-slot", children: [
|
|
7490
7490
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children: W.title }),
|
|
@@ -7532,7 +7532,7 @@ function HB({
|
|
|
7532
7532
|
tryOnProcessing: i,
|
|
7533
7533
|
resultImageUrl: o,
|
|
7534
7534
|
tryOnDone: r,
|
|
7535
|
-
onTryAgain:
|
|
7535
|
+
onTryAgain: z,
|
|
7536
7536
|
onClose: p,
|
|
7537
7537
|
overlayNode: T,
|
|
7538
7538
|
showLines: F,
|
|
@@ -7540,7 +7540,7 @@ function HB({
|
|
|
7540
7540
|
onImageLoad: W,
|
|
7541
7541
|
t
|
|
7542
7542
|
}) {
|
|
7543
|
-
const k =
|
|
7543
|
+
const k = wf(() => {
|
|
7544
7544
|
const I = [...g?.matchDetails || []];
|
|
7545
7545
|
if (g?.sections)
|
|
7546
7546
|
for (const O of Object.values(g.sections))
|
|
@@ -7548,8 +7548,8 @@ function HB({
|
|
|
7548
7548
|
if (I.length > 0) {
|
|
7549
7549
|
const O = I.filter(
|
|
7550
7550
|
(K) => K.fit === "good" || K.fit === "a-bit-tight" || K.fit === "a-bit-loose"
|
|
7551
|
-
).length,
|
|
7552
|
-
return Math.max(70,
|
|
7551
|
+
).length, N = Math.round(O / I.length * 100);
|
|
7552
|
+
return Math.max(70, N);
|
|
7553
7553
|
}
|
|
7554
7554
|
return g?.confidence === "high" ? 96 : g?.confidence === "medium" ? 84 : 72;
|
|
7555
7555
|
}, [g]), u = o || f, v = !!o;
|
|
@@ -7612,7 +7612,7 @@ function HB({
|
|
|
7612
7612
|
/* @__PURE__ */ A("span", { className: "ps-msr-match-label", children: t("FIT MATCH") })
|
|
7613
7613
|
] }) }),
|
|
7614
7614
|
/* @__PURE__ */ A("div", { className: "ps-msr-sections", children: B.map(({ name: I, secResult: O }) => {
|
|
7615
|
-
const
|
|
7615
|
+
const N = I.replace(/\s*[—–-]\s*.*/g, ""), K = O, E = K.found === !1 ? t("No fit") : K.size || O.recommendedSize;
|
|
7616
7616
|
return /* @__PURE__ */ P(
|
|
7617
7617
|
"button",
|
|
7618
7618
|
{
|
|
@@ -7620,7 +7620,7 @@ function HB({
|
|
|
7620
7620
|
className: "ps-msr-section-card",
|
|
7621
7621
|
onClick: () => C(I),
|
|
7622
7622
|
children: [
|
|
7623
|
-
/* @__PURE__ */ A("span", { className: "ps-msr-section-name", children:
|
|
7623
|
+
/* @__PURE__ */ A("span", { className: "ps-msr-section-name", children: N.toUpperCase() }),
|
|
7624
7624
|
/* @__PURE__ */ A("span", { className: "ps-msr-section-size", children: E })
|
|
7625
7625
|
]
|
|
7626
7626
|
},
|
|
@@ -7634,7 +7634,7 @@ function HB({
|
|
|
7634
7634
|
{
|
|
7635
7635
|
type: "button",
|
|
7636
7636
|
className: "ps-msr-tryon-cta ps-secondary",
|
|
7637
|
-
onClick:
|
|
7637
|
+
onClick: z,
|
|
7638
7638
|
children: t("Try Again")
|
|
7639
7639
|
}
|
|
7640
7640
|
),
|
|
@@ -7692,8 +7692,8 @@ function kn({ t: f, isActive: n }) {
|
|
|
7692
7692
|
}
|
|
7693
7693
|
g.current = Date.now();
|
|
7694
7694
|
const i = setInterval(() => {
|
|
7695
|
-
const o = g.current || Date.now(), r = (Date.now() - o) / 1e3,
|
|
7696
|
-
if (B.current && (B.current.style.width = `${p}%`), D.current && (D.current.textContent = `${p}%`), e.current && (e.current.style.strokeDashoffset = String(RP * (1 -
|
|
7695
|
+
const o = g.current || Date.now(), r = (Date.now() - o) / 1e3, z = Math.min(95, r / vP * 100), p = Math.round(z);
|
|
7696
|
+
if (B.current && (B.current.style.width = `${p}%`), D.current && (D.current.textContent = `${p}%`), e.current && (e.current.style.strokeDashoffset = String(RP * (1 - z / 100))), C.current) {
|
|
7697
7697
|
const T = Math.max(0, vP - Math.floor(r));
|
|
7698
7698
|
C.current.textContent = r >= vP ? "•••" : `~${T}s`;
|
|
7699
7699
|
}
|
|
@@ -7772,13 +7772,13 @@ function cB({
|
|
|
7772
7772
|
`fl-${r}`
|
|
7773
7773
|
)),
|
|
7774
7774
|
[f.leftIrisCenter, f.rightIrisCenter].map((i, o) => {
|
|
7775
|
-
const r = o === 0 ? f.leftIrisRing : f.rightIrisRing,
|
|
7775
|
+
const r = o === 0 ? f.leftIrisRing : f.rightIrisRing, z = r?.length ? Math.abs((r[0]?.x ?? i.x) - (r[2]?.x ?? i.x)) * e / 2 : 6;
|
|
7776
7776
|
return /* @__PURE__ */ A(
|
|
7777
7777
|
"circle",
|
|
7778
7778
|
{
|
|
7779
7779
|
cx: i.x * e,
|
|
7780
7780
|
cy: i.y * B,
|
|
7781
|
-
r: Math.max(6,
|
|
7781
|
+
r: Math.max(6, z),
|
|
7782
7782
|
fill: "none",
|
|
7783
7783
|
stroke: "rgba(255,230,120,0.95)",
|
|
7784
7784
|
strokeWidth: "2.5",
|
|
@@ -7845,13 +7845,13 @@ function pB({
|
|
|
7845
7845
|
{ title: B("REFINING DETAILS"), desc: B("Fine-tuning fit, drape and shadows.") },
|
|
7846
7846
|
{ title: B("ALMOST THERE"), desc: B("Final compositing in progress.") },
|
|
7847
7847
|
{ title: B("FINISHING TOUCHES"), desc: B("Polishing the result.") }
|
|
7848
|
-
], i = g ? D : C, o = g ? !!e : n, [r,
|
|
7848
|
+
], i = g ? D : C, o = g ? !!e : n, [r, z] = j(0);
|
|
7849
7849
|
JA(() => {
|
|
7850
|
-
|
|
7850
|
+
z(0);
|
|
7851
7851
|
}, [g]), JA(() => {
|
|
7852
7852
|
if (o) return;
|
|
7853
7853
|
const F = setInterval(() => {
|
|
7854
|
-
|
|
7854
|
+
z((h) => Math.min(h + 1, i.length - 1));
|
|
7855
7855
|
}, g ? 2200 : 900);
|
|
7856
7856
|
return () => clearInterval(F);
|
|
7857
7857
|
}, [o, i.length, g]);
|
|
@@ -7917,21 +7917,21 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
|
|
|
7917
7917
|
{ key: "chest", line: f.chest, label: "Chest" },
|
|
7918
7918
|
{ key: "waist", line: f.waist, label: "Waist" },
|
|
7919
7919
|
{ key: "hips", line: f.hips, label: "Hips" }
|
|
7920
|
-
], i = e, o = B, r = Math.max(i, o) / 500,
|
|
7920
|
+
], i = e, o = B, r = Math.max(i, o) / 500, z = Math.max(5, 3 * r), p = Math.max(7, 5 * r);
|
|
7921
7921
|
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${i} ${o}`, preserveAspectRatio: "xMidYMid meet", children: D.map(({ key: T, line: F, label: h }, W) => {
|
|
7922
7922
|
if (!F || typeof F.x1 != "number" || typeof F.x2 != "number" || typeof F.y != "number") return null;
|
|
7923
|
-
const t = F.x1 * i, k = F.x2 * i, u = F.y * o, v = k - t, I = v * 0.06, O = (t + k) / 2,
|
|
7923
|
+
const t = F.x1 * i, k = F.x2 * i, u = F.y * o, v = k - t, I = v * 0.06, O = (t + k) / 2, N = n.find((mA) => {
|
|
7924
7924
|
const dA = mA.area.toLowerCase().trim();
|
|
7925
7925
|
return !!(dA === T || T === "chest" && (dA.includes("bust") || dA.includes("chest")) || T === "waist" && dA.includes("waist") || T === "hips" && (dA.includes("hip") || dA === "hips"));
|
|
7926
|
-
}), K =
|
|
7926
|
+
}), K = N ? C(N.fit) : "#2154EF", E = W * 0.35, BA = `M ${t} ${u} Q ${O} ${u + I} ${k} ${u}`, c = v * 1.05, hA = N ? N.fit === "good" ? "✓ Fit" : N.isLength ? N.fit.includes("short") || N.fit.includes("tight") ? "Short" : "Long" : N.fit.includes("tight") ? "Tight" : "Loose" : h, l = Math.round(14 * r), y = hA.length * l * 0.62, sA = i - k - 12 * r < y, V = sA ? t - 10 * r : k + 10 * r, s = sA ? "end" : "start", PA = sA ? t : k, RA = sA ? t - 6 * r : k + 6 * r;
|
|
7927
7927
|
return /* @__PURE__ */ P("g", { children: [
|
|
7928
7928
|
/* @__PURE__ */ A(
|
|
7929
7929
|
"path",
|
|
7930
7930
|
{
|
|
7931
|
-
d:
|
|
7931
|
+
d: BA,
|
|
7932
7932
|
fill: "none",
|
|
7933
7933
|
stroke: K,
|
|
7934
|
-
strokeWidth:
|
|
7934
|
+
strokeWidth: z,
|
|
7935
7935
|
strokeLinecap: "round",
|
|
7936
7936
|
strokeDasharray: c,
|
|
7937
7937
|
strokeDashoffset: c,
|
|
@@ -8041,7 +8041,7 @@ function DP({
|
|
|
8041
8041
|
onBack: i,
|
|
8042
8042
|
t: o,
|
|
8043
8043
|
productImage: r,
|
|
8044
|
-
productTitle:
|
|
8044
|
+
productTitle: z,
|
|
8045
8045
|
isMobile: p,
|
|
8046
8046
|
isTryOnImage: T,
|
|
8047
8047
|
showLines: F,
|
|
@@ -8053,120 +8053,129 @@ function DP({
|
|
|
8053
8053
|
backLabel: v,
|
|
8054
8054
|
internationalSizes: I,
|
|
8055
8055
|
continueLabel: O,
|
|
8056
|
-
renderRaw:
|
|
8056
|
+
renderRaw: N = !1,
|
|
8057
8057
|
sectionFound: K
|
|
8058
8058
|
}) {
|
|
8059
|
-
const E = g?.recommendedSize || "", [
|
|
8059
|
+
const E = g?.recommendedSize || "", [BA, c] = j(null), hA = B.toLowerCase(), l = hA.includes("mm") ? "mm" : hA.includes("cm") ? "cm" : "in", y = C || l, XA = (a) => hn(a, y, l), sA = (a) => UB(a, y, l), V = I ? Object.keys(I) : [], [s, PA] = j(null), RA = D?.secResult?.recommendedSize || "", [mA, dA] = j(null), ZA = wf(() => {
|
|
8060
8060
|
if (!D) return [];
|
|
8061
|
-
const a = D.section, X = a.headers.findIndex((
|
|
8061
|
+
const a = D.section, X = a.headers.findIndex((zA) => /size|taglia|größe|taille/i.test(zA.trim())), nA = X >= 0 ? X : 0, H = a.headers[nA] || "Size", oA = a.rows.map((zA) => Uf(zA, nA, H)).filter(Boolean);
|
|
8062
8062
|
return [...new Set(oA)];
|
|
8063
|
-
}, [D]), Hf =
|
|
8063
|
+
}, [D]), Hf = wf(() => {
|
|
8064
8064
|
if (!D) return {};
|
|
8065
8065
|
const a = D.section, X = a.headers.findIndex((oA) => /size|taglia|größe|taille/i.test(oA.trim()));
|
|
8066
8066
|
if (X < 0) return {};
|
|
8067
|
-
let
|
|
8068
|
-
if (
|
|
8069
|
-
const
|
|
8067
|
+
let nA = a.headers.findIndex((oA) => /height|altezza|hauteur|größe|tall/i.test(oA.trim()) && !/size/i.test(oA));
|
|
8068
|
+
if (nA < 0 && (nA = a.headers.findIndex((oA, zA) => zA !== X)), nA < 0) return {};
|
|
8069
|
+
const H = {};
|
|
8070
8070
|
for (const oA of a.rows) {
|
|
8071
|
-
const
|
|
8072
|
-
|
|
8071
|
+
const zA = Uf(oA, X, a.headers[X] || "Size"), YA = Uf(oA, nA, a.headers[nA] || "");
|
|
8072
|
+
zA && YA && (H[String(zA).trim()] = String(YA).trim());
|
|
8073
8073
|
}
|
|
8074
|
-
return
|
|
8075
|
-
}, [D]),
|
|
8074
|
+
return H;
|
|
8075
|
+
}, [D]), m = wf(() => {
|
|
8076
8076
|
const a = n.headers.findIndex((X) => /size|taglia|größe|taille/i.test(X.trim()));
|
|
8077
8077
|
if (a >= 0) return a;
|
|
8078
8078
|
for (let X = 0; X < n.headers.length; X++) {
|
|
8079
|
-
const
|
|
8080
|
-
if (n.rows.some((
|
|
8079
|
+
const nA = n.headers[X];
|
|
8080
|
+
if (n.rows.some((H) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Uf(H, X, nA)))) return X;
|
|
8081
8081
|
}
|
|
8082
8082
|
return 0;
|
|
8083
|
-
}, [n]),
|
|
8084
|
-
const a = n.rows.map((X) => Uf(X,
|
|
8083
|
+
}, [n]), EA = n.headers[m] || "Size", TA = wf(() => {
|
|
8084
|
+
const a = n.rows.map((X) => Uf(X, m, EA)).filter(Boolean);
|
|
8085
8085
|
return [...new Set(a)];
|
|
8086
|
-
}, [n,
|
|
8086
|
+
}, [n, m, EA]), bA = BA || E, VA = bA === E, kA = wf(() => {
|
|
8087
8087
|
if (VA) return null;
|
|
8088
|
-
const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i,
|
|
8089
|
-
return o(
|
|
8090
|
-
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : bA, SA =
|
|
8088
|
+
const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i, nA = a.some((H) => X.test(H.fit || ""));
|
|
8089
|
+
return o(nA ? "Not Recommended" : "Your Selection");
|
|
8090
|
+
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : bA, SA = wf(() => {
|
|
8091
8091
|
const a = [];
|
|
8092
8092
|
for (let X = 0; X < n.headers.length; X++) {
|
|
8093
|
-
const
|
|
8094
|
-
if (/\(cm\)|centimeter/i.test(
|
|
8093
|
+
const nA = (n.headers[X] || "").toLowerCase();
|
|
8094
|
+
if (/\(cm\)|centimeter/i.test(nA)) {
|
|
8095
8095
|
a.push("cm");
|
|
8096
8096
|
continue;
|
|
8097
8097
|
}
|
|
8098
|
-
if (/\(in\)|\(inch|inch/i.test(
|
|
8098
|
+
if (/\(in\)|\(inch|inch/i.test(nA)) {
|
|
8099
8099
|
a.push("in");
|
|
8100
8100
|
continue;
|
|
8101
8101
|
}
|
|
8102
|
-
let
|
|
8102
|
+
let H = null;
|
|
8103
8103
|
for (const oA of n.rows) {
|
|
8104
|
-
const
|
|
8105
|
-
if (
|
|
8106
|
-
if (/cm\b|centimeter/i.test(
|
|
8107
|
-
|
|
8104
|
+
const zA = String(Uf(oA, X, n.headers[X]) || "").trim();
|
|
8105
|
+
if (zA) {
|
|
8106
|
+
if (/cm\b|centimeter/i.test(zA)) {
|
|
8107
|
+
H = "cm";
|
|
8108
8108
|
break;
|
|
8109
8109
|
}
|
|
8110
|
-
if (/in\b|inch|"$/i.test(
|
|
8111
|
-
|
|
8110
|
+
if (/in\b|inch|"$/i.test(zA)) {
|
|
8111
|
+
H = "in";
|
|
8112
8112
|
break;
|
|
8113
8113
|
}
|
|
8114
8114
|
}
|
|
8115
8115
|
}
|
|
8116
|
-
a.push(
|
|
8116
|
+
a.push(H);
|
|
8117
8117
|
}
|
|
8118
8118
|
return a;
|
|
8119
|
-
}, [n]), ff =
|
|
8120
|
-
const
|
|
8119
|
+
}, [n]), ff = UA((a, X) => {
|
|
8120
|
+
const nA = a.toLowerCase().trim(), H = B === "cm" || B === "", oA = H ? "cm" : "in", zA = [];
|
|
8121
8121
|
for (let AA = 0; AA < n.headers.length; AA++) {
|
|
8122
8122
|
const LA = (n.headers[AA] || "").toLowerCase().trim();
|
|
8123
|
-
if (LA ===
|
|
8124
|
-
|
|
8123
|
+
if (LA === nA) {
|
|
8124
|
+
zA.push(AA);
|
|
8125
8125
|
continue;
|
|
8126
8126
|
}
|
|
8127
8127
|
const Pf = LA.replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8128
|
-
(Pf ===
|
|
8128
|
+
(Pf === nA || LA.includes(nA) || nA.includes(Pf)) && zA.push(AA);
|
|
8129
8129
|
}
|
|
8130
|
-
if (
|
|
8131
|
-
let YA =
|
|
8132
|
-
YA == null && (YA =
|
|
8133
|
-
const
|
|
8134
|
-
let
|
|
8135
|
-
if (
|
|
8136
|
-
const LA = Uf(AA,
|
|
8137
|
-
return LA.startsWith(
|
|
8138
|
-
})), !
|
|
8139
|
-
const Bf = Uf(
|
|
8130
|
+
if (zA.length === 0) return null;
|
|
8131
|
+
let YA = zA.find((AA) => SA[AA] === oA);
|
|
8132
|
+
YA == null && (YA = zA[0]);
|
|
8133
|
+
const of = n.headers[YA], J = X.trim().toLowerCase();
|
|
8134
|
+
let gA = n.rows.find((AA) => Uf(AA, m, EA) === X);
|
|
8135
|
+
if (gA || (gA = n.rows.find((AA) => Uf(AA, m, EA).trim().toLowerCase() === J)), gA || (gA = n.rows.find((AA) => {
|
|
8136
|
+
const LA = Uf(AA, m, EA).trim().toLowerCase();
|
|
8137
|
+
return LA.startsWith(J) || J.startsWith(LA);
|
|
8138
|
+
})), !gA) return null;
|
|
8139
|
+
const Bf = Uf(gA, YA, of);
|
|
8140
8140
|
if (!Bf) return null;
|
|
8141
8141
|
const FA = QP(Bf), OA = SA[YA];
|
|
8142
|
-
if (OA === "in" &&
|
|
8142
|
+
if (OA === "in" && H) {
|
|
8143
8143
|
const AA = (LA) => +(LA * 2.54).toFixed(1);
|
|
8144
8144
|
return { range: String(AA(FA.min)) + (FA.min !== FA.max ? "–" + String(AA(FA.max)) : ""), min: AA(FA.min), max: AA(FA.max) };
|
|
8145
8145
|
}
|
|
8146
|
-
if (OA === "cm" && !
|
|
8146
|
+
if (OA === "cm" && !H) {
|
|
8147
8147
|
const AA = (LA) => +(LA / 2.54).toFixed(1);
|
|
8148
8148
|
return { range: String(AA(FA.min)) + (FA.min !== FA.max ? "–" + String(AA(FA.max)) : ""), min: AA(FA.min), max: AA(FA.max) };
|
|
8149
8149
|
}
|
|
8150
8150
|
return { range: Bf, ...FA };
|
|
8151
|
-
}, [n,
|
|
8152
|
-
if (
|
|
8153
|
-
return (g?.matchDetails || []).map((
|
|
8154
|
-
area:
|
|
8155
|
-
rawUserValue:
|
|
8156
|
-
rawChartRange:
|
|
8157
|
-
fit:
|
|
8151
|
+
}, [n, m, EA, B, SA]), rA = wf(() => {
|
|
8152
|
+
if (N)
|
|
8153
|
+
return (g?.matchDetails || []).map((gA) => ({
|
|
8154
|
+
area: gA.measurement.replace(/\s*\(.*?\)\s*$/, "").trim() || gA.measurement,
|
|
8155
|
+
rawUserValue: gA.userValue,
|
|
8156
|
+
rawChartRange: gA.chartRange,
|
|
8157
|
+
fit: gA.fit,
|
|
8158
8158
|
userNum: 0,
|
|
8159
8159
|
chartLabel: "",
|
|
8160
8160
|
isLength: !1
|
|
8161
8161
|
}));
|
|
8162
|
-
const a = g?.matchDetails || [], X = D?.secResult?.matchDetails || [],
|
|
8163
|
-
if (!
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8162
|
+
const a = g?.matchDetails || [], X = D?.secResult?.matchDetails || [], nA = [...a, ...X], H = g?.length || "", oA = (g?.availableLengths?.length || 0) > 0, zA = RA || H, YA = !!(D || oA);
|
|
8163
|
+
if (YA && !X.length) {
|
|
8164
|
+
const J = e.height || 0;
|
|
8165
|
+
nA.push({
|
|
8166
|
+
measurement: "Height",
|
|
8167
|
+
userValue: J ? String(J) : "",
|
|
8168
|
+
chartRange: zA || "",
|
|
8169
|
+
fit: "good"
|
|
8170
|
+
});
|
|
8171
|
+
}
|
|
8172
|
+
if (!nA.length) return [];
|
|
8173
|
+
const of = new Set(X.length > 0 ? X.map((J) => J.measurement) : YA ? ["Height"] : []);
|
|
8174
|
+
return nA.map((J) => {
|
|
8175
|
+
if (of.has(J.measurement)) {
|
|
8176
|
+
const U = e[J.measurement.toLowerCase()] || kf(J.userValue), R = mA || zA || J.chartRange;
|
|
8168
8177
|
if (!D)
|
|
8169
|
-
return { area:
|
|
8178
|
+
return { area: J.measurement + " (" + R + ")", userNum: U, chartLabel: R, fit: "good", isLength: !0 };
|
|
8170
8179
|
const G = D.section, S = G.headers.findIndex((KA) => /size|length/i.test(KA.trim())), aA = G.headers.findIndex((KA) => /cm|\(cm\)|height.*cm/i.test(KA.toLowerCase())), fA = S >= 0 ? S : 0, NA = aA >= 0 ? aA : -1, $A = G.rows.find((KA) => Uf(KA, fA, G.headers[fA]) === R);
|
|
8171
8180
|
let ef = R, yA = "good";
|
|
8172
8181
|
if ($A && NA >= 0) {
|
|
@@ -8175,44 +8184,44 @@ function DP({
|
|
|
8175
8184
|
ef = KA;
|
|
8176
8185
|
const { min: vf, max: M } = QP(KA);
|
|
8177
8186
|
if (vf > 0 && M > 0) {
|
|
8178
|
-
const
|
|
8187
|
+
const cA = M - vf, pA = cA > 0 ? cA * 0.5 : vf * 0.05 || 3, tf = Math.max((M || vf) * 5e-3, 0.25);
|
|
8179
8188
|
if (U >= vf - tf && U <= M + tf) yA = "good";
|
|
8180
8189
|
else if (U < vf) {
|
|
8181
8190
|
const Df = vf - U;
|
|
8182
|
-
yA = Df >
|
|
8191
|
+
yA = Df > pA * 2 ? "too-tight" : Df > pA ? "tight" : "a-bit-tight";
|
|
8183
8192
|
} else {
|
|
8184
8193
|
const Df = U - M;
|
|
8185
|
-
yA = Df >
|
|
8194
|
+
yA = Df > pA * 2 ? "too-loose" : Df > pA ? "loose" : "a-bit-loose";
|
|
8186
8195
|
}
|
|
8187
8196
|
}
|
|
8188
8197
|
}
|
|
8189
8198
|
}
|
|
8190
|
-
return { area:
|
|
8199
|
+
return { area: J.measurement + " (" + R + ")", userNum: U, chartLabel: kP(ef), fit: yA, isLength: !0 };
|
|
8191
8200
|
}
|
|
8192
|
-
const
|
|
8193
|
-
let { min: Bf, max: FA } = QP(
|
|
8194
|
-
const AA = ff(
|
|
8201
|
+
const gA = e[J.measurement.toLowerCase()] || kf(J.userValue);
|
|
8202
|
+
let { min: Bf, max: FA } = QP(J.chartRange), OA = J.chartRange;
|
|
8203
|
+
const AA = ff(J.measurement, bA);
|
|
8195
8204
|
AA && (OA = AA.range, Bf = AA.min, FA = AA.max);
|
|
8196
|
-
const LA = FA - Bf, Pf = LA > 0 ? LA * 0.5 : Bf * 0.05 || 3, lA =
|
|
8205
|
+
const LA = FA - Bf, Pf = LA > 0 ? LA * 0.5 : Bf * 0.05 || 3, lA = J.measurement.toLowerCase(), x = /length|inseam|sleeve|hem|rise/.test(lA);
|
|
8197
8206
|
let q;
|
|
8198
8207
|
const QA = Math.max((FA || Bf) * 0.03, 0.5);
|
|
8199
|
-
if (
|
|
8208
|
+
if (gA >= Bf - QA && gA <= FA + QA)
|
|
8200
8209
|
q = "good";
|
|
8201
8210
|
else if (x) {
|
|
8202
|
-
const U =
|
|
8203
|
-
q = (U > Pf * 2 ? "too-" : U > Pf ? "" : "a-bit-") + (
|
|
8204
|
-
} else if (
|
|
8205
|
-
const U = Bf -
|
|
8211
|
+
const U = gA > FA ? gA - FA : Bf - gA;
|
|
8212
|
+
q = (U > Pf * 2 ? "too-" : U > Pf ? "" : "a-bit-") + (gA > FA ? "short" : "long");
|
|
8213
|
+
} else if (gA < Bf) {
|
|
8214
|
+
const U = Bf - gA;
|
|
8206
8215
|
q = U > Pf * 2 ? "too-loose" : U > Pf ? "loose" : "a-bit-loose";
|
|
8207
8216
|
} else {
|
|
8208
|
-
const U =
|
|
8217
|
+
const U = gA - FA;
|
|
8209
8218
|
q = U > Pf * 2 ? "too-tight" : U > Pf ? "tight" : "a-bit-tight";
|
|
8210
8219
|
}
|
|
8211
|
-
return { area:
|
|
8220
|
+
return { area: J.measurement, userNum: gA, chartLabel: kP(OA), fit: q, isLength: x };
|
|
8212
8221
|
});
|
|
8213
|
-
}, [g, D, e, bA, E, ff, mA, RA,
|
|
8222
|
+
}, [g, D, e, bA, E, ff, mA, RA, N]), nf = rA.filter(
|
|
8214
8223
|
(a) => a.fit === "good" || a.fit === "a-bit-tight" || a.fit === "a-bit-loose"
|
|
8215
|
-
).length, xA = rA.length > 0 ? Math.round(nf / rA.length * 100) : 0, Ef = !
|
|
8224
|
+
).length, xA = rA.length > 0 ? Math.round(nf / rA.length * 100) : 0, Ef = !N, eA = g, $ = eA?.size || E, _A = (g?.matchDetails || []).find(
|
|
8216
8225
|
(a) => /inseam|length/i.test(a.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(a.measurement)
|
|
8217
8226
|
), Of = _A ? (_A.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", cf = eA?.length || RA || Of, Mf = eA?.availableSizes || [], gf = eA?.availableLengths || [], qA = mA || cf, GA = Mf.length > 0 ? Mf : TA, _ = (() => {
|
|
8218
8227
|
if (GA.length <= 3) return GA;
|
|
@@ -8228,10 +8237,10 @@ function DP({
|
|
|
8228
8237
|
return uA.slice(X, X + 3);
|
|
8229
8238
|
})();
|
|
8230
8239
|
if (p) {
|
|
8231
|
-
const a = f.replace(/\s*[—–-]\s*.*/g, ""), X = (
|
|
8232
|
-
const oA =
|
|
8240
|
+
const a = f.replace(/\s*[—–-]\s*.*/g, ""), X = (H) => {
|
|
8241
|
+
const oA = H.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8233
8242
|
return oA.includes("chest") || oA.includes("bust") ? o("Full circumference at the widest point.") : oA.includes("waist") ? o("Circumference at the natural waistline.") : oA.includes("hip") ? o("Circumference at the fullest point.") : oA.includes("shoulder") ? o("Shoulder edge to shoulder edge.") : oA.includes("sleeve") || oA.includes("arm") ? o("Shoulder seam to cuff edge.") : oA.includes("neck") || oA.includes("collar") ? o("Around the base of the neck.") : oA.includes("inseam") || oA.includes("inside leg") ? o("Inner leg seam length.") : oA.includes("thigh") ? o("Circumference around the upper leg.") : oA.includes("length") || oA.includes("height") ? o("Top to bottom length.") : "";
|
|
8234
|
-
},
|
|
8243
|
+
}, nA = (H, oA) => oA && H === "good" ? o("EDITORIAL LENGTH") : H === "good" ? o("PERFECT TENSION") : H === "a-bit-tight" ? o("SLIGHTLY TIGHT") : H === "a-bit-loose" ? o("SLIGHT EASE") : H.includes("tight") ? o("TIGHT") : H.includes("loose") ? o("LOOSE") : o("FIT");
|
|
8235
8244
|
return /* @__PURE__ */ A("div", { className: "ps-msd-root", children: /* @__PURE__ */ P("div", { className: "ps-msd-scroll", children: [
|
|
8236
8245
|
/* @__PURE__ */ P("div", { className: "ps-msd-topbar", children: [
|
|
8237
8246
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-msd-back", onClick: i, "aria-label": o("Back"), children: /* @__PURE__ */ P("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "20", height: "20", children: [
|
|
@@ -8250,7 +8259,7 @@ function DP({
|
|
|
8250
8259
|
"img",
|
|
8251
8260
|
{
|
|
8252
8261
|
src: r,
|
|
8253
|
-
alt:
|
|
8262
|
+
alt: z || "",
|
|
8254
8263
|
className: "ps-msd-image-img",
|
|
8255
8264
|
onLoad: t
|
|
8256
8265
|
}
|
|
@@ -8299,7 +8308,7 @@ function DP({
|
|
|
8299
8308
|
"select",
|
|
8300
8309
|
{
|
|
8301
8310
|
value: s || "",
|
|
8302
|
-
onChange: (
|
|
8311
|
+
onChange: (H) => PA(H.target.value || null),
|
|
8303
8312
|
style: {
|
|
8304
8313
|
fontSize: "11px",
|
|
8305
8314
|
fontWeight: 600,
|
|
@@ -8316,7 +8325,7 @@ function DP({
|
|
|
8316
8325
|
"aria-label": o("Display size in country"),
|
|
8317
8326
|
children: [
|
|
8318
8327
|
/* @__PURE__ */ A("option", { value: "", children: o("Standard") }),
|
|
8319
|
-
V.map((
|
|
8328
|
+
V.map((H) => /* @__PURE__ */ A("option", { value: H, children: H }, H))
|
|
8320
8329
|
]
|
|
8321
8330
|
}
|
|
8322
8331
|
),
|
|
@@ -8355,19 +8364,19 @@ function DP({
|
|
|
8355
8364
|
K !== !1 && rA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-blueprint", children: [
|
|
8356
8365
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: o("MEASUREMENT BLUEPRINT") }),
|
|
8357
8366
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
8358
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: rA.map((
|
|
8359
|
-
const
|
|
8367
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: rA.map((H, oA) => {
|
|
8368
|
+
const zA = H.isLength && H.fit.includes("short") || H.fit.includes("tight"), YA = H.fit === "good" ? "ps-good" : zA ? "ps-tight" : "ps-loose", of = X(H.area), J = String(oA + 1).padStart(2, "0");
|
|
8360
8369
|
return /* @__PURE__ */ P("div", { className: "ps-msd-row", children: [
|
|
8361
8370
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-num", children: [
|
|
8362
|
-
|
|
8371
|
+
J,
|
|
8363
8372
|
" ",
|
|
8364
|
-
|
|
8373
|
+
H.area.toUpperCase()
|
|
8365
8374
|
] }),
|
|
8366
|
-
|
|
8375
|
+
of && /* @__PURE__ */ A("p", { className: "ps-msd-row-desc", children: of }),
|
|
8367
8376
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cells", children: [
|
|
8368
8377
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cell", children: [
|
|
8369
8378
|
/* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: o("USER") }),
|
|
8370
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children:
|
|
8379
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: N ? H.rawUserValue || "—" : isNaN(H.userNum) || H.userNum === 0 ? "—" : `${XA(H.userNum)} ${B}` })
|
|
8371
8380
|
] }),
|
|
8372
8381
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cell ps-right", children: [
|
|
8373
8382
|
/* @__PURE__ */ P("span", { className: "ps-msd-cell-label", children: [
|
|
@@ -8375,11 +8384,11 @@ function DP({
|
|
|
8375
8384
|
" ",
|
|
8376
8385
|
bA
|
|
8377
8386
|
] }),
|
|
8378
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children:
|
|
8387
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: N ? H.rawChartRange || "—" : sA(H.chartLabel) })
|
|
8379
8388
|
] })
|
|
8380
8389
|
] }),
|
|
8381
|
-
/* @__PURE__ */ P("div", { className: `ps-msd-row-badge ${
|
|
8382
|
-
|
|
8390
|
+
/* @__PURE__ */ P("div", { className: `ps-msd-row-badge ${YA}`, children: [
|
|
8391
|
+
H.isLength ? Hn(H.fit, o).toUpperCase() : nA(H.fit, H.isLength),
|
|
8383
8392
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "11", height: "11", children: /* @__PURE__ */ A("path", { d: "M3 8l3.5 3.5L13 5" }) })
|
|
8384
8393
|
] })
|
|
8385
8394
|
] }, oA);
|
|
@@ -8387,34 +8396,34 @@ function DP({
|
|
|
8387
8396
|
] }),
|
|
8388
8397
|
K !== !1 && _.length > 1 && /* @__PURE__ */ P("div", { className: "ps-msd-sizes", children: [
|
|
8389
8398
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: o("TRY ANOTHER SIZE") }),
|
|
8390
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: _.map((
|
|
8399
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: _.map((H) => /* @__PURE__ */ A(
|
|
8391
8400
|
"button",
|
|
8392
8401
|
{
|
|
8393
8402
|
type: "button",
|
|
8394
|
-
className: `ps-msd-size-pill${
|
|
8395
|
-
onClick: () => c(
|
|
8396
|
-
children:
|
|
8403
|
+
className: `ps-msd-size-pill${H === bA ? " ps-active" : ""}`,
|
|
8404
|
+
onClick: () => c(H === E ? null : H),
|
|
8405
|
+
children: H
|
|
8397
8406
|
},
|
|
8398
|
-
|
|
8407
|
+
H
|
|
8399
8408
|
)) })
|
|
8400
8409
|
] }),
|
|
8401
8410
|
K !== !1 && WA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-sizes", children: [
|
|
8402
8411
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: o("LENGTH ADJUSTMENT") }),
|
|
8403
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: WA.map((
|
|
8404
|
-
const oA = String(qA ?? "").trim() === String(
|
|
8412
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: WA.map((H) => {
|
|
8413
|
+
const oA = String(qA ?? "").trim() === String(H ?? "").trim(), zA = Hf[String(H).trim()];
|
|
8405
8414
|
return /* @__PURE__ */ P(
|
|
8406
8415
|
"button",
|
|
8407
8416
|
{
|
|
8408
8417
|
type: "button",
|
|
8409
8418
|
className: `ps-msd-size-pill${oA ? " ps-active" : ""}`,
|
|
8410
|
-
onClick: () => dA(
|
|
8419
|
+
onClick: () => dA(H === cf ? null : H),
|
|
8411
8420
|
style: { display: "flex", flexDirection: "column", alignItems: "center", lineHeight: 1.15, gap: "0.15vw" },
|
|
8412
8421
|
children: [
|
|
8413
|
-
/* @__PURE__ */ A("span", { children:
|
|
8414
|
-
|
|
8422
|
+
/* @__PURE__ */ A("span", { children: H }),
|
|
8423
|
+
zA && /* @__PURE__ */ A("span", { style: { fontSize: "0.55vw", fontWeight: 500, opacity: 0.75 }, children: zA })
|
|
8415
8424
|
]
|
|
8416
8425
|
},
|
|
8417
|
-
|
|
8426
|
+
H
|
|
8418
8427
|
);
|
|
8419
8428
|
}) })
|
|
8420
8429
|
] }),
|
|
@@ -8552,10 +8561,10 @@ function DP({
|
|
|
8552
8561
|
}, children: [
|
|
8553
8562
|
/* @__PURE__ */ A("span", { style: { fontSize: "3.5vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children: vA }),
|
|
8554
8563
|
qA && (() => {
|
|
8555
|
-
const a = /^\d+(\.\d+)?$/.test(String(qA).trim()), X = (f || "").toLowerCase(),
|
|
8564
|
+
const a = /^\d+(\.\d+)?$/.test(String(qA).trim()), X = (f || "").toLowerCase(), nA = a ? /pant|trouser|inseam/.test(X) ? o("Inseam") : o("Length") : null;
|
|
8556
8565
|
return /* @__PURE__ */ P("span", { style: { fontSize: "1.4vw", fontWeight: 400, color: "var(--ps-text-secondary)", display: "inline-flex", alignItems: "baseline", gap: "0.25vw" }, children: [
|
|
8557
8566
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.9vw", fontWeight: 600, color: "var(--ps-text-muted)", letterSpacing: "0.02em" }, children: "/" }),
|
|
8558
|
-
|
|
8567
|
+
nA && /* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", fontWeight: 600, color: "var(--ps-text-muted)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: nA }),
|
|
8559
8568
|
/* @__PURE__ */ A("span", { children: qA })
|
|
8560
8569
|
] });
|
|
8561
8570
|
})(),
|
|
@@ -8585,12 +8594,12 @@ function DP({
|
|
|
8585
8594
|
/* @__PURE__ */ A("th", { style: { textAlign: "right", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: o("Fit Result") })
|
|
8586
8595
|
] }) }),
|
|
8587
8596
|
/* @__PURE__ */ A("tbody", { children: rA.map((a, X) => {
|
|
8588
|
-
const
|
|
8597
|
+
const nA = a.fit === "good" ? "#2154EF" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "#dc2626" : "#d97706" : a.fit.includes("tight") ? "#dc2626" : "#d97706", H = a.fit === "good" ? "rgba(33,84,239,0.08)" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
|
|
8589
8598
|
return /* @__PURE__ */ P("tr", { style: { borderBottom: X < rA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
8590
8599
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: a.area }),
|
|
8591
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children:
|
|
8592
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children:
|
|
8593
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color:
|
|
8600
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: N ? a.rawUserValue || "—" : isNaN(a.userNum) || a.userNum === 0 ? "—" : `${XA(a.userNum)} ${B}` }),
|
|
8601
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: N ? a.rawChartRange || "—" : sA(a.chartLabel) }),
|
|
8602
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: nA, background: H, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: a.isLength ? Hn(a.fit, o) : jB(a.fit, o) }) })
|
|
8594
8603
|
] }, X);
|
|
8595
8604
|
}) })
|
|
8596
8605
|
] }) }),
|
|
@@ -8631,7 +8640,7 @@ function DP({
|
|
|
8631
8640
|
WA.length > 0 && /* @__PURE__ */ P("div", { style: { marginBottom: "0.8vw", marginTop: "0.4vw" }, children: [
|
|
8632
8641
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 700, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.1em", display: "block", marginBottom: "0.4vw" }, children: o("Length Adjustment") }),
|
|
8633
8642
|
/* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: WA.map((a) => {
|
|
8634
|
-
const X = String(qA ?? "").trim() === String(a ?? "").trim(),
|
|
8643
|
+
const X = String(qA ?? "").trim() === String(a ?? "").trim(), nA = Hf[String(a).trim()];
|
|
8635
8644
|
return /* @__PURE__ */ P(
|
|
8636
8645
|
"button",
|
|
8637
8646
|
{
|
|
@@ -8655,7 +8664,7 @@ function DP({
|
|
|
8655
8664
|
},
|
|
8656
8665
|
children: [
|
|
8657
8666
|
/* @__PURE__ */ A("span", { children: a }),
|
|
8658
|
-
|
|
8667
|
+
nA && /* @__PURE__ */ A("span", { style: { fontSize: "0.55vw", fontWeight: 500, opacity: 0.75 }, children: nA })
|
|
8659
8668
|
]
|
|
8660
8669
|
},
|
|
8661
8670
|
a
|
|
@@ -8742,7 +8751,7 @@ function EB({
|
|
|
8742
8751
|
setView: i,
|
|
8743
8752
|
handleDownload: o,
|
|
8744
8753
|
onRetryWithFit: r,
|
|
8745
|
-
retryLoading:
|
|
8754
|
+
retryLoading: z,
|
|
8746
8755
|
selectedFile: p,
|
|
8747
8756
|
previewUrl: T,
|
|
8748
8757
|
handleFileSelect: F,
|
|
@@ -8754,13 +8763,13 @@ function EB({
|
|
|
8754
8763
|
measurementType: v = "body",
|
|
8755
8764
|
estimationDone: I = !1,
|
|
8756
8765
|
activeSection: O,
|
|
8757
|
-
setActiveSection:
|
|
8766
|
+
setActiveSection: N,
|
|
8758
8767
|
onResetTryOn: K,
|
|
8759
8768
|
onClose: E,
|
|
8760
|
-
userHeightCm:
|
|
8769
|
+
userHeightCm: BA,
|
|
8761
8770
|
t: c
|
|
8762
8771
|
}) {
|
|
8763
|
-
const hA = (n?.unit || D || "").toString().toLowerCase(), l = hA === "mm" ? "mm" : hA === "cm" ? "cm" : "in", y = c(l === "mm" ? "mm" : D === "cm" ? "cm" : "in"), [XA, sA] = j({}), V = QP, s =
|
|
8772
|
+
const hA = (n?.unit || D || "").toString().toLowerCase(), l = hA === "mm" ? "mm" : hA === "cm" ? "cm" : "in", y = c(l === "mm" ? "mm" : D === "cm" ? "cm" : "in"), [XA, sA] = j({}), V = QP, s = UA((U, R, G) => Uf(U, R, G), []), PA = wf(() => {
|
|
8764
8773
|
if (!g?.headers || !g?.rows) return -1;
|
|
8765
8774
|
const U = g.headers.findIndex((R) => /size|taglia|größe|taille/i.test(R.trim()));
|
|
8766
8775
|
if (U >= 0) return U;
|
|
@@ -8770,8 +8779,8 @@ function EB({
|
|
|
8770
8779
|
}
|
|
8771
8780
|
return 0;
|
|
8772
8781
|
}, [g, s]), RA = g?.headers?.[PA] || c("Size");
|
|
8773
|
-
|
|
8774
|
-
const mA =
|
|
8782
|
+
wf(() => PA < 0 || !g?.rows ? [] : g.rows.map((U) => s(U, PA, RA)).filter(Boolean), [g, PA, RA, s]);
|
|
8783
|
+
const mA = wf(() => {
|
|
8775
8784
|
if (!g?.headers || !g?.rows) return [];
|
|
8776
8785
|
const U = [];
|
|
8777
8786
|
for (let R = 0; R < g.headers.length; R++) {
|
|
@@ -8801,17 +8810,17 @@ function EB({
|
|
|
8801
8810
|
U.push(S);
|
|
8802
8811
|
}
|
|
8803
8812
|
return U;
|
|
8804
|
-
}, [g, s]), dA =
|
|
8813
|
+
}, [g, s]), dA = UA((U, R) => {
|
|
8805
8814
|
if (!g?.headers || !g?.rows || PA < 0) return null;
|
|
8806
8815
|
const G = U.toLowerCase().trim(), S = y === "cm" || y === "", aA = S ? "cm" : "in", fA = [];
|
|
8807
8816
|
for (let M = 0; M < g.headers.length; M++) {
|
|
8808
|
-
const
|
|
8809
|
-
if (
|
|
8817
|
+
const cA = (g.headers[M] || "").toLowerCase().trim();
|
|
8818
|
+
if (cA === G) {
|
|
8810
8819
|
fA.push(M);
|
|
8811
8820
|
continue;
|
|
8812
8821
|
}
|
|
8813
|
-
const
|
|
8814
|
-
(
|
|
8822
|
+
const pA = cA.replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8823
|
+
(pA === G || cA.includes(G) || G.includes(pA)) && fA.push(M);
|
|
8815
8824
|
}
|
|
8816
8825
|
if (fA.length === 0) return null;
|
|
8817
8826
|
let NA = fA.find((M) => mA[M] === aA);
|
|
@@ -8822,17 +8831,17 @@ function EB({
|
|
|
8822
8831
|
if (!yA) return null;
|
|
8823
8832
|
const KA = V(yA), vf = mA[NA];
|
|
8824
8833
|
if (vf === "in" && S) {
|
|
8825
|
-
const M = (
|
|
8834
|
+
const M = (cA) => +(cA * 2.54).toFixed(1);
|
|
8826
8835
|
return { range: String(M(KA.min)) + (KA.min !== KA.max ? "–" + String(M(KA.max)) : ""), min: M(KA.min), max: M(KA.max) };
|
|
8827
8836
|
}
|
|
8828
8837
|
if (vf === "cm" && !S) {
|
|
8829
|
-
const M = (
|
|
8838
|
+
const M = (cA) => +(cA / 2.54).toFixed(1);
|
|
8830
8839
|
return { range: String(M(KA.min)) + (KA.min !== KA.max ? "–" + String(M(KA.max)) : ""), min: M(KA.min), max: M(KA.max) };
|
|
8831
8840
|
}
|
|
8832
8841
|
return { range: yA, ...KA };
|
|
8833
8842
|
}, [g, PA, RA, y, s, V, mA]), ZA = n?.recommendedSize || "";
|
|
8834
|
-
|
|
8835
|
-
const [Hf,
|
|
8843
|
+
wf(() => n?.internationalSizes || {}, [n]);
|
|
8844
|
+
const [Hf, m] = j("fit"), [EA, TA] = j(null), [bA, VA] = j(!1), [kA, vA] = j(!1), [SA, ff] = j(!1), [rA, nf] = j(null), [xA, Ef] = j(!1), [eA, $] = j({ w: 800, h: 1200 }), _A = UA((U) => {
|
|
8836
8845
|
const R = U.currentTarget;
|
|
8837
8846
|
R.naturalWidth && R.naturalHeight && $({ w: R.naturalWidth, h: R.naturalHeight });
|
|
8838
8847
|
}, []);
|
|
@@ -8849,16 +8858,16 @@ function EB({
|
|
|
8849
8858
|
}, [e, t]);
|
|
8850
8859
|
const [Of, cf] = j(!1), [Mf, gf] = j(!1);
|
|
8851
8860
|
iA(null);
|
|
8852
|
-
const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X = iA(null), [
|
|
8861
|
+
const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X = iA(null), [nA, H] = j(null), [oA, zA] = j(!1);
|
|
8853
8862
|
JA(() => {
|
|
8854
8863
|
if (_) {
|
|
8855
8864
|
const U = URL.createObjectURL(_);
|
|
8856
|
-
return
|
|
8865
|
+
return H(U), () => URL.revokeObjectURL(U);
|
|
8857
8866
|
}
|
|
8858
|
-
|
|
8867
|
+
H(null);
|
|
8859
8868
|
}, [_]);
|
|
8860
|
-
const YA =
|
|
8861
|
-
|
|
8869
|
+
const YA = EA || ZA;
|
|
8870
|
+
wf(() => {
|
|
8862
8871
|
if (!n?.matchDetails?.length) return [];
|
|
8863
8872
|
const U = /* @__PURE__ */ new Set();
|
|
8864
8873
|
return n.matchDetails.filter((G) => {
|
|
@@ -8884,7 +8893,7 @@ function EB({
|
|
|
8884
8893
|
}
|
|
8885
8894
|
return { area: G.measurement, userNum: kf(G.userValue), chartLabel: aA, fit: fA };
|
|
8886
8895
|
});
|
|
8887
|
-
}, [n, YA, ZA, dA]),
|
|
8896
|
+
}, [n, YA, ZA, dA]), wf(() => {
|
|
8888
8897
|
if (!g?.headers || !g?.rows || PA < 0) return null;
|
|
8889
8898
|
const U = g.rows.find((G) => s(G, PA, RA) === YA);
|
|
8890
8899
|
if (!U) return null;
|
|
@@ -8897,19 +8906,19 @@ function EB({
|
|
|
8897
8906
|
}
|
|
8898
8907
|
return R;
|
|
8899
8908
|
}, [g, PA, RA, YA, s]);
|
|
8900
|
-
const
|
|
8909
|
+
const of = !!(g?.sections && Object.keys(g.sections).length > 1), J = wf(() => n?.sections && Object.keys(n.sections).length > 0 ? Object.entries(n.sections).map(([U, R]) => {
|
|
8901
8910
|
const G = g?.sections?.[U] || Object.values(g?.sections || {}).find(
|
|
8902
8911
|
(aA) => U.toLowerCase().includes(aA.name?.toLowerCase()?.replace(/\s*(size|sizing)\s*/gi, "").trim() || "---")
|
|
8903
8912
|
) || { headers: [], rows: [], requiredFields: [] }, S = {};
|
|
8904
8913
|
if (R.matchDetails)
|
|
8905
8914
|
for (const aA of R.matchDetails) S[aA.measurement.toLowerCase()] = kf(aA.userValue);
|
|
8906
|
-
return
|
|
8907
|
-
}) : !
|
|
8915
|
+
return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: G, secResult: R, userMeasurements: S };
|
|
8916
|
+
}) : !of || !g?.sections ? [] : Object.entries(g.sections).map(([U, R]) => {
|
|
8908
8917
|
const G = n?.sections?.[U] || { recommendedSize: n?.recommendedSize || "", matchDetails: [] }, S = {};
|
|
8909
8918
|
if (G.matchDetails)
|
|
8910
8919
|
for (const aA of G.matchDetails) S[aA.measurement.toLowerCase()] = kf(aA.userValue);
|
|
8911
|
-
return
|
|
8912
|
-
}), [
|
|
8920
|
+
return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: R, secResult: G, userMeasurements: S };
|
|
8921
|
+
}), [of, g, n, BA]), gA = wf(() => J.filter((U) => !zn(U.name)), [J]), Bf = wf(() => J.filter((U) => zn(U.name)), [J]), FA = !!T, OA = FA && (t || f && !n), AA = !FA && f && !n, LA = !!n, Pf = !!e && !t, lA = FA ? LA && Pf : LA, x = NP(), q = v === "face" || v === "head";
|
|
8913
8922
|
n?.found;
|
|
8914
8923
|
const QA = v === "foot";
|
|
8915
8924
|
return console.log("[PS-SDK] SizeResultView render:", {
|
|
@@ -8981,10 +8990,10 @@ function EB({
|
|
|
8981
8990
|
})()
|
|
8982
8991
|
] }),
|
|
8983
8992
|
(lA || n && !OA) && /* @__PURE__ */ P(tA, { children: [
|
|
8984
|
-
|
|
8993
|
+
of ? O ? (
|
|
8985
8994
|
/* ── Detail view for a single section ── */
|
|
8986
8995
|
(() => {
|
|
8987
|
-
const U =
|
|
8996
|
+
const U = gA.find((R) => R.name === O);
|
|
8988
8997
|
return U ? x ? /* @__PURE__ */ A(
|
|
8989
8998
|
DP,
|
|
8990
8999
|
{
|
|
@@ -8996,7 +9005,7 @@ function EB({
|
|
|
8996
9005
|
unitLbl: y,
|
|
8997
9006
|
chartUnit: l,
|
|
8998
9007
|
lengthEntry: cn(U.name, Bf),
|
|
8999
|
-
onBack: () =>
|
|
9008
|
+
onBack: () => N(null),
|
|
9000
9009
|
internationalSizes: U.secResult?.internationalSizes,
|
|
9001
9010
|
productImage: e || B,
|
|
9002
9011
|
productTitle: C,
|
|
@@ -9040,7 +9049,7 @@ function EB({
|
|
|
9040
9049
|
unitLbl: y,
|
|
9041
9050
|
chartUnit: l,
|
|
9042
9051
|
lengthEntry: cn(U.name, Bf),
|
|
9043
|
-
onBack: () =>
|
|
9052
|
+
onBack: () => N(null),
|
|
9044
9053
|
internationalSizes: U.secResult?.internationalSizes,
|
|
9045
9054
|
t: c
|
|
9046
9055
|
}
|
|
@@ -9056,8 +9065,8 @@ function EB({
|
|
|
9056
9065
|
productTitle: C,
|
|
9057
9066
|
sizingResult: n,
|
|
9058
9067
|
sizeGuide: g,
|
|
9059
|
-
sectionEntries:
|
|
9060
|
-
onSelectSection: (U) =>
|
|
9068
|
+
sectionEntries: gA.map(({ name: U, secResult: R }) => ({ name: U, secResult: R })),
|
|
9069
|
+
onSelectSection: (U) => N(U),
|
|
9061
9070
|
onTryOn: () => {
|
|
9062
9071
|
uA(p || null), GA(!0);
|
|
9063
9072
|
},
|
|
@@ -9139,9 +9148,9 @@ function EB({
|
|
|
9139
9148
|
/* @__PURE__ */ A("h3", { className: "ps-tryon-v2-title", children: c("Your Perfect Fit") }),
|
|
9140
9149
|
/* @__PURE__ */ A("p", { className: "ps-tryon-v2-subtitle", children: c("Tap any section for detailed breakdown") }),
|
|
9141
9150
|
/* @__PURE__ */ A("div", { className: "ps-tryon-v2-sep" }),
|
|
9142
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children:
|
|
9143
|
-
const S = g?.sectionImages?.[U], aA = G ===
|
|
9144
|
-
return /* @__PURE__ */ P("button", { className: `ps-tryon-sr-card-v2${aA ? " ps-full" : ""}`, onClick: () =>
|
|
9151
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: gA.map(({ name: U, secResult: R }, G) => {
|
|
9152
|
+
const S = g?.sectionImages?.[U], aA = G === gA.length - 1 && gA.length % 2 !== 0, fA = R;
|
|
9153
|
+
return /* @__PURE__ */ P("button", { className: `ps-tryon-sr-card-v2${aA ? " ps-full" : ""}`, onClick: () => N(U), style: { animationDelay: `${G * 0.07}s` }, children: [
|
|
9145
9154
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-card-v2-text", children: [
|
|
9146
9155
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-label", children: U.replace(/\s*[—–-]\s*.*/g, "") }),
|
|
9147
9156
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value", children: fA.found === !1 ? c("No fit") : fA.size || R.recommendedSize }),
|
|
@@ -9299,8 +9308,8 @@ function EB({
|
|
|
9299
9308
|
}
|
|
9300
9309
|
}
|
|
9301
9310
|
),
|
|
9302
|
-
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: _ &&
|
|
9303
|
-
/* @__PURE__ */ A("img", { src:
|
|
9311
|
+
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: _ && nA ? /* @__PURE__ */ P(tA, { children: [
|
|
9312
|
+
/* @__PURE__ */ A("img", { src: nA, alt: c("Your photo"), className: "ps-pm-preview-img" }),
|
|
9304
9313
|
/* @__PURE__ */ A(
|
|
9305
9314
|
"button",
|
|
9306
9315
|
{
|
|
@@ -9415,8 +9424,8 @@ function EB({
|
|
|
9415
9424
|
},
|
|
9416
9425
|
className: "ps-tryon-upload-hover",
|
|
9417
9426
|
children: [
|
|
9418
|
-
_ &&
|
|
9419
|
-
/* @__PURE__ */ A("img", { src:
|
|
9427
|
+
_ && nA ? /* @__PURE__ */ P(tA, { children: [
|
|
9428
|
+
/* @__PURE__ */ A("img", { src: nA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
9420
9429
|
/* @__PURE__ */ A("div", { className: "ps-tryon-upload-hover-overlay", style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(0,0,0,0.4)", opacity: 0, transition: "opacity 0.2s", borderRadius: "0.5vw" }, children: /* @__PURE__ */ A("span", { style: { color: "#fff", fontSize: "0.8vw", fontWeight: 600 }, children: c("Click to change photo") }) })
|
|
9421
9430
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
9422
9431
|
/* @__PURE__ */ A(zP, { size: 32 }),
|
|
@@ -9593,13 +9602,13 @@ function aB({
|
|
|
9593
9602
|
{
|
|
9594
9603
|
className: Qf(`ps-tryon-upload${g ? " ps-tryon-drag-over" : ""}`, o.uploadZone),
|
|
9595
9604
|
onClick: () => B.current?.click(),
|
|
9596
|
-
onDragOver: (
|
|
9597
|
-
|
|
9605
|
+
onDragOver: (z) => {
|
|
9606
|
+
z.preventDefault(), e(!0);
|
|
9598
9607
|
},
|
|
9599
9608
|
onDragLeave: () => e(!1),
|
|
9600
|
-
onDrop: (
|
|
9601
|
-
|
|
9602
|
-
const p =
|
|
9609
|
+
onDrop: (z) => {
|
|
9610
|
+
z.preventDefault(), e(!1);
|
|
9611
|
+
const p = z.dataTransfer?.files?.[0];
|
|
9603
9612
|
p && C(p);
|
|
9604
9613
|
},
|
|
9605
9614
|
children: [
|
|
@@ -9610,8 +9619,8 @@ function aB({
|
|
|
9610
9619
|
type: "file",
|
|
9611
9620
|
accept: "image/jpeg,image/png,image/webp",
|
|
9612
9621
|
style: { display: "none" },
|
|
9613
|
-
onChange: (
|
|
9614
|
-
const p =
|
|
9622
|
+
onChange: (z) => {
|
|
9623
|
+
const p = z.target.files?.[0];
|
|
9615
9624
|
p && C(p);
|
|
9616
9625
|
}
|
|
9617
9626
|
}
|
|
@@ -9635,15 +9644,15 @@ function dB({
|
|
|
9635
9644
|
cn: i,
|
|
9636
9645
|
t: o
|
|
9637
9646
|
}) {
|
|
9638
|
-
const r =
|
|
9647
|
+
const r = UA((h) => {
|
|
9639
9648
|
g.current = h, h && (h.style.width = `${Math.round(n.current)}%`);
|
|
9640
|
-
}, []),
|
|
9649
|
+
}, []), z = UA((h) => {
|
|
9641
9650
|
e.current = h, h && (h.textContent = `${Math.round(n.current)}%`);
|
|
9642
|
-
}, []), p =
|
|
9651
|
+
}, []), p = UA((h) => {
|
|
9643
9652
|
B.current = h;
|
|
9644
|
-
}, []), T =
|
|
9653
|
+
}, []), T = UA((h) => {
|
|
9645
9654
|
C.current = h;
|
|
9646
|
-
}, []), F =
|
|
9655
|
+
}, []), F = UA((h) => {
|
|
9647
9656
|
if (D.current = h, h) {
|
|
9648
9657
|
const W = xP * (1 - Math.round(n.current) / 100);
|
|
9649
9658
|
h.style.strokeDashoffset = String(W);
|
|
@@ -9686,7 +9695,7 @@ function dB({
|
|
|
9686
9695
|
/* @__PURE__ */ A("span", { ref: T, className: "ps-tryon-progress-eta", children: "~22s" })
|
|
9687
9696
|
] }),
|
|
9688
9697
|
/* @__PURE__ */ A("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ A("div", { ref: r, className: "ps-tryon-progress-bar-fill" }) }),
|
|
9689
|
-
/* @__PURE__ */ A("span", { ref:
|
|
9698
|
+
/* @__PURE__ */ A("span", { ref: z, className: "ps-tryon-progress-pct", children: "0%" })
|
|
9690
9699
|
] }),
|
|
9691
9700
|
/* @__PURE__ */ A("div", { ref: p, className: Qf("ps-tryon-processing-text", i.processingText), children: o("Preparing your image...") }),
|
|
9692
9701
|
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-processing-sub", i.processingSubText), children: o("This usually takes 15-25 seconds") })
|
|
@@ -9774,11 +9783,11 @@ function CP({
|
|
|
9774
9783
|
] }, f);
|
|
9775
9784
|
}
|
|
9776
9785
|
function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B }) {
|
|
9777
|
-
const [C, D] = j(null), [i, o] = j("identity"), [r,
|
|
9786
|
+
const [C, D] = j(null), [i, o] = j("identity"), [r, z] = j("name-photo"), [p, T] = j(!1), [F, h] = j(null), W = iA(null);
|
|
9778
9787
|
JA(() => {
|
|
9779
9788
|
W.current && (W.current.scrollTop = 0);
|
|
9780
9789
|
}, [C, i]);
|
|
9781
|
-
const [t, k] = j(""), [u, v] = j("male"), [I, O] = j("cm"), [
|
|
9790
|
+
const [t, k] = j(""), [u, v] = j("male"), [I, O] = j("cm"), [N, K] = j(""), [E, BA] = j(""), [c, hA] = j(""), [l, y] = j(""), [XA, sA] = j(""), [V, s] = j(""), [PA, RA] = j(null), [mA, dA] = j(!1), ZA = iA(null), Hf = iA(null), [m, EA] = j(!1), [TA, bA] = j(null), VA = () => {
|
|
9782
9791
|
TA === !0 && ZA.current?.click();
|
|
9783
9792
|
}, kA = async (x) => {
|
|
9784
9793
|
const q = x.target.files?.[0];
|
|
@@ -9807,16 +9816,16 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9807
9816
|
}
|
|
9808
9817
|
}, vA = () => {
|
|
9809
9818
|
RA(null), g?.(null), ZA.current && (ZA.current.value = "");
|
|
9810
|
-
}, [SA, ff] = j(null), [rA, nf] = j(null), [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(null), gf = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], qA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], GA = u === "female", _ = GA ? MA.female : MA.male, uA = GA ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], WA = uA.indexOf(i), a = uA.length, X = WA === a - 1,
|
|
9819
|
+
}, [SA, ff] = j(null), [rA, nf] = j(null), [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(null), gf = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], qA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], GA = u === "female", _ = GA ? MA.female : MA.male, uA = GA ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], WA = uA.indexOf(i), a = uA.length, X = WA === a - 1, nA = () => {
|
|
9811
9820
|
if (I === "in") {
|
|
9812
9821
|
const x = parseInt(E, 10), q = parseInt(c, 10);
|
|
9813
9822
|
!isNaN(x) && x >= 0 && !isNaN(q) && q >= 0 && K(String(Math.round((x * 12 + q) * 2.54)));
|
|
9814
9823
|
}
|
|
9815
9824
|
O("cm");
|
|
9816
|
-
},
|
|
9825
|
+
}, H = () => {
|
|
9817
9826
|
if (I === "cm") {
|
|
9818
|
-
const x = parseFloat(
|
|
9819
|
-
!isNaN(x) && x > 0 && (
|
|
9827
|
+
const x = parseFloat(N);
|
|
9828
|
+
!isNaN(x) && x > 0 && (BA(String(Math.floor(x / 2.54 / 12))), hA(String(Math.round(x / 2.54 % 12))));
|
|
9820
9829
|
}
|
|
9821
9830
|
O("in");
|
|
9822
9831
|
}, oA = () => {
|
|
@@ -9827,15 +9836,15 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9827
9836
|
const U = parseInt(E, 10), R = parseInt(c, 10);
|
|
9828
9837
|
x = !isNaN(U) && U > 0 && !isNaN(R) && R >= 0 && R <= 11;
|
|
9829
9838
|
} else {
|
|
9830
|
-
const U = parseFloat(
|
|
9839
|
+
const U = parseFloat(N);
|
|
9831
9840
|
x = !isNaN(U) && U > 0;
|
|
9832
9841
|
}
|
|
9833
9842
|
if (!x)
|
|
9834
9843
|
return s(B("Please enter a valid height")), !1;
|
|
9835
9844
|
const q = parseFloat(l), QA = parseFloat(XA);
|
|
9836
9845
|
return !q || q <= 0 ? (s(B("Please enter a valid weight")), !1) : !QA || QA <= 0 ? (s(B("Please enter a valid age")), !1) : (s(""), !0);
|
|
9837
|
-
},
|
|
9838
|
-
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(
|
|
9846
|
+
}, zA = () => t.trim() ? (s(""), !0) : (s(B("Please enter a profile name")), !1), YA = () => {
|
|
9847
|
+
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(N);
|
|
9839
9848
|
return {
|
|
9840
9849
|
name: t.trim(),
|
|
9841
9850
|
gender: u,
|
|
@@ -9853,8 +9862,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9853
9862
|
bandSize: GA && _A || void 0,
|
|
9854
9863
|
cupSize: GA && cf || void 0
|
|
9855
9864
|
};
|
|
9856
|
-
},
|
|
9857
|
-
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(
|
|
9865
|
+
}, of = () => {
|
|
9866
|
+
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(N), q = parseFloat(l), QA = parseFloat(XA);
|
|
9858
9867
|
return {
|
|
9859
9868
|
name: t.trim(),
|
|
9860
9869
|
gender: u,
|
|
@@ -9866,7 +9875,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9866
9875
|
...QA > 0 ? { age: QA } : {},
|
|
9867
9876
|
photoBase64: PA || void 0
|
|
9868
9877
|
};
|
|
9869
|
-
},
|
|
9878
|
+
}, J = () => {
|
|
9870
9879
|
if (!(i === "identity" && !oA())) {
|
|
9871
9880
|
if (i === "chest" && !SA) {
|
|
9872
9881
|
s(B("Please pick an option"));
|
|
@@ -9894,7 +9903,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9894
9903
|
}
|
|
9895
9904
|
o(uA[WA + 1]);
|
|
9896
9905
|
}
|
|
9897
|
-
},
|
|
9906
|
+
}, gA = (x, q) => {
|
|
9898
9907
|
s(""), x === "chest" ? ff(q) : x === "stomach" ? nf(q) : x === "seat" ? Ef(q) : x === "hips" && $(q);
|
|
9899
9908
|
const QA = uA.indexOf(x), U = QA === a - 1;
|
|
9900
9909
|
setTimeout(() => {
|
|
@@ -9912,12 +9921,12 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9912
9921
|
o(uA[Math.max(0, WA - 1)]);
|
|
9913
9922
|
}, FA = C === "manual" && (i === "chest" || i === "stomach" || i === "seat" || i === "hips"), OA = async () => {
|
|
9914
9923
|
if (r === "name-photo") {
|
|
9915
|
-
if (!
|
|
9924
|
+
if (!zA()) return;
|
|
9916
9925
|
if (!PA) {
|
|
9917
9926
|
s(B("Please upload a photo"));
|
|
9918
9927
|
return;
|
|
9919
9928
|
}
|
|
9920
|
-
s(""),
|
|
9929
|
+
s(""), z("details");
|
|
9921
9930
|
return;
|
|
9922
9931
|
}
|
|
9923
9932
|
if (r === "details") {
|
|
@@ -9928,14 +9937,14 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9928
9937
|
return;
|
|
9929
9938
|
}
|
|
9930
9939
|
} else {
|
|
9931
|
-
const q = parseFloat(
|
|
9940
|
+
const q = parseFloat(N);
|
|
9932
9941
|
if (!q || q < 100 || q > 250) {
|
|
9933
9942
|
s(B("Please enter a valid height"));
|
|
9934
9943
|
return;
|
|
9935
9944
|
}
|
|
9936
9945
|
}
|
|
9937
|
-
if (s(""),
|
|
9938
|
-
const q = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(
|
|
9946
|
+
if (s(""), z("calculating"), T(!0), e && PA) {
|
|
9947
|
+
const q = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(N), QA = parseFloat(l), U = parseFloat(XA);
|
|
9939
9948
|
try {
|
|
9940
9949
|
const R = await e({
|
|
9941
9950
|
photoBase64: PA,
|
|
@@ -9953,18 +9962,18 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9953
9962
|
T(!1);
|
|
9954
9963
|
return;
|
|
9955
9964
|
}
|
|
9956
|
-
const x =
|
|
9965
|
+
const x = of();
|
|
9957
9966
|
F && (x.measurements = F, x.measurementsUnit = "cm"), f(x);
|
|
9958
9967
|
}, AA = () => {
|
|
9959
9968
|
if (s(""), r === "details") {
|
|
9960
|
-
|
|
9969
|
+
z("name-photo");
|
|
9961
9970
|
return;
|
|
9962
9971
|
}
|
|
9963
9972
|
if (r === "calculating" && !p) {
|
|
9964
|
-
|
|
9973
|
+
z("details");
|
|
9965
9974
|
return;
|
|
9966
9975
|
}
|
|
9967
|
-
D(null),
|
|
9976
|
+
D(null), z("name-photo");
|
|
9968
9977
|
}, LA = () => {
|
|
9969
9978
|
if (C === "manual") return Bf();
|
|
9970
9979
|
if (C === "image") return AA();
|
|
@@ -10046,8 +10055,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10046
10055
|
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${u === "female" ? " ps-active" : ""}`, onClick: () => v("female"), children: B("Female") })
|
|
10047
10056
|
] }),
|
|
10048
10057
|
/* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", children: [
|
|
10049
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick:
|
|
10050
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick:
|
|
10058
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick: nA, children: "cm" }),
|
|
10059
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick: H, children: "in" })
|
|
10051
10060
|
] })
|
|
10052
10061
|
] }),
|
|
10053
10062
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
@@ -10075,7 +10084,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10075
10084
|
type: "number",
|
|
10076
10085
|
inputMode: "numeric",
|
|
10077
10086
|
className: "ps-bp-inline-input",
|
|
10078
|
-
value:
|
|
10087
|
+
value: N,
|
|
10079
10088
|
placeholder: B("e.g. 173"),
|
|
10080
10089
|
onChange: (x) => {
|
|
10081
10090
|
K(x.target.value), s("");
|
|
@@ -10094,7 +10103,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10094
10103
|
value: E,
|
|
10095
10104
|
placeholder: "5",
|
|
10096
10105
|
onChange: (x) => {
|
|
10097
|
-
|
|
10106
|
+
BA(x.target.value), s("");
|
|
10098
10107
|
}
|
|
10099
10108
|
}
|
|
10100
10109
|
),
|
|
@@ -10164,9 +10173,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10164
10173
|
title: B("CHEST PROFILE"),
|
|
10165
10174
|
subtitle: B("Select the profile that best matches your chest breadth"),
|
|
10166
10175
|
children: [
|
|
10167
|
-
/* @__PURE__ */ A(Ff, { img: _.chest?.narrow ?? null, label: B("NARROW"), selected: SA === "narrow", onSelect: () =>
|
|
10168
|
-
/* @__PURE__ */ A(Ff, { img: _.chest?.average ?? null, label: B("AVERAGE"), selected: SA === "average", onSelect: () =>
|
|
10169
|
-
/* @__PURE__ */ A(Ff, { img: _.chest?.broad ?? null, label: B("BROAD"), selected: SA === "broad", onSelect: () =>
|
|
10176
|
+
/* @__PURE__ */ A(Ff, { img: _.chest?.narrow ?? null, label: B("NARROW"), selected: SA === "narrow", onSelect: () => gA("chest", "narrow") }),
|
|
10177
|
+
/* @__PURE__ */ A(Ff, { img: _.chest?.average ?? null, label: B("AVERAGE"), selected: SA === "average", onSelect: () => gA("chest", "average") }),
|
|
10178
|
+
/* @__PURE__ */ A(Ff, { img: _.chest?.broad ?? null, label: B("BROAD"), selected: SA === "broad", onSelect: () => gA("chest", "broad") })
|
|
10170
10179
|
]
|
|
10171
10180
|
}
|
|
10172
10181
|
),
|
|
@@ -10177,9 +10186,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10177
10186
|
title: B("STOMACH PROFILE"),
|
|
10178
10187
|
subtitle: B("Describe your mid-section silhouette"),
|
|
10179
10188
|
children: [
|
|
10180
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.flat ?? null, label: B("FLAT"), selected: rA === "flat", onSelect: () =>
|
|
10181
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.average ?? null, label: B("AVERAGE"), selected: rA === "average", onSelect: () =>
|
|
10182
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.round ?? null, label: B("ROUND"), selected: rA === "round", onSelect: () =>
|
|
10189
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.flat ?? null, label: B("FLAT"), selected: rA === "flat", onSelect: () => gA("stomach", "flat") }),
|
|
10190
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.average ?? null, label: B("AVERAGE"), selected: rA === "average", onSelect: () => gA("stomach", "average") }),
|
|
10191
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.round ?? null, label: B("ROUND"), selected: rA === "round", onSelect: () => gA("stomach", "round") })
|
|
10183
10192
|
]
|
|
10184
10193
|
}
|
|
10185
10194
|
),
|
|
@@ -10190,9 +10199,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10190
10199
|
title: B("BACK & SEAT"),
|
|
10191
10200
|
subtitle: B("The curvature of your lower spine and seat profile"),
|
|
10192
10201
|
children: [
|
|
10193
|
-
/* @__PURE__ */ A(Ff, { img: _.seat?.narrow ?? null, label: B("STRAIGHT"), selected: xA === "narrow", onSelect: () =>
|
|
10194
|
-
/* @__PURE__ */ A(Ff, { img: _.seat?.average ?? null, label: B("CURVED"), selected: xA === "average", onSelect: () =>
|
|
10195
|
-
/* @__PURE__ */ A(Ff, { img: _.seat?.full ?? null, label: B("DEEP"), selected: xA === "full", onSelect: () =>
|
|
10202
|
+
/* @__PURE__ */ A(Ff, { img: _.seat?.narrow ?? null, label: B("STRAIGHT"), selected: xA === "narrow", onSelect: () => gA("seat", "narrow") }),
|
|
10203
|
+
/* @__PURE__ */ A(Ff, { img: _.seat?.average ?? null, label: B("CURVED"), selected: xA === "average", onSelect: () => gA("seat", "average") }),
|
|
10204
|
+
/* @__PURE__ */ A(Ff, { img: _.seat?.full ?? null, label: B("DEEP"), selected: xA === "full", onSelect: () => gA("seat", "full") })
|
|
10196
10205
|
]
|
|
10197
10206
|
}
|
|
10198
10207
|
),
|
|
@@ -10203,9 +10212,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10203
10212
|
title: B("HIP PROFILE"),
|
|
10204
10213
|
subtitle: B("The curvature of your hips and thighs"),
|
|
10205
10214
|
children: [
|
|
10206
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.narrow ?? null, label: B("NARROW"), selected: eA === "narrow", onSelect: () =>
|
|
10207
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.average ?? null, label: B("AVERAGE"), selected: eA === "average", onSelect: () =>
|
|
10208
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.full ?? null, label: B("FULL"), selected: eA === "full", onSelect: () =>
|
|
10215
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.narrow ?? null, label: B("NARROW"), selected: eA === "narrow", onSelect: () => gA("hips", "narrow") }),
|
|
10216
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.average ?? null, label: B("AVERAGE"), selected: eA === "average", onSelect: () => gA("hips", "average") }),
|
|
10217
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.full ?? null, label: B("FULL"), selected: eA === "full", onSelect: () => gA("hips", "full") })
|
|
10209
10218
|
]
|
|
10210
10219
|
}
|
|
10211
10220
|
),
|
|
@@ -10334,9 +10343,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10334
10343
|
/* @__PURE__ */ P("div", { className: "ps-cpw-image-right", children: [
|
|
10335
10344
|
/* @__PURE__ */ A("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: /* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10336
10345
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("NAME") }),
|
|
10337
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: Hf, type: "text", className: `ps-bp-inline-input${
|
|
10346
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: Hf, type: "text", className: `ps-bp-inline-input${m ? " ps-cpw-shake" : ""}`, value: t, placeholder: B("e.g. My Photo Profile"), onChange: (x) => {
|
|
10338
10347
|
k(x.target.value), s("");
|
|
10339
|
-
}, onAnimationEnd: () =>
|
|
10348
|
+
}, onAnimationEnd: () => EA(!1) }) })
|
|
10340
10349
|
] }) }),
|
|
10341
10350
|
/* @__PURE__ */ P("div", { className: "ps-cpw-photo-guide", children: [
|
|
10342
10351
|
/* @__PURE__ */ A("div", { className: "ps-cpw-photo-guide-title", children: B("HOW TO TAKE A GOOD PHOTO") }),
|
|
@@ -10375,20 +10384,20 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10375
10384
|
/* @__PURE__ */ A("div", { className: "ps-cpw-section-sub", children: B("Enter your details for accurate body estimation") })
|
|
10376
10385
|
] }),
|
|
10377
10386
|
/* @__PURE__ */ A("div", { className: "ps-cpw-pill-row", style: { marginBottom: "0.8vw" }, children: /* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", children: [
|
|
10378
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick:
|
|
10379
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick:
|
|
10387
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick: nA, children: "cm" }),
|
|
10388
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick: H, children: "in" })
|
|
10380
10389
|
] }) }),
|
|
10381
10390
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
10382
10391
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10383
10392
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("HEIGHT") }),
|
|
10384
10393
|
I === "cm" ? /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
10385
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
10394
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: N, placeholder: B("e.g. 173"), onChange: (x) => {
|
|
10386
10395
|
K(x.target.value), s("");
|
|
10387
10396
|
} }),
|
|
10388
10397
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
10389
10398
|
] }) : /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", style: { gap: "6px" }, children: [
|
|
10390
10399
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: E, placeholder: "5", onChange: (x) => {
|
|
10391
|
-
|
|
10400
|
+
BA(x.target.value), s("");
|
|
10392
10401
|
} }),
|
|
10393
10402
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
10394
10403
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: c, placeholder: "8", onChange: (x) => {
|
|
@@ -10461,7 +10470,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10461
10470
|
] }),
|
|
10462
10471
|
/* @__PURE__ */ P("div", { className: "ps-cpw-footer", children: [
|
|
10463
10472
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-back-btn", onClick: LA, children: C == null ? B("Cancel") : `← ${B("Back")}` }),
|
|
10464
|
-
C === "manual" && !FA && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick:
|
|
10473
|
+
C === "manual" && !FA && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: J, children: B(X ? "CALCULATE MY FIT" : "Continue") }),
|
|
10465
10474
|
C === "image" && r === "name-photo" && /* @__PURE__ */ A(
|
|
10466
10475
|
"button",
|
|
10467
10476
|
{
|
|
@@ -10469,7 +10478,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10469
10478
|
className: "ps-cpw-next-btn",
|
|
10470
10479
|
onClick: () => {
|
|
10471
10480
|
if (!t.trim()) {
|
|
10472
|
-
|
|
10481
|
+
EA(!0), Hf.current?.focus();
|
|
10473
10482
|
return;
|
|
10474
10483
|
}
|
|
10475
10484
|
OA();
|
|
@@ -10481,7 +10490,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10481
10490
|
C === "image" && r === "details" && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: OA, children: B("Calculate My Body Parts") }),
|
|
10482
10491
|
C === "image" && r === "calculating" && !p && F && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: OA, children: B("Save Profile") }),
|
|
10483
10492
|
C === "image" && r === "calculating" && !p && !F && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: () => {
|
|
10484
|
-
|
|
10493
|
+
z("details"), s("");
|
|
10485
10494
|
}, children: B("Try Again") })
|
|
10486
10495
|
] })
|
|
10487
10496
|
] });
|
|
@@ -10517,36 +10526,36 @@ function A8({
|
|
|
10517
10526
|
isEstimating: o = !1,
|
|
10518
10527
|
t: r
|
|
10519
10528
|
}) {
|
|
10520
|
-
const
|
|
10529
|
+
const z = f.gender === "female" ? VB : WB, p = f.measurements || {}, T = Object.keys(p).some((K) => p[K] != null), [F, h] = j(f.measurementsUnit || "cm"), [W, t] = j(() => {
|
|
10521
10530
|
const K = {};
|
|
10522
|
-
return
|
|
10523
|
-
const
|
|
10524
|
-
K[E.key] =
|
|
10531
|
+
return z.forEach((E) => {
|
|
10532
|
+
const BA = p[E.key];
|
|
10533
|
+
K[E.key] = BA != null ? String(Math.round(BA * 10) / 10) : "";
|
|
10525
10534
|
}), K;
|
|
10526
10535
|
});
|
|
10527
10536
|
JA(() => {
|
|
10528
10537
|
t((K) => {
|
|
10529
10538
|
const E = { ...K };
|
|
10530
|
-
let
|
|
10531
|
-
return
|
|
10539
|
+
let BA = !1;
|
|
10540
|
+
return z.forEach((c) => {
|
|
10532
10541
|
const hA = p[c.key];
|
|
10533
|
-
hA != null && !K[c.key] && (E[c.key] = String(Math.round(hA * 10) / 10),
|
|
10534
|
-
}),
|
|
10542
|
+
hA != null && !K[c.key] && (E[c.key] = String(Math.round(hA * 10) / 10), BA = !0);
|
|
10543
|
+
}), BA ? E : K;
|
|
10535
10544
|
});
|
|
10536
10545
|
}, [f.measurements, f.id]);
|
|
10537
10546
|
const [k, u] = j(f.bandSize || ""), [v, I] = j(f.cupSize || ""), O = (K) => {
|
|
10538
10547
|
K !== F && (t((E) => {
|
|
10539
|
-
const
|
|
10548
|
+
const BA = {};
|
|
10540
10549
|
for (const [c, hA] of Object.entries(E)) {
|
|
10541
10550
|
const l = parseFloat(hA);
|
|
10542
|
-
!isNaN(l) && l > 0 ?
|
|
10551
|
+
!isNaN(l) && l > 0 ? BA[c] = String(K === "in" ? Math.round(l / 2.54 * 10) / 10 : Math.round(l * 2.54 * 10) / 10) : BA[c] = hA;
|
|
10543
10552
|
}
|
|
10544
|
-
return
|
|
10553
|
+
return BA;
|
|
10545
10554
|
}), h(K));
|
|
10546
|
-
},
|
|
10555
|
+
}, N = () => {
|
|
10547
10556
|
const K = { ...f.measurements || {} };
|
|
10548
|
-
for (const [E,
|
|
10549
|
-
const c = parseFloat(
|
|
10557
|
+
for (const [E, BA] of Object.entries(W)) {
|
|
10558
|
+
const c = parseFloat(BA);
|
|
10550
10559
|
!isNaN(c) && c > 0 && (K[E] = c);
|
|
10551
10560
|
}
|
|
10552
10561
|
e(K, F), f.gender === "female" && i && (k || v) && i(k, v), D();
|
|
@@ -10585,12 +10594,12 @@ function A8({
|
|
|
10585
10594
|
] })
|
|
10586
10595
|
] }) }),
|
|
10587
10596
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-list", children: [
|
|
10588
|
-
|
|
10589
|
-
const E = p[K.key],
|
|
10597
|
+
z.map((K) => {
|
|
10598
|
+
const E = p[K.key], BA = o && E == null && !W[K.key];
|
|
10590
10599
|
return /* @__PURE__ */ P("div", { className: `ps-pmv-measure-row${E == null ? " ps-loading" : ""}`, children: [
|
|
10591
10600
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: K.iconSrc, alt: "", "aria-hidden": "true" }) }),
|
|
10592
10601
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: r(K.label) }),
|
|
10593
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children:
|
|
10602
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: BA ? /* @__PURE__ */ P("span", { style: { display: "inline-flex", alignItems: "center", gap: "0.4vw" }, children: [
|
|
10594
10603
|
/* @__PURE__ */ A("span", { className: "ps-tryon-size-loading-spinner", style: { width: "0.8vw", height: "0.8vw", borderWidth: "1.5px" } }),
|
|
10595
10604
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children: r("calculating...") })
|
|
10596
10605
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
@@ -10655,7 +10664,7 @@ function A8({
|
|
|
10655
10664
|
{
|
|
10656
10665
|
type: "button",
|
|
10657
10666
|
className: "ps-pmv-btn-primary",
|
|
10658
|
-
onClick:
|
|
10667
|
+
onClick: N,
|
|
10659
10668
|
children: T ? r("SAVE") : /* @__PURE__ */ P(tA, { children: [
|
|
10660
10669
|
/* @__PURE__ */ A("span", { className: "ps-pmv-btn-spinner" }),
|
|
10661
10670
|
r("CALCULATING")
|
|
@@ -10694,19 +10703,19 @@ function P8({
|
|
|
10694
10703
|
t: D
|
|
10695
10704
|
}) {
|
|
10696
10705
|
const i = (() => {
|
|
10697
|
-
const
|
|
10698
|
-
if (!
|
|
10706
|
+
const z = f.height ?? f.heightCm;
|
|
10707
|
+
if (!z) return null;
|
|
10699
10708
|
if (f.heightUnit === "in" || f.heightUnit === "ft") {
|
|
10700
|
-
const p = Math.floor(
|
|
10709
|
+
const p = Math.floor(z / 12), T = Math.round(z % 12);
|
|
10701
10710
|
return `${p}'${T}"`;
|
|
10702
10711
|
}
|
|
10703
|
-
return `${Math.round(
|
|
10712
|
+
return `${Math.round(z)} cm`;
|
|
10704
10713
|
})(), o = (() => {
|
|
10705
|
-
const
|
|
10706
|
-
return
|
|
10714
|
+
const z = f.weight ?? f.weightKg;
|
|
10715
|
+
return z ? `${Math.round(z)} ${f.weightUnit || "kg"}` : null;
|
|
10707
10716
|
})(), r = (() => {
|
|
10708
|
-
const
|
|
10709
|
-
return
|
|
10717
|
+
const z = f.lastEditedAt || f.lastUsedAt || f.createdAt;
|
|
10718
|
+
return z ? new Date(z).toLocaleDateString(void 0, { month: "short", day: "numeric" }) : null;
|
|
10710
10719
|
})();
|
|
10711
10720
|
return /* @__PURE__ */ P(
|
|
10712
10721
|
"div",
|
|
@@ -10733,7 +10742,7 @@ function P8({
|
|
|
10733
10742
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children: r })
|
|
10734
10743
|
] })
|
|
10735
10744
|
] }),
|
|
10736
|
-
/* @__PURE__ */ P("div", { className: "ps-msp-card-actions", onClick: (
|
|
10745
|
+
/* @__PURE__ */ P("div", { className: "ps-msp-card-actions", onClick: (z) => z.stopPropagation(), children: [
|
|
10737
10746
|
/* @__PURE__ */ A(
|
|
10738
10747
|
"button",
|
|
10739
10748
|
{
|
|
@@ -10752,8 +10761,8 @@ function P8({
|
|
|
10752
10761
|
{
|
|
10753
10762
|
type: "button",
|
|
10754
10763
|
className: "ps-msp-card-delete",
|
|
10755
|
-
onClick: (
|
|
10756
|
-
|
|
10764
|
+
onClick: (z) => {
|
|
10765
|
+
z.stopPropagation(), B();
|
|
10757
10766
|
},
|
|
10758
10767
|
"aria-label": D("Delete"),
|
|
10759
10768
|
children: /* @__PURE__ */ P("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
@@ -10788,7 +10797,7 @@ function g8({
|
|
|
10788
10797
|
onRequestDelete: i,
|
|
10789
10798
|
onClose: o,
|
|
10790
10799
|
onPhotoPreview: r,
|
|
10791
|
-
onEstimateFromPhoto:
|
|
10800
|
+
onEstimateFromPhoto: z,
|
|
10792
10801
|
estimatingProfileIds: p,
|
|
10793
10802
|
t: T,
|
|
10794
10803
|
onRegisterBackInterceptor: F
|
|
@@ -10834,8 +10843,8 @@ function g8({
|
|
|
10834
10843
|
try {
|
|
10835
10844
|
const O = localStorage.getItem("primestyle_profiles");
|
|
10836
10845
|
if (O) {
|
|
10837
|
-
const
|
|
10838
|
-
|
|
10846
|
+
const N = JSON.parse(O);
|
|
10847
|
+
N.length > 0 && (I = N[0].id ?? null);
|
|
10839
10848
|
}
|
|
10840
10849
|
} catch {
|
|
10841
10850
|
}
|
|
@@ -10843,7 +10852,7 @@ function g8({
|
|
|
10843
10852
|
},
|
|
10844
10853
|
onCancel: () => W(!1),
|
|
10845
10854
|
onPhotoPreview: r,
|
|
10846
|
-
onEstimate:
|
|
10855
|
+
onEstimate: z,
|
|
10847
10856
|
t: T
|
|
10848
10857
|
}
|
|
10849
10858
|
) : /* @__PURE__ */ P(tA, { children: [
|
|
@@ -10903,7 +10912,7 @@ function w8({
|
|
|
10903
10912
|
heightInches: i,
|
|
10904
10913
|
setHeightInches: o,
|
|
10905
10914
|
weight: r,
|
|
10906
|
-
setWeight:
|
|
10915
|
+
setWeight: z,
|
|
10907
10916
|
age: p,
|
|
10908
10917
|
setAge: T,
|
|
10909
10918
|
switchToMetric: F,
|
|
@@ -10915,18 +10924,18 @@ function w8({
|
|
|
10915
10924
|
fastPathLabel: v,
|
|
10916
10925
|
activeProfileName: I,
|
|
10917
10926
|
onStartFresh: O,
|
|
10918
|
-
hidePhotoOptions:
|
|
10927
|
+
hidePhotoOptions: N = !1,
|
|
10919
10928
|
error: K,
|
|
10920
10929
|
t: E
|
|
10921
10930
|
}) {
|
|
10922
|
-
const
|
|
10931
|
+
const BA = parseFloat(e) || 173, c = (parseFloat(C) || 5) * 12 + (parseFloat(i) || 8), hA = Math.floor(c / 12), l = c % 12, y = parseFloat(r) || (n === "kg" ? 70 : 154), XA = parseFloat(p) || 30, sA = n === "kg" ? 30 : 66, V = n === "kg" ? 200 : 440, s = 120, PA = 220, RA = 48, mA = 84, dA = 13, ZA = 100, Hf = (BA - s) / (PA - s) * 100, m = (c - RA) / (mA - RA) * 100, EA = (y - sA) / (V - sA) * 100, TA = (XA - dA) / (ZA - dA) * 100, bA = (nf) => {
|
|
10923
10932
|
const xA = Math.max(RA, Math.min(mA, nf));
|
|
10924
10933
|
D(String(Math.floor(xA / 12))), o(String(xA % 12));
|
|
10925
10934
|
}, VA = () => {
|
|
10926
|
-
f === "in" ? bA(c + 1) : B(String(Math.min(PA,
|
|
10935
|
+
f === "in" ? bA(c + 1) : B(String(Math.min(PA, BA + 1)));
|
|
10927
10936
|
}, kA = () => {
|
|
10928
|
-
f === "in" ? bA(c - 1) : B(String(Math.max(s,
|
|
10929
|
-
}, vA = () =>
|
|
10937
|
+
f === "in" ? bA(c - 1) : B(String(Math.max(s, BA - 1)));
|
|
10938
|
+
}, vA = () => z(String(Math.min(V, y + 1))), SA = () => z(String(Math.max(sA, y - 1))), ff = () => T(String(Math.min(ZA, XA + 1))), rA = () => T(String(Math.max(dA, XA - 1)));
|
|
10930
10939
|
return /* @__PURE__ */ P("div", { className: "ps-bpm-root", children: [
|
|
10931
10940
|
/* @__PURE__ */ P("div", { className: "ps-bpm-header", children: [
|
|
10932
10941
|
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: E("Body Measurements") }),
|
|
@@ -10965,7 +10974,7 @@ function w8({
|
|
|
10965
10974
|
/* @__PURE__ */ P("div", { className: "ps-bpm-row", children: [
|
|
10966
10975
|
/* @__PURE__ */ P("div", { className: "ps-bpm-row-top", children: [
|
|
10967
10976
|
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: E("HEIGHT") }),
|
|
10968
|
-
/* @__PURE__ */ A("span", { className: "ps-bpm-value-display", children: f === "in" ? `${hA}ft ${l}in` : `${Math.round(
|
|
10977
|
+
/* @__PURE__ */ A("span", { className: "ps-bpm-value-display", children: f === "in" ? `${hA}ft ${l}in` : `${Math.round(BA)} cm` })
|
|
10969
10978
|
] }),
|
|
10970
10979
|
/* @__PURE__ */ P("div", { className: "ps-bpm-slider-row", children: [
|
|
10971
10980
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: kA, "aria-label": E("Decrease"), children: /* @__PURE__ */ A(OP, {}) }),
|
|
@@ -10979,7 +10988,7 @@ function w8({
|
|
|
10979
10988
|
step: 1,
|
|
10980
10989
|
value: c,
|
|
10981
10990
|
onChange: (nf) => bA(parseInt(nf.target.value, 10)),
|
|
10982
|
-
style: { "--ps-pct": `${
|
|
10991
|
+
style: { "--ps-pct": `${m}%` }
|
|
10983
10992
|
}
|
|
10984
10993
|
) : /* @__PURE__ */ A(
|
|
10985
10994
|
"input",
|
|
@@ -10989,7 +10998,7 @@ function w8({
|
|
|
10989
10998
|
min: s,
|
|
10990
10999
|
max: PA,
|
|
10991
11000
|
step: 1,
|
|
10992
|
-
value:
|
|
11001
|
+
value: BA,
|
|
10993
11002
|
onChange: (nf) => B(nf.target.value),
|
|
10994
11003
|
style: { "--ps-pct": `${Hf}%` }
|
|
10995
11004
|
}
|
|
@@ -11017,8 +11026,8 @@ function w8({
|
|
|
11017
11026
|
max: V,
|
|
11018
11027
|
step: 1,
|
|
11019
11028
|
value: y,
|
|
11020
|
-
onChange: (nf) =>
|
|
11021
|
-
style: { "--ps-pct": `${
|
|
11029
|
+
onChange: (nf) => z(nf.target.value),
|
|
11030
|
+
style: { "--ps-pct": `${EA}%` }
|
|
11022
11031
|
}
|
|
11023
11032
|
),
|
|
11024
11033
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: vA, "aria-label": E("Increase"), children: /* @__PURE__ */ A(KP, {}) })
|
|
@@ -11052,7 +11061,7 @@ function w8({
|
|
|
11052
11061
|
] })
|
|
11053
11062
|
] })
|
|
11054
11063
|
] }),
|
|
11055
|
-
!
|
|
11064
|
+
!N && /* @__PURE__ */ P(tA, { children: [
|
|
11056
11065
|
/* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children: E("or") }) }),
|
|
11057
11066
|
/* @__PURE__ */ P(
|
|
11058
11067
|
"button",
|
|
@@ -11081,7 +11090,7 @@ function w8({
|
|
|
11081
11090
|
children: v || E("Next")
|
|
11082
11091
|
}
|
|
11083
11092
|
),
|
|
11084
|
-
!
|
|
11093
|
+
!N && /* @__PURE__ */ A(
|
|
11085
11094
|
PP,
|
|
11086
11095
|
{
|
|
11087
11096
|
mode: "manual",
|
|
@@ -11121,7 +11130,7 @@ function Zn({
|
|
|
11121
11130
|
photoStepHeight: i,
|
|
11122
11131
|
onPhotoStepHeightChange: o,
|
|
11123
11132
|
ageConfirmed: r,
|
|
11124
|
-
onAgeConfirmedChange:
|
|
11133
|
+
onAgeConfirmedChange: z,
|
|
11125
11134
|
t: p
|
|
11126
11135
|
}) {
|
|
11127
11136
|
const T = D === "close-up", F = iA(null), h = !!f, W = !h && r !== !0;
|
|
@@ -11175,14 +11184,14 @@ function Zn({
|
|
|
11175
11184
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-eyebrow", children: p("AGE VERIFICATION") }),
|
|
11176
11185
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-question", children: p("Is the person in this photo 18 years or older?") }),
|
|
11177
11186
|
/* @__PURE__ */ P("div", { className: "ps-pm-age-gate-actions", children: [
|
|
11178
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-primary", onClick: () =>
|
|
11179
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () =>
|
|
11187
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-primary", onClick: () => z(!0), children: p("Yes") }),
|
|
11188
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => z(!1), children: p("No") })
|
|
11180
11189
|
] })
|
|
11181
11190
|
] }) }),
|
|
11182
11191
|
r === !1 && /* @__PURE__ */ A("div", { className: "ps-pm-age-gate", role: "alert", children: /* @__PURE__ */ P("div", { className: "ps-pm-age-gate-card", children: [
|
|
11183
11192
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-eyebrow ps-pm-age-gate-eyebrow-blocked", children: p("UPLOAD NOT ALLOWED") }),
|
|
11184
11193
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-question", children: p("For your safety, we cannot process photos of people under 18.") }),
|
|
11185
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () =>
|
|
11194
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => z(null), children: p("Go back") })
|
|
11186
11195
|
] }) })
|
|
11187
11196
|
] }) }),
|
|
11188
11197
|
/* @__PURE__ */ P("div", { className: "ps-pm-legal-notice", children: [
|
|
@@ -11261,7 +11270,7 @@ function iP({
|
|
|
11261
11270
|
] }),
|
|
11262
11271
|
/* @__PURE__ */ A("h2", { className: "ps-bsm-question", children: g }),
|
|
11263
11272
|
/* @__PURE__ */ A("div", { className: "ps-bsm-options-center", children: /* @__PURE__ */ A("div", { className: "ps-bsm-options", children: e.map((i, o) => {
|
|
11264
|
-
const r = B === i.value,
|
|
11273
|
+
const r = B === i.value, z = String.fromCharCode(65 + o);
|
|
11265
11274
|
return /* @__PURE__ */ P(
|
|
11266
11275
|
"button",
|
|
11267
11276
|
{
|
|
@@ -11273,7 +11282,7 @@ function iP({
|
|
|
11273
11282
|
/* @__PURE__ */ P("span", { className: "ps-bsm-card-eyebrow", children: [
|
|
11274
11283
|
D("PROFILE"),
|
|
11275
11284
|
" ",
|
|
11276
|
-
|
|
11285
|
+
z
|
|
11277
11286
|
] }),
|
|
11278
11287
|
/* @__PURE__ */ A("span", { className: "ps-bsm-card-label", children: i.label.toUpperCase() })
|
|
11279
11288
|
] }),
|
|
@@ -11375,7 +11384,7 @@ function z8({
|
|
|
11375
11384
|
weightUnit: i,
|
|
11376
11385
|
setWeightUnit: o,
|
|
11377
11386
|
sizingUnit: r,
|
|
11378
|
-
setSizingUnit:
|
|
11387
|
+
setSizingUnit: z,
|
|
11379
11388
|
onComplete: p,
|
|
11380
11389
|
onSnapSubmit: T,
|
|
11381
11390
|
hasActiveProfileWithMeasurements: F = !1,
|
|
@@ -11386,48 +11395,48 @@ function z8({
|
|
|
11386
11395
|
onBack: u,
|
|
11387
11396
|
t: v
|
|
11388
11397
|
}) {
|
|
11389
|
-
const I = g ? r8 : t8, [O,
|
|
11398
|
+
const I = g ? r8 : t8, [O, N] = j("basics");
|
|
11390
11399
|
O === "photo" || I.indexOf(O);
|
|
11391
|
-
const K = NP(), E = Yn(B),
|
|
11400
|
+
const K = NP(), E = Yn(B), BA = k?.height, c = k?.weight, hA = k?.age, l = k?.heightUnit === "ft" ? "in" : k?.heightUnit, y = k?.weightUnit, XA = BA != null && l === "cm" ? String(Math.round(BA)) : BA != null && (l === "in" || l === "ft") ? String(Math.round(BA * 2.54)) : e.current.height || "173", sA = BA != null && (l === "in" || l === "ft") ? Math.round(BA) : BA != null && l === "cm" ? Math.round(BA / 2.54) : null, V = sA != null ? String(Math.floor(sA / 12)) : e.current.heightFeet || "5", s = sA != null ? String(sA % 12) : e.current.heightInches || "8", PA = c != null ? String(Math.round(c)) : e.current.weight || (E ? "154" : "70"), RA = hA != null ? String(hA) : e.current.age || "30", [mA, dA] = j(XA), [ZA, Hf] = j(V), [m, EA] = j(s), [TA, bA] = j(PA), [VA, kA] = j(RA), [vA, SA] = j(
|
|
11392
11401
|
l || (C === "ft" ? "in" : C || (E ? "in" : "cm"))
|
|
11393
11402
|
), [ff, rA] = j(
|
|
11394
11403
|
y || i || (E ? "lbs" : "kg")
|
|
11395
|
-
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf = iA(null), [qA, GA] = j(null), [_, uA] = j(() => sA != null ? String(Math.round(sA * 2.54)) : XA), [WA, a] = j(null), [X,
|
|
11396
|
-
const
|
|
11397
|
-
if (!
|
|
11404
|
+
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf = iA(null), [qA, GA] = j(null), [_, uA] = j(() => sA != null ? String(Math.round(sA * 2.54)) : XA), [WA, a] = j(null), [X, nA] = j(null), [H, oA] = j(null), [zA, YA] = j(null), [of, J] = j(""), [gA, Bf] = j(null), [FA, OA] = j(null), [AA, LA] = j(() => ["US", "UK", "AU"].includes(B) ? B === "AU" ? "UK" : B : ["FR", "ES"].includes(B) ? "FR" : ["IT"].includes(B) ? "IT" : ["JP", "CN", "KR"].includes(B) ? "JP" : "EU"), [Pf, lA] = j(!1), x = pn[AA] || pn.US, [q, QA] = j(""), U = UA(async (M) => {
|
|
11405
|
+
const cA = M.target.files?.[0];
|
|
11406
|
+
if (!cA) return;
|
|
11398
11407
|
if (qA !== !0) {
|
|
11399
11408
|
QA(v("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
11400
11409
|
return;
|
|
11401
11410
|
}
|
|
11402
|
-
if (!
|
|
11411
|
+
if (!cA.type.startsWith("image/")) {
|
|
11403
11412
|
QA(v("Please upload an image file"));
|
|
11404
11413
|
return;
|
|
11405
11414
|
}
|
|
11406
|
-
if (
|
|
11415
|
+
if (cA.size > 10 * 1024 * 1024) {
|
|
11407
11416
|
QA(v("Image must be under 10MB"));
|
|
11408
11417
|
return;
|
|
11409
11418
|
}
|
|
11410
|
-
QA(""), Mf(!0), Ef(
|
|
11411
|
-
const
|
|
11412
|
-
$(
|
|
11419
|
+
QA(""), Mf(!0), Ef(cA);
|
|
11420
|
+
const pA = URL.createObjectURL(cA);
|
|
11421
|
+
$(pA);
|
|
11413
11422
|
try {
|
|
11414
|
-
const tf = await AP(
|
|
11423
|
+
const tf = await AP(cA);
|
|
11415
11424
|
Of(tf);
|
|
11416
11425
|
} catch {
|
|
11417
11426
|
QA(v("Failed to process image")), $(null);
|
|
11418
11427
|
} finally {
|
|
11419
11428
|
Mf(!1);
|
|
11420
11429
|
}
|
|
11421
|
-
}, [v, qA]), R =
|
|
11430
|
+
}, [v, qA]), R = UA(() => {
|
|
11422
11431
|
eA && URL.revokeObjectURL(eA), Ef(null), $(null), Of(null), gf.current && (gf.current.value = "");
|
|
11423
|
-
}, [eA]), G =
|
|
11432
|
+
}, [eA]), G = UA(() => {
|
|
11424
11433
|
if (vA === "in") {
|
|
11425
|
-
const
|
|
11426
|
-
if (!
|
|
11434
|
+
const cA = parseFloat(ZA);
|
|
11435
|
+
if (!cA || cA < 3 || cA > 8)
|
|
11427
11436
|
return QA(v("Please enter a valid height")), !1;
|
|
11428
11437
|
} else {
|
|
11429
|
-
const
|
|
11430
|
-
if (!
|
|
11438
|
+
const cA = parseFloat(mA);
|
|
11439
|
+
if (!cA || cA < 100 || cA > 250)
|
|
11431
11440
|
return QA(v("Please enter a valid height (100-250 cm)")), !1;
|
|
11432
11441
|
}
|
|
11433
11442
|
const M = parseFloat(TA);
|
|
@@ -11440,50 +11449,50 @@ function z8({
|
|
|
11440
11449
|
}, [vA, ff, mA, ZA, TA, v]), S = () => {
|
|
11441
11450
|
let M;
|
|
11442
11451
|
if (vA === "in") {
|
|
11443
|
-
const
|
|
11444
|
-
M =
|
|
11452
|
+
const cA = parseFloat(ZA) || 0, pA = parseFloat(m) || 0;
|
|
11453
|
+
M = cA * 12 + pA;
|
|
11445
11454
|
} else
|
|
11446
11455
|
M = parseFloat(mA);
|
|
11447
11456
|
return { heightVal: M, weightVal: parseFloat(TA) };
|
|
11448
11457
|
}, aA = g ? "female" : "male", fA = (M) => {
|
|
11449
|
-
const
|
|
11450
|
-
return
|
|
11458
|
+
const cA = I.indexOf(M);
|
|
11459
|
+
return cA < I.length - 1 ? I[cA + 1] : "submit";
|
|
11451
11460
|
}, NA = () => {
|
|
11452
|
-
const { heightVal: M, weightVal:
|
|
11453
|
-
e.current.height = String(M), e.current.weight = String(
|
|
11461
|
+
const { heightVal: M, weightVal: cA } = S();
|
|
11462
|
+
e.current.height = String(M), e.current.weight = String(cA), e.current.gender = aA, VA && (e.current.age = VA), D(vA), o(ff), p({
|
|
11454
11463
|
height: M,
|
|
11455
|
-
weight:
|
|
11464
|
+
weight: cA,
|
|
11456
11465
|
heightUnit: vA,
|
|
11457
11466
|
weightUnit: ff,
|
|
11458
11467
|
gender: aA,
|
|
11459
11468
|
age: VA ? parseInt(VA, 10) : void 0,
|
|
11460
11469
|
chestProfile: WA || void 0,
|
|
11461
11470
|
midsectionProfile: X,
|
|
11462
|
-
hipProfile:
|
|
11471
|
+
hipProfile: H,
|
|
11463
11472
|
bodyImage: _A || void 0,
|
|
11464
|
-
bandSize:
|
|
11473
|
+
bandSize: gA || void 0,
|
|
11465
11474
|
cupSize: FA || void 0
|
|
11466
11475
|
});
|
|
11467
|
-
}, $A =
|
|
11476
|
+
}, $A = UA(() => {
|
|
11468
11477
|
if (O === "basics") {
|
|
11469
11478
|
if (!G()) return;
|
|
11470
|
-
|
|
11479
|
+
N(fA("basics"));
|
|
11471
11480
|
} else if (O === "chest") {
|
|
11472
11481
|
if (!WA) return;
|
|
11473
|
-
|
|
11482
|
+
N(fA("chest"));
|
|
11474
11483
|
} else if (O === "midsection") {
|
|
11475
11484
|
if (!X) return;
|
|
11476
|
-
|
|
11485
|
+
N(fA("midsection"));
|
|
11477
11486
|
} else if (O === "seat") {
|
|
11478
|
-
if (!
|
|
11487
|
+
if (!zA) return;
|
|
11479
11488
|
const M = fA("seat");
|
|
11480
|
-
M === "submit" ? NA() :
|
|
11489
|
+
M === "submit" ? NA() : N(M);
|
|
11481
11490
|
} else if (O === "hips") {
|
|
11482
|
-
if (!
|
|
11491
|
+
if (!H) return;
|
|
11483
11492
|
const M = fA("hips");
|
|
11484
|
-
M === "submit" ? NA() :
|
|
11493
|
+
M === "submit" ? NA() : N(M);
|
|
11485
11494
|
} else if (O === "bra") {
|
|
11486
|
-
if (!
|
|
11495
|
+
if (!gA || !FA) {
|
|
11487
11496
|
QA(v("Please select both band and cup size"));
|
|
11488
11497
|
return;
|
|
11489
11498
|
}
|
|
@@ -11507,19 +11516,19 @@ function z8({
|
|
|
11507
11516
|
gender: aA
|
|
11508
11517
|
});
|
|
11509
11518
|
}
|
|
11510
|
-
}, [O, I, G, WA, X,
|
|
11511
|
-
const
|
|
11512
|
-
return
|
|
11513
|
-
}, yA =
|
|
11519
|
+
}, [O, I, G, WA, X, H, zA, gA, FA, vA, ff, mA, ZA, m, TA, VA, _A, xA, _, e, D, o, p, T, g, aA, F, h]), ef = (M) => {
|
|
11520
|
+
const cA = I.indexOf(M);
|
|
11521
|
+
return cA > 0 ? I[cA - 1] : null;
|
|
11522
|
+
}, yA = UA(() => {
|
|
11514
11523
|
if (QA(""), O === "basics")
|
|
11515
11524
|
u();
|
|
11516
11525
|
else if (O === "photo")
|
|
11517
|
-
|
|
11526
|
+
N("basics");
|
|
11518
11527
|
else {
|
|
11519
11528
|
const M = ef(O);
|
|
11520
|
-
M ?
|
|
11529
|
+
M ? N(M) : u();
|
|
11521
11530
|
}
|
|
11522
|
-
}, [O, I, u]), KA = O === "basics" ? !0 : O === "chest" ? !!WA : O === "midsection" ? !!X : O === "seat" ? !!
|
|
11531
|
+
}, [O, I, u]), KA = O === "basics" ? !0 : O === "chest" ? !!WA : O === "midsection" ? !!X : O === "seat" ? !!zA : O === "hips" ? !!H : O === "bra" ? !!(gA && FA) : O === "photo", vf = O === I[I.length - 1];
|
|
11523
11532
|
return O === "photo" ? K ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
11524
11533
|
Zn,
|
|
11525
11534
|
{
|
|
@@ -11527,7 +11536,7 @@ function z8({
|
|
|
11527
11536
|
handlePhotoSelect: U,
|
|
11528
11537
|
handleRemovePhoto: R,
|
|
11529
11538
|
onAnalyze: $A,
|
|
11530
|
-
onSwitchToManual: () =>
|
|
11539
|
+
onSwitchToManual: () => N("basics"),
|
|
11531
11540
|
error: q,
|
|
11532
11541
|
photoStepHeight: _,
|
|
11533
11542
|
onPhotoStepHeightChange: uA,
|
|
@@ -11795,7 +11804,7 @@ function z8({
|
|
|
11795
11804
|
PP,
|
|
11796
11805
|
{
|
|
11797
11806
|
mode: "scan",
|
|
11798
|
-
onSwitchToManual: () =>
|
|
11807
|
+
onSwitchToManual: () => N("basics"),
|
|
11799
11808
|
onSwitchToScan: () => {
|
|
11800
11809
|
},
|
|
11801
11810
|
t: v
|
|
@@ -11834,16 +11843,16 @@ function z8({
|
|
|
11834
11843
|
O === "basics" && (() => {
|
|
11835
11844
|
const M = () => {
|
|
11836
11845
|
if (vA === "in") {
|
|
11837
|
-
const
|
|
11838
|
-
dA(String(Math.round(
|
|
11846
|
+
const pA = (parseFloat(ZA) || 5) * 12 + (parseFloat(m) || 8);
|
|
11847
|
+
dA(String(Math.round(pA * 2.54)));
|
|
11839
11848
|
}
|
|
11840
|
-
ff === "lbs" && TA && bA(String(Math.round(parseFloat(TA) / 2.205))), SA("cm"), rA("kg"), D("cm"), o("kg"),
|
|
11841
|
-
},
|
|
11849
|
+
ff === "lbs" && TA && bA(String(Math.round(parseFloat(TA) / 2.205))), SA("cm"), rA("kg"), D("cm"), o("kg"), z?.("cm");
|
|
11850
|
+
}, cA = () => {
|
|
11842
11851
|
if (vA === "cm") {
|
|
11843
|
-
const
|
|
11844
|
-
Hf(String(Math.floor(tf / 12))),
|
|
11852
|
+
const pA = parseFloat(mA) || 173, tf = Math.round(pA / 2.54);
|
|
11853
|
+
Hf(String(Math.floor(tf / 12))), EA(String(tf % 12));
|
|
11845
11854
|
}
|
|
11846
|
-
ff === "kg" && TA && bA(String(Math.round(parseFloat(TA) * 2.205))), SA("in"), rA("lbs"), D("in"), o("lbs"),
|
|
11855
|
+
ff === "kg" && TA && bA(String(Math.round(parseFloat(TA) * 2.205))), SA("in"), rA("lbs"), D("in"), o("lbs"), z?.("in");
|
|
11847
11856
|
};
|
|
11848
11857
|
return K ? /* @__PURE__ */ A(
|
|
11849
11858
|
w8,
|
|
@@ -11855,16 +11864,16 @@ function z8({
|
|
|
11855
11864
|
setHeight: dA,
|
|
11856
11865
|
heightFeet: ZA,
|
|
11857
11866
|
setHeightFeet: Hf,
|
|
11858
|
-
heightInches:
|
|
11859
|
-
setHeightInches:
|
|
11867
|
+
heightInches: m,
|
|
11868
|
+
setHeightInches: EA,
|
|
11860
11869
|
weight: TA,
|
|
11861
11870
|
setWeight: bA,
|
|
11862
11871
|
age: VA,
|
|
11863
11872
|
setAge: kA,
|
|
11864
11873
|
switchToMetric: M,
|
|
11865
|
-
switchToImperial:
|
|
11866
|
-
onUploadPhoto: () =>
|
|
11867
|
-
onSwitchToScan: () =>
|
|
11874
|
+
switchToImperial: cA,
|
|
11875
|
+
onUploadPhoto: () => N("photo"),
|
|
11876
|
+
onSwitchToScan: () => N("photo"),
|
|
11868
11877
|
hidePhotoOptions: F,
|
|
11869
11878
|
onNext: F && h ? h : $A,
|
|
11870
11879
|
canProceed: !0,
|
|
@@ -11888,37 +11897,37 @@ function z8({
|
|
|
11888
11897
|
] }),
|
|
11889
11898
|
/* @__PURE__ */ P("div", { className: "ps-bp-system-toggle", children: [
|
|
11890
11899
|
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${nf ? "" : " ps-bp-system-active"}`, onClick: M, type: "button", children: v("Metric") }),
|
|
11891
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${nf ? " ps-bp-system-active" : ""}`, onClick:
|
|
11900
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${nf ? " ps-bp-system-active" : ""}`, onClick: cA, type: "button", children: v("Imperial") })
|
|
11892
11901
|
] }),
|
|
11893
11902
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-fields", children: [
|
|
11894
11903
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
11895
11904
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("HEIGHT") }),
|
|
11896
11905
|
vA === "in" ? /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11897
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: ZA, onChange: (
|
|
11906
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: ZA, onChange: (pA) => Hf(pA.target.value), min: 3, max: 8 }),
|
|
11898
11907
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
11899
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value:
|
|
11908
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: m, onChange: (pA) => EA(pA.target.value), min: 0, max: 11 }),
|
|
11900
11909
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
11901
11910
|
] }) : /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11902
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: mA, onChange: (
|
|
11911
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: mA, onChange: (pA) => dA(pA.target.value), min: 100, max: 250 }),
|
|
11903
11912
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
11904
11913
|
] })
|
|
11905
11914
|
] }),
|
|
11906
11915
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
11907
11916
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("WEIGHT") }),
|
|
11908
11917
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11909
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: ff === "kg" ? "75" : "165", value: TA, onChange: (
|
|
11918
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: ff === "kg" ? "75" : "165", value: TA, onChange: (pA) => bA(pA.target.value), min: ff === "kg" ? 30 : 66, max: ff === "kg" ? 300 : 660 }),
|
|
11910
11919
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: ff })
|
|
11911
11920
|
] })
|
|
11912
11921
|
] }),
|
|
11913
11922
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
11914
11923
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("AGE") }),
|
|
11915
11924
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11916
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "30", value: VA, onChange: (
|
|
11925
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "30", value: VA, onChange: (pA) => kA(pA.target.value), min: 13, max: 100 }),
|
|
11917
11926
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: v("years") })
|
|
11918
11927
|
] })
|
|
11919
11928
|
] })
|
|
11920
11929
|
] }),
|
|
11921
|
-
/* @__PURE__ */ P("button", { className: "ps-bp-photo-cta", onClick: () =>
|
|
11930
|
+
/* @__PURE__ */ P("button", { className: "ps-bp-photo-cta", onClick: () => N("photo"), type: "button", children: [
|
|
11922
11931
|
/* @__PURE__ */ A(i8, {}),
|
|
11923
11932
|
/* @__PURE__ */ A("span", { children: v("Or upload a photo for AI sizing") }),
|
|
11924
11933
|
/* @__PURE__ */ A("span", { className: "ps-bp-photo-cta-arrow", children: "→" })
|
|
@@ -11945,11 +11954,11 @@ function z8({
|
|
|
11945
11954
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
11946
11955
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your chest?") }),
|
|
11947
11956
|
/* @__PURE__ */ P("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: [
|
|
11948
|
-
/* @__PURE__ */ A(rf, { img: MA.male.chest.narrow, label: v("Narrow"), selected: WA === "narrow", onSelect: () => a("narrow"), onHover: () =>
|
|
11949
|
-
/* @__PURE__ */ A(rf, { img: MA.male.chest.average, label: v("Average"), selected: WA === "average", onSelect: () => a("average"), onHover: () =>
|
|
11950
|
-
/* @__PURE__ */ A(rf, { img: MA.male.chest.broad, label: v("Broad"), selected: WA === "broad", onSelect: () => a("broad"), onHover: () =>
|
|
11957
|
+
/* @__PURE__ */ A(rf, { img: MA.male.chest.narrow, label: v("Narrow"), selected: WA === "narrow", onSelect: () => a("narrow"), onHover: () => J(v("A slimmer, narrower chest build")), onLeave: () => J("") }),
|
|
11958
|
+
/* @__PURE__ */ A(rf, { img: MA.male.chest.average, label: v("Average"), selected: WA === "average", onSelect: () => a("average"), onHover: () => J(v("A moderate, proportionate chest")), onLeave: () => J("") }),
|
|
11959
|
+
/* @__PURE__ */ A(rf, { img: MA.male.chest.broad, label: v("Broad"), selected: WA === "broad", onSelect: () => a("broad"), onHover: () => J(v("A wider, more muscular chest")), onLeave: () => J("") })
|
|
11951
11960
|
] }),
|
|
11952
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
11961
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
11953
11962
|
] }, "step-chest")),
|
|
11954
11963
|
O === "midsection" && (K ? /* @__PURE__ */ A(
|
|
11955
11964
|
iP,
|
|
@@ -11967,22 +11976,22 @@ function z8({
|
|
|
11967
11976
|
{ value: "round", label: v("Full"), img: MA.male.stomach.round }
|
|
11968
11977
|
],
|
|
11969
11978
|
selected: X,
|
|
11970
|
-
onSelect: (M) =>
|
|
11979
|
+
onSelect: (M) => nA(M),
|
|
11971
11980
|
t: v
|
|
11972
11981
|
},
|
|
11973
11982
|
"step-midsection-mobile"
|
|
11974
11983
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
11975
11984
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your midsection?") }),
|
|
11976
11985
|
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(tA, { children: [
|
|
11977
|
-
/* @__PURE__ */ A(rf, { img: MA.female.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () =>
|
|
11978
|
-
/* @__PURE__ */ A(rf, { img: MA.female.stomach.average, label: v("Average"), selected: X === "average", onSelect: () =>
|
|
11979
|
-
/* @__PURE__ */ A(rf, { img: MA.female.stomach.round, label: v("Full"), selected: X === "round", onSelect: () =>
|
|
11986
|
+
/* @__PURE__ */ A(rf, { img: MA.female.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () => nA("flat"), onHover: () => J(v("A flatter midsection with minimal protrusion")), onLeave: () => J("") }),
|
|
11987
|
+
/* @__PURE__ */ A(rf, { img: MA.female.stomach.average, label: v("Average"), selected: X === "average", onSelect: () => nA("average"), onHover: () => J(v("A moderate, natural midsection shape")), onLeave: () => J("") }),
|
|
11988
|
+
/* @__PURE__ */ A(rf, { img: MA.female.stomach.round, label: v("Full"), selected: X === "round", onSelect: () => nA("round"), onHover: () => J(v("A fuller, more rounded midsection")), onLeave: () => J("") })
|
|
11980
11989
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
11981
|
-
/* @__PURE__ */ A(rf, { img: MA.male.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () =>
|
|
11982
|
-
/* @__PURE__ */ A(rf, { img: MA.male.stomach.average, label: v("Average"), selected: X === "average", onSelect: () =>
|
|
11983
|
-
/* @__PURE__ */ A(rf, { img: MA.male.stomach.round, label: v("Full"), selected: X === "round", onSelect: () =>
|
|
11990
|
+
/* @__PURE__ */ A(rf, { img: MA.male.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () => nA("flat"), onHover: () => J(v("A flatter midsection with minimal protrusion")), onLeave: () => J("") }),
|
|
11991
|
+
/* @__PURE__ */ A(rf, { img: MA.male.stomach.average, label: v("Average"), selected: X === "average", onSelect: () => nA("average"), onHover: () => J(v("A moderate, natural midsection shape")), onLeave: () => J("") }),
|
|
11992
|
+
/* @__PURE__ */ A(rf, { img: MA.male.stomach.round, label: v("Full"), selected: X === "round", onSelect: () => nA("round"), onHover: () => J(v("A fuller, more rounded midsection")), onLeave: () => J("") })
|
|
11984
11993
|
] }) }),
|
|
11985
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
11994
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
11986
11995
|
] }, "step-midsection")),
|
|
11987
11996
|
O === "seat" && (K ? /* @__PURE__ */ A(
|
|
11988
11997
|
iP,
|
|
@@ -11999,7 +12008,7 @@ function z8({
|
|
|
11999
12008
|
{ value: "average", label: v("Average"), img: MA.male.seat.average },
|
|
12000
12009
|
{ value: "full", label: v("Full"), img: MA.male.seat.full }
|
|
12001
12010
|
],
|
|
12002
|
-
selected:
|
|
12011
|
+
selected: zA,
|
|
12003
12012
|
onSelect: (M) => YA(M),
|
|
12004
12013
|
t: v
|
|
12005
12014
|
},
|
|
@@ -12007,15 +12016,15 @@ function z8({
|
|
|
12007
12016
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
12008
12017
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your seat?") }),
|
|
12009
12018
|
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(tA, { children: [
|
|
12010
|
-
/* @__PURE__ */ A(rf, { img: MA.female.seat.narrow, label: v("Flat"), selected:
|
|
12011
|
-
/* @__PURE__ */ A(rf, { img: MA.female.seat.average, label: v("Average"), selected:
|
|
12012
|
-
/* @__PURE__ */ A(rf, { img: MA.female.seat.full, label: v("Full"), selected:
|
|
12019
|
+
/* @__PURE__ */ A(rf, { img: MA.female.seat.narrow, label: v("Flat"), selected: zA === "narrow", onSelect: () => YA("narrow"), onHover: () => J(v("A flatter backside with less projection")), onLeave: () => J("") }),
|
|
12020
|
+
/* @__PURE__ */ A(rf, { img: MA.female.seat.average, label: v("Average"), selected: zA === "average", onSelect: () => YA("average"), onHover: () => J(v("A moderate, natural backside shape")), onLeave: () => J("") }),
|
|
12021
|
+
/* @__PURE__ */ A(rf, { img: MA.female.seat.full, label: v("Full"), selected: zA === "full", onSelect: () => YA("full"), onHover: () => J(v("A fuller, more rounded backside")), onLeave: () => J("") })
|
|
12013
12022
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
12014
|
-
/* @__PURE__ */ A(rf, { img: MA.male.seat.narrow, label: v("Flat"), selected:
|
|
12015
|
-
/* @__PURE__ */ A(rf, { img: MA.male.seat.average, label: v("Average"), selected:
|
|
12016
|
-
/* @__PURE__ */ A(rf, { img: MA.male.seat.full, label: v("Full"), selected:
|
|
12023
|
+
/* @__PURE__ */ A(rf, { img: MA.male.seat.narrow, label: v("Flat"), selected: zA === "narrow", onSelect: () => YA("narrow"), onHover: () => J(v("A flatter backside with less projection")), onLeave: () => J("") }),
|
|
12024
|
+
/* @__PURE__ */ A(rf, { img: MA.male.seat.average, label: v("Average"), selected: zA === "average", onSelect: () => YA("average"), onHover: () => J(v("A moderate, natural backside shape")), onLeave: () => J("") }),
|
|
12025
|
+
/* @__PURE__ */ A(rf, { img: MA.male.seat.full, label: v("Full"), selected: zA === "full", onSelect: () => YA("full"), onHover: () => J(v("A fuller, more rounded backside")), onLeave: () => J("") })
|
|
12017
12026
|
] }) }),
|
|
12018
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12027
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
12019
12028
|
] }, "step-seat")),
|
|
12020
12029
|
O === "hips" && g && (K ? /* @__PURE__ */ A(
|
|
12021
12030
|
iP,
|
|
@@ -12028,7 +12037,7 @@ function z8({
|
|
|
12028
12037
|
{ value: "average", label: v("Average"), img: MA.female.hips.average },
|
|
12029
12038
|
{ value: "full", label: v("Curvy"), img: MA.female.hips.full }
|
|
12030
12039
|
],
|
|
12031
|
-
selected:
|
|
12040
|
+
selected: H,
|
|
12032
12041
|
onSelect: (M) => oA(M),
|
|
12033
12042
|
t: v
|
|
12034
12043
|
},
|
|
@@ -12036,11 +12045,11 @@ function z8({
|
|
|
12036
12045
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
12037
12046
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your hips?") }),
|
|
12038
12047
|
/* @__PURE__ */ P("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: [
|
|
12039
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.narrow, label: v("Narrow"), selected:
|
|
12040
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.average, label: v("Average"), selected:
|
|
12041
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.full, label: v("Curvy"), selected:
|
|
12048
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.narrow, label: v("Narrow"), selected: H === "narrow", onSelect: () => oA("narrow"), onHover: () => J(v("Hips closer to shoulder width")), onLeave: () => J("") }),
|
|
12049
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.average, label: v("Average"), selected: H === "average", onSelect: () => oA("average"), onHover: () => J(v("Hips proportionate to shoulders")), onLeave: () => J("") }),
|
|
12050
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.full, label: v("Curvy"), selected: H === "full", onSelect: () => oA("full"), onHover: () => J(v("Hips wider than shoulders")), onLeave: () => J("") })
|
|
12042
12051
|
] }),
|
|
12043
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12052
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
12044
12053
|
] }, "step-hips")),
|
|
12045
12054
|
O === "bra" && g && /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-bra-step", children: [
|
|
12046
12055
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Select your bra size") }),
|
|
@@ -12074,11 +12083,11 @@ function z8({
|
|
|
12074
12083
|
M
|
|
12075
12084
|
)) })
|
|
12076
12085
|
] }),
|
|
12077
|
-
|
|
12078
|
-
const M = H8(
|
|
12086
|
+
gA && FA && (() => {
|
|
12087
|
+
const M = H8(gA, FA, AA);
|
|
12079
12088
|
return /* @__PURE__ */ P("span", { className: "ps-bp-bra-inline-result", children: [
|
|
12080
12089
|
/* @__PURE__ */ P("strong", { children: [
|
|
12081
|
-
|
|
12090
|
+
gA,
|
|
12082
12091
|
FA
|
|
12083
12092
|
] }),
|
|
12084
12093
|
M && /* @__PURE__ */ P("span", { children: [
|
|
@@ -12092,7 +12101,7 @@ function z8({
|
|
|
12092
12101
|
/* @__PURE__ */ A("div", { className: "ps-bp-bra-grid", children: x.map((M) => /* @__PURE__ */ A(
|
|
12093
12102
|
"button",
|
|
12094
12103
|
{
|
|
12095
|
-
className: `ps-bp-bra-btn${
|
|
12104
|
+
className: `ps-bp-bra-btn${gA === M ? " ps-bp-bra-btn-selected" : ""}`,
|
|
12096
12105
|
onClick: () => Bf(M),
|
|
12097
12106
|
type: "button",
|
|
12098
12107
|
children: M
|
|
@@ -12116,7 +12125,7 @@ function z8({
|
|
|
12116
12125
|
q && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: q })
|
|
12117
12126
|
] }, "step-bra"),
|
|
12118
12127
|
!(K && O === "basics") && (() => {
|
|
12119
|
-
const M = O === "basics" && F && !!h,
|
|
12128
|
+
const M = O === "basics" && F && !!h, cA = M ? h : $A, pA = xf(vA) ? ` (${xf(vA)})` : "", tf = M ? v("Find My Best Fit") + pA : vf ? v("Find My Size") + pA : v("Next");
|
|
12120
12129
|
return /* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
12121
12130
|
O !== "basics" ? /* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: yA, type: "button", children: [
|
|
12122
12131
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
@@ -12127,7 +12136,7 @@ function z8({
|
|
|
12127
12136
|
"button",
|
|
12128
12137
|
{
|
|
12129
12138
|
className: `ps-bp-next-btn${!M && !KA ? " ps-bp-btn-disabled" : ""}`,
|
|
12130
|
-
onClick:
|
|
12139
|
+
onClick: cA,
|
|
12131
12140
|
disabled: !M && !KA,
|
|
12132
12141
|
type: "button",
|
|
12133
12142
|
children: tf
|
|
@@ -12155,7 +12164,7 @@ function SP({
|
|
|
12155
12164
|
formRef: i,
|
|
12156
12165
|
sizingUnit: o,
|
|
12157
12166
|
setSizingUnit: r,
|
|
12158
|
-
setSizingMethod:
|
|
12167
|
+
setSizingMethod: z,
|
|
12159
12168
|
setSizingLoading: p,
|
|
12160
12169
|
setView: T,
|
|
12161
12170
|
submitSizing: F,
|
|
@@ -12163,37 +12172,37 @@ function SP({
|
|
|
12163
12172
|
onBack: W,
|
|
12164
12173
|
t
|
|
12165
12174
|
}) {
|
|
12166
|
-
const k = e === "close-up", u = NP(), [v, I] = j("manual"), [O,
|
|
12167
|
-
const
|
|
12168
|
-
return n.forEach((
|
|
12169
|
-
|
|
12170
|
-
}),
|
|
12171
|
-
}), [K, E] = j(""),
|
|
12172
|
-
const
|
|
12173
|
-
if (!
|
|
12174
|
-
const TA = URL.createObjectURL(
|
|
12175
|
-
y(
|
|
12175
|
+
const k = e === "close-up", u = NP(), [v, I] = j("manual"), [O, N] = j(() => {
|
|
12176
|
+
const m = {};
|
|
12177
|
+
return n.forEach((EA) => {
|
|
12178
|
+
m[EA.key] = i.current[EA.key] || "";
|
|
12179
|
+
}), m;
|
|
12180
|
+
}), [K, E] = j(""), BA = iA(null), [c, hA] = j(null), [l, y] = j(null), [XA, sA] = j(null), [V, s] = j(null), PA = UA(async (m) => {
|
|
12181
|
+
const EA = m.target.files?.[0];
|
|
12182
|
+
if (!EA) return;
|
|
12183
|
+
const TA = URL.createObjectURL(EA);
|
|
12184
|
+
y(EA), hA(TA);
|
|
12176
12185
|
try {
|
|
12177
|
-
const bA = await AP(
|
|
12186
|
+
const bA = await AP(EA);
|
|
12178
12187
|
sA(bA);
|
|
12179
12188
|
} catch {
|
|
12180
12189
|
}
|
|
12181
|
-
}, []), RA =
|
|
12190
|
+
}, []), RA = UA(() => {
|
|
12182
12191
|
c && URL.revokeObjectURL(c), y(null), hA(null), sA(null);
|
|
12183
|
-
}, [c]), mA = (
|
|
12184
|
-
|
|
12192
|
+
}, [c]), mA = (m, EA) => {
|
|
12193
|
+
N((TA) => ({ ...TA, [m]: EA })), E("");
|
|
12185
12194
|
}, dA = () => {
|
|
12186
|
-
const
|
|
12187
|
-
if (!
|
|
12188
|
-
const
|
|
12189
|
-
if (!
|
|
12190
|
-
E(t("Please enter your ") + t(
|
|
12195
|
+
const m = n[0];
|
|
12196
|
+
if (!m) return;
|
|
12197
|
+
const EA = parseFloat(O[m.key] || "");
|
|
12198
|
+
if (!EA || EA <= 0) {
|
|
12199
|
+
E(t("Please enter your ") + t(m.label).toLowerCase());
|
|
12191
12200
|
return;
|
|
12192
12201
|
}
|
|
12193
12202
|
n.forEach((TA) => {
|
|
12194
12203
|
const bA = parseFloat(O[TA.key] || "");
|
|
12195
12204
|
bA > 0 && (i.current[TA.key] = String(bA));
|
|
12196
|
-
}), i.current.gender = i.current.gender || "male",
|
|
12205
|
+
}), i.current.gender = i.current.gender || "male", z("exact"), p(!0), T("size-result"), F("exact");
|
|
12197
12206
|
}, ZA = () => {
|
|
12198
12207
|
if (V !== !0) {
|
|
12199
12208
|
E(t("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
@@ -12212,7 +12221,7 @@ function SP({
|
|
|
12212
12221
|
weightUnit: "kg",
|
|
12213
12222
|
gender: i.current.gender || "male"
|
|
12214
12223
|
});
|
|
12215
|
-
}, Hf = g.find((
|
|
12224
|
+
}, Hf = g.find((m) => m.value === o)?.label || g[0].label;
|
|
12216
12225
|
return u && v === "photo" ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
12217
12226
|
Zn,
|
|
12218
12227
|
{
|
|
@@ -12224,43 +12233,43 @@ function SP({
|
|
|
12224
12233
|
error: K,
|
|
12225
12234
|
photoVariant: e,
|
|
12226
12235
|
ageConfirmed: V,
|
|
12227
|
-
onAgeConfirmedChange: (
|
|
12228
|
-
s(
|
|
12236
|
+
onAgeConfirmedChange: (m) => {
|
|
12237
|
+
s(m), m === !0 && E("");
|
|
12229
12238
|
},
|
|
12230
12239
|
t
|
|
12231
12240
|
}
|
|
12232
12241
|
) }) : u ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ P("div", { className: "ps-bpm-root", children: [
|
|
12233
12242
|
/* @__PURE__ */ A("div", { className: "ps-bpm-header", children: /* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: t(f) }) }),
|
|
12234
|
-
/* @__PURE__ */ A("div", { className: "ps-bpm-toggle", style: { padding: "0 4%" }, children: g.map((
|
|
12243
|
+
/* @__PURE__ */ A("div", { className: "ps-bpm-toggle", style: { padding: "0 4%" }, children: g.map((m) => /* @__PURE__ */ A(
|
|
12235
12244
|
"button",
|
|
12236
12245
|
{
|
|
12237
12246
|
type: "button",
|
|
12238
|
-
className: `ps-bpm-toggle-btn${o ===
|
|
12239
|
-
onClick: () => r(
|
|
12240
|
-
children: t(
|
|
12247
|
+
className: `ps-bpm-toggle-btn${o === m.value ? " ps-bpm-toggle-active" : ""}`,
|
|
12248
|
+
onClick: () => r(m.value),
|
|
12249
|
+
children: t(m.label)
|
|
12241
12250
|
},
|
|
12242
|
-
|
|
12251
|
+
m.value
|
|
12243
12252
|
)) }),
|
|
12244
12253
|
/* @__PURE__ */ P("div", { style: { padding: "0 4%" }, children: [
|
|
12245
|
-
n.map((
|
|
12246
|
-
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: t(
|
|
12254
|
+
n.map((m) => /* @__PURE__ */ P("div", { className: "ps-bpm-row", children: [
|
|
12255
|
+
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: t(m.label).toUpperCase() }),
|
|
12247
12256
|
/* @__PURE__ */ P("div", { className: "ps-bpm-inline-group", children: [
|
|
12248
12257
|
/* @__PURE__ */ A(
|
|
12249
12258
|
"input",
|
|
12250
12259
|
{
|
|
12251
12260
|
type: "number",
|
|
12252
12261
|
className: "ps-bpm-value-input",
|
|
12253
|
-
value: O[
|
|
12254
|
-
onChange: (
|
|
12255
|
-
placeholder:
|
|
12256
|
-
step:
|
|
12257
|
-
min:
|
|
12258
|
-
max:
|
|
12262
|
+
value: O[m.key],
|
|
12263
|
+
onChange: (EA) => mA(m.key, EA.target.value),
|
|
12264
|
+
placeholder: m.placeholder[o] || m.placeholder.cm || m.placeholder.in || "",
|
|
12265
|
+
step: m.step ?? 0.5,
|
|
12266
|
+
min: m.min,
|
|
12267
|
+
max: m.max
|
|
12259
12268
|
}
|
|
12260
12269
|
),
|
|
12261
12270
|
/* @__PURE__ */ A("span", { className: "ps-bpm-unit", children: Hf.toLowerCase() })
|
|
12262
12271
|
] })
|
|
12263
|
-
] },
|
|
12272
|
+
] }, m.key)),
|
|
12264
12273
|
K && /* @__PURE__ */ A("p", { className: "ps-acc-error", style: { paddingTop: 8 }, children: K })
|
|
12265
12274
|
] }),
|
|
12266
12275
|
/* @__PURE__ */ A("div", { style: { flex: 1, minHeight: 16 } }),
|
|
@@ -12301,7 +12310,7 @@ function SP({
|
|
|
12301
12310
|
"div",
|
|
12302
12311
|
{
|
|
12303
12312
|
onClick: () => {
|
|
12304
|
-
!c && V === !0 &&
|
|
12313
|
+
!c && V === !0 && BA.current?.click();
|
|
12305
12314
|
},
|
|
12306
12315
|
style: {
|
|
12307
12316
|
flex: 1,
|
|
@@ -12321,8 +12330,8 @@ function SP({
|
|
|
12321
12330
|
},
|
|
12322
12331
|
children: c ? /* @__PURE__ */ P(tA, { children: [
|
|
12323
12332
|
/* @__PURE__ */ A("img", { src: c, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
12324
|
-
/* @__PURE__ */ A("button", { onClick: (
|
|
12325
|
-
|
|
12333
|
+
/* @__PURE__ */ A("button", { onClick: (m) => {
|
|
12334
|
+
m.stopPropagation(), RA();
|
|
12326
12335
|
}, style: { position: "absolute", top: "0.5vw", right: "0.5vw", width: "1.4vw", height: "1.4vw", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "none", color: "#fff", fontSize: "0.7vw", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }, children: "×" })
|
|
12327
12336
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
12328
12337
|
/* @__PURE__ */ A(zP, { size: 32 }),
|
|
@@ -12548,7 +12557,7 @@ function SP({
|
|
|
12548
12557
|
] })
|
|
12549
12558
|
] })
|
|
12550
12559
|
] }),
|
|
12551
|
-
/* @__PURE__ */ A("input", { ref:
|
|
12560
|
+
/* @__PURE__ */ A("input", { ref: BA, type: "file", accept: "image/*", style: { display: "none" }, onChange: PA }),
|
|
12552
12561
|
K && /* @__PURE__ */ A("p", { className: "ps-bp-error", style: { padding: "0 1.5vw" }, children: K }),
|
|
12553
12562
|
/* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
12554
12563
|
/* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: () => I("manual"), type: "button", children: [
|
|
@@ -12567,35 +12576,35 @@ function SP({
|
|
|
12567
12576
|
/* ── Manual step — identical structure to BodyProfileView basics step ── */
|
|
12568
12577
|
/* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter", children: [
|
|
12569
12578
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: t(f) }),
|
|
12570
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-system-toggle", children: g.map((
|
|
12579
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-system-toggle", children: g.map((m) => /* @__PURE__ */ A(
|
|
12571
12580
|
"button",
|
|
12572
12581
|
{
|
|
12573
12582
|
type: "button",
|
|
12574
|
-
className: `ps-bp-system-btn${o ===
|
|
12575
|
-
onClick: () => r(
|
|
12576
|
-
children: t(
|
|
12583
|
+
className: `ps-bp-system-btn${o === m.value ? " ps-bp-system-active" : ""}`,
|
|
12584
|
+
onClick: () => r(m.value),
|
|
12585
|
+
children: t(m.label)
|
|
12577
12586
|
},
|
|
12578
|
-
|
|
12587
|
+
m.value
|
|
12579
12588
|
)) }),
|
|
12580
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-inline-fields", children: n.map((
|
|
12581
|
-
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: t(
|
|
12589
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-inline-fields", children: n.map((m) => /* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
12590
|
+
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: t(m.label).toUpperCase() }),
|
|
12582
12591
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
12583
12592
|
/* @__PURE__ */ A(
|
|
12584
12593
|
"input",
|
|
12585
12594
|
{
|
|
12586
12595
|
type: "number",
|
|
12587
12596
|
className: "ps-bp-inline-input",
|
|
12588
|
-
value: O[
|
|
12589
|
-
onChange: (
|
|
12590
|
-
placeholder:
|
|
12591
|
-
step:
|
|
12592
|
-
min:
|
|
12593
|
-
max:
|
|
12597
|
+
value: O[m.key],
|
|
12598
|
+
onChange: (EA) => mA(m.key, EA.target.value),
|
|
12599
|
+
placeholder: m.placeholder[o] || m.placeholder.cm || m.placeholder.in || "",
|
|
12600
|
+
step: m.step ?? 0.5,
|
|
12601
|
+
min: m.min,
|
|
12602
|
+
max: m.max
|
|
12594
12603
|
}
|
|
12595
12604
|
),
|
|
12596
12605
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: Hf.toLowerCase() })
|
|
12597
12606
|
] })
|
|
12598
|
-
] },
|
|
12607
|
+
] }, m.key)) }),
|
|
12599
12608
|
K && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: K }),
|
|
12600
12609
|
!B && /* @__PURE__ */ P("button", { className: "ps-bp-photo-cta", onClick: () => I("photo"), type: "button", children: [
|
|
12601
12610
|
/* @__PURE__ */ A(Un, {}),
|
|
@@ -12778,7 +12787,7 @@ function R8({
|
|
|
12778
12787
|
buttonIcon: i,
|
|
12779
12788
|
locale: o,
|
|
12780
12789
|
buttonStyles: r = {},
|
|
12781
|
-
modalStyles:
|
|
12790
|
+
modalStyles: z = {},
|
|
12782
12791
|
classNames: p = {},
|
|
12783
12792
|
className: T,
|
|
12784
12793
|
style: F,
|
|
@@ -12790,29 +12799,29 @@ function R8({
|
|
|
12790
12799
|
onError: v,
|
|
12791
12800
|
sizeGuideData: I
|
|
12792
12801
|
}) {
|
|
12793
|
-
const O = g || f, [
|
|
12802
|
+
const O = g || f, [N, K] = j(() => o || "");
|
|
12794
12803
|
JA(() => {
|
|
12795
12804
|
o !== void 0 && K(o);
|
|
12796
12805
|
}, [o]);
|
|
12797
|
-
const E =
|
|
12806
|
+
const E = wf(() => Hg(N || void 0), [N]), BA = e ?? E("Virtual Try-On"), [c, hA] = j(!1);
|
|
12798
12807
|
JA(() => {
|
|
12799
12808
|
hA(!0);
|
|
12800
12809
|
}, []);
|
|
12801
|
-
const [l, y] = j("idle"), [XA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA, dA] = j(null), [ZA, Hf] = j(!1), [
|
|
12810
|
+
const [l, y] = j("idle"), [XA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA, dA] = j(null), [ZA, Hf] = j(!1), [m, EA] = j(!1), [TA, bA] = j(null), [VA, kA] = j(null), [vA, SA] = j(null), [ff, rA] = j(!1), [nf, xA] = j(!1), [Ef, eA] = j(!1), [$, _A] = j(null), [Of, cf] = j(!1), Mf = iA(!1), [gf, qA] = j(Xg), GA = Yn(gf), [_, uA] = j(GA ? "in" : "cm"), [WA, a] = j(GA ? "in" : "cm"), [X, nA] = j(GA ? "lbs" : "kg");
|
|
12802
12811
|
JA(() => {
|
|
12803
12812
|
const w = Xf(n);
|
|
12804
12813
|
w === "foot" || w === "head" ? uA("cm") : w === "face" && uA("mm");
|
|
12805
12814
|
}, [n]);
|
|
12806
|
-
const
|
|
12815
|
+
const H = iA({}), [oA, zA] = j("male"), [YA, of] = j(0), [J, gA] = j(null), [Bf, FA] = j(!1), [OA, AA] = j(() => af("profiles", [])), [LA, Pf] = j(() => af("history", [])), [lA, x] = j(() => Kn()), [q, QA] = j(() => /* @__PURE__ */ new Set()), [U, R] = j(null), G = UA((w) => {
|
|
12807
12816
|
x(w), Tg(w);
|
|
12808
12817
|
}, []), [S, aA] = j(!1), [fA, NA] = j(null), [$A, ef] = j(null), yA = iA(null), KA = iA(() => !1), vf = iA(() => {
|
|
12809
|
-
}), M =
|
|
12818
|
+
}), M = UA((w, Q) => {
|
|
12810
12819
|
KA.current = w, vf.current = Q;
|
|
12811
|
-
}, []),
|
|
12820
|
+
}, []), cA = iA(null), pA = iA(null), tf = iA(null), Df = iA(null), IA = iA(null), pf = iA(!1), qn = iA(null), If = iA(null), [Wn, lf] = j(null), [Vn, LP] = j(null), Jf = iA(null);
|
|
12812
12821
|
JA(() => {
|
|
12813
12822
|
try {
|
|
12814
12823
|
const w = bf(), Q = uf(B);
|
|
12815
|
-
|
|
12824
|
+
pA.current = new zg(w, Q), tf.current = new cg(pA.current.getStreamUrl());
|
|
12816
12825
|
} catch {
|
|
12817
12826
|
}
|
|
12818
12827
|
return () => {
|
|
@@ -12881,7 +12890,7 @@ function R8({
|
|
|
12881
12890
|
_A({ found: !1 });
|
|
12882
12891
|
return;
|
|
12883
12892
|
}
|
|
12884
|
-
if (!
|
|
12893
|
+
if (!pA.current) {
|
|
12885
12894
|
_A({ found: !1 });
|
|
12886
12895
|
return;
|
|
12887
12896
|
}
|
|
@@ -12897,7 +12906,7 @@ function R8({
|
|
|
12897
12906
|
_A({ found: !1 });
|
|
12898
12907
|
}).finally(() => cf(!1));
|
|
12899
12908
|
}, [B, n, I]);
|
|
12900
|
-
const $n =
|
|
12909
|
+
const $n = wf(() => {
|
|
12901
12910
|
switch (l) {
|
|
12902
12911
|
case "welcome":
|
|
12903
12912
|
case "body-profile":
|
|
@@ -12912,7 +12921,7 @@ function R8({
|
|
|
12912
12921
|
default:
|
|
12913
12922
|
return 1;
|
|
12914
12923
|
}
|
|
12915
|
-
}, [l]), Zf =
|
|
12924
|
+
}, [l]), Zf = UA(
|
|
12916
12925
|
(w, Q) => {
|
|
12917
12926
|
let Y = lA, wA = OA.find((L) => L.id === Y);
|
|
12918
12927
|
if (!wA) {
|
|
@@ -12966,7 +12975,7 @@ function R8({
|
|
|
12966
12975
|
}
|
|
12967
12976
|
},
|
|
12968
12977
|
[lA, OA, B, f, n, O, G]
|
|
12969
|
-
), UP = iA(null), [qf, EP] = j(null), yP =
|
|
12978
|
+
), UP = iA(null), [qf, EP] = j(null), yP = UA(async (w) => {
|
|
12970
12979
|
const Q = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0, wA = !!w.measurements && Object.keys(w.measurements).length > 0, L = w.photoBase64;
|
|
12971
12980
|
if (!wA && L && Q > 0 && UP.current) {
|
|
12972
12981
|
try {
|
|
@@ -13009,23 +13018,23 @@ function R8({
|
|
|
13009
13018
|
d?.raw && SA(d.raw), xA(!0);
|
|
13010
13019
|
}).catch(() => {
|
|
13011
13020
|
}).finally(() => rA(!1));
|
|
13012
|
-
}, [O, n, f, I, B, V]), _n =
|
|
13021
|
+
}, [O, n, f, I, B, V]), _n = UA(async () => {
|
|
13013
13022
|
const w = OA.find((L) => L.id === lA);
|
|
13014
13023
|
if (!w) return;
|
|
13015
13024
|
const Q = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0;
|
|
13016
13025
|
Q > 0 && Y > 0 && EP(w);
|
|
13017
|
-
}, [OA, lA]), Ag =
|
|
13026
|
+
}, [OA, lA]), Ag = UA(() => {
|
|
13018
13027
|
if (!qf) return;
|
|
13019
13028
|
const w = qf;
|
|
13020
13029
|
EP(null), yP(w);
|
|
13021
|
-
}, [qf, yP]), fg =
|
|
13022
|
-
EP(null),
|
|
13030
|
+
}, [qf, yP]), fg = UA(() => {
|
|
13031
|
+
EP(null), of((w) => w + 1), y("body-profile");
|
|
13023
13032
|
}, []), Pg = iA(() => {
|
|
13024
|
-
}), ng =
|
|
13033
|
+
}), ng = UA(() => {
|
|
13025
13034
|
console.log("[ps-sdk] handleOpen fired — opening modal"), y("body-profile"), h?.();
|
|
13026
|
-
}, [h]), Gf =
|
|
13027
|
-
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1),
|
|
13028
|
-
}, [W, V]), gg =
|
|
13035
|
+
}, [h]), Gf = UA(() => {
|
|
13036
|
+
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), gA(null), FA(!1), aA(!1), H.current = {}, zA("male"), Yf.current = !1, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null), W?.();
|
|
13037
|
+
}, [W, V]), gg = UA(() => {
|
|
13029
13038
|
if (fA) {
|
|
13030
13039
|
NA(null), yA.current && (y(yA.current), yA.current = null);
|
|
13031
13040
|
return;
|
|
@@ -13061,7 +13070,7 @@ function R8({
|
|
|
13061
13070
|
Gf();
|
|
13062
13071
|
break;
|
|
13063
13072
|
}
|
|
13064
|
-
}, [l, fA, TA, Gf]), Bg = l !== "idle" && l !== "processing" && l !== "result" && l !== "welcome" && l !== "body-profile" && l !== "size-result", ZP =
|
|
13073
|
+
}, [l, fA, TA, Gf]), Bg = l !== "idle" && l !== "processing" && l !== "result" && l !== "welcome" && l !== "body-profile" && l !== "size-result", ZP = UA((w) => {
|
|
13065
13074
|
if (!pg(w)) {
|
|
13066
13075
|
dA(E("Please upload a JPEG, PNG, or WebP image.")), y("error"), v?.({ message: "Invalid file type", code: "INVALID_FILE" });
|
|
13067
13076
|
return;
|
|
@@ -13076,11 +13085,11 @@ function R8({
|
|
|
13076
13085
|
If.current = Y;
|
|
13077
13086
|
}).catch(() => {
|
|
13078
13087
|
});
|
|
13079
|
-
}, [t, v]), qP =
|
|
13088
|
+
}, [t, v]), qP = UA(() => {
|
|
13080
13089
|
sA(null), V && URL.revokeObjectURL(V), s(null);
|
|
13081
|
-
}, [V]), Wf =
|
|
13090
|
+
}, [V]), Wf = UA(() => {
|
|
13082
13091
|
IA.current && (clearInterval(IA.current), IA.current = null), Df.current?.(), Df.current = null;
|
|
13083
|
-
}, []), aP =
|
|
13092
|
+
}, []), aP = UA((w) => {
|
|
13084
13093
|
if (w.status === "completed" && w.imageUrl) {
|
|
13085
13094
|
if (RA((Q) => !Q || Q.startsWith("data:") || !w.imageUrl.startsWith("data:") ? w.imageUrl : Q), !pf.current) {
|
|
13086
13095
|
if (pf.current = !0, nP.current = 100, mf.current && (mf.current.style.width = "100%"), Nf.current && (Nf.current.textContent = "100%"), yf.current && (yf.current.style.strokeDashoffset = "0"), Lf.current && (Lf.current.textContent = E("Done")), Sf.current) {
|
|
@@ -13096,17 +13105,17 @@ function R8({
|
|
|
13096
13105
|
const Q = w.error || E("Try-on generation failed");
|
|
13097
13106
|
dA(Q), y("error"), v?.({ message: Q });
|
|
13098
13107
|
}
|
|
13099
|
-
}, [u, v, Wf]), Kf =
|
|
13100
|
-
if (!
|
|
13108
|
+
}, [u, v, Wf]), Kf = wf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields : oA === "female" ? Og : Kg, [$, oA]), Vf = UA(async (w) => {
|
|
13109
|
+
if (!pA.current) return;
|
|
13101
13110
|
const Q = w || VA, Y = uf(B), wA = bf(), L = Xf(n);
|
|
13102
13111
|
if (L === "face" || L === "head") {
|
|
13103
|
-
const d =
|
|
13104
|
-
if (!
|
|
13105
|
-
const Af = parseFloat(
|
|
13112
|
+
const d = H.current, b = (jA) => {
|
|
13113
|
+
if (!jA) return;
|
|
13114
|
+
const Af = parseFloat(jA);
|
|
13106
13115
|
return Number.isFinite(Af) && Af > 0 ? Af : void 0;
|
|
13107
|
-
}, HA = d.sizingUnit || _ || (L === "head" ? "cm" : "mm"), DA = (
|
|
13108
|
-
if (
|
|
13109
|
-
return HA === "mm" ?
|
|
13116
|
+
}, HA = d.sizingUnit || _ || (L === "head" ? "cm" : "mm"), DA = (jA) => {
|
|
13117
|
+
if (jA != null)
|
|
13118
|
+
return HA === "mm" ? jA : HA === "cm" ? jA * 10 : HA === "in" ? jA * 25.4 : jA;
|
|
13110
13119
|
}, CA = {}, zf = {
|
|
13111
13120
|
bridgeWidth: DA(b(d.bridgeWidth)),
|
|
13112
13121
|
templeLength: DA(b(d.templeLength) ?? b(d.armLength)),
|
|
@@ -13118,29 +13127,29 @@ function R8({
|
|
|
13118
13127
|
headCircumference: DA(b(d.headCircumference)),
|
|
13119
13128
|
headWidth: DA(b(d.headWidth))
|
|
13120
13129
|
};
|
|
13121
|
-
for (const [
|
|
13130
|
+
for (const [jA, Af] of Object.entries(zf)) typeof Af == "number" && (CA[jA] = Af);
|
|
13122
13131
|
const df = {
|
|
13123
13132
|
product: { title: n, productId: g },
|
|
13124
13133
|
sizeGuide: $?.found ? $ : { found: !1 },
|
|
13125
13134
|
sizingUnit: L === "head" ? "cm" : "mm",
|
|
13126
13135
|
category: L,
|
|
13127
13136
|
...Object.keys(CA).length > 0 && { faceMeasurementsMm: CA, irisConfidence: 1 }
|
|
13128
|
-
}, Cf = new Promise((
|
|
13137
|
+
}, Cf = new Promise((jA) => setTimeout(jA, 4500));
|
|
13129
13138
|
try {
|
|
13130
|
-
const
|
|
13139
|
+
const jA = await fetch(`${Y}/api/v1/sizing/face-recommend`, {
|
|
13131
13140
|
method: "POST",
|
|
13132
13141
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${wA}` },
|
|
13133
13142
|
body: JSON.stringify(df)
|
|
13134
13143
|
});
|
|
13135
|
-
if (
|
|
13136
|
-
const Af = await
|
|
13144
|
+
if (jA.ok) {
|
|
13145
|
+
const Af = await jA.json();
|
|
13137
13146
|
await Cf, SA(Af), u?.(Af);
|
|
13138
13147
|
} else {
|
|
13139
|
-
const Af = await
|
|
13140
|
-
console.error("[PS-SDK] face-recommend failed:",
|
|
13148
|
+
const Af = await jA.text().catch(() => "");
|
|
13149
|
+
console.error("[PS-SDK] face-recommend failed:", jA.status, Af), await Cf, dA(E("Unable to get size recommendation. Please try again.")), y("error"), xA(!0);
|
|
13141
13150
|
}
|
|
13142
|
-
} catch (
|
|
13143
|
-
console.error("[PS-SDK] face-recommend network error:",
|
|
13151
|
+
} catch (jA) {
|
|
13152
|
+
console.error("[PS-SDK] face-recommend network error:", jA), await Cf, dA(E("Unable to connect to sizing service. Please try again.")), y("error"), xA(!0);
|
|
13144
13153
|
} finally {
|
|
13145
13154
|
rA(!1);
|
|
13146
13155
|
}
|
|
@@ -13151,34 +13160,34 @@ function R8({
|
|
|
13151
13160
|
locale: gf,
|
|
13152
13161
|
product: { title: n, productId: O, description: "", variants: [] }
|
|
13153
13162
|
};
|
|
13154
|
-
if ($?.found && (Z.sizeGuide = $, $.sections && (Z.sizeGuide = { ...$, sections: $.sections })), Z.sizingUnit = _, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: $?.found, hasHeaders: !!$?.headers, hasRows: !!$?.rows, headers: $?.headers, rowCount: $?.rows?.length, hasSections: !!$?.sections, sectionNames: $?.sections ? Object.keys($.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", Z.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", Z.sizeGuide && Z.sizeGuide.rows?.[0] ? Array.isArray(Z.sizeGuide.rows[0]) ? "array" : typeof Z.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(Z).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:", Q, "| sizingUnit:", _, "| heightUnit:", WA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(
|
|
13155
|
-
const d = { gender:
|
|
13163
|
+
if ($?.found && (Z.sizeGuide = $, $.sections && (Z.sizeGuide = { ...$, sections: $.sections })), Z.sizingUnit = _, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: $?.found, hasHeaders: !!$?.headers, hasRows: !!$?.rows, headers: $?.headers, rowCount: $?.rows?.length, hasSections: !!$?.sections, sectionNames: $?.sections ? Object.keys($.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", Z.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", Z.sizeGuide && Z.sizeGuide.rows?.[0] ? Array.isArray(Z.sizeGuide.rows[0]) ? "array" : typeof Z.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(Z).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:", Q, "| sizingUnit:", _, "| heightUnit:", WA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(H.current)), console.log("[PS-SDK] dynamicFields:", Kf.map((d) => `${d.key}(unit=${d.unit},req=${d.required})`).join(", ")), Q === "exact") {
|
|
13164
|
+
const d = { gender: H.current.gender || "male", sizingUnit: _ }, b = /* @__PURE__ */ new Set();
|
|
13156
13165
|
for (const HA of Kf)
|
|
13157
13166
|
HA.unit !== "size" && !["shoeEU", "shoeUS", "shoeUK"].includes(HA.key) && b.add(HA.key);
|
|
13158
13167
|
for (const HA of ["chest", "bust", "waist", "hips", "shoulderWidth", "sleeveLength", "inseam", "neckCircumference", "footLengthCm", "height", "length", "thighCircumference", "headCircumferenceCm", "faceWidthMm", "bridgeWidthMm", "templeLengthMm"])
|
|
13159
|
-
|
|
13168
|
+
H.current[HA] && b.add(HA);
|
|
13160
13169
|
console.log("[PS-SDK] numericKeys:", [...b].join(", "));
|
|
13161
13170
|
for (const HA of b) {
|
|
13162
|
-
const DA =
|
|
13171
|
+
const DA = H.current[HA];
|
|
13163
13172
|
if (!DA) continue;
|
|
13164
13173
|
const CA = parseFloat(DA);
|
|
13165
13174
|
isNaN(CA) || (d[HA] = CA);
|
|
13166
13175
|
}
|
|
13167
|
-
|
|
13176
|
+
H.current.shoeEU && (d.shoeEU = H.current.shoeEU), H.current.shoeUS && (d.shoeUS = H.current.shoeUS), H.current.shoeUK && (d.shoeUK = H.current.shoeUK), H.current.fitPreference && (d.fitPreference = H.current.fitPreference), Z.measurements = d, console.log("[PS-SDK] FINAL measurements:", JSON.stringify(d));
|
|
13168
13177
|
} else {
|
|
13169
|
-
const d = parseFloat(
|
|
13178
|
+
const d = parseFloat(H.current.height || "0"), b = parseFloat(H.current.weight || "0");
|
|
13170
13179
|
if (!d || !b) {
|
|
13171
|
-
console.error("[PS-SDK] submitSizing ABORT — qHeight:", d, "qWeight:", b, "formRef:", JSON.stringify(
|
|
13180
|
+
console.error("[PS-SDK] submitSizing ABORT — qHeight:", d, "qWeight:", b, "formRef:", JSON.stringify(H.current)), rA(!1);
|
|
13172
13181
|
return;
|
|
13173
13182
|
}
|
|
13174
13183
|
const HA = {
|
|
13175
13184
|
height: d,
|
|
13176
13185
|
weight: b,
|
|
13177
|
-
heightUnit:
|
|
13178
|
-
weightUnit:
|
|
13179
|
-
gender:
|
|
13186
|
+
heightUnit: H.current.heightUnit || WA || "cm",
|
|
13187
|
+
weightUnit: H.current.weightUnit || X || "kg",
|
|
13188
|
+
gender: H.current.gender || "male"
|
|
13180
13189
|
};
|
|
13181
|
-
|
|
13190
|
+
H.current.age && (HA.age = parseInt(H.current.age, 10)), H.current.bodyType && (HA.bodyType = H.current.bodyType), H.current.chestProfile && (HA.chestProfile = H.current.chestProfile), H.current.midsectionProfile && (HA.midsectionProfile = H.current.midsectionProfile), H.current.hipProfile && (HA.hipProfile = H.current.hipProfile), Z.quickEstimate = HA;
|
|
13182
13191
|
}
|
|
13183
13192
|
xA(!1);
|
|
13184
13193
|
try {
|
|
@@ -13214,34 +13223,34 @@ function R8({
|
|
|
13214
13223
|
} finally {
|
|
13215
13224
|
rA(!1);
|
|
13216
13225
|
}
|
|
13217
|
-
}, [B, VA, gf, WA, X, _, $, n, Kf, Zf]), eg =
|
|
13218
|
-
if (!
|
|
13219
|
-
const
|
|
13220
|
-
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), dA(
|
|
13226
|
+
}, [B, VA, gf, WA, X, _, $, n, Kf, Zf]), eg = UA(async (w, Q, Y, wA, L, Z, d, b, HA, DA, CA) => {
|
|
13227
|
+
if (!pA.current) {
|
|
13228
|
+
const jA = E("SDK not configured. Please refresh and try again.");
|
|
13229
|
+
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), dA(jA), y("error"), v?.({ message: jA, code: "SDK_NOT_CONFIGURED" });
|
|
13221
13230
|
return;
|
|
13222
13231
|
}
|
|
13223
13232
|
uf(B), bf();
|
|
13224
13233
|
const zf = /* @__PURE__ */ new Set(["weight", "weightKg", "height", "heightCm"]), df = /* @__PURE__ */ new Set();
|
|
13225
13234
|
if ($?.sections) {
|
|
13226
|
-
for (const
|
|
13227
|
-
if (
|
|
13228
|
-
for (const Af of
|
|
13235
|
+
for (const jA of Object.values($.sections))
|
|
13236
|
+
if (jA.requiredFields)
|
|
13237
|
+
for (const Af of jA.requiredFields)
|
|
13229
13238
|
Af.required && Af.unit === "cm" && !zf.has(Af.key) && df.add(Af.key);
|
|
13230
13239
|
}
|
|
13231
|
-
for (const
|
|
13232
|
-
|
|
13240
|
+
for (const jA of Kf)
|
|
13241
|
+
jA.required && jA.unit === "cm" && !zf.has(jA.key) && df.add(jA.key);
|
|
13233
13242
|
const Cf = Array.from(df);
|
|
13234
|
-
if (console.log("[PS-SDK] Quick estimate — dynamicFields:", Kf.map((
|
|
13243
|
+
if (console.log("[PS-SDK] Quick estimate — dynamicFields:", Kf.map((jA) => `${jA.key}(${jA.unit},req=${jA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:", Cf), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: b, midsectionProfile: HA, hipProfile: DA }), Cf.length === 0) {
|
|
13235
13244
|
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), kA("quick"), rA(!0), y("size-result"), Vf("quick");
|
|
13236
13245
|
return;
|
|
13237
13246
|
}
|
|
13238
|
-
|
|
13239
|
-
}, [B, Kf, $, Vf, _, X]), dP =
|
|
13247
|
+
H.current.height = String(w), H.current.weight = String(Q), H.current.heightUnit = Y, H.current.weightUnit = wA, H.current.gender = L, Z && (H.current.age = String(Z)), d && (H.current.bodyType = d), b && (H.current.chestProfile = b), HA && (H.current.midsectionProfile = HA), DA && (H.current.hipProfile = DA), SA(null), RA(null), kA("quick"), rA(!0), y("size-result"), Vf("quick");
|
|
13248
|
+
}, [B, Kf, $, Vf, _, X]), dP = UA(async (w) => {
|
|
13240
13249
|
if (console.log("[ps-sdk] handleSnapSubmit fired", {
|
|
13241
|
-
hasApiRef: !!
|
|
13250
|
+
hasApiRef: !!pA.current,
|
|
13242
13251
|
hasSseRef: !!tf.current,
|
|
13243
13252
|
apiUrl: B
|
|
13244
|
-
}), !
|
|
13253
|
+
}), !pA.current || !tf.current) {
|
|
13245
13254
|
const DA = E("SDK not configured. Please refresh and try again.");
|
|
13246
13255
|
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), dA(DA), y("error"), v?.({ message: DA, code: "SDK_NOT_CONFIGURED" });
|
|
13247
13256
|
return;
|
|
@@ -13347,10 +13356,10 @@ function R8({
|
|
|
13347
13356
|
rA(!1);
|
|
13348
13357
|
}, [B, f, n, _, X, gf, $, Kf, Zf]);
|
|
13349
13358
|
UP.current = dP;
|
|
13350
|
-
const WP =
|
|
13359
|
+
const WP = UA(async (w) => {
|
|
13351
13360
|
const Q = w || XA || Jf.current;
|
|
13352
|
-
if (!Q || !
|
|
13353
|
-
const Z =
|
|
13361
|
+
if (!Q || !pA.current || !tf.current) {
|
|
13362
|
+
const Z = pA.current ? E("Please upload a photo first.") : E("SDK not configured. Please provide an API key.");
|
|
13354
13363
|
dA(Z), y("error"), v?.({ message: Z, code: "SDK_NOT_CONFIGURED" });
|
|
13355
13364
|
return;
|
|
13356
13365
|
}
|
|
@@ -13367,7 +13376,7 @@ function R8({
|
|
|
13367
13376
|
const Z = await AP(Q);
|
|
13368
13377
|
let d;
|
|
13369
13378
|
wA && vA?.matchDetails?.length && (d = xg(vA.matchDetails, If.current));
|
|
13370
|
-
const b = await
|
|
13379
|
+
const b = await pA.current.submitTryOn(
|
|
13371
13380
|
Z,
|
|
13372
13381
|
f,
|
|
13373
13382
|
d,
|
|
@@ -13390,7 +13399,7 @@ function R8({
|
|
|
13390
13399
|
return;
|
|
13391
13400
|
}
|
|
13392
13401
|
try {
|
|
13393
|
-
const DA = await
|
|
13402
|
+
const DA = await pA.current.getStatus(b.jobId);
|
|
13394
13403
|
(DA.status === "completed" || DA.status === "failed") && aP({ galleryId: b.jobId, status: DA.status, imageUrl: DA.imageUrl, error: DA.status === "failed" ? DA.message : null, timestamp: Date.now() });
|
|
13395
13404
|
} catch {
|
|
13396
13405
|
}
|
|
@@ -13399,9 +13408,9 @@ function R8({
|
|
|
13399
13408
|
const d = Z instanceof Error ? Z.message : E("Failed to start try-on"), b = Z instanceof an ? Z.code : void 0;
|
|
13400
13409
|
dA(d), y("error"), v?.({ message: d, code: b });
|
|
13401
13410
|
}
|
|
13402
|
-
}, [XA, f, n, vA, k, v, aP]), og =
|
|
13403
|
-
if (!XA || !
|
|
13404
|
-
|
|
13411
|
+
}, [XA, f, n, vA, k, v, aP]), og = UA(async (w) => {
|
|
13412
|
+
if (!XA || !pA.current || !tf.current) return;
|
|
13413
|
+
EA(!0);
|
|
13405
13414
|
const Q = En(Xf(n)), Y = Q === "apparel";
|
|
13406
13415
|
if (Y && If.current) {
|
|
13407
13416
|
const wA = {
|
|
@@ -13421,7 +13430,7 @@ function R8({
|
|
|
13421
13430
|
}
|
|
13422
13431
|
try {
|
|
13423
13432
|
pf.current = !1, Df.current?.(), IA.current && (clearInterval(IA.current), IA.current = null);
|
|
13424
|
-
const wA = await AP(XA), L = Y ? w : void 0, Z = await
|
|
13433
|
+
const wA = await AP(XA), L = Y ? w : void 0, Z = await pA.current.submitTryOn(
|
|
13425
13434
|
wA,
|
|
13426
13435
|
f,
|
|
13427
13436
|
L,
|
|
@@ -13433,7 +13442,7 @@ function R8({
|
|
|
13433
13442
|
}
|
|
13434
13443
|
);
|
|
13435
13444
|
Df.current = tf.current.onJob(Z.jobId, (b) => {
|
|
13436
|
-
b.status === "completed" && b.imageUrl ? (RA(b.imageUrl),
|
|
13445
|
+
b.status === "completed" && b.imageUrl ? (RA(b.imageUrl), EA(!1), pf.current = !0, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (EA(!1), pf.current = !0, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null));
|
|
13437
13446
|
});
|
|
13438
13447
|
let d = 0;
|
|
13439
13448
|
IA.current = setInterval(async () => {
|
|
@@ -13442,19 +13451,19 @@ function R8({
|
|
|
13442
13451
|
return;
|
|
13443
13452
|
}
|
|
13444
13453
|
if (d++, d > 60) {
|
|
13445
|
-
IA.current && clearInterval(IA.current), IA.current = null,
|
|
13454
|
+
IA.current && clearInterval(IA.current), IA.current = null, EA(!1);
|
|
13446
13455
|
return;
|
|
13447
13456
|
}
|
|
13448
13457
|
try {
|
|
13449
|
-
const b = await
|
|
13450
|
-
b.status === "completed" && b.imageUrl ? (pf.current || (pf.current = !0, RA(b.imageUrl),
|
|
13458
|
+
const b = await pA.current.getStatus(Z.jobId);
|
|
13459
|
+
b.status === "completed" && b.imageUrl ? (pf.current || (pf.current = !0, RA(b.imageUrl), EA(!1), Df.current?.(), Df.current = null), IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (pf.current = !0, EA(!1), IA.current && (clearInterval(IA.current), IA.current = null));
|
|
13451
13460
|
} catch {
|
|
13452
13461
|
}
|
|
13453
13462
|
}, 3e3);
|
|
13454
13463
|
} catch {
|
|
13455
|
-
|
|
13464
|
+
EA(!1);
|
|
13456
13465
|
}
|
|
13457
|
-
}, [XA, f, n]), wg =
|
|
13466
|
+
}, [XA, f, n]), wg = UA(() => {
|
|
13458
13467
|
if (PA)
|
|
13459
13468
|
if (PA.startsWith("data:")) {
|
|
13460
13469
|
const w = document.createElement("a");
|
|
@@ -13464,9 +13473,9 @@ function R8({
|
|
|
13464
13473
|
const Q = URL.createObjectURL(w), Y = document.createElement("a");
|
|
13465
13474
|
Y.href = Q, Y.download = `primestyle-tryon-${Date.now()}.png`, Y.click(), setTimeout(() => URL.revokeObjectURL(Q), 100);
|
|
13466
13475
|
}).catch(() => window.open(PA, "_blank"));
|
|
13467
|
-
}, [PA]), vg =
|
|
13476
|
+
}, [PA]), vg = UA(() => {
|
|
13468
13477
|
pf.current = !1, Wf(), sA(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), aA(!1), y("body-profile");
|
|
13469
|
-
}, [V, Wf]), Dg =
|
|
13478
|
+
}, [V, Wf]), Dg = UA((w) => {
|
|
13470
13479
|
const Q = OA.find((wA) => wA.id === w);
|
|
13471
13480
|
if (!Q) return;
|
|
13472
13481
|
G(w), AA((wA) => wA.map((L) => L.id === w ? { ...L, lastUsedAt: Date.now() } : L));
|
|
@@ -13474,28 +13483,28 @@ function R8({
|
|
|
13474
13483
|
if ((Q.height ?? Q.heightCm) && (Y.height = String(Q.height ?? Q.heightCm)), (Q.weight ?? Q.weightKg) && (Y.weight = String(Q.weight ?? Q.weightKg)), Q.chest && (Y.chest = String(Q.chest)), Q.bust && (Y.bust = String(Q.bust)), Q.waist && (Y.waist = String(Q.waist)), Q.hips && (Y.hips = String(Q.hips)), Q.shoulderWidth && (Y.shoulderWidth = String(Q.shoulderWidth)), Q.sleeveLength && (Y.sleeveLength = String(Q.sleeveLength)), Q.inseam && (Y.inseam = String(Q.inseam)), Q.neckCircumference && (Y.neckCircumference = String(Q.neckCircumference)), Q.footLengthCm && (Y.footLengthCm = String(Q.footLengthCm)), Q.shoeEU && (Y.shoeEU = Q.shoeEU), Q.shoeUS && (Y.shoeUS = Q.shoeUS), Q.shoeUK && (Y.shoeUK = Q.shoeUK), Q.fitPreference && (Y.fitPreference = Q.fitPreference), Q.customMeasurements)
|
|
13475
13484
|
for (const [wA, L] of Object.entries(Q.customMeasurements))
|
|
13476
13485
|
Y[wA] = String(L);
|
|
13477
|
-
|
|
13486
|
+
H.current = Y, zA(Y.gender || "male"), Q.country && qA(Q.country), Q.sizingUnit && uA(Q.sizingUnit), Q.heightUnit && a(Q.heightUnit), Q.weightUnit && nA(Q.weightUnit), of((wA) => wA + 1);
|
|
13478
13487
|
}, [OA]);
|
|
13479
|
-
Pg.current = Dg,
|
|
13488
|
+
Pg.current = Dg, UA((w, Q) => {
|
|
13480
13489
|
const Y = (Q ? null : lA) || `p_${Date.now()}`, wA = {
|
|
13481
13490
|
id: Y,
|
|
13482
13491
|
name: w,
|
|
13483
|
-
gender:
|
|
13484
|
-
height:
|
|
13485
|
-
weight:
|
|
13486
|
-
chest:
|
|
13487
|
-
bust:
|
|
13488
|
-
waist:
|
|
13489
|
-
hips:
|
|
13490
|
-
shoulderWidth:
|
|
13491
|
-
sleeveLength:
|
|
13492
|
-
inseam:
|
|
13493
|
-
neckCircumference:
|
|
13494
|
-
footLengthCm:
|
|
13495
|
-
shoeEU:
|
|
13496
|
-
shoeUS:
|
|
13497
|
-
shoeUK:
|
|
13498
|
-
fitPreference:
|
|
13492
|
+
gender: H.current.gender || "male",
|
|
13493
|
+
height: H.current.height ? parseFloat(H.current.height) : void 0,
|
|
13494
|
+
weight: H.current.weight ? parseFloat(H.current.weight) : void 0,
|
|
13495
|
+
chest: H.current.chest ? parseFloat(H.current.chest) : void 0,
|
|
13496
|
+
bust: H.current.bust ? parseFloat(H.current.bust) : void 0,
|
|
13497
|
+
waist: H.current.waist ? parseFloat(H.current.waist) : void 0,
|
|
13498
|
+
hips: H.current.hips ? parseFloat(H.current.hips) : void 0,
|
|
13499
|
+
shoulderWidth: H.current.shoulderWidth ? parseFloat(H.current.shoulderWidth) : void 0,
|
|
13500
|
+
sleeveLength: H.current.sleeveLength ? parseFloat(H.current.sleeveLength) : void 0,
|
|
13501
|
+
inseam: H.current.inseam ? parseFloat(H.current.inseam) : void 0,
|
|
13502
|
+
neckCircumference: H.current.neckCircumference ? parseFloat(H.current.neckCircumference) : void 0,
|
|
13503
|
+
footLengthCm: H.current.footLengthCm ? parseFloat(H.current.footLengthCm) : void 0,
|
|
13504
|
+
shoeEU: H.current.shoeEU,
|
|
13505
|
+
shoeUS: H.current.shoeUS,
|
|
13506
|
+
shoeUK: H.current.shoeUK,
|
|
13507
|
+
fitPreference: H.current.fitPreference,
|
|
13499
13508
|
country: gf,
|
|
13500
13509
|
sizingUnit: _,
|
|
13501
13510
|
heightUnit: WA,
|
|
@@ -13521,7 +13530,7 @@ function R8({
|
|
|
13521
13530
|
"heightFeet",
|
|
13522
13531
|
"heightInches"
|
|
13523
13532
|
]), Z = {};
|
|
13524
|
-
for (const [d, b] of Object.entries(
|
|
13533
|
+
for (const [d, b] of Object.entries(H.current))
|
|
13525
13534
|
!L.has(d) && b && !isNaN(Number(b)) && (Z[d] = parseFloat(b));
|
|
13526
13535
|
Object.keys(Z).length > 0 && (wA.customMeasurements = Z), AA((d) => {
|
|
13527
13536
|
const b = d.findIndex((HA) => HA.id === Y);
|
|
@@ -13532,7 +13541,7 @@ function R8({
|
|
|
13532
13541
|
return [...d, wA].slice(-50);
|
|
13533
13542
|
}), G(Y), aA(!0);
|
|
13534
13543
|
}, [lA, gf, _, WA, X]);
|
|
13535
|
-
const VP =
|
|
13544
|
+
const VP = UA(() => {
|
|
13536
13545
|
const w = {
|
|
13537
13546
|
id: `h_${Date.now()}`,
|
|
13538
13547
|
productTitle: n,
|
|
@@ -13563,7 +13572,7 @@ function R8({
|
|
|
13563
13572
|
JA(() => {
|
|
13564
13573
|
l === "size-result" && vA && !Yf.current ? (Yf.current = !0, gP.current = !1, VP()) : l === "size-result" && vA && PA && !gP.current ? (gP.current = !0, Pf((w) => w.length === 0 ? w : [{ ...w[0], resultImageUrl: PA }, ...w.slice(1)])) : l === "result" && PA && !Yf.current ? (Yf.current = !0, VP()) : (l === "welcome" || l === "body-profile") && (Yf.current = !1, gP.current = !1);
|
|
13565
13574
|
}, [l, vA, PA]);
|
|
13566
|
-
const Cg =
|
|
13575
|
+
const Cg = UA((w) => {
|
|
13567
13576
|
Yf.current = !0, w.sizingResult ? SA(w.sizingResult) : w.recommendedSize && SA({
|
|
13568
13577
|
recommendedSize: w.recommendedSize,
|
|
13569
13578
|
confidence: w.confidence || "high",
|
|
@@ -13571,10 +13580,10 @@ function R8({
|
|
|
13571
13580
|
internationalSizes: w.internationalSizes,
|
|
13572
13581
|
matchDetails: w.matchDetails
|
|
13573
13582
|
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), rA(!1), eA(!1), bA(null), NA(null), y("size-result");
|
|
13574
|
-
}, []), ig =
|
|
13575
|
-
|
|
13583
|
+
}, []), ig = UA((w, Q) => {
|
|
13584
|
+
H.current[w] = Q;
|
|
13576
13585
|
}, []);
|
|
13577
|
-
|
|
13586
|
+
wf(() => {
|
|
13578
13587
|
const Q = {
|
|
13579
13588
|
US: { key: "shoeUS", labelKey: "Shoe size (US)", ph: "e.g. 10" },
|
|
13580
13589
|
UK: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" },
|
|
@@ -13598,47 +13607,47 @@ function R8({
|
|
|
13598
13607
|
"--ps-btn-icon-size": r.iconSize,
|
|
13599
13608
|
"--ps-btn-icon-color": r.iconColor,
|
|
13600
13609
|
"--ps-btn-shadow": r.boxShadow,
|
|
13601
|
-
"--ps-modal-overlay":
|
|
13602
|
-
"--ps-modal-bg":
|
|
13603
|
-
"--ps-modal-color":
|
|
13604
|
-
"--ps-modal-radius":
|
|
13605
|
-
"--ps-modal-width":
|
|
13606
|
-
"--ps-modal-max-width":
|
|
13607
|
-
"--ps-modal-font":
|
|
13608
|
-
"--ps-modal-header-bg":
|
|
13609
|
-
"--ps-modal-header-color":
|
|
13610
|
-
"--ps-modal-close-color":
|
|
13611
|
-
"--ps-upload-border":
|
|
13612
|
-
"--ps-upload-bg":
|
|
13613
|
-
"--ps-upload-color":
|
|
13614
|
-
"--ps-upload-icon-color":
|
|
13615
|
-
"--ps-modal-primary-bg":
|
|
13616
|
-
"--ps-modal-primary-color":
|
|
13617
|
-
"--ps-modal-primary-radius":
|
|
13618
|
-
"--ps-loader":
|
|
13619
|
-
"--ps-result-radius":
|
|
13610
|
+
"--ps-modal-overlay": z.overlayColor,
|
|
13611
|
+
"--ps-modal-bg": z.backgroundColor,
|
|
13612
|
+
"--ps-modal-color": z.textColor,
|
|
13613
|
+
"--ps-modal-radius": z.borderRadius,
|
|
13614
|
+
"--ps-modal-width": z.width,
|
|
13615
|
+
"--ps-modal-max-width": z.maxWidth,
|
|
13616
|
+
"--ps-modal-font": z.fontFamily,
|
|
13617
|
+
"--ps-modal-header-bg": z.headerBackgroundColor,
|
|
13618
|
+
"--ps-modal-header-color": z.headerTextColor,
|
|
13619
|
+
"--ps-modal-close-color": z.closeButtonColor,
|
|
13620
|
+
"--ps-upload-border": z.uploadBorderColor,
|
|
13621
|
+
"--ps-upload-bg": z.uploadBackgroundColor,
|
|
13622
|
+
"--ps-upload-color": z.uploadTextColor,
|
|
13623
|
+
"--ps-upload-icon-color": z.uploadIconColor,
|
|
13624
|
+
"--ps-modal-primary-bg": z.primaryButtonBackgroundColor,
|
|
13625
|
+
"--ps-modal-primary-color": z.primaryButtonTextColor,
|
|
13626
|
+
"--ps-modal-primary-radius": z.primaryButtonBorderRadius,
|
|
13627
|
+
"--ps-loader": z.loaderColor,
|
|
13628
|
+
"--ps-result-radius": z.resultBorderRadius,
|
|
13620
13629
|
// New theming variables.
|
|
13621
13630
|
// accentColor falls back to the trigger button background so the user's
|
|
13622
13631
|
// brand color cascades to the modal automatically without having to pass
|
|
13623
13632
|
// both buttonStyles AND modalStyles. Most consumers only set buttonStyles.
|
|
13624
|
-
"--ps-accent":
|
|
13625
|
-
"--ps-accent-hover":
|
|
13626
|
-
"--ps-accent-light":
|
|
13627
|
-
"--ps-text-primary":
|
|
13628
|
-
"--ps-text-secondary":
|
|
13629
|
-
"--ps-text-muted":
|
|
13630
|
-
"--ps-border-color":
|
|
13631
|
-
"--ps-bg-secondary":
|
|
13632
|
-
"--ps-error-color":
|
|
13633
|
-
"--ps-success-color":
|
|
13634
|
-
"--ps-logo-height":
|
|
13633
|
+
"--ps-accent": z.accentColor ?? r.backgroundColor,
|
|
13634
|
+
"--ps-accent-hover": z.accentHoverColor ?? r.hoverBackgroundColor,
|
|
13635
|
+
"--ps-accent-light": z.accentLightColor,
|
|
13636
|
+
"--ps-text-primary": z.textPrimaryColor,
|
|
13637
|
+
"--ps-text-secondary": z.textSecondaryColor,
|
|
13638
|
+
"--ps-text-muted": z.textMutedColor,
|
|
13639
|
+
"--ps-border-color": z.borderColor,
|
|
13640
|
+
"--ps-bg-secondary": z.secondaryBackgroundColor,
|
|
13641
|
+
"--ps-error-color": z.errorColor,
|
|
13642
|
+
"--ps-success-color": z.successColor,
|
|
13643
|
+
"--ps-logo-height": z.logoHeight
|
|
13635
13644
|
}, $P = Object.fromEntries(Object.entries(tg).filter(([, w]) => w !== void 0));
|
|
13636
13645
|
function rg() {
|
|
13637
13646
|
switch (l) {
|
|
13638
13647
|
case "welcome":
|
|
13639
13648
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(BB, { productImage: f, setView: y, t: E }) }, "v-welcome");
|
|
13640
13649
|
case "body-profile": {
|
|
13641
|
-
const w = Xf(n), Q = { productImage: f, productTitle: n, formRef:
|
|
13650
|
+
const w = Xf(n), Q = { productImage: f, productTitle: n, formRef: H, sizingUnit: _, setSizingUnit: uA, setSizingMethod: kA, setSizingLoading: rA, setView: y, submitSizing: Vf, onSnapSubmit: dP, onBack: Gf, sizeGuide: $, t: E };
|
|
13642
13651
|
if (w === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(j8, { ...Q }) }, "v-foot");
|
|
13643
13652
|
if (w === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(a8, { ...Q }) }, "v-head");
|
|
13644
13653
|
if (w === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(I8, { ...Q }) }, "v-face");
|
|
@@ -13649,12 +13658,12 @@ function R8({
|
|
|
13649
13658
|
productImage: f,
|
|
13650
13659
|
productTitle: n,
|
|
13651
13660
|
isWomen: Y || L,
|
|
13652
|
-
formRef:
|
|
13661
|
+
formRef: H,
|
|
13653
13662
|
sizingCountry: gf,
|
|
13654
13663
|
heightUnit: WA,
|
|
13655
13664
|
setHeightUnit: a,
|
|
13656
13665
|
weightUnit: X,
|
|
13657
|
-
setWeightUnit:
|
|
13666
|
+
setWeightUnit: nA,
|
|
13658
13667
|
sizingUnit: _,
|
|
13659
13668
|
setSizingUnit: uA,
|
|
13660
13669
|
hasActiveProfileWithMeasurements: (() => {
|
|
@@ -13667,10 +13676,10 @@ function R8({
|
|
|
13667
13676
|
activeProfileName: OA.find((b) => b.id === lA)?.name || null,
|
|
13668
13677
|
activeProfile: OA.find((d) => d.id === lA) || null,
|
|
13669
13678
|
onStartFresh: () => {
|
|
13670
|
-
G(null),
|
|
13679
|
+
G(null), H.current = {};
|
|
13671
13680
|
},
|
|
13672
13681
|
onComplete: (d) => {
|
|
13673
|
-
|
|
13682
|
+
H.current.gender = d.gender, d.bandSize && (H.current.bandSize = d.bandSize), d.cupSize && (H.current.cupSize = d.cupSize), eg(
|
|
13674
13683
|
d.height,
|
|
13675
13684
|
d.weight,
|
|
13676
13685
|
d.heightUnit,
|
|
@@ -13697,13 +13706,13 @@ function R8({
|
|
|
13697
13706
|
{
|
|
13698
13707
|
productImage: f,
|
|
13699
13708
|
productTitle: n,
|
|
13700
|
-
estimatedValues:
|
|
13709
|
+
estimatedValues: J,
|
|
13701
13710
|
estimationLoading: Bf,
|
|
13702
13711
|
dynamicFields: Kf,
|
|
13703
|
-
formRef:
|
|
13712
|
+
formRef: H,
|
|
13704
13713
|
formGender: oA,
|
|
13705
13714
|
formKey: YA,
|
|
13706
|
-
setFormKey:
|
|
13715
|
+
setFormKey: of,
|
|
13707
13716
|
sizingUnit: _,
|
|
13708
13717
|
setSizingUnit: uA,
|
|
13709
13718
|
updateField: ig,
|
|
@@ -13729,7 +13738,7 @@ function R8({
|
|
|
13729
13738
|
setView: y,
|
|
13730
13739
|
handleDownload: wg,
|
|
13731
13740
|
onRetryWithFit: og,
|
|
13732
|
-
retryLoading:
|
|
13741
|
+
retryLoading: m,
|
|
13733
13742
|
selectedFile: XA,
|
|
13734
13743
|
previewUrl: V,
|
|
13735
13744
|
handleFileSelect: ZP,
|
|
@@ -13764,7 +13773,7 @@ function R8({
|
|
|
13764
13773
|
previewUrl: V,
|
|
13765
13774
|
dragOver: ZA,
|
|
13766
13775
|
setDragOver: Hf,
|
|
13767
|
-
fileInputRef:
|
|
13776
|
+
fileInputRef: cA,
|
|
13768
13777
|
handleFileSelect: ZP,
|
|
13769
13778
|
handleRemovePreview: qP,
|
|
13770
13779
|
handleTryOnSubmit: WP,
|
|
@@ -13860,8 +13869,8 @@ function R8({
|
|
|
13860
13869
|
if (FP(Q.id, CA.estimates, CA.unit), CA.userEstimates) {
|
|
13861
13870
|
const zf = af("profiles", []), df = zf.findIndex((Cf) => Cf.id === Q.id);
|
|
13862
13871
|
if (df >= 0) {
|
|
13863
|
-
const Cf = zf[df],
|
|
13864
|
-
|
|
13872
|
+
const Cf = zf[df], jA = CA.userEstimates, Af = { ...Cf };
|
|
13873
|
+
jA.height && !(Cf.height || Cf.heightCm) && (Af.height = jA.height, Af.heightCm = jA.height, Af.heightUnit = "cm"), jA.weight && !(Cf.weight || Cf.weightKg) && (Af.weight = jA.weight, Af.weightKg = jA.weight, Af.weightUnit = "kg"), jA.age && !Cf.age && (Af.age = jA.age), zf[df] = Af, sf("profiles", zf);
|
|
13865
13874
|
}
|
|
13866
13875
|
}
|
|
13867
13876
|
AA(af("profiles", []));
|
|
@@ -13908,14 +13917,14 @@ function R8({
|
|
|
13908
13917
|
type: "button",
|
|
13909
13918
|
children: [
|
|
13910
13919
|
D !== !1 && (i || /* @__PURE__ */ A(hf, {})),
|
|
13911
|
-
/* @__PURE__ */ A("span", { children:
|
|
13920
|
+
/* @__PURE__ */ A("span", { children: BA })
|
|
13912
13921
|
]
|
|
13913
13922
|
}
|
|
13914
13923
|
),
|
|
13915
13924
|
l !== "idle" && typeof document < "u" && lP(
|
|
13916
13925
|
/* @__PURE__ */ A("div", { className: Qf("ps-tryon-overlay", p.overlay), style: $P, "data-ps-tryon-portal": !0, children: /* @__PURE__ */ P("div", { className: Qf(`ps-tryon-modal${l === "result" && PA && vA || l === "size-result" || l === "estimation-review" || l === "body-profile" || l === "profiles" ? " ps-tryon-modal-wide" : ""}`, p.modal), onClick: (w) => w.stopPropagation(), children: [
|
|
13917
13926
|
/* @__PURE__ */ P("div", { className: Qf("ps-tryon-header ps-tryon-header-minimal", p.header), children: [
|
|
13918
|
-
/* @__PURE__ */ A(_g, { activeLocale:
|
|
13927
|
+
/* @__PURE__ */ A(_g, { activeLocale: N, onSelect: K }),
|
|
13919
13928
|
/* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: E("Profiles"), onClick: () => {
|
|
13920
13929
|
fA && NA(null), l === "profiles" ? (y(yA.current || "body-profile"), yA.current = null) : (yA.current = l, y("profiles"));
|
|
13921
13930
|
}, children: /* @__PURE__ */ A(mP, {}) }),
|
|
@@ -13992,10 +14001,10 @@ function G8(f) {
|
|
|
13992
14001
|
const [n, g] = j(null), [e, B] = j(!0), [C, D] = j(!1), [i, o] = j(0);
|
|
13993
14002
|
return JA(() => {
|
|
13994
14003
|
let r = !1;
|
|
13995
|
-
return B(!0), D(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: f.productId }), Gn(f).then((
|
|
13996
|
-
r || (
|
|
13997
|
-
}).catch((
|
|
13998
|
-
console.log("[ps-sdk:hook] usePrimeStyleSize threw",
|
|
14004
|
+
return B(!0), D(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: f.productId }), Gn(f).then((z) => {
|
|
14005
|
+
r || (z === null ? (console.log("[ps-sdk:hook] usePrimeStyleSize → null (no profile or recommendation failed)"), D(!0), g(null)) : (console.log("[ps-sdk:hook] usePrimeStyleSize → result", { recommendedSize: z.recommendedSize, hasRaw: !!z.raw }), g(z)));
|
|
14006
|
+
}).catch((z) => {
|
|
14007
|
+
console.log("[ps-sdk:hook] usePrimeStyleSize threw", z), r || g(null);
|
|
13999
14008
|
}).finally(() => {
|
|
14000
14009
|
r || B(!1);
|
|
14001
14010
|
}), () => {
|
|
@@ -14003,7 +14012,7 @@ function G8(f) {
|
|
|
14003
14012
|
};
|
|
14004
14013
|
}, [f.productId, f.apiUrl, f.apiKey, i]), JA(() => {
|
|
14005
14014
|
if (typeof window > "u") return;
|
|
14006
|
-
const r = () => o((
|
|
14015
|
+
const r = () => o((z) => z + 1);
|
|
14007
14016
|
return window.addEventListener(fP, r), window.addEventListener("storage", r), () => {
|
|
14008
14017
|
window.removeEventListener(fP, r), window.removeEventListener("storage", r);
|
|
14009
14018
|
};
|