@primestyleai/tryon 5.10.142 → 5.10.143
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 +987 -989
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +5 -12
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { P as Tg, L as Gg, b as Jt, d as tg, a as uo, c as Kt, A as St, S as jt, i as Rt } from "../index-GW10cktY.js";
|
|
3
3
|
import { jsxs as e, jsx as A, Fragment as _ } from "react/jsx-runtime";
|
|
4
|
-
import { useState as f, useRef as
|
|
4
|
+
import { useState as f, useRef as hA, useCallback as bA, useEffect as xA, useMemo as He } from "react";
|
|
5
5
|
import { createPortal as vg } from "react-dom";
|
|
6
6
|
const Tt = "primestyle-photos", no = "photos", Xt = 1;
|
|
7
7
|
let Vo = null;
|
|
@@ -96,11 +96,11 @@ async function og(o) {
|
|
|
96
96
|
const g = await At(o), t = gg.detect(g);
|
|
97
97
|
if (!t?.landmarks?.length || t.landmarks[0].length < 25)
|
|
98
98
|
return null;
|
|
99
|
-
const i = t.landmarks[0], a = i[Vg], c = i[qg], n = i[Zg], w = i[$g], r = (a.y + c.y) / 2, p = (n.y + w.y) / 2, Q = p - r, C = r + Q * 0.28, I = Math.abs(c.x - a.x), u = Math.min(a.x, c.x) - I * 0.05, M = Math.max(a.x, c.x) + I * 0.05, L = Math.abs(w.x - n.x),
|
|
99
|
+
const i = t.landmarks[0], a = i[Vg], c = i[qg], n = i[Zg], w = i[$g], r = (a.y + c.y) / 2, p = (n.y + w.y) / 2, Q = p - r, C = r + Q * 0.28, I = Math.abs(c.x - a.x), u = Math.min(a.x, c.x) - I * 0.05, M = Math.max(a.x, c.x) + I * 0.05, L = Math.abs(w.x - n.x), Y = Math.min(n.x, w.x) - L * 0.15, v = Math.max(n.x, w.x) + L * 0.15, l = C + (p - C) * 0.55, R = I * 0.85, V = (a.x + c.x + n.x + w.x) / 4, s = V - R / 2, x = V + R / 2;
|
|
100
100
|
return {
|
|
101
101
|
chest: { y: C, x1: u, x2: M },
|
|
102
|
-
waist: { y: l, x1: s, x2:
|
|
103
|
-
hips: { y: p, x1:
|
|
102
|
+
waist: { y: l, x1: s, x2: x },
|
|
103
|
+
hips: { y: p, x1: Y, x2: v }
|
|
104
104
|
};
|
|
105
105
|
} catch (g) {
|
|
106
106
|
return console.error("[PS-SDK] Pose detection failed:", g), null;
|
|
@@ -135,8 +135,8 @@ async function po(o) {
|
|
|
135
135
|
jointCount: c?.landmarks?.[0]?.length ?? 0
|
|
136
136
|
}), null;
|
|
137
137
|
const n = c.landmarks[0], w = c.worldLandmarks?.[0] ?? null, r = (M, L = !1) => {
|
|
138
|
-
const
|
|
139
|
-
return typeof
|
|
138
|
+
const Y = L && w ? w[M] : n[M], v = { x: Y.x, y: Y.y };
|
|
139
|
+
return typeof Y.z == "number" && (v.z = Y.z), typeof Y.visibility == "number" && (v.visibility = Y.visibility), v;
|
|
140
140
|
}, p = {
|
|
141
141
|
leftShoulder: r(Vg),
|
|
142
142
|
rightShoulder: r(qg),
|
|
@@ -157,8 +157,8 @@ async function po(o) {
|
|
|
157
157
|
console.groupCollapsed(`[PS-SDK:MediaPipe] ✓ ${C} joints detected @ ${p.imageWidth}×${p.imageHeight}px (z=${I ? "yes" : "no"}, worldLandmarks=${u ? "yes" : "no"})`);
|
|
158
158
|
for (const [M, L] of Object.entries(p)) {
|
|
159
159
|
if (!Q(L)) continue;
|
|
160
|
-
const
|
|
161
|
-
console.log(` ${M.padEnd(15)} (${
|
|
160
|
+
const Y = L, v = typeof Y.z == "number" ? `, z=${Y.z.toFixed(3)}` : "", l = typeof Y.visibility == "number" ? `, vis=${Y.visibility.toFixed(2)}` : "";
|
|
161
|
+
console.log(` ${M.padEnd(15)} (${Y.x.toFixed(3)}, ${Y.y.toFixed(3)}${v}${l})`);
|
|
162
162
|
}
|
|
163
163
|
return console.log(` imageWidth ${p.imageWidth}`), console.log(` imageHeight ${p.imageHeight}`), console.groupEnd(), p;
|
|
164
164
|
} catch (g) {
|
|
@@ -272,10 +272,10 @@ function cn(o, g, t) {
|
|
|
272
272
|
const i = Og(o.leftIrisRing, g, t), a = Og(o.rightIrisRing, g, t), c = (i + a) / 2;
|
|
273
273
|
let n = 1;
|
|
274
274
|
c < 8 ? n = 0.3 : Math.abs(i - a) / c > 0.3 ? n = 0.5 : Math.abs(i - a) / c > 0.15 && (n = 0.8);
|
|
275
|
-
const w = c > 0 ? Lg / c : 0, r = (E,
|
|
276
|
-
(E.x -
|
|
277
|
-
(E.y -
|
|
278
|
-
) * w, p = r(o.leftIrisCenter, o.rightIrisCenter), C = r(o.leftInnerEye, o.rightInnerEye) / 1.6, I = r(o.leftTragus, o.rightTragus), u = r(o.leftTragus, o.leftOuterEye), M = r(o.rightTragus, o.rightOuterEye), L = (u + M) / 2,
|
|
275
|
+
const w = c > 0 ? Lg / c : 0, r = (E, G) => Math.hypot(
|
|
276
|
+
(E.x - G.x) * g,
|
|
277
|
+
(E.y - G.y) * t
|
|
278
|
+
) * w, p = r(o.leftIrisCenter, o.rightIrisCenter), C = r(o.leftInnerEye, o.rightInnerEye) / 1.6, I = r(o.leftTragus, o.rightTragus), u = r(o.leftTragus, o.leftOuterEye), M = r(o.rightTragus, o.rightOuterEye), L = (u + M) / 2, Y = I * 1.07, l = Math.abs((o.forehead.z ?? 0) - (o.chin.z ?? 0)) * g * w, R = Math.max(170, Math.min(210, l || 190)), V = Y / 2, s = R / 2, x = Math.PI * Math.sqrt(2 * (V * V + s * s));
|
|
279
279
|
return {
|
|
280
280
|
measurements: {
|
|
281
281
|
irisDiameter: Lg,
|
|
@@ -285,9 +285,9 @@ function cn(o, g, t) {
|
|
|
285
285
|
templeLengthLeft: Ze(u),
|
|
286
286
|
templeLengthRight: Ze(M),
|
|
287
287
|
templeLength: Ze(L),
|
|
288
|
-
headWidth: Ze(
|
|
288
|
+
headWidth: Ze(Y),
|
|
289
289
|
headDepth: Ze(R),
|
|
290
|
-
headCircumference: Ze(
|
|
290
|
+
headCircumference: Ze(x)
|
|
291
291
|
},
|
|
292
292
|
irisConfidence: n
|
|
293
293
|
};
|
|
@@ -8703,7 +8703,7 @@ function Kn({ view: o, stepIndex: g }) {
|
|
|
8703
8703
|
return o === "error" || o === "idle" ? null : /* @__PURE__ */ A("div", { className: "ps-tryon-dots", children: Array.from({ length: En }, (t, i) => i + 1).map((t) => /* @__PURE__ */ A("div", { className: `ps-tryon-dot${t < g ? " ps-done" : t === g ? " ps-active" : ""}` }, t)) });
|
|
8704
8704
|
}
|
|
8705
8705
|
function Sn({ activeLocale: o, onSelect: g }) {
|
|
8706
|
-
const [t, i] = f(!1), a =
|
|
8706
|
+
const [t, i] = f(!1), a = hA(null), c = hA(null), [n, w] = f({ top: 0, right: 0 }), r = Gg[o] || "English", p = bA(() => {
|
|
8707
8707
|
if (!a.current) return;
|
|
8708
8708
|
const Q = a.current.getBoundingClientRect();
|
|
8709
8709
|
w({ top: Q.bottom + 4, right: window.innerWidth - Q.right });
|
|
@@ -8784,18 +8784,18 @@ function ct({
|
|
|
8784
8784
|
}) {
|
|
8785
8785
|
const [a, c] = f(o?.name || ""), [n, w] = f(o?.gender || "male"), [r, p] = f(o?.sizingUnit || "cm"), [Q, C] = f(() => {
|
|
8786
8786
|
if (!o) return {};
|
|
8787
|
-
const
|
|
8787
|
+
const Y = {};
|
|
8788
8788
|
for (const v of ["heightCm", "weightKg", "age"]) {
|
|
8789
8789
|
const l = o[v];
|
|
8790
|
-
typeof l == "number" && l > 0 && (
|
|
8790
|
+
typeof l == "number" && l > 0 && (Y[v] = String(l));
|
|
8791
8791
|
}
|
|
8792
|
-
return
|
|
8792
|
+
return Y;
|
|
8793
8793
|
}), I = n === "female" ? Rn : jn, [u, M] = f(""), L = () => {
|
|
8794
|
-
const
|
|
8795
|
-
a.trim() ||
|
|
8794
|
+
const Y = [];
|
|
8795
|
+
a.trim() || Y.push(i("Profile Name"));
|
|
8796
8796
|
for (const l of I)
|
|
8797
|
-
parseFloat(Q[l.key] || "") > 0 ||
|
|
8798
|
-
if (
|
|
8797
|
+
parseFloat(Q[l.key] || "") > 0 || Y.push(i(l.label));
|
|
8798
|
+
if (Y.length > 0) {
|
|
8799
8799
|
M(i("Please fill in all fields"));
|
|
8800
8800
|
return;
|
|
8801
8801
|
}
|
|
@@ -8814,8 +8814,8 @@ function ct({
|
|
|
8814
8814
|
type: "text",
|
|
8815
8815
|
className: "ps-tryon-sf-input",
|
|
8816
8816
|
value: a,
|
|
8817
|
-
onChange: (
|
|
8818
|
-
c(
|
|
8817
|
+
onChange: (Y) => {
|
|
8818
|
+
c(Y.target.value), M("");
|
|
8819
8819
|
},
|
|
8820
8820
|
placeholder: i("e.g. My Measurements")
|
|
8821
8821
|
}
|
|
@@ -8863,11 +8863,11 @@ function ct({
|
|
|
8863
8863
|
)
|
|
8864
8864
|
] })
|
|
8865
8865
|
] }),
|
|
8866
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-pe-fields", children: I.map((
|
|
8866
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-pe-fields", children: I.map((Y) => /* @__PURE__ */ e("div", { className: "ps-tryon-sf-float-field", children: [
|
|
8867
8867
|
/* @__PURE__ */ e("label", { className: "ps-tryon-sf-float-label", children: [
|
|
8868
|
-
i(
|
|
8868
|
+
i(Y.label),
|
|
8869
8869
|
" (",
|
|
8870
|
-
r === "in" ?
|
|
8870
|
+
r === "in" ? Y.imperialUnit : Y.metricUnit,
|
|
8871
8871
|
")"
|
|
8872
8872
|
] }),
|
|
8873
8873
|
/* @__PURE__ */ A(
|
|
@@ -8876,13 +8876,13 @@ function ct({
|
|
|
8876
8876
|
type: "number",
|
|
8877
8877
|
className: "ps-tryon-sf-input",
|
|
8878
8878
|
placeholder: " ",
|
|
8879
|
-
value: Q[
|
|
8879
|
+
value: Q[Y.key] || "",
|
|
8880
8880
|
onChange: (v) => {
|
|
8881
|
-
C((l) => ({ ...l, [
|
|
8881
|
+
C((l) => ({ ...l, [Y.key]: v.target.value })), M("");
|
|
8882
8882
|
}
|
|
8883
8883
|
}
|
|
8884
8884
|
)
|
|
8885
|
-
] },
|
|
8885
|
+
] }, Y.key)) }),
|
|
8886
8886
|
u && /* @__PURE__ */ A("div", { className: "ps-tryon-pe-error", children: u }),
|
|
8887
8887
|
/* @__PURE__ */ e("div", { className: "ps-tryon-pe-actions", children: [
|
|
8888
8888
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-tryon-est-back", onClick: t, children: i("Cancel") }),
|
|
@@ -8953,15 +8953,15 @@ function Tn({
|
|
|
8953
8953
|
/* @__PURE__ */ A("span", { className: "ps-tryon-history-size-badge", children: u.recommendedSize }),
|
|
8954
8954
|
u.reasoning && /* @__PURE__ */ A("span", { className: "ps-tryon-history-sizing-reason", children: u.reasoning })
|
|
8955
8955
|
] }),
|
|
8956
|
-
C(u) && u.sizingResult?.sections && /* @__PURE__ */ A("div", { className: "ps-tryon-history-sections", children: Object.entries(u.sizingResult.sections).map(([L,
|
|
8956
|
+
C(u) && u.sizingResult?.sections && /* @__PURE__ */ A("div", { className: "ps-tryon-history-sections", children: Object.entries(u.sizingResult.sections).map(([L, Y]) => /* @__PURE__ */ e("span", { className: "ps-tryon-history-section-chip", children: [
|
|
8957
8957
|
L,
|
|
8958
8958
|
": ",
|
|
8959
|
-
|
|
8959
|
+
Y.recommendedSize
|
|
8960
8960
|
] }, L)) }),
|
|
8961
8961
|
u.resultImageUrl && /* @__PURE__ */ A("span", { className: "ps-tryon-history-tryon-badge", children: r("Try-on") })
|
|
8962
8962
|
] }),
|
|
8963
8963
|
/* @__PURE__ */ A("button", { className: "ps-tryon-history-delete", onClick: (L) => {
|
|
8964
|
-
L.stopPropagation(), c((
|
|
8964
|
+
L.stopPropagation(), c((Y) => Y.filter((v, l) => l !== M));
|
|
8965
8965
|
}, children: /* @__PURE__ */ A(zn, {}) })
|
|
8966
8966
|
] }, u.id)),
|
|
8967
8967
|
/* @__PURE__ */ A("button", { className: "ps-tryon-drawer-clear", onClick: () => c([]), children: r("Clear All") })
|
|
@@ -9148,7 +9148,7 @@ function qn({
|
|
|
9148
9148
|
setSizingLoading: u,
|
|
9149
9149
|
setView: M,
|
|
9150
9150
|
submitSizing: L,
|
|
9151
|
-
t:
|
|
9151
|
+
t: Y
|
|
9152
9152
|
}) {
|
|
9153
9153
|
const v = w === "in" ? "in" : "cm", l = /* @__PURE__ */ new Set(["weight", "weightKg", "height"]), R = a.filter((s) => s.required && s.unit === "cm" && !l.has(s.key)), V = () => {
|
|
9154
9154
|
c.current.gender = n, I("exact"), u(!0), M("size-result"), L("exact");
|
|
@@ -9157,24 +9157,24 @@ function qn({
|
|
|
9157
9157
|
/* @__PURE__ */ A("div", { className: "ps-bp-image", children: /* @__PURE__ */ A("img", { src: o, alt: g, className: "ps-bp-image-img" }) }),
|
|
9158
9158
|
/* @__PURE__ */ e("div", { className: "ps-bp-root", style: { alignItems: "center", justifyContent: "center" }, children: [
|
|
9159
9159
|
/* @__PURE__ */ A("div", { className: "ps-tryon-size-loading-spinner" }),
|
|
9160
|
-
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.8vw", marginTop: "0.6vw" }, children:
|
|
9160
|
+
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.8vw", marginTop: "0.6vw" }, children: Y("Estimating your measurements...") })
|
|
9161
9161
|
] })
|
|
9162
9162
|
] }) : /* @__PURE__ */ e("div", { className: "ps-bp-layout", children: [
|
|
9163
9163
|
/* @__PURE__ */ A("div", { className: "ps-bp-image", children: /* @__PURE__ */ A("img", { src: o, alt: g, className: "ps-bp-image-img" }) }),
|
|
9164
9164
|
/* @__PURE__ */ e("div", { className: "ps-bp-root", children: [
|
|
9165
|
-
/* @__PURE__ */ A("h3", { className: "ps-bp-title", style: { fontSize: "1.1vw" }, children:
|
|
9166
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-subtitle", children:
|
|
9165
|
+
/* @__PURE__ */ A("h3", { className: "ps-bp-title", style: { fontSize: "1.1vw" }, children: Y("Here's what we estimated") }),
|
|
9166
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-subtitle", children: Y("Tap any value to adjust if needed") }),
|
|
9167
9167
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sf-fields", style: { flex: 1, overflowY: "auto" }, children: R.map((s) => {
|
|
9168
|
-
const
|
|
9169
|
-
if (!
|
|
9170
|
-
const
|
|
9171
|
-
return c.current[s.key] || (c.current[s.key] = String(
|
|
9168
|
+
const x = t[s.key], E = c.current[s.key] ? parseFloat(c.current[s.key]) : null, G = x || E;
|
|
9169
|
+
if (!G) return null;
|
|
9170
|
+
const U = !x && !!E;
|
|
9171
|
+
return c.current[s.key] || (c.current[s.key] = String(G)), /* @__PURE__ */ A("div", { className: "ps-tryon-sf-float-row", children: /* @__PURE__ */ e("div", { className: "ps-tryon-sf-float-field", children: [
|
|
9172
9172
|
/* @__PURE__ */ e("label", { className: "ps-tryon-sf-float-label", children: [
|
|
9173
|
-
|
|
9173
|
+
Y(s.label),
|
|
9174
9174
|
" (",
|
|
9175
9175
|
v,
|
|
9176
9176
|
") ",
|
|
9177
|
-
|
|
9177
|
+
U ? /* @__PURE__ */ A("span", { className: "ps-tryon-sf-entered-badge", children: Y("ENTERED") }) : /* @__PURE__ */ A("span", { className: "ps-tryon-sf-estimated-badge", children: Y("ESTIMATED") })
|
|
9178
9178
|
] }),
|
|
9179
9179
|
/* @__PURE__ */ A(
|
|
9180
9180
|
"input",
|
|
@@ -9182,7 +9182,7 @@ function qn({
|
|
|
9182
9182
|
type: "number",
|
|
9183
9183
|
placeholder: " ",
|
|
9184
9184
|
className: "ps-tryon-sf-input",
|
|
9185
|
-
defaultValue:
|
|
9185
|
+
defaultValue: G,
|
|
9186
9186
|
onInput: (T) => C(s.key, T.target.value)
|
|
9187
9187
|
}
|
|
9188
9188
|
)
|
|
@@ -9192,9 +9192,9 @@ function qn({
|
|
|
9192
9192
|
/* @__PURE__ */ e("button", { type: "button", className: "ps-bp-back-btn", onClick: () => M("body-profile"), children: [
|
|
9193
9193
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
9194
9194
|
" ",
|
|
9195
|
-
|
|
9195
|
+
Y("Back")
|
|
9196
9196
|
] }),
|
|
9197
|
-
/* @__PURE__ */ A("button", { className: "ps-bp-next-btn", onClick: V, children:
|
|
9197
|
+
/* @__PURE__ */ A("button", { className: "ps-bp-next-btn", onClick: V, children: Y("What is my size?") })
|
|
9198
9198
|
] })
|
|
9199
9199
|
] })
|
|
9200
9200
|
] });
|
|
@@ -9320,20 +9320,18 @@ function Ug({
|
|
|
9320
9320
|
{ title: r("ESTIMATING BODY"), desc: r("Computing chest, waist, hips, sleeve and inseam from your basics."), viewfinderText: r("ESTIMATING BODY") },
|
|
9321
9321
|
{ title: r("MATCHING SIZE"), desc: r("Comparing your measurements to the garment's size guide."), viewfinderText: r("MATCHING SIZE") },
|
|
9322
9322
|
{ title: r("FINALIZING RESULT"), desc: r("Almost done — preparing your recommendation."), viewfinderText: r("FINALIZING") }
|
|
9323
|
-
], [I, u] = f({ w: 800, h: 1200 }), M = (
|
|
9324
|
-
const
|
|
9325
|
-
u({ w:
|
|
9326
|
-
}, L =
|
|
9323
|
+
], [I, u] = f({ w: 800, h: 1200 }), M = (R) => {
|
|
9324
|
+
const V = R.currentTarget;
|
|
9325
|
+
u({ w: V.naturalWidth || V.offsetWidth, h: V.naturalHeight || V.offsetHeight });
|
|
9326
|
+
}, L = 1800, [Y, v] = f(0);
|
|
9327
9327
|
xA(() => {
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
}, [C.length]), xA(() => {
|
|
9334
|
-
Q && t && l === 0 && R(1);
|
|
9328
|
+
if (Y >= C.length - 1) return;
|
|
9329
|
+
const R = setTimeout(() => v((V) => Math.min(C.length - 1, V + 1)), L);
|
|
9330
|
+
return () => clearTimeout(R);
|
|
9331
|
+
}, [Y, C.length]), xA(() => {
|
|
9332
|
+
Q && t && Y === 0 && v(1);
|
|
9335
9333
|
}, [t]);
|
|
9336
|
-
const
|
|
9334
|
+
const l = C[Y] ?? C[0];
|
|
9337
9335
|
return /* @__PURE__ */ e("div", { className: "ps-msc-root", children: [
|
|
9338
9336
|
/* @__PURE__ */ e("div", { className: "ps-msc-viewfinder", children: [
|
|
9339
9337
|
p && /* @__PURE__ */ A(
|
|
@@ -9348,9 +9346,9 @@ function Ug({
|
|
|
9348
9346
|
Q && t && /* @__PURE__ */ A("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ A(Ai, { landmarks: t, w: I.w, h: I.h }) })
|
|
9349
9347
|
] }),
|
|
9350
9348
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage", children: /* @__PURE__ */ e("div", { className: "ps-msc-stage-slot", children: [
|
|
9351
|
-
/* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children:
|
|
9352
|
-
/* @__PURE__ */ A("div", { className: "ps-msc-stage-desc", children:
|
|
9353
|
-
] },
|
|
9349
|
+
/* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children: l.title }),
|
|
9350
|
+
/* @__PURE__ */ A("div", { className: "ps-msc-stage-desc", children: l.desc })
|
|
9351
|
+
] }, Y) }),
|
|
9354
9352
|
/* @__PURE__ */ A("div", { className: "ps-bpm-spacer" })
|
|
9355
9353
|
] });
|
|
9356
9354
|
}
|
|
@@ -9474,20 +9472,20 @@ function ti({
|
|
|
9474
9472
|
onClose: u,
|
|
9475
9473
|
overlayNode: M,
|
|
9476
9474
|
showLines: L,
|
|
9477
|
-
onToggleLines:
|
|
9475
|
+
onToggleLines: Y,
|
|
9478
9476
|
onImageLoad: v,
|
|
9479
9477
|
t: l
|
|
9480
9478
|
}) {
|
|
9481
9479
|
const R = He(() => {
|
|
9482
|
-
const
|
|
9480
|
+
const x = [...t?.matchDetails || []];
|
|
9483
9481
|
if (t?.sections)
|
|
9484
9482
|
for (const E of Object.values(t.sections))
|
|
9485
|
-
E.matchDetails &&
|
|
9486
|
-
if (
|
|
9487
|
-
const E =
|
|
9488
|
-
(
|
|
9489
|
-
).length,
|
|
9490
|
-
return Math.max(70,
|
|
9483
|
+
E.matchDetails && x.push(...E.matchDetails);
|
|
9484
|
+
if (x.length > 0) {
|
|
9485
|
+
const E = x.filter(
|
|
9486
|
+
(U) => U.fit === "good" || U.fit === "a-bit-tight" || U.fit === "a-bit-loose"
|
|
9487
|
+
).length, G = Math.round(E / x.length * 100);
|
|
9488
|
+
return Math.max(70, G);
|
|
9491
9489
|
}
|
|
9492
9490
|
return t?.confidence === "high" ? 96 : t?.confidence === "medium" ? 84 : 72;
|
|
9493
9491
|
}, [t]), V = Q || o, s = !!Q;
|
|
@@ -9507,12 +9505,12 @@ function ti({
|
|
|
9507
9505
|
),
|
|
9508
9506
|
L && M,
|
|
9509
9507
|
r && p != null && /* @__PURE__ */ A(Io, { tryOnStartedAt: p, t: l }),
|
|
9510
|
-
s &&
|
|
9508
|
+
s && Y && /* @__PURE__ */ e(
|
|
9511
9509
|
"button",
|
|
9512
9510
|
{
|
|
9513
9511
|
type: "button",
|
|
9514
9512
|
className: "ps-msr-fit-toggle",
|
|
9515
|
-
onClick:
|
|
9513
|
+
onClick: Y,
|
|
9516
9514
|
"aria-pressed": !!L,
|
|
9517
9515
|
children: [
|
|
9518
9516
|
/* @__PURE__ */ A(gi, {}),
|
|
@@ -9549,17 +9547,17 @@ function ti({
|
|
|
9549
9547
|
] }),
|
|
9550
9548
|
/* @__PURE__ */ A("span", { className: "ps-msr-match-label", children: l("FIT MATCH") })
|
|
9551
9549
|
] }) }),
|
|
9552
|
-
/* @__PURE__ */ A("div", { className: "ps-msr-sections", children: a.map(({ name:
|
|
9553
|
-
const
|
|
9550
|
+
/* @__PURE__ */ A("div", { className: "ps-msr-sections", children: a.map(({ name: x, secResult: E }) => {
|
|
9551
|
+
const G = x.replace(/\s*[—–-]\s*.*/g, ""), U = E, T = c?.[x], aA = !!T, X = U.found === !1 ? l("No fit") : aA ? T.displayLabel : U.size || E.recommendedSize, UA = i?.sectionImages?.[x], LA = ei(x), h = UA || LA || null;
|
|
9554
9552
|
return /* @__PURE__ */ e(
|
|
9555
9553
|
"button",
|
|
9556
9554
|
{
|
|
9557
9555
|
type: "button",
|
|
9558
9556
|
className: `ps-msr-section-card${aA ? " ps-overridden" : ""}`,
|
|
9559
|
-
onClick: () => n(
|
|
9557
|
+
onClick: () => n(x),
|
|
9560
9558
|
children: [
|
|
9561
9559
|
h && /* @__PURE__ */ A("img", { src: h, alt: "", className: "ps-msr-section-icon-lg" }),
|
|
9562
|
-
/* @__PURE__ */ A("span", { className: "ps-msr-section-name", children:
|
|
9560
|
+
/* @__PURE__ */ A("span", { className: "ps-msr-section-name", children: G.toUpperCase() }),
|
|
9563
9561
|
/* @__PURE__ */ A("span", { className: "ps-msr-section-size", children: X }),
|
|
9564
9562
|
/* @__PURE__ */ A(
|
|
9565
9563
|
"span",
|
|
@@ -9577,7 +9575,7 @@ function ti({
|
|
|
9577
9575
|
)
|
|
9578
9576
|
]
|
|
9579
9577
|
},
|
|
9580
|
-
|
|
9578
|
+
x
|
|
9581
9579
|
);
|
|
9582
9580
|
}) })
|
|
9583
9581
|
] }),
|
|
@@ -9779,7 +9777,7 @@ function Bi({
|
|
|
9779
9777
|
{ title: t("ANALYZING BODY"), desc: t("Measuring shoulders, chest, waist and hips.") },
|
|
9780
9778
|
{ title: t("MATCHING SIZE"), desc: t("Comparing your measurements to the size guide.") },
|
|
9781
9779
|
{ title: t("FINALIZING RESULT"), desc: t("Almost done — preparing your recommendation.") }
|
|
9782
|
-
], a = 6e3, c = 1e3, n =
|
|
9780
|
+
], a = 6e3, c = 1e3, n = hA(Date.now()), [w, r] = f(0);
|
|
9783
9781
|
xA(() => {
|
|
9784
9782
|
const Q = (a - c) / Math.max(1, i.length - 1), C = setInterval(() => {
|
|
9785
9783
|
const I = Date.now() - n.current, u = Math.min(i.length - 1, Math.floor(I / Q));
|
|
@@ -9853,14 +9851,14 @@ function zo({ lines: o, fitRows: g, show: t, imgWidth: i, imgHeight: a }) {
|
|
|
9853
9851
|
{ key: "waist", line: o.waist, label: "Waist" },
|
|
9854
9852
|
{ key: "hips", line: o.hips, label: "Hips" }
|
|
9855
9853
|
], w = i, r = a, p = n.map((L) => L.line && typeof L.line.x1 == "number" && typeof L.line.x2 == "number" ? Math.abs(L.line.x2 - L.line.x1) : 0).filter((L) => L > 0), Q = p.length ? Math.max(...p) : 0.2, C = Math.max(1, Q * w), I = C * 0.018, u = C * 0.025, M = C / 400;
|
|
9856
|
-
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${w} ${r}`, preserveAspectRatio: "xMidYMid meet", children: n.map(({ key: L, line:
|
|
9857
|
-
if (!
|
|
9858
|
-
const R = Math.abs(
|
|
9854
|
+
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${w} ${r}`, preserveAspectRatio: "xMidYMid meet", children: n.map(({ key: L, line: Y, label: v }, l) => {
|
|
9855
|
+
if (!Y || typeof Y.x1 != "number" || typeof Y.x2 != "number" || typeof Y.y != "number") return null;
|
|
9856
|
+
const R = Math.abs(Y.x2 - Y.x1);
|
|
9859
9857
|
if (Q > 0 && R < Q * 0.35 || R * w < 20) return null;
|
|
9860
|
-
const V =
|
|
9858
|
+
const V = Y.x1 * w, s = Y.x2 * w, x = Y.y * r, E = s - V, G = E * 0.06, U = (V + s) / 2, T = g.find((VA) => {
|
|
9861
9859
|
const HA = VA.area.toLowerCase().trim();
|
|
9862
9860
|
return !!(HA === L || L === "chest" && (HA.includes("bust") || HA.includes("chest")) || L === "waist" && HA.includes("waist") || L === "hips" && (HA.includes("hip") || HA === "hips"));
|
|
9863
|
-
}), aA = T ? c(T.fit) : "#2154EF", X = l * 0.35, UA = `M ${V} ${
|
|
9861
|
+
}), aA = T ? c(T.fit) : "#2154EF", X = l * 0.35, UA = `M ${V} ${x} Q ${U} ${x + G} ${s} ${x}`, LA = E * 1.05, h = T ? T.fit === "good" ? "✓ Fit" : T.isLength ? T.fit.includes("short") || T.fit.includes("tight") ? "Short" : "Long" : T.fit.includes("tight") ? "Tight" : "Loose" : v, oA = Math.max(14, Math.round(22 * M)), z = h.length * oA * 0.62, S = w - s - 12 * M < z, nA = S ? V - 10 * M : s + 10 * M, MA = S ? "end" : "start", iA = S ? V : s, YA = S ? V - 6 * M : s + 6 * M;
|
|
9864
9862
|
return /* @__PURE__ */ e("g", { children: [
|
|
9865
9863
|
/* @__PURE__ */ A(
|
|
9866
9864
|
"path",
|
|
@@ -9879,7 +9877,7 @@ function zo({ lines: o, fitRows: g, show: t, imgWidth: i, imgHeight: a }) {
|
|
|
9879
9877
|
"circle",
|
|
9880
9878
|
{
|
|
9881
9879
|
cx: V,
|
|
9882
|
-
cy:
|
|
9880
|
+
cy: x,
|
|
9883
9881
|
r: u,
|
|
9884
9882
|
fill: aA,
|
|
9885
9883
|
opacity: "0",
|
|
@@ -9890,7 +9888,7 @@ function zo({ lines: o, fitRows: g, show: t, imgWidth: i, imgHeight: a }) {
|
|
|
9890
9888
|
"circle",
|
|
9891
9889
|
{
|
|
9892
9890
|
cx: s,
|
|
9893
|
-
cy:
|
|
9891
|
+
cy: x,
|
|
9894
9892
|
r: u,
|
|
9895
9893
|
fill: aA,
|
|
9896
9894
|
opacity: "0",
|
|
@@ -9902,9 +9900,9 @@ function zo({ lines: o, fitRows: g, show: t, imgWidth: i, imgHeight: a }) {
|
|
|
9902
9900
|
"line",
|
|
9903
9901
|
{
|
|
9904
9902
|
x1: iA,
|
|
9905
|
-
y1:
|
|
9903
|
+
y1: x,
|
|
9906
9904
|
x2: YA,
|
|
9907
|
-
y2:
|
|
9905
|
+
y2: x,
|
|
9908
9906
|
stroke: aA,
|
|
9909
9907
|
strokeWidth: 2 * M
|
|
9910
9908
|
}
|
|
@@ -9913,7 +9911,7 @@ function zo({ lines: o, fitRows: g, show: t, imgWidth: i, imgHeight: a }) {
|
|
|
9913
9911
|
"text",
|
|
9914
9912
|
{
|
|
9915
9913
|
x: nA,
|
|
9916
|
-
y:
|
|
9914
|
+
y: x + 1 * M,
|
|
9917
9915
|
fill: aA,
|
|
9918
9916
|
fontSize: oA,
|
|
9919
9917
|
fontWeight: "700",
|
|
@@ -9984,24 +9982,24 @@ function _o({
|
|
|
9984
9982
|
showLines: u,
|
|
9985
9983
|
onToggleLines: M,
|
|
9986
9984
|
overlayNode: L,
|
|
9987
|
-
onImageLoad:
|
|
9985
|
+
onImageLoad: Y,
|
|
9988
9986
|
onTryOn: v,
|
|
9989
9987
|
tryOnProcessing: l,
|
|
9990
9988
|
tryOnStartedAt: R,
|
|
9991
9989
|
backLabel: V,
|
|
9992
9990
|
internationalSizes: s,
|
|
9993
|
-
continueLabel:
|
|
9991
|
+
continueLabel: x,
|
|
9994
9992
|
renderRaw: E = !1,
|
|
9995
|
-
sectionFound:
|
|
9996
|
-
allSizes:
|
|
9993
|
+
sectionFound: G,
|
|
9994
|
+
allSizes: U
|
|
9997
9995
|
}) {
|
|
9998
|
-
const T = t?.recommendedSize || "", [aA, X] = f(null), UA = Zn(R ?? null), LA = a.toLowerCase(), h = LA.includes("mm") ? "mm" : LA.includes("cm") ? "cm" : "in", oA = c || h,
|
|
9996
|
+
const T = t?.recommendedSize || "", [aA, X] = f(null), UA = Zn(R ?? null), LA = a.toLowerCase(), h = LA.includes("mm") ? "mm" : LA.includes("cm") ? "cm" : "in", oA = c || h, z = (y) => Ct(y, oA, h), vA = (y) => li(y, oA, h), S = (y) => {
|
|
9999
9997
|
const gA = vA(y);
|
|
10000
9998
|
return /^\d+(?:\.\d+)?(?:\s*[-–]\s*\d+(?:\.\d+)?)?$/.test(gA.trim()) ? `${gA} ${a}` : gA;
|
|
10001
9999
|
}, nA = s ? Object.keys(s) : [], [MA, iA] = f(null), YA = n?.secResult?.recommendedSize || "", [VA, HA] = f(null), pe = He(() => {
|
|
10002
10000
|
if (!n) return [];
|
|
10003
|
-
const y = n.section, gA = y.headers.findIndex((qA) => /size|taglia|größe|taille/i.test(qA.trim())), CA = gA >= 0 ? gA : 0, J = y.headers[CA] || "Size",
|
|
10004
|
-
return [...new Set(
|
|
10001
|
+
const y = n.section, gA = y.headers.findIndex((qA) => /size|taglia|größe|taille/i.test(qA.trim())), CA = gA >= 0 ? gA : 0, J = y.headers[CA] || "Size", QA = y.rows.map((qA) => Te(qA, CA, J)).filter(Boolean);
|
|
10002
|
+
return [...new Set(QA)];
|
|
10005
10003
|
}, [n]), _A = He(() => ({}), []), yA = He(() => {
|
|
10006
10004
|
const y = g.headers.findIndex((gA) => /size|taglia|größe|taille/i.test(gA.trim()));
|
|
10007
10005
|
if (y >= 0) return y;
|
|
@@ -10032,8 +10030,8 @@ function _o({
|
|
|
10032
10030
|
continue;
|
|
10033
10031
|
}
|
|
10034
10032
|
let J = null;
|
|
10035
|
-
for (const
|
|
10036
|
-
const qA = String(Te(
|
|
10033
|
+
for (const QA of g.rows) {
|
|
10034
|
+
const qA = String(Te(QA, gA, g.headers[gA]) || "").trim();
|
|
10037
10035
|
if (qA) {
|
|
10038
10036
|
if (/cm\b|centimeter/i.test(qA)) {
|
|
10039
10037
|
J = "cm";
|
|
@@ -10049,7 +10047,7 @@ function _o({
|
|
|
10049
10047
|
}
|
|
10050
10048
|
return y;
|
|
10051
10049
|
}, [g]), me = bA((y, gA) => {
|
|
10052
|
-
const CA = y.toLowerCase().trim(), J = a === "cm" || a === "",
|
|
10050
|
+
const CA = y.toLowerCase().trim(), J = a === "cm" || a === "", QA = J ? "cm" : "in", qA = [];
|
|
10053
10051
|
for (let q = 0; q < g.headers.length; q++) {
|
|
10054
10052
|
const kA = (g.headers[q] || "").toLowerCase().trim();
|
|
10055
10053
|
if (kA === CA) {
|
|
@@ -10060,7 +10058,7 @@ function _o({
|
|
|
10060
10058
|
(Qe === CA || kA.includes(CA) || CA.includes(Qe)) && qA.push(q);
|
|
10061
10059
|
}
|
|
10062
10060
|
if (qA.length === 0) return null;
|
|
10063
|
-
let TA = qA.find((q) => Z[q] ===
|
|
10061
|
+
let TA = qA.find((q) => Z[q] === QA);
|
|
10064
10062
|
TA == null && (TA = qA[0]);
|
|
10065
10063
|
const ve = g.headers[TA], GA = gA.trim().toLowerCase();
|
|
10066
10064
|
let OA = g.rows.find((q) => Te(q, yA, oe) === gA);
|
|
@@ -10070,12 +10068,12 @@ function _o({
|
|
|
10070
10068
|
})), !OA) return null;
|
|
10071
10069
|
const ie = Te(OA, TA, ve);
|
|
10072
10070
|
if (!ie) return null;
|
|
10073
|
-
const XA = dt(ie),
|
|
10074
|
-
if (
|
|
10071
|
+
const XA = dt(ie), m = Z[TA];
|
|
10072
|
+
if (m === "in" && J) {
|
|
10075
10073
|
const q = (kA) => +(kA * 2.54).toFixed(1);
|
|
10076
10074
|
return { range: String(q(XA.min)) + (XA.min !== XA.max ? "–" + String(q(XA.max)) : ""), min: q(XA.min), max: q(XA.max) };
|
|
10077
10075
|
}
|
|
10078
|
-
if (
|
|
10076
|
+
if (m === "cm" && !J) {
|
|
10079
10077
|
const q = (kA) => +(kA / 2.54).toFixed(1);
|
|
10080
10078
|
return { range: String(q(XA.min)) + (XA.min !== XA.max ? "–" + String(q(XA.max)) : ""), min: q(XA.min), max: q(XA.max) };
|
|
10081
10079
|
}
|
|
@@ -10094,11 +10092,11 @@ function _o({
|
|
|
10094
10092
|
const re = cA.min, Ae = cA.max, PA = Ae - re, se = PA > 0 ? PA * 0.5 : re * 0.05 || 3, Pe = Math.max((Ae || re) * 5e-3, 0.25);
|
|
10095
10093
|
if (xe >= re - Pe && xe <= Ae + Pe) Qe = "good";
|
|
10096
10094
|
else if (xe < re) {
|
|
10097
|
-
const
|
|
10098
|
-
Qe =
|
|
10095
|
+
const b = re - xe;
|
|
10096
|
+
Qe = b > se * 2 ? "too-loose" : b > se ? "loose" : "a-bit-loose";
|
|
10099
10097
|
} else {
|
|
10100
|
-
const
|
|
10101
|
-
Qe =
|
|
10098
|
+
const b = xe - Ae;
|
|
10099
|
+
Qe = b > se * 2 ? "too-tight" : b > se ? "tight" : "a-bit-tight";
|
|
10102
10100
|
}
|
|
10103
10101
|
}
|
|
10104
10102
|
}
|
|
@@ -10113,56 +10111,56 @@ function _o({
|
|
|
10113
10111
|
isLength: !1
|
|
10114
10112
|
};
|
|
10115
10113
|
});
|
|
10116
|
-
const y = t?.matchDetails || [], gA = n?.secResult?.matchDetails || [], CA = /* @__PURE__ */ new Set(), J = [...y, ...gA].filter((
|
|
10117
|
-
const q = String(
|
|
10114
|
+
const y = t?.matchDetails || [], gA = n?.secResult?.matchDetails || [], CA = /* @__PURE__ */ new Set(), J = [...y, ...gA].filter((m) => {
|
|
10115
|
+
const q = String(m?.measurement ?? "").toLowerCase().trim();
|
|
10118
10116
|
return !q || CA.has(q) ? !1 : (CA.add(q), !0);
|
|
10119
|
-
}),
|
|
10117
|
+
}), QA = t?.length || "", qA = (t?.availableLengths?.length || 0) > 0, TA = YA || QA, ve = !!(n || qA), GA = J.some((m) => m.measurement.toLowerCase() === "height"), OA = !!n?.section?.headers?.some((m) => /height|altezza|estatura|\(cm\)/i.test(m));
|
|
10120
10118
|
if (n && OA && !GA) {
|
|
10121
|
-
const
|
|
10119
|
+
const m = i.height || 0;
|
|
10122
10120
|
J.push({
|
|
10123
10121
|
measurement: "Height",
|
|
10124
|
-
userValue:
|
|
10122
|
+
userValue: m ? String(m) : "",
|
|
10125
10123
|
chartRange: TA || "",
|
|
10126
10124
|
fit: "good"
|
|
10127
10125
|
});
|
|
10128
10126
|
} else if (qA && !n && !GA) {
|
|
10129
|
-
const
|
|
10127
|
+
const m = i.height || 0;
|
|
10130
10128
|
J.push({
|
|
10131
10129
|
measurement: "Height",
|
|
10132
|
-
userValue:
|
|
10130
|
+
userValue: m ? String(m) : "",
|
|
10133
10131
|
chartRange: "",
|
|
10134
10132
|
fit: "good"
|
|
10135
10133
|
});
|
|
10136
10134
|
}
|
|
10137
10135
|
if (!J.length) return [];
|
|
10138
|
-
const ie = new Set(gA.map((
|
|
10136
|
+
const ie = new Set(gA.map((m) => m.measurement));
|
|
10139
10137
|
ve && ie.add("Height");
|
|
10140
10138
|
const XA = VA || TA;
|
|
10141
|
-
return J.map((
|
|
10142
|
-
if (ie.has(
|
|
10143
|
-
const re = i[
|
|
10139
|
+
return J.map((m) => {
|
|
10140
|
+
if (ie.has(m.measurement)) {
|
|
10141
|
+
const re = i[m.measurement.toLowerCase()] || _e(m.userValue), Ae = n?.secResult?.allSizes, PA = XA ? Ae?.[XA]?.[m.measurement] : void 0, se = XA ? U?.[XA]?.[m.measurement] : void 0, Pe = U?.[Ce]?.[m.measurement], b = PA ?? se ?? Pe, P = b?.chartRange ?? m.chartRange, F = b?.fit ?? m.fit ?? "good";
|
|
10144
10142
|
return {
|
|
10145
|
-
area:
|
|
10143
|
+
area: m.measurement,
|
|
10146
10144
|
userNum: re,
|
|
10147
|
-
chartLabel: fg(
|
|
10148
|
-
fit:
|
|
10145
|
+
chartLabel: fg(P),
|
|
10146
|
+
fit: F,
|
|
10149
10147
|
isLength: !0
|
|
10150
10148
|
};
|
|
10151
10149
|
}
|
|
10152
|
-
const q = i[
|
|
10150
|
+
const q = i[m.measurement.toLowerCase()] || _e(m.userValue), kA = m.measurement.toLowerCase(), Qe = /length|inseam|sleeve|hem|rise/.test(kA), cA = U?.[Ce]?.[m.measurement], ae = cA?.chartRange ?? m.chartRange, xe = cA?.fit ?? m.fit ?? "good";
|
|
10153
10151
|
return {
|
|
10154
|
-
area:
|
|
10152
|
+
area: m.measurement,
|
|
10155
10153
|
userNum: q,
|
|
10156
10154
|
chartLabel: fg(ae),
|
|
10157
10155
|
fit: xe,
|
|
10158
10156
|
isLength: Qe
|
|
10159
10157
|
};
|
|
10160
10158
|
});
|
|
10161
|
-
}, [t, n, i, E,
|
|
10159
|
+
}, [t, n, i, E, U, Ce, VA]), Ye = fe.filter(
|
|
10162
10160
|
(y) => y.fit === "good" || y.fit === "a-bit-tight" || y.fit === "a-bit-loose"
|
|
10163
10161
|
).length, ne = fe.length > 0 ? Math.round(Ye / fe.length * 100) : 0, de = !E, dA = t, ge = dA?.size || T, jA = (t?.matchDetails || []).find(
|
|
10164
10162
|
(y) => /inseam|length/i.test(y.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(y.measurement)
|
|
10165
|
-
), H = jA ? (jA.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", zA = dA?.length || YA || H, he = dA?.availableSizes || [], Oe = dA?.availableLengths || [], JA = VA || zA, ke =
|
|
10163
|
+
), H = jA ? (jA.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", zA = dA?.length || YA || H, he = dA?.availableSizes || [], Oe = dA?.availableLengths || [], JA = VA || zA, ke = U ? Object.keys(U) : [], De = ke.length > 0 ? ke : he.length > 0 ? he : SA, BA = (() => {
|
|
10166
10164
|
if (De.length <= 3) return De;
|
|
10167
10165
|
const y = De.indexOf(T);
|
|
10168
10166
|
if (y < 0) return De.slice(0, 3);
|
|
@@ -10177,9 +10175,9 @@ function _o({
|
|
|
10177
10175
|
})();
|
|
10178
10176
|
if (C) {
|
|
10179
10177
|
const y = o.replace(/\s*[—–-]\s*.*/g, ""), gA = (J) => {
|
|
10180
|
-
const
|
|
10181
|
-
return
|
|
10182
|
-
}, CA = (J,
|
|
10178
|
+
const QA = J.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
10179
|
+
return QA.includes("chest") || QA.includes("bust") ? r("Full circumference at the widest point.") : QA.includes("waist") ? r("Circumference at the natural waistline.") : QA.includes("hip") ? r("Circumference at the fullest point.") : QA.includes("shoulder") ? r("Shoulder edge to shoulder edge.") : QA.includes("sleeve") || QA.includes("arm") ? r("Shoulder seam to cuff edge.") : QA.includes("neck") || QA.includes("collar") ? r("Around the base of the neck.") : QA.includes("inseam") || QA.includes("inside leg") ? r("Inner leg seam length.") : QA.includes("thigh") ? r("Circumference around the upper leg.") : QA.includes("length") || QA.includes("height") ? r("Top to bottom length.") : "";
|
|
10180
|
+
}, CA = (J, QA) => QA && J === "good" ? r("EDITORIAL LENGTH") : J === "good" ? r("PERFECT TENSION") : J === "a-bit-tight" ? r("SLIGHTLY TIGHT") : J === "a-bit-loose" ? r("SLIGHT EASE") : J.includes("tight") ? r("TIGHT") : J.includes("loose") ? r("LOOSE") : r("FIT");
|
|
10183
10181
|
return /* @__PURE__ */ A("div", { className: "ps-msd-root", children: /* @__PURE__ */ e("div", { className: "ps-msd-scroll", children: [
|
|
10184
10182
|
/* @__PURE__ */ e("div", { className: "ps-msd-topbar", children: [
|
|
10185
10183
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-msd-back", onClick: w, "aria-label": r("Back"), children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "20", height: "20", children: [
|
|
@@ -10200,7 +10198,7 @@ function _o({
|
|
|
10200
10198
|
src: p,
|
|
10201
10199
|
alt: Q || "",
|
|
10202
10200
|
className: "ps-msd-image-img",
|
|
10203
|
-
onLoad:
|
|
10201
|
+
onLoad: Y
|
|
10204
10202
|
}
|
|
10205
10203
|
),
|
|
10206
10204
|
u && L,
|
|
@@ -10224,7 +10222,7 @@ function _o({
|
|
|
10224
10222
|
}
|
|
10225
10223
|
)
|
|
10226
10224
|
] }),
|
|
10227
|
-
|
|
10225
|
+
G === !1 && /* @__PURE__ */ A("div", { style: {
|
|
10228
10226
|
flex: 1,
|
|
10229
10227
|
display: "flex",
|
|
10230
10228
|
alignItems: "center",
|
|
@@ -10241,7 +10239,7 @@ function _o({
|
|
|
10241
10239
|
/* @__PURE__ */ A("p", { style: { fontSize: "15px", fontWeight: 600, color: "var(--ps-text-primary)", margin: "10px 0 6px", lineHeight: 1.4 }, children: r("We couldn't find a size that fits for this product.") }),
|
|
10242
10240
|
/* @__PURE__ */ A("p", { className: "ps-msd-card-note", style: { margin: 0, lineHeight: 1.5 }, children: r("Your measurements are outside this product's size range. You can still try it on visually below.") })
|
|
10243
10241
|
] }) }),
|
|
10244
|
-
|
|
10242
|
+
G !== !1 && /* @__PURE__ */ e("div", { className: "ps-msd-card", children: [
|
|
10245
10243
|
/* @__PURE__ */ A(
|
|
10246
10244
|
"span",
|
|
10247
10245
|
{
|
|
@@ -10308,11 +10306,11 @@ function _o({
|
|
|
10308
10306
|
] }),
|
|
10309
10307
|
/* @__PURE__ */ A("p", { className: "ps-msd-card-note", children: r("Based on your measurements and the garment's tailoring chart.") })
|
|
10310
10308
|
] }),
|
|
10311
|
-
|
|
10309
|
+
G !== !1 && fe.length > 0 && /* @__PURE__ */ e("div", { className: "ps-msd-blueprint", children: [
|
|
10312
10310
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: r("MEASUREMENT BLUEPRINT") }),
|
|
10313
10311
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
10314
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: fe.map((J,
|
|
10315
|
-
const qA = J.isLength && J.fit.includes("short") || J.fit.includes("tight"), TA = J.fit === "good" ? "ps-good" : qA ? "ps-tight" : "ps-loose", ve = gA(J.area), GA = String(
|
|
10312
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: fe.map((J, QA) => {
|
|
10313
|
+
const qA = J.isLength && J.fit.includes("short") || J.fit.includes("tight"), TA = J.fit === "good" ? "ps-good" : qA ? "ps-tight" : "ps-loose", ve = gA(J.area), GA = String(QA + 1).padStart(2, "0");
|
|
10316
10314
|
return /* @__PURE__ */ e("div", { className: "ps-msd-row", children: [
|
|
10317
10315
|
/* @__PURE__ */ e("div", { className: "ps-msd-row-num", children: [
|
|
10318
10316
|
GA,
|
|
@@ -10323,7 +10321,7 @@ function _o({
|
|
|
10323
10321
|
/* @__PURE__ */ e("div", { className: "ps-msd-row-cells", children: [
|
|
10324
10322
|
/* @__PURE__ */ e("div", { className: "ps-msd-row-cell", children: [
|
|
10325
10323
|
/* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: r("USER") }),
|
|
10326
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: E ? J.rawUserValue || "" : isNaN(J.userNum) || J.userNum === 0 ? "" : `${
|
|
10324
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: E ? J.rawUserValue || "" : isNaN(J.userNum) || J.userNum === 0 ? "" : `${z(J.userNum)} ${a}` })
|
|
10327
10325
|
] }),
|
|
10328
10326
|
/* @__PURE__ */ e("div", { className: "ps-msd-row-cell ps-right", children: [
|
|
10329
10327
|
/* @__PURE__ */ e("span", { className: "ps-msd-cell-label", children: [
|
|
@@ -10338,10 +10336,10 @@ function _o({
|
|
|
10338
10336
|
J.isLength ? Jg(J.fit, r).toUpperCase() : CA(J.fit, J.isLength),
|
|
10339
10337
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "11", height: "11", children: /* @__PURE__ */ A("path", { d: "M3 8l3.5 3.5L13 5" }) })
|
|
10340
10338
|
] })
|
|
10341
|
-
] },
|
|
10339
|
+
] }, QA);
|
|
10342
10340
|
}) })
|
|
10343
10341
|
] }),
|
|
10344
|
-
|
|
10342
|
+
G !== !1 && BA.length > 1 && /* @__PURE__ */ e("div", { className: "ps-msd-sizes", children: [
|
|
10345
10343
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: r("TRY ANOTHER SIZE") }),
|
|
10346
10344
|
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: BA.map((J) => /* @__PURE__ */ A(
|
|
10347
10345
|
"button",
|
|
@@ -10354,15 +10352,15 @@ function _o({
|
|
|
10354
10352
|
J
|
|
10355
10353
|
)) })
|
|
10356
10354
|
] }),
|
|
10357
|
-
|
|
10355
|
+
G !== !1 && FA.length > 0 && /* @__PURE__ */ e("div", { className: "ps-msd-sizes", children: [
|
|
10358
10356
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: r("LENGTH ADJUSTMENT") }),
|
|
10359
10357
|
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: FA.map((J) => {
|
|
10360
|
-
const
|
|
10358
|
+
const QA = String(JA ?? "").trim() === String(J ?? "").trim(), qA = _A[String(J).trim()];
|
|
10361
10359
|
return /* @__PURE__ */ e(
|
|
10362
10360
|
"button",
|
|
10363
10361
|
{
|
|
10364
10362
|
type: "button",
|
|
10365
|
-
className: `ps-msd-size-pill${
|
|
10363
|
+
className: `ps-msd-size-pill${QA ? " ps-active" : ""}`,
|
|
10366
10364
|
onClick: () => HA(J === zA ? null : J),
|
|
10367
10365
|
style: { display: "flex", flexDirection: "column", alignItems: "center", lineHeight: 1.15, gap: "0.15vw" },
|
|
10368
10366
|
children: [
|
|
@@ -10374,7 +10372,7 @@ function _o({
|
|
|
10374
10372
|
);
|
|
10375
10373
|
}) })
|
|
10376
10374
|
] }),
|
|
10377
|
-
|
|
10375
|
+
G !== !1 && /* @__PURE__ */ e("p", { className: "ps-msd-footer-note", children: [
|
|
10378
10376
|
r("*Our sizing engine recommends"),
|
|
10379
10377
|
" ",
|
|
10380
10378
|
ge,
|
|
@@ -10451,7 +10449,7 @@ function _o({
|
|
|
10451
10449
|
whiteSpace: "nowrap"
|
|
10452
10450
|
},
|
|
10453
10451
|
children: [
|
|
10454
|
-
|
|
10452
|
+
x || r("Continue"),
|
|
10455
10453
|
" →"
|
|
10456
10454
|
]
|
|
10457
10455
|
}
|
|
@@ -10460,7 +10458,7 @@ function _o({
|
|
|
10460
10458
|
] }) });
|
|
10461
10459
|
}
|
|
10462
10460
|
return /* @__PURE__ */ e("div", { className: "ps-tryon-sec-detail", style: { padding: "1.5vw", display: "flex", flexDirection: "column", height: "100%", background: "#F8F9FA" }, children: [
|
|
10463
|
-
/* @__PURE__ */ A("div", { style: { flex: 1, minHeight: 0, overflowY: "auto", scrollbarWidth: "thin", scrollbarColor: "rgba(0,0,0,0.04) transparent", display:
|
|
10461
|
+
/* @__PURE__ */ A("div", { style: { flex: 1, minHeight: 0, overflowY: "auto", scrollbarWidth: "thin", scrollbarColor: "rgba(0,0,0,0.04) transparent", display: G === !1 ? "flex" : "block", alignItems: G === !1 ? "center" : void 0, justifyContent: G === !1 ? "center" : void 0 }, children: G === !1 ? /* @__PURE__ */ e("div", { style: {
|
|
10464
10462
|
background: "white",
|
|
10465
10463
|
borderRadius: "0.7vw",
|
|
10466
10464
|
border: "1px solid rgba(0,0,0,0.06)",
|
|
@@ -10562,7 +10560,7 @@ function _o({
|
|
|
10562
10560
|
const CA = y.fit === "good" ? "#2154EF" : y.isLength ? y.fit.includes("short") || y.fit.includes("tight") ? "#dc2626" : "#d97706" : y.fit.includes("tight") ? "#dc2626" : "#d97706", J = y.fit === "good" ? "rgba(33,84,239,0.08)" : y.isLength ? y.fit.includes("short") || y.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : y.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
|
|
10563
10561
|
return /* @__PURE__ */ e("tr", { style: { borderBottom: gA < fe.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
10564
10562
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: y.area }),
|
|
10565
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? y.rawUserValue || "" : isNaN(y.userNum) || y.userNum === 0 ? "" : `${
|
|
10563
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? y.rawUserValue || "" : isNaN(y.userNum) || y.userNum === 0 ? "" : `${z(y.userNum)} ${a}` }),
|
|
10566
10564
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? y.rawChartRange || "" : S(y.chartLabel) }),
|
|
10567
10565
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: CA, background: J, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: y.isLength ? Jg(y.fit, r) : wi(y.fit, r) }) })
|
|
10568
10566
|
] }, gA);
|
|
@@ -10697,7 +10695,7 @@ function _o({
|
|
|
10697
10695
|
onMouseEnter: (y) => y.currentTarget.style.opacity = "0.9",
|
|
10698
10696
|
onMouseLeave: (y) => y.currentTarget.style.opacity = "1",
|
|
10699
10697
|
children: [
|
|
10700
|
-
|
|
10698
|
+
x || r("Continue"),
|
|
10701
10699
|
" →"
|
|
10702
10700
|
]
|
|
10703
10701
|
}
|
|
@@ -10722,16 +10720,16 @@ function pi({
|
|
|
10722
10720
|
previewUrl: u,
|
|
10723
10721
|
handleFileSelect: M,
|
|
10724
10722
|
handleRemovePreview: L,
|
|
10725
|
-
handleTryOnSubmit:
|
|
10723
|
+
handleTryOnSubmit: Y,
|
|
10726
10724
|
tryOnProcessing: v,
|
|
10727
10725
|
tryOnStartedAt: l,
|
|
10728
10726
|
bodyLandmarks: R,
|
|
10729
10727
|
faceLandmarks: V = null,
|
|
10730
10728
|
measurementType: s = "body",
|
|
10731
|
-
estimationDone:
|
|
10729
|
+
estimationDone: x = !1,
|
|
10732
10730
|
activeSection: E,
|
|
10733
|
-
setActiveSection:
|
|
10734
|
-
onResetTryOn:
|
|
10731
|
+
setActiveSection: G,
|
|
10732
|
+
onResetTryOn: U,
|
|
10735
10733
|
onClose: T,
|
|
10736
10734
|
userHeightCm: aA,
|
|
10737
10735
|
pendingCustomSizes: X,
|
|
@@ -10739,33 +10737,33 @@ function pi({
|
|
|
10739
10737
|
tryOnAvailable: LA = !0,
|
|
10740
10738
|
t: h
|
|
10741
10739
|
}) {
|
|
10742
|
-
const oA = (g?.unit || p || "").toString().toLowerCase(),
|
|
10740
|
+
const oA = (g?.unit || p || "").toString().toLowerCase(), z = oA === "mm" ? "mm" : oA === "cm" ? "cm" : "in", vA = h(z === "mm" ? "mm" : p === "cm" ? "cm" : "in"), [S, nA] = f({}), MA = dt, iA = bA((b, P, F) => Te(b, P, F), []), YA = He(() => {
|
|
10743
10741
|
if (!t?.headers || !t?.rows) return -1;
|
|
10744
|
-
const
|
|
10745
|
-
if (
|
|
10746
|
-
for (let
|
|
10747
|
-
const
|
|
10748
|
-
if (t.rows.some((K) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(iA(K,
|
|
10742
|
+
const b = t.headers.findIndex((P) => /size|taglia|größe|taille/i.test(P.trim()));
|
|
10743
|
+
if (b >= 0) return b;
|
|
10744
|
+
for (let P = 0; P < t.headers.length; P++) {
|
|
10745
|
+
const F = t.headers[P];
|
|
10746
|
+
if (t.rows.some((K) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(iA(K, P, F)))) return P;
|
|
10749
10747
|
}
|
|
10750
10748
|
return 0;
|
|
10751
10749
|
}, [t, iA]), VA = t?.headers?.[YA] || h("Size");
|
|
10752
|
-
He(() => YA < 0 || !t?.rows ? [] : t.rows.map((
|
|
10750
|
+
He(() => YA < 0 || !t?.rows ? [] : t.rows.map((b) => iA(b, YA, VA)).filter(Boolean), [t, YA, VA, iA]);
|
|
10753
10751
|
const HA = He(() => {
|
|
10754
10752
|
if (!t?.headers || !t?.rows) return [];
|
|
10755
|
-
const
|
|
10756
|
-
for (let
|
|
10757
|
-
const
|
|
10758
|
-
if (/\(cm\)|centimeter/i.test(
|
|
10759
|
-
|
|
10753
|
+
const b = [];
|
|
10754
|
+
for (let P = 0; P < t.headers.length; P++) {
|
|
10755
|
+
const F = (t.headers[P] || "").toLowerCase();
|
|
10756
|
+
if (/\(cm\)|centimeter/i.test(F)) {
|
|
10757
|
+
b.push("cm");
|
|
10760
10758
|
continue;
|
|
10761
10759
|
}
|
|
10762
|
-
if (/\(in\)|\(inch|inch/i.test(
|
|
10763
|
-
|
|
10760
|
+
if (/\(in\)|\(inch|inch/i.test(F)) {
|
|
10761
|
+
b.push("in");
|
|
10764
10762
|
continue;
|
|
10765
10763
|
}
|
|
10766
10764
|
let K = null;
|
|
10767
10765
|
for (const EA of t.rows) {
|
|
10768
|
-
const $ = String(iA(EA,
|
|
10766
|
+
const $ = String(iA(EA, P, t.headers[P]) || "").trim();
|
|
10769
10767
|
if ($) {
|
|
10770
10768
|
if (/cm\b|centimeter/i.test($)) {
|
|
10771
10769
|
K = "cm";
|
|
@@ -10777,77 +10775,77 @@ function pi({
|
|
|
10777
10775
|
}
|
|
10778
10776
|
}
|
|
10779
10777
|
}
|
|
10780
|
-
|
|
10778
|
+
b.push(K);
|
|
10781
10779
|
}
|
|
10782
|
-
return
|
|
10783
|
-
}, [t, iA]), pe = bA((
|
|
10780
|
+
return b;
|
|
10781
|
+
}, [t, iA]), pe = bA((b, P) => {
|
|
10784
10782
|
if (!t?.headers || !t?.rows || YA < 0) return null;
|
|
10785
|
-
const
|
|
10783
|
+
const F = b.toLowerCase().trim(), K = vA === "cm" || vA === "", EA = K ? "cm" : "in", $ = [];
|
|
10786
10784
|
for (let W = 0; W < t.headers.length; W++) {
|
|
10787
|
-
const
|
|
10788
|
-
if (
|
|
10785
|
+
const fA = (t.headers[W] || "").toLowerCase().trim();
|
|
10786
|
+
if (fA === F) {
|
|
10789
10787
|
$.push(W);
|
|
10790
10788
|
continue;
|
|
10791
10789
|
}
|
|
10792
|
-
const uA =
|
|
10793
|
-
(uA ===
|
|
10790
|
+
const uA = fA.replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
10791
|
+
(uA === F || fA.includes(F) || F.includes(uA)) && $.push(W);
|
|
10794
10792
|
}
|
|
10795
10793
|
if ($.length === 0) return null;
|
|
10796
10794
|
let lA = $.find((W) => HA[W] === EA);
|
|
10797
10795
|
lA == null && (lA = $[0]);
|
|
10798
|
-
const IA = t.headers[lA], Be = t.rows.find((W) => iA(W, YA, VA) ===
|
|
10796
|
+
const IA = t.headers[lA], Be = t.rows.find((W) => iA(W, YA, VA) === P);
|
|
10799
10797
|
if (!Be) return null;
|
|
10800
10798
|
const Ee = iA(Be, lA, IA);
|
|
10801
10799
|
if (!Ee) return null;
|
|
10802
10800
|
const KA = MA(Ee), D = HA[lA];
|
|
10803
10801
|
if (D === "in" && K) {
|
|
10804
|
-
const W = (
|
|
10802
|
+
const W = (fA) => +(fA * 2.54).toFixed(1);
|
|
10805
10803
|
return { range: String(W(KA.min)) + (KA.min !== KA.max ? "–" + String(W(KA.max)) : ""), min: W(KA.min), max: W(KA.max) };
|
|
10806
10804
|
}
|
|
10807
10805
|
if (D === "cm" && !K) {
|
|
10808
|
-
const W = (
|
|
10806
|
+
const W = (fA) => +(fA / 2.54).toFixed(1);
|
|
10809
10807
|
return { range: String(W(KA.min)) + (KA.min !== KA.max ? "–" + String(W(KA.max)) : ""), min: W(KA.min), max: W(KA.max) };
|
|
10810
10808
|
}
|
|
10811
10809
|
return { range: Ee, ...KA };
|
|
10812
10810
|
}, [t, YA, VA, vA, iA, MA, HA]), _A = g?.recommendedSize || "";
|
|
10813
10811
|
He(() => g?.internationalSizes || {}, [g]);
|
|
10814
|
-
const [yA, oe] = f("fit"), [SA, Ce] = f(null), [mA, Ie] = f(!1), [Z, me] = f(!1), [fe, Ye] = f(!1), [ne, de] = f(null), [dA, ge] = f(!1), [jA, H] = f({ w: 800, h: 1200 }), zA = X ?? {}, he = bA((
|
|
10815
|
-
const
|
|
10816
|
-
|
|
10812
|
+
const [yA, oe] = f("fit"), [SA, Ce] = f(null), [mA, Ie] = f(!1), [Z, me] = f(!1), [fe, Ye] = f(!1), [ne, de] = f(null), [dA, ge] = f(!1), [jA, H] = f({ w: 800, h: 1200 }), zA = X ?? {}, he = bA((b) => {
|
|
10813
|
+
const P = b.currentTarget;
|
|
10814
|
+
P.naturalWidth && P.naturalHeight && H({ w: P.naturalWidth, h: P.naturalHeight });
|
|
10817
10815
|
}, []);
|
|
10818
10816
|
xA(() => {
|
|
10819
10817
|
if (!i || v) {
|
|
10820
10818
|
de(null), ge(!1);
|
|
10821
10819
|
return;
|
|
10822
10820
|
}
|
|
10823
|
-
ge(!1), og(i).then((
|
|
10824
|
-
de(
|
|
10821
|
+
ge(!1), og(i).then((b) => {
|
|
10822
|
+
de(b), ge(!0);
|
|
10825
10823
|
}).catch(() => {
|
|
10826
10824
|
ge(!0);
|
|
10827
10825
|
});
|
|
10828
10826
|
}, [i, v]);
|
|
10829
10827
|
const [Oe, JA] = f(!1), [ke, De] = f(!1);
|
|
10830
|
-
|
|
10831
|
-
const [BA, RA] = f(!1), [FA, y] = f(null), [gA, CA] = f(!1), J =
|
|
10828
|
+
hA(null);
|
|
10829
|
+
const [BA, RA] = f(!1), [FA, y] = f(null), [gA, CA] = f(!1), J = hA(null), [QA, qA] = f(null), [TA, ve] = f(!1);
|
|
10832
10830
|
xA(() => {
|
|
10833
10831
|
if (FA) {
|
|
10834
|
-
const
|
|
10835
|
-
return qA(
|
|
10832
|
+
const b = URL.createObjectURL(FA);
|
|
10833
|
+
return qA(b), () => URL.revokeObjectURL(b);
|
|
10836
10834
|
}
|
|
10837
10835
|
qA(null);
|
|
10838
10836
|
}, [FA]);
|
|
10839
10837
|
const GA = SA || _A;
|
|
10840
10838
|
He(() => {
|
|
10841
10839
|
if (!g?.matchDetails?.length) return [];
|
|
10842
|
-
const
|
|
10843
|
-
return g.matchDetails.filter((
|
|
10844
|
-
const K =
|
|
10845
|
-
return
|
|
10846
|
-
}).map((
|
|
10847
|
-
const K = _e(
|
|
10848
|
-
let EA =
|
|
10840
|
+
const b = /* @__PURE__ */ new Set();
|
|
10841
|
+
return g.matchDetails.filter((F) => {
|
|
10842
|
+
const K = F.measurement.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
10843
|
+
return b.has(K) ? !1 : (b.add(K), !0);
|
|
10844
|
+
}).map((F) => {
|
|
10845
|
+
const K = _e(F.userValue);
|
|
10846
|
+
let EA = F.chartRange, $ = F.fit;
|
|
10849
10847
|
if (GA !== _A) {
|
|
10850
|
-
const lA = pe(
|
|
10848
|
+
const lA = pe(F.measurement, GA);
|
|
10851
10849
|
if (lA && lA.min > 0) {
|
|
10852
10850
|
EA = fg(lA.range);
|
|
10853
10851
|
const IA = lA.min, Be = lA.max, Ee = Be - IA, KA = Ee > 0 ? Ee * 0.5 : IA * 0.05 || 3, D = Math.max((Be || IA) * 5e-3, 0.25);
|
|
@@ -10861,37 +10859,37 @@ function pi({
|
|
|
10861
10859
|
}
|
|
10862
10860
|
}
|
|
10863
10861
|
}
|
|
10864
|
-
return { area:
|
|
10862
|
+
return { area: F.measurement, userNum: _e(F.userValue), chartLabel: EA, fit: $ };
|
|
10865
10863
|
});
|
|
10866
10864
|
}, [g, GA, _A, pe]), He(() => {
|
|
10867
10865
|
if (!t?.headers || !t?.rows || YA < 0) return null;
|
|
10868
|
-
const
|
|
10869
|
-
if (!
|
|
10870
|
-
const
|
|
10871
|
-
for (let
|
|
10872
|
-
const K = t.headers[
|
|
10873
|
-
if (
|
|
10874
|
-
const EA = iA(
|
|
10875
|
-
EA &&
|
|
10866
|
+
const b = t.rows.find((F) => iA(F, YA, VA) === GA);
|
|
10867
|
+
if (!b) return null;
|
|
10868
|
+
const P = [];
|
|
10869
|
+
for (let F = 0; F < t.headers.length; F++) {
|
|
10870
|
+
const K = t.headers[F] || "";
|
|
10871
|
+
if (F === YA) continue;
|
|
10872
|
+
const EA = iA(b, F, K);
|
|
10873
|
+
EA && P.push({ header: K, value: EA });
|
|
10876
10874
|
}
|
|
10877
|
-
return
|
|
10875
|
+
return P;
|
|
10878
10876
|
}, [t, YA, VA, GA, iA]);
|
|
10879
10877
|
const OA = !!(t?.sections && Object.keys(t.sections).length > 1), ie = He(() => {
|
|
10880
|
-
const
|
|
10881
|
-
if (
|
|
10882
|
-
for (const K of
|
|
10878
|
+
const b = {}, P = (F) => {
|
|
10879
|
+
if (F)
|
|
10880
|
+
for (const K of F) {
|
|
10883
10881
|
const EA = K.measurement.toLowerCase();
|
|
10884
|
-
if (
|
|
10882
|
+
if (b[EA] == null) {
|
|
10885
10883
|
const $ = _e(K.userValue);
|
|
10886
|
-
$ > 0 && (
|
|
10884
|
+
$ > 0 && (b[EA] = $);
|
|
10887
10885
|
}
|
|
10888
10886
|
}
|
|
10889
10887
|
};
|
|
10890
|
-
if (
|
|
10891
|
-
for (const
|
|
10892
|
-
return aA && aA > 0 &&
|
|
10893
|
-
const EA =
|
|
10894
|
-
let $ = t?.sections?.[
|
|
10888
|
+
if (P(g?.matchDetails), g?.sections)
|
|
10889
|
+
for (const F of Object.values(g.sections)) P(F.matchDetails);
|
|
10890
|
+
return aA && aA > 0 && b.height == null && (b.height = aA), g?.sections && Object.keys(g.sections).length > 0 ? Object.entries(g.sections).map(([F, K]) => {
|
|
10891
|
+
const EA = F.toLowerCase();
|
|
10892
|
+
let $ = t?.sections?.[F];
|
|
10895
10893
|
if (!$ && t?.sections) {
|
|
10896
10894
|
const IA = Object.entries(t.sections).find(([Be]) => {
|
|
10897
10895
|
const Ee = Be.toLowerCase(), KA = Ee.replace(/\s*(size|sizing)\s*/gi, "").trim();
|
|
@@ -10900,47 +10898,47 @@ function pi({
|
|
|
10900
10898
|
IA && ($ = IA[1]);
|
|
10901
10899
|
}
|
|
10902
10900
|
$ || ($ = { headers: [], rows: [], requiredFields: [] });
|
|
10903
|
-
const lA = { ...
|
|
10901
|
+
const lA = { ...b };
|
|
10904
10902
|
if (K.matchDetails)
|
|
10905
10903
|
for (const IA of K.matchDetails) {
|
|
10906
10904
|
const Be = _e(IA.userValue);
|
|
10907
10905
|
Be > 0 && (lA[IA.measurement.toLowerCase()] = Be);
|
|
10908
10906
|
}
|
|
10909
|
-
return { name:
|
|
10910
|
-
}) : !OA || !t?.sections ? [] : Object.entries(t.sections).map(([
|
|
10911
|
-
const EA = g?.sections?.[
|
|
10907
|
+
return { name: F, section: $, secResult: K, userMeasurements: lA };
|
|
10908
|
+
}) : !OA || !t?.sections ? [] : Object.entries(t.sections).map(([F, K]) => {
|
|
10909
|
+
const EA = g?.sections?.[F] || { recommendedSize: g?.recommendedSize || "", matchDetails: [] }, $ = { ...b };
|
|
10912
10910
|
if (EA.matchDetails)
|
|
10913
10911
|
for (const lA of EA.matchDetails) {
|
|
10914
10912
|
const IA = _e(lA.userValue);
|
|
10915
10913
|
IA > 0 && ($[lA.measurement.toLowerCase()] = IA);
|
|
10916
10914
|
}
|
|
10917
|
-
return { name:
|
|
10915
|
+
return { name: F, section: K, secResult: EA, userMeasurements: $ };
|
|
10918
10916
|
});
|
|
10919
|
-
}, [OA, t, g, aA]), XA = He(() => ie.filter((
|
|
10920
|
-
if (!
|
|
10921
|
-
let K = pg(
|
|
10922
|
-
if (K || (K = ie.find((Be) => Be.name ===
|
|
10917
|
+
}, [OA, t, g, aA]), XA = He(() => ie.filter((b) => !Kg(b.name)), [ie]), m = He(() => ie.filter((b) => Kg(b.name)), [ie]), q = bA((b, P) => {
|
|
10918
|
+
if (!P) return P;
|
|
10919
|
+
let K = pg(b, m)?.secResult?.recommendedSize?.trim() || "";
|
|
10920
|
+
if (K || (K = ie.find((Be) => Be.name === b)?.secResult?.length?.trim() || ""), !K) return P;
|
|
10923
10921
|
const EA = K.toLowerCase();
|
|
10924
10922
|
if (/^\d/.test(K)) {
|
|
10925
|
-
const Be = /pant|trouser|inseam/i.test(
|
|
10926
|
-
return `${
|
|
10923
|
+
const Be = /pant|trouser|inseam/i.test(b) ? "Inseam" : "Length";
|
|
10924
|
+
return `${P} / ${Be} ${K}`;
|
|
10927
10925
|
}
|
|
10928
|
-
if (/^x(tra)?[- ]?long/.test(EA)) return /^\d/.test(
|
|
10929
|
-
if (/^\d/.test(
|
|
10926
|
+
if (/^x(tra)?[- ]?long/.test(EA)) return /^\d/.test(P) ? `${P}XL` : `${P} / Extra Long`;
|
|
10927
|
+
if (/^\d/.test(P)) {
|
|
10930
10928
|
const IA = EA.charAt(0).toUpperCase();
|
|
10931
|
-
return `${
|
|
10929
|
+
return `${P}${IA}`;
|
|
10932
10930
|
}
|
|
10933
10931
|
const lA = K.replace(/\s+/g, " ").trim();
|
|
10934
|
-
return `${
|
|
10935
|
-
}, [
|
|
10932
|
+
return `${P} / ${lA}`;
|
|
10933
|
+
}, [m, ie]);
|
|
10936
10934
|
He(() => {
|
|
10937
|
-
const
|
|
10938
|
-
if (!
|
|
10935
|
+
const b = aA || 0;
|
|
10936
|
+
if (!b) return "";
|
|
10939
10937
|
if (vA === "in") {
|
|
10940
|
-
const
|
|
10941
|
-
return `${
|
|
10938
|
+
const P = b / 2.54, F = Math.floor(P / 12), K = Math.round(P - F * 12);
|
|
10939
|
+
return `${F}'${K}"`;
|
|
10942
10940
|
}
|
|
10943
|
-
return `${Math.round(
|
|
10941
|
+
return `${Math.round(b)} cm`;
|
|
10944
10942
|
}, [aA, vA]);
|
|
10945
10943
|
const kA = !!u, Qe = kA && o, cA = !kA && o, ae = !!g, re = kA ? ae && (!!i && !v) : ae, Ae = jo(), PA = s === "face" || s === "head";
|
|
10946
10944
|
g?.found;
|
|
@@ -11006,11 +11004,11 @@ function pi({
|
|
|
11006
11004
|
s === "face" || s === "head" ? V && /* @__PURE__ */ A(ai, { landmarks: V, imgWidth: jA.w, imgHeight: jA.h }) : R && /* @__PURE__ */ A(ci, { landmarks: R, imgWidth: jA.w, imgHeight: jA.h })
|
|
11007
11005
|
] }),
|
|
11008
11006
|
(() => {
|
|
11009
|
-
const
|
|
11010
|
-
return h(
|
|
11007
|
+
const b = s === "face" || s === "head";
|
|
11008
|
+
return h(b ? s === "head" ? "Detecting head" : "Detecting face" : "Detecting body pose"), /* @__PURE__ */ A("div", { className: "ps-tryon-sr-right-col", style: { display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ A(
|
|
11011
11009
|
Bi,
|
|
11012
11010
|
{
|
|
11013
|
-
category:
|
|
11011
|
+
category: b ? s : "body",
|
|
11014
11012
|
sizingDone: ae,
|
|
11015
11013
|
t: h
|
|
11016
11014
|
}
|
|
@@ -11021,25 +11019,25 @@ function pi({
|
|
|
11021
11019
|
OA ? E ? (
|
|
11022
11020
|
/* ── Detail view for a single section ── */
|
|
11023
11021
|
(() => {
|
|
11024
|
-
const
|
|
11025
|
-
return
|
|
11022
|
+
const b = XA.find((P) => P.name === E);
|
|
11023
|
+
return b ? Ae ? /* @__PURE__ */ e(_, { children: [
|
|
11026
11024
|
Pe && /* @__PURE__ */ A("div", { style: { padding: "0 16px" }, children: Pe }),
|
|
11027
11025
|
/* @__PURE__ */ A(
|
|
11028
11026
|
_o,
|
|
11029
11027
|
{
|
|
11030
|
-
sectionName:
|
|
11031
|
-
section:
|
|
11032
|
-
sectionResult:
|
|
11033
|
-
sectionFound:
|
|
11034
|
-
userMeasurements:
|
|
11028
|
+
sectionName: b.name,
|
|
11029
|
+
section: b.section,
|
|
11030
|
+
sectionResult: b.secResult,
|
|
11031
|
+
sectionFound: b.secResult?.found,
|
|
11032
|
+
userMeasurements: b.userMeasurements,
|
|
11035
11033
|
unitLbl: vA,
|
|
11036
|
-
chartUnit:
|
|
11034
|
+
chartUnit: z,
|
|
11037
11035
|
lengthEntry: (() => {
|
|
11038
|
-
const
|
|
11039
|
-
return
|
|
11036
|
+
const P = pg(b.name, m);
|
|
11037
|
+
return P || b.secResult?.availableLengths?.length > 0 && m.find((K) => K.section.headers.some((EA) => /height|altezza|estatura|\(cm\)/i.test(EA))) || null;
|
|
11040
11038
|
})(),
|
|
11041
|
-
onBack: () =>
|
|
11042
|
-
internationalSizes:
|
|
11039
|
+
onBack: () => G(null),
|
|
11040
|
+
internationalSizes: b.secResult?.internationalSizes,
|
|
11043
11041
|
productImage: v && u ? u : i || a,
|
|
11044
11042
|
productTitle: n,
|
|
11045
11043
|
isMobile: !0,
|
|
@@ -11057,14 +11055,14 @@ function pi({
|
|
|
11057
11055
|
{
|
|
11058
11056
|
lines: ne,
|
|
11059
11057
|
fitRows: (() => {
|
|
11060
|
-
const
|
|
11058
|
+
const P = [...g?.matchDetails || []];
|
|
11061
11059
|
if (g?.sections)
|
|
11062
11060
|
for (const K of Object.values(g.sections))
|
|
11063
|
-
K.matchDetails &&
|
|
11064
|
-
const
|
|
11065
|
-
return
|
|
11061
|
+
K.matchDetails && P.push(...K.matchDetails);
|
|
11062
|
+
const F = /* @__PURE__ */ new Set();
|
|
11063
|
+
return P.filter((K) => {
|
|
11066
11064
|
const EA = K.measurement.toLowerCase();
|
|
11067
|
-
return
|
|
11065
|
+
return F.has(EA) ? !1 : (F.add(EA), !0);
|
|
11068
11066
|
}).map((K) => ({ area: K.measurement, userNum: parseFloat(K.userValue) || 0, chartLabel: K.chartRange || "", fit: K.fit }));
|
|
11069
11067
|
})(),
|
|
11070
11068
|
show: Z,
|
|
@@ -11073,7 +11071,7 @@ function pi({
|
|
|
11073
11071
|
}
|
|
11074
11072
|
) : null,
|
|
11075
11073
|
t: h,
|
|
11076
|
-
allSizes:
|
|
11074
|
+
allSizes: b.secResult?.allSizes ?? g?.allSizes
|
|
11077
11075
|
}
|
|
11078
11076
|
)
|
|
11079
11077
|
] }) : /* @__PURE__ */ e("div", { className: "ps-tryon-v2", children: [
|
|
@@ -11095,23 +11093,23 @@ function pi({
|
|
|
11095
11093
|
/* @__PURE__ */ A(
|
|
11096
11094
|
_o,
|
|
11097
11095
|
{
|
|
11098
|
-
sectionName:
|
|
11099
|
-
section:
|
|
11100
|
-
sectionResult:
|
|
11101
|
-
sectionFound:
|
|
11102
|
-
userMeasurements:
|
|
11096
|
+
sectionName: b.name,
|
|
11097
|
+
section: b.section,
|
|
11098
|
+
sectionResult: b.secResult,
|
|
11099
|
+
sectionFound: b.secResult?.found,
|
|
11100
|
+
userMeasurements: b.userMeasurements,
|
|
11103
11101
|
unitLbl: vA,
|
|
11104
|
-
chartUnit:
|
|
11102
|
+
chartUnit: z,
|
|
11105
11103
|
lengthEntry: (() => {
|
|
11106
|
-
const
|
|
11107
|
-
return
|
|
11104
|
+
const P = pg(b.name, m);
|
|
11105
|
+
return P || b.secResult?.availableLengths?.length > 0 && m.find((K) => K.section.headers.some((EA) => /height|altezza|estatura|\(cm\)/i.test(EA))) || null;
|
|
11108
11106
|
})(),
|
|
11109
|
-
onBack: () =>
|
|
11110
|
-
internationalSizes:
|
|
11107
|
+
onBack: () => G(null),
|
|
11108
|
+
internationalSizes: b.secResult?.internationalSizes,
|
|
11111
11109
|
tryOnProcessing: v,
|
|
11112
11110
|
tryOnStartedAt: l,
|
|
11113
11111
|
t: h,
|
|
11114
|
-
allSizes:
|
|
11112
|
+
allSizes: b.secResult?.allSizes ?? g?.allSizes
|
|
11115
11113
|
}
|
|
11116
11114
|
)
|
|
11117
11115
|
] }, `detail-${E}`)
|
|
@@ -11126,12 +11124,12 @@ function pi({
|
|
|
11126
11124
|
productTitle: n,
|
|
11127
11125
|
sizingResult: g,
|
|
11128
11126
|
sizeGuide: t,
|
|
11129
|
-
sectionEntries: XA.map(({ name:
|
|
11130
|
-
const
|
|
11131
|
-
return { name:
|
|
11127
|
+
sectionEntries: XA.map(({ name: b, secResult: P }) => {
|
|
11128
|
+
const F = P?.size || P.recommendedSize || "";
|
|
11129
|
+
return { name: b, secResult: { ...P, recommendedSize: q(b, F) } };
|
|
11132
11130
|
}),
|
|
11133
11131
|
pendingCustomSizes: zA,
|
|
11134
|
-
onSelectSection: (
|
|
11132
|
+
onSelectSection: (b) => G(b),
|
|
11135
11133
|
onTryOn: () => {
|
|
11136
11134
|
y(I || null), RA(!0);
|
|
11137
11135
|
},
|
|
@@ -11140,7 +11138,7 @@ function pi({
|
|
|
11140
11138
|
resultImageUrl: i,
|
|
11141
11139
|
tryOnDone: !!i && !v,
|
|
11142
11140
|
onTryAgain: () => {
|
|
11143
|
-
|
|
11141
|
+
U?.(), y(I || null), RA(!0);
|
|
11144
11142
|
},
|
|
11145
11143
|
onClose: T,
|
|
11146
11144
|
showLines: Z,
|
|
@@ -11151,15 +11149,15 @@ function pi({
|
|
|
11151
11149
|
{
|
|
11152
11150
|
lines: ne,
|
|
11153
11151
|
fitRows: (() => {
|
|
11154
|
-
const
|
|
11152
|
+
const b = [...g?.matchDetails || []];
|
|
11155
11153
|
if (g?.sections)
|
|
11156
|
-
for (const
|
|
11157
|
-
|
|
11158
|
-
const
|
|
11159
|
-
return
|
|
11160
|
-
const K =
|
|
11161
|
-
return
|
|
11162
|
-
}).map((
|
|
11154
|
+
for (const F of Object.values(g.sections))
|
|
11155
|
+
F.matchDetails && b.push(...F.matchDetails);
|
|
11156
|
+
const P = /* @__PURE__ */ new Set();
|
|
11157
|
+
return b.filter((F) => {
|
|
11158
|
+
const K = F.measurement.toLowerCase();
|
|
11159
|
+
return P.has(K) ? !1 : (P.add(K), !0);
|
|
11160
|
+
}).map((F) => ({ area: F.measurement, userNum: parseFloat(F.userValue) || 0, chartLabel: F.chartRange || "", fit: F.fit }));
|
|
11163
11161
|
})(),
|
|
11164
11162
|
show: Z,
|
|
11165
11163
|
imgWidth: jA.w,
|
|
@@ -11177,15 +11175,15 @@ function pi({
|
|
|
11177
11175
|
v && /* @__PURE__ */ A(Io, { tryOnStartedAt: l ?? null, t: h }),
|
|
11178
11176
|
/* @__PURE__ */ A($o, { active: !!v }),
|
|
11179
11177
|
i && !v && dA && ne && /* @__PURE__ */ A(zo, { lines: ne, fitRows: (() => {
|
|
11180
|
-
const
|
|
11178
|
+
const b = [...g?.matchDetails || []];
|
|
11181
11179
|
if (g?.sections)
|
|
11182
|
-
for (const
|
|
11183
|
-
|
|
11184
|
-
const
|
|
11185
|
-
return
|
|
11186
|
-
const K =
|
|
11187
|
-
return
|
|
11188
|
-
}).map((
|
|
11180
|
+
for (const F of Object.values(g.sections))
|
|
11181
|
+
F.matchDetails && b.push(...F.matchDetails);
|
|
11182
|
+
const P = /* @__PURE__ */ new Set();
|
|
11183
|
+
return b.filter((F) => {
|
|
11184
|
+
const K = F.measurement.toLowerCase();
|
|
11185
|
+
return P.has(K) ? !1 : (P.add(K), !0);
|
|
11186
|
+
}).map((F) => ({ area: F.measurement, userNum: parseFloat(F.userValue) || 0, chartLabel: F.chartRange || "", fit: F.fit }));
|
|
11189
11187
|
})(), show: Z, imgWidth: jA.w, imgHeight: jA.h }),
|
|
11190
11188
|
i && !v && /* @__PURE__ */ e("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
11191
11189
|
!PA && /* @__PURE__ */ e("button", { className: "ps-tryon-sr-glass-btn", onClick: () => me(!Z), children: [
|
|
@@ -11212,13 +11210,13 @@ function pi({
|
|
|
11212
11210
|
/* @__PURE__ */ A("p", { className: "ps-tryon-v2-subtitle", children: h("Tap any section for detailed breakdown") }),
|
|
11213
11211
|
Pe,
|
|
11214
11212
|
/* @__PURE__ */ A("div", { className: "ps-tryon-v2-sep" }),
|
|
11215
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: XA.map(({ name:
|
|
11216
|
-
const K = t?.sectionImages?.[
|
|
11217
|
-
return /* @__PURE__ */ e("button", { className: `ps-tryon-sr-card-v2${$ ? " ps-full" : ""}${Be ? " ps-overridden" : ""}`, onClick: () =>
|
|
11213
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: XA.map(({ name: b, secResult: P }, F) => {
|
|
11214
|
+
const K = t?.sectionImages?.[b], EA = ri(b), $ = F === XA.length - 1 && XA.length % 2 !== 0, lA = P, IA = zA[b], Be = !!IA, Ee = Be ? IA.displayLabel : q(b, lA.size || P.recommendedSize || "");
|
|
11215
|
+
return /* @__PURE__ */ e("button", { className: `ps-tryon-sr-card-v2${$ ? " ps-full" : ""}${Be ? " ps-overridden" : ""}`, onClick: () => G(b), style: { animationDelay: `${F * 0.07}s` }, children: [
|
|
11218
11216
|
/* @__PURE__ */ e("div", { className: "ps-tryon-sr-card-v2-text", children: [
|
|
11219
11217
|
/* @__PURE__ */ e("span", { className: "ps-tryon-sr-card-v2-label", children: [
|
|
11220
11218
|
EA && /* @__PURE__ */ A("img", { src: EA, alt: "", className: "ps-tryon-sr-card-v2-label-icon" }),
|
|
11221
|
-
|
|
11219
|
+
b.replace(/\s*[—–-]\s*.*/g, "")
|
|
11222
11220
|
] }),
|
|
11223
11221
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value", children: lA.found === !1 ? h("No fit") : (() => {
|
|
11224
11222
|
const KA = Ee.indexOf(" / ");
|
|
@@ -11240,8 +11238,8 @@ function pi({
|
|
|
11240
11238
|
/* @__PURE__ */ A("span", { "aria-hidden": "true", children: "›" })
|
|
11241
11239
|
] })
|
|
11242
11240
|
] }),
|
|
11243
|
-
K && /* @__PURE__ */ A("img", { src: K, alt:
|
|
11244
|
-
] },
|
|
11241
|
+
K && /* @__PURE__ */ A("img", { src: K, alt: b, className: "ps-tryon-sr-card-v2-img" })
|
|
11242
|
+
] }, b);
|
|
11245
11243
|
}) }),
|
|
11246
11244
|
/* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginTop: "0.5vw", gap: "0.5vw" }, children: [
|
|
11247
11245
|
/* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: () => Q("body-profile"), type: "button", children: [
|
|
@@ -11293,9 +11291,9 @@ function pi({
|
|
|
11293
11291
|
) : (
|
|
11294
11292
|
/* ── SINGLE-PIECE — rendered via SectionDetailView for visual parity with multi-garment ── */
|
|
11295
11293
|
(() => {
|
|
11296
|
-
const
|
|
11294
|
+
const b = t?.found ? { headers: t.headers || [], rows: t.rows || [], requiredFields: t.requiredFields || [] } : { headers: [], rows: [], requiredFields: [] }, P = { recommendedSize: g?.recommendedSize || "", matchDetails: g?.matchDetails || [] }, F = {};
|
|
11297
11295
|
if (g?.matchDetails)
|
|
11298
|
-
for (const $ of g.matchDetails)
|
|
11296
|
+
for (const $ of g.matchDetails) F[$.measurement.toLowerCase()] = _e($.userValue);
|
|
11299
11297
|
const K = h("Your Fit"), EA = () => {
|
|
11300
11298
|
i || (y(I || null), RA(!0));
|
|
11301
11299
|
};
|
|
@@ -11305,15 +11303,15 @@ function pi({
|
|
|
11305
11303
|
_o,
|
|
11306
11304
|
{
|
|
11307
11305
|
sectionName: K,
|
|
11308
|
-
section:
|
|
11309
|
-
sectionResult:
|
|
11306
|
+
section: b,
|
|
11307
|
+
sectionResult: P,
|
|
11310
11308
|
sectionFound: g?.found,
|
|
11311
|
-
userMeasurements:
|
|
11309
|
+
userMeasurements: F,
|
|
11312
11310
|
unitLbl: vA,
|
|
11313
|
-
chartUnit:
|
|
11311
|
+
chartUnit: z,
|
|
11314
11312
|
lengthEntry: null,
|
|
11315
11313
|
onBack: () => {
|
|
11316
|
-
i &&
|
|
11314
|
+
i && U?.(), Q("body-profile");
|
|
11317
11315
|
},
|
|
11318
11316
|
backLabel: h("Back"),
|
|
11319
11317
|
internationalSizes: g?.internationalSizes,
|
|
@@ -11370,15 +11368,15 @@ function pi({
|
|
|
11370
11368
|
_o,
|
|
11371
11369
|
{
|
|
11372
11370
|
sectionName: K,
|
|
11373
|
-
section:
|
|
11374
|
-
sectionResult:
|
|
11371
|
+
section: b,
|
|
11372
|
+
sectionResult: P,
|
|
11375
11373
|
sectionFound: g?.found,
|
|
11376
|
-
userMeasurements:
|
|
11374
|
+
userMeasurements: F,
|
|
11377
11375
|
unitLbl: vA,
|
|
11378
|
-
chartUnit:
|
|
11376
|
+
chartUnit: z,
|
|
11379
11377
|
lengthEntry: null,
|
|
11380
11378
|
onBack: () => {
|
|
11381
|
-
i ? (
|
|
11379
|
+
i ? (U?.(), Q("body-profile")) : G(null);
|
|
11382
11380
|
},
|
|
11383
11381
|
backLabel: h("Back"),
|
|
11384
11382
|
internationalSizes: g?.internationalSizes,
|
|
@@ -11410,7 +11408,7 @@ function pi({
|
|
|
11410
11408
|
{
|
|
11411
11409
|
className: "ps-bp-back-btn",
|
|
11412
11410
|
onClick: () => {
|
|
11413
|
-
i &&
|
|
11411
|
+
i && U?.(), Q("body-profile");
|
|
11414
11412
|
},
|
|
11415
11413
|
type: "button",
|
|
11416
11414
|
children: [
|
|
@@ -11436,12 +11434,12 @@ function pi({
|
|
|
11436
11434
|
"button",
|
|
11437
11435
|
{
|
|
11438
11436
|
className: `ps-tryon-sr-card-v2 ps-full${zA[K] ? " ps-overridden" : ""}`,
|
|
11439
|
-
onClick: () =>
|
|
11437
|
+
onClick: () => G(K),
|
|
11440
11438
|
type: "button",
|
|
11441
11439
|
children: /* @__PURE__ */ e("div", { className: "ps-tryon-sr-card-v2-text", children: [
|
|
11442
11440
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-label", children: K }),
|
|
11443
11441
|
(() => {
|
|
11444
|
-
const $ = zA[K]?.displayLabel ||
|
|
11442
|
+
const $ = zA[K]?.displayLabel || P.recommendedSize || "—", lA = $.length > 12;
|
|
11445
11443
|
return /* @__PURE__ */ A("span", { className: `ps-tryon-sr-card-v2-value${lA ? " ps-long" : ""}`, children: $ });
|
|
11446
11444
|
})(),
|
|
11447
11445
|
/* @__PURE__ */ A(
|
|
@@ -11466,7 +11464,7 @@ function pi({
|
|
|
11466
11464
|
{
|
|
11467
11465
|
className: "ps-bp-back-btn",
|
|
11468
11466
|
onClick: () => {
|
|
11469
|
-
i &&
|
|
11467
|
+
i && U?.(), Q("body-profile");
|
|
11470
11468
|
},
|
|
11471
11469
|
type: "button",
|
|
11472
11470
|
children: [
|
|
@@ -11520,14 +11518,14 @@ function pi({
|
|
|
11520
11518
|
type: "file",
|
|
11521
11519
|
accept: "image/jpeg,image/png,image/webp",
|
|
11522
11520
|
style: { display: "none" },
|
|
11523
|
-
onChange: (
|
|
11524
|
-
const
|
|
11525
|
-
|
|
11521
|
+
onChange: (b) => {
|
|
11522
|
+
const P = b.target.files?.[0];
|
|
11523
|
+
P && y(P);
|
|
11526
11524
|
}
|
|
11527
11525
|
}
|
|
11528
11526
|
),
|
|
11529
|
-
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: FA &&
|
|
11530
|
-
/* @__PURE__ */ A("img", { src:
|
|
11527
|
+
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: FA && QA ? /* @__PURE__ */ e(_, { children: [
|
|
11528
|
+
/* @__PURE__ */ A("img", { src: QA, alt: h("Your photo"), className: "ps-pm-preview-img" }),
|
|
11531
11529
|
/* @__PURE__ */ A(
|
|
11532
11530
|
"button",
|
|
11533
11531
|
{
|
|
@@ -11586,7 +11584,7 @@ function pi({
|
|
|
11586
11584
|
className: "ps-pm-primary-btn",
|
|
11587
11585
|
disabled: !FA,
|
|
11588
11586
|
onClick: () => {
|
|
11589
|
-
FA && (M(FA),
|
|
11587
|
+
FA && (M(FA), Y(FA), RA(!1));
|
|
11590
11588
|
},
|
|
11591
11589
|
children: h("START TRY-ON")
|
|
11592
11590
|
}
|
|
@@ -11618,14 +11616,14 @@ function pi({
|
|
|
11618
11616
|
"div",
|
|
11619
11617
|
{
|
|
11620
11618
|
onClick: () => J.current?.click(),
|
|
11621
|
-
onDragOver: (
|
|
11622
|
-
|
|
11619
|
+
onDragOver: (b) => {
|
|
11620
|
+
b.preventDefault(), CA(!0);
|
|
11623
11621
|
},
|
|
11624
11622
|
onDragLeave: () => CA(!1),
|
|
11625
|
-
onDrop: (
|
|
11626
|
-
|
|
11627
|
-
const
|
|
11628
|
-
|
|
11623
|
+
onDrop: (b) => {
|
|
11624
|
+
b.preventDefault(), CA(!1);
|
|
11625
|
+
const P = b.dataTransfer.files[0];
|
|
11626
|
+
P && y(P);
|
|
11629
11627
|
},
|
|
11630
11628
|
style: {
|
|
11631
11629
|
flex: 1,
|
|
@@ -11642,8 +11640,8 @@ function pi({
|
|
|
11642
11640
|
},
|
|
11643
11641
|
className: "ps-tryon-upload-hover",
|
|
11644
11642
|
children: [
|
|
11645
|
-
FA &&
|
|
11646
|
-
/* @__PURE__ */ A("img", { src:
|
|
11643
|
+
FA && QA ? /* @__PURE__ */ e(_, { children: [
|
|
11644
|
+
/* @__PURE__ */ A("img", { src: QA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
11647
11645
|
/* @__PURE__ */ A("div", { className: "ps-tryon-upload-hover-overlay", style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(0,0,0,0.4)", opacity: 0, transition: "opacity 0.2s", borderRadius: "0.5vw" }, children: /* @__PURE__ */ A("span", { style: { color: "#fff", fontSize: "0.8vw", fontWeight: 600 }, children: h("Click to change photo") }) })
|
|
11648
11646
|
] }) : /* @__PURE__ */ e(_, { children: [
|
|
11649
11647
|
/* @__PURE__ */ A(So, { size: 32 }),
|
|
@@ -11657,9 +11655,9 @@ function pi({
|
|
|
11657
11655
|
type: "file",
|
|
11658
11656
|
accept: "image/jpeg,image/png,image/webp",
|
|
11659
11657
|
style: { display: "none" },
|
|
11660
|
-
onChange: (
|
|
11661
|
-
const
|
|
11662
|
-
|
|
11658
|
+
onChange: (b) => {
|
|
11659
|
+
const P = b.target.files?.[0];
|
|
11660
|
+
P && y(P);
|
|
11663
11661
|
}
|
|
11664
11662
|
}
|
|
11665
11663
|
)
|
|
@@ -11746,7 +11744,7 @@ function pi({
|
|
|
11746
11744
|
h("Back")
|
|
11747
11745
|
] }),
|
|
11748
11746
|
/* @__PURE__ */ e("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, disabled: !FA, onClick: () => {
|
|
11749
|
-
FA && (M(FA),
|
|
11747
|
+
FA && (M(FA), Y(FA), RA(!1));
|
|
11750
11748
|
}, children: [
|
|
11751
11749
|
/* @__PURE__ */ A(to, { size: 14 }),
|
|
11752
11750
|
" ",
|
|
@@ -11759,11 +11757,11 @@ function pi({
|
|
|
11759
11757
|
/* @__PURE__ */ A("h4", { children: h("Full Size Chart") }),
|
|
11760
11758
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => Ie(!1), children: "✕" })
|
|
11761
11759
|
] }),
|
|
11762
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: t.sections && Object.keys(t.sections).length > 1 ? Object.entries(t.sections).map(([
|
|
11763
|
-
const K = g?.sections?.[
|
|
11760
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: t.sections && Object.keys(t.sections).length > 1 ? Object.entries(t.sections).map(([b, P]) => {
|
|
11761
|
+
const K = g?.sections?.[b]?.recommendedSize || "", EA = P.headers.findIndex((IA) => /size|taglia|größe|taille|fit|length/i.test(IA.trim())), $ = EA >= 0 ? EA : 0, lA = P.headers[$] || "Size";
|
|
11764
11762
|
return /* @__PURE__ */ e("div", { className: "ps-tryon-chart-section", children: [
|
|
11765
11763
|
/* @__PURE__ */ e("div", { className: "ps-tryon-chart-section-title", children: [
|
|
11766
|
-
/* @__PURE__ */ A("span", { children:
|
|
11764
|
+
/* @__PURE__ */ A("span", { children: b }),
|
|
11767
11765
|
K && /* @__PURE__ */ e("span", { className: "ps-tryon-chart-section-rec", children: [
|
|
11768
11766
|
h("Your size"),
|
|
11769
11767
|
": ",
|
|
@@ -11771,20 +11769,20 @@ function pi({
|
|
|
11771
11769
|
] })
|
|
11772
11770
|
] }),
|
|
11773
11771
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ e("table", { className: "ps-tryon-sr-chart-table", children: [
|
|
11774
|
-
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children:
|
|
11775
|
-
/* @__PURE__ */ A("tbody", { children:
|
|
11772
|
+
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: P.headers.map((IA, Be) => /* @__PURE__ */ A("th", { className: Be === $ ? "ps-size-col" : "", children: IA }, Be)) }) }),
|
|
11773
|
+
/* @__PURE__ */ A("tbody", { children: P.rows.map((IA, Be) => {
|
|
11776
11774
|
const KA = Te(IA, $, lA) === K;
|
|
11777
|
-
return /* @__PURE__ */ A("tr", { className: KA ? "ps-active-row" : "", children:
|
|
11775
|
+
return /* @__PURE__ */ A("tr", { className: KA ? "ps-active-row" : "", children: P.headers.map((D, W) => /* @__PURE__ */ A("td", { className: W === $ ? "ps-size-col" : "", children: Te(IA, W, D) }, W)) }, Be);
|
|
11778
11776
|
}) })
|
|
11779
11777
|
] }) })
|
|
11780
|
-
] },
|
|
11778
|
+
] }, b);
|
|
11781
11779
|
}) : t.headers && t.rows ? (
|
|
11782
11780
|
/* Single section fallback */
|
|
11783
11781
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ e("table", { className: "ps-tryon-sr-chart-table", children: [
|
|
11784
|
-
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: t.headers.map((
|
|
11785
|
-
/* @__PURE__ */ A("tbody", { children: t.rows.map((
|
|
11786
|
-
const K = iA(
|
|
11787
|
-
return /* @__PURE__ */ A("tr", { className: K ? "ps-active-row" : "", children: t.headers.map((EA, $) => /* @__PURE__ */ A("td", { className: $ === YA ? "ps-size-col" : "", children: iA(
|
|
11782
|
+
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: t.headers.map((b, P) => /* @__PURE__ */ A("th", { className: P === YA ? "ps-size-col" : "", children: b }, P)) }) }),
|
|
11783
|
+
/* @__PURE__ */ A("tbody", { children: t.rows.map((b, P) => {
|
|
11784
|
+
const K = iA(b, YA, VA) === GA;
|
|
11785
|
+
return /* @__PURE__ */ A("tr", { className: K ? "ps-active-row" : "", children: t.headers.map((EA, $) => /* @__PURE__ */ A("td", { className: $ === YA ? "ps-size-col" : "", children: iA(b, $, EA) }, $)) }, P);
|
|
11788
11786
|
}) })
|
|
11789
11787
|
] }) })
|
|
11790
11788
|
) : null })
|
|
@@ -11864,35 +11862,35 @@ function Sg({
|
|
|
11864
11862
|
onClearPhoto: Q,
|
|
11865
11863
|
t: C
|
|
11866
11864
|
}) {
|
|
11867
|
-
const I =
|
|
11865
|
+
const I = hA(null), u = hA(0), [M, L] = f(!1), [Y, v] = f(!1), [l, R] = f(""), [V, s] = f(null), [x, E] = f(null);
|
|
11868
11866
|
xA(() => {
|
|
11869
11867
|
t || (s(null), E(null));
|
|
11870
11868
|
}, [t]);
|
|
11871
|
-
const
|
|
11872
|
-
if (!(c ||
|
|
11869
|
+
const G = async (z) => {
|
|
11870
|
+
if (!(c || Y)) {
|
|
11873
11871
|
if (E(null), s(null), i && a !== !0) {
|
|
11874
11872
|
E(C("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
11875
11873
|
return;
|
|
11876
11874
|
}
|
|
11877
|
-
if (!
|
|
11875
|
+
if (!z.type.startsWith("image/")) {
|
|
11878
11876
|
E(C("Please upload an image file"));
|
|
11879
11877
|
return;
|
|
11880
11878
|
}
|
|
11881
|
-
if (
|
|
11879
|
+
if (z.size > 10 * 1024 * 1024) {
|
|
11882
11880
|
E(C("Image must be under 10MB"));
|
|
11883
11881
|
return;
|
|
11884
11882
|
}
|
|
11885
11883
|
if (o && g) {
|
|
11886
11884
|
v(!0), R(C("Analyzing photo…"));
|
|
11887
11885
|
try {
|
|
11888
|
-
const vA = await tg(
|
|
11886
|
+
const vA = await tg(z, o, g);
|
|
11889
11887
|
if (!vA.isAdult) {
|
|
11890
11888
|
const S = vA.reasoning?.trim() || C("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
|
|
11891
11889
|
s(S), v(!1), R("");
|
|
11892
11890
|
return;
|
|
11893
11891
|
}
|
|
11894
11892
|
try {
|
|
11895
|
-
await uo(
|
|
11893
|
+
await uo(z, { maxDimension: 1024, quality: 0.85 });
|
|
11896
11894
|
} catch {
|
|
11897
11895
|
}
|
|
11898
11896
|
} catch {
|
|
@@ -11900,23 +11898,23 @@ function Sg({
|
|
|
11900
11898
|
v(!1), R("");
|
|
11901
11899
|
}
|
|
11902
11900
|
}
|
|
11903
|
-
p(
|
|
11901
|
+
p(z);
|
|
11904
11902
|
}
|
|
11905
|
-
},
|
|
11906
|
-
c ||
|
|
11907
|
-
}, T = (
|
|
11908
|
-
|
|
11909
|
-
}, aA = (
|
|
11910
|
-
|
|
11911
|
-
}, X = (
|
|
11912
|
-
|
|
11913
|
-
}, UA = (
|
|
11914
|
-
if (
|
|
11915
|
-
const vA =
|
|
11916
|
-
vA &&
|
|
11917
|
-
}, LA = (
|
|
11918
|
-
const vA =
|
|
11919
|
-
vA &&
|
|
11903
|
+
}, U = () => {
|
|
11904
|
+
c || Y || I.current?.click();
|
|
11905
|
+
}, T = (z) => {
|
|
11906
|
+
z.preventDefault(), z.stopPropagation(), !(c || Y) && (u.current += 1, L(!0));
|
|
11907
|
+
}, aA = (z) => {
|
|
11908
|
+
z.preventDefault(), z.stopPropagation(), z.dataTransfer && (z.dataTransfer.dropEffect = "copy");
|
|
11909
|
+
}, X = (z) => {
|
|
11910
|
+
z.preventDefault(), z.stopPropagation(), u.current = Math.max(0, u.current - 1), u.current === 0 && L(!1);
|
|
11911
|
+
}, UA = (z) => {
|
|
11912
|
+
if (z.preventDefault(), z.stopPropagation(), u.current = 0, L(!1), c || Y) return;
|
|
11913
|
+
const vA = z.dataTransfer?.files?.[0];
|
|
11914
|
+
vA && G(vA);
|
|
11915
|
+
}, LA = (z) => {
|
|
11916
|
+
const vA = z.target.files?.[0];
|
|
11917
|
+
vA && G(vA), I.current && (I.current.value = "");
|
|
11920
11918
|
}, h = () => {
|
|
11921
11919
|
s(null), E(null), Q?.();
|
|
11922
11920
|
};
|
|
@@ -11924,7 +11922,7 @@ function Sg({
|
|
|
11924
11922
|
"div",
|
|
11925
11923
|
{
|
|
11926
11924
|
className: `ps-photo-zone${M ? " ps-photo-zone-drag" : ""}${r === "inline" ? " ps-photo-zone-inline" : ""}${t ? " ps-photo-zone-has" : ""}`,
|
|
11927
|
-
onClick: t ? void 0 :
|
|
11925
|
+
onClick: t ? void 0 : U,
|
|
11928
11926
|
onDragEnter: T,
|
|
11929
11927
|
onDragOver: aA,
|
|
11930
11928
|
onDragLeave: X,
|
|
@@ -11942,14 +11940,14 @@ function Sg({
|
|
|
11942
11940
|
),
|
|
11943
11941
|
t && !V && /* @__PURE__ */ e(_, { children: [
|
|
11944
11942
|
/* @__PURE__ */ A("img", { src: t, alt: C("Your photo"), className: "ps-photo-zone-img" }),
|
|
11945
|
-
/* @__PURE__ */ A("div", { className: "ps-photo-zone-hover-overlay", onClick:
|
|
11943
|
+
/* @__PURE__ */ A("div", { className: "ps-photo-zone-hover-overlay", onClick: U, title: C("Click to change photo"), children: /* @__PURE__ */ A("span", { children: C("Click to change photo") }) }),
|
|
11946
11944
|
Q && /* @__PURE__ */ A(
|
|
11947
11945
|
"button",
|
|
11948
11946
|
{
|
|
11949
11947
|
type: "button",
|
|
11950
11948
|
className: "ps-photo-zone-remove",
|
|
11951
|
-
onClick: (
|
|
11952
|
-
|
|
11949
|
+
onClick: (z) => {
|
|
11950
|
+
z.stopPropagation(), h();
|
|
11953
11951
|
},
|
|
11954
11952
|
"aria-label": C("Remove photo"),
|
|
11955
11953
|
children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
@@ -11959,17 +11957,17 @@ function Sg({
|
|
|
11959
11957
|
}
|
|
11960
11958
|
)
|
|
11961
11959
|
] }),
|
|
11962
|
-
!t && !V && !
|
|
11960
|
+
!t && !V && !Y && /* @__PURE__ */ e("div", { className: "ps-photo-zone-empty", children: [
|
|
11963
11961
|
/* @__PURE__ */ A(So, { size: 32 }),
|
|
11964
11962
|
/* @__PURE__ */ A("span", { className: "ps-photo-zone-title", children: w || C("Upload your photo") }),
|
|
11965
11963
|
n && /* @__PURE__ */ A("span", { className: "ps-photo-zone-hint", children: n }),
|
|
11966
11964
|
/* @__PURE__ */ A("span", { className: "ps-photo-zone-hint", children: C("JPEG, PNG up to 10MB · click or drop") })
|
|
11967
11965
|
] }),
|
|
11968
|
-
|
|
11966
|
+
Y && /* @__PURE__ */ e("div", { className: "ps-photo-zone-processing", children: [
|
|
11969
11967
|
/* @__PURE__ */ A("div", { className: "ps-photo-zone-spinner" }),
|
|
11970
11968
|
/* @__PURE__ */ A("span", { className: "ps-photo-zone-status", children: l })
|
|
11971
11969
|
] }),
|
|
11972
|
-
V && /* @__PURE__ */ e("div", { className: "ps-photo-zone-rejection", onClick: (
|
|
11970
|
+
V && /* @__PURE__ */ e("div", { className: "ps-photo-zone-rejection", onClick: (z) => z.stopPropagation(), children: [
|
|
11973
11971
|
/* @__PURE__ */ A("div", { className: "ps-photo-zone-rejection-icon", "aria-hidden": "true", children: "!" }),
|
|
11974
11972
|
/* @__PURE__ */ A("div", { className: "ps-photo-zone-rejection-title", children: C("Different photo needed") }),
|
|
11975
11973
|
/* @__PURE__ */ A("div", { className: "ps-photo-zone-rejection-msg", children: V }),
|
|
@@ -11985,7 +11983,7 @@ function Sg({
|
|
|
11985
11983
|
}
|
|
11986
11984
|
)
|
|
11987
11985
|
] }),
|
|
11988
|
-
|
|
11986
|
+
x && !V && /* @__PURE__ */ A("div", { className: "ps-photo-zone-error", onClick: (z) => z.stopPropagation(), children: x })
|
|
11989
11987
|
]
|
|
11990
11988
|
}
|
|
11991
11989
|
);
|
|
@@ -12196,18 +12194,18 @@ function Di({
|
|
|
12196
12194
|
cn: C,
|
|
12197
12195
|
t: I
|
|
12198
12196
|
}) {
|
|
12199
|
-
const u = bA((
|
|
12200
|
-
t.current =
|
|
12201
|
-
}, []), M = bA((
|
|
12202
|
-
i.current =
|
|
12203
|
-
}, []), L = bA((
|
|
12204
|
-
a.current =
|
|
12205
|
-
}, []),
|
|
12206
|
-
c.current =
|
|
12207
|
-
}, []), v = bA((
|
|
12208
|
-
if (n.current =
|
|
12197
|
+
const u = bA((U) => {
|
|
12198
|
+
t.current = U, U && (U.style.width = `${Math.round(g.current)}%`);
|
|
12199
|
+
}, []), M = bA((U) => {
|
|
12200
|
+
i.current = U, U && (U.textContent = `${Math.round(g.current)}%`);
|
|
12201
|
+
}, []), L = bA((U) => {
|
|
12202
|
+
a.current = U;
|
|
12203
|
+
}, []), Y = bA((U) => {
|
|
12204
|
+
c.current = U;
|
|
12205
|
+
}, []), v = bA((U) => {
|
|
12206
|
+
if (n.current = U, U) {
|
|
12209
12207
|
const T = dg * (1 - Math.round(g.current) / 100);
|
|
12210
|
-
|
|
12208
|
+
U.style.strokeDashoffset = String(T);
|
|
12211
12209
|
}
|
|
12212
12210
|
}, []), l = [
|
|
12213
12211
|
I("Our model is analyzing 150+ body landmarks for the perfect fit"),
|
|
@@ -12215,16 +12213,16 @@ function Di({
|
|
|
12215
12213
|
I("Cross-checking fit against millions of garment patterns"),
|
|
12216
12214
|
I("Rendering shadows and highlights to match your photo's lighting")
|
|
12217
12215
|
], R = (() => {
|
|
12218
|
-
const
|
|
12219
|
-
return [
|
|
12220
|
-
})(), [V, s] = f(0), [
|
|
12216
|
+
const U = I("Pair this with neutral tones for a balanced look"), T = I("Layer with a fitted base for sharper silhouette"), aA = I("Cuff once for a relaxed everyday feel");
|
|
12217
|
+
return [U, T, aA];
|
|
12218
|
+
})(), [V, s] = f(0), [x, E] = f(0);
|
|
12221
12219
|
xA(() => {
|
|
12222
|
-
const
|
|
12220
|
+
const U = setInterval(() => s((aA) => (aA + 1) % l.length), 4e3), T = setInterval(() => E((aA) => (aA + 1) % R.length), 5e3);
|
|
12223
12221
|
return () => {
|
|
12224
|
-
clearInterval(
|
|
12222
|
+
clearInterval(U), clearInterval(T);
|
|
12225
12223
|
};
|
|
12226
12224
|
}, []);
|
|
12227
|
-
const
|
|
12225
|
+
const G = r?.trim() || (p?.trim() ? p.trim().slice(0, 90) + (p.trim().length > 90 ? "…" : "") : null) || I("Crafted with quality materials for everyday comfort");
|
|
12228
12226
|
return /* @__PURE__ */ e("div", { className: "ps-tryon-processing-v2", children: [
|
|
12229
12227
|
/* @__PURE__ */ e("div", { className: "ps-tryon-processing-v2-image", children: [
|
|
12230
12228
|
o && /* @__PURE__ */ e(_, { children: [
|
|
@@ -12266,7 +12264,7 @@ function Di({
|
|
|
12266
12264
|
] }),
|
|
12267
12265
|
/* @__PURE__ */ e("div", { className: "ps-tryon-processing-v2-bar-hidden", children: [
|
|
12268
12266
|
/* @__PURE__ */ A("div", { ref: u }),
|
|
12269
|
-
/* @__PURE__ */ A("span", { ref:
|
|
12267
|
+
/* @__PURE__ */ A("span", { ref: Y })
|
|
12270
12268
|
] }),
|
|
12271
12269
|
/* @__PURE__ */ A("div", { className: "ps-tryon-processing-v2-sep" }),
|
|
12272
12270
|
/* @__PURE__ */ e("div", { className: "ps-tryon-processing-v2-section", children: [
|
|
@@ -12276,7 +12274,7 @@ function Di({
|
|
|
12276
12274
|
/* @__PURE__ */ A("div", { className: "ps-tryon-processing-v2-card-icon ps-style", children: /* @__PURE__ */ A("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ A("path", { d: "M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7c1 .9 1 1.8 1 2.3v1h6v-1c0-.5 0-1.4 1-2.3A7 7 0 0 0 12 2z" }) }) }),
|
|
12277
12275
|
/* @__PURE__ */ e("div", { className: "ps-tryon-processing-v2-card-text", children: [
|
|
12278
12276
|
/* @__PURE__ */ A("div", { className: "ps-tryon-processing-v2-card-head", children: I("Style Tip") }),
|
|
12279
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-processing-v2-card-body", children: R[
|
|
12277
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-processing-v2-card-body", children: R[x] }, x)
|
|
12280
12278
|
] })
|
|
12281
12279
|
] }),
|
|
12282
12280
|
/* @__PURE__ */ e("div", { className: "ps-tryon-processing-v2-card", children: [
|
|
@@ -12287,7 +12285,7 @@ function Di({
|
|
|
12287
12285
|
] }) }),
|
|
12288
12286
|
/* @__PURE__ */ e("div", { className: "ps-tryon-processing-v2-card-text", children: [
|
|
12289
12287
|
/* @__PURE__ */ A("div", { className: "ps-tryon-processing-v2-card-head", children: I("Garment Spotlight") }),
|
|
12290
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-processing-v2-card-body", children:
|
|
12288
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-processing-v2-card-body", children: G })
|
|
12291
12289
|
] })
|
|
12292
12290
|
] }),
|
|
12293
12291
|
/* @__PURE__ */ e("div", { className: "ps-tryon-processing-v2-card", children: [
|
|
@@ -12465,11 +12463,11 @@ function Ag({
|
|
|
12465
12463
|
] }, o);
|
|
12466
12464
|
}
|
|
12467
12465
|
function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, onEstimate: c, t: n }) {
|
|
12468
|
-
const [w, r] = f(null), [p, Q] = f("identity"), [C, I] = f("name-photo"), [u, M] = f(!1), [L,
|
|
12466
|
+
const [w, r] = f(null), [p, Q] = f("identity"), [C, I] = f("name-photo"), [u, M] = f(!1), [L, Y] = f(null), v = hA(null);
|
|
12469
12467
|
xA(() => {
|
|
12470
12468
|
v.current && (v.current.scrollTop = 0);
|
|
12471
12469
|
}, [w, p]);
|
|
12472
|
-
const [l, R] = f(""), [V, s] = f("male"), [
|
|
12470
|
+
const [l, R] = f(""), [V, s] = f("male"), [x, E] = f("cm"), [G, U] = f(""), [T, aA] = f(""), [X, UA] = f(""), [LA, h] = f(""), [oA, z] = f(""), [vA, S] = f(""), [nA, MA] = f(null), [iA, YA] = f(!1), [VA, HA] = f(""), [pe, _A] = f(null), [yA, oe] = f(null), [SA, Ce] = f({ w: 800, h: 1200 }), [mA, Ie] = f(0), [Z, me] = f(!1), [fe, Ye] = f(!1);
|
|
12473
12471
|
xA(() => {
|
|
12474
12472
|
if (C !== "calculating" || !nA) return;
|
|
12475
12473
|
let D = !1;
|
|
@@ -12484,7 +12482,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12484
12482
|
const D = setInterval(() => Ie((W) => W + 1), 1500);
|
|
12485
12483
|
return () => clearInterval(D);
|
|
12486
12484
|
}, [C, u]);
|
|
12487
|
-
const ne =
|
|
12485
|
+
const ne = hA(null), de = hA(null), [dA, ge] = f(!1), [jA, H] = f(null), zA = () => {
|
|
12488
12486
|
jA === !0 && ne.current?.click();
|
|
12489
12487
|
}, he = async (D) => {
|
|
12490
12488
|
const W = D.target.files?.[0];
|
|
@@ -12503,7 +12501,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12503
12501
|
}
|
|
12504
12502
|
S(""), YA(!0), HA(n("Analyzing photo…"));
|
|
12505
12503
|
try {
|
|
12506
|
-
const
|
|
12504
|
+
const fA = t && i ? tg(W, t, i) : Promise.resolve({ isAdult: !0, confidence: "low" }), uA = uo(W), ee = await fA;
|
|
12507
12505
|
if (!ee.isAdult) {
|
|
12508
12506
|
const Me = ee.reasoning?.trim() || n("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
|
|
12509
12507
|
_A(Me);
|
|
@@ -12519,24 +12517,24 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12519
12517
|
}
|
|
12520
12518
|
}, Oe = () => {
|
|
12521
12519
|
MA(null), a?.(null), ne.current && (ne.current.value = "");
|
|
12522
|
-
}, [JA, ke] = f(null), [De, BA] = f(null), [RA, FA] = f(null), [y, gA] = f(null), [CA, J] = f(null), [
|
|
12520
|
+
}, [JA, ke] = f(null), [De, BA] = f(null), [RA, FA] = f(null), [y, gA] = f(null), [CA, J] = f(null), [QA, qA] = f(null), [TA, ve] = f("US"), [GA, OA] = f(null), ie = hA(null);
|
|
12523
12521
|
xA(() => {
|
|
12524
12522
|
if (!GA) return;
|
|
12525
12523
|
const D = (W) => {
|
|
12526
|
-
const
|
|
12527
|
-
|
|
12524
|
+
const fA = ie.current;
|
|
12525
|
+
fA && !fA.contains(W.target) && OA(null);
|
|
12528
12526
|
};
|
|
12529
12527
|
return document.addEventListener("mousedown", D), () => document.removeEventListener("mousedown", D);
|
|
12530
12528
|
}, [GA]);
|
|
12531
|
-
const XA = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"],
|
|
12532
|
-
if (
|
|
12529
|
+
const XA = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], m = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], q = V === "female", kA = q ? WA.female : WA.male, Qe = q ? ["identity", "stomach", "seat", "hips"] : ["identity", "chest", "stomach", "seat"], cA = Qe.indexOf(p), ae = Qe.length, xe = cA === ae - 1, re = () => {
|
|
12530
|
+
if (x === "in") {
|
|
12533
12531
|
const D = parseInt(T, 10), W = parseInt(X, 10);
|
|
12534
|
-
!isNaN(D) && D >= 0 && !isNaN(W) && W >= 0 &&
|
|
12532
|
+
!isNaN(D) && D >= 0 && !isNaN(W) && W >= 0 && U(String(Math.round((D * 12 + W) * 2.54)));
|
|
12535
12533
|
}
|
|
12536
12534
|
E("cm");
|
|
12537
12535
|
}, Ae = () => {
|
|
12538
|
-
if (
|
|
12539
|
-
const D = parseFloat(
|
|
12536
|
+
if (x === "cm") {
|
|
12537
|
+
const D = parseFloat(G);
|
|
12540
12538
|
!isNaN(D) && D > 0 && (aA(String(Math.floor(D / 2.54 / 12))), UA(String(Math.round(D / 2.54 % 12))));
|
|
12541
12539
|
}
|
|
12542
12540
|
E("in");
|
|
@@ -12544,11 +12542,11 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12544
12542
|
if (!l.trim())
|
|
12545
12543
|
return S(n("Please enter a profile name")), !1;
|
|
12546
12544
|
let D;
|
|
12547
|
-
if (
|
|
12545
|
+
if (x === "in") {
|
|
12548
12546
|
const uA = parseInt(T, 10), ee = parseInt(X, 10);
|
|
12549
12547
|
D = !isNaN(uA) && uA > 0 && !isNaN(ee) && ee >= 0 && ee <= 11;
|
|
12550
12548
|
} else {
|
|
12551
|
-
const uA = parseFloat(
|
|
12549
|
+
const uA = parseFloat(G);
|
|
12552
12550
|
D = !isNaN(uA) && uA > 0;
|
|
12553
12551
|
}
|
|
12554
12552
|
if (!D)
|
|
@@ -12556,16 +12554,16 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12556
12554
|
const W = parseFloat(LA);
|
|
12557
12555
|
if (!W || W <= 0)
|
|
12558
12556
|
return S(n("Please enter a valid weight")), !1;
|
|
12559
|
-
const
|
|
12560
|
-
return !
|
|
12557
|
+
const fA = parseFloat(oA);
|
|
12558
|
+
return !fA || fA <= 0 ? (S(n("Please enter a valid age")), !1) : q && (!CA || !QA) ? (S(n("Please select your bra band and cup size")), !1) : (S(""), !0);
|
|
12561
12559
|
}, se = () => l.trim() ? (S(""), !0) : (S(n("Please enter a profile name")), !1), Pe = () => {
|
|
12562
|
-
const D =
|
|
12560
|
+
const D = x === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(G), W = parseFloat(oA);
|
|
12563
12561
|
return {
|
|
12564
12562
|
name: l.trim(),
|
|
12565
12563
|
gender: V,
|
|
12566
|
-
sizingUnit:
|
|
12567
|
-
heightUnit:
|
|
12568
|
-
weightUnit:
|
|
12564
|
+
sizingUnit: x,
|
|
12565
|
+
heightUnit: x,
|
|
12566
|
+
weightUnit: x === "in" ? "lbs" : "kg",
|
|
12569
12567
|
heightCm: D,
|
|
12570
12568
|
weightKg: parseFloat(LA),
|
|
12571
12569
|
height: D,
|
|
@@ -12575,25 +12573,25 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12575
12573
|
midsectionProfile: De || void 0,
|
|
12576
12574
|
hipProfile: q ? y || void 0 : RA || void 0,
|
|
12577
12575
|
bandSize: q && CA || void 0,
|
|
12578
|
-
cupSize: q &&
|
|
12576
|
+
cupSize: q && QA || void 0
|
|
12579
12577
|
};
|
|
12580
|
-
},
|
|
12581
|
-
const D =
|
|
12578
|
+
}, b = () => {
|
|
12579
|
+
const D = x === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(G), W = parseFloat(LA), fA = parseFloat(oA);
|
|
12582
12580
|
return {
|
|
12583
12581
|
name: l.trim(),
|
|
12584
12582
|
gender: V,
|
|
12585
|
-
sizingUnit:
|
|
12586
|
-
heightUnit:
|
|
12587
|
-
weightUnit:
|
|
12583
|
+
sizingUnit: x,
|
|
12584
|
+
heightUnit: x,
|
|
12585
|
+
weightUnit: x === "in" ? "lbs" : "kg",
|
|
12588
12586
|
...D > 0 ? { heightCm: D, height: D } : {},
|
|
12589
12587
|
...W > 0 ? { weightKg: W, weight: W } : {},
|
|
12590
|
-
...
|
|
12588
|
+
...fA > 0 ? { age: fA } : {},
|
|
12591
12589
|
...q && CA ? { bandSize: CA } : {},
|
|
12592
|
-
...q &&
|
|
12593
|
-
...q && CA &&
|
|
12590
|
+
...q && QA ? { cupSize: QA } : {},
|
|
12591
|
+
...q && CA && QA ? { braSizeRegion: TA } : {},
|
|
12594
12592
|
photoBase64: nA || void 0
|
|
12595
12593
|
};
|
|
12596
|
-
},
|
|
12594
|
+
}, P = () => {
|
|
12597
12595
|
if (!(p === "identity" && !PA())) {
|
|
12598
12596
|
if (p === "chest" && !JA) {
|
|
12599
12597
|
S(n("Please pick an option"));
|
|
@@ -12611,7 +12609,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12611
12609
|
S(n("Please pick an option"));
|
|
12612
12610
|
return;
|
|
12613
12611
|
}
|
|
12614
|
-
if (p === "bra" && (!CA || !
|
|
12612
|
+
if (p === "bra" && (!CA || !QA)) {
|
|
12615
12613
|
S(n("Please pick band and cup size"));
|
|
12616
12614
|
return;
|
|
12617
12615
|
}
|
|
@@ -12621,15 +12619,15 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12621
12619
|
}
|
|
12622
12620
|
Q(Qe[cA + 1]);
|
|
12623
12621
|
}
|
|
12624
|
-
},
|
|
12622
|
+
}, F = (D, W) => {
|
|
12625
12623
|
S(""), D === "chest" ? ke(W) : D === "stomach" ? BA(W) : D === "seat" ? FA(W) : D === "hips" && gA(W);
|
|
12626
|
-
const
|
|
12624
|
+
const fA = Qe.indexOf(D), uA = fA === ae - 1;
|
|
12627
12625
|
setTimeout(() => {
|
|
12628
12626
|
if (uA) {
|
|
12629
12627
|
const ee = Pe();
|
|
12630
12628
|
D === "chest" ? ee.chestProfile = W : D === "stomach" ? ee.midsectionProfile = W : (D === "seat" || D === "hips") && (ee.hipProfile = W), o(ee);
|
|
12631
12629
|
} else
|
|
12632
|
-
Q(Qe[
|
|
12630
|
+
Q(Qe[fA + 1]);
|
|
12633
12631
|
}, 220);
|
|
12634
12632
|
}, K = () => {
|
|
12635
12633
|
if (S(""), p === "identity") {
|
|
@@ -12644,15 +12642,15 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12644
12642
|
S(n("Please upload a photo"));
|
|
12645
12643
|
return;
|
|
12646
12644
|
}
|
|
12647
|
-
if (
|
|
12648
|
-
const
|
|
12649
|
-
if (!
|
|
12645
|
+
if (x === "in") {
|
|
12646
|
+
const fA = parseFloat(T);
|
|
12647
|
+
if (!fA || fA < 3 || fA > 8) {
|
|
12650
12648
|
S(n("Please enter a valid height"));
|
|
12651
12649
|
return;
|
|
12652
12650
|
}
|
|
12653
12651
|
} else {
|
|
12654
|
-
const
|
|
12655
|
-
if (!
|
|
12652
|
+
const fA = parseFloat(G);
|
|
12653
|
+
if (!fA || fA < 100 || fA > 250) {
|
|
12656
12654
|
S(n("Please enter a valid height"));
|
|
12657
12655
|
return;
|
|
12658
12656
|
}
|
|
@@ -12662,23 +12660,23 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12662
12660
|
S(n("Please enter a valid weight"));
|
|
12663
12661
|
return;
|
|
12664
12662
|
}
|
|
12665
|
-
if (q && (!CA || !
|
|
12663
|
+
if (q && (!CA || !QA)) {
|
|
12666
12664
|
S(n("Please select your bra band and cup size"));
|
|
12667
12665
|
return;
|
|
12668
12666
|
}
|
|
12669
12667
|
if (S(""), I("calculating"), M(!0), c && nA) {
|
|
12670
|
-
const
|
|
12668
|
+
const fA = x === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(G), uA = parseFloat(oA);
|
|
12671
12669
|
try {
|
|
12672
12670
|
const ee = await c({
|
|
12673
12671
|
photoBase64: nA,
|
|
12674
|
-
height:
|
|
12672
|
+
height: fA || 0,
|
|
12675
12673
|
weight: W || 0,
|
|
12676
|
-
heightUnit:
|
|
12677
|
-
weightUnit:
|
|
12674
|
+
heightUnit: x,
|
|
12675
|
+
weightUnit: x === "in" ? "lbs" : "kg",
|
|
12678
12676
|
gender: V,
|
|
12679
12677
|
...uA > 0 ? { age: uA } : {}
|
|
12680
12678
|
});
|
|
12681
|
-
ee?.estimates &&
|
|
12679
|
+
ee?.estimates && Y(ee.estimates);
|
|
12682
12680
|
} catch {
|
|
12683
12681
|
}
|
|
12684
12682
|
}
|
|
@@ -12689,7 +12687,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12689
12687
|
I("calculating");
|
|
12690
12688
|
return;
|
|
12691
12689
|
}
|
|
12692
|
-
const D =
|
|
12690
|
+
const D = b();
|
|
12693
12691
|
L && (D.measurements = L, D.measurementsUnit = "cm"), o(D);
|
|
12694
12692
|
}, lA = () => {
|
|
12695
12693
|
if (S(""), C === "details") {
|
|
@@ -12782,8 +12780,8 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12782
12780
|
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${V === "female" ? " ps-active" : ""}`, onClick: () => s("female"), children: n("Female") })
|
|
12783
12781
|
] }),
|
|
12784
12782
|
/* @__PURE__ */ e("div", { className: "ps-cpw-pill-group", children: [
|
|
12785
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${
|
|
12786
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${
|
|
12783
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${x === "cm" ? " ps-active" : ""}`, onClick: re, children: "cm" }),
|
|
12784
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${x === "in" ? " ps-active" : ""}`, onClick: Ae, children: "in" })
|
|
12787
12785
|
] })
|
|
12788
12786
|
] }),
|
|
12789
12787
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
@@ -12804,17 +12802,17 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12804
12802
|
] }),
|
|
12805
12803
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
12806
12804
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: n("HEIGHT") }),
|
|
12807
|
-
|
|
12805
|
+
x === "cm" ? /* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
12808
12806
|
/* @__PURE__ */ A(
|
|
12809
12807
|
"input",
|
|
12810
12808
|
{
|
|
12811
12809
|
type: "number",
|
|
12812
12810
|
inputMode: "numeric",
|
|
12813
12811
|
className: "ps-bp-inline-input",
|
|
12814
|
-
value:
|
|
12812
|
+
value: G,
|
|
12815
12813
|
placeholder: n("e.g. 173"),
|
|
12816
12814
|
onChange: (D) => {
|
|
12817
|
-
|
|
12815
|
+
U(D.target.value), S("");
|
|
12818
12816
|
}
|
|
12819
12817
|
}
|
|
12820
12818
|
),
|
|
@@ -12862,13 +12860,13 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12862
12860
|
inputMode: "numeric",
|
|
12863
12861
|
className: "ps-bp-inline-input",
|
|
12864
12862
|
value: LA,
|
|
12865
|
-
placeholder: n(
|
|
12863
|
+
placeholder: n(x === "in" ? "e.g. 154" : "e.g. 70"),
|
|
12866
12864
|
onChange: (D) => {
|
|
12867
12865
|
h(D.target.value), S("");
|
|
12868
12866
|
}
|
|
12869
12867
|
}
|
|
12870
12868
|
),
|
|
12871
|
-
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children:
|
|
12869
|
+
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: x === "in" ? "lbs" : "kg" })
|
|
12872
12870
|
] })
|
|
12873
12871
|
] }),
|
|
12874
12872
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
@@ -12883,7 +12881,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12883
12881
|
value: oA,
|
|
12884
12882
|
placeholder: n("e.g. 30"),
|
|
12885
12883
|
onChange: (D) => {
|
|
12886
|
-
|
|
12884
|
+
z(D.target.value), S("");
|
|
12887
12885
|
}
|
|
12888
12886
|
}
|
|
12889
12887
|
),
|
|
@@ -12927,8 +12925,8 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12927
12925
|
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A(
|
|
12928
12926
|
ho,
|
|
12929
12927
|
{
|
|
12930
|
-
value:
|
|
12931
|
-
options:
|
|
12928
|
+
value: QA,
|
|
12929
|
+
options: m,
|
|
12932
12930
|
placeholder: "—",
|
|
12933
12931
|
isOpen: GA === "cup",
|
|
12934
12932
|
onToggle: () => OA(GA === "cup" ? null : "cup"),
|
|
@@ -12949,9 +12947,9 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12949
12947
|
title: n("CHEST PROFILE"),
|
|
12950
12948
|
subtitle: n("Select the profile that best matches your chest breadth"),
|
|
12951
12949
|
children: [
|
|
12952
|
-
/* @__PURE__ */ A(Se, { img: kA.chest?.narrow ?? null, label: n("NARROW"), selected: JA === "narrow", onSelect: () =>
|
|
12953
|
-
/* @__PURE__ */ A(Se, { img: kA.chest?.average ?? null, label: n("AVERAGE"), selected: JA === "average", onSelect: () =>
|
|
12954
|
-
/* @__PURE__ */ A(Se, { img: kA.chest?.broad ?? null, label: n("BROAD"), selected: JA === "broad", onSelect: () =>
|
|
12950
|
+
/* @__PURE__ */ A(Se, { img: kA.chest?.narrow ?? null, label: n("NARROW"), selected: JA === "narrow", onSelect: () => F("chest", "narrow") }),
|
|
12951
|
+
/* @__PURE__ */ A(Se, { img: kA.chest?.average ?? null, label: n("AVERAGE"), selected: JA === "average", onSelect: () => F("chest", "average") }),
|
|
12952
|
+
/* @__PURE__ */ A(Se, { img: kA.chest?.broad ?? null, label: n("BROAD"), selected: JA === "broad", onSelect: () => F("chest", "broad") })
|
|
12955
12953
|
]
|
|
12956
12954
|
}
|
|
12957
12955
|
),
|
|
@@ -12962,9 +12960,9 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12962
12960
|
title: n("STOMACH PROFILE"),
|
|
12963
12961
|
subtitle: n("Describe your mid-section silhouette"),
|
|
12964
12962
|
children: [
|
|
12965
|
-
/* @__PURE__ */ A(Se, { img: kA.stomach?.flat ?? null, label: n("FLAT"), selected: De === "flat", onSelect: () =>
|
|
12966
|
-
/* @__PURE__ */ A(Se, { img: kA.stomach?.average ?? null, label: n("AVERAGE"), selected: De === "average", onSelect: () =>
|
|
12967
|
-
/* @__PURE__ */ A(Se, { img: kA.stomach?.round ?? null, label: n("ROUND"), selected: De === "round", onSelect: () =>
|
|
12963
|
+
/* @__PURE__ */ A(Se, { img: kA.stomach?.flat ?? null, label: n("FLAT"), selected: De === "flat", onSelect: () => F("stomach", "flat") }),
|
|
12964
|
+
/* @__PURE__ */ A(Se, { img: kA.stomach?.average ?? null, label: n("AVERAGE"), selected: De === "average", onSelect: () => F("stomach", "average") }),
|
|
12965
|
+
/* @__PURE__ */ A(Se, { img: kA.stomach?.round ?? null, label: n("ROUND"), selected: De === "round", onSelect: () => F("stomach", "round") })
|
|
12968
12966
|
]
|
|
12969
12967
|
}
|
|
12970
12968
|
),
|
|
@@ -12975,9 +12973,9 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12975
12973
|
title: n("BACK & SEAT"),
|
|
12976
12974
|
subtitle: n("The curvature of your lower spine and seat profile"),
|
|
12977
12975
|
children: [
|
|
12978
|
-
/* @__PURE__ */ A(Se, { img: kA.seat?.narrow ?? null, label: n("STRAIGHT"), selected: RA === "narrow", onSelect: () =>
|
|
12979
|
-
/* @__PURE__ */ A(Se, { img: kA.seat?.average ?? null, label: n("CURVED"), selected: RA === "average", onSelect: () =>
|
|
12980
|
-
/* @__PURE__ */ A(Se, { img: kA.seat?.full ?? null, label: n("DEEP"), selected: RA === "full", onSelect: () =>
|
|
12976
|
+
/* @__PURE__ */ A(Se, { img: kA.seat?.narrow ?? null, label: n("STRAIGHT"), selected: RA === "narrow", onSelect: () => F("seat", "narrow") }),
|
|
12977
|
+
/* @__PURE__ */ A(Se, { img: kA.seat?.average ?? null, label: n("CURVED"), selected: RA === "average", onSelect: () => F("seat", "average") }),
|
|
12978
|
+
/* @__PURE__ */ A(Se, { img: kA.seat?.full ?? null, label: n("DEEP"), selected: RA === "full", onSelect: () => F("seat", "full") })
|
|
12981
12979
|
]
|
|
12982
12980
|
}
|
|
12983
12981
|
),
|
|
@@ -12988,9 +12986,9 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
12988
12986
|
title: n("HIP PROFILE"),
|
|
12989
12987
|
subtitle: n("The curvature of your hips and thighs"),
|
|
12990
12988
|
children: [
|
|
12991
|
-
/* @__PURE__ */ A(Se, { img: kA.hips.narrow ?? null, label: n("NARROW"), selected: y === "narrow", onSelect: () =>
|
|
12992
|
-
/* @__PURE__ */ A(Se, { img: kA.hips.average ?? null, label: n("AVERAGE"), selected: y === "average", onSelect: () =>
|
|
12993
|
-
/* @__PURE__ */ A(Se, { img: kA.hips.full ?? null, label: n("FULL"), selected: y === "full", onSelect: () =>
|
|
12989
|
+
/* @__PURE__ */ A(Se, { img: kA.hips.narrow ?? null, label: n("NARROW"), selected: y === "narrow", onSelect: () => F("hips", "narrow") }),
|
|
12990
|
+
/* @__PURE__ */ A(Se, { img: kA.hips.average ?? null, label: n("AVERAGE"), selected: y === "average", onSelect: () => F("hips", "average") }),
|
|
12991
|
+
/* @__PURE__ */ A(Se, { img: kA.hips.full ?? null, label: n("FULL"), selected: y === "full", onSelect: () => F("hips", "full") })
|
|
12994
12992
|
]
|
|
12995
12993
|
}
|
|
12996
12994
|
),
|
|
@@ -13023,13 +13021,13 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13023
13021
|
"select",
|
|
13024
13022
|
{
|
|
13025
13023
|
className: "ps-cpw-input",
|
|
13026
|
-
value:
|
|
13024
|
+
value: QA ?? "",
|
|
13027
13025
|
onChange: (D) => {
|
|
13028
13026
|
qA(D.target.value || null), S("");
|
|
13029
13027
|
},
|
|
13030
13028
|
children: [
|
|
13031
13029
|
/* @__PURE__ */ A("option", { value: "", children: n("Select") }),
|
|
13032
|
-
|
|
13030
|
+
m.map((D) => /* @__PURE__ */ A("option", { value: D, children: D }, D))
|
|
13033
13031
|
]
|
|
13034
13032
|
}
|
|
13035
13033
|
)
|
|
@@ -13071,8 +13069,8 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13071
13069
|
if (D.preventDefault(), D.stopPropagation(), nA || jA !== !0) return;
|
|
13072
13070
|
const W = D.dataTransfer?.files?.[0];
|
|
13073
13071
|
if (!W || !ne.current) return;
|
|
13074
|
-
const
|
|
13075
|
-
|
|
13072
|
+
const fA = new DataTransfer();
|
|
13073
|
+
fA.items.add(W), ne.current.files = fA.files, ne.current.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
13076
13074
|
},
|
|
13077
13075
|
style: {
|
|
13078
13076
|
flex: 1,
|
|
@@ -13356,8 +13354,8 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13356
13354
|
/* @__PURE__ */ A("p", { style: { margin: "0.2vw 0 0", fontSize: "0.65vw", color: "var(--ps-text-muted)" }, children: n("Used to calibrate the AI from your photo.") })
|
|
13357
13355
|
] }),
|
|
13358
13356
|
/* @__PURE__ */ e("div", { className: "ps-bp-system-toggle", style: { alignSelf: "center" }, children: [
|
|
13359
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${
|
|
13360
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${
|
|
13357
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${x === "cm" ? " ps-bp-system-active" : ""}`, onClick: re, type: "button", children: n("Metric") }),
|
|
13358
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${x === "in" ? " ps-bp-system-active" : ""}`, onClick: Ae, type: "button", children: n("Imperial") })
|
|
13361
13359
|
] }),
|
|
13362
13360
|
/* @__PURE__ */ A("div", { style: { marginTop: "auto", marginBottom: "auto" }, children: /* @__PURE__ */ e("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
13363
13361
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
@@ -13397,9 +13395,9 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13397
13395
|
] }),
|
|
13398
13396
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
13399
13397
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: n("HEIGHT") }),
|
|
13400
|
-
|
|
13401
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
13402
|
-
|
|
13398
|
+
x === "cm" ? /* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
13399
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: G, placeholder: n("e.g. 173"), onChange: (D) => {
|
|
13400
|
+
U(D.target.value), S("");
|
|
13403
13401
|
} }),
|
|
13404
13402
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
13405
13403
|
] }) : /* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", style: { gap: "6px" }, children: [
|
|
@@ -13416,10 +13414,10 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13416
13414
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
13417
13415
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: n("WEIGHT") }),
|
|
13418
13416
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
13419
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: LA, placeholder: n(
|
|
13417
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: LA, placeholder: n(x === "in" ? "e.g. 154" : "e.g. 70"), onChange: (D) => {
|
|
13420
13418
|
h(D.target.value), S("");
|
|
13421
13419
|
} }),
|
|
13422
|
-
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children:
|
|
13420
|
+
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: x === "in" ? "lbs" : "kg" })
|
|
13423
13421
|
] })
|
|
13424
13422
|
] }),
|
|
13425
13423
|
q && /* @__PURE__ */ e("div", { ref: ie, children: [
|
|
@@ -13459,7 +13457,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13459
13457
|
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A(
|
|
13460
13458
|
ho,
|
|
13461
13459
|
{
|
|
13462
|
-
value:
|
|
13460
|
+
value: QA,
|
|
13463
13461
|
options: jg[TA] || jg.US,
|
|
13464
13462
|
placeholder: "—",
|
|
13465
13463
|
direction: "up",
|
|
@@ -13562,15 +13560,15 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13562
13560
|
/* @__PURE__ */ A("div", { className: "ps-cpw-section-sub", children: n("Enter your details for accurate body estimation") })
|
|
13563
13561
|
] }),
|
|
13564
13562
|
/* @__PURE__ */ A("div", { className: "ps-cpw-pill-row", style: { marginBottom: "0.8vw" }, children: /* @__PURE__ */ e("div", { className: "ps-cpw-pill-group", children: [
|
|
13565
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${
|
|
13566
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${
|
|
13563
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${x === "cm" ? " ps-active" : ""}`, onClick: re, children: "cm" }),
|
|
13564
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${x === "in" ? " ps-active" : ""}`, onClick: Ae, children: "in" })
|
|
13567
13565
|
] }) }),
|
|
13568
13566
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
13569
13567
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
13570
13568
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: n("HEIGHT") }),
|
|
13571
|
-
|
|
13572
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
13573
|
-
|
|
13569
|
+
x === "cm" ? /* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
13570
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: G, placeholder: n("e.g. 173"), onChange: (D) => {
|
|
13571
|
+
U(D.target.value), S("");
|
|
13574
13572
|
} }),
|
|
13575
13573
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
13576
13574
|
] }) : /* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", style: { gap: "6px" }, children: [
|
|
@@ -13587,17 +13585,17 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13587
13585
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
13588
13586
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: n("WEIGHT") }),
|
|
13589
13587
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
13590
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: LA, placeholder: n(
|
|
13588
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: LA, placeholder: n(x === "in" ? "e.g. 154" : "e.g. 70"), onChange: (D) => {
|
|
13591
13589
|
h(D.target.value), S("");
|
|
13592
13590
|
} }),
|
|
13593
|
-
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children:
|
|
13591
|
+
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: x === "in" ? "lbs" : "kg" })
|
|
13594
13592
|
] })
|
|
13595
13593
|
] }),
|
|
13596
13594
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
13597
13595
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: n("AGE") }),
|
|
13598
13596
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
13599
13597
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: oA, placeholder: n("e.g. 30"), onChange: (D) => {
|
|
13600
|
-
|
|
13598
|
+
z(D.target.value), S("");
|
|
13601
13599
|
} }),
|
|
13602
13600
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: n("years") })
|
|
13603
13601
|
] })
|
|
@@ -13612,7 +13610,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13612
13610
|
{ title: n("ANALYZING BODY"), desc: n("Measuring shoulders, chest, waist and hips.") },
|
|
13613
13611
|
{ title: n("COMPUTING DEPTH"), desc: n("Using your height and weight to compute true circumferences.") },
|
|
13614
13612
|
{ title: n("FINALIZING"), desc: n("Almost done — preparing your body profile.") }
|
|
13615
|
-
], W = D[mA % D.length] ?? D[0],
|
|
13613
|
+
], W = D[mA % D.length] ?? D[0], fA = [
|
|
13616
13614
|
["leftShoulder", "rightShoulder"],
|
|
13617
13615
|
["leftShoulder", "leftElbow"],
|
|
13618
13616
|
["leftElbow", "leftWrist"],
|
|
@@ -13662,7 +13660,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13662
13660
|
style: { position: "absolute", inset: 0, width: "100%", height: "100%", pointerEvents: "none" },
|
|
13663
13661
|
"aria-hidden": "true",
|
|
13664
13662
|
children: [
|
|
13665
|
-
|
|
13663
|
+
fA.map(([uA, ee], ue) => {
|
|
13666
13664
|
const Me = yA[uA], io = yA[ee];
|
|
13667
13665
|
return !Me || !io ? null : /* @__PURE__ */ A(
|
|
13668
13666
|
"line",
|
|
@@ -13718,13 +13716,13 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13718
13716
|
].map(({ key: uA, label: ee }) => {
|
|
13719
13717
|
const ue = L[uA] ?? (uA === "bust" ? L.chest : uA === "chest" ? L.bust : void 0);
|
|
13720
13718
|
if (!ue || ue === 0) return null;
|
|
13721
|
-
const Me =
|
|
13719
|
+
const Me = x === "in" ? Math.round(ue / 2.54 * 10) / 10 : ue;
|
|
13722
13720
|
return /* @__PURE__ */ e("div", { style: { background: "rgba(33,84,239,0.04)", border: "1px solid rgba(33,84,239,0.12)", borderRadius: "0.4vw", padding: "0.6vw 0.8vw" }, children: [
|
|
13723
13721
|
/* @__PURE__ */ A("div", { style: { fontSize: "0.6vw", fontWeight: 700, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", marginBottom: "0.2vw" }, children: ee }),
|
|
13724
13722
|
/* @__PURE__ */ e("div", { style: { fontSize: "1vw", fontWeight: 600, color: "var(--ps-text-primary)" }, children: [
|
|
13725
13723
|
Me,
|
|
13726
13724
|
" ",
|
|
13727
|
-
/* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", color: "var(--ps-text-muted)", fontWeight: 400 }, children:
|
|
13725
|
+
/* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", color: "var(--ps-text-muted)", fontWeight: 400 }, children: x })
|
|
13728
13726
|
] })
|
|
13729
13727
|
] }, uA);
|
|
13730
13728
|
}) })
|
|
@@ -13736,16 +13734,16 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
|
|
|
13736
13734
|
] }),
|
|
13737
13735
|
/* @__PURE__ */ e("div", { className: "ps-cpw-footer", children: [
|
|
13738
13736
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-back-btn", onClick: IA, children: w == null ? n("Cancel") : `← ${n("Back")}` }),
|
|
13739
|
-
w === "manual" && !EA && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick:
|
|
13737
|
+
w === "manual" && !EA && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: P, children: n(xe ? "CALCULATE MY FIT" : "Continue") }),
|
|
13740
13738
|
w === "image" && C === "name-photo" && (() => {
|
|
13741
|
-
const D =
|
|
13739
|
+
const D = x === "in" ? parseFloat(T) > 0 || parseFloat(X) > 0 : parseFloat(G) > 0, W = parseFloat(LA) > 0, fA = !!l.trim(), uA = !!nA, ee = iA, ue = n(ee ? "Analyzing photo…" : uA ? fA ? D ? W ? "Calculate My Body Parts" : "Enter your weight" : "Enter your height" : "Add a name for this profile" : "Upload a photo"), Me = ee || !uA || !fA || !D || !W;
|
|
13742
13740
|
return /* @__PURE__ */ A(
|
|
13743
13741
|
"button",
|
|
13744
13742
|
{
|
|
13745
13743
|
type: "button",
|
|
13746
13744
|
className: "ps-cpw-next-btn",
|
|
13747
13745
|
onClick: () => {
|
|
13748
|
-
if (!
|
|
13746
|
+
if (!fA) {
|
|
13749
13747
|
ge(!0), de.current?.focus();
|
|
13750
13748
|
return;
|
|
13751
13749
|
}
|
|
@@ -13796,37 +13794,37 @@ function Xi({
|
|
|
13796
13794
|
isEstimating: r = !1,
|
|
13797
13795
|
t: p
|
|
13798
13796
|
}) {
|
|
13799
|
-
const Q = o.gender === "female" ? ji : Si, C = o.measurements || {}, I = Object.keys(C).some((E) => C[E] != null), [u, M] = f(o.measurementsUnit || "cm"), [L,
|
|
13797
|
+
const Q = o.gender === "female" ? ji : Si, C = o.measurements || {}, I = Object.keys(C).some((E) => C[E] != null), [u, M] = f(o.measurementsUnit || "cm"), [L, Y] = f(() => {
|
|
13800
13798
|
const E = {};
|
|
13801
|
-
return Q.forEach((
|
|
13802
|
-
const
|
|
13803
|
-
E[
|
|
13799
|
+
return Q.forEach((G) => {
|
|
13800
|
+
const U = C[G.key];
|
|
13801
|
+
E[G.key] = U != null ? String(Math.round(U * 10) / 10) : "";
|
|
13804
13802
|
}), E;
|
|
13805
13803
|
});
|
|
13806
13804
|
xA(() => {
|
|
13807
|
-
|
|
13808
|
-
const
|
|
13809
|
-
let
|
|
13805
|
+
Y((E) => {
|
|
13806
|
+
const G = { ...E };
|
|
13807
|
+
let U = !1;
|
|
13810
13808
|
return Q.forEach((T) => {
|
|
13811
13809
|
const aA = C[T.key];
|
|
13812
|
-
aA != null && !E[T.key] && (
|
|
13813
|
-
}),
|
|
13810
|
+
aA != null && !E[T.key] && (G[T.key] = String(Math.round(aA * 10) / 10), U = !0);
|
|
13811
|
+
}), U ? G : E;
|
|
13814
13812
|
});
|
|
13815
13813
|
}, [o.measurements, o.id]);
|
|
13816
13814
|
const [v, l] = f(o.bandSize || ""), [R, V] = f(o.cupSize || ""), s = (E) => {
|
|
13817
|
-
E !== u && (
|
|
13818
|
-
const
|
|
13819
|
-
for (const [T, aA] of Object.entries(
|
|
13815
|
+
E !== u && (Y((G) => {
|
|
13816
|
+
const U = {};
|
|
13817
|
+
for (const [T, aA] of Object.entries(G)) {
|
|
13820
13818
|
const X = parseFloat(aA);
|
|
13821
|
-
!isNaN(X) && X > 0 ?
|
|
13819
|
+
!isNaN(X) && X > 0 ? U[T] = String(E === "in" ? Math.round(X / 2.54 * 10) / 10 : Math.round(X * 2.54 * 10) / 10) : U[T] = aA;
|
|
13822
13820
|
}
|
|
13823
|
-
return
|
|
13821
|
+
return U;
|
|
13824
13822
|
}), M(E));
|
|
13825
|
-
},
|
|
13823
|
+
}, x = () => {
|
|
13826
13824
|
const E = { ...o.measurements || {} };
|
|
13827
|
-
for (const [
|
|
13828
|
-
const T = parseFloat(
|
|
13829
|
-
!isNaN(T) && T > 0 && (E[
|
|
13825
|
+
for (const [G, U] of Object.entries(L)) {
|
|
13826
|
+
const T = parseFloat(U);
|
|
13827
|
+
!isNaN(T) && T > 0 && (E[G] = T);
|
|
13830
13828
|
}
|
|
13831
13829
|
i(E, u), o.gender === "female" && w && (v || R) && w(v, R), n();
|
|
13832
13830
|
};
|
|
@@ -13865,11 +13863,11 @@ function Xi({
|
|
|
13865
13863
|
] }) }),
|
|
13866
13864
|
/* @__PURE__ */ e("div", { className: "ps-pmv-measure-list", children: [
|
|
13867
13865
|
Q.map((E) => {
|
|
13868
|
-
const
|
|
13869
|
-
return /* @__PURE__ */ e("div", { className: `ps-pmv-measure-row${
|
|
13866
|
+
const G = C[E.key], U = r && G == null && !L[E.key];
|
|
13867
|
+
return /* @__PURE__ */ e("div", { className: `ps-pmv-measure-row${G == null ? " ps-loading" : ""}`, children: [
|
|
13870
13868
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: E.iconSrc, alt: "", "aria-hidden": "true" }) }),
|
|
13871
13869
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: p(E.label) }),
|
|
13872
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children:
|
|
13870
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: U ? /* @__PURE__ */ e("span", { style: { display: "inline-flex", alignItems: "center", gap: "0.4vw" }, children: [
|
|
13873
13871
|
/* @__PURE__ */ A("span", { className: "ps-tryon-size-loading-spinner", style: { width: "0.8vw", height: "0.8vw", borderWidth: "1.5px" } }),
|
|
13874
13872
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children: p("calculating...") })
|
|
13875
13873
|
] }) : /* @__PURE__ */ e(_, { children: [
|
|
@@ -13881,7 +13879,7 @@ function Xi({
|
|
|
13881
13879
|
className: "ps-pmv-inline-input",
|
|
13882
13880
|
value: L[E.key] ?? "",
|
|
13883
13881
|
placeholder: "—",
|
|
13884
|
-
onChange: (T) =>
|
|
13882
|
+
onChange: (T) => Y((aA) => ({ ...aA, [E.key]: T.target.value }))
|
|
13885
13883
|
}
|
|
13886
13884
|
),
|
|
13887
13885
|
/* @__PURE__ */ A("span", { className: "ps-pmv-inline-unit", children: u })
|
|
@@ -13934,7 +13932,7 @@ function Xi({
|
|
|
13934
13932
|
{
|
|
13935
13933
|
type: "button",
|
|
13936
13934
|
className: "ps-pmv-btn-primary",
|
|
13937
|
-
onClick:
|
|
13935
|
+
onClick: x,
|
|
13938
13936
|
children: I ? p("SAVE") : /* @__PURE__ */ e(_, { children: [
|
|
13939
13937
|
/* @__PURE__ */ A("span", { className: "ps-pmv-btn-spinner" }),
|
|
13940
13938
|
p("CALCULATING")
|
|
@@ -14074,13 +14072,13 @@ function Zi({
|
|
|
14074
14072
|
t: M,
|
|
14075
14073
|
onRegisterBackInterceptor: L
|
|
14076
14074
|
}) {
|
|
14077
|
-
const [
|
|
14075
|
+
const [Y, v] = f(!1), [l, R] = f(null), V = l && o.find((s) => s.id === l) || null;
|
|
14078
14076
|
return xA(() => {
|
|
14079
14077
|
l && !o.find((s) => s.id === l) && R(null);
|
|
14080
14078
|
}, [o, l]), xA(() => {
|
|
14081
14079
|
if (!L) return;
|
|
14082
|
-
L(() =>
|
|
14083
|
-
if (
|
|
14080
|
+
L(() => Y || l !== null, () => {
|
|
14081
|
+
if (Y) {
|
|
14084
14082
|
v(!1);
|
|
14085
14083
|
return;
|
|
14086
14084
|
}
|
|
@@ -14089,7 +14087,7 @@ function Zi({
|
|
|
14089
14087
|
return;
|
|
14090
14088
|
}
|
|
14091
14089
|
});
|
|
14092
|
-
}, [
|
|
14090
|
+
}, [Y, l, L]), /* @__PURE__ */ A("div", { className: "ps-msp-root", children: /* @__PURE__ */ A("div", { className: "ps-msp-scroll", children: V ? /* @__PURE__ */ A(
|
|
14093
14091
|
Xi,
|
|
14094
14092
|
{
|
|
14095
14093
|
profile: V,
|
|
@@ -14098,31 +14096,31 @@ function Zi({
|
|
|
14098
14096
|
onSelect: () => {
|
|
14099
14097
|
t(V.id), R(null);
|
|
14100
14098
|
},
|
|
14101
|
-
onSaveMeasurements: (s,
|
|
14102
|
-
onSaveBraSize: n ? (s,
|
|
14099
|
+
onSaveMeasurements: (s, x) => c(V.id, s, x),
|
|
14100
|
+
onSaveBraSize: n ? (s, x) => n(V.id, s, x) : void 0,
|
|
14103
14101
|
onDelete: () => w(V.id),
|
|
14104
14102
|
onBack: () => R(null),
|
|
14105
14103
|
onSave: () => R(null),
|
|
14106
14104
|
t: M
|
|
14107
14105
|
}
|
|
14108
|
-
) :
|
|
14106
|
+
) : Y ? /* @__PURE__ */ A(
|
|
14109
14107
|
Ui,
|
|
14110
14108
|
{
|
|
14111
14109
|
apiUrl: p,
|
|
14112
14110
|
apiKey: Q,
|
|
14113
14111
|
onSave: (s) => {
|
|
14114
14112
|
a(s);
|
|
14115
|
-
let
|
|
14113
|
+
let x = null;
|
|
14116
14114
|
if (typeof window < "u")
|
|
14117
14115
|
try {
|
|
14118
14116
|
const E = localStorage.getItem("primestyle_profiles");
|
|
14119
14117
|
if (E) {
|
|
14120
|
-
const
|
|
14121
|
-
|
|
14118
|
+
const G = JSON.parse(E);
|
|
14119
|
+
G.length > 0 && (x = G[0].id ?? null);
|
|
14122
14120
|
}
|
|
14123
14121
|
} catch {
|
|
14124
14122
|
}
|
|
14125
|
-
v(!1),
|
|
14123
|
+
v(!1), x && R(x);
|
|
14126
14124
|
},
|
|
14127
14125
|
onCancel: () => v(!1),
|
|
14128
14126
|
onPhotoPreview: C,
|
|
@@ -14232,36 +14230,36 @@ function gr({
|
|
|
14232
14230
|
switchToMetric: u,
|
|
14233
14231
|
switchToImperial: M,
|
|
14234
14232
|
onUploadPhoto: L,
|
|
14235
|
-
onSwitchToScan:
|
|
14233
|
+
onSwitchToScan: Y,
|
|
14236
14234
|
onNext: v,
|
|
14237
14235
|
canProceed: l,
|
|
14238
14236
|
fastPathLabel: R,
|
|
14239
14237
|
activeProfileName: V,
|
|
14240
14238
|
onStartFresh: s,
|
|
14241
|
-
hidePhotoOptions:
|
|
14239
|
+
hidePhotoOptions: x = !1,
|
|
14242
14240
|
error: E,
|
|
14243
|
-
t:
|
|
14241
|
+
t: G
|
|
14244
14242
|
}) {
|
|
14245
|
-
const
|
|
14243
|
+
const U = parseFloat(i) || 173, T = (parseFloat(c) || 5) * 12 + (parseFloat(w) || 8), aA = Math.floor(T / 12), X = T % 12, UA = parseFloat(p) || (g === "kg" ? 70 : 154), LA = parseFloat(C) || 30, h = g === "kg" ? 30 : 66, oA = g === "kg" ? 200 : 440, z = 120, vA = 220, S = 48, nA = 84, MA = 13, iA = 100, YA = (U - z) / (vA - z) * 100, VA = (T - S) / (nA - S) * 100, HA = (UA - h) / (oA - h) * 100, pe = (LA - MA) / (iA - MA) * 100, _A = (Z) => {
|
|
14246
14244
|
const me = Math.max(S, Math.min(nA, Z));
|
|
14247
14245
|
n(String(Math.floor(me / 12))), r(String(me % 12));
|
|
14248
14246
|
}, yA = () => {
|
|
14249
|
-
o === "in" ? _A(T + 1) : a(String(Math.min(vA,
|
|
14247
|
+
o === "in" ? _A(T + 1) : a(String(Math.min(vA, U + 1)));
|
|
14250
14248
|
}, oe = () => {
|
|
14251
|
-
o === "in" ? _A(T - 1) : a(String(Math.max(
|
|
14249
|
+
o === "in" ? _A(T - 1) : a(String(Math.max(z, U - 1)));
|
|
14252
14250
|
}, SA = () => Q(String(Math.min(oA, UA + 1))), Ce = () => Q(String(Math.max(h, UA - 1))), mA = () => I(String(Math.min(iA, LA + 1))), Ie = () => I(String(Math.max(MA, LA - 1)));
|
|
14253
14251
|
return /* @__PURE__ */ e("div", { className: "ps-bpm-root", children: [
|
|
14254
14252
|
/* @__PURE__ */ e("div", { className: "ps-bpm-header", children: [
|
|
14255
|
-
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children:
|
|
14256
|
-
/* @__PURE__ */ A("p", { className: "ps-bpm-subtitle", children:
|
|
14253
|
+
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: G("Body Measurements") }),
|
|
14254
|
+
/* @__PURE__ */ A("p", { className: "ps-bpm-subtitle", children: G("Enter your details for a bespoke size recommendation") })
|
|
14257
14255
|
] }),
|
|
14258
14256
|
V && /* @__PURE__ */ e("p", { className: "ps-bp-profile-hint", children: [
|
|
14259
|
-
|
|
14257
|
+
G("Using"),
|
|
14260
14258
|
" ",
|
|
14261
14259
|
/* @__PURE__ */ A("strong", { children: V }),
|
|
14262
14260
|
s && /* @__PURE__ */ e(_, { children: [
|
|
14263
14261
|
" · ",
|
|
14264
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: s, children:
|
|
14262
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: s, children: G("start fresh") })
|
|
14265
14263
|
] })
|
|
14266
14264
|
] }),
|
|
14267
14265
|
/* @__PURE__ */ e("div", { className: "ps-bpm-toggle", children: [
|
|
@@ -14271,7 +14269,7 @@ function gr({
|
|
|
14271
14269
|
type: "button",
|
|
14272
14270
|
className: `ps-bpm-toggle-btn${t ? "" : " ps-active"}`,
|
|
14273
14271
|
onClick: u,
|
|
14274
|
-
children:
|
|
14272
|
+
children: G("Metric")
|
|
14275
14273
|
}
|
|
14276
14274
|
),
|
|
14277
14275
|
/* @__PURE__ */ A(
|
|
@@ -14280,18 +14278,18 @@ function gr({
|
|
|
14280
14278
|
type: "button",
|
|
14281
14279
|
className: `ps-bpm-toggle-btn${t ? " ps-active" : ""}`,
|
|
14282
14280
|
onClick: M,
|
|
14283
|
-
children:
|
|
14281
|
+
children: G("Imperial")
|
|
14284
14282
|
}
|
|
14285
14283
|
)
|
|
14286
14284
|
] }),
|
|
14287
14285
|
/* @__PURE__ */ e("div", { className: "ps-bpm-fields", children: [
|
|
14288
14286
|
/* @__PURE__ */ e("div", { className: "ps-bpm-row", children: [
|
|
14289
14287
|
/* @__PURE__ */ e("div", { className: "ps-bpm-row-top", children: [
|
|
14290
|
-
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children:
|
|
14291
|
-
/* @__PURE__ */ A("span", { className: "ps-bpm-value-display", children: o === "in" ? `${aA}ft ${X}in` : `${Math.round(
|
|
14288
|
+
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: G("HEIGHT") }),
|
|
14289
|
+
/* @__PURE__ */ A("span", { className: "ps-bpm-value-display", children: o === "in" ? `${aA}ft ${X}in` : `${Math.round(U)} cm` })
|
|
14292
14290
|
] }),
|
|
14293
14291
|
/* @__PURE__ */ e("div", { className: "ps-bpm-slider-row", children: [
|
|
14294
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: oe, "aria-label":
|
|
14292
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: oe, "aria-label": G("Decrease"), children: /* @__PURE__ */ A(Cg, {}) }),
|
|
14295
14293
|
o === "in" ? /* @__PURE__ */ A(
|
|
14296
14294
|
"input",
|
|
14297
14295
|
{
|
|
@@ -14309,20 +14307,20 @@ function gr({
|
|
|
14309
14307
|
{
|
|
14310
14308
|
type: "range",
|
|
14311
14309
|
className: "ps-bpm-slider",
|
|
14312
|
-
min:
|
|
14310
|
+
min: z,
|
|
14313
14311
|
max: vA,
|
|
14314
14312
|
step: 1,
|
|
14315
|
-
value:
|
|
14313
|
+
value: U,
|
|
14316
14314
|
onChange: (Z) => a(Z.target.value),
|
|
14317
14315
|
style: { "--ps-pct": `${YA}%` }
|
|
14318
14316
|
}
|
|
14319
14317
|
),
|
|
14320
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: yA, "aria-label":
|
|
14318
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: yA, "aria-label": G("Increase"), children: /* @__PURE__ */ A(Dg, {}) })
|
|
14321
14319
|
] })
|
|
14322
14320
|
] }),
|
|
14323
14321
|
/* @__PURE__ */ e("div", { className: "ps-bpm-row", children: [
|
|
14324
14322
|
/* @__PURE__ */ e("div", { className: "ps-bpm-row-top", children: [
|
|
14325
|
-
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children:
|
|
14323
|
+
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: G("WEIGHT") }),
|
|
14326
14324
|
/* @__PURE__ */ e("span", { className: "ps-bpm-value-display", children: [
|
|
14327
14325
|
Math.round(UA),
|
|
14328
14326
|
" ",
|
|
@@ -14330,7 +14328,7 @@ function gr({
|
|
|
14330
14328
|
] })
|
|
14331
14329
|
] }),
|
|
14332
14330
|
/* @__PURE__ */ e("div", { className: "ps-bpm-slider-row", children: [
|
|
14333
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: Ce, "aria-label":
|
|
14331
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: Ce, "aria-label": G("Decrease"), children: /* @__PURE__ */ A(Cg, {}) }),
|
|
14334
14332
|
/* @__PURE__ */ A(
|
|
14335
14333
|
"input",
|
|
14336
14334
|
{
|
|
@@ -14344,20 +14342,20 @@ function gr({
|
|
|
14344
14342
|
style: { "--ps-pct": `${HA}%` }
|
|
14345
14343
|
}
|
|
14346
14344
|
),
|
|
14347
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: SA, "aria-label":
|
|
14345
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: SA, "aria-label": G("Increase"), children: /* @__PURE__ */ A(Dg, {}) })
|
|
14348
14346
|
] })
|
|
14349
14347
|
] }),
|
|
14350
14348
|
/* @__PURE__ */ e("div", { className: "ps-bpm-row", children: [
|
|
14351
14349
|
/* @__PURE__ */ e("div", { className: "ps-bpm-row-top", children: [
|
|
14352
|
-
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children:
|
|
14350
|
+
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: G("AGE") }),
|
|
14353
14351
|
/* @__PURE__ */ e("span", { className: "ps-bpm-value-display", children: [
|
|
14354
14352
|
Math.round(LA),
|
|
14355
14353
|
" ",
|
|
14356
|
-
|
|
14354
|
+
G("YEARS")
|
|
14357
14355
|
] })
|
|
14358
14356
|
] }),
|
|
14359
14357
|
/* @__PURE__ */ e("div", { className: "ps-bpm-slider-row", children: [
|
|
14360
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: Ie, "aria-label":
|
|
14358
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: Ie, "aria-label": G("Decrease"), children: /* @__PURE__ */ A(Cg, {}) }),
|
|
14361
14359
|
/* @__PURE__ */ A(
|
|
14362
14360
|
"input",
|
|
14363
14361
|
{
|
|
@@ -14371,12 +14369,12 @@ function gr({
|
|
|
14371
14369
|
style: { "--ps-pct": `${pe}%` }
|
|
14372
14370
|
}
|
|
14373
14371
|
),
|
|
14374
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: mA, "aria-label":
|
|
14372
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: mA, "aria-label": G("Increase"), children: /* @__PURE__ */ A(Dg, {}) })
|
|
14375
14373
|
] })
|
|
14376
14374
|
] })
|
|
14377
14375
|
] }),
|
|
14378
|
-
!
|
|
14379
|
-
/* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children:
|
|
14376
|
+
!x && /* @__PURE__ */ e(_, { children: [
|
|
14377
|
+
/* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children: G("or") }) }),
|
|
14380
14378
|
/* @__PURE__ */ e(
|
|
14381
14379
|
"button",
|
|
14382
14380
|
{
|
|
@@ -14385,7 +14383,7 @@ function gr({
|
|
|
14385
14383
|
onClick: L,
|
|
14386
14384
|
children: [
|
|
14387
14385
|
/* @__PURE__ */ A(er, {}),
|
|
14388
|
-
/* @__PURE__ */ A("span", { children:
|
|
14386
|
+
/* @__PURE__ */ A("span", { children: G("Upload a photo for AI sizing") }),
|
|
14389
14387
|
/* @__PURE__ */ A(or, {})
|
|
14390
14388
|
]
|
|
14391
14389
|
}
|
|
@@ -14401,17 +14399,17 @@ function gr({
|
|
|
14401
14399
|
className: "ps-bpm-next-btn",
|
|
14402
14400
|
onClick: v,
|
|
14403
14401
|
disabled: !l,
|
|
14404
|
-
children: R ||
|
|
14402
|
+
children: R || G("Next")
|
|
14405
14403
|
}
|
|
14406
14404
|
),
|
|
14407
|
-
!
|
|
14405
|
+
!x && /* @__PURE__ */ A(
|
|
14408
14406
|
Ko,
|
|
14409
14407
|
{
|
|
14410
14408
|
mode: "manual",
|
|
14411
14409
|
onSwitchToManual: () => {
|
|
14412
14410
|
},
|
|
14413
|
-
onSwitchToScan:
|
|
14414
|
-
t:
|
|
14411
|
+
onSwitchToScan: Y,
|
|
14412
|
+
t: G
|
|
14415
14413
|
}
|
|
14416
14414
|
)
|
|
14417
14415
|
] })
|
|
@@ -14459,10 +14457,10 @@ function ut({
|
|
|
14459
14457
|
photoProcessing: u = !1,
|
|
14460
14458
|
photoStatus: M,
|
|
14461
14459
|
photoRejection: L,
|
|
14462
|
-
onClearRejection:
|
|
14460
|
+
onClearRejection: Y,
|
|
14463
14461
|
t: v
|
|
14464
14462
|
}) {
|
|
14465
|
-
const l = n === "close-up", R =
|
|
14463
|
+
const l = n === "close-up", R = hA(null), V = !!o, s = !V && p !== !0;
|
|
14466
14464
|
return /* @__PURE__ */ e("div", { className: "ps-pm-root", children: [
|
|
14467
14465
|
/* @__PURE__ */ e("div", { className: "ps-pm-header", children: [
|
|
14468
14466
|
/* @__PURE__ */ A("h2", { className: "ps-pm-title", children: v(l ? "Upload a face photo or selfie" : "Review your photo") }),
|
|
@@ -14531,8 +14529,8 @@ function ut({
|
|
|
14531
14529
|
{
|
|
14532
14530
|
type: "button",
|
|
14533
14531
|
className: "ps-pm-age-overlay-btn ps-pm-age-overlay-yes",
|
|
14534
|
-
onClick: (
|
|
14535
|
-
|
|
14532
|
+
onClick: (x) => {
|
|
14533
|
+
x.stopPropagation(), Q(!0);
|
|
14536
14534
|
},
|
|
14537
14535
|
children: v("Yes")
|
|
14538
14536
|
}
|
|
@@ -14542,8 +14540,8 @@ function ut({
|
|
|
14542
14540
|
{
|
|
14543
14541
|
type: "button",
|
|
14544
14542
|
className: "ps-pm-age-overlay-btn ps-pm-age-overlay-no",
|
|
14545
|
-
onClick: (
|
|
14546
|
-
|
|
14543
|
+
onClick: (x) => {
|
|
14544
|
+
x.stopPropagation(), Q(!1);
|
|
14547
14545
|
},
|
|
14548
14546
|
children: v("No")
|
|
14549
14547
|
}
|
|
@@ -14557,8 +14555,8 @@ function ut({
|
|
|
14557
14555
|
{
|
|
14558
14556
|
type: "button",
|
|
14559
14557
|
className: "ps-pm-age-overlay-btn ps-pm-age-overlay-no",
|
|
14560
|
-
onClick: (
|
|
14561
|
-
|
|
14558
|
+
onClick: (x) => {
|
|
14559
|
+
x.stopPropagation(), Q(null);
|
|
14562
14560
|
},
|
|
14563
14561
|
children: v("Go back")
|
|
14564
14562
|
}
|
|
@@ -14580,12 +14578,12 @@ function ut({
|
|
|
14580
14578
|
/* @__PURE__ */ A("span", { className: "ps-pm-photo-rejection-title", children: v("Different photo needed") })
|
|
14581
14579
|
] }),
|
|
14582
14580
|
/* @__PURE__ */ A("p", { className: "ps-pm-photo-rejection-msg", children: L }),
|
|
14583
|
-
|
|
14581
|
+
Y && /* @__PURE__ */ A(
|
|
14584
14582
|
"button",
|
|
14585
14583
|
{
|
|
14586
14584
|
type: "button",
|
|
14587
14585
|
className: "ps-pm-photo-rejection-retry",
|
|
14588
|
-
onClick:
|
|
14586
|
+
onClick: Y,
|
|
14589
14587
|
children: v("Try another photo")
|
|
14590
14588
|
}
|
|
14591
14589
|
)
|
|
@@ -14851,30 +14849,30 @@ function pr({
|
|
|
14851
14849
|
onComplete: u,
|
|
14852
14850
|
onSnapSubmit: M,
|
|
14853
14851
|
hasActiveProfileWithMeasurements: L = !1,
|
|
14854
|
-
onUseActiveProfile:
|
|
14852
|
+
onUseActiveProfile: Y,
|
|
14855
14853
|
activeProfileName: v,
|
|
14856
14854
|
onStartFresh: l,
|
|
14857
14855
|
activeProfile: R,
|
|
14858
14856
|
onBack: V,
|
|
14859
14857
|
t: s
|
|
14860
14858
|
}) {
|
|
14861
|
-
const
|
|
14862
|
-
E === "photo" ||
|
|
14863
|
-
const
|
|
14859
|
+
const x = t ? cr : Br, [E, G] = f("photo");
|
|
14860
|
+
E === "photo" || x.indexOf(E);
|
|
14861
|
+
const U = jo(), T = at(a), aA = R?.height, X = R?.weight, UA = R?.age, LA = R?.heightUnit === "ft" ? "in" : R?.heightUnit, h = R?.weightUnit, oA = aA != null && LA === "cm" ? String(Math.round(aA)) : aA != null && (LA === "in" || LA === "ft") ? String(Math.round(aA * 2.54)) : i.current.height || "", z = aA != null && (LA === "in" || LA === "ft") ? Math.round(aA) : aA != null && LA === "cm" ? Math.round(aA / 2.54) : null, vA = z != null ? String(Math.floor(z / 12)) : i.current.heightFeet || "", S = z != null ? String(z % 12) : i.current.heightInches || "", nA = X != null ? String(Math.round(X)) : i.current.weight || "", MA = UA != null ? String(UA) : i.current.age || "", [iA, YA] = f(oA), [VA, HA] = f(vA), [pe, _A] = f(S), [yA, oe] = f(nA), [SA, Ce] = f(MA), [mA, Ie] = f(
|
|
14864
14862
|
LA || (c === "ft" ? "in" : c || (T ? "in" : "cm"))
|
|
14865
14863
|
), [Z, me] = f(
|
|
14866
14864
|
h || w || (T ? "lbs" : "kg")
|
|
14867
|
-
), fe = mA === "in" || Z === "lbs", [Ye, ne] = f(null), [de, dA] = f(null), [ge, jA] = f(null), [H, zA] = f(!1), [he, Oe] = f(""), [JA, ke] = f(null), [De, BA] = f(!1), RA =
|
|
14865
|
+
), fe = mA === "in" || Z === "lbs", [Ye, ne] = f(null), [de, dA] = f(null), [ge, jA] = f(null), [H, zA] = f(!1), [he, Oe] = f(""), [JA, ke] = f(null), [De, BA] = f(!1), RA = hA(null), [FA, y] = f(null), [gA, CA] = f(!1), [J, QA] = f(!1), [qA, TA] = f(() => z != null ? String(Math.round(z * 2.54)) : oA), [ve, GA] = f(null), [OA, ie] = f(null), [XA, m] = f(null), [q, kA] = f(null), [Qe, cA] = f(""), [ae, xe] = f(null), [re, Ae] = f(null), [PA, se] = f(() => ["US", "UK", "AU"].includes(a) ? a === "AU" ? "UK" : a : ["FR", "ES"].includes(a) ? "FR" : ["IT"].includes(a) ? "IT" : ["JP", "CN", "KR"].includes(a) ? "JP" : "EU"), [Pe, b] = f(!1), [P, F] = f(null), K = hA(null);
|
|
14868
14866
|
xA(() => {
|
|
14869
|
-
if (!
|
|
14870
|
-
const
|
|
14867
|
+
if (!P) return;
|
|
14868
|
+
const N = (pA) => {
|
|
14871
14869
|
const le = K.current;
|
|
14872
|
-
le && !le.contains(pA.target) &&
|
|
14870
|
+
le && !le.contains(pA.target) && F(null);
|
|
14873
14871
|
};
|
|
14874
|
-
return document.addEventListener("mousedown",
|
|
14875
|
-
}, [
|
|
14876
|
-
const EA = go[PA] || go.US, [$, lA] = f(""), IA = bA(async (
|
|
14877
|
-
const pA =
|
|
14872
|
+
return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
14873
|
+
}, [P]);
|
|
14874
|
+
const EA = go[PA] || go.US, [$, lA] = f(""), IA = bA(async (N) => {
|
|
14875
|
+
const pA = N.target.files?.[0];
|
|
14878
14876
|
if (!pA) return;
|
|
14879
14877
|
if (FA !== !0) {
|
|
14880
14878
|
lA(s("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
@@ -14905,17 +14903,17 @@ function pr({
|
|
|
14905
14903
|
} finally {
|
|
14906
14904
|
zA(!1), Oe("");
|
|
14907
14905
|
}
|
|
14908
|
-
}, [s, FA]), Be =
|
|
14906
|
+
}, [s, FA]), Be = hA(null), Ee = bA(() => {
|
|
14909
14907
|
de && !De && URL.revokeObjectURL(de), ne(null), dA(null), jA(null), BA(!1), RA.current && (RA.current.value = "");
|
|
14910
14908
|
}, [de, De]), KA = bA(() => {
|
|
14911
14909
|
Ee(), YA(""), HA(""), _A(""), oe(""), Ce(""), xe(null), Ae(null), l?.();
|
|
14912
14910
|
}, [Ee, l]);
|
|
14913
14911
|
xA(() => {
|
|
14914
|
-
const
|
|
14915
|
-
!
|
|
14912
|
+
const N = R?.photoBase64, pA = R?.id ?? null;
|
|
14913
|
+
!N || !pA || Be.current !== pA && (Be.current = pA, jA(N), dA(N), BA(!0), y(!0));
|
|
14916
14914
|
}, [R]), xA(() => {
|
|
14917
|
-
const
|
|
14918
|
-
|
|
14915
|
+
const N = R?.age;
|
|
14916
|
+
N != null && N > 0 && !SA && Ce(String(Math.round(N)));
|
|
14919
14917
|
}, [R, SA]);
|
|
14920
14918
|
const D = bA(() => {
|
|
14921
14919
|
if (mA === "in") {
|
|
@@ -14927,32 +14925,32 @@ function pr({
|
|
|
14927
14925
|
if (!pA || pA < 100 || pA > 250)
|
|
14928
14926
|
return lA(s("Please enter a valid height (100-250 cm)")), !1;
|
|
14929
14927
|
}
|
|
14930
|
-
const
|
|
14928
|
+
const N = parseFloat(yA);
|
|
14931
14929
|
if (Z === "lbs") {
|
|
14932
|
-
if (!
|
|
14930
|
+
if (!N || N < 66 || N > 660)
|
|
14933
14931
|
return lA(s("Please enter a valid weight")), !1;
|
|
14934
|
-
} else if (!
|
|
14932
|
+
} else if (!N || N < 30 || N > 300)
|
|
14935
14933
|
return lA(s("Please enter a valid weight (30-300 kg)")), !1;
|
|
14936
14934
|
return lA(""), !0;
|
|
14937
14935
|
}, [mA, Z, iA, VA, yA, s]), W = () => {
|
|
14938
|
-
let
|
|
14936
|
+
let N;
|
|
14939
14937
|
if (mA === "in") {
|
|
14940
14938
|
const pA = parseFloat(VA) || 0, le = parseFloat(pe) || 0;
|
|
14941
|
-
|
|
14939
|
+
N = pA * 12 + le;
|
|
14942
14940
|
} else
|
|
14943
|
-
|
|
14944
|
-
return { heightVal:
|
|
14945
|
-
},
|
|
14946
|
-
const pA =
|
|
14947
|
-
return pA <
|
|
14941
|
+
N = parseFloat(iA);
|
|
14942
|
+
return { heightVal: N, weightVal: parseFloat(yA) };
|
|
14943
|
+
}, fA = t ? "female" : "male", uA = (N) => {
|
|
14944
|
+
const pA = x.indexOf(N);
|
|
14945
|
+
return pA < x.length - 1 ? x[pA + 1] : "submit";
|
|
14948
14946
|
}, ee = () => {
|
|
14949
|
-
const { heightVal:
|
|
14950
|
-
i.current.height = String(
|
|
14951
|
-
height:
|
|
14947
|
+
const { heightVal: N, weightVal: pA } = W();
|
|
14948
|
+
i.current.height = String(N), i.current.weight = String(pA), i.current.gender = fA, SA && (i.current.age = SA), n(mA), r(Z), u({
|
|
14949
|
+
height: N,
|
|
14952
14950
|
weight: pA,
|
|
14953
14951
|
heightUnit: mA,
|
|
14954
14952
|
weightUnit: Z,
|
|
14955
|
-
gender:
|
|
14953
|
+
gender: fA,
|
|
14956
14954
|
age: SA ? parseInt(SA, 10) : void 0,
|
|
14957
14955
|
chestProfile: ve || void 0,
|
|
14958
14956
|
midsectionProfile: OA,
|
|
@@ -14963,15 +14961,15 @@ function pr({
|
|
|
14963
14961
|
});
|
|
14964
14962
|
}, ue = bA(() => {
|
|
14965
14963
|
if (!ge || !Ye) return;
|
|
14966
|
-
const
|
|
14964
|
+
const N = mA === "in" ? (parseFloat(VA) || 0) * 12 + (parseFloat(pe) || 0) : parseFloat(iA) || 0, pA = parseFloat(yA) || 0, le = parseFloat(SA) || void 0;
|
|
14967
14965
|
M({
|
|
14968
14966
|
photoFile: Ye,
|
|
14969
14967
|
photoBase64: ge,
|
|
14970
|
-
height:
|
|
14968
|
+
height: N,
|
|
14971
14969
|
weight: pA,
|
|
14972
14970
|
heightUnit: mA,
|
|
14973
14971
|
weightUnit: Z,
|
|
14974
|
-
gender:
|
|
14972
|
+
gender: fA,
|
|
14975
14973
|
...le ? { age: le } : {},
|
|
14976
14974
|
...t && ae && re ? {
|
|
14977
14975
|
braSize: {
|
|
@@ -14981,24 +14979,24 @@ function pr({
|
|
|
14981
14979
|
}
|
|
14982
14980
|
} : {}
|
|
14983
14981
|
});
|
|
14984
|
-
}, [ge, Ye, mA, Z, VA, pe, iA, yA, SA,
|
|
14982
|
+
}, [ge, Ye, mA, Z, VA, pe, iA, yA, SA, fA, t, ae, re, PA, M]), Me = bA(() => {
|
|
14985
14983
|
if (E === "basics") {
|
|
14986
14984
|
if (!D()) return;
|
|
14987
|
-
|
|
14985
|
+
G(uA("basics"));
|
|
14988
14986
|
} else if (E === "chest") {
|
|
14989
14987
|
if (!ve) return;
|
|
14990
|
-
|
|
14988
|
+
G(uA("chest"));
|
|
14991
14989
|
} else if (E === "midsection") {
|
|
14992
14990
|
if (!OA) return;
|
|
14993
|
-
|
|
14991
|
+
G(uA("midsection"));
|
|
14994
14992
|
} else if (E === "seat") {
|
|
14995
14993
|
if (!q) return;
|
|
14996
|
-
const
|
|
14997
|
-
|
|
14994
|
+
const N = uA("seat");
|
|
14995
|
+
N === "submit" ? ee() : G(N);
|
|
14998
14996
|
} else if (E === "hips") {
|
|
14999
14997
|
if (!XA) return;
|
|
15000
|
-
const
|
|
15001
|
-
|
|
14998
|
+
const N = uA("hips");
|
|
14999
|
+
N === "submit" ? ee() : G(N);
|
|
15002
15000
|
} else if (E === "bra") {
|
|
15003
15001
|
if (!ae || !re) {
|
|
15004
15002
|
lA(s("Please select both band and cup size"));
|
|
@@ -15007,8 +15005,8 @@ function pr({
|
|
|
15007
15005
|
lA(""), ee();
|
|
15008
15006
|
} else if (E === "photo") {
|
|
15009
15007
|
if (!ge || !Ye) {
|
|
15010
|
-
if (L &&
|
|
15011
|
-
|
|
15008
|
+
if (L && Y) {
|
|
15009
|
+
Y();
|
|
15012
15010
|
return;
|
|
15013
15011
|
}
|
|
15014
15012
|
lA(s("Please upload a photo"));
|
|
@@ -15018,14 +15016,14 @@ function pr({
|
|
|
15018
15016
|
lA(s("Please confirm your age"));
|
|
15019
15017
|
return;
|
|
15020
15018
|
}
|
|
15021
|
-
if (lA(""),
|
|
15022
|
-
|
|
15019
|
+
if (lA(""), U) {
|
|
15020
|
+
G("scan-details");
|
|
15023
15021
|
return;
|
|
15024
15022
|
}
|
|
15025
15023
|
ue();
|
|
15026
15024
|
} else if (E === "scan-details") {
|
|
15027
|
-
const
|
|
15028
|
-
if (!
|
|
15025
|
+
const N = mA === "in" ? parseFloat(VA) > 0 || parseFloat(pe) > 0 : parseFloat(iA) > 0, pA = parseFloat(yA) > 0;
|
|
15026
|
+
if (!N) {
|
|
15029
15027
|
lA(s("Please enter your height"));
|
|
15030
15028
|
return;
|
|
15031
15029
|
}
|
|
@@ -15043,37 +15041,37 @@ function pr({
|
|
|
15043
15041
|
}
|
|
15044
15042
|
lA(""), ue();
|
|
15045
15043
|
}
|
|
15046
|
-
}, [E,
|
|
15047
|
-
const pA =
|
|
15048
|
-
return pA > 0 ?
|
|
15044
|
+
}, [E, x, D, ve, OA, XA, q, ae, re, mA, Z, iA, VA, pe, yA, SA, ge, Ye, FA, U, t, fA, L, Y, ue]), io = (N) => {
|
|
15045
|
+
const pA = x.indexOf(N);
|
|
15046
|
+
return pA > 0 ? x[pA - 1] : null;
|
|
15049
15047
|
}, ze = bA(() => {
|
|
15050
15048
|
if (lA(""), E === "basics")
|
|
15051
15049
|
V();
|
|
15052
15050
|
else if (E === "photo")
|
|
15053
|
-
|
|
15051
|
+
G("basics");
|
|
15054
15052
|
else if (E === "scan-details")
|
|
15055
|
-
|
|
15053
|
+
G("photo");
|
|
15056
15054
|
else {
|
|
15057
|
-
const
|
|
15058
|
-
|
|
15055
|
+
const N = io(E);
|
|
15056
|
+
N ? G(N) : V();
|
|
15059
15057
|
}
|
|
15060
|
-
}, [E,
|
|
15058
|
+
}, [E, x, V]), We = E === "basics" || E === "scan-details" ? !0 : E === "chest" ? !!ve : E === "midsection" ? !!OA : E === "seat" ? !!q : E === "hips" ? !!XA : E === "bra" ? !!(ae && re) : E === "photo", Ao = E === x[x.length - 1], ye = () => {
|
|
15061
15059
|
if (mA === "in") {
|
|
15062
|
-
const
|
|
15063
|
-
|
|
15060
|
+
const N = (parseFloat(VA) || 0) * 12 + (parseFloat(pe) || 0);
|
|
15061
|
+
N > 0 && YA(String(Math.round(N * 2.54)));
|
|
15064
15062
|
}
|
|
15065
15063
|
Z === "lbs" && yA && oe(String(Math.round(parseFloat(yA) / 2.205))), Ie("cm"), me("kg"), n("cm"), r("kg"), Q?.("cm");
|
|
15066
15064
|
}, Je = () => {
|
|
15067
15065
|
if (mA === "cm") {
|
|
15068
|
-
const
|
|
15069
|
-
if (
|
|
15070
|
-
const pA = Math.round(
|
|
15066
|
+
const N = parseFloat(iA);
|
|
15067
|
+
if (N > 0) {
|
|
15068
|
+
const pA = Math.round(N / 2.54);
|
|
15071
15069
|
HA(String(Math.floor(pA / 12))), _A(String(pA % 12));
|
|
15072
15070
|
}
|
|
15073
15071
|
}
|
|
15074
15072
|
Z === "kg" && yA && oe(String(Math.round(parseFloat(yA) * 2.205))), Ie("in"), me("lbs"), n("in"), r("lbs"), Q?.("in");
|
|
15075
15073
|
};
|
|
15076
|
-
if (E === "scan-details" &&
|
|
15074
|
+
if (E === "scan-details" && U)
|
|
15077
15075
|
return /* @__PURE__ */ e("div", { className: "ps-bp-wrapper", children: [
|
|
15078
15076
|
/* @__PURE__ */ e("div", { className: "ps-bp-scan-progress", children: [
|
|
15079
15077
|
/* @__PURE__ */ A(
|
|
@@ -15081,7 +15079,7 @@ function pr({
|
|
|
15081
15079
|
{
|
|
15082
15080
|
type: "button",
|
|
15083
15081
|
className: "ps-bp-scan-progress-back",
|
|
15084
|
-
onClick: () =>
|
|
15082
|
+
onClick: () => G("photo"),
|
|
15085
15083
|
"aria-label": s("Back"),
|
|
15086
15084
|
children: "←"
|
|
15087
15085
|
}
|
|
@@ -15110,19 +15108,19 @@ function pr({
|
|
|
15110
15108
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
15111
15109
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: s("HEIGHT") }),
|
|
15112
15110
|
mA === "in" ? /* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
15113
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: VA, onChange: (
|
|
15111
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: VA, onChange: (N) => HA(N.target.value), min: 3, max: 8 }),
|
|
15114
15112
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
15115
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: pe, onChange: (
|
|
15113
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: pe, onChange: (N) => _A(N.target.value), min: 0, max: 11 }),
|
|
15116
15114
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
15117
15115
|
] }) : /* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
15118
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: iA, onChange: (
|
|
15116
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: iA, onChange: (N) => YA(N.target.value), min: 100, max: 250 }),
|
|
15119
15117
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
15120
15118
|
] })
|
|
15121
15119
|
] }),
|
|
15122
15120
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
15123
15121
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: s("WEIGHT") }),
|
|
15124
15122
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
|
|
15125
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: Z === "kg" ? "75" : "165", value: yA, onChange: (
|
|
15123
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: Z === "kg" ? "75" : "165", value: yA, onChange: (N) => oe(N.target.value), min: Z === "kg" ? 30 : 66, max: Z === "kg" ? 300 : 660 }),
|
|
15126
15124
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: Z })
|
|
15127
15125
|
] })
|
|
15128
15126
|
] }),
|
|
@@ -15134,10 +15132,10 @@ function pr({
|
|
|
15134
15132
|
{
|
|
15135
15133
|
value: PA,
|
|
15136
15134
|
options: Object.keys(go),
|
|
15137
|
-
isOpen:
|
|
15138
|
-
onToggle: () =>
|
|
15139
|
-
onSelect: (
|
|
15140
|
-
se(
|
|
15135
|
+
isOpen: P === "region",
|
|
15136
|
+
onToggle: () => F(P === "region" ? null : "region"),
|
|
15137
|
+
onSelect: (N) => {
|
|
15138
|
+
se(N), xe(null), Ae(null), F(null);
|
|
15141
15139
|
}
|
|
15142
15140
|
}
|
|
15143
15141
|
) })
|
|
@@ -15150,10 +15148,10 @@ function pr({
|
|
|
15150
15148
|
value: ae,
|
|
15151
15149
|
options: go[PA] || go.US,
|
|
15152
15150
|
placeholder: "—",
|
|
15153
|
-
isOpen:
|
|
15154
|
-
onToggle: () =>
|
|
15155
|
-
onSelect: (
|
|
15156
|
-
xe(
|
|
15151
|
+
isOpen: P === "band",
|
|
15152
|
+
onToggle: () => F(P === "band" ? null : "band"),
|
|
15153
|
+
onSelect: (N) => {
|
|
15154
|
+
xe(N), F(null);
|
|
15157
15155
|
}
|
|
15158
15156
|
}
|
|
15159
15157
|
) })
|
|
@@ -15167,10 +15165,10 @@ function pr({
|
|
|
15167
15165
|
options: vo[PA] || vo.US,
|
|
15168
15166
|
placeholder: "—",
|
|
15169
15167
|
direction: "up",
|
|
15170
|
-
isOpen:
|
|
15171
|
-
onToggle: () =>
|
|
15172
|
-
onSelect: (
|
|
15173
|
-
Ae(
|
|
15168
|
+
isOpen: P === "cup",
|
|
15169
|
+
onToggle: () => F(P === "cup" ? null : "cup"),
|
|
15170
|
+
onSelect: (N) => {
|
|
15171
|
+
Ae(N), F(null);
|
|
15174
15172
|
}
|
|
15175
15173
|
}
|
|
15176
15174
|
) })
|
|
@@ -15185,7 +15183,7 @@ function pr({
|
|
|
15185
15183
|
Ko,
|
|
15186
15184
|
{
|
|
15187
15185
|
mode: "scan",
|
|
15188
|
-
onSwitchToManual: () =>
|
|
15186
|
+
onSwitchToManual: () => G("basics"),
|
|
15189
15187
|
onSwitchToScan: () => {
|
|
15190
15188
|
},
|
|
15191
15189
|
t: s
|
|
@@ -15194,10 +15192,10 @@ function pr({
|
|
|
15194
15192
|
] })
|
|
15195
15193
|
] });
|
|
15196
15194
|
if (E === "photo" || E === "scan-details") {
|
|
15197
|
-
const
|
|
15198
|
-
H && be.push(s("Analyzing photo…")), !le && !H && be.push(s("Upload a photo")),
|
|
15195
|
+
const N = mA === "in" ? parseFloat(VA) > 0 || parseFloat(pe) > 0 : parseFloat(iA) > 0, pA = parseFloat(yA) > 0, le = !!de, be = [];
|
|
15196
|
+
H && be.push(s("Analyzing photo…")), !le && !H && be.push(s("Upload a photo")), N || be.push(s("Enter your height")), pA || be.push(s("Enter your weight")), t && (!ae || !re) && be.push(s("Enter your bra size"));
|
|
15199
15197
|
const eo = be.length > 0, Ve = eo ? be[0] ?? s("Analyze My Size") : s("Analyze My Size");
|
|
15200
|
-
return
|
|
15198
|
+
return U ? /* @__PURE__ */ e("div", { className: "ps-bp-wrapper", children: [
|
|
15201
15199
|
/* @__PURE__ */ e("div", { className: "ps-bp-scan-progress", children: [
|
|
15202
15200
|
/* @__PURE__ */ A("span", { className: "ps-bp-scan-progress-spacer", "aria-hidden": "true" }),
|
|
15203
15201
|
/* @__PURE__ */ e("div", { className: "ps-bp-scan-progress-track", children: [
|
|
@@ -15233,7 +15231,7 @@ function pr({
|
|
|
15233
15231
|
handlePhotoSelect: IA,
|
|
15234
15232
|
handleRemovePhoto: Ee,
|
|
15235
15233
|
onAnalyze: Me,
|
|
15236
|
-
onSwitchToManual: () =>
|
|
15234
|
+
onSwitchToManual: () => G("basics"),
|
|
15237
15235
|
error: $,
|
|
15238
15236
|
photoStepHeight: qA,
|
|
15239
15237
|
onPhotoStepHeightChange: TA,
|
|
@@ -15316,9 +15314,9 @@ function pr({
|
|
|
15316
15314
|
!de && FA === !0 && RA.current?.click();
|
|
15317
15315
|
},
|
|
15318
15316
|
onMouseEnter: () => {
|
|
15319
|
-
!de && FA === !0 &&
|
|
15317
|
+
!de && FA === !0 && QA(!0);
|
|
15320
15318
|
},
|
|
15321
|
-
onMouseLeave: () =>
|
|
15319
|
+
onMouseLeave: () => QA(!1),
|
|
15322
15320
|
onDragEnter: (eA) => {
|
|
15323
15321
|
eA.preventDefault(), eA.stopPropagation();
|
|
15324
15322
|
},
|
|
@@ -15668,10 +15666,10 @@ function pr({
|
|
|
15668
15666
|
{
|
|
15669
15667
|
value: PA,
|
|
15670
15668
|
options: Object.keys(go),
|
|
15671
|
-
isOpen:
|
|
15672
|
-
onToggle: () =>
|
|
15669
|
+
isOpen: P === "region",
|
|
15670
|
+
onToggle: () => F(P === "region" ? null : "region"),
|
|
15673
15671
|
onSelect: (eA) => {
|
|
15674
|
-
se(eA), xe(null), Ae(null),
|
|
15672
|
+
se(eA), xe(null), Ae(null), F(null);
|
|
15675
15673
|
}
|
|
15676
15674
|
}
|
|
15677
15675
|
) })
|
|
@@ -15684,10 +15682,10 @@ function pr({
|
|
|
15684
15682
|
value: ae,
|
|
15685
15683
|
options: go[PA] || go.US,
|
|
15686
15684
|
placeholder: "—",
|
|
15687
|
-
isOpen:
|
|
15688
|
-
onToggle: () =>
|
|
15685
|
+
isOpen: P === "band",
|
|
15686
|
+
onToggle: () => F(P === "band" ? null : "band"),
|
|
15689
15687
|
onSelect: (eA) => {
|
|
15690
|
-
xe(eA),
|
|
15688
|
+
xe(eA), F(null);
|
|
15691
15689
|
}
|
|
15692
15690
|
}
|
|
15693
15691
|
) })
|
|
@@ -15701,10 +15699,10 @@ function pr({
|
|
|
15701
15699
|
options: vo[PA] || vo.US,
|
|
15702
15700
|
placeholder: "—",
|
|
15703
15701
|
direction: "up",
|
|
15704
|
-
isOpen:
|
|
15705
|
-
onToggle: () =>
|
|
15702
|
+
isOpen: P === "cup",
|
|
15703
|
+
onToggle: () => F(P === "cup" ? null : "cup"),
|
|
15706
15704
|
onSelect: (eA) => {
|
|
15707
|
-
Ae(eA),
|
|
15705
|
+
Ae(eA), F(null);
|
|
15708
15706
|
}
|
|
15709
15707
|
}
|
|
15710
15708
|
) })
|
|
@@ -15796,7 +15794,7 @@ function pr({
|
|
|
15796
15794
|
] })
|
|
15797
15795
|
] }),
|
|
15798
15796
|
/* @__PURE__ */ A("input", { ref: RA, type: "file", accept: "image/*", onChange: IA, style: { display: "none" } }),
|
|
15799
|
-
|
|
15797
|
+
U ? /* @__PURE__ */ e(_, { children: [
|
|
15800
15798
|
/* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
|
|
15801
15799
|
/* @__PURE__ */ e("div", { className: "ps-bpm-bottom", children: [
|
|
15802
15800
|
/* @__PURE__ */ A(
|
|
@@ -15813,7 +15811,7 @@ function pr({
|
|
|
15813
15811
|
Ko,
|
|
15814
15812
|
{
|
|
15815
15813
|
mode: "scan",
|
|
15816
|
-
onSwitchToManual: () =>
|
|
15814
|
+
onSwitchToManual: () => G("basics"),
|
|
15817
15815
|
onSwitchToScan: () => {
|
|
15818
15816
|
},
|
|
15819
15817
|
t: s
|
|
@@ -15829,7 +15827,7 @@ function pr({
|
|
|
15829
15827
|
{
|
|
15830
15828
|
type: "button",
|
|
15831
15829
|
className: "ps-bp-photo-manual-link",
|
|
15832
|
-
onClick: () =>
|
|
15830
|
+
onClick: () => G("basics"),
|
|
15833
15831
|
children: s("Enter measurements manually")
|
|
15834
15832
|
}
|
|
15835
15833
|
)
|
|
@@ -15869,7 +15867,7 @@ function pr({
|
|
|
15869
15867
|
),
|
|
15870
15868
|
/* @__PURE__ */ e("div", { className: "ps-bp-root", children: [
|
|
15871
15869
|
E === "basics" && (() => {
|
|
15872
|
-
const
|
|
15870
|
+
const N = () => {
|
|
15873
15871
|
if (mA === "in") {
|
|
15874
15872
|
const le = (parseFloat(VA) || 5) * 12 + (parseFloat(pe) || 8);
|
|
15875
15873
|
YA(String(Math.round(le * 2.54)));
|
|
@@ -15882,7 +15880,7 @@ function pr({
|
|
|
15882
15880
|
}
|
|
15883
15881
|
Z === "kg" && yA && oe(String(Math.round(parseFloat(yA) * 2.205))), Ie("in"), me("lbs"), n("in"), r("lbs"), Q?.("in");
|
|
15884
15882
|
};
|
|
15885
|
-
return
|
|
15883
|
+
return U ? /* @__PURE__ */ A(
|
|
15886
15884
|
gr,
|
|
15887
15885
|
{
|
|
15888
15886
|
hUnit: mA,
|
|
@@ -15898,12 +15896,12 @@ function pr({
|
|
|
15898
15896
|
setWeight: oe,
|
|
15899
15897
|
age: SA,
|
|
15900
15898
|
setAge: Ce,
|
|
15901
|
-
switchToMetric:
|
|
15899
|
+
switchToMetric: N,
|
|
15902
15900
|
switchToImperial: pA,
|
|
15903
|
-
onUploadPhoto: () =>
|
|
15904
|
-
onSwitchToScan: () =>
|
|
15901
|
+
onUploadPhoto: () => G("photo"),
|
|
15902
|
+
onSwitchToScan: () => G("photo"),
|
|
15905
15903
|
hidePhotoOptions: L,
|
|
15906
|
-
onNext: L &&
|
|
15904
|
+
onNext: L && Y ? Y : Me,
|
|
15907
15905
|
canProceed: !0,
|
|
15908
15906
|
fastPathLabel: L ? s("Find My Best Fit") + (Xe(mA) ? ` (${Xe(mA)})` : "") : void 0,
|
|
15909
15907
|
activeProfileName: L ? v : null,
|
|
@@ -15924,7 +15922,7 @@ function pr({
|
|
|
15924
15922
|
] })
|
|
15925
15923
|
] }),
|
|
15926
15924
|
/* @__PURE__ */ e("div", { className: "ps-bp-system-toggle", children: [
|
|
15927
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${fe ? "" : " ps-bp-system-active"}`, onClick:
|
|
15925
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${fe ? "" : " ps-bp-system-active"}`, onClick: N, type: "button", children: s("Metric") }),
|
|
15928
15926
|
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${fe ? " ps-bp-system-active" : ""}`, onClick: pA, type: "button", children: s("Imperial") })
|
|
15929
15927
|
] }),
|
|
15930
15928
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-fields", children: [
|
|
@@ -15959,7 +15957,7 @@ function pr({
|
|
|
15959
15957
|
"button",
|
|
15960
15958
|
{
|
|
15961
15959
|
className: "ps-bp-photo-cta",
|
|
15962
|
-
onClick: () =>
|
|
15960
|
+
onClick: () => G("photo"),
|
|
15963
15961
|
type: "button",
|
|
15964
15962
|
children: [
|
|
15965
15963
|
/* @__PURE__ */ A(ar, {}),
|
|
@@ -15971,11 +15969,11 @@ function pr({
|
|
|
15971
15969
|
$ && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: $ })
|
|
15972
15970
|
] }, "step-basics");
|
|
15973
15971
|
})(),
|
|
15974
|
-
E === "chest" && !t && (
|
|
15972
|
+
E === "chest" && !t && (U ? /* @__PURE__ */ A(
|
|
15975
15973
|
eg,
|
|
15976
15974
|
{
|
|
15977
|
-
stepNumber:
|
|
15978
|
-
totalSteps:
|
|
15975
|
+
stepNumber: x.indexOf("chest") + 1,
|
|
15976
|
+
totalSteps: x.length,
|
|
15979
15977
|
title: s("WHICH BEST DESCRIBES YOUR CHEST?"),
|
|
15980
15978
|
options: [
|
|
15981
15979
|
{ value: "narrow", label: s("Narrow"), img: WA.male.chest.narrow },
|
|
@@ -15983,7 +15981,7 @@ function pr({
|
|
|
15983
15981
|
{ value: "broad", label: s("Broad"), img: WA.male.chest.broad }
|
|
15984
15982
|
],
|
|
15985
15983
|
selected: ve,
|
|
15986
|
-
onSelect: (
|
|
15984
|
+
onSelect: (N) => GA(N),
|
|
15987
15985
|
t: s
|
|
15988
15986
|
},
|
|
15989
15987
|
"step-chest-mobile"
|
|
@@ -15996,11 +15994,11 @@ function pr({
|
|
|
15996
15994
|
] }),
|
|
15997
15995
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: Qe || " " })
|
|
15998
15996
|
] }, "step-chest")),
|
|
15999
|
-
E === "midsection" && (
|
|
15997
|
+
E === "midsection" && (U ? /* @__PURE__ */ A(
|
|
16000
15998
|
eg,
|
|
16001
15999
|
{
|
|
16002
|
-
stepNumber:
|
|
16003
|
-
totalSteps:
|
|
16000
|
+
stepNumber: x.indexOf("midsection") + 1,
|
|
16001
|
+
totalSteps: x.length,
|
|
16004
16002
|
title: s("WHICH BEST DESCRIBES YOUR MIDSECTION?"),
|
|
16005
16003
|
options: t ? [
|
|
16006
16004
|
{ value: "flat", label: s("Flat"), img: WA.female.stomach.flat },
|
|
@@ -16012,7 +16010,7 @@ function pr({
|
|
|
16012
16010
|
{ value: "round", label: s("Full"), img: WA.male.stomach.round }
|
|
16013
16011
|
],
|
|
16014
16012
|
selected: OA,
|
|
16015
|
-
onSelect: (
|
|
16013
|
+
onSelect: (N) => ie(N),
|
|
16016
16014
|
t: s
|
|
16017
16015
|
},
|
|
16018
16016
|
"step-midsection-mobile"
|
|
@@ -16029,11 +16027,11 @@ function pr({
|
|
|
16029
16027
|
] }) }),
|
|
16030
16028
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: Qe || " " })
|
|
16031
16029
|
] }, "step-midsection")),
|
|
16032
|
-
E === "seat" && (
|
|
16030
|
+
E === "seat" && (U ? /* @__PURE__ */ A(
|
|
16033
16031
|
eg,
|
|
16034
16032
|
{
|
|
16035
|
-
stepNumber:
|
|
16036
|
-
totalSteps:
|
|
16033
|
+
stepNumber: x.indexOf("seat") + 1,
|
|
16034
|
+
totalSteps: x.length,
|
|
16037
16035
|
title: s("WHICH BEST DESCRIBES YOUR SEAT?"),
|
|
16038
16036
|
options: t ? [
|
|
16039
16037
|
{ value: "narrow", label: s("Flat"), img: WA.female.seat.narrow },
|
|
@@ -16045,7 +16043,7 @@ function pr({
|
|
|
16045
16043
|
{ value: "full", label: s("Full"), img: WA.male.seat.full }
|
|
16046
16044
|
],
|
|
16047
16045
|
selected: q,
|
|
16048
|
-
onSelect: (
|
|
16046
|
+
onSelect: (N) => kA(N),
|
|
16049
16047
|
t: s
|
|
16050
16048
|
},
|
|
16051
16049
|
"step-seat-mobile"
|
|
@@ -16062,11 +16060,11 @@ function pr({
|
|
|
16062
16060
|
] }) }),
|
|
16063
16061
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: Qe || " " })
|
|
16064
16062
|
] }, "step-seat")),
|
|
16065
|
-
E === "hips" && t && (
|
|
16063
|
+
E === "hips" && t && (U ? /* @__PURE__ */ A(
|
|
16066
16064
|
eg,
|
|
16067
16065
|
{
|
|
16068
|
-
stepNumber:
|
|
16069
|
-
totalSteps:
|
|
16066
|
+
stepNumber: x.indexOf("hips") + 1,
|
|
16067
|
+
totalSteps: x.length,
|
|
16070
16068
|
title: s("WHICH BEST DESCRIBES YOUR HIPS?"),
|
|
16071
16069
|
options: [
|
|
16072
16070
|
{ value: "narrow", label: s("Narrow"), img: WA.female.hips.narrow },
|
|
@@ -16074,16 +16072,16 @@ function pr({
|
|
|
16074
16072
|
{ value: "full", label: s("Curvy"), img: WA.female.hips.full }
|
|
16075
16073
|
],
|
|
16076
16074
|
selected: XA,
|
|
16077
|
-
onSelect: (
|
|
16075
|
+
onSelect: (N) => m(N),
|
|
16078
16076
|
t: s
|
|
16079
16077
|
},
|
|
16080
16078
|
"step-hips-mobile"
|
|
16081
16079
|
) : /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
16082
16080
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: s("Which best describes your hips?") }),
|
|
16083
16081
|
/* @__PURE__ */ e("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: [
|
|
16084
|
-
/* @__PURE__ */ A(Fe, { img: WA.female.hips.narrow, label: s("Narrow"), selected: XA === "narrow", onSelect: () =>
|
|
16085
|
-
/* @__PURE__ */ A(Fe, { img: WA.female.hips.average, label: s("Average"), selected: XA === "average", onSelect: () =>
|
|
16086
|
-
/* @__PURE__ */ A(Fe, { img: WA.female.hips.full, label: s("Curvy"), selected: XA === "full", onSelect: () =>
|
|
16082
|
+
/* @__PURE__ */ A(Fe, { img: WA.female.hips.narrow, label: s("Narrow"), selected: XA === "narrow", onSelect: () => m("narrow"), onHover: () => cA(s("Hips closer to shoulder width")), onLeave: () => cA("") }),
|
|
16083
|
+
/* @__PURE__ */ A(Fe, { img: WA.female.hips.average, label: s("Average"), selected: XA === "average", onSelect: () => m("average"), onHover: () => cA(s("Hips proportionate to shoulders")), onLeave: () => cA("") }),
|
|
16084
|
+
/* @__PURE__ */ A(Fe, { img: WA.female.hips.full, label: s("Curvy"), selected: XA === "full", onSelect: () => m("full"), onHover: () => cA(s("Hips wider than shoulders")), onLeave: () => cA("") })
|
|
16087
16085
|
] }),
|
|
16088
16086
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: Qe || " " })
|
|
16089
16087
|
] }, "step-hips")),
|
|
@@ -16097,7 +16095,7 @@ function pr({
|
|
|
16097
16095
|
"button",
|
|
16098
16096
|
{
|
|
16099
16097
|
className: "ps-bp-bra-region-trigger",
|
|
16100
|
-
onClick: () =>
|
|
16098
|
+
onClick: () => b(!Pe),
|
|
16101
16099
|
type: "button",
|
|
16102
16100
|
children: [
|
|
16103
16101
|
PA,
|
|
@@ -16106,62 +16104,62 @@ function pr({
|
|
|
16106
16104
|
]
|
|
16107
16105
|
}
|
|
16108
16106
|
),
|
|
16109
|
-
Pe && /* @__PURE__ */ A("div", { className: "ps-bp-bra-region-dropdown", children: ["US", "UK", "EU", "FR", "IT", "JP"].map((
|
|
16107
|
+
Pe && /* @__PURE__ */ A("div", { className: "ps-bp-bra-region-dropdown", children: ["US", "UK", "EU", "FR", "IT", "JP"].map((N) => /* @__PURE__ */ A(
|
|
16110
16108
|
"button",
|
|
16111
16109
|
{
|
|
16112
|
-
className: `ps-bp-bra-region-item${PA ===
|
|
16110
|
+
className: `ps-bp-bra-region-item${PA === N ? " ps-selected" : ""}`,
|
|
16113
16111
|
onClick: () => {
|
|
16114
|
-
se(
|
|
16112
|
+
se(N), xe(null), Ae(null), b(!1);
|
|
16115
16113
|
},
|
|
16116
16114
|
type: "button",
|
|
16117
|
-
children:
|
|
16115
|
+
children: N
|
|
16118
16116
|
},
|
|
16119
|
-
|
|
16117
|
+
N
|
|
16120
16118
|
)) })
|
|
16121
16119
|
] }),
|
|
16122
16120
|
ae && re && (() => {
|
|
16123
|
-
const
|
|
16121
|
+
const N = lr(ae, re, PA);
|
|
16124
16122
|
return /* @__PURE__ */ e("span", { className: "ps-bp-bra-inline-result", children: [
|
|
16125
16123
|
/* @__PURE__ */ e("strong", { children: [
|
|
16126
16124
|
ae,
|
|
16127
16125
|
re
|
|
16128
16126
|
] }),
|
|
16129
|
-
|
|
16127
|
+
N && /* @__PURE__ */ e("span", { children: [
|
|
16130
16128
|
" · ",
|
|
16131
|
-
|
|
16129
|
+
N.cm,
|
|
16132
16130
|
"cm"
|
|
16133
16131
|
] })
|
|
16134
16132
|
] });
|
|
16135
16133
|
})()
|
|
16136
16134
|
] }),
|
|
16137
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-bra-grid", children: EA.map((
|
|
16135
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-bra-grid", children: EA.map((N) => /* @__PURE__ */ A(
|
|
16138
16136
|
"button",
|
|
16139
16137
|
{
|
|
16140
|
-
className: `ps-bp-bra-btn${ae ===
|
|
16141
|
-
onClick: () => xe(
|
|
16138
|
+
className: `ps-bp-bra-btn${ae === N ? " ps-bp-bra-btn-selected" : ""}`,
|
|
16139
|
+
onClick: () => xe(N),
|
|
16142
16140
|
type: "button",
|
|
16143
|
-
children:
|
|
16141
|
+
children: N
|
|
16144
16142
|
},
|
|
16145
|
-
|
|
16143
|
+
N
|
|
16146
16144
|
)) })
|
|
16147
16145
|
] }),
|
|
16148
16146
|
/* @__PURE__ */ e("div", { className: "ps-bp-bra-section", children: [
|
|
16149
16147
|
/* @__PURE__ */ A("span", { className: "ps-bp-bra-label", children: s("CUP SIZE") }),
|
|
16150
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-bra-grid", children: (vo[PA] || vo.US).map((
|
|
16148
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-bra-grid", children: (vo[PA] || vo.US).map((N) => /* @__PURE__ */ A(
|
|
16151
16149
|
"button",
|
|
16152
16150
|
{
|
|
16153
|
-
className: `ps-bp-bra-btn${re ===
|
|
16154
|
-
onClick: () => Ae(
|
|
16151
|
+
className: `ps-bp-bra-btn${re === N ? " ps-bp-bra-btn-selected" : ""}`,
|
|
16152
|
+
onClick: () => Ae(N),
|
|
16155
16153
|
type: "button",
|
|
16156
|
-
children:
|
|
16154
|
+
children: N
|
|
16157
16155
|
},
|
|
16158
|
-
|
|
16156
|
+
N
|
|
16159
16157
|
)) })
|
|
16160
16158
|
] }),
|
|
16161
16159
|
$ && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: $ })
|
|
16162
16160
|
] }, "step-bra"),
|
|
16163
|
-
!(
|
|
16164
|
-
const
|
|
16161
|
+
!(U && E === "basics") && (() => {
|
|
16162
|
+
const N = E === "basics" && L && !!Y, pA = N ? Y : Me, le = Xe(mA) ? ` (${Xe(mA)})` : "", be = N ? s("Find My Best Fit") + le : Ao ? s("Find My Size") + le : s("Next");
|
|
16165
16163
|
return /* @__PURE__ */ e("div", { className: "ps-bp-nav", children: [
|
|
16166
16164
|
E !== "basics" ? /* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: ze, type: "button", children: [
|
|
16167
16165
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
@@ -16171,9 +16169,9 @@ function pr({
|
|
|
16171
16169
|
/* @__PURE__ */ A(
|
|
16172
16170
|
"button",
|
|
16173
16171
|
{
|
|
16174
|
-
className: `ps-bp-next-btn${!
|
|
16172
|
+
className: `ps-bp-next-btn${!N && !We ? " ps-bp-btn-disabled" : ""}`,
|
|
16175
16173
|
onClick: pA,
|
|
16176
|
-
disabled: !
|
|
16174
|
+
disabled: !N && !We,
|
|
16177
16175
|
type: "button",
|
|
16178
16176
|
children: be
|
|
16179
16177
|
}
|
|
@@ -16206,25 +16204,25 @@ function xg({
|
|
|
16206
16204
|
submitSizing: u,
|
|
16207
16205
|
onSnapSubmit: M,
|
|
16208
16206
|
onBack: L,
|
|
16209
|
-
apiUrl:
|
|
16207
|
+
apiUrl: Y,
|
|
16210
16208
|
apiKey: v,
|
|
16211
16209
|
t: l
|
|
16212
16210
|
}) {
|
|
16213
|
-
const R = i === "close-up", V = jo(), [s,
|
|
16211
|
+
const R = i === "close-up", V = jo(), [s, x] = f("manual"), [E, G] = f(() => {
|
|
16214
16212
|
const H = {};
|
|
16215
16213
|
return g.forEach((zA) => {
|
|
16216
16214
|
H[zA.key] = w.current[zA.key] || "";
|
|
16217
16215
|
}), H;
|
|
16218
|
-
}),
|
|
16216
|
+
}), U = t ?? [
|
|
16219
16217
|
{ label: l("Centimeters"), value: "cm" },
|
|
16220
16218
|
{ label: l("Inches"), value: "in" }
|
|
16221
|
-
], [T, aA] = f(""), X =
|
|
16219
|
+
], [T, aA] = f(""), X = hA(null), [UA, LA] = f(null), [h, oA] = f(null), [z, vA] = f(null), [S, nA] = f(!1), [MA, iA] = f(!1), [YA, VA] = f(""), [HA, pe] = f(null), [_A, yA] = f(null), [oe, SA] = f(!1), Ce = bA(async (H) => {
|
|
16222
16220
|
const zA = H.target.files?.[0];
|
|
16223
16221
|
if (!zA) return;
|
|
16224
16222
|
const he = URL.createObjectURL(zA);
|
|
16225
16223
|
oA(zA), LA(he), iA(!0), VA("Analyzing photo…");
|
|
16226
16224
|
try {
|
|
16227
|
-
const Oe =
|
|
16225
|
+
const Oe = Y && v ? tg(zA, Y, v) : Promise.resolve({ isAdult: !0, confidence: "low" }), JA = uo(zA, R ? { maxDimension: 1536, quality: 0.85 } : {}), ke = await Oe;
|
|
16228
16226
|
if (!ke.isAdult) {
|
|
16229
16227
|
const BA = ke.reasoning?.trim() || l("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
|
|
16230
16228
|
pe(BA), oA(null), LA(null);
|
|
@@ -16236,10 +16234,10 @@ function xg({
|
|
|
16236
16234
|
} finally {
|
|
16237
16235
|
iA(!1), VA("");
|
|
16238
16236
|
}
|
|
16239
|
-
}, [R,
|
|
16237
|
+
}, [R, Y, v, l]), mA = bA(() => {
|
|
16240
16238
|
UA && URL.revokeObjectURL(UA), oA(null), LA(null), vA(null);
|
|
16241
16239
|
}, [UA]), Ie = (H, zA) => {
|
|
16242
|
-
|
|
16240
|
+
G((he) => ({ ...he, [H]: zA })), aA("");
|
|
16243
16241
|
}, Z = () => {
|
|
16244
16242
|
const H = g[0];
|
|
16245
16243
|
if (!H) return;
|
|
@@ -16257,20 +16255,20 @@ function xg({
|
|
|
16257
16255
|
aA(l("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
16258
16256
|
return;
|
|
16259
16257
|
}
|
|
16260
|
-
if (!h || !
|
|
16258
|
+
if (!h || !z) {
|
|
16261
16259
|
aA(l("Please upload a photo"));
|
|
16262
16260
|
return;
|
|
16263
16261
|
}
|
|
16264
16262
|
M({
|
|
16265
16263
|
photoFile: h,
|
|
16266
|
-
photoBase64:
|
|
16264
|
+
photoBase64: z,
|
|
16267
16265
|
height: 0,
|
|
16268
16266
|
weight: 0,
|
|
16269
16267
|
heightUnit: "cm",
|
|
16270
16268
|
weightUnit: "kg",
|
|
16271
16269
|
gender: w.current.gender || "male"
|
|
16272
16270
|
});
|
|
16273
|
-
}, fe =
|
|
16271
|
+
}, fe = U.find((H) => H.value === r)?.label || U[0].label;
|
|
16274
16272
|
if (V && s === "photo")
|
|
16275
16273
|
return /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
16276
16274
|
ut,
|
|
@@ -16279,7 +16277,7 @@ function xg({
|
|
|
16279
16277
|
handlePhotoSelect: Ce,
|
|
16280
16278
|
handleRemovePhoto: mA,
|
|
16281
16279
|
onAnalyze: me,
|
|
16282
|
-
onSwitchToManual: () =>
|
|
16280
|
+
onSwitchToManual: () => x("manual"),
|
|
16283
16281
|
error: T,
|
|
16284
16282
|
photoVariant: i,
|
|
16285
16283
|
ageConfirmed: _A,
|
|
@@ -16292,7 +16290,7 @@ function xg({
|
|
|
16292
16290
|
if (V)
|
|
16293
16291
|
return /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ e("div", { className: "ps-bpm-root", children: [
|
|
16294
16292
|
/* @__PURE__ */ A("div", { className: "ps-bpm-header", children: /* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: l(o) }) }),
|
|
16295
|
-
/* @__PURE__ */ A("div", { className: "ps-bpm-toggle", style: { padding: "0 4%" }, children:
|
|
16293
|
+
/* @__PURE__ */ A("div", { className: "ps-bpm-toggle", style: { padding: "0 4%" }, children: U.map((H) => /* @__PURE__ */ A(
|
|
16296
16294
|
"button",
|
|
16297
16295
|
{
|
|
16298
16296
|
type: "button",
|
|
@@ -16327,7 +16325,7 @@ function xg({
|
|
|
16327
16325
|
/* @__PURE__ */ A("div", { style: { flex: 1, minHeight: 16 } }),
|
|
16328
16326
|
!a && /* @__PURE__ */ e(_, { children: [
|
|
16329
16327
|
/* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children: l("or") }) }),
|
|
16330
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ps-bpm-upload-link", onClick: () =>
|
|
16328
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ps-bpm-upload-link", onClick: () => x("photo"), children: [
|
|
16331
16329
|
/* @__PURE__ */ A(Rg, {}),
|
|
16332
16330
|
/* @__PURE__ */ A("span", { children: l(R ? "Upload a close-up face photo or selfie" : "Upload a photo for AI sizing") }),
|
|
16333
16331
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: /* @__PURE__ */ A("polyline", { points: "9 18 15 12 9 6" }) })
|
|
@@ -16346,7 +16344,7 @@ function xg({
|
|
|
16346
16344
|
mode: "manual",
|
|
16347
16345
|
onSwitchToManual: () => {
|
|
16348
16346
|
},
|
|
16349
|
-
onSwitchToScan: () =>
|
|
16347
|
+
onSwitchToScan: () => x("photo"),
|
|
16350
16348
|
t: l
|
|
16351
16349
|
}
|
|
16352
16350
|
)
|
|
@@ -16357,7 +16355,7 @@ function xg({
|
|
|
16357
16355
|
/* @__PURE__ */ A("div", { className: "ps-bp-image", style: { position: "relative" }, children: /* @__PURE__ */ A("img", { src: c, alt: n, className: "ps-bp-image-img" }) }),
|
|
16358
16356
|
/* @__PURE__ */ A("div", { className: "ps-bp-root", children: /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter", children: [
|
|
16359
16357
|
/* @__PURE__ */ A("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "0.6vw", marginBottom: "0.3vw" }, children: /* @__PURE__ */ A("h2", { className: "ps-bp-title", style: { margin: 0 }, children: l(o) }) }),
|
|
16360
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-system-toggle", children:
|
|
16358
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-system-toggle", children: U.map((H) => /* @__PURE__ */ A(
|
|
16361
16359
|
"button",
|
|
16362
16360
|
{
|
|
16363
16361
|
type: "button",
|
|
@@ -16387,7 +16385,7 @@ function xg({
|
|
|
16387
16385
|
] })
|
|
16388
16386
|
] }, H.key)) }),
|
|
16389
16387
|
T && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: T }),
|
|
16390
|
-
!a && /* @__PURE__ */ e("button", { className: "ps-bp-photo-cta", onClick: () =>
|
|
16388
|
+
!a && /* @__PURE__ */ e("button", { className: "ps-bp-photo-cta", onClick: () => x("photo"), type: "button", children: [
|
|
16391
16389
|
/* @__PURE__ */ A(Rg, {}),
|
|
16392
16390
|
/* @__PURE__ */ A("span", { children: l(R ? "Or upload a close-up face photo or selfie" : "Or upload a photo for AI sizing") }),
|
|
16393
16391
|
/* @__PURE__ */ A("span", { className: "ps-bp-photo-cta-arrow", children: "→" })
|
|
@@ -16715,7 +16713,7 @@ function xg({
|
|
|
16715
16713
|
/* @__PURE__ */ A("p", { style: { margin: "0.2vw 0 0", fontSize: "0.65vw", color: "var(--ps-text-muted)" }, children: l("Enter your measurements OR upload a photo — we'll use whichever you provide.") })
|
|
16716
16714
|
] }),
|
|
16717
16715
|
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: "0.7vw" }, children: [
|
|
16718
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-system-toggle", style: { alignSelf: "center" }, children:
|
|
16716
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-system-toggle", style: { alignSelf: "center" }, children: U.map((H) => /* @__PURE__ */ A(
|
|
16719
16717
|
"button",
|
|
16720
16718
|
{
|
|
16721
16719
|
type: "button",
|
|
@@ -16866,7 +16864,7 @@ function xg({
|
|
|
16866
16864
|
/* @__PURE__ */ A("input", { ref: X, type: "file", accept: "image/*", style: { display: "none" }, onChange: Ce }),
|
|
16867
16865
|
T && /* @__PURE__ */ A("p", { className: "ps-bp-error", style: { padding: "0 1.5vw" }, children: T }),
|
|
16868
16866
|
/* @__PURE__ */ e("div", { className: "ps-bp-nav", children: [
|
|
16869
|
-
/* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: () =>
|
|
16867
|
+
/* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: () => x("manual"), type: "button", children: [
|
|
16870
16868
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
16871
16869
|
" ",
|
|
16872
16870
|
l("Back")
|
|
@@ -17079,17 +17077,17 @@ function br({
|
|
|
17079
17077
|
buttonStyles: u = {},
|
|
17080
17078
|
modalStyles: M = {},
|
|
17081
17079
|
classNames: L = {},
|
|
17082
|
-
className:
|
|
17080
|
+
className: Y,
|
|
17083
17081
|
style: v,
|
|
17084
17082
|
onOpen: l,
|
|
17085
17083
|
onClose: R,
|
|
17086
17084
|
onUpload: V,
|
|
17087
17085
|
onProcessing: s,
|
|
17088
|
-
onComplete:
|
|
17086
|
+
onComplete: x,
|
|
17089
17087
|
onError: E,
|
|
17090
|
-
sizeGuideData:
|
|
17088
|
+
sizeGuideData: G
|
|
17091
17089
|
}) {
|
|
17092
|
-
const
|
|
17090
|
+
const U = a || o, [T, aA] = f(() => I || "");
|
|
17093
17091
|
xA(() => {
|
|
17094
17092
|
I !== void 0 && aA(I);
|
|
17095
17093
|
}, [I]);
|
|
@@ -17097,14 +17095,14 @@ function br({
|
|
|
17097
17095
|
xA(() => {
|
|
17098
17096
|
h(!0);
|
|
17099
17097
|
}, []);
|
|
17100
|
-
const [oA,
|
|
17098
|
+
const [oA, z] = f("idle"), [vA, S] = f(null), [nA, MA] = f(null), [iA, YA] = f(null), [VA, HA] = f(null), [pe, _A] = f(!1), [yA, oe] = f(null), [SA, Ce] = f(null), [mA, Ie] = f({}), Z = hA({});
|
|
17101
17099
|
xA(() => {
|
|
17102
17100
|
Z.current = mA;
|
|
17103
17101
|
}, [mA]);
|
|
17104
|
-
const me =
|
|
17102
|
+
const me = hA(null), fe = hA(null), Ye = hA(null);
|
|
17105
17103
|
bA((B, d) => {
|
|
17106
|
-
Ie((
|
|
17107
|
-
const rA = { ...
|
|
17104
|
+
Ie((O) => {
|
|
17105
|
+
const rA = { ...O };
|
|
17108
17106
|
return d === null ? delete rA[B] : rA[B] = { ...d, sectionName: B }, Z.current = rA, rA;
|
|
17109
17107
|
});
|
|
17110
17108
|
}, []);
|
|
@@ -17114,7 +17112,7 @@ function br({
|
|
|
17114
17112
|
recommendedSize: dA.recommendedSize
|
|
17115
17113
|
}), Ie({}));
|
|
17116
17114
|
}, [dA?.recommendedSize]);
|
|
17117
|
-
const [Oe, JA] = f(!1), [ke, De] = f(!1), [BA, RA] = f(null), FA =
|
|
17115
|
+
const [Oe, JA] = f(!1), [ke, De] = f(!1), [BA, RA] = f(null), FA = hA(!1);
|
|
17118
17116
|
xA(() => {
|
|
17119
17117
|
me.current = dA;
|
|
17120
17118
|
}, [dA]), xA(() => {
|
|
@@ -17122,17 +17120,17 @@ function br({
|
|
|
17122
17120
|
}, [BA]), xA(() => {
|
|
17123
17121
|
Ye.current = iA;
|
|
17124
17122
|
}, [iA]);
|
|
17125
|
-
const [y, gA] = f(!1), CA =
|
|
17123
|
+
const [y, gA] = f(!1), CA = hA(!1), [J, QA] = f(Pn), qA = at(J), [TA, ve] = f(qA ? "in" : "cm"), [GA, OA] = f(qA ? "in" : "cm"), [ie, XA] = f(qA ? "lbs" : "kg");
|
|
17126
17124
|
xA(() => {
|
|
17127
17125
|
const B = wo(i);
|
|
17128
17126
|
B === "foot" || B === "head" ? ve("cm") : B === "face" && ve("mm");
|
|
17129
17127
|
}, [i]);
|
|
17130
|
-
const
|
|
17131
|
-
|
|
17132
|
-
}, []), [Be, Ee] = f(!1), [KA, D] = f(null), [W,
|
|
17128
|
+
const m = hA({}), [q, kA] = f("male"), [Qe, cA] = f(0), [ae, xe] = f(null), [re, Ae] = f(!1), [PA, se] = f(() => Ke("profiles", [])), [Pe, b] = f(() => Ke("history", [])), [P, F] = f(() => nt()), [K, EA] = f(() => /* @__PURE__ */ new Set()), [$, lA] = f(null), IA = bA((B) => {
|
|
17129
|
+
F(B), In(B);
|
|
17130
|
+
}, []), [Be, Ee] = f(!1), [KA, D] = f(null), [W, fA] = f(null), uA = hA(null), ee = hA(() => !1), ue = hA(() => {
|
|
17133
17131
|
}), Me = bA((B, d) => {
|
|
17134
17132
|
ee.current = B, ue.current = d;
|
|
17135
|
-
}, []), io =
|
|
17133
|
+
}, []), io = hA(null), ze = hA(null), We = hA(null), Ao = hA(null), ye = hA(null), Je = hA(!1), N = hA(null), pA = hA(null), [le, be] = f(null), [eo, Ve] = f(null), eA = hA(null), qe = hA(null), ro = hA(!1), mo = hA(null);
|
|
17136
17134
|
xA(() => {
|
|
17137
17135
|
try {
|
|
17138
17136
|
const B = Re(), d = je(r);
|
|
@@ -17154,12 +17152,12 @@ function br({
|
|
|
17154
17152
|
headers: { "Content-Type": "application/json" },
|
|
17155
17153
|
body: JSON.stringify({ images: g, productTitle: i }),
|
|
17156
17154
|
signal: d.signal
|
|
17157
|
-
}).then((
|
|
17158
|
-
|
|
17155
|
+
}).then((O) => O.ok ? O.json() : null).then((O) => {
|
|
17156
|
+
O?.bestUrl && (mo.current = O.bestUrl, console.log(`[ps-sdk] pre-picked garment reference: ${O.bestUrl}`));
|
|
17159
17157
|
}).catch(() => {
|
|
17160
17158
|
}), () => d.abort();
|
|
17161
17159
|
}, [g, t, r, i]);
|
|
17162
|
-
const ng = 22, Ro =
|
|
17160
|
+
const ng = 22, Ro = hA(0), Po = hA(null), bo = hA(null), xo = hA(null), Ho = hA(null), Mo = hA(null), ig = hA(null), rg = hA(""), so = hA(null);
|
|
17163
17161
|
xA(() => {
|
|
17164
17162
|
if (oA === "processing") {
|
|
17165
17163
|
if (so.current) return;
|
|
@@ -17174,24 +17172,24 @@ function br({
|
|
|
17174
17172
|
], d = 2 * Math.PI * 38;
|
|
17175
17173
|
return so.current = setInterval(() => {
|
|
17176
17174
|
if (Je.current) return;
|
|
17177
|
-
const
|
|
17175
|
+
const O = ig.current || Date.now(), rA = (Date.now() - O) / 1e3, tA = Math.min(95, rA / ng * 100);
|
|
17178
17176
|
Ro.current = tA;
|
|
17179
17177
|
const AA = Math.round(tA);
|
|
17180
17178
|
if (Po.current && (Po.current.style.width = `${AA}%`), bo.current && (bo.current.textContent = `${AA}%`), Mo.current) {
|
|
17181
|
-
const
|
|
17182
|
-
Mo.current.style.strokeDashoffset = String(
|
|
17179
|
+
const k = d * (1 - tA / 100);
|
|
17180
|
+
Mo.current.style.strokeDashoffset = String(k);
|
|
17183
17181
|
}
|
|
17184
17182
|
if (Ho.current) {
|
|
17185
|
-
const
|
|
17186
|
-
Ho.current.textContent = rA >= ng ? "•••" : `~${
|
|
17183
|
+
const k = Math.max(0, ng - Math.floor(rA));
|
|
17184
|
+
Ho.current.textContent = rA >= ng ? "•••" : `~${k}s`;
|
|
17187
17185
|
}
|
|
17188
17186
|
if (xo.current) {
|
|
17189
|
-
const
|
|
17190
|
-
if (
|
|
17187
|
+
const k = [...B].reverse().find((j) => AA >= j.at);
|
|
17188
|
+
if (k && k.text !== rg.current) {
|
|
17191
17189
|
const j = xo.current;
|
|
17192
17190
|
j.style.opacity = "0", setTimeout(() => {
|
|
17193
|
-
j.textContent =
|
|
17194
|
-
}, 180), rg.current =
|
|
17191
|
+
j.textContent = k.text, j.style.opacity = "1";
|
|
17192
|
+
}, 180), rg.current = k.text;
|
|
17195
17193
|
}
|
|
17196
17194
|
}
|
|
17197
17195
|
}, 200), () => {
|
|
@@ -17203,9 +17201,9 @@ function br({
|
|
|
17203
17201
|
nA && URL.revokeObjectURL(nA);
|
|
17204
17202
|
}, [nA]), xA(() => {
|
|
17205
17203
|
if (oA !== "idle") {
|
|
17206
|
-
const B = window.scrollY, d = document.body.style.overflow,
|
|
17204
|
+
const B = window.scrollY, d = document.body.style.overflow, O = document.body.style.overscrollBehavior;
|
|
17207
17205
|
return document.body.style.overflow = "hidden", document.body.style.overscrollBehavior = "none", () => {
|
|
17208
|
-
document.body.style.overflow = d, document.body.style.overscrollBehavior =
|
|
17206
|
+
document.body.style.overflow = d, document.body.style.overscrollBehavior = O, window.scrollTo(0, B);
|
|
17209
17207
|
};
|
|
17210
17208
|
}
|
|
17211
17209
|
}, [oA]), xA(() => {
|
|
@@ -17217,7 +17215,7 @@ function br({
|
|
|
17217
17215
|
return window.addEventListener(Jo, B), () => window.removeEventListener(Jo, B);
|
|
17218
17216
|
}, []), xA(() => {
|
|
17219
17217
|
if (CA.current) return;
|
|
17220
|
-
if (CA.current = !0, !
|
|
17218
|
+
if (CA.current = !0, !G) {
|
|
17221
17219
|
RA({ found: !1 });
|
|
17222
17220
|
return;
|
|
17223
17221
|
}
|
|
@@ -17230,13 +17228,13 @@ function br({
|
|
|
17230
17228
|
fetch(`${B}/api/v1/sizing/sizeguide`, {
|
|
17231
17229
|
method: "POST",
|
|
17232
17230
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${d}` },
|
|
17233
|
-
body: JSON.stringify({ product: { title: i, productId:
|
|
17234
|
-
}).then((
|
|
17235
|
-
RA(
|
|
17231
|
+
body: JSON.stringify({ product: { title: i, productId: U }, sizeGuideRaw: G })
|
|
17232
|
+
}).then((O) => O.ok ? O.json() : null).then((O) => {
|
|
17233
|
+
RA(O || { found: !1 });
|
|
17236
17234
|
}).catch(() => {
|
|
17237
17235
|
RA({ found: !1 });
|
|
17238
17236
|
}).finally(() => gA(!1));
|
|
17239
|
-
}, [r, i,
|
|
17237
|
+
}, [r, i, G]);
|
|
17240
17238
|
const mt = He(() => {
|
|
17241
17239
|
switch (oA) {
|
|
17242
17240
|
case "welcome":
|
|
@@ -17253,8 +17251,8 @@ function br({
|
|
|
17253
17251
|
return 1;
|
|
17254
17252
|
}
|
|
17255
17253
|
}, [oA]), yo = bA(
|
|
17256
|
-
(B, d,
|
|
17257
|
-
let rA =
|
|
17254
|
+
(B, d, O) => {
|
|
17255
|
+
let rA = P, tA = PA.find((AA) => AA.id === rA);
|
|
17258
17256
|
if (!tA) {
|
|
17259
17257
|
const AA = {
|
|
17260
17258
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
@@ -17273,20 +17271,20 @@ function br({
|
|
|
17273
17271
|
createdAt: Date.now(),
|
|
17274
17272
|
lastUsedAt: Date.now()
|
|
17275
17273
|
};
|
|
17276
|
-
se((
|
|
17274
|
+
se((k) => [AA, ...k]), IA(AA.id), rA = AA.id, tA = AA;
|
|
17277
17275
|
}
|
|
17278
|
-
if (
|
|
17276
|
+
if (O?.skipBodyEstimate)
|
|
17279
17277
|
console.log("[ps-sdk:persist] skipping body estimates — face/head flow (no body context)");
|
|
17280
17278
|
else if (rA && d?.estimates) {
|
|
17281
|
-
const AA = d.estimates,
|
|
17282
|
-
wg(rA, AA,
|
|
17279
|
+
const AA = d.estimates, k = d.estimatesUnit || "cm";
|
|
17280
|
+
wg(rA, AA, k), se(Ke("profiles", []));
|
|
17283
17281
|
}
|
|
17284
17282
|
if (JA(!0), d?.recommendedSize && rA) {
|
|
17285
17283
|
const AA = d.sections ? Object.fromEntries(
|
|
17286
|
-
Object.entries(d.sections).map(([
|
|
17284
|
+
Object.entries(d.sections).map(([k, j]) => [k, j.recommendedSize])
|
|
17287
17285
|
) : void 0;
|
|
17288
17286
|
rt(rA, {
|
|
17289
|
-
productId:
|
|
17287
|
+
productId: U,
|
|
17290
17288
|
productTitle: i,
|
|
17291
17289
|
productImage: o,
|
|
17292
17290
|
recommendedSize: d.recommendedSize,
|
|
@@ -17296,17 +17294,17 @@ function br({
|
|
|
17296
17294
|
}), se(Ke("profiles", []));
|
|
17297
17295
|
}
|
|
17298
17296
|
},
|
|
17299
|
-
[
|
|
17300
|
-
), sg =
|
|
17301
|
-
const d = B.height ?? B.heightCm ?? 0,
|
|
17297
|
+
[P, PA, r, o, i, U, IA]
|
|
17298
|
+
), sg = hA(null), [Fo, Hg] = f(null), To = bA(async (B) => {
|
|
17299
|
+
const d = B.height ?? B.heightCm ?? 0, O = B.weight ?? B.weightKg ?? 0, rA = !!B.measurements && Object.keys(B.measurements).length > 0, tA = B.photoBase64;
|
|
17302
17300
|
if (!rA && tA && d > 0 && sg.current) {
|
|
17303
17301
|
try {
|
|
17304
|
-
const
|
|
17302
|
+
const k = tA.startsWith("data:") ? tA : `data:image/jpeg;base64,${tA}`, j = await fetch(k).then((ZA) => ZA.blob()), sA = new File([j], "profile-photo.jpg", { type: j.type || "image/jpeg" });
|
|
17305
17303
|
await sg.current({
|
|
17306
17304
|
photoFile: sA,
|
|
17307
17305
|
photoBase64: tA,
|
|
17308
17306
|
height: d,
|
|
17309
|
-
weight:
|
|
17307
|
+
weight: O,
|
|
17310
17308
|
heightUnit: B.heightUnit || "cm",
|
|
17311
17309
|
weightUnit: B.weightUnit || "kg",
|
|
17312
17310
|
gender: B.gender,
|
|
@@ -17320,45 +17318,45 @@ function br({
|
|
|
17320
17318
|
const AA = B.photoBase64;
|
|
17321
17319
|
if (AA)
|
|
17322
17320
|
try {
|
|
17323
|
-
const
|
|
17324
|
-
fetch(
|
|
17321
|
+
const k = AA.startsWith("data:") ? AA : `data:image/jpeg;base64,${AA}`;
|
|
17322
|
+
fetch(k).then((j) => j.blob()).then((j) => {
|
|
17325
17323
|
const sA = new File([j], "profile-photo.jpg", { type: j.type || "image/jpeg" });
|
|
17326
17324
|
S(sA), eA.current = sA, nA && URL.revokeObjectURL(nA), MA(URL.createObjectURL(sA));
|
|
17327
17325
|
}).catch(() => {
|
|
17328
17326
|
});
|
|
17329
17327
|
} catch {
|
|
17330
17328
|
}
|
|
17331
|
-
|
|
17332
|
-
productId:
|
|
17329
|
+
z("size-result"), st({
|
|
17330
|
+
productId: U,
|
|
17333
17331
|
productTitle: i,
|
|
17334
17332
|
productImage: o,
|
|
17335
|
-
sizeGuideData:
|
|
17333
|
+
sizeGuideData: G,
|
|
17336
17334
|
profile: B,
|
|
17337
17335
|
apiUrl: r,
|
|
17338
17336
|
skipCache: !0
|
|
17339
|
-
}).then((
|
|
17340
|
-
|
|
17337
|
+
}).then((k) => {
|
|
17338
|
+
k?.raw && ge(k.raw), JA(!0);
|
|
17341
17339
|
}).catch(() => {
|
|
17342
17340
|
}).finally(() => H(!1));
|
|
17343
|
-
}, [
|
|
17344
|
-
const B = PA.find((tA) => tA.id ===
|
|
17341
|
+
}, [U, i, o, G, r, nA]), Pt = bA(async () => {
|
|
17342
|
+
const B = PA.find((tA) => tA.id === P);
|
|
17345
17343
|
if (!B) return;
|
|
17346
|
-
const d = B.height ?? B.heightCm ?? 0,
|
|
17347
|
-
d > 0 &&
|
|
17348
|
-
}, [PA,
|
|
17344
|
+
const d = B.height ?? B.heightCm ?? 0, O = B.weight ?? B.weightKg ?? 0;
|
|
17345
|
+
d > 0 && O > 0 && To(B);
|
|
17346
|
+
}, [PA, P, To]), bt = bA(() => {
|
|
17349
17347
|
if (!Fo) return;
|
|
17350
17348
|
const B = Fo;
|
|
17351
17349
|
Hg(null), To(B);
|
|
17352
17350
|
}, [Fo, To]), xt = bA(() => {
|
|
17353
|
-
Hg(null), cA((B) => B + 1),
|
|
17354
|
-
}, []), Ht =
|
|
17351
|
+
Hg(null), cA((B) => B + 1), z("body-profile");
|
|
17352
|
+
}, []), Ht = hA(() => {
|
|
17355
17353
|
}), Mt = bA(() => {
|
|
17356
|
-
console.log("[ps-sdk] handleOpen fired — opening modal"),
|
|
17354
|
+
console.log("[ps-sdk] handleOpen fired — opening modal"), z("body-profile"), l?.();
|
|
17357
17355
|
}, [l]), ao = bA(() => {
|
|
17358
|
-
|
|
17356
|
+
z("idle"), S(null), D(null), fA(null), nA && URL.revokeObjectURL(nA), MA(null), YA(null), HA(null), de(null), ge(null), H(!1), xe(null), Ae(!1), he(!1), Ee(!1), m.current = {}, kA("male"), Bo.current = !1, Ao.current?.(), Ao.current = null, ye.current && (clearInterval(ye.current), ye.current = null), R?.();
|
|
17359
17357
|
}, [R, nA]), yt = bA(() => {
|
|
17360
17358
|
if (KA) {
|
|
17361
|
-
D(null), uA.current && (
|
|
17359
|
+
D(null), uA.current && (z(uA.current), uA.current = null);
|
|
17362
17360
|
return;
|
|
17363
17361
|
}
|
|
17364
17362
|
switch (oA) {
|
|
@@ -17366,30 +17364,30 @@ function br({
|
|
|
17366
17364
|
ao();
|
|
17367
17365
|
break;
|
|
17368
17366
|
case "estimation-review":
|
|
17369
|
-
|
|
17367
|
+
z("body-profile");
|
|
17370
17368
|
break;
|
|
17371
17369
|
case "size-result":
|
|
17372
17370
|
if (SA) {
|
|
17373
17371
|
Ce(null);
|
|
17374
17372
|
break;
|
|
17375
17373
|
}
|
|
17376
|
-
|
|
17374
|
+
z("body-profile");
|
|
17377
17375
|
break;
|
|
17378
17376
|
case "upload":
|
|
17379
|
-
|
|
17377
|
+
z("size-result");
|
|
17380
17378
|
break;
|
|
17381
17379
|
case "error":
|
|
17382
|
-
|
|
17380
|
+
z("body-profile");
|
|
17383
17381
|
break;
|
|
17384
17382
|
case "no-chart":
|
|
17385
|
-
|
|
17383
|
+
z("body-profile");
|
|
17386
17384
|
break;
|
|
17387
17385
|
case "profiles":
|
|
17388
17386
|
if (ee.current()) {
|
|
17389
17387
|
ue.current();
|
|
17390
17388
|
break;
|
|
17391
17389
|
}
|
|
17392
|
-
|
|
17390
|
+
z(uA.current || "body-profile"), uA.current = null;
|
|
17393
17391
|
break;
|
|
17394
17392
|
default:
|
|
17395
17393
|
ao();
|
|
@@ -17397,17 +17395,17 @@ function br({
|
|
|
17397
17395
|
}
|
|
17398
17396
|
}, [oA, KA, SA, ao]), Ft = oA !== "idle" && oA !== "processing" && oA !== "result" && oA !== "welcome" && oA !== "body-profile" && oA !== "size-result", ag = bA((B) => {
|
|
17399
17397
|
if (!Rt(B)) {
|
|
17400
|
-
HA(X("Please upload a JPEG, PNG, or WebP image.")),
|
|
17398
|
+
HA(X("Please upload a JPEG, PNG, or WebP image.")), z("error"), E?.({ message: "Invalid file type", code: "INVALID_FILE" });
|
|
17401
17399
|
return;
|
|
17402
17400
|
}
|
|
17403
17401
|
if (B.size > 10 * 1024 * 1024) {
|
|
17404
|
-
HA(X("Image must be under 10MB.")),
|
|
17402
|
+
HA(X("Image must be under 10MB.")), z("error"), E?.({ message: "File too large", code: "FILE_TOO_LARGE" });
|
|
17405
17403
|
return;
|
|
17406
17404
|
}
|
|
17407
17405
|
S(B), eA.current = B, qe.current = null;
|
|
17408
17406
|
const d = URL.createObjectURL(B);
|
|
17409
|
-
MA(d), V?.(B), pA.current = null, og(d).then((
|
|
17410
|
-
pA.current =
|
|
17407
|
+
MA(d), V?.(B), pA.current = null, og(d).then((O) => {
|
|
17408
|
+
pA.current = O;
|
|
17411
17409
|
}).catch(() => {
|
|
17412
17410
|
});
|
|
17413
17411
|
}, [V, E]), Mg = bA(() => {
|
|
@@ -17427,34 +17425,34 @@ function br({
|
|
|
17427
17425
|
d.textContent = X("Complete!"), d.style.opacity = "1";
|
|
17428
17426
|
}, 180);
|
|
17429
17427
|
}
|
|
17430
|
-
Co(), De(!1), oe(null),
|
|
17428
|
+
Co(), De(!1), oe(null), x?.({ jobId: B.galleryId, imageUrl: B.imageUrl });
|
|
17431
17429
|
}
|
|
17432
17430
|
} else if (B.status === "failed" && !Je.current) {
|
|
17433
17431
|
Je.current = !0, Co(), De(!1), oe(null);
|
|
17434
17432
|
const d = B.error || X("Try-on generation failed");
|
|
17435
|
-
HA(d),
|
|
17433
|
+
HA(d), z("error"), E?.({ message: d });
|
|
17436
17434
|
}
|
|
17437
|
-
}, [
|
|
17435
|
+
}, [x, E, Co]), oo = He(() => BA?.found && BA.requiredFields && BA.requiredFields.length > 0 ? BA.requiredFields : q === "female" ? hn : vn, [BA, q]), ko = bA(async (B) => {
|
|
17438
17436
|
if (!ze.current) return;
|
|
17439
|
-
const d = B || ne,
|
|
17437
|
+
const d = B || ne, O = je(r), rA = Re(), tA = wo(i);
|
|
17440
17438
|
if (tA === "face" || tA === "head") {
|
|
17441
|
-
const
|
|
17439
|
+
const k = m.current, j = (wA) => {
|
|
17442
17440
|
if (!wA) return;
|
|
17443
17441
|
const we = parseFloat(wA);
|
|
17444
17442
|
return Number.isFinite(we) && we > 0 ? we : void 0;
|
|
17445
|
-
}, sA =
|
|
17443
|
+
}, sA = k.sizingUnit || TA || (tA === "head" ? "cm" : "mm"), ZA = (wA) => {
|
|
17446
17444
|
if (wA != null)
|
|
17447
17445
|
return sA === "mm" ? wA : sA === "cm" ? wA * 10 : sA === "in" ? wA * 25.4 : wA;
|
|
17448
17446
|
}, DA = {}, te = {
|
|
17449
|
-
bridgeWidth: ZA(j(
|
|
17450
|
-
templeLength: ZA(j(
|
|
17451
|
-
lensWidth: ZA(j(
|
|
17452
|
-
lensHeight: ZA(j(
|
|
17453
|
-
faceWidth: ZA(j(
|
|
17454
|
-
pd: ZA(j(
|
|
17447
|
+
bridgeWidth: ZA(j(k.bridgeWidth)),
|
|
17448
|
+
templeLength: ZA(j(k.templeLength) ?? j(k.armLength)),
|
|
17449
|
+
lensWidth: ZA(j(k.lensWidth)),
|
|
17450
|
+
lensHeight: ZA(j(k.lensHeight)),
|
|
17451
|
+
faceWidth: ZA(j(k.faceWidth) ?? j(k.frameWidth)),
|
|
17452
|
+
pd: ZA(j(k.pd)),
|
|
17455
17453
|
// Headwear — circumference usually typed in cm; keep as mm internally.
|
|
17456
|
-
headCircumference: ZA(j(
|
|
17457
|
-
headWidth: ZA(j(
|
|
17454
|
+
headCircumference: ZA(j(k.headCircumference)),
|
|
17455
|
+
headWidth: ZA(j(k.headWidth))
|
|
17458
17456
|
};
|
|
17459
17457
|
for (const [wA, we] of Object.entries(te)) typeof we == "number" && (DA[wA] = we);
|
|
17460
17458
|
const $A = {
|
|
@@ -17465,20 +17463,20 @@ function br({
|
|
|
17465
17463
|
...Object.keys(DA).length > 0 && { faceMeasurementsMm: DA, irisConfidence: 1 }
|
|
17466
17464
|
}, ce = new Promise((wA) => setTimeout(wA, 4500));
|
|
17467
17465
|
try {
|
|
17468
|
-
const wA = await fetch(`${
|
|
17466
|
+
const wA = await fetch(`${O}/api/v1/sizing/face-recommend`, {
|
|
17469
17467
|
method: "POST",
|
|
17470
17468
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${rA}` },
|
|
17471
17469
|
body: JSON.stringify($A)
|
|
17472
17470
|
});
|
|
17473
17471
|
if (wA.ok) {
|
|
17474
17472
|
const we = await wA.json();
|
|
17475
|
-
await ce, ge(we),
|
|
17473
|
+
await ce, ge(we), x?.(we);
|
|
17476
17474
|
} else {
|
|
17477
17475
|
const we = await wA.text().catch(() => "");
|
|
17478
|
-
console.error("[PS-SDK] face-recommend failed:", wA.status, we), await ce, HA(X("Unable to get size recommendation. Please try again.")),
|
|
17476
|
+
console.error("[PS-SDK] face-recommend failed:", wA.status, we), await ce, HA(X("Unable to get size recommendation. Please try again.")), z("error"), JA(!0);
|
|
17479
17477
|
}
|
|
17480
17478
|
} catch (wA) {
|
|
17481
|
-
console.error("[PS-SDK] face-recommend network error:", wA), await ce, HA(X("Unable to connect to sizing service. Please try again.")),
|
|
17479
|
+
console.error("[PS-SDK] face-recommend network error:", wA), await ce, HA(X("Unable to connect to sizing service. Please try again.")), z("error"), JA(!0);
|
|
17482
17480
|
} finally {
|
|
17483
17481
|
H(!1);
|
|
17484
17482
|
}
|
|
@@ -17487,53 +17485,53 @@ function br({
|
|
|
17487
17485
|
const AA = {
|
|
17488
17486
|
method: d,
|
|
17489
17487
|
locale: J,
|
|
17490
|
-
product: { title: i, productId:
|
|
17488
|
+
product: { title: i, productId: U, description: "", variants: [] }
|
|
17491
17489
|
};
|
|
17492
|
-
if (BA?.found && (AA.sizeGuide = BA, BA.sections && (AA.sizeGuide = { ...BA, sections: BA.sections })), AA.sizingUnit = TA, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: BA?.found, hasHeaders: !!BA?.headers, hasRows: !!BA?.rows, headers: BA?.headers, rowCount: BA?.rows?.length, hasSections: !!BA?.sections, sectionNames: BA?.sections ? Object.keys(BA.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", AA.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", AA.sizeGuide && AA.sizeGuide.rows?.[0] ? Array.isArray(AA.sizeGuide.rows[0]) ? "array" : typeof AA.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(AA).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:", d, "| sizingUnit:", TA, "| heightUnit:", GA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(
|
|
17493
|
-
const
|
|
17490
|
+
if (BA?.found && (AA.sizeGuide = BA, BA.sections && (AA.sizeGuide = { ...BA, sections: BA.sections })), AA.sizingUnit = TA, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: BA?.found, hasHeaders: !!BA?.headers, hasRows: !!BA?.rows, headers: BA?.headers, rowCount: BA?.rows?.length, hasSections: !!BA?.sections, sectionNames: BA?.sections ? Object.keys(BA.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", AA.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", AA.sizeGuide && AA.sizeGuide.rows?.[0] ? Array.isArray(AA.sizeGuide.rows[0]) ? "array" : typeof AA.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(AA).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:", d, "| sizingUnit:", TA, "| heightUnit:", GA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(m.current)), console.log("[PS-SDK] dynamicFields:", oo.map((k) => `${k.key}(unit=${k.unit},req=${k.required})`).join(", ")), d === "exact") {
|
|
17491
|
+
const k = { gender: m.current.gender || "male", sizingUnit: TA }, j = /* @__PURE__ */ new Set();
|
|
17494
17492
|
for (const sA of oo)
|
|
17495
17493
|
sA.unit !== "size" && !["shoeEU", "shoeUS", "shoeUK"].includes(sA.key) && j.add(sA.key);
|
|
17496
17494
|
for (const sA of ["chest", "bust", "waist", "hips", "shoulderWidth", "sleeveLength", "inseam", "neckCircumference", "footLengthCm", "height", "length", "thighCircumference", "headCircumferenceCm", "faceWidthMm", "bridgeWidthMm", "templeLengthMm"])
|
|
17497
|
-
|
|
17495
|
+
m.current[sA] && j.add(sA);
|
|
17498
17496
|
console.log("[PS-SDK] numericKeys:", [...j].join(", "));
|
|
17499
17497
|
for (const sA of j) {
|
|
17500
|
-
const ZA =
|
|
17498
|
+
const ZA = m.current[sA];
|
|
17501
17499
|
if (!ZA) continue;
|
|
17502
17500
|
const DA = parseFloat(ZA);
|
|
17503
|
-
isNaN(DA) || (
|
|
17501
|
+
isNaN(DA) || (k[sA] = DA);
|
|
17504
17502
|
}
|
|
17505
|
-
|
|
17503
|
+
m.current.shoeEU && (k.shoeEU = m.current.shoeEU), m.current.shoeUS && (k.shoeUS = m.current.shoeUS), m.current.shoeUK && (k.shoeUK = m.current.shoeUK), m.current.fitPreference && (k.fitPreference = m.current.fitPreference), AA.measurements = k, console.log("[PS-SDK] FINAL measurements:", JSON.stringify(k));
|
|
17506
17504
|
} else {
|
|
17507
|
-
const
|
|
17508
|
-
if (!
|
|
17509
|
-
console.error("[PS-SDK] submitSizing ABORT — qHeight:",
|
|
17505
|
+
const k = parseFloat(m.current.height || "0"), j = parseFloat(m.current.weight || "0");
|
|
17506
|
+
if (!k || !j) {
|
|
17507
|
+
console.error("[PS-SDK] submitSizing ABORT — qHeight:", k, "qWeight:", j, "formRef:", JSON.stringify(m.current)), H(!1);
|
|
17510
17508
|
return;
|
|
17511
17509
|
}
|
|
17512
17510
|
const sA = {
|
|
17513
|
-
height:
|
|
17511
|
+
height: k,
|
|
17514
17512
|
weight: j,
|
|
17515
|
-
heightUnit:
|
|
17516
|
-
weightUnit:
|
|
17517
|
-
gender:
|
|
17513
|
+
heightUnit: m.current.heightUnit || GA || "cm",
|
|
17514
|
+
weightUnit: m.current.weightUnit || ie || "kg",
|
|
17515
|
+
gender: m.current.gender || "male"
|
|
17518
17516
|
};
|
|
17519
|
-
|
|
17517
|
+
m.current.age && (sA.age = parseInt(m.current.age, 10)), m.current.bodyType && (sA.bodyType = m.current.bodyType), m.current.chestProfile && (sA.chestProfile = m.current.chestProfile), m.current.midsectionProfile && (sA.midsectionProfile = m.current.midsectionProfile), m.current.hipProfile && (sA.hipProfile = m.current.hipProfile), AA.quickEstimate = sA;
|
|
17520
17518
|
}
|
|
17521
17519
|
JA(!1);
|
|
17522
17520
|
try {
|
|
17523
|
-
const
|
|
17521
|
+
const k = Date.now(), j = JSON.stringify(AA).length;
|
|
17524
17522
|
console.log(`[ps-sdk:T] ▶ POST /sizing/recommend (quick) payload=${Math.round(j / 1024)}KB bodyImage=${!!AA.bodyImage}`);
|
|
17525
|
-
const sA = await fetch(`${
|
|
17523
|
+
const sA = await fetch(`${O}/api/v1/sizing/recommend`, {
|
|
17526
17524
|
method: "POST",
|
|
17527
17525
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${rA}` },
|
|
17528
17526
|
body: JSON.stringify(AA)
|
|
17529
17527
|
});
|
|
17530
|
-
if (console.log(`[ps-sdk:T] ◀ /sizing/recommend (quick) status=${sA.status} roundTrip=${Date.now() -
|
|
17528
|
+
if (console.log(`[ps-sdk:T] ◀ /sizing/recommend (quick) status=${sA.status} roundTrip=${Date.now() - k}ms`), sA.ok) {
|
|
17531
17529
|
const ZA = await sA.json();
|
|
17532
17530
|
if (console.log("[PS-SDK] Sizing recommend RESULT:", JSON.stringify(ZA)), ZA?.found === !1 && ZA?.reasoning === "NO_SIZE_CHART") {
|
|
17533
|
-
|
|
17531
|
+
z("no-chart"), JA(!0);
|
|
17534
17532
|
return;
|
|
17535
17533
|
}
|
|
17536
|
-
ge(ZA),
|
|
17534
|
+
ge(ZA), x?.(ZA);
|
|
17537
17535
|
const DA = AA.measurements || {}, te = AA.quickEstimate || {}, $A = d === "exact" ? DA : te;
|
|
17538
17536
|
yo(
|
|
17539
17537
|
{
|
|
@@ -17551,17 +17549,17 @@ function br({
|
|
|
17551
17549
|
);
|
|
17552
17550
|
} else {
|
|
17553
17551
|
const ZA = await sA.text().catch(() => "");
|
|
17554
|
-
console.error("[PS-SDK] Sizing recommend failed:", sA.status, ZA), HA(X("Unable to get size recommendation. Please try again.")),
|
|
17552
|
+
console.error("[PS-SDK] Sizing recommend failed:", sA.status, ZA), HA(X("Unable to get size recommendation. Please try again.")), z("error"), JA(!0);
|
|
17555
17553
|
}
|
|
17556
|
-
} catch (
|
|
17557
|
-
console.error("[PS-SDK] Sizing recommend network error:",
|
|
17554
|
+
} catch (k) {
|
|
17555
|
+
console.error("[PS-SDK] Sizing recommend network error:", k), HA(X("Unable to connect to sizing service. Please try again.")), z("error"), JA(!0);
|
|
17558
17556
|
} finally {
|
|
17559
17557
|
H(!1);
|
|
17560
17558
|
}
|
|
17561
|
-
}, [r, ne, J, GA, ie, TA, BA, i, oo, yo]), kt = bA(async (B, d,
|
|
17559
|
+
}, [r, ne, J, GA, ie, TA, BA, i, oo, yo]), kt = bA(async (B, d, O, rA, tA, AA, k, j, sA, ZA, DA) => {
|
|
17562
17560
|
if (!ze.current) {
|
|
17563
17561
|
const wA = X("SDK not configured. Please refresh and try again.");
|
|
17564
|
-
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), HA(wA),
|
|
17562
|
+
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), HA(wA), z("error"), E?.({ message: wA, code: "SDK_NOT_CONFIGURED" });
|
|
17565
17563
|
return;
|
|
17566
17564
|
}
|
|
17567
17565
|
je(r), Re();
|
|
@@ -17576,10 +17574,10 @@ function br({
|
|
|
17576
17574
|
wA.required && wA.unit === "cm" && !te.has(wA.key) && $A.add(wA.key);
|
|
17577
17575
|
const ce = Array.from($A);
|
|
17578
17576
|
if (console.log("[PS-SDK] Quick estimate — dynamicFields:", oo.map((wA) => `${wA.key}(${wA.unit},req=${wA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:", ce), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: j, midsectionProfile: sA, hipProfile: ZA }), ce.length === 0) {
|
|
17579
|
-
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), nA && URL.revokeObjectURL(nA), S(null), eA.current = null, MA(null), be(null), Ve(null), de("quick"), H(!0),
|
|
17577
|
+
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), nA && URL.revokeObjectURL(nA), S(null), eA.current = null, MA(null), be(null), Ve(null), de("quick"), H(!0), z("size-result"), ko("quick");
|
|
17580
17578
|
return;
|
|
17581
17579
|
}
|
|
17582
|
-
|
|
17580
|
+
m.current.height = String(B), m.current.weight = String(d), m.current.heightUnit = O, m.current.weightUnit = rA, m.current.gender = tA, AA && (m.current.age = String(AA)), k && (m.current.bodyType = k), j && (m.current.chestProfile = j), sA && (m.current.midsectionProfile = sA), ZA && (m.current.hipProfile = ZA), ge(null), YA(null), nA && URL.revokeObjectURL(nA), S(null), eA.current = null, MA(null), be(null), Ve(null), de("quick"), H(!0), z("size-result"), ko("quick");
|
|
17583
17581
|
}, [r, oo, BA, ko, TA, ie, nA]), cg = bA(async (B) => {
|
|
17584
17582
|
if (console.log("[ps-sdk] handleSnapSubmit fired", {
|
|
17585
17583
|
hasApiRef: !!ze.current,
|
|
@@ -17587,13 +17585,13 @@ function br({
|
|
|
17587
17585
|
apiUrl: r
|
|
17588
17586
|
}), !ze.current || !We.current) {
|
|
17589
17587
|
const DA = X("SDK not configured. Please refresh and try again.");
|
|
17590
|
-
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), HA(DA),
|
|
17588
|
+
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), HA(DA), z("error"), E?.({ message: DA, code: "SDK_NOT_CONFIGURED" });
|
|
17591
17589
|
return;
|
|
17592
17590
|
}
|
|
17593
|
-
const d = je(r),
|
|
17591
|
+
const d = je(r), O = Re();
|
|
17594
17592
|
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: d }), S(B.photoFile), eA.current = B.photoFile;
|
|
17595
17593
|
const rA = B.photoFile ? URL.createObjectURL(B.photoFile) : B.photoBase64.startsWith("data:") ? B.photoBase64 : `data:image/jpeg;base64,${B.photoBase64}`;
|
|
17596
|
-
MA(rA), Je.current = !1, qe.current = null, FA.current = !1, De(!1), oe(null), ge(null), YA(null), H(!0), JA(!1),
|
|
17594
|
+
MA(rA), Je.current = !1, qe.current = null, FA.current = !1, De(!1), oe(null), ge(null), YA(null), H(!0), JA(!1), z("size-result");
|
|
17597
17595
|
const tA = wo(i);
|
|
17598
17596
|
if (tA === "face" || tA === "head") {
|
|
17599
17597
|
Ve(null);
|
|
@@ -17603,12 +17601,12 @@ function br({
|
|
|
17603
17601
|
if (!te) {
|
|
17604
17602
|
console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product"), await DA;
|
|
17605
17603
|
const wA = X(tA === "head" ? "We couldn't detect your head clearly. Please upload a close-up photo that shows your full head and ears." : "We couldn't detect your face clearly. Please upload a close-up selfie that shows both eyes.");
|
|
17606
|
-
HA(wA),
|
|
17604
|
+
HA(wA), z("error"), E?.({ message: wA, code: "FACE_DETECTION_FAILED" }), H(!1);
|
|
17607
17605
|
return;
|
|
17608
17606
|
}
|
|
17609
17607
|
te && Ve(te.landmarks);
|
|
17610
17608
|
const $A = {
|
|
17611
|
-
product: { title: i, productId:
|
|
17609
|
+
product: { title: i, productId: U },
|
|
17612
17610
|
sizeGuide: BA ?? { found: !1 },
|
|
17613
17611
|
sizingUnit: tA === "head" ? "cm" : "mm",
|
|
17614
17612
|
category: tA,
|
|
@@ -17617,12 +17615,12 @@ function br({
|
|
|
17617
17615
|
te && ($A.faceMeasurementsMm = te.measurementsMm, $A.faceLandmarks = te.landmarks, $A.irisConfidence = te.irisConfidence);
|
|
17618
17616
|
const ce = await fetch(`${d}/api/v1/sizing/face-recommend`, {
|
|
17619
17617
|
method: "POST",
|
|
17620
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${
|
|
17618
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${O}` },
|
|
17621
17619
|
body: JSON.stringify($A)
|
|
17622
17620
|
});
|
|
17623
17621
|
if (ce.ok) {
|
|
17624
17622
|
const wA = await ce.json();
|
|
17625
|
-
await DA, ge(wA),
|
|
17623
|
+
await DA, ge(wA), x?.(wA), yo(
|
|
17626
17624
|
{
|
|
17627
17625
|
gender: B.gender,
|
|
17628
17626
|
height: B.height,
|
|
@@ -17644,16 +17642,16 @@ function br({
|
|
|
17644
17642
|
return;
|
|
17645
17643
|
}
|
|
17646
17644
|
pA.current = null, be(null), og(rA).then((DA) => (pA.current = DA, DA)).catch(() => null);
|
|
17647
|
-
const AA = po(rA).then((DA) => (be(DA), DA)).catch(() => null),
|
|
17645
|
+
const AA = po(rA).then((DA) => (be(DA), DA)).catch(() => null), k = 8e3, j = await Promise.race([
|
|
17648
17646
|
AA,
|
|
17649
|
-
new Promise((DA) => setTimeout(() => DA(null),
|
|
17647
|
+
new Promise((DA) => setTimeout(() => DA(null), k))
|
|
17650
17648
|
]);
|
|
17651
|
-
j || console.log("[ps-sdk] landmarks not ready in",
|
|
17649
|
+
j || console.log("[ps-sdk] landmarks not ready in", k, "ms — proceeding without them"), xn(j);
|
|
17652
17650
|
const sA = {
|
|
17653
17651
|
method: "photo",
|
|
17654
17652
|
locale: J,
|
|
17655
17653
|
sizingUnit: TA,
|
|
17656
|
-
product: { title: i, productId:
|
|
17654
|
+
product: { title: i, productId: U, description: "", variants: [] },
|
|
17657
17655
|
bodyImage: B.photoBase64,
|
|
17658
17656
|
// BlazePose landmarks (normalized 0–1 coordinates). The backend uses
|
|
17659
17657
|
// these to compute exact pixel distances and feed them to Gemini as
|
|
@@ -17701,17 +17699,17 @@ function br({
|
|
|
17701
17699
|
console.log(`[ps-sdk:T] ▶ POST /sizing/recommend payload=${Math.round(te / 1024)}KB bodyImage=${!!sA.bodyImage} landmarks=${!!sA.bodyLandmarks}`);
|
|
17702
17700
|
const $A = await fetch(`${d}/api/v1/sizing/recommend`, {
|
|
17703
17701
|
method: "POST",
|
|
17704
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${
|
|
17702
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${O}` },
|
|
17705
17703
|
body: JSON.stringify(sA)
|
|
17706
17704
|
});
|
|
17707
17705
|
if (console.log(`[ps-sdk:T] ◀ /sizing/recommend status=${$A.status} roundTrip=${Date.now() - DA}ms`), $A.ok) {
|
|
17708
17706
|
const ce = await $A.json();
|
|
17709
17707
|
if (ce?.found === !1 && ce?.reasoning === "NO_SIZE_CHART") {
|
|
17710
|
-
|
|
17708
|
+
z("no-chart"), JA(!0), H(!1);
|
|
17711
17709
|
return;
|
|
17712
17710
|
}
|
|
17713
17711
|
const wA = mr(ce);
|
|
17714
|
-
ce?.found === !1 || wA != null && wA < 50 ? (console.log(`[ps-sdk:gate] LOW FIT (match=${wA ?? "?"}%, found=${ce?.found}) — suppressing try-on`), FA.current = !0, De(!1), oe(null), ge({ ...ce, found: !1 }),
|
|
17712
|
+
ce?.found === !1 || wA != null && wA < 50 ? (console.log(`[ps-sdk:gate] LOW FIT (match=${wA ?? "?"}%, found=${ce?.found}) — suppressing try-on`), FA.current = !0, De(!1), oe(null), ge({ ...ce, found: !1 }), x?.({ ...ce, found: !1 })) : (ge(ce), x?.(ce), yo(
|
|
17715
17713
|
{
|
|
17716
17714
|
gender: B.gender,
|
|
17717
17715
|
height: B.height,
|
|
@@ -17735,11 +17733,11 @@ function br({
|
|
|
17735
17733
|
const d = B || vA || eA.current;
|
|
17736
17734
|
if (!d || !ze.current || !We.current) {
|
|
17737
17735
|
const AA = ze.current ? X("Please upload a photo first.") : X("SDK not configured. Please provide an API key.");
|
|
17738
|
-
HA(AA),
|
|
17736
|
+
HA(AA), z("error"), E?.({ message: AA, code: "SDK_NOT_CONFIGURED" });
|
|
17739
17737
|
return;
|
|
17740
17738
|
}
|
|
17741
17739
|
B && B !== vA && (S(B), eA.current = B), Je.current = !1, De(!0), oe(Date.now());
|
|
17742
|
-
const
|
|
17740
|
+
const O = Pr(wo(i)), rA = O === "apparel", tA = (B ? null : nA) || URL.createObjectURL(d);
|
|
17743
17741
|
(B || !nA) && MA(tA), rA && (!pA.current || !le) && (pA.current = null, be(null), og(tA).then((AA) => {
|
|
17744
17742
|
pA.current = AA;
|
|
17745
17743
|
}).catch(() => {
|
|
@@ -17748,17 +17746,17 @@ function br({
|
|
|
17748
17746
|
}).catch(() => {
|
|
17749
17747
|
}));
|
|
17750
17748
|
try {
|
|
17751
|
-
const AA = await uo(d, rA ? { maxDimension: 1024, quality: 0.85 } : {}),
|
|
17749
|
+
const AA = await uo(d, rA ? { maxDimension: 1024, quality: 0.85 } : {}), k = Z.current, j = Object.keys(k), sA = j.length > 0, ZA = sA ? (() => {
|
|
17752
17750
|
const NA = /* @__PURE__ */ new Set(), Ne = [];
|
|
17753
17751
|
for (const co of j) {
|
|
17754
|
-
const Ue =
|
|
17752
|
+
const Ue = k[co]?.matchDetails || [];
|
|
17755
17753
|
for (const Qo of Ue) {
|
|
17756
17754
|
const Xo = Qo.measurement.toLowerCase().trim();
|
|
17757
17755
|
NA.has(Xo) || (NA.add(Xo), Ne.push(Qo));
|
|
17758
17756
|
}
|
|
17759
17757
|
}
|
|
17760
17758
|
return Ne;
|
|
17761
|
-
})() : null, DA = sA ? j.map((NA) => `${NA.replace(/\s*[—–-]\s*.*/g, "").trim()} ${
|
|
17759
|
+
})() : null, DA = sA ? j.map((NA) => `${NA.replace(/\s*[—–-]\s*.*/g, "").trim()} ${k[NA].displayLabel}`).join(", ") : void 0, te = sA ? {
|
|
17762
17760
|
selectedSize: DA ?? "",
|
|
17763
17761
|
displayLabel: DA ?? "",
|
|
17764
17762
|
matchDetails: ZA ?? void 0
|
|
@@ -17806,9 +17804,9 @@ function br({
|
|
|
17806
17804
|
AA,
|
|
17807
17805
|
we,
|
|
17808
17806
|
wA,
|
|
17809
|
-
|
|
17807
|
+
O ?? "apparel",
|
|
17810
17808
|
{
|
|
17811
|
-
productId:
|
|
17809
|
+
productId: U,
|
|
17812
17810
|
productTitle: i,
|
|
17813
17811
|
productDescription: c,
|
|
17814
17812
|
productMaterial: n,
|
|
@@ -17817,9 +17815,9 @@ function br({
|
|
|
17817
17815
|
BA,
|
|
17818
17816
|
te?.displayLabel,
|
|
17819
17817
|
(() => {
|
|
17820
|
-
const NA = parseFloat(
|
|
17818
|
+
const NA = parseFloat(m.current.height || "0");
|
|
17821
17819
|
if (!NA || NA <= 0) return;
|
|
17822
|
-
const Ne =
|
|
17820
|
+
const Ne = m.current.heightUnit || GA || "cm";
|
|
17823
17821
|
if (Ne === "ft") {
|
|
17824
17822
|
const co = Math.floor(NA), Ue = Math.round((NA - co) * 12);
|
|
17825
17823
|
return `${co}'${Ue}"`;
|
|
@@ -17827,9 +17825,9 @@ function br({
|
|
|
17827
17825
|
return Ne === "in" ? `${NA}"` : `${NA} cm`;
|
|
17828
17826
|
})(),
|
|
17829
17827
|
(() => {
|
|
17830
|
-
const NA = parseFloat(
|
|
17828
|
+
const NA = parseFloat(m.current.weight || "0");
|
|
17831
17829
|
if (!NA || NA <= 0) return;
|
|
17832
|
-
const Ne =
|
|
17830
|
+
const Ne = m.current.weightUnit || ie || "kg";
|
|
17833
17831
|
return `${NA} ${Ne}`;
|
|
17834
17832
|
})()
|
|
17835
17833
|
),
|
|
@@ -17854,8 +17852,8 @@ function br({
|
|
|
17854
17852
|
}
|
|
17855
17853
|
}, 3e3);
|
|
17856
17854
|
} catch (AA) {
|
|
17857
|
-
const
|
|
17858
|
-
HA(
|
|
17855
|
+
const k = AA instanceof Error ? AA.message : X("Failed to start try-on"), j = AA instanceof Tg ? AA.code : void 0;
|
|
17856
|
+
HA(k), z("error"), E?.({ message: k, code: j });
|
|
17859
17857
|
}
|
|
17860
17858
|
}, [vA, o, i, dA, s, E, Bg]);
|
|
17861
17859
|
xA(() => {
|
|
@@ -17872,41 +17870,41 @@ function br({
|
|
|
17872
17870
|
B.href = iA, B.download = `primestyle-tryon-${Date.now()}.png`, B.click();
|
|
17873
17871
|
} else
|
|
17874
17872
|
fetch(iA).then((B) => B.blob()).then((B) => {
|
|
17875
|
-
const d = URL.createObjectURL(B),
|
|
17876
|
-
|
|
17873
|
+
const d = URL.createObjectURL(B), O = document.createElement("a");
|
|
17874
|
+
O.href = d, O.download = `primestyle-tryon-${Date.now()}.png`, O.click(), setTimeout(() => URL.revokeObjectURL(d), 100);
|
|
17877
17875
|
}).catch(() => window.open(iA, "_blank"));
|
|
17878
17876
|
}, [iA]), Gt = bA(() => {
|
|
17879
|
-
Je.current = !1, Co(), S(null), nA && URL.revokeObjectURL(nA), MA(null), YA(null), HA(null), de(null), ge(null), H(!1), Ee(!1),
|
|
17877
|
+
Je.current = !1, Co(), S(null), nA && URL.revokeObjectURL(nA), MA(null), YA(null), HA(null), de(null), ge(null), H(!1), Ee(!1), z("body-profile");
|
|
17880
17878
|
}, [nA, Co]), Lt = bA((B) => {
|
|
17881
17879
|
const d = PA.find((rA) => rA.id === B);
|
|
17882
17880
|
if (!d) return;
|
|
17883
17881
|
IA(B), se((rA) => rA.map((tA) => tA.id === B ? { ...tA, lastUsedAt: Date.now() } : tA));
|
|
17884
|
-
const
|
|
17885
|
-
if ((d.height ?? d.heightCm) && (
|
|
17882
|
+
const O = { gender: d.gender || "male" };
|
|
17883
|
+
if ((d.height ?? d.heightCm) && (O.height = String(d.height ?? d.heightCm)), (d.weight ?? d.weightKg) && (O.weight = String(d.weight ?? d.weightKg)), d.chest && (O.chest = String(d.chest)), d.bust && (O.bust = String(d.bust)), d.waist && (O.waist = String(d.waist)), d.hips && (O.hips = String(d.hips)), d.shoulderWidth && (O.shoulderWidth = String(d.shoulderWidth)), d.sleeveLength && (O.sleeveLength = String(d.sleeveLength)), d.inseam && (O.inseam = String(d.inseam)), d.neckCircumference && (O.neckCircumference = String(d.neckCircumference)), d.footLengthCm && (O.footLengthCm = String(d.footLengthCm)), d.shoeEU && (O.shoeEU = d.shoeEU), d.shoeUS && (O.shoeUS = d.shoeUS), d.shoeUK && (O.shoeUK = d.shoeUK), d.fitPreference && (O.fitPreference = d.fitPreference), d.customMeasurements)
|
|
17886
17884
|
for (const [rA, tA] of Object.entries(d.customMeasurements))
|
|
17887
|
-
|
|
17888
|
-
|
|
17885
|
+
O[rA] = String(tA);
|
|
17886
|
+
m.current = O, kA(O.gender || "male"), d.country && QA(d.country), d.sizingUnit && ve(d.sizingUnit), d.heightUnit && OA(d.heightUnit), d.weightUnit && XA(d.weightUnit), cA((rA) => rA + 1);
|
|
17889
17887
|
}, [PA]);
|
|
17890
17888
|
Ht.current = Lt, bA((B, d) => {
|
|
17891
|
-
const
|
|
17892
|
-
id:
|
|
17889
|
+
const O = (d ? null : P) || `p_${Date.now()}`, rA = {
|
|
17890
|
+
id: O,
|
|
17893
17891
|
name: B,
|
|
17894
|
-
gender:
|
|
17895
|
-
height:
|
|
17896
|
-
weight:
|
|
17897
|
-
chest:
|
|
17898
|
-
bust:
|
|
17899
|
-
waist:
|
|
17900
|
-
hips:
|
|
17901
|
-
shoulderWidth:
|
|
17902
|
-
sleeveLength:
|
|
17903
|
-
inseam:
|
|
17904
|
-
neckCircumference:
|
|
17905
|
-
footLengthCm:
|
|
17906
|
-
shoeEU:
|
|
17907
|
-
shoeUS:
|
|
17908
|
-
shoeUK:
|
|
17909
|
-
fitPreference:
|
|
17892
|
+
gender: m.current.gender || "male",
|
|
17893
|
+
height: m.current.height ? parseFloat(m.current.height) : void 0,
|
|
17894
|
+
weight: m.current.weight ? parseFloat(m.current.weight) : void 0,
|
|
17895
|
+
chest: m.current.chest ? parseFloat(m.current.chest) : void 0,
|
|
17896
|
+
bust: m.current.bust ? parseFloat(m.current.bust) : void 0,
|
|
17897
|
+
waist: m.current.waist ? parseFloat(m.current.waist) : void 0,
|
|
17898
|
+
hips: m.current.hips ? parseFloat(m.current.hips) : void 0,
|
|
17899
|
+
shoulderWidth: m.current.shoulderWidth ? parseFloat(m.current.shoulderWidth) : void 0,
|
|
17900
|
+
sleeveLength: m.current.sleeveLength ? parseFloat(m.current.sleeveLength) : void 0,
|
|
17901
|
+
inseam: m.current.inseam ? parseFloat(m.current.inseam) : void 0,
|
|
17902
|
+
neckCircumference: m.current.neckCircumference ? parseFloat(m.current.neckCircumference) : void 0,
|
|
17903
|
+
footLengthCm: m.current.footLengthCm ? parseFloat(m.current.footLengthCm) : void 0,
|
|
17904
|
+
shoeEU: m.current.shoeEU,
|
|
17905
|
+
shoeUS: m.current.shoeUS,
|
|
17906
|
+
shoeUK: m.current.shoeUK,
|
|
17907
|
+
fitPreference: m.current.fitPreference,
|
|
17910
17908
|
country: J,
|
|
17911
17909
|
sizingUnit: TA,
|
|
17912
17910
|
heightUnit: GA,
|
|
@@ -17932,24 +17930,24 @@ function br({
|
|
|
17932
17930
|
"heightFeet",
|
|
17933
17931
|
"heightInches"
|
|
17934
17932
|
]), AA = {};
|
|
17935
|
-
for (const [
|
|
17936
|
-
!tA.has(
|
|
17937
|
-
Object.keys(AA).length > 0 && (rA.customMeasurements = AA), se((
|
|
17938
|
-
const j =
|
|
17933
|
+
for (const [k, j] of Object.entries(m.current))
|
|
17934
|
+
!tA.has(k) && j && !isNaN(Number(j)) && (AA[k] = parseFloat(j));
|
|
17935
|
+
Object.keys(AA).length > 0 && (rA.customMeasurements = AA), se((k) => {
|
|
17936
|
+
const j = k.findIndex((sA) => sA.id === O);
|
|
17939
17937
|
if (j >= 0) {
|
|
17940
|
-
const sA = [...
|
|
17938
|
+
const sA = [...k];
|
|
17941
17939
|
return sA[j] = rA, sA;
|
|
17942
17940
|
}
|
|
17943
|
-
return [...
|
|
17944
|
-
}), IA(
|
|
17945
|
-
}, [
|
|
17941
|
+
return [...k, rA].slice(-50);
|
|
17942
|
+
}), IA(O), Ee(!0);
|
|
17943
|
+
}, [P, J, TA, GA, ie]);
|
|
17946
17944
|
const yg = bA(async () => {
|
|
17947
17945
|
const B = `h_${Date.now()}`;
|
|
17948
17946
|
let d = !1;
|
|
17949
|
-
const
|
|
17950
|
-
if (
|
|
17947
|
+
const O = vA || eA.current;
|
|
17948
|
+
if (O)
|
|
17951
17949
|
try {
|
|
17952
|
-
const j = await uo(
|
|
17950
|
+
const j = await uo(O, { maxDimension: 768, quality: 0.7 }), sA = await (await fetch(j)).blob();
|
|
17953
17951
|
d = await Xg(B, sA);
|
|
17954
17952
|
} catch {
|
|
17955
17953
|
}
|
|
@@ -17959,7 +17957,7 @@ function br({
|
|
|
17959
17957
|
selectedLength: j.selectedLength,
|
|
17960
17958
|
displayLabel: j.displayLabel,
|
|
17961
17959
|
isOverride: !!tA && j.selectedSize !== tA
|
|
17962
|
-
})),
|
|
17960
|
+
})), k = {
|
|
17963
17961
|
id: B,
|
|
17964
17962
|
productTitle: i,
|
|
17965
17963
|
productImage: o,
|
|
@@ -17982,22 +17980,22 @@ function br({
|
|
|
17982
17980
|
hasPhoto: d || void 0,
|
|
17983
17981
|
selectedSizes: AA.length ? AA : void 0
|
|
17984
17982
|
};
|
|
17985
|
-
if (
|
|
17986
|
-
const j = PA.find((sA) => sA.id ===
|
|
17987
|
-
j && (
|
|
17983
|
+
if (P) {
|
|
17984
|
+
const j = PA.find((sA) => sA.id === P);
|
|
17985
|
+
j && (k.profileName = j.name);
|
|
17988
17986
|
}
|
|
17989
|
-
|
|
17990
|
-
const sA = [
|
|
17987
|
+
b((j) => {
|
|
17988
|
+
const sA = [k, ...j].slice(0, 50), ZA = new Set(sA.map((DA) => DA.id));
|
|
17991
17989
|
return qt(ZA), sA;
|
|
17992
17990
|
});
|
|
17993
|
-
}, [i, o, iA, dA, BA,
|
|
17991
|
+
}, [i, o, iA, dA, BA, P, PA, vA]), Bo = hA(!1), Go = hA(!1);
|
|
17994
17992
|
xA(() => {
|
|
17995
17993
|
if (oA === "size-result" && dA && !Bo.current)
|
|
17996
17994
|
Bo.current = !0, Go.current = !1, yg().catch(() => {
|
|
17997
17995
|
});
|
|
17998
17996
|
else if (oA === "size-result" && dA && iA && !Go.current) {
|
|
17999
17997
|
Go.current = !0;
|
|
18000
|
-
const B = Z.current, d = dA?.recommendedSize ?? "",
|
|
17998
|
+
const B = Z.current, d = dA?.recommendedSize ?? "", O = Object.values(B).map((tA) => ({
|
|
18001
17999
|
sectionName: tA.sectionName,
|
|
18002
18000
|
selectedSize: tA.selectedSize,
|
|
18003
18001
|
selectedLength: tA.selectedLength,
|
|
@@ -18005,19 +18003,19 @@ function br({
|
|
|
18005
18003
|
isOverride: !!d && tA.selectedSize !== d
|
|
18006
18004
|
}));
|
|
18007
18005
|
let rA = null;
|
|
18008
|
-
if (
|
|
18006
|
+
if (b((tA) => tA.length === 0 ? tA : (rA = tA[0].id, [{
|
|
18009
18007
|
...tA[0],
|
|
18010
18008
|
resultImageUrl: iA,
|
|
18011
18009
|
hasResult: !0,
|
|
18012
|
-
...
|
|
18010
|
+
...O.length ? { selectedSizes: O } : {}
|
|
18013
18011
|
}, ...tA.slice(1)])), rA) {
|
|
18014
18012
|
const tA = rA;
|
|
18015
18013
|
(async () => {
|
|
18016
18014
|
try {
|
|
18017
18015
|
const AA = await fetch(iA);
|
|
18018
18016
|
if (!AA.ok) return;
|
|
18019
|
-
const
|
|
18020
|
-
await Wt(tA,
|
|
18017
|
+
const k = await AA.blob();
|
|
18018
|
+
await Wt(tA, k);
|
|
18021
18019
|
} catch {
|
|
18022
18020
|
}
|
|
18023
18021
|
})();
|
|
@@ -18034,26 +18032,26 @@ function br({
|
|
|
18034
18032
|
matchDetails: B.matchDetails
|
|
18035
18033
|
}), B.sizeGuide && (RA(B.sizeGuide), gA(!1)), YA(B.resultImageUrl || null), (B.hasResult || B.resultImageUrl) && Vt(B.id).then((d) => {
|
|
18036
18034
|
if (!d) return;
|
|
18037
|
-
const
|
|
18038
|
-
YA(
|
|
18035
|
+
const O = URL.createObjectURL(d);
|
|
18036
|
+
YA(O);
|
|
18039
18037
|
}), B.hasPhoto && Wg(B.id).then((d) => {
|
|
18040
18038
|
if (!d) return;
|
|
18041
|
-
const
|
|
18042
|
-
S(
|
|
18039
|
+
const O = new File([d], `history-photo-${B.id}.jpg`, { type: d.type || "image/jpeg" });
|
|
18040
|
+
S(O), eA.current = O;
|
|
18043
18041
|
}), B.selectedSizes && B.selectedSizes.length) {
|
|
18044
18042
|
const d = {};
|
|
18045
|
-
for (const
|
|
18046
|
-
d[
|
|
18047
|
-
sectionName:
|
|
18048
|
-
selectedSize:
|
|
18049
|
-
selectedLength:
|
|
18050
|
-
displayLabel:
|
|
18043
|
+
for (const O of B.selectedSizes)
|
|
18044
|
+
d[O.sectionName] = {
|
|
18045
|
+
sectionName: O.sectionName,
|
|
18046
|
+
selectedSize: O.selectedSize,
|
|
18047
|
+
selectedLength: O.selectedLength,
|
|
18048
|
+
displayLabel: O.displayLabel
|
|
18051
18049
|
};
|
|
18052
18050
|
Ie(d), Z.current = d;
|
|
18053
18051
|
}
|
|
18054
|
-
H(!1), De(!1), oe(null), Ce(null), D(null),
|
|
18052
|
+
H(!1), De(!1), oe(null), Ce(null), D(null), z("size-result");
|
|
18055
18053
|
}, []), zt = bA((B, d) => {
|
|
18056
|
-
|
|
18054
|
+
m.current[B] = d;
|
|
18057
18055
|
}, []);
|
|
18058
18056
|
He(() => {
|
|
18059
18057
|
const d = {
|
|
@@ -18117,20 +18115,20 @@ function br({
|
|
|
18117
18115
|
function Ut() {
|
|
18118
18116
|
switch (oA) {
|
|
18119
18117
|
case "welcome":
|
|
18120
|
-
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(Vn, { productImage: o, setView:
|
|
18118
|
+
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(Vn, { productImage: o, setView: z, t: X }) }, "v-welcome");
|
|
18121
18119
|
case "body-profile": {
|
|
18122
|
-
const B = wo(i), d = { productImage: o, productTitle: i, formRef:
|
|
18120
|
+
const B = wo(i), d = { productImage: o, productTitle: i, formRef: m, sizingUnit: TA, setSizingUnit: ve, setSizingMethod: de, setSizingLoading: H, setView: z, submitSizing: ko, onSnapSubmit: cg, onBack: ao, apiUrl: je(r), apiKey: Re(), sizeGuide: BA, t: X };
|
|
18123
18121
|
if (B === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(Dr, { ...d }) }, "v-foot");
|
|
18124
18122
|
if (B === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(hr, { ...d }) }, "v-head");
|
|
18125
18123
|
if (B === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(ur, { ...d }) }, "v-face");
|
|
18126
|
-
const
|
|
18124
|
+
const O = !!(BA?.requiredFields?.some((k) => k.key === "bust") || BA?.sections && Object.values(BA.sections).some((k) => k.requiredFields?.some((j) => j.key === "bust"))), rA = i.toLowerCase(), tA = /\b(women|woman|ladies|female|dress|skirt|blouse|bra)\b/i.test(rA);
|
|
18127
18125
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
18128
18126
|
pr,
|
|
18129
18127
|
{
|
|
18130
18128
|
productImage: o,
|
|
18131
18129
|
productTitle: i,
|
|
18132
|
-
isWomen:
|
|
18133
|
-
formRef:
|
|
18130
|
+
isWomen: O || tA,
|
|
18131
|
+
formRef: m,
|
|
18134
18132
|
sizingCountry: J,
|
|
18135
18133
|
heightUnit: GA,
|
|
18136
18134
|
setHeightUnit: OA,
|
|
@@ -18141,39 +18139,39 @@ function br({
|
|
|
18141
18139
|
apiUrl: je(r),
|
|
18142
18140
|
apiKey: Re(),
|
|
18143
18141
|
hasActiveProfileWithMeasurements: (() => {
|
|
18144
|
-
const
|
|
18145
|
-
if (!
|
|
18146
|
-
const j =
|
|
18142
|
+
const k = PA.find((ZA) => ZA.id === P);
|
|
18143
|
+
if (!k) return !1;
|
|
18144
|
+
const j = k.height ?? k.heightCm ?? 0, sA = k.weight ?? k.weightKg ?? 0;
|
|
18147
18145
|
return j > 0 && sA > 0;
|
|
18148
18146
|
})(),
|
|
18149
18147
|
onUseActiveProfile: Pt,
|
|
18150
|
-
activeProfileName: PA.find((j) => j.id ===
|
|
18151
|
-
activeProfile: PA.find((
|
|
18148
|
+
activeProfileName: PA.find((j) => j.id === P)?.name || null,
|
|
18149
|
+
activeProfile: PA.find((k) => k.id === P) || null,
|
|
18152
18150
|
onStartFresh: () => {
|
|
18153
|
-
IA(null),
|
|
18151
|
+
IA(null), m.current = {};
|
|
18154
18152
|
},
|
|
18155
|
-
onComplete: (
|
|
18156
|
-
|
|
18157
|
-
|
|
18158
|
-
|
|
18159
|
-
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
|
|
18153
|
+
onComplete: (k) => {
|
|
18154
|
+
m.current.gender = k.gender, k.bandSize && (m.current.bandSize = k.bandSize), k.cupSize && (m.current.cupSize = k.cupSize), he(!!k.bodyImage), kt(
|
|
18155
|
+
k.height,
|
|
18156
|
+
k.weight,
|
|
18157
|
+
k.heightUnit,
|
|
18158
|
+
k.weightUnit,
|
|
18159
|
+
k.gender,
|
|
18160
|
+
k.age,
|
|
18163
18161
|
void 0,
|
|
18164
|
-
|
|
18165
|
-
|
|
18166
|
-
|
|
18167
|
-
|
|
18162
|
+
k.chestProfile,
|
|
18163
|
+
k.midsectionProfile,
|
|
18164
|
+
k.hipProfile,
|
|
18165
|
+
k.bodyImage
|
|
18168
18166
|
);
|
|
18169
18167
|
},
|
|
18170
|
-
onSnapSubmit: (
|
|
18171
|
-
he(!0), cg(
|
|
18168
|
+
onSnapSubmit: (k) => {
|
|
18169
|
+
he(!0), cg(k);
|
|
18172
18170
|
},
|
|
18173
18171
|
onBack: ao,
|
|
18174
18172
|
t: X
|
|
18175
18173
|
},
|
|
18176
|
-
`bp-${
|
|
18174
|
+
`bp-${P || "anon"}`
|
|
18177
18175
|
) }, "v-bodyprofile");
|
|
18178
18176
|
}
|
|
18179
18177
|
case "estimation-review":
|
|
@@ -18185,7 +18183,7 @@ function br({
|
|
|
18185
18183
|
estimatedValues: ae,
|
|
18186
18184
|
estimationLoading: re,
|
|
18187
18185
|
dynamicFields: oo,
|
|
18188
|
-
formRef:
|
|
18186
|
+
formRef: m,
|
|
18189
18187
|
formGender: q,
|
|
18190
18188
|
formKey: Qe,
|
|
18191
18189
|
setFormKey: cA,
|
|
@@ -18194,7 +18192,7 @@ function br({
|
|
|
18194
18192
|
updateField: zt,
|
|
18195
18193
|
setSizingMethod: de,
|
|
18196
18194
|
setSizingLoading: H,
|
|
18197
|
-
setView:
|
|
18195
|
+
setView: z,
|
|
18198
18196
|
submitSizing: ko,
|
|
18199
18197
|
t: X
|
|
18200
18198
|
}
|
|
@@ -18214,7 +18212,7 @@ function br({
|
|
|
18214
18212
|
productMaterial: n,
|
|
18215
18213
|
productDescription: c,
|
|
18216
18214
|
sizingUnit: TA,
|
|
18217
|
-
setView:
|
|
18215
|
+
setView: z,
|
|
18218
18216
|
handleDownload: Yt,
|
|
18219
18217
|
selectedFile: vA,
|
|
18220
18218
|
previewUrl: nA,
|
|
@@ -18234,12 +18232,12 @@ function br({
|
|
|
18234
18232
|
},
|
|
18235
18233
|
onClose: ao,
|
|
18236
18234
|
userHeightCm: (() => {
|
|
18237
|
-
const B = PA.find((tA) => tA.id ===
|
|
18235
|
+
const B = PA.find((tA) => tA.id === P);
|
|
18238
18236
|
if (!B) return;
|
|
18239
18237
|
const d = B.height ?? B.heightCm;
|
|
18240
18238
|
if (!d || d <= 0) return;
|
|
18241
|
-
const
|
|
18242
|
-
return (
|
|
18239
|
+
const O = B.heightUnit, rA = dA?.unit || TA;
|
|
18240
|
+
return (O === "in" || O === "ft") && rA !== "in" ? Math.round(d * 2.54) : (!O || O === "cm") && rA === "in" ? Math.round(d / 2.54 * 10) / 10 : d;
|
|
18243
18241
|
})(),
|
|
18244
18242
|
t: X
|
|
18245
18243
|
}
|
|
@@ -18275,34 +18273,34 @@ function br({
|
|
|
18275
18273
|
productMaterial: n,
|
|
18276
18274
|
productDescription: c,
|
|
18277
18275
|
onCancel: () => {
|
|
18278
|
-
|
|
18276
|
+
z("size-result"), De(!1);
|
|
18279
18277
|
},
|
|
18280
18278
|
cn: L,
|
|
18281
18279
|
t: X
|
|
18282
18280
|
}
|
|
18283
18281
|
) }, "v-proc");
|
|
18284
18282
|
case "result":
|
|
18285
|
-
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A($i, { setView:
|
|
18283
|
+
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A($i, { setView: z }) }, "v-result");
|
|
18286
18284
|
case "profiles":
|
|
18287
18285
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
18288
18286
|
Zi,
|
|
18289
18287
|
{
|
|
18290
18288
|
profiles: PA,
|
|
18291
|
-
activeProfileId:
|
|
18289
|
+
activeProfileId: P,
|
|
18292
18290
|
estimatingProfileIds: K,
|
|
18293
18291
|
apiUrl: je(r),
|
|
18294
18292
|
apiKey: Re(),
|
|
18295
18293
|
onSelectProfile: (B) => {
|
|
18296
|
-
IA(B),
|
|
18294
|
+
IA(B), z("body-profile");
|
|
18297
18295
|
},
|
|
18298
|
-
onSaveProfileMeasurements: (B, d,
|
|
18299
|
-
wg(B, d,
|
|
18296
|
+
onSaveProfileMeasurements: (B, d, O) => {
|
|
18297
|
+
wg(B, d, O ?? PA.find((rA) => rA.id === B)?.measurementsUnit ?? "cm"), se(Ke("profiles", []));
|
|
18300
18298
|
},
|
|
18301
|
-
onSaveBraSize: (B, d,
|
|
18302
|
-
it(B, { bandSize: d, cupSize:
|
|
18299
|
+
onSaveBraSize: (B, d, O) => {
|
|
18300
|
+
it(B, { bandSize: d, cupSize: O }), se(Ke("profiles", []));
|
|
18303
18301
|
},
|
|
18304
18302
|
onEditProfile: (B) => {
|
|
18305
|
-
|
|
18303
|
+
fA(B);
|
|
18306
18304
|
},
|
|
18307
18305
|
onPhotoPreview: (B) => {
|
|
18308
18306
|
if (B) {
|
|
@@ -18313,7 +18311,7 @@ function br({
|
|
|
18313
18311
|
},
|
|
18314
18312
|
onEstimateFromPhoto: async (B) => {
|
|
18315
18313
|
try {
|
|
18316
|
-
const d = await po(B.photoBase64).catch(() => null),
|
|
18314
|
+
const d = await po(B.photoBase64).catch(() => null), O = await zg({
|
|
18317
18315
|
apiUrl: r,
|
|
18318
18316
|
height: B.height > 0 ? B.height : void 0,
|
|
18319
18317
|
weight: B.weight > 0 ? B.weight : void 0,
|
|
@@ -18324,7 +18322,7 @@ function br({
|
|
|
18324
18322
|
bodyImage: B.photoBase64,
|
|
18325
18323
|
bodyLandmarks: d ?? void 0
|
|
18326
18324
|
});
|
|
18327
|
-
return
|
|
18325
|
+
return O ? { estimates: O.estimates, unit: O.unit } : null;
|
|
18328
18326
|
} catch {
|
|
18329
18327
|
return null;
|
|
18330
18328
|
}
|
|
@@ -18335,15 +18333,15 @@ function br({
|
|
|
18335
18333
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
18336
18334
|
createdAt: Date.now(),
|
|
18337
18335
|
lastUsedAt: Date.now()
|
|
18338
|
-
},
|
|
18339
|
-
mg(
|
|
18340
|
-
const rA = d.heightCm || d.height || 0, tA = d.weightKg || d.weight || 0, AA = d.sizingUnit === "in" ? "in" : "cm",
|
|
18336
|
+
}, O = [d, ...PA];
|
|
18337
|
+
mg(O), se(O), IA(d.id);
|
|
18338
|
+
const rA = d.heightCm || d.height || 0, tA = d.weightKg || d.weight || 0, AA = d.sizingUnit === "in" ? "in" : "cm", k = d.sizingUnit === "in" ? "lbs" : "kg", j = d.photoBase64;
|
|
18341
18339
|
!(!!d.measurements && Object.keys(d.measurements).length > 0) && (j || rA > 0 && tA > 0) && (EA((DA) => new Set(DA).add(d.id)), (j ? po(j).catch(() => null) : Promise.resolve(null)).then((DA) => zg({
|
|
18342
18340
|
apiUrl: r,
|
|
18343
18341
|
height: rA > 0 ? rA : void 0,
|
|
18344
18342
|
weight: tA > 0 ? tA : void 0,
|
|
18345
18343
|
heightUnit: AA,
|
|
18346
|
-
weightUnit:
|
|
18344
|
+
weightUnit: k,
|
|
18347
18345
|
gender: d.gender,
|
|
18348
18346
|
age: d.age,
|
|
18349
18347
|
chestProfile: d.chestProfile,
|
|
@@ -18371,10 +18369,10 @@ function br({
|
|
|
18371
18369
|
}));
|
|
18372
18370
|
},
|
|
18373
18371
|
onDeleteProfile: (B) => {
|
|
18374
|
-
se((d) => d.filter((
|
|
18372
|
+
se((d) => d.filter((O) => O.id !== B)), P === B && IA(null), lo("profiles", Ke("profiles", []).filter((d) => d.id !== B));
|
|
18375
18373
|
},
|
|
18376
18374
|
onRequestDelete: (B) => lA(B),
|
|
18377
|
-
onClose: () =>
|
|
18375
|
+
onClose: () => z("body-profile"),
|
|
18378
18376
|
onRegisterBackInterceptor: Me,
|
|
18379
18377
|
t: X
|
|
18380
18378
|
}
|
|
@@ -18395,7 +18393,7 @@ function br({
|
|
|
18395
18393
|
{
|
|
18396
18394
|
productImage: o,
|
|
18397
18395
|
productTitle: i,
|
|
18398
|
-
onTryOn: () =>
|
|
18396
|
+
onTryOn: () => z("photo-guide"),
|
|
18399
18397
|
onClose: R ?? (() => {
|
|
18400
18398
|
}),
|
|
18401
18399
|
t: X
|
|
@@ -18408,7 +18406,7 @@ function br({
|
|
|
18408
18406
|
measurementType: wo(i),
|
|
18409
18407
|
apiUrl: je(r),
|
|
18410
18408
|
apiKey: Re(),
|
|
18411
|
-
onBack: () =>
|
|
18409
|
+
onBack: () => z("no-chart"),
|
|
18412
18410
|
onSubmit: (B) => {
|
|
18413
18411
|
ag(B), Yo(B);
|
|
18414
18412
|
},
|
|
@@ -18419,7 +18417,7 @@ function br({
|
|
|
18419
18417
|
return null;
|
|
18420
18418
|
}
|
|
18421
18419
|
}
|
|
18422
|
-
return /* @__PURE__ */ e("div", { className: Le("ps-tryon-root", L.root ||
|
|
18420
|
+
return /* @__PURE__ */ e("div", { className: Le("ps-tryon-root", L.root || Y), style: { visibility: LA ? "visible" : "hidden", ...Fg, ...v }, suppressHydrationWarning: !0, "data-ps-tryon": !0, children: [
|
|
18423
18421
|
/* @__PURE__ */ e(
|
|
18424
18422
|
"button",
|
|
18425
18423
|
{
|
|
@@ -18439,15 +18437,15 @@ function br({
|
|
|
18439
18437
|
/* @__PURE__ */ e("div", { className: Le("ps-tryon-header ps-tryon-header-minimal", L.header), children: [
|
|
18440
18438
|
/* @__PURE__ */ A(Sn, { activeLocale: T, onSelect: aA }),
|
|
18441
18439
|
/* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: X("Profiles"), onClick: () => {
|
|
18442
|
-
KA && D(null), oA === "profiles" ? (
|
|
18440
|
+
KA && D(null), oA === "profiles" ? (z(uA.current || "body-profile"), uA.current = null) : (uA.current = oA, z("profiles"));
|
|
18443
18441
|
}, children: /* @__PURE__ */ A(Pg, {}) }),
|
|
18444
18442
|
/* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: X("History"), onClick: () => {
|
|
18445
|
-
oA === "profiles" && (
|
|
18443
|
+
oA === "profiles" && (z(uA.current || "body-profile"), uA.current = null), KA === "history" ? D(null) : (uA.current = uA.current || oA, D("history"));
|
|
18446
18444
|
}, children: /* @__PURE__ */ A(Ln, {}) }),
|
|
18447
18445
|
/* @__PURE__ */ A("button", { onClick: ao, className: Le("ps-tryon-close", L.closeButton), children: /* @__PURE__ */ A(Bt, {}) })
|
|
18448
18446
|
] }),
|
|
18449
18447
|
oA !== "body-profile" && oA !== "processing" && !(oA === "size-result" && BA?.sections && Object.keys(BA.sections).length > 1) && /* @__PURE__ */ A(Kn, { view: oA, stepIndex: mt }),
|
|
18450
|
-
/* @__PURE__ */ e("div", { ref:
|
|
18448
|
+
/* @__PURE__ */ e("div", { ref: N, className: Le("ps-tryon-body", L.body), style: { position: "relative", overflow: KA ? "hidden" : void 0 }, children: [
|
|
18451
18449
|
Ft && /* @__PURE__ */ e("button", { className: "ps-tryon-back-btn", onClick: yt, children: [
|
|
18452
18450
|
/* @__PURE__ */ e("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
18453
18451
|
/* @__PURE__ */ A("line", { x1: "17", y1: "6", x2: "1", y2: "6" }),
|
|
@@ -18464,8 +18462,8 @@ function br({
|
|
|
18464
18462
|
profiles: PA,
|
|
18465
18463
|
setProfiles: se,
|
|
18466
18464
|
history: Pe,
|
|
18467
|
-
setHistory:
|
|
18468
|
-
setProfileDetail:
|
|
18465
|
+
setHistory: b,
|
|
18466
|
+
setProfileDetail: fA,
|
|
18469
18467
|
restoreHistory: Ot,
|
|
18470
18468
|
t: X
|
|
18471
18469
|
}
|
|
@@ -18475,8 +18473,8 @@ function br({
|
|
|
18475
18473
|
Wi,
|
|
18476
18474
|
{
|
|
18477
18475
|
onConfirm: () => {
|
|
18478
|
-
const B = $, d = Ke("profiles", []).filter((
|
|
18479
|
-
lo("profiles", d), se(d),
|
|
18476
|
+
const B = $, d = Ke("profiles", []).filter((O) => O.id !== B);
|
|
18477
|
+
lo("profiles", d), se(d), P === B && IA(null), lA(null);
|
|
18480
18478
|
},
|
|
18481
18479
|
onCancel: () => lA(null),
|
|
18482
18480
|
t: X
|
|
@@ -18498,9 +18496,9 @@ function br({
|
|
|
18498
18496
|
Xn,
|
|
18499
18497
|
{
|
|
18500
18498
|
profileDetail: W,
|
|
18501
|
-
setProfileDetail:
|
|
18499
|
+
setProfileDetail: fA,
|
|
18502
18500
|
setProfiles: se,
|
|
18503
|
-
activeProfileId:
|
|
18501
|
+
activeProfileId: P,
|
|
18504
18502
|
setActiveProfileId: IA,
|
|
18505
18503
|
t: X
|
|
18506
18504
|
}
|