@primestyleai/tryon 5.10.182 → 5.10.184
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/index.js +38 -36
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +12 -10
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -528,7 +528,7 @@ function ei(e) {
|
|
|
528
528
|
} catch {
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function no(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
|
|
547
|
+
return no(_r, []);
|
|
548
548
|
}
|
|
549
549
|
function Bn(e) {
|
|
550
550
|
Qo(_r, e), ei("profiles");
|
|
551
551
|
}
|
|
552
552
|
function oi() {
|
|
553
|
-
return
|
|
553
|
+
return no(Ai, null);
|
|
554
554
|
}
|
|
555
555
|
function Wg(e) {
|
|
556
556
|
Qo(Ai, e), ei("active-profile");
|
|
@@ -1202,6 +1202,10 @@ const ms = [
|
|
|
1202
1202
|
fitType: "bag",
|
|
1203
1203
|
pattern: /\b(handbag|handbags|bag|bags|tote|totes|shoulder bag|hobo bag|crossbody|clutch|satchel|backpack|backpacks|weekender|duffle|duffel|wallet|wallets|purse|purses|briefcase|belt bag|fanny pack|luggage|suitcase|suitcases|small leather goods|leather goods)\b/i
|
|
1204
1204
|
},
|
|
1205
|
+
{
|
|
1206
|
+
fitType: "apparel",
|
|
1207
|
+
pattern: /\b(shirt|shirts|t-shirt|tee|top|tops|dress|dresses|jacket|jackets|coat|coats|pants|trousers|jeans|skirt|skirts|shorts|suit|suits|tuxedo|tuxedos|blazer|blazers|hoodie|hoodies|sweater|sweaters|cardigan|cardigans|apparel|clothing|garment|garments)\b/i
|
|
1208
|
+
},
|
|
1205
1209
|
{
|
|
1206
1210
|
fitType: "belt",
|
|
1207
1211
|
pattern: /\b(belt|belts|waist belt)\b/i
|
|
@@ -1229,10 +1233,6 @@ const ms = [
|
|
|
1229
1233
|
{
|
|
1230
1234
|
fitType: "accessory",
|
|
1231
1235
|
pattern: /\b(accessory|accessories|jewelry|jewellery|brooch|brooches|scarf|scarves|glove|gloves)\b/i
|
|
1232
|
-
},
|
|
1233
|
-
{
|
|
1234
|
-
fitType: "apparel",
|
|
1235
|
-
pattern: /\b(shirt|shirts|t-shirt|tee|top|tops|dress|dresses|jacket|jackets|coat|coats|pants|trousers|jeans|skirt|skirts|shorts|suit|suits|tuxedo|tuxedos|blazer|blazers|hoodie|hoodies|sweater|sweaters|cardigan|cardigans|apparel|clothing|garment|garments)\b/i
|
|
1236
1236
|
}
|
|
1237
1237
|
];
|
|
1238
1238
|
function li(e) {
|
|
@@ -16927,7 +16927,7 @@ function $a({
|
|
|
16927
16927
|
let X = null;
|
|
16928
16928
|
if (typeof window < "u")
|
|
16929
16929
|
try {
|
|
16930
|
-
const G = localStorage.getItem("
|
|
16930
|
+
const G = localStorage.getItem("profiles");
|
|
16931
16931
|
if (G) {
|
|
16932
16932
|
const DA = JSON.parse(G);
|
|
16933
16933
|
DA.length > 0 && (X = DA[0].id ?? null);
|
|
@@ -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(""),
|
|
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) => {
|
|
17910
17910
|
const vA = b.target.files?.[0];
|
|
17911
17911
|
if (!vA) return;
|
|
17912
17912
|
if (he !== !0) {
|
|
@@ -18378,7 +18378,7 @@ function Kc({
|
|
|
18378
18378
|
] }) }),
|
|
18379
18379
|
/* @__PURE__ */ o("div", { className: "ps-bpm-bottom", children: [
|
|
18380
18380
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-next-btn", onClick: lo, children: s(G ? ce ? Y ? "Analyze My Size" : "Choose size" : "Choose brand" : "Analyze My Size") }),
|
|
18381
|
-
/* @__PURE__ */ A(
|
|
18381
|
+
!c && /* @__PURE__ */ A(
|
|
18382
18382
|
gt,
|
|
18383
18383
|
{
|
|
18384
18384
|
mode: "scan",
|
|
@@ -18427,10 +18427,12 @@ function Kc({
|
|
|
18427
18427
|
ki,
|
|
18428
18428
|
{
|
|
18429
18429
|
photoPreview: WA,
|
|
18430
|
-
handlePhotoSelect:
|
|
18430
|
+
handlePhotoSelect: ro,
|
|
18431
18431
|
handleRemovePhoto: At,
|
|
18432
18432
|
onAnalyze: lo,
|
|
18433
|
-
onSwitchToManual: () =>
|
|
18433
|
+
onSwitchToManual: () => {
|
|
18434
|
+
c || QA("basics");
|
|
18435
|
+
},
|
|
18434
18436
|
error: SA,
|
|
18435
18437
|
photoStepHeight: ae,
|
|
18436
18438
|
onPhotoStepHeightChange: Be,
|
|
@@ -18444,7 +18446,7 @@ function Kc({
|
|
|
18444
18446
|
photoStatus: Oe,
|
|
18445
18447
|
photoRejection: fe,
|
|
18446
18448
|
onClearRejection: () => CA(null),
|
|
18447
|
-
hideTabs:
|
|
18449
|
+
hideTabs: c,
|
|
18448
18450
|
t: s
|
|
18449
18451
|
}
|
|
18450
18452
|
),
|
|
@@ -18988,7 +18990,7 @@ function Kc({
|
|
|
18988
18990
|
] })
|
|
18989
18991
|
] }) })
|
|
18990
18992
|
] }),
|
|
18991
|
-
/* @__PURE__ */ A("input", { ref: UA, type: "file", accept: "image/*", onChange:
|
|
18993
|
+
/* @__PURE__ */ A("input", { ref: UA, type: "file", accept: "image/*", onChange: ro, style: { display: "none" } }),
|
|
18992
18994
|
dA ? /* @__PURE__ */ o(iA, { children: [
|
|
18993
18995
|
/* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
|
|
18994
18996
|
/* @__PURE__ */ o("div", { className: "ps-bpm-bottom", children: [
|
|
@@ -19014,7 +19016,7 @@ function Kc({
|
|
|
19014
19016
|
)
|
|
19015
19017
|
] })
|
|
19016
19018
|
] }) : /* @__PURE__ */ o(iA, { children: [
|
|
19017
|
-
/* @__PURE__ */ o("div", { className: "ps-bp-photo-manual-switch", children: [
|
|
19019
|
+
!c && /* @__PURE__ */ o("div", { className: "ps-bp-photo-manual-switch", children: [
|
|
19018
19020
|
s("Prefer not to upload a photo?"),
|
|
19019
19021
|
" ",
|
|
19020
19022
|
/* @__PURE__ */ A(
|
|
@@ -19056,7 +19058,7 @@ function Kc({
|
|
|
19056
19058
|
ref: UA,
|
|
19057
19059
|
type: "file",
|
|
19058
19060
|
accept: "image/*",
|
|
19059
|
-
onChange:
|
|
19061
|
+
onChange: ro,
|
|
19060
19062
|
style: { display: "none" }
|
|
19061
19063
|
}
|
|
19062
19064
|
),
|
|
@@ -20740,7 +20742,7 @@ function BB({
|
|
|
20740
20742
|
mA(() => {
|
|
20741
20743
|
fA === "foot" || fA === "head" || fA === "wrist" ? ce("cm") : fA === "face" ? ce("mm") : fA === "body-basic" && ce(rA ? "in" : "cm");
|
|
20742
20744
|
}, [fA, rA]);
|
|
20743
|
-
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(() =>
|
|
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) => {
|
|
20744
20746
|
Li(a), Wg(a);
|
|
20745
20747
|
}, []), [wB, Dn] = f(!1), [Oo, mo] = f(null), [Oi, Rt] = f(null), Ve = wA(null), or = wA(() => !1), tr = wA(() => {
|
|
20746
20748
|
}), lt = wA(null), Qn = wA(!1), nr = wA(""), zi = uA((a, w) => {
|
|
@@ -20989,13 +20991,13 @@ function BB({
|
|
|
20989
20991
|
}, [SA]), mA(() => {
|
|
20990
20992
|
Qo("history", Bo.map(rB));
|
|
20991
20993
|
}, [Bo]), mA(() => {
|
|
20992
|
-
|
|
20994
|
+
ro && fn(ro, SA, Pe).catch((a) => {
|
|
20993
20995
|
ko(a instanceof Error ? a.message : K("Could not load your saved profiles."));
|
|
20994
20996
|
});
|
|
20995
|
-
}, [
|
|
20996
|
-
if (!(!
|
|
20997
|
+
}, [ro?.accessToken]), mA(() => {
|
|
20998
|
+
if (!(!ro || Qn.current || JSON.stringify({ profiles: SA, activeProfileId: Pe }) === nr.current))
|
|
20997
20999
|
return lt.current && clearTimeout(lt.current), lt.current = setTimeout(() => {
|
|
20998
|
-
Ir(l,
|
|
21000
|
+
Ir(l, ro.accessToken, SA, Pe).then((w) => {
|
|
20999
21001
|
et(w.profiles, w.activeProfileId);
|
|
21000
21002
|
}).catch((w) => {
|
|
21001
21003
|
ko(w instanceof Error ? w.message : K("Profile sync failed. Your local changes are still saved here."));
|
|
@@ -21003,8 +21005,8 @@ function BB({
|
|
|
21003
21005
|
}, 650), () => {
|
|
21004
21006
|
lt.current && clearTimeout(lt.current);
|
|
21005
21007
|
};
|
|
21006
|
-
}, [Pe, l, et,
|
|
21007
|
-
const a = () => LA(
|
|
21008
|
+
}, [Pe, l, et, ro, SA, K]), mA(() => {
|
|
21009
|
+
const a = () => LA(no("profiles", []));
|
|
21008
21010
|
return window.addEventListener(Ut, a), () => window.removeEventListener(Ut, a);
|
|
21009
21011
|
}, []), mA(() => {
|
|
21010
21012
|
if (Re.current) return;
|
|
@@ -21056,7 +21058,7 @@ function BB({
|
|
|
21056
21058
|
if (!N?.skipBodyEstimate) {
|
|
21057
21059
|
if (M && w?.estimates) {
|
|
21058
21060
|
const j = w.estimates, q = w.estimatesUnit || "cm";
|
|
21059
|
-
Pn(M, j, q), LA(
|
|
21061
|
+
Pn(M, j, q), LA(no("profiles", []));
|
|
21060
21062
|
}
|
|
21061
21063
|
}
|
|
21062
21064
|
if (S(!0), w?.recommendedSize && M) {
|
|
@@ -21071,7 +21073,7 @@ function BB({
|
|
|
21071
21073
|
confidence: w.confidence,
|
|
21072
21074
|
sections: j,
|
|
21073
21075
|
savedAt: Date.now()
|
|
21074
|
-
}), LA(
|
|
21076
|
+
}), LA(no("profiles", []));
|
|
21075
21077
|
}
|
|
21076
21078
|
},
|
|
21077
21079
|
[Pe, SA, e, g, m]
|
|
@@ -21693,7 +21695,7 @@ function BB({
|
|
|
21693
21695
|
}
|
|
21694
21696
|
xo();
|
|
21695
21697
|
}, [xo, vo]), tg = uA(async ({ rating: a, note: w }) => {
|
|
21696
|
-
const N = !!
|
|
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({
|
|
21697
21699
|
jobId: Z,
|
|
21698
21700
|
historyEntryId: j,
|
|
21699
21701
|
resultImageUrl: CA,
|
|
@@ -21715,7 +21717,7 @@ function BB({
|
|
|
21715
21717
|
profileLoggedIn: N,
|
|
21716
21718
|
profileId: M?.id,
|
|
21717
21719
|
profileName: M?.name,
|
|
21718
|
-
profileAccessToken:
|
|
21720
|
+
profileAccessToken: ro?.accessToken
|
|
21719
21721
|
};
|
|
21720
21722
|
if (yt(l)) {
|
|
21721
21723
|
As(cA);
|
|
@@ -21726,7 +21728,7 @@ function BB({
|
|
|
21726
21728
|
} catch (yA) {
|
|
21727
21729
|
throw Lo.current.delete(q), Qo(Gn, Array.from(Lo.current).slice(-80)), yA;
|
|
21728
21730
|
}
|
|
21729
|
-
}, [Pe, l, m, KA, g,
|
|
21731
|
+
}, [Pe, l, m, KA, g, ro, SA, io, vo, CA, AA?.recommendedSize]), ng = uA(() => {
|
|
21730
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");
|
|
21731
21733
|
}, [GA, No]), rg = uA((a) => {
|
|
21732
21734
|
const w = SA.find((M) => M.id === a);
|
|
@@ -22130,7 +22132,7 @@ function BB({
|
|
|
22130
22132
|
tryOnProcessing: L,
|
|
22131
22133
|
tryOnStartedAt: Me,
|
|
22132
22134
|
tryOnAvailable: qe && AA?.found !== !1,
|
|
22133
|
-
showProfileCompletionCta: fA
|
|
22135
|
+
showProfileCompletionCta: fA === "body" && !!AA && AA.found !== !1,
|
|
22134
22136
|
onProfileCompletionCta: Ui,
|
|
22135
22137
|
bodyLandmarks: rr,
|
|
22136
22138
|
faceLandmarks: Ri,
|
|
@@ -22193,7 +22195,7 @@ function BB({
|
|
|
22193
22195
|
case "result":
|
|
22194
22196
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(ic, { setView: _ }) }, "v-result");
|
|
22195
22197
|
case "profiles":
|
|
22196
|
-
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children:
|
|
22198
|
+
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: ro ? /* @__PURE__ */ A(
|
|
22197
22199
|
$a,
|
|
22198
22200
|
{
|
|
22199
22201
|
profiles: SA,
|
|
@@ -22207,10 +22209,10 @@ function BB({
|
|
|
22207
22209
|
uo(a), EA(null), _("body-profile");
|
|
22208
22210
|
},
|
|
22209
22211
|
onSaveProfileMeasurements: (a, w, N) => {
|
|
22210
|
-
Pn(a, w, N ?? SA.find((M) => M.id === a)?.measurementsUnit ?? "cm"), LA(
|
|
22212
|
+
Pn(a, w, N ?? SA.find((M) => M.id === a)?.measurementsUnit ?? "cm"), LA(no("profiles", []));
|
|
22211
22213
|
},
|
|
22212
22214
|
onSaveBraSize: (a, w, N) => {
|
|
22213
|
-
ti(a, { bandSize: w, cupSize: N }), LA(
|
|
22215
|
+
ti(a, { bandSize: w, cupSize: N }), LA(no("profiles", []));
|
|
22214
22216
|
},
|
|
22215
22217
|
onEditProfile: (a) => {
|
|
22216
22218
|
Rt(a);
|
|
@@ -22265,13 +22267,13 @@ function BB({
|
|
|
22265
22267
|
})).then((bA) => {
|
|
22266
22268
|
if (bA) {
|
|
22267
22269
|
if (Pn(w.id, bA.estimates, bA.unit), bA.userEstimates) {
|
|
22268
|
-
const De =
|
|
22270
|
+
const De = no("profiles", []), He = De.findIndex((OA) => OA.id === w.id);
|
|
22269
22271
|
if (He >= 0) {
|
|
22270
22272
|
const OA = De[He], Qe = bA.userEstimates, Ze = { ...OA };
|
|
22271
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);
|
|
22272
22274
|
}
|
|
22273
22275
|
}
|
|
22274
|
-
LA(
|
|
22276
|
+
LA(no("profiles", []));
|
|
22275
22277
|
}
|
|
22276
22278
|
}).catch(() => {
|
|
22277
22279
|
}).finally(() => {
|
|
@@ -22282,7 +22284,7 @@ function BB({
|
|
|
22282
22284
|
}));
|
|
22283
22285
|
},
|
|
22284
22286
|
onDeleteProfile: (a) => {
|
|
22285
|
-
LA((w) => w.filter((N) => N.id !== a)), Pe === a && uo(null), Qo("profiles",
|
|
22287
|
+
LA((w) => w.filter((N) => N.id !== a)), Pe === a && uo(null), Qo("profiles", no("profiles", []).filter((w) => w.id !== a));
|
|
22286
22288
|
},
|
|
22287
22289
|
onRequestDelete: (a) => Cn(a),
|
|
22288
22290
|
onLogout: Si,
|
|
@@ -22505,7 +22507,7 @@ function BB({
|
|
|
22505
22507
|
Va,
|
|
22506
22508
|
{
|
|
22507
22509
|
onConfirm: () => {
|
|
22508
|
-
const a = er, w =
|
|
22510
|
+
const a = er, w = no("profiles", []).filter((N) => N.id !== a);
|
|
22509
22511
|
Qo("profiles", w), LA(w), Pe === a && uo(null), Cn(null);
|
|
22510
22512
|
},
|
|
22511
22513
|
onCancel: () => Cn(null),
|