@primestyleai/tryon 5.10.184 → 5.10.185

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.
@@ -528,7 +528,7 @@ function ei(e) {
528
528
  } catch {
529
529
  }
530
530
  }
531
- function no(e, t) {
531
+ function ro(e, t) {
532
532
  if (typeof window > "u") return t;
533
533
  try {
534
534
  const n = localStorage.getItem($r + e);
@@ -544,13 +544,13 @@ function Qo(e, t) {
544
544
  }
545
545
  }
546
546
  function Zn() {
547
- return no(_r, []);
547
+ return ro(_r, []);
548
548
  }
549
549
  function Bn(e) {
550
550
  Qo(_r, e), ei("profiles");
551
551
  }
552
552
  function oi() {
553
- return no(Ai, null);
553
+ return ro(Ai, null);
554
554
  }
555
555
  function Wg(e) {
556
556
  Qo(Ai, e), ei("active-profile");
@@ -17906,7 +17906,7 @@ function Kc({
17906
17906
  const YA = Jo[oe] || Jo.US, [ce, u] = f(() => B.current.referenceShoeBrandId || ""), [oA, I] = f(() => B.current.referenceShoeSizeSystem || Fc(i)), [Y, D] = f(() => B.current.referenceShoeSizeValue || B.current.referenceShoeSizeUS || ""), [R, tA] = f(() => x === "in" ? "in" : "cm"), [gA, HA] = f(() => {
17907
17907
  const b = B.current.detectedGender || B.current.gender;
17908
17908
  return b === "male" || b === "female" ? b : null;
17909
- }), EA = gA || (n ? "female" : "male"), Ie = gA || Yc(t, n), PA = kc(oA), je = G ? kr({ brandId: ce, size: Y, sizeSystem: oA, productTitle: t, gender: Ie }) : null, Ae = Rn.find((b) => b.id === ce), [SA, LA] = f(""), ro = uA(async (b) => {
17909
+ }), EA = gA || (n ? "female" : "male"), Ie = gA || Yc(t, n), PA = kc(oA), je = G ? kr({ brandId: ce, size: Y, sizeSystem: oA, productTitle: t, gender: Ie }) : null, Ae = Rn.find((b) => b.id === ce), [SA, LA] = f(""), no = uA(async (b) => {
17910
17910
  const vA = b.target.files?.[0];
17911
17911
  if (!vA) return;
17912
17912
  if (he !== !0) {
@@ -18427,7 +18427,7 @@ function Kc({
18427
18427
  ki,
18428
18428
  {
18429
18429
  photoPreview: WA,
18430
- handlePhotoSelect: ro,
18430
+ handlePhotoSelect: no,
18431
18431
  handleRemovePhoto: At,
18432
18432
  onAnalyze: lo,
18433
18433
  onSwitchToManual: () => {
@@ -18990,7 +18990,7 @@ function Kc({
18990
18990
  ] })
18991
18991
  ] }) })
18992
18992
  ] }),
18993
- /* @__PURE__ */ A("input", { ref: UA, type: "file", accept: "image/*", onChange: ro, style: { display: "none" } }),
18993
+ /* @__PURE__ */ A("input", { ref: UA, type: "file", accept: "image/*", onChange: no, style: { display: "none" } }),
18994
18994
  dA ? /* @__PURE__ */ o(iA, { children: [
18995
18995
  /* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
18996
18996
  /* @__PURE__ */ o("div", { className: "ps-bpm-bottom", children: [
@@ -19058,7 +19058,7 @@ function Kc({
19058
19058
  ref: UA,
19059
19059
  type: "file",
19060
19060
  accept: "image/*",
19061
- onChange: ro,
19061
+ onChange: no,
19062
19062
  style: { display: "none" }
19063
19063
  }
19064
19064
  ),
@@ -20742,7 +20742,7 @@ function BB({
20742
20742
  mA(() => {
20743
20743
  fA === "foot" || fA === "head" || fA === "wrist" ? ce("cm") : fA === "face" ? ce("mm") : fA === "body-basic" && ce(rA ? "in" : "cm");
20744
20744
  }, [fA, rA]);
20745
- const D = wA({}), [R, tA] = f("male"), [gA, HA] = f(0), [FA, EA] = f(Ye ?? null), [Ie, PA] = f(null), [je, Ae] = f(!1), [SA, LA] = f(() => no("profiles", [])), [ro, at] = f(() => Ds()), [At, ct] = f(() => no(Ln, null)), [Kt, ko] = f(null), [Ro, Yo] = f(null), [Bo, lo] = f(() => no("history", []).map(nB)), so = wA(null), We = wA(null), Lo = wA(new Set(no(Gn, []))), [jt, Go] = f(!1), Bt = wA(null), [To, b] = f(null), [vA, te] = f(null), [ke, ao] = f(null), [io, pA] = f(null), [vo, Io] = f(null), [Pe, Li] = f(() => oi()), [Gi, Ar] = f(() => /* @__PURE__ */ new Set()), [er, Cn] = f(null), uo = uA((a) => {
20745
+ const D = wA({}), [R, tA] = f("male"), [gA, HA] = f(0), [FA, EA] = f(Ye ?? null), [Ie, PA] = f(null), [je, Ae] = f(!1), [SA, LA] = f(() => ro("profiles", [])), [no, at] = f(() => Ds()), [At, ct] = f(() => ro(Ln, null)), [Kt, ko] = f(null), [Ro, Yo] = f(null), [Bo, lo] = f(() => ro("history", []).map(nB)), so = wA(null), We = wA(null), Lo = wA(new Set(ro(Gn, []))), [jt, Go] = f(!1), Bt = wA(null), [To, b] = f(null), [vA, te] = f(null), [ke, ao] = f(null), [io, pA] = f(null), [vo, Io] = f(null), [Pe, Li] = f(() => oi()), [Gi, Ar] = f(() => /* @__PURE__ */ new Set()), [er, Cn] = f(null), uo = uA((a) => {
20746
20746
  Li(a), Wg(a);
20747
20747
  }, []), [wB, Dn] = f(!1), [Oo, mo] = f(null), [Oi, Rt] = f(null), Ve = wA(null), or = wA(() => !1), tr = wA(() => {
20748
20748
  }), lt = wA(null), Qn = wA(!1), nr = wA(""), zi = uA((a, w) => {
@@ -20991,13 +20991,13 @@ function BB({
20991
20991
  }, [SA]), mA(() => {
20992
20992
  Qo("history", Bo.map(rB));
20993
20993
  }, [Bo]), mA(() => {
20994
- ro && fn(ro, SA, Pe).catch((a) => {
20994
+ no && fn(no, SA, Pe).catch((a) => {
20995
20995
  ko(a instanceof Error ? a.message : K("Could not load your saved profiles."));
20996
20996
  });
20997
- }, [ro?.accessToken]), mA(() => {
20998
- if (!(!ro || Qn.current || JSON.stringify({ profiles: SA, activeProfileId: Pe }) === nr.current))
20997
+ }, [no?.accessToken]), mA(() => {
20998
+ if (!(!no || Qn.current || JSON.stringify({ profiles: SA, activeProfileId: Pe }) === nr.current))
20999
20999
  return lt.current && clearTimeout(lt.current), lt.current = setTimeout(() => {
21000
- Ir(l, ro.accessToken, SA, Pe).then((w) => {
21000
+ Ir(l, no.accessToken, SA, Pe).then((w) => {
21001
21001
  et(w.profiles, w.activeProfileId);
21002
21002
  }).catch((w) => {
21003
21003
  ko(w instanceof Error ? w.message : K("Profile sync failed. Your local changes are still saved here."));
@@ -21005,8 +21005,8 @@ function BB({
21005
21005
  }, 650), () => {
21006
21006
  lt.current && clearTimeout(lt.current);
21007
21007
  };
21008
- }, [Pe, l, et, ro, SA, K]), mA(() => {
21009
- const a = () => LA(no("profiles", []));
21008
+ }, [Pe, l, et, no, SA, K]), mA(() => {
21009
+ const a = () => LA(ro("profiles", []));
21010
21010
  return window.addEventListener(Ut, a), () => window.removeEventListener(Ut, a);
21011
21011
  }, []), mA(() => {
21012
21012
  if (Re.current) return;
@@ -21058,7 +21058,7 @@ function BB({
21058
21058
  if (!N?.skipBodyEstimate) {
21059
21059
  if (M && w?.estimates) {
21060
21060
  const j = w.estimates, q = w.estimatesUnit || "cm";
21061
- Pn(M, j, q), LA(no("profiles", []));
21061
+ Pn(M, j, q), LA(ro("profiles", []));
21062
21062
  }
21063
21063
  }
21064
21064
  if (S(!0), w?.recommendedSize && M) {
@@ -21073,7 +21073,7 @@ function BB({
21073
21073
  confidence: w.confidence,
21074
21074
  sections: j,
21075
21075
  savedAt: Date.now()
21076
- }), LA(no("profiles", []));
21076
+ }), LA(ro("profiles", []));
21077
21077
  }
21078
21078
  },
21079
21079
  [Pe, SA, e, g, m]
@@ -21695,7 +21695,7 @@ function BB({
21695
21695
  }
21696
21696
  xo();
21697
21697
  }, [xo, vo]), tg = uA(async ({ rating: a, note: w }) => {
21698
- const N = !!ro, M = N ? SA.find((yA) => yA.id === Pe) : null, Z = We.current ?? void 0, j = so.current ?? void 0, q = _c({
21698
+ const N = !!no, M = N ? SA.find((yA) => yA.id === Pe) : null, Z = We.current ?? void 0, j = so.current ?? void 0, q = _c({
21699
21699
  jobId: Z,
21700
21700
  historyEntryId: j,
21701
21701
  resultImageUrl: CA,
@@ -21717,7 +21717,7 @@ function BB({
21717
21717
  profileLoggedIn: N,
21718
21718
  profileId: M?.id,
21719
21719
  profileName: M?.name,
21720
- profileAccessToken: ro?.accessToken
21720
+ profileAccessToken: no?.accessToken
21721
21721
  };
21722
21722
  if (yt(l)) {
21723
21723
  As(cA);
@@ -21728,7 +21728,7 @@ function BB({
21728
21728
  } catch (yA) {
21729
21729
  throw Lo.current.delete(q), Qo(Gn, Array.from(Lo.current).slice(-80)), yA;
21730
21730
  }
21731
- }, [Pe, l, m, KA, g, ro, SA, io, vo, CA, AA?.recommendedSize]), ng = uA(() => {
21731
+ }, [Pe, l, m, KA, g, no, SA, io, vo, CA, AA?.recommendedSize]), ng = uA(() => {
21732
21732
  Co.current = !1, No(), Oe(null), GA && URL.revokeObjectURL(GA), fe(null), Je(null), Do.current = !1, Uo.current = !1, so.current = null, We.current = null, b(null), te(null), ao(null), pA(null), Io(null), UA(null), sA(null), VA(null), eA(!1), Dn(!1), EA("basics"), HA((a) => a + 1), _("body-profile");
21733
21733
  }, [GA, No]), rg = uA((a) => {
21734
21734
  const w = SA.find((M) => M.id === a);
@@ -22132,7 +22132,7 @@ function BB({
22132
22132
  tryOnProcessing: L,
22133
22133
  tryOnStartedAt: Me,
22134
22134
  tryOnAvailable: qe && AA?.found !== !1,
22135
- showProfileCompletionCta: fA === "body" && !!AA && AA.found !== !1,
22135
+ showProfileCompletionCta: fA === "body" && !!AA && AA.found !== !1 && (!no || SA.length === 0),
22136
22136
  onProfileCompletionCta: Ui,
22137
22137
  bodyLandmarks: rr,
22138
22138
  faceLandmarks: Ri,
@@ -22195,7 +22195,7 @@ function BB({
22195
22195
  case "result":
22196
22196
  return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(ic, { setView: _ }) }, "v-result");
22197
22197
  case "profiles":
22198
- return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: ro ? /* @__PURE__ */ A(
22198
+ return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: no ? /* @__PURE__ */ A(
22199
22199
  $a,
22200
22200
  {
22201
22201
  profiles: SA,
@@ -22209,10 +22209,10 @@ function BB({
22209
22209
  uo(a), EA(null), _("body-profile");
22210
22210
  },
22211
22211
  onSaveProfileMeasurements: (a, w, N) => {
22212
- Pn(a, w, N ?? SA.find((M) => M.id === a)?.measurementsUnit ?? "cm"), LA(no("profiles", []));
22212
+ Pn(a, w, N ?? SA.find((M) => M.id === a)?.measurementsUnit ?? "cm"), LA(ro("profiles", []));
22213
22213
  },
22214
22214
  onSaveBraSize: (a, w, N) => {
22215
- ti(a, { bandSize: w, cupSize: N }), LA(no("profiles", []));
22215
+ ti(a, { bandSize: w, cupSize: N }), LA(ro("profiles", []));
22216
22216
  },
22217
22217
  onEditProfile: (a) => {
22218
22218
  Rt(a);
@@ -22267,13 +22267,13 @@ function BB({
22267
22267
  })).then((bA) => {
22268
22268
  if (bA) {
22269
22269
  if (Pn(w.id, bA.estimates, bA.unit), bA.userEstimates) {
22270
- const De = no("profiles", []), He = De.findIndex((OA) => OA.id === w.id);
22270
+ const De = ro("profiles", []), He = De.findIndex((OA) => OA.id === w.id);
22271
22271
  if (He >= 0) {
22272
22272
  const OA = De[He], Qe = bA.userEstimates, Ze = { ...OA };
22273
22273
  Qe.height && !(OA.height || OA.heightCm) && (Ze.height = Qe.height, Ze.heightCm = Qe.height, Ze.heightUnit = "cm"), Qe.weight && !(OA.weight || OA.weightKg) && (Ze.weight = Qe.weight, Ze.weightKg = Qe.weight, Ze.weightUnit = "kg"), Qe.age && !OA.age && (Ze.age = Qe.age), De[He] = Ze, Qo("profiles", De);
22274
22274
  }
22275
22275
  }
22276
- LA(no("profiles", []));
22276
+ LA(ro("profiles", []));
22277
22277
  }
22278
22278
  }).catch(() => {
22279
22279
  }).finally(() => {
@@ -22284,7 +22284,7 @@ function BB({
22284
22284
  }));
22285
22285
  },
22286
22286
  onDeleteProfile: (a) => {
22287
- LA((w) => w.filter((N) => N.id !== a)), Pe === a && uo(null), Qo("profiles", no("profiles", []).filter((w) => w.id !== a));
22287
+ LA((w) => w.filter((N) => N.id !== a)), Pe === a && uo(null), Qo("profiles", ro("profiles", []).filter((w) => w.id !== a));
22288
22288
  },
22289
22289
  onRequestDelete: (a) => Cn(a),
22290
22290
  onLogout: Si,
@@ -22507,7 +22507,7 @@ function BB({
22507
22507
  Va,
22508
22508
  {
22509
22509
  onConfirm: () => {
22510
- const a = er, w = no("profiles", []).filter((N) => N.id !== a);
22510
+ const a = er, w = ro("profiles", []).filter((N) => N.id !== a);
22511
22511
  Qo("profiles", w), LA(w), Pe === a && uo(null), Cn(null);
22512
22512
  },
22513
22513
  onCancel: () => Cn(null),