@primestyleai/tryon 5.10.47 → 5.10.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { P as sP, L as wP, b as ag, a as tn, c as jg, A as dg, S as Ug, i as Fg } from "../index-DfsSxOUa.js";
3
3
  import { jsxs as f, jsx as A, Fragment as rA } from "react/jsx-runtime";
4
- import { useState as d, useRef as pA, useCallback as EA, useEffect as NA, useMemo as pf } from "react";
4
+ import { useState as d, useRef as aA, useCallback as EA, useEffect as NA, useMemo as pf } from "react";
5
5
  import { createPortal as Vn } from "react-dom";
6
6
  const mn = 11, Jn = 12, vP = 13, tP = 14, iP = 15, DP = 16, Nn = 23, Sn = 24, rP = 25, CP = 26, HP = 27, QP = 28, zP = 0;
7
7
  let En = null, Qn = null;
@@ -31,7 +31,7 @@ async function Un(n) {
31
31
  const g = await TP(n), e = En.detect(g);
32
32
  if (!e?.landmarks?.length || e.landmarks[0].length < 25)
33
33
  return null;
34
- const B = e.landmarks[0], P = B[mn], D = B[Jn], i = B[Nn], C = B[Sn], w = (P.y + D.y) / 2, H = (i.y + C.y) / 2, c = H - w, z = w + c * 0.28, T = Math.abs(D.x - P.x), x = Math.min(P.x, D.x) - T * 0.05, l = Math.max(P.x, D.x) + T * 0.05, nA = Math.abs(C.x - i.x), r = Math.min(i.x, C.x) - nA * 0.15, b = Math.max(i.x, C.x) + nA * 0.15, k = z + (H - z) * 0.55, v = T * 0.85, O = (P.x + D.x + i.x + C.x) / 4, s = O - v / 2, S = O + v / 2;
34
+ const B = e.landmarks[0], P = B[mn], D = B[Jn], i = B[Nn], C = B[Sn], w = (P.y + D.y) / 2, H = (i.y + C.y) / 2, p = H - w, z = w + p * 0.28, T = Math.abs(D.x - P.x), x = Math.min(P.x, D.x) - T * 0.05, l = Math.max(P.x, D.x) + T * 0.05, fA = Math.abs(C.x - i.x), r = Math.min(i.x, C.x) - fA * 0.15, b = Math.max(i.x, C.x) + fA * 0.15, k = z + (H - z) * 0.55, v = T * 0.85, O = (P.x + D.x + i.x + C.x) / 4, s = O - v / 2, S = O + v / 2;
35
35
  return {
36
36
  chest: { y: z, x1: x, x2: l },
37
37
  waist: { y: k, x1: s, x2: S },
@@ -166,7 +166,7 @@ function Mg(n) {
166
166
  }
167
167
  function pP(n, g, e) {
168
168
  if (n.length < 4) return 0;
169
- const B = (c) => ({ x: c.x * g, y: c.y * e }), [P, D, i, C] = n.map(B), w = Math.hypot(P.x - i.x, P.y - i.y), H = Math.hypot(D.x - C.x, D.y - C.y);
169
+ const B = (p) => ({ x: p.x * g, y: p.y * e }), [P, D, i, C] = n.map(B), w = Math.hypot(P.x - i.x, P.y - i.y), H = Math.hypot(D.x - C.x, D.y - C.y);
170
170
  return (w + H) / 2;
171
171
  }
172
172
  function xg(n) {
@@ -199,24 +199,24 @@ function Ig(n, g, e) {
199
199
  const C = D > 0 ? cP / D : 0, w = (K, F) => Math.hypot(
200
200
  (K.x - F.x) * g,
201
201
  (K.y - F.y) * e
202
- ) * C, H = w(n.leftIrisCenter, n.rightIrisCenter), z = w(n.leftInnerEye, n.rightInnerEye) / 1.6, T = w(n.leftTragus, n.rightTragus), x = w(n.leftTragus, n.leftOuterEye), l = w(n.rightTragus, n.rightOuterEye), nA = (x + l) / 2, r = T * 1.07, k = Math.abs((n.forehead.z ?? 0) - (n.chin.z ?? 0)) * g * C, v = Math.max(170, Math.min(210, k || 190)), O = r / 2, s = v / 2, S = Math.PI * Math.sqrt(2 * (O * O + s * s));
202
+ ) * C, H = w(n.leftIrisCenter, n.rightIrisCenter), z = w(n.leftInnerEye, n.rightInnerEye) / 1.6, T = w(n.leftTragus, n.rightTragus), x = w(n.leftTragus, n.leftOuterEye), l = w(n.rightTragus, n.rightOuterEye), fA = (x + l) / 2, r = T * 1.07, k = Math.abs((n.forehead.z ?? 0) - (n.chin.z ?? 0)) * g * C, v = Math.max(170, Math.min(210, k || 190)), O = r / 2, s = v / 2, S = Math.PI * Math.sqrt(2 * (O * O + s * s));
203
203
  return {
204
204
  measurements: {
205
205
  irisDiameter: cP,
206
- pd: Xf(H),
207
- bridgeWidth: Xf(z),
208
- faceWidth: Xf(T),
209
- templeLengthLeft: Xf(x),
210
- templeLengthRight: Xf(l),
211
- templeLength: Xf(nA),
212
- headWidth: Xf(r),
213
- headDepth: Xf(v),
214
- headCircumference: Xf(S)
206
+ pd: uf(H),
207
+ bridgeWidth: uf(z),
208
+ faceWidth: uf(T),
209
+ templeLengthLeft: uf(x),
210
+ templeLengthRight: uf(l),
211
+ templeLength: uf(fA),
212
+ headWidth: uf(r),
213
+ headDepth: uf(v),
214
+ headCircumference: uf(S)
215
215
  },
216
216
  irisConfidence: i
217
217
  };
218
218
  }
219
- function Xf(n) {
219
+ function uf(n) {
220
220
  return Math.round(n * 10) / 10;
221
221
  }
222
222
  async function Rg(n) {
@@ -234,12 +234,12 @@ async function Rg(n) {
234
234
  return console.warn("[PS-SDK:FaceDetect] NO FACES detected — returning null"), null;
235
235
  const H = i.faceLandmarks[0];
236
236
  console.log(`[PS-SDK:FaceDetect] first face has ${H.length} landmarks`);
237
- const c = xg(H);
238
- if (!c)
237
+ const p = xg(H);
238
+ if (!p)
239
239
  return null;
240
240
  console.log("[PS-SDK:FaceDetect] step 4/4 — computing measurements");
241
- const { measurements: z, irisConfidence: T } = Ig(c, B, P);
242
- return console.log(`[PS-SDK:FaceDetect] ✓ DONE in ${Math.round(performance.now() - g)}ms`, { irisConfidence: T, measurements: z }), { landmarks: c, measurementsMm: z, irisConfidence: T, imageWidth: B, imageHeight: P };
241
+ const { measurements: z, irisConfidence: T } = Ig(p, B, P);
242
+ return console.log(`[PS-SDK:FaceDetect] ✓ DONE in ${Math.round(performance.now() - g)}ms`, { irisConfidence: T, measurements: z }), { landmarks: p, measurementsMm: z, irisConfidence: T, imageWidth: B, imageHeight: P };
243
243
  } catch (e) {
244
244
  return console.error("[PS-SDK:FaceDetect] detectFaceMeasurements FAILED:", e), null;
245
245
  }
@@ -304,7 +304,7 @@ function jP(n, g, e) {
304
304
  for (const C of Object.values(n.sections)) i(C.matchDetails);
305
305
  if (D.length && (B.userMeasurementsText = D.join(", ")), g?.headers?.length && g.rows?.length) {
306
306
  const C = g.headers, w = g.rows.slice(0, 20).map(
307
- (H) => C.map((c, z) => `${c} ${H[z] ?? "—"}`).join(", ")
307
+ (H) => C.map((p, z) => `${p} ${H[z] ?? "—"}`).join(", ")
308
308
  );
309
309
  B.sizeChartSummary = w.join(" | ");
310
310
  }
@@ -537,7 +537,7 @@ async function mP(n) {
537
537
  return g("recommend returned no recommendedSize — bailing"), null;
538
538
  const H = w.sections ? Object.fromEntries(
539
539
  Object.entries(w.sections).map(([z, T]) => [z, T.recommendedSize])
540
- ) : void 0, c = w.sections ? Object.fromEntries(
540
+ ) : void 0, p = w.sections ? Object.fromEntries(
541
541
  Object.entries(w.sections).map(([z, T]) => [
542
542
  z,
543
543
  {
@@ -557,7 +557,7 @@ async function mP(n) {
557
557
  recommendedSize: w.recommendedSize,
558
558
  confidence: w.confidence,
559
559
  sections: H,
560
- sectionsFull: c,
560
+ sectionsFull: p,
561
561
  recommendedLength: w.recommendedLength || void 0,
562
562
  savedAt: Date.now()
563
563
  }), {
@@ -6948,19 +6948,19 @@ function ne({ view: n, stepIndex: g }) {
6948
6948
  return n === "error" || n === "idle" ? null : /* @__PURE__ */ A("div", { className: "ps-tryon-dots", children: Array.from({ length: bg }, (e, B) => B + 1).map((e) => /* @__PURE__ */ A("div", { className: `ps-tryon-dot${e < g ? " ps-done" : e === g ? " ps-active" : ""}` }, e)) });
6949
6949
  }
6950
6950
  function Pe({ activeLocale: n, onSelect: g }) {
6951
- const [e, B] = d(!1), P = pA(null), D = pA(null), [i, C] = d({ top: 0, right: 0 }), w = wP[n] || "English", H = EA(() => {
6951
+ const [e, B] = d(!1), P = aA(null), D = aA(null), [i, C] = d({ top: 0, right: 0 }), w = wP[n] || "English", H = EA(() => {
6952
6952
  if (!P.current) return;
6953
- const c = P.current.getBoundingClientRect();
6954
- C({ top: c.bottom + 4, right: window.innerWidth - c.right });
6953
+ const p = P.current.getBoundingClientRect();
6954
+ C({ top: p.bottom + 4, right: window.innerWidth - p.right });
6955
6955
  }, []);
6956
6956
  return NA(() => {
6957
6957
  if (!e) return;
6958
6958
  H();
6959
- const c = (z) => {
6959
+ const p = (z) => {
6960
6960
  P.current?.contains(z.target) || D.current?.contains(z.target) || B(!1);
6961
6961
  };
6962
- return document.addEventListener("mousedown", c), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0), () => {
6963
- document.removeEventListener("mousedown", c), window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0);
6962
+ return document.addEventListener("mousedown", p), window.addEventListener("resize", H), window.addEventListener("scroll", H, !0), () => {
6963
+ document.removeEventListener("mousedown", p), window.removeEventListener("resize", H), window.removeEventListener("scroll", H, !0);
6964
6964
  };
6965
6965
  }, [e, H]), /* @__PURE__ */ f(rA, { children: [
6966
6966
  /* @__PURE__ */ f(
@@ -6991,20 +6991,20 @@ function Pe({ activeLocale: n, onSelect: g }) {
6991
6991
  // dropdown is portaled later than the overlay so it stacks on top.
6992
6992
  zIndex: 2147483647
6993
6993
  },
6994
- children: /* @__PURE__ */ A("div", { className: "ps-tryon-lang-list", children: ag.map((c) => /* @__PURE__ */ f(
6994
+ children: /* @__PURE__ */ A("div", { className: "ps-tryon-lang-list", children: ag.map((p) => /* @__PURE__ */ f(
6995
6995
  "button",
6996
6996
  {
6997
- className: `ps-tryon-lang-item${c === n ? " ps-selected" : ""}`,
6997
+ className: `ps-tryon-lang-item${p === n ? " ps-selected" : ""}`,
6998
6998
  onClick: () => {
6999
- g(c), B(!1);
6999
+ g(p), B(!1);
7000
7000
  },
7001
7001
  children: [
7002
- /* @__PURE__ */ A("span", { className: "ps-tryon-lang-name", children: wP[c] || c }),
7003
- /* @__PURE__ */ A("span", { className: "ps-tryon-lang-code", children: c.toUpperCase() }),
7004
- c === n && /* @__PURE__ */ A("span", { className: "ps-tryon-lang-check", children: /* @__PURE__ */ A(Zg, { size: 12 }) })
7002
+ /* @__PURE__ */ A("span", { className: "ps-tryon-lang-name", children: wP[p] || p }),
7003
+ /* @__PURE__ */ A("span", { className: "ps-tryon-lang-code", children: p.toUpperCase() }),
7004
+ p === n && /* @__PURE__ */ A("span", { className: "ps-tryon-lang-check", children: /* @__PURE__ */ A(Zg, { size: 12 }) })
7005
7005
  ]
7006
7006
  },
7007
- c
7007
+ p
7008
7008
  )) })
7009
7009
  }
7010
7010
  ),
@@ -7027,7 +7027,7 @@ function yP({
7027
7027
  onCancel: e,
7028
7028
  t: B
7029
7029
  }) {
7030
- const [P, D] = d(n?.name || ""), [i, C] = d(n?.gender || "male"), [w, H] = d(n?.sizingUnit || "cm"), [c, z] = d(() => {
7030
+ const [P, D] = d(n?.name || ""), [i, C] = d(n?.gender || "male"), [w, H] = d(n?.sizingUnit || "cm"), [p, z] = d(() => {
7031
7031
  if (!n) return {};
7032
7032
  const r = {};
7033
7033
  for (const b of ["heightCm", "weightKg", "age"]) {
@@ -7035,11 +7035,11 @@ function yP({
7035
7035
  typeof k == "number" && k > 0 && (r[b] = String(k));
7036
7036
  }
7037
7037
  return r;
7038
- }), T = i === "female" ? ee : ge, [x, l] = d(""), nA = () => {
7038
+ }), T = i === "female" ? ee : ge, [x, l] = d(""), fA = () => {
7039
7039
  const r = [];
7040
7040
  P.trim() || r.push(B("Profile Name"));
7041
7041
  for (const k of T)
7042
- parseFloat(c[k.key] || "") > 0 || r.push(B(k.label));
7042
+ parseFloat(p[k.key] || "") > 0 || r.push(B(k.label));
7043
7043
  if (r.length > 0) {
7044
7044
  l(B("Please fill in all fields"));
7045
7045
  return;
@@ -7047,7 +7047,7 @@ function yP({
7047
7047
  l("");
7048
7048
  const b = { name: P.trim(), gender: i, sizingUnit: w };
7049
7049
  for (const k of T)
7050
- b[k.key] = parseFloat(c[k.key]);
7050
+ b[k.key] = parseFloat(p[k.key]);
7051
7051
  g(b);
7052
7052
  };
7053
7053
  return /* @__PURE__ */ f("div", { className: "ps-tryon-profile-edit", children: [
@@ -7121,7 +7121,7 @@ function yP({
7121
7121
  type: "number",
7122
7122
  className: "ps-tryon-sf-input",
7123
7123
  placeholder: " ",
7124
- value: c[r.key] || "",
7124
+ value: p[r.key] || "",
7125
7125
  onChange: (b) => {
7126
7126
  z((k) => ({ ...k, [r.key]: b.target.value })), l("");
7127
7127
  }
@@ -7131,7 +7131,7 @@ function yP({
7131
7131
  x && /* @__PURE__ */ A("div", { className: "ps-tryon-pe-error", children: x }),
7132
7132
  /* @__PURE__ */ f("div", { className: "ps-tryon-pe-actions", children: [
7133
7133
  /* @__PURE__ */ A("button", { type: "button", className: "ps-tryon-est-back", onClick: e, children: B("Cancel") }),
7134
- /* @__PURE__ */ A("button", { type: "button", className: "ps-tryon-pe-save", onClick: nA, children: B(n ? "Save Changes" : "Create Profile") })
7134
+ /* @__PURE__ */ A("button", { type: "button", className: "ps-tryon-pe-save", onClick: fA, children: B(n ? "Save Changes" : "Create Profile") })
7135
7135
  ] })
7136
7136
  ] });
7137
7137
  }
@@ -7146,7 +7146,7 @@ function Be({
7146
7146
  restoreHistory: C,
7147
7147
  t: w
7148
7148
  }) {
7149
- const [H, c] = d(!1);
7149
+ const [H, p] = d(!1);
7150
7150
  if (!n) return null;
7151
7151
  const z = (x) => !!(x.sizeGuide?.sections && Object.keys(x.sizeGuide.sections).length > 1), T = (x) => {
7152
7152
  const l = {
@@ -7154,18 +7154,18 @@ function Be({
7154
7154
  id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
7155
7155
  createdAt: Date.now()
7156
7156
  };
7157
- B((nA) => [l, ...nA]), c(!1);
7157
+ B((fA) => [l, ...fA]), p(!1);
7158
7158
  };
7159
7159
  return /* @__PURE__ */ f("div", { className: `ps-tryon-drawer${n ? " ps-tryon-drawer-open" : ""}`, children: [
7160
7160
  /* @__PURE__ */ f("div", { className: "ps-tryon-drawer-header", children: [
7161
7161
  /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-back", onClick: () => {
7162
- c(!1), g(null);
7162
+ p(!1), g(null);
7163
7163
  }, children: /* @__PURE__ */ A(Jg, {}) }),
7164
7164
  /* @__PURE__ */ A("span", { className: "ps-tryon-drawer-title", children: w(H ? "New Profile" : n === "profiles" ? "My Profiles" : "History") }),
7165
- n === "profiles" && !H && /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-add-btn", onClick: () => c(!0), children: "+" })
7165
+ n === "profiles" && !H && /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-add-btn", onClick: () => p(!0), children: "+" })
7166
7166
  ] }),
7167
- /* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: n === "profiles" && H ? /* @__PURE__ */ A(yP, { onSave: T, onCancel: () => c(!1), t: w }) : n === "profiles" ? /* @__PURE__ */ f(rA, { children: [
7168
- /* @__PURE__ */ f("button", { className: "ps-tryon-drawer-create", onClick: () => c(!0), children: [
7167
+ /* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: n === "profiles" && H ? /* @__PURE__ */ A(yP, { onSave: T, onCancel: () => p(!1), t: w }) : n === "profiles" ? /* @__PURE__ */ f(rA, { children: [
7168
+ /* @__PURE__ */ f("button", { className: "ps-tryon-drawer-create", onClick: () => p(!0), children: [
7169
7169
  "+ ",
7170
7170
  w("Create New Profile")
7171
7171
  ] }),
@@ -7198,15 +7198,15 @@ function Be({
7198
7198
  /* @__PURE__ */ A("span", { className: "ps-tryon-history-size-badge", children: x.recommendedSize }),
7199
7199
  x.reasoning && /* @__PURE__ */ A("span", { className: "ps-tryon-history-sizing-reason", children: x.reasoning })
7200
7200
  ] }),
7201
- z(x) && x.sizingResult?.sections && /* @__PURE__ */ A("div", { className: "ps-tryon-history-sections", children: Object.entries(x.sizingResult.sections).map(([nA, r]) => /* @__PURE__ */ f("span", { className: "ps-tryon-history-section-chip", children: [
7202
- nA,
7201
+ z(x) && x.sizingResult?.sections && /* @__PURE__ */ A("div", { className: "ps-tryon-history-sections", children: Object.entries(x.sizingResult.sections).map(([fA, r]) => /* @__PURE__ */ f("span", { className: "ps-tryon-history-section-chip", children: [
7202
+ fA,
7203
7203
  ": ",
7204
7204
  r.recommendedSize
7205
- ] }, nA)) }),
7205
+ ] }, fA)) }),
7206
7206
  x.resultImageUrl && /* @__PURE__ */ A("span", { className: "ps-tryon-history-tryon-badge", children: w("Try-on") })
7207
7207
  ] }),
7208
- /* @__PURE__ */ A("button", { className: "ps-tryon-history-delete", onClick: (nA) => {
7209
- nA.stopPropagation(), D((r) => r.filter((b, k) => k !== l));
7208
+ /* @__PURE__ */ A("button", { className: "ps-tryon-history-delete", onClick: (fA) => {
7209
+ fA.stopPropagation(), D((r) => r.filter((b, k) => k !== l));
7210
7210
  }, children: /* @__PURE__ */ A(yg, {}) })
7211
7211
  ] }, x.id)),
7212
7212
  /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-clear", onClick: () => D([]), children: w("Clear All") })
@@ -7230,16 +7230,16 @@ function oe({
7230
7230
  }, [n]), !n || typeof document > "u") return null;
7231
7231
  const i = (w) => {
7232
7232
  e((H) => H.map(
7233
- (c) => c.id === n.id ? {
7234
- ...c,
7233
+ (p) => p.id === n.id ? {
7234
+ ...p,
7235
7235
  ...w,
7236
7236
  // Keep id + createdAt + sizeHistory + measurements; bump lastEditedAt
7237
- id: c.id,
7238
- createdAt: c.createdAt,
7239
- sizeHistory: c.sizeHistory,
7240
- measurements: c.measurements,
7237
+ id: p.id,
7238
+ createdAt: p.createdAt,
7239
+ sizeHistory: p.sizeHistory,
7240
+ measurements: p.measurements,
7241
7241
  lastEditedAt: Date.now()
7242
- } : c
7242
+ } : p
7243
7243
  )), g(null);
7244
7244
  }, C = () => g(null);
7245
7245
  return Vn(
@@ -7283,7 +7283,7 @@ function we({
7283
7283
  return `${T}'${x}"`;
7284
7284
  }
7285
7285
  return `${Math.round(z)} cm`;
7286
- }, w = (z) => z ? `${Math.round(z)} ${D}` : "—", H = n.height ?? n.heightCm, c = n.weight ?? n.weightKg;
7286
+ }, w = (z) => z ? `${Math.round(z)} ${D}` : "—", H = n.height ?? n.heightCm, p = n.weight ?? n.weightKg;
7287
7287
  return /* @__PURE__ */ A("div", { className: "ps-confirm-overlay", onClick: e, children: /* @__PURE__ */ f("div", { className: "ps-confirm-modal", onClick: (z) => z.stopPropagation(), children: [
7288
7288
  /* @__PURE__ */ A(
7289
7289
  "button",
@@ -7329,7 +7329,7 @@ function we({
7329
7329
  ] }),
7330
7330
  /* @__PURE__ */ f("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
7331
7331
  /* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: B("Weight") }),
7332
- /* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: w(c) })
7332
+ /* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: w(p) })
7333
7333
  ] }),
7334
7334
  n.age ? /* @__PURE__ */ f("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
7335
7335
  /* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: B("Age") }),
@@ -7387,16 +7387,16 @@ function te({
7387
7387
  sizingUnit: C,
7388
7388
  setSizingUnit: w,
7389
7389
  formKey: H,
7390
- setFormKey: c,
7390
+ setFormKey: p,
7391
7391
  updateField: z,
7392
7392
  setSizingMethod: T,
7393
7393
  setSizingLoading: x,
7394
7394
  setView: l,
7395
- submitSizing: nA,
7395
+ submitSizing: fA,
7396
7396
  t: r
7397
7397
  }) {
7398
7398
  const b = C === "in" ? "in" : "cm", k = /* @__PURE__ */ new Set(["weight", "weightKg", "height"]), v = P.filter((s) => s.required && s.unit === "cm" && !k.has(s.key)), O = () => {
7399
- D.current.gender = i, T("exact"), x(!0), l("size-result"), nA("exact");
7399
+ D.current.gender = i, T("exact"), x(!0), l("size-result"), fA("exact");
7400
7400
  };
7401
7401
  return B || !e ? /* @__PURE__ */ f("div", { className: "ps-bp-layout", children: [
7402
7402
  /* @__PURE__ */ A("div", { className: "ps-bp-image", children: /* @__PURE__ */ A("img", { src: n, alt: g, className: "ps-bp-image-img" }) }),
@@ -7563,14 +7563,14 @@ function ce({ landmarks: n, w: g, h: e }) {
7563
7563
  }
7564
7564
  const zn = 22, Ln = 27, bn = 2 * Math.PI * Ln;
7565
7565
  function pe({ t: n }) {
7566
- const g = pA(Date.now()), e = pA(null), B = pA(null), P = pA(null), D = pA(null);
7566
+ const g = aA(Date.now()), e = aA(null), B = aA(null), P = aA(null), D = aA(null);
7567
7567
  return NA(() => {
7568
7568
  g.current = Date.now();
7569
7569
  const i = setInterval(() => {
7570
7570
  const C = (Date.now() - g.current) / 1e3, w = Math.min(95, C / zn * 100), H = Math.round(w);
7571
7571
  if (B.current && (B.current.style.width = `${H}%`), D.current && (D.current.textContent = `${H}%`), e.current && (e.current.style.strokeDashoffset = String(bn * (1 - w / 100))), P.current) {
7572
- const c = Math.max(0, zn - Math.floor(C));
7573
- P.current.textContent = C >= zn ? "•••" : `~${c}s`;
7572
+ const p = Math.max(0, zn - Math.floor(C));
7573
+ P.current.textContent = C >= zn ? "•••" : `~${p}s`;
7574
7574
  }
7575
7575
  }, 200);
7576
7576
  return () => clearInterval(i);
@@ -7622,7 +7622,7 @@ function UP({
7622
7622
  { title: i("ESTIMATING BODY"), desc: i("Computing chest, waist, hips, sleeve and inseam from your basics."), viewfinderText: i("ESTIMATING BODY") },
7623
7623
  { title: i("MATCHING SIZE"), desc: i("Comparing your measurements to the garment's size guide."), viewfinderText: i("MATCHING SIZE") },
7624
7624
  { title: i("FINALIZING RESULT"), desc: i("Almost done — preparing your recommendation."), viewfinderText: i("FINALIZING") }
7625
- ], [c, z] = d({ w: 800, h: 1200 }), T = (r) => {
7625
+ ], [p, z] = d({ w: 800, h: 1200 }), T = (r) => {
7626
7626
  const b = r.currentTarget;
7627
7627
  z({ w: b.naturalWidth || b.offsetWidth, h: b.naturalHeight || b.offsetHeight });
7628
7628
  }, [x, l] = d(0);
@@ -7634,7 +7634,7 @@ function UP({
7634
7634
  }, [H.length, P]), NA(() => {
7635
7635
  w && e && x === 0 && l(1);
7636
7636
  }, [e]);
7637
- const nA = H[x] ?? H[0];
7637
+ const fA = H[x] ?? H[0];
7638
7638
  return /* @__PURE__ */ f("div", { className: "ps-msc-root", children: [
7639
7639
  /* @__PURE__ */ f("div", { className: "ps-msc-viewfinder", children: [
7640
7640
  C && /* @__PURE__ */ A(
@@ -7646,11 +7646,11 @@ function UP({
7646
7646
  onLoad: T
7647
7647
  }
7648
7648
  ),
7649
- w && e && /* @__PURE__ */ A("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ A(ce, { landmarks: e, w: c.w, h: c.h }) })
7649
+ w && e && /* @__PURE__ */ A("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ A(ce, { landmarks: e, w: p.w, h: p.h }) })
7650
7650
  ] }),
7651
7651
  /* @__PURE__ */ A("div", { className: "ps-msc-stage", children: /* @__PURE__ */ f("div", { className: "ps-msc-stage-slot", children: [
7652
- /* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children: nA.title }),
7653
- /* @__PURE__ */ A("div", { className: "ps-msc-stage-desc", children: nA.desc })
7652
+ /* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children: fA.title }),
7653
+ /* @__PURE__ */ A("div", { className: "ps-msc-stage-desc", children: fA.desc })
7654
7654
  ] }, x) }),
7655
7655
  P && /* @__PURE__ */ A("div", { style: { display: "flex", justifyContent: "center", padding: "0 16px", width: "100%" }, children: /* @__PURE__ */ A(pe, { t: i }) }),
7656
7656
  /* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
@@ -7694,12 +7694,12 @@ function Ue({
7694
7694
  tryOnProcessing: C,
7695
7695
  resultImageUrl: w,
7696
7696
  tryOnDone: H,
7697
- onTryAgain: c,
7697
+ onTryAgain: p,
7698
7698
  onClose: z,
7699
7699
  overlayNode: T,
7700
7700
  showLines: x,
7701
7701
  onToggleLines: l,
7702
- onImageLoad: nA,
7702
+ onImageLoad: fA,
7703
7703
  t: r
7704
7704
  }) {
7705
7705
  const b = pf(() => {
@@ -7726,7 +7726,7 @@ function Ue({
7726
7726
  src: k,
7727
7727
  alt: g,
7728
7728
  className: "ps-msr-product-img",
7729
- onLoad: nA
7729
+ onLoad: fA
7730
7730
  }
7731
7731
  ),
7732
7732
  x && T,
@@ -7796,7 +7796,7 @@ function Ue({
7796
7796
  {
7797
7797
  type: "button",
7798
7798
  className: "ps-msr-tryon-cta ps-secondary",
7799
- onClick: c,
7799
+ onClick: p,
7800
7800
  children: r("Try Again")
7801
7801
  }
7802
7802
  ),
@@ -7850,7 +7850,7 @@ const Ee = [
7850
7850
  ["rightKnee", "rightAnkle"]
7851
7851
  ], cn = 22, Zn = 27, Xn = 2 * Math.PI * Zn;
7852
7852
  function LP({ t: n, isActive: g }) {
7853
- const e = pA(null), B = pA(null), P = pA(null), D = pA(null), i = pA(null);
7853
+ const e = aA(null), B = aA(null), P = aA(null), D = aA(null), i = aA(null);
7854
7854
  return NA(() => {
7855
7855
  if (!g) {
7856
7856
  e.current = null;
@@ -7858,8 +7858,8 @@ function LP({ t: n, isActive: g }) {
7858
7858
  }
7859
7859
  e.current = Date.now();
7860
7860
  const C = setInterval(() => {
7861
- const w = e.current || Date.now(), H = (Date.now() - w) / 1e3, c = Math.min(95, H / cn * 100), z = Math.round(c);
7862
- if (P.current && (P.current.style.width = `${z}%`), i.current && (i.current.textContent = `${z}%`), B.current && (B.current.style.strokeDashoffset = String(Xn * (1 - c / 100))), D.current) {
7861
+ const w = e.current || Date.now(), H = (Date.now() - w) / 1e3, p = Math.min(95, H / cn * 100), z = Math.round(p);
7862
+ if (P.current && (P.current.style.width = `${z}%`), i.current && (i.current.textContent = `${z}%`), B.current && (B.current.style.strokeDashoffset = String(Xn * (1 - p / 100))), D.current) {
7863
7863
  const T = Math.max(0, cn - Math.floor(H));
7864
7864
  D.current.textContent = H >= cn ? "•••" : `~${T}s`;
7865
7865
  }
@@ -7938,13 +7938,13 @@ function Me({
7938
7938
  `fl-${H}`
7939
7939
  )),
7940
7940
  [n.leftIrisCenter, n.rightIrisCenter].map((C, w) => {
7941
- const H = w === 0 ? n.leftIrisRing : n.rightIrisRing, c = H?.length ? Math.abs((H[0]?.x ?? C.x) - (H[2]?.x ?? C.x)) * B / 2 : 6;
7941
+ const H = w === 0 ? n.leftIrisRing : n.rightIrisRing, p = H?.length ? Math.abs((H[0]?.x ?? C.x) - (H[2]?.x ?? C.x)) * B / 2 : 6;
7942
7942
  return /* @__PURE__ */ A(
7943
7943
  "circle",
7944
7944
  {
7945
7945
  cx: C.x * B,
7946
7946
  cy: C.y * P,
7947
- r: Math.max(6, c),
7947
+ r: Math.max(6, p),
7948
7948
  fill: "none",
7949
7949
  stroke: "rgba(255,230,120,0.95)",
7950
7950
  strokeWidth: "2.5",
@@ -7956,7 +7956,7 @@ function Me({
7956
7956
  }),
7957
7957
  (() => {
7958
7958
  const w = Math.max(1, Math.abs(n.rightOuterEye.x - n.leftOuterEye.x) * B) * 0.04, H = w * 0.55;
7959
- return D.map(({ key: c, p: z }, T) => /* @__PURE__ */ f("g", { children: [
7959
+ return D.map(({ key: p, p: z }, T) => /* @__PURE__ */ f("g", { children: [
7960
7960
  /* @__PURE__ */ A(
7961
7961
  "circle",
7962
7962
  {
@@ -7979,7 +7979,7 @@ function Me({
7979
7979
  style: { animation: `ps-pose-fade 0.3s ease ${T * 0.04}s forwards, ps-dot-pulse 1.5s ease-in-out ${0.5 + T * 0.04}s infinite` }
7980
7980
  }
7981
7981
  )
7982
- ] }, c));
7982
+ ] }, p));
7983
7983
  })()
7984
7984
  ] });
7985
7985
  }
@@ -8014,13 +8014,13 @@ function xe({
8014
8014
  { title: P("REFINING DETAILS"), desc: P("Fine-tuning fit, drape and shadows.") },
8015
8015
  { title: P("ALMOST THERE"), desc: P("Final compositing in progress.") },
8016
8016
  { title: P("FINISHING TOUCHES"), desc: P("Polishing the result.") }
8017
- ], C = e ? i : D, w = e ? !!B : g, [H, c] = d(0);
8017
+ ], C = e ? i : D, w = e ? !!B : g, [H, p] = d(0);
8018
8018
  NA(() => {
8019
- c(0);
8019
+ p(0);
8020
8020
  }, [e]), NA(() => {
8021
8021
  if (w) return;
8022
8022
  const x = setInterval(() => {
8023
- c((l) => Math.min(l + 1, C.length - 1));
8023
+ p((l) => Math.min(l + 1, C.length - 1));
8024
8024
  }, e ? 2200 : 900);
8025
8025
  return () => clearInterval(x);
8026
8026
  }, [w, C.length, e]);
@@ -8086,13 +8086,13 @@ function wn({ lines: n, fitRows: g, show: e, imgWidth: B, imgHeight: P }) {
8086
8086
  { key: "chest", line: n.chest, label: "Chest" },
8087
8087
  { key: "waist", line: n.waist, label: "Waist" },
8088
8088
  { key: "hips", line: n.hips, label: "Hips" }
8089
- ], C = B, w = P, H = Math.max(C, w) / 500, c = Math.max(5, 3 * H), z = Math.max(7, 5 * H);
8090
- return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${C} ${w}`, preserveAspectRatio: "xMidYMid meet", children: i.map(({ key: T, line: x, label: l }, nA) => {
8089
+ ], C = B, w = P, H = Math.max(C, w) / 500, p = Math.max(5, 3 * H), z = Math.max(7, 5 * H);
8090
+ return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${C} ${w}`, preserveAspectRatio: "xMidYMid meet", children: i.map(({ key: T, line: x, label: l }, fA) => {
8091
8091
  if (!x || typeof x.x1 != "number" || typeof x.x2 != "number" || typeof x.y != "number") return null;
8092
8092
  const r = x.x1 * C, b = x.x2 * C, k = x.y * w, v = b - r, O = v * 0.06, s = (r + b) / 2, S = g.find((iA) => {
8093
8093
  const BA = iA.area.toLowerCase().trim();
8094
8094
  return !!(BA === T || T === "chest" && (BA.includes("bust") || BA.includes("chest")) || T === "waist" && BA.includes("waist") || T === "hips" && (BA.includes("hip") || BA === "hips"));
8095
- }), K = S ? D(S.fit) : "#2154EF", F = nA * 0.35, tA = `M ${r} ${k} Q ${s} ${k + O} ${b} ${k}`, wA = v * 1.05, YA = S ? S.fit === "good" ? "✓ Fit" : S.isLength ? S.fit.includes("short") || S.fit.includes("tight") ? "Short" : "Long" : S.fit.includes("tight") ? "Tight" : "Loose" : l, h = Math.round(14 * H), a = YA.length * h * 0.62, RA = C - b - 12 * H < a, vA = RA ? r - 10 * H : b + 10 * H, J = RA ? "end" : "start", gA = RA ? r : b, kA = RA ? r - 6 * H : b + 6 * H;
8095
+ }), K = S ? D(S.fit) : "#2154EF", F = fA * 0.35, tA = `M ${r} ${k} Q ${s} ${k + O} ${b} ${k}`, wA = v * 1.05, YA = S ? S.fit === "good" ? "✓ Fit" : S.isLength ? S.fit.includes("short") || S.fit.includes("tight") ? "Short" : "Long" : S.fit.includes("tight") ? "Tight" : "Loose" : l, h = Math.round(14 * H), a = YA.length * h * 0.62, RA = C - b - 12 * H < a, vA = RA ? r - 10 * H : b + 10 * H, N = RA ? "end" : "start", PA = RA ? r : b, kA = RA ? r - 6 * H : b + 6 * H;
8096
8096
  return /* @__PURE__ */ f("g", { children: [
8097
8097
  /* @__PURE__ */ A(
8098
8098
  "path",
@@ -8100,7 +8100,7 @@ function wn({ lines: n, fitRows: g, show: e, imgWidth: B, imgHeight: P }) {
8100
8100
  d: tA,
8101
8101
  fill: "none",
8102
8102
  stroke: K,
8103
- strokeWidth: c,
8103
+ strokeWidth: p,
8104
8104
  strokeLinecap: "round",
8105
8105
  strokeDasharray: wA,
8106
8106
  strokeDashoffset: wA,
@@ -8133,7 +8133,7 @@ function wn({ lines: n, fitRows: g, show: e, imgWidth: B, imgHeight: P }) {
8133
8133
  /* @__PURE__ */ A(
8134
8134
  "line",
8135
8135
  {
8136
- x1: gA,
8136
+ x1: PA,
8137
8137
  y1: k,
8138
8138
  x2: kA,
8139
8139
  y2: k,
@@ -8151,7 +8151,7 @@ function wn({ lines: n, fitRows: g, show: e, imgWidth: B, imgHeight: P }) {
8151
8151
  fontWeight: "700",
8152
8152
  fontFamily: "system-ui, -apple-system, sans-serif",
8153
8153
  dominantBaseline: "middle",
8154
- textAnchor: J,
8154
+ textAnchor: N,
8155
8155
  children: YA
8156
8156
  }
8157
8157
  )
@@ -8163,7 +8163,7 @@ const qn = (n) => {
8163
8163
  if (n == null) return "";
8164
8164
  const g = n.replace(/[^\d.\-\u2013]/g, " ").trim().split(/[\s\-\u2013]+/).filter(Boolean).map((e) => parseFloat(e)).filter((e) => !isNaN(e));
8165
8165
  return g.length === 1 ? `${g[0]}` : g.length > 1 ? `${g[0]}–${g[1]}` : n;
8166
- }, uf = (n) => {
8166
+ }, kf = (n) => {
8167
8167
  if (n == null) return 0;
8168
8168
  const g = parseFloat(n.replace(/[^\d.]/g, ""));
8169
8169
  return isNaN(g) ? 0 : g;
@@ -8210,12 +8210,12 @@ function pn({
8210
8210
  onBack: C,
8211
8211
  t: w,
8212
8212
  productImage: H,
8213
- productTitle: c,
8213
+ productTitle: p,
8214
8214
  isMobile: z,
8215
8215
  isTryOnImage: T,
8216
8216
  showLines: x,
8217
8217
  onToggleLines: l,
8218
- overlayNode: nA,
8218
+ overlayNode: fA,
8219
8219
  onImageLoad: r,
8220
8220
  onTryOn: b,
8221
8221
  tryOnProcessing: k,
@@ -8228,34 +8228,34 @@ function pn({
8228
8228
  onRegenerateTryOn: tA,
8229
8229
  pendingCustomSize: wA
8230
8230
  }) {
8231
- const YA = e?.recommendedSize || "", [h, a] = d(null), XA = P.toLowerCase(), RA = XA.includes("mm") ? "mm" : XA.includes("cm") ? "cm" : "in", vA = D || RA, J = (E) => ZP(E, vA, RA), gA = (E) => Re(E, vA, RA), kA = O ? Object.keys(O) : [], [iA, BA] = d(null), OA = i?.secResult?.recommendedSize || "", [gf, KA] = d(null), ef = pf(() => {
8231
+ const YA = e?.recommendedSize || "", [h, a] = d(null), bA = P.toLowerCase(), RA = bA.includes("mm") ? "mm" : bA.includes("cm") ? "cm" : "in", vA = D || RA, N = (E) => ZP(E, vA, RA), PA = (E) => Re(E, vA, RA), kA = O ? Object.keys(O) : [], [iA, BA] = d(null), OA = i?.secResult?.recommendedSize || "", [gf, KA] = d(null), ef = pf(() => {
8232
8232
  if (!i) return [];
8233
- const E = i.section, y = E.headers.findIndex((FA) => /size|taglia|größe|taille/i.test(FA.trim())), HA = y >= 0 ? y : 0, Q = E.headers[HA] || "Size", Z = E.rows.map((FA) => Rf(FA, HA, Q)).filter(Boolean);
8233
+ const E = i.section, y = E.headers.findIndex((FA) => /size|taglia|größe|taille/i.test(FA.trim())), QA = y >= 0 ? y : 0, Q = E.headers[QA] || "Size", Z = E.rows.map((FA) => Rf(FA, QA, Q)).filter(Boolean);
8234
8234
  return [...new Set(Z)];
8235
8235
  }, [i]), hA = pf(() => ({}), []), Pf = pf(() => {
8236
8236
  const E = g.headers.findIndex((y) => /size|taglia|größe|taille/i.test(y.trim()));
8237
8237
  if (E >= 0) return E;
8238
8238
  for (let y = 0; y < g.headers.length; y++) {
8239
- const HA = g.headers[y];
8240
- if (g.rows.some((Q) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Rf(Q, y, HA)))) return y;
8239
+ const QA = g.headers[y];
8240
+ if (g.rows.some((Q) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Rf(Q, y, QA)))) return y;
8241
8241
  }
8242
8242
  return 0;
8243
8243
  }, [g]), ZA = g.headers[Pf] || "Size", df = pf(() => {
8244
8244
  const E = g.rows.map((y) => Rf(y, Pf, ZA)).filter(Boolean);
8245
8245
  return [...new Set(E)];
8246
- }, [g, Pf, ZA]), aA = h || YA, Bf = aA === YA, DA = pf(() => {
8246
+ }, [g, Pf, ZA]), jA = h || YA, Bf = jA === YA, DA = pf(() => {
8247
8247
  if (Bf) return null;
8248
- const E = e?.matchDetails ?? [], y = /tight|loose|large|small|very/i, HA = E.some((Q) => y.test(Q.fit || ""));
8249
- return w(HA ? "Not Recommended" : "Your Selection");
8250
- }, [Bf, e, w]), TA = iA && Bf && O && O[iA] ? O[iA] : aA, I = pf(() => {
8248
+ const E = e?.matchDetails ?? [], y = /tight|loose|large|small|very/i, QA = E.some((Q) => y.test(Q.fit || ""));
8249
+ return w(QA ? "Not Recommended" : "Your Selection");
8250
+ }, [Bf, e, w]), TA = iA && Bf && O && O[iA] ? O[iA] : jA, I = pf(() => {
8251
8251
  const E = [];
8252
8252
  for (let y = 0; y < g.headers.length; y++) {
8253
- const HA = (g.headers[y] || "").toLowerCase();
8254
- if (/\(cm\)|centimeter/i.test(HA)) {
8253
+ const QA = (g.headers[y] || "").toLowerCase();
8254
+ if (/\(cm\)|centimeter/i.test(QA)) {
8255
8255
  E.push("cm");
8256
8256
  continue;
8257
8257
  }
8258
- if (/\(in\)|\(inch|inch/i.test(HA)) {
8258
+ if (/\(in\)|\(inch|inch/i.test(QA)) {
8259
8259
  E.push("in");
8260
8260
  continue;
8261
8261
  }
@@ -8277,24 +8277,24 @@ function pn({
8277
8277
  }
8278
8278
  return E;
8279
8279
  }, [g]), uA = EA((E, y) => {
8280
- const HA = E.toLowerCase().trim(), Q = P === "cm" || P === "", Z = Q ? "cm" : "in", FA = [];
8280
+ const QA = E.toLowerCase().trim(), Q = P === "cm" || P === "", Z = Q ? "cm" : "in", FA = [];
8281
8281
  for (let V = 0; V < g.headers.length; V++) {
8282
8282
  const xA = (g.headers[V] || "").toLowerCase().trim();
8283
- if (xA === HA) {
8283
+ if (xA === QA) {
8284
8284
  FA.push(V);
8285
8285
  continue;
8286
8286
  }
8287
8287
  const wf = xA.replace(/\s*\(.*?\)\s*/g, "").trim();
8288
- (wf === HA || xA.includes(HA) || HA.includes(wf)) && FA.push(V);
8288
+ (wf === QA || xA.includes(QA) || QA.includes(wf)) && FA.push(V);
8289
8289
  }
8290
8290
  if (FA.length === 0) return null;
8291
8291
  let SA = FA.find((V) => I[V] === Z);
8292
8292
  SA == null && (SA = FA[0]);
8293
- const tf = g.headers[SA], bA = y.trim().toLowerCase();
8293
+ const tf = g.headers[SA], XA = y.trim().toLowerCase();
8294
8294
  let _ = g.rows.find((V) => Rf(V, Pf, ZA) === y);
8295
- if (_ || (_ = g.rows.find((V) => Rf(V, Pf, ZA).trim().toLowerCase() === bA)), _ || (_ = g.rows.find((V) => {
8295
+ if (_ || (_ = g.rows.find((V) => Rf(V, Pf, ZA).trim().toLowerCase() === XA)), _ || (_ = g.rows.find((V) => {
8296
8296
  const xA = Rf(V, Pf, ZA).trim().toLowerCase();
8297
- return xA.startsWith(bA) || bA.startsWith(xA);
8297
+ return xA.startsWith(XA) || XA.startsWith(xA);
8298
8298
  })), !_) return null;
8299
8299
  const qA = Rf(_, SA, tf);
8300
8300
  if (!qA) return null;
@@ -8308,16 +8308,16 @@ function pn({
8308
8308
  return { range: String(V(W.min)) + (W.min !== W.max ? "–" + String(V(W.max)) : ""), min: V(W.min), max: V(W.max) };
8309
8309
  }
8310
8310
  return { range: qA, ...W };
8311
- }, [g, Pf, ZA, P, I]), fA = pf(() => {
8311
+ }, [g, Pf, ZA, P, I]), AA = pf(() => {
8312
8312
  if (S)
8313
8313
  return (e?.matchDetails || []).map((L) => {
8314
8314
  let V = L.chartRange, xA = L.fit;
8315
- if (aA !== YA) {
8316
- const wf = uA(L.measurement, aA);
8315
+ if (jA !== YA) {
8316
+ const wf = uA(L.measurement, jA);
8317
8317
  if (wf && (wf.min > 0 || wf.max > 0)) {
8318
- const zA = (L.chartRange.match(/[a-zA-Z]+\s*$/) || [""])[0];
8319
- V = wf.range + (zA ? ` ${zA.trim()}` : "");
8320
- const Df = uf(L.userValue);
8318
+ const cA = (L.chartRange.match(/[a-zA-Z]+\s*$/) || [""])[0];
8319
+ V = wf.range + (cA ? ` ${cA.trim()}` : "");
8320
+ const Df = kf(L.userValue);
8321
8321
  if (Df > 0) {
8322
8322
  const Af = wf.min, Hf = wf.max, WA = Hf - Af, ff = WA > 0 ? WA * 0.5 : Af * 0.05 || 3, nf = Math.max((Hf || Af) * 5e-3, 0.25);
8323
8323
  if (Df >= Af - nf && Df <= Hf + nf) xA = "good";
@@ -8341,11 +8341,11 @@ function pn({
8341
8341
  isLength: !1
8342
8342
  };
8343
8343
  });
8344
- const E = e?.matchDetails || [], y = i?.secResult?.matchDetails || [], HA = /* @__PURE__ */ new Set(), Q = [...E, ...y].filter((W) => {
8344
+ const E = e?.matchDetails || [], y = i?.secResult?.matchDetails || [], QA = /* @__PURE__ */ new Set(), Q = [...E, ...y].filter((W) => {
8345
8345
  const L = String(W?.measurement ?? "").toLowerCase().trim();
8346
- return !L || HA.has(L) ? !1 : (HA.add(L), !0);
8347
- }), Z = e?.length || "", FA = (e?.availableLengths?.length || 0) > 0, SA = OA || Z, tf = !!(i || FA), bA = Q.some((W) => W.measurement.toLowerCase() === "height"), _ = !!i?.section?.headers?.some((W) => /height|altezza|estatura|\(cm\)/i.test(W));
8348
- if (i && _ && !bA) {
8346
+ return !L || QA.has(L) ? !1 : (QA.add(L), !0);
8347
+ }), Z = e?.length || "", FA = (e?.availableLengths?.length || 0) > 0, SA = OA || Z, tf = !!(i || FA), XA = Q.some((W) => W.measurement.toLowerCase() === "height"), _ = !!i?.section?.headers?.some((W) => /height|altezza|estatura|\(cm\)/i.test(W));
8348
+ if (i && _ && !XA) {
8349
8349
  const W = B.height || 0;
8350
8350
  Q.push({
8351
8351
  measurement: "Height",
@@ -8353,7 +8353,7 @@ function pn({
8353
8353
  chartRange: SA || "",
8354
8354
  fit: "good"
8355
8355
  });
8356
- } else if (FA && !i && !bA) {
8356
+ } else if (FA && !i && !XA) {
8357
8357
  const W = B.height || 0;
8358
8358
  Q.push({
8359
8359
  measurement: "Height",
@@ -8366,50 +8366,50 @@ function pn({
8366
8366
  const qA = new Set(y.map((W) => W.measurement));
8367
8367
  return tf && qA.add("Height"), Q.map((W) => {
8368
8368
  if (qA.has(W.measurement)) {
8369
- const VA = B[W.measurement.toLowerCase()] || uf(W.userValue), o = gf || SA || W.chartRange;
8369
+ const VA = B[W.measurement.toLowerCase()] || kf(W.userValue), o = gf || SA || W.chartRange;
8370
8370
  if (!i)
8371
8371
  return { area: W.measurement + " (" + o + ")", userNum: VA, chartLabel: o, fit: "good", isLength: !0 };
8372
8372
  const j = i.section, U = W.measurement.toLowerCase(), R = U === "height", u = j.headers.findIndex((zf) => /size|length/i.test(zf.trim())), Y = P === "in";
8373
- let MA = -1, CA = !1;
8373
+ let MA = -1, HA = !1;
8374
8374
  if (R) {
8375
- const zf = j.headers.findIndex((dA) => /cm|\(cm\)|height.*cm/i.test(dA.toLowerCase())), $A = j.headers.findIndex((dA) => /height|altezza|estatura/i.test(dA.toLowerCase()) && !/cm/i.test(dA));
8376
- MA = zf >= 0 ? zf : $A, CA = MA === zf;
8375
+ const zf = j.headers.findIndex((UA) => /cm|\(cm\)|height.*cm/i.test(UA.toLowerCase())), $A = j.headers.findIndex((UA) => /height|altezza|estatura/i.test(UA.toLowerCase()) && !/cm/i.test(UA));
8376
+ MA = zf >= 0 ? zf : $A, HA = MA === zf;
8377
8377
  } else
8378
8378
  MA = j.headers.findIndex((zf) => {
8379
8379
  const $A = zf.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
8380
8380
  return $A ? $A === U || $A.includes(U) || U.includes($A) : !1;
8381
- }), CA = MA >= 0 ? /cm/i.test(j.headers[MA] || "") : !1;
8382
- const JA = u >= 0 ? u : 0, X = MA >= 0 ? MA : -1, jA = ((() => {
8381
+ }), HA = MA >= 0 ? /cm/i.test(j.headers[MA] || "") : !1;
8382
+ const JA = u >= 0 ? u : 0, X = MA >= 0 ? MA : -1, dA = ((() => {
8383
8383
  const zf = (o || "").toLowerCase().trim();
8384
8384
  return /big.*tall|tall/.test(zf) ? "Long" : /^big$/.test(zf) ? "Regular" : o;
8385
- })() || "").toLowerCase().trim(), q = j.rows.find((zf) => Rf(zf, JA, j.headers[JA]) === o) || j.rows.find((zf) => Rf(zf, JA, j.headers[JA]).trim().toLowerCase() === jA) || null;
8386
- let PA = o, vf = "good";
8385
+ })() || "").toLowerCase().trim(), q = j.rows.find((zf) => Rf(zf, JA, j.headers[JA]) === o) || j.rows.find((zf) => Rf(zf, JA, j.headers[JA]).trim().toLowerCase() === dA) || null;
8386
+ let nA = o, vf = "good";
8387
8387
  if (q && X >= 0) {
8388
8388
  const zf = Rf(q, X, j.headers[X]);
8389
8389
  if (zf) {
8390
- const { min: $A, max: dA } = Fn(zf);
8391
- if ($A > 0 && dA > 0) {
8392
- const sf = CA && Y || !CA && !Y ? +(VA * 2.54).toFixed(1) : VA, Cn = dA - $A, mf = Cn > 0 ? Cn * 0.5 : $A * 0.05 || 3, kf = Math.max((dA || $A) * 5e-3, 0.25);
8393
- if (sf >= $A - kf && sf <= dA + kf) vf = "good";
8390
+ const { min: $A, max: UA } = Fn(zf);
8391
+ if ($A > 0 && UA > 0) {
8392
+ const sf = HA && Y || !HA && !Y ? +(VA * 2.54).toFixed(1) : VA, Cn = UA - $A, mf = Cn > 0 ? Cn * 0.5 : $A * 0.05 || 3, Xf = Math.max((UA || $A) * 5e-3, 0.25);
8393
+ if (sf >= $A - Xf && sf <= UA + Xf) vf = "good";
8394
8394
  else if (sf < $A) {
8395
8395
  const Yf = $A - sf;
8396
8396
  vf = Yf > mf * 2 ? "too-long" : Yf > mf ? "long" : "a-bit-long";
8397
8397
  } else {
8398
- const Yf = sf - dA;
8398
+ const Yf = sf - UA;
8399
8399
  vf = Yf > mf * 2 ? "too-short" : Yf > mf ? "short" : "a-bit-short";
8400
8400
  }
8401
- const Wf = CA && Y || !CA && !Y, Vf = Wf ? CA ? +($A / 2.54).toFixed(1) : +($A * 2.54).toFixed(1) : $A, Jf = Wf ? CA ? +(dA / 2.54).toFixed(1) : +(dA * 2.54).toFixed(1) : dA;
8402
- PA = `${Vf}-${Jf}`;
8401
+ const Wf = HA && Y || !HA && !Y, Vf = Wf ? HA ? +($A / 2.54).toFixed(1) : +($A * 2.54).toFixed(1) : $A, Jf = Wf ? HA ? +(UA / 2.54).toFixed(1) : +(UA * 2.54).toFixed(1) : UA;
8402
+ nA = `${Vf}-${Jf}`;
8403
8403
  } else
8404
- PA = zf;
8404
+ nA = zf;
8405
8405
  }
8406
8406
  }
8407
- return { area: W.measurement + " (" + o + ")", userNum: VA, chartLabel: qn(PA), fit: vf, isLength: !0 };
8407
+ return { area: W.measurement + " (" + o + ")", userNum: VA, chartLabel: qn(nA), fit: vf, isLength: !0 };
8408
8408
  }
8409
- const L = B[W.measurement.toLowerCase()] || uf(W.userValue);
8409
+ const L = B[W.measurement.toLowerCase()] || kf(W.userValue);
8410
8410
  let { min: V, max: xA } = Fn(W.chartRange), wf = W.chartRange;
8411
- const zA = uA(W.measurement, aA);
8412
- zA && (wf = zA.range, V = zA.min, xA = zA.max);
8411
+ const cA = uA(W.measurement, jA);
8412
+ cA && (wf = cA.range, V = cA.min, xA = cA.max);
8413
8413
  const Df = xA - V, Af = Df > 0 ? Df * 0.5 : V * 0.05 || 3, Hf = W.measurement.toLowerCase(), WA = /length|inseam|sleeve|hem|rise/.test(Hf);
8414
8414
  let ff;
8415
8415
  const nf = Math.max((xA || V) * 0.03, 0.5);
@@ -8427,9 +8427,9 @@ function pn({
8427
8427
  }
8428
8428
  return { area: W.measurement, userNum: L, chartLabel: qn(wf), fit: ff, isLength: WA };
8429
8429
  });
8430
- }, [e, i, B, aA, YA, uA, gf, OA, S]), sA = fA.filter(
8430
+ }, [e, i, B, jA, YA, uA, gf, OA, S]), sA = AA.filter(
8431
8431
  (E) => E.fit === "good" || E.fit === "a-bit-tight" || E.fit === "a-bit-loose"
8432
- ).length, yA = fA.length > 0 ? Math.round(sA / fA.length * 100) : 0, Of = !S, LA = e, eA = LA?.size || YA, Uf = (e?.matchDetails || []).find(
8432
+ ).length, yA = AA.length > 0 ? Math.round(sA / AA.length * 100) : 0, Of = !S, LA = e, gA = LA?.size || YA, Uf = (e?.matchDetails || []).find(
8433
8433
  (E) => /inseam|length/i.test(E.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(E.measurement)
8434
8434
  ), jf = Uf ? (Uf.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", lA = LA?.length || OA || jf, Mf = LA?.availableSizes || [], Qf = LA?.availableLengths || [], af = gf || lA, xf = Mf.length > 0 ? Mf : df, _A = (() => {
8435
8435
  if (xf.length <= 3) return xf;
@@ -8448,7 +8448,7 @@ function pn({
8448
8448
  const E = n.replace(/\s*[—–-]\s*.*/g, ""), y = (Q) => {
8449
8449
  const Z = Q.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
8450
8450
  return Z.includes("chest") || Z.includes("bust") ? w("Full circumference at the widest point.") : Z.includes("waist") ? w("Circumference at the natural waistline.") : Z.includes("hip") ? w("Circumference at the fullest point.") : Z.includes("shoulder") ? w("Shoulder edge to shoulder edge.") : Z.includes("sleeve") || Z.includes("arm") ? w("Shoulder seam to cuff edge.") : Z.includes("neck") || Z.includes("collar") ? w("Around the base of the neck.") : Z.includes("inseam") || Z.includes("inside leg") ? w("Inner leg seam length.") : Z.includes("thigh") ? w("Circumference around the upper leg.") : Z.includes("length") || Z.includes("height") ? w("Top to bottom length.") : "";
8451
- }, HA = (Q, Z) => Z && Q === "good" ? w("EDITORIAL LENGTH") : Q === "good" ? w("PERFECT TENSION") : Q === "a-bit-tight" ? w("SLIGHTLY TIGHT") : Q === "a-bit-loose" ? w("SLIGHT EASE") : Q.includes("tight") ? w("TIGHT") : Q.includes("loose") ? w("LOOSE") : w("FIT");
8451
+ }, QA = (Q, Z) => Z && Q === "good" ? w("EDITORIAL LENGTH") : Q === "good" ? w("PERFECT TENSION") : Q === "a-bit-tight" ? w("SLIGHTLY TIGHT") : Q === "a-bit-loose" ? w("SLIGHT EASE") : Q.includes("tight") ? w("TIGHT") : Q.includes("loose") ? w("LOOSE") : w("FIT");
8452
8452
  return /* @__PURE__ */ A("div", { className: "ps-msd-root", children: /* @__PURE__ */ f("div", { className: "ps-msd-scroll", children: [
8453
8453
  /* @__PURE__ */ f("div", { className: "ps-msd-topbar", children: [
8454
8454
  /* @__PURE__ */ A("button", { type: "button", className: "ps-msd-back", onClick: C, "aria-label": w("Back"), children: /* @__PURE__ */ f("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "20", height: "20", children: [
@@ -8467,12 +8467,12 @@ function pn({
8467
8467
  "img",
8468
8468
  {
8469
8469
  src: H,
8470
- alt: c || "",
8470
+ alt: p || "",
8471
8471
  className: "ps-msd-image-img",
8472
8472
  onLoad: r
8473
8473
  }
8474
8474
  ),
8475
- x && nA,
8475
+ x && fA,
8476
8476
  T && l && /* @__PURE__ */ f(
8477
8477
  "button",
8478
8478
  {
@@ -8510,7 +8510,7 @@ function pn({
8510
8510
  /* @__PURE__ */ A("p", { className: "ps-msd-card-note", style: { margin: 0, lineHeight: 1.5 }, children: w("Your measurements are outside this product's size range. You can still try it on visually below.") })
8511
8511
  ] }) }),
8512
8512
  K !== !1 && /* @__PURE__ */ f("div", { className: "ps-msd-card", children: [
8513
- /* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: w(aA === eA ? "RECOMMENDED SIZE" : "TRYING SIZE") }),
8513
+ /* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: w(jA === gA ? "RECOMMENDED SIZE" : "TRYING SIZE") }),
8514
8514
  /* @__PURE__ */ f("div", { style: { display: "flex", alignItems: "center", gap: "10px", marginTop: "6px", marginBottom: "4px" }, children: [
8515
8515
  kA.length > 1 && /* @__PURE__ */ f(
8516
8516
  "select",
@@ -8569,14 +8569,14 @@ function pn({
8569
8569
  ] }),
8570
8570
  /* @__PURE__ */ A("p", { className: "ps-msd-card-note", children: w("Based on your measurements and the garment's tailoring chart.") })
8571
8571
  ] }),
8572
- K !== !1 && fA.length > 0 && /* @__PURE__ */ f("div", { className: "ps-msd-blueprint", children: [
8572
+ K !== !1 && AA.length > 0 && /* @__PURE__ */ f("div", { className: "ps-msd-blueprint", children: [
8573
8573
  /* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: w("MEASUREMENT BLUEPRINT") }),
8574
8574
  /* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
8575
- /* @__PURE__ */ A("div", { className: "ps-msd-rows", children: fA.map((Q, Z) => {
8576
- const FA = Q.isLength && Q.fit.includes("short") || Q.fit.includes("tight"), SA = Q.fit === "good" ? "ps-good" : FA ? "ps-tight" : "ps-loose", tf = y(Q.area), bA = String(Z + 1).padStart(2, "0");
8575
+ /* @__PURE__ */ A("div", { className: "ps-msd-rows", children: AA.map((Q, Z) => {
8576
+ const FA = Q.isLength && Q.fit.includes("short") || Q.fit.includes("tight"), SA = Q.fit === "good" ? "ps-good" : FA ? "ps-tight" : "ps-loose", tf = y(Q.area), XA = String(Z + 1).padStart(2, "0");
8577
8577
  return /* @__PURE__ */ f("div", { className: "ps-msd-row", children: [
8578
8578
  /* @__PURE__ */ f("div", { className: "ps-msd-row-num", children: [
8579
- bA,
8579
+ XA,
8580
8580
  " ",
8581
8581
  Q.area.toUpperCase()
8582
8582
  ] }),
@@ -8584,19 +8584,19 @@ function pn({
8584
8584
  /* @__PURE__ */ f("div", { className: "ps-msd-row-cells", children: [
8585
8585
  /* @__PURE__ */ f("div", { className: "ps-msd-row-cell", children: [
8586
8586
  /* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: w("USER") }),
8587
- /* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: S ? Q.rawUserValue || "—" : isNaN(Q.userNum) || Q.userNum === 0 ? "—" : `${J(Q.userNum)} ${P}` })
8587
+ /* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: S ? Q.rawUserValue || "—" : isNaN(Q.userNum) || Q.userNum === 0 ? "—" : `${N(Q.userNum)} ${P}` })
8588
8588
  ] }),
8589
8589
  /* @__PURE__ */ f("div", { className: "ps-msd-row-cell ps-right", children: [
8590
8590
  /* @__PURE__ */ f("span", { className: "ps-msd-cell-label", children: [
8591
8591
  w("SIZE"),
8592
8592
  " ",
8593
- aA
8593
+ jA
8594
8594
  ] }),
8595
- /* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: S ? Q.rawChartRange || "—" : gA(Q.chartLabel) })
8595
+ /* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: S ? Q.rawChartRange || "—" : PA(Q.chartLabel) })
8596
8596
  ] })
8597
8597
  ] }),
8598
8598
  /* @__PURE__ */ f("div", { className: `ps-msd-row-badge ${SA}`, children: [
8599
- Q.isLength ? EP(Q.fit, w).toUpperCase() : HA(Q.fit, Q.isLength),
8599
+ Q.isLength ? EP(Q.fit, w).toUpperCase() : QA(Q.fit, Q.isLength),
8600
8600
  /* @__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" }) })
8601
8601
  ] })
8602
8602
  ] }, Z);
@@ -8608,7 +8608,7 @@ function pn({
8608
8608
  "button",
8609
8609
  {
8610
8610
  type: "button",
8611
- className: `ps-msd-size-pill${Q === aA ? " ps-active" : ""}`,
8611
+ className: `ps-msd-size-pill${Q === jA ? " ps-active" : ""}`,
8612
8612
  onClick: () => a(Q === YA ? null : Q),
8613
8613
  children: Q
8614
8614
  },
@@ -8638,7 +8638,7 @@ function pn({
8638
8638
  K !== !1 && /* @__PURE__ */ f("p", { className: "ps-msd-footer-note", children: [
8639
8639
  w("*Our sizing engine recommends"),
8640
8640
  " ",
8641
- eA,
8641
+ gA,
8642
8642
  lA ? ` (${lA})` : "",
8643
8643
  " ",
8644
8644
  w("based on your measurements and the garment's tailoring chart.")
@@ -8769,10 +8769,10 @@ function pn({
8769
8769
  }, children: [
8770
8770
  /* @__PURE__ */ A("span", { style: { fontSize: "3.5vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children: TA }),
8771
8771
  af && (() => {
8772
- const E = /^\d+(\.\d+)?$/.test(String(af).trim()), y = (n || "").toLowerCase(), HA = E ? /pant|trouser|inseam/.test(y) ? w("Inseam") : w("Length") : null;
8772
+ const E = /^\d+(\.\d+)?$/.test(String(af).trim()), y = (n || "").toLowerCase(), QA = E ? /pant|trouser|inseam/.test(y) ? w("Inseam") : w("Length") : null;
8773
8773
  return /* @__PURE__ */ f("span", { style: { fontSize: "1.4vw", fontWeight: 400, color: "var(--ps-text-secondary)", display: "inline-flex", alignItems: "baseline", gap: "0.25vw" }, children: [
8774
8774
  /* @__PURE__ */ A("span", { style: { fontSize: "0.9vw", fontWeight: 600, color: "var(--ps-text-muted)", letterSpacing: "0.02em" }, children: "/" }),
8775
- HA && /* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", fontWeight: 600, color: "var(--ps-text-muted)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: HA }),
8775
+ QA && /* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", fontWeight: 600, color: "var(--ps-text-muted)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: QA }),
8776
8776
  /* @__PURE__ */ A("span", { children: af })
8777
8777
  ] });
8778
8778
  })(),
@@ -8794,20 +8794,20 @@ function pn({
8794
8794
  w("Match based on your silhouette profile")
8795
8795
  ] })
8796
8796
  ] }),
8797
- fA.length > 0 && /* @__PURE__ */ A("div", { style: { background: "white", borderRadius: "0.5vw", border: "1px solid rgba(0,0,0,0.06)", overflow: "hidden", marginBottom: "1.2vw" }, children: /* @__PURE__ */ f("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
8797
+ AA.length > 0 && /* @__PURE__ */ A("div", { style: { background: "white", borderRadius: "0.5vw", border: "1px solid rgba(0,0,0,0.06)", overflow: "hidden", marginBottom: "1.2vw" }, children: /* @__PURE__ */ f("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
8798
8798
  /* @__PURE__ */ A("thead", { children: /* @__PURE__ */ f("tr", { children: [
8799
8799
  /* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: w("Measurement") }),
8800
8800
  /* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: w("Your Body") }),
8801
8801
  /* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: w("Garment Spec") }),
8802
8802
  /* @__PURE__ */ A("th", { style: { textAlign: "right", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: w("Fit Result") })
8803
8803
  ] }) }),
8804
- /* @__PURE__ */ A("tbody", { children: fA.map((E, y) => {
8805
- const HA = E.fit === "good" ? "#2154EF" : E.isLength ? E.fit.includes("short") || E.fit.includes("tight") ? "#dc2626" : "#d97706" : E.fit.includes("tight") ? "#dc2626" : "#d97706", Q = E.fit === "good" ? "rgba(33,84,239,0.08)" : E.isLength ? E.fit.includes("short") || E.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : E.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
8806
- return /* @__PURE__ */ f("tr", { style: { borderBottom: y < fA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
8804
+ /* @__PURE__ */ A("tbody", { children: AA.map((E, y) => {
8805
+ const QA = E.fit === "good" ? "#2154EF" : E.isLength ? E.fit.includes("short") || E.fit.includes("tight") ? "#dc2626" : "#d97706" : E.fit.includes("tight") ? "#dc2626" : "#d97706", Q = E.fit === "good" ? "rgba(33,84,239,0.08)" : E.isLength ? E.fit.includes("short") || E.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : E.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
8806
+ return /* @__PURE__ */ f("tr", { style: { borderBottom: y < AA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
8807
8807
  /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: E.area }),
8808
- /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: S ? E.rawUserValue || "—" : isNaN(E.userNum) || E.userNum === 0 ? "—" : `${J(E.userNum)} ${P}` }),
8809
- /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: S ? E.rawChartRange || "—" : gA(E.chartLabel) }),
8810
- /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: HA, background: Q, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: E.isLength ? EP(E.fit, w) : Ie(E.fit, w) }) })
8808
+ /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: S ? E.rawUserValue || "—" : isNaN(E.userNum) || E.userNum === 0 ? "—" : `${N(E.userNum)} ${P}` }),
8809
+ /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: S ? E.rawChartRange || "—" : PA(E.chartLabel) }),
8810
+ /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: QA, background: Q, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: E.isLength ? EP(E.fit, w) : Ie(E.fit, w) }) })
8811
8811
  ] }, y);
8812
8812
  }) })
8813
8813
  ] }) }),
@@ -8820,7 +8820,7 @@ function pn({
8820
8820
  w("Size")
8821
8821
  ] }),
8822
8822
  /* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: _A.map((E) => {
8823
- const y = E === aA;
8823
+ const y = E === jA;
8824
8824
  return /* @__PURE__ */ A(
8825
8825
  "button",
8826
8826
  {
@@ -8848,7 +8848,7 @@ function pn({
8848
8848
  mA.length > 0 && /* @__PURE__ */ f("div", { style: { marginBottom: "0.8vw", marginTop: "0.4vw" }, children: [
8849
8849
  /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 700, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.1em", display: "block", marginBottom: "0.4vw" }, children: w("Length Adjustment") }),
8850
8850
  /* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: mA.map((E) => {
8851
- const y = String(af ?? "").trim() === String(E ?? "").trim(), HA = hA[String(E).trim()];
8851
+ const y = String(af ?? "").trim() === String(E ?? "").trim(), QA = hA[String(E).trim()];
8852
8852
  return /* @__PURE__ */ f(
8853
8853
  "button",
8854
8854
  {
@@ -8872,7 +8872,7 @@ function pn({
8872
8872
  },
8873
8873
  children: [
8874
8874
  /* @__PURE__ */ A("span", { children: E }),
8875
- HA && /* @__PURE__ */ A("span", { style: { fontSize: "0.55vw", fontWeight: 500, opacity: 0.75 }, children: HA })
8875
+ QA && /* @__PURE__ */ A("span", { style: { fontSize: "0.55vw", fontWeight: 500, opacity: 0.75 }, children: QA })
8876
8876
  ]
8877
8877
  },
8878
8878
  E
@@ -8880,27 +8880,27 @@ function pn({
8880
8880
  }) })
8881
8881
  ] }),
8882
8882
  (F || tA) && (!Bf || gf && gf !== lA) && /* @__PURE__ */ A("div", { style: { marginTop: "0.6vw", marginBottom: "0.2vw" }, children: (() => {
8883
- const E = aA, y = gf || lA || "", HA = !!(gf && gf !== lA), Q = y ? `${E} / ${y}` : E, Z = () => {
8883
+ const E = jA, y = gf || lA || "", QA = !!(gf && gf !== lA), Q = y ? `${E} / ${y}` : E, Z = () => {
8884
8884
  const SA = e?.matchDetails || [];
8885
8885
  if (!SA.length) return;
8886
8886
  const tf = new Set(
8887
- (i?.secResult?.matchDetails || []).map((bA) => bA.measurement.toLowerCase())
8887
+ (i?.secResult?.matchDetails || []).map((XA) => XA.measurement.toLowerCase())
8888
8888
  );
8889
- return SA.map((bA) => {
8890
- const _ = bA.measurement.toLowerCase();
8889
+ return SA.map((XA) => {
8890
+ const _ = XA.measurement.toLowerCase();
8891
8891
  if (tf.has(_) && i) {
8892
8892
  const W = i.section, L = W.headers.findIndex((Df) => /size|length/i.test(Df.trim())), V = L >= 0 ? L : 0, xA = W.headers.findIndex((Df) => {
8893
8893
  const Af = Df.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
8894
8894
  return !!Af && (Af === _ || Af.includes(_) || _.includes(Af));
8895
8895
  });
8896
- if (xA < 0) return bA;
8896
+ if (xA < 0) return XA;
8897
8897
  const wf = W.rows.find((Df) => Rf(Df, V, W.headers[V]) === y);
8898
- if (!wf) return bA;
8899
- const zA = Rf(wf, xA, W.headers[xA]);
8900
- return zA ? { ...bA, chartRange: zA } : bA;
8898
+ if (!wf) return XA;
8899
+ const cA = Rf(wf, xA, W.headers[xA]);
8900
+ return cA ? { ...XA, chartRange: cA } : XA;
8901
8901
  }
8902
- const qA = uA(bA.measurement, E);
8903
- return qA?.range ? { ...bA, chartRange: qA.range } : bA;
8902
+ const qA = uA(XA.measurement, E);
8903
+ return qA?.range ? { ...XA, chartRange: qA.range } : XA;
8904
8904
  });
8905
8905
  }, FA = wA === E;
8906
8906
  return tA ? /* @__PURE__ */ f(
@@ -8909,7 +8909,7 @@ function pn({
8909
8909
  type: "button",
8910
8910
  onClick: () => tA({
8911
8911
  selectedSize: E,
8912
- selectedLength: HA ? y : void 0,
8912
+ selectedLength: QA ? y : void 0,
8913
8913
  displayLabel: Q,
8914
8914
  matchDetails: Z()
8915
8915
  }),
@@ -8946,7 +8946,7 @@ function pn({
8946
8946
  onClick: () => {
8947
8947
  F && F(FA ? null : {
8948
8948
  selectedSize: E,
8949
- selectedLength: HA ? y : void 0,
8949
+ selectedLength: QA ? y : void 0,
8950
8950
  displayLabel: Q,
8951
8951
  matchDetails: Z()
8952
8952
  });
@@ -9068,12 +9068,12 @@ function Oe({
9068
9068
  setView: C,
9069
9069
  handleDownload: w,
9070
9070
  onRetryWithFit: H,
9071
- retryLoading: c,
9071
+ retryLoading: p,
9072
9072
  selectedFile: z,
9073
9073
  previewUrl: T,
9074
9074
  handleFileSelect: x,
9075
9075
  handleRemovePreview: l,
9076
- handleTryOnSubmit: nA,
9076
+ handleTryOnSubmit: fA,
9077
9077
  tryOnProcessing: r,
9078
9078
  bodyLandmarks: b,
9079
9079
  faceLandmarks: k = null,
@@ -9089,7 +9089,7 @@ function Oe({
9089
9089
  onRegenerateTryOn: h,
9090
9090
  t: a
9091
9091
  }) {
9092
- const XA = (g?.unit || i || "").toString().toLowerCase(), RA = XA === "mm" ? "mm" : XA === "cm" ? "cm" : "in", vA = a(RA === "mm" ? "mm" : i === "cm" ? "cm" : "in"), [J, gA] = d({}), kA = Fn, iA = EA((o, j, U) => Rf(o, j, U), []), BA = pf(() => {
9092
+ const bA = (g?.unit || i || "").toString().toLowerCase(), RA = bA === "mm" ? "mm" : bA === "cm" ? "cm" : "in", vA = a(RA === "mm" ? "mm" : i === "cm" ? "cm" : "in"), [N, PA] = d({}), kA = Fn, iA = EA((o, j, U) => Rf(o, j, U), []), BA = pf(() => {
9093
9093
  if (!e?.headers || !e?.rows) return -1;
9094
9094
  const o = e.headers.findIndex((j) => /size|taglia|größe|taille/i.test(j.trim()));
9095
9095
  if (o >= 0) return o;
@@ -9134,34 +9134,34 @@ function Oe({
9134
9134
  if (!e?.headers || !e?.rows || BA < 0) return null;
9135
9135
  const U = o.toLowerCase().trim(), R = vA === "cm" || vA === "", u = R ? "cm" : "in", Y = [];
9136
9136
  for (let q = 0; q < e.headers.length; q++) {
9137
- const PA = (e.headers[q] || "").toLowerCase().trim();
9138
- if (PA === U) {
9137
+ const nA = (e.headers[q] || "").toLowerCase().trim();
9138
+ if (nA === U) {
9139
9139
  Y.push(q);
9140
9140
  continue;
9141
9141
  }
9142
- const vf = PA.replace(/\s*\(.*?\)\s*/g, "").trim();
9143
- (vf === U || PA.includes(U) || U.includes(vf)) && Y.push(q);
9142
+ const vf = nA.replace(/\s*\(.*?\)\s*/g, "").trim();
9143
+ (vf === U || nA.includes(U) || U.includes(vf)) && Y.push(q);
9144
9144
  }
9145
9145
  if (Y.length === 0) return null;
9146
9146
  let MA = Y.find((q) => gf[q] === u);
9147
9147
  MA == null && (MA = Y[0]);
9148
- const CA = e.headers[MA], JA = e.rows.find((q) => iA(q, BA, OA) === j);
9148
+ const HA = e.headers[MA], JA = e.rows.find((q) => iA(q, BA, OA) === j);
9149
9149
  if (!JA) return null;
9150
- const X = iA(JA, MA, CA);
9150
+ const X = iA(JA, MA, HA);
9151
9151
  if (!X) return null;
9152
- const N = kA(X), jA = gf[MA];
9153
- if (jA === "in" && R) {
9154
- const q = (PA) => +(PA * 2.54).toFixed(1);
9155
- return { range: String(q(N.min)) + (N.min !== N.max ? "–" + String(q(N.max)) : ""), min: q(N.min), max: q(N.max) };
9152
+ const J = kA(X), dA = gf[MA];
9153
+ if (dA === "in" && R) {
9154
+ const q = (nA) => +(nA * 2.54).toFixed(1);
9155
+ return { range: String(q(J.min)) + (J.min !== J.max ? "–" + String(q(J.max)) : ""), min: q(J.min), max: q(J.max) };
9156
9156
  }
9157
- if (jA === "cm" && !R) {
9158
- const q = (PA) => +(PA / 2.54).toFixed(1);
9159
- return { range: String(q(N.min)) + (N.min !== N.max ? "–" + String(q(N.max)) : ""), min: q(N.min), max: q(N.max) };
9157
+ if (dA === "cm" && !R) {
9158
+ const q = (nA) => +(nA / 2.54).toFixed(1);
9159
+ return { range: String(q(J.min)) + (J.min !== J.max ? "–" + String(q(J.max)) : ""), min: q(J.min), max: q(J.max) };
9160
9160
  }
9161
- return { range: X, ...N };
9161
+ return { range: X, ...J };
9162
9162
  }, [e, BA, OA, vA, iA, kA, gf]), ef = g?.recommendedSize || "";
9163
9163
  pf(() => g?.internationalSizes || {}, [g]);
9164
- const [hA, Pf] = d("fit"), [ZA, df] = d(null), [aA, Bf] = d(!1), [DA, TA] = d(!1), [I, uA] = d(!1), [fA, sA] = d(null), [yA, Of] = d(!1), [LA, eA] = d({ w: 800, h: 1200 }), Uf = wA ?? null, jf = (o) => {
9164
+ const [hA, Pf] = d("fit"), [ZA, df] = d(null), [jA, Bf] = d(!1), [DA, TA] = d(!1), [I, uA] = d(!1), [AA, sA] = d(null), [yA, Of] = d(!1), [LA, gA] = d({ w: 800, h: 1200 }), Uf = wA ?? null, jf = (o) => {
9165
9165
  YA?.(o);
9166
9166
  };
9167
9167
  NA(() => {
@@ -9169,7 +9169,7 @@ function Oe({
9169
9169
  }, [g?.recommendedSize]);
9170
9170
  const lA = EA((o) => {
9171
9171
  const j = o.currentTarget;
9172
- j.naturalWidth && j.naturalHeight && eA({ w: j.naturalWidth, h: j.naturalHeight });
9172
+ j.naturalWidth && j.naturalHeight && gA({ w: j.naturalWidth, h: j.naturalHeight });
9173
9173
  }, []);
9174
9174
  NA(() => {
9175
9175
  if (!B || r) {
@@ -9183,8 +9183,8 @@ function Oe({
9183
9183
  });
9184
9184
  }, [B, r]);
9185
9185
  const [Mf, Qf] = d(!1), [af, xf] = d(!1);
9186
- pA(null);
9187
- const [_A, of] = d(!1), [mA, E] = d(null), [y, HA] = d(!1), Q = pA(null), [Z, FA] = d(null), [SA, tf] = d(!1);
9186
+ aA(null);
9187
+ const [_A, of] = d(!1), [mA, E] = d(null), [y, QA] = d(!1), Q = aA(null), [Z, FA] = d(null), [SA, tf] = d(!1);
9188
9188
  NA(() => {
9189
9189
  if (mA) {
9190
9190
  const o = URL.createObjectURL(mA);
@@ -9192,7 +9192,7 @@ function Oe({
9192
9192
  }
9193
9193
  FA(null);
9194
9194
  }, [mA]);
9195
- const bA = ZA || ef;
9195
+ const XA = ZA || ef;
9196
9196
  pf(() => {
9197
9197
  if (!g?.matchDetails?.length) return [];
9198
9198
  const o = /* @__PURE__ */ new Set();
@@ -9200,28 +9200,28 @@ function Oe({
9200
9200
  const R = U.measurement.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
9201
9201
  return o.has(R) ? !1 : (o.add(R), !0);
9202
9202
  }).map((U) => {
9203
- const R = uf(U.userValue);
9203
+ const R = kf(U.userValue);
9204
9204
  let u = U.chartRange, Y = U.fit;
9205
- if (bA !== ef) {
9206
- const MA = KA(U.measurement, bA);
9205
+ if (XA !== ef) {
9206
+ const MA = KA(U.measurement, XA);
9207
9207
  if (MA && MA.min > 0) {
9208
9208
  u = qn(MA.range);
9209
- const CA = MA.min, JA = MA.max, X = JA - CA, N = X > 0 ? X * 0.5 : CA * 0.05 || 3, jA = Math.max((JA || CA) * 5e-3, 0.25);
9210
- if (R >= CA - jA && R <= JA + jA) Y = "good";
9211
- else if (R < CA) {
9212
- const q = CA - R;
9213
- Y = q > N * 2 ? "too-loose" : q > N ? "loose" : "a-bit-loose";
9209
+ const HA = MA.min, JA = MA.max, X = JA - HA, J = X > 0 ? X * 0.5 : HA * 0.05 || 3, dA = Math.max((JA || HA) * 5e-3, 0.25);
9210
+ if (R >= HA - dA && R <= JA + dA) Y = "good";
9211
+ else if (R < HA) {
9212
+ const q = HA - R;
9213
+ Y = q > J * 2 ? "too-loose" : q > J ? "loose" : "a-bit-loose";
9214
9214
  } else {
9215
9215
  const q = R - JA;
9216
- Y = q > N * 2 ? "too-tight" : q > N ? "tight" : "a-bit-tight";
9216
+ Y = q > J * 2 ? "too-tight" : q > J ? "tight" : "a-bit-tight";
9217
9217
  }
9218
9218
  }
9219
9219
  }
9220
- return { area: U.measurement, userNum: uf(U.userValue), chartLabel: u, fit: Y };
9220
+ return { area: U.measurement, userNum: kf(U.userValue), chartLabel: u, fit: Y };
9221
9221
  });
9222
- }, [g, bA, ef, KA]), pf(() => {
9222
+ }, [g, XA, ef, KA]), pf(() => {
9223
9223
  if (!e?.headers || !e?.rows || BA < 0) return null;
9224
- const o = e.rows.find((U) => iA(U, BA, OA) === bA);
9224
+ const o = e.rows.find((U) => iA(U, BA, OA) === XA);
9225
9225
  if (!o) return null;
9226
9226
  const j = [];
9227
9227
  for (let U = 0; U < e.headers.length; U++) {
@@ -9231,14 +9231,14 @@ function Oe({
9231
9231
  u && j.push({ header: R, value: u });
9232
9232
  }
9233
9233
  return j;
9234
- }, [e, BA, OA, bA, iA]);
9234
+ }, [e, BA, OA, XA, iA]);
9235
9235
  const _ = !!(e?.sections && Object.keys(e.sections).length > 1), qA = pf(() => {
9236
9236
  const o = {}, j = (U) => {
9237
9237
  if (U)
9238
9238
  for (const R of U) {
9239
9239
  const u = R.measurement.toLowerCase();
9240
9240
  if (o[u] == null) {
9241
- const Y = uf(R.userValue);
9241
+ const Y = kf(R.userValue);
9242
9242
  Y > 0 && (o[u] = Y);
9243
9243
  }
9244
9244
  }
@@ -9249,26 +9249,26 @@ function Oe({
9249
9249
  const u = U.toLowerCase();
9250
9250
  let Y = e?.sections?.[U];
9251
9251
  if (!Y && e?.sections) {
9252
- const CA = Object.entries(e.sections).find(([JA]) => {
9253
- const X = JA.toLowerCase(), N = X.replace(/\s*(size|sizing)\s*/gi, "").trim();
9254
- return N ? u === X || u.includes(N) || N.includes(u) : !1;
9252
+ const HA = Object.entries(e.sections).find(([JA]) => {
9253
+ const X = JA.toLowerCase(), J = X.replace(/\s*(size|sizing)\s*/gi, "").trim();
9254
+ return J ? u === X || u.includes(J) || J.includes(u) : !1;
9255
9255
  });
9256
- CA && (Y = CA[1]);
9256
+ HA && (Y = HA[1]);
9257
9257
  }
9258
9258
  Y || (Y = { headers: [], rows: [], requiredFields: [] });
9259
9259
  const MA = { ...o };
9260
9260
  if (R.matchDetails)
9261
- for (const CA of R.matchDetails) {
9262
- const JA = uf(CA.userValue);
9263
- JA > 0 && (MA[CA.measurement.toLowerCase()] = JA);
9261
+ for (const HA of R.matchDetails) {
9262
+ const JA = kf(HA.userValue);
9263
+ JA > 0 && (MA[HA.measurement.toLowerCase()] = JA);
9264
9264
  }
9265
9265
  return { name: U, section: Y, secResult: R, userMeasurements: MA };
9266
9266
  }) : !_ || !e?.sections ? [] : Object.entries(e.sections).map(([U, R]) => {
9267
9267
  const u = g?.sections?.[U] || { recommendedSize: g?.recommendedSize || "", matchDetails: [] }, Y = { ...o };
9268
9268
  if (u.matchDetails)
9269
9269
  for (const MA of u.matchDetails) {
9270
- const CA = uf(MA.userValue);
9271
- CA > 0 && (Y[MA.measurement.toLowerCase()] = CA);
9270
+ const HA = kf(MA.userValue);
9271
+ HA > 0 && (Y[MA.measurement.toLowerCase()] = HA);
9272
9272
  }
9273
9273
  return { name: U, section: R, secResult: u, userMeasurements: Y };
9274
9274
  });
@@ -9283,8 +9283,8 @@ function Oe({
9283
9283
  }
9284
9284
  if (/^x(tra)?[- ]?long/.test(u)) return /^\d/.test(j) ? `${j}XL` : `${j} / Extra Long`;
9285
9285
  if (/^\d/.test(j)) {
9286
- const CA = u.charAt(0).toUpperCase();
9287
- return `${j}${CA}`;
9286
+ const HA = u.charAt(0).toUpperCase();
9287
+ return `${j}${HA}`;
9288
9288
  }
9289
9289
  const MA = R.replace(/\s+/g, " ").trim();
9290
9290
  return `${j} / ${MA}`;
@@ -9296,7 +9296,7 @@ function Oe({
9296
9296
  return `${U}'${R}"`;
9297
9297
  }
9298
9298
  return `${Math.round(o)} cm`;
9299
- }, [tA, vA]), wf = !!T, zA = wf && (r || n && !g), Df = !wf && n && !g, Af = !!g, Hf = !!B && !r, WA = wf ? Af && Hf : Af, ff = AP(), nf = v === "face" || v === "head";
9299
+ }, [tA, vA]), wf = !!T, cA = wf && (r || n && !g), Df = !wf && n && !g, Af = !!g, Hf = !!B && !r, WA = wf ? Af && Hf : Af, ff = AP(), nf = v === "face" || v === "head";
9300
9300
  g?.found;
9301
9301
  const VA = v === "foot";
9302
9302
  return /* @__PURE__ */ f("div", { className: "ps-tryon-sr", children: [
@@ -9317,7 +9317,7 @@ function Oe({
9317
9317
  /* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.8vw" }, children: a("Generating your size recommendation...") })
9318
9318
  ] })
9319
9319
  ] }),
9320
- ff && zA && !WA && T && /* @__PURE__ */ A(
9320
+ ff && cA && !WA && T && /* @__PURE__ */ A(
9321
9321
  UP,
9322
9322
  {
9323
9323
  previewUrl: T,
@@ -9328,7 +9328,7 @@ function Oe({
9328
9328
  t: a
9329
9329
  }
9330
9330
  ),
9331
- !ff && zA && !WA && /* @__PURE__ */ f("div", { className: "ps-tryon-sr-split", children: [
9331
+ !ff && cA && !WA && /* @__PURE__ */ f("div", { className: "ps-tryon-sr-split", children: [
9332
9332
  /* @__PURE__ */ f("div", { className: "ps-tryon-sr-img-col", style: { position: "relative" }, children: [
9333
9333
  /* @__PURE__ */ A(
9334
9334
  "img",
@@ -9355,7 +9355,7 @@ function Oe({
9355
9355
  ) });
9356
9356
  })()
9357
9357
  ] }),
9358
- (WA || g && !zA) && /* @__PURE__ */ f(rA, { children: [
9358
+ (WA || g && !cA) && /* @__PURE__ */ f(rA, { children: [
9359
9359
  _ ? s ? (
9360
9360
  /* ── Detail view for a single section ── */
9361
9361
  (() => {
@@ -9386,10 +9386,10 @@ function Oe({
9386
9386
  showLines: DA,
9387
9387
  onToggleLines: nf ? void 0 : () => TA(!DA),
9388
9388
  onImageLoad: lA,
9389
- overlayNode: B && yA && fA ? /* @__PURE__ */ A(
9389
+ overlayNode: B && yA && AA ? /* @__PURE__ */ A(
9390
9390
  wn,
9391
9391
  {
9392
- lines: fA,
9392
+ lines: AA,
9393
9393
  fitRows: (() => {
9394
9394
  const j = [...g?.matchDetails || []];
9395
9395
  if (g?.sections)
@@ -9461,10 +9461,10 @@ function Oe({
9461
9461
  showLines: DA,
9462
9462
  onToggleLines: nf ? void 0 : () => TA(!DA),
9463
9463
  onImageLoad: lA,
9464
- overlayNode: B && yA && fA ? /* @__PURE__ */ A(
9464
+ overlayNode: B && yA && AA ? /* @__PURE__ */ A(
9465
9465
  wn,
9466
9466
  {
9467
- lines: fA,
9467
+ lines: AA,
9468
9468
  fitRows: (() => {
9469
9469
  const o = [...g?.matchDetails || []];
9470
9470
  if (g?.sections)
@@ -9494,7 +9494,7 @@ function Oe({
9494
9494
  /* @__PURE__ */ A("span", { children: a("Generating try-on...") }),
9495
9495
  /* @__PURE__ */ A(LP, { t: a, isActive: !0 })
9496
9496
  ] }),
9497
- B && !r && yA && fA && /* @__PURE__ */ A(wn, { lines: fA, fitRows: (() => {
9497
+ B && !r && yA && AA && /* @__PURE__ */ A(wn, { lines: AA, fitRows: (() => {
9498
9498
  const o = [...g?.matchDetails || []];
9499
9499
  if (g?.sections)
9500
9500
  for (const U of Object.values(g.sections))
@@ -9538,10 +9538,10 @@ function Oe({
9538
9538
  o.replace(/\s*[—–-]\s*.*/g, "")
9539
9539
  ] }),
9540
9540
  /* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value", children: MA.found === !1 ? a("No fit") : (() => {
9541
- const CA = V(o, MA.size || j.recommendedSize || ""), JA = CA.indexOf(" / ");
9542
- return JA === -1 ? CA : /* @__PURE__ */ f(rA, { children: [
9543
- /* @__PURE__ */ A("span", { children: CA.slice(0, JA) }),
9544
- /* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value-suffix", children: CA.slice(JA) })
9541
+ const HA = V(o, MA.size || j.recommendedSize || ""), JA = HA.indexOf(" / ");
9542
+ return JA === -1 ? HA : /* @__PURE__ */ f(rA, { children: [
9543
+ /* @__PURE__ */ A("span", { children: HA.slice(0, JA) }),
9544
+ /* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value-suffix", children: HA.slice(JA) })
9545
9545
  ] });
9546
9546
  })() }),
9547
9547
  /* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-rec", children: xA ? `${a("recommended")} · ${xA}` : a("recommended") })
@@ -9602,7 +9602,7 @@ function Oe({
9602
9602
  (() => {
9603
9603
  const o = e?.found ? { headers: e.headers || [], rows: e.rows || [], requiredFields: e.requiredFields || [] } : { headers: [], rows: [], requiredFields: [] }, j = { recommendedSize: g?.recommendedSize || "", matchDetails: g?.matchDetails || [] }, U = {};
9604
9604
  if (g?.matchDetails)
9605
- for (const Y of g.matchDetails) U[Y.measurement.toLowerCase()] = uf(Y.userValue);
9605
+ for (const Y of g.matchDetails) U[Y.measurement.toLowerCase()] = kf(Y.userValue);
9606
9606
  const R = a("Your Fit"), u = () => {
9607
9607
  B || (E(z || null), of(!0));
9608
9608
  };
@@ -9636,10 +9636,10 @@ function Oe({
9636
9636
  showLines: DA,
9637
9637
  onToggleLines: nf ? void 0 : () => TA(!DA),
9638
9638
  onImageLoad: lA,
9639
- overlayNode: B && yA && fA ? /* @__PURE__ */ A(
9639
+ overlayNode: B && yA && AA ? /* @__PURE__ */ A(
9640
9640
  wn,
9641
9641
  {
9642
- lines: fA,
9642
+ lines: AA,
9643
9643
  fitRows: (g?.matchDetails || []).map((Y) => ({ area: Y.measurement, userNum: parseFloat(Y.userValue) || 0, chartLabel: Y.chartRange || "", fit: Y.fit })),
9644
9644
  show: DA,
9645
9645
  imgWidth: LA.w,
@@ -9651,7 +9651,7 @@ function Oe({
9651
9651
  ) : /* @__PURE__ */ f("div", { className: "ps-tryon-v2", children: [
9652
9652
  /* @__PURE__ */ f("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
9653
9653
  /* @__PURE__ */ A("img", { src: B || P, alt: D, className: "ps-tryon-v2-bg-img", onLoad: lA }),
9654
- B && yA && fA && /* @__PURE__ */ A(wn, { lines: fA, fitRows: (g?.matchDetails || []).map((Y) => ({ area: Y.measurement, userNum: parseFloat(Y.userValue) || 0, chartLabel: Y.chartRange || "", fit: Y.fit })), show: DA, imgWidth: LA.w, imgHeight: LA.h }),
9654
+ B && yA && AA && /* @__PURE__ */ A(wn, { lines: AA, fitRows: (g?.matchDetails || []).map((Y) => ({ area: Y.measurement, userNum: parseFloat(Y.userValue) || 0, chartLabel: Y.chartRange || "", fit: Y.fit })), show: DA, imgWidth: LA.w, imgHeight: LA.h }),
9655
9655
  B && !r && /* @__PURE__ */ f("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
9656
9656
  !nf && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () => TA(!DA), children: a(DA ? "Hide Fit" : "Show Fit") }),
9657
9657
  /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: w, children: a("Download") })
@@ -9768,7 +9768,7 @@ function Oe({
9768
9768
  className: "ps-pm-primary-btn",
9769
9769
  disabled: !mA,
9770
9770
  onClick: () => {
9771
- mA && (x(mA), nA(mA), of(!1));
9771
+ mA && (x(mA), fA(mA), of(!1));
9772
9772
  },
9773
9773
  children: a("START TRY-ON")
9774
9774
  }
@@ -9801,11 +9801,11 @@ function Oe({
9801
9801
  {
9802
9802
  onClick: () => Q.current?.click(),
9803
9803
  onDragOver: (o) => {
9804
- o.preventDefault(), HA(!0);
9804
+ o.preventDefault(), QA(!0);
9805
9805
  },
9806
- onDragLeave: () => HA(!1),
9806
+ onDragLeave: () => QA(!1),
9807
9807
  onDrop: (o) => {
9808
- o.preventDefault(), HA(!1);
9808
+ o.preventDefault(), QA(!1);
9809
9809
  const j = o.dataTransfer.files[0];
9810
9810
  j && E(j);
9811
9811
  },
@@ -9928,7 +9928,7 @@ function Oe({
9928
9928
  a("Back")
9929
9929
  ] }),
9930
9930
  /* @__PURE__ */ f("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, disabled: !mA, onClick: () => {
9931
- mA && (x(mA), nA(mA), of(!1));
9931
+ mA && (x(mA), fA(mA), of(!1));
9932
9932
  }, children: [
9933
9933
  /* @__PURE__ */ A(_f, { size: 14 }),
9934
9934
  " ",
@@ -9936,13 +9936,13 @@ function Oe({
9936
9936
  ] })
9937
9937
  ] })
9938
9938
  ] }) }),
9939
- aA && e && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children: /* @__PURE__ */ f("div", { className: "ps-tryon-sr-chart-modal", children: [
9939
+ jA && e && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children: /* @__PURE__ */ f("div", { className: "ps-tryon-sr-chart-modal", children: [
9940
9940
  /* @__PURE__ */ f("div", { className: "ps-tryon-sr-chart-header", children: [
9941
9941
  /* @__PURE__ */ A("h4", { children: a("Full Size Chart") }),
9942
9942
  /* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => Bf(!1), children: "✕" })
9943
9943
  ] }),
9944
9944
  /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: e.sections && Object.keys(e.sections).length > 1 ? Object.entries(e.sections).map(([o, j]) => {
9945
- const R = g?.sections?.[o]?.recommendedSize || "", u = j.headers.findIndex((CA) => /size|taglia|größe|taille|fit|length/i.test(CA.trim())), Y = u >= 0 ? u : 0, MA = j.headers[Y] || "Size";
9945
+ const R = g?.sections?.[o]?.recommendedSize || "", u = j.headers.findIndex((HA) => /size|taglia|größe|taille|fit|length/i.test(HA.trim())), Y = u >= 0 ? u : 0, MA = j.headers[Y] || "Size";
9946
9946
  return /* @__PURE__ */ f("div", { className: "ps-tryon-chart-section", children: [
9947
9947
  /* @__PURE__ */ f("div", { className: "ps-tryon-chart-section-title", children: [
9948
9948
  /* @__PURE__ */ A("span", { children: o }),
@@ -9953,10 +9953,10 @@ function Oe({
9953
9953
  ] })
9954
9954
  ] }),
9955
9955
  /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ f("table", { className: "ps-tryon-sr-chart-table", children: [
9956
- /* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: j.headers.map((CA, JA) => /* @__PURE__ */ A("th", { className: JA === Y ? "ps-size-col" : "", children: CA }, JA)) }) }),
9957
- /* @__PURE__ */ A("tbody", { children: j.rows.map((CA, JA) => {
9958
- const N = Rf(CA, Y, MA) === R;
9959
- return /* @__PURE__ */ A("tr", { className: N ? "ps-active-row" : "", children: j.headers.map((jA, q) => /* @__PURE__ */ A("td", { className: q === Y ? "ps-size-col" : "", children: Rf(CA, q, jA) }, q)) }, JA);
9956
+ /* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: j.headers.map((HA, JA) => /* @__PURE__ */ A("th", { className: JA === Y ? "ps-size-col" : "", children: HA }, JA)) }) }),
9957
+ /* @__PURE__ */ A("tbody", { children: j.rows.map((HA, JA) => {
9958
+ const J = Rf(HA, Y, MA) === R;
9959
+ return /* @__PURE__ */ A("tr", { className: J ? "ps-active-row" : "", children: j.headers.map((dA, q) => /* @__PURE__ */ A("td", { className: q === Y ? "ps-size-col" : "", children: Rf(HA, q, dA) }, q)) }, JA);
9960
9960
  }) })
9961
9961
  ] }) })
9962
9962
  ] }, o);
@@ -9965,7 +9965,7 @@ function Oe({
9965
9965
  /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ f("table", { className: "ps-tryon-sr-chart-table", children: [
9966
9966
  /* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: e.headers.map((o, j) => /* @__PURE__ */ A("th", { className: j === BA ? "ps-size-col" : "", children: o }, j)) }) }),
9967
9967
  /* @__PURE__ */ A("tbody", { children: e.rows.map((o, j) => {
9968
- const R = iA(o, BA, OA) === bA;
9968
+ const R = iA(o, BA, OA) === XA;
9969
9969
  return /* @__PURE__ */ A("tr", { className: R ? "ps-active-row" : "", children: e.headers.map((u, Y) => /* @__PURE__ */ A("td", { className: Y === BA ? "ps-size-col" : "", children: iA(o, Y, u) }, Y)) }, j);
9970
9970
  }) })
9971
9971
  ] }) })
@@ -10002,13 +10002,13 @@ function se({
10002
10002
  {
10003
10003
  className: Ef(`ps-tryon-upload${e ? " ps-tryon-drag-over" : ""}`, w.uploadZone),
10004
10004
  onClick: () => P.current?.click(),
10005
- onDragOver: (c) => {
10006
- c.preventDefault(), B(!0);
10005
+ onDragOver: (p) => {
10006
+ p.preventDefault(), B(!0);
10007
10007
  },
10008
10008
  onDragLeave: () => B(!1),
10009
- onDrop: (c) => {
10010
- c.preventDefault(), B(!1);
10011
- const z = c.dataTransfer?.files?.[0];
10009
+ onDrop: (p) => {
10010
+ p.preventDefault(), B(!1);
10011
+ const z = p.dataTransfer?.files?.[0];
10012
10012
  z && D(z);
10013
10013
  },
10014
10014
  children: [
@@ -10019,8 +10019,8 @@ function se({
10019
10019
  type: "file",
10020
10020
  accept: "image/jpeg,image/png,image/webp",
10021
10021
  style: { display: "none" },
10022
- onChange: (c) => {
10023
- const z = c.target.files?.[0];
10022
+ onChange: (p) => {
10023
+ const z = p.target.files?.[0];
10024
10024
  z && D(z);
10025
10025
  }
10026
10026
  }
@@ -10046,7 +10046,7 @@ function Ke({
10046
10046
  }) {
10047
10047
  const H = EA((l) => {
10048
10048
  e.current = l, l && (l.style.width = `${Math.round(g.current)}%`);
10049
- }, []), c = EA((l) => {
10049
+ }, []), p = EA((l) => {
10050
10050
  B.current = l, l && (l.textContent = `${Math.round(g.current)}%`);
10051
10051
  }, []), z = EA((l) => {
10052
10052
  P.current = l;
@@ -10054,8 +10054,8 @@ function Ke({
10054
10054
  D.current = l;
10055
10055
  }, []), x = EA((l) => {
10056
10056
  if (i.current = l, l) {
10057
- const nA = kn * (1 - Math.round(g.current) / 100);
10058
- l.style.strokeDashoffset = String(nA);
10057
+ const fA = kn * (1 - Math.round(g.current) / 100);
10058
+ l.style.strokeDashoffset = String(fA);
10059
10059
  }
10060
10060
  }, []);
10061
10061
  return /* @__PURE__ */ f("div", { className: "ps-tryon-processing", children: [
@@ -10095,7 +10095,7 @@ function Ke({
10095
10095
  /* @__PURE__ */ A("span", { ref: T, className: "ps-tryon-progress-eta", children: "~22s" })
10096
10096
  ] }),
10097
10097
  /* @__PURE__ */ A("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ A("div", { ref: H, className: "ps-tryon-progress-bar-fill" }) }),
10098
- /* @__PURE__ */ A("span", { ref: c, className: "ps-tryon-progress-pct", children: "0%" })
10098
+ /* @__PURE__ */ A("span", { ref: p, className: "ps-tryon-progress-pct", children: "0%" })
10099
10099
  ] }),
10100
10100
  /* @__PURE__ */ A("div", { ref: z, className: Ef("ps-tryon-processing-text", C.processingText), children: w("Preparing your image...") }),
10101
10101
  /* @__PURE__ */ A("p", { className: Ef("ps-tryon-processing-sub", C.processingSubText), children: w("This usually takes 15-25 seconds") })
@@ -10183,55 +10183,55 @@ function an({
10183
10183
  ] }, n);
10184
10184
  }
10185
10185
  function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P }) {
10186
- const [D, i] = d(null), [C, w] = d("identity"), [H, c] = d("name-photo"), [z, T] = d(!1), [x, l] = d(null), nA = pA(null);
10186
+ const [D, i] = d(null), [C, w] = d("identity"), [H, p] = d("name-photo"), [z, T] = d(!1), [x, l] = d(null), fA = aA(null);
10187
10187
  NA(() => {
10188
- nA.current && (nA.current.scrollTop = 0);
10188
+ fA.current && (fA.current.scrollTop = 0);
10189
10189
  }, [D, C]);
10190
- const [r, b] = d(""), [k, v] = d("male"), [O, s] = d("cm"), [S, K] = d(""), [F, tA] = d(""), [wA, YA] = d(""), [h, a] = d(""), [XA, RA] = d(""), [vA, J] = d(""), [gA, kA] = d(null), [iA, BA] = d(!1), [OA, gf] = d(null), [KA, ef] = d({ w: 800, h: 1200 }), [hA, Pf] = d(0), [ZA, df] = d(!1), [aA, Bf] = d(!1);
10190
+ const [r, b] = d(""), [k, v] = d("male"), [O, s] = d("cm"), [S, K] = d(""), [F, tA] = d(""), [wA, YA] = d(""), [h, a] = d(""), [bA, RA] = d(""), [vA, N] = d(""), [PA, kA] = d(null), [iA, BA] = d(!1), [OA, gf] = d(null), [KA, ef] = d({ w: 800, h: 1200 }), [hA, Pf] = d(0), [ZA, df] = d(!1), [jA, Bf] = d(!1);
10191
10191
  NA(() => {
10192
- if (H !== "calculating" || !gA) return;
10192
+ if (H !== "calculating" || !PA) return;
10193
10193
  let o = !1;
10194
- return $f(gA).then((j) => {
10194
+ return $f(PA).then((j) => {
10195
10195
  !o && j && gf(j);
10196
10196
  }).catch(() => {
10197
10197
  }), () => {
10198
10198
  o = !0;
10199
10199
  };
10200
- }, [H, gA]), NA(() => {
10200
+ }, [H, PA]), NA(() => {
10201
10201
  if (H !== "calculating" || !z) return;
10202
10202
  const o = setInterval(() => Pf((j) => j + 1), 1500);
10203
10203
  return () => clearInterval(o);
10204
10204
  }, [H, z]);
10205
- const DA = pA(null), TA = pA(null), [I, uA] = d(!1), [fA, sA] = d(null), yA = () => {
10206
- fA === !0 && DA.current?.click();
10205
+ const DA = aA(null), TA = aA(null), [I, uA] = d(!1), [AA, sA] = d(null), yA = () => {
10206
+ AA === !0 && DA.current?.click();
10207
10207
  }, Of = async (o) => {
10208
10208
  const j = o.target.files?.[0];
10209
10209
  if (j) {
10210
- if (fA !== !0) {
10211
- J(P("Please confirm that the person in the photo is 18 or older before uploading."));
10210
+ if (AA !== !0) {
10211
+ N(P("Please confirm that the person in the photo is 18 or older before uploading."));
10212
10212
  return;
10213
10213
  }
10214
10214
  if (!j.type.startsWith("image/")) {
10215
- J(P("Please upload an image file"));
10215
+ N(P("Please upload an image file"));
10216
10216
  return;
10217
10217
  }
10218
10218
  if (j.size > 10 * 1024 * 1024) {
10219
- J(P("Image must be under 10MB"));
10219
+ N(P("Image must be under 10MB"));
10220
10220
  return;
10221
10221
  }
10222
10222
  BA(!0);
10223
10223
  try {
10224
10224
  const U = await tn(j);
10225
- kA(U), e?.(U), J("");
10225
+ kA(U), e?.(U), N("");
10226
10226
  } catch {
10227
- J(P("Failed to process image"));
10227
+ N(P("Failed to process image"));
10228
10228
  } finally {
10229
10229
  BA(!1);
10230
10230
  }
10231
10231
  }
10232
10232
  }, LA = () => {
10233
10233
  kA(null), e?.(null), DA.current && (DA.current.value = "");
10234
- }, [eA, Uf] = d(null), [jf, lA] = d(null), [Mf, Qf] = d(null), [af, xf] = d(null), [_A, of] = d(null), [mA, E] = d(null), y = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], HA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], Q = k === "female", Z = Q ? GA.female : GA.male, FA = Q ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], SA = FA.indexOf(C), tf = FA.length, bA = SA === tf - 1, _ = () => {
10234
+ }, [gA, Uf] = d(null), [jf, lA] = d(null), [Mf, Qf] = d(null), [af, xf] = d(null), [_A, of] = d(null), [mA, E] = d(null), y = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], QA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], Q = k === "female", Z = Q ? GA.female : GA.male, FA = Q ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], SA = FA.indexOf(C), tf = FA.length, XA = SA === tf - 1, _ = () => {
10235
10235
  if (O === "in") {
10236
10236
  const o = parseInt(F, 10), j = parseInt(wA, 10);
10237
10237
  !isNaN(o) && o >= 0 && !isNaN(j) && j >= 0 && K(String(Math.round((o * 12 + j) * 2.54)));
@@ -10245,7 +10245,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10245
10245
  s("in");
10246
10246
  }, W = () => {
10247
10247
  if (!r.trim())
10248
- return J(P("Please enter a profile name")), !1;
10248
+ return N(P("Please enter a profile name")), !1;
10249
10249
  let o;
10250
10250
  if (O === "in") {
10251
10251
  const R = parseInt(F, 10), u = parseInt(wA, 10);
@@ -10255,10 +10255,10 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10255
10255
  o = !isNaN(R) && R > 0;
10256
10256
  }
10257
10257
  if (!o)
10258
- return J(P("Please enter a valid height")), !1;
10259
- const j = parseFloat(h), U = parseFloat(XA);
10260
- return !j || j <= 0 ? (J(P("Please enter a valid weight")), !1) : !U || U <= 0 ? (J(P("Please enter a valid age")), !1) : (J(""), !0);
10261
- }, L = () => r.trim() ? (J(""), !0) : (J(P("Please enter a profile name")), !1), V = () => {
10258
+ return N(P("Please enter a valid height")), !1;
10259
+ const j = parseFloat(h), U = parseFloat(bA);
10260
+ return !j || j <= 0 ? (N(P("Please enter a valid weight")), !1) : !U || U <= 0 ? (N(P("Please enter a valid age")), !1) : (N(""), !0);
10261
+ }, L = () => r.trim() ? (N(""), !0) : (N(P("Please enter a profile name")), !1), V = () => {
10262
10262
  const o = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S);
10263
10263
  return {
10264
10264
  name: r.trim(),
@@ -10270,15 +10270,15 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10270
10270
  weightKg: parseFloat(h),
10271
10271
  height: o,
10272
10272
  weight: parseFloat(h),
10273
- age: parseFloat(XA),
10274
- chestProfile: eA || void 0,
10273
+ age: parseFloat(bA),
10274
+ chestProfile: gA || void 0,
10275
10275
  midsectionProfile: jf || void 0,
10276
10276
  hipProfile: Q ? af || void 0 : Mf || void 0,
10277
10277
  bandSize: Q && _A || void 0,
10278
10278
  cupSize: Q && mA || void 0
10279
10279
  };
10280
10280
  }, xA = () => {
10281
- const o = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), j = parseFloat(h), U = parseFloat(XA);
10281
+ const o = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), j = parseFloat(h), U = parseFloat(bA);
10282
10282
  return {
10283
10283
  name: r.trim(),
10284
10284
  gender: k,
@@ -10288,38 +10288,38 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10288
10288
  ...o > 0 ? { heightCm: o, height: o } : {},
10289
10289
  ...j > 0 ? { weightKg: j, weight: j } : {},
10290
10290
  ...U > 0 ? { age: U } : {},
10291
- photoBase64: gA || void 0
10291
+ photoBase64: PA || void 0
10292
10292
  };
10293
10293
  }, wf = () => {
10294
10294
  if (!(C === "identity" && !W())) {
10295
- if (C === "chest" && !eA) {
10296
- J(P("Please pick an option"));
10295
+ if (C === "chest" && !gA) {
10296
+ N(P("Please pick an option"));
10297
10297
  return;
10298
10298
  }
10299
10299
  if (C === "stomach" && !jf) {
10300
- J(P("Please pick an option"));
10300
+ N(P("Please pick an option"));
10301
10301
  return;
10302
10302
  }
10303
10303
  if (C === "seat" && !Mf) {
10304
- J(P("Please pick an option"));
10304
+ N(P("Please pick an option"));
10305
10305
  return;
10306
10306
  }
10307
10307
  if (C === "hips" && !af) {
10308
- J(P("Please pick an option"));
10308
+ N(P("Please pick an option"));
10309
10309
  return;
10310
10310
  }
10311
10311
  if (C === "bra" && (!_A || !mA)) {
10312
- J(P("Please pick band and cup size"));
10312
+ N(P("Please pick band and cup size"));
10313
10313
  return;
10314
10314
  }
10315
- if (J(""), bA) {
10315
+ if (N(""), XA) {
10316
10316
  n(V());
10317
10317
  return;
10318
10318
  }
10319
10319
  w(FA[SA + 1]);
10320
10320
  }
10321
- }, zA = (o, j) => {
10322
- J(""), o === "chest" ? Uf(j) : o === "stomach" ? lA(j) : o === "seat" ? Qf(j) : o === "hips" && xf(j);
10321
+ }, cA = (o, j) => {
10322
+ N(""), o === "chest" ? Uf(j) : o === "stomach" ? lA(j) : o === "seat" ? Qf(j) : o === "hips" && xf(j);
10323
10323
  const U = FA.indexOf(o), R = U === tf - 1;
10324
10324
  setTimeout(() => {
10325
10325
  if (R) {
@@ -10329,7 +10329,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10329
10329
  w(FA[U + 1]);
10330
10330
  }, 220);
10331
10331
  }, Df = () => {
10332
- if (J(""), C === "identity") {
10332
+ if (N(""), C === "identity") {
10333
10333
  i(null);
10334
10334
  return;
10335
10335
  }
@@ -10337,33 +10337,33 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10337
10337
  }, Af = D === "manual" && (C === "chest" || C === "stomach" || C === "seat" || C === "hips"), Hf = async () => {
10338
10338
  if (H === "name-photo") {
10339
10339
  if (!L()) return;
10340
- if (!gA) {
10341
- J(P("Please upload a photo"));
10340
+ if (!PA) {
10341
+ N(P("Please upload a photo"));
10342
10342
  return;
10343
10343
  }
10344
10344
  if (O === "in") {
10345
10345
  const U = parseFloat(F);
10346
10346
  if (!U || U < 3 || U > 8) {
10347
- J(P("Please enter a valid height"));
10347
+ N(P("Please enter a valid height"));
10348
10348
  return;
10349
10349
  }
10350
10350
  } else {
10351
10351
  const U = parseFloat(S);
10352
10352
  if (!U || U < 100 || U > 250) {
10353
- J(P("Please enter a valid height"));
10353
+ N(P("Please enter a valid height"));
10354
10354
  return;
10355
10355
  }
10356
10356
  }
10357
10357
  const j = parseFloat(h);
10358
10358
  if (!j || j <= 0) {
10359
- J(P("Please enter a valid weight"));
10359
+ N(P("Please enter a valid weight"));
10360
10360
  return;
10361
10361
  }
10362
- if (J(""), c("calculating"), T(!0), B && gA) {
10363
- const U = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), R = parseFloat(XA);
10362
+ if (N(""), p("calculating"), T(!0), B && PA) {
10363
+ const U = O === "in" ? (parseInt(F, 10) || 0) * 12 + (parseInt(wA, 10) || 0) : parseFloat(S), R = parseFloat(bA);
10364
10364
  try {
10365
10365
  const u = await B({
10366
- photoBase64: gA,
10366
+ photoBase64: PA,
10367
10367
  height: U || 0,
10368
10368
  weight: j || 0,
10369
10369
  heightUnit: O,
@@ -10379,21 +10379,21 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10379
10379
  return;
10380
10380
  }
10381
10381
  if (H === "details") {
10382
- c("calculating");
10382
+ p("calculating");
10383
10383
  return;
10384
10384
  }
10385
10385
  const o = xA();
10386
10386
  x && (o.measurements = x, o.measurementsUnit = "cm"), n(o);
10387
10387
  }, WA = () => {
10388
- if (J(""), H === "details") {
10389
- c("name-photo");
10388
+ if (N(""), H === "details") {
10389
+ p("name-photo");
10390
10390
  return;
10391
10391
  }
10392
10392
  if (H === "calculating" && !z) {
10393
- c("name-photo");
10393
+ p("name-photo");
10394
10394
  return;
10395
10395
  }
10396
- i(null), c("name-photo");
10396
+ i(null), p("name-photo");
10397
10397
  }, ff = () => {
10398
10398
  if (D === "manual") return Df();
10399
10399
  if (D === "image") return WA();
@@ -10416,14 +10416,14 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10416
10416
  if (D == null) return 0;
10417
10417
  if (D === "manual") return Math.round((SA + 1) / tf * 100);
10418
10418
  let o = 0;
10419
- return r.trim() && (o += 50), gA && (o += 50), o;
10419
+ return r.trim() && (o += 50), PA && (o += 50), o;
10420
10420
  })();
10421
10421
  return /* @__PURE__ */ f("div", { className: "ps-cpw-root", children: [
10422
10422
  !(D === "image" && H === "name-photo") && /* @__PURE__ */ f("div", { className: "ps-cpw-step-head", children: [
10423
10423
  /* @__PURE__ */ A("h2", { className: "ps-cpw-step-title", children: nf }),
10424
10424
  D != null && /* @__PURE__ */ A("div", { className: "ps-cpw-progress", children: /* @__PURE__ */ A("div", { className: "ps-cpw-progress-track", children: /* @__PURE__ */ A("div", { className: "ps-cpw-progress-fill", style: { width: `${VA}%` } }) }) })
10425
10425
  ] }),
10426
- /* @__PURE__ */ f("div", { className: "ps-cpw-body", ref: nA, children: [
10426
+ /* @__PURE__ */ f("div", { className: "ps-cpw-body", ref: fA, children: [
10427
10427
  D == null && /* @__PURE__ */ A("div", { className: "ps-cpw-method-picker ps-cpw-fade-in", children: /* @__PURE__ */ f("div", { className: "ps-cpw-method-grid", children: [
10428
10428
  /* @__PURE__ */ f(
10429
10429
  "button",
@@ -10490,7 +10490,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10490
10490
  value: r,
10491
10491
  placeholder: P("e.g. My Measurements"),
10492
10492
  onChange: (o) => {
10493
- b(o.target.value), J("");
10493
+ b(o.target.value), N("");
10494
10494
  }
10495
10495
  }
10496
10496
  ) })
@@ -10507,7 +10507,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10507
10507
  value: S,
10508
10508
  placeholder: P("e.g. 173"),
10509
10509
  onChange: (o) => {
10510
- K(o.target.value), J("");
10510
+ K(o.target.value), N("");
10511
10511
  }
10512
10512
  }
10513
10513
  ),
@@ -10523,7 +10523,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10523
10523
  value: F,
10524
10524
  placeholder: "5",
10525
10525
  onChange: (o) => {
10526
- tA(o.target.value), J("");
10526
+ tA(o.target.value), N("");
10527
10527
  }
10528
10528
  }
10529
10529
  ),
@@ -10538,7 +10538,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10538
10538
  value: wA,
10539
10539
  placeholder: "8",
10540
10540
  onChange: (o) => {
10541
- YA(o.target.value), J("");
10541
+ YA(o.target.value), N("");
10542
10542
  }
10543
10543
  }
10544
10544
  ),
@@ -10557,7 +10557,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10557
10557
  value: h,
10558
10558
  placeholder: P(O === "in" ? "e.g. 154" : "e.g. 70"),
10559
10559
  onChange: (o) => {
10560
- a(o.target.value), J("");
10560
+ a(o.target.value), N("");
10561
10561
  }
10562
10562
  }
10563
10563
  ),
@@ -10573,10 +10573,10 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10573
10573
  type: "number",
10574
10574
  inputMode: "numeric",
10575
10575
  className: "ps-bp-inline-input",
10576
- value: XA,
10576
+ value: bA,
10577
10577
  placeholder: P("e.g. 30"),
10578
10578
  onChange: (o) => {
10579
- RA(o.target.value), J("");
10579
+ RA(o.target.value), N("");
10580
10580
  }
10581
10581
  }
10582
10582
  ),
@@ -10593,9 +10593,9 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10593
10593
  title: P("CHEST PROFILE"),
10594
10594
  subtitle: P("Select the profile that best matches your chest breadth"),
10595
10595
  children: [
10596
- /* @__PURE__ */ A(Gf, { img: Z.chest?.narrow ?? null, label: P("NARROW"), selected: eA === "narrow", onSelect: () => zA("chest", "narrow") }),
10597
- /* @__PURE__ */ A(Gf, { img: Z.chest?.average ?? null, label: P("AVERAGE"), selected: eA === "average", onSelect: () => zA("chest", "average") }),
10598
- /* @__PURE__ */ A(Gf, { img: Z.chest?.broad ?? null, label: P("BROAD"), selected: eA === "broad", onSelect: () => zA("chest", "broad") })
10596
+ /* @__PURE__ */ A(Gf, { img: Z.chest?.narrow ?? null, label: P("NARROW"), selected: gA === "narrow", onSelect: () => cA("chest", "narrow") }),
10597
+ /* @__PURE__ */ A(Gf, { img: Z.chest?.average ?? null, label: P("AVERAGE"), selected: gA === "average", onSelect: () => cA("chest", "average") }),
10598
+ /* @__PURE__ */ A(Gf, { img: Z.chest?.broad ?? null, label: P("BROAD"), selected: gA === "broad", onSelect: () => cA("chest", "broad") })
10599
10599
  ]
10600
10600
  }
10601
10601
  ),
@@ -10606,9 +10606,9 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10606
10606
  title: P("STOMACH PROFILE"),
10607
10607
  subtitle: P("Describe your mid-section silhouette"),
10608
10608
  children: [
10609
- /* @__PURE__ */ A(Gf, { img: Z.stomach?.flat ?? null, label: P("FLAT"), selected: jf === "flat", onSelect: () => zA("stomach", "flat") }),
10610
- /* @__PURE__ */ A(Gf, { img: Z.stomach?.average ?? null, label: P("AVERAGE"), selected: jf === "average", onSelect: () => zA("stomach", "average") }),
10611
- /* @__PURE__ */ A(Gf, { img: Z.stomach?.round ?? null, label: P("ROUND"), selected: jf === "round", onSelect: () => zA("stomach", "round") })
10609
+ /* @__PURE__ */ A(Gf, { img: Z.stomach?.flat ?? null, label: P("FLAT"), selected: jf === "flat", onSelect: () => cA("stomach", "flat") }),
10610
+ /* @__PURE__ */ A(Gf, { img: Z.stomach?.average ?? null, label: P("AVERAGE"), selected: jf === "average", onSelect: () => cA("stomach", "average") }),
10611
+ /* @__PURE__ */ A(Gf, { img: Z.stomach?.round ?? null, label: P("ROUND"), selected: jf === "round", onSelect: () => cA("stomach", "round") })
10612
10612
  ]
10613
10613
  }
10614
10614
  ),
@@ -10619,9 +10619,9 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10619
10619
  title: P("BACK & SEAT"),
10620
10620
  subtitle: P("The curvature of your lower spine and seat profile"),
10621
10621
  children: [
10622
- /* @__PURE__ */ A(Gf, { img: Z.seat?.narrow ?? null, label: P("STRAIGHT"), selected: Mf === "narrow", onSelect: () => zA("seat", "narrow") }),
10623
- /* @__PURE__ */ A(Gf, { img: Z.seat?.average ?? null, label: P("CURVED"), selected: Mf === "average", onSelect: () => zA("seat", "average") }),
10624
- /* @__PURE__ */ A(Gf, { img: Z.seat?.full ?? null, label: P("DEEP"), selected: Mf === "full", onSelect: () => zA("seat", "full") })
10622
+ /* @__PURE__ */ A(Gf, { img: Z.seat?.narrow ?? null, label: P("STRAIGHT"), selected: Mf === "narrow", onSelect: () => cA("seat", "narrow") }),
10623
+ /* @__PURE__ */ A(Gf, { img: Z.seat?.average ?? null, label: P("CURVED"), selected: Mf === "average", onSelect: () => cA("seat", "average") }),
10624
+ /* @__PURE__ */ A(Gf, { img: Z.seat?.full ?? null, label: P("DEEP"), selected: Mf === "full", onSelect: () => cA("seat", "full") })
10625
10625
  ]
10626
10626
  }
10627
10627
  ),
@@ -10632,9 +10632,9 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10632
10632
  title: P("HIP PROFILE"),
10633
10633
  subtitle: P("The curvature of your hips and thighs"),
10634
10634
  children: [
10635
- /* @__PURE__ */ A(Gf, { img: Z.hips.narrow ?? null, label: P("NARROW"), selected: af === "narrow", onSelect: () => zA("hips", "narrow") }),
10636
- /* @__PURE__ */ A(Gf, { img: Z.hips.average ?? null, label: P("AVERAGE"), selected: af === "average", onSelect: () => zA("hips", "average") }),
10637
- /* @__PURE__ */ A(Gf, { img: Z.hips.full ?? null, label: P("FULL"), selected: af === "full", onSelect: () => zA("hips", "full") })
10635
+ /* @__PURE__ */ A(Gf, { img: Z.hips.narrow ?? null, label: P("NARROW"), selected: af === "narrow", onSelect: () => cA("hips", "narrow") }),
10636
+ /* @__PURE__ */ A(Gf, { img: Z.hips.average ?? null, label: P("AVERAGE"), selected: af === "average", onSelect: () => cA("hips", "average") }),
10637
+ /* @__PURE__ */ A(Gf, { img: Z.hips.full ?? null, label: P("FULL"), selected: af === "full", onSelect: () => cA("hips", "full") })
10638
10638
  ]
10639
10639
  }
10640
10640
  ),
@@ -10652,7 +10652,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10652
10652
  className: "ps-cpw-input",
10653
10653
  value: _A ?? "",
10654
10654
  onChange: (o) => {
10655
- of(o.target.value || null), J("");
10655
+ of(o.target.value || null), N("");
10656
10656
  },
10657
10657
  children: [
10658
10658
  /* @__PURE__ */ A("option", { value: "", children: P("Select") }),
@@ -10669,11 +10669,11 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10669
10669
  className: "ps-cpw-input",
10670
10670
  value: mA ?? "",
10671
10671
  onChange: (o) => {
10672
- E(o.target.value || null), J("");
10672
+ E(o.target.value || null), N("");
10673
10673
  },
10674
10674
  children: [
10675
10675
  /* @__PURE__ */ A("option", { value: "", children: P("Select") }),
10676
- HA.map((o) => /* @__PURE__ */ A("option", { value: o, children: o }, o))
10676
+ QA.map((o) => /* @__PURE__ */ A("option", { value: o, children: o }, o))
10677
10677
  ]
10678
10678
  }
10679
10679
  )
@@ -10696,10 +10696,10 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10696
10696
  "div",
10697
10697
  {
10698
10698
  onClick: () => {
10699
- !gA && fA === !0 && yA();
10699
+ !PA && AA === !0 && yA();
10700
10700
  },
10701
10701
  onMouseEnter: () => {
10702
- !gA && fA === !0 && Bf(!0);
10702
+ !PA && AA === !0 && Bf(!0);
10703
10703
  },
10704
10704
  onMouseLeave: () => Bf(!1),
10705
10705
  style: {
@@ -10708,16 +10708,16 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10708
10708
  flexDirection: "column",
10709
10709
  alignItems: "center",
10710
10710
  justifyContent: "center",
10711
- border: gA ? "2px solid var(--ps-accent)" : fA === !0 && aA ? "2px dashed var(--ps-accent)" : "2px dashed var(--ps-border-color)",
10711
+ border: PA ? "2px solid var(--ps-accent)" : AA === !0 && jA ? "2px dashed var(--ps-accent)" : "2px dashed var(--ps-border-color)",
10712
10712
  borderRadius: "0.5vw",
10713
- cursor: gA ? "default" : fA === !0 ? "pointer" : "default",
10713
+ cursor: PA ? "default" : AA === !0 ? "pointer" : "default",
10714
10714
  position: "relative",
10715
- background: gA ? "var(--ps-bg-secondary)" : fA === !0 && aA ? "rgba(33,84,239,0.04)" : fA === null ? "rgba(0,0,0,0.025)" : "var(--ps-bg-secondary)",
10715
+ background: PA ? "var(--ps-bg-secondary)" : AA === !0 && jA ? "rgba(33,84,239,0.04)" : AA === null ? "rgba(0,0,0,0.025)" : "var(--ps-bg-secondary)",
10716
10716
  transition: "border-color 0.18s, background 0.18s",
10717
10717
  overflow: "hidden"
10718
10718
  },
10719
- children: gA ? /* @__PURE__ */ f(rA, { children: [
10720
- /* @__PURE__ */ A("img", { src: gA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
10719
+ children: PA ? /* @__PURE__ */ f(rA, { children: [
10720
+ /* @__PURE__ */ A("img", { src: PA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
10721
10721
  /* @__PURE__ */ A("button", { onClick: (o) => {
10722
10722
  o.stopPropagation(), LA();
10723
10723
  }, style: { position: "absolute", top: "0.5vw", right: "0.5vw", width: "1.4vw", height: "1.4vw", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "none", color: "#fff", fontSize: "0.7vw", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }, children: "×" })
@@ -10730,7 +10730,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10730
10730
  /* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: P(iA ? "Processing..." : "Upload your photo") }),
10731
10731
  /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: P("Click or drag a full-body photo") }),
10732
10732
  /* @__PURE__ */ A("span", { style: { fontSize: "0.5vw", color: "var(--ps-text-dim)", marginTop: "0.4vw" }, children: "JPEG, PNG (max 10MB)" }),
10733
- fA === null && /* @__PURE__ */ f(
10733
+ AA === null && /* @__PURE__ */ f(
10734
10734
  "div",
10735
10735
  {
10736
10736
  role: "dialog",
@@ -10755,7 +10755,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10755
10755
  {
10756
10756
  type: "button",
10757
10757
  onClick: (o) => {
10758
- o.stopPropagation(), sA(!0), J("");
10758
+ o.stopPropagation(), sA(!0), N("");
10759
10759
  },
10760
10760
  style: {
10761
10761
  padding: "0.4vw 1vw",
@@ -10795,7 +10795,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10795
10795
  ]
10796
10796
  }
10797
10797
  ),
10798
- fA === !1 && /* @__PURE__ */ f(
10798
+ AA === !1 && /* @__PURE__ */ f(
10799
10799
  "div",
10800
10800
  {
10801
10801
  role: "alert",
@@ -10907,23 +10907,23 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10907
10907
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
10908
10908
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("NAME") }),
10909
10909
  /* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: TA, type: "text", className: `ps-bp-inline-input${I ? " ps-cpw-shake" : ""}`, value: r, placeholder: P("e.g. My Photo Profile"), onChange: (o) => {
10910
- b(o.target.value), J("");
10910
+ b(o.target.value), N("");
10911
10911
  }, onAnimationEnd: () => uA(!1) }) })
10912
10912
  ] }),
10913
10913
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
10914
10914
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("HEIGHT") }),
10915
10915
  O === "cm" ? /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
10916
10916
  /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: S, placeholder: P("e.g. 173"), onChange: (o) => {
10917
- K(o.target.value), J("");
10917
+ K(o.target.value), N("");
10918
10918
  } }),
10919
10919
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
10920
10920
  ] }) : /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", style: { gap: "6px" }, children: [
10921
10921
  /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: F, placeholder: "5", onChange: (o) => {
10922
- tA(o.target.value), J("");
10922
+ tA(o.target.value), N("");
10923
10923
  } }),
10924
10924
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
10925
10925
  /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: wA, placeholder: "8", onChange: (o) => {
10926
- YA(o.target.value), J("");
10926
+ YA(o.target.value), N("");
10927
10927
  } }),
10928
10928
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
10929
10929
  ] })
@@ -10932,7 +10932,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10932
10932
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("WEIGHT") }),
10933
10933
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
10934
10934
  /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: h, placeholder: P(O === "in" ? "e.g. 154" : "e.g. 70"), onChange: (o) => {
10935
- a(o.target.value), J("");
10935
+ a(o.target.value), N("");
10936
10936
  } }),
10937
10937
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: O === "in" ? "lbs" : "kg" })
10938
10938
  ] })
@@ -10940,8 +10940,8 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
10940
10940
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
10941
10941
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("AGE") }),
10942
10942
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
10943
- /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: XA, placeholder: P("e.g. 30"), onChange: (o) => {
10944
- RA(o.target.value), J("");
10943
+ /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: bA, placeholder: P("e.g. 30"), onChange: (o) => {
10944
+ RA(o.target.value), N("");
10945
10945
  } }),
10946
10946
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: P("years") })
10947
10947
  ] })
@@ -11051,16 +11051,16 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
11051
11051
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("HEIGHT") }),
11052
11052
  O === "cm" ? /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
11053
11053
  /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: S, placeholder: P("e.g. 173"), onChange: (o) => {
11054
- K(o.target.value), J("");
11054
+ K(o.target.value), N("");
11055
11055
  } }),
11056
11056
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
11057
11057
  ] }) : /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", style: { gap: "6px" }, children: [
11058
11058
  /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: F, placeholder: "5", onChange: (o) => {
11059
- tA(o.target.value), J("");
11059
+ tA(o.target.value), N("");
11060
11060
  } }),
11061
11061
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
11062
11062
  /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: wA, placeholder: "8", onChange: (o) => {
11063
- YA(o.target.value), J("");
11063
+ YA(o.target.value), N("");
11064
11064
  } }),
11065
11065
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
11066
11066
  ] })
@@ -11069,7 +11069,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
11069
11069
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("WEIGHT") }),
11070
11070
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
11071
11071
  /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: h, placeholder: P(O === "in" ? "e.g. 154" : "e.g. 70"), onChange: (o) => {
11072
- a(o.target.value), J("");
11072
+ a(o.target.value), N("");
11073
11073
  } }),
11074
11074
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: O === "in" ? "lbs" : "kg" })
11075
11075
  ] })
@@ -11077,8 +11077,8 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
11077
11077
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
11078
11078
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: P("AGE") }),
11079
11079
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
11080
- /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: XA, placeholder: P("e.g. 30"), onChange: (o) => {
11081
- RA(o.target.value), J("");
11080
+ /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: bA, placeholder: P("e.g. 30"), onChange: (o) => {
11081
+ RA(o.target.value), N("");
11082
11082
  } }),
11083
11083
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: P("years") })
11084
11084
  ] })
@@ -11120,10 +11120,10 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
11120
11120
  overflow: "hidden",
11121
11121
  minHeight: "20vw"
11122
11122
  }, children: [
11123
- gA && /* @__PURE__ */ A(
11123
+ PA && /* @__PURE__ */ A(
11124
11124
  "img",
11125
11125
  {
11126
- src: gA,
11126
+ src: PA,
11127
11127
  alt: "",
11128
11128
  style: { maxWidth: "100%", maxHeight: "100%", objectFit: "contain", display: "block" },
11129
11129
  onLoad: (R) => {
@@ -11144,14 +11144,14 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
11144
11144
  "aria-hidden": "true",
11145
11145
  children: [
11146
11146
  U.map(([R, u], Y) => {
11147
- const MA = OA[R], CA = OA[u];
11148
- return !MA || !CA ? null : /* @__PURE__ */ A(
11147
+ const MA = OA[R], HA = OA[u];
11148
+ return !MA || !HA ? null : /* @__PURE__ */ A(
11149
11149
  "line",
11150
11150
  {
11151
11151
  x1: MA.x * KA.w,
11152
11152
  y1: MA.y * KA.h,
11153
- x2: CA.x * KA.w,
11154
- y2: CA.y * KA.h,
11153
+ x2: HA.x * KA.w,
11154
+ y2: HA.y * KA.h,
11155
11155
  stroke: "rgba(100,210,255,0.95)",
11156
11156
  strokeWidth: Math.max(3, KA.w / 180),
11157
11157
  strokeLinecap: "round"
@@ -11217,9 +11217,9 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
11217
11217
  ] }),
11218
11218
  /* @__PURE__ */ f("div", { className: "ps-cpw-footer", children: [
11219
11219
  /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-back-btn", onClick: ff, children: D == null ? P("Cancel") : `← ${P("Back")}` }),
11220
- D === "manual" && !Af && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: wf, children: P(bA ? "CALCULATE MY FIT" : "Continue") }),
11220
+ D === "manual" && !Af && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: wf, children: P(XA ? "CALCULATE MY FIT" : "Continue") }),
11221
11221
  D === "image" && H === "name-photo" && (() => {
11222
- const o = O === "in" ? parseFloat(F) > 0 || parseFloat(wA) > 0 : parseFloat(S) > 0, j = parseFloat(h) > 0, U = !!r.trim(), R = !!gA, u = P(R ? U ? o ? j ? "Calculate My Body Parts" : "Enter your weight" : "Enter your height" : "Add a name for this profile" : "Upload a photo"), Y = !R || !U || !o || !j;
11222
+ const o = O === "in" ? parseFloat(F) > 0 || parseFloat(wA) > 0 : parseFloat(S) > 0, j = parseFloat(h) > 0, U = !!r.trim(), R = !!PA, u = P(R ? U ? o ? j ? "Calculate My Body Parts" : "Enter your weight" : "Enter your height" : "Add a name for this profile" : "Upload a photo"), Y = !R || !U || !o || !j;
11223
11223
  return /* @__PURE__ */ A(
11224
11224
  "button",
11225
11225
  {
@@ -11241,7 +11241,7 @@ function AB({ onSave: n, onCancel: g, onPhotoPreview: e, onEstimate: B, t: P })
11241
11241
  D === "image" && H === "details" && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: Hf, children: P("Calculate My Body Parts") }),
11242
11242
  D === "image" && H === "calculating" && !z && x && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: Hf, children: P("Save Profile") }),
11243
11243
  D === "image" && H === "calculating" && !z && !x && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: () => {
11244
- c("details"), J("");
11244
+ p("details"), N("");
11245
11245
  }, children: P("Try Again") })
11246
11246
  ] })
11247
11247
  ] });
@@ -11277,9 +11277,9 @@ function oB({
11277
11277
  isEstimating: w = !1,
11278
11278
  t: H
11279
11279
  }) {
11280
- const c = n.gender === "female" ? gB : PB, z = n.measurements || {}, T = Object.keys(z).some((K) => z[K] != null), [x, l] = d(n.measurementsUnit || "cm"), [nA, r] = d(() => {
11280
+ const p = n.gender === "female" ? gB : PB, z = n.measurements || {}, T = Object.keys(z).some((K) => z[K] != null), [x, l] = d(n.measurementsUnit || "cm"), [fA, r] = d(() => {
11281
11281
  const K = {};
11282
- return c.forEach((F) => {
11282
+ return p.forEach((F) => {
11283
11283
  const tA = z[F.key];
11284
11284
  K[F.key] = tA != null ? String(Math.round(tA * 10) / 10) : "";
11285
11285
  }), K;
@@ -11288,7 +11288,7 @@ function oB({
11288
11288
  r((K) => {
11289
11289
  const F = { ...K };
11290
11290
  let tA = !1;
11291
- return c.forEach((wA) => {
11291
+ return p.forEach((wA) => {
11292
11292
  const YA = z[wA.key];
11293
11293
  YA != null && !K[wA.key] && (F[wA.key] = String(Math.round(YA * 10) / 10), tA = !0);
11294
11294
  }), tA ? F : K;
@@ -11305,7 +11305,7 @@ function oB({
11305
11305
  }), l(K));
11306
11306
  }, S = () => {
11307
11307
  const K = { ...n.measurements || {} };
11308
- for (const [F, tA] of Object.entries(nA)) {
11308
+ for (const [F, tA] of Object.entries(fA)) {
11309
11309
  const wA = parseFloat(tA);
11310
11310
  !isNaN(wA) && wA > 0 && (K[F] = wA);
11311
11311
  }
@@ -11345,8 +11345,8 @@ function oB({
11345
11345
  ] })
11346
11346
  ] }) }),
11347
11347
  /* @__PURE__ */ f("div", { className: "ps-pmv-measure-list", children: [
11348
- c.map((K) => {
11349
- const F = z[K.key], tA = w && F == null && !nA[K.key];
11348
+ p.map((K) => {
11349
+ const F = z[K.key], tA = w && F == null && !fA[K.key];
11350
11350
  return /* @__PURE__ */ f("div", { className: `ps-pmv-measure-row${F == null ? " ps-loading" : ""}`, children: [
11351
11351
  /* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: K.iconSrc, alt: "", "aria-hidden": "true" }) }),
11352
11352
  /* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: H(K.label) }),
@@ -11360,7 +11360,7 @@ function oB({
11360
11360
  type: "number",
11361
11361
  step: "0.1",
11362
11362
  className: "ps-pmv-inline-input",
11363
- value: nA[K.key] ?? "",
11363
+ value: fA[K.key] ?? "",
11364
11364
  placeholder: "—",
11365
11365
  onChange: (wA) => r((YA) => ({ ...YA, [K.key]: wA.target.value }))
11366
11366
  }
@@ -11454,19 +11454,19 @@ function vB({
11454
11454
  t: i
11455
11455
  }) {
11456
11456
  const C = (() => {
11457
- const c = n.height ?? n.heightCm;
11458
- if (!c) return null;
11457
+ const p = n.height ?? n.heightCm;
11458
+ if (!p) return null;
11459
11459
  if (n.heightUnit === "in" || n.heightUnit === "ft") {
11460
- const z = Math.floor(c / 12), T = Math.round(c % 12);
11460
+ const z = Math.floor(p / 12), T = Math.round(p % 12);
11461
11461
  return `${z}'${T}"`;
11462
11462
  }
11463
- return `${Math.round(c)} cm`;
11463
+ return `${Math.round(p)} cm`;
11464
11464
  })(), w = (() => {
11465
- const c = n.weight ?? n.weightKg;
11466
- return c ? `${Math.round(c)} ${n.weightUnit || "kg"}` : null;
11465
+ const p = n.weight ?? n.weightKg;
11466
+ return p ? `${Math.round(p)} ${n.weightUnit || "kg"}` : null;
11467
11467
  })(), H = (() => {
11468
- const c = n.lastEditedAt || n.lastUsedAt || n.createdAt;
11469
- return c ? new Date(c).toLocaleDateString(void 0, { month: "short", day: "numeric" }) : null;
11468
+ const p = n.lastEditedAt || n.lastUsedAt || n.createdAt;
11469
+ return p ? new Date(p).toLocaleDateString(void 0, { month: "short", day: "numeric" }) : null;
11470
11470
  })();
11471
11471
  return /* @__PURE__ */ f(
11472
11472
  "div",
@@ -11493,7 +11493,7 @@ function vB({
11493
11493
  /* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children: H })
11494
11494
  ] })
11495
11495
  ] }),
11496
- /* @__PURE__ */ f("div", { className: "ps-msp-card-actions", onClick: (c) => c.stopPropagation(), children: [
11496
+ /* @__PURE__ */ f("div", { className: "ps-msp-card-actions", onClick: (p) => p.stopPropagation(), children: [
11497
11497
  /* @__PURE__ */ A(
11498
11498
  "button",
11499
11499
  {
@@ -11512,8 +11512,8 @@ function vB({
11512
11512
  {
11513
11513
  type: "button",
11514
11514
  className: "ps-msp-card-delete",
11515
- onClick: (c) => {
11516
- c.stopPropagation(), P();
11515
+ onClick: (p) => {
11516
+ p.stopPropagation(), P();
11517
11517
  },
11518
11518
  "aria-label": i("Delete"),
11519
11519
  children: /* @__PURE__ */ f("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
@@ -11548,19 +11548,19 @@ function iB({
11548
11548
  onRequestDelete: C,
11549
11549
  onClose: w,
11550
11550
  onPhotoPreview: H,
11551
- onEstimateFromPhoto: c,
11551
+ onEstimateFromPhoto: p,
11552
11552
  estimatingProfileIds: z,
11553
11553
  t: T,
11554
11554
  onRegisterBackInterceptor: x
11555
11555
  }) {
11556
- const [l, nA] = d(!1), [r, b] = d(null), k = r && n.find((v) => v.id === r) || null;
11556
+ const [l, fA] = d(!1), [r, b] = d(null), k = r && n.find((v) => v.id === r) || null;
11557
11557
  return NA(() => {
11558
11558
  r && !n.find((v) => v.id === r) && b(null);
11559
11559
  }, [n, r]), NA(() => {
11560
11560
  if (!x) return;
11561
11561
  x(() => l || r !== null, () => {
11562
11562
  if (l) {
11563
- nA(!1);
11563
+ fA(!1);
11564
11564
  return;
11565
11565
  }
11566
11566
  if (r !== null) {
@@ -11599,11 +11599,11 @@ function iB({
11599
11599
  }
11600
11600
  } catch {
11601
11601
  }
11602
- nA(!1), O && b(O);
11602
+ fA(!1), O && b(O);
11603
11603
  },
11604
- onCancel: () => nA(!1),
11604
+ onCancel: () => fA(!1),
11605
11605
  onPhotoPreview: H,
11606
- onEstimate: c,
11606
+ onEstimate: p,
11607
11607
  t: T
11608
11608
  }
11609
11609
  ) : /* @__PURE__ */ f(rA, { children: [
@@ -11612,7 +11612,7 @@ function iB({
11612
11612
  /* @__PURE__ */ A("p", { className: "ps-msp-subtitle", children: T("Manage your bespoke silhouettes. Switch between profiles for different fits or create a new one for specific garment types.") })
11613
11613
  ] }),
11614
11614
  /* @__PURE__ */ f("div", { className: "ps-msp-grid", children: [
11615
- /* @__PURE__ */ A(tB, { onClick: () => nA(!0), t: T }),
11615
+ /* @__PURE__ */ A(tB, { onClick: () => fA(!0), t: T }),
11616
11616
  n.map((v) => /* @__PURE__ */ A(
11617
11617
  vB,
11618
11618
  {
@@ -11663,12 +11663,12 @@ function HB({
11663
11663
  heightInches: C,
11664
11664
  setHeightInches: w,
11665
11665
  weight: H,
11666
- setWeight: c,
11666
+ setWeight: p,
11667
11667
  age: z,
11668
11668
  setAge: T,
11669
11669
  switchToMetric: x,
11670
11670
  switchToImperial: l,
11671
- onUploadPhoto: nA,
11671
+ onUploadPhoto: fA,
11672
11672
  onSwitchToScan: r,
11673
11673
  onNext: b,
11674
11674
  canProceed: k,
@@ -11679,14 +11679,14 @@ function HB({
11679
11679
  error: K,
11680
11680
  t: F
11681
11681
  }) {
11682
- const tA = parseFloat(B) || 173, wA = (parseFloat(D) || 5) * 12 + (parseFloat(C) || 8), YA = Math.floor(wA / 12), h = wA % 12, a = parseFloat(H) || (g === "kg" ? 70 : 154), XA = parseFloat(z) || 30, RA = g === "kg" ? 30 : 66, vA = g === "kg" ? 200 : 440, J = 120, gA = 220, kA = 48, iA = 84, BA = 13, OA = 100, gf = (tA - J) / (gA - J) * 100, KA = (wA - kA) / (iA - kA) * 100, ef = (a - RA) / (vA - RA) * 100, hA = (XA - BA) / (OA - BA) * 100, Pf = e ? parseFloat(D) > 0 || parseFloat(C) > 0 : parseFloat(B) > 0, ZA = parseFloat(H) > 0, df = Pf && ZA, aA = (sA) => {
11682
+ const tA = parseFloat(B) || 173, wA = (parseFloat(D) || 5) * 12 + (parseFloat(C) || 8), YA = Math.floor(wA / 12), h = wA % 12, a = parseFloat(H) || (g === "kg" ? 70 : 154), bA = parseFloat(z) || 30, RA = g === "kg" ? 30 : 66, vA = g === "kg" ? 200 : 440, N = 120, PA = 220, kA = 48, iA = 84, BA = 13, OA = 100, gf = (tA - N) / (PA - N) * 100, KA = (wA - kA) / (iA - kA) * 100, ef = (a - RA) / (vA - RA) * 100, hA = (bA - BA) / (OA - BA) * 100, Pf = e ? parseFloat(D) > 0 || parseFloat(C) > 0 : parseFloat(B) > 0, ZA = parseFloat(H) > 0, df = Pf && ZA, jA = (sA) => {
11683
11683
  const yA = Math.max(kA, Math.min(iA, sA));
11684
11684
  i(String(Math.floor(yA / 12))), w(String(yA % 12));
11685
11685
  }, Bf = () => {
11686
- n === "in" ? aA(wA + 1) : P(String(Math.min(gA, tA + 1)));
11686
+ n === "in" ? jA(wA + 1) : P(String(Math.min(PA, tA + 1)));
11687
11687
  }, DA = () => {
11688
- n === "in" ? aA(wA - 1) : P(String(Math.max(J, tA - 1)));
11689
- }, TA = () => c(String(Math.min(vA, a + 1))), I = () => c(String(Math.max(RA, a - 1))), uA = () => T(String(Math.min(OA, XA + 1))), fA = () => T(String(Math.max(BA, XA - 1)));
11688
+ n === "in" ? jA(wA - 1) : P(String(Math.max(N, tA - 1)));
11689
+ }, TA = () => p(String(Math.min(vA, a + 1))), I = () => p(String(Math.max(RA, a - 1))), uA = () => T(String(Math.min(OA, bA + 1))), AA = () => T(String(Math.max(BA, bA - 1)));
11690
11690
  return /* @__PURE__ */ f("div", { className: "ps-bpm-root", children: [
11691
11691
  /* @__PURE__ */ f("div", { className: "ps-bpm-header", children: [
11692
11692
  /* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: F("Body Measurements") }),
@@ -11738,7 +11738,7 @@ function HB({
11738
11738
  max: iA,
11739
11739
  step: 1,
11740
11740
  value: wA,
11741
- onChange: (sA) => aA(parseInt(sA.target.value, 10)),
11741
+ onChange: (sA) => jA(parseInt(sA.target.value, 10)),
11742
11742
  style: { "--ps-pct": `${KA}%` }
11743
11743
  }
11744
11744
  ) : /* @__PURE__ */ A(
@@ -11746,8 +11746,8 @@ function HB({
11746
11746
  {
11747
11747
  type: "range",
11748
11748
  className: "ps-bpm-slider",
11749
- min: J,
11750
- max: gA,
11749
+ min: N,
11750
+ max: PA,
11751
11751
  step: 1,
11752
11752
  value: tA,
11753
11753
  onChange: (sA) => P(sA.target.value),
@@ -11777,7 +11777,7 @@ function HB({
11777
11777
  max: vA,
11778
11778
  step: 1,
11779
11779
  value: a,
11780
- onChange: (sA) => c(sA.target.value),
11780
+ onChange: (sA) => p(sA.target.value),
11781
11781
  style: { "--ps-pct": `${ef}%` }
11782
11782
  }
11783
11783
  ),
@@ -11788,13 +11788,13 @@ function HB({
11788
11788
  /* @__PURE__ */ f("div", { className: "ps-bpm-row-top", children: [
11789
11789
  /* @__PURE__ */ A("span", { className: "ps-bpm-label", children: F("AGE") }),
11790
11790
  /* @__PURE__ */ f("span", { className: "ps-bpm-value-display", children: [
11791
- Math.round(XA),
11791
+ Math.round(bA),
11792
11792
  " ",
11793
11793
  F("YEARS")
11794
11794
  ] })
11795
11795
  ] }),
11796
11796
  /* @__PURE__ */ f("div", { className: "ps-bpm-slider-row", children: [
11797
- /* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: fA, "aria-label": F("Decrease"), children: /* @__PURE__ */ A(hn, {}) }),
11797
+ /* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: AA, "aria-label": F("Decrease"), children: /* @__PURE__ */ A(hn, {}) }),
11798
11798
  /* @__PURE__ */ A(
11799
11799
  "input",
11800
11800
  {
@@ -11803,7 +11803,7 @@ function HB({
11803
11803
  min: BA,
11804
11804
  max: OA,
11805
11805
  step: 1,
11806
- value: XA,
11806
+ value: bA,
11807
11807
  onChange: (sA) => T(sA.target.value),
11808
11808
  style: { "--ps-pct": `${hA}%` }
11809
11809
  }
@@ -11819,7 +11819,7 @@ function HB({
11819
11819
  {
11820
11820
  type: "button",
11821
11821
  className: "ps-bpm-upload-link",
11822
- onClick: nA,
11822
+ onClick: fA,
11823
11823
  disabled: !df,
11824
11824
  "aria-describedby": df ? void 0 : "ps-bpm-upload-link-hint",
11825
11825
  children: [
@@ -11893,10 +11893,10 @@ function ng({
11893
11893
  photoStepHeight: C,
11894
11894
  onPhotoStepHeightChange: w,
11895
11895
  ageConfirmed: H,
11896
- onAgeConfirmedChange: c,
11896
+ onAgeConfirmedChange: p,
11897
11897
  t: z
11898
11898
  }) {
11899
- const T = i === "close-up", x = pA(null), l = !!n, nA = !l && H !== !0;
11899
+ const T = i === "close-up", x = aA(null), l = !!n, fA = !l && H !== !0;
11900
11900
  return /* @__PURE__ */ f("div", { className: "ps-pm-root", children: [
11901
11901
  /* @__PURE__ */ f("div", { className: "ps-pm-header", children: [
11902
11902
  /* @__PURE__ */ A("h2", { className: "ps-pm-title", children: z(T ? "Upload a face photo or selfie" : "Review your photo") }),
@@ -11929,13 +11929,13 @@ function ng({
11929
11929
  "button",
11930
11930
  {
11931
11931
  type: "button",
11932
- className: `ps-pm-preview-empty${nA ? " ps-pm-preview-blurred" : ""}`,
11932
+ className: `ps-pm-preview-empty${fA ? " ps-pm-preview-blurred" : ""}`,
11933
11933
  onClick: () => {
11934
- nA || x.current?.click();
11934
+ fA || x.current?.click();
11935
11935
  },
11936
- disabled: nA,
11937
- "aria-hidden": nA,
11938
- tabIndex: nA ? -1 : 0,
11936
+ disabled: fA,
11937
+ "aria-hidden": fA,
11938
+ tabIndex: fA ? -1 : 0,
11939
11939
  children: [
11940
11940
  /* @__PURE__ */ A(QB, {}),
11941
11941
  /* @__PURE__ */ A("span", { className: "ps-pm-preview-empty-title", children: z("Tap to upload") }),
@@ -11947,14 +11947,14 @@ function ng({
11947
11947
  /* @__PURE__ */ A("div", { className: "ps-pm-age-gate-eyebrow", children: z("AGE VERIFICATION") }),
11948
11948
  /* @__PURE__ */ A("div", { className: "ps-pm-age-gate-question", children: z("Is the person in this photo 18 years or older?") }),
11949
11949
  /* @__PURE__ */ f("div", { className: "ps-pm-age-gate-actions", children: [
11950
- /* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-primary", onClick: () => c(!0), children: z("Yes") }),
11951
- /* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => c(!1), children: z("No") })
11950
+ /* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-primary", onClick: () => p(!0), children: z("Yes") }),
11951
+ /* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => p(!1), children: z("No") })
11952
11952
  ] })
11953
11953
  ] }) }),
11954
11954
  H === !1 && /* @__PURE__ */ A("div", { className: "ps-pm-age-gate", role: "alert", children: /* @__PURE__ */ f("div", { className: "ps-pm-age-gate-card", children: [
11955
11955
  /* @__PURE__ */ A("div", { className: "ps-pm-age-gate-eyebrow ps-pm-age-gate-eyebrow-blocked", children: z("UPLOAD NOT ALLOWED") }),
11956
11956
  /* @__PURE__ */ A("div", { className: "ps-pm-age-gate-question", children: z("For your safety, we cannot process photos of people under 18.") }),
11957
- /* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => c(null), children: z("Go back") })
11957
+ /* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => p(null), children: z("Go back") })
11958
11958
  ] }) })
11959
11959
  ] }) }),
11960
11960
  /* @__PURE__ */ f("div", { className: "ps-pm-legal-notice", children: [
@@ -12062,7 +12062,7 @@ function jn({
12062
12062
  ] }),
12063
12063
  /* @__PURE__ */ A("h2", { className: "ps-bsm-question", children: e }),
12064
12064
  /* @__PURE__ */ A("div", { className: "ps-bsm-options-center", children: /* @__PURE__ */ A("div", { className: "ps-bsm-options", children: B.map((C, w) => {
12065
- const H = P === C.value, c = String.fromCharCode(65 + w);
12065
+ const H = P === C.value, p = String.fromCharCode(65 + w);
12066
12066
  return /* @__PURE__ */ f(
12067
12067
  "button",
12068
12068
  {
@@ -12074,7 +12074,7 @@ function jn({
12074
12074
  /* @__PURE__ */ f("span", { className: "ps-bsm-card-eyebrow", children: [
12075
12075
  i("PROFILE"),
12076
12076
  " ",
12077
- c
12077
+ p
12078
12078
  ] }),
12079
12079
  /* @__PURE__ */ A("span", { className: "ps-bsm-card-label", children: C.label.toUpperCase() })
12080
12080
  ] }),
@@ -12176,12 +12176,12 @@ function MB({
12176
12176
  weightUnit: C,
12177
12177
  setWeightUnit: w,
12178
12178
  sizingUnit: H,
12179
- setSizingUnit: c,
12179
+ setSizingUnit: p,
12180
12180
  onComplete: z,
12181
12181
  onSnapSubmit: T,
12182
12182
  hasActiveProfileWithMeasurements: x = !1,
12183
12183
  onUseActiveProfile: l,
12184
- activeProfileName: nA,
12184
+ activeProfileName: fA,
12185
12185
  onStartFresh: r,
12186
12186
  activeProfile: b,
12187
12187
  onBack: k,
@@ -12189,30 +12189,30 @@ function MB({
12189
12189
  }) {
12190
12190
  const O = e ? UB : dB, [s, S] = d("basics");
12191
12191
  s === "photo" || O.indexOf(s);
12192
- const K = AP(), F = JP(P), tA = b?.height, wA = b?.weight, YA = b?.age, h = b?.heightUnit === "ft" ? "in" : b?.heightUnit, a = b?.weightUnit, XA = tA != null && h === "cm" ? String(Math.round(tA)) : tA != null && (h === "in" || h === "ft") ? String(Math.round(tA * 2.54)) : B.current.height || "173", RA = tA != null && (h === "in" || h === "ft") ? Math.round(tA) : tA != null && h === "cm" ? Math.round(tA / 2.54) : null, vA = RA != null ? String(Math.floor(RA / 12)) : B.current.heightFeet || "5", J = RA != null ? String(RA % 12) : B.current.heightInches || "8", gA = wA != null ? String(Math.round(wA)) : B.current.weight || (F ? "154" : "70"), kA = YA != null ? String(YA) : B.current.age || "30", [iA, BA] = d(XA), [OA, gf] = d(vA), [KA, ef] = d(J), [hA, Pf] = d(gA), [ZA, df] = d(kA), [aA, Bf] = d(
12192
+ const K = AP(), F = JP(P), tA = b?.height, wA = b?.weight, YA = b?.age, h = b?.heightUnit === "ft" ? "in" : b?.heightUnit, a = b?.weightUnit, bA = tA != null && h === "cm" ? String(Math.round(tA)) : tA != null && (h === "in" || h === "ft") ? String(Math.round(tA * 2.54)) : B.current.height || "173", RA = tA != null && (h === "in" || h === "ft") ? Math.round(tA) : tA != null && h === "cm" ? Math.round(tA / 2.54) : null, vA = RA != null ? String(Math.floor(RA / 12)) : B.current.heightFeet || "5", N = RA != null ? String(RA % 12) : B.current.heightInches || "8", PA = wA != null ? String(Math.round(wA)) : B.current.weight || (F ? "154" : "70"), kA = YA != null ? String(YA) : B.current.age || "30", [iA, BA] = d(bA), [OA, gf] = d(vA), [KA, ef] = d(N), [hA, Pf] = d(PA), [ZA, df] = d(kA), [jA, Bf] = d(
12193
12193
  h || (D === "ft" ? "in" : D || (F ? "in" : "cm"))
12194
12194
  ), [DA, TA] = d(
12195
12195
  a || C || (F ? "lbs" : "kg")
12196
- ), I = aA === "in" || DA === "lbs", [uA, fA] = d(null), [sA, yA] = d(null), [Of, LA] = d(null), [eA, Uf] = d(!1), jf = pA(null), [lA, Mf] = d(null), [Qf, af] = d(!1), [xf, _A] = d(!1), [of, mA] = d(() => RA != null ? String(Math.round(RA * 2.54)) : XA), [E, y] = d(null), [HA, Q] = d(null), [Z, FA] = d(null), [SA, tf] = d(null), [bA, _] = d(""), [qA, W] = d(null), [L, V] = d(null), [xA, wf] = d(() => ["US", "UK", "AU"].includes(P) ? P === "AU" ? "UK" : P : ["FR", "ES"].includes(P) ? "FR" : ["IT"].includes(P) ? "IT" : ["JP", "CN", "KR"].includes(P) ? "JP" : "EU"), [zA, Df] = d(!1), Af = xP[xA] || xP.US, [Hf, WA] = d(""), ff = EA(async (X) => {
12197
- const N = X.target.files?.[0];
12198
- if (!N) return;
12196
+ ), I = jA === "in" || DA === "lbs", [uA, AA] = d(null), [sA, yA] = d(null), [Of, LA] = d(null), [gA, Uf] = d(!1), jf = aA(null), [lA, Mf] = d(null), [Qf, af] = d(!1), [xf, _A] = d(!1), [of, mA] = d(() => RA != null ? String(Math.round(RA * 2.54)) : bA), [E, y] = d(null), [QA, Q] = d(null), [Z, FA] = d(null), [SA, tf] = d(null), [XA, _] = d(""), [qA, W] = d(null), [L, V] = d(null), [xA, wf] = d(() => ["US", "UK", "AU"].includes(P) ? P === "AU" ? "UK" : P : ["FR", "ES"].includes(P) ? "FR" : ["IT"].includes(P) ? "IT" : ["JP", "CN", "KR"].includes(P) ? "JP" : "EU"), [cA, Df] = d(!1), Af = xP[xA] || xP.US, [Hf, WA] = d(""), ff = EA(async (X) => {
12197
+ const J = X.target.files?.[0];
12198
+ if (!J) return;
12199
12199
  if (lA !== !0) {
12200
12200
  WA(v("Please confirm that the person in the photo is 18 or older before uploading."));
12201
12201
  return;
12202
12202
  }
12203
- if (!N.type.startsWith("image/")) {
12203
+ if (!J.type.startsWith("image/")) {
12204
12204
  WA(v("Please upload an image file"));
12205
12205
  return;
12206
12206
  }
12207
- if (N.size > 10 * 1024 * 1024) {
12207
+ if (J.size > 10 * 1024 * 1024) {
12208
12208
  WA(v("Image must be under 10MB"));
12209
12209
  return;
12210
12210
  }
12211
- WA(""), Uf(!0), fA(N);
12212
- const jA = URL.createObjectURL(N);
12213
- yA(jA);
12211
+ WA(""), Uf(!0), AA(J);
12212
+ const dA = URL.createObjectURL(J);
12213
+ yA(dA);
12214
12214
  try {
12215
- const q = await tn(N);
12215
+ const q = await tn(J);
12216
12216
  LA(q);
12217
12217
  } catch {
12218
12218
  WA(v("Failed to process image")), yA(null);
@@ -12220,15 +12220,15 @@ function MB({
12220
12220
  Uf(!1);
12221
12221
  }
12222
12222
  }, [v, lA]), nf = EA(() => {
12223
- sA && URL.revokeObjectURL(sA), fA(null), yA(null), LA(null), jf.current && (jf.current.value = "");
12223
+ sA && URL.revokeObjectURL(sA), AA(null), yA(null), LA(null), jf.current && (jf.current.value = "");
12224
12224
  }, [sA]), VA = EA(() => {
12225
- if (aA === "in") {
12226
- const N = parseFloat(OA);
12227
- if (!N || N < 3 || N > 8)
12225
+ if (jA === "in") {
12226
+ const J = parseFloat(OA);
12227
+ if (!J || J < 3 || J > 8)
12228
12228
  return WA(v("Please enter a valid height")), !1;
12229
12229
  } else {
12230
- const N = parseFloat(iA);
12231
- if (!N || N < 100 || N > 250)
12230
+ const J = parseFloat(iA);
12231
+ if (!J || J < 100 || J > 250)
12232
12232
  return WA(v("Please enter a valid height (100-250 cm)")), !1;
12233
12233
  }
12234
12234
  const X = parseFloat(hA);
@@ -12238,28 +12238,28 @@ function MB({
12238
12238
  } else if (!X || X < 30 || X > 300)
12239
12239
  return WA(v("Please enter a valid weight (30-300 kg)")), !1;
12240
12240
  return WA(""), !0;
12241
- }, [aA, DA, iA, OA, hA, v]), o = () => {
12241
+ }, [jA, DA, iA, OA, hA, v]), o = () => {
12242
12242
  let X;
12243
- if (aA === "in") {
12244
- const N = parseFloat(OA) || 0, jA = parseFloat(KA) || 0;
12245
- X = N * 12 + jA;
12243
+ if (jA === "in") {
12244
+ const J = parseFloat(OA) || 0, dA = parseFloat(KA) || 0;
12245
+ X = J * 12 + dA;
12246
12246
  } else
12247
12247
  X = parseFloat(iA);
12248
12248
  return { heightVal: X, weightVal: parseFloat(hA) };
12249
12249
  }, j = e ? "female" : "male", U = (X) => {
12250
- const N = O.indexOf(X);
12251
- return N < O.length - 1 ? O[N + 1] : "submit";
12250
+ const J = O.indexOf(X);
12251
+ return J < O.length - 1 ? O[J + 1] : "submit";
12252
12252
  }, R = () => {
12253
- const { heightVal: X, weightVal: N } = o();
12254
- B.current.height = String(X), B.current.weight = String(N), B.current.gender = j, ZA && (B.current.age = ZA), i(aA), w(DA), z({
12253
+ const { heightVal: X, weightVal: J } = o();
12254
+ B.current.height = String(X), B.current.weight = String(J), B.current.gender = j, ZA && (B.current.age = ZA), i(jA), w(DA), z({
12255
12255
  height: X,
12256
- weight: N,
12257
- heightUnit: aA,
12256
+ weight: J,
12257
+ heightUnit: jA,
12258
12258
  weightUnit: DA,
12259
12259
  gender: j,
12260
12260
  age: ZA ? parseInt(ZA, 10) : void 0,
12261
12261
  chestProfile: E || void 0,
12262
- midsectionProfile: HA,
12262
+ midsectionProfile: QA,
12263
12263
  hipProfile: Z,
12264
12264
  bodyImage: Of || void 0,
12265
12265
  bandSize: qA || void 0,
@@ -12273,7 +12273,7 @@ function MB({
12273
12273
  if (!E) return;
12274
12274
  S(U("chest"));
12275
12275
  } else if (s === "midsection") {
12276
- if (!HA) return;
12276
+ if (!QA) return;
12277
12277
  S(U("midsection"));
12278
12278
  } else if (s === "seat") {
12279
12279
  if (!SA) return;
@@ -12298,21 +12298,21 @@ function MB({
12298
12298
  WA(v("Please upload a photo"));
12299
12299
  return;
12300
12300
  }
12301
- const X = aA === "in" ? (parseFloat(OA) || 0) * 12 + (parseFloat(KA) || 0) : parseFloat(iA) || 0, N = parseFloat(hA) || 0, jA = parseFloat(ZA) || void 0;
12301
+ const X = jA === "in" ? (parseFloat(OA) || 0) * 12 + (parseFloat(KA) || 0) : parseFloat(iA) || 0, J = parseFloat(hA) || 0, dA = parseFloat(ZA) || void 0;
12302
12302
  T({
12303
12303
  photoFile: uA,
12304
12304
  photoBase64: Of,
12305
12305
  height: X,
12306
- weight: N,
12307
- heightUnit: aA,
12306
+ weight: J,
12307
+ heightUnit: jA,
12308
12308
  weightUnit: DA,
12309
12309
  gender: j,
12310
- ...jA ? { age: jA } : {}
12310
+ ...dA ? { age: dA } : {}
12311
12311
  });
12312
12312
  }
12313
- }, [s, O, VA, E, HA, Z, SA, qA, L, aA, DA, iA, OA, KA, hA, ZA, Of, uA, of, B, i, w, z, T, e, j, x, l]), Y = (X) => {
12314
- const N = O.indexOf(X);
12315
- return N > 0 ? O[N - 1] : null;
12313
+ }, [s, O, VA, E, QA, Z, SA, qA, L, jA, DA, iA, OA, KA, hA, ZA, Of, uA, of, B, i, w, z, T, e, j, x, l]), Y = (X) => {
12314
+ const J = O.indexOf(X);
12315
+ return J > 0 ? O[J - 1] : null;
12316
12316
  }, MA = EA(() => {
12317
12317
  if (WA(""), s === "basics")
12318
12318
  k();
@@ -12322,25 +12322,25 @@ function MB({
12322
12322
  const X = Y(s);
12323
12323
  X ? S(X) : k();
12324
12324
  }
12325
- }, [s, O, k]), CA = s === "basics" ? !0 : s === "chest" ? !!E : s === "midsection" ? !!HA : s === "seat" ? !!SA : s === "hips" ? !!Z : s === "bra" ? !!(qA && L) : s === "photo", JA = s === O[O.length - 1];
12325
+ }, [s, O, k]), HA = s === "basics" ? !0 : s === "chest" ? !!E : s === "midsection" ? !!QA : s === "seat" ? !!SA : s === "hips" ? !!Z : s === "bra" ? !!(qA && L) : s === "photo", JA = s === O[O.length - 1];
12326
12326
  if (s === "photo") {
12327
- const X = aA === "in" ? parseFloat(OA) > 0 || parseFloat(KA) > 0 : parseFloat(iA) > 0, N = parseFloat(hA) > 0, jA = !!sA, q = [];
12328
- jA || q.push(v("Upload a photo")), X || q.push(v("Enter your height")), N || q.push(v("Enter your weight"));
12329
- const PA = q.length > 0, vf = PA ? q[0] ?? v("Analyze My Size") : v("Analyze My Size"), zf = () => {
12330
- if (aA === "in") {
12331
- const dA = (parseFloat(OA) || 0) * 12 + (parseFloat(KA) || 0);
12332
- dA > 0 && BA(String(Math.round(dA * 2.54)));
12327
+ const X = jA === "in" ? parseFloat(OA) > 0 || parseFloat(KA) > 0 : parseFloat(iA) > 0, J = parseFloat(hA) > 0, dA = !!sA, q = [];
12328
+ dA || q.push(v("Upload a photo")), X || q.push(v("Enter your height")), J || q.push(v("Enter your weight"));
12329
+ const nA = q.length > 0, vf = nA ? q[0] ?? v("Analyze My Size") : v("Analyze My Size"), zf = () => {
12330
+ if (jA === "in") {
12331
+ const UA = (parseFloat(OA) || 0) * 12 + (parseFloat(KA) || 0);
12332
+ UA > 0 && BA(String(Math.round(UA * 2.54)));
12333
12333
  }
12334
- DA === "lbs" && hA && Pf(String(Math.round(parseFloat(hA) / 2.205))), Bf("cm"), TA("kg"), i("cm"), w("kg"), c?.("cm");
12334
+ DA === "lbs" && hA && Pf(String(Math.round(parseFloat(hA) / 2.205))), Bf("cm"), TA("kg"), i("cm"), w("kg"), p?.("cm");
12335
12335
  }, $A = () => {
12336
- if (aA === "cm") {
12337
- const dA = parseFloat(iA);
12338
- if (dA > 0) {
12339
- const sf = Math.round(dA / 2.54);
12336
+ if (jA === "cm") {
12337
+ const UA = parseFloat(iA);
12338
+ if (UA > 0) {
12339
+ const sf = Math.round(UA / 2.54);
12340
12340
  gf(String(Math.floor(sf / 12))), ef(String(sf % 12));
12341
12341
  }
12342
12342
  }
12343
- DA === "kg" && hA && Pf(String(Math.round(parseFloat(hA) * 2.205))), Bf("in"), TA("lbs"), i("in"), w("lbs"), c?.("in");
12343
+ DA === "kg" && hA && Pf(String(Math.round(parseFloat(hA) * 2.205))), Bf("in"), TA("lbs"), i("in"), w("lbs"), p?.("in");
12344
12344
  };
12345
12345
  return K ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
12346
12346
  ng,
@@ -12354,8 +12354,8 @@ function MB({
12354
12354
  photoStepHeight: of,
12355
12355
  onPhotoStepHeightChange: mA,
12356
12356
  ageConfirmed: lA,
12357
- onAgeConfirmedChange: (dA) => {
12358
- Mf(dA), dA === !0 && WA("");
12357
+ onAgeConfirmedChange: (UA) => {
12358
+ Mf(UA), UA === !0 && WA("");
12359
12359
  },
12360
12360
  t: v
12361
12361
  }
@@ -12395,8 +12395,8 @@ function MB({
12395
12395
  },
12396
12396
  children: sA ? /* @__PURE__ */ f(rA, { children: [
12397
12397
  /* @__PURE__ */ A("img", { src: sA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
12398
- /* @__PURE__ */ A("button", { onClick: (dA) => {
12399
- dA.stopPropagation(), nf();
12398
+ /* @__PURE__ */ A("button", { onClick: (UA) => {
12399
+ UA.stopPropagation(), nf();
12400
12400
  }, style: { position: "absolute", top: "0.5vw", right: "0.5vw", width: "1.4vw", height: "1.4vw", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "none", color: "#fff", fontSize: "0.7vw", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }, children: "×" })
12401
12401
  ] }) : /* @__PURE__ */ f(rA, { children: [
12402
12402
  /* @__PURE__ */ A(Mn, { size: 32 }),
@@ -12408,7 +12408,7 @@ function MB({
12408
12408
  {
12409
12409
  role: "dialog",
12410
12410
  "aria-labelledby": "ps-bp-age-q",
12411
- onClick: (dA) => dA.stopPropagation(),
12411
+ onClick: (UA) => UA.stopPropagation(),
12412
12412
  style: {
12413
12413
  marginTop: "1.1vw",
12414
12414
  padding: "0.75vw 1.1vw",
@@ -12428,8 +12428,8 @@ function MB({
12428
12428
  "button",
12429
12429
  {
12430
12430
  type: "button",
12431
- onClick: (dA) => {
12432
- dA.stopPropagation(), Mf(!0), WA("");
12431
+ onClick: (UA) => {
12432
+ UA.stopPropagation(), Mf(!0), WA("");
12433
12433
  },
12434
12434
  style: {
12435
12435
  padding: "0.4vw 1vw",
@@ -12449,8 +12449,8 @@ function MB({
12449
12449
  "button",
12450
12450
  {
12451
12451
  type: "button",
12452
- onClick: (dA) => {
12453
- dA.stopPropagation(), Mf(!1);
12452
+ onClick: (UA) => {
12453
+ UA.stopPropagation(), Mf(!1);
12454
12454
  },
12455
12455
  style: {
12456
12456
  padding: "0.4vw 1vw",
@@ -12473,7 +12473,7 @@ function MB({
12473
12473
  "div",
12474
12474
  {
12475
12475
  role: "alert",
12476
- onClick: (dA) => dA.stopPropagation(),
12476
+ onClick: (UA) => UA.stopPropagation(),
12477
12477
  style: {
12478
12478
  marginTop: "1.1vw",
12479
12479
  padding: "0.75vw 1.1vw",
@@ -12492,8 +12492,8 @@ function MB({
12492
12492
  "button",
12493
12493
  {
12494
12494
  type: "button",
12495
- onClick: (dA) => {
12496
- dA.stopPropagation(), Mf(null);
12495
+ onClick: (UA) => {
12496
+ UA.stopPropagation(), Mf(null);
12497
12497
  },
12498
12498
  style: {
12499
12499
  padding: "0.4vw 1vw",
@@ -12529,7 +12529,7 @@ function MB({
12529
12529
  "button",
12530
12530
  {
12531
12531
  type: "button",
12532
- onClick: () => af((dA) => !dA),
12532
+ onClick: () => af((UA) => !UA),
12533
12533
  "aria-label": v("How to take a good photo"),
12534
12534
  title: v("How to take a good photo"),
12535
12535
  style: {
@@ -12581,20 +12581,20 @@ function MB({
12581
12581
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-fields", children: [
12582
12582
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
12583
12583
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("HEIGHT") }),
12584
- aA === "in" ? /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
12585
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: OA, onChange: (dA) => gf(dA.target.value), min: 3, max: 8 }),
12584
+ jA === "in" ? /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
12585
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: OA, onChange: (UA) => gf(UA.target.value), min: 3, max: 8 }),
12586
12586
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
12587
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: KA, onChange: (dA) => ef(dA.target.value), min: 0, max: 11 }),
12587
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: KA, onChange: (UA) => ef(UA.target.value), min: 0, max: 11 }),
12588
12588
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
12589
12589
  ] }) : /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
12590
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: iA, onChange: (dA) => BA(dA.target.value), min: 100, max: 250 }),
12590
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: iA, onChange: (UA) => BA(UA.target.value), min: 100, max: 250 }),
12591
12591
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
12592
12592
  ] })
12593
12593
  ] }),
12594
12594
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
12595
12595
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("WEIGHT") }),
12596
12596
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
12597
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: DA === "kg" ? "75" : "165", value: hA, onChange: (dA) => Pf(dA.target.value), min: DA === "kg" ? 30 : 66, max: DA === "kg" ? 300 : 660 }),
12597
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: DA === "kg" ? "75" : "165", value: hA, onChange: (UA) => Pf(UA.target.value), min: DA === "kg" ? 30 : 66, max: DA === "kg" ? 300 : 660 }),
12598
12598
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: DA })
12599
12599
  ] })
12600
12600
  ] })
@@ -12731,11 +12731,11 @@ function MB({
12731
12731
  /* @__PURE__ */ A(
12732
12732
  "button",
12733
12733
  {
12734
- className: `ps-bp-next-btn${PA ? " ps-bp-btn-disabled" : ""}`,
12734
+ className: `ps-bp-next-btn${nA ? " ps-bp-btn-disabled" : ""}`,
12735
12735
  onClick: u,
12736
- disabled: PA,
12736
+ disabled: nA,
12737
12737
  type: "button",
12738
- title: PA ? q.join(" · ") : void 0,
12738
+ title: nA ? q.join(" · ") : void 0,
12739
12739
  children: vf
12740
12740
  }
12741
12741
  )
@@ -12757,22 +12757,22 @@ function MB({
12757
12757
  /* @__PURE__ */ f("div", { className: "ps-bp-root", children: [
12758
12758
  s === "basics" && (() => {
12759
12759
  const X = () => {
12760
- if (aA === "in") {
12761
- const jA = (parseFloat(OA) || 5) * 12 + (parseFloat(KA) || 8);
12762
- BA(String(Math.round(jA * 2.54)));
12760
+ if (jA === "in") {
12761
+ const dA = (parseFloat(OA) || 5) * 12 + (parseFloat(KA) || 8);
12762
+ BA(String(Math.round(dA * 2.54)));
12763
12763
  }
12764
- DA === "lbs" && hA && Pf(String(Math.round(parseFloat(hA) / 2.205))), Bf("cm"), TA("kg"), i("cm"), w("kg"), c?.("cm");
12765
- }, N = () => {
12766
- if (aA === "cm") {
12767
- const jA = parseFloat(iA) || 173, q = Math.round(jA / 2.54);
12764
+ DA === "lbs" && hA && Pf(String(Math.round(parseFloat(hA) / 2.205))), Bf("cm"), TA("kg"), i("cm"), w("kg"), p?.("cm");
12765
+ }, J = () => {
12766
+ if (jA === "cm") {
12767
+ const dA = parseFloat(iA) || 173, q = Math.round(dA / 2.54);
12768
12768
  gf(String(Math.floor(q / 12))), ef(String(q % 12));
12769
12769
  }
12770
- DA === "kg" && hA && Pf(String(Math.round(parseFloat(hA) * 2.205))), Bf("in"), TA("lbs"), i("in"), w("lbs"), c?.("in");
12770
+ DA === "kg" && hA && Pf(String(Math.round(parseFloat(hA) * 2.205))), Bf("in"), TA("lbs"), i("in"), w("lbs"), p?.("in");
12771
12771
  };
12772
12772
  return K ? /* @__PURE__ */ A(
12773
12773
  HB,
12774
12774
  {
12775
- hUnit: aA,
12775
+ hUnit: jA,
12776
12776
  wUnit: DA,
12777
12777
  isImperialMode: I,
12778
12778
  height: iA,
@@ -12786,14 +12786,14 @@ function MB({
12786
12786
  age: ZA,
12787
12787
  setAge: df,
12788
12788
  switchToMetric: X,
12789
- switchToImperial: N,
12789
+ switchToImperial: J,
12790
12790
  onUploadPhoto: () => S("photo"),
12791
12791
  onSwitchToScan: () => S("photo"),
12792
12792
  hidePhotoOptions: x,
12793
12793
  onNext: x && l ? l : u,
12794
12794
  canProceed: !0,
12795
- fastPathLabel: x ? v("Find My Best Fit") + (bf(aA) ? ` (${bf(aA)})` : "") : void 0,
12796
- activeProfileName: x ? nA : null,
12795
+ fastPathLabel: x ? v("Find My Best Fit") + (bf(jA) ? ` (${bf(jA)})` : "") : void 0,
12796
+ activeProfileName: x ? fA : null,
12797
12797
  onStartFresh: r,
12798
12798
  error: Hf,
12799
12799
  t: v
@@ -12801,10 +12801,10 @@ function MB({
12801
12801
  "step-basics-mobile"
12802
12802
  ) : /* @__PURE__ */ f("div", { className: "ps-bp-step ps-bp-step-enter", children: [
12803
12803
  /* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Body Measurements") }),
12804
- x && nA && /* @__PURE__ */ f("p", { className: "ps-bp-profile-hint", children: [
12804
+ x && fA && /* @__PURE__ */ f("p", { className: "ps-bp-profile-hint", children: [
12805
12805
  v("Using"),
12806
12806
  " ",
12807
- /* @__PURE__ */ A("strong", { children: nA }),
12807
+ /* @__PURE__ */ A("strong", { children: fA }),
12808
12808
  r && /* @__PURE__ */ f(rA, { children: [
12809
12809
  " · ",
12810
12810
  /* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: r, children: v("start fresh") })
@@ -12812,38 +12812,38 @@ function MB({
12812
12812
  ] }),
12813
12813
  /* @__PURE__ */ f("div", { className: "ps-bp-system-toggle", children: [
12814
12814
  /* @__PURE__ */ A("button", { className: `ps-bp-system-btn${I ? "" : " ps-bp-system-active"}`, onClick: X, type: "button", children: v("Metric") }),
12815
- /* @__PURE__ */ A("button", { className: `ps-bp-system-btn${I ? " ps-bp-system-active" : ""}`, onClick: N, type: "button", children: v("Imperial") })
12815
+ /* @__PURE__ */ A("button", { className: `ps-bp-system-btn${I ? " ps-bp-system-active" : ""}`, onClick: J, type: "button", children: v("Imperial") })
12816
12816
  ] }),
12817
12817
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-fields", children: [
12818
12818
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
12819
12819
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("HEIGHT") }),
12820
- aA === "in" ? /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
12821
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: OA, onChange: (jA) => gf(jA.target.value), min: 3, max: 8 }),
12820
+ jA === "in" ? /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
12821
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: OA, onChange: (dA) => gf(dA.target.value), min: 3, max: 8 }),
12822
12822
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
12823
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: KA, onChange: (jA) => ef(jA.target.value), min: 0, max: 11 }),
12823
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: KA, onChange: (dA) => ef(dA.target.value), min: 0, max: 11 }),
12824
12824
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
12825
12825
  ] }) : /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
12826
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: iA, onChange: (jA) => BA(jA.target.value), min: 100, max: 250 }),
12826
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: iA, onChange: (dA) => BA(dA.target.value), min: 100, max: 250 }),
12827
12827
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
12828
12828
  ] })
12829
12829
  ] }),
12830
12830
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
12831
12831
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("WEIGHT") }),
12832
12832
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
12833
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: DA === "kg" ? "75" : "165", value: hA, onChange: (jA) => Pf(jA.target.value), min: DA === "kg" ? 30 : 66, max: DA === "kg" ? 300 : 660 }),
12833
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: DA === "kg" ? "75" : "165", value: hA, onChange: (dA) => Pf(dA.target.value), min: DA === "kg" ? 30 : 66, max: DA === "kg" ? 300 : 660 }),
12834
12834
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: DA })
12835
12835
  ] })
12836
12836
  ] }),
12837
12837
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-row", children: [
12838
12838
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("AGE") }),
12839
12839
  /* @__PURE__ */ f("div", { className: "ps-bp-inline-input-group", children: [
12840
- /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "30", value: ZA, onChange: (jA) => df(jA.target.value), min: 13, max: 100 }),
12840
+ /* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "30", value: ZA, onChange: (dA) => df(dA.target.value), min: 13, max: 100 }),
12841
12841
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: v("years") })
12842
12842
  ] })
12843
12843
  ] })
12844
12844
  ] }),
12845
12845
  (() => {
12846
- const jA = aA === "in" ? parseFloat(OA) > 0 || parseFloat(KA) > 0 : parseFloat(iA) > 0, q = parseFloat(hA) > 0, PA = jA && q;
12846
+ const dA = jA === "in" ? parseFloat(OA) > 0 || parseFloat(KA) > 0 : parseFloat(iA) > 0, q = parseFloat(hA) > 0, nA = dA && q;
12847
12847
  return /* @__PURE__ */ f(rA, { children: [
12848
12848
  /* @__PURE__ */ f(
12849
12849
  "button",
@@ -12851,8 +12851,8 @@ function MB({
12851
12851
  className: "ps-bp-photo-cta",
12852
12852
  onClick: () => S("photo"),
12853
12853
  type: "button",
12854
- disabled: !PA,
12855
- title: PA ? void 0 : v("Enter height and weight first"),
12854
+ disabled: !nA,
12855
+ title: nA ? void 0 : v("Enter height and weight first"),
12856
12856
  children: [
12857
12857
  /* @__PURE__ */ A(jB, {}),
12858
12858
  /* @__PURE__ */ A("span", { children: v("Or upload a photo for AI sizing") }),
@@ -12860,7 +12860,7 @@ function MB({
12860
12860
  ]
12861
12861
  }
12862
12862
  ),
12863
- !PA && /* @__PURE__ */ A("span", { className: "ps-bp-photo-cta-hint", children: v("Enter height and weight first") })
12863
+ !nA && /* @__PURE__ */ A("span", { className: "ps-bp-photo-cta-hint", children: v("Enter height and weight first") })
12864
12864
  ] });
12865
12865
  })(),
12866
12866
  Hf && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: Hf })
@@ -12889,7 +12889,7 @@ function MB({
12889
12889
  /* @__PURE__ */ A(Ff, { img: GA.male.chest.average, label: v("Average"), selected: E === "average", onSelect: () => y("average"), onHover: () => _(v("A moderate, proportionate chest")), onLeave: () => _("") }),
12890
12890
  /* @__PURE__ */ A(Ff, { img: GA.male.chest.broad, label: v("Broad"), selected: E === "broad", onSelect: () => y("broad"), onHover: () => _(v("A wider, more muscular chest")), onLeave: () => _("") })
12891
12891
  ] }),
12892
- /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: bA || " " })
12892
+ /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: XA || " " })
12893
12893
  ] }, "step-chest")),
12894
12894
  s === "midsection" && (K ? /* @__PURE__ */ A(
12895
12895
  jn,
@@ -12906,7 +12906,7 @@ function MB({
12906
12906
  { value: "average", label: v("Average"), img: GA.male.stomach.average },
12907
12907
  { value: "round", label: v("Full"), img: GA.male.stomach.round }
12908
12908
  ],
12909
- selected: HA,
12909
+ selected: QA,
12910
12910
  onSelect: (X) => Q(X),
12911
12911
  t: v
12912
12912
  },
@@ -12914,15 +12914,15 @@ function MB({
12914
12914
  ) : /* @__PURE__ */ f("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
12915
12915
  /* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your midsection?") }),
12916
12916
  /* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: e ? /* @__PURE__ */ f(rA, { children: [
12917
- /* @__PURE__ */ A(Ff, { img: GA.female.stomach.flat, label: v("Flat"), selected: HA === "flat", onSelect: () => Q("flat"), onHover: () => _(v("A flatter midsection with minimal protrusion")), onLeave: () => _("") }),
12918
- /* @__PURE__ */ A(Ff, { img: GA.female.stomach.average, label: v("Average"), selected: HA === "average", onSelect: () => Q("average"), onHover: () => _(v("A moderate, natural midsection shape")), onLeave: () => _("") }),
12919
- /* @__PURE__ */ A(Ff, { img: GA.female.stomach.round, label: v("Full"), selected: HA === "round", onSelect: () => Q("round"), onHover: () => _(v("A fuller, more rounded midsection")), onLeave: () => _("") })
12917
+ /* @__PURE__ */ A(Ff, { img: GA.female.stomach.flat, label: v("Flat"), selected: QA === "flat", onSelect: () => Q("flat"), onHover: () => _(v("A flatter midsection with minimal protrusion")), onLeave: () => _("") }),
12918
+ /* @__PURE__ */ A(Ff, { img: GA.female.stomach.average, label: v("Average"), selected: QA === "average", onSelect: () => Q("average"), onHover: () => _(v("A moderate, natural midsection shape")), onLeave: () => _("") }),
12919
+ /* @__PURE__ */ A(Ff, { img: GA.female.stomach.round, label: v("Full"), selected: QA === "round", onSelect: () => Q("round"), onHover: () => _(v("A fuller, more rounded midsection")), onLeave: () => _("") })
12920
12920
  ] }) : /* @__PURE__ */ f(rA, { children: [
12921
- /* @__PURE__ */ A(Ff, { img: GA.male.stomach.flat, label: v("Flat"), selected: HA === "flat", onSelect: () => Q("flat"), onHover: () => _(v("A flatter midsection with minimal protrusion")), onLeave: () => _("") }),
12922
- /* @__PURE__ */ A(Ff, { img: GA.male.stomach.average, label: v("Average"), selected: HA === "average", onSelect: () => Q("average"), onHover: () => _(v("A moderate, natural midsection shape")), onLeave: () => _("") }),
12923
- /* @__PURE__ */ A(Ff, { img: GA.male.stomach.round, label: v("Full"), selected: HA === "round", onSelect: () => Q("round"), onHover: () => _(v("A fuller, more rounded midsection")), onLeave: () => _("") })
12921
+ /* @__PURE__ */ A(Ff, { img: GA.male.stomach.flat, label: v("Flat"), selected: QA === "flat", onSelect: () => Q("flat"), onHover: () => _(v("A flatter midsection with minimal protrusion")), onLeave: () => _("") }),
12922
+ /* @__PURE__ */ A(Ff, { img: GA.male.stomach.average, label: v("Average"), selected: QA === "average", onSelect: () => Q("average"), onHover: () => _(v("A moderate, natural midsection shape")), onLeave: () => _("") }),
12923
+ /* @__PURE__ */ A(Ff, { img: GA.male.stomach.round, label: v("Full"), selected: QA === "round", onSelect: () => Q("round"), onHover: () => _(v("A fuller, more rounded midsection")), onLeave: () => _("") })
12924
12924
  ] }) }),
12925
- /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: bA || " " })
12925
+ /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: XA || " " })
12926
12926
  ] }, "step-midsection")),
12927
12927
  s === "seat" && (K ? /* @__PURE__ */ A(
12928
12928
  jn,
@@ -12955,7 +12955,7 @@ function MB({
12955
12955
  /* @__PURE__ */ A(Ff, { img: GA.male.seat.average, label: v("Average"), selected: SA === "average", onSelect: () => tf("average"), onHover: () => _(v("A moderate, natural backside shape")), onLeave: () => _("") }),
12956
12956
  /* @__PURE__ */ A(Ff, { img: GA.male.seat.full, label: v("Full"), selected: SA === "full", onSelect: () => tf("full"), onHover: () => _(v("A fuller, more rounded backside")), onLeave: () => _("") })
12957
12957
  ] }) }),
12958
- /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: bA || " " })
12958
+ /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: XA || " " })
12959
12959
  ] }, "step-seat")),
12960
12960
  s === "hips" && e && (K ? /* @__PURE__ */ A(
12961
12961
  jn,
@@ -12980,7 +12980,7 @@ function MB({
12980
12980
  /* @__PURE__ */ A(Ff, { img: GA.female.hips.average, label: v("Average"), selected: Z === "average", onSelect: () => FA("average"), onHover: () => _(v("Hips proportionate to shoulders")), onLeave: () => _("") }),
12981
12981
  /* @__PURE__ */ A(Ff, { img: GA.female.hips.full, label: v("Curvy"), selected: Z === "full", onSelect: () => FA("full"), onHover: () => _(v("Hips wider than shoulders")), onLeave: () => _("") })
12982
12982
  ] }),
12983
- /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: bA || " " })
12983
+ /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: XA || " " })
12984
12984
  ] }, "step-hips")),
12985
12985
  s === "bra" && e && /* @__PURE__ */ f("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-bra-step", children: [
12986
12986
  /* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Select your bra size") }),
@@ -12992,16 +12992,16 @@ function MB({
12992
12992
  "button",
12993
12993
  {
12994
12994
  className: "ps-bp-bra-region-trigger",
12995
- onClick: () => Df(!zA),
12995
+ onClick: () => Df(!cA),
12996
12996
  type: "button",
12997
12997
  children: [
12998
12998
  xA,
12999
12999
  " ",
13000
- /* @__PURE__ */ A("span", { className: `ps-bp-bra-region-arrow${zA ? " ps-open" : ""}`, children: "▾" })
13000
+ /* @__PURE__ */ A("span", { className: `ps-bp-bra-region-arrow${cA ? " ps-open" : ""}`, children: "▾" })
13001
13001
  ]
13002
13002
  }
13003
13003
  ),
13004
- zA && /* @__PURE__ */ A("div", { className: "ps-bp-bra-region-dropdown", children: ["US", "UK", "EU", "FR", "IT", "JP"].map((X) => /* @__PURE__ */ A(
13004
+ cA && /* @__PURE__ */ A("div", { className: "ps-bp-bra-region-dropdown", children: ["US", "UK", "EU", "FR", "IT", "JP"].map((X) => /* @__PURE__ */ A(
13005
13005
  "button",
13006
13006
  {
13007
13007
  className: `ps-bp-bra-region-item${xA === X ? " ps-selected" : ""}`,
@@ -13056,7 +13056,7 @@ function MB({
13056
13056
  Hf && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: Hf })
13057
13057
  ] }, "step-bra"),
13058
13058
  !(K && s === "basics") && (() => {
13059
- const X = s === "basics" && x && !!l, N = X ? l : u, jA = bf(aA) ? ` (${bf(aA)})` : "", q = X ? v("Find My Best Fit") + jA : JA ? v("Find My Size") + jA : v("Next");
13059
+ const X = s === "basics" && x && !!l, J = X ? l : u, dA = bf(jA) ? ` (${bf(jA)})` : "", q = X ? v("Find My Best Fit") + dA : JA ? v("Find My Size") + dA : v("Next");
13060
13060
  return /* @__PURE__ */ f("div", { className: "ps-bp-nav", children: [
13061
13061
  s !== "basics" ? /* @__PURE__ */ f("button", { className: "ps-bp-back-btn", onClick: MA, type: "button", children: [
13062
13062
  /* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
@@ -13066,9 +13066,9 @@ function MB({
13066
13066
  /* @__PURE__ */ A(
13067
13067
  "button",
13068
13068
  {
13069
- className: `ps-bp-next-btn${!X && !CA ? " ps-bp-btn-disabled" : ""}`,
13070
- onClick: N,
13071
- disabled: !X && !CA,
13069
+ className: `ps-bp-next-btn${!X && !HA ? " ps-bp-btn-disabled" : ""}`,
13070
+ onClick: J,
13071
+ disabled: !X && !HA,
13072
13072
  type: "button",
13073
13073
  children: q
13074
13074
  }
@@ -13095,12 +13095,12 @@ function fP({
13095
13095
  formRef: C,
13096
13096
  sizingUnit: w,
13097
13097
  setSizingUnit: H,
13098
- setSizingMethod: c,
13098
+ setSizingMethod: p,
13099
13099
  setSizingLoading: z,
13100
13100
  setView: T,
13101
13101
  submitSizing: x,
13102
13102
  onSnapSubmit: l,
13103
- onBack: nA,
13103
+ onBack: fA,
13104
13104
  t: r
13105
13105
  }) {
13106
13106
  const b = B === "close-up", k = AP(), [v, O] = d("manual"), [s, S] = d(() => {
@@ -13108,11 +13108,11 @@ function fP({
13108
13108
  return g.forEach((uA) => {
13109
13109
  I[uA.key] = C.current[uA.key] || "";
13110
13110
  }), I;
13111
- }), [K, F] = d(""), tA = pA(null), [wA, YA] = d(null), [h, a] = d(null), [XA, RA] = d(null), [vA, J] = d(!1), [gA, kA] = d(null), [iA, BA] = d(!1), OA = EA(async (I) => {
13111
+ }), [K, F] = d(""), tA = aA(null), [wA, YA] = d(null), [h, a] = d(null), [bA, RA] = d(null), [vA, N] = d(!1), [PA, kA] = d(null), [iA, BA] = d(!1), OA = EA(async (I) => {
13112
13112
  const uA = I.target.files?.[0];
13113
13113
  if (!uA) return;
13114
- const fA = URL.createObjectURL(uA);
13115
- a(uA), YA(fA);
13114
+ const AA = URL.createObjectURL(uA);
13115
+ a(uA), YA(AA);
13116
13116
  try {
13117
13117
  const sA = await tn(uA, b ? { maxDimension: 1536, quality: 0.85 } : {});
13118
13118
  RA(sA);
@@ -13121,7 +13121,7 @@ function fP({
13121
13121
  }, [b]), gf = EA(() => {
13122
13122
  wA && URL.revokeObjectURL(wA), a(null), YA(null), RA(null);
13123
13123
  }, [wA]), KA = (I, uA) => {
13124
- S((fA) => ({ ...fA, [I]: uA })), F("");
13124
+ S((AA) => ({ ...AA, [I]: uA })), F("");
13125
13125
  }, ef = () => {
13126
13126
  const I = g[0];
13127
13127
  if (!I) return;
@@ -13130,22 +13130,22 @@ function fP({
13130
13130
  F(r("Please enter your ") + r(I.label).toLowerCase());
13131
13131
  return;
13132
13132
  }
13133
- g.forEach((fA) => {
13134
- const sA = parseFloat(s[fA.key] || "");
13135
- sA > 0 && (C.current[fA.key] = String(sA));
13136
- }), C.current.gender = C.current.gender || "male", c("exact"), z(!0), T("size-result"), x("exact");
13133
+ g.forEach((AA) => {
13134
+ const sA = parseFloat(s[AA.key] || "");
13135
+ sA > 0 && (C.current[AA.key] = String(sA));
13136
+ }), C.current.gender = C.current.gender || "male", p("exact"), z(!0), T("size-result"), x("exact");
13137
13137
  }, hA = () => {
13138
- if (gA !== !0) {
13138
+ if (PA !== !0) {
13139
13139
  F(r("Please confirm that the person in the photo is 18 or older before uploading."));
13140
13140
  return;
13141
13141
  }
13142
- if (!h || !XA) {
13142
+ if (!h || !bA) {
13143
13143
  F(r("Please upload a photo"));
13144
13144
  return;
13145
13145
  }
13146
13146
  l({
13147
13147
  photoFile: h,
13148
- photoBase64: XA,
13148
+ photoBase64: bA,
13149
13149
  height: 0,
13150
13150
  weight: 0,
13151
13151
  heightUnit: "cm",
@@ -13164,7 +13164,7 @@ function fP({
13164
13164
  onSwitchToManual: () => O("manual"),
13165
13165
  error: K,
13166
13166
  photoVariant: B,
13167
- ageConfirmed: gA,
13167
+ ageConfirmed: PA,
13168
13168
  onAgeConfirmedChange: (I) => {
13169
13169
  kA(I), I === !0 && F("");
13170
13170
  },
@@ -13234,7 +13234,7 @@ function fP({
13234
13234
  )
13235
13235
  ] })
13236
13236
  ] }) });
13237
- const ZA = g.some((I) => (parseFloat(s[I.key] || "") || 0) > 0), df = !!h && gA === !0, Bf = !df && !ZA, DA = df ? r("Analyze") : `${r("Find My Size")}${bf(w) ? ` (${bf(w)})` : ""}`, TA = df ? hA : ef;
13237
+ const ZA = g.some((I) => (parseFloat(s[I.key] || "") || 0) > 0), df = !!h && PA === !0, Bf = !df && !ZA, DA = df ? r("Analyze") : `${r("Find My Size")}${bf(w) ? ` (${bf(w)})` : ""}`, TA = df ? hA : ef;
13238
13238
  return v !== "photo" || P ? /* @__PURE__ */ f("div", { className: "ps-bp-layout", children: [
13239
13239
  /* @__PURE__ */ A("div", { className: "ps-bp-image", style: { position: "relative" }, children: /* @__PURE__ */ A("img", { src: D, alt: i, className: "ps-bp-image-img" }) }),
13240
13240
  /* @__PURE__ */ A("div", { className: "ps-bp-root", children: /* @__PURE__ */ f("div", { className: "ps-bp-step ps-bp-step-enter", children: [
@@ -13295,23 +13295,23 @@ function fP({
13295
13295
  "div",
13296
13296
  {
13297
13297
  onClick: () => {
13298
- !wA && gA === !0 && tA.current?.click();
13298
+ !wA && PA === !0 && tA.current?.click();
13299
13299
  },
13300
13300
  onMouseEnter: () => {
13301
- !wA && gA === !0 && J(!0);
13301
+ !wA && PA === !0 && N(!0);
13302
13302
  },
13303
- onMouseLeave: () => J(!1),
13303
+ onMouseLeave: () => N(!1),
13304
13304
  style: {
13305
13305
  flex: 1,
13306
13306
  display: "flex",
13307
13307
  flexDirection: "column",
13308
13308
  alignItems: "center",
13309
13309
  justifyContent: "center",
13310
- border: wA ? "2px solid var(--ps-accent)" : gA === !0 && vA ? "2px dashed var(--ps-accent)" : "2px dashed var(--ps-border-color)",
13310
+ border: wA ? "2px solid var(--ps-accent)" : PA === !0 && vA ? "2px dashed var(--ps-accent)" : "2px dashed var(--ps-border-color)",
13311
13311
  borderRadius: "0.5vw",
13312
- cursor: wA ? "default" : gA === !0 ? "pointer" : "default",
13312
+ cursor: wA ? "default" : PA === !0 ? "pointer" : "default",
13313
13313
  position: "relative",
13314
- background: wA ? "var(--ps-bg-secondary)" : gA === !0 && vA ? "rgba(33,84,239,0.04)" : gA === null ? "rgba(0,0,0,0.025)" : "var(--ps-bg-secondary)",
13314
+ background: wA ? "var(--ps-bg-secondary)" : PA === !0 && vA ? "rgba(33,84,239,0.04)" : PA === null ? "rgba(0,0,0,0.025)" : "var(--ps-bg-secondary)",
13315
13315
  transition: "border-color 0.18s, background 0.18s",
13316
13316
  overflow: "hidden"
13317
13317
  },
@@ -13325,7 +13325,7 @@ function fP({
13325
13325
  /* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: r(b ? "Upload close-up photo" : "Upload your photo") }),
13326
13326
  /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: r(b ? "Click or drag a close-up face photo" : "Click or drag a full-body photo") }),
13327
13327
  /* @__PURE__ */ A("span", { style: { fontSize: "0.5vw", color: "var(--ps-text-dim)", marginTop: "0.4vw" }, children: "JPEG, PNG (max 10MB)" }),
13328
- gA === null && /* @__PURE__ */ f(
13328
+ PA === null && /* @__PURE__ */ f(
13329
13329
  "div",
13330
13330
  {
13331
13331
  role: "dialog",
@@ -13389,7 +13389,7 @@ function fP({
13389
13389
  ]
13390
13390
  }
13391
13391
  ),
13392
- gA === !1 && /* @__PURE__ */ f(
13392
+ PA === !1 && /* @__PURE__ */ f(
13393
13393
  "div",
13394
13394
  {
13395
13395
  role: "alert",
@@ -13874,12 +13874,12 @@ function XB({
13874
13874
  buttonIcon: C,
13875
13875
  locale: w,
13876
13876
  buttonStyles: H = {},
13877
- modalStyles: c = {},
13877
+ modalStyles: p = {},
13878
13878
  classNames: z = {},
13879
13879
  className: T,
13880
13880
  style: x,
13881
13881
  onOpen: l,
13882
- onClose: nA,
13882
+ onClose: fA,
13883
13883
  onUpload: r,
13884
13884
  onProcessing: b,
13885
13885
  onComplete: k,
@@ -13894,32 +13894,32 @@ function XB({
13894
13894
  NA(() => {
13895
13895
  YA(!0);
13896
13896
  }, []);
13897
- const [h, a] = d("idle"), [XA, RA] = d(null), [vA, J] = d(null), [gA, kA] = d(null), [iA, BA] = d(null), [OA, gf] = d(!1), [KA, ef] = d(!1), [hA, Pf] = d(null), [ZA, df] = d(null), aA = pA(null);
13897
+ const [h, a] = d("idle"), [bA, RA] = d(null), [vA, N] = d(null), [PA, kA] = d(null), [iA, BA] = d(null), [OA, gf] = d(!1), [KA, ef] = d(!1), [hA, Pf] = d(null), [ZA, df] = d(null), jA = aA(null);
13898
13898
  NA(() => {
13899
- aA.current = ZA;
13899
+ jA.current = ZA;
13900
13900
  }, [ZA]);
13901
- const [Bf, DA] = d(null), [TA, I] = d(null), [uA, fA] = d(!1), [sA, yA] = d(!1), [Of, LA] = d(!1), [eA, Uf] = d(null), [jf, lA] = d(!1), Mf = pA(!1), [Qf, af] = d(hg), xf = JP(Qf), [_A, of] = d(xf ? "in" : "cm"), [mA, E] = d(xf ? "in" : "cm"), [y, HA] = d(xf ? "lbs" : "kg");
13901
+ const [Bf, DA] = d(null), [TA, I] = d(null), [uA, AA] = d(!1), [sA, yA] = d(!1), [Of, LA] = d(!1), [gA, Uf] = d(null), [jf, lA] = d(!1), Mf = aA(!1), [Qf, af] = d(hg), xf = JP(Qf), [_A, of] = d(xf ? "in" : "cm"), [mA, E] = d(xf ? "in" : "cm"), [y, QA] = d(xf ? "lbs" : "kg");
13902
13902
  NA(() => {
13903
13903
  const t = Lf(g);
13904
13904
  t === "foot" || t === "head" ? of("cm") : t === "face" && of("mm");
13905
13905
  }, [g]);
13906
- const Q = pA({}), [Z, FA] = d("male"), [SA, tf] = d(0), [bA, _] = d(null), [qA, W] = d(!1), [L, V] = d(() => Kf("profiles", [])), [xA, wf] = d(() => Kf("history", [])), [zA, Df] = d(() => kP()), [Af, Hf] = d(() => /* @__PURE__ */ new Set()), [WA, ff] = d(null), nf = EA((t) => {
13906
+ const Q = aA({}), [Z, FA] = d("male"), [SA, tf] = d(0), [XA, _] = d(null), [qA, W] = d(!1), [L, V] = d(() => Kf("profiles", [])), [xA, wf] = d(() => Kf("history", [])), [cA, Df] = d(() => kP()), [Af, Hf] = d(() => /* @__PURE__ */ new Set()), [WA, ff] = d(null), nf = EA((t) => {
13907
13907
  Df(t), Xg(t);
13908
- }, []), [VA, o] = d(!1), [j, U] = d(null), [R, u] = d(null), Y = pA(null), MA = pA(() => !1), CA = pA(() => {
13909
- }), JA = EA((t, p) => {
13910
- MA.current = t, CA.current = p;
13911
- }, []), X = pA(null), N = pA(null), jA = pA(null), q = pA(null), PA = pA(null), vf = pA(!1), zf = pA(null), $A = pA(null), [dA, sf] = d(null), [Cn, mf] = d(null), kf = pA(null);
13908
+ }, []), [VA, o] = d(!1), [j, U] = d(null), [R, u] = d(null), Y = aA(null), MA = aA(() => !1), HA = aA(() => {
13909
+ }), JA = EA((t, c) => {
13910
+ MA.current = t, HA.current = c;
13911
+ }, []), X = aA(null), J = aA(null), dA = aA(null), q = aA(null), nA = aA(null), vf = aA(!1), zf = aA(null), $A = aA(null), [UA, sf] = d(null), [Cn, mf] = d(null), Xf = aA(null);
13912
13912
  NA(() => {
13913
13913
  try {
13914
- const t = Zf(), p = qf(P);
13915
- N.current = new dg(t, p), jA.current = new Ug(N.current.getStreamUrl());
13914
+ const t = Zf(), c = qf(P);
13915
+ J.current = new dg(t, c), dA.current = new Ug(J.current.getStreamUrl());
13916
13916
  } catch {
13917
13917
  }
13918
13918
  return () => {
13919
- q.current?.(), jA.current?.disconnect(), PA.current && clearInterval(PA.current);
13919
+ q.current?.(), dA.current?.disconnect(), nA.current && clearInterval(nA.current);
13920
13920
  };
13921
13921
  }, [P]);
13922
- const Wf = 22, Vf = pA(0), Jf = pA(null), Yf = pA(null), An = pA(null), fn = pA(null), nn = pA(null), xn = pA(null), In = pA(""), Nf = pA(null);
13922
+ const Wf = 22, Vf = aA(0), Jf = aA(null), Yf = aA(null), An = aA(null), fn = aA(null), nn = aA(null), xn = aA(null), In = aA(""), Nf = aA(null);
13923
13923
  NA(() => {
13924
13924
  if (h === "processing") {
13925
13925
  if (Nf.current) return;
@@ -13931,22 +13931,22 @@ function XB({
13931
13931
  { at: 50, text: F("Generating virtual try-on...") },
13932
13932
  { at: 75, text: F("Refining details...") },
13933
13933
  { at: 90, text: F("Almost there...") }
13934
- ], p = 2 * Math.PI * 27;
13934
+ ], c = 2 * Math.PI * 27;
13935
13935
  return Nf.current = setInterval(() => {
13936
13936
  if (vf.current) return;
13937
- const G = xn.current || Date.now(), cA = (Date.now() - G) / 1e3, $ = Math.min(95, cA / Wf * 100);
13937
+ const G = xn.current || Date.now(), pA = (Date.now() - G) / 1e3, $ = Math.min(95, pA / Wf * 100);
13938
13938
  Vf.current = $;
13939
- const AA = Math.round($);
13940
- if (Jf.current && (Jf.current.style.width = `${AA}%`), Yf.current && (Yf.current.textContent = `${AA}%`), nn.current) {
13941
- const M = p * (1 - $ / 100);
13939
+ const eA = Math.round($);
13940
+ if (Jf.current && (Jf.current.style.width = `${eA}%`), Yf.current && (Yf.current.textContent = `${eA}%`), nn.current) {
13941
+ const M = c * (1 - $ / 100);
13942
13942
  nn.current.style.strokeDashoffset = String(M);
13943
13943
  }
13944
13944
  if (fn.current) {
13945
- const M = Math.max(0, Wf - Math.floor(cA));
13946
- fn.current.textContent = cA >= Wf ? "•••" : `~${M}s`;
13945
+ const M = Math.max(0, Wf - Math.floor(pA));
13946
+ fn.current.textContent = pA >= Wf ? "•••" : `~${M}s`;
13947
13947
  }
13948
13948
  if (An.current) {
13949
- const M = [...t].reverse().find((m) => AA >= m.at);
13949
+ const M = [...t].reverse().find((m) => eA >= m.at);
13950
13950
  if (M && M.text !== In.current) {
13951
13951
  const m = An.current;
13952
13952
  m.style.opacity = "0", setTimeout(() => {
@@ -13963,9 +13963,9 @@ function XB({
13963
13963
  vA && URL.revokeObjectURL(vA);
13964
13964
  }, [vA]), NA(() => {
13965
13965
  if (h !== "idle") {
13966
- const t = window.scrollY, p = document.body.style.overflow, G = document.body.style.overscrollBehavior;
13966
+ const t = window.scrollY, c = document.body.style.overflow, G = document.body.style.overscrollBehavior;
13967
13967
  return document.body.style.overflow = "hidden", document.body.style.overscrollBehavior = "none", () => {
13968
- document.body.style.overflow = p, document.body.style.overscrollBehavior = G, window.scrollTo(0, t);
13968
+ document.body.style.overflow = c, document.body.style.overscrollBehavior = G, window.scrollTo(0, t);
13969
13969
  };
13970
13970
  }
13971
13971
  }, [h]), NA(() => {
@@ -13981,15 +13981,15 @@ function XB({
13981
13981
  Uf({ found: !1 });
13982
13982
  return;
13983
13983
  }
13984
- if (!N.current) {
13984
+ if (!J.current) {
13985
13985
  Uf({ found: !1 });
13986
13986
  return;
13987
13987
  }
13988
13988
  lA(!0);
13989
- const t = qf(P), p = Zf();
13989
+ const t = qf(P), c = Zf();
13990
13990
  fetch(`${t}/api/v1/sizing/sizeguide`, {
13991
13991
  method: "POST",
13992
- headers: { "Content-Type": "application/json", Authorization: `Bearer ${p}` },
13992
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${c}` },
13993
13993
  body: JSON.stringify({ product: { title: g, productId: s }, sizeGuideRaw: O })
13994
13994
  }).then((G) => G.ok ? G.json() : null).then((G) => {
13995
13995
  Uf(G || { found: !1 });
@@ -14013,9 +14013,9 @@ function XB({
14013
14013
  return 1;
14014
14014
  }
14015
14015
  }, [h]), Pn = EA(
14016
- (t, p) => {
14017
- let G = zA, cA = L.find(($) => $.id === G);
14018
- if (!cA) {
14016
+ (t, c) => {
14017
+ let G = cA, pA = L.find(($) => $.id === G);
14018
+ if (!pA) {
14019
14019
  const $ = {
14020
14020
  id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
14021
14021
  name: (t.gender === "female", "My Profile"),
@@ -14033,7 +14033,7 @@ function XB({
14033
14033
  createdAt: Date.now(),
14034
14034
  lastUsedAt: Date.now()
14035
14035
  };
14036
- V((AA) => [$, ...AA]), nf($.id), G = $.id, cA = $;
14036
+ V((eA) => [$, ...eA]), nf($.id), G = $.id, pA = $;
14037
14037
  }
14038
14038
  if (Yn({
14039
14039
  apiUrl: P,
@@ -14050,31 +14050,31 @@ function XB({
14050
14050
  }).then(($) => {
14051
14051
  !$ || !G || (Gn(G, $.estimates, $.unit), V(Kf("profiles", [])));
14052
14052
  }).catch(() => {
14053
- }).finally(() => yA(!0)), p?.recommendedSize && G) {
14054
- const $ = p.sections ? Object.fromEntries(
14055
- Object.entries(p.sections).map(([AA, M]) => [AA, M.recommendedSize])
14053
+ }).finally(() => yA(!0)), c?.recommendedSize && G) {
14054
+ const $ = c.sections ? Object.fromEntries(
14055
+ Object.entries(c.sections).map(([eA, M]) => [eA, M.recommendedSize])
14056
14056
  ) : void 0;
14057
14057
  lP(G, {
14058
14058
  productId: s,
14059
14059
  productTitle: g,
14060
14060
  productImage: n,
14061
- recommendedSize: p.recommendedSize,
14062
- confidence: p.confidence,
14061
+ recommendedSize: c.recommendedSize,
14062
+ confidence: c.confidence,
14063
14063
  sections: $,
14064
14064
  savedAt: Date.now()
14065
14065
  }), V(Kf("profiles", []));
14066
14066
  }
14067
14067
  },
14068
- [zA, L, P, n, g, s, nf]
14069
- ), Rn = pA(null), [gn, On] = d(null), nP = EA(async (t) => {
14070
- const p = t.height ?? t.heightCm ?? 0, G = t.weight ?? t.weightKg ?? 0, cA = !!t.measurements && Object.keys(t.measurements).length > 0, $ = t.photoBase64;
14071
- if (!cA && $ && p > 0 && Rn.current) {
14068
+ [cA, L, P, n, g, s, nf]
14069
+ ), Rn = aA(null), [gn, On] = d(null), nP = EA(async (t) => {
14070
+ const c = t.height ?? t.heightCm ?? 0, G = t.weight ?? t.weightKg ?? 0, pA = !!t.measurements && Object.keys(t.measurements).length > 0, $ = t.photoBase64;
14071
+ if (!pA && $ && c > 0 && Rn.current) {
14072
14072
  try {
14073
- const M = $.startsWith("data:") ? $ : `data:image/jpeg;base64,${$}`, m = await fetch(M).then((UA) => UA.blob()), oA = new File([m], "profile-photo.jpg", { type: m.type || "image/jpeg" });
14073
+ const M = $.startsWith("data:") ? $ : `data:image/jpeg;base64,${$}`, m = await fetch(M).then((oA) => oA.blob()), CA = new File([m], "profile-photo.jpg", { type: m.type || "image/jpeg" });
14074
14074
  await Rn.current({
14075
- photoFile: oA,
14075
+ photoFile: CA,
14076
14076
  photoBase64: $,
14077
- height: p,
14077
+ height: c,
14078
14078
  weight: G,
14079
14079
  heightUnit: t.heightUnit || "cm",
14080
14080
  weightUnit: t.weightUnit || "kg",
@@ -14085,14 +14085,14 @@ function XB({
14085
14085
  }
14086
14086
  return;
14087
14087
  }
14088
- I(null), fA(!0), yA(cA), cA && (J(null), sf(null));
14089
- const AA = t.photoBase64;
14090
- if (AA)
14088
+ I(null), AA(!0), yA(pA), pA && (N(null), sf(null));
14089
+ const eA = t.photoBase64;
14090
+ if (eA)
14091
14091
  try {
14092
- const M = AA.startsWith("data:") ? AA : `data:image/jpeg;base64,${AA}`;
14092
+ const M = eA.startsWith("data:") ? eA : `data:image/jpeg;base64,${eA}`;
14093
14093
  fetch(M).then((m) => m.blob()).then((m) => {
14094
- const oA = new File([m], "profile-photo.jpg", { type: m.type || "image/jpeg" });
14095
- RA(oA), kf.current = oA, vA && URL.revokeObjectURL(vA), J(URL.createObjectURL(oA));
14094
+ const CA = new File([m], "profile-photo.jpg", { type: m.type || "image/jpeg" });
14095
+ RA(CA), Xf.current = CA, vA && URL.revokeObjectURL(vA), N(URL.createObjectURL(CA));
14096
14096
  }).catch(() => {
14097
14097
  });
14098
14098
  } catch {
@@ -14108,24 +14108,24 @@ function XB({
14108
14108
  }).then((M) => {
14109
14109
  M?.raw && I(M.raw), yA(!0);
14110
14110
  }).catch(() => {
14111
- }).finally(() => fA(!1));
14111
+ }).finally(() => AA(!1));
14112
14112
  }, [s, g, n, O, P, vA]), gg = EA(async () => {
14113
- const t = L.find(($) => $.id === zA);
14113
+ const t = L.find(($) => $.id === cA);
14114
14114
  if (!t) return;
14115
- const p = t.height ?? t.heightCm ?? 0, G = t.weight ?? t.weightKg ?? 0;
14116
- p > 0 && G > 0 && On(t);
14117
- }, [L, zA]), eg = EA(() => {
14115
+ const c = t.height ?? t.heightCm ?? 0, G = t.weight ?? t.weightKg ?? 0;
14116
+ c > 0 && G > 0 && On(t);
14117
+ }, [L, cA]), eg = EA(() => {
14118
14118
  if (!gn) return;
14119
14119
  const t = gn;
14120
14120
  On(null), nP(t);
14121
14121
  }, [gn, nP]), Bg = EA(() => {
14122
14122
  On(null), tf((t) => t + 1), a("body-profile");
14123
- }, []), og = pA(() => {
14123
+ }, []), og = aA(() => {
14124
14124
  }), wg = EA(() => {
14125
14125
  console.log("[ps-sdk] handleOpen fired — opening modal"), a("body-profile"), l?.();
14126
14126
  }, [l]), Sf = EA(() => {
14127
- a("idle"), RA(null), U(null), u(null), vA && URL.revokeObjectURL(vA), J(null), kA(null), BA(null), DA(null), I(null), fA(!1), _(null), W(!1), o(!1), Q.current = {}, FA("male"), yf.current = !1, q.current?.(), q.current = null, PA.current && (clearInterval(PA.current), PA.current = null), nA?.();
14128
- }, [nA, vA]), vg = EA(() => {
14127
+ a("idle"), RA(null), U(null), u(null), vA && URL.revokeObjectURL(vA), N(null), kA(null), BA(null), DA(null), I(null), AA(!1), _(null), W(!1), o(!1), Q.current = {}, FA("male"), yf.current = !1, q.current?.(), q.current = null, nA.current && (clearInterval(nA.current), nA.current = null), fA?.();
14128
+ }, [fA, vA]), vg = EA(() => {
14129
14129
  if (j) {
14130
14130
  U(null), Y.current && (a(Y.current), Y.current = null);
14131
14131
  return;
@@ -14152,7 +14152,7 @@ function XB({
14152
14152
  break;
14153
14153
  case "profiles":
14154
14154
  if (MA.current()) {
14155
- CA.current();
14155
+ HA.current();
14156
14156
  break;
14157
14157
  }
14158
14158
  a(Y.current || "body-profile"), Y.current = null;
@@ -14170,66 +14170,66 @@ function XB({
14170
14170
  BA(F("Image must be under 10MB.")), a("error"), v?.({ message: "File too large", code: "FILE_TOO_LARGE" });
14171
14171
  return;
14172
14172
  }
14173
- RA(t), kf.current = t;
14174
- const p = URL.createObjectURL(t);
14175
- J(p), r?.(t), $A.current = null, Un(p).then((G) => {
14173
+ RA(t), Xf.current = t;
14174
+ const c = URL.createObjectURL(t);
14175
+ N(c), r?.(t), $A.current = null, Un(c).then((G) => {
14176
14176
  $A.current = G;
14177
14177
  }).catch(() => {
14178
14178
  });
14179
14179
  }, [r, v]), gP = EA(() => {
14180
- RA(null), vA && URL.revokeObjectURL(vA), J(null);
14180
+ RA(null), vA && URL.revokeObjectURL(vA), N(null);
14181
14181
  }, [vA]), en = EA(() => {
14182
- PA.current && (clearInterval(PA.current), PA.current = null), q.current?.(), q.current = null;
14182
+ nA.current && (clearInterval(nA.current), nA.current = null), q.current?.(), q.current = null;
14183
14183
  }, []), sn = EA((t) => {
14184
14184
  if (t.status === "completed" && t.imageUrl) {
14185
- if (kA((p) => !p || p.startsWith("data:") || !t.imageUrl.startsWith("data:") ? t.imageUrl : p), !vf.current) {
14185
+ if (kA((c) => !c || c.startsWith("data:") || !t.imageUrl.startsWith("data:") ? t.imageUrl : c), !vf.current) {
14186
14186
  if (vf.current = !0, Vf.current = 100, Jf.current && (Jf.current.style.width = "100%"), Yf.current && (Yf.current.textContent = "100%"), nn.current && (nn.current.style.strokeDashoffset = "0"), fn.current && (fn.current.textContent = F("Done")), An.current) {
14187
- const p = An.current;
14188
- p.style.opacity = "0", setTimeout(() => {
14189
- p.textContent = F("Complete!"), p.style.opacity = "1";
14187
+ const c = An.current;
14188
+ c.style.opacity = "0", setTimeout(() => {
14189
+ c.textContent = F("Complete!"), c.style.opacity = "1";
14190
14190
  }, 180);
14191
14191
  }
14192
14192
  en(), LA(!1), k?.({ jobId: t.galleryId, imageUrl: t.imageUrl });
14193
14193
  }
14194
14194
  } else if (t.status === "failed" && !vf.current) {
14195
14195
  vf.current = !0, en(), LA(!1);
14196
- const p = t.error || F("Try-on generation failed");
14197
- BA(p), a("error"), v?.({ message: p });
14196
+ const c = t.error || F("Try-on generation failed");
14197
+ BA(c), a("error"), v?.({ message: c });
14198
14198
  }
14199
- }, [k, v, en]), hf = pf(() => eA?.found && eA.requiredFields && eA.requiredFields.length > 0 ? eA.requiredFields : Z === "female" ? Gg : Yg, [eA, Z]), Bn = EA(async (t) => {
14200
- if (!N.current) return;
14201
- const p = t || Bf, G = qf(P), cA = Zf(), $ = Lf(g);
14199
+ }, [k, v, en]), hf = pf(() => gA?.found && gA.requiredFields && gA.requiredFields.length > 0 ? gA.requiredFields : Z === "female" ? Gg : Yg, [gA, Z]), Bn = EA(async (t) => {
14200
+ if (!J.current) return;
14201
+ const c = t || Bf, G = qf(P), pA = Zf(), $ = Lf(g);
14202
14202
  if ($ === "face" || $ === "head") {
14203
14203
  const M = Q.current, m = (IA) => {
14204
14204
  if (!IA) return;
14205
14205
  const rf = parseFloat(IA);
14206
14206
  return Number.isFinite(rf) && rf > 0 ? rf : void 0;
14207
- }, oA = M.sizingUnit || _A || ($ === "head" ? "cm" : "mm"), UA = (IA) => {
14207
+ }, CA = M.sizingUnit || _A || ($ === "head" ? "cm" : "mm"), oA = (IA) => {
14208
14208
  if (IA != null)
14209
- return oA === "mm" ? IA : oA === "cm" ? IA * 10 : oA === "in" ? IA * 25.4 : IA;
14210
- }, QA = {}, Cf = {
14211
- bridgeWidth: UA(m(M.bridgeWidth)),
14212
- templeLength: UA(m(M.templeLength) ?? m(M.armLength)),
14213
- lensWidth: UA(m(M.lensWidth)),
14214
- lensHeight: UA(m(M.lensHeight)),
14215
- faceWidth: UA(m(M.faceWidth) ?? m(M.frameWidth)),
14216
- pd: UA(m(M.pd)),
14209
+ return CA === "mm" ? IA : CA === "cm" ? IA * 10 : CA === "in" ? IA * 25.4 : IA;
14210
+ }, zA = {}, Cf = {
14211
+ bridgeWidth: oA(m(M.bridgeWidth)),
14212
+ templeLength: oA(m(M.templeLength) ?? m(M.armLength)),
14213
+ lensWidth: oA(m(M.lensWidth)),
14214
+ lensHeight: oA(m(M.lensHeight)),
14215
+ faceWidth: oA(m(M.faceWidth) ?? m(M.frameWidth)),
14216
+ pd: oA(m(M.pd)),
14217
14217
  // Headwear — circumference usually typed in cm; keep as mm internally.
14218
- headCircumference: UA(m(M.headCircumference)),
14219
- headWidth: UA(m(M.headWidth))
14218
+ headCircumference: oA(m(M.headCircumference)),
14219
+ headWidth: oA(m(M.headWidth))
14220
14220
  };
14221
- for (const [IA, rf] of Object.entries(Cf)) typeof rf == "number" && (QA[IA] = rf);
14221
+ for (const [IA, rf] of Object.entries(Cf)) typeof rf == "number" && (zA[IA] = rf);
14222
14222
  const Tf = {
14223
14223
  product: { title: g, productId: e },
14224
- sizeGuide: eA?.found ? eA : { found: !1 },
14224
+ sizeGuide: gA?.found ? gA : { found: !1 },
14225
14225
  sizingUnit: $ === "head" ? "cm" : "mm",
14226
14226
  category: $,
14227
- ...Object.keys(QA).length > 0 && { faceMeasurementsMm: QA, irisConfidence: 1 }
14227
+ ...Object.keys(zA).length > 0 && { faceMeasurementsMm: zA, irisConfidence: 1 }
14228
14228
  }, cf = new Promise((IA) => setTimeout(IA, 4500));
14229
14229
  try {
14230
14230
  const IA = await fetch(`${G}/api/v1/sizing/face-recommend`, {
14231
14231
  method: "POST",
14232
- headers: { "Content-Type": "application/json", Authorization: `Bearer ${cA}` },
14232
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${pA}` },
14233
14233
  body: JSON.stringify(Tf)
14234
14234
  });
14235
14235
  if (IA.ok) {
@@ -14242,66 +14242,66 @@ function XB({
14242
14242
  } catch (IA) {
14243
14243
  console.error("[PS-SDK] face-recommend network error:", IA), await cf, BA(F("Unable to connect to sizing service. Please try again.")), a("error"), yA(!0);
14244
14244
  } finally {
14245
- fA(!1);
14245
+ AA(!1);
14246
14246
  }
14247
14247
  return;
14248
14248
  }
14249
- const AA = {
14250
- method: p,
14249
+ const eA = {
14250
+ method: c,
14251
14251
  locale: Qf,
14252
14252
  product: { title: g, productId: s, description: "", variants: [] }
14253
14253
  };
14254
- if (eA?.found && (AA.sizeGuide = eA, eA.sections && (AA.sizeGuide = { ...eA, sections: eA.sections })), AA.sizingUnit = _A, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: eA?.found, hasHeaders: !!eA?.headers, hasRows: !!eA?.rows, headers: eA?.headers, rowCount: eA?.rows?.length, hasSections: !!eA?.sections, sectionNames: eA?.sections ? Object.keys(eA.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:", p, "| sizingUnit:", _A, "| heightUnit:", mA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(Q.current)), console.log("[PS-SDK] dynamicFields:", hf.map((M) => `${M.key}(unit=${M.unit},req=${M.required})`).join(", ")), p === "exact") {
14254
+ if (gA?.found && (eA.sizeGuide = gA, gA.sections && (eA.sizeGuide = { ...gA, sections: gA.sections })), eA.sizingUnit = _A, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: gA?.found, hasHeaders: !!gA?.headers, hasRows: !!gA?.rows, headers: gA?.headers, rowCount: gA?.rows?.length, hasSections: !!gA?.sections, sectionNames: gA?.sections ? Object.keys(gA.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", eA.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", eA.sizeGuide && eA.sizeGuide.rows?.[0] ? Array.isArray(eA.sizeGuide.rows[0]) ? "array" : typeof eA.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(eA).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:", c, "| sizingUnit:", _A, "| heightUnit:", mA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(Q.current)), console.log("[PS-SDK] dynamicFields:", hf.map((M) => `${M.key}(unit=${M.unit},req=${M.required})`).join(", ")), c === "exact") {
14255
14255
  const M = { gender: Q.current.gender || "male", sizingUnit: _A }, m = /* @__PURE__ */ new Set();
14256
- for (const oA of hf)
14257
- oA.unit !== "size" && !["shoeEU", "shoeUS", "shoeUK"].includes(oA.key) && m.add(oA.key);
14258
- for (const oA of ["chest", "bust", "waist", "hips", "shoulderWidth", "sleeveLength", "inseam", "neckCircumference", "footLengthCm", "height", "length", "thighCircumference", "headCircumferenceCm", "faceWidthMm", "bridgeWidthMm", "templeLengthMm"])
14259
- Q.current[oA] && m.add(oA);
14256
+ for (const CA of hf)
14257
+ CA.unit !== "size" && !["shoeEU", "shoeUS", "shoeUK"].includes(CA.key) && m.add(CA.key);
14258
+ for (const CA of ["chest", "bust", "waist", "hips", "shoulderWidth", "sleeveLength", "inseam", "neckCircumference", "footLengthCm", "height", "length", "thighCircumference", "headCircumferenceCm", "faceWidthMm", "bridgeWidthMm", "templeLengthMm"])
14259
+ Q.current[CA] && m.add(CA);
14260
14260
  console.log("[PS-SDK] numericKeys:", [...m].join(", "));
14261
- for (const oA of m) {
14262
- const UA = Q.current[oA];
14263
- if (!UA) continue;
14264
- const QA = parseFloat(UA);
14265
- isNaN(QA) || (M[oA] = QA);
14261
+ for (const CA of m) {
14262
+ const oA = Q.current[CA];
14263
+ if (!oA) continue;
14264
+ const zA = parseFloat(oA);
14265
+ isNaN(zA) || (M[CA] = zA);
14266
14266
  }
14267
- Q.current.shoeEU && (M.shoeEU = Q.current.shoeEU), Q.current.shoeUS && (M.shoeUS = Q.current.shoeUS), Q.current.shoeUK && (M.shoeUK = Q.current.shoeUK), Q.current.fitPreference && (M.fitPreference = Q.current.fitPreference), AA.measurements = M, console.log("[PS-SDK] FINAL measurements:", JSON.stringify(M));
14267
+ Q.current.shoeEU && (M.shoeEU = Q.current.shoeEU), Q.current.shoeUS && (M.shoeUS = Q.current.shoeUS), Q.current.shoeUK && (M.shoeUK = Q.current.shoeUK), Q.current.fitPreference && (M.fitPreference = Q.current.fitPreference), eA.measurements = M, console.log("[PS-SDK] FINAL measurements:", JSON.stringify(M));
14268
14268
  } else {
14269
14269
  const M = parseFloat(Q.current.height || "0"), m = parseFloat(Q.current.weight || "0");
14270
14270
  if (!M || !m) {
14271
- console.error("[PS-SDK] submitSizing ABORT — qHeight:", M, "qWeight:", m, "formRef:", JSON.stringify(Q.current)), fA(!1);
14271
+ console.error("[PS-SDK] submitSizing ABORT — qHeight:", M, "qWeight:", m, "formRef:", JSON.stringify(Q.current)), AA(!1);
14272
14272
  return;
14273
14273
  }
14274
- const oA = {
14274
+ const CA = {
14275
14275
  height: M,
14276
14276
  weight: m,
14277
14277
  heightUnit: Q.current.heightUnit || mA || "cm",
14278
14278
  weightUnit: Q.current.weightUnit || y || "kg",
14279
14279
  gender: Q.current.gender || "male"
14280
14280
  };
14281
- Q.current.age && (oA.age = parseInt(Q.current.age, 10)), Q.current.bodyType && (oA.bodyType = Q.current.bodyType), Q.current.chestProfile && (oA.chestProfile = Q.current.chestProfile), Q.current.midsectionProfile && (oA.midsectionProfile = Q.current.midsectionProfile), Q.current.hipProfile && (oA.hipProfile = Q.current.hipProfile), AA.quickEstimate = oA;
14281
+ Q.current.age && (CA.age = parseInt(Q.current.age, 10)), Q.current.bodyType && (CA.bodyType = Q.current.bodyType), Q.current.chestProfile && (CA.chestProfile = Q.current.chestProfile), Q.current.midsectionProfile && (CA.midsectionProfile = Q.current.midsectionProfile), Q.current.hipProfile && (CA.hipProfile = Q.current.hipProfile), eA.quickEstimate = CA;
14282
14282
  }
14283
14283
  yA(!1);
14284
14284
  try {
14285
14285
  const M = await fetch(`${G}/api/v1/sizing/recommend`, {
14286
14286
  method: "POST",
14287
- headers: { "Content-Type": "application/json", Authorization: `Bearer ${cA}` },
14288
- body: JSON.stringify(AA)
14287
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${pA}` },
14288
+ body: JSON.stringify(eA)
14289
14289
  });
14290
14290
  if (M.ok) {
14291
14291
  const m = await M.json();
14292
14292
  console.log("[PS-SDK] Sizing recommend RESULT:", JSON.stringify(m)), I(m), k?.(m);
14293
- const oA = AA.measurements || {}, UA = AA.quickEstimate || {}, QA = p === "exact" ? oA : UA;
14293
+ const CA = eA.measurements || {}, oA = eA.quickEstimate || {}, zA = c === "exact" ? CA : oA;
14294
14294
  Pn(
14295
14295
  {
14296
- gender: QA.gender || "male",
14297
- height: Number(QA.height || QA.heightCm || 0),
14298
- weight: Number(QA.weight || QA.weightKg || 0),
14299
- heightUnit: QA.heightUnit || "cm",
14300
- weightUnit: QA.weightUnit || "kg",
14301
- age: QA.age != null ? Number(QA.age) : void 0,
14302
- chestProfile: QA.chestProfile,
14303
- midsectionProfile: QA.midsectionProfile,
14304
- hipProfile: QA.hipProfile
14296
+ gender: zA.gender || "male",
14297
+ height: Number(zA.height || zA.heightCm || 0),
14298
+ weight: Number(zA.weight || zA.weightKg || 0),
14299
+ heightUnit: zA.heightUnit || "cm",
14300
+ weightUnit: zA.weightUnit || "kg",
14301
+ age: zA.age != null ? Number(zA.age) : void 0,
14302
+ chestProfile: zA.chestProfile,
14303
+ midsectionProfile: zA.midsectionProfile,
14304
+ hipProfile: zA.hipProfile
14305
14305
  },
14306
14306
  m
14307
14307
  );
@@ -14312,18 +14312,18 @@ function XB({
14312
14312
  } catch (M) {
14313
14313
  console.error("[PS-SDK] Sizing recommend network error:", M), BA(F("Unable to connect to sizing service. Please try again.")), a("error"), yA(!0);
14314
14314
  } finally {
14315
- fA(!1);
14315
+ AA(!1);
14316
14316
  }
14317
- }, [P, Bf, Qf, mA, y, _A, eA, g, hf, Pn]), ig = EA(async (t, p, G, cA, $, AA, M, m, oA, UA, QA) => {
14318
- if (!N.current) {
14317
+ }, [P, Bf, Qf, mA, y, _A, gA, g, hf, Pn]), ig = EA(async (t, c, G, pA, $, eA, M, m, CA, oA, zA) => {
14318
+ if (!J.current) {
14319
14319
  const IA = F("SDK not configured. Please refresh and try again.");
14320
14320
  console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), BA(IA), a("error"), v?.({ message: IA, code: "SDK_NOT_CONFIGURED" });
14321
14321
  return;
14322
14322
  }
14323
14323
  qf(P), Zf();
14324
14324
  const Cf = /* @__PURE__ */ new Set(["weight", "weightKg", "height", "heightCm"]), Tf = /* @__PURE__ */ new Set();
14325
- if (eA?.sections) {
14326
- for (const IA of Object.values(eA.sections))
14325
+ if (gA?.sections) {
14326
+ for (const IA of Object.values(gA.sections))
14327
14327
  if (IA.requiredFields)
14328
14328
  for (const rf of IA.requiredFields)
14329
14329
  rf.required && rf.unit === "cm" && !Cf.has(rf.key) && Tf.add(rf.key);
@@ -14331,54 +14331,54 @@ function XB({
14331
14331
  for (const IA of hf)
14332
14332
  IA.required && IA.unit === "cm" && !Cf.has(IA.key) && Tf.add(IA.key);
14333
14333
  const cf = Array.from(Tf);
14334
- if (console.log("[PS-SDK] Quick estimate — dynamicFields:", hf.map((IA) => `${IA.key}(${IA.unit},req=${IA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:", cf), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: m, midsectionProfile: oA, hipProfile: UA }), cf.length === 0) {
14335
- console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), DA("quick"), fA(!0), a("size-result"), Bn("quick");
14334
+ if (console.log("[PS-SDK] Quick estimate — dynamicFields:", hf.map((IA) => `${IA.key}(${IA.unit},req=${IA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:", cf), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: m, midsectionProfile: CA, hipProfile: oA }), cf.length === 0) {
14335
+ console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), DA("quick"), AA(!0), a("size-result"), Bn("quick");
14336
14336
  return;
14337
14337
  }
14338
- Q.current.height = String(t), Q.current.weight = String(p), Q.current.heightUnit = G, Q.current.weightUnit = cA, Q.current.gender = $, AA && (Q.current.age = String(AA)), M && (Q.current.bodyType = M), m && (Q.current.chestProfile = m), oA && (Q.current.midsectionProfile = oA), UA && (Q.current.hipProfile = UA), I(null), kA(null), DA("quick"), fA(!0), a("size-result"), Bn("quick");
14339
- }, [P, hf, eA, Bn, _A, y]), Kn = EA(async (t) => {
14338
+ Q.current.height = String(t), Q.current.weight = String(c), Q.current.heightUnit = G, Q.current.weightUnit = pA, Q.current.gender = $, eA && (Q.current.age = String(eA)), M && (Q.current.bodyType = M), m && (Q.current.chestProfile = m), CA && (Q.current.midsectionProfile = CA), oA && (Q.current.hipProfile = oA), I(null), kA(null), DA("quick"), AA(!0), a("size-result"), Bn("quick");
14339
+ }, [P, hf, gA, Bn, _A, y]), Kn = EA(async (t) => {
14340
14340
  if (console.log("[ps-sdk] handleSnapSubmit fired", {
14341
- hasApiRef: !!N.current,
14342
- hasSseRef: !!jA.current,
14341
+ hasApiRef: !!J.current,
14342
+ hasSseRef: !!dA.current,
14343
14343
  apiUrl: P
14344
- }), !N.current || !jA.current) {
14345
- const UA = F("SDK not configured. Please refresh and try again.");
14346
- console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), BA(UA), a("error"), v?.({ message: UA, code: "SDK_NOT_CONFIGURED" });
14344
+ }), !J.current || !dA.current) {
14345
+ const oA = F("SDK not configured. Please refresh and try again.");
14346
+ console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), BA(oA), a("error"), v?.({ message: oA, code: "SDK_NOT_CONFIGURED" });
14347
14347
  return;
14348
14348
  }
14349
- const p = qf(P), G = Zf();
14350
- console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: p }), RA(t.photoFile), kf.current = t.photoFile;
14351
- const cA = t.photoFile ? URL.createObjectURL(t.photoFile) : t.photoBase64.startsWith("data:") ? t.photoBase64 : `data:image/jpeg;base64,${t.photoBase64}`;
14352
- J(cA), vf.current = !1, LA(!1), I(null), kA(null), fA(!0), yA(!1), a("size-result");
14349
+ const c = qf(P), G = Zf();
14350
+ console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: c }), RA(t.photoFile), Xf.current = t.photoFile;
14351
+ const pA = t.photoFile ? URL.createObjectURL(t.photoFile) : t.photoBase64.startsWith("data:") ? t.photoBase64 : `data:image/jpeg;base64,${t.photoBase64}`;
14352
+ N(pA), vf.current = !1, LA(!1), I(null), kA(null), AA(!0), yA(!1), a("size-result");
14353
14353
  const $ = Lf(g);
14354
14354
  if ($ === "face" || $ === "head") {
14355
14355
  mf(null);
14356
- const UA = new Promise((QA) => setTimeout(QA, 4500));
14356
+ const oA = new Promise((zA) => setTimeout(zA, 4500));
14357
14357
  try {
14358
- const QA = await Rg(cA);
14359
- if (!QA) {
14360
- console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product"), await UA;
14358
+ const zA = await Rg(pA);
14359
+ if (!zA) {
14360
+ console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product"), await oA;
14361
14361
  const cf = F($ === "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.");
14362
- BA(cf), a("error"), v?.({ message: cf, code: "FACE_DETECTION_FAILED" }), fA(!1);
14362
+ BA(cf), a("error"), v?.({ message: cf, code: "FACE_DETECTION_FAILED" }), AA(!1);
14363
14363
  return;
14364
14364
  }
14365
- QA && mf(QA.landmarks);
14365
+ zA && mf(zA.landmarks);
14366
14366
  const Cf = {
14367
14367
  product: { title: g, productId: s },
14368
- sizeGuide: eA ?? { found: !1 },
14368
+ sizeGuide: gA ?? { found: !1 },
14369
14369
  sizingUnit: $ === "head" ? "cm" : "mm",
14370
14370
  category: $,
14371
14371
  bodyImage: t.photoBase64
14372
14372
  };
14373
- QA && (Cf.faceMeasurementsMm = QA.measurementsMm, Cf.faceLandmarks = QA.landmarks, Cf.irisConfidence = QA.irisConfidence);
14374
- const Tf = await fetch(`${p}/api/v1/sizing/face-recommend`, {
14373
+ zA && (Cf.faceMeasurementsMm = zA.measurementsMm, Cf.faceLandmarks = zA.landmarks, Cf.irisConfidence = zA.irisConfidence);
14374
+ const Tf = await fetch(`${c}/api/v1/sizing/face-recommend`, {
14375
14375
  method: "POST",
14376
14376
  headers: { "Content-Type": "application/json", Authorization: `Bearer ${G}` },
14377
14377
  body: JSON.stringify(Cf)
14378
14378
  });
14379
14379
  if (Tf.ok) {
14380
14380
  const cf = await Tf.json();
14381
- await UA, I(cf), k?.(cf), Pn(
14381
+ await oA, I(cf), k?.(cf), Pn(
14382
14382
  {
14383
14383
  gender: t.gender,
14384
14384
  height: t.height,
@@ -14391,20 +14391,20 @@ function XB({
14391
14391
  cf
14392
14392
  );
14393
14393
  } else
14394
- await UA, yA(!0);
14395
- } catch (QA) {
14396
- console.error("[ps-sdk] face-recommend failed:", QA), await UA, yA(!0);
14394
+ await oA, yA(!0);
14395
+ } catch (zA) {
14396
+ console.error("[ps-sdk] face-recommend failed:", zA), await oA, yA(!0);
14397
14397
  }
14398
- fA(!1);
14398
+ AA(!1);
14399
14399
  return;
14400
14400
  }
14401
- $A.current = null, sf(null), Un(cA).then((UA) => ($A.current = UA, UA)).catch(() => null);
14402
- const AA = $f(cA).then((UA) => (sf(UA), UA)).catch(() => null), M = 2500, m = await Promise.race([
14403
- AA,
14404
- new Promise((UA) => setTimeout(() => UA(null), M))
14401
+ $A.current = null, sf(null), Un(pA).then((oA) => ($A.current = oA, oA)).catch(() => null);
14402
+ const eA = $f(pA).then((oA) => (sf(oA), oA)).catch(() => null), M = 2500, m = await Promise.race([
14403
+ eA,
14404
+ new Promise((oA) => setTimeout(() => oA(null), M))
14405
14405
  ]);
14406
14406
  m || console.log("[ps-sdk] landmarks not ready in", M, "ms — proceeding without them");
14407
- const oA = {
14407
+ const CA = {
14408
14408
  method: "photo",
14409
14409
  locale: Qf,
14410
14410
  sizingUnit: _A,
@@ -14424,16 +14424,16 @@ function XB({
14424
14424
  ...t.age && { age: t.age }
14425
14425
  }
14426
14426
  };
14427
- eA?.found && (oA.sizeGuide = eA);
14427
+ gA?.found && (CA.sizeGuide = gA);
14428
14428
  try {
14429
- const UA = await fetch(`${p}/api/v1/sizing/recommend`, {
14429
+ const oA = await fetch(`${c}/api/v1/sizing/recommend`, {
14430
14430
  method: "POST",
14431
14431
  headers: { "Content-Type": "application/json", Authorization: `Bearer ${G}` },
14432
- body: JSON.stringify(oA)
14432
+ body: JSON.stringify(CA)
14433
14433
  });
14434
- if (UA.ok) {
14435
- const QA = await UA.json();
14436
- I(QA), k?.(QA), Pn(
14434
+ if (oA.ok) {
14435
+ const zA = await oA.json();
14436
+ I(zA), k?.(zA), Pn(
14437
14437
  {
14438
14438
  gender: t.gender,
14439
14439
  height: t.height,
@@ -14443,153 +14443,164 @@ function XB({
14443
14443
  age: t.age,
14444
14444
  bodyImage: t.photoBase64
14445
14445
  },
14446
- QA
14446
+ zA
14447
14447
  );
14448
14448
  } else
14449
14449
  yA(!0);
14450
14450
  } catch {
14451
14451
  yA(!0);
14452
14452
  }
14453
- fA(!1);
14454
- }, [P, n, g, _A, y, Qf, eA, hf, Pn]);
14453
+ AA(!1);
14454
+ }, [P, n, g, _A, y, Qf, gA, hf, Pn]);
14455
14455
  Rn.current = Kn;
14456
14456
  const eP = EA(async (t) => {
14457
- const p = t || XA || kf.current;
14458
- if (!p || !N.current || !jA.current) {
14459
- const AA = N.current ? F("Please upload a photo first.") : F("SDK not configured. Please provide an API key.");
14460
- BA(AA), a("error"), v?.({ message: AA, code: "SDK_NOT_CONFIGURED" });
14457
+ const c = t || bA || Xf.current;
14458
+ if (!c || !J.current || !dA.current) {
14459
+ const eA = J.current ? F("Please upload a photo first.") : F("SDK not configured. Please provide an API key.");
14460
+ BA(eA), a("error"), v?.({ message: eA, code: "SDK_NOT_CONFIGURED" });
14461
14461
  return;
14462
14462
  }
14463
- t && t !== XA && (RA(t), kf.current = t), vf.current = !1, LA(!0);
14464
- const G = OP(Lf(g)), cA = G === "apparel", $ = (t ? null : vA) || URL.createObjectURL(p);
14465
- (t || !vA) && J($), $A.current = null, sf(null), cA && (Un($).then((AA) => {
14466
- $A.current = AA;
14463
+ t && t !== bA && (RA(t), Xf.current = t), vf.current = !1, LA(!0);
14464
+ const G = OP(Lf(g)), pA = G === "apparel", $ = (t ? null : vA) || URL.createObjectURL(c);
14465
+ (t || !vA) && N($), $A.current = null, sf(null), pA && (Un($).then((eA) => {
14466
+ $A.current = eA;
14467
14467
  }).catch(() => {
14468
- }), $f($).then((AA) => {
14469
- sf(AA);
14468
+ }), $f($).then((eA) => {
14469
+ sf(eA);
14470
14470
  }).catch(() => {
14471
14471
  }));
14472
14472
  try {
14473
- const AA = await tn(p), M = aA.current, m = M?.matchDetails && M.matchDetails.length ? M.matchDetails : TA?.matchDetails || [];
14474
- let oA;
14475
- cA && m.length && (oA = aP(m, $A.current));
14476
- const UA = await N.current.submitTryOn(
14477
- AA,
14473
+ const eA = await tn(c), M = jA.current, m = M?.matchDetails && M.matchDetails.length ? M.matchDetails : TA?.matchDetails || [];
14474
+ let CA;
14475
+ pA && m.length && (CA = aP(m, $A.current));
14476
+ const oA = await J.current.submitTryOn(
14477
+ eA,
14478
14478
  n,
14479
- oA,
14479
+ CA,
14480
14480
  G ?? "apparel",
14481
14481
  {
14482
14482
  productId: s,
14483
14483
  productTitle: g,
14484
- silhouetteContext: jP(TA, eA, M?.displayLabel)
14484
+ silhouetteContext: jP(TA, gA, M?.displayLabel)
14485
14485
  }
14486
14486
  );
14487
- b?.(UA.jobId), q.current = jA.current.onJob(UA.jobId, sn);
14488
- let QA = 0;
14489
- PA.current = setInterval(async () => {
14487
+ b?.(oA.jobId), q.current = dA.current.onJob(oA.jobId, sn);
14488
+ let zA = 0;
14489
+ nA.current = setInterval(async () => {
14490
14490
  if (vf.current) {
14491
- PA.current && clearInterval(PA.current), PA.current = null;
14491
+ nA.current && clearInterval(nA.current), nA.current = null;
14492
14492
  return;
14493
14493
  }
14494
- if (QA++, QA > 60) {
14495
- PA.current && clearInterval(PA.current), PA.current = null;
14494
+ if (zA++, zA > 60) {
14495
+ nA.current && clearInterval(nA.current), nA.current = null;
14496
14496
  return;
14497
14497
  }
14498
14498
  try {
14499
- const Cf = await N.current.getStatus(UA.jobId);
14500
- (Cf.status === "completed" || Cf.status === "failed") && sn({ galleryId: UA.jobId, status: Cf.status, imageUrl: Cf.imageUrl, error: Cf.status === "failed" ? Cf.message : null, timestamp: Date.now() });
14499
+ const Cf = await J.current.getStatus(oA.jobId);
14500
+ (Cf.status === "completed" || Cf.status === "failed") && sn({ galleryId: oA.jobId, status: Cf.status, imageUrl: Cf.imageUrl, error: Cf.status === "failed" ? Cf.message : null, timestamp: Date.now() });
14501
14501
  } catch {
14502
14502
  }
14503
14503
  }, 3e3);
14504
- } catch (AA) {
14505
- const M = AA instanceof Error ? AA.message : F("Failed to start try-on"), m = AA instanceof sP ? AA.code : void 0;
14504
+ } catch (eA) {
14505
+ const M = eA instanceof Error ? eA.message : F("Failed to start try-on"), m = eA instanceof sP ? eA.code : void 0;
14506
14506
  BA(M), a("error"), v?.({ message: M, code: m });
14507
14507
  }
14508
- }, [XA, n, g, TA, b, v, sn]), Tn = EA(async (t, p) => {
14509
- if (!XA || !N.current || !jA.current) return;
14510
- ef(!0);
14511
- const G = OP(Lf(g)), cA = G === "apparel";
14512
- if (cA && $A.current) {
14513
- const $ = {
14508
+ }, [bA, n, g, TA, b, v, sn]), Tn = EA(async (t, c) => {
14509
+ const G = bA || Xf.current;
14510
+ if (!G || !J.current || !dA.current) {
14511
+ console.warn("[ps-sdk:retry] skipping no file/api/sse", {
14512
+ hasFile: !!G,
14513
+ hasApi: !!J.current,
14514
+ hasSse: !!dA.current
14515
+ });
14516
+ return;
14517
+ }
14518
+ console.log("[ps-sdk:retry] starting", { fitInfoCount: t.length, selectedSizeOverride: c, fitInfo: t }), ef(!0);
14519
+ const pA = OP(Lf(g)), $ = pA === "apparel";
14520
+ if ($ && $A.current) {
14521
+ const eA = {
14514
14522
  chest: "chest",
14515
14523
  bust: "chest",
14516
14524
  waist: "waist",
14517
14525
  hips: "hips",
14518
14526
  hip: "hips"
14519
14527
  };
14520
- for (const AA of t) {
14521
- const M = $[AA.area.toLowerCase()];
14522
- if (M && $A.current[M]) {
14523
- const m = $A.current[M];
14524
- AA.y = Math.round(m.y * 1e3) / 1e3, AA.x1 = Math.round(m.x1 * 1e3) / 1e3, AA.x2 = Math.round(m.x2 * 1e3) / 1e3;
14528
+ for (const M of t) {
14529
+ const m = eA[M.area.toLowerCase()];
14530
+ if (m && $A.current[m]) {
14531
+ const CA = $A.current[m];
14532
+ M.y = Math.round(CA.y * 1e3) / 1e3, M.x1 = Math.round(CA.x1 * 1e3) / 1e3, M.x2 = Math.round(CA.x2 * 1e3) / 1e3;
14525
14533
  }
14526
14534
  }
14527
14535
  }
14528
14536
  try {
14529
- vf.current = !1, q.current?.(), PA.current && (clearInterval(PA.current), PA.current = null);
14530
- const $ = await tn(XA), AA = cA ? t : void 0, M = await N.current.submitTryOn(
14531
- $,
14537
+ vf.current = !1, q.current?.(), nA.current && (clearInterval(nA.current), nA.current = null);
14538
+ const eA = await tn(G), M = $ ? t : void 0, m = await J.current.submitTryOn(
14539
+ eA,
14532
14540
  n,
14533
- AA,
14534
- G ?? "apparel",
14541
+ M,
14542
+ pA ?? "apparel",
14535
14543
  {
14536
14544
  productId: s,
14537
14545
  productTitle: g,
14538
- silhouetteContext: jP(TA, eA, p)
14546
+ silhouetteContext: jP(TA, gA, c)
14539
14547
  }
14540
14548
  );
14541
- q.current = jA.current.onJob(M.jobId, (oA) => {
14542
- oA.status === "completed" && oA.imageUrl ? (kA(oA.imageUrl), ef(!1), vf.current = !0, q.current?.(), q.current = null, PA.current && (clearInterval(PA.current), PA.current = null)) : oA.status === "failed" && (ef(!1), vf.current = !0, q.current?.(), q.current = null, PA.current && (clearInterval(PA.current), PA.current = null));
14549
+ q.current = dA.current.onJob(m.jobId, (oA) => {
14550
+ oA.status === "completed" && oA.imageUrl ? (kA(oA.imageUrl), ef(!1), vf.current = !0, q.current?.(), q.current = null, nA.current && (clearInterval(nA.current), nA.current = null)) : oA.status === "failed" && (ef(!1), vf.current = !0, q.current?.(), q.current = null, nA.current && (clearInterval(nA.current), nA.current = null));
14543
14551
  });
14544
- let m = 0;
14545
- PA.current = setInterval(async () => {
14552
+ let CA = 0;
14553
+ nA.current = setInterval(async () => {
14546
14554
  if (vf.current) {
14547
- PA.current && clearInterval(PA.current), PA.current = null;
14555
+ nA.current && clearInterval(nA.current), nA.current = null;
14548
14556
  return;
14549
14557
  }
14550
- if (m++, m > 60) {
14551
- PA.current && clearInterval(PA.current), PA.current = null, ef(!1);
14558
+ if (CA++, CA > 60) {
14559
+ nA.current && clearInterval(nA.current), nA.current = null, ef(!1);
14552
14560
  return;
14553
14561
  }
14554
14562
  try {
14555
- const oA = await N.current.getStatus(M.jobId);
14556
- oA.status === "completed" && oA.imageUrl ? (vf.current || (vf.current = !0, kA(oA.imageUrl), ef(!1), q.current?.(), q.current = null), PA.current && (clearInterval(PA.current), PA.current = null)) : oA.status === "failed" && (vf.current = !0, ef(!1), PA.current && (clearInterval(PA.current), PA.current = null));
14563
+ const oA = await J.current.getStatus(m.jobId);
14564
+ oA.status === "completed" && oA.imageUrl ? (vf.current || (vf.current = !0, kA(oA.imageUrl), ef(!1), q.current?.(), q.current = null), nA.current && (clearInterval(nA.current), nA.current = null)) : oA.status === "failed" && (vf.current = !0, ef(!1), nA.current && (clearInterval(nA.current), nA.current = null));
14557
14565
  } catch {
14558
14566
  }
14559
14567
  }, 3e3);
14560
14568
  } catch {
14561
14569
  ef(!1);
14562
14570
  }
14563
- }, [XA, n, g]), Dg = EA((t) => {
14564
- df(t);
14565
- const p = t.matchDetails || [];
14566
- if (!p.length) return;
14567
- const G = aP(p, $A.current);
14568
- Tn(G, t.displayLabel);
14569
- }, [Tn]), rg = EA(() => {
14570
- if (gA)
14571
- if (gA.startsWith("data:")) {
14571
+ }, [bA, n, g]), Dg = EA((t) => {
14572
+ console.log("[ps-sdk:regen] fired", { override: t, hasFile: !!bA, hasRefFile: !!Xf.current }), df(t);
14573
+ const c = t.matchDetails || [];
14574
+ if (!c.length) {
14575
+ console.warn("[ps-sdk:regen] no matchDetails in override — cannot rebuild fitInfo");
14576
+ return;
14577
+ }
14578
+ const G = aP(c, $A.current);
14579
+ console.log("[ps-sdk:regen] fitInfo built", { fitInfo: G, label: t.displayLabel }), Tn(G, t.displayLabel);
14580
+ }, [Tn, bA]), rg = EA(() => {
14581
+ if (PA)
14582
+ if (PA.startsWith("data:")) {
14572
14583
  const t = document.createElement("a");
14573
- t.href = gA, t.download = `primestyle-tryon-${Date.now()}.png`, t.click();
14584
+ t.href = PA, t.download = `primestyle-tryon-${Date.now()}.png`, t.click();
14574
14585
  } else
14575
- fetch(gA).then((t) => t.blob()).then((t) => {
14576
- const p = URL.createObjectURL(t), G = document.createElement("a");
14577
- G.href = p, G.download = `primestyle-tryon-${Date.now()}.png`, G.click(), setTimeout(() => URL.revokeObjectURL(p), 100);
14578
- }).catch(() => window.open(gA, "_blank"));
14579
- }, [gA]), Cg = EA(() => {
14580
- vf.current = !1, en(), RA(null), vA && URL.revokeObjectURL(vA), J(null), kA(null), BA(null), DA(null), I(null), fA(!1), o(!1), a("body-profile");
14586
+ fetch(PA).then((t) => t.blob()).then((t) => {
14587
+ const c = URL.createObjectURL(t), G = document.createElement("a");
14588
+ G.href = c, G.download = `primestyle-tryon-${Date.now()}.png`, G.click(), setTimeout(() => URL.revokeObjectURL(c), 100);
14589
+ }).catch(() => window.open(PA, "_blank"));
14590
+ }, [PA]), Cg = EA(() => {
14591
+ vf.current = !1, en(), RA(null), vA && URL.revokeObjectURL(vA), N(null), kA(null), BA(null), DA(null), I(null), AA(!1), o(!1), a("body-profile");
14581
14592
  }, [vA, en]), Hg = EA((t) => {
14582
- const p = L.find((cA) => cA.id === t);
14583
- if (!p) return;
14584
- nf(t), V((cA) => cA.map(($) => $.id === t ? { ...$, lastUsedAt: Date.now() } : $));
14585
- const G = { gender: p.gender || "male" };
14586
- if ((p.height ?? p.heightCm) && (G.height = String(p.height ?? p.heightCm)), (p.weight ?? p.weightKg) && (G.weight = String(p.weight ?? p.weightKg)), p.chest && (G.chest = String(p.chest)), p.bust && (G.bust = String(p.bust)), p.waist && (G.waist = String(p.waist)), p.hips && (G.hips = String(p.hips)), p.shoulderWidth && (G.shoulderWidth = String(p.shoulderWidth)), p.sleeveLength && (G.sleeveLength = String(p.sleeveLength)), p.inseam && (G.inseam = String(p.inseam)), p.neckCircumference && (G.neckCircumference = String(p.neckCircumference)), p.footLengthCm && (G.footLengthCm = String(p.footLengthCm)), p.shoeEU && (G.shoeEU = p.shoeEU), p.shoeUS && (G.shoeUS = p.shoeUS), p.shoeUK && (G.shoeUK = p.shoeUK), p.fitPreference && (G.fitPreference = p.fitPreference), p.customMeasurements)
14587
- for (const [cA, $] of Object.entries(p.customMeasurements))
14588
- G[cA] = String($);
14589
- Q.current = G, FA(G.gender || "male"), p.country && af(p.country), p.sizingUnit && of(p.sizingUnit), p.heightUnit && E(p.heightUnit), p.weightUnit && HA(p.weightUnit), tf((cA) => cA + 1);
14593
+ const c = L.find((pA) => pA.id === t);
14594
+ if (!c) return;
14595
+ nf(t), V((pA) => pA.map(($) => $.id === t ? { ...$, lastUsedAt: Date.now() } : $));
14596
+ const G = { gender: c.gender || "male" };
14597
+ if ((c.height ?? c.heightCm) && (G.height = String(c.height ?? c.heightCm)), (c.weight ?? c.weightKg) && (G.weight = String(c.weight ?? c.weightKg)), c.chest && (G.chest = String(c.chest)), c.bust && (G.bust = String(c.bust)), c.waist && (G.waist = String(c.waist)), c.hips && (G.hips = String(c.hips)), c.shoulderWidth && (G.shoulderWidth = String(c.shoulderWidth)), c.sleeveLength && (G.sleeveLength = String(c.sleeveLength)), c.inseam && (G.inseam = String(c.inseam)), c.neckCircumference && (G.neckCircumference = String(c.neckCircumference)), c.footLengthCm && (G.footLengthCm = String(c.footLengthCm)), c.shoeEU && (G.shoeEU = c.shoeEU), c.shoeUS && (G.shoeUS = c.shoeUS), c.shoeUK && (G.shoeUK = c.shoeUK), c.fitPreference && (G.fitPreference = c.fitPreference), c.customMeasurements)
14598
+ for (const [pA, $] of Object.entries(c.customMeasurements))
14599
+ G[pA] = String($);
14600
+ Q.current = G, FA(G.gender || "male"), c.country && af(c.country), c.sizingUnit && of(c.sizingUnit), c.heightUnit && E(c.heightUnit), c.weightUnit && QA(c.weightUnit), tf((pA) => pA + 1);
14590
14601
  }, [L]);
14591
- og.current = Hg, EA((t, p) => {
14592
- const G = (p ? null : zA) || `p_${Date.now()}`, cA = {
14602
+ og.current = Hg, EA((t, c) => {
14603
+ const G = (c ? null : cA) || `p_${Date.now()}`, pA = {
14593
14604
  id: G,
14594
14605
  name: t,
14595
14606
  gender: Q.current.gender || "male",
@@ -14632,49 +14643,49 @@ function XB({
14632
14643
  "weight",
14633
14644
  "heightFeet",
14634
14645
  "heightInches"
14635
- ]), AA = {};
14646
+ ]), eA = {};
14636
14647
  for (const [M, m] of Object.entries(Q.current))
14637
- !$.has(M) && m && !isNaN(Number(m)) && (AA[M] = parseFloat(m));
14638
- Object.keys(AA).length > 0 && (cA.customMeasurements = AA), V((M) => {
14639
- const m = M.findIndex((oA) => oA.id === G);
14648
+ !$.has(M) && m && !isNaN(Number(m)) && (eA[M] = parseFloat(m));
14649
+ Object.keys(eA).length > 0 && (pA.customMeasurements = eA), V((M) => {
14650
+ const m = M.findIndex((CA) => CA.id === G);
14640
14651
  if (m >= 0) {
14641
- const oA = [...M];
14642
- return oA[m] = cA, oA;
14652
+ const CA = [...M];
14653
+ return CA[m] = pA, CA;
14643
14654
  }
14644
- return [...M, cA].slice(-50);
14655
+ return [...M, pA].slice(-50);
14645
14656
  }), nf(G), o(!0);
14646
- }, [zA, Qf, _A, mA, y]);
14657
+ }, [cA, Qf, _A, mA, y]);
14647
14658
  const BP = EA(() => {
14648
14659
  const t = {
14649
14660
  id: `h_${Date.now()}`,
14650
14661
  productTitle: g,
14651
14662
  productImage: n,
14652
- resultImageUrl: gA || void 0,
14663
+ resultImageUrl: PA || void 0,
14653
14664
  recommendedSize: TA?.recommendedSize,
14654
14665
  confidence: TA?.confidence,
14655
14666
  reasoning: TA?.reasoning,
14656
14667
  internationalSizes: TA?.internationalSizes,
14657
14668
  matchDetails: TA?.matchDetails,
14658
14669
  sizingResult: TA || void 0,
14659
- sizeGuide: eA ? {
14660
- found: eA.found,
14661
- title: eA.title,
14662
- headers: eA.headers,
14663
- rows: eA.rows,
14664
- sections: eA.sections,
14665
- sectionImages: eA.sectionImages
14670
+ sizeGuide: gA ? {
14671
+ found: gA.found,
14672
+ title: gA.title,
14673
+ headers: gA.headers,
14674
+ rows: gA.rows,
14675
+ sections: gA.sections,
14676
+ sectionImages: gA.sectionImages
14666
14677
  } : void 0,
14667
14678
  date: Date.now()
14668
14679
  };
14669
- if (zA) {
14670
- const p = L.find((G) => G.id === zA);
14671
- p && (t.profileName = p.name);
14680
+ if (cA) {
14681
+ const c = L.find((G) => G.id === cA);
14682
+ c && (t.profileName = c.name);
14672
14683
  }
14673
- wf((p) => [t, ...p].slice(0, 50));
14674
- }, [g, n, gA, TA, eA, zA, L]), yf = pA(!1), Hn = pA(!1);
14684
+ wf((c) => [t, ...c].slice(0, 50));
14685
+ }, [g, n, PA, TA, gA, cA, L]), yf = aA(!1), Hn = aA(!1);
14675
14686
  NA(() => {
14676
- h === "size-result" && TA && !yf.current ? (yf.current = !0, Hn.current = !1, BP()) : h === "size-result" && TA && gA && !Hn.current ? (Hn.current = !0, wf((t) => t.length === 0 ? t : [{ ...t[0], resultImageUrl: gA }, ...t.slice(1)])) : h === "result" && gA && !yf.current ? (yf.current = !0, BP()) : (h === "welcome" || h === "body-profile") && (yf.current = !1, Hn.current = !1);
14677
- }, [h, TA, gA]);
14687
+ h === "size-result" && TA && !yf.current ? (yf.current = !0, Hn.current = !1, BP()) : h === "size-result" && TA && PA && !Hn.current ? (Hn.current = !0, wf((t) => t.length === 0 ? t : [{ ...t[0], resultImageUrl: PA }, ...t.slice(1)])) : h === "result" && PA && !yf.current ? (yf.current = !0, BP()) : (h === "welcome" || h === "body-profile") && (yf.current = !1, Hn.current = !1);
14688
+ }, [h, TA, PA]);
14678
14689
  const Qg = EA((t) => {
14679
14690
  yf.current = !0, t.sizingResult ? I(t.sizingResult) : t.recommendedSize && I({
14680
14691
  recommendedSize: t.recommendedSize,
@@ -14682,17 +14693,17 @@ function XB({
14682
14693
  reasoning: t.reasoning || "",
14683
14694
  internationalSizes: t.internationalSizes,
14684
14695
  matchDetails: t.matchDetails
14685
- }), t.sizeGuide && (Uf(t.sizeGuide), lA(!1)), kA(t.resultImageUrl || null), fA(!1), LA(!1), Pf(null), U(null), a("size-result");
14686
- }, []), zg = EA((t, p) => {
14687
- Q.current[t] = p;
14696
+ }), t.sizeGuide && (Uf(t.sizeGuide), lA(!1)), kA(t.resultImageUrl || null), AA(!1), LA(!1), Pf(null), U(null), a("size-result");
14697
+ }, []), zg = EA((t, c) => {
14698
+ Q.current[t] = c;
14688
14699
  }, []);
14689
14700
  pf(() => {
14690
- const p = {
14701
+ const c = {
14691
14702
  US: { key: "shoeUS", labelKey: "Shoe size (US)", ph: "e.g. 10" },
14692
14703
  UK: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" },
14693
14704
  AU: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" }
14694
14705
  }[Qf] || { key: "shoeEU", labelKey: "Shoe size (EU)", ph: "e.g. 43" };
14695
- return { key: p.key, label: F(p.labelKey), ph: p.ph };
14706
+ return { key: c.key, label: F(c.labelKey), ph: c.ph };
14696
14707
  }, [Qf, F]);
14697
14708
  const cg = {
14698
14709
  "--ps-btn-bg": H.backgroundColor,
@@ -14710,51 +14721,51 @@ function XB({
14710
14721
  "--ps-btn-icon-size": H.iconSize,
14711
14722
  "--ps-btn-icon-color": H.iconColor,
14712
14723
  "--ps-btn-shadow": H.boxShadow,
14713
- "--ps-modal-overlay": c.overlayColor,
14714
- "--ps-modal-bg": c.backgroundColor,
14715
- "--ps-modal-color": c.textColor,
14716
- "--ps-modal-radius": c.borderRadius,
14717
- "--ps-modal-width": c.width,
14718
- "--ps-modal-max-width": c.maxWidth,
14719
- "--ps-modal-font": c.fontFamily,
14720
- "--ps-modal-header-bg": c.headerBackgroundColor,
14721
- "--ps-modal-header-color": c.headerTextColor,
14722
- "--ps-modal-close-color": c.closeButtonColor,
14723
- "--ps-upload-border": c.uploadBorderColor,
14724
- "--ps-upload-bg": c.uploadBackgroundColor,
14725
- "--ps-upload-color": c.uploadTextColor,
14726
- "--ps-upload-icon-color": c.uploadIconColor,
14727
- "--ps-modal-primary-bg": c.primaryButtonBackgroundColor,
14728
- "--ps-modal-primary-color": c.primaryButtonTextColor,
14729
- "--ps-modal-primary-radius": c.primaryButtonBorderRadius,
14730
- "--ps-loader": c.loaderColor,
14731
- "--ps-result-radius": c.resultBorderRadius,
14724
+ "--ps-modal-overlay": p.overlayColor,
14725
+ "--ps-modal-bg": p.backgroundColor,
14726
+ "--ps-modal-color": p.textColor,
14727
+ "--ps-modal-radius": p.borderRadius,
14728
+ "--ps-modal-width": p.width,
14729
+ "--ps-modal-max-width": p.maxWidth,
14730
+ "--ps-modal-font": p.fontFamily,
14731
+ "--ps-modal-header-bg": p.headerBackgroundColor,
14732
+ "--ps-modal-header-color": p.headerTextColor,
14733
+ "--ps-modal-close-color": p.closeButtonColor,
14734
+ "--ps-upload-border": p.uploadBorderColor,
14735
+ "--ps-upload-bg": p.uploadBackgroundColor,
14736
+ "--ps-upload-color": p.uploadTextColor,
14737
+ "--ps-upload-icon-color": p.uploadIconColor,
14738
+ "--ps-modal-primary-bg": p.primaryButtonBackgroundColor,
14739
+ "--ps-modal-primary-color": p.primaryButtonTextColor,
14740
+ "--ps-modal-primary-radius": p.primaryButtonBorderRadius,
14741
+ "--ps-loader": p.loaderColor,
14742
+ "--ps-result-radius": p.resultBorderRadius,
14732
14743
  // New theming variables.
14733
14744
  // accentColor falls back to the trigger button background so the user's
14734
14745
  // brand color cascades to the modal automatically without having to pass
14735
14746
  // both buttonStyles AND modalStyles. Most consumers only set buttonStyles.
14736
- "--ps-accent": c.accentColor ?? H.backgroundColor,
14737
- "--ps-accent-hover": c.accentHoverColor ?? H.hoverBackgroundColor,
14738
- "--ps-accent-light": c.accentLightColor,
14739
- "--ps-text-primary": c.textPrimaryColor,
14740
- "--ps-text-secondary": c.textSecondaryColor,
14741
- "--ps-text-muted": c.textMutedColor,
14742
- "--ps-border-color": c.borderColor,
14743
- "--ps-bg-secondary": c.secondaryBackgroundColor,
14744
- "--ps-error-color": c.errorColor,
14745
- "--ps-success-color": c.successColor,
14746
- "--ps-logo-height": c.logoHeight
14747
+ "--ps-accent": p.accentColor ?? H.backgroundColor,
14748
+ "--ps-accent-hover": p.accentHoverColor ?? H.hoverBackgroundColor,
14749
+ "--ps-accent-light": p.accentLightColor,
14750
+ "--ps-text-primary": p.textPrimaryColor,
14751
+ "--ps-text-secondary": p.textSecondaryColor,
14752
+ "--ps-text-muted": p.textMutedColor,
14753
+ "--ps-border-color": p.borderColor,
14754
+ "--ps-bg-secondary": p.secondaryBackgroundColor,
14755
+ "--ps-error-color": p.errorColor,
14756
+ "--ps-success-color": p.successColor,
14757
+ "--ps-logo-height": p.logoHeight
14747
14758
  }, oP = Object.fromEntries(Object.entries(cg).filter(([, t]) => t !== void 0));
14748
14759
  function pg() {
14749
14760
  switch (h) {
14750
14761
  case "welcome":
14751
14762
  return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(ve, { productImage: n, setView: a, t: F }) }, "v-welcome");
14752
14763
  case "body-profile": {
14753
- const t = Lf(g), p = { productImage: n, productTitle: g, formRef: Q, sizingUnit: _A, setSizingUnit: of, setSizingMethod: DA, setSizingLoading: fA, setView: a, submitSizing: Bn, onSnapSubmit: Kn, onBack: Sf, sizeGuide: eA, t: F };
14754
- if (t === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(RB, { ...p }) }, "v-foot");
14755
- if (t === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(KB, { ...p }) }, "v-head");
14756
- if (t === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(bB, { ...p }) }, "v-face");
14757
- const G = !!(eA?.requiredFields?.some((M) => M.key === "bust") || eA?.sections && Object.values(eA.sections).some((M) => M.requiredFields?.some((m) => m.key === "bust"))), cA = g.toLowerCase(), $ = /\b(women|woman|ladies|female|dress|skirt|blouse|bra)\b/i.test(cA);
14764
+ const t = Lf(g), c = { productImage: n, productTitle: g, formRef: Q, sizingUnit: _A, setSizingUnit: of, setSizingMethod: DA, setSizingLoading: AA, setView: a, submitSizing: Bn, onSnapSubmit: Kn, onBack: Sf, sizeGuide: gA, t: F };
14765
+ if (t === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(RB, { ...c }) }, "v-foot");
14766
+ if (t === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(KB, { ...c }) }, "v-head");
14767
+ if (t === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(bB, { ...c }) }, "v-face");
14768
+ const G = !!(gA?.requiredFields?.some((M) => M.key === "bust") || gA?.sections && Object.values(gA.sections).some((M) => M.requiredFields?.some((m) => m.key === "bust"))), pA = g.toLowerCase(), $ = /\b(women|woman|ladies|female|dress|skirt|blouse|bra)\b/i.test(pA);
14758
14769
  return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
14759
14770
  MB,
14760
14771
  {
@@ -14766,18 +14777,18 @@ function XB({
14766
14777
  heightUnit: mA,
14767
14778
  setHeightUnit: E,
14768
14779
  weightUnit: y,
14769
- setWeightUnit: HA,
14780
+ setWeightUnit: QA,
14770
14781
  sizingUnit: _A,
14771
14782
  setSizingUnit: of,
14772
14783
  hasActiveProfileWithMeasurements: (() => {
14773
- const M = L.find((UA) => UA.id === zA);
14784
+ const M = L.find((oA) => oA.id === cA);
14774
14785
  if (!M) return !1;
14775
- const m = M.height ?? M.heightCm ?? 0, oA = M.weight ?? M.weightKg ?? 0;
14776
- return m > 0 && oA > 0;
14786
+ const m = M.height ?? M.heightCm ?? 0, CA = M.weight ?? M.weightKg ?? 0;
14787
+ return m > 0 && CA > 0;
14777
14788
  })(),
14778
14789
  onUseActiveProfile: gg,
14779
- activeProfileName: L.find((m) => m.id === zA)?.name || null,
14780
- activeProfile: L.find((M) => M.id === zA) || null,
14790
+ activeProfileName: L.find((m) => m.id === cA)?.name || null,
14791
+ activeProfile: L.find((M) => M.id === cA) || null,
14781
14792
  onStartFresh: () => {
14782
14793
  nf(null), Q.current = {};
14783
14794
  },
@@ -14800,7 +14811,7 @@ function XB({
14800
14811
  onBack: Sf,
14801
14812
  t: F
14802
14813
  },
14803
- `bp-${zA || "anon"}`
14814
+ `bp-${cA || "anon"}`
14804
14815
  ) }, "v-bodyprofile");
14805
14816
  }
14806
14817
  case "estimation-review":
@@ -14809,7 +14820,7 @@ function XB({
14809
14820
  {
14810
14821
  productImage: n,
14811
14822
  productTitle: g,
14812
- estimatedValues: bA,
14823
+ estimatedValues: XA,
14813
14824
  estimationLoading: qA,
14814
14825
  dynamicFields: hf,
14815
14826
  formRef: Q,
@@ -14820,7 +14831,7 @@ function XB({
14820
14831
  setSizingUnit: of,
14821
14832
  updateField: zg,
14822
14833
  setSizingMethod: DA,
14823
- setSizingLoading: fA,
14834
+ setSizingLoading: AA,
14824
14835
  setView: a,
14825
14836
  submitSizing: Bn,
14826
14837
  t: F
@@ -14833,8 +14844,8 @@ function XB({
14833
14844
  estimationDone: sA,
14834
14845
  sizingLoading: uA,
14835
14846
  sizingResult: TA,
14836
- sizeGuide: eA,
14837
- resultImageUrl: gA,
14847
+ sizeGuide: gA,
14848
+ resultImageUrl: PA,
14838
14849
  productImage: n,
14839
14850
  productTitle: g,
14840
14851
  sizingUnit: _A,
@@ -14842,13 +14853,13 @@ function XB({
14842
14853
  handleDownload: rg,
14843
14854
  onRetryWithFit: Tn,
14844
14855
  retryLoading: KA,
14845
- selectedFile: XA,
14856
+ selectedFile: bA,
14846
14857
  previewUrl: vA,
14847
14858
  handleFileSelect: PP,
14848
14859
  handleRemovePreview: gP,
14849
14860
  handleTryOnSubmit: eP,
14850
14861
  tryOnProcessing: Of,
14851
- bodyLandmarks: dA,
14862
+ bodyLandmarks: UA,
14852
14863
  faceLandmarks: Cn,
14853
14864
  measurementType: Lf(g),
14854
14865
  activeSection: hA,
@@ -14857,16 +14868,16 @@ function XB({
14857
14868
  onPendingCustomSizeChange: df,
14858
14869
  onRegenerateTryOn: Dg,
14859
14870
  onResetTryOn: () => {
14860
- RA(null), vA && URL.revokeObjectURL(vA), J(null), kA(null);
14871
+ RA(null), vA && URL.revokeObjectURL(vA), N(null), kA(null);
14861
14872
  },
14862
14873
  onClose: Sf,
14863
14874
  userHeightCm: (() => {
14864
- const t = L.find(($) => $.id === zA);
14875
+ const t = L.find(($) => $.id === cA);
14865
14876
  if (!t) return;
14866
- const p = t.height ?? t.heightCm;
14867
- if (!p || p <= 0) return;
14868
- const G = t.heightUnit, cA = TA?.unit || _A;
14869
- return (G === "in" || G === "ft") && cA !== "in" ? Math.round(p * 2.54) : (!G || G === "cm") && cA === "in" ? Math.round(p / 2.54 * 10) / 10 : p;
14877
+ const c = t.height ?? t.heightCm;
14878
+ if (!c || c <= 0) return;
14879
+ const G = t.heightUnit, pA = TA?.unit || _A;
14880
+ return (G === "in" || G === "ft") && pA !== "in" ? Math.round(c * 2.54) : (!G || G === "cm") && pA === "in" ? Math.round(c / 2.54 * 10) / 10 : c;
14870
14881
  })(),
14871
14882
  t: F
14872
14883
  }
@@ -14875,7 +14886,7 @@ function XB({
14875
14886
  return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
14876
14887
  se,
14877
14888
  {
14878
- selectedFile: XA,
14889
+ selectedFile: bA,
14879
14890
  previewUrl: vA,
14880
14891
  dragOver: OA,
14881
14892
  setDragOver: gf,
@@ -14909,30 +14920,30 @@ function XB({
14909
14920
  iB,
14910
14921
  {
14911
14922
  profiles: L,
14912
- activeProfileId: zA,
14923
+ activeProfileId: cA,
14913
14924
  estimatingProfileIds: Af,
14914
14925
  onSelectProfile: (t) => {
14915
14926
  nf(t), a("body-profile");
14916
14927
  },
14917
- onSaveProfileMeasurements: (t, p, G) => {
14918
- Gn(t, p, G ?? L.find((cA) => cA.id === t)?.measurementsUnit ?? "cm"), V(Kf("profiles", []));
14928
+ onSaveProfileMeasurements: (t, c, G) => {
14929
+ Gn(t, c, G ?? L.find((pA) => pA.id === t)?.measurementsUnit ?? "cm"), V(Kf("profiles", []));
14919
14930
  },
14920
- onSaveBraSize: (t, p, G) => {
14921
- hP(t, { bandSize: p, cupSize: G }), V(Kf("profiles", []));
14931
+ onSaveBraSize: (t, c, G) => {
14932
+ hP(t, { bandSize: c, cupSize: G }), V(Kf("profiles", []));
14922
14933
  },
14923
14934
  onEditProfile: (t) => {
14924
14935
  u(t);
14925
14936
  },
14926
14937
  onPhotoPreview: (t) => {
14927
14938
  if (t) {
14928
- const p = t.startsWith("data:") ? t : `data:image/jpeg;base64,${t}`;
14929
- J(p);
14939
+ const c = t.startsWith("data:") ? t : `data:image/jpeg;base64,${t}`;
14940
+ N(c);
14930
14941
  } else
14931
- J(null);
14942
+ N(null);
14932
14943
  },
14933
14944
  onEstimateFromPhoto: async (t) => {
14934
14945
  try {
14935
- const p = await $f(t.photoBase64).catch(() => null), G = await Yn({
14946
+ const c = await $f(t.photoBase64).catch(() => null), G = await Yn({
14936
14947
  apiUrl: P,
14937
14948
  height: t.height > 0 ? t.height : void 0,
14938
14949
  weight: t.weight > 0 ? t.weight : void 0,
@@ -14941,7 +14952,7 @@ function XB({
14941
14952
  gender: t.gender,
14942
14953
  age: t.age,
14943
14954
  bodyImage: t.photoBase64,
14944
- bodyLandmarks: p ?? void 0
14955
+ bodyLandmarks: c ?? void 0
14945
14956
  });
14946
14957
  return G ? { estimates: G.estimates, unit: G.unit } : null;
14947
14958
  } catch {
@@ -14949,33 +14960,33 @@ function XB({
14949
14960
  }
14950
14961
  },
14951
14962
  onSaveNewProfile: async (t) => {
14952
- const p = {
14963
+ const c = {
14953
14964
  ...t,
14954
14965
  id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
14955
14966
  createdAt: Date.now(),
14956
14967
  lastUsedAt: Date.now()
14957
- }, G = [p, ...L];
14958
- lf("profiles", G), V(G), nf(p.id);
14959
- const cA = p.heightCm || p.height || 0, $ = p.weightKg || p.weight || 0, AA = p.sizingUnit === "in" ? "in" : "cm", M = p.sizingUnit === "in" ? "lbs" : "kg", m = p.photoBase64;
14960
- !(!!p.measurements && Object.keys(p.measurements).length > 0) && (m || cA > 0 && $ > 0) && (Hf((QA) => new Set(QA).add(p.id)), (m ? $f(m).catch(() => null) : Promise.resolve(null)).then((QA) => Yn({
14968
+ }, G = [c, ...L];
14969
+ lf("profiles", G), V(G), nf(c.id);
14970
+ const pA = c.heightCm || c.height || 0, $ = c.weightKg || c.weight || 0, eA = c.sizingUnit === "in" ? "in" : "cm", M = c.sizingUnit === "in" ? "lbs" : "kg", m = c.photoBase64;
14971
+ !(!!c.measurements && Object.keys(c.measurements).length > 0) && (m || pA > 0 && $ > 0) && (Hf((zA) => new Set(zA).add(c.id)), (m ? $f(m).catch(() => null) : Promise.resolve(null)).then((zA) => Yn({
14961
14972
  apiUrl: P,
14962
- height: cA > 0 ? cA : void 0,
14973
+ height: pA > 0 ? pA : void 0,
14963
14974
  weight: $ > 0 ? $ : void 0,
14964
- heightUnit: AA,
14975
+ heightUnit: eA,
14965
14976
  weightUnit: M,
14966
- gender: p.gender,
14967
- age: p.age,
14968
- chestProfile: p.chestProfile,
14969
- midsectionProfile: p.midsectionProfile,
14970
- hipProfile: p.hipProfile,
14977
+ gender: c.gender,
14978
+ age: c.age,
14979
+ chestProfile: c.chestProfile,
14980
+ midsectionProfile: c.midsectionProfile,
14981
+ hipProfile: c.hipProfile,
14971
14982
  bodyImage: m,
14972
- bodyLandmarks: QA ?? void 0
14973
- })).then((QA) => {
14974
- if (QA) {
14975
- if (Gn(p.id, QA.estimates, QA.unit), QA.userEstimates) {
14976
- const Cf = Kf("profiles", []), Tf = Cf.findIndex((cf) => cf.id === p.id);
14983
+ bodyLandmarks: zA ?? void 0
14984
+ })).then((zA) => {
14985
+ if (zA) {
14986
+ if (Gn(c.id, zA.estimates, zA.unit), zA.userEstimates) {
14987
+ const Cf = Kf("profiles", []), Tf = Cf.findIndex((cf) => cf.id === c.id);
14977
14988
  if (Tf >= 0) {
14978
- const cf = Cf[Tf], IA = QA.userEstimates, rf = { ...cf };
14989
+ const cf = Cf[Tf], IA = zA.userEstimates, rf = { ...cf };
14979
14990
  IA.height && !(cf.height || cf.heightCm) && (rf.height = IA.height, rf.heightCm = IA.height, rf.heightUnit = "cm"), IA.weight && !(cf.weight || cf.weightKg) && (rf.weight = IA.weight, rf.weightKg = IA.weight, rf.weightUnit = "kg"), IA.age && !cf.age && (rf.age = IA.age), Cf[Tf] = rf, lf("profiles", Cf);
14980
14991
  }
14981
14992
  }
@@ -14983,14 +14994,14 @@ function XB({
14983
14994
  }
14984
14995
  }).catch(() => {
14985
14996
  }).finally(() => {
14986
- Hf((QA) => {
14987
- const Cf = new Set(QA);
14988
- return Cf.delete(p.id), Cf;
14997
+ Hf((zA) => {
14998
+ const Cf = new Set(zA);
14999
+ return Cf.delete(c.id), Cf;
14989
15000
  });
14990
15001
  }));
14991
15002
  },
14992
15003
  onDeleteProfile: (t) => {
14993
- V((p) => p.filter((G) => G.id !== t)), zA === t && nf(null), lf("profiles", Kf("profiles", []).filter((p) => p.id !== t));
15004
+ V((c) => c.filter((G) => G.id !== t)), cA === t && nf(null), lf("profiles", Kf("profiles", []).filter((c) => c.id !== t));
14994
15005
  },
14995
15006
  onRequestDelete: (t) => ff(t),
14996
15007
  onClose: () => a("body-profile"),
@@ -15028,7 +15039,7 @@ function XB({
15028
15039
  }
15029
15040
  ),
15030
15041
  h !== "idle" && typeof document < "u" && Vn(
15031
- /* @__PURE__ */ A("div", { className: Ef("ps-tryon-overlay", z.overlay), style: oP, "data-ps-tryon-portal": !0, children: /* @__PURE__ */ f("div", { className: Ef(`ps-tryon-modal${h === "result" && gA && TA || h === "size-result" || h === "estimation-review" || h === "body-profile" || h === "profiles" ? " ps-tryon-modal-wide" : ""}`, z.modal), onClick: (t) => t.stopPropagation(), children: [
15042
+ /* @__PURE__ */ A("div", { className: Ef("ps-tryon-overlay", z.overlay), style: oP, "data-ps-tryon-portal": !0, children: /* @__PURE__ */ f("div", { className: Ef(`ps-tryon-modal${h === "result" && PA && TA || h === "size-result" || h === "estimation-review" || h === "body-profile" || h === "profiles" ? " ps-tryon-modal-wide" : ""}`, z.modal), onClick: (t) => t.stopPropagation(), children: [
15032
15043
  /* @__PURE__ */ f("div", { className: Ef("ps-tryon-header ps-tryon-header-minimal", z.header), children: [
15033
15044
  /* @__PURE__ */ A(Pe, { activeLocale: S, onSelect: K }),
15034
15045
  /* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: F("Profiles"), onClick: () => {
@@ -15039,7 +15050,7 @@ function XB({
15039
15050
  }, children: /* @__PURE__ */ A(Ng, {}) }),
15040
15051
  /* @__PURE__ */ A("button", { onClick: Sf, className: Ef("ps-tryon-close", z.closeButton), children: /* @__PURE__ */ A(NP, {}) })
15041
15052
  ] }),
15042
- h !== "body-profile" && h !== "processing" && !(h === "size-result" && eA?.sections && Object.keys(eA.sections).length > 1) && /* @__PURE__ */ A(ne, { view: h, stepIndex: Pg }),
15053
+ h !== "body-profile" && h !== "processing" && !(h === "size-result" && gA?.sections && Object.keys(gA.sections).length > 1) && /* @__PURE__ */ A(ne, { view: h, stepIndex: Pg }),
15043
15054
  /* @__PURE__ */ f("div", { ref: zf, className: Ef("ps-tryon-body", z.body), style: { position: "relative", overflow: j ? "hidden" : void 0 }, children: [
15044
15055
  tg && /* @__PURE__ */ f("button", { className: "ps-tryon-back-btn", onClick: vg, children: [
15045
15056
  /* @__PURE__ */ f("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
@@ -15068,8 +15079,8 @@ function XB({
15068
15079
  wB,
15069
15080
  {
15070
15081
  onConfirm: () => {
15071
- const t = WA, p = Kf("profiles", []).filter((G) => G.id !== t);
15072
- lf("profiles", p), V(p), zA === t && nf(null), ff(null);
15082
+ const t = WA, c = Kf("profiles", []).filter((G) => G.id !== t);
15083
+ lf("profiles", c), V(c), cA === t && nf(null), ff(null);
15073
15084
  },
15074
15085
  onCancel: () => ff(null),
15075
15086
  t: F
@@ -15093,7 +15104,7 @@ function XB({
15093
15104
  profileDetail: R,
15094
15105
  setProfileDetail: u,
15095
15106
  setProfiles: V,
15096
- activeProfileId: zA,
15107
+ activeProfileId: cA,
15097
15108
  setActiveProfileId: nf,
15098
15109
  t: F
15099
15110
  }
@@ -15107,10 +15118,10 @@ function JB(n) {
15107
15118
  const [g, e] = d(null), [B, P] = d(!0), [D, i] = d(!1), [C, w] = d(0);
15108
15119
  return NA(() => {
15109
15120
  let H = !1;
15110
- return P(!0), i(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: n.productId }), mP(n).then((c) => {
15111
- H || (c === null ? (console.log("[ps-sdk:hook] usePrimeStyleSize → null (no profile or recommendation failed)"), i(!0), e(null)) : (console.log("[ps-sdk:hook] usePrimeStyleSize → result", { recommendedSize: c.recommendedSize, hasRaw: !!c.raw }), e(c)));
15112
- }).catch((c) => {
15113
- console.log("[ps-sdk:hook] usePrimeStyleSize threw", c), H || e(null);
15121
+ return P(!0), i(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: n.productId }), mP(n).then((p) => {
15122
+ H || (p === null ? (console.log("[ps-sdk:hook] usePrimeStyleSize → null (no profile or recommendation failed)"), i(!0), e(null)) : (console.log("[ps-sdk:hook] usePrimeStyleSize → result", { recommendedSize: p.recommendedSize, hasRaw: !!p.raw }), e(p)));
15123
+ }).catch((p) => {
15124
+ console.log("[ps-sdk:hook] usePrimeStyleSize threw", p), H || e(null);
15114
15125
  }).finally(() => {
15115
15126
  H || P(!1);
15116
15127
  }), () => {
@@ -15118,7 +15129,7 @@ function JB(n) {
15118
15129
  };
15119
15130
  }, [n.productId, n.apiUrl, n.apiKey, C]), NA(() => {
15120
15131
  if (typeof window > "u") return;
15121
- const H = () => w((c) => c + 1);
15132
+ const H = () => w((p) => p + 1);
15122
15133
  return window.addEventListener(Dn, H), window.addEventListener("storage", H), () => {
15123
15134
  window.removeEventListener(Dn, H), window.removeEventListener("storage", H);
15124
15135
  };