@primestyleai/tryon 5.10.13 → 5.10.15
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 +808 -799
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +17 -3
- 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,11 +31,11 @@ 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,
|
|
34
|
+
const e = g.landmarks[0], B = e[sP], C = e[TP], D = e[GP], i = e[YP], o = (B.y + C.y) / 2, Q = (D.y + i.y) / 2, z = Q - 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 + (Q - 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:
|
|
38
|
-
hips: { y:
|
|
37
|
+
waist: { y: u, x1: O, x2: N },
|
|
38
|
+
hips: { y: Q, x1: t, x2: k }
|
|
39
39
|
};
|
|
40
40
|
} catch (n) {
|
|
41
41
|
return console.error("[PS-SDK] Pose detection failed:", n), null;
|
|
@@ -134,8 +134,8 @@ function Ug(f) {
|
|
|
134
134
|
}
|
|
135
135
|
function Dn(f, n, g) {
|
|
136
136
|
if (f.length < 4) return 0;
|
|
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),
|
|
138
|
-
return (o +
|
|
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), Q = Math.hypot(C.x - i.x, C.y - i.y);
|
|
138
|
+
return (o + Q) / 2;
|
|
139
139
|
}
|
|
140
140
|
function Eg(f) {
|
|
141
141
|
if (f.length < 478) return null;
|
|
@@ -166,11 +166,11 @@ 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,
|
|
169
|
+
) * i, Q = 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,
|
|
173
|
-
pd: Rf(
|
|
173
|
+
pd: Rf(Q),
|
|
174
174
|
bridgeWidth: Rf(p),
|
|
175
175
|
faceWidth: Rf(T),
|
|
176
176
|
templeLengthLeft: Rf(F),
|
|
@@ -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((
|
|
262
|
+
(o) => D.map((Q, z) => `${Q} ${o[z] ?? "—"}`).join(", ")
|
|
263
263
|
);
|
|
264
264
|
g.sizeChartSummary = i.join(" | ");
|
|
265
265
|
}
|
|
@@ -490,7 +490,7 @@ async function Gn(f) {
|
|
|
490
490
|
}
|
|
491
491
|
if (!o || !o.recommendedSize)
|
|
492
492
|
return n("recommend returned no recommendedSize — bailing"), null;
|
|
493
|
-
const
|
|
493
|
+
const Q = o.sections ? Object.fromEntries(
|
|
494
494
|
Object.entries(o.sections).map(([p, T]) => [p, T.recommendedSize])
|
|
495
495
|
) : void 0, z = o.sections ? Object.fromEntries(
|
|
496
496
|
Object.entries(o.sections).map(([p, T]) => [
|
|
@@ -511,14 +511,14 @@ async function Gn(f) {
|
|
|
511
511
|
productImage: f.productImage,
|
|
512
512
|
recommendedSize: o.recommendedSize,
|
|
513
513
|
confidence: o.confidence,
|
|
514
|
-
sections:
|
|
514
|
+
sections: Q,
|
|
515
515
|
sectionsFull: z,
|
|
516
516
|
recommendedLength: o.recommendedLength || void 0,
|
|
517
517
|
savedAt: Date.now()
|
|
518
518
|
}), {
|
|
519
519
|
recommendedSize: o.recommendedSize,
|
|
520
520
|
confidence: o.confidence,
|
|
521
|
-
sections:
|
|
521
|
+
sections: Q,
|
|
522
522
|
profileId: g.id,
|
|
523
523
|
fromCache: !1,
|
|
524
524
|
raw: o,
|
|
@@ -6786,21 +6786,21 @@ 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",
|
|
6789
|
+
const [g, e] = j(!1), B = iA(null), C = iA(null), [D, i] = j({ top: 0, right: 0 }), o = _P[f] || "English", Q = UA(() => {
|
|
6790
6790
|
if (!B.current) return;
|
|
6791
6791
|
const z = B.current.getBoundingClientRect();
|
|
6792
6792
|
i({ top: z.bottom + 4, right: window.innerWidth - z.right });
|
|
6793
6793
|
}, []);
|
|
6794
6794
|
return JA(() => {
|
|
6795
6795
|
if (!g) return;
|
|
6796
|
-
|
|
6796
|
+
Q();
|
|
6797
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", z), window.addEventListener("resize",
|
|
6801
|
-
document.removeEventListener("mousedown", z), window.removeEventListener("resize",
|
|
6800
|
+
return document.addEventListener("mousedown", z), window.addEventListener("resize", Q), window.addEventListener("scroll", Q, !0), () => {
|
|
6801
|
+
document.removeEventListener("mousedown", z), window.removeEventListener("resize", Q), window.removeEventListener("scroll", Q, !0);
|
|
6802
6802
|
};
|
|
6803
|
-
}, [g,
|
|
6803
|
+
}, [g, Q]), /* @__PURE__ */ P(tA, { children: [
|
|
6804
6804
|
/* @__PURE__ */ P(
|
|
6805
6805
|
"button",
|
|
6806
6806
|
{
|
|
@@ -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,
|
|
6868
|
+
const [B, C] = j(f?.name || ""), [D, i] = j(f?.gender || "male"), [o, Q] = 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"]) {
|
|
@@ -6931,7 +6931,7 @@ function un({
|
|
|
6931
6931
|
{
|
|
6932
6932
|
type: "button",
|
|
6933
6933
|
className: `ps-tryon-pe-pill-btn${o === "cm" ? " ps-active" : ""}`,
|
|
6934
|
-
onClick: () =>
|
|
6934
|
+
onClick: () => Q("cm"),
|
|
6935
6935
|
children: "cm"
|
|
6936
6936
|
}
|
|
6937
6937
|
),
|
|
@@ -6940,7 +6940,7 @@ function un({
|
|
|
6940
6940
|
{
|
|
6941
6941
|
type: "button",
|
|
6942
6942
|
className: `ps-tryon-pe-pill-btn${o === "in" ? " ps-active" : ""}`,
|
|
6943
|
-
onClick: () =>
|
|
6943
|
+
onClick: () => Q("in"),
|
|
6944
6944
|
children: "in"
|
|
6945
6945
|
}
|
|
6946
6946
|
)
|
|
@@ -6984,7 +6984,7 @@ function PB({
|
|
|
6984
6984
|
restoreHistory: i,
|
|
6985
6985
|
t: o
|
|
6986
6986
|
}) {
|
|
6987
|
-
const [
|
|
6987
|
+
const [Q, 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 = {
|
|
@@ -6999,10 +6999,10 @@ function PB({
|
|
|
6999
6999
|
/* @__PURE__ */ A("button", { className: "ps-tryon-drawer-back", onClick: () => {
|
|
7000
7000
|
z(!1), n(null);
|
|
7001
7001
|
}, children: /* @__PURE__ */ A(kg, {}) }),
|
|
7002
|
-
/* @__PURE__ */ A("span", { className: "ps-tryon-drawer-title", children: o(
|
|
7003
|
-
f === "profiles" && !
|
|
7002
|
+
/* @__PURE__ */ A("span", { className: "ps-tryon-drawer-title", children: o(Q ? "New Profile" : f === "profiles" ? "My Profiles" : "History") }),
|
|
7003
|
+
f === "profiles" && !Q && /* @__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" &&
|
|
7005
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: f === "profiles" && Q ? /* @__PURE__ */ A(un, { onSave: T, onCancel: () => z(!1), t: o }) : f === "profiles" ? /* @__PURE__ */ P(tA, { children: [
|
|
7006
7006
|
/* @__PURE__ */ P("button", { className: "ps-tryon-drawer-create", onClick: () => z(!0), children: [
|
|
7007
7007
|
"+ ",
|
|
7008
7008
|
o("Create New Profile")
|
|
@@ -7067,7 +7067,7 @@ function nB({
|
|
|
7067
7067
|
};
|
|
7068
7068
|
}, [f]), !f || typeof document > "u") return null;
|
|
7069
7069
|
const D = (o) => {
|
|
7070
|
-
g((
|
|
7070
|
+
g((Q) => Q.map(
|
|
7071
7071
|
(z) => z.id === f.id ? {
|
|
7072
7072
|
...z,
|
|
7073
7073
|
...o,
|
|
@@ -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}` : "—",
|
|
7124
|
+
}, o = (p) => p ? `${Math.round(p)} ${C}` : "—", Q = 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",
|
|
@@ -7163,7 +7163,7 @@ function gB({
|
|
|
7163
7163
|
}, children: [
|
|
7164
7164
|
/* @__PURE__ */ P("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
|
|
7165
7165
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: e("Height") }),
|
|
7166
|
-
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: i(
|
|
7166
|
+
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: i(Q) })
|
|
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") }),
|
|
@@ -7224,7 +7224,7 @@ function eB({
|
|
|
7224
7224
|
formGender: D,
|
|
7225
7225
|
sizingUnit: i,
|
|
7226
7226
|
setSizingUnit: o,
|
|
7227
|
-
formKey:
|
|
7227
|
+
formKey: Q,
|
|
7228
7228
|
setFormKey: z,
|
|
7229
7229
|
updateField: p,
|
|
7230
7230
|
setSizingMethod: T,
|
|
@@ -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",
|
|
@@ -7270,7 +7270,7 @@ function eB({
|
|
|
7270
7270
|
}
|
|
7271
7271
|
)
|
|
7272
7272
|
] }) }, O.key);
|
|
7273
|
-
}) }, `est-${
|
|
7273
|
+
}) }, `est-${Q}`),
|
|
7274
7274
|
/* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
7275
7275
|
/* @__PURE__ */ P("button", { type: "button", className: "ps-bp-back-btn", onClick: () => h("body-profile"), children: [
|
|
7276
7276
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
@@ -7405,8 +7405,8 @@ function iB({ t: f }) {
|
|
|
7405
7405
|
return JA(() => {
|
|
7406
7406
|
n.current = Date.now();
|
|
7407
7407
|
const D = setInterval(() => {
|
|
7408
|
-
const i = (Date.now() - n.current) / 1e3, o = Math.min(95, i / wP * 100),
|
|
7409
|
-
if (e.current && (e.current.style.width = `${
|
|
7408
|
+
const i = (Date.now() - n.current) / 1e3, o = Math.min(95, i / wP * 100), Q = Math.round(o);
|
|
7409
|
+
if (e.current && (e.current.style.width = `${Q}%`), C.current && (C.current.textContent = `${Q}%`), g.current && (g.current.style.strokeDashoffset = String(IP * (1 - o / 100))), B.current) {
|
|
7410
7410
|
const z = Math.max(0, wP - Math.floor(i));
|
|
7411
7411
|
B.current.textContent = i >= wP ? "•••" : `~${z}s`;
|
|
7412
7412
|
}
|
|
@@ -7444,7 +7444,7 @@ function rn({
|
|
|
7444
7444
|
onSwitchToManual: C,
|
|
7445
7445
|
t: D
|
|
7446
7446
|
}) {
|
|
7447
|
-
const i = f || n || "", o = !!f,
|
|
7447
|
+
const i = f || n || "", o = !!f, Q = B ? [
|
|
7448
7448
|
{ title: D("GENERATING TRY-ON"), desc: D("Rendering the garment on your photo."), viewfinderText: D("GENERATING") },
|
|
7449
7449
|
{ title: D("REFINING DETAILS"), desc: D("Fine-tuning fit, drape and shadows."), viewfinderText: D("REFINING") },
|
|
7450
7450
|
{ title: D("ALMOST THERE"), desc: D("Final compositing in progress."), viewfinderText: D("COMPOSITING") },
|
|
@@ -7466,13 +7466,13 @@ function rn({
|
|
|
7466
7466
|
}, [F, h] = j(0);
|
|
7467
7467
|
JA(() => {
|
|
7468
7468
|
const k = setInterval(() => {
|
|
7469
|
-
h((u) => (u + 1) %
|
|
7469
|
+
h((u) => (u + 1) % Q.length);
|
|
7470
7470
|
}, B ? 2200 : 1500);
|
|
7471
7471
|
return () => clearInterval(k);
|
|
7472
|
-
}, [
|
|
7472
|
+
}, [Q.length, B]), JA(() => {
|
|
7473
7473
|
o && g && F === 0 && h(1);
|
|
7474
7474
|
}, [g]);
|
|
7475
|
-
const W =
|
|
7475
|
+
const W = Q[F] ?? Q[0];
|
|
7476
7476
|
return /* @__PURE__ */ P("div", { className: "ps-msc-root", children: [
|
|
7477
7477
|
/* @__PURE__ */ P("div", { className: "ps-msc-viewfinder", children: [
|
|
7478
7478
|
i && /* @__PURE__ */ A(
|
|
@@ -7531,7 +7531,7 @@ function HB({
|
|
|
7531
7531
|
onTryOn: D,
|
|
7532
7532
|
tryOnProcessing: i,
|
|
7533
7533
|
resultImageUrl: o,
|
|
7534
|
-
tryOnDone:
|
|
7534
|
+
tryOnDone: Q,
|
|
7535
7535
|
onTryAgain: z,
|
|
7536
7536
|
onClose: p,
|
|
7537
7537
|
overlayNode: T,
|
|
@@ -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
|
},
|
|
@@ -7628,7 +7628,7 @@ function HB({
|
|
|
7628
7628
|
);
|
|
7629
7629
|
}) })
|
|
7630
7630
|
] }),
|
|
7631
|
-
/* @__PURE__ */ A("div", { className: "ps-msr-bottom", children:
|
|
7631
|
+
/* @__PURE__ */ A("div", { className: "ps-msr-bottom", children: Q ? /* @__PURE__ */ P("div", { className: "ps-msr-bottom-row", children: [
|
|
7632
7632
|
/* @__PURE__ */ A(
|
|
7633
7633
|
"button",
|
|
7634
7634
|
{
|
|
@@ -7692,10 +7692,10 @@ 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(),
|
|
7695
|
+
const o = g.current || Date.now(), Q = (Date.now() - o) / 1e3, z = Math.min(95, Q / vP * 100), p = Math.round(z);
|
|
7696
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
|
-
const T = Math.max(0, vP - Math.floor(
|
|
7698
|
-
C.current.textContent =
|
|
7697
|
+
const T = Math.max(0, vP - Math.floor(Q));
|
|
7698
|
+
C.current.textContent = Q >= vP ? "•••" : `~${T}s`;
|
|
7699
7699
|
}
|
|
7700
7700
|
}, 200);
|
|
7701
7701
|
return () => clearInterval(i);
|
|
@@ -7756,7 +7756,7 @@ function cB({
|
|
|
7756
7756
|
[f.leftMouth, f.rightMouth]
|
|
7757
7757
|
];
|
|
7758
7758
|
return /* @__PURE__ */ P("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${e} ${B}`, preserveAspectRatio: "xMidYMid meet", children: [
|
|
7759
|
-
D.map(([i, o],
|
|
7759
|
+
D.map(([i, o], Q) => /* @__PURE__ */ A(
|
|
7760
7760
|
"line",
|
|
7761
7761
|
{
|
|
7762
7762
|
x1: i.x * e,
|
|
@@ -7767,12 +7767,12 @@ function cB({
|
|
|
7767
7767
|
strokeWidth: "3",
|
|
7768
7768
|
strokeLinecap: "round",
|
|
7769
7769
|
opacity: "0",
|
|
7770
|
-
style: { animation: `ps-pose-fade 0.4s ease ${
|
|
7770
|
+
style: { animation: `ps-pose-fade 0.4s ease ${Q * 0.05}s forwards` }
|
|
7771
7771
|
},
|
|
7772
|
-
`fl-${
|
|
7772
|
+
`fl-${Q}`
|
|
7773
7773
|
)),
|
|
7774
7774
|
[f.leftIrisCenter, f.rightIrisCenter].map((i, o) => {
|
|
7775
|
-
const
|
|
7775
|
+
const Q = o === 0 ? f.leftIrisRing : f.rightIrisRing, z = Q?.length ? Math.abs((Q[0]?.x ?? i.x) - (Q[2]?.x ?? i.x)) * e / 2 : 6;
|
|
7776
7776
|
return /* @__PURE__ */ A(
|
|
7777
7777
|
"circle",
|
|
7778
7778
|
{
|
|
@@ -7788,7 +7788,7 @@ function cB({
|
|
|
7788
7788
|
`iris-${o}`
|
|
7789
7789
|
);
|
|
7790
7790
|
}),
|
|
7791
|
-
C.map(({ key: i, p: o },
|
|
7791
|
+
C.map(({ key: i, p: o }, Q) => /* @__PURE__ */ P("g", { children: [
|
|
7792
7792
|
/* @__PURE__ */ A(
|
|
7793
7793
|
"circle",
|
|
7794
7794
|
{
|
|
@@ -7797,7 +7797,7 @@ function cB({
|
|
|
7797
7797
|
r: "11",
|
|
7798
7798
|
fill: "rgba(100,210,255,0.22)",
|
|
7799
7799
|
opacity: "0",
|
|
7800
|
-
style: { animation: `ps-pose-fade 0.3s ease ${
|
|
7800
|
+
style: { animation: `ps-pose-fade 0.3s ease ${Q * 0.04}s forwards` }
|
|
7801
7801
|
}
|
|
7802
7802
|
),
|
|
7803
7803
|
/* @__PURE__ */ A(
|
|
@@ -7808,7 +7808,7 @@ function cB({
|
|
|
7808
7808
|
r: "6",
|
|
7809
7809
|
fill: "rgba(100,210,255,0.95)",
|
|
7810
7810
|
opacity: "0",
|
|
7811
|
-
style: { animation: `ps-pose-fade 0.3s ease ${
|
|
7811
|
+
style: { animation: `ps-pose-fade 0.3s ease ${Q * 0.04}s forwards, ps-dot-pulse 1.5s ease-in-out ${0.5 + Q * 0.04}s infinite` }
|
|
7812
7812
|
}
|
|
7813
7813
|
)
|
|
7814
7814
|
] }, i))
|
|
@@ -7845,7 +7845,7 @@ 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, [
|
|
7848
|
+
], i = g ? D : C, o = g ? !!e : n, [Q, z] = j(0);
|
|
7849
7849
|
JA(() => {
|
|
7850
7850
|
z(0);
|
|
7851
7851
|
}, [g]), JA(() => {
|
|
@@ -7855,12 +7855,12 @@ function pB({
|
|
|
7855
7855
|
}, g ? 2200 : 900);
|
|
7856
7856
|
return () => clearInterval(F);
|
|
7857
7857
|
}, [o, i.length, g]);
|
|
7858
|
-
const p = i[
|
|
7858
|
+
const p = i[Q] ?? i[0];
|
|
7859
7859
|
return /* @__PURE__ */ P("div", { className: "ps-msc-stage", style: { alignSelf: "center", marginTop: "auto", marginBottom: "auto" }, children: [
|
|
7860
7860
|
/* @__PURE__ */ P("div", { className: "ps-msc-stage-slot", children: [
|
|
7861
7861
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children: p.title }),
|
|
7862
7862
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage-desc", children: p.desc })
|
|
7863
|
-
] }, `${g ? "t" : "s"}-${
|
|
7863
|
+
] }, `${g ? "t" : "s"}-${Q}`),
|
|
7864
7864
|
g && /* @__PURE__ */ A(kn, { t: B, isActive: !!g })
|
|
7865
7865
|
] });
|
|
7866
7866
|
}
|
|
@@ -7868,14 +7868,14 @@ function Qn({ landmarks: f, imgWidth: n, imgHeight: g }) {
|
|
|
7868
7868
|
const e = n, B = g;
|
|
7869
7869
|
return /* @__PURE__ */ P("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${e} ${B}`, preserveAspectRatio: "xMidYMid meet", children: [
|
|
7870
7870
|
zB.map(([C, D], i) => {
|
|
7871
|
-
const o = f[C],
|
|
7872
|
-
return !o || !
|
|
7871
|
+
const o = f[C], Q = f[D];
|
|
7872
|
+
return !o || !Q || typeof o != "object" || typeof Q != "object" || typeof o.x != "number" || typeof o.y != "number" || typeof Q.x != "number" || typeof Q.y != "number" ? null : /* @__PURE__ */ A(
|
|
7873
7873
|
"line",
|
|
7874
7874
|
{
|
|
7875
7875
|
x1: o.x * e,
|
|
7876
7876
|
y1: o.y * B,
|
|
7877
|
-
x2:
|
|
7878
|
-
y2:
|
|
7877
|
+
x2: Q.x * e,
|
|
7878
|
+
y2: Q.y * B,
|
|
7879
7879
|
stroke: "rgba(100,210,255,0.5)",
|
|
7880
7880
|
strokeWidth: "4",
|
|
7881
7881
|
strokeLinecap: "round",
|
|
@@ -7917,18 +7917,18 @@ 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,
|
|
7920
|
+
], i = e, o = B, Q = Math.max(i, o) / 500, z = Math.max(5, 3 * Q), p = Math.max(7, 5 * Q);
|
|
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" ? "Perfect Fit" : N.isLength ? N.fit.includes("short") || N.fit.includes("tight") ? "Short" : "Long" : N.fit.includes("tight") ? "Tight" : "Loose" : h, l = Math.round(14 * Q), y = hA.length * l * 0.62, sA = i - k - 12 * Q < y, V = sA ? t - 10 * Q : k + 10 * Q, s = sA ? "end" : "start", PA = sA ? t : k, RA = sA ? t - 6 * Q : k + 6 * Q;
|
|
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
7934
|
strokeWidth: z,
|
|
@@ -7969,14 +7969,14 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
|
|
|
7969
7969
|
x2: RA,
|
|
7970
7970
|
y2: u,
|
|
7971
7971
|
stroke: K,
|
|
7972
|
-
strokeWidth: 2 *
|
|
7972
|
+
strokeWidth: 2 * Q
|
|
7973
7973
|
}
|
|
7974
7974
|
),
|
|
7975
7975
|
/* @__PURE__ */ A(
|
|
7976
7976
|
"text",
|
|
7977
7977
|
{
|
|
7978
7978
|
x: V,
|
|
7979
|
-
y: u + 1 *
|
|
7979
|
+
y: u + 1 * Q,
|
|
7980
7980
|
fill: K,
|
|
7981
7981
|
fontSize: l,
|
|
7982
7982
|
fontWeight: "700",
|
|
@@ -8040,7 +8040,7 @@ function DP({
|
|
|
8040
8040
|
lengthEntry: D,
|
|
8041
8041
|
onBack: i,
|
|
8042
8042
|
t: o,
|
|
8043
|
-
productImage:
|
|
8043
|
+
productImage: Q,
|
|
8044
8044
|
productTitle: z,
|
|
8045
8045
|
isMobile: p,
|
|
8046
8046
|
isTryOnImage: T,
|
|
@@ -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((
|
|
8062
|
-
return [...new Set(
|
|
8061
|
+
const a = D.section, X = a.headers.findIndex((zA) => /size|taglia|größe|taille/i.test(zA.trim())), nA = X >= 0 ? X : 0, r = a.headers[nA] || "Size", eA = a.rows.map((zA) => Uf(zA, nA, r)).filter(Boolean);
|
|
8062
|
+
return [...new Set(eA)];
|
|
8063
8063
|
}, [D]), Hf = wf(() => {
|
|
8064
8064
|
if (!D) return {};
|
|
8065
|
-
const a = D.section, X = a.headers.findIndex((
|
|
8065
|
+
const a = D.section, X = a.headers.findIndex((eA) => /size|taglia|größe|taille/i.test(eA.trim()));
|
|
8066
8066
|
if (X < 0) return {};
|
|
8067
|
-
let
|
|
8068
|
-
if (
|
|
8069
|
-
const
|
|
8070
|
-
for (const
|
|
8071
|
-
const
|
|
8072
|
-
|
|
8067
|
+
let nA = a.headers.findIndex((eA) => /height|altezza|hauteur|größe|tall/i.test(eA.trim()) && !/size/i.test(eA));
|
|
8068
|
+
if (nA < 0 && (nA = a.headers.findIndex((eA, zA) => zA !== X)), nA < 0) return {};
|
|
8069
|
+
const r = {};
|
|
8070
|
+
for (const eA of a.rows) {
|
|
8071
|
+
const zA = Uf(eA, X, a.headers[X] || "Size"), YA = Uf(eA, nA, a.headers[nA] || "");
|
|
8072
|
+
zA && YA && (r[String(zA).trim()] = String(YA).trim());
|
|
8073
8073
|
}
|
|
8074
|
-
return
|
|
8075
|
-
}, [D]),
|
|
8074
|
+
return r;
|
|
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((r) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Uf(r, 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] :
|
|
8088
|
+
const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i, nA = a.some((r) => X.test(r.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
|
|
8103
|
-
for (const
|
|
8104
|
-
const
|
|
8105
|
-
if (
|
|
8106
|
-
if (/cm\b|centimeter/i.test(
|
|
8107
|
-
|
|
8102
|
+
let r = null;
|
|
8103
|
+
for (const eA of n.rows) {
|
|
8104
|
+
const zA = String(Uf(eA, X, n.headers[X]) || "").trim();
|
|
8105
|
+
if (zA) {
|
|
8106
|
+
if (/cm\b|centimeter/i.test(zA)) {
|
|
8107
|
+
r = "cm";
|
|
8108
8108
|
break;
|
|
8109
8109
|
}
|
|
8110
|
-
if (/in\b|inch|"$/i.test(
|
|
8111
|
-
|
|
8110
|
+
if (/in\b|inch|"$/i.test(zA)) {
|
|
8111
|
+
r = "in";
|
|
8112
8112
|
break;
|
|
8113
8113
|
}
|
|
8114
8114
|
}
|
|
8115
8115
|
}
|
|
8116
|
-
a.push(
|
|
8116
|
+
a.push(r);
|
|
8117
8117
|
}
|
|
8118
8118
|
return a;
|
|
8119
|
-
}, [n]), ff =
|
|
8120
|
-
const
|
|
8119
|
+
}, [n]), ff = UA((a, X) => {
|
|
8120
|
+
const nA = a.toLowerCase().trim(), r = B === "cm" || B === "", eA = r ? "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
|
|
8132
|
-
|
|
8133
|
-
const of = n.headers[
|
|
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] === eA);
|
|
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
|
-
const FA = QP(Bf), OA = SA[
|
|
8142
|
-
if (OA === "in" &&
|
|
8141
|
+
const FA = QP(Bf), OA = SA[YA];
|
|
8142
|
+
if (OA === "in" && r) {
|
|
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" && !r) {
|
|
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], r = g?.length || "", eA = (g?.availableLengths?.length || 0) > 0, zA = RA || r, YA = !!(D || eA);
|
|
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,63 +8184,63 @@ 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,
|
|
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, oA = g, $ = oA?.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
|
-
), Of = _A ? (_A.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", cf =
|
|
8226
|
+
), Of = _A ? (_A.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", cf = oA?.length || RA || Of, Mf = oA?.availableSizes || [], gf = oA?.availableLengths || [], qA = mA || cf, GA = Mf.length > 0 ? Mf : TA, _ = (() => {
|
|
8218
8227
|
if (GA.length <= 3) return GA;
|
|
8219
8228
|
const a = GA.indexOf(E);
|
|
8220
8229
|
if (a < 0) return GA.slice(0, 3);
|
|
8221
8230
|
const X = Math.max(0, Math.min(GA.length - 3, a - 1));
|
|
8222
8231
|
return GA.slice(X, X + 3);
|
|
8223
|
-
})(),
|
|
8224
|
-
if (
|
|
8225
|
-
const a =
|
|
8226
|
-
if (a < 0) return
|
|
8227
|
-
const X = Math.max(0, Math.min(
|
|
8228
|
-
return
|
|
8232
|
+
})(), uA = gf.length > 0 ? gf : ZA, WA = (() => {
|
|
8233
|
+
if (uA.length <= 3) return uA;
|
|
8234
|
+
const a = uA.indexOf(cf);
|
|
8235
|
+
if (a < 0) return uA.slice(0, 3);
|
|
8236
|
+
const X = Math.max(0, Math.min(uA.length - 3, a - 1));
|
|
8237
|
+
return uA.slice(X, X + 3);
|
|
8229
8238
|
})();
|
|
8230
8239
|
if (p) {
|
|
8231
|
-
const a = f.replace(/\s*[—–-]\s*.*/g, ""), X = (
|
|
8232
|
-
const
|
|
8233
|
-
return
|
|
8234
|
-
},
|
|
8240
|
+
const a = f.replace(/\s*[—–-]\s*.*/g, ""), X = (r) => {
|
|
8241
|
+
const eA = r.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8242
|
+
return eA.includes("chest") || eA.includes("bust") ? o("Full circumference at the widest point.") : eA.includes("waist") ? o("Circumference at the natural waistline.") : eA.includes("hip") ? o("Circumference at the fullest point.") : eA.includes("shoulder") ? o("Shoulder edge to shoulder edge.") : eA.includes("sleeve") || eA.includes("arm") ? o("Shoulder seam to cuff edge.") : eA.includes("neck") || eA.includes("collar") ? o("Around the base of the neck.") : eA.includes("inseam") || eA.includes("inside leg") ? o("Inner leg seam length.") : eA.includes("thigh") ? o("Circumference around the upper leg.") : eA.includes("length") || eA.includes("height") ? o("Top to bottom length.") : "";
|
|
8243
|
+
}, nA = (r, eA) => r === "good" ? o("PERFECT FIT") : eA && (r.includes("short") || r === "tight" || r === "too-tight" || r === "a-bit-tight") ? r === "a-bit-tight" || r === "a-bit-short" ? o("A BIT SHORT") : r.includes("too") ? o("TOO SHORT") : o("SHORT") : eA && (r.includes("long") || r === "loose" || r === "too-loose" || r === "a-bit-loose") ? r === "a-bit-loose" || r === "a-bit-long" ? o("A BIT LONG") : r.includes("too") ? o("TOO LONG") : o("LONG") : r === "a-bit-tight" ? o("SLIGHTLY TIGHT") : r === "a-bit-loose" ? o("SLIGHT EASE") : r.includes("tight") ? o("TIGHT") : r.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: [
|
|
@@ -8245,11 +8254,11 @@ function DP({
|
|
|
8245
8254
|
] }),
|
|
8246
8255
|
/* @__PURE__ */ A("span", { className: "ps-msd-topbar-spacer" })
|
|
8247
8256
|
] }),
|
|
8248
|
-
|
|
8257
|
+
Q && /* @__PURE__ */ P("div", { className: `ps-msd-image${T ? " ps-tryon" : ""}`, children: [
|
|
8249
8258
|
/* @__PURE__ */ A(
|
|
8250
8259
|
"img",
|
|
8251
8260
|
{
|
|
8252
|
-
src:
|
|
8261
|
+
src: Q,
|
|
8253
8262
|
alt: z || "",
|
|
8254
8263
|
className: "ps-msd-image-img",
|
|
8255
8264
|
onLoad: t
|
|
@@ -8293,13 +8302,13 @@ function DP({
|
|
|
8293
8302
|
/* @__PURE__ */ A("p", { className: "ps-msd-card-note", style: { margin: 0, lineHeight: 1.5 }, children: o("Your measurements are outside this product's size range. You can still try it on visually below.") })
|
|
8294
8303
|
] }) }),
|
|
8295
8304
|
K !== !1 && /* @__PURE__ */ P("div", { className: "ps-msd-card", children: [
|
|
8296
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: o(
|
|
8305
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: o(bA === $ ? "RECOMMENDED SIZE" : "TRYING SIZE") }),
|
|
8297
8306
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "10px", marginTop: "6px", marginBottom: "4px" }, children: [
|
|
8298
8307
|
V.length > 1 && /* @__PURE__ */ P(
|
|
8299
8308
|
"select",
|
|
8300
8309
|
{
|
|
8301
8310
|
value: s || "",
|
|
8302
|
-
onChange: (
|
|
8311
|
+
onChange: (r) => PA(r.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((r) => /* @__PURE__ */ A("option", { value: r, children: r }, r))
|
|
8320
8329
|
]
|
|
8321
8330
|
}
|
|
8322
8331
|
),
|
|
@@ -8355,66 +8364,66 @@ 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((r, eA) => {
|
|
8368
|
+
const zA = r.isLength && r.fit.includes("short") || r.fit.includes("tight"), YA = r.fit === "good" ? "ps-good" : zA ? "ps-tight" : "ps-loose", of = X(r.area), J = String(eA + 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
|
+
r.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 ? r.rawUserValue || "—" : isNaN(r.userNum) || r.userNum === 0 ? "—" : `${XA(r.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: [
|
|
8374
8383
|
o("SIZE"),
|
|
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 ? r.rawChartRange || "—" : sA(r.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
|
+
r.isLength ? Hn(r.fit, o).toUpperCase() : nA(r.fit, r.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
|
+
] }, eA);
|
|
8386
8395
|
}) })
|
|
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((r) => /* @__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${r === bA ? " ps-active" : ""}`,
|
|
8404
|
+
onClick: () => c(r === E ? null : r),
|
|
8405
|
+
children: r
|
|
8397
8406
|
},
|
|
8398
|
-
|
|
8407
|
+
r
|
|
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
|
|
8412
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: WA.map((r) => {
|
|
8413
|
+
const eA = String(qA ?? "").trim() === String(r ?? "").trim(), zA = Hf[String(r).trim()];
|
|
8405
8414
|
return /* @__PURE__ */ P(
|
|
8406
8415
|
"button",
|
|
8407
8416
|
{
|
|
8408
8417
|
type: "button",
|
|
8409
|
-
className: `ps-msd-size-pill${
|
|
8410
|
-
onClick: () => dA(
|
|
8418
|
+
className: `ps-msd-size-pill${eA ? " ps-active" : ""}`,
|
|
8419
|
+
onClick: () => dA(r === cf ? null : r),
|
|
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: r }),
|
|
8423
|
+
zA && /* @__PURE__ */ A("span", { style: { fontSize: "0.55vw", fontWeight: 500, opacity: 0.75 }, children: zA })
|
|
8415
8424
|
]
|
|
8416
8425
|
},
|
|
8417
|
-
|
|
8426
|
+
r
|
|
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", r = 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: r, 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
|
] }) }),
|
|
@@ -8603,7 +8612,7 @@ function DP({
|
|
|
8603
8612
|
o("Size")
|
|
8604
8613
|
] }),
|
|
8605
8614
|
/* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: _.map((a) => {
|
|
8606
|
-
const X = a ===
|
|
8615
|
+
const X = a === bA;
|
|
8607
8616
|
return /* @__PURE__ */ A(
|
|
8608
8617
|
"button",
|
|
8609
8618
|
{
|
|
@@ -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
|
|
@@ -8741,7 +8750,7 @@ function EB({
|
|
|
8741
8750
|
sizingUnit: D,
|
|
8742
8751
|
setView: i,
|
|
8743
8752
|
handleDownload: o,
|
|
8744
|
-
onRetryWithFit:
|
|
8753
|
+
onRetryWithFit: Q,
|
|
8745
8754
|
retryLoading: z,
|
|
8746
8755
|
selectedFile: p,
|
|
8747
8756
|
previewUrl: T,
|
|
@@ -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"), [
|
|
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;
|
|
@@ -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
8843
|
wf(() => n?.internationalSizes || {}, [n]);
|
|
8835
|
-
const [Hf,
|
|
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), [oA, $] = 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,15 +8858,15 @@ 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), [_,
|
|
8861
|
+
const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X = iA(null), [nA, r] = j(null), [eA, zA] = j(!1);
|
|
8853
8862
|
JA(() => {
|
|
8854
8863
|
if (_) {
|
|
8855
8864
|
const U = URL.createObjectURL(_);
|
|
8856
|
-
return
|
|
8865
|
+
return r(U), () => URL.revokeObjectURL(U);
|
|
8857
8866
|
}
|
|
8858
|
-
|
|
8867
|
+
r(null);
|
|
8859
8868
|
}, [_]);
|
|
8860
|
-
const
|
|
8869
|
+
const YA = EA || ZA;
|
|
8861
8870
|
wf(() => {
|
|
8862
8871
|
if (!n?.matchDetails?.length) return [];
|
|
8863
8872
|
const U = /* @__PURE__ */ new Set();
|
|
@@ -8867,8 +8876,8 @@ function EB({
|
|
|
8867
8876
|
}).map((G) => {
|
|
8868
8877
|
const S = kf(G.userValue);
|
|
8869
8878
|
let aA = G.chartRange, fA = G.fit;
|
|
8870
|
-
if (
|
|
8871
|
-
const NA = dA(G.measurement,
|
|
8879
|
+
if (YA !== ZA) {
|
|
8880
|
+
const NA = dA(G.measurement, YA);
|
|
8872
8881
|
if (NA && NA.min > 0) {
|
|
8873
8882
|
aA = kP(NA.range);
|
|
8874
8883
|
const $A = NA.min, ef = NA.max, yA = ef - $A, KA = yA > 0 ? yA * 0.5 : $A * 0.05 || 3, vf = Math.max((ef || $A) * 5e-3, 0.25);
|
|
@@ -8884,9 +8893,9 @@ function EB({
|
|
|
8884
8893
|
}
|
|
8885
8894
|
return { area: G.measurement, userNum: kf(G.userValue), chartLabel: aA, fit: fA };
|
|
8886
8895
|
});
|
|
8887
|
-
}, [n,
|
|
8896
|
+
}, [n, YA, ZA, dA]), wf(() => {
|
|
8888
8897
|
if (!g?.headers || !g?.rows || PA < 0) return null;
|
|
8889
|
-
const U = g.rows.find((G) => s(G, PA, RA) ===
|
|
8898
|
+
const U = g.rows.find((G) => s(G, PA, RA) === YA);
|
|
8890
8899
|
if (!U) return null;
|
|
8891
8900
|
const R = [];
|
|
8892
8901
|
for (let G = 0; G < g.headers.length; G++) {
|
|
@@ -8896,20 +8905,20 @@ function EB({
|
|
|
8896
8905
|
aA && R.push({ header: S, value: aA });
|
|
8897
8906
|
}
|
|
8898
8907
|
return R;
|
|
8899
|
-
}, [g, PA, RA,
|
|
8900
|
-
const of = !!(g?.sections && Object.keys(g.sections).length > 1),
|
|
8908
|
+
}, [g, PA, RA, YA, s]);
|
|
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
|
|
8915
|
+
return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: G, secResult: R, userMeasurements: S };
|
|
8907
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
|
-
}), [of, g, n,
|
|
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:", {
|
|
@@ -8964,7 +8973,7 @@ function EB({
|
|
|
8964
8973
|
onLoad: _A
|
|
8965
8974
|
}
|
|
8966
8975
|
),
|
|
8967
|
-
v === "face" || v === "head" ? u && /* @__PURE__ */ A(cB, { landmarks: u, imgWidth:
|
|
8976
|
+
v === "face" || v === "head" ? u && /* @__PURE__ */ A(cB, { landmarks: u, imgWidth: oA.w, imgHeight: oA.h }) : k && /* @__PURE__ */ A(Qn, { landmarks: k, imgWidth: oA.w, imgHeight: oA.h })
|
|
8968
8977
|
] }),
|
|
8969
8978
|
(() => {
|
|
8970
8979
|
const U = v === "face" || v === "head";
|
|
@@ -8984,7 +8993,7 @@ function EB({
|
|
|
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,
|
|
@@ -9021,8 +9030,8 @@ function EB({
|
|
|
9021
9030
|
}).map((S) => ({ area: S.measurement, userNum: parseFloat(S.userValue) || 0, chartLabel: S.chartRange || "", fit: S.fit }));
|
|
9022
9031
|
})(),
|
|
9023
9032
|
show: kA,
|
|
9024
|
-
imgWidth:
|
|
9025
|
-
imgHeight:
|
|
9033
|
+
imgWidth: oA.w,
|
|
9034
|
+
imgHeight: oA.h
|
|
9026
9035
|
}
|
|
9027
9036
|
) : null,
|
|
9028
9037
|
t: 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,16 +9065,16 @@ 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
|
},
|
|
9064
9073
|
tryOnProcessing: t,
|
|
9065
9074
|
resultImageUrl: e,
|
|
9066
9075
|
tryOnDone: !!e && !t,
|
|
9067
9076
|
onTryAgain: () => {
|
|
9068
|
-
K?.(),
|
|
9077
|
+
K?.(), uA(p || null), GA(!0);
|
|
9069
9078
|
},
|
|
9070
9079
|
onClose: E,
|
|
9071
9080
|
showLines: kA,
|
|
@@ -9087,8 +9096,8 @@ function EB({
|
|
|
9087
9096
|
}).map((G) => ({ area: G.measurement, userNum: parseFloat(G.userValue) || 0, chartLabel: G.chartRange || "", fit: G.fit }));
|
|
9088
9097
|
})(),
|
|
9089
9098
|
show: kA,
|
|
9090
|
-
imgWidth:
|
|
9091
|
-
imgHeight:
|
|
9099
|
+
imgWidth: oA.w,
|
|
9100
|
+
imgHeight: oA.h
|
|
9092
9101
|
}
|
|
9093
9102
|
) : null,
|
|
9094
9103
|
t: c
|
|
@@ -9099,7 +9108,7 @@ function EB({
|
|
|
9099
9108
|
/* @__PURE__ */ P("div", { className: "ps-tryon-v2", children: [
|
|
9100
9109
|
/* @__PURE__ */ P("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
|
|
9101
9110
|
/* @__PURE__ */ A("img", { src: t && T ? T : e || B, alt: C, className: "ps-tryon-v2-bg-img", onLoad: _A }),
|
|
9102
|
-
t && k && /* @__PURE__ */ A(Qn, { landmarks: k, imgWidth:
|
|
9111
|
+
t && k && /* @__PURE__ */ A(Qn, { landmarks: k, imgWidth: oA.w, imgHeight: oA.h }),
|
|
9103
9112
|
t && /* @__PURE__ */ P("div", { className: "ps-tryon-v2-processing-label", children: [
|
|
9104
9113
|
/* @__PURE__ */ A("span", { children: c("Generating try-on...") }),
|
|
9105
9114
|
/* @__PURE__ */ A(kn, { t: c, isActive: !0 })
|
|
@@ -9114,7 +9123,7 @@ function EB({
|
|
|
9114
9123
|
const S = G.measurement.toLowerCase();
|
|
9115
9124
|
return R.has(S) ? !1 : (R.add(S), !0);
|
|
9116
9125
|
}).map((G) => ({ area: G.measurement, userNum: parseFloat(G.userValue) || 0, chartLabel: G.chartRange || "", fit: G.fit }));
|
|
9117
|
-
})(), show: kA, imgWidth:
|
|
9126
|
+
})(), show: kA, imgWidth: oA.w, imgHeight: oA.h }),
|
|
9118
9127
|
e && !t && /* @__PURE__ */ P("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
9119
9128
|
!q && /* @__PURE__ */ P("button", { className: "ps-tryon-sr-glass-btn", onClick: () => vA(!kA), children: [
|
|
9120
9129
|
/* @__PURE__ */ P("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", style: { marginRight: "0.3vw" }, children: [
|
|
@@ -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 }),
|
|
@@ -9186,7 +9195,7 @@ function EB({
|
|
|
9186
9195
|
style: { marginTop: 0 },
|
|
9187
9196
|
disabled: t,
|
|
9188
9197
|
onClick: () => {
|
|
9189
|
-
|
|
9198
|
+
uA(p || null), GA(!0);
|
|
9190
9199
|
},
|
|
9191
9200
|
children: [
|
|
9192
9201
|
/* @__PURE__ */ A(hf, { size: 14 }),
|
|
@@ -9205,7 +9214,7 @@ function EB({
|
|
|
9205
9214
|
if (n?.matchDetails)
|
|
9206
9215
|
for (const fA of n.matchDetails) G[fA.measurement.toLowerCase()] = kf(fA.userValue);
|
|
9207
9216
|
const S = c("Your Fit"), aA = () => {
|
|
9208
|
-
e || (
|
|
9217
|
+
e || (uA(p || null), GA(!0));
|
|
9209
9218
|
};
|
|
9210
9219
|
return x ? /* @__PURE__ */ A(
|
|
9211
9220
|
DP,
|
|
@@ -9238,8 +9247,8 @@ function EB({
|
|
|
9238
9247
|
lines: rA,
|
|
9239
9248
|
fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })),
|
|
9240
9249
|
show: kA,
|
|
9241
|
-
imgWidth:
|
|
9242
|
-
imgHeight:
|
|
9250
|
+
imgWidth: oA.w,
|
|
9251
|
+
imgHeight: oA.h
|
|
9243
9252
|
}
|
|
9244
9253
|
) : null,
|
|
9245
9254
|
t: c
|
|
@@ -9247,7 +9256,7 @@ function EB({
|
|
|
9247
9256
|
) : /* @__PURE__ */ P("div", { className: "ps-tryon-v2", children: [
|
|
9248
9257
|
/* @__PURE__ */ P("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
|
|
9249
9258
|
/* @__PURE__ */ A("img", { src: e || B, alt: C, className: "ps-tryon-v2-bg-img", onLoad: _A }),
|
|
9250
|
-
e && xA && rA && /* @__PURE__ */ A($f, { lines: rA, fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })), show: kA, imgWidth:
|
|
9259
|
+
e && xA && rA && /* @__PURE__ */ A($f, { lines: rA, fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })), show: kA, imgWidth: oA.w, imgHeight: oA.h }),
|
|
9251
9260
|
e && !t && /* @__PURE__ */ P("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
9252
9261
|
!q && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () => vA(!kA), children: c(kA ? "Hide Fit" : "Show Fit") }),
|
|
9253
9262
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: o, children: c("Download") })
|
|
@@ -9295,18 +9304,18 @@ function EB({
|
|
|
9295
9304
|
style: { display: "none" },
|
|
9296
9305
|
onChange: (U) => {
|
|
9297
9306
|
const R = U.target.files?.[0];
|
|
9298
|
-
R &&
|
|
9307
|
+
R && uA(R);
|
|
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
|
{
|
|
9307
9316
|
type: "button",
|
|
9308
9317
|
className: "ps-pm-preview-remove",
|
|
9309
|
-
onClick: () =>
|
|
9318
|
+
onClick: () => uA(null),
|
|
9310
9319
|
"aria-label": c("Remove photo"),
|
|
9311
9320
|
children: /* @__PURE__ */ P("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
9312
9321
|
/* @__PURE__ */ A("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
@@ -9378,7 +9387,7 @@ function EB({
|
|
|
9378
9387
|
type: "button",
|
|
9379
9388
|
className: "ps-pm-secondary-btn",
|
|
9380
9389
|
onClick: () => {
|
|
9381
|
-
GA(!1),
|
|
9390
|
+
GA(!1), uA(null);
|
|
9382
9391
|
},
|
|
9383
9392
|
children: c("BACK")
|
|
9384
9393
|
}
|
|
@@ -9398,7 +9407,7 @@ function EB({
|
|
|
9398
9407
|
onDrop: (U) => {
|
|
9399
9408
|
U.preventDefault(), a(!1);
|
|
9400
9409
|
const R = U.dataTransfer.files[0];
|
|
9401
|
-
R &&
|
|
9410
|
+
R && uA(R);
|
|
9402
9411
|
},
|
|
9403
9412
|
style: {
|
|
9404
9413
|
flex: 1,
|
|
@@ -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 }),
|
|
@@ -9432,7 +9441,7 @@ function EB({
|
|
|
9432
9441
|
style: { display: "none" },
|
|
9433
9442
|
onChange: (U) => {
|
|
9434
9443
|
const R = U.target.files?.[0];
|
|
9435
|
-
R &&
|
|
9444
|
+
R && uA(R);
|
|
9436
9445
|
}
|
|
9437
9446
|
}
|
|
9438
9447
|
)
|
|
@@ -9527,7 +9536,7 @@ function EB({
|
|
|
9527
9536
|
] })
|
|
9528
9537
|
] })
|
|
9529
9538
|
] }) }),
|
|
9530
|
-
|
|
9539
|
+
bA && g && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children: /* @__PURE__ */ P("div", { className: "ps-tryon-sr-chart-modal", children: [
|
|
9531
9540
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-chart-header", children: [
|
|
9532
9541
|
/* @__PURE__ */ A("h4", { children: c("Full Size Chart") }),
|
|
9533
9542
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => VA(!1), children: "✕" })
|
|
@@ -9556,7 +9565,7 @@ function EB({
|
|
|
9556
9565
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ P("table", { className: "ps-tryon-sr-chart-table", children: [
|
|
9557
9566
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: g.headers.map((U, R) => /* @__PURE__ */ A("th", { className: R === PA ? "ps-size-col" : "", children: U }, R)) }) }),
|
|
9558
9567
|
/* @__PURE__ */ A("tbody", { children: g.rows.map((U, R) => {
|
|
9559
|
-
const S = s(U, PA, RA) ===
|
|
9568
|
+
const S = s(U, PA, RA) === YA;
|
|
9560
9569
|
return /* @__PURE__ */ A("tr", { className: S ? "ps-active-row" : "", children: g.headers.map((aA, fA) => /* @__PURE__ */ A("td", { className: fA === PA ? "ps-size-col" : "", children: s(U, fA, aA) }, fA)) }, R);
|
|
9561
9570
|
}) })
|
|
9562
9571
|
] }) })
|
|
@@ -9575,16 +9584,16 @@ function aB({
|
|
|
9575
9584
|
handleRemovePreview: D,
|
|
9576
9585
|
handleTryOnSubmit: i,
|
|
9577
9586
|
cn: o,
|
|
9578
|
-
t:
|
|
9587
|
+
t: Q
|
|
9579
9588
|
}) {
|
|
9580
9589
|
return /* @__PURE__ */ A(tA, { children: f && n ? /* @__PURE__ */ P(tA, { children: [
|
|
9581
9590
|
/* @__PURE__ */ P("div", { className: Qf("ps-tryon-preview", o.preview), children: [
|
|
9582
9591
|
/* @__PURE__ */ A("div", { className: "ps-tryon-preview-blur", style: { backgroundImage: `url(${n})` } }),
|
|
9583
|
-
/* @__PURE__ */ A("img", { src: n, alt:
|
|
9592
|
+
/* @__PURE__ */ A("img", { src: n, alt: Q("Your photo"), className: o.previewImage }),
|
|
9584
9593
|
/* @__PURE__ */ A("button", { onClick: D, className: Qf("ps-tryon-preview-remove", o.removeButton), children: "×" })
|
|
9585
9594
|
] }),
|
|
9586
9595
|
/* @__PURE__ */ P("button", { onClick: i, className: Qf("ps-tryon-submit", o.submitButton), children: [
|
|
9587
|
-
|
|
9596
|
+
Q("Try It On"),
|
|
9588
9597
|
" ",
|
|
9589
9598
|
/* @__PURE__ */ A(_f, {})
|
|
9590
9599
|
] })
|
|
@@ -9617,8 +9626,8 @@ function aB({
|
|
|
9617
9626
|
}
|
|
9618
9627
|
),
|
|
9619
9628
|
/* @__PURE__ */ A(zP, {}),
|
|
9620
|
-
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-upload-text", o.uploadText), children:
|
|
9621
|
-
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-upload-hint", o.uploadHint), children:
|
|
9629
|
+
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-upload-text", o.uploadText), children: Q("Upload a full body photo") }),
|
|
9630
|
+
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-upload-hint", o.uploadHint), children: Q("JPEG, PNG or WebP (max 10MB)") })
|
|
9622
9631
|
]
|
|
9623
9632
|
}
|
|
9624
9633
|
) });
|
|
@@ -9635,15 +9644,15 @@ function dB({
|
|
|
9635
9644
|
cn: i,
|
|
9636
9645
|
t: o
|
|
9637
9646
|
}) {
|
|
9638
|
-
const
|
|
9647
|
+
const Q = UA((h) => {
|
|
9639
9648
|
g.current = h, h && (h.style.width = `${Math.round(n.current)}%`);
|
|
9640
|
-
}, []), z =
|
|
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);
|
|
@@ -9685,7 +9694,7 @@ function dB({
|
|
|
9685
9694
|
] }),
|
|
9686
9695
|
/* @__PURE__ */ A("span", { ref: T, className: "ps-tryon-progress-eta", children: "~22s" })
|
|
9687
9696
|
] }),
|
|
9688
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ A("div", { ref:
|
|
9697
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ A("div", { ref: Q, className: "ps-tryon-progress-bar-fill" }) }),
|
|
9689
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...") }),
|
|
@@ -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"), [
|
|
9786
|
+
const [C, D] = j(null), [i, o] = j("identity"), [Q, 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,19 +9816,19 @@ 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), [
|
|
9819
|
+
}, [SA, ff] = j(null), [rA, nf] = j(null), [xA, Ef] = j(null), [oA, $] = 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
|
+
}, r = () => {
|
|
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
|
+
}, eA = () => {
|
|
9823
9832
|
if (!t.trim())
|
|
9824
9833
|
return s(B("Please enter a profile name")), !1;
|
|
9825
9834
|
let x;
|
|
@@ -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
|
-
const q = parseFloat(l), QA = parseFloat(
|
|
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,
|
|
@@ -9846,15 +9855,15 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9846
9855
|
weightKg: parseFloat(l),
|
|
9847
9856
|
height: x,
|
|
9848
9857
|
weight: parseFloat(l),
|
|
9849
|
-
age: parseFloat(
|
|
9858
|
+
age: parseFloat(XA),
|
|
9850
9859
|
chestProfile: SA || void 0,
|
|
9851
9860
|
midsectionProfile: rA || void 0,
|
|
9852
|
-
hipProfile: GA ?
|
|
9861
|
+
hipProfile: GA ? oA || void 0 : xA || void 0,
|
|
9853
9862
|
bandSize: GA && _A || void 0,
|
|
9854
9863
|
cupSize: GA && cf || void 0
|
|
9855
9864
|
};
|
|
9856
9865
|
}, of = () => {
|
|
9857
|
-
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(
|
|
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,8 +9875,8 @@ 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
|
-
},
|
|
9870
|
-
if (!(i === "identity" && !
|
|
9878
|
+
}, J = () => {
|
|
9879
|
+
if (!(i === "identity" && !eA())) {
|
|
9871
9880
|
if (i === "chest" && !SA) {
|
|
9872
9881
|
s(B("Please pick an option"));
|
|
9873
9882
|
return;
|
|
@@ -9880,7 +9889,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9880
9889
|
s(B("Please pick an option"));
|
|
9881
9890
|
return;
|
|
9882
9891
|
}
|
|
9883
|
-
if (i === "hips" && !
|
|
9892
|
+
if (i === "hips" && !oA) {
|
|
9884
9893
|
s(B("Please pick an option"));
|
|
9885
9894
|
return;
|
|
9886
9895
|
}
|
|
@@ -9889,30 +9898,30 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9889
9898
|
return;
|
|
9890
9899
|
}
|
|
9891
9900
|
if (s(""), X) {
|
|
9892
|
-
f(
|
|
9901
|
+
f(YA());
|
|
9893
9902
|
return;
|
|
9894
9903
|
}
|
|
9895
|
-
o(
|
|
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
|
-
const QA =
|
|
9908
|
+
const QA = uA.indexOf(x), U = QA === a - 1;
|
|
9900
9909
|
setTimeout(() => {
|
|
9901
9910
|
if (U) {
|
|
9902
|
-
const R =
|
|
9911
|
+
const R = YA();
|
|
9903
9912
|
x === "chest" ? R.chestProfile = q : x === "stomach" ? R.midsectionProfile = q : (x === "seat" || x === "hips") && (R.hipProfile = q), f(R);
|
|
9904
9913
|
} else
|
|
9905
|
-
o(
|
|
9914
|
+
o(uA[QA + 1]);
|
|
9906
9915
|
}, 220);
|
|
9907
9916
|
}, Bf = () => {
|
|
9908
9917
|
if (s(""), i === "identity") {
|
|
9909
9918
|
D(null);
|
|
9910
9919
|
return;
|
|
9911
9920
|
}
|
|
9912
|
-
o(
|
|
9921
|
+
o(uA[Math.max(0, WA - 1)]);
|
|
9913
9922
|
}, FA = C === "manual" && (i === "chest" || i === "stomach" || i === "seat" || i === "hips"), OA = async () => {
|
|
9914
|
-
if (
|
|
9915
|
-
if (!
|
|
9923
|
+
if (Q === "name-photo") {
|
|
9924
|
+
if (!zA()) return;
|
|
9916
9925
|
if (!PA) {
|
|
9917
9926
|
s(B("Please upload a photo"));
|
|
9918
9927
|
return;
|
|
@@ -9920,7 +9929,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9920
9929
|
s(""), z("details");
|
|
9921
9930
|
return;
|
|
9922
9931
|
}
|
|
9923
|
-
if (
|
|
9932
|
+
if (Q === "details") {
|
|
9924
9933
|
if (I === "in") {
|
|
9925
9934
|
const q = parseFloat(E);
|
|
9926
9935
|
if (!q || q < 3 || q > 8) {
|
|
@@ -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
9946
|
if (s(""), z("calculating"), T(!0), e && PA) {
|
|
9938
|
-
const q = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(
|
|
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,
|
|
@@ -9956,11 +9965,11 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9956
9965
|
const x = of();
|
|
9957
9966
|
F && (x.measurements = F, x.measurementsUnit = "cm"), f(x);
|
|
9958
9967
|
}, AA = () => {
|
|
9959
|
-
if (s(""),
|
|
9968
|
+
if (s(""), Q === "details") {
|
|
9960
9969
|
z("name-photo");
|
|
9961
9970
|
return;
|
|
9962
9971
|
}
|
|
9963
|
-
if (
|
|
9972
|
+
if (Q === "calculating" && !p) {
|
|
9964
9973
|
z("details");
|
|
9965
9974
|
return;
|
|
9966
9975
|
}
|
|
@@ -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: r, 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
|
),
|
|
@@ -10144,7 +10153,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10144
10153
|
type: "number",
|
|
10145
10154
|
inputMode: "numeric",
|
|
10146
10155
|
className: "ps-bp-inline-input",
|
|
10147
|
-
value:
|
|
10156
|
+
value: XA,
|
|
10148
10157
|
placeholder: B("e.g. 30"),
|
|
10149
10158
|
onChange: (x) => {
|
|
10150
10159
|
sA(x.target.value), s("");
|
|
@@ -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:
|
|
10207
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.average ?? null, label: B("AVERAGE"), selected:
|
|
10208
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.full ?? null, label: B("FULL"), selected:
|
|
10215
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.narrow ?? null, label: B("NARROW"), selected: oA === "narrow", onSelect: () => gA("hips", "narrow") }),
|
|
10216
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.average ?? null, label: B("AVERAGE"), selected: oA === "average", onSelect: () => gA("hips", "average") }),
|
|
10217
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.full ?? null, label: B("FULL"), selected: oA === "full", onSelect: () => gA("hips", "full") })
|
|
10209
10218
|
]
|
|
10210
10219
|
}
|
|
10211
10220
|
),
|
|
@@ -10252,7 +10261,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10252
10261
|
] })
|
|
10253
10262
|
] }, "bra"),
|
|
10254
10263
|
C === "manual" && V && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: V }),
|
|
10255
|
-
C === "image" &&
|
|
10264
|
+
C === "image" && Q === "name-photo" && /* @__PURE__ */ P("div", { className: "ps-cpw-image-split ps-cpw-fade-in", children: [
|
|
10256
10265
|
/* @__PURE__ */ A(
|
|
10257
10266
|
"input",
|
|
10258
10267
|
{
|
|
@@ -10301,7 +10310,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10301
10310
|
type: "button",
|
|
10302
10311
|
className: "ps-cpw-age-gate-btn ps-cpw-age-gate-btn-primary",
|
|
10303
10312
|
onClick: () => {
|
|
10304
|
-
|
|
10313
|
+
bA(!0), s("");
|
|
10305
10314
|
},
|
|
10306
10315
|
children: B("Yes")
|
|
10307
10316
|
}
|
|
@@ -10311,7 +10320,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10311
10320
|
{
|
|
10312
10321
|
type: "button",
|
|
10313
10322
|
className: "ps-cpw-age-gate-btn ps-cpw-age-gate-btn-secondary",
|
|
10314
|
-
onClick: () =>
|
|
10323
|
+
onClick: () => bA(!1),
|
|
10315
10324
|
children: B("No")
|
|
10316
10325
|
}
|
|
10317
10326
|
)
|
|
@@ -10325,7 +10334,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10325
10334
|
{
|
|
10326
10335
|
type: "button",
|
|
10327
10336
|
className: "ps-cpw-age-gate-btn ps-cpw-age-gate-btn-secondary",
|
|
10328
|
-
onClick: () =>
|
|
10337
|
+
onClick: () => bA(null),
|
|
10329
10338
|
children: B("Go back")
|
|
10330
10339
|
}
|
|
10331
10340
|
)
|
|
@@ -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") }),
|
|
@@ -10369,26 +10378,26 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10369
10378
|
V && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: V })
|
|
10370
10379
|
] })
|
|
10371
10380
|
] }, "image-photo"),
|
|
10372
|
-
C === "image" &&
|
|
10381
|
+
C === "image" && Q === "details" && /* @__PURE__ */ P("div", { className: "ps-cpw-fade-in", style: { padding: "1vw 1.5vw" }, children: [
|
|
10373
10382
|
/* @__PURE__ */ P("div", { className: "ps-cpw-section-head", children: [
|
|
10374
10383
|
/* @__PURE__ */ A("div", { className: "ps-cpw-section-title", children: B("Your measurements") }),
|
|
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: r, 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) => {
|
|
@@ -10409,7 +10418,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10409
10418
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10410
10419
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("AGE") }),
|
|
10411
10420
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
10412
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
10421
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: XA, placeholder: B("e.g. 30"), onChange: (x) => {
|
|
10413
10422
|
sA(x.target.value), s("");
|
|
10414
10423
|
} }),
|
|
10415
10424
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: B("years") })
|
|
@@ -10418,7 +10427,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10418
10427
|
] }),
|
|
10419
10428
|
V && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: V })
|
|
10420
10429
|
] }, "image-details"),
|
|
10421
|
-
C === "image" &&
|
|
10430
|
+
C === "image" && Q === "calculating" && /* @__PURE__ */ A("div", { className: "ps-cpw-fade-in", style: { display: "flex", flexDirection: "column", flex: 1, padding: "1.5vw 2vw", overflow: "auto" }, children: p ? /* @__PURE__ */ P("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", flex: 1, gap: "1.2vw" }, children: [
|
|
10422
10431
|
/* @__PURE__ */ A("div", { className: "ps-tryon-size-loading-spinner" }),
|
|
10423
10432
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-primary)", fontSize: "1vw", fontWeight: 600 }, children: B("Analyzing your body measurements...") }),
|
|
10424
10433
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.75vw" }, children: B("Using AI to estimate chest, waist, hips, shoulders, and more") })
|
|
@@ -10461,15 +10470,15 @@ 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:
|
|
10465
|
-
C === "image" &&
|
|
10473
|
+
C === "manual" && !FA && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: J, children: B(X ? "CALCULATE MY FIT" : "Continue") }),
|
|
10474
|
+
C === "image" && Q === "name-photo" && /* @__PURE__ */ A(
|
|
10466
10475
|
"button",
|
|
10467
10476
|
{
|
|
10468
10477
|
type: "button",
|
|
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();
|
|
@@ -10478,9 +10487,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10478
10487
|
children: t.trim() ? B(PA ? "Continue" : "Upload a photo") : B("Add a name for this profile")
|
|
10479
10488
|
}
|
|
10480
10489
|
),
|
|
10481
|
-
C === "image" &&
|
|
10482
|
-
C === "image" &&
|
|
10483
|
-
C === "image" &&
|
|
10490
|
+
C === "image" && Q === "details" && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: OA, children: B("Calculate My Body Parts") }),
|
|
10491
|
+
C === "image" && Q === "calculating" && !p && F && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: OA, children: B("Save Profile") }),
|
|
10492
|
+
C === "image" && Q === "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
|
] })
|
|
@@ -10515,50 +10524,50 @@ function A8({
|
|
|
10515
10524
|
onSave: D,
|
|
10516
10525
|
onSaveBraSize: i,
|
|
10517
10526
|
isEstimating: o = !1,
|
|
10518
|
-
t:
|
|
10527
|
+
t: Q
|
|
10519
10528
|
}) {
|
|
10520
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
10531
|
return z.forEach((E) => {
|
|
10523
|
-
const
|
|
10524
|
-
K[E.key] =
|
|
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
|
|
10539
|
+
let BA = !1;
|
|
10531
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();
|
|
10553
10562
|
};
|
|
10554
10563
|
return /* @__PURE__ */ P("div", { className: "ps-pmv-root", children: [
|
|
10555
10564
|
/* @__PURE__ */ P("div", { className: "ps-pmv-hero", children: [
|
|
10556
|
-
/* @__PURE__ */ A("div", { className: "ps-pmv-hero-eyebrow", children: n ?
|
|
10565
|
+
/* @__PURE__ */ A("div", { className: "ps-pmv-hero-eyebrow", children: n ? Q("ACTIVE PROFILE") : f.gender === "female" ? Q("WOMEN'S FIT") : Q("MEN'S FIT") }),
|
|
10557
10566
|
/* @__PURE__ */ A("h2", { className: "ps-pmv-hero-name", children: f.name })
|
|
10558
10567
|
] }),
|
|
10559
10568
|
/* @__PURE__ */ A("div", { className: "ps-pmv-data", children: /* @__PURE__ */ P("div", { className: "ps-pmv-section", children: [
|
|
10560
10569
|
/* @__PURE__ */ A("div", { className: "ps-pmv-section-head", children: /* @__PURE__ */ P("div", { className: "ps-pmv-section-title-row", children: [
|
|
10561
|
-
/* @__PURE__ */ A("div", { className: "ps-pmv-section-title", children:
|
|
10570
|
+
/* @__PURE__ */ A("div", { className: "ps-pmv-section-title", children: Q("BODY MEASUREMENTS") }),
|
|
10562
10571
|
/* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", style: { marginLeft: "auto" }, children: [
|
|
10563
10572
|
/* @__PURE__ */ A(
|
|
10564
10573
|
"button",
|
|
@@ -10581,18 +10590,18 @@ function A8({
|
|
|
10581
10590
|
] }),
|
|
10582
10591
|
!T && /* @__PURE__ */ P("div", { className: "ps-pmv-loading-pill", style: { marginLeft: "8px" }, children: [
|
|
10583
10592
|
/* @__PURE__ */ A("span", { className: "ps-pmv-loading-spinner" }),
|
|
10584
|
-
/* @__PURE__ */ A("span", { children:
|
|
10593
|
+
/* @__PURE__ */ A("span", { children: Q("Calculating...") })
|
|
10585
10594
|
] })
|
|
10586
10595
|
] }) }),
|
|
10587
10596
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-list", children: [
|
|
10588
10597
|
z.map((K) => {
|
|
10589
|
-
const E = p[K.key],
|
|
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
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children:
|
|
10593
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children:
|
|
10601
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: Q(K.label) }),
|
|
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
|
-
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children:
|
|
10604
|
+
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children: Q("calculating...") })
|
|
10596
10605
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
10597
10606
|
/* @__PURE__ */ A(
|
|
10598
10607
|
"input",
|
|
@@ -10612,7 +10621,7 @@ function A8({
|
|
|
10612
10621
|
f.gender === "female" && /* @__PURE__ */ P(tA, { children: [
|
|
10613
10622
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-row", children: [
|
|
10614
10623
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon" }),
|
|
10615
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children:
|
|
10624
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: Q("BAND") }),
|
|
10616
10625
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: /* @__PURE__ */ P(
|
|
10617
10626
|
"select",
|
|
10618
10627
|
{
|
|
@@ -10628,7 +10637,7 @@ function A8({
|
|
|
10628
10637
|
] }),
|
|
10629
10638
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-row", children: [
|
|
10630
10639
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon" }),
|
|
10631
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children:
|
|
10640
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: Q("CUP") }),
|
|
10632
10641
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: /* @__PURE__ */ P(
|
|
10633
10642
|
"select",
|
|
10634
10643
|
{
|
|
@@ -10646,19 +10655,19 @@ function A8({
|
|
|
10646
10655
|
] })
|
|
10647
10656
|
] }) }),
|
|
10648
10657
|
/* @__PURE__ */ P("div", { className: "ps-pmv-actions", children: [
|
|
10649
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: C, children:
|
|
10658
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: C, children: Q("Back") }),
|
|
10650
10659
|
/* @__PURE__ */ P("div", { className: "ps-pmv-actions-right", children: [
|
|
10651
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-delete", onClick: B, children:
|
|
10652
|
-
!n && /* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: g, children:
|
|
10660
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-delete", onClick: B, children: Q("Delete") }),
|
|
10661
|
+
!n && /* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: g, children: Q("USE THIS PROFILE") }),
|
|
10653
10662
|
/* @__PURE__ */ A(
|
|
10654
10663
|
"button",
|
|
10655
10664
|
{
|
|
10656
10665
|
type: "button",
|
|
10657
10666
|
className: "ps-pmv-btn-primary",
|
|
10658
|
-
onClick:
|
|
10659
|
-
children: T ?
|
|
10667
|
+
onClick: N,
|
|
10668
|
+
children: T ? Q("SAVE") : /* @__PURE__ */ P(tA, { children: [
|
|
10660
10669
|
/* @__PURE__ */ A("span", { className: "ps-pmv-btn-spinner" }),
|
|
10661
|
-
|
|
10670
|
+
Q("CALCULATING")
|
|
10662
10671
|
] })
|
|
10663
10672
|
}
|
|
10664
10673
|
)
|
|
@@ -10704,7 +10713,7 @@ function P8({
|
|
|
10704
10713
|
})(), o = (() => {
|
|
10705
10714
|
const z = f.weight ?? f.weightKg;
|
|
10706
10715
|
return z ? `${Math.round(z)} ${f.weightUnit || "kg"}` : null;
|
|
10707
|
-
})(),
|
|
10716
|
+
})(), Q = (() => {
|
|
10708
10717
|
const z = f.lastEditedAt || f.lastUsedAt || f.createdAt;
|
|
10709
10718
|
return z ? new Date(z).toLocaleDateString(void 0, { month: "short", day: "numeric" }) : null;
|
|
10710
10719
|
})();
|
|
@@ -10728,9 +10737,9 @@ function P8({
|
|
|
10728
10737
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-label", children: D("WEIGHT") }),
|
|
10729
10738
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children: o })
|
|
10730
10739
|
] }),
|
|
10731
|
-
|
|
10740
|
+
Q && /* @__PURE__ */ P("div", { className: "ps-msp-meta-row", children: [
|
|
10732
10741
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-label", children: D("LAST UPDATE") }),
|
|
10733
|
-
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children:
|
|
10742
|
+
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children: Q })
|
|
10734
10743
|
] })
|
|
10735
10744
|
] }),
|
|
10736
10745
|
/* @__PURE__ */ P("div", { className: "ps-msp-card-actions", onClick: (z) => z.stopPropagation(), children: [
|
|
@@ -10787,7 +10796,7 @@ function g8({
|
|
|
10787
10796
|
onSaveBraSize: D,
|
|
10788
10797
|
onRequestDelete: i,
|
|
10789
10798
|
onClose: o,
|
|
10790
|
-
onPhotoPreview:
|
|
10799
|
+
onPhotoPreview: Q,
|
|
10791
10800
|
onEstimateFromPhoto: z,
|
|
10792
10801
|
estimatingProfileIds: p,
|
|
10793
10802
|
t: T,
|
|
@@ -10834,15 +10843,15 @@ 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
|
}
|
|
10842
10851
|
W(!1), I && k(I);
|
|
10843
10852
|
},
|
|
10844
10853
|
onCancel: () => W(!1),
|
|
10845
|
-
onPhotoPreview:
|
|
10854
|
+
onPhotoPreview: Q,
|
|
10846
10855
|
onEstimate: z,
|
|
10847
10856
|
t: T
|
|
10848
10857
|
}
|
|
@@ -10902,7 +10911,7 @@ function w8({
|
|
|
10902
10911
|
setHeightFeet: D,
|
|
10903
10912
|
heightInches: i,
|
|
10904
10913
|
setHeightInches: o,
|
|
10905
|
-
weight:
|
|
10914
|
+
weight: Q,
|
|
10906
10915
|
setWeight: z,
|
|
10907
10916
|
age: p,
|
|
10908
10917
|
setAge: T,
|
|
@@ -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(Q) || (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" ?
|
|
10935
|
+
f === "in" ? bA(c + 1) : B(String(Math.min(PA, BA + 1)));
|
|
10927
10936
|
}, kA = () => {
|
|
10928
|
-
f === "in" ?
|
|
10929
|
-
}, vA = () => z(String(Math.min(V, y + 1))), SA = () => z(String(Math.max(sA, y - 1))), ff = () => T(String(Math.min(ZA,
|
|
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, {}) }),
|
|
@@ -10978,8 +10987,8 @@ function w8({
|
|
|
10978
10987
|
max: mA,
|
|
10979
10988
|
step: 1,
|
|
10980
10989
|
value: c,
|
|
10981
|
-
onChange: (nf) =>
|
|
10982
|
-
style: { "--ps-pct": `${
|
|
10990
|
+
onChange: (nf) => bA(parseInt(nf.target.value, 10)),
|
|
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
|
}
|
|
@@ -11018,7 +11027,7 @@ function w8({
|
|
|
11018
11027
|
step: 1,
|
|
11019
11028
|
value: y,
|
|
11020
11029
|
onChange: (nf) => z(nf.target.value),
|
|
11021
|
-
style: { "--ps-pct": `${
|
|
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, {}) })
|
|
@@ -11028,7 +11037,7 @@ function w8({
|
|
|
11028
11037
|
/* @__PURE__ */ P("div", { className: "ps-bpm-row-top", children: [
|
|
11029
11038
|
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: E("AGE") }),
|
|
11030
11039
|
/* @__PURE__ */ P("span", { className: "ps-bpm-value-display", children: [
|
|
11031
|
-
Math.round(
|
|
11040
|
+
Math.round(XA),
|
|
11032
11041
|
" ",
|
|
11033
11042
|
E("YEARS")
|
|
11034
11043
|
] })
|
|
@@ -11043,7 +11052,7 @@ function w8({
|
|
|
11043
11052
|
min: dA,
|
|
11044
11053
|
max: ZA,
|
|
11045
11054
|
step: 1,
|
|
11046
|
-
value:
|
|
11055
|
+
value: XA,
|
|
11047
11056
|
onChange: (nf) => T(nf.target.value),
|
|
11048
11057
|
style: { "--ps-pct": `${TA}%` }
|
|
11049
11058
|
}
|
|
@@ -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",
|
|
@@ -11120,11 +11129,11 @@ function Zn({
|
|
|
11120
11129
|
photoVariant: D = "full-body",
|
|
11121
11130
|
photoStepHeight: i,
|
|
11122
11131
|
onPhotoStepHeightChange: o,
|
|
11123
|
-
ageConfirmed:
|
|
11132
|
+
ageConfirmed: Q,
|
|
11124
11133
|
onAgeConfirmedChange: z,
|
|
11125
11134
|
t: p
|
|
11126
11135
|
}) {
|
|
11127
|
-
const T = D === "close-up", F = iA(null), h = !!f, W = !h &&
|
|
11136
|
+
const T = D === "close-up", F = iA(null), h = !!f, W = !h && Q !== !0;
|
|
11128
11137
|
return /* @__PURE__ */ P("div", { className: "ps-pm-root", children: [
|
|
11129
11138
|
/* @__PURE__ */ P("div", { className: "ps-pm-header", children: [
|
|
11130
11139
|
/* @__PURE__ */ A("h2", { className: "ps-pm-title", children: p(T ? "Upload a face photo or selfie" : "Review your photo") }),
|
|
@@ -11171,7 +11180,7 @@ function Zn({
|
|
|
11171
11180
|
]
|
|
11172
11181
|
}
|
|
11173
11182
|
),
|
|
11174
|
-
|
|
11183
|
+
Q === null && /* @__PURE__ */ A("div", { className: "ps-pm-age-gate", role: "dialog", children: /* @__PURE__ */ P("div", { className: "ps-pm-age-gate-card", children: [
|
|
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: [
|
|
@@ -11179,7 +11188,7 @@ function Zn({
|
|
|
11179
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
|
+
Q === !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
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") })
|
|
@@ -11261,12 +11270,12 @@ 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
|
|
11273
|
+
const Q = B === i.value, z = String.fromCharCode(65 + o);
|
|
11265
11274
|
return /* @__PURE__ */ P(
|
|
11266
11275
|
"button",
|
|
11267
11276
|
{
|
|
11268
11277
|
type: "button",
|
|
11269
|
-
className: `ps-bsm-card${
|
|
11278
|
+
className: `ps-bsm-card${Q ? " ps-active" : ""}`,
|
|
11270
11279
|
onClick: () => C(i.value),
|
|
11271
11280
|
children: [
|
|
11272
11281
|
/* @__PURE__ */ P("div", { className: "ps-bsm-card-content", children: [
|
|
@@ -11374,7 +11383,7 @@ function z8({
|
|
|
11374
11383
|
setHeightUnit: D,
|
|
11375
11384
|
weightUnit: i,
|
|
11376
11385
|
setWeightUnit: o,
|
|
11377
|
-
sizingUnit:
|
|
11386
|
+
sizingUnit: Q,
|
|
11378
11387
|
setSizingUnit: z,
|
|
11379
11388
|
onComplete: p,
|
|
11380
11389
|
onSnapSubmit: T,
|
|
@@ -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), [
|
|
11396
|
-
const
|
|
11397
|
-
if (!
|
|
11404
|
+
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [oA, $] = 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), [r, eA] = 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 =
|
|
11422
|
-
|
|
11423
|
-
}, [
|
|
11430
|
+
}, [v, qA]), R = UA(() => {
|
|
11431
|
+
oA && URL.revokeObjectURL(oA), Ef(null), $(null), Of(null), gf.current && (gf.current.value = "");
|
|
11432
|
+
}, [oA]), 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: r,
|
|
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 (!r) 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,30 +11516,30 @@ 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, r, 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" ? !!r : 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
|
{
|
|
11526
|
-
photoPreview:
|
|
11535
|
+
photoPreview: oA,
|
|
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
|
-
onPhotoStepHeightChange:
|
|
11542
|
+
onPhotoStepHeightChange: uA,
|
|
11534
11543
|
ageConfirmed: qA,
|
|
11535
11544
|
onAgeConfirmedChange: (M) => {
|
|
11536
11545
|
GA(M), M === !0 && QA("");
|
|
@@ -11544,7 +11553,7 @@ function z8({
|
|
|
11544
11553
|
"div",
|
|
11545
11554
|
{
|
|
11546
11555
|
onClick: () => {
|
|
11547
|
-
!
|
|
11556
|
+
!oA && qA === !0 && gf.current?.click();
|
|
11548
11557
|
},
|
|
11549
11558
|
style: {
|
|
11550
11559
|
flex: 1,
|
|
@@ -11552,20 +11561,20 @@ function z8({
|
|
|
11552
11561
|
flexDirection: "column",
|
|
11553
11562
|
alignItems: "center",
|
|
11554
11563
|
justifyContent: "center",
|
|
11555
|
-
border:
|
|
11564
|
+
border: oA ? "2px solid var(--ps-accent)" : "2px dashed var(--ps-border-color)",
|
|
11556
11565
|
borderRadius: "0.5vw",
|
|
11557
|
-
cursor:
|
|
11566
|
+
cursor: oA ? "default" : qA === !0 ? "pointer" : "not-allowed",
|
|
11558
11567
|
position: "relative",
|
|
11559
11568
|
background: "var(--ps-bg-secondary)",
|
|
11560
11569
|
transition: "border-color 0.2s, filter 0.25s",
|
|
11561
11570
|
overflow: "hidden",
|
|
11562
|
-
filter: !
|
|
11563
|
-
pointerEvents: !
|
|
11564
|
-
userSelect: !
|
|
11571
|
+
filter: !oA && qA !== !0 ? "blur(6px) saturate(0.7)" : void 0,
|
|
11572
|
+
pointerEvents: !oA && qA !== !0 ? "none" : void 0,
|
|
11573
|
+
userSelect: !oA && qA !== !0 ? "none" : void 0
|
|
11565
11574
|
},
|
|
11566
|
-
"aria-hidden": !
|
|
11567
|
-
children:
|
|
11568
|
-
/* @__PURE__ */ A("img", { src:
|
|
11575
|
+
"aria-hidden": !oA && qA !== !0,
|
|
11576
|
+
children: oA ? /* @__PURE__ */ P(tA, { children: [
|
|
11577
|
+
/* @__PURE__ */ A("img", { src: oA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
11569
11578
|
/* @__PURE__ */ A("button", { onClick: (M) => {
|
|
11570
11579
|
M.stopPropagation(), R();
|
|
11571
11580
|
}, 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: "×" })
|
|
@@ -11577,7 +11586,7 @@ function z8({
|
|
|
11577
11586
|
] })
|
|
11578
11587
|
}
|
|
11579
11588
|
),
|
|
11580
|
-
!
|
|
11589
|
+
!oA && qA === null && /* @__PURE__ */ A(
|
|
11581
11590
|
"div",
|
|
11582
11591
|
{
|
|
11583
11592
|
role: "dialog",
|
|
@@ -11661,7 +11670,7 @@ function z8({
|
|
|
11661
11670
|
] })
|
|
11662
11671
|
}
|
|
11663
11672
|
),
|
|
11664
|
-
!
|
|
11673
|
+
!oA && qA === !1 && /* @__PURE__ */ A(
|
|
11665
11674
|
"div",
|
|
11666
11675
|
{
|
|
11667
11676
|
role: "alert",
|
|
@@ -11787,7 +11796,7 @@ function z8({
|
|
|
11787
11796
|
type: "button",
|
|
11788
11797
|
className: "ps-bpm-next-btn",
|
|
11789
11798
|
onClick: $A,
|
|
11790
|
-
disabled: !
|
|
11799
|
+
disabled: !oA,
|
|
11791
11800
|
children: v("Analyze My Size")
|
|
11792
11801
|
}
|
|
11793
11802
|
),
|
|
@@ -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
|
|
@@ -11811,7 +11820,7 @@ function z8({
|
|
|
11811
11820
|
/* @__PURE__ */ A(
|
|
11812
11821
|
"button",
|
|
11813
11822
|
{
|
|
11814
|
-
className: `ps-bp-next-btn${
|
|
11823
|
+
className: `ps-bp-next-btn${oA ? "" : " ps-bp-btn-disabled"}`,
|
|
11815
11824
|
onClick: $A,
|
|
11816
11825
|
type: "button",
|
|
11817
11826
|
children: v("Analyze My Size")
|
|
@@ -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 &&
|
|
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 &&
|
|
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
|
-
setWeight:
|
|
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,9 +11954,9 @@ 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
11961
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
11953
11962
|
] }, "step-chest")),
|
|
@@ -11967,20 +11976,20 @@ 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
11994
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
11986
11995
|
] }, "step-midsection")),
|
|
@@ -11999,21 +12008,21 @@ 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:
|
|
12003
|
-
onSelect: (M) =>
|
|
12011
|
+
selected: zA,
|
|
12012
|
+
onSelect: (M) => YA(M),
|
|
12004
12013
|
t: v
|
|
12005
12014
|
},
|
|
12006
12015
|
"step-seat-mobile"
|
|
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
12027
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
12019
12028
|
] }, "step-seat")),
|
|
@@ -12028,17 +12037,17 @@ 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:
|
|
12032
|
-
onSelect: (M) =>
|
|
12040
|
+
selected: r,
|
|
12041
|
+
onSelect: (M) => eA(M),
|
|
12033
12042
|
t: v
|
|
12034
12043
|
},
|
|
12035
12044
|
"step-hips-mobile"
|
|
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: r === "narrow", onSelect: () => eA("narrow"), onHover: () => J(v("Hips closer to shoulder width")), onLeave: () => J("") }),
|
|
12049
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.average, label: v("Average"), selected: r === "average", onSelect: () => eA("average"), onHover: () => J(v("Hips proportionate to shoulders")), onLeave: () => J("") }),
|
|
12050
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.full, label: v("Curvy"), selected: r === "full", onSelect: () => eA("full"), onHover: () => J(v("Hips wider than shoulders")), onLeave: () => J("") })
|
|
12042
12051
|
] }),
|
|
12043
12052
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
12044
12053
|
] }, "step-hips")),
|
|
@@ -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
|
|
@@ -12154,7 +12163,7 @@ function SP({
|
|
|
12154
12163
|
productTitle: D,
|
|
12155
12164
|
formRef: i,
|
|
12156
12165
|
sizingUnit: o,
|
|
12157
|
-
setSizingUnit:
|
|
12166
|
+
setSizingUnit: Q,
|
|
12158
12167
|
setSizingMethod: z,
|
|
12159
12168
|
setSizingLoading: p,
|
|
12160
12169
|
setView: T,
|
|
@@ -12163,56 +12172,56 @@ 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
|
|
12178
|
-
sA(
|
|
12186
|
+
const bA = await AP(EA);
|
|
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
|
-
const
|
|
12195
|
-
|
|
12203
|
+
const bA = parseFloat(O[TA.key] || "");
|
|
12204
|
+
bA > 0 && (i.current[TA.key] = String(bA));
|
|
12196
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."));
|
|
12200
12209
|
return;
|
|
12201
12210
|
}
|
|
12202
|
-
if (!l || !
|
|
12211
|
+
if (!l || !XA) {
|
|
12203
12212
|
E(t("Please upload a photo"));
|
|
12204
12213
|
return;
|
|
12205
12214
|
}
|
|
12206
12215
|
h({
|
|
12207
12216
|
photoFile: l,
|
|
12208
|
-
photoBase64:
|
|
12217
|
+
photoBase64: XA,
|
|
12209
12218
|
height: 0,
|
|
12210
12219
|
weight: 0,
|
|
12211
12220
|
heightUnit: "cm",
|
|
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: () =>
|
|
12240
|
-
children: t(
|
|
12247
|
+
className: `ps-bpm-toggle-btn${o === m.value ? " ps-bpm-toggle-active" : ""}`,
|
|
12248
|
+
onClick: () => Q(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: () =>
|
|
12576
|
-
children: t(
|
|
12583
|
+
className: `ps-bp-system-btn${o === m.value ? " ps-bp-system-active" : ""}`,
|
|
12584
|
+
onClick: () => Q(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, {}),
|
|
@@ -12631,7 +12640,7 @@ function p8(f) {
|
|
|
12631
12640
|
const n = f?.requiredFields;
|
|
12632
12641
|
if (!n || n.length === 0) return tP;
|
|
12633
12642
|
const g = /* @__PURE__ */ new Set(["size", "country", "eu", "__skip__", "shoeEU", "shoeUS", "shoeUK", "shoeJP"]), e = (C, D) => {
|
|
12634
|
-
const i = tP.find((
|
|
12643
|
+
const i = tP.find((Q) => Q.key === C);
|
|
12635
12644
|
return i ? i.placeholder : /foot|length/i.test(C) || /foot|length/i.test(D) ? tP[0].placeholder : { cm: "", in: "" };
|
|
12636
12645
|
}, B = n.filter((C) => !g.has(C.key) && C.unit !== "size").map((C) => {
|
|
12637
12646
|
const D = e(C.key, C.label || "");
|
|
@@ -12777,7 +12786,7 @@ function R8({
|
|
|
12777
12786
|
showIcon: D = !0,
|
|
12778
12787
|
buttonIcon: i,
|
|
12779
12788
|
locale: o,
|
|
12780
|
-
buttonStyles:
|
|
12789
|
+
buttonStyles: Q = {},
|
|
12781
12790
|
modalStyles: z = {},
|
|
12782
12791
|
classNames: p = {},
|
|
12783
12792
|
className: T,
|
|
@@ -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 = wf(() => Hg(
|
|
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"), [
|
|
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, oA] = 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
|
-
w === "foot" || w === "head" ?
|
|
12813
|
+
w === "foot" || w === "head" ? uA("cm") : w === "face" && uA("mm");
|
|
12805
12814
|
}, [n]);
|
|
12806
|
-
const
|
|
12815
|
+
const r = iA({}), [eA, 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 =
|
|
12810
|
-
KA.current = w, vf.current =
|
|
12811
|
-
}, []),
|
|
12818
|
+
}), M = UA((w, H) => {
|
|
12819
|
+
KA.current = w, vf.current = H;
|
|
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
|
-
const w = bf(),
|
|
12815
|
-
|
|
12823
|
+
const w = bf(), H = uf(B);
|
|
12824
|
+
pA.current = new zg(w, H), tf.current = new cg(pA.current.getStreamUrl());
|
|
12816
12825
|
} catch {
|
|
12817
12826
|
}
|
|
12818
12827
|
return () => {
|
|
@@ -12831,14 +12840,14 @@ function R8({
|
|
|
12831
12840
|
{ at: 50, text: E("Generating virtual try-on...") },
|
|
12832
12841
|
{ at: 75, text: E("Refining details...") },
|
|
12833
12842
|
{ at: 90, text: E("Almost there...") }
|
|
12834
|
-
],
|
|
12843
|
+
], H = 2 * Math.PI * 27;
|
|
12835
12844
|
return Tf.current = setInterval(() => {
|
|
12836
12845
|
if (pf.current) return;
|
|
12837
12846
|
const Y = pP.current || Date.now(), wA = (Date.now() - Y) / 1e3, L = Math.min(95, wA / cP * 100);
|
|
12838
12847
|
nP.current = L;
|
|
12839
12848
|
const Z = Math.round(L);
|
|
12840
12849
|
if (mf.current && (mf.current.style.width = `${Z}%`), Nf.current && (Nf.current.textContent = `${Z}%`), yf.current) {
|
|
12841
|
-
const d =
|
|
12850
|
+
const d = H * (1 - L / 100);
|
|
12842
12851
|
yf.current.style.strokeDashoffset = String(d);
|
|
12843
12852
|
}
|
|
12844
12853
|
if (Lf.current) {
|
|
@@ -12863,9 +12872,9 @@ function R8({
|
|
|
12863
12872
|
V && URL.revokeObjectURL(V);
|
|
12864
12873
|
}, [V]), JA(() => {
|
|
12865
12874
|
if (l !== "idle") {
|
|
12866
|
-
const w = window.scrollY,
|
|
12875
|
+
const w = window.scrollY, H = document.body.style.overflow, Y = document.body.style.overscrollBehavior;
|
|
12867
12876
|
return document.body.style.overflow = "hidden", document.body.style.overscrollBehavior = "none", () => {
|
|
12868
|
-
document.body.style.overflow =
|
|
12877
|
+
document.body.style.overflow = H, document.body.style.overscrollBehavior = Y, window.scrollTo(0, w);
|
|
12869
12878
|
};
|
|
12870
12879
|
}
|
|
12871
12880
|
}, [l]), JA(() => {
|
|
@@ -12881,15 +12890,15 @@ 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
|
}
|
|
12888
12897
|
cf(!0);
|
|
12889
|
-
const w = uf(B),
|
|
12898
|
+
const w = uf(B), H = bf();
|
|
12890
12899
|
fetch(`${w}/api/v1/sizing/sizeguide`, {
|
|
12891
12900
|
method: "POST",
|
|
12892
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${
|
|
12901
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${H}` },
|
|
12893
12902
|
body: JSON.stringify({ product: { title: n, productId: O }, sizeGuideRaw: I })
|
|
12894
12903
|
}).then((Y) => Y.ok ? Y.json() : null).then((Y) => {
|
|
12895
12904
|
_A(Y || { found: !1 });
|
|
@@ -12912,8 +12921,8 @@ function R8({
|
|
|
12912
12921
|
default:
|
|
12913
12922
|
return 1;
|
|
12914
12923
|
}
|
|
12915
|
-
}, [l]), Zf =
|
|
12916
|
-
(w,
|
|
12924
|
+
}, [l]), Zf = UA(
|
|
12925
|
+
(w, H) => {
|
|
12917
12926
|
let Y = lA, wA = OA.find((L) => L.id === Y);
|
|
12918
12927
|
if (!wA) {
|
|
12919
12928
|
const L = {
|
|
@@ -12950,31 +12959,31 @@ function R8({
|
|
|
12950
12959
|
}).then((L) => {
|
|
12951
12960
|
!L || !Y || (FP(Y, L.estimates, L.unit), AA(af("profiles", [])));
|
|
12952
12961
|
}).catch(() => {
|
|
12953
|
-
}).finally(() => xA(!0)),
|
|
12954
|
-
const L =
|
|
12955
|
-
Object.entries(
|
|
12962
|
+
}).finally(() => xA(!0)), H?.recommendedSize && Y) {
|
|
12963
|
+
const L = H.sections ? Object.fromEntries(
|
|
12964
|
+
Object.entries(H.sections).map(([Z, d]) => [Z, d.recommendedSize])
|
|
12956
12965
|
) : void 0;
|
|
12957
12966
|
Tn(Y, {
|
|
12958
12967
|
productId: O,
|
|
12959
12968
|
productTitle: n,
|
|
12960
12969
|
productImage: f,
|
|
12961
|
-
recommendedSize:
|
|
12962
|
-
confidence:
|
|
12970
|
+
recommendedSize: H.recommendedSize,
|
|
12971
|
+
confidence: H.confidence,
|
|
12963
12972
|
sections: L,
|
|
12964
12973
|
savedAt: Date.now()
|
|
12965
12974
|
}), AA(af("profiles", []));
|
|
12966
12975
|
}
|
|
12967
12976
|
},
|
|
12968
12977
|
[lA, OA, B, f, n, O, G]
|
|
12969
|
-
), UP = iA(null), [qf, EP] = j(null), yP =
|
|
12970
|
-
const
|
|
12971
|
-
if (!wA && L &&
|
|
12978
|
+
), UP = iA(null), [qf, EP] = j(null), yP = UA(async (w) => {
|
|
12979
|
+
const H = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0, wA = !!w.measurements && Object.keys(w.measurements).length > 0, L = w.photoBase64;
|
|
12980
|
+
if (!wA && L && H > 0 && UP.current) {
|
|
12972
12981
|
try {
|
|
12973
12982
|
const d = L.startsWith("data:") ? L : `data:image/jpeg;base64,${L}`, b = await fetch(d).then((DA) => DA.blob()), HA = new File([b], "profile-photo.jpg", { type: b.type || "image/jpeg" });
|
|
12974
12983
|
await UP.current({
|
|
12975
12984
|
photoFile: HA,
|
|
12976
12985
|
photoBase64: L,
|
|
12977
|
-
height:
|
|
12986
|
+
height: H,
|
|
12978
12987
|
weight: Y,
|
|
12979
12988
|
heightUnit: w.heightUnit || "cm",
|
|
12980
12989
|
weightUnit: w.weightUnit || "kg",
|
|
@@ -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
|
-
const
|
|
13016
|
-
|
|
13017
|
-
}, [OA, lA]), Ag =
|
|
13024
|
+
const H = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0;
|
|
13025
|
+
H > 0 && Y > 0 && EP(w);
|
|
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 =
|
|
13030
|
+
}, [qf, yP]), fg = UA(() => {
|
|
13022
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), r.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;
|
|
@@ -13039,7 +13048,7 @@ function R8({
|
|
|
13039
13048
|
break;
|
|
13040
13049
|
case "size-result":
|
|
13041
13050
|
if (TA) {
|
|
13042
|
-
|
|
13051
|
+
bA(null);
|
|
13043
13052
|
break;
|
|
13044
13053
|
}
|
|
13045
13054
|
y("body-profile");
|
|
@@ -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;
|
|
@@ -13071,42 +13080,42 @@ function R8({
|
|
|
13071
13080
|
return;
|
|
13072
13081
|
}
|
|
13073
13082
|
sA(w), Jf.current = w;
|
|
13074
|
-
const
|
|
13075
|
-
s(
|
|
13083
|
+
const H = URL.createObjectURL(w);
|
|
13084
|
+
s(H), t?.(w), If.current = null, rP(H).then((Y) => {
|
|
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
|
-
if (RA((
|
|
13094
|
+
if (RA((H) => !H || H.startsWith("data:") || !w.imageUrl.startsWith("data:") ? w.imageUrl : H), !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) {
|
|
13087
|
-
const
|
|
13088
|
-
|
|
13089
|
-
|
|
13096
|
+
const H = Sf.current;
|
|
13097
|
+
H.style.opacity = "0", setTimeout(() => {
|
|
13098
|
+
H.textContent = E("Complete!"), H.style.opacity = "1";
|
|
13090
13099
|
}, 180);
|
|
13091
13100
|
}
|
|
13092
|
-
Wf(),
|
|
13101
|
+
Wf(), oA(!1), u?.({ jobId: w.galleryId, imageUrl: w.imageUrl });
|
|
13093
13102
|
}
|
|
13094
13103
|
} else if (w.status === "failed" && !pf.current) {
|
|
13095
|
-
pf.current = !0, Wf(),
|
|
13096
|
-
const
|
|
13097
|
-
dA(
|
|
13104
|
+
pf.current = !0, Wf(), oA(!1);
|
|
13105
|
+
const H = w.error || E("Try-on generation failed");
|
|
13106
|
+
dA(H), y("error"), v?.({ message: H });
|
|
13098
13107
|
}
|
|
13099
|
-
}, [u, v, Wf]), Kf = wf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields :
|
|
13100
|
-
if (!
|
|
13101
|
-
const
|
|
13108
|
+
}, [u, v, Wf]), Kf = wf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields : eA === "female" ? Og : Kg, [$, eA]), Vf = UA(async (w) => {
|
|
13109
|
+
if (!pA.current) return;
|
|
13110
|
+
const H = 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 = r.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,67 +13127,67 @@ 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
|
}
|
|
13147
13156
|
return;
|
|
13148
13157
|
}
|
|
13149
13158
|
const Z = {
|
|
13150
|
-
method:
|
|
13159
|
+
method: H,
|
|
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:",
|
|
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:", H, "| sizingUnit:", _, "| heightUnit:", WA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(r.current)), console.log("[PS-SDK] dynamicFields:", Kf.map((d) => `${d.key}(unit=${d.unit},req=${d.required})`).join(", ")), H === "exact") {
|
|
13164
|
+
const d = { gender: r.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
|
+
r.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 = r.current[HA];
|
|
13163
13172
|
if (!DA) continue;
|
|
13164
13173
|
const CA = parseFloat(DA);
|
|
13165
13174
|
isNaN(CA) || (d[HA] = CA);
|
|
13166
13175
|
}
|
|
13167
|
-
|
|
13176
|
+
r.current.shoeEU && (d.shoeEU = r.current.shoeEU), r.current.shoeUS && (d.shoeUS = r.current.shoeUS), r.current.shoeUK && (d.shoeUK = r.current.shoeUK), r.current.fitPreference && (d.fitPreference = r.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(r.current.height || "0"), b = parseFloat(r.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(r.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: r.current.heightUnit || WA || "cm",
|
|
13187
|
+
weightUnit: r.current.weightUnit || X || "kg",
|
|
13188
|
+
gender: r.current.gender || "male"
|
|
13180
13189
|
};
|
|
13181
|
-
|
|
13190
|
+
r.current.age && (HA.age = parseInt(r.current.age, 10)), r.current.bodyType && (HA.bodyType = r.current.bodyType), r.current.chestProfile && (HA.chestProfile = r.current.chestProfile), r.current.midsectionProfile && (HA.midsectionProfile = r.current.midsectionProfile), r.current.hipProfile && (HA.hipProfile = r.current.hipProfile), Z.quickEstimate = HA;
|
|
13182
13191
|
}
|
|
13183
13192
|
xA(!1);
|
|
13184
13193
|
try {
|
|
@@ -13190,7 +13199,7 @@ function R8({
|
|
|
13190
13199
|
if (d.ok) {
|
|
13191
13200
|
const b = await d.json();
|
|
13192
13201
|
console.log("[PS-SDK] Sizing recommend RESULT:", JSON.stringify(b)), SA(b), u?.(b);
|
|
13193
|
-
const HA = Z.measurements || {}, DA = Z.quickEstimate || {}, CA =
|
|
13202
|
+
const HA = Z.measurements || {}, DA = Z.quickEstimate || {}, CA = H === "exact" ? HA : DA;
|
|
13194
13203
|
Zf(
|
|
13195
13204
|
{
|
|
13196
13205
|
gender: CA.gender || "male",
|
|
@@ -13214,42 +13223,42 @@ 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, H, 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
|
+
r.current.height = String(w), r.current.weight = String(H), r.current.heightUnit = Y, r.current.weightUnit = wA, r.current.gender = L, Z && (r.current.age = String(Z)), d && (r.current.bodyType = d), b && (r.current.chestProfile = b), HA && (r.current.midsectionProfile = HA), DA && (r.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;
|
|
13248
13257
|
}
|
|
13249
|
-
const
|
|
13250
|
-
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl:
|
|
13258
|
+
const H = uf(B), Y = bf();
|
|
13259
|
+
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: H }), sA(w.photoFile), Jf.current = w.photoFile;
|
|
13251
13260
|
const wA = w.photoFile ? URL.createObjectURL(w.photoFile) : w.photoBase64.startsWith("data:") ? w.photoBase64 : `data:image/jpeg;base64,${w.photoBase64}`;
|
|
13252
|
-
s(wA), pf.current = !1,
|
|
13261
|
+
s(wA), pf.current = !1, oA(!1), SA(null), RA(null), rA(!0), xA(!1), y("size-result");
|
|
13253
13262
|
const L = Xf(n);
|
|
13254
13263
|
if (L === "face" || L === "head") {
|
|
13255
13264
|
LP(null);
|
|
@@ -13265,7 +13274,7 @@ function R8({
|
|
|
13265
13274
|
bodyImage: w.photoBase64
|
|
13266
13275
|
};
|
|
13267
13276
|
CA && (zf.faceMeasurementsMm = CA.measurementsMm, zf.faceLandmarks = CA.landmarks, zf.irisConfidence = CA.irisConfidence);
|
|
13268
|
-
const df = await fetch(`${
|
|
13277
|
+
const df = await fetch(`${H}/api/v1/sizing/face-recommend`, {
|
|
13269
13278
|
method: "POST",
|
|
13270
13279
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${Y}` },
|
|
13271
13280
|
body: JSON.stringify(zf)
|
|
@@ -13320,7 +13329,7 @@ function R8({
|
|
|
13320
13329
|
};
|
|
13321
13330
|
$?.found && (HA.sizeGuide = $);
|
|
13322
13331
|
try {
|
|
13323
|
-
const DA = await fetch(`${
|
|
13332
|
+
const DA = await fetch(`${H}/api/v1/sizing/recommend`, {
|
|
13324
13333
|
method: "POST",
|
|
13325
13334
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${Y}` },
|
|
13326
13335
|
body: JSON.stringify(HA)
|
|
@@ -13347,15 +13356,15 @@ function R8({
|
|
|
13347
13356
|
rA(!1);
|
|
13348
13357
|
}, [B, f, n, _, X, gf, $, Kf, Zf]);
|
|
13349
13358
|
UP.current = dP;
|
|
13350
|
-
const WP =
|
|
13351
|
-
const
|
|
13352
|
-
if (!
|
|
13353
|
-
const Z =
|
|
13359
|
+
const WP = UA(async (w) => {
|
|
13360
|
+
const H = w || XA || Jf.current;
|
|
13361
|
+
if (!H || !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
|
}
|
|
13357
|
-
w && w !==
|
|
13358
|
-
const Y = En(Xf(n)), wA = Y === "apparel", L = (w ? null : V) || URL.createObjectURL(
|
|
13366
|
+
w && w !== XA && (sA(w), Jf.current = w), pf.current = !1, oA(!0);
|
|
13367
|
+
const Y = En(Xf(n)), wA = Y === "apparel", L = (w ? null : V) || URL.createObjectURL(H);
|
|
13359
13368
|
(w || !V) && s(L), If.current = null, lf(null), wA && (rP(L).then((Z) => {
|
|
13360
13369
|
If.current = Z;
|
|
13361
13370
|
}).catch(() => {
|
|
@@ -13364,10 +13373,10 @@ function R8({
|
|
|
13364
13373
|
}).catch(() => {
|
|
13365
13374
|
}));
|
|
13366
13375
|
try {
|
|
13367
|
-
const Z = await AP(
|
|
13376
|
+
const Z = await AP(H);
|
|
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,10 +13408,10 @@ 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
|
-
}, [
|
|
13403
|
-
if (!
|
|
13404
|
-
|
|
13405
|
-
const
|
|
13411
|
+
}, [XA, f, n, vA, k, v, aP]), og = UA(async (w) => {
|
|
13412
|
+
if (!XA || !pA.current || !tf.current) return;
|
|
13413
|
+
EA(!0);
|
|
13414
|
+
const H = En(Xf(n)), Y = H === "apparel";
|
|
13406
13415
|
if (Y && If.current) {
|
|
13407
13416
|
const wA = {
|
|
13408
13417
|
chest: "chest",
|
|
@@ -13421,11 +13430,11 @@ 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(
|
|
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,
|
|
13428
|
-
|
|
13437
|
+
H ?? "apparel",
|
|
13429
13438
|
{
|
|
13430
13439
|
productId: O,
|
|
13431
13440
|
productTitle: n,
|
|
@@ -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,60 +13451,60 @@ 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
|
-
}, [
|
|
13466
|
+
}, [XA, f, n]), wg = UA(() => {
|
|
13458
13467
|
if (PA)
|
|
13459
13468
|
if (PA.startsWith("data:")) {
|
|
13460
13469
|
const w = document.createElement("a");
|
|
13461
13470
|
w.href = PA, w.download = `primestyle-tryon-${Date.now()}.png`, w.click();
|
|
13462
13471
|
} else
|
|
13463
13472
|
fetch(PA).then((w) => w.blob()).then((w) => {
|
|
13464
|
-
const
|
|
13465
|
-
Y.href =
|
|
13473
|
+
const H = URL.createObjectURL(w), Y = document.createElement("a");
|
|
13474
|
+
Y.href = H, Y.download = `primestyle-tryon-${Date.now()}.png`, Y.click(), setTimeout(() => URL.revokeObjectURL(H), 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 =
|
|
13470
|
-
const
|
|
13471
|
-
if (!
|
|
13478
|
+
}, [V, Wf]), Dg = UA((w) => {
|
|
13479
|
+
const H = OA.find((wA) => wA.id === w);
|
|
13480
|
+
if (!H) return;
|
|
13472
13481
|
G(w), AA((wA) => wA.map((L) => L.id === w ? { ...L, lastUsedAt: Date.now() } : L));
|
|
13473
|
-
const Y = { gender:
|
|
13474
|
-
if ((
|
|
13475
|
-
for (const [wA, L] of Object.entries(
|
|
13482
|
+
const Y = { gender: H.gender || "male" };
|
|
13483
|
+
if ((H.height ?? H.heightCm) && (Y.height = String(H.height ?? H.heightCm)), (H.weight ?? H.weightKg) && (Y.weight = String(H.weight ?? H.weightKg)), H.chest && (Y.chest = String(H.chest)), H.bust && (Y.bust = String(H.bust)), H.waist && (Y.waist = String(H.waist)), H.hips && (Y.hips = String(H.hips)), H.shoulderWidth && (Y.shoulderWidth = String(H.shoulderWidth)), H.sleeveLength && (Y.sleeveLength = String(H.sleeveLength)), H.inseam && (Y.inseam = String(H.inseam)), H.neckCircumference && (Y.neckCircumference = String(H.neckCircumference)), H.footLengthCm && (Y.footLengthCm = String(H.footLengthCm)), H.shoeEU && (Y.shoeEU = H.shoeEU), H.shoeUS && (Y.shoeUS = H.shoeUS), H.shoeUK && (Y.shoeUK = H.shoeUK), H.fitPreference && (Y.fitPreference = H.fitPreference), H.customMeasurements)
|
|
13484
|
+
for (const [wA, L] of Object.entries(H.customMeasurements))
|
|
13476
13485
|
Y[wA] = String(L);
|
|
13477
|
-
|
|
13486
|
+
r.current = Y, zA(Y.gender || "male"), H.country && qA(H.country), H.sizingUnit && uA(H.sizingUnit), H.heightUnit && a(H.heightUnit), H.weightUnit && nA(H.weightUnit), of((wA) => wA + 1);
|
|
13478
13487
|
}, [OA]);
|
|
13479
|
-
Pg.current = Dg,
|
|
13480
|
-
const Y = (
|
|
13488
|
+
Pg.current = Dg, UA((w, H) => {
|
|
13489
|
+
const Y = (H ? 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: r.current.gender || "male",
|
|
13493
|
+
height: r.current.height ? parseFloat(r.current.height) : void 0,
|
|
13494
|
+
weight: r.current.weight ? parseFloat(r.current.weight) : void 0,
|
|
13495
|
+
chest: r.current.chest ? parseFloat(r.current.chest) : void 0,
|
|
13496
|
+
bust: r.current.bust ? parseFloat(r.current.bust) : void 0,
|
|
13497
|
+
waist: r.current.waist ? parseFloat(r.current.waist) : void 0,
|
|
13498
|
+
hips: r.current.hips ? parseFloat(r.current.hips) : void 0,
|
|
13499
|
+
shoulderWidth: r.current.shoulderWidth ? parseFloat(r.current.shoulderWidth) : void 0,
|
|
13500
|
+
sleeveLength: r.current.sleeveLength ? parseFloat(r.current.sleeveLength) : void 0,
|
|
13501
|
+
inseam: r.current.inseam ? parseFloat(r.current.inseam) : void 0,
|
|
13502
|
+
neckCircumference: r.current.neckCircumference ? parseFloat(r.current.neckCircumference) : void 0,
|
|
13503
|
+
footLengthCm: r.current.footLengthCm ? parseFloat(r.current.footLengthCm) : void 0,
|
|
13504
|
+
shoeEU: r.current.shoeEU,
|
|
13505
|
+
shoeUS: r.current.shoeUS,
|
|
13506
|
+
shoeUK: r.current.shoeUK,
|
|
13507
|
+
fitPreference: r.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(r.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,
|
|
@@ -13555,49 +13564,49 @@ function R8({
|
|
|
13555
13564
|
date: Date.now()
|
|
13556
13565
|
};
|
|
13557
13566
|
if (lA) {
|
|
13558
|
-
const
|
|
13559
|
-
|
|
13567
|
+
const H = OA.find((Y) => Y.id === lA);
|
|
13568
|
+
H && (w.profileName = H.name);
|
|
13560
13569
|
}
|
|
13561
|
-
Pf((
|
|
13570
|
+
Pf((H) => [w, ...H].slice(0, 50));
|
|
13562
13571
|
}, [n, f, PA, vA, $, lA, OA]), Yf = iA(!1), gP = iA(!1);
|
|
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",
|
|
13570
13579
|
reasoning: w.reasoning || "",
|
|
13571
13580
|
internationalSizes: w.internationalSizes,
|
|
13572
13581
|
matchDetails: w.matchDetails
|
|
13573
|
-
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), rA(!1),
|
|
13574
|
-
}, []), ig =
|
|
13575
|
-
|
|
13582
|
+
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), rA(!1), oA(!1), bA(null), NA(null), y("size-result");
|
|
13583
|
+
}, []), ig = UA((w, H) => {
|
|
13584
|
+
r.current[w] = H;
|
|
13576
13585
|
}, []);
|
|
13577
13586
|
wf(() => {
|
|
13578
|
-
const
|
|
13587
|
+
const H = {
|
|
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" },
|
|
13581
13590
|
AU: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" }
|
|
13582
13591
|
}[gf] || { key: "shoeEU", labelKey: "Shoe size (EU)", ph: "e.g. 43" };
|
|
13583
|
-
return { key:
|
|
13592
|
+
return { key: H.key, label: E(H.labelKey), ph: H.ph };
|
|
13584
13593
|
}, [gf, E]);
|
|
13585
13594
|
const tg = {
|
|
13586
|
-
"--ps-btn-bg":
|
|
13587
|
-
"--ps-btn-color":
|
|
13588
|
-
"--ps-btn-radius":
|
|
13589
|
-
"--ps-btn-font-size":
|
|
13590
|
-
"--ps-btn-font":
|
|
13591
|
-
"--ps-btn-font-weight":
|
|
13592
|
-
"--ps-btn-padding":
|
|
13593
|
-
"--ps-btn-border":
|
|
13594
|
-
"--ps-btn-width":
|
|
13595
|
-
"--ps-btn-height":
|
|
13596
|
-
"--ps-btn-hover-bg":
|
|
13597
|
-
"--ps-btn-hover-color":
|
|
13598
|
-
"--ps-btn-icon-size":
|
|
13599
|
-
"--ps-btn-icon-color":
|
|
13600
|
-
"--ps-btn-shadow":
|
|
13595
|
+
"--ps-btn-bg": Q.backgroundColor,
|
|
13596
|
+
"--ps-btn-color": Q.textColor,
|
|
13597
|
+
"--ps-btn-radius": Q.borderRadius,
|
|
13598
|
+
"--ps-btn-font-size": Q.fontSize,
|
|
13599
|
+
"--ps-btn-font": Q.fontFamily,
|
|
13600
|
+
"--ps-btn-font-weight": Q.fontWeight,
|
|
13601
|
+
"--ps-btn-padding": Q.padding,
|
|
13602
|
+
"--ps-btn-border": Q.border,
|
|
13603
|
+
"--ps-btn-width": Q.width,
|
|
13604
|
+
"--ps-btn-height": Q.height,
|
|
13605
|
+
"--ps-btn-hover-bg": Q.hoverBackgroundColor,
|
|
13606
|
+
"--ps-btn-hover-color": Q.hoverTextColor,
|
|
13607
|
+
"--ps-btn-icon-size": Q.iconSize,
|
|
13608
|
+
"--ps-btn-icon-color": Q.iconColor,
|
|
13609
|
+
"--ps-btn-shadow": Q.boxShadow,
|
|
13601
13610
|
"--ps-modal-overlay": z.overlayColor,
|
|
13602
13611
|
"--ps-modal-bg": z.backgroundColor,
|
|
13603
13612
|
"--ps-modal-color": z.textColor,
|
|
@@ -13621,8 +13630,8 @@ function R8({
|
|
|
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": z.accentColor ??
|
|
13625
|
-
"--ps-accent-hover": z.accentHoverColor ??
|
|
13633
|
+
"--ps-accent": z.accentColor ?? Q.backgroundColor,
|
|
13634
|
+
"--ps-accent-hover": z.accentHoverColor ?? Q.hoverBackgroundColor,
|
|
13626
13635
|
"--ps-accent-light": z.accentLightColor,
|
|
13627
13636
|
"--ps-text-primary": z.textPrimaryColor,
|
|
13628
13637
|
"--ps-text-secondary": z.textSecondaryColor,
|
|
@@ -13638,10 +13647,10 @@ function R8({
|
|
|
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),
|
|
13642
|
-
if (w === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(j8, { ...
|
|
13643
|
-
if (w === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(a8, { ...
|
|
13644
|
-
if (w === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(I8, { ...
|
|
13650
|
+
const w = Xf(n), H = { productImage: f, productTitle: n, formRef: r, sizingUnit: _, setSizingUnit: uA, setSizingMethod: kA, setSizingLoading: rA, setView: y, submitSizing: Vf, onSnapSubmit: dP, onBack: Gf, sizeGuide: $, t: E };
|
|
13651
|
+
if (w === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(j8, { ...H }) }, "v-foot");
|
|
13652
|
+
if (w === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(a8, { ...H }) }, "v-head");
|
|
13653
|
+
if (w === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(I8, { ...H }) }, "v-face");
|
|
13645
13654
|
const Y = !!($?.requiredFields?.some((d) => d.key === "bust") || $?.sections && Object.values($.sections).some((d) => d.requiredFields?.some((b) => b.key === "bust"))), wA = n.toLowerCase(), L = /\b(women|woman|ladies|female|dress|skirt|blouse|bra)\b/i.test(wA);
|
|
13646
13655
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
13647
13656
|
z8,
|
|
@@ -13649,14 +13658,14 @@ function R8({
|
|
|
13649
13658
|
productImage: f,
|
|
13650
13659
|
productTitle: n,
|
|
13651
13660
|
isWomen: Y || L,
|
|
13652
|
-
formRef:
|
|
13661
|
+
formRef: r,
|
|
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
|
-
setSizingUnit:
|
|
13668
|
+
setSizingUnit: uA,
|
|
13660
13669
|
hasActiveProfileWithMeasurements: (() => {
|
|
13661
13670
|
const d = OA.find((DA) => DA.id === lA);
|
|
13662
13671
|
if (!d) return !1;
|
|
@@ -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), r.current = {};
|
|
13671
13680
|
},
|
|
13672
13681
|
onComplete: (d) => {
|
|
13673
|
-
|
|
13682
|
+
r.current.gender = d.gender, d.bandSize && (r.current.bandSize = d.bandSize), d.cupSize && (r.current.cupSize = d.cupSize), eg(
|
|
13674
13683
|
d.height,
|
|
13675
13684
|
d.weight,
|
|
13676
13685
|
d.heightUnit,
|
|
@@ -13697,15 +13706,15 @@ 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:
|
|
13704
|
-
formGender:
|
|
13705
|
-
formKey:
|
|
13712
|
+
formRef: r,
|
|
13713
|
+
formGender: eA,
|
|
13714
|
+
formKey: YA,
|
|
13706
13715
|
setFormKey: of,
|
|
13707
13716
|
sizingUnit: _,
|
|
13708
|
-
setSizingUnit:
|
|
13717
|
+
setSizingUnit: uA,
|
|
13709
13718
|
updateField: ig,
|
|
13710
13719
|
setSizingMethod: kA,
|
|
13711
13720
|
setSizingLoading: rA,
|
|
@@ -13729,8 +13738,8 @@ function R8({
|
|
|
13729
13738
|
setView: y,
|
|
13730
13739
|
handleDownload: wg,
|
|
13731
13740
|
onRetryWithFit: og,
|
|
13732
|
-
retryLoading:
|
|
13733
|
-
selectedFile:
|
|
13741
|
+
retryLoading: m,
|
|
13742
|
+
selectedFile: XA,
|
|
13734
13743
|
previewUrl: V,
|
|
13735
13744
|
handleFileSelect: ZP,
|
|
13736
13745
|
handleRemovePreview: qP,
|
|
@@ -13740,7 +13749,7 @@ function R8({
|
|
|
13740
13749
|
faceLandmarks: Vn,
|
|
13741
13750
|
measurementType: Xf(n),
|
|
13742
13751
|
activeSection: TA,
|
|
13743
|
-
setActiveSection:
|
|
13752
|
+
setActiveSection: bA,
|
|
13744
13753
|
onResetTryOn: () => {
|
|
13745
13754
|
sA(null), V && URL.revokeObjectURL(V), s(null), RA(null);
|
|
13746
13755
|
},
|
|
@@ -13748,10 +13757,10 @@ function R8({
|
|
|
13748
13757
|
userHeightCm: (() => {
|
|
13749
13758
|
const w = OA.find((L) => L.id === lA);
|
|
13750
13759
|
if (!w) return;
|
|
13751
|
-
const
|
|
13752
|
-
if (!
|
|
13760
|
+
const H = w.height ?? w.heightCm;
|
|
13761
|
+
if (!H || H <= 0) return;
|
|
13753
13762
|
const Y = w.heightUnit, wA = vA?.unit || _;
|
|
13754
|
-
return (Y === "in" || Y === "ft") && wA !== "in" ? Math.round(
|
|
13763
|
+
return (Y === "in" || Y === "ft") && wA !== "in" ? Math.round(H * 2.54) : (!Y || Y === "cm") && wA === "in" ? Math.round(H / 2.54 * 10) / 10 : H;
|
|
13755
13764
|
})(),
|
|
13756
13765
|
t: E
|
|
13757
13766
|
}
|
|
@@ -13760,11 +13769,11 @@ function R8({
|
|
|
13760
13769
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
13761
13770
|
aB,
|
|
13762
13771
|
{
|
|
13763
|
-
selectedFile:
|
|
13772
|
+
selectedFile: XA,
|
|
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,
|
|
@@ -13799,25 +13808,25 @@ function R8({
|
|
|
13799
13808
|
onSelectProfile: (w) => {
|
|
13800
13809
|
G(w), y("body-profile");
|
|
13801
13810
|
},
|
|
13802
|
-
onSaveProfileMeasurements: (w,
|
|
13803
|
-
FP(w,
|
|
13811
|
+
onSaveProfileMeasurements: (w, H, Y) => {
|
|
13812
|
+
FP(w, H, Y ?? OA.find((wA) => wA.id === w)?.measurementsUnit ?? "cm"), AA(af("profiles", []));
|
|
13804
13813
|
},
|
|
13805
|
-
onSaveBraSize: (w,
|
|
13806
|
-
sn(w, { bandSize:
|
|
13814
|
+
onSaveBraSize: (w, H, Y) => {
|
|
13815
|
+
sn(w, { bandSize: H, cupSize: Y }), AA(af("profiles", []));
|
|
13807
13816
|
},
|
|
13808
13817
|
onEditProfile: (w) => {
|
|
13809
13818
|
ef(w);
|
|
13810
13819
|
},
|
|
13811
13820
|
onPhotoPreview: (w) => {
|
|
13812
13821
|
if (w) {
|
|
13813
|
-
const
|
|
13814
|
-
s(
|
|
13822
|
+
const H = w.startsWith("data:") ? w : `data:image/jpeg;base64,${w}`;
|
|
13823
|
+
s(H);
|
|
13815
13824
|
} else
|
|
13816
13825
|
s(null);
|
|
13817
13826
|
},
|
|
13818
13827
|
onEstimateFromPhoto: async (w) => {
|
|
13819
13828
|
try {
|
|
13820
|
-
const
|
|
13829
|
+
const H = await eP(w.photoBase64).catch(() => null), Y = await MP({
|
|
13821
13830
|
apiUrl: B,
|
|
13822
13831
|
height: w.height > 0 ? w.height : void 0,
|
|
13823
13832
|
weight: w.weight > 0 ? w.weight : void 0,
|
|
@@ -13826,7 +13835,7 @@ function R8({
|
|
|
13826
13835
|
gender: w.gender,
|
|
13827
13836
|
age: w.age,
|
|
13828
13837
|
bodyImage: w.photoBase64,
|
|
13829
|
-
bodyLandmarks:
|
|
13838
|
+
bodyLandmarks: H ?? void 0
|
|
13830
13839
|
});
|
|
13831
13840
|
return Y ? { estimates: Y.estimates, unit: Y.unit } : null;
|
|
13832
13841
|
} catch {
|
|
@@ -13834,34 +13843,34 @@ function R8({
|
|
|
13834
13843
|
}
|
|
13835
13844
|
},
|
|
13836
13845
|
onSaveNewProfile: async (w) => {
|
|
13837
|
-
const
|
|
13846
|
+
const H = {
|
|
13838
13847
|
...w,
|
|
13839
13848
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
13840
13849
|
createdAt: Date.now(),
|
|
13841
13850
|
lastUsedAt: Date.now()
|
|
13842
|
-
}, Y = [
|
|
13843
|
-
sf("profiles", Y), AA(Y), G(
|
|
13844
|
-
const wA =
|
|
13845
|
-
!(!!
|
|
13851
|
+
}, Y = [H, ...OA];
|
|
13852
|
+
sf("profiles", Y), AA(Y), G(H.id);
|
|
13853
|
+
const wA = H.heightCm || H.height || 0, L = H.weightKg || H.weight || 0, Z = H.sizingUnit === "in" ? "in" : "cm", d = H.sizingUnit === "in" ? "lbs" : "kg", b = H.photoBase64;
|
|
13854
|
+
!(!!H.measurements && Object.keys(H.measurements).length > 0) && (b || wA > 0 && L > 0) && (QA((CA) => new Set(CA).add(H.id)), (b ? eP(b).catch(() => null) : Promise.resolve(null)).then((CA) => MP({
|
|
13846
13855
|
apiUrl: B,
|
|
13847
13856
|
height: wA > 0 ? wA : void 0,
|
|
13848
13857
|
weight: L > 0 ? L : void 0,
|
|
13849
13858
|
heightUnit: Z,
|
|
13850
13859
|
weightUnit: d,
|
|
13851
|
-
gender:
|
|
13852
|
-
age:
|
|
13853
|
-
chestProfile:
|
|
13854
|
-
midsectionProfile:
|
|
13855
|
-
hipProfile:
|
|
13860
|
+
gender: H.gender,
|
|
13861
|
+
age: H.age,
|
|
13862
|
+
chestProfile: H.chestProfile,
|
|
13863
|
+
midsectionProfile: H.midsectionProfile,
|
|
13864
|
+
hipProfile: H.hipProfile,
|
|
13856
13865
|
bodyImage: b,
|
|
13857
13866
|
bodyLandmarks: CA ?? void 0
|
|
13858
13867
|
})).then((CA) => {
|
|
13859
13868
|
if (CA) {
|
|
13860
|
-
if (FP(
|
|
13861
|
-
const zf = af("profiles", []), df = zf.findIndex((Cf) => Cf.id ===
|
|
13869
|
+
if (FP(H.id, CA.estimates, CA.unit), CA.userEstimates) {
|
|
13870
|
+
const zf = af("profiles", []), df = zf.findIndex((Cf) => Cf.id === H.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", []));
|
|
@@ -13870,12 +13879,12 @@ function R8({
|
|
|
13870
13879
|
}).finally(() => {
|
|
13871
13880
|
QA((CA) => {
|
|
13872
13881
|
const zf = new Set(CA);
|
|
13873
|
-
return zf.delete(
|
|
13882
|
+
return zf.delete(H.id), zf;
|
|
13874
13883
|
});
|
|
13875
13884
|
}));
|
|
13876
13885
|
},
|
|
13877
13886
|
onDeleteProfile: (w) => {
|
|
13878
|
-
AA((
|
|
13887
|
+
AA((H) => H.filter((Y) => Y.id !== w)), lA === w && G(null), sf("profiles", af("profiles", []).filter((H) => H.id !== w));
|
|
13879
13888
|
},
|
|
13880
13889
|
onRequestDelete: (w) => R(w),
|
|
13881
13890
|
onClose: () => y("body-profile"),
|
|
@@ -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, {}) }),
|
|
@@ -13953,8 +13962,8 @@ function R8({
|
|
|
13953
13962
|
f8,
|
|
13954
13963
|
{
|
|
13955
13964
|
onConfirm: () => {
|
|
13956
|
-
const w = U,
|
|
13957
|
-
sf("profiles",
|
|
13965
|
+
const w = U, H = af("profiles", []).filter((Y) => Y.id !== w);
|
|
13966
|
+
sf("profiles", H), AA(H), lA === w && G(null), R(null);
|
|
13958
13967
|
},
|
|
13959
13968
|
onCancel: () => R(null),
|
|
13960
13969
|
t: E
|
|
@@ -13991,21 +14000,21 @@ function T8(f) {
|
|
|
13991
14000
|
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
|
-
let
|
|
14003
|
+
let Q = !1;
|
|
13995
14004
|
return B(!0), D(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: f.productId }), Gn(f).then((z) => {
|
|
13996
|
-
|
|
14005
|
+
Q || (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)));
|
|
13997
14006
|
}).catch((z) => {
|
|
13998
|
-
console.log("[ps-sdk:hook] usePrimeStyleSize threw", z),
|
|
14007
|
+
console.log("[ps-sdk:hook] usePrimeStyleSize threw", z), Q || g(null);
|
|
13999
14008
|
}).finally(() => {
|
|
14000
|
-
|
|
14009
|
+
Q || B(!1);
|
|
14001
14010
|
}), () => {
|
|
14002
|
-
|
|
14011
|
+
Q = !0;
|
|
14003
14012
|
};
|
|
14004
14013
|
}, [f.productId, f.apiUrl, f.apiKey, i]), JA(() => {
|
|
14005
14014
|
if (typeof window > "u") return;
|
|
14006
|
-
const
|
|
14007
|
-
return window.addEventListener(fP,
|
|
14008
|
-
window.removeEventListener(fP,
|
|
14015
|
+
const Q = () => o((z) => z + 1);
|
|
14016
|
+
return window.addEventListener(fP, Q), window.addEventListener("storage", Q), () => {
|
|
14017
|
+
window.removeEventListener(fP, Q), window.removeEventListener("storage", Q);
|
|
14009
14018
|
};
|
|
14010
14019
|
}, []), {
|
|
14011
14020
|
recommendedSize: n?.recommendedSize ?? null,
|
|
@@ -14013,7 +14022,7 @@ function G8(f) {
|
|
|
14013
14022
|
loading: e,
|
|
14014
14023
|
noProfile: C,
|
|
14015
14024
|
result: n,
|
|
14016
|
-
refetch: () => o((
|
|
14025
|
+
refetch: () => o((Q) => Q + 1)
|
|
14017
14026
|
};
|
|
14018
14027
|
}
|
|
14019
14028
|
export {
|