@primestyleai/tryon 5.10.140 → 5.10.142

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,12 +1,12 @@
1
1
  "use client";
2
- import { P as Tg, L as Gg, b as Jt, d as gg, a as uo, c as Kt, A as St, S as jt, i as Rt } from "../index-GW10cktY.js";
2
+ import { P as Tg, L as Gg, b as Jt, d as tg, a as uo, c as Kt, A as St, S as jt, i as Rt } from "../index-GW10cktY.js";
3
3
  import { jsxs as e, jsx as A, Fragment as _ } from "react/jsx-runtime";
4
4
  import { useState as f, useRef as QA, useCallback as bA, useEffect as xA, useMemo as He } from "react";
5
5
  import { createPortal as vg } from "react-dom";
6
6
  const Tt = "primestyle-photos", no = "photos", Xt = 1;
7
- let Wo = null;
7
+ let Vo = null;
8
8
  function Eg() {
9
- return Wo || (Wo = new Promise((o) => {
9
+ return Vo || (Vo = new Promise((o) => {
10
10
  try {
11
11
  if (typeof indexedDB > "u") return o(null);
12
12
  const g = indexedDB.open(Tt, Xt);
@@ -17,7 +17,7 @@ function Eg() {
17
17
  } catch {
18
18
  o(null);
19
19
  }
20
- }), Wo);
20
+ }), Vo);
21
21
  }
22
22
  const Ig = "result-";
23
23
  async function Xg(o, g) {
@@ -69,10 +69,10 @@ async function qt(o) {
69
69
  });
70
70
  }
71
71
  const Vg = 11, qg = 12, Zt = 13, $t = 14, _t = 15, An = 16, Zg = 23, $g = 24, en = 25, on = 26, gn = 27, tn = 28, nn = 0;
