@primestyleai/tryon 5.8.52 → 5.8.54
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 +59 -35
- package/dist/storefront/primestyle-tryon.js +59 -35
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -7760,36 +7760,57 @@ function FaceOverlay({
|
|
|
7760
7760
|
] }, key))
|
|
7761
7761
|
] });
|
|
7762
7762
|
}
|
|
7763
|
-
function
|
|
7763
|
+
function StageCycler({
|
|
7764
7764
|
category,
|
|
7765
7765
|
sizingDone,
|
|
7766
|
+
tryOnProcessing,
|
|
7767
|
+
tryOnDone,
|
|
7766
7768
|
t
|
|
7767
7769
|
}) {
|
|
7768
|
-
const
|
|
7770
|
+
const sizingStages = category === "head" ? [
|
|
7769
7771
|
{ title: t("DETECTING HEAD"), desc: t("Reading head landmarks from your photo.") },
|
|
7770
7772
|
{ title: t("MAPPING CIRCUMFERENCE"), desc: t("Estimating head width and depth.") },
|
|
7771
7773
|
{ title: t("MATCHING HAT SIZE"), desc: t("Comparing your circumference to the size chart.") },
|
|
7772
7774
|
{ title: t("FINALIZING RESULT"), desc: t("Almost done — preparing your recommendation.") }
|
|
7773
|
-
] : [
|
|
7775
|
+
] : category === "face" ? [
|
|
7774
7776
|
{ title: t("DETECTING FACE"), desc: t("Identifying 478 face landmarks in your photo.") },
|
|
7775
7777
|
{ title: t("CALIBRATING SCALE"), desc: t("Using iris size as the pixel-to-mm anchor.") },
|
|
7776
7778
|
{ title: t("MEASURING FRAME"), desc: t("Mapping bridge, lens width and temple length.") },
|
|
7777
7779
|
{ title: t("MATCHING FRAME SIZE"), desc: t("Comparing your measurements to the size chart.") },
|
|
7778
7780
|
{ title: t("FINALIZING RESULT"), desc: t("Almost done — preparing your recommendation.") }
|
|
7781
|
+
] : [
|
|
7782
|
+
// Body + foot fall through here — broadest set of stages so long
|
|
7783
|
+
// Gemini estimates still have fresh text to cycle through.
|
|
7784
|
+
{ title: t("DETECTING POSE"), desc: t("Identifying body landmarks from your photo.") },
|
|
7785
|
+
{ title: t("SCANNING FRAME"), desc: t("Our AI is mapping your proportions.") },
|
|
7786
|
+
{ title: t("ANALYZING BODY"), desc: t("Measuring shoulders, chest, waist and hips.") },
|
|
7787
|
+
{ title: t("MATCHING SIZE"), desc: t("Comparing your measurements to the size guide.") },
|
|
7788
|
+
{ title: t("FINALIZING RESULT"), desc: t("Almost done — preparing your recommendation.") }
|
|
7789
|
+
];
|
|
7790
|
+
const tryOnStages = [
|
|
7791
|
+
{ title: t("GENERATING TRY-ON"), desc: t("Rendering the garment on your photo.") },
|
|
7792
|
+
{ title: t("REFINING DETAILS"), desc: t("Fine-tuning fit, drape and shadows.") },
|
|
7793
|
+
{ title: t("ALMOST THERE"), desc: t("Final compositing in progress.") },
|
|
7794
|
+
{ title: t("FINISHING TOUCHES"), desc: t("Polishing the result.") }
|
|
7779
7795
|
];
|
|
7796
|
+
const active = tryOnProcessing ? tryOnStages : sizingStages;
|
|
7797
|
+
const isDone = tryOnProcessing ? !!tryOnDone : sizingDone;
|
|
7780
7798
|
const [idx, setIdx] = useState(0);
|
|
7781
7799
|
useEffect(() => {
|
|
7782
|
-
|
|
7800
|
+
setIdx(0);
|
|
7801
|
+
}, [tryOnProcessing]);
|
|
7802
|
+
useEffect(() => {
|
|
7803
|
+
if (isDone) return;
|
|
7783
7804
|
const id = setInterval(() => {
|
|
7784
|
-
setIdx((i) => Math.min(i + 1,
|
|
7805
|
+
setIdx((i) => Math.min(i + 1, active.length - 1));
|
|
7785
7806
|
}, 900);
|
|
7786
7807
|
return () => clearInterval(id);
|
|
7787
|
-
}, [
|
|
7788
|
-
const current =
|
|
7808
|
+
}, [isDone, active.length]);
|
|
7809
|
+
const current = active[idx] ?? active[0];
|
|
7789
7810
|
return /* @__PURE__ */ jsx("div", { className: "ps-msc-stage", style: { alignSelf: "center", marginTop: "auto", marginBottom: "auto" }, children: /* @__PURE__ */ jsxs("div", { className: "ps-msc-stage-slot", children: [
|
|
7790
7811
|
/* @__PURE__ */ jsx("div", { className: "ps-msc-stage-title", children: current.title }),
|
|
7791
7812
|
/* @__PURE__ */ jsx("div", { className: "ps-msc-stage-desc", children: current.desc })
|
|
7792
|
-
] }, idx) });
|
|
7813
|
+
] }, `${tryOnProcessing ? "t" : "s"}-${idx}`) });
|
|
7793
7814
|
}
|
|
7794
7815
|
function SkeletonOverlay({ landmarks, imgWidth, imgHeight }) {
|
|
7795
7816
|
const W = imgWidth;
|
|
@@ -8343,7 +8364,10 @@ function SectionDetailView({
|
|
|
8343
8364
|
borderRadius: "8px",
|
|
8344
8365
|
padding: "4px 12px"
|
|
8345
8366
|
}, children: [
|
|
8346
|
-
/* @__PURE__ */
|
|
8367
|
+
/* @__PURE__ */ jsxs("span", { className: "ps-msd-card-size", children: [
|
|
8368
|
+
displaySizeLabel,
|
|
8369
|
+
!selectedCountry && finalDisplayLength ? ` / ${finalDisplayLength}` : ""
|
|
8370
|
+
] }),
|
|
8347
8371
|
finalDisplayLength && /* @__PURE__ */ jsx("span", { className: "ps-msd-card-size-meta", children: finalDisplayLength }),
|
|
8348
8372
|
selectedCountry && isRecommended && /* @__PURE__ */ jsxs("span", { className: "ps-msd-card-size-meta", style: { fontSize: "11px", opacity: 0.7 }, children: [
|
|
8349
8373
|
"(",
|
|
@@ -8776,7 +8800,6 @@ function SizeResultView({
|
|
|
8776
8800
|
const [poseLines, setPoseLines] = useState(null);
|
|
8777
8801
|
const [poseReady, setPoseReady] = useState(false);
|
|
8778
8802
|
const [imgDims, setImgDims] = useState({ w: 800, h: 1200 });
|
|
8779
|
-
const analyzingDone = estimationDone;
|
|
8780
8803
|
const handleImgLoad = useCallback((e) => {
|
|
8781
8804
|
const el = e.currentTarget;
|
|
8782
8805
|
if (el.naturalWidth && el.naturalHeight) {
|
|
@@ -8958,31 +8981,17 @@ function SizeResultView({
|
|
|
8958
8981
|
] }),
|
|
8959
8982
|
(() => {
|
|
8960
8983
|
const isFaceCategory = measurementType === "face" || measurementType === "head";
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
/* @__PURE__ */ jsxs("div", { className: `ps-tryon-snap-step${analyzingDone ? " ps-done" : detectionDone ? " ps-active" : ""}`, children: [
|
|
8973
|
-
/* @__PURE__ */ jsx("div", { className: "ps-tryon-snap-step-icon", children: !detectionDone ? /* @__PURE__ */ jsx("span", { className: "ps-tryon-snap-num", children: "2" }) : !analyzingDone ? /* @__PURE__ */ jsx("div", { className: "ps-tryon-size-loading-spinner", style: { width: "1vw", height: "1vw", borderWidth: "1.5px" } }) : /* @__PURE__ */ jsx("span", { className: "ps-tryon-snap-check", children: "✓" }) }),
|
|
8974
|
-
/* @__PURE__ */ jsx("span", { children: t("Analyzing your size") })
|
|
8975
|
-
] }),
|
|
8976
|
-
/* @__PURE__ */ jsxs("div", { className: `ps-tryon-snap-step${analyzingDone ? " ps-active" : ""}`, children: [
|
|
8977
|
-
/* @__PURE__ */ jsx("div", { className: "ps-tryon-snap-step-icon", children: !analyzingDone ? /* @__PURE__ */ jsx("span", { className: "ps-tryon-snap-num", children: "3" }) : /* @__PURE__ */ jsx("div", { className: "ps-tryon-size-loading-spinner", style: { width: "1vw", height: "1vw", borderWidth: "1.5px" } }) }),
|
|
8978
|
-
/* @__PURE__ */ jsx("span", { children: t("Finding best fit for you") })
|
|
8979
|
-
] })
|
|
8980
|
-
] }),
|
|
8981
|
-
tryOnProcessing && /* @__PURE__ */ jsxs("div", { className: `ps-tryon-snap-step${tryOnDone ? " ps-done" : " ps-active"}`, children: [
|
|
8982
|
-
/* @__PURE__ */ jsx("div", { className: "ps-tryon-snap-step-icon", children: tryOnDone ? /* @__PURE__ */ jsx("span", { className: "ps-tryon-snap-check", children: "✓" }) : /* @__PURE__ */ jsx("div", { className: "ps-tryon-size-loading-spinner", style: { width: "1vw", height: "1vw", borderWidth: "1.5px" } }) }),
|
|
8983
|
-
/* @__PURE__ */ jsx("span", { children: t("Generating virtual try-on") })
|
|
8984
|
-
] })
|
|
8985
|
-
] });
|
|
8984
|
+
isFaceCategory ? measurementType === "head" ? t("Detecting head") : t("Detecting face") : t("Detecting body pose");
|
|
8985
|
+
return /* @__PURE__ */ jsx("div", { className: "ps-tryon-sr-right-col", style: { display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsx(
|
|
8986
|
+
StageCycler,
|
|
8987
|
+
{
|
|
8988
|
+
category: isFaceCategory ? measurementType : "body",
|
|
8989
|
+
sizingDone,
|
|
8990
|
+
tryOnProcessing,
|
|
8991
|
+
tryOnDone,
|
|
8992
|
+
t
|
|
8993
|
+
}
|
|
8994
|
+
) });
|
|
8986
8995
|
})()
|
|
8987
8996
|
] }),
|
|
8988
8997
|
(allDone || sizingResult && !isSnapProcessing) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -13463,6 +13472,21 @@ function PrimeStyleTryonInner({
|
|
|
13463
13472
|
setPreviewUrl(null);
|
|
13464
13473
|
setBodyLandmarks(null);
|
|
13465
13474
|
}
|
|
13475
|
+
const profilePhoto = p.photoBase64;
|
|
13476
|
+
if (profilePhoto) {
|
|
13477
|
+
try {
|
|
13478
|
+
const dataUrl = profilePhoto.startsWith("data:") ? profilePhoto : `data:image/jpeg;base64,${profilePhoto}`;
|
|
13479
|
+
fetch(dataUrl).then((r) => r.blob()).then((blob) => {
|
|
13480
|
+
const file = new File([blob], "profile-photo.jpg", { type: blob.type || "image/jpeg" });
|
|
13481
|
+
setSelectedFile(file);
|
|
13482
|
+
selectedFileRef.current = file;
|
|
13483
|
+
if (previewUrl) URL.revokeObjectURL(previewUrl);
|
|
13484
|
+
setPreviewUrl(URL.createObjectURL(file));
|
|
13485
|
+
}).catch(() => {
|
|
13486
|
+
});
|
|
13487
|
+
} catch {
|
|
13488
|
+
}
|
|
13489
|
+
}
|
|
13466
13490
|
setView("size-result");
|
|
13467
13491
|
recommendForProduct({
|
|
13468
13492
|
productId: effectiveProductId,
|
|
@@ -17184,36 +17184,57 @@ function FaceOverlay({
|
|
|
17184
17184
|
] }, key))
|
|
17185
17185
|
] });
|
|
17186
17186
|
}
|
|
17187
|
-
function
|
|
17187
|
+
function StageCycler({
|
|
17188
17188
|
category,
|
|
17189
17189
|
sizingDone,
|
|
17190
|
+
tryOnProcessing,
|
|
17191
|
+
tryOnDone,
|
|
17190
17192
|
t: t2
|
|
17191
17193
|
}) {
|
|
17192
|
-
const
|
|
17194
|
+
const sizingStages = category === "head" ? [
|
|
17193
17195
|
{ title: t2("DETECTING HEAD"), desc: t2("Reading head landmarks from your photo.") },
|
|
17194
17196
|
{ title: t2("MAPPING CIRCUMFERENCE"), desc: t2("Estimating head width and depth.") },
|
|
17195
17197
|
{ title: t2("MATCHING HAT SIZE"), desc: t2("Comparing your circumference to the size chart.") },
|
|
17196
17198
|
{ title: t2("FINALIZING RESULT"), desc: t2("Almost done — preparing your recommendation.") }
|
|
17197
|
-
] : [
|
|
17199
|
+
] : category === "face" ? [
|
|
17198
17200
|
{ title: t2("DETECTING FACE"), desc: t2("Identifying 478 face landmarks in your photo.") },
|
|
17199
17201
|
{ title: t2("CALIBRATING SCALE"), desc: t2("Using iris size as the pixel-to-mm anchor.") },
|
|
17200
17202
|
{ title: t2("MEASURING FRAME"), desc: t2("Mapping bridge, lens width and temple length.") },
|
|
17201
17203
|
{ title: t2("MATCHING FRAME SIZE"), desc: t2("Comparing your measurements to the size chart.") },
|
|
17202
17204
|
{ title: t2("FINALIZING RESULT"), desc: t2("Almost done — preparing your recommendation.") }
|
|
17205
|
+
] : [
|
|
17206
|
+
// Body + foot fall through here — broadest set of stages so long
|
|
17207
|
+
// Gemini estimates still have fresh text to cycle through.
|
|
17208
|
+
{ title: t2("DETECTING POSE"), desc: t2("Identifying body landmarks from your photo.") },
|
|
17209
|
+
{ title: t2("SCANNING FRAME"), desc: t2("Our AI is mapping your proportions.") },
|
|
17210
|
+
{ title: t2("ANALYZING BODY"), desc: t2("Measuring shoulders, chest, waist and hips.") },
|
|
17211
|
+
{ title: t2("MATCHING SIZE"), desc: t2("Comparing your measurements to the size guide.") },
|
|
17212
|
+
{ title: t2("FINALIZING RESULT"), desc: t2("Almost done — preparing your recommendation.") }
|
|
17213
|
+
];
|
|
17214
|
+
const tryOnStages = [
|
|
17215
|
+
{ title: t2("GENERATING TRY-ON"), desc: t2("Rendering the garment on your photo.") },
|
|
17216
|
+
{ title: t2("REFINING DETAILS"), desc: t2("Fine-tuning fit, drape and shadows.") },
|
|
17217
|
+
{ title: t2("ALMOST THERE"), desc: t2("Final compositing in progress.") },
|
|
17218
|
+
{ title: t2("FINISHING TOUCHES"), desc: t2("Polishing the result.") }
|
|
17203
17219
|
];
|
|
17220
|
+
const active = tryOnProcessing ? tryOnStages : sizingStages;
|
|
17221
|
+
const isDone = tryOnProcessing ? !!tryOnDone : sizingDone;
|
|
17204
17222
|
const [idx, setIdx] = reactExports.useState(0);
|
|
17205
17223
|
reactExports.useEffect(() => {
|
|
17206
|
-
|
|
17224
|
+
setIdx(0);
|
|
17225
|
+
}, [tryOnProcessing]);
|
|
17226
|
+
reactExports.useEffect(() => {
|
|
17227
|
+
if (isDone) return;
|
|
17207
17228
|
const id2 = setInterval(() => {
|
|
17208
|
-
setIdx((i) => Math.min(i + 1,
|
|
17229
|
+
setIdx((i) => Math.min(i + 1, active.length - 1));
|
|
17209
17230
|
}, 900);
|
|
17210
17231
|
return () => clearInterval(id2);
|
|
17211
|
-
}, [
|
|
17212
|
-
const current =
|
|
17232
|
+
}, [isDone, active.length]);
|
|
17233
|
+
const current = active[idx] ?? active[0];
|
|
17213
17234
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msc-stage", style: { alignSelf: "center", marginTop: "auto", marginBottom: "auto" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msc-stage-slot", children: [
|
|
17214
17235
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msc-stage-title", children: current.title }),
|
|
17215
17236
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msc-stage-desc", children: current.desc })
|
|
17216
|
-
] }, idx) });
|
|
17237
|
+
] }, `${tryOnProcessing ? "t" : "s"}-${idx}`) });
|
|
17217
17238
|
}
|
|
17218
17239
|
function SkeletonOverlay({ landmarks, imgWidth, imgHeight }) {
|
|
17219
17240
|
const W2 = imgWidth;
|
|
@@ -17767,7 +17788,10 @@ function SectionDetailView({
|
|
|
17767
17788
|
borderRadius: "8px",
|
|
17768
17789
|
padding: "4px 12px"
|
|
17769
17790
|
}, children: [
|
|
17770
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
17791
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-msd-card-size", children: [
|
|
17792
|
+
displaySizeLabel,
|
|
17793
|
+
!selectedCountry && finalDisplayLength ? ` / ${finalDisplayLength}` : ""
|
|
17794
|
+
] }),
|
|
17771
17795
|
finalDisplayLength && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-msd-card-size-meta", children: finalDisplayLength }),
|
|
17772
17796
|
selectedCountry && isRecommended && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-msd-card-size-meta", style: { fontSize: "11px", opacity: 0.7 }, children: [
|
|
17773
17797
|
"(",
|
|
@@ -18200,7 +18224,6 @@ function SizeResultView({
|
|
|
18200
18224
|
const [poseLines, setPoseLines] = reactExports.useState(null);
|
|
18201
18225
|
const [poseReady, setPoseReady] = reactExports.useState(false);
|
|
18202
18226
|
const [imgDims, setImgDims] = reactExports.useState({ w: 800, h: 1200 });
|
|
18203
|
-
const analyzingDone = estimationDone;
|
|
18204
18227
|
const handleImgLoad = reactExports.useCallback((e) => {
|
|
18205
18228
|
const el2 = e.currentTarget;
|
|
18206
18229
|
if (el2.naturalWidth && el2.naturalHeight) {
|
|
@@ -18382,31 +18405,17 @@ function SizeResultView({
|
|
|
18382
18405
|
] }),
|
|
18383
18406
|
(() => {
|
|
18384
18407
|
const isFaceCategory = measurementType === "face" || measurementType === "head";
|
|
18385
|
-
|
|
18386
|
-
|
|
18387
|
-
|
|
18388
|
-
|
|
18389
|
-
|
|
18390
|
-
|
|
18391
|
-
|
|
18392
|
-
|
|
18393
|
-
|
|
18394
|
-
|
|
18395
|
-
|
|
18396
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-tryon-snap-step${analyzingDone ? " ps-done" : detectionDone ? " ps-active" : ""}`, children: [
|
|
18397
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-snap-step-icon", children: !detectionDone ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-snap-num", children: "2" }) : !analyzingDone ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-size-loading-spinner", style: { width: "1vw", height: "1vw", borderWidth: "1.5px" } }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-snap-check", children: "✓" }) }),
|
|
18398
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("Analyzing your size") })
|
|
18399
|
-
] }),
|
|
18400
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-tryon-snap-step${analyzingDone ? " ps-active" : ""}`, children: [
|
|
18401
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-snap-step-icon", children: !analyzingDone ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-snap-num", children: "3" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-size-loading-spinner", style: { width: "1vw", height: "1vw", borderWidth: "1.5px" } }) }),
|
|
18402
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("Finding best fit for you") })
|
|
18403
|
-
] })
|
|
18404
|
-
] }),
|
|
18405
|
-
tryOnProcessing && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-tryon-snap-step${tryOnDone ? " ps-done" : " ps-active"}`, children: [
|
|
18406
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-snap-step-icon", children: tryOnDone ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-snap-check", children: "✓" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-size-loading-spinner", style: { width: "1vw", height: "1vw", borderWidth: "1.5px" } }) }),
|
|
18407
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("Generating virtual try-on") })
|
|
18408
|
-
] })
|
|
18409
|
-
] });
|
|
18408
|
+
isFaceCategory ? measurementType === "head" ? t2("Detecting head") : t2("Detecting face") : t2("Detecting body pose");
|
|
18409
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-sr-right-col", style: { display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18410
|
+
StageCycler,
|
|
18411
|
+
{
|
|
18412
|
+
category: isFaceCategory ? measurementType : "body",
|
|
18413
|
+
sizingDone,
|
|
18414
|
+
tryOnProcessing,
|
|
18415
|
+
tryOnDone,
|
|
18416
|
+
t: t2
|
|
18417
|
+
}
|
|
18418
|
+
) });
|
|
18410
18419
|
})()
|
|
18411
18420
|
] }),
|
|
18412
18421
|
(allDone || sizingResult && !isSnapProcessing) && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
@@ -22887,6 +22896,21 @@ function PrimeStyleTryonInner({
|
|
|
22887
22896
|
setPreviewUrl(null);
|
|
22888
22897
|
setBodyLandmarks(null);
|
|
22889
22898
|
}
|
|
22899
|
+
const profilePhoto = p2.photoBase64;
|
|
22900
|
+
if (profilePhoto) {
|
|
22901
|
+
try {
|
|
22902
|
+
const dataUrl = profilePhoto.startsWith("data:") ? profilePhoto : `data:image/jpeg;base64,${profilePhoto}`;
|
|
22903
|
+
fetch(dataUrl).then((r2) => r2.blob()).then((blob) => {
|
|
22904
|
+
const file = new File([blob], "profile-photo.jpg", { type: blob.type || "image/jpeg" });
|
|
22905
|
+
setSelectedFile(file);
|
|
22906
|
+
selectedFileRef.current = file;
|
|
22907
|
+
if (previewUrl) URL.revokeObjectURL(previewUrl);
|
|
22908
|
+
setPreviewUrl(URL.createObjectURL(file));
|
|
22909
|
+
}).catch(() => {
|
|
22910
|
+
});
|
|
22911
|
+
} catch {
|
|
22912
|
+
}
|
|
22913
|
+
}
|
|
22890
22914
|
setView("size-result");
|
|
22891
22915
|
recommendForProduct({
|
|
22892
22916
|
productId: effectiveProductId,
|