@primestyleai/tryon 5.10.48 → 5.10.49
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 +333 -330
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +8 -2
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -31,7 +31,7 @@ async function Un(n) {
|
|
|
31
31
|
const g = await TP(n), e = En.detect(g);
|
|
32
32
|
if (!e?.landmarks?.length || e.landmarks[0].length < 25)
|
|
33
33
|
return null;
|
|
34
|
-
const B = e.landmarks[0], P = B[mn], D = B[Jn], i = B[Nn], C = B[Sn], w = (P.y + D.y) / 2, H = (i.y + C.y) / 2,
|
|
34
|
+
const B = e.landmarks[0], P = B[mn], D = B[Jn], i = B[Nn], C = B[Sn], w = (P.y + D.y) / 2, H = (i.y + C.y) / 2, p = H - w, z = w + p * 0.28, T = Math.abs(D.x - P.x), x = Math.min(P.x, D.x) - T * 0.05, l = Math.max(P.x, D.x) + T * 0.05, fA = Math.abs(C.x - i.x), r = Math.min(i.x, C.x) - fA * 0.15, b = Math.max(i.x, C.x) + fA * 0.15, k = z + (H - z) * 0.55, v = T * 0.85, O = (P.x + D.x + i.x + C.x) / 4, s = O - v / 2, S = O + v / 2;
|
|
35
35
|
return {
|
|
36
36
|
chest: { y: z, x1: x, x2: l },
|
|
37
37
|
waist: { y: k, x1: s, x2: S },
|
|
@@ -166,7 +166,7 @@ function Mg(n) {
|
|
|
166
166
|
}
|
|
167
167
|
function pP(n, g, e) {
|
|
168
168
|
if (n.length < 4) return 0;
|
|
169
|
-
const B = (
|
|
169
|
+
const B = (p) => ({ x: p.x * g, y: p.y * e }), [P, D, i, C] = n.map(B), w = Math.hypot(P.x - i.x, P.y - i.y), H = Math.hypot(D.x - C.x, D.y - C.y);
|
|
170
170
|
return (w + H) / 2;
|
|
171
171
|
}
|
|
172
172
|
function xg(n) {
|
|
@@ -234,12 +234,12 @@ async function Rg(n) {
|
|
|
234
234
|
return console.warn("[PS-SDK:FaceDetect] NO FACES detected — returning null"), null;
|
|
235
235
|
const H = i.faceLandmarks[0];
|
|
236
236
|
console.log(`[PS-SDK:FaceDetect] first face has ${H.length} landmarks`);
|
|
237
|
-
const
|
|
238
|
-
if (!
|
|
237
|
+
const p = xg(H);
|
|
238
|
+
if (!p)
|
|
239
239
|
return null;
|
|
240
240
|
console.log("[PS-SDK:FaceDetect] step 4/4 — computing measurements");
|
|
241
|
-
const { measurements: z, irisConfidence: T } = Ig(
|
|
242
|
-
return console.log(`[PS-SDK:FaceDetect] ✓ DONE in ${Math.round(performance.now() - g)}ms`, { irisConfidence: T, measurements: z }), { landmarks:
|
|
241
|
+
const { measurements: z, irisConfidence: T } = Ig(p, B, P);
|
|
242
|
+
return console.log(`[PS-SDK:FaceDetect] ✓ DONE in ${Math.round(performance.now() - g)}ms`, { irisConfidence: T, measurements: z }), { landmarks: p, measurementsMm: z, irisConfidence: T, imageWidth: B, imageHeight: P };
|
|
243
243
|
} catch (e) {
|
|
244
244
|
return console.error("[PS-SDK:FaceDetect] detectFaceMeasurements FAILED:", e), null;
|
|
245
245
|
}
|
|
@@ -304,7 +304,7 @@ function jP(n, g, e) {
|
|
|
304
304
|
for (const C of Object.values(n.sections)) i(C.matchDetails);
|
|
305
305
|
if (D.length && (B.userMeasurementsText = D.join(", ")), g?.headers?.length && g.rows?.length) {
|
|
306
306
|
const C = g.headers, w = g.rows.slice(0, 20).map(
|
|
307
|
-
(H) => C.map((
|
|
307
|
+
(H) => C.map((p, z) => `${p} ${H[z] ?? "—"}`).join(", ")
|
|
308
308
|
);
|
|
309
309
|
B.sizeChartSummary = w.join(" | ");
|
|
310
310
|
}
|
|
@@ -537,7 +537,7 @@ async function mP(n) {
|
|
|
537
537
|
return g("recommend returned no recommendedSize — bailing"), null;
|
|
538
538
|
const H = w.sections ? Object.fromEntries(
|
|
539
539
|
Object.entries(w.sections).map(([z, T]) => [z, T.recommendedSize])
|
|
540
|
-
) : void 0,
|
|
540
|
+
) : void 0, p = w.sections ? Object.fromEntries(
|
|
541
541
|
Object.entries(w.sections).map(([z, T]) => [
|
|
542
542
|
z,
|
|
543
543
|
{
|
|
@@ -557,7 +557,7 @@ async function mP(n) {
|
|
|
557
557
|
recommendedSize: w.recommendedSize,
|
|
558
558
|
confidence: w.confidence,
|
|
559
559
|
sections: H,
|
|
560
|
-
sectionsFull:
|
|
560
|
+
sectionsFull: p,
|
|
561
561
|
recommendedLength: w.recommendedLength || void 0,
|
|
562
562
|
savedAt: Date.now()
|
|
563
563
|
}), {
|
|
@@ -6950,17 +6950,17 @@ function ne({ view: n, stepIndex: g }) {
|
|
|
6950
6950
|
function Pe({ activeLocale: n, onSelect: g }) {
|
|
6951
6951
|
const [e, B] = d(!1), P = aA(null), D = aA(null), [i, C] = d({ top: 0, right: 0 }), w = wP[n] || "English", H = EA(() => {
|
|
6952
6952
|
if (!P.current) return;
|
|
6953
|
-
const
|
|
6954
|
-
C({ top:
|
|
6953
|
+
const p = P.current.getBoundingClientRect();
|
|
6954
|
+
C({ top: p.bottom + 4, right: window.innerWidth - p.right });
|
|
6955
6955
|
}, []);
|
|
6956
6956
|
return NA(() => {
|
|
6957
6957
|
if (!e) return;
|
|
6958
6958
|
H();
|
|
6959
|
-
const
|
|
6959
|
+
const p = (z) => {
|
|
6960
6960
|
P.current?.contains(z.target) || D.current?.contains(z.target) || B(!1);
|
|
6961
6961
|
};
|
|
6962
|
-
return document.addEventListener("mousedown",
|
|
6963
|
-
document.removeEventListener("mousedown",
|
|
6962
|
+
return document.addEventListener("mousedown", p), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0), () => {
|
|
6963
|
+
document.removeEventListener("mousedown", p), window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0);
|
|
6964
6964
|
};
|
|
6965
6965
|
}, [e, H]), /* @__PURE__ */ f(rA, { children: [
|
|
6966
6966
|
/* @__PURE__ */ f(
|
|
@@ -6991,20 +6991,20 @@ function Pe({ activeLocale: n, onSelect: g }) {
|
|
|
6991
6991
|
// dropdown is portaled later than the overlay so it stacks on top.
|
|
6992
6992
|
zIndex: 2147483647
|
|
6993
6993
|
},
|
|
6994
|
-
children: /* @__PURE__ */ A("div", { className: "ps-tryon-lang-list", children: ag.map((
|
|
6994
|
+
children: /* @__PURE__ */ A("div", { className: "ps-tryon-lang-list", children: ag.map((p) => /* @__PURE__ */ f(
|
|
6995
6995
|
"button",
|
|
6996
6996
|
{
|
|
6997
|
-
className: `ps-tryon-lang-item${
|
|
6997
|
+
className: `ps-tryon-lang-item${p === n ? " ps-selected" : ""}`,
|
|
6998
6998
|
onClick: () => {
|
|
6999
|
-
g(
|
|
6999
|
+
g(p), B(!1);
|
|
7000
7000
|
},
|
|
7001
7001
|
children: [
|
|
7002
|
-
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-name", children: wP[
|
|
7003
|
-
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-code", children:
|
|
7004
|
-
|
|
7002
|
+
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-name", children: wP[p] || p }),
|
|
7003
|
+
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-code", children: p.toUpperCase() }),
|
|
7004
|
+
p === n && /* @__PURE__ */ A("span", { className: "ps-tryon-lang-check", children: /* @__PURE__ */ A(Zg, { size: 12 }) })
|
|
7005
7005
|
]
|
|
7006
7006
|
},
|
|
7007
|
-
|
|
7007
|
+
p
|
|
7008
7008
|
)) })
|
|
7009
7009
|
}
|
|
7010
7010
|
),
|
|
@@ -7027,7 +7027,7 @@ function yP({
|
|
|
7027
7027
|
onCancel: e,
|
|
7028
7028
|
t: B
|
|
7029
7029
|
}) {
|
|
7030
|
-
const [P, D] = d(n?.name || ""), [i, C] = d(n?.gender || "male"), [w, H] = d(n?.sizingUnit || "cm"), [
|
|
7030
|
+
const [P, D] = d(n?.name || ""), [i, C] = d(n?.gender || "male"), [w, H] = d(n?.sizingUnit || "cm"), [p, z] = d(() => {
|
|
7031
7031
|
if (!n) return {};
|
|
7032
7032
|
const r = {};
|
|
7033
7033
|
for (const b of ["heightCm", "weightKg", "age"]) {
|
|
@@ -7039,7 +7039,7 @@ function yP({
|
|
|
7039
7039
|
const r = [];
|
|
7040
7040
|
P.trim() || r.push(B("Profile Name"));
|
|
7041
7041
|
for (const k of T)
|
|
7042
|
-
parseFloat(
|
|
7042
|
+
parseFloat(p[k.key] || "") > 0 || r.push(B(k.label));
|
|
7043
7043
|
if (r.length > 0) {
|
|
7044
7044
|
l(B("Please fill in all fields"));
|
|
7045
7045
|
return;
|
|
@@ -7047,7 +7047,7 @@ function yP({
|
|
|
7047
7047
|
l("");
|
|
7048
7048
|
const b = { name: P.trim(), gender: i, sizingUnit: w };
|
|
7049
7049
|
for (const k of T)
|
|
7050
|
-
b[k.key] = parseFloat(
|
|
7050
|
+
b[k.key] = parseFloat(p[k.key]);
|
|
7051
7051
|
g(b);
|
|
7052
7052
|
};
|
|
7053
7053
|
return /* @__PURE__ */ f("div", { className: "ps-tryon-profile-edit", children: [
|
|
@@ -7121,7 +7121,7 @@ function yP({
|
|
|
7121
7121
|
type: "number",
|
|
7122
7122
|
className: "ps-tryon-sf-input",
|
|
7123
7123
|
placeholder: " ",
|
|
7124
|
-
value:
|
|
7124
|
+
value: p[r.key] || "",
|
|
7125
7125
|
onChange: (b) => {
|
|
7126
7126
|
z((k) => ({ ...k, [r.key]: b.target.value })), l("");
|
|
7127
7127
|
}
|
|
@@ -7146,7 +7146,7 @@ function Be({
|
|
|
7146
7146
|
restoreHistory: C,
|
|
7147
7147
|
t: w
|
|
7148
7148
|
}) {
|
|
7149
|
-
const [H,
|
|
7149
|
+
const [H, p] = d(!1);
|
|
7150
7150
|
if (!n) return null;
|
|
7151
7151
|
const z = (x) => !!(x.sizeGuide?.sections && Object.keys(x.sizeGuide.sections).length > 1), T = (x) => {
|
|
7152
7152
|
const l = {
|
|
@@ -7154,18 +7154,18 @@ function Be({
|
|
|
7154
7154
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
7155
7155
|
createdAt: Date.now()
|
|
7156
7156
|
};
|
|
7157
|
-
B((fA) => [l, ...fA]),
|
|
7157
|
+
B((fA) => [l, ...fA]), p(!1);
|
|
7158
7158
|
};
|
|
7159
7159
|
return /* @__PURE__ */ f("div", { className: `ps-tryon-drawer${n ? " ps-tryon-drawer-open" : ""}`, children: [
|
|
7160
7160
|
/* @__PURE__ */ f("div", { className: "ps-tryon-drawer-header", children: [
|
|
7161
7161
|
/* @__PURE__ */ A("button", { className: "ps-tryon-drawer-back", onClick: () => {
|
|
7162
|
-
|
|
7162
|
+
p(!1), g(null);
|
|
7163
7163
|
}, children: /* @__PURE__ */ A(Jg, {}) }),
|
|
7164
7164
|
/* @__PURE__ */ A("span", { className: "ps-tryon-drawer-title", children: w(H ? "New Profile" : n === "profiles" ? "My Profiles" : "History") }),
|
|
7165
|
-
n === "profiles" && !H && /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-add-btn", onClick: () =>
|
|
7165
|
+
n === "profiles" && !H && /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-add-btn", onClick: () => p(!0), children: "+" })
|
|
7166
7166
|
] }),
|
|
7167
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: n === "profiles" && H ? /* @__PURE__ */ A(yP, { onSave: T, onCancel: () =>
|
|
7168
|
-
/* @__PURE__ */ f("button", { className: "ps-tryon-drawer-create", onClick: () =>
|
|
7167
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: n === "profiles" && H ? /* @__PURE__ */ A(yP, { onSave: T, onCancel: () => p(!1), t: w }) : n === "profiles" ? /* @__PURE__ */ f(rA, { children: [
|
|
7168
|
+
/* @__PURE__ */ f("button", { className: "ps-tryon-drawer-create", onClick: () => p(!0), children: [
|
|
7169
7169
|
"+ ",
|
|
7170
7170
|
w("Create New Profile")
|
|
7171
7171
|
] }),
|
|
@@ -7230,16 +7230,16 @@ function oe({
|
|
|
7230
7230
|
}, [n]), !n || typeof document > "u") return null;
|
|
7231
7231
|
const i = (w) => {
|
|
7232
7232
|
e((H) => H.map(
|
|
7233
|
-
(
|
|
7234
|
-
...
|
|
7233
|
+
(p) => p.id === n.id ? {
|
|
7234
|
+
...p,
|
|
7235
7235
|
...w,
|
|
7236
7236
|
// Keep id + createdAt + sizeHistory + measurements; bump lastEditedAt
|
|
7237
|
-
id:
|
|
7238
|
-
createdAt:
|
|
7239
|
-
sizeHistory:
|
|
7240
|
-
measurements:
|
|
7237
|
+
id: p.id,
|
|
7238
|
+
createdAt: p.createdAt,
|
|
7239
|
+
sizeHistory: p.sizeHistory,
|
|
7240
|
+
measurements: p.measurements,
|
|
7241
7241
|
lastEditedAt: Date.now()
|
|
7242
|
-
} :
|
|
7242
|
+
} : p
|
|
7243
7243
|
)), g(null);
|
|
7244
7244
|
}, C = () => g(null);
|
|
7245
7245
|
return Vn(
|
|
@@ -7283,7 +7283,7 @@ function we({
|
|
|
7283
7283
|
return `${T}'${x}"`;
|
|
7284
7284
|
}
|
|
7285
7285
|
return `${Math.round(z)} cm`;
|
|
7286
|
-
}, w = (z) => z ? `${Math.round(z)} ${D}` : "—", H = n.height ?? n.heightCm,
|
|
7286
|
+
}, w = (z) => z ? `${Math.round(z)} ${D}` : "—", H = n.height ?? n.heightCm, p = n.weight ?? n.weightKg;
|
|
7287
7287
|
return /* @__PURE__ */ A("div", { className: "ps-confirm-overlay", onClick: e, children: /* @__PURE__ */ f("div", { className: "ps-confirm-modal", onClick: (z) => z.stopPropagation(), children: [
|
|
7288
7288
|
/* @__PURE__ */ A(
|
|
7289
7289
|
"button",
|
|
@@ -7329,7 +7329,7 @@ function we({
|
|
|
7329
7329
|
] }),
|
|
7330
7330
|
/* @__PURE__ */ f("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
|
|
7331
7331
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: B("Weight") }),
|
|
7332
|
-
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: w(
|
|
7332
|
+
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: w(p) })
|
|
7333
7333
|
] }),
|
|
7334
7334
|
n.age ? /* @__PURE__ */ f("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
|
|
7335
7335
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: B("Age") }),
|
|
@@ -7387,7 +7387,7 @@ function te({
|
|
|
7387
7387
|
sizingUnit: C,
|
|
7388
7388
|
setSizingUnit: w,
|
|
7389
7389
|
formKey: H,
|
|
7390
|
-
setFormKey:
|
|
7390
|
+
setFormKey: p,
|
|
7391
7391
|
updateField: z,
|
|
7392
7392
|
setSizingMethod: T,
|
|
7393
7393
|
setSizingLoading: x,
|
|
@@ -7569,8 +7569,8 @@ function pe({ t: n }) {
|
|
|
7569
7569
|
const i = setInterval(() => {
|
|
7570
7570
|
const C = (Date.now() - g.current) / 1e3, w = Math.min(95, C / zn * 100), H = Math.round(w);
|
|
7571
7571
|
if (B.current && (B.current.style.width = `${H}%`), D.current && (D.current.textContent = `${H}%`), e.current && (e.current.style.strokeDashoffset = String(bn * (1 - w / 100))), P.current) {
|
|
7572
|
-
const
|
|
7573
|
-
P.current.textContent = C >= zn ? "•••" : `~${
|
|
7572
|
+
const p = Math.max(0, zn - Math.floor(C));
|
|
7573
|
+
P.current.textContent = C >= zn ? "•••" : `~${p}s`;
|
|
7574
7574
|
}
|
|
7575
7575
|
}, 200);
|
|
7576
7576
|
return () => clearInterval(i);
|
|
@@ -7622,7 +7622,7 @@ function UP({
|
|
|
7622
7622
|
{ title: i("ESTIMATING BODY"), desc: i("Computing chest, waist, hips, sleeve and inseam from your basics."), viewfinderText: i("ESTIMATING BODY") },
|
|
7623
7623
|
{ title: i("MATCHING SIZE"), desc: i("Comparing your measurements to the garment's size guide."), viewfinderText: i("MATCHING SIZE") },
|
|
7624
7624
|
{ title: i("FINALIZING RESULT"), desc: i("Almost done — preparing your recommendation."), viewfinderText: i("FINALIZING") }
|
|
7625
|
-
], [
|
|
7625
|
+
], [p, z] = d({ w: 800, h: 1200 }), T = (r) => {
|
|
7626
7626
|
const b = r.currentTarget;
|
|
7627
7627
|
z({ w: b.naturalWidth || b.offsetWidth, h: b.naturalHeight || b.offsetHeight });
|
|
7628
7628
|
}, [x, l] = d(0);
|
|
@@ -7646,7 +7646,7 @@ function UP({
|
|
|
7646
7646
|
onLoad: T
|
|
7647
7647
|
}
|
|
7648
7648
|
),
|
|
7649
|
-
w && e && /* @__PURE__ */ A("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ A(ce, { landmarks: e, w:
|
|
7649
|
+
w && e && /* @__PURE__ */ A("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ A(ce, { landmarks: e, w: p.w, h: p.h }) })
|
|
7650
7650
|
] }),
|
|
7651
7651
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage", children: /* @__PURE__ */ f("div", { className: "ps-msc-stage-slot", children: [
|
|
7652
7652
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children: fA.title }),
|
|
@@ -7694,7 +7694,7 @@ function Ue({
|
|
|
7694
7694
|
tryOnProcessing: C,
|
|
7695
7695
|
resultImageUrl: w,
|
|
7696
7696
|
tryOnDone: H,
|
|
7697
|
-
onTryAgain:
|
|
7697
|
+
onTryAgain: p,
|
|
7698
7698
|
onClose: z,
|
|
7699
7699
|
overlayNode: T,
|
|
7700
7700
|
showLines: x,
|
|
@@ -7796,7 +7796,7 @@ function Ue({
|
|
|
7796
7796
|
{
|
|
7797
7797
|
type: "button",
|
|
7798
7798
|
className: "ps-msr-tryon-cta ps-secondary",
|
|
7799
|
-
onClick:
|
|
7799
|
+
onClick: p,
|
|
7800
7800
|
children: r("Try Again")
|
|
7801
7801
|
}
|
|
7802
7802
|
),
|
|
@@ -7858,8 +7858,8 @@ function LP({ t: n, isActive: g }) {
|
|
|
7858
7858
|
}
|
|
7859
7859
|
e.current = Date.now();
|
|
7860
7860
|
const C = setInterval(() => {
|
|
7861
|
-
const w = e.current || Date.now(), H = (Date.now() - w) / 1e3,
|
|
7862
|
-
if (P.current && (P.current.style.width = `${z}%`), i.current && (i.current.textContent = `${z}%`), B.current && (B.current.style.strokeDashoffset = String(Xn * (1 -
|
|
7861
|
+
const w = e.current || Date.now(), H = (Date.now() - w) / 1e3, p = Math.min(95, H / cn * 100), z = Math.round(p);
|
|
7862
|
+
if (P.current && (P.current.style.width = `${z}%`), i.current && (i.current.textContent = `${z}%`), B.current && (B.current.style.strokeDashoffset = String(Xn * (1 - p / 100))), D.current) {
|
|
7863
7863
|
const T = Math.max(0, cn - Math.floor(H));
|
|
7864
7864
|
D.current.textContent = H >= cn ? "•••" : `~${T}s`;
|
|
7865
7865
|
}
|
|
@@ -7938,13 +7938,13 @@ function Me({
|
|
|
7938
7938
|
`fl-${H}`
|
|
7939
7939
|
)),
|
|
7940
7940
|
[n.leftIrisCenter, n.rightIrisCenter].map((C, w) => {
|
|
7941
|
-
const H = w === 0 ? n.leftIrisRing : n.rightIrisRing,
|
|
7941
|
+
const H = w === 0 ? n.leftIrisRing : n.rightIrisRing, p = H?.length ? Math.abs((H[0]?.x ?? C.x) - (H[2]?.x ?? C.x)) * B / 2 : 6;
|
|
7942
7942
|
return /* @__PURE__ */ A(
|
|
7943
7943
|
"circle",
|
|
7944
7944
|
{
|
|
7945
7945
|
cx: C.x * B,
|
|
7946
7946
|
cy: C.y * P,
|
|
7947
|
-
r: Math.max(6,
|
|
7947
|
+
r: Math.max(6, p),
|
|
7948
7948
|
fill: "none",
|
|
7949
7949
|
stroke: "rgba(255,230,120,0.95)",
|
|
7950
7950
|
strokeWidth: "2.5",
|
|
@@ -7956,7 +7956,7 @@ function Me({
|
|
|
7956
7956
|
}),
|
|
7957
7957
|
(() => {
|
|
7958
7958
|
const w = Math.max(1, Math.abs(n.rightOuterEye.x - n.leftOuterEye.x) * B) * 0.04, H = w * 0.55;
|
|
7959
|
-
return D.map(({ key:
|
|
7959
|
+
return D.map(({ key: p, p: z }, T) => /* @__PURE__ */ f("g", { children: [
|
|
7960
7960
|
/* @__PURE__ */ A(
|
|
7961
7961
|
"circle",
|
|
7962
7962
|
{
|
|
@@ -7979,7 +7979,7 @@ function Me({
|
|
|
7979
7979
|
style: { animation: `ps-pose-fade 0.3s ease ${T * 0.04}s forwards, ps-dot-pulse 1.5s ease-in-out ${0.5 + T * 0.04}s infinite` }
|
|
7980
7980
|
}
|
|
7981
7981
|
)
|
|
7982
|
-
] },
|
|
7982
|
+
] }, p));
|
|
7983
7983
|
})()
|
|
7984
7984
|
] });
|
|
7985
7985
|
}
|
|
@@ -8014,13 +8014,13 @@ function xe({
|
|
|
8014
8014
|
{ title: P("REFINING DETAILS"), desc: P("Fine-tuning fit, drape and shadows.") },
|
|
8015
8015
|
{ title: P("ALMOST THERE"), desc: P("Final compositing in progress.") },
|
|
8016
8016
|
{ title: P("FINISHING TOUCHES"), desc: P("Polishing the result.") }
|
|
8017
|
-
], C = e ? i : D, w = e ? !!B : g, [H,
|
|
8017
|
+
], C = e ? i : D, w = e ? !!B : g, [H, p] = d(0);
|
|
8018
8018
|
NA(() => {
|
|
8019
|
-
|
|
8019
|
+
p(0);
|
|
8020
8020
|
}, [e]), NA(() => {
|
|
8021
8021
|
if (w) return;
|
|
8022
8022
|
const x = setInterval(() => {
|
|
8023
|
-
|
|
8023
|
+
p((l) => Math.min(l + 1, C.length - 1));
|
|
8024
8024
|
}, e ? 2200 : 900);
|
|
8025
8025
|
return () => clearInterval(x);
|
|
8026
8026
|
}, [w, C.length, e]);
|
|
@@ -8086,7 +8086,7 @@ function wn({ lines: n, fitRows: g, show: e, imgWidth: B, imgHeight: P }) {
|
|
|
8086
8086
|
{ key: "chest", line: n.chest, label: "Chest" },
|
|
8087
8087
|
{ key: "waist", line: n.waist, label: "Waist" },
|
|
8088
8088
|
{ key: "hips", line: n.hips, label: "Hips" }
|
|
8089
|
-
], C = B, w = P, H = Math.max(C, w) / 500,
|
|
8089
|
+
], C = B, w = P, H = Math.max(C, w) / 500, p = Math.max(5, 3 * H), z = Math.max(7, 5 * H);
|
|
8090
8090
|
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${C} ${w}`, preserveAspectRatio: "xMidYMid meet", children: i.map(({ key: T, line: x, label: l }, fA) => {
|
|
8091
8091
|
if (!x || typeof x.x1 != "number" || typeof x.x2 != "number" || typeof x.y != "number") return null;
|
|
8092
8092
|
const r = x.x1 * C, b = x.x2 * C, k = x.y * w, v = b - r, O = v * 0.06, s = (r + b) / 2, S = g.find((iA) => {
|
|
@@ -8100,7 +8100,7 @@ function wn({ lines: n, fitRows: g, show: e, imgWidth: B, imgHeight: P }) {
|
|
|
8100
8100
|
d: tA,
|
|
8101
8101
|
fill: "none",
|
|
8102
8102
|
stroke: K,
|
|
8103
|
-
strokeWidth:
|
|
8103
|
+
strokeWidth: p,
|
|
8104
8104
|
strokeLinecap: "round",
|
|
8105
8105
|
strokeDasharray: wA,
|
|
8106
8106
|
strokeDashoffset: wA,
|
|
@@ -8210,7 +8210,7 @@ function pn({
|
|
|
8210
8210
|
onBack: C,
|
|
8211
8211
|
t: w,
|
|
8212
8212
|
productImage: H,
|
|
8213
|
-
productTitle:
|
|
8213
|
+
productTitle: p,
|
|
8214
8214
|
isMobile: z,
|
|
8215
8215
|
isTryOnImage: T,
|
|
8216
8216
|
showLines: x,
|
|
@@ -8228,7 +8228,7 @@ function pn({
|
|
|
8228
8228
|
onRegenerateTryOn: tA,
|
|
8229
8229
|
pendingCustomSize: wA
|
|
8230
8230
|
}) {
|
|
8231
|
-
const YA = e?.recommendedSize || "", [h, a] = d(null),
|
|
8231
|
+
const YA = e?.recommendedSize || "", [h, a] = d(null), bA = P.toLowerCase(), RA = bA.includes("mm") ? "mm" : bA.includes("cm") ? "cm" : "in", vA = D || RA, N = (E) => ZP(E, vA, RA), PA = (E) => Re(E, vA, RA), kA = O ? Object.keys(O) : [], [iA, BA] = d(null), OA = i?.secResult?.recommendedSize || "", [gf, KA] = d(null), ef = pf(() => {
|
|
8232
8232
|
if (!i) return [];
|
|
8233
8233
|
const E = i.section, y = E.headers.findIndex((FA) => /size|taglia|größe|taille/i.test(FA.trim())), QA = y >= 0 ? y : 0, Q = E.headers[QA] || "Size", Z = E.rows.map((FA) => Rf(FA, QA, Q)).filter(Boolean);
|
|
8234
8234
|
return [...new Set(Z)];
|
|
@@ -8276,7 +8276,7 @@ function pn({
|
|
|
8276
8276
|
E.push(Q);
|
|
8277
8277
|
}
|
|
8278
8278
|
return E;
|
|
8279
|
-
}, [g]),
|
|
8279
|
+
}, [g]), uA = EA((E, y) => {
|
|
8280
8280
|
const QA = E.toLowerCase().trim(), Q = P === "cm" || P === "", Z = Q ? "cm" : "in", FA = [];
|
|
8281
8281
|
for (let V = 0; V < g.headers.length; V++) {
|
|
8282
8282
|
const xA = (g.headers[V] || "").toLowerCase().trim();
|
|
@@ -8290,11 +8290,11 @@ function pn({
|
|
|
8290
8290
|
if (FA.length === 0) return null;
|
|
8291
8291
|
let SA = FA.find((V) => I[V] === Z);
|
|
8292
8292
|
SA == null && (SA = FA[0]);
|
|
8293
|
-
const tf = g.headers[SA],
|
|
8293
|
+
const tf = g.headers[SA], XA = y.trim().toLowerCase();
|
|
8294
8294
|
let _ = g.rows.find((V) => Rf(V, Pf, ZA) === y);
|
|
8295
|
-
if (_ || (_ = g.rows.find((V) => Rf(V, Pf, ZA).trim().toLowerCase() ===
|
|
8295
|
+
if (_ || (_ = g.rows.find((V) => Rf(V, Pf, ZA).trim().toLowerCase() === XA)), _ || (_ = g.rows.find((V) => {
|
|
8296
8296
|
const xA = Rf(V, Pf, ZA).trim().toLowerCase();
|
|
8297
|
-
return xA.startsWith(
|
|
8297
|
+
return xA.startsWith(XA) || XA.startsWith(xA);
|
|
8298
8298
|
})), !_) return null;
|
|
8299
8299
|
const qA = Rf(_, SA, tf);
|
|
8300
8300
|
if (!qA) return null;
|
|
@@ -8313,7 +8313,7 @@ function pn({
|
|
|
8313
8313
|
return (e?.matchDetails || []).map((L) => {
|
|
8314
8314
|
let V = L.chartRange, xA = L.fit;
|
|
8315
8315
|
if (jA !== YA) {
|
|
8316
|
-
const wf =
|
|
8316
|
+
const wf = uA(L.measurement, jA);
|
|
8317
8317
|
if (wf && (wf.min > 0 || wf.max > 0)) {
|
|
8318
8318
|
const cA = (L.chartRange.match(/[a-zA-Z]+\s*$/) || [""])[0];
|
|
8319
8319
|
V = wf.range + (cA ? ` ${cA.trim()}` : "");
|
|
@@ -8344,8 +8344,8 @@ function pn({
|
|
|
8344
8344
|
const E = e?.matchDetails || [], y = i?.secResult?.matchDetails || [], QA = /* @__PURE__ */ new Set(), Q = [...E, ...y].filter((W) => {
|
|
8345
8345
|
const L = String(W?.measurement ?? "").toLowerCase().trim();
|
|
8346
8346
|
return !L || QA.has(L) ? !1 : (QA.add(L), !0);
|
|
8347
|
-
}), Z = e?.length || "", FA = (e?.availableLengths?.length || 0) > 0, SA = OA || Z, tf = !!(i || FA),
|
|
8348
|
-
if (i && _ && !
|
|
8347
|
+
}), Z = e?.length || "", FA = (e?.availableLengths?.length || 0) > 0, SA = OA || Z, tf = !!(i || FA), XA = Q.some((W) => W.measurement.toLowerCase() === "height"), _ = !!i?.section?.headers?.some((W) => /height|altezza|estatura|\(cm\)/i.test(W));
|
|
8348
|
+
if (i && _ && !XA) {
|
|
8349
8349
|
const W = B.height || 0;
|
|
8350
8350
|
Q.push({
|
|
8351
8351
|
measurement: "Height",
|
|
@@ -8353,7 +8353,7 @@ function pn({
|
|
|
8353
8353
|
chartRange: SA || "",
|
|
8354
8354
|
fit: "good"
|
|
8355
8355
|
});
|
|
8356
|
-
} else if (FA && !i && !
|
|
8356
|
+
} else if (FA && !i && !XA) {
|
|
8357
8357
|
const W = B.height || 0;
|
|
8358
8358
|
Q.push({
|
|
8359
8359
|
measurement: "Height",
|
|
@@ -8408,7 +8408,7 @@ function pn({
|
|
|
8408
8408
|
}
|
|
8409
8409
|
const L = B[W.measurement.toLowerCase()] || kf(W.userValue);
|
|
8410
8410
|
let { min: V, max: xA } = Fn(W.chartRange), wf = W.chartRange;
|
|
8411
|
-
const cA =
|
|
8411
|
+
const cA = uA(W.measurement, jA);
|
|
8412
8412
|
cA && (wf = cA.range, V = cA.min, xA = cA.max);
|
|
8413
8413
|
const Df = xA - V, Af = Df > 0 ? Df * 0.5 : V * 0.05 || 3, Hf = W.measurement.toLowerCase(), WA = /length|inseam|sleeve|hem|rise/.test(Hf);
|
|
8414
8414
|
let ff;
|
|
@@ -8427,7 +8427,7 @@ function pn({
|
|
|
8427
8427
|
}
|
|
8428
8428
|
return { area: W.measurement, userNum: L, chartLabel: qn(wf), fit: ff, isLength: WA };
|
|
8429
8429
|
});
|
|
8430
|
-
}, [e, i, B, jA, YA,
|
|
8430
|
+
}, [e, i, B, jA, YA, uA, gf, OA, S]), sA = AA.filter(
|
|
8431
8431
|
(E) => E.fit === "good" || E.fit === "a-bit-tight" || E.fit === "a-bit-loose"
|
|
8432
8432
|
).length, yA = AA.length > 0 ? Math.round(sA / AA.length * 100) : 0, Of = !S, LA = e, gA = LA?.size || YA, Uf = (e?.matchDetails || []).find(
|
|
8433
8433
|
(E) => /inseam|length/i.test(E.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(E.measurement)
|
|
@@ -8467,7 +8467,7 @@ function pn({
|
|
|
8467
8467
|
"img",
|
|
8468
8468
|
{
|
|
8469
8469
|
src: H,
|
|
8470
|
-
alt:
|
|
8470
|
+
alt: p || "",
|
|
8471
8471
|
className: "ps-msd-image-img",
|
|
8472
8472
|
onLoad: r
|
|
8473
8473
|
}
|
|
@@ -8573,10 +8573,10 @@ function pn({
|
|
|
8573
8573
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: w("MEASUREMENT BLUEPRINT") }),
|
|
8574
8574
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
8575
8575
|
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: AA.map((Q, Z) => {
|
|
8576
|
-
const FA = Q.isLength && Q.fit.includes("short") || Q.fit.includes("tight"), SA = Q.fit === "good" ? "ps-good" : FA ? "ps-tight" : "ps-loose", tf = y(Q.area),
|
|
8576
|
+
const FA = Q.isLength && Q.fit.includes("short") || Q.fit.includes("tight"), SA = Q.fit === "good" ? "ps-good" : FA ? "ps-tight" : "ps-loose", tf = y(Q.area), XA = String(Z + 1).padStart(2, "0");
|
|
8577
8577
|
return /* @__PURE__ */ f("div", { className: "ps-msd-row", children: [
|
|
8578
8578
|
/* @__PURE__ */ f("div", { className: "ps-msd-row-num", children: [
|
|
8579
|
-
|
|
8579
|
+
XA,
|
|
8580
8580
|
" ",
|
|
8581
8581
|
Q.area.toUpperCase()
|
|
8582
8582
|
] }),
|
|
@@ -8884,23 +8884,23 @@ function pn({
|
|
|
8884
8884
|
const SA = e?.matchDetails || [];
|
|
8885
8885
|
if (!SA.length) return;
|
|
8886
8886
|
const tf = new Set(
|
|
8887
|
-
(i?.secResult?.matchDetails || []).map((
|
|
8887
|
+
(i?.secResult?.matchDetails || []).map((XA) => XA.measurement.toLowerCase())
|
|
8888
8888
|
);
|
|
8889
|
-
return SA.map((
|
|
8890
|
-
const _ =
|
|
8889
|
+
return SA.map((XA) => {
|
|
8890
|
+
const _ = XA.measurement.toLowerCase();
|
|
8891
8891
|
if (tf.has(_) && i) {
|
|
8892
8892
|
const W = i.section, L = W.headers.findIndex((Df) => /size|length/i.test(Df.trim())), V = L >= 0 ? L : 0, xA = W.headers.findIndex((Df) => {
|
|
8893
8893
|
const Af = Df.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8894
8894
|
return !!Af && (Af === _ || Af.includes(_) || _.includes(Af));
|
|
8895
8895
|
});
|
|
8896
|
-
if (xA < 0) return
|
|
8896
|
+
if (xA < 0) return XA;
|
|
8897
8897
|
const wf = W.rows.find((Df) => Rf(Df, V, W.headers[V]) === y);
|
|
8898
|
-
if (!wf) return
|
|
8898
|
+
if (!wf) return XA;
|
|
8899
8899
|
const cA = Rf(wf, xA, W.headers[xA]);
|
|
8900
|
-
return cA ? { ...
|
|
8900
|
+
return cA ? { ...XA, chartRange: cA } : XA;
|
|
8901
8901
|
}
|
|
8902
|
-
const qA = XA
|
|
8903
|
-
return qA?.range ? { ...
|
|
8902
|
+
const qA = uA(XA.measurement, E);
|
|
8903
|
+
return qA?.range ? { ...XA, chartRange: qA.range } : XA;
|
|
8904
8904
|
});
|
|
8905
8905
|
}, FA = wA === E;
|
|
8906
8906
|
return tA ? /* @__PURE__ */ f(
|
|
@@ -9068,7 +9068,7 @@ function Oe({
|
|
|
9068
9068
|
setView: C,
|
|
9069
9069
|
handleDownload: w,
|
|
9070
9070
|
onRetryWithFit: H,
|
|
9071
|
-
retryLoading:
|
|
9071
|
+
retryLoading: p,
|
|
9072
9072
|
selectedFile: z,
|
|
9073
9073
|
previewUrl: T,
|
|
9074
9074
|
handleFileSelect: x,
|
|
@@ -9089,7 +9089,7 @@ function Oe({
|
|
|
9089
9089
|
onRegenerateTryOn: h,
|
|
9090
9090
|
t: a
|
|
9091
9091
|
}) {
|
|
9092
|
-
const
|
|
9092
|
+
const bA = (g?.unit || i || "").toString().toLowerCase(), RA = bA === "mm" ? "mm" : bA === "cm" ? "cm" : "in", vA = a(RA === "mm" ? "mm" : i === "cm" ? "cm" : "in"), [N, PA] = d({}), kA = Fn, iA = EA((o, j, U) => Rf(o, j, U), []), BA = pf(() => {
|
|
9093
9093
|
if (!e?.headers || !e?.rows) return -1;
|
|
9094
9094
|
const o = e.headers.findIndex((j) => /size|taglia|größe|taille/i.test(j.trim()));
|
|
9095
9095
|
if (o >= 0) return o;
|
|
@@ -9161,7 +9161,7 @@ function Oe({
|
|
|
9161
9161
|
return { range: X, ...J };
|
|
9162
9162
|
}, [e, BA, OA, vA, iA, kA, gf]), ef = g?.recommendedSize || "";
|
|
9163
9163
|
pf(() => g?.internationalSizes || {}, [g]);
|
|
9164
|
-
const [hA, Pf] = d("fit"), [ZA, df] = d(null), [jA, Bf] = d(!1), [DA, TA] = d(!1), [I,
|
|
9164
|
+
const [hA, Pf] = d("fit"), [ZA, df] = d(null), [jA, Bf] = d(!1), [DA, TA] = d(!1), [I, uA] = d(!1), [AA, sA] = d(null), [yA, Of] = d(!1), [LA, gA] = d({ w: 800, h: 1200 }), Uf = wA ?? null, jf = (o) => {
|
|
9165
9165
|
YA?.(o);
|
|
9166
9166
|
};
|
|
9167
9167
|
NA(() => {
|
|
@@ -9192,7 +9192,7 @@ function Oe({
|
|
|
9192
9192
|
}
|
|
9193
9193
|
FA(null);
|
|
9194
9194
|
}, [mA]);
|
|
9195
|
-
const
|
|
9195
|
+
const XA = ZA || ef;
|
|
9196
9196
|
pf(() => {
|
|
9197
9197
|
if (!g?.matchDetails?.length) return [];
|
|
9198
9198
|
const o = /* @__PURE__ */ new Set();
|
|
@@ -9202,8 +9202,8 @@ function Oe({
|
|
|
9202
9202
|
}).map((U) => {
|
|
9203
9203
|
const R = kf(U.userValue);
|
|
9204
9204
|
let u = U.chartRange, Y = U.fit;
|
|
9205
|
-
if (
|
|
9206
|
-
const MA = KA(U.measurement,
|
|
9205
|
+
if (XA !== ef) {
|
|
9206
|
+
const MA = KA(U.measurement, XA);
|
|
9207
9207
|
if (MA && MA.min > 0) {
|
|
9208
9208
|
u = qn(MA.range);
|
|
9209
9209
|
const HA = MA.min, JA = MA.max, X = JA - HA, J = X > 0 ? X * 0.5 : HA * 0.05 || 3, dA = Math.max((JA || HA) * 5e-3, 0.25);
|
|
@@ -9219,9 +9219,9 @@ function Oe({
|
|
|
9219
9219
|
}
|
|
9220
9220
|
return { area: U.measurement, userNum: kf(U.userValue), chartLabel: u, fit: Y };
|
|
9221
9221
|
});
|
|
9222
|
-
}, [g,
|
|
9222
|
+
}, [g, XA, ef, KA]), pf(() => {
|
|
9223
9223
|
if (!e?.headers || !e?.rows || BA < 0) return null;
|
|
9224
|
-
const o = e.rows.find((U) => iA(U, BA, OA) ===
|
|
9224
|
+
const o = e.rows.find((U) => iA(U, BA, OA) === XA);
|
|
9225
9225
|
if (!o) return null;
|
|
9226
9226
|
const j = [];
|
|
9227
9227
|
for (let U = 0; U < e.headers.length; U++) {
|
|
@@ -9231,7 +9231,7 @@ function Oe({
|
|
|
9231
9231
|
u && j.push({ header: R, value: u });
|
|
9232
9232
|
}
|
|
9233
9233
|
return j;
|
|
9234
|
-
}, [e, BA, OA,
|
|
9234
|
+
}, [e, BA, OA, XA, iA]);
|
|
9235
9235
|
const _ = !!(e?.sections && Object.keys(e.sections).length > 1), qA = pf(() => {
|
|
9236
9236
|
const o = {}, j = (U) => {
|
|
9237
9237
|
if (U)
|
|
@@ -9965,7 +9965,7 @@ function Oe({
|
|
|
9965
9965
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ f("table", { className: "ps-tryon-sr-chart-table", children: [
|
|
9966
9966
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: e.headers.map((o, j) => /* @__PURE__ */ A("th", { className: j === BA ? "ps-size-col" : "", children: o }, j)) }) }),
|
|
9967
9967
|
/* @__PURE__ */ A("tbody", { children: e.rows.map((o, j) => {
|
|
9968
|
-
const R = iA(o, BA, OA) ===
|
|
9968
|
+
const R = iA(o, BA, OA) === XA;
|
|
9969
9969
|
return /* @__PURE__ */ A("tr", { className: R ? "ps-active-row" : "", children: e.headers.map((u, Y) => /* @__PURE__ */ A("td", { className: Y === BA ? "ps-size-col" : "", children: iA(o, Y, u) }, Y)) }, j);
|
|
9970
9970
|
}) })
|
|
9971
9971
|
] }) })
|
|
@@ -10002,13 +10002,13 @@ function se({
|
|
|
10002
10002
|
{
|
|
10003
10003
|
className: Ef(`ps-tryon-upload${e ? " ps-tryon-drag-over" : ""}`, w.uploadZone),
|
|
10004
10004
|
onClick: () => P.current?.click(),
|
|
10005
|
-
onDragOver: (
|
|
10006
|
-
|
|
10005
|
+
onDragOver: (p) => {
|
|
10006
|
+
p.preventDefault(), B(!0);
|
|
10007
10007
|
},
|
|
10008
10008
|
onDragLeave: () => B(!1),
|
|
10009
|
-
onDrop: (
|
|
10010
|
-
|
|
10011
|
-
const z =
|
|
10009
|
+
onDrop: (p) => {
|
|
10010
|
+
p.preventDefault(), B(!1);
|
|
10011
|
+
const z = p.dataTransfer?.files?.[0];
|
|
10012
10012
|
z && D(z);
|
|
10013
10013
|
},
|
|
10014
10014
|
children: [
|
|
@@ -10019,8 +10019,8 @@ function se({
|
|
|
10019
10019
|
type: "file",
|
|
10020
10020
|
accept: "image/jpeg,image/png,image/webp",
|
|
10021
10021
|
style: { display: "none" },
|
|
10022
|
-
onChange: (
|
|
10023
|
-
const z =
|
|
10022
|
+
onChange: (p) => {
|
|
10023
|
+
const z = p.target.files?.[0];
|
|
10024
10024
|
z && D(z);
|
|
10025
10025
|
}
|
|
10026
10026
|
}
|
|
@@ -10046,7 +10046,7 @@ function Ke({
|
|
|
10046
10046
|
}) {
|
|
10047
10047
|
const H = EA((l) => {
|
|
10048
10048
|
e.current = l, l && (l.style.width = `${Math.round(g.current)}%`);
|
|
10049
|
-
}, []),
|
|
10049
|
+
}, []), p = EA((l) => {
|
|
10050
10050
|
B.current = l, l && (l.textContent = `${Math.round(g.current)}%`);
|
|
10051
10051
|
}, []), z = EA((l) => {
|
|
10052
10052
|
P.current = l;
|
|
@@ -10095,7 +10095,7 @@ function Ke({
|
|
|
10095
10095
|
/* @__PURE__ */ A("span", { ref: T, className: "ps-tryon-progress-eta", children: "~22s" })
|
|
10096
10096
|
] }),
|
|
10097
10097
|
/* @__PURE__ */ A("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ A("div", { ref: H, className: "ps-tryon-progress-bar-fill" }) }),
|
|
10098
|
-
/* @__PURE__ */ A("span", { ref:
|
|
10098
|
+
/* @__PURE__ */ A("span", { ref: p, className: "ps-tryon-progress-pct", children: "0%" })
|
|
10099
10099
|
] }),
|
|
10100
10100
|
/* @__PURE__ */ A("div", { ref: z, className: Ef("ps-tryon-processing-text", C.processingText), children: w("Preparing your image...") }),
|
|
10101
10101
|
/* @__PURE__ */ A("p", { className: Ef("ps-tryon-processing-sub", C.processingSubText), children: w("This usually takes 15-25 seconds") })
|
|
@@ -10183,11 +10183,11 @@ function an({
|
|
|
10183
10183
|
] }, n);
|
|
10184
10184
|
}
|
|
10185
10185
|
function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P }) {
|
|
10186
|
-
const [D, i] = d(null), [C, w] = d("identity"), [H,
|
|
10186
|
+
const [D, i] = d(null), [C, w] = d("identity"), [H, p] = d("name-photo"), [z, T] = d(!1), [x, l] = d(null), fA = aA(null);
|
|
10187
10187
|
NA(() => {
|
|
10188
10188
|
fA.current && (fA.current.scrollTop = 0);
|
|
10189
10189
|
}, [D, C]);
|
|
10190
|
-
const [r, b] = d(""), [k, v] = d("male"), [O, s] = d("cm"), [S, K] = d(""), [F, tA] = d(""), [wA, YA] = d(""), [h, a] = d(""), [
|
|
10190
|
+
const [r, b] = d(""), [k, v] = d("male"), [O, s] = d("cm"), [S, K] = d(""), [F, tA] = d(""), [wA, YA] = d(""), [h, a] = d(""), [bA, RA] = d(""), [vA, N] = d(""), [PA, kA] = d(null), [iA, BA] = d(!1), [OA, gf] = d(null), [KA, ef] = d({ w: 800, h: 1200 }), [hA, Pf] = d(0), [ZA, df] = d(!1), [jA, Bf] = d(!1);
|
|
10191
10191
|
NA(() => {
|
|
10192
10192
|
if (H !== "calculating" || !PA) return;
|
|
10193
10193
|
let o = !1;
|
|
@@ -10202,7 +10202,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10202
10202
|
const o = setInterval(() => Pf((j) => j + 1), 1500);
|
|
10203
10203
|
return () => clearInterval(o);
|
|
10204
10204
|
}, [H, z]);
|
|
10205
|
-
const DA = aA(null), TA = aA(null), [I,
|
|
10205
|
+
const DA = aA(null), TA = aA(null), [I, uA] = d(!1), [AA, sA] = d(null), yA = () => {
|
|
10206
10206
|
AA === !0 && DA.current?.click();
|
|
10207
10207
|
}, Of = async (o) => {
|
|
10208
10208
|
const j = o.target.files?.[0];
|
|
@@ -10231,7 +10231,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10231
10231
|
}
|
|
10232
10232
|
}, LA = () => {
|
|
10233
10233
|
kA(null), e?.(null), DA.current && (DA.current.value = "");
|
|
10234
|
-
}, [gA, Uf] = d(null), [jf, lA] = d(null), [Mf, Qf] = d(null), [af, xf] = d(null), [_A, of] = d(null), [mA, E] = d(null), y = ["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"], Q = k === "female", Z = Q ? GA.female : GA.male, FA = Q ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], SA = FA.indexOf(C), tf = FA.length,
|
|
10234
|
+
}, [gA, Uf] = d(null), [jf, lA] = d(null), [Mf, Qf] = d(null), [af, xf] = d(null), [_A, of] = d(null), [mA, E] = d(null), y = ["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"], Q = k === "female", Z = Q ? GA.female : GA.male, FA = Q ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], SA = FA.indexOf(C), tf = FA.length, XA = SA === tf - 1, _ = () => {
|
|
10235
10235
|
if (O === "in") {
|
|
10236
10236
|
const o = parseInt(F, 10), j = parseInt(wA, 10);
|
|
10237
10237
|
!isNaN(o) && o >= 0 && !isNaN(j) && j >= 0 && K(String(Math.round((o * 12 + j) * 2.54)));
|
|
@@ -10256,7 +10256,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10256
10256
|
}
|
|
10257
10257
|
if (!o)
|
|
10258
10258
|
return N(P("Please enter a valid height")), !1;
|
|
10259
|
-
const j = parseFloat(h), U = parseFloat(
|
|
10259
|
+
const j = parseFloat(h), U = parseFloat(bA);
|
|
10260
10260
|
return !j || j <= 0 ? (N(P("Please enter a valid weight")), !1) : !U || U <= 0 ? (N(P("Please enter a valid age")), !1) : (N(""), !0);
|
|
10261
10261
|
}, L = () => r.trim() ? (N(""), !0) : (N(P("Please enter a profile name")), !1), V = () => {
|
|
10262
10262
|
const o = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S);
|
|
@@ -10270,7 +10270,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10270
10270
|
weightKg: parseFloat(h),
|
|
10271
10271
|
height: o,
|
|
10272
10272
|
weight: parseFloat(h),
|
|
10273
|
-
age: parseFloat(
|
|
10273
|
+
age: parseFloat(bA),
|
|
10274
10274
|
chestProfile: gA || void 0,
|
|
10275
10275
|
midsectionProfile: jf || void 0,
|
|
10276
10276
|
hipProfile: Q ? af || void 0 : Mf || void 0,
|
|
@@ -10278,7 +10278,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10278
10278
|
cupSize: Q && mA || void 0
|
|
10279
10279
|
};
|
|
10280
10280
|
}, xA = () => {
|
|
10281
|
-
const o = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), j = parseFloat(h), U = parseFloat(
|
|
10281
|
+
const o = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), j = parseFloat(h), U = parseFloat(bA);
|
|
10282
10282
|
return {
|
|
10283
10283
|
name: r.trim(),
|
|
10284
10284
|
gender: k,
|
|
@@ -10312,7 +10312,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10312
10312
|
N(P("Please pick band and cup size"));
|
|
10313
10313
|
return;
|
|
10314
10314
|
}
|
|
10315
|
-
if (N(""),
|
|
10315
|
+
if (N(""), XA) {
|
|
10316
10316
|
n(V());
|
|
10317
10317
|
return;
|
|
10318
10318
|
}
|
|
@@ -10359,8 +10359,8 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10359
10359
|
N(P("Please enter a valid weight"));
|
|
10360
10360
|
return;
|
|
10361
10361
|
}
|
|
10362
|
-
if (N(""),
|
|
10363
|
-
const U = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), R = parseFloat(
|
|
10362
|
+
if (N(""), p("calculating"), T(!0), B && PA) {
|
|
10363
|
+
const U = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), R = parseFloat(bA);
|
|
10364
10364
|
try {
|
|
10365
10365
|
const u = await B({
|
|
10366
10366
|
photoBase64: PA,
|
|
@@ -10379,21 +10379,21 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10379
10379
|
return;
|
|
10380
10380
|
}
|
|
10381
10381
|
if (H === "details") {
|
|
10382
|
-
|
|
10382
|
+
p("calculating");
|
|
10383
10383
|
return;
|
|
10384
10384
|
}
|
|
10385
10385
|
const o = xA();
|
|
10386
10386
|
x && (o.measurements = x, o.measurementsUnit = "cm"), n(o);
|
|
10387
10387
|
}, WA = () => {
|
|
10388
10388
|
if (N(""), H === "details") {
|
|
10389
|
-
|
|
10389
|
+
p("name-photo");
|
|
10390
10390
|
return;
|
|
10391
10391
|
}
|
|
10392
10392
|
if (H === "calculating" && !z) {
|
|
10393
|
-
|
|
10393
|
+
p("name-photo");
|
|
10394
10394
|
return;
|
|
10395
10395
|
}
|
|
10396
|
-
i(null),
|
|
10396
|
+
i(null), p("name-photo");
|
|
10397
10397
|
}, ff = () => {
|
|
10398
10398
|
if (D === "manual") return Df();
|
|
10399
10399
|
if (D === "image") return WA();
|
|
@@ -10573,7 +10573,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10573
10573
|
type: "number",
|
|
10574
10574
|
inputMode: "numeric",
|
|
10575
10575
|
className: "ps-bp-inline-input",
|
|
10576
|
-
value:
|
|
10576
|
+
value: bA,
|
|
10577
10577
|
placeholder: P("e.g. 30"),
|
|
10578
10578
|
onChange: (o) => {
|
|
10579
10579
|
RA(o.target.value), N("");
|
|
@@ -10908,7 +10908,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10908
10908
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("NAME") }),
|
|
10909
10909
|
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: TA, type: "text", className: `ps-bp-inline-input${I ? " ps-cpw-shake" : ""}`, value: r, placeholder: P("e.g. My Photo Profile"), onChange: (o) => {
|
|
10910
10910
|
b(o.target.value), N("");
|
|
10911
|
-
}, onAnimationEnd: () =>
|
|
10911
|
+
}, onAnimationEnd: () => uA(!1) }) })
|
|
10912
10912
|
] }),
|
|
10913
10913
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
10914
10914
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("HEIGHT") }),
|
|
@@ -10940,7 +10940,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
10940
10940
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
10941
10941
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("AGE") }),
|
|
10942
10942
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
10943
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
10943
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: bA, placeholder: P("e.g. 30"), onChange: (o) => {
|
|
10944
10944
|
RA(o.target.value), N("");
|
|
10945
10945
|
} }),
|
|
10946
10946
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: P("years") })
|
|
@@ -11077,7 +11077,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11077
11077
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
|
|
11078
11078
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("AGE") }),
|
|
11079
11079
|
/* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
|
|
11080
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
11080
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: bA, placeholder: P("e.g. 30"), onChange: (o) => {
|
|
11081
11081
|
RA(o.target.value), N("");
|
|
11082
11082
|
} }),
|
|
11083
11083
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: P("years") })
|
|
@@ -11217,7 +11217,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11217
11217
|
] }),
|
|
11218
11218
|
/* @__PURE__ */ f("div", { className: "ps-cpw-footer", children: [
|
|
11219
11219
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-back-btn", onClick: ff, children: D == null ? P("Cancel") : `← ${P("Back")}` }),
|
|
11220
|
-
D === "manual" && !Af && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: wf, children: P(
|
|
11220
|
+
D === "manual" && !Af && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: wf, children: P(XA ? "CALCULATE MY FIT" : "Continue") }),
|
|
11221
11221
|
D === "image" && H === "name-photo" && (() => {
|
|
11222
11222
|
const o = O === "in" ? parseFloat(F) > 0 || parseFloat(wA) > 0 : parseFloat(S) > 0, j = parseFloat(h) > 0, U = !!r.trim(), R = !!PA, u = P(R ? U ? o ? j ? "Calculate My Body Parts" : "Enter your weight" : "Enter your height" : "Add a name for this profile" : "Upload a photo"), Y = !R || !U || !o || !j;
|
|
11223
11223
|
return /* @__PURE__ */ A(
|
|
@@ -11227,7 +11227,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11227
11227
|
className: "ps-cpw-next-btn",
|
|
11228
11228
|
onClick: () => {
|
|
11229
11229
|
if (!U) {
|
|
11230
|
-
|
|
11230
|
+
uA(!0), TA.current?.focus();
|
|
11231
11231
|
return;
|
|
11232
11232
|
}
|
|
11233
11233
|
Hf();
|
|
@@ -11241,7 +11241,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
|
|
|
11241
11241
|
D === "image" && H === "details" && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: Hf, children: P("Calculate My Body Parts") }),
|
|
11242
11242
|
D === "image" && H === "calculating" && !z && x && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: Hf, children: P("Save Profile") }),
|
|
11243
11243
|
D === "image" && H === "calculating" && !z && !x && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: () => {
|
|
11244
|
-
|
|
11244
|
+
p("details"), N("");
|
|
11245
11245
|
}, children: P("Try Again") })
|
|
11246
11246
|
] })
|
|
11247
11247
|
] });
|
|
@@ -11277,9 +11277,9 @@ function oB({
|
|
|
11277
11277
|
isEstimating: w = !1,
|
|
11278
11278
|
t: H
|
|
11279
11279
|
}) {
|
|
11280
|
-
const
|
|
11280
|
+
const p = n.gender === "female" ? gB : PB, z = n.measurements || {}, T = Object.keys(z).some((K) => z[K] != null), [x, l] = d(n.measurementsUnit || "cm"), [fA, r] = d(() => {
|
|
11281
11281
|
const K = {};
|
|
11282
|
-
return
|
|
11282
|
+
return p.forEach((F) => {
|
|
11283
11283
|
const tA = z[F.key];
|
|
11284
11284
|
K[F.key] = tA != null ? String(Math.round(tA * 10) / 10) : "";
|
|
11285
11285
|
}), K;
|
|
@@ -11288,7 +11288,7 @@ function oB({
|
|
|
11288
11288
|
r((K) => {
|
|
11289
11289
|
const F = { ...K };
|
|
11290
11290
|
let tA = !1;
|
|
11291
|
-
return
|
|
11291
|
+
return p.forEach((wA) => {
|
|
11292
11292
|
const YA = z[wA.key];
|
|
11293
11293
|
YA != null && !K[wA.key] && (F[wA.key] = String(Math.round(YA * 10) / 10), tA = !0);
|
|
11294
11294
|
}), tA ? F : K;
|
|
@@ -11345,7 +11345,7 @@ function oB({
|
|
|
11345
11345
|
] })
|
|
11346
11346
|
] }) }),
|
|
11347
11347
|
/* @__PURE__ */ f("div", { className: "ps-pmv-measure-list", children: [
|
|
11348
|
-
|
|
11348
|
+
p.map((K) => {
|
|
11349
11349
|
const F = z[K.key], tA = w && F == null && !fA[K.key];
|
|
11350
11350
|
return /* @__PURE__ */ f("div", { className: `ps-pmv-measure-row${F == null ? " ps-loading" : ""}`, children: [
|
|
11351
11351
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: K.iconSrc, alt: "", "aria-hidden": "true" }) }),
|
|
@@ -11454,19 +11454,19 @@ function vB({
|
|
|
11454
11454
|
t: i
|
|
11455
11455
|
}) {
|
|
11456
11456
|
const C = (() => {
|
|
11457
|
-
const
|
|
11458
|
-
if (!
|
|
11457
|
+
const p = n.height ?? n.heightCm;
|
|
11458
|
+
if (!p) return null;
|
|
11459
11459
|
if (n.heightUnit === "in" || n.heightUnit === "ft") {
|
|
11460
|
-
const z = Math.floor(
|
|
11460
|
+
const z = Math.floor(p / 12), T = Math.round(p % 12);
|
|
11461
11461
|
return `${z}'${T}"`;
|
|
11462
11462
|
}
|
|
11463
|
-
return `${Math.round(
|
|
11463
|
+
return `${Math.round(p)} cm`;
|
|
11464
11464
|
})(), w = (() => {
|
|
11465
|
-
const
|
|
11466
|
-
return
|
|
11465
|
+
const p = n.weight ?? n.weightKg;
|
|
11466
|
+
return p ? `${Math.round(p)} ${n.weightUnit || "kg"}` : null;
|
|
11467
11467
|
})(), H = (() => {
|
|
11468
|
-
const
|
|
11469
|
-
return
|
|
11468
|
+
const p = n.lastEditedAt || n.lastUsedAt || n.createdAt;
|
|
11469
|
+
return p ? new Date(p).toLocaleDateString(void 0, { month: "short", day: "numeric" }) : null;
|
|
11470
11470
|
})();
|
|
11471
11471
|
return /* @__PURE__ */ f(
|
|
11472
11472
|
"div",
|
|
@@ -11493,7 +11493,7 @@ function vB({
|
|
|
11493
11493
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children: H })
|
|
11494
11494
|
] })
|
|
11495
11495
|
] }),
|
|
11496
|
-
/* @__PURE__ */ f("div", { className: "ps-msp-card-actions", onClick: (
|
|
11496
|
+
/* @__PURE__ */ f("div", { className: "ps-msp-card-actions", onClick: (p) => p.stopPropagation(), children: [
|
|
11497
11497
|
/* @__PURE__ */ A(
|
|
11498
11498
|
"button",
|
|
11499
11499
|
{
|
|
@@ -11512,8 +11512,8 @@ function vB({
|
|
|
11512
11512
|
{
|
|
11513
11513
|
type: "button",
|
|
11514
11514
|
className: "ps-msp-card-delete",
|
|
11515
|
-
onClick: (
|
|
11516
|
-
|
|
11515
|
+
onClick: (p) => {
|
|
11516
|
+
p.stopPropagation(), P();
|
|
11517
11517
|
},
|
|
11518
11518
|
"aria-label": i("Delete"),
|
|
11519
11519
|
children: /* @__PURE__ */ f("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
@@ -11548,7 +11548,7 @@ function iB({
|
|
|
11548
11548
|
onRequestDelete: C,
|
|
11549
11549
|
onClose: w,
|
|
11550
11550
|
onPhotoPreview: H,
|
|
11551
|
-
onEstimateFromPhoto:
|
|
11551
|
+
onEstimateFromPhoto: p,
|
|
11552
11552
|
estimatingProfileIds: z,
|
|
11553
11553
|
t: T,
|
|
11554
11554
|
onRegisterBackInterceptor: x
|
|
@@ -11603,7 +11603,7 @@ function iB({
|
|
|
11603
11603
|
},
|
|
11604
11604
|
onCancel: () => fA(!1),
|
|
11605
11605
|
onPhotoPreview: H,
|
|
11606
|
-
onEstimate:
|
|
11606
|
+
onEstimate: p,
|
|
11607
11607
|
t: T
|
|
11608
11608
|
}
|
|
11609
11609
|
) : /* @__PURE__ */ f(rA, { children: [
|
|
@@ -11663,7 +11663,7 @@ function HB({
|
|
|
11663
11663
|
heightInches: C,
|
|
11664
11664
|
setHeightInches: w,
|
|
11665
11665
|
weight: H,
|
|
11666
|
-
setWeight:
|
|
11666
|
+
setWeight: p,
|
|
11667
11667
|
age: z,
|
|
11668
11668
|
setAge: T,
|
|
11669
11669
|
switchToMetric: x,
|
|
@@ -11679,14 +11679,14 @@ function HB({
|
|
|
11679
11679
|
error: K,
|
|
11680
11680
|
t: F
|
|
11681
11681
|
}) {
|
|
11682
|
-
const tA = parseFloat(B) || 173, wA = (parseFloat(D) || 5) * 12 + (parseFloat(C) || 8), YA = Math.floor(wA / 12), h = wA % 12, a = parseFloat(H) || (g === "kg" ? 70 : 154),
|
|
11682
|
+
const tA = parseFloat(B) || 173, wA = (parseFloat(D) || 5) * 12 + (parseFloat(C) || 8), YA = Math.floor(wA / 12), h = wA % 12, a = parseFloat(H) || (g === "kg" ? 70 : 154), bA = parseFloat(z) || 30, RA = g === "kg" ? 30 : 66, vA = g === "kg" ? 200 : 440, N = 120, PA = 220, kA = 48, iA = 84, BA = 13, OA = 100, gf = (tA - N) / (PA - N) * 100, KA = (wA - kA) / (iA - kA) * 100, ef = (a - RA) / (vA - RA) * 100, hA = (bA - BA) / (OA - BA) * 100, Pf = e ? parseFloat(D) > 0 || parseFloat(C) > 0 : parseFloat(B) > 0, ZA = parseFloat(H) > 0, df = Pf && ZA, jA = (sA) => {
|
|
11683
11683
|
const yA = Math.max(kA, Math.min(iA, sA));
|
|
11684
11684
|
i(String(Math.floor(yA / 12))), w(String(yA % 12));
|
|
11685
11685
|
}, Bf = () => {
|
|
11686
11686
|
n === "in" ? jA(wA + 1) : P(String(Math.min(PA, tA + 1)));
|
|
11687
11687
|
}, DA = () => {
|
|
11688
11688
|
n === "in" ? jA(wA - 1) : P(String(Math.max(N, tA - 1)));
|
|
11689
|
-
}, TA = () =>
|
|
11689
|
+
}, TA = () => p(String(Math.min(vA, a + 1))), I = () => p(String(Math.max(RA, a - 1))), uA = () => T(String(Math.min(OA, bA + 1))), AA = () => T(String(Math.max(BA, bA - 1)));
|
|
11690
11690
|
return /* @__PURE__ */ f("div", { className: "ps-bpm-root", children: [
|
|
11691
11691
|
/* @__PURE__ */ f("div", { className: "ps-bpm-header", children: [
|
|
11692
11692
|
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: F("Body Measurements") }),
|
|
@@ -11777,7 +11777,7 @@ function HB({
|
|
|
11777
11777
|
max: vA,
|
|
11778
11778
|
step: 1,
|
|
11779
11779
|
value: a,
|
|
11780
|
-
onChange: (sA) =>
|
|
11780
|
+
onChange: (sA) => p(sA.target.value),
|
|
11781
11781
|
style: { "--ps-pct": `${ef}%` }
|
|
11782
11782
|
}
|
|
11783
11783
|
),
|
|
@@ -11788,7 +11788,7 @@ function HB({
|
|
|
11788
11788
|
/* @__PURE__ */ f("div", { className: "ps-bpm-row-top", children: [
|
|
11789
11789
|
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: F("AGE") }),
|
|
11790
11790
|
/* @__PURE__ */ f("span", { className: "ps-bpm-value-display", children: [
|
|
11791
|
-
Math.round(
|
|
11791
|
+
Math.round(bA),
|
|
11792
11792
|
" ",
|
|
11793
11793
|
F("YEARS")
|
|
11794
11794
|
] })
|
|
@@ -11803,12 +11803,12 @@ function HB({
|
|
|
11803
11803
|
min: BA,
|
|
11804
11804
|
max: OA,
|
|
11805
11805
|
step: 1,
|
|
11806
|
-
value:
|
|
11806
|
+
value: bA,
|
|
11807
11807
|
onChange: (sA) => T(sA.target.value),
|
|
11808
11808
|
style: { "--ps-pct": `${hA}%` }
|
|
11809
11809
|
}
|
|
11810
11810
|
),
|
|
11811
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick:
|
|
11811
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: uA, "aria-label": F("Increase"), children: /* @__PURE__ */ A(ln, {}) })
|
|
11812
11812
|
] })
|
|
11813
11813
|
] })
|
|
11814
11814
|
] }),
|
|
@@ -11893,7 +11893,7 @@ function ng({
|
|
|
11893
11893
|
photoStepHeight: C,
|
|
11894
11894
|
onPhotoStepHeightChange: w,
|
|
11895
11895
|
ageConfirmed: H,
|
|
11896
|
-
onAgeConfirmedChange:
|
|
11896
|
+
onAgeConfirmedChange: p,
|
|
11897
11897
|
t: z
|
|
11898
11898
|
}) {
|
|
11899
11899
|
const T = i === "close-up", x = aA(null), l = !!n, fA = !l && H !== !0;
|
|
@@ -11947,14 +11947,14 @@ function ng({
|
|
|
11947
11947
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-eyebrow", children: z("AGE VERIFICATION") }),
|
|
11948
11948
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-question", children: z("Is the person in this photo 18 years or older?") }),
|
|
11949
11949
|
/* @__PURE__ */ f("div", { className: "ps-pm-age-gate-actions", children: [
|
|
11950
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-primary", onClick: () =>
|
|
11951
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () =>
|
|
11950
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-primary", onClick: () => p(!0), children: z("Yes") }),
|
|
11951
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => p(!1), children: z("No") })
|
|
11952
11952
|
] })
|
|
11953
11953
|
] }) }),
|
|
11954
11954
|
H === !1 && /* @__PURE__ */ A("div", { className: "ps-pm-age-gate", role: "alert", children: /* @__PURE__ */ f("div", { className: "ps-pm-age-gate-card", children: [
|
|
11955
11955
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-eyebrow ps-pm-age-gate-eyebrow-blocked", children: z("UPLOAD NOT ALLOWED") }),
|
|
11956
11956
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-question", children: z("For your safety, we cannot process photos of people under 18.") }),
|
|
11957
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () =>
|
|
11957
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => p(null), children: z("Go back") })
|
|
11958
11958
|
] }) })
|
|
11959
11959
|
] }) }),
|
|
11960
11960
|
/* @__PURE__ */ f("div", { className: "ps-pm-legal-notice", children: [
|
|
@@ -12062,7 +12062,7 @@ function jn({
|
|
|
12062
12062
|
] }),
|
|
12063
12063
|
/* @__PURE__ */ A("h2", { className: "ps-bsm-question", children: e }),
|
|
12064
12064
|
/* @__PURE__ */ A("div", { className: "ps-bsm-options-center", children: /* @__PURE__ */ A("div", { className: "ps-bsm-options", children: B.map((C, w) => {
|
|
12065
|
-
const H = P === C.value,
|
|
12065
|
+
const H = P === C.value, p = String.fromCharCode(65 + w);
|
|
12066
12066
|
return /* @__PURE__ */ f(
|
|
12067
12067
|
"button",
|
|
12068
12068
|
{
|
|
@@ -12074,7 +12074,7 @@ function jn({
|
|
|
12074
12074
|
/* @__PURE__ */ f("span", { className: "ps-bsm-card-eyebrow", children: [
|
|
12075
12075
|
i("PROFILE"),
|
|
12076
12076
|
" ",
|
|
12077
|
-
|
|
12077
|
+
p
|
|
12078
12078
|
] }),
|
|
12079
12079
|
/* @__PURE__ */ A("span", { className: "ps-bsm-card-label", children: C.label.toUpperCase() })
|
|
12080
12080
|
] }),
|
|
@@ -12176,7 +12176,7 @@ function MB({
|
|
|
12176
12176
|
weightUnit: C,
|
|
12177
12177
|
setWeightUnit: w,
|
|
12178
12178
|
sizingUnit: H,
|
|
12179
|
-
setSizingUnit:
|
|
12179
|
+
setSizingUnit: p,
|
|
12180
12180
|
onComplete: z,
|
|
12181
12181
|
onSnapSubmit: T,
|
|
12182
12182
|
hasActiveProfileWithMeasurements: x = !1,
|
|
@@ -12189,11 +12189,11 @@ function MB({
|
|
|
12189
12189
|
}) {
|
|
12190
12190
|
const O = e ? UB : dB, [s, S] = d("basics");
|
|
12191
12191
|
s === "photo" || O.indexOf(s);
|
|
12192
|
-
const K = AP(), F = JP(P), tA = b?.height, wA = b?.weight, YA = b?.age, h = b?.heightUnit === "ft" ? "in" : b?.heightUnit, a = b?.weightUnit,
|
|
12192
|
+
const K = AP(), F = JP(P), tA = b?.height, wA = b?.weight, YA = b?.age, h = b?.heightUnit === "ft" ? "in" : b?.heightUnit, a = b?.weightUnit, bA = tA != null && h === "cm" ? String(Math.round(tA)) : tA != null && (h === "in" || h === "ft") ? String(Math.round(tA * 2.54)) : B.current.height || "173", RA = tA != null && (h === "in" || h === "ft") ? Math.round(tA) : tA != null && h === "cm" ? Math.round(tA / 2.54) : null, vA = RA != null ? String(Math.floor(RA / 12)) : B.current.heightFeet || "5", N = RA != null ? String(RA % 12) : B.current.heightInches || "8", PA = wA != null ? String(Math.round(wA)) : B.current.weight || (F ? "154" : "70"), kA = YA != null ? String(YA) : B.current.age || "30", [iA, BA] = d(bA), [OA, gf] = d(vA), [KA, ef] = d(N), [hA, Pf] = d(PA), [ZA, df] = d(kA), [jA, Bf] = d(
|
|
12193
12193
|
h || (D === "ft" ? "in" : D || (F ? "in" : "cm"))
|
|
12194
12194
|
), [DA, TA] = d(
|
|
12195
12195
|
a || C || (F ? "lbs" : "kg")
|
|
12196
|
-
), I = jA === "in" || DA === "lbs", [
|
|
12196
|
+
), I = jA === "in" || DA === "lbs", [uA, AA] = d(null), [sA, yA] = d(null), [Of, LA] = d(null), [gA, Uf] = d(!1), jf = aA(null), [lA, Mf] = d(null), [Qf, af] = d(!1), [xf, _A] = d(!1), [of, mA] = d(() => RA != null ? String(Math.round(RA * 2.54)) : bA), [E, y] = d(null), [QA, Q] = d(null), [Z, FA] = d(null), [SA, tf] = d(null), [XA, _] = d(""), [qA, W] = d(null), [L, V] = d(null), [xA, wf] = d(() => ["US", "UK", "AU"].includes(P) ? P === "AU" ? "UK" : P : ["FR", "ES"].includes(P) ? "FR" : ["IT"].includes(P) ? "IT" : ["JP", "CN", "KR"].includes(P) ? "JP" : "EU"), [cA, Df] = d(!1), Af = xP[xA] || xP.US, [Hf, WA] = d(""), ff = EA(async (X) => {
|
|
12197
12197
|
const J = X.target.files?.[0];
|
|
12198
12198
|
if (!J) return;
|
|
12199
12199
|
if (lA !== !0) {
|
|
@@ -12290,7 +12290,7 @@ function MB({
|
|
|
12290
12290
|
}
|
|
12291
12291
|
WA(""), R();
|
|
12292
12292
|
} else if (s === "photo") {
|
|
12293
|
-
if (!Of || !
|
|
12293
|
+
if (!Of || !uA) {
|
|
12294
12294
|
if (x && l) {
|
|
12295
12295
|
l();
|
|
12296
12296
|
return;
|
|
@@ -12300,7 +12300,7 @@ function MB({
|
|
|
12300
12300
|
}
|
|
12301
12301
|
const X = jA === "in" ? (parseFloat(OA) || 0) * 12 + (parseFloat(KA) || 0) : parseFloat(iA) || 0, J = parseFloat(hA) || 0, dA = parseFloat(ZA) || void 0;
|
|
12302
12302
|
T({
|
|
12303
|
-
photoFile:
|
|
12303
|
+
photoFile: uA,
|
|
12304
12304
|
photoBase64: Of,
|
|
12305
12305
|
height: X,
|
|
12306
12306
|
weight: J,
|
|
@@ -12310,7 +12310,7 @@ function MB({
|
|
|
12310
12310
|
...dA ? { age: dA } : {}
|
|
12311
12311
|
});
|
|
12312
12312
|
}
|
|
12313
|
-
}, [s, O, VA, E, QA, Z, SA, qA, L, jA, DA, iA, OA, KA, hA, ZA, Of,
|
|
12313
|
+
}, [s, O, VA, E, QA, Z, SA, qA, L, jA, DA, iA, OA, KA, hA, ZA, Of, uA, of, B, i, w, z, T, e, j, x, l]), Y = (X) => {
|
|
12314
12314
|
const J = O.indexOf(X);
|
|
12315
12315
|
return J > 0 ? O[J - 1] : null;
|
|
12316
12316
|
}, MA = EA(() => {
|
|
@@ -12331,7 +12331,7 @@ function MB({
|
|
|
12331
12331
|
const UA = (parseFloat(OA) || 0) * 12 + (parseFloat(KA) || 0);
|
|
12332
12332
|
UA > 0 && BA(String(Math.round(UA * 2.54)));
|
|
12333
12333
|
}
|
|
12334
|
-
DA === "lbs" && hA && Pf(String(Math.round(parseFloat(hA) / 2.205))), Bf("cm"), TA("kg"), i("cm"), w("kg"),
|
|
12334
|
+
DA === "lbs" && hA && Pf(String(Math.round(parseFloat(hA) / 2.205))), Bf("cm"), TA("kg"), i("cm"), w("kg"), p?.("cm");
|
|
12335
12335
|
}, $A = () => {
|
|
12336
12336
|
if (jA === "cm") {
|
|
12337
12337
|
const UA = parseFloat(iA);
|
|
@@ -12340,7 +12340,7 @@ function MB({
|
|
|
12340
12340
|
gf(String(Math.floor(sf / 12))), ef(String(sf % 12));
|
|
12341
12341
|
}
|
|
12342
12342
|
}
|
|
12343
|
-
DA === "kg" && hA && Pf(String(Math.round(parseFloat(hA) * 2.205))), Bf("in"), TA("lbs"), i("in"), w("lbs"),
|
|
12343
|
+
DA === "kg" && hA && Pf(String(Math.round(parseFloat(hA) * 2.205))), Bf("in"), TA("lbs"), i("in"), w("lbs"), p?.("in");
|
|
12344
12344
|
};
|
|
12345
12345
|
return K ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
12346
12346
|
ng,
|
|
@@ -12761,13 +12761,13 @@ function MB({
|
|
|
12761
12761
|
const dA = (parseFloat(OA) || 5) * 12 + (parseFloat(KA) || 8);
|
|
12762
12762
|
BA(String(Math.round(dA * 2.54)));
|
|
12763
12763
|
}
|
|
12764
|
-
DA === "lbs" && hA && Pf(String(Math.round(parseFloat(hA) / 2.205))), Bf("cm"), TA("kg"), i("cm"), w("kg"),
|
|
12764
|
+
DA === "lbs" && hA && Pf(String(Math.round(parseFloat(hA) / 2.205))), Bf("cm"), TA("kg"), i("cm"), w("kg"), p?.("cm");
|
|
12765
12765
|
}, J = () => {
|
|
12766
12766
|
if (jA === "cm") {
|
|
12767
12767
|
const dA = parseFloat(iA) || 173, q = Math.round(dA / 2.54);
|
|
12768
12768
|
gf(String(Math.floor(q / 12))), ef(String(q % 12));
|
|
12769
12769
|
}
|
|
12770
|
-
DA === "kg" && hA && Pf(String(Math.round(parseFloat(hA) * 2.205))), Bf("in"), TA("lbs"), i("in"), w("lbs"),
|
|
12770
|
+
DA === "kg" && hA && Pf(String(Math.round(parseFloat(hA) * 2.205))), Bf("in"), TA("lbs"), i("in"), w("lbs"), p?.("in");
|
|
12771
12771
|
};
|
|
12772
12772
|
return K ? /* @__PURE__ */ A(
|
|
12773
12773
|
HB,
|
|
@@ -12889,7 +12889,7 @@ function MB({
|
|
|
12889
12889
|
/* @__PURE__ */ A(Ff, { img: GA.male.chest.average, label: v("Average"), selected: E === "average", onSelect: () => y("average"), onHover: () => _(v("A moderate, proportionate chest")), onLeave: () => _("") }),
|
|
12890
12890
|
/* @__PURE__ */ A(Ff, { img: GA.male.chest.broad, label: v("Broad"), selected: E === "broad", onSelect: () => y("broad"), onHover: () => _(v("A wider, more muscular chest")), onLeave: () => _("") })
|
|
12891
12891
|
] }),
|
|
12892
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12892
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: XA || " " })
|
|
12893
12893
|
] }, "step-chest")),
|
|
12894
12894
|
s === "midsection" && (K ? /* @__PURE__ */ A(
|
|
12895
12895
|
jn,
|
|
@@ -12922,7 +12922,7 @@ function MB({
|
|
|
12922
12922
|
/* @__PURE__ */ A(Ff, { img: GA.male.stomach.average, label: v("Average"), selected: QA === "average", onSelect: () => Q("average"), onHover: () => _(v("A moderate, natural midsection shape")), onLeave: () => _("") }),
|
|
12923
12923
|
/* @__PURE__ */ A(Ff, { img: GA.male.stomach.round, label: v("Full"), selected: QA === "round", onSelect: () => Q("round"), onHover: () => _(v("A fuller, more rounded midsection")), onLeave: () => _("") })
|
|
12924
12924
|
] }) }),
|
|
12925
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12925
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: XA || " " })
|
|
12926
12926
|
] }, "step-midsection")),
|
|
12927
12927
|
s === "seat" && (K ? /* @__PURE__ */ A(
|
|
12928
12928
|
jn,
|
|
@@ -12955,7 +12955,7 @@ function MB({
|
|
|
12955
12955
|
/* @__PURE__ */ A(Ff, { img: GA.male.seat.average, label: v("Average"), selected: SA === "average", onSelect: () => tf("average"), onHover: () => _(v("A moderate, natural backside shape")), onLeave: () => _("") }),
|
|
12956
12956
|
/* @__PURE__ */ A(Ff, { img: GA.male.seat.full, label: v("Full"), selected: SA === "full", onSelect: () => tf("full"), onHover: () => _(v("A fuller, more rounded backside")), onLeave: () => _("") })
|
|
12957
12957
|
] }) }),
|
|
12958
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12958
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: XA || " " })
|
|
12959
12959
|
] }, "step-seat")),
|
|
12960
12960
|
s === "hips" && e && (K ? /* @__PURE__ */ A(
|
|
12961
12961
|
jn,
|
|
@@ -12980,7 +12980,7 @@ function MB({
|
|
|
12980
12980
|
/* @__PURE__ */ A(Ff, { img: GA.female.hips.average, label: v("Average"), selected: Z === "average", onSelect: () => FA("average"), onHover: () => _(v("Hips proportionate to shoulders")), onLeave: () => _("") }),
|
|
12981
12981
|
/* @__PURE__ */ A(Ff, { img: GA.female.hips.full, label: v("Curvy"), selected: Z === "full", onSelect: () => FA("full"), onHover: () => _(v("Hips wider than shoulders")), onLeave: () => _("") })
|
|
12982
12982
|
] }),
|
|
12983
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12983
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: XA || " " })
|
|
12984
12984
|
] }, "step-hips")),
|
|
12985
12985
|
s === "bra" && e && /* @__PURE__ */ f("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-bra-step", children: [
|
|
12986
12986
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Select your bra size") }),
|
|
@@ -13095,7 +13095,7 @@ function fP({
|
|
|
13095
13095
|
formRef: C,
|
|
13096
13096
|
sizingUnit: w,
|
|
13097
13097
|
setSizingUnit: H,
|
|
13098
|
-
setSizingMethod:
|
|
13098
|
+
setSizingMethod: p,
|
|
13099
13099
|
setSizingLoading: z,
|
|
13100
13100
|
setView: T,
|
|
13101
13101
|
submitSizing: x,
|
|
@@ -13105,47 +13105,47 @@ function fP({
|
|
|
13105
13105
|
}) {
|
|
13106
13106
|
const b = B === "close-up", k = AP(), [v, O] = d("manual"), [s, S] = d(() => {
|
|
13107
13107
|
const I = {};
|
|
13108
|
-
return g.forEach((
|
|
13109
|
-
I[
|
|
13108
|
+
return g.forEach((uA) => {
|
|
13109
|
+
I[uA.key] = C.current[uA.key] || "";
|
|
13110
13110
|
}), I;
|
|
13111
|
-
}), [K, F] = d(""), tA = aA(null), [wA, YA] = d(null), [h, a] = d(null), [
|
|
13112
|
-
const
|
|
13113
|
-
if (!
|
|
13114
|
-
const AA = URL.createObjectURL(
|
|
13115
|
-
a(
|
|
13111
|
+
}), [K, F] = d(""), tA = aA(null), [wA, YA] = d(null), [h, a] = d(null), [bA, RA] = d(null), [vA, N] = d(!1), [PA, kA] = d(null), [iA, BA] = d(!1), OA = EA(async (I) => {
|
|
13112
|
+
const uA = I.target.files?.[0];
|
|
13113
|
+
if (!uA) return;
|
|
13114
|
+
const AA = URL.createObjectURL(uA);
|
|
13115
|
+
a(uA), YA(AA);
|
|
13116
13116
|
try {
|
|
13117
|
-
const sA = await tn(
|
|
13117
|
+
const sA = await tn(uA, b ? { maxDimension: 1536, quality: 0.85 } : {});
|
|
13118
13118
|
RA(sA);
|
|
13119
13119
|
} catch {
|
|
13120
13120
|
}
|
|
13121
13121
|
}, [b]), gf = EA(() => {
|
|
13122
13122
|
wA && URL.revokeObjectURL(wA), a(null), YA(null), RA(null);
|
|
13123
|
-
}, [wA]), KA = (I,
|
|
13124
|
-
S((AA) => ({ ...AA, [I]:
|
|
13123
|
+
}, [wA]), KA = (I, uA) => {
|
|
13124
|
+
S((AA) => ({ ...AA, [I]: uA })), F("");
|
|
13125
13125
|
}, ef = () => {
|
|
13126
13126
|
const I = g[0];
|
|
13127
13127
|
if (!I) return;
|
|
13128
|
-
const
|
|
13129
|
-
if (!
|
|
13128
|
+
const uA = parseFloat(s[I.key] || "");
|
|
13129
|
+
if (!uA || uA <= 0) {
|
|
13130
13130
|
F(r("Please enter your ") + r(I.label).toLowerCase());
|
|
13131
13131
|
return;
|
|
13132
13132
|
}
|
|
13133
13133
|
g.forEach((AA) => {
|
|
13134
13134
|
const sA = parseFloat(s[AA.key] || "");
|
|
13135
13135
|
sA > 0 && (C.current[AA.key] = String(sA));
|
|
13136
|
-
}), C.current.gender = C.current.gender || "male",
|
|
13136
|
+
}), C.current.gender = C.current.gender || "male", p("exact"), z(!0), T("size-result"), x("exact");
|
|
13137
13137
|
}, hA = () => {
|
|
13138
13138
|
if (PA !== !0) {
|
|
13139
13139
|
F(r("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
13140
13140
|
return;
|
|
13141
13141
|
}
|
|
13142
|
-
if (!h || !
|
|
13142
|
+
if (!h || !bA) {
|
|
13143
13143
|
F(r("Please upload a photo"));
|
|
13144
13144
|
return;
|
|
13145
13145
|
}
|
|
13146
13146
|
l({
|
|
13147
13147
|
photoFile: h,
|
|
13148
|
-
photoBase64:
|
|
13148
|
+
photoBase64: bA,
|
|
13149
13149
|
height: 0,
|
|
13150
13150
|
weight: 0,
|
|
13151
13151
|
heightUnit: "cm",
|
|
@@ -13194,7 +13194,7 @@ function fP({
|
|
|
13194
13194
|
type: "number",
|
|
13195
13195
|
className: "ps-bpm-value-input",
|
|
13196
13196
|
value: s[I.key],
|
|
13197
|
-
onChange: (
|
|
13197
|
+
onChange: (uA) => KA(I.key, uA.target.value),
|
|
13198
13198
|
placeholder: I.placeholder[w] || I.placeholder.cm || I.placeholder.in || "",
|
|
13199
13199
|
step: I.step ?? 0.5,
|
|
13200
13200
|
min: I.min,
|
|
@@ -13258,7 +13258,7 @@ function fP({
|
|
|
13258
13258
|
type: "number",
|
|
13259
13259
|
className: "ps-bp-inline-input",
|
|
13260
13260
|
value: s[I.key],
|
|
13261
|
-
onChange: (
|
|
13261
|
+
onChange: (uA) => KA(I.key, uA.target.value),
|
|
13262
13262
|
placeholder: I.placeholder[w] || I.placeholder.cm || I.placeholder.in || "",
|
|
13263
13263
|
step: I.step ?? 0.5,
|
|
13264
13264
|
min: I.min,
|
|
@@ -13557,7 +13557,7 @@ function fP({
|
|
|
13557
13557
|
type: "number",
|
|
13558
13558
|
className: "ps-bp-inline-input",
|
|
13559
13559
|
value: s[I.key],
|
|
13560
|
-
onChange: (
|
|
13560
|
+
onChange: (uA) => KA(I.key, uA.target.value),
|
|
13561
13561
|
placeholder: I.placeholder[w] || I.placeholder.cm || I.placeholder.in || "",
|
|
13562
13562
|
step: I.step ?? 0.5,
|
|
13563
13563
|
min: I.min,
|
|
@@ -13874,7 +13874,7 @@ function XB({
|
|
|
13874
13874
|
buttonIcon: C,
|
|
13875
13875
|
locale: w,
|
|
13876
13876
|
buttonStyles: H = {},
|
|
13877
|
-
modalStyles:
|
|
13877
|
+
modalStyles: p = {},
|
|
13878
13878
|
classNames: z = {},
|
|
13879
13879
|
className: T,
|
|
13880
13880
|
style: x,
|
|
@@ -13894,25 +13894,25 @@ function XB({
|
|
|
13894
13894
|
NA(() => {
|
|
13895
13895
|
YA(!0);
|
|
13896
13896
|
}, []);
|
|
13897
|
-
const [h, a] = d("idle"), [
|
|
13897
|
+
const [h, a] = d("idle"), [bA, RA] = d(null), [vA, N] = d(null), [PA, kA] = d(null), [iA, BA] = d(null), [OA, gf] = d(!1), [KA, ef] = d(!1), [hA, Pf] = d(null), [ZA, df] = d(null), jA = aA(null);
|
|
13898
13898
|
NA(() => {
|
|
13899
13899
|
jA.current = ZA;
|
|
13900
13900
|
}, [ZA]);
|
|
13901
|
-
const [Bf, DA] = d(null), [TA, I] = d(null), [
|
|
13901
|
+
const [Bf, DA] = d(null), [TA, I] = d(null), [uA, AA] = d(!1), [sA, yA] = d(!1), [Of, LA] = d(!1), [gA, Uf] = d(null), [jf, lA] = d(!1), Mf = aA(!1), [Qf, af] = d(hg), xf = JP(Qf), [_A, of] = d(xf ? "in" : "cm"), [mA, E] = d(xf ? "in" : "cm"), [y, QA] = d(xf ? "lbs" : "kg");
|
|
13902
13902
|
NA(() => {
|
|
13903
13903
|
const t = Lf(g);
|
|
13904
13904
|
t === "foot" || t === "head" ? of("cm") : t === "face" && of("mm");
|
|
13905
13905
|
}, [g]);
|
|
13906
|
-
const Q = aA({}), [Z, FA] = d("male"), [SA, tf] = d(0), [
|
|
13906
|
+
const Q = aA({}), [Z, FA] = d("male"), [SA, tf] = d(0), [XA, _] = d(null), [qA, W] = d(!1), [L, V] = d(() => Kf("profiles", [])), [xA, wf] = d(() => Kf("history", [])), [cA, Df] = d(() => kP()), [Af, Hf] = d(() => /* @__PURE__ */ new Set()), [WA, ff] = d(null), nf = EA((t) => {
|
|
13907
13907
|
Df(t), Xg(t);
|
|
13908
13908
|
}, []), [VA, o] = d(!1), [j, U] = d(null), [R, u] = d(null), Y = aA(null), MA = aA(() => !1), HA = aA(() => {
|
|
13909
|
-
}), JA = EA((t,
|
|
13910
|
-
MA.current = t, HA.current =
|
|
13909
|
+
}), JA = EA((t, c) => {
|
|
13910
|
+
MA.current = t, HA.current = c;
|
|
13911
13911
|
}, []), X = aA(null), J = aA(null), dA = aA(null), q = aA(null), nA = aA(null), vf = aA(!1), zf = aA(null), $A = aA(null), [UA, sf] = d(null), [Cn, mf] = d(null), Xf = aA(null);
|
|
13912
13912
|
NA(() => {
|
|
13913
13913
|
try {
|
|
13914
|
-
const t = Zf(),
|
|
13915
|
-
J.current = new dg(t,
|
|
13914
|
+
const t = Zf(), c = qf(P);
|
|
13915
|
+
J.current = new dg(t, c), dA.current = new Ug(J.current.getStreamUrl());
|
|
13916
13916
|
} catch {
|
|
13917
13917
|
}
|
|
13918
13918
|
return () => {
|
|
@@ -13931,14 +13931,14 @@ function XB({
|
|
|
13931
13931
|
{ at: 50, text: F("Generating virtual try-on...") },
|
|
13932
13932
|
{ at: 75, text: F("Refining details...") },
|
|
13933
13933
|
{ at: 90, text: F("Almost there...") }
|
|
13934
|
-
],
|
|
13934
|
+
], c = 2 * Math.PI * 27;
|
|
13935
13935
|
return Nf.current = setInterval(() => {
|
|
13936
13936
|
if (vf.current) return;
|
|
13937
13937
|
const G = xn.current || Date.now(), pA = (Date.now() - G) / 1e3, $ = Math.min(95, pA / Wf * 100);
|
|
13938
13938
|
Vf.current = $;
|
|
13939
13939
|
const eA = Math.round($);
|
|
13940
13940
|
if (Jf.current && (Jf.current.style.width = `${eA}%`), Yf.current && (Yf.current.textContent = `${eA}%`), nn.current) {
|
|
13941
|
-
const M =
|
|
13941
|
+
const M = c * (1 - $ / 100);
|
|
13942
13942
|
nn.current.style.strokeDashoffset = String(M);
|
|
13943
13943
|
}
|
|
13944
13944
|
if (fn.current) {
|
|
@@ -13963,9 +13963,9 @@ function XB({
|
|
|
13963
13963
|
vA && URL.revokeObjectURL(vA);
|
|
13964
13964
|
}, [vA]), NA(() => {
|
|
13965
13965
|
if (h !== "idle") {
|
|
13966
|
-
const t = window.scrollY,
|
|
13966
|
+
const t = window.scrollY, c = document.body.style.overflow, G = document.body.style.overscrollBehavior;
|
|
13967
13967
|
return document.body.style.overflow = "hidden", document.body.style.overscrollBehavior = "none", () => {
|
|
13968
|
-
document.body.style.overflow =
|
|
13968
|
+
document.body.style.overflow = c, document.body.style.overscrollBehavior = G, window.scrollTo(0, t);
|
|
13969
13969
|
};
|
|
13970
13970
|
}
|
|
13971
13971
|
}, [h]), NA(() => {
|
|
@@ -13986,10 +13986,10 @@ function XB({
|
|
|
13986
13986
|
return;
|
|
13987
13987
|
}
|
|
13988
13988
|
lA(!0);
|
|
13989
|
-
const t = qf(P),
|
|
13989
|
+
const t = qf(P), c = Zf();
|
|
13990
13990
|
fetch(`${t}/api/v1/sizing/sizeguide`, {
|
|
13991
13991
|
method: "POST",
|
|
13992
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${
|
|
13992
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${c}` },
|
|
13993
13993
|
body: JSON.stringify({ product: { title: g, productId: s }, sizeGuideRaw: O })
|
|
13994
13994
|
}).then((G) => G.ok ? G.json() : null).then((G) => {
|
|
13995
13995
|
Uf(G || { found: !1 });
|
|
@@ -14013,7 +14013,7 @@ function XB({
|
|
|
14013
14013
|
return 1;
|
|
14014
14014
|
}
|
|
14015
14015
|
}, [h]), Pn = EA(
|
|
14016
|
-
(t,
|
|
14016
|
+
(t, c) => {
|
|
14017
14017
|
let G = cA, pA = L.find(($) => $.id === G);
|
|
14018
14018
|
if (!pA) {
|
|
14019
14019
|
const $ = {
|
|
@@ -14050,16 +14050,16 @@ function XB({
|
|
|
14050
14050
|
}).then(($) => {
|
|
14051
14051
|
!$ || !G || (Gn(G, $.estimates, $.unit), V(Kf("profiles", [])));
|
|
14052
14052
|
}).catch(() => {
|
|
14053
|
-
}).finally(() => yA(!0)),
|
|
14054
|
-
const $ =
|
|
14055
|
-
Object.entries(
|
|
14053
|
+
}).finally(() => yA(!0)), c?.recommendedSize && G) {
|
|
14054
|
+
const $ = c.sections ? Object.fromEntries(
|
|
14055
|
+
Object.entries(c.sections).map(([eA, M]) => [eA, M.recommendedSize])
|
|
14056
14056
|
) : void 0;
|
|
14057
14057
|
lP(G, {
|
|
14058
14058
|
productId: s,
|
|
14059
14059
|
productTitle: g,
|
|
14060
14060
|
productImage: n,
|
|
14061
|
-
recommendedSize:
|
|
14062
|
-
confidence:
|
|
14061
|
+
recommendedSize: c.recommendedSize,
|
|
14062
|
+
confidence: c.confidence,
|
|
14063
14063
|
sections: $,
|
|
14064
14064
|
savedAt: Date.now()
|
|
14065
14065
|
}), V(Kf("profiles", []));
|
|
@@ -14067,14 +14067,14 @@ function XB({
|
|
|
14067
14067
|
},
|
|
14068
14068
|
[cA, L, P, n, g, s, nf]
|
|
14069
14069
|
), Rn = aA(null), [gn, On] = d(null), nP = EA(async (t) => {
|
|
14070
|
-
const
|
|
14071
|
-
if (!pA && $ &&
|
|
14070
|
+
const c = t.height ?? t.heightCm ?? 0, G = t.weight ?? t.weightKg ?? 0, pA = !!t.measurements && Object.keys(t.measurements).length > 0, $ = t.photoBase64;
|
|
14071
|
+
if (!pA && $ && c > 0 && Rn.current) {
|
|
14072
14072
|
try {
|
|
14073
14073
|
const M = $.startsWith("data:") ? $ : `data:image/jpeg;base64,${$}`, m = await fetch(M).then((oA) => oA.blob()), CA = new File([m], "profile-photo.jpg", { type: m.type || "image/jpeg" });
|
|
14074
14074
|
await Rn.current({
|
|
14075
14075
|
photoFile: CA,
|
|
14076
14076
|
photoBase64: $,
|
|
14077
|
-
height:
|
|
14077
|
+
height: c,
|
|
14078
14078
|
weight: G,
|
|
14079
14079
|
heightUnit: t.heightUnit || "cm",
|
|
14080
14080
|
weightUnit: t.weightUnit || "kg",
|
|
@@ -14112,8 +14112,8 @@ function XB({
|
|
|
14112
14112
|
}, [s, g, n, O, P, vA]), gg = EA(async () => {
|
|
14113
14113
|
const t = L.find(($) => $.id === cA);
|
|
14114
14114
|
if (!t) return;
|
|
14115
|
-
const
|
|
14116
|
-
|
|
14115
|
+
const c = t.height ?? t.heightCm ?? 0, G = t.weight ?? t.weightKg ?? 0;
|
|
14116
|
+
c > 0 && G > 0 && On(t);
|
|
14117
14117
|
}, [L, cA]), eg = EA(() => {
|
|
14118
14118
|
if (!gn) return;
|
|
14119
14119
|
const t = gn;
|
|
@@ -14171,8 +14171,8 @@ function XB({
|
|
|
14171
14171
|
return;
|
|
14172
14172
|
}
|
|
14173
14173
|
RA(t), Xf.current = t;
|
|
14174
|
-
const
|
|
14175
|
-
N(
|
|
14174
|
+
const c = URL.createObjectURL(t);
|
|
14175
|
+
N(c), r?.(t), $A.current = null, Un(c).then((G) => {
|
|
14176
14176
|
$A.current = G;
|
|
14177
14177
|
}).catch(() => {
|
|
14178
14178
|
});
|
|
@@ -14182,23 +14182,23 @@ function XB({
|
|
|
14182
14182
|
nA.current && (clearInterval(nA.current), nA.current = null), q.current?.(), q.current = null;
|
|
14183
14183
|
}, []), sn = EA((t) => {
|
|
14184
14184
|
if (t.status === "completed" && t.imageUrl) {
|
|
14185
|
-
if (kA((
|
|
14185
|
+
if (kA((c) => !c || c.startsWith("data:") || !t.imageUrl.startsWith("data:") ? t.imageUrl : c), !vf.current) {
|
|
14186
14186
|
if (vf.current = !0, Vf.current = 100, Jf.current && (Jf.current.style.width = "100%"), Yf.current && (Yf.current.textContent = "100%"), nn.current && (nn.current.style.strokeDashoffset = "0"), fn.current && (fn.current.textContent = F("Done")), An.current) {
|
|
14187
|
-
const
|
|
14188
|
-
|
|
14189
|
-
|
|
14187
|
+
const c = An.current;
|
|
14188
|
+
c.style.opacity = "0", setTimeout(() => {
|
|
14189
|
+
c.textContent = F("Complete!"), c.style.opacity = "1";
|
|
14190
14190
|
}, 180);
|
|
14191
14191
|
}
|
|
14192
14192
|
en(), LA(!1), k?.({ jobId: t.galleryId, imageUrl: t.imageUrl });
|
|
14193
14193
|
}
|
|
14194
14194
|
} else if (t.status === "failed" && !vf.current) {
|
|
14195
14195
|
vf.current = !0, en(), LA(!1);
|
|
14196
|
-
const
|
|
14197
|
-
BA(
|
|
14196
|
+
const c = t.error || F("Try-on generation failed");
|
|
14197
|
+
BA(c), a("error"), v?.({ message: c });
|
|
14198
14198
|
}
|
|
14199
14199
|
}, [k, v, en]), hf = pf(() => gA?.found && gA.requiredFields && gA.requiredFields.length > 0 ? gA.requiredFields : Z === "female" ? Gg : Yg, [gA, Z]), Bn = EA(async (t) => {
|
|
14200
14200
|
if (!J.current) return;
|
|
14201
|
-
const
|
|
14201
|
+
const c = t || Bf, G = qf(P), pA = Zf(), $ = Lf(g);
|
|
14202
14202
|
if ($ === "face" || $ === "head") {
|
|
14203
14203
|
const M = Q.current, m = (IA) => {
|
|
14204
14204
|
if (!IA) return;
|
|
@@ -14247,11 +14247,11 @@ function XB({
|
|
|
14247
14247
|
return;
|
|
14248
14248
|
}
|
|
14249
14249
|
const eA = {
|
|
14250
|
-
method:
|
|
14250
|
+
method: c,
|
|
14251
14251
|
locale: Qf,
|
|
14252
14252
|
product: { title: g, productId: s, description: "", variants: [] }
|
|
14253
14253
|
};
|
|
14254
|
-
if (gA?.found && (eA.sizeGuide = gA, gA.sections && (eA.sizeGuide = { ...gA, sections: gA.sections })), eA.sizingUnit = _A, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: gA?.found, hasHeaders: !!gA?.headers, hasRows: !!gA?.rows, headers: gA?.headers, rowCount: gA?.rows?.length, hasSections: !!gA?.sections, sectionNames: gA?.sections ? Object.keys(gA.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", eA.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", eA.sizeGuide && eA.sizeGuide.rows?.[0] ? Array.isArray(eA.sizeGuide.rows[0]) ? "array" : typeof eA.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(eA).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:",
|
|
14254
|
+
if (gA?.found && (eA.sizeGuide = gA, gA.sections && (eA.sizeGuide = { ...gA, sections: gA.sections })), eA.sizingUnit = _A, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: gA?.found, hasHeaders: !!gA?.headers, hasRows: !!gA?.rows, headers: gA?.headers, rowCount: gA?.rows?.length, hasSections: !!gA?.sections, sectionNames: gA?.sections ? Object.keys(gA.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", eA.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", eA.sizeGuide && eA.sizeGuide.rows?.[0] ? Array.isArray(eA.sizeGuide.rows[0]) ? "array" : typeof eA.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(eA).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:", c, "| sizingUnit:", _A, "| heightUnit:", mA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(Q.current)), console.log("[PS-SDK] dynamicFields:", hf.map((M) => `${M.key}(unit=${M.unit},req=${M.required})`).join(", ")), c === "exact") {
|
|
14255
14255
|
const M = { gender: Q.current.gender || "male", sizingUnit: _A }, m = /* @__PURE__ */ new Set();
|
|
14256
14256
|
for (const CA of hf)
|
|
14257
14257
|
CA.unit !== "size" && !["shoeEU", "shoeUS", "shoeUK"].includes(CA.key) && m.add(CA.key);
|
|
@@ -14290,7 +14290,7 @@ function XB({
|
|
|
14290
14290
|
if (M.ok) {
|
|
14291
14291
|
const m = await M.json();
|
|
14292
14292
|
console.log("[PS-SDK] Sizing recommend RESULT:", JSON.stringify(m)), I(m), k?.(m);
|
|
14293
|
-
const CA = eA.measurements || {}, oA = eA.quickEstimate || {}, zA =
|
|
14293
|
+
const CA = eA.measurements || {}, oA = eA.quickEstimate || {}, zA = c === "exact" ? CA : oA;
|
|
14294
14294
|
Pn(
|
|
14295
14295
|
{
|
|
14296
14296
|
gender: zA.gender || "male",
|
|
@@ -14314,7 +14314,7 @@ function XB({
|
|
|
14314
14314
|
} finally {
|
|
14315
14315
|
AA(!1);
|
|
14316
14316
|
}
|
|
14317
|
-
}, [P, Bf, Qf, mA, y, _A, gA, g, hf, Pn]), ig = EA(async (t,
|
|
14317
|
+
}, [P, Bf, Qf, mA, y, _A, gA, g, hf, Pn]), ig = EA(async (t, c, G, pA, $, eA, M, m, CA, oA, zA) => {
|
|
14318
14318
|
if (!J.current) {
|
|
14319
14319
|
const IA = F("SDK not configured. Please refresh and try again.");
|
|
14320
14320
|
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), BA(IA), a("error"), v?.({ message: IA, code: "SDK_NOT_CONFIGURED" });
|
|
@@ -14335,7 +14335,7 @@ function XB({
|
|
|
14335
14335
|
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), DA("quick"), AA(!0), a("size-result"), Bn("quick");
|
|
14336
14336
|
return;
|
|
14337
14337
|
}
|
|
14338
|
-
Q.current.height = String(t), Q.current.weight = String(
|
|
14338
|
+
Q.current.height = String(t), Q.current.weight = String(c), Q.current.heightUnit = G, Q.current.weightUnit = pA, Q.current.gender = $, eA && (Q.current.age = String(eA)), M && (Q.current.bodyType = M), m && (Q.current.chestProfile = m), CA && (Q.current.midsectionProfile = CA), oA && (Q.current.hipProfile = oA), I(null), kA(null), DA("quick"), AA(!0), a("size-result"), Bn("quick");
|
|
14339
14339
|
}, [P, hf, gA, Bn, _A, y]), Kn = EA(async (t) => {
|
|
14340
14340
|
if (console.log("[ps-sdk] handleSnapSubmit fired", {
|
|
14341
14341
|
hasApiRef: !!J.current,
|
|
@@ -14346,8 +14346,8 @@ function XB({
|
|
|
14346
14346
|
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), BA(oA), a("error"), v?.({ message: oA, code: "SDK_NOT_CONFIGURED" });
|
|
14347
14347
|
return;
|
|
14348
14348
|
}
|
|
14349
|
-
const
|
|
14350
|
-
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl:
|
|
14349
|
+
const c = qf(P), G = Zf();
|
|
14350
|
+
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: c }), RA(t.photoFile), Xf.current = t.photoFile;
|
|
14351
14351
|
const pA = t.photoFile ? URL.createObjectURL(t.photoFile) : t.photoBase64.startsWith("data:") ? t.photoBase64 : `data:image/jpeg;base64,${t.photoBase64}`;
|
|
14352
14352
|
N(pA), vf.current = !1, LA(!1), I(null), kA(null), AA(!0), yA(!1), a("size-result");
|
|
14353
14353
|
const $ = Lf(g);
|
|
@@ -14371,7 +14371,7 @@ function XB({
|
|
|
14371
14371
|
bodyImage: t.photoBase64
|
|
14372
14372
|
};
|
|
14373
14373
|
zA && (Cf.faceMeasurementsMm = zA.measurementsMm, Cf.faceLandmarks = zA.landmarks, Cf.irisConfidence = zA.irisConfidence);
|
|
14374
|
-
const Tf = await fetch(`${
|
|
14374
|
+
const Tf = await fetch(`${c}/api/v1/sizing/face-recommend`, {
|
|
14375
14375
|
method: "POST",
|
|
14376
14376
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${G}` },
|
|
14377
14377
|
body: JSON.stringify(Cf)
|
|
@@ -14426,7 +14426,7 @@ function XB({
|
|
|
14426
14426
|
};
|
|
14427
14427
|
gA?.found && (CA.sizeGuide = gA);
|
|
14428
14428
|
try {
|
|
14429
|
-
const oA = await fetch(`${
|
|
14429
|
+
const oA = await fetch(`${c}/api/v1/sizing/recommend`, {
|
|
14430
14430
|
method: "POST",
|
|
14431
14431
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${G}` },
|
|
14432
14432
|
body: JSON.stringify(CA)
|
|
@@ -14454,14 +14454,14 @@ function XB({
|
|
|
14454
14454
|
}, [P, n, g, _A, y, Qf, gA, hf, Pn]);
|
|
14455
14455
|
Rn.current = Kn;
|
|
14456
14456
|
const eP = EA(async (t) => {
|
|
14457
|
-
const
|
|
14458
|
-
if (!
|
|
14457
|
+
const c = t || bA || Xf.current;
|
|
14458
|
+
if (!c || !J.current || !dA.current) {
|
|
14459
14459
|
const eA = J.current ? F("Please upload a photo first.") : F("SDK not configured. Please provide an API key.");
|
|
14460
14460
|
BA(eA), a("error"), v?.({ message: eA, code: "SDK_NOT_CONFIGURED" });
|
|
14461
14461
|
return;
|
|
14462
14462
|
}
|
|
14463
|
-
t && t !==
|
|
14464
|
-
const G = OP(Lf(g)), pA = G === "apparel", $ = (t ? null : vA) || URL.createObjectURL(
|
|
14463
|
+
t && t !== bA && (RA(t), Xf.current = t), vf.current = !1, LA(!0);
|
|
14464
|
+
const G = OP(Lf(g)), pA = G === "apparel", $ = (t ? null : vA) || URL.createObjectURL(c);
|
|
14465
14465
|
(t || !vA) && N($), $A.current = null, sf(null), pA && (Un($).then((eA) => {
|
|
14466
14466
|
$A.current = eA;
|
|
14467
14467
|
}).catch(() => {
|
|
@@ -14470,7 +14470,7 @@ function XB({
|
|
|
14470
14470
|
}).catch(() => {
|
|
14471
14471
|
}));
|
|
14472
14472
|
try {
|
|
14473
|
-
const eA = await tn(
|
|
14473
|
+
const eA = await tn(c), M = jA.current, m = M?.matchDetails && M.matchDetails.length ? M.matchDetails : TA?.matchDetails || [];
|
|
14474
14474
|
let CA;
|
|
14475
14475
|
pA && m.length && (CA = aP(m, $A.current));
|
|
14476
14476
|
const oA = await J.current.submitTryOn(
|
|
@@ -14505,8 +14505,8 @@ function XB({
|
|
|
14505
14505
|
const M = eA instanceof Error ? eA.message : F("Failed to start try-on"), m = eA instanceof sP ? eA.code : void 0;
|
|
14506
14506
|
BA(M), a("error"), v?.({ message: M, code: m });
|
|
14507
14507
|
}
|
|
14508
|
-
}, [
|
|
14509
|
-
const G =
|
|
14508
|
+
}, [bA, n, g, TA, b, v, sn]), Tn = EA(async (t, c) => {
|
|
14509
|
+
const G = bA || Xf.current;
|
|
14510
14510
|
if (!G || !J.current || !dA.current) {
|
|
14511
14511
|
console.warn("[ps-sdk:retry] skipping — no file/api/sse", {
|
|
14512
14512
|
hasFile: !!G,
|
|
@@ -14515,7 +14515,7 @@ function XB({
|
|
|
14515
14515
|
});
|
|
14516
14516
|
return;
|
|
14517
14517
|
}
|
|
14518
|
-
ef(!0);
|
|
14518
|
+
console.log("[ps-sdk:retry] starting", { fitInfoCount: t.length, selectedSizeOverride: c, fitInfo: t }), ef(!0);
|
|
14519
14519
|
const pA = OP(Lf(g)), $ = pA === "apparel";
|
|
14520
14520
|
if ($ && $A.current) {
|
|
14521
14521
|
const eA = {
|
|
@@ -14543,7 +14543,7 @@ function XB({
|
|
|
14543
14543
|
{
|
|
14544
14544
|
productId: s,
|
|
14545
14545
|
productTitle: g,
|
|
14546
|
-
silhouetteContext: jP(TA, gA,
|
|
14546
|
+
silhouetteContext: jP(TA, gA, c)
|
|
14547
14547
|
}
|
|
14548
14548
|
);
|
|
14549
14549
|
q.current = dA.current.onJob(m.jobId, (oA) => {
|
|
@@ -14568,36 +14568,39 @@ function XB({
|
|
|
14568
14568
|
} catch {
|
|
14569
14569
|
ef(!1);
|
|
14570
14570
|
}
|
|
14571
|
-
}, [
|
|
14572
|
-
df(t);
|
|
14573
|
-
const
|
|
14574
|
-
if (!
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
|
|
14571
|
+
}, [bA, n, g]), Dg = EA((t) => {
|
|
14572
|
+
console.log("[ps-sdk:regen] fired", { override: t, hasFile: !!bA, hasRefFile: !!Xf.current }), df(t);
|
|
14573
|
+
const c = t.matchDetails || [];
|
|
14574
|
+
if (!c.length) {
|
|
14575
|
+
console.warn("[ps-sdk:regen] no matchDetails in override — cannot rebuild fitInfo");
|
|
14576
|
+
return;
|
|
14577
|
+
}
|
|
14578
|
+
const G = aP(c, $A.current);
|
|
14579
|
+
console.log("[ps-sdk:regen] fitInfo built", { fitInfo: G, label: t.displayLabel }), Tn(G, t.displayLabel);
|
|
14580
|
+
}, [Tn, bA]), rg = EA(() => {
|
|
14578
14581
|
if (PA)
|
|
14579
14582
|
if (PA.startsWith("data:")) {
|
|
14580
14583
|
const t = document.createElement("a");
|
|
14581
14584
|
t.href = PA, t.download = `primestyle-tryon-${Date.now()}.png`, t.click();
|
|
14582
14585
|
} else
|
|
14583
14586
|
fetch(PA).then((t) => t.blob()).then((t) => {
|
|
14584
|
-
const
|
|
14585
|
-
G.href =
|
|
14587
|
+
const c = URL.createObjectURL(t), G = document.createElement("a");
|
|
14588
|
+
G.href = c, G.download = `primestyle-tryon-${Date.now()}.png`, G.click(), setTimeout(() => URL.revokeObjectURL(c), 100);
|
|
14586
14589
|
}).catch(() => window.open(PA, "_blank"));
|
|
14587
14590
|
}, [PA]), Cg = EA(() => {
|
|
14588
14591
|
vf.current = !1, en(), RA(null), vA && URL.revokeObjectURL(vA), N(null), kA(null), BA(null), DA(null), I(null), AA(!1), o(!1), a("body-profile");
|
|
14589
14592
|
}, [vA, en]), Hg = EA((t) => {
|
|
14590
|
-
const
|
|
14591
|
-
if (!
|
|
14593
|
+
const c = L.find((pA) => pA.id === t);
|
|
14594
|
+
if (!c) return;
|
|
14592
14595
|
nf(t), V((pA) => pA.map(($) => $.id === t ? { ...$, lastUsedAt: Date.now() } : $));
|
|
14593
|
-
const G = { gender:
|
|
14594
|
-
if ((
|
|
14595
|
-
for (const [pA, $] of Object.entries(
|
|
14596
|
+
const G = { gender: c.gender || "male" };
|
|
14597
|
+
if ((c.height ?? c.heightCm) && (G.height = String(c.height ?? c.heightCm)), (c.weight ?? c.weightKg) && (G.weight = String(c.weight ?? c.weightKg)), c.chest && (G.chest = String(c.chest)), c.bust && (G.bust = String(c.bust)), c.waist && (G.waist = String(c.waist)), c.hips && (G.hips = String(c.hips)), c.shoulderWidth && (G.shoulderWidth = String(c.shoulderWidth)), c.sleeveLength && (G.sleeveLength = String(c.sleeveLength)), c.inseam && (G.inseam = String(c.inseam)), c.neckCircumference && (G.neckCircumference = String(c.neckCircumference)), c.footLengthCm && (G.footLengthCm = String(c.footLengthCm)), c.shoeEU && (G.shoeEU = c.shoeEU), c.shoeUS && (G.shoeUS = c.shoeUS), c.shoeUK && (G.shoeUK = c.shoeUK), c.fitPreference && (G.fitPreference = c.fitPreference), c.customMeasurements)
|
|
14598
|
+
for (const [pA, $] of Object.entries(c.customMeasurements))
|
|
14596
14599
|
G[pA] = String($);
|
|
14597
|
-
Q.current = G, FA(G.gender || "male"),
|
|
14600
|
+
Q.current = G, FA(G.gender || "male"), c.country && af(c.country), c.sizingUnit && of(c.sizingUnit), c.heightUnit && E(c.heightUnit), c.weightUnit && QA(c.weightUnit), tf((pA) => pA + 1);
|
|
14598
14601
|
}, [L]);
|
|
14599
|
-
og.current = Hg, EA((t,
|
|
14600
|
-
const G = (
|
|
14602
|
+
og.current = Hg, EA((t, c) => {
|
|
14603
|
+
const G = (c ? null : cA) || `p_${Date.now()}`, pA = {
|
|
14601
14604
|
id: G,
|
|
14602
14605
|
name: t,
|
|
14603
14606
|
gender: Q.current.gender || "male",
|
|
@@ -14675,10 +14678,10 @@ function XB({
|
|
|
14675
14678
|
date: Date.now()
|
|
14676
14679
|
};
|
|
14677
14680
|
if (cA) {
|
|
14678
|
-
const
|
|
14679
|
-
|
|
14681
|
+
const c = L.find((G) => G.id === cA);
|
|
14682
|
+
c && (t.profileName = c.name);
|
|
14680
14683
|
}
|
|
14681
|
-
wf((
|
|
14684
|
+
wf((c) => [t, ...c].slice(0, 50));
|
|
14682
14685
|
}, [g, n, PA, TA, gA, cA, L]), yf = aA(!1), Hn = aA(!1);
|
|
14683
14686
|
NA(() => {
|
|
14684
14687
|
h === "size-result" && TA && !yf.current ? (yf.current = !0, Hn.current = !1, BP()) : h === "size-result" && TA && PA && !Hn.current ? (Hn.current = !0, wf((t) => t.length === 0 ? t : [{ ...t[0], resultImageUrl: PA }, ...t.slice(1)])) : h === "result" && PA && !yf.current ? (yf.current = !0, BP()) : (h === "welcome" || h === "body-profile") && (yf.current = !1, Hn.current = !1);
|
|
@@ -14691,16 +14694,16 @@ function XB({
|
|
|
14691
14694
|
internationalSizes: t.internationalSizes,
|
|
14692
14695
|
matchDetails: t.matchDetails
|
|
14693
14696
|
}), t.sizeGuide && (Uf(t.sizeGuide), lA(!1)), kA(t.resultImageUrl || null), AA(!1), LA(!1), Pf(null), U(null), a("size-result");
|
|
14694
|
-
}, []), zg = EA((t,
|
|
14695
|
-
Q.current[t] =
|
|
14697
|
+
}, []), zg = EA((t, c) => {
|
|
14698
|
+
Q.current[t] = c;
|
|
14696
14699
|
}, []);
|
|
14697
14700
|
pf(() => {
|
|
14698
|
-
const
|
|
14701
|
+
const c = {
|
|
14699
14702
|
US: { key: "shoeUS", labelKey: "Shoe size (US)", ph: "e.g. 10" },
|
|
14700
14703
|
UK: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" },
|
|
14701
14704
|
AU: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" }
|
|
14702
14705
|
}[Qf] || { key: "shoeEU", labelKey: "Shoe size (EU)", ph: "e.g. 43" };
|
|
14703
|
-
return { key:
|
|
14706
|
+
return { key: c.key, label: F(c.labelKey), ph: c.ph };
|
|
14704
14707
|
}, [Qf, F]);
|
|
14705
14708
|
const cg = {
|
|
14706
14709
|
"--ps-btn-bg": H.backgroundColor,
|
|
@@ -14718,50 +14721,50 @@ function XB({
|
|
|
14718
14721
|
"--ps-btn-icon-size": H.iconSize,
|
|
14719
14722
|
"--ps-btn-icon-color": H.iconColor,
|
|
14720
14723
|
"--ps-btn-shadow": H.boxShadow,
|
|
14721
|
-
"--ps-modal-overlay":
|
|
14722
|
-
"--ps-modal-bg":
|
|
14723
|
-
"--ps-modal-color":
|
|
14724
|
-
"--ps-modal-radius":
|
|
14725
|
-
"--ps-modal-width":
|
|
14726
|
-
"--ps-modal-max-width":
|
|
14727
|
-
"--ps-modal-font":
|
|
14728
|
-
"--ps-modal-header-bg":
|
|
14729
|
-
"--ps-modal-header-color":
|
|
14730
|
-
"--ps-modal-close-color":
|
|
14731
|
-
"--ps-upload-border":
|
|
14732
|
-
"--ps-upload-bg":
|
|
14733
|
-
"--ps-upload-color":
|
|
14734
|
-
"--ps-upload-icon-color":
|
|
14735
|
-
"--ps-modal-primary-bg":
|
|
14736
|
-
"--ps-modal-primary-color":
|
|
14737
|
-
"--ps-modal-primary-radius":
|
|
14738
|
-
"--ps-loader":
|
|
14739
|
-
"--ps-result-radius":
|
|
14724
|
+
"--ps-modal-overlay": p.overlayColor,
|
|
14725
|
+
"--ps-modal-bg": p.backgroundColor,
|
|
14726
|
+
"--ps-modal-color": p.textColor,
|
|
14727
|
+
"--ps-modal-radius": p.borderRadius,
|
|
14728
|
+
"--ps-modal-width": p.width,
|
|
14729
|
+
"--ps-modal-max-width": p.maxWidth,
|
|
14730
|
+
"--ps-modal-font": p.fontFamily,
|
|
14731
|
+
"--ps-modal-header-bg": p.headerBackgroundColor,
|
|
14732
|
+
"--ps-modal-header-color": p.headerTextColor,
|
|
14733
|
+
"--ps-modal-close-color": p.closeButtonColor,
|
|
14734
|
+
"--ps-upload-border": p.uploadBorderColor,
|
|
14735
|
+
"--ps-upload-bg": p.uploadBackgroundColor,
|
|
14736
|
+
"--ps-upload-color": p.uploadTextColor,
|
|
14737
|
+
"--ps-upload-icon-color": p.uploadIconColor,
|
|
14738
|
+
"--ps-modal-primary-bg": p.primaryButtonBackgroundColor,
|
|
14739
|
+
"--ps-modal-primary-color": p.primaryButtonTextColor,
|
|
14740
|
+
"--ps-modal-primary-radius": p.primaryButtonBorderRadius,
|
|
14741
|
+
"--ps-loader": p.loaderColor,
|
|
14742
|
+
"--ps-result-radius": p.resultBorderRadius,
|
|
14740
14743
|
// New theming variables.
|
|
14741
14744
|
// accentColor falls back to the trigger button background so the user's
|
|
14742
14745
|
// brand color cascades to the modal automatically without having to pass
|
|
14743
14746
|
// both buttonStyles AND modalStyles. Most consumers only set buttonStyles.
|
|
14744
|
-
"--ps-accent":
|
|
14745
|
-
"--ps-accent-hover":
|
|
14746
|
-
"--ps-accent-light":
|
|
14747
|
-
"--ps-text-primary":
|
|
14748
|
-
"--ps-text-secondary":
|
|
14749
|
-
"--ps-text-muted":
|
|
14750
|
-
"--ps-border-color":
|
|
14751
|
-
"--ps-bg-secondary":
|
|
14752
|
-
"--ps-error-color":
|
|
14753
|
-
"--ps-success-color":
|
|
14754
|
-
"--ps-logo-height":
|
|
14747
|
+
"--ps-accent": p.accentColor ?? H.backgroundColor,
|
|
14748
|
+
"--ps-accent-hover": p.accentHoverColor ?? H.hoverBackgroundColor,
|
|
14749
|
+
"--ps-accent-light": p.accentLightColor,
|
|
14750
|
+
"--ps-text-primary": p.textPrimaryColor,
|
|
14751
|
+
"--ps-text-secondary": p.textSecondaryColor,
|
|
14752
|
+
"--ps-text-muted": p.textMutedColor,
|
|
14753
|
+
"--ps-border-color": p.borderColor,
|
|
14754
|
+
"--ps-bg-secondary": p.secondaryBackgroundColor,
|
|
14755
|
+
"--ps-error-color": p.errorColor,
|
|
14756
|
+
"--ps-success-color": p.successColor,
|
|
14757
|
+
"--ps-logo-height": p.logoHeight
|
|
14755
14758
|
}, oP = Object.fromEntries(Object.entries(cg).filter(([, t]) => t !== void 0));
|
|
14756
14759
|
function pg() {
|
|
14757
14760
|
switch (h) {
|
|
14758
14761
|
case "welcome":
|
|
14759
14762
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(ve, { productImage: n, setView: a, t: F }) }, "v-welcome");
|
|
14760
14763
|
case "body-profile": {
|
|
14761
|
-
const t = Lf(g),
|
|
14762
|
-
if (t === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(RB, { ...
|
|
14763
|
-
if (t === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(KB, { ...
|
|
14764
|
-
if (t === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(bB, { ...
|
|
14764
|
+
const t = Lf(g), c = { productImage: n, productTitle: g, formRef: Q, sizingUnit: _A, setSizingUnit: of, setSizingMethod: DA, setSizingLoading: AA, setView: a, submitSizing: Bn, onSnapSubmit: Kn, onBack: Sf, sizeGuide: gA, t: F };
|
|
14765
|
+
if (t === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(RB, { ...c }) }, "v-foot");
|
|
14766
|
+
if (t === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(KB, { ...c }) }, "v-head");
|
|
14767
|
+
if (t === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(bB, { ...c }) }, "v-face");
|
|
14765
14768
|
const G = !!(gA?.requiredFields?.some((M) => M.key === "bust") || gA?.sections && Object.values(gA.sections).some((M) => M.requiredFields?.some((m) => m.key === "bust"))), pA = g.toLowerCase(), $ = /\b(women|woman|ladies|female|dress|skirt|blouse|bra)\b/i.test(pA);
|
|
14766
14769
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
14767
14770
|
MB,
|
|
@@ -14817,7 +14820,7 @@ function XB({
|
|
|
14817
14820
|
{
|
|
14818
14821
|
productImage: n,
|
|
14819
14822
|
productTitle: g,
|
|
14820
|
-
estimatedValues:
|
|
14823
|
+
estimatedValues: XA,
|
|
14821
14824
|
estimationLoading: qA,
|
|
14822
14825
|
dynamicFields: hf,
|
|
14823
14826
|
formRef: Q,
|
|
@@ -14839,7 +14842,7 @@ function XB({
|
|
|
14839
14842
|
Oe,
|
|
14840
14843
|
{
|
|
14841
14844
|
estimationDone: sA,
|
|
14842
|
-
sizingLoading:
|
|
14845
|
+
sizingLoading: uA,
|
|
14843
14846
|
sizingResult: TA,
|
|
14844
14847
|
sizeGuide: gA,
|
|
14845
14848
|
resultImageUrl: PA,
|
|
@@ -14850,7 +14853,7 @@ function XB({
|
|
|
14850
14853
|
handleDownload: rg,
|
|
14851
14854
|
onRetryWithFit: Tn,
|
|
14852
14855
|
retryLoading: KA,
|
|
14853
|
-
selectedFile:
|
|
14856
|
+
selectedFile: bA,
|
|
14854
14857
|
previewUrl: vA,
|
|
14855
14858
|
handleFileSelect: PP,
|
|
14856
14859
|
handleRemovePreview: gP,
|
|
@@ -14871,10 +14874,10 @@ function XB({
|
|
|
14871
14874
|
userHeightCm: (() => {
|
|
14872
14875
|
const t = L.find(($) => $.id === cA);
|
|
14873
14876
|
if (!t) return;
|
|
14874
|
-
const
|
|
14875
|
-
if (!
|
|
14877
|
+
const c = t.height ?? t.heightCm;
|
|
14878
|
+
if (!c || c <= 0) return;
|
|
14876
14879
|
const G = t.heightUnit, pA = TA?.unit || _A;
|
|
14877
|
-
return (G === "in" || G === "ft") && pA !== "in" ? Math.round(
|
|
14880
|
+
return (G === "in" || G === "ft") && pA !== "in" ? Math.round(c * 2.54) : (!G || G === "cm") && pA === "in" ? Math.round(c / 2.54 * 10) / 10 : c;
|
|
14878
14881
|
})(),
|
|
14879
14882
|
t: F
|
|
14880
14883
|
}
|
|
@@ -14883,7 +14886,7 @@ function XB({
|
|
|
14883
14886
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
14884
14887
|
se,
|
|
14885
14888
|
{
|
|
14886
|
-
selectedFile:
|
|
14889
|
+
selectedFile: bA,
|
|
14887
14890
|
previewUrl: vA,
|
|
14888
14891
|
dragOver: OA,
|
|
14889
14892
|
setDragOver: gf,
|
|
@@ -14922,25 +14925,25 @@ function XB({
|
|
|
14922
14925
|
onSelectProfile: (t) => {
|
|
14923
14926
|
nf(t), a("body-profile");
|
|
14924
14927
|
},
|
|
14925
|
-
onSaveProfileMeasurements: (t,
|
|
14926
|
-
Gn(t,
|
|
14928
|
+
onSaveProfileMeasurements: (t, c, G) => {
|
|
14929
|
+
Gn(t, c, G ?? L.find((pA) => pA.id === t)?.measurementsUnit ?? "cm"), V(Kf("profiles", []));
|
|
14927
14930
|
},
|
|
14928
|
-
onSaveBraSize: (t,
|
|
14929
|
-
hP(t, { bandSize:
|
|
14931
|
+
onSaveBraSize: (t, c, G) => {
|
|
14932
|
+
hP(t, { bandSize: c, cupSize: G }), V(Kf("profiles", []));
|
|
14930
14933
|
},
|
|
14931
14934
|
onEditProfile: (t) => {
|
|
14932
14935
|
u(t);
|
|
14933
14936
|
},
|
|
14934
14937
|
onPhotoPreview: (t) => {
|
|
14935
14938
|
if (t) {
|
|
14936
|
-
const
|
|
14937
|
-
N(
|
|
14939
|
+
const c = t.startsWith("data:") ? t : `data:image/jpeg;base64,${t}`;
|
|
14940
|
+
N(c);
|
|
14938
14941
|
} else
|
|
14939
14942
|
N(null);
|
|
14940
14943
|
},
|
|
14941
14944
|
onEstimateFromPhoto: async (t) => {
|
|
14942
14945
|
try {
|
|
14943
|
-
const
|
|
14946
|
+
const c = await $f(t.photoBase64).catch(() => null), G = await Yn({
|
|
14944
14947
|
apiUrl: P,
|
|
14945
14948
|
height: t.height > 0 ? t.height : void 0,
|
|
14946
14949
|
weight: t.weight > 0 ? t.weight : void 0,
|
|
@@ -14949,7 +14952,7 @@ function XB({
|
|
|
14949
14952
|
gender: t.gender,
|
|
14950
14953
|
age: t.age,
|
|
14951
14954
|
bodyImage: t.photoBase64,
|
|
14952
|
-
bodyLandmarks:
|
|
14955
|
+
bodyLandmarks: c ?? void 0
|
|
14953
14956
|
});
|
|
14954
14957
|
return G ? { estimates: G.estimates, unit: G.unit } : null;
|
|
14955
14958
|
} catch {
|
|
@@ -14957,31 +14960,31 @@ function XB({
|
|
|
14957
14960
|
}
|
|
14958
14961
|
},
|
|
14959
14962
|
onSaveNewProfile: async (t) => {
|
|
14960
|
-
const
|
|
14963
|
+
const c = {
|
|
14961
14964
|
...t,
|
|
14962
14965
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
14963
14966
|
createdAt: Date.now(),
|
|
14964
14967
|
lastUsedAt: Date.now()
|
|
14965
|
-
}, G = [
|
|
14966
|
-
lf("profiles", G), V(G), nf(
|
|
14967
|
-
const pA =
|
|
14968
|
-
!(!!
|
|
14968
|
+
}, G = [c, ...L];
|
|
14969
|
+
lf("profiles", G), V(G), nf(c.id);
|
|
14970
|
+
const pA = c.heightCm || c.height || 0, $ = c.weightKg || c.weight || 0, eA = c.sizingUnit === "in" ? "in" : "cm", M = c.sizingUnit === "in" ? "lbs" : "kg", m = c.photoBase64;
|
|
14971
|
+
!(!!c.measurements && Object.keys(c.measurements).length > 0) && (m || pA > 0 && $ > 0) && (Hf((zA) => new Set(zA).add(c.id)), (m ? $f(m).catch(() => null) : Promise.resolve(null)).then((zA) => Yn({
|
|
14969
14972
|
apiUrl: P,
|
|
14970
14973
|
height: pA > 0 ? pA : void 0,
|
|
14971
14974
|
weight: $ > 0 ? $ : void 0,
|
|
14972
14975
|
heightUnit: eA,
|
|
14973
14976
|
weightUnit: M,
|
|
14974
|
-
gender:
|
|
14975
|
-
age:
|
|
14976
|
-
chestProfile:
|
|
14977
|
-
midsectionProfile:
|
|
14978
|
-
hipProfile:
|
|
14977
|
+
gender: c.gender,
|
|
14978
|
+
age: c.age,
|
|
14979
|
+
chestProfile: c.chestProfile,
|
|
14980
|
+
midsectionProfile: c.midsectionProfile,
|
|
14981
|
+
hipProfile: c.hipProfile,
|
|
14979
14982
|
bodyImage: m,
|
|
14980
14983
|
bodyLandmarks: zA ?? void 0
|
|
14981
14984
|
})).then((zA) => {
|
|
14982
14985
|
if (zA) {
|
|
14983
|
-
if (Gn(
|
|
14984
|
-
const Cf = Kf("profiles", []), Tf = Cf.findIndex((cf) => cf.id ===
|
|
14986
|
+
if (Gn(c.id, zA.estimates, zA.unit), zA.userEstimates) {
|
|
14987
|
+
const Cf = Kf("profiles", []), Tf = Cf.findIndex((cf) => cf.id === c.id);
|
|
14985
14988
|
if (Tf >= 0) {
|
|
14986
14989
|
const cf = Cf[Tf], IA = zA.userEstimates, rf = { ...cf };
|
|
14987
14990
|
IA.height && !(cf.height || cf.heightCm) && (rf.height = IA.height, rf.heightCm = IA.height, rf.heightUnit = "cm"), IA.weight && !(cf.weight || cf.weightKg) && (rf.weight = IA.weight, rf.weightKg = IA.weight, rf.weightUnit = "kg"), IA.age && !cf.age && (rf.age = IA.age), Cf[Tf] = rf, lf("profiles", Cf);
|
|
@@ -14993,12 +14996,12 @@ function XB({
|
|
|
14993
14996
|
}).finally(() => {
|
|
14994
14997
|
Hf((zA) => {
|
|
14995
14998
|
const Cf = new Set(zA);
|
|
14996
|
-
return Cf.delete(
|
|
14999
|
+
return Cf.delete(c.id), Cf;
|
|
14997
15000
|
});
|
|
14998
15001
|
}));
|
|
14999
15002
|
},
|
|
15000
15003
|
onDeleteProfile: (t) => {
|
|
15001
|
-
V((
|
|
15004
|
+
V((c) => c.filter((G) => G.id !== t)), cA === t && nf(null), lf("profiles", Kf("profiles", []).filter((c) => c.id !== t));
|
|
15002
15005
|
},
|
|
15003
15006
|
onRequestDelete: (t) => ff(t),
|
|
15004
15007
|
onClose: () => a("body-profile"),
|
|
@@ -15076,8 +15079,8 @@ function XB({
|
|
|
15076
15079
|
wB,
|
|
15077
15080
|
{
|
|
15078
15081
|
onConfirm: () => {
|
|
15079
|
-
const t = WA,
|
|
15080
|
-
lf("profiles",
|
|
15082
|
+
const t = WA, c = Kf("profiles", []).filter((G) => G.id !== t);
|
|
15083
|
+
lf("profiles", c), V(c), cA === t && nf(null), ff(null);
|
|
15081
15084
|
},
|
|
15082
15085
|
onCancel: () => ff(null),
|
|
15083
15086
|
t: F
|
|
@@ -15115,10 +15118,10 @@ function JB(n) {
|
|
|
15115
15118
|
const [g, e] = d(null), [B, P] = d(!0), [D, i] = d(!1), [C, w] = d(0);
|
|
15116
15119
|
return NA(() => {
|
|
15117
15120
|
let H = !1;
|
|
15118
|
-
return P(!0), i(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: n.productId }), mP(n).then((
|
|
15119
|
-
H || (
|
|
15120
|
-
}).catch((
|
|
15121
|
-
console.log("[ps-sdk:hook] usePrimeStyleSize threw",
|
|
15121
|
+
return P(!0), i(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: n.productId }), mP(n).then((p) => {
|
|
15122
|
+
H || (p === null ? (console.log("[ps-sdk:hook] usePrimeStyleSize → null (no profile or recommendation failed)"), i(!0), e(null)) : (console.log("[ps-sdk:hook] usePrimeStyleSize → result", { recommendedSize: p.recommendedSize, hasRaw: !!p.raw }), e(p)));
|
|
15123
|
+
}).catch((p) => {
|
|
15124
|
+
console.log("[ps-sdk:hook] usePrimeStyleSize threw", p), H || e(null);
|
|
15122
15125
|
}).finally(() => {
|
|
15123
15126
|
H || P(!1);
|
|
15124
15127
|
}), () => {
|
|
@@ -15126,7 +15129,7 @@ function JB(n) {
|
|
|
15126
15129
|
};
|
|
15127
15130
|
}, [n.productId, n.apiUrl, n.apiKey, C]), NA(() => {
|
|
15128
15131
|
if (typeof window > "u") return;
|
|
15129
|
-
const H = () => w((
|
|
15132
|
+
const H = () => w((p) => p + 1);
|
|
15130
15133
|
return window.addEventListener(Dn, H), window.addEventListener("storage", H), () => {
|
|
15131
15134
|
window.removeEventListener(Dn, H), window.removeEventListener("storage", H);
|
|
15132
15135
|
};
|