72
- let og = null, Vo = null;
72
+ let gg = null, qo = null;
73
73
  async function _g() {
74
- if (!og)
75
- return Vo || (Vo = (async () => {
74
+ if (!gg)
75
+ return qo || (qo = (async () => {
76
76
  const o = await import(
77
77
  /* webpackIgnore: true */
78
78
  // @ts-ignore dynamic CDN import
@@ -80,7 +80,7 @@ async function _g() {
80
80
  ), { FilesetResolver: g, PoseLandmarker: t } = o, i = await g.forVisionTasks(
81
81
  "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.33/wasm"
82
82
  );
83
- og = await t.createFromOptions(i, {
83
+ gg = await t.createFromOptions(i, {
84
84
  baseOptions: {
85
85
  modelAssetPath: "https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_lite/float16/1/pose_landmarker_lite.task",
86
86
  delegate: "GPU"
@@ -88,12 +88,12 @@ async function _g() {
88
88
  runningMode: "IMAGE",
89
89
  numPoses: 1
90
90
  });
91
- })(), Vo);
91
+ })(), qo);
92
92
  }
93
- async function eg(o) {
93
+ async function og(o) {
94
94
  try {
95
95
  await _g();
96
- const g = await At(o), t = og.detect(g);
96
+ const g = await At(o), t = gg.detect(g);
97
97
  if (!t?.landmarks?.length || t.landmarks[0].length < 25)
98
98
  return null;
99
99
  const i = t.landmarks[0], a = i[Vg], c = i[qg], n = i[Zg], w = i[$g], r = (a.y + c.y) / 2, p = (n.y + w.y) / 2, Q = p - r, C = r + Q * 0.28, I = Math.abs(c.x - a.x), u = Math.min(a.x, c.x) - I * 0.05, M = Math.max(a.x, c.x) + I * 0.05, L = Math.abs(w.x - n.x), G = Math.min(n.x, w.x) - L * 0.15, v = Math.max(n.x, w.x) + L * 0.15, l = C + (p - C) * 0.55, R = I * 0.85, V = (a.x + c.x + n.x + w.x) / 4, s = V - R / 2, m = V + R / 2;
@@ -128,7 +128,7 @@ async function po(o) {
128
128
  await _g();
129
129
  let g;
130
130
  typeof o == "string" ? g = await At(o) : g = o;
131
- const t = await rn(g, 1024), i = t.width || g.naturalWidth || g.width, a = t.height || g.naturalHeight || g.height, c = og.detect(t);
131
+ const t = await rn(g, 1024), i = t.width || g.naturalWidth || g.width, a = t.height || g.naturalHeight || g.height, c = gg.detect(t);
132
132
  if (!c?.landmarks?.length || c.landmarks[0].length < 29)
133
133
  return console.warn("[PS-SDK:MediaPipe] detection returned no usable landmarks", {
134
134
  gotLandmarks: !!c?.landmarks?.length,
@@ -9323,7 +9323,7 @@ function Ug({
9323
9323
  ], [I, u] = f({ w: 800, h: 1200 }), M = (s) => {
9324
9324
  const m = s.currentTarget;
9325
9325
  u({ w: m.naturalWidth || m.offsetWidth, h: m.naturalHeight || m.offsetHeight });
9326
- }, L = 6e3, G = 1e3, v = QA(Date.now()), [l, R] = f(0);
9326
+ }, L = 2e3, G = 400, v = QA(Date.now()), [l, R] = f(0);
9327
9327
  xA(() => {
9328
9328
  const s = (L - G) / Math.max(1, C.length - 1), m = setInterval(() => {
9329
9329
  const E = Date.now() - v.current, F = Math.min(C.length - 1, Math.floor(E / s));
@@ -9354,7 +9354,7 @@ function Ug({
9354
9354
  /* @__PURE__ */ A("div", { className: "ps-bpm-spacer" })
9355
9355
  ] });
9356
9356
  }
9357
- const qo = 22;
9357
+ const Zo = 22;
9358
9358
  function Io({
9359
9359
  tryOnStartedAt: o,
9360
9360
  t: g
@@ -9365,7 +9365,7 @@ function Io({
9365
9365
  const C = setInterval(() => t((I) => I + 1), 200);
9366
9366
  return () => clearInterval(C);
9367
9367
  }, [o]), o == null) return null;
9368
- const i = (Date.now() - o) / 1e3, a = Math.min(95, i / qo * 100), c = Math.round(a), n = Math.max(0, qo - Math.floor(i)), w = i >= qo ? g("almost done") : `~${n}s ${g("left")}`, r = [
9368
+ const i = (Date.now() - o) / 1e3, a = Math.min(95, i / Zo * 100), c = Math.round(a), n = Math.max(0, Zo - Math.floor(i)), w = i >= Zo ? g("almost done") : `~${n}s ${g("left")}`, r = [
9369
9369
  g("Preparing your image"),
9370
9370
  g("Analyzing body proportions"),
9371
9371
  g("Mapping garment to body"),
@@ -9373,7 +9373,7 @@ function Io({
9373
9373
  g("Almost done")
9374
9374
  ], p = Math.min(
9375
9375
  r.length - 1,
9376
- Math.floor(i / qo * r.length)
9376
+ Math.floor(i / Zo * r.length)
9377
9377
  ), Q = r[p];
9378
9378
  return /* @__PURE__ */ e("div", { className: "ps-tryon-badge", role: "status", "aria-live": "polite", children: [
9379
9379
  /* @__PURE__ */ e("div", { className: "ps-tryon-badge-row", children: [
@@ -9840,7 +9840,7 @@ function ci({ landmarks: o, imgWidth: g, imgHeight: t }) {
9840
9840
  ] }, C))
9841
9841
  ] });
9842
9842
  }
9843
- function Zo({ active: o }) {
9843
+ function $o({ active: o }) {
9844
9844
  return o ? /* @__PURE__ */ e(_, { children: [
9845
9845
  /* @__PURE__ */ A("div", { className: "ps-tryon-scan-overlay" }),
9846
9846
  /* @__PURE__ */ A("div", { className: "ps-tryon-scan-line" })
@@ -9860,7 +9860,7 @@ function zo({ lines: o, fitRows: g, show: t, imgWidth: i, imgHeight: a }) {
9860
9860
  const V = G.x1 * w, s = G.x2 * w, m = G.y * r, E = s - V, F = E * 0.06, O = (V + s) / 2, T = g.find((VA) => {
9861
9861
  const HA = VA.area.toLowerCase().trim();
9862
9862
  return !!(HA === L || L === "chest" && (HA.includes("bust") || HA.includes("chest")) || L === "waist" && HA.includes("waist") || L === "hips" && (HA.includes("hip") || HA === "hips"));
9863
- }), aA = T ? c(T.fit) : "#2154EF", X = l * 0.35, UA = `M ${V} ${m} Q ${O} ${m + F} ${s} ${m}`, LA = E * 1.05, h = T ? T.fit === "good" ? "✓ Fit" : T.isLength ? T.fit.includes("short") || T.fit.includes("tight") ? "Short" : "Long" : T.fit.includes("tight") ? "Tight" : "Loose" : v, gA = Math.round(14 * M), N = h.length * gA * 0.62, S = w - s - 12 * M < N, nA = S ? V - 10 * M : s + 10 * M, MA = S ? "end" : "start", iA = S ? V : s, YA = S ? V - 6 * M : s + 6 * M;
9863
+ }), aA = T ? c(T.fit) : "#2154EF", X = l * 0.35, UA = `M ${V} ${m} Q ${O} ${m + F} ${s} ${m}`, LA = E * 1.05, h = T ? T.fit === "good" ? "✓ Fit" : T.isLength ? T.fit.includes("short") || T.fit.includes("tight") ? "Short" : "Long" : T.fit.includes("tight") ? "Tight" : "Loose" : v, oA = Math.max(14, Math.round(22 * M)), N = h.length * oA * 0.62, S = w - s - 12 * M < N, nA = S ? V - 10 * M : s + 10 * M, MA = S ? "end" : "start", iA = S ? V : s, YA = S ? V - 6 * M : s + 6 * M;
9864
9864
  return /* @__PURE__ */ e("g", { children: [
9865
9865
  /* @__PURE__ */ A(
9866
9866
  "path",
@@ -9915,7 +9915,7 @@ function zo({ lines: o, fitRows: g, show: t, imgWidth: i, imgHeight: a }) {
9915
9915
  x: nA,
9916
9916
  y: m + 1 * M,
9917
9917
  fill: aA,
9918
- fontSize: gA,
9918
+ fontSize: oA,
9919
9919
  fontWeight: "700",
9920
9920
  fontFamily: "system-ui, -apple-system, sans-serif",
9921
9921
  dominantBaseline: "middle",
@@ -9967,7 +9967,7 @@ function pg(o, g) {
9967
9967
  return a === t || t.includes(a) || a.includes(t);
9968
9968
  }) || null;
9969
9969
  }
9970
- function $o({
9970
+ function _o({
9971
9971
  sectionName: o,
9972
9972
  section: g,
9973
9973
  sectionResult: t,
@@ -9995,34 +9995,34 @@ function $o({
9995
9995
  sectionFound: F,
9996
9996
  allSizes: O
9997
9997
  }) {
9998
- const T = t?.recommendedSize || "", [aA, X] = f(null), UA = Zn(R ?? null), LA = a.toLowerCase(), h = LA.includes("mm") ? "mm" : LA.includes("cm") ? "cm" : "in", gA = c || h, N = (y) => Ct(y, gA, h), vA = (y) => li(y, gA, h), S = (y) => {
9999
- const oA = vA(y);
10000
- return /^\d+(?:\.\d+)?(?:\s*[-–]\s*\d+(?:\.\d+)?)?$/.test(oA.trim()) ? `${oA} ${a}` : oA;
9998
+ const T = t?.recommendedSize || "", [aA, X] = f(null), UA = Zn(R ?? null), LA = a.toLowerCase(), h = LA.includes("mm") ? "mm" : LA.includes("cm") ? "cm" : "in", oA = c || h, N = (y) => Ct(y, oA, h), vA = (y) => li(y, oA, h), S = (y) => {
9999
+ const gA = vA(y);
10000
+ return /^\d+(?:\.\d+)?(?:\s*[-–]\s*\d+(?:\.\d+)?)?$/.test(gA.trim()) ? `${gA} ${a}` : gA;
10001
10001
  }, nA = s ? Object.keys(s) : [], [MA, iA] = f(null), YA = n?.secResult?.recommendedSize || "", [VA, HA] = f(null), pe = He(() => {
10002
10002
  if (!n) return [];
10003
- const y = n.section, oA = y.headers.findIndex((qA) => /size|taglia|größe|taille/i.test(qA.trim())), CA = oA >= 0 ? oA : 0, J = y.headers[CA] || "Size", fA = y.rows.map((qA) => Te(qA, CA, J)).filter(Boolean);
10003
+ const y = n.section, gA = y.headers.findIndex((qA) => /size|taglia|größe|taille/i.test(qA.trim())), CA = gA >= 0 ? gA : 0, J = y.headers[CA] || "Size", fA = y.rows.map((qA) => Te(qA, CA, J)).filter(Boolean);
10004
10004
  return [...new Set(fA)];
10005
10005
  }, [n]), _A = He(() => ({}), []), yA = He(() => {
10006
- const y = g.headers.findIndex((oA) => /size|taglia|größe|taille/i.test(oA.trim()));
10006
+ const y = g.headers.findIndex((gA) => /size|taglia|größe|taille/i.test(gA.trim()));
10007
10007
  if (y >= 0) return y;
10008
- for (let oA = 0; oA < g.headers.length; oA++) {
10009
- const CA = g.headers[oA];
10010
- if (g.rows.some((J) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Te(J, oA, CA)))) return oA;
10008
+ for (let gA = 0; gA < g.headers.length; gA++) {
10009
+ const CA = g.headers[gA];
10010
+ if (g.rows.some((J) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Te(J, gA, CA)))) return gA;
10011
10011
  }
10012
10012
  return 0;
10013
10013
  }, [g]), oe = g.headers[yA] || "Size", SA = He(() => {
10014
- const y = g.rows.map((oA) => Te(oA, yA, oe)).filter(Boolean);
10014
+ const y = g.rows.map((gA) => Te(gA, yA, oe)).filter(Boolean);
10015
10015
  return [...new Set(y)];
10016
10016
  }, [g, yA, oe]), Ce = aA || T, mA = Ce === T;
10017
10017
  He(() => {
10018
10018
  if (mA) return null;
10019
- const y = t?.matchDetails ?? [], oA = /tight|loose|large|small|very/i, CA = y.some((J) => oA.test(J.fit || ""));
10019
+ const y = t?.matchDetails ?? [], gA = /tight|loose|large|small|very/i, CA = y.some((J) => gA.test(J.fit || ""));
10020
10020
  return r(CA ? "Not Recommended" : "Your Selection");
10021
10021
  }, [mA, t, r]);
10022
10022
  const Ie = MA && mA && s && s[MA] ? s[MA] : Ce, Z = He(() => {
10023
10023
  const y = [];
10024
- for (let oA = 0; oA < g.headers.length; oA++) {
10025
- const CA = (g.headers[oA] || "").toLowerCase();
10024
+ for (let gA = 0; gA < g.headers.length; gA++) {
10025
+ const CA = (g.headers[gA] || "").toLowerCase();
10026
10026
  if (/\(cm\)|centimeter/i.test(CA)) {
10027
10027
  y.push("cm");
10028
10028
  continue;
@@ -10033,7 +10033,7 @@ function $o({
10033
10033
  }
10034
10034
  let J = null;
10035
10035
  for (const fA of g.rows) {
10036
- const qA = String(Te(fA, oA, g.headers[oA]) || "").trim();
10036
+ const qA = String(Te(fA, gA, g.headers[gA]) || "").trim();
10037
10037
  if (qA) {
10038
10038
  if (/cm\b|centimeter/i.test(qA)) {
10039
10039
  J = "cm";
@@ -10048,7 +10048,7 @@ function $o({
10048
10048
  y.push(J);
10049
10049
  }
10050
10050
  return y;
10051
- }, [g]), me = bA((y, oA) => {
10051
+ }, [g]), me = bA((y, gA) => {
10052
10052
  const CA = y.toLowerCase().trim(), J = a === "cm" || a === "", fA = J ? "cm" : "in", qA = [];
10053
10053
  for (let q = 0; q < g.headers.length; q++) {
10054
10054
  const kA = (g.headers[q] || "").toLowerCase().trim();
@@ -10062,8 +10062,8 @@ function $o({
10062
10062
  if (qA.length === 0) return null;
10063
10063
  let TA = qA.find((q) => Z[q] === fA);
10064
10064
  TA == null && (TA = qA[0]);
10065
- const ve = g.headers[TA], GA = oA.trim().toLowerCase();
10066
- let OA = g.rows.find((q) => Te(q, yA, oe) === oA);
10065
+ const ve = g.headers[TA], GA = gA.trim().toLowerCase();
10066
+ let OA = g.rows.find((q) => Te(q, yA, oe) === gA);
10067
10067
  if (OA || (OA = g.rows.find((q) => Te(q, yA, oe).trim().toLowerCase() === GA)), OA || (OA = g.rows.find((q) => {
10068
10068
  const kA = Te(q, yA, oe).trim().toLowerCase();
10069
10069
  return kA.startsWith(GA) || GA.startsWith(kA);
@@ -10113,7 +10113,7 @@ function $o({
10113
10113
  isLength: !1
10114
10114
  };
10115
10115
  });
10116
- const y = t?.matchDetails || [], oA = n?.secResult?.matchDetails || [], CA = /* @__PURE__ */ new Set(), J = [...y, ...oA].filter((P) => {
10116
+ const y = t?.matchDetails || [], gA = n?.secResult?.matchDetails || [], CA = /* @__PURE__ */ new Set(), J = [...y, ...gA].filter((P) => {
10117
10117
  const q = String(P?.measurement ?? "").toLowerCase().trim();
10118
10118
  return !q || CA.has(q) ? !1 : (CA.add(q), !0);
10119
10119
  }), fA = t?.length || "", qA = (t?.availableLengths?.length || 0) > 0, TA = YA || fA, ve = !!(n || qA), GA = J.some((P) => P.measurement.toLowerCase() === "height"), OA = !!n?.section?.headers?.some((P) => /height|altezza|estatura|\(cm\)/i.test(P));
@@ -10135,7 +10135,7 @@ function $o({
10135
10135
  });
10136
10136
  }
10137
10137
  if (!J.length) return [];
10138
- const ie = new Set(oA.map((P) => P.measurement));
10138
+ const ie = new Set(gA.map((P) => P.measurement));
10139
10139
  ve && ie.add("Height");
10140
10140
  const XA = VA || TA;
10141
10141
  return J.map((P) => {
@@ -10160,23 +10160,23 @@ function $o({
10160
10160
  });
10161
10161
  }, [t, n, i, E, O, Ce, VA]), Ye = fe.filter(
10162
10162
  (y) => y.fit === "good" || y.fit === "a-bit-tight" || y.fit === "a-bit-loose"
10163
- ).length, ne = fe.length > 0 ? Math.round(Ye / fe.length * 100) : 0, de = !E, pA = t, ge = pA?.size || T, jA = (t?.matchDetails || []).find(
10163
+ ).length, ne = fe.length > 0 ? Math.round(Ye / fe.length * 100) : 0, de = !E, dA = t, ge = dA?.size || T, jA = (t?.matchDetails || []).find(
10164
10164
  (y) => /inseam|length/i.test(y.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(y.measurement)
10165
- ), H = jA ? (jA.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", zA = pA?.length || YA || H, he = pA?.availableSizes || [], Oe = pA?.availableLengths || [], JA = VA || zA, ke = O ? Object.keys(O) : [], De = ke.length > 0 ? ke : he.length > 0 ? he : SA, BA = (() => {
10165
+ ), H = jA ? (jA.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", zA = dA?.length || YA || H, he = dA?.availableSizes || [], Oe = dA?.availableLengths || [], JA = VA || zA, ke = O ? Object.keys(O) : [], De = ke.length > 0 ? ke : he.length > 0 ? he : SA, BA = (() => {
10166
10166
  if (De.length <= 3) return De;
10167
10167
  const y = De.indexOf(T);
10168
10168
  if (y < 0) return De.slice(0, 3);
10169
- const oA = Math.max(0, Math.min(De.length - 3, y - 1));
10170
- return De.slice(oA, oA + 3);
10169
+ const gA = Math.max(0, Math.min(De.length - 3, y - 1));
10170
+ return De.slice(gA, gA + 3);
10171
10171
  })(), RA = Oe.length > 0 ? Oe : pe, FA = (() => {
10172
10172
  if (RA.length <= 3) return RA;
10173
10173
  const y = RA.indexOf(zA);
10174
10174
  if (y < 0) return RA.slice(0, 3);
10175
- const oA = Math.max(0, Math.min(RA.length - 3, y - 1));
10176
- return RA.slice(oA, oA + 3);
10175
+ const gA = Math.max(0, Math.min(RA.length - 3, y - 1));
10176
+ return RA.slice(gA, gA + 3);
10177
10177
  })();
10178
10178
  if (C) {
10179
- const y = o.replace(/\s*[—–-]\s*.*/g, ""), oA = (J) => {
10179
+ const y = o.replace(/\s*[—–-]\s*.*/g, ""), gA = (J) => {
10180
10180
  const fA = J.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
10181
10181
  return fA.includes("chest") || fA.includes("bust") ? r("Full circumference at the widest point.") : fA.includes("waist") ? r("Circumference at the natural waistline.") : fA.includes("hip") ? r("Circumference at the fullest point.") : fA.includes("shoulder") ? r("Shoulder edge to shoulder edge.") : fA.includes("sleeve") || fA.includes("arm") ? r("Shoulder seam to cuff edge.") : fA.includes("neck") || fA.includes("collar") ? r("Around the base of the neck.") : fA.includes("inseam") || fA.includes("inside leg") ? r("Inner leg seam length.") : fA.includes("thigh") ? r("Circumference around the upper leg.") : fA.includes("length") || fA.includes("height") ? r("Top to bottom length.") : "";
10182
10182
  }, CA = (J, fA) => fA && J === "good" ? r("EDITORIAL LENGTH") : J === "good" ? r("PERFECT TENSION") : J === "a-bit-tight" ? r("SLIGHTLY TIGHT") : J === "a-bit-loose" ? r("SLIGHT EASE") : J.includes("tight") ? r("TIGHT") : J.includes("loose") ? r("LOOSE") : r("FIT");
@@ -10312,7 +10312,7 @@ function $o({
10312
10312
  /* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: r("MEASUREMENT BLUEPRINT") }),
10313
10313
  /* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
10314
10314
  /* @__PURE__ */ A("div", { className: "ps-msd-rows", children: fe.map((J, fA) => {
10315
- const qA = J.isLength && J.fit.includes("short") || J.fit.includes("tight"), TA = J.fit === "good" ? "ps-good" : qA ? "ps-tight" : "ps-loose", ve = oA(J.area), GA = String(fA + 1).padStart(2, "0");
10315
+ const qA = J.isLength && J.fit.includes("short") || J.fit.includes("tight"), TA = J.fit === "good" ? "ps-good" : qA ? "ps-tight" : "ps-loose", ve = gA(J.area), GA = String(fA + 1).padStart(2, "0");
10316
10316
  return /* @__PURE__ */ e("div", { className: "ps-msd-row", children: [
10317
10317
  /* @__PURE__ */ e("div", { className: "ps-msd-row-num", children: [
10318
10318
  GA,
@@ -10526,7 +10526,7 @@ function $o({
10526
10526
  return /* @__PURE__ */ A("span", { style: { fontSize: y ? "1.6vw" : "3.5vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children: Ie });
10527
10527
  })(),
10528
10528
  JA && !Ie.includes(" / ") && (() => {
10529
- const y = /^\d+(\.\d+)?$/.test(String(JA).trim()), oA = (o || "").toLowerCase(), CA = y ? /pant|trouser|inseam/.test(oA) ? r("Inseam") : r("Length") : null;
10529
+ const y = /^\d+(\.\d+)?$/.test(String(JA).trim()), gA = (o || "").toLowerCase(), CA = y ? /pant|trouser|inseam/.test(gA) ? r("Inseam") : r("Length") : null;
10530
10530
  return /* @__PURE__ */ e("span", { style: { fontSize: "1.4vw", fontWeight: 400, color: "var(--ps-text-secondary)", display: "inline-flex", alignItems: "baseline", gap: "0.25vw" }, children: [
10531
10531
  /* @__PURE__ */ A("span", { style: { fontSize: "0.9vw", fontWeight: 600, color: "var(--ps-text-muted)", letterSpacing: "0.02em" }, children: "/" }),
10532
10532
  CA && /* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", fontWeight: 600, color: "var(--ps-text-muted)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: CA }),
@@ -10558,14 +10558,14 @@ function $o({
10558
10558
  /* @__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: r("Garment Spec") }),
10559
10559
  /* @__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: r("Fit Result") })
10560
10560
  ] }) }),
10561
- /* @__PURE__ */ A("tbody", { children: fe.map((y, oA) => {
10561
+ /* @__PURE__ */ A("tbody", { children: fe.map((y, gA) => {
10562
10562
  const CA = y.fit === "good" ? "#2154EF" : y.isLength ? y.fit.includes("short") || y.fit.includes("tight") ? "#dc2626" : "#d97706" : y.fit.includes("tight") ? "#dc2626" : "#d97706", J = y.fit === "good" ? "rgba(33,84,239,0.08)" : y.isLength ? y.fit.includes("short") || y.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : y.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
10563
- return /* @__PURE__ */ e("tr", { style: { borderBottom: oA < fe.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
10563
+ return /* @__PURE__ */ e("tr", { style: { borderBottom: gA < fe.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
10564
10564
  /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: y.area }),
10565
10565
  /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? y.rawUserValue || "" : isNaN(y.userNum) || y.userNum === 0 ? "" : `${N(y.userNum)} ${a}` }),
10566
10566
  /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? y.rawChartRange || "" : S(y.chartLabel) }),
10567
10567
  /* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: CA, background: J, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: y.isLength ? Jg(y.fit, r) : wi(y.fit, r) }) })
10568
- ] }, oA);
10568
+ ] }, gA);
10569
10569
  }) })
10570
10570
  ] }) }),
10571
10571
  BA.length > 1 && /* @__PURE__ */ e("div", { style: { marginBottom: "0.8vw" }, children: [
@@ -10577,7 +10577,7 @@ function $o({
10577
10577
  r("Size")
10578
10578
  ] }),
10579
10579
  /* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: BA.map((y) => {
10580
- const oA = y === Ce;
10580
+ const gA = y === Ce;
10581
10581
  return /* @__PURE__ */ A(
10582
10582
  "button",
10583
10583
  {
@@ -10587,9 +10587,9 @@ function $o({
10587
10587
  borderRadius: "0.35vw",
10588
10588
  fontSize: "0.7vw",
10589
10589
  fontWeight: 600,
10590
- border: oA ? "2px solid var(--ps-accent)" : "2px solid rgba(0,0,0,0.12)",
10591
- background: oA ? "var(--ps-accent)" : "transparent",
10592
- color: oA ? "white" : "var(--ps-text-primary)",
10590
+ border: gA ? "2px solid var(--ps-accent)" : "2px solid rgba(0,0,0,0.12)",
10591
+ background: gA ? "var(--ps-accent)" : "transparent",
10592
+ color: gA ? "white" : "var(--ps-text-primary)",
10593
10593
  cursor: "pointer",
10594
10594
  transition: "all 0.2s",
10595
10595
  fontFamily: "inherit",
@@ -10605,7 +10605,7 @@ function $o({
10605
10605
  FA.length > 0 && /* @__PURE__ */ e("div", { style: { marginBottom: "0.8vw", marginTop: "0.4vw" }, children: [
10606
10606
  /* @__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: r("Length Adjustment") }),
10607
10607
  /* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: FA.map((y) => {
10608
- const oA = String(JA ?? "").trim() === String(y ?? "").trim(), CA = _A[String(y).trim()];
10608
+ const gA = String(JA ?? "").trim() === String(y ?? "").trim(), CA = _A[String(y).trim()];
10609
10609
  return /* @__PURE__ */ e(
10610
10610
  "button",
10611
10611
  {
@@ -10615,9 +10615,9 @@ function $o({
10615
10615
  borderRadius: "0.35vw",
10616
10616
  fontSize: "0.7vw",
10617
10617
  fontWeight: 600,
10618
- border: oA ? "2px solid var(--ps-accent)" : "2px solid rgba(0,0,0,0.12)",
10619
- background: oA ? "var(--ps-accent)" : "transparent",
10620
- color: oA ? "white" : "var(--ps-text-primary)",
10618
+ border: gA ? "2px solid var(--ps-accent)" : "2px solid rgba(0,0,0,0.12)",
10619
+ background: gA ? "var(--ps-accent)" : "transparent",
10620
+ color: gA ? "white" : "var(--ps-text-primary)",
10621
10621
  cursor: "pointer",
10622
10622
  transition: "all 0.2s",
10623
10623
  fontFamily: "inherit",
@@ -10739,7 +10739,7 @@ function pi({
10739
10739
  tryOnAvailable: LA = !0,
10740
10740
  t: h
10741
10741
  }) {
10742
- const gA = (g?.unit || p || "").toString().toLowerCase(), N = gA === "mm" ? "mm" : gA === "cm" ? "cm" : "in", vA = h(N === "mm" ? "mm" : p === "cm" ? "cm" : "in"), [S, nA] = f({}), MA = dt, iA = bA((x, b, k) => Te(x, b, k), []), YA = He(() => {
10742
+ const oA = (g?.unit || p || "").toString().toLowerCase(), N = oA === "mm" ? "mm" : oA === "cm" ? "cm" : "in", vA = h(N === "mm" ? "mm" : p === "cm" ? "cm" : "in"), [S, nA] = f({}), MA = dt, iA = bA((x, b, k) => Te(x, b, k), []), YA = He(() => {
10743
10743
  if (!t?.headers || !t?.rows) return -1;
10744
10744
  const x = t.headers.findIndex((b) => /size|taglia|größe|taille/i.test(b.trim()));
10745
10745
  if (x >= 0) return x;
@@ -10811,7 +10811,7 @@ function pi({
10811
10811
  return { range: Ee, ...KA };
10812
10812
  }, [t, YA, VA, vA, iA, MA, HA]), _A = g?.recommendedSize || "";
10813
10813
  He(() => g?.internationalSizes || {}, [g]);
10814
- const [yA, oe] = f("fit"), [SA, Ce] = f(null), [mA, Ie] = f(!1), [Z, me] = f(!1), [fe, Ye] = f(!1), [ne, de] = f(null), [pA, ge] = f(!1), [jA, H] = f({ w: 800, h: 1200 }), zA = X ?? {}, he = bA((x) => {
10814
+ const [yA, oe] = f("fit"), [SA, Ce] = f(null), [mA, Ie] = f(!1), [Z, me] = f(!1), [fe, Ye] = f(!1), [ne, de] = f(null), [dA, ge] = f(!1), [jA, H] = f({ w: 800, h: 1200 }), zA = X ?? {}, he = bA((x) => {
10815
10815
  const b = x.currentTarget;
10816
10816
  b.naturalWidth && b.naturalHeight && H({ w: b.naturalWidth, h: b.naturalHeight });
10817
10817
  }, []);
@@ -10820,7 +10820,7 @@ function pi({
10820
10820
  de(null), ge(!1);
10821
10821
  return;
10822
10822
  }
10823
- ge(!1), eg(i).then((x) => {
10823
+ ge(!1), og(i).then((x) => {
10824
10824
  de(x), ge(!0);
10825
10825
  }).catch(() => {
10826
10826
  ge(!0);
@@ -10828,7 +10828,7 @@ function pi({
10828
10828
  }, [i, v]);
10829
10829
  const [Oe, JA] = f(!1), [ke, De] = f(!1);
10830
10830
  QA(null);
10831
- const [BA, RA] = f(!1), [FA, y] = f(null), [oA, CA] = f(!1), J = QA(null), [fA, qA] = f(null), [TA, ve] = f(!1);
10831
+ const [BA, RA] = f(!1), [FA, y] = f(null), [gA, CA] = f(!1), J = QA(null), [fA, qA] = f(null), [TA, ve] = f(!1);
10832
10832
  xA(() => {
10833
10833
  if (FA) {
10834
10834
  const x = URL.createObjectURL(FA);
@@ -11025,7 +11025,7 @@ function pi({
11025
11025
  return x ? Ae ? /* @__PURE__ */ e(_, { children: [
11026
11026
  Pe && /* @__PURE__ */ A("div", { style: { padding: "0 16px" }, children: Pe }),
11027
11027
  /* @__PURE__ */ A(
11028
- $o,
11028
+ _o,
11029
11029
  {
11030
11030
  sectionName: x.name,
11031
11031
  section: x.section,
@@ -11051,8 +11051,8 @@ function pi({
11051
11051
  onImageLoad: he,
11052
11052
  overlayNode: v ? /* @__PURE__ */ e(_, { children: [
11053
11053
  /* @__PURE__ */ A(Io, { tryOnStartedAt: l ?? null, t: h }),
11054
- /* @__PURE__ */ A(Zo, { active: !0 })
11055
- ] }) : i && pA && ne ? /* @__PURE__ */ A(
11054
+ /* @__PURE__ */ A($o, { active: !0 })
11055
+ ] }) : i && dA && ne ? /* @__PURE__ */ A(
11056
11056
  zo,
11057
11057
  {
11058
11058
  lines: ne,
@@ -11088,12 +11088,12 @@ function pi({
11088
11088
  }
11089
11089
  ),
11090
11090
  v && /* @__PURE__ */ A(Io, { tryOnStartedAt: l ?? null, t: h }),
11091
- /* @__PURE__ */ A(Zo, { active: !!v })
11091
+ /* @__PURE__ */ A($o, { active: !!v })
11092
11092
  ] }),
11093
11093
  /* @__PURE__ */ e("div", { className: "ps-tryon-v2-panel", children: [
11094
11094
  Pe,
11095
11095
  /* @__PURE__ */ A(
11096
- $o,
11096
+ _o,
11097
11097
  {
11098
11098
  sectionName: x.name,
11099
11099
  section: x.section,
@@ -11146,7 +11146,7 @@ function pi({
11146
11146
  showLines: Z,
11147
11147
  onToggleLines: PA ? void 0 : () => me(!Z),
11148
11148
  onImageLoad: he,
11149
- overlayNode: i && pA && ne ? /* @__PURE__ */ A(
11149
+ overlayNode: i && dA && ne ? /* @__PURE__ */ A(
11150
11150
  zo,
11151
11151
  {
11152
11152
  lines: ne,
@@ -11175,8 +11175,8 @@ function pi({
11175
11175
  /* @__PURE__ */ e("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
11176
11176
  /* @__PURE__ */ A("img", { src: v && u ? u : i || a, alt: n, className: "ps-tryon-v2-bg-img", onLoad: he }),
11177
11177
  v && /* @__PURE__ */ A(Io, { tryOnStartedAt: l ?? null, t: h }),
11178
- /* @__PURE__ */ A(Zo, { active: !!v }),
11179
- i && !v && pA && ne && /* @__PURE__ */ A(zo, { lines: ne, fitRows: (() => {
11178
+ /* @__PURE__ */ A($o, { active: !!v }),
11179
+ i && !v && dA && ne && /* @__PURE__ */ A(zo, { lines: ne, fitRows: (() => {
11180
11180
  const x = [...g?.matchDetails || []];
11181
11181
  if (g?.sections)
11182
11182
  for (const k of Object.values(g.sections))
@@ -11302,7 +11302,7 @@ function pi({
11302
11302
  return Ae ? /* @__PURE__ */ e(_, { children: [
11303
11303
  Pe && /* @__PURE__ */ A("div", { style: { padding: "0 16px" }, children: Pe }),
11304
11304
  /* @__PURE__ */ A(
11305
- $o,
11305
+ _o,
11306
11306
  {
11307
11307
  sectionName: K,
11308
11308
  section: x,
@@ -11330,7 +11330,7 @@ function pi({
11330
11330
  showLines: Z,
11331
11331
  onToggleLines: PA ? void 0 : () => me(!Z),
11332
11332
  onImageLoad: he,
11333
- overlayNode: i && pA && ne ? /* @__PURE__ */ A(
11333
+ overlayNode: i && dA && ne ? /* @__PURE__ */ A(
11334
11334
  zo,
11335
11335
  {
11336
11336
  lines: ne,
@@ -11355,8 +11355,8 @@ function pi({
11355
11355
  }
11356
11356
  ),
11357
11357
  v && /* @__PURE__ */ A(Io, { tryOnStartedAt: l ?? null, t: h }),
11358
- /* @__PURE__ */ A(Zo, { active: !!v }),
11359
- i && !v && pA && ne && /* @__PURE__ */ A(zo, { lines: ne, fitRows: (g?.matchDetails || []).map(($) => ({ area: $.measurement, userNum: parseFloat($.userValue) || 0, chartLabel: $.chartRange || "", fit: $.fit })), show: Z, imgWidth: jA.w, imgHeight: jA.h }),
11358
+ /* @__PURE__ */ A($o, { active: !!v }),
11359
+ i && !v && dA && ne && /* @__PURE__ */ A(zo, { lines: ne, fitRows: (g?.matchDetails || []).map(($) => ({ area: $.measurement, userNum: parseFloat($.userValue) || 0, chartLabel: $.chartRange || "", fit: $.fit })), show: Z, imgWidth: jA.w, imgHeight: jA.h }),
11360
11360
  i && !v && /* @__PURE__ */ e("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
11361
11361
  !PA && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () => me(!Z), children: h(Z ? "Hide Fit" : "Show Fit") }),
11362
11362
  /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: C, children: h("Download") })
@@ -11367,7 +11367,7 @@ function pi({
11367
11367
  E === K ? (
11368
11368
  /* DETAIL VIEW — full size table, same as multi-garment */
11369
11369
  /* @__PURE__ */ A(
11370
- $o,
11370
+ _o,
11371
11371
  {
11372
11372
  sectionName: K,
11373
11373
  section: x,
@@ -11885,7 +11885,7 @@ function Sg({
11885
11885
  if (o && g) {
11886
11886
  v(!0), R(C("Analyzing photo…"));
11887
11887
  try {
11888
- const vA = await gg(N, o, g);
11888
+ const vA = await tg(N, o, g);
11889
11889
  if (!vA.isAdult) {
11890
11890
  const S = vA.reasoning?.trim() || C("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
11891
11891
  s(S), v(!1), R("");
@@ -12450,7 +12450,7 @@ function Se({
12450
12450
  }
12451
12451
  );
12452
12452
  }
12453
- function _o({
12453
+ function Ag({
12454
12454
  stepKey: o,
12455
12455
  title: g,
12456
12456
  subtitle: t,
@@ -12469,7 +12469,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12469
12469
  xA(() => {
12470
12470
  v.current && (v.current.scrollTop = 0);
12471
12471
  }, [w, p]);
12472
- const [l, R] = f(""), [V, s] = f("male"), [m, E] = f("cm"), [F, O] = f(""), [T, aA] = f(""), [X, UA] = f(""), [LA, h] = f(""), [gA, N] = f(""), [vA, S] = f(""), [nA, MA] = f(null), [iA, YA] = f(!1), [VA, HA] = f(""), [pe, _A] = f(null), [yA, oe] = f(null), [SA, Ce] = f({ w: 800, h: 1200 }), [mA, Ie] = f(0), [Z, me] = f(!1), [fe, Ye] = f(!1);
12472
+ const [l, R] = f(""), [V, s] = f("male"), [m, E] = f("cm"), [F, O] = f(""), [T, aA] = f(""), [X, UA] = f(""), [LA, h] = f(""), [oA, N] = f(""), [vA, S] = f(""), [nA, MA] = f(null), [iA, YA] = f(!1), [VA, HA] = f(""), [pe, _A] = f(null), [yA, oe] = f(null), [SA, Ce] = f({ w: 800, h: 1200 }), [mA, Ie] = f(0), [Z, me] = f(!1), [fe, Ye] = f(!1);
12473
12473
  xA(() => {
12474
12474
  if (C !== "calculating" || !nA) return;
12475
12475
  let D = !1;
@@ -12484,7 +12484,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12484
12484
  const D = setInterval(() => Ie((W) => W + 1), 1500);
12485
12485
  return () => clearInterval(D);
12486
12486
  }, [C, u]);
12487
- const ne = QA(null), de = QA(null), [pA, ge] = f(!1), [jA, H] = f(null), zA = () => {
12487
+ const ne = QA(null), de = QA(null), [dA, ge] = f(!1), [jA, H] = f(null), zA = () => {
12488
12488
  jA === !0 && ne.current?.click();
12489
12489
  }, he = async (D) => {
12490
12490
  const W = D.target.files?.[0];
@@ -12503,7 +12503,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12503
12503
  }
12504
12504
  S(""), YA(!0), HA(n("Analyzing photo…"));
12505
12505
  try {
12506
- const hA = t && i ? gg(W, t, i) : Promise.resolve({ isAdult: !0, confidence: "low" }), uA = uo(W), ee = await hA;
12506
+ const hA = t && i ? tg(W, t, i) : Promise.resolve({ isAdult: !0, confidence: "low" }), uA = uo(W), ee = await hA;
12507
12507
  if (!ee.isAdult) {
12508
12508
  const Me = ee.reasoning?.trim() || n("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
12509
12509
  _A(Me);
@@ -12519,7 +12519,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12519
12519
  }
12520
12520
  }, Oe = () => {
12521
12521
  MA(null), a?.(null), ne.current && (ne.current.value = "");
12522
- }, [JA, ke] = f(null), [De, BA] = f(null), [RA, FA] = f(null), [y, oA] = f(null), [CA, J] = f(null), [fA, qA] = f(null), [TA, ve] = f("US"), [GA, OA] = f(null), ie = QA(null);
12522
+ }, [JA, ke] = f(null), [De, BA] = f(null), [RA, FA] = f(null), [y, gA] = f(null), [CA, J] = f(null), [fA, qA] = f(null), [TA, ve] = f("US"), [GA, OA] = f(null), ie = QA(null);
12523
12523
  xA(() => {
12524
12524
  if (!GA) return;
12525
12525
  const D = (W) => {
@@ -12556,10 +12556,10 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12556
12556
  const W = parseFloat(LA);
12557
12557
  if (!W || W <= 0)
12558
12558
  return S(n("Please enter a valid weight")), !1;
12559
- const hA = parseFloat(gA);
12559
+ const hA = parseFloat(oA);
12560
12560
  return !hA || hA <= 0 ? (S(n("Please enter a valid age")), !1) : q && (!CA || !fA) ? (S(n("Please select your bra band and cup size")), !1) : (S(""), !0);
12561
12561
  }, se = () => l.trim() ? (S(""), !0) : (S(n("Please enter a profile name")), !1), Pe = () => {
12562
- const D = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), W = parseFloat(gA);
12562
+ const D = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), W = parseFloat(oA);
12563
12563
  return {
12564
12564
  name: l.trim(),
12565
12565
  gender: V,
@@ -12578,7 +12578,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12578
12578
  cupSize: q && fA || void 0
12579
12579
  };
12580
12580
  }, x = () => {
12581
- const D = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), W = parseFloat(LA), hA = parseFloat(gA);
12581
+ const D = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), W = parseFloat(LA), hA = parseFloat(oA);
12582
12582
  return {
12583
12583
  name: l.trim(),
12584
12584
  gender: V,
@@ -12622,7 +12622,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12622
12622
  Q(Qe[cA + 1]);
12623
12623
  }
12624
12624
  }, k = (D, W) => {
12625
- S(""), D === "chest" ? ke(W) : D === "stomach" ? BA(W) : D === "seat" ? FA(W) : D === "hips" && oA(W);
12625
+ S(""), D === "chest" ? ke(W) : D === "stomach" ? BA(W) : D === "seat" ? FA(W) : D === "hips" && gA(W);
12626
12626
  const hA = Qe.indexOf(D), uA = hA === ae - 1;
12627
12627
  setTimeout(() => {
12628
12628
  if (uA) {
@@ -12667,7 +12667,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12667
12667
  return;
12668
12668
  }
12669
12669
  if (S(""), I("calculating"), M(!0), c && nA) {
12670
- const hA = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), uA = parseFloat(gA);
12670
+ const hA = m === "in" ? (parseInt(T, 10) || 0) * 12 + (parseInt(X, 10) || 0) : parseFloat(F), uA = parseFloat(oA);
12671
12671
  try {
12672
12672
  const ee = await c({
12673
12673
  photoBase64: nA,
@@ -12880,7 +12880,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12880
12880
  type: "number",
12881
12881
  inputMode: "numeric",
12882
12882
  className: "ps-bp-inline-input",
12883
- value: gA,
12883
+ value: oA,
12884
12884
  placeholder: n("e.g. 30"),
12885
12885
  onChange: (D) => {
12886
12886
  N(D.target.value), S("");
@@ -12943,7 +12943,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12943
12943
  vA && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: vA })
12944
12944
  ] }, "manual-identity"),
12945
12945
  w === "manual" && p === "chest" && !q && /* @__PURE__ */ e(
12946
- _o,
12946
+ Ag,
12947
12947
  {
12948
12948
  stepKey: "chest",
12949
12949
  title: n("CHEST PROFILE"),
@@ -12956,7 +12956,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12956
12956
  }
12957
12957
  ),
12958
12958
  w === "manual" && p === "stomach" && /* @__PURE__ */ e(
12959
- _o,
12959
+ Ag,
12960
12960
  {
12961
12961
  stepKey: "stomach",
12962
12962
  title: n("STOMACH PROFILE"),
@@ -12969,7 +12969,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12969
12969
  }
12970
12970
  ),
12971
12971
  w === "manual" && p === "seat" && /* @__PURE__ */ e(
12972
- _o,
12972
+ Ag,
12973
12973
  {
12974
12974
  stepKey: "seat",
12975
12975
  title: n("BACK & SEAT"),
@@ -12982,7 +12982,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
12982
12982
  }
12983
12983
  ),
12984
12984
  w === "manual" && p === "hips" && q && kA.hips && /* @__PURE__ */ e(
12985
- _o,
12985
+ Ag,
12986
12986
  {
12987
12987
  stepKey: "hips",
12988
12988
  title: n("HIP PROFILE"),
@@ -13362,7 +13362,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
13362
13362
  /* @__PURE__ */ A("div", { style: { marginTop: "auto", marginBottom: "auto" }, children: /* @__PURE__ */ e("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
13363
13363
  /* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
13364
13364
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: n("NAME") }),
13365
- /* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: de, type: "text", className: `ps-bp-inline-input${pA ? " ps-cpw-shake" : ""}`, value: l, placeholder: n("e.g. My Photo Profile"), onChange: (D) => {
13365
+ /* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: de, type: "text", className: `ps-bp-inline-input${dA ? " ps-cpw-shake" : ""}`, value: l, placeholder: n("e.g. My Photo Profile"), onChange: (D) => {
13366
13366
  R(D.target.value), S("");
13367
13367
  }, onAnimationEnd: () => ge(!1) }) })
13368
13368
  ] }),
@@ -13596,7 +13596,7 @@ function Ui({ onSave: o, onCancel: g, apiUrl: t, apiKey: i, onPhotoPreview: a, o
13596
13596
  /* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
13597
13597
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: n("AGE") }),
13598
13598
  /* @__PURE__ */ e("div", { className: "ps-bp-inline-input-group", children: [
13599
- /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: gA, placeholder: n("e.g. 30"), onChange: (D) => {
13599
+ /* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: oA, placeholder: n("e.g. 30"), onChange: (D) => {
13600
13600
  N(D.target.value), S("");
13601
13601
  } }),
13602
13602
  /* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: n("years") })
@@ -14242,14 +14242,14 @@ function gr({
14242
14242
  error: E,
14243
14243
  t: F
14244
14244
  }) {
14245
- const O = parseFloat(i) || 173, T = (parseFloat(c) || 5) * 12 + (parseFloat(w) || 8), aA = Math.floor(T / 12), X = T % 12, UA = parseFloat(p) || (g === "kg" ? 70 : 154), LA = parseFloat(C) || 30, h = g === "kg" ? 30 : 66, gA = g === "kg" ? 200 : 440, N = 120, vA = 220, S = 48, nA = 84, MA = 13, iA = 100, YA = (O - N) / (vA - N) * 100, VA = (T - S) / (nA - S) * 100, HA = (UA - h) / (gA - h) * 100, pe = (LA - MA) / (iA - MA) * 100, _A = (Z) => {
14245
+ const O = parseFloat(i) || 173, T = (parseFloat(c) || 5) * 12 + (parseFloat(w) || 8), aA = Math.floor(T / 12), X = T % 12, UA = parseFloat(p) || (g === "kg" ? 70 : 154), LA = parseFloat(C) || 30, h = g === "kg" ? 30 : 66, oA = g === "kg" ? 200 : 440, N = 120, vA = 220, S = 48, nA = 84, MA = 13, iA = 100, YA = (O - N) / (vA - N) * 100, VA = (T - S) / (nA - S) * 100, HA = (UA - h) / (oA - h) * 100, pe = (LA - MA) / (iA - MA) * 100, _A = (Z) => {
14246
14246
  const me = Math.max(S, Math.min(nA, Z));
14247
14247
  n(String(Math.floor(me / 12))), r(String(me % 12));
14248
14248
  }, yA = () => {
14249
14249
  o === "in" ? _A(T + 1) : a(String(Math.min(vA, O + 1)));
14250
14250
  }, oe = () => {
14251
14251
  o === "in" ? _A(T - 1) : a(String(Math.max(N, O - 1)));
14252
- }, SA = () => Q(String(Math.min(gA, UA + 1))), Ce = () => Q(String(Math.max(h, UA - 1))), mA = () => I(String(Math.min(iA, LA + 1))), Ie = () => I(String(Math.max(MA, LA - 1)));
14252
+ }, SA = () => Q(String(Math.min(oA, UA + 1))), Ce = () => Q(String(Math.max(h, UA - 1))), mA = () => I(String(Math.min(iA, LA + 1))), Ie = () => I(String(Math.max(MA, LA - 1)));
14253
14253
  return /* @__PURE__ */ e("div", { className: "ps-bpm-root", children: [
14254
14254
  /* @__PURE__ */ e("div", { className: "ps-bpm-header", children: [
14255
14255
  /* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: F("Body Measurements") }),
@@ -14337,7 +14337,7 @@ function gr({
14337
14337
  type: "range",
14338
14338
  className: "ps-bpm-slider",
14339
14339
  min: h,
14340
- max: gA,
14340
+ max: oA,
14341
14341
  step: 1,
14342
14342
  value: UA,
14343
14343
  onChange: (Z) => Q(Z.target.value),
@@ -14676,7 +14676,7 @@ function ut({
14676
14676
  ] })
14677
14677
  ] });
14678
14678
  }
14679
- function Ag({
14679
+ function eg({
14680
14680
  stepNumber: o,
14681
14681
  totalSteps: g,
14682
14682
  title: t,
@@ -14860,71 +14860,71 @@ function pr({
14860
14860
  }) {
14861
14861
  const m = t ? cr : Br, [E, F] = f("photo");
14862
14862
  E === "photo" || m.indexOf(E);
14863
- const O = jo(), T = at(a), aA = R?.height, X = R?.weight, UA = R?.age, LA = R?.heightUnit === "ft" ? "in" : R?.heightUnit, h = R?.weightUnit, gA = aA != null && LA === "cm" ? String(Math.round(aA)) : aA != null && (LA === "in" || LA === "ft") ? String(Math.round(aA * 2.54)) : i.current.height || "", N = aA != null && (LA === "in" || LA === "ft") ? Math.round(aA) : aA != null && LA === "cm" ? Math.round(aA / 2.54) : null, vA = N != null ? String(Math.floor(N / 12)) : i.current.heightFeet || "", S = N != null ? String(N % 12) : i.current.heightInches || "", nA = X != null ? String(Math.round(X)) : i.current.weight || "", MA = UA != null ? String(UA) : i.current.age || "", [iA, YA] = f(gA), [VA, HA] = f(vA), [pe, _A] = f(S), [yA, oe] = f(nA), [SA, Ce] = f(MA), [mA, Ie] = f(
14863
+ const O = jo(), T = at(a), aA = R?.height, X = R?.weight, UA = R?.age, LA = R?.heightUnit === "ft" ? "in" : R?.heightUnit, h = R?.weightUnit, oA = aA != null && LA === "cm" ? String(Math.round(aA)) : aA != null && (LA === "in" || LA === "ft") ? String(Math.round(aA * 2.54)) : i.current.height || "", N = aA != null && (LA === "in" || LA === "ft") ? Math.round(aA) : aA != null && LA === "cm" ? Math.round(aA / 2.54) : null, vA = N != null ? String(Math.floor(N / 12)) : i.current.heightFeet || "", S = N != null ? String(N % 12) : i.current.heightInches || "", nA = X != null ? String(Math.round(X)) : i.current.weight || "", MA = UA != null ? String(UA) : i.current.age || "", [iA, YA] = f(oA), [VA, HA] = f(vA), [pe, _A] = f(S), [yA, oe] = f(nA), [SA, Ce] = f(MA), [mA, Ie] = f(
14864
14864
  LA || (c === "ft" ? "in" : c || (T ? "in" : "cm"))
14865
14865
  ), [Z, me] = f(
14866
14866
  h || w || (T ? "lbs" : "kg")
14867
- ), fe = mA === "in" || Z === "lbs", [Ye, ne] = f(null), [de, pA] = f(null), [ge, jA] = f(null), [H, zA] = f(!1), [he, Oe] = f(""), [JA, ke] = f(null), [De, BA] = f(!1), RA = QA(null), [FA, y] = f(null), [oA, CA] = f(!1), [J, fA] = f(!1), [qA, TA] = f(() => N != null ? String(Math.round(N * 2.54)) : gA), [ve, GA] = f(null), [OA, ie] = f(null), [XA, P] = f(null), [q, kA] = f(null), [Qe, cA] = f(""), [ae, xe] = f(null), [re, Ae] = f(null), [PA, se] = f(() => ["US", "UK", "AU"].includes(a) ? a === "AU" ? "UK" : a : ["FR", "ES"].includes(a) ? "FR" : ["IT"].includes(a) ? "IT" : ["JP", "CN", "KR"].includes(a) ? "JP" : "EU"), [Pe, x] = f(!1), [b, k] = f(null), K = QA(null);
14867
+ ), fe = mA === "in" || Z === "lbs", [Ye, ne] = f(null), [de, dA] = f(null), [ge, jA] = f(null), [H, zA] = f(!1), [he, Oe] = f(""), [JA, ke] = f(null), [De, BA] = f(!1), RA = QA(null), [FA, y] = f(null), [gA, CA] = f(!1), [J, fA] = f(!1), [qA, TA] = f(() => N != null ? String(Math.round(N * 2.54)) : oA), [ve, GA] = f(null), [OA, ie] = f(null), [XA, P] = f(null), [q, kA] = f(null), [Qe, cA] = f(""), [ae, xe] = f(null), [re, Ae] = f(null), [PA, se] = f(() => ["US", "UK", "AU"].includes(a) ? a === "AU" ? "UK" : a : ["FR", "ES"].includes(a) ? "FR" : ["IT"].includes(a) ? "IT" : ["JP", "CN", "KR"].includes(a) ? "JP" : "EU"), [Pe, x] = f(!1), [b, k] = f(null), K = QA(null);
14868
14868
  xA(() => {
14869
14869
  if (!b) return;
14870
- const U = (dA) => {
14870
+ const U = (pA) => {
14871
14871
  const le = K.current;
14872
- le && !le.contains(dA.target) && k(null);
14872
+ le && !le.contains(pA.target) && k(null);
14873
14873
  };
14874
14874
  return document.addEventListener("mousedown", U), () => document.removeEventListener("mousedown", U);
14875
14875
  }, [b]);
14876
14876
  const EA = go[PA] || go.US, [$, lA] = f(""), IA = bA(async (U) => {
14877
- const dA = U.target.files?.[0];
14878
- if (!dA) return;
14877
+ const pA = U.target.files?.[0];
14878
+ if (!pA) return;
14879
14879
  if (FA !== !0) {
14880
14880
  lA(s("Please confirm that the person in the photo is 18 or older before uploading."));
14881
14881
  return;
14882
14882
  }
14883
- if (!dA.type.startsWith("image/")) {
14883
+ if (!pA.type.startsWith("image/")) {
14884
14884
  lA(s("Please upload an image file"));
14885
14885
  return;
14886
14886
  }
14887
- if (dA.size > 10 * 1024 * 1024) {
14887
+ if (pA.size > 10 * 1024 * 1024) {
14888
14888
  lA(s("Image must be under 10MB"));
14889
14889
  return;
14890
14890
  }
14891
- lA(""), zA(!0), Oe(s("Analyzing photo…")), ne(dA);
14892
- const le = URL.createObjectURL(dA);
14893
- pA(le);
14891
+ lA(""), zA(!0), Oe(s("Analyzing photo…")), ne(pA);
14892
+ const le = URL.createObjectURL(pA);
14893
+ dA(le);
14894
14894
  try {
14895
- const be = C && I ? gg(dA, C, I) : Promise.resolve({ isAdult: !0, confidence: "low" }), eo = uo(dA, { maxDimension: 1024, quality: 0.85 }), Ve = await be;
14895
+ const be = C && I ? tg(pA, C, I) : Promise.resolve({ isAdult: !0, confidence: "low" }), eo = uo(pA, { maxDimension: 1024, quality: 0.85 }), Ve = await be;
14896
14896
  if (!Ve.isAdult) {
14897
14897
  const qe = Ve.reasoning?.trim() || s("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
14898
- ke(qe), pA(null), ne(null);
14898
+ ke(qe), dA(null), ne(null);
14899
14899
  return;
14900
14900
  }
14901
14901
  const eA = await eo;
14902
14902
  jA(eA), ke(null);
14903
14903
  } catch {
14904
- lA(s("Failed to process image")), pA(null);
14904
+ lA(s("Failed to process image")), dA(null);
14905
14905
  } finally {
14906
14906
  zA(!1), Oe("");
14907
14907
  }
14908
14908
  }, [s, FA]), Be = QA(null), Ee = bA(() => {
14909
- de && !De && URL.revokeObjectURL(de), ne(null), pA(null), jA(null), BA(!1), RA.current && (RA.current.value = "");
14909
+ de && !De && URL.revokeObjectURL(de), ne(null), dA(null), jA(null), BA(!1), RA.current && (RA.current.value = "");
14910
14910
  }, [de, De]), KA = bA(() => {
14911
14911
  Ee(), YA(""), HA(""), _A(""), oe(""), Ce(""), xe(null), Ae(null), l?.();
14912
14912
  }, [Ee, l]);
14913
14913
  xA(() => {
14914
- const U = R?.photoBase64, dA = R?.id ?? null;
14915
- !U || !dA || Be.current !== dA && (Be.current = dA, jA(U), pA(U), BA(!0), y(!0));
14914
+ const U = R?.photoBase64, pA = R?.id ?? null;
14915
+ !U || !pA || Be.current !== pA && (Be.current = pA, jA(U), dA(U), BA(!0), y(!0));
14916
14916
  }, [R]), xA(() => {
14917
14917
  const U = R?.age;
14918
14918
  U != null && U > 0 && !SA && Ce(String(Math.round(U)));
14919
14919
  }, [R, SA]);
14920
14920
  const D = bA(() => {
14921
14921
  if (mA === "in") {
14922
- const dA = parseFloat(VA);
14923
- if (!dA || dA < 3 || dA > 8)
14922
+ const pA = parseFloat(VA);
14923
+ if (!pA || pA < 3 || pA > 8)
14924
14924
  return lA(s("Please enter a valid height")), !1;
14925
14925
  } else {
14926
- const dA = parseFloat(iA);
14927
- if (!dA || dA < 100 || dA > 250)
14926
+ const pA = parseFloat(iA);
14927
+ if (!pA || pA < 100 || pA > 250)
14928
14928
  return lA(s("Please enter a valid height (100-250 cm)")), !1;
14929
14929
  }
14930
14930
  const U = parseFloat(yA);
@@ -14937,19 +14937,19 @@ function pr({
14937
14937
  }, [mA, Z, iA, VA, yA, s]), W = () => {
14938
14938
  let U;
14939
14939
  if (mA === "in") {
14940
- const dA = parseFloat(VA) || 0, le = parseFloat(pe) || 0;
14941
- U = dA * 12 + le;
14940
+ const pA = parseFloat(VA) || 0, le = parseFloat(pe) || 0;
14941
+ U = pA * 12 + le;
14942
14942
  } else
14943
14943
  U = parseFloat(iA);
14944
14944
  return { heightVal: U, weightVal: parseFloat(yA) };
14945
14945
  }, hA = t ? "female" : "male", uA = (U) => {
14946
- const dA = m.indexOf(U);
14947
- return dA < m.length - 1 ? m[dA + 1] : "submit";
14946
+ const pA = m.indexOf(U);
14947
+ return pA < m.length - 1 ? m[pA + 1] : "submit";
14948
14948
  }, ee = () => {
14949
- const { heightVal: U, weightVal: dA } = W();
14950
- i.current.height = String(U), i.current.weight = String(dA), i.current.gender = hA, SA && (i.current.age = SA), n(mA), r(Z), u({
14949
+ const { heightVal: U, weightVal: pA } = W();
14950
+ i.current.height = String(U), i.current.weight = String(pA), i.current.gender = hA, SA && (i.current.age = SA), n(mA), r(Z), u({
14951
14951
  height: U,
14952
- weight: dA,
14952
+ weight: pA,
14953
14953
  heightUnit: mA,
14954
14954
  weightUnit: Z,
14955
14955
  gender: hA,
@@ -14963,12 +14963,12 @@ function pr({
14963
14963
  });
14964
14964
  }, ue = bA(() => {
14965
14965
  if (!ge || !Ye) return;
14966
- const U = mA === "in" ? (parseFloat(VA) || 0) * 12 + (parseFloat(pe) || 0) : parseFloat(iA) || 0, dA = parseFloat(yA) || 0, le = parseFloat(SA) || void 0;
14966
+ const U = mA === "in" ? (parseFloat(VA) || 0) * 12 + (parseFloat(pe) || 0) : parseFloat(iA) || 0, pA = parseFloat(yA) || 0, le = parseFloat(SA) || void 0;
14967
14967
  M({
14968
14968
  photoFile: Ye,
14969
14969
  photoBase64: ge,
14970
14970
  height: U,
14971
- weight: dA,
14971
+ weight: pA,
14972
14972
  heightUnit: mA,
14973
14973
  weightUnit: Z,
14974
14974
  gender: hA,
@@ -15024,12 +15024,12 @@ function pr({
15024
15024
  }
15025
15025
  ue();
15026
15026
  } else if (E === "scan-details") {
15027
- const U = mA === "in" ? parseFloat(VA) > 0 || parseFloat(pe) > 0 : parseFloat(iA) > 0, dA = parseFloat(yA) > 0;
15027
+ const U = mA === "in" ? parseFloat(VA) > 0 || parseFloat(pe) > 0 : parseFloat(iA) > 0, pA = parseFloat(yA) > 0;
15028
15028
  if (!U) {
15029
15029
  lA(s("Please enter your height"));
15030
15030
  return;
15031
15031
  }
15032
- if (!dA) {
15032
+ if (!pA) {
15033
15033
  lA(s("Please enter your weight"));
15034
15034
  return;
15035
15035
  }
@@ -15044,8 +15044,8 @@ function pr({
15044
15044
  lA(""), ue();
15045
15045
  }
15046
15046
  }, [E, m, D, ve, OA, XA, q, ae, re, mA, Z, iA, VA, pe, yA, SA, ge, Ye, FA, O, t, hA, L, G, ue]), io = (U) => {
15047
- const dA = m.indexOf(U);
15048
- return dA > 0 ? m[dA - 1] : null;
15047
+ const pA = m.indexOf(U);
15048
+ return pA > 0 ? m[pA - 1] : null;
15049
15049
  }, ze = bA(() => {
15050
15050
  if (lA(""), E === "basics")
15051
15051
  V();
@@ -15067,8 +15067,8 @@ function pr({
15067
15067
  if (mA === "cm") {
15068
15068
  const U = parseFloat(iA);
15069
15069
  if (U > 0) {
15070
- const dA = Math.round(U / 2.54);
15071
- HA(String(Math.floor(dA / 12))), _A(String(dA % 12));
15070
+ const pA = Math.round(U / 2.54);
15071
+ HA(String(Math.floor(pA / 12))), _A(String(pA % 12));
15072
15072
  }
15073
15073
  }
15074
15074
  Z === "kg" && yA && oe(String(Math.round(parseFloat(yA) * 2.205))), Ie("in"), me("lbs"), n("in"), r("lbs"), Q?.("in");
@@ -15194,8 +15194,8 @@ function pr({
15194
15194
  ] })
15195
15195
  ] });
15196
15196
  if (E === "photo" || E === "scan-details") {
15197
- const U = mA === "in" ? parseFloat(VA) > 0 || parseFloat(pe) > 0 : parseFloat(iA) > 0, dA = parseFloat(yA) > 0, le = !!de, be = [];
15198
- H && be.push(s("Analyzing photo…")), !le && !H && be.push(s("Upload a photo")), U || be.push(s("Enter your height")), dA || be.push(s("Enter your weight")), t && (!ae || !re) && be.push(s("Enter your bra size"));
15197
+ const U = mA === "in" ? parseFloat(VA) > 0 || parseFloat(pe) > 0 : parseFloat(iA) > 0, pA = parseFloat(yA) > 0, le = !!de, be = [];
15198
+ H && be.push(s("Analyzing photo…")), !le && !H && be.push(s("Upload a photo")), U || be.push(s("Enter your height")), pA || be.push(s("Enter your weight")), t && (!ae || !re) && be.push(s("Enter your bra size"));
15199
15199
  const eo = be.length > 0, Ve = eo ? be[0] ?? s("Analyze My Size") : s("Analyze My Size");
15200
15200
  return O ? /* @__PURE__ */ e("div", { className: "ps-bp-wrapper", children: [
15201
15201
  /* @__PURE__ */ e("div", { className: "ps-bp-scan-progress", children: [
@@ -15219,7 +15219,7 @@ function pr({
15219
15219
  type: "button",
15220
15220
  onClick: () => CA((eA) => !eA),
15221
15221
  "aria-label": s("How to take a good photo"),
15222
- className: `ps-pm-help-pill ps-bp-scan-help-pill${oA ? " ps-active" : ""}`,
15222
+ className: `ps-pm-help-pill ps-bp-scan-help-pill${gA ? " ps-active" : ""}`,
15223
15223
  children: [
15224
15224
  /* @__PURE__ */ A("span", { className: "ps-pm-help-pill-q", "aria-hidden": "true", children: "?" }),
15225
15225
  /* @__PURE__ */ A("span", { children: s("How to take a good photo") })
@@ -15250,7 +15250,7 @@ function pr({
15250
15250
  t: s
15251
15251
  }
15252
15252
  ),
15253
- oA && /* @__PURE__ */ e(_, { children: [
15253
+ gA && /* @__PURE__ */ e(_, { children: [
15254
15254
  /* @__PURE__ */ A("div", { className: "ps-bp-photo-help-backdrop", onClick: () => CA(!1), "aria-hidden": "true" }),
15255
15255
  /* @__PURE__ */ e("div", { role: "dialog", "aria-label": s("How to take the best photo"), className: "ps-bp-photo-help", children: [
15256
15256
  /* @__PURE__ */ A("div", { className: "ps-bp-photo-help-handle", "aria-hidden": "true" }),
@@ -15585,8 +15585,8 @@ function pr({
15585
15585
  alignItems: "center",
15586
15586
  gap: "0.35vw",
15587
15587
  padding: "0.4vw 0.7vw",
15588
- background: oA ? "var(--ps-accent)" : "transparent",
15589
- color: oA ? "#FFFFFF" : "var(--ps-accent)",
15588
+ background: gA ? "var(--ps-accent)" : "transparent",
15589
+ color: gA ? "#FFFFFF" : "var(--ps-accent)",
15590
15590
  border: "1.5px solid var(--ps-accent)",
15591
15591
  borderRadius: "999px",
15592
15592
  cursor: "pointer",
@@ -15608,8 +15608,8 @@ function pr({
15608
15608
  minWidth: "14px",
15609
15609
  minHeight: "14px",
15610
15610
  borderRadius: "50%",
15611
- background: oA ? "#FFFFFF" : "var(--ps-accent)",
15612
- color: oA ? "var(--ps-accent)" : "#FFFFFF",
15611
+ background: gA ? "#FFFFFF" : "var(--ps-accent)",
15612
+ color: gA ? "var(--ps-accent)" : "#FFFFFF",
15613
15613
  fontSize: "0.65vw",
15614
15614
  fontWeight: 700,
15615
15615
  lineHeight: 1
@@ -15712,7 +15712,7 @@ function pr({
15712
15712
  ] })
15713
15713
  ] })
15714
15714
  ] }),
15715
- oA && /* @__PURE__ */ e(_, { children: [
15715
+ gA && /* @__PURE__ */ e(_, { children: [
15716
15716
  /* @__PURE__ */ A(
15717
15717
  "div",
15718
15718
  {
@@ -15875,7 +15875,7 @@ function pr({
15875
15875
  YA(String(Math.round(le * 2.54)));
15876
15876
  }
15877
15877
  Z === "lbs" && yA && oe(String(Math.round(parseFloat(yA) / 2.205))), Ie("cm"), me("kg"), n("cm"), r("kg"), Q?.("cm");
15878
- }, dA = () => {
15878
+ }, pA = () => {
15879
15879
  if (mA === "cm") {
15880
15880
  const le = parseFloat(iA) || 173, be = Math.round(le / 2.54);
15881
15881
  HA(String(Math.floor(be / 12))), _A(String(be % 12));
@@ -15899,7 +15899,7 @@ function pr({
15899
15899
  age: SA,
15900
15900
  setAge: Ce,
15901
15901
  switchToMetric: U,
15902
- switchToImperial: dA,
15902
+ switchToImperial: pA,
15903
15903
  onUploadPhoto: () => F("photo"),
15904
15904
  onSwitchToScan: () => F("photo"),
15905
15905
  hidePhotoOptions: L,
@@ -15925,7 +15925,7 @@ function pr({
15925
15925
  ] }),
15926
15926
  /* @__PURE__ */ e("div", { className: "ps-bp-system-toggle", children: [
15927
15927
  /* @__PURE__ */ A("button", { className: `ps-bp-system-btn${fe ? "" : " ps-bp-system-active"}`, onClick: U, type: "button", children: s("Metric") }),
15928
- /* @__PURE__ */ A("button", { className: `ps-bp-system-btn${fe ? " ps-bp-system-active" : ""}`, onClick: dA, type: "button", children: s("Imperial") })
15928
+ /* @__PURE__ */ A("button", { className: `ps-bp-system-btn${fe ? " ps-bp-system-active" : ""}`, onClick: pA, type: "button", children: s("Imperial") })
15929
15929
  ] }),
15930
15930
  /* @__PURE__ */ e("div", { className: "ps-bp-inline-fields", children: [
15931
15931
  /* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
@@ -15972,7 +15972,7 @@ function pr({
15972
15972
  ] }, "step-basics");
15973
15973
  })(),
15974
15974
  E === "chest" && !t && (O ? /* @__PURE__ */ A(
15975
- Ag,
15975
+ eg,
15976
15976
  {
15977
15977
  stepNumber: m.indexOf("chest") + 1,
15978
15978
  totalSteps: m.length,
@@ -15997,7 +15997,7 @@ function pr({
15997
15997
  /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: Qe || " " })
15998
15998
  ] }, "step-chest")),
15999
15999
  E === "midsection" && (O ? /* @__PURE__ */ A(
16000
- Ag,
16000
+ eg,
16001
16001
  {
16002
16002
  stepNumber: m.indexOf("midsection") + 1,
16003
16003
  totalSteps: m.length,
@@ -16030,7 +16030,7 @@ function pr({
16030
16030
  /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: Qe || " " })
16031
16031
  ] }, "step-midsection")),
16032
16032
  E === "seat" && (O ? /* @__PURE__ */ A(
16033
- Ag,
16033
+ eg,
16034
16034
  {
16035
16035
  stepNumber: m.indexOf("seat") + 1,
16036
16036
  totalSteps: m.length,
@@ -16063,7 +16063,7 @@ function pr({
16063
16063
  /* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: Qe || " " })
16064
16064
  ] }, "step-seat")),
16065
16065
  E === "hips" && t && (O ? /* @__PURE__ */ A(
16066
- Ag,
16066
+ eg,
16067
16067
  {
16068
16068
  stepNumber: m.indexOf("hips") + 1,
16069
16069
  totalSteps: m.length,
@@ -16161,7 +16161,7 @@ function pr({
16161
16161
  $ && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: $ })
16162
16162
  ] }, "step-bra"),
16163
16163
  !(O && E === "basics") && (() => {
16164
- const U = E === "basics" && L && !!G, dA = U ? G : Me, le = Xe(mA) ? ` (${Xe(mA)})` : "", be = U ? s("Find My Best Fit") + le : Ao ? s("Find My Size") + le : s("Next");
16164
+ const U = E === "basics" && L && !!G, pA = U ? G : Me, le = Xe(mA) ? ` (${Xe(mA)})` : "", be = U ? s("Find My Best Fit") + le : Ao ? s("Find My Size") + le : s("Next");
16165
16165
  return /* @__PURE__ */ e("div", { className: "ps-bp-nav", children: [
16166
16166
  E !== "basics" ? /* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: ze, type: "button", children: [
16167
16167
  /* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
@@ -16172,7 +16172,7 @@ function pr({
16172
16172
  "button",
16173
16173
  {
16174
16174
  className: `ps-bp-next-btn${!U && !We ? " ps-bp-btn-disabled" : ""}`,
16175
- onClick: dA,
16175
+ onClick: pA,
16176
16176
  disabled: !U && !We,
16177
16177
  type: "button",
16178
16178
  children: be
@@ -16218,16 +16218,16 @@ function xg({
16218
16218
  }), O = t ?? [
16219
16219
  { label: l("Centimeters"), value: "cm" },
16220
16220
  { label: l("Inches"), value: "in" }
16221
- ], [T, aA] = f(""), X = QA(null), [UA, LA] = f(null), [h, gA] = f(null), [N, vA] = f(null), [S, nA] = f(!1), [MA, iA] = f(!1), [YA, VA] = f(""), [HA, pe] = f(null), [_A, yA] = f(null), [oe, SA] = f(!1), Ce = bA(async (H) => {
16221
+ ], [T, aA] = f(""), X = QA(null), [UA, LA] = f(null), [h, oA] = f(null), [N, vA] = f(null), [S, nA] = f(!1), [MA, iA] = f(!1), [YA, VA] = f(""), [HA, pe] = f(null), [_A, yA] = f(null), [oe, SA] = f(!1), Ce = bA(async (H) => {
16222
16222
  const zA = H.target.files?.[0];
16223
16223
  if (!zA) return;
16224
16224
  const he = URL.createObjectURL(zA);
16225
- gA(zA), LA(he), iA(!0), VA("Analyzing photo…");
16225
+ oA(zA), LA(he), iA(!0), VA("Analyzing photo…");
16226
16226
  try {
16227
- const Oe = G && v ? gg(zA, G, v) : Promise.resolve({ isAdult: !0, confidence: "low" }), JA = uo(zA, R ? { maxDimension: 1536, quality: 0.85 } : {}), ke = await Oe;
16227
+ const Oe = G && v ? tg(zA, G, v) : Promise.resolve({ isAdult: !0, confidence: "low" }), JA = uo(zA, R ? { maxDimension: 1536, quality: 0.85 } : {}), ke = await Oe;
16228
16228
  if (!ke.isAdult) {
16229
16229
  const BA = ke.reasoning?.trim() || l("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
16230
- pe(BA), gA(null), LA(null);
16230
+ pe(BA), oA(null), LA(null);
16231
16231
  return;
16232
16232
  }
16233
16233
  const De = await JA;
@@ -16237,7 +16237,7 @@ function xg({
16237
16237
  iA(!1), VA("");
16238
16238
  }
16239
16239
  }, [R, G, v, l]), mA = bA(() => {
16240
- UA && URL.revokeObjectURL(UA), gA(null), LA(null), vA(null);
16240
+ UA && URL.revokeObjectURL(UA), oA(null), LA(null), vA(null);
16241
16241
  }, [UA]), Ie = (H, zA) => {
16242
16242
  F((he) => ({ ...he, [H]: zA })), aA("");
16243
16243
  }, Z = () => {
@@ -16352,7 +16352,7 @@ function xg({
16352
16352
  )
16353
16353
  ] })
16354
16354
  ] }) });
16355
- const Ye = g.some((H) => (parseFloat(E[H.key] || "") || 0) > 0), ne = !!h && _A === !0 && !MA, pA = MA || !ne && !Ye, ge = MA ? l("Analyzing photo…") : ne ? l("Analyze") : `${l("Find My Size")}${Xe(r) ? ` (${Xe(r)})` : ""}`, jA = ne ? me : Z;
16355
+ const Ye = g.some((H) => (parseFloat(E[H.key] || "") || 0) > 0), ne = !!h && _A === !0 && !MA, dA = MA || !ne && !Ye, ge = MA ? l("Analyzing photo…") : ne ? l("Analyze") : `${l("Find My Size")}${Xe(r) ? ` (${Xe(r)})` : ""}`, jA = ne ? me : Z;
16356
16356
  return s !== "photo" || a ? /* @__PURE__ */ e("div", { className: "ps-bp-layout", children: [
16357
16357
  /* @__PURE__ */ A("div", { className: "ps-bp-image", style: { position: "relative" }, children: /* @__PURE__ */ A("img", { src: c, alt: n, className: "ps-bp-image-img" }) }),
16358
16358
  /* @__PURE__ */ A("div", { className: "ps-bp-root", children: /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter", children: [
@@ -16874,9 +16874,9 @@ function xg({
16874
16874
  /* @__PURE__ */ e(
16875
16875
  "button",
16876
16876
  {
16877
- className: `ps-bp-next-btn${pA ? " ps-bp-btn-disabled" : ""}`,
16877
+ className: `ps-bp-next-btn${dA ? " ps-bp-btn-disabled" : ""}`,
16878
16878
  onClick: jA,
16879
- disabled: pA,
16879
+ disabled: dA,
16880
16880
  type: "button",
16881
16881
  children: [
16882
16882
  ge,
@@ -17097,7 +17097,7 @@ function br({
17097
17097
  xA(() => {
17098
17098
  h(!0);
17099
17099
  }, []);
17100
- const [gA, N] = f("idle"), [vA, S] = f(null), [nA, MA] = f(null), [iA, YA] = f(null), [VA, HA] = f(null), [pe, _A] = f(!1), [yA, oe] = f(null), [SA, Ce] = f(null), [mA, Ie] = f({}), Z = QA({});
17100
+ const [oA, N] = f("idle"), [vA, S] = f(null), [nA, MA] = f(null), [iA, YA] = f(null), [VA, HA] = f(null), [pe, _A] = f(!1), [yA, oe] = f(null), [SA, Ce] = f(null), [mA, Ie] = f({}), Z = QA({});
17101
17101
  xA(() => {
17102
17102
  Z.current = mA;
17103
17103
  }, [mA]);
@@ -17108,21 +17108,21 @@ function br({
17108
17108
  return d === null ? delete rA[B] : rA[B] = { ...d, sectionName: B }, Z.current = rA, rA;
17109
17109
  });
17110
17110
  }, []);
17111
- const [ne, de] = f(null), [pA, ge] = f(null), [jA, H] = f(!1), [zA, he] = f(!1);
17111
+ const [ne, de] = f(null), [dA, ge] = f(null), [jA, H] = f(!1), [zA, he] = f(!1);
17112
17112
  xA(() => {
17113
- pA?.recommendedSize && (console.log("[ps-sdk:reset] new sizingResult — clearing all section overrides", {
17114
- recommendedSize: pA.recommendedSize
17113
+ dA?.recommendedSize && (console.log("[ps-sdk:reset] new sizingResult — clearing all section overrides", {
17114
+ recommendedSize: dA.recommendedSize
17115
17115
  }), Ie({}));
17116
- }, [pA?.recommendedSize]);
17116
+ }, [dA?.recommendedSize]);
17117
17117
  const [Oe, JA] = f(!1), [ke, De] = f(!1), [BA, RA] = f(null), FA = QA(!1);
17118
17118
  xA(() => {
17119
- me.current = pA;
17120
- }, [pA]), xA(() => {
17119
+ me.current = dA;
17120
+ }, [dA]), xA(() => {
17121
17121
  fe.current = BA;
17122
17122
  }, [BA]), xA(() => {
17123
17123
  Ye.current = iA;
17124
17124
  }, [iA]);
17125
- const [y, oA] = f(!1), CA = QA(!1), [J, fA] = f(Pn), qA = at(J), [TA, ve] = f(qA ? "in" : "cm"), [GA, OA] = f(qA ? "in" : "cm"), [ie, XA] = f(qA ? "lbs" : "kg");
17125
+ const [y, gA] = f(!1), CA = QA(!1), [J, fA] = f(Pn), qA = at(J), [TA, ve] = f(qA ? "in" : "cm"), [GA, OA] = f(qA ? "in" : "cm"), [ie, XA] = f(qA ? "lbs" : "kg");
17126
17126
  xA(() => {
17127
17127
  const B = wo(i);
17128
17128
  B === "foot" || B === "head" ? ve("cm") : B === "face" && ve("mm");
@@ -17132,7 +17132,7 @@ function br({
17132
17132
  }, []), [Be, Ee] = f(!1), [KA, D] = f(null), [W, hA] = f(null), uA = QA(null), ee = QA(() => !1), ue = QA(() => {
17133
17133
  }), Me = bA((B, d) => {
17134
17134
  ee.current = B, ue.current = d;
17135
- }, []), io = QA(null), ze = QA(null), We = QA(null), Ao = QA(null), ye = QA(null), Je = QA(!1), U = QA(null), dA = QA(null), [le, be] = f(null), [eo, Ve] = f(null), eA = QA(null), qe = QA(null), ro = QA(!1), mo = QA(null);
17135
+ }, []), io = QA(null), ze = QA(null), We = QA(null), Ao = QA(null), ye = QA(null), Je = QA(!1), U = QA(null), pA = QA(null), [le, be] = f(null), [eo, Ve] = f(null), eA = QA(null), qe = QA(null), ro = QA(!1), mo = QA(null);
17136
17136
  xA(() => {
17137
17137
  try {
17138
17138
  const B = Re(), d = je(r);
@@ -17159,11 +17159,11 @@ function br({
17159
17159
  }).catch(() => {
17160
17160
  }), () => d.abort();
17161
17161
  }, [g, t, r, i]);
17162
- const tg = 22, Ro = QA(0), Po = QA(null), bo = QA(null), xo = QA(null), Ho = QA(null), Mo = QA(null), ng = QA(null), ig = QA(""), so = QA(null);
17162
+ const ng = 22, Ro = QA(0), Po = QA(null), bo = QA(null), xo = QA(null), Ho = QA(null), Mo = QA(null), ig = QA(null), rg = QA(""), so = QA(null);
17163
17163
  xA(() => {
17164
- if (gA === "processing") {
17164
+ if (oA === "processing") {
17165
17165
  if (so.current) return;
17166
- Ro.current = 0, ng.current = Date.now(), ig.current = "";
17166
+ Ro.current = 0, ig.current = Date.now(), rg.current = "";
17167
17167
  const B = [
17168
17168
  { at: 0, text: X("Preparing your image...") },
17169
17169
  { at: 15, text: X("Analyzing body proportions...") },
@@ -17174,7 +17174,7 @@ function br({
17174
17174
  ], d = 2 * Math.PI * 38;
17175
17175
  return so.current = setInterval(() => {
17176
17176
  if (Je.current) return;
17177
- const z = ng.current || Date.now(), rA = (Date.now() - z) / 1e3, tA = Math.min(95, rA / tg * 100);
17177
+ const z = ig.current || Date.now(), rA = (Date.now() - z) / 1e3, tA = Math.min(95, rA / ng * 100);
17178
17178
  Ro.current = tA;
17179
17179
  const AA = Math.round(tA);
17180
17180
  if (Po.current && (Po.current.style.width = `${AA}%`), bo.current && (bo.current.textContent = `${AA}%`), Mo.current) {
@@ -17182,33 +17182,33 @@ function br({
17182
17182
  Mo.current.style.strokeDashoffset = String(Y);
17183
17183
  }
17184
17184
  if (Ho.current) {
17185
- const Y = Math.max(0, tg - Math.floor(rA));
17186
- Ho.current.textContent = rA >= tg ? "•••" : `~${Y}s`;
17185
+ const Y = Math.max(0, ng - Math.floor(rA));
17186
+ Ho.current.textContent = rA >= ng ? "•••" : `~${Y}s`;
17187
17187
  }
17188
17188
  if (xo.current) {
17189
17189
  const Y = [...B].reverse().find((j) => AA >= j.at);
17190
- if (Y && Y.text !== ig.current) {
17190
+ if (Y && Y.text !== rg.current) {
17191
17191
  const j = xo.current;
17192
17192
  j.style.opacity = "0", setTimeout(() => {
17193
17193
  j.textContent = Y.text, j.style.opacity = "1";
17194
- }, 180), ig.current = Y.text;
17194
+ }, 180), rg.current = Y.text;
17195
17195
  }
17196
17196
  }
17197
17197
  }, 200), () => {
17198
17198
  clearInterval(so.current), so.current = null;
17199
17199
  };
17200
17200
  } else
17201
- so.current && (clearInterval(so.current), so.current = null), ng.current = null;
17202
- }, [gA, X]), xA(() => () => {
17201
+ so.current && (clearInterval(so.current), so.current = null), ig.current = null;
17202
+ }, [oA, X]), xA(() => () => {
17203
17203
  nA && URL.revokeObjectURL(nA);
17204
17204
  }, [nA]), xA(() => {
17205
- if (gA !== "idle") {
17205
+ if (oA !== "idle") {
17206
17206
  const B = window.scrollY, d = document.body.style.overflow, z = document.body.style.overscrollBehavior;
17207
17207
  return document.body.style.overflow = "hidden", document.body.style.overscrollBehavior = "none", () => {
17208
17208
  document.body.style.overflow = d, document.body.style.overscrollBehavior = z, window.scrollTo(0, B);
17209
17209
  };
17210
17210
  }
17211
- }, [gA]), xA(() => {
17211
+ }, [oA]), xA(() => {
17212
17212
  lo("profiles", PA);
17213
17213
  }, [PA]), xA(() => {
17214
17214
  lo("history", Pe);
@@ -17225,7 +17225,7 @@ function br({
17225
17225
  RA({ found: !1 });
17226
17226
  return;
17227
17227
  }
17228
- oA(!0);
17228
+ gA(!0);
17229
17229
  const B = je(r), d = Re();
17230
17230
  fetch(`${B}/api/v1/sizing/sizeguide`, {
17231
17231
  method: "POST",
@@ -17235,10 +17235,10 @@ function br({
17235
17235
  RA(z || { found: !1 });
17236
17236
  }).catch(() => {
17237
17237
  RA({ found: !1 });
17238
- }).finally(() => oA(!1));
17238
+ }).finally(() => gA(!1));
17239
17239
  }, [r, i, F]);
17240
17240
  const mt = He(() => {
17241
- switch (gA) {
17241
+ switch (oA) {
17242
17242
  case "welcome":
17243
17243
  case "body-profile":
17244
17244
  return 1;
@@ -17252,7 +17252,7 @@ function br({
17252
17252
  default:
17253
17253
  return 1;
17254
17254
  }
17255
- }, [gA]), yo = bA(
17255
+ }, [oA]), yo = bA(
17256
17256
  (B, d, z) => {
17257
17257
  let rA = b, tA = PA.find((AA) => AA.id === rA);
17258
17258
  if (!tA) {
@@ -17297,12 +17297,12 @@ function br({
17297
17297
  }
17298
17298
  },
17299
17299
  [b, PA, r, o, i, O, IA]
17300
- ), rg = QA(null), [Fo, sg] = f(null), Hg = bA(async (B) => {
17300
+ ), sg = QA(null), [Fo, Hg] = f(null), To = bA(async (B) => {
17301
17301
  const d = B.height ?? B.heightCm ?? 0, z = B.weight ?? B.weightKg ?? 0, rA = !!B.measurements && Object.keys(B.measurements).length > 0, tA = B.photoBase64;
17302
- if (!rA && tA && d > 0 && rg.current) {
17302
+ if (!rA && tA && d > 0 && sg.current) {
17303
17303
  try {
17304
17304
  const Y = tA.startsWith("data:") ? tA : `data:image/jpeg;base64,${tA}`, j = await fetch(Y).then((ZA) => ZA.blob()), sA = new File([j], "profile-photo.jpg", { type: j.type || "image/jpeg" });
17305
- await rg.current({
17305
+ await sg.current({
17306
17306
  photoFile: sA,
17307
17307
  photoBase64: tA,
17308
17308
  height: d,
@@ -17344,13 +17344,13 @@ function br({
17344
17344
  const B = PA.find((tA) => tA.id === b);
17345
17345
  if (!B) return;
17346
17346
  const d = B.height ?? B.heightCm ?? 0, z = B.weight ?? B.weightKg ?? 0;
17347
- d > 0 && z > 0 && sg(B);
17348
- }, [PA, b]), bt = bA(() => {
17347
+ d > 0 && z > 0 && To(B);
17348
+ }, [PA, b, To]), bt = bA(() => {
17349
17349
  if (!Fo) return;
17350
17350
  const B = Fo;
17351
- sg(null), Hg(B);
17352
- }, [Fo, Hg]), xt = bA(() => {
17353
- sg(null), cA((B) => B + 1), N("body-profile");
17351
+ Hg(null), To(B);
17352
+ }, [Fo, To]), xt = bA(() => {
17353
+ Hg(null), cA((B) => B + 1), N("body-profile");
17354
17354
  }, []), Ht = QA(() => {
17355
17355
  }), Mt = bA(() => {
17356
17356
  console.log("[ps-sdk] handleOpen fired — opening modal"), N("body-profile"), l?.();
@@ -17361,7 +17361,7 @@ function br({
17361
17361
  D(null), uA.current && (N(uA.current), uA.current = null);
17362
17362
  return;
17363
17363
  }
17364
- switch (gA) {
17364
+ switch (oA) {
17365
17365
  case "body-profile":
17366
17366
  ao();
17367
17367
  break;
@@ -17395,7 +17395,7 @@ function br({
17395
17395
  ao();
17396
17396
  break;
17397
17397
  }
17398
- }, [gA, KA, SA, ao]), Ft = gA !== "idle" && gA !== "processing" && gA !== "result" && gA !== "welcome" && gA !== "body-profile" && gA !== "size-result", ag = bA((B) => {
17398
+ }, [oA, KA, SA, ao]), Ft = oA !== "idle" && oA !== "processing" && oA !== "result" && oA !== "welcome" && oA !== "body-profile" && oA !== "size-result", ag = bA((B) => {
17399
17399
  if (!Rt(B)) {
17400
17400
  HA(X("Please upload a JPEG, PNG, or WebP image.")), N("error"), E?.({ message: "Invalid file type", code: "INVALID_FILE" });
17401
17401
  return;
@@ -17406,8 +17406,8 @@ function br({
17406
17406
  }
17407
17407
  S(B), eA.current = B, qe.current = null;
17408
17408
  const d = URL.createObjectURL(B);
17409
- MA(d), V?.(B), dA.current = null, eg(d).then((z) => {
17410
- dA.current = z;
17409
+ MA(d), V?.(B), pA.current = null, og(d).then((z) => {
17410
+ pA.current = z;
17411
17411
  }).catch(() => {
17412
17412
  });
17413
17413
  }, [V, E]), Mg = bA(() => {
@@ -17643,7 +17643,7 @@ function br({
17643
17643
  H(!1);
17644
17644
  return;
17645
17645
  }
17646
- dA.current = null, be(null), eg(rA).then((DA) => (dA.current = DA, DA)).catch(() => null);
17646
+ pA.current = null, be(null), og(rA).then((DA) => (pA.current = DA, DA)).catch(() => null);
17647
17647
  const AA = po(rA).then((DA) => (be(DA), DA)).catch(() => null), Y = 8e3, j = await Promise.race([
17648
17648
  AA,
17649
17649
  new Promise((DA) => setTimeout(() => DA(null), Y))
@@ -17695,7 +17695,7 @@ function br({
17695
17695
  const DA = sA.bodyLandmarks, te = DA ? Object.keys(DA).filter(($A) => $A !== "imageWidth" && $A !== "imageHeight" && DA[$A]).length : 0;
17696
17696
  console.log(`[ps-sdk:debug] payload → bodyLandmarks=${!!DA}(${te} joints)`);
17697
17697
  }
17698
- const ZA = new Promise((DA) => setTimeout(DA, 6e3));
17698
+ const ZA = new Promise((DA) => setTimeout(DA, 2e3));
17699
17699
  try {
17700
17700
  const DA = Date.now(), te = JSON.stringify(sA).length;
17701
17701
  console.log(`[ps-sdk:T] ▶ POST /sizing/recommend payload=${Math.round(te / 1024)}KB bodyImage=${!!sA.bodyImage} landmarks=${!!sA.bodyLandmarks}`);
@@ -17730,7 +17730,7 @@ function br({
17730
17730
  }
17731
17731
  await ZA, H(!1);
17732
17732
  }, [r, o, i, TA, ie, J, BA, oo, yo]);
17733
- rg.current = cg;
17733
+ sg.current = cg;
17734
17734
  const Yo = bA(async (B) => {
17735
17735
  const d = B || vA || eA.current;
17736
17736
  if (!d || !ze.current || !We.current) {
@@ -17740,8 +17740,8 @@ function br({
17740
17740
  }
17741
17741
  B && B !== vA && (S(B), eA.current = B), Je.current = !1, De(!0), oe(Date.now());
17742
17742
  const z = Pr(wo(i)), rA = z === "apparel", tA = (B ? null : nA) || URL.createObjectURL(d);
17743
- (B || !nA) && MA(tA), rA && (!dA.current || !le) && (dA.current = null, be(null), eg(tA).then((AA) => {
17744
- dA.current = AA;
17743
+ (B || !nA) && MA(tA), rA && (!pA.current || !le) && (pA.current = null, be(null), og(tA).then((AA) => {
17744
+ pA.current = AA;
17745
17745
  }).catch(() => {
17746
17746
  }), po(tA).then((AA) => {
17747
17747
  be(AA);
@@ -17753,8 +17753,8 @@ function br({
17753
17753
  for (const co of j) {
17754
17754
  const Ue = Y[co]?.matchDetails || [];
17755
17755
  for (const Qo of Ue) {
17756
- const To = Qo.measurement.toLowerCase().trim();
17757
- NA.has(To) || (NA.add(To), Ne.push(Qo));
17756
+ const Xo = Qo.measurement.toLowerCase().trim();
17757
+ NA.has(Xo) || (NA.add(Xo), Ne.push(Qo));
17758
17758
  }
17759
17759
  }
17760
17760
  return Ne;
@@ -17772,25 +17772,25 @@ function br({
17772
17772
  });
17773
17773
  const $A = () => {
17774
17774
  const NA = /* @__PURE__ */ new Set(), Ne = [];
17775
- console.log("[ps-sdk:flatten] sizingResult keys:", Object.keys(pA || {})), console.log("[ps-sdk:flatten] root matchDetails:", (pA?.matchDetails || []).map((Ue) => Ue.measurement)), console.log("[ps-sdk:flatten] sections:", pA?.sections ? Object.keys(pA.sections) : "none");
17776
- const co = (Ue, Qo, To) => {
17775
+ console.log("[ps-sdk:flatten] sizingResult keys:", Object.keys(dA || {})), console.log("[ps-sdk:flatten] root matchDetails:", (dA?.matchDetails || []).map((Ue) => Ue.measurement)), console.log("[ps-sdk:flatten] sections:", dA?.sections ? Object.keys(dA.sections) : "none");
17776
+ const co = (Ue, Qo, Xo) => {
17777
17777
  if (Ue) {
17778
- console.log(`[ps-sdk:flatten] ${Qo} →`, Ue.map((Xo) => Xo.measurement));
17779
- for (const Xo of Ue) {
17780
- const Yg = Xo.measurement.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
17781
- NA.has(Yg) || (NA.add(Yg), Ne.push({ ...Xo, section: To }));
17778
+ console.log(`[ps-sdk:flatten] ${Qo} →`, Ue.map((Wo) => Wo.measurement));
17779
+ for (const Wo of Ue) {
17780
+ const Yg = Wo.measurement.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
17781
+ NA.has(Yg) || (NA.add(Yg), Ne.push({ ...Wo, section: Xo }));
17782
17782
  }
17783
17783
  }
17784
17784
  };
17785
- if (co(pA?.matchDetails, "root", void 0), pA?.sections)
17786
- for (const [Ue, Qo] of Object.entries(pA.sections))
17785
+ if (co(dA?.matchDetails, "root", void 0), dA?.sections)
17786
+ for (const [Ue, Qo] of Object.entries(dA.sections))
17787
17787
  co(Qo?.matchDetails, `section:${Ue}`, Ue);
17788
17788
  return console.log("[ps-sdk:flatten] final unique:", Ne.map((Ue) => Ue.measurement)), Ne;
17789
17789
  }, ce = te?.matchDetails && te.matchDetails.length ? te.matchDetails : $A();
17790
17790
  let wA;
17791
17791
  if (rA && ce.length) {
17792
- const NA = (pA?.unit || TA || "in").toString().toLowerCase(), Ne = NA === "cm" ? "cm" : NA === "mm" ? "mm" : "in";
17793
- wA = Qn(ce, dA.current, Ne);
17792
+ const NA = (dA?.unit || TA || "in").toString().toLowerCase(), Ne = NA === "cm" ? "cm" : NA === "mm" ? "mm" : "in";
17793
+ wA = Qn(ce, pA.current, Ne);
17794
17794
  }
17795
17795
  console.log("[ps-sdk:tryon] fitInfo built", { count: wA?.length || 0, areas: wA?.map((NA) => `${NA.area}(${NA.fit})`) });
17796
17796
  let we = o;
@@ -17813,7 +17813,7 @@ function br({
17813
17813
  productDescription: c,
17814
17814
  productMaterial: n,
17815
17815
  silhouetteContext: fn(
17816
- pA,
17816
+ dA,
17817
17817
  BA,
17818
17818
  te?.displayLabel,
17819
17819
  (() => {
@@ -17857,14 +17857,14 @@ function br({
17857
17857
  const Y = AA instanceof Error ? AA.message : X("Failed to start try-on"), j = AA instanceof Tg ? AA.code : void 0;
17858
17858
  HA(Y), N("error"), E?.({ message: Y, code: j });
17859
17859
  }
17860
- }, [vA, o, i, pA, s, E, Bg]);
17860
+ }, [vA, o, i, dA, s, E, Bg]);
17861
17861
  xA(() => {
17862
- if (!pA) {
17862
+ if (oA !== "size-result") {
17863
17863
  ro.current = !1;
17864
17864
  return;
17865
17865
  }
17866
- pA.found !== !1 && (FA.current || ro.current || ke || iA || !vA && !eA.current || (ro.current = !0, Yo()));
17867
- }, [pA, ke, iA, vA, Yo]);
17866
+ FA.current || ro.current || ke || iA || !(vA || eA.current) || (ro.current = !0, Yo());
17867
+ }, [oA, vA, ke, iA, Yo]);
17868
17868
  const Yt = bA(() => {
17869
17869
  if (iA)
17870
17870
  if (iA.startsWith("data:")) {
@@ -17953,7 +17953,7 @@ function br({
17953
17953
  d = await Xg(B, sA);
17954
17954
  } catch {
17955
17955
  }
17956
- const rA = Z.current, tA = pA?.recommendedSize ?? "", AA = Object.values(rA).map((j) => ({
17956
+ const rA = Z.current, tA = dA?.recommendedSize ?? "", AA = Object.values(rA).map((j) => ({
17957
17957
  sectionName: j.sectionName,
17958
17958
  selectedSize: j.selectedSize,
17959
17959
  selectedLength: j.selectedLength,
@@ -17964,12 +17964,12 @@ function br({
17964
17964
  productTitle: i,
17965
17965
  productImage: o,
17966
17966
  resultImageUrl: iA || void 0,
17967
- recommendedSize: pA?.recommendedSize,
17968
- confidence: pA?.confidence,
17969
- reasoning: pA?.reasoning,
17970
- internationalSizes: pA?.internationalSizes,
17971
- matchDetails: pA?.matchDetails,
17972
- sizingResult: pA || void 0,
17967
+ recommendedSize: dA?.recommendedSize,
17968
+ confidence: dA?.confidence,
17969
+ reasoning: dA?.reasoning,
17970
+ internationalSizes: dA?.internationalSizes,
17971
+ matchDetails: dA?.matchDetails,
17972
+ sizingResult: dA || void 0,
17973
17973
  sizeGuide: BA ? {
17974
17974
  found: BA.found,
17975
17975
  title: BA.title,
@@ -17990,14 +17990,14 @@ function br({
17990
17990
  const sA = [Y, ...j].slice(0, 50), ZA = new Set(sA.map((DA) => DA.id));
17991
17991
  return qt(ZA), sA;
17992
17992
  });
17993
- }, [i, o, iA, pA, BA, b, PA, vA]), Bo = QA(!1), Go = QA(!1);
17993
+ }, [i, o, iA, dA, BA, b, PA, vA]), Bo = QA(!1), Go = QA(!1);
17994
17994
  xA(() => {
17995
- if (gA === "size-result" && pA && !Bo.current)
17995
+ if (oA === "size-result" && dA && !Bo.current)
17996
17996
  Bo.current = !0, Go.current = !1, yg().catch(() => {
17997
17997
  });
17998
- else if (gA === "size-result" && pA && iA && !Go.current) {
17998
+ else if (oA === "size-result" && dA && iA && !Go.current) {
17999
17999
  Go.current = !0;
18000
- const B = Z.current, d = pA?.recommendedSize ?? "", z = Object.values(B).map((tA) => ({
18000
+ const B = Z.current, d = dA?.recommendedSize ?? "", z = Object.values(B).map((tA) => ({
18001
18001
  sectionName: tA.sectionName,
18002
18002
  selectedSize: tA.selectedSize,
18003
18003
  selectedLength: tA.selectedLength,
@@ -18022,9 +18022,9 @@ function br({
18022
18022
  }
18023
18023
  })();
18024
18024
  }
18025
- } else gA === "result" && iA && !Bo.current ? (Bo.current = !0, yg().catch(() => {
18026
- })) : (gA === "welcome" || gA === "body-profile") && (Bo.current = !1, Go.current = !1);
18027
- }, [gA, pA, iA]);
18025
+ } else oA === "result" && iA && !Bo.current ? (Bo.current = !0, yg().catch(() => {
18026
+ })) : (oA === "welcome" || oA === "body-profile") && (Bo.current = !1, Go.current = !1);
18027
+ }, [oA, dA, iA]);
18028
18028
  const Ot = bA((B) => {
18029
18029
  if (Bo.current = !0, Go.current = !!B.resultImageUrl, ro.current = !0, B.sizingResult ? ge(B.sizingResult) : B.recommendedSize && ge({
18030
18030
  recommendedSize: B.recommendedSize,
@@ -18032,7 +18032,7 @@ function br({
18032
18032
  reasoning: B.reasoning || "",
18033
18033
  internationalSizes: B.internationalSizes,
18034
18034
  matchDetails: B.matchDetails
18035
- }), B.sizeGuide && (RA(B.sizeGuide), oA(!1)), YA(B.resultImageUrl || null), (B.hasResult || B.resultImageUrl) && Vt(B.id).then((d) => {
18035
+ }), B.sizeGuide && (RA(B.sizeGuide), gA(!1)), YA(B.resultImageUrl || null), (B.hasResult || B.resultImageUrl) && Vt(B.id).then((d) => {
18036
18036
  if (!d) return;
18037
18037
  const z = URL.createObjectURL(d);
18038
18038
  YA(z);
@@ -18115,7 +18115,7 @@ function br({
18115
18115
  "--ps-logo-height": M.logoHeight
18116
18116
  }, Fg = Object.fromEntries(Object.entries(Nt).filter(([, B]) => B !== void 0));
18117
18117
  function Ut() {
18118
- switch (gA) {
18118
+ switch (oA) {
18119
18119
  case "welcome":
18120
18120
  return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(Vn, { productImage: o, setView: N, t: X }) }, "v-welcome");
18121
18121
  case "body-profile": {
@@ -18205,7 +18205,7 @@ function br({
18205
18205
  {
18206
18206
  estimationDone: Oe,
18207
18207
  sizingLoading: jA,
18208
- sizingResult: pA,
18208
+ sizingResult: dA,
18209
18209
  sizeGuide: BA,
18210
18210
  resultImageUrl: iA,
18211
18211
  productImage: o,
@@ -18238,7 +18238,7 @@ function br({
18238
18238
  if (!B) return;
18239
18239
  const d = B.height ?? B.heightCm;
18240
18240
  if (!d || d <= 0) return;
18241
- const z = B.heightUnit, rA = pA?.unit || TA;
18241
+ const z = B.heightUnit, rA = dA?.unit || TA;
18242
18242
  return (z === "in" || z === "ft") && rA !== "in" ? Math.round(d * 2.54) : (!z || z === "cm") && rA === "in" ? Math.round(d / 2.54 * 10) / 10 : d;
18243
18243
  })(),
18244
18244
  t: X
@@ -18434,19 +18434,19 @@ function br({
18434
18434
  ]
18435
18435
  }
18436
18436
  ),
18437
- gA !== "idle" && typeof document < "u" && vg(
18438
- /* @__PURE__ */ A("div", { className: Le("ps-tryon-overlay", L.overlay), style: Fg, "data-ps-tryon-portal": !0, children: /* @__PURE__ */ e("div", { className: Le(`ps-tryon-modal${gA === "result" && iA && pA || gA === "size-result" || gA === "estimation-review" || gA === "body-profile" || gA === "profiles" || gA === "no-chart" || gA === "photo-guide" ? " ps-tryon-modal-wide" : ""}`, L.modal), onClick: (B) => B.stopPropagation(), children: [
18437
+ oA !== "idle" && typeof document < "u" && vg(
18438
+ /* @__PURE__ */ A("div", { className: Le("ps-tryon-overlay", L.overlay), style: Fg, "data-ps-tryon-portal": !0, children: /* @__PURE__ */ e("div", { className: Le(`ps-tryon-modal${oA === "result" && iA && dA || oA === "size-result" || oA === "estimation-review" || oA === "body-profile" || oA === "profiles" || oA === "no-chart" || oA === "photo-guide" ? " ps-tryon-modal-wide" : ""}`, L.modal), onClick: (B) => B.stopPropagation(), children: [
18439
18439
  /* @__PURE__ */ e("div", { className: Le("ps-tryon-header ps-tryon-header-minimal", L.header), children: [
18440
18440
  /* @__PURE__ */ A(Sn, { activeLocale: T, onSelect: aA }),
18441
18441
  /* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: X("Profiles"), onClick: () => {
18442
- KA && D(null), gA === "profiles" ? (N(uA.current || "body-profile"), uA.current = null) : (uA.current = gA, N("profiles"));
18442
+ KA && D(null), oA === "profiles" ? (N(uA.current || "body-profile"), uA.current = null) : (uA.current = oA, N("profiles"));
18443
18443
  }, children: /* @__PURE__ */ A(Pg, {}) }),
18444
18444
  /* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: X("History"), onClick: () => {
18445
- gA === "profiles" && (N(uA.current || "body-profile"), uA.current = null), KA === "history" ? D(null) : (uA.current = uA.current || gA, D("history"));
18445
+ oA === "profiles" && (N(uA.current || "body-profile"), uA.current = null), KA === "history" ? D(null) : (uA.current = uA.current || oA, D("history"));
18446
18446
  }, children: /* @__PURE__ */ A(Ln, {}) }),
18447
18447
  /* @__PURE__ */ A("button", { onClick: ao, className: Le("ps-tryon-close", L.closeButton), children: /* @__PURE__ */ A(Bt, {}) })
18448
18448
  ] }),
18449
- gA !== "body-profile" && gA !== "processing" && !(gA === "size-result" && BA?.sections && Object.keys(BA.sections).length > 1) && /* @__PURE__ */ A(Kn, { view: gA, stepIndex: mt }),
18449
+ oA !== "body-profile" && oA !== "processing" && !(oA === "size-result" && BA?.sections && Object.keys(BA.sections).length > 1) && /* @__PURE__ */ A(Kn, { view: oA, stepIndex: mt }),
18450
18450
  /* @__PURE__ */ e("div", { ref: U, className: Le("ps-tryon-body", L.body), style: { position: "relative", overflow: KA ? "hidden" : void 0 }, children: [
18451
18451
  Ft && /* @__PURE__ */ e("button", { className: "ps-tryon-back-btn", onClick: yt, children: [
18452
18452
  /* @__PURE__ */ e("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [