@primestyleai/tryon 5.10.3 → 5.10.5

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.
@@ -8674,11 +8674,23 @@ function SectionDetailView({
8674
8674
  }
8675
8675
  )
8676
8676
  ] }),
8677
- sectionFound === false && /* @__PURE__ */ jsxs("div", { className: "ps-msd-card", style: { textAlign: "center" }, children: [
8677
+ sectionFound === false && /* @__PURE__ */ jsx("div", { style: {
8678
+ flex: 1,
8679
+ display: "flex",
8680
+ alignItems: "center",
8681
+ justifyContent: "center",
8682
+ minHeight: 240,
8683
+ padding: "24px 16px"
8684
+ }, children: /* @__PURE__ */ jsxs("div", { className: "ps-msd-card", style: {
8685
+ textAlign: "center",
8686
+ width: "100%",
8687
+ maxWidth: 420,
8688
+ padding: "28px 24px"
8689
+ }, children: [
8678
8690
  /* @__PURE__ */ jsx("span", { className: "ps-msd-card-eyebrow", children: t("NO MATCHING SIZE") }),
8679
- /* @__PURE__ */ jsx("p", { style: { fontSize: "15px", fontWeight: 600, color: "var(--ps-text-primary)", margin: "10px 0 4px" }, children: t("We couldn't find a size that fits for this product.") }),
8680
- /* @__PURE__ */ jsx("p", { className: "ps-msd-card-note", children: t("Your measurements are outside this product's size range — the chart doesn't include a close match. You can still try it on visually below.") })
8681
- ] }),
8691
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "15px", fontWeight: 600, color: "var(--ps-text-primary)", margin: "10px 0 6px", lineHeight: 1.4 }, children: t("We couldn't find a size that fits for this product.") }),
8692
+ /* @__PURE__ */ jsx("p", { className: "ps-msd-card-note", style: { margin: 0, lineHeight: 1.5 }, children: t("Your measurements are outside this product's size range. You can still try it on visually below.") })
8693
+ ] }) }),
8682
8694
  sectionFound !== false && /* @__PURE__ */ jsxs("div", { className: "ps-msd-card", children: [
8683
8695
  /* @__PURE__ */ jsx("span", { className: "ps-msd-card-eyebrow", children: displaySize === backendSize ? t("RECOMMENDED SIZE") : t("TRYING SIZE") }),
8684
8696
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px", marginTop: "6px", marginBottom: "4px" }, children: [
@@ -8813,22 +8825,94 @@ function SectionDetailView({
8813
8825
  backendLength ? ` (${backendLength})` : "",
8814
8826
  " ",
8815
8827
  t("based on your measurements and the garment's tailoring chart.")
8828
+ ] }),
8829
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 10, padding: "12px 0 4px", flexShrink: 0 }, children: [
8830
+ /* @__PURE__ */ jsxs(
8831
+ "button",
8832
+ {
8833
+ type: "button",
8834
+ className: "ps-bp-back-btn",
8835
+ onClick: onBack,
8836
+ style: { fontSize: 13, padding: "10px 6px" },
8837
+ children: [
8838
+ /* @__PURE__ */ jsx("span", { className: "ps-bp-back-arrow", children: "←" }),
8839
+ " ",
8840
+ backLabel || t("Back")
8841
+ ]
8842
+ }
8843
+ ),
8844
+ /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
8845
+ onTryOn ? /* @__PURE__ */ jsxs(
8846
+ "button",
8847
+ {
8848
+ type: "button",
8849
+ onClick: onTryOn,
8850
+ disabled: tryOnProcessing,
8851
+ style: {
8852
+ flex: 1,
8853
+ padding: "12px 16px",
8854
+ borderRadius: 10,
8855
+ background: "var(--ps-accent)",
8856
+ color: "white",
8857
+ border: "none",
8858
+ fontSize: 14,
8859
+ fontWeight: 700,
8860
+ fontFamily: "inherit",
8861
+ cursor: tryOnProcessing ? "default" : "pointer",
8862
+ opacity: tryOnProcessing ? 0.6 : 1,
8863
+ display: "flex",
8864
+ alignItems: "center",
8865
+ justifyContent: "center",
8866
+ gap: 6
8867
+ },
8868
+ children: [
8869
+ /* @__PURE__ */ jsx(CameraIcon$1, { size: 14 }),
8870
+ tryOnProcessing ? t("Processing...") : t("Try It On")
8871
+ ]
8872
+ }
8873
+ ) : /* @__PURE__ */ jsxs(
8874
+ "button",
8875
+ {
8876
+ type: "button",
8877
+ onClick: onBack,
8878
+ style: {
8879
+ flex: 1,
8880
+ padding: "12px 16px",
8881
+ borderRadius: 10,
8882
+ background: "var(--ps-accent)",
8883
+ color: "white",
8884
+ border: "none",
8885
+ fontSize: 14,
8886
+ fontWeight: 700,
8887
+ fontFamily: "inherit",
8888
+ cursor: "pointer",
8889
+ display: "flex",
8890
+ alignItems: "center",
8891
+ justifyContent: "center",
8892
+ gap: 6
8893
+ },
8894
+ children: [
8895
+ continueLabel || t("Continue"),
8896
+ " →"
8897
+ ]
8898
+ }
8899
+ )
8816
8900
  ] })
8817
8901
  ] }) });
8818
8902
  }
8819
8903
  return /* @__PURE__ */ jsxs("div", { className: "ps-tryon-sec-detail", style: { padding: "1.5vw", display: "flex", flexDirection: "column", height: "100%", background: "#F8F9FA" }, children: [
8820
- /* @__PURE__ */ jsx("div", { style: { flex: 1, minHeight: 0, overflowY: "auto", scrollbarWidth: "thin", scrollbarColor: "rgba(0,0,0,0.04) transparent" }, children: sectionFound === false ? /* @__PURE__ */ jsxs("div", { style: {
8904
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, minHeight: 0, overflowY: "auto", scrollbarWidth: "thin", scrollbarColor: "rgba(0,0,0,0.04) transparent", display: sectionFound === false ? "flex" : "block", alignItems: sectionFound === false ? "center" : void 0, justifyContent: sectionFound === false ? "center" : void 0 }, children: sectionFound === false ? /* @__PURE__ */ jsxs("div", { style: {
8821
8905
  background: "white",
8822
8906
  borderRadius: "0.7vw",
8823
8907
  border: "1px solid rgba(0,0,0,0.06)",
8824
- padding: "1.4vw 1.6vw",
8908
+ padding: "2vw 2.2vw",
8825
8909
  textAlign: "center",
8826
- marginTop: "0.4vw",
8827
- marginBottom: "1vw"
8910
+ width: "100%",
8911
+ maxWidth: "28vw"
8828
8912
  }, children: [
8829
8913
  /* @__PURE__ */ jsx("span", { style: { fontSize: "0.7vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: t("No matching size") }),
8830
- /* @__PURE__ */ jsx("p", { style: { fontSize: "1vw", fontWeight: 600, color: "var(--ps-text-primary)", margin: "0.6vw 0 0.4vw" }, children: t("We couldn't find a size that fits for this product.") }),
8831
- /* @__PURE__ */ jsx("p", { style: { fontSize: "0.7vw", color: "var(--ps-text-secondary)", lineHeight: 1.55, margin: 0, maxWidth: "26vw", marginLeft: "auto", marginRight: "auto" }, children: t("Your measurements are outside this product's size range. You can still try it on visually below.") })
8914
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "1vw", fontWeight: 600, color: "var(--ps-text-primary)", margin: "0.8vw 0 0.5vw", lineHeight: 1.4 }, children: t("We couldn't find a size that fits for this product.") }),
8915
+ /* @__PURE__ */ jsx("p", { style: { fontSize: "0.72vw", color: "var(--ps-text-secondary)", lineHeight: 1.55, margin: 0 }, children: t("Your measurements are outside this product's size range. You can still try it on visually below.") })
8832
8916
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
8833
8917
  /* @__PURE__ */ jsx("span", { style: { fontSize: "0.75vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: isRecommended ? t("Recommended Size") : altSizeLabel ?? t("Your Selection") }),
8834
8918
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.5vw", marginTop: "0.35vw", marginBottom: "0.4vw" }, children: [
@@ -13097,7 +13181,7 @@ function AccessorySizeView({
13097
13181
  },
13098
13182
  opt.value
13099
13183
  )) }),
13100
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflowY: "auto" }, children: [
13184
+ /* @__PURE__ */ jsxs("div", { style: { padding: "0 4%" }, children: [
13101
13185
  fields.map((f) => /* @__PURE__ */ jsxs("div", { className: "ps-bpm-row", children: [
13102
13186
  /* @__PURE__ */ jsx("span", { className: "ps-bpm-label", children: t(f.label).toUpperCase() }),
13103
13187
  /* @__PURE__ */ jsxs("div", { className: "ps-bpm-inline-group", children: [
@@ -13117,8 +13201,9 @@ function AccessorySizeView({
13117
13201
  /* @__PURE__ */ jsx("span", { className: "ps-bpm-unit", children: activeUnitLabel.toLowerCase() })
13118
13202
  ] })
13119
13203
  ] }, f.key)),
13120
- error && /* @__PURE__ */ jsx("p", { className: "ps-acc-error", style: { padding: "0 4%" }, children: error })
13204
+ error && /* @__PURE__ */ jsx("p", { className: "ps-acc-error", style: { paddingTop: 8 }, children: error })
13121
13205
  ] }),
13206
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, minHeight: 16 } }),
13122
13207
  !disablePhotoUpload && /* @__PURE__ */ jsxs(Fragment, { children: [
13123
13208
  /* @__PURE__ */ jsx("div", { className: "ps-bpm-or", children: /* @__PURE__ */ jsx("span", { children: t("or") }) }),
13124
13209
  /* @__PURE__ */ jsxs("button", { type: "button", className: "ps-bpm-upload-link", onClick: () => setStep("photo"), children: [
@@ -13127,7 +13212,6 @@ function AccessorySizeView({
13127
13212
  /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" }) })
13128
13213
  ] })
13129
13214
  ] }),
13130
- /* @__PURE__ */ jsx("div", { className: "ps-bpm-spacer" }),
13131
13215
  /* @__PURE__ */ jsxs("div", { className: "ps-bpm-bottom", children: [
13132
13216
  /* @__PURE__ */ jsxs("button", { type: "button", className: "ps-bpm-next-btn", onClick: handleManualSubmit, children: [
13133
13217
  t("Find My Size"),
@@ -13701,7 +13785,9 @@ function PrimeStyleTryonInner({
13701
13785
  const [heightUnit, setHeightUnit] = useState(imperial ? "in" : "cm");
13702
13786
  const [weightUnit, setWeightUnit] = useState(imperial ? "lbs" : "kg");
13703
13787
  useEffect(() => {
13704
- if (detectMeasurementType(productTitle) === "foot") setSizingUnit("cm");
13788
+ const mtype = detectMeasurementType(productTitle);
13789
+ if (mtype === "foot" || mtype === "head") setSizingUnit("cm");
13790
+ else if (mtype === "face") setSizingUnit("mm");
13705
13791
  }, [productTitle]);
13706
13792
  const formRef = useRef({});
13707
13793
  const [formGender, setFormGender] = useState("male");
@@ -14523,7 +14609,12 @@ function PrimeStyleTryonInner({
14523
14609
  setBodyLandmarks(lm);
14524
14610
  return lm;
14525
14611
  }).catch(() => null);
14526
- const landmarks = await landmarksPromise;
14612
+ const LANDMARK_TIMEOUT_MS = 2500;
14613
+ const landmarks = await Promise.race([
14614
+ landmarksPromise,
14615
+ new Promise((resolve) => setTimeout(() => resolve(null), LANDMARK_TIMEOUT_MS))
14616
+ ]);
14617
+ if (!landmarks) console.log("[ps-sdk] landmarks not ready in", LANDMARK_TIMEOUT_MS, "ms — proceeding without them");
14527
14618
  const payload = {
14528
14619
  method: "photo",
14529
14620
  locale: sizingCountry,
@@ -18099,11 +18099,23 @@ function SectionDetailView({
18099
18099
  }
18100
18100
  )
18101
18101
  ] }),
18102
- sectionFound === false && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msd-card", style: { textAlign: "center" }, children: [
18102
+ sectionFound === false && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
18103
+ flex: 1,
18104
+ display: "flex",
18105
+ alignItems: "center",
18106
+ justifyContent: "center",
18107
+ minHeight: 240,
18108
+ padding: "24px 16px"
18109
+ }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msd-card", style: {
18110
+ textAlign: "center",
18111
+ width: "100%",
18112
+ maxWidth: 420,
18113
+ padding: "28px 24px"
18114
+ }, children: [
18103
18115
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-msd-card-eyebrow", children: t2("NO MATCHING SIZE") }),
18104
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { fontSize: "15px", fontWeight: 600, color: "var(--ps-text-primary)", margin: "10px 0 4px" }, children: t2("We couldn't find a size that fits for this product.") }),
18105
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-msd-card-note", children: t2("Your measurements are outside this product's size range — the chart doesn't include a close match. You can still try it on visually below.") })
18106
- ] }),
18116
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { fontSize: "15px", fontWeight: 600, color: "var(--ps-text-primary)", margin: "10px 0 6px", lineHeight: 1.4 }, children: t2("We couldn't find a size that fits for this product.") }),
18117
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-msd-card-note", style: { margin: 0, lineHeight: 1.5 }, children: t2("Your measurements are outside this product's size range. You can still try it on visually below.") })
18118
+ ] }) }),
18107
18119
  sectionFound !== false && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msd-card", children: [
18108
18120
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-msd-card-eyebrow", children: displaySize === backendSize ? t2("RECOMMENDED SIZE") : t2("TRYING SIZE") }),
18109
18121
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px", marginTop: "6px", marginBottom: "4px" }, children: [
@@ -18238,22 +18250,94 @@ function SectionDetailView({
18238
18250
  backendLength ? ` (${backendLength})` : "",
18239
18251
  " ",
18240
18252
  t2("based on your measurements and the garment's tailoring chart.")
18253
+ ] }),
18254
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", gap: 10, padding: "12px 0 4px", flexShrink: 0 }, children: [
18255
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
18256
+ "button",
18257
+ {
18258
+ type: "button",
18259
+ className: "ps-bp-back-btn",
18260
+ onClick: onBack,
18261
+ style: { fontSize: 13, padding: "10px 6px" },
18262
+ children: [
18263
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-back-arrow", children: "←" }),
18264
+ " ",
18265
+ backLabel || t2("Back")
18266
+ ]
18267
+ }
18268
+ ),
18269
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1 } }),
18270
+ onTryOn ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
18271
+ "button",
18272
+ {
18273
+ type: "button",
18274
+ onClick: onTryOn,
18275
+ disabled: tryOnProcessing,
18276
+ style: {
18277
+ flex: 1,
18278
+ padding: "12px 16px",
18279
+ borderRadius: 10,
18280
+ background: "var(--ps-accent)",
18281
+ color: "white",
18282
+ border: "none",
18283
+ fontSize: 14,
18284
+ fontWeight: 700,
18285
+ fontFamily: "inherit",
18286
+ cursor: tryOnProcessing ? "default" : "pointer",
18287
+ opacity: tryOnProcessing ? 0.6 : 1,
18288
+ display: "flex",
18289
+ alignItems: "center",
18290
+ justifyContent: "center",
18291
+ gap: 6
18292
+ },
18293
+ children: [
18294
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CameraIcon$1, { size: 14 }),
18295
+ tryOnProcessing ? t2("Processing...") : t2("Try It On")
18296
+ ]
18297
+ }
18298
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
18299
+ "button",
18300
+ {
18301
+ type: "button",
18302
+ onClick: onBack,
18303
+ style: {
18304
+ flex: 1,
18305
+ padding: "12px 16px",
18306
+ borderRadius: 10,
18307
+ background: "var(--ps-accent)",
18308
+ color: "white",
18309
+ border: "none",
18310
+ fontSize: 14,
18311
+ fontWeight: 700,
18312
+ fontFamily: "inherit",
18313
+ cursor: "pointer",
18314
+ display: "flex",
18315
+ alignItems: "center",
18316
+ justifyContent: "center",
18317
+ gap: 6
18318
+ },
18319
+ children: [
18320
+ continueLabel || t2("Continue"),
18321
+ " →"
18322
+ ]
18323
+ }
18324
+ )
18241
18325
  ] })
18242
18326
  ] }) });
18243
18327
  }
18244
18328
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-sec-detail", style: { padding: "1.5vw", display: "flex", flexDirection: "column", height: "100%", background: "#F8F9FA" }, children: [
18245
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, minHeight: 0, overflowY: "auto", scrollbarWidth: "thin", scrollbarColor: "rgba(0,0,0,0.04) transparent" }, children: sectionFound === false ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: {
18329
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, minHeight: 0, overflowY: "auto", scrollbarWidth: "thin", scrollbarColor: "rgba(0,0,0,0.04) transparent", display: sectionFound === false ? "flex" : "block", alignItems: sectionFound === false ? "center" : void 0, justifyContent: sectionFound === false ? "center" : void 0 }, children: sectionFound === false ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: {
18246
18330
  background: "white",
18247
18331
  borderRadius: "0.7vw",
18248
18332
  border: "1px solid rgba(0,0,0,0.06)",
18249
- padding: "1.4vw 1.6vw",
18333
+ padding: "2vw 2.2vw",
18250
18334
  textAlign: "center",
18251
- marginTop: "0.4vw",
18252
- marginBottom: "1vw"
18335
+ width: "100%",
18336
+ maxWidth: "28vw"
18253
18337
  }, children: [
18254
18338
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { fontSize: "0.7vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: t2("No matching size") }),
18255
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { fontSize: "1vw", fontWeight: 600, color: "var(--ps-text-primary)", margin: "0.6vw 0 0.4vw" }, children: t2("We couldn't find a size that fits for this product.") }),
18256
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { fontSize: "0.7vw", color: "var(--ps-text-secondary)", lineHeight: 1.55, margin: 0, maxWidth: "26vw", marginLeft: "auto", marginRight: "auto" }, children: t2("Your measurements are outside this product's size range. You can still try it on visually below.") })
18339
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { fontSize: "1vw", fontWeight: 600, color: "var(--ps-text-primary)", margin: "0.8vw 0 0.5vw", lineHeight: 1.4 }, children: t2("We couldn't find a size that fits for this product.") }),
18340
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { fontSize: "0.72vw", color: "var(--ps-text-secondary)", lineHeight: 1.55, margin: 0 }, children: t2("Your measurements are outside this product's size range. You can still try it on visually below.") })
18257
18341
  ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
18258
18342
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { fontSize: "0.75vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: isRecommended ? t2("Recommended Size") : altSizeLabel ?? t2("Your Selection") }),
18259
18343
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.5vw", marginTop: "0.35vw", marginBottom: "0.4vw" }, children: [
@@ -22522,7 +22606,7 @@ function AccessorySizeView({
22522
22606
  },
22523
22607
  opt.value
22524
22608
  )) }),
22525
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { flex: 1, overflowY: "auto" }, children: [
22609
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { padding: "0 4%" }, children: [
22526
22610
  fields.map((f2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bpm-row", children: [
22527
22611
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bpm-label", children: t2(f2.label).toUpperCase() }),
22528
22612
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bpm-inline-group", children: [
@@ -22542,8 +22626,9 @@ function AccessorySizeView({
22542
22626
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bpm-unit", children: activeUnitLabel.toLowerCase() })
22543
22627
  ] })
22544
22628
  ] }, f2.key)),
22545
- error && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-acc-error", style: { padding: "0 4%" }, children: error })
22629
+ error && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-acc-error", style: { paddingTop: 8 }, children: error })
22546
22630
  ] }),
22631
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, minHeight: 16 } }),
22547
22632
  !disablePhotoUpload && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
22548
22633
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bpm-or", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("or") }) }),
22549
22634
  /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-bpm-upload-link", onClick: () => setStep("photo"), children: [
@@ -22552,7 +22637,6 @@ function AccessorySizeView({
22552
22637
  /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: /* @__PURE__ */ jsxRuntimeExports.jsx("polyline", { points: "9 18 15 12 9 6" }) })
22553
22638
  ] })
22554
22639
  ] }),
22555
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bpm-spacer" }),
22556
22640
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bpm-bottom", children: [
22557
22641
  /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", className: "ps-bpm-next-btn", onClick: handleManualSubmit, children: [
22558
22642
  t2("Find My Size"),
@@ -23126,7 +23210,9 @@ function PrimeStyleTryonInner({
23126
23210
  const [heightUnit, setHeightUnit] = reactExports.useState(imperial ? "in" : "cm");
23127
23211
  const [weightUnit, setWeightUnit] = reactExports.useState(imperial ? "lbs" : "kg");
23128
23212
  reactExports.useEffect(() => {
23129
- if (detectMeasurementType(productTitle) === "foot") setSizingUnit("cm");
23213
+ const mtype = detectMeasurementType(productTitle);
23214
+ if (mtype === "foot" || mtype === "head") setSizingUnit("cm");
23215
+ else if (mtype === "face") setSizingUnit("mm");
23130
23216
  }, [productTitle]);
23131
23217
  const formRef = reactExports.useRef({});
23132
23218
  const [formGender, setFormGender] = reactExports.useState("male");
@@ -23948,7 +24034,12 @@ function PrimeStyleTryonInner({
23948
24034
  setBodyLandmarks(lm);
23949
24035
  return lm;
23950
24036
  }).catch(() => null);
23951
- const landmarks = await landmarksPromise;
24037
+ const LANDMARK_TIMEOUT_MS = 2500;
24038
+ const landmarks = await Promise.race([
24039
+ landmarksPromise,
24040
+ new Promise((resolve) => setTimeout(() => resolve(null), LANDMARK_TIMEOUT_MS))
24041
+ ]);
24042
+ if (!landmarks) console.log("[ps-sdk] landmarks not ready in", LANDMARK_TIMEOUT_MS, "ms — proceeding without them");
23952
24043
  const payload = {
23953
24044
  method: "photo",
23954
24045
  locale: sizingCountry,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primestyleai/tryon",
3
- "version": "5.10.3",
3
+ "version": "5.10.5",
4
4
  "description": "PrimeStyle Virtual Try-On SDK — React component & Web Component",
5
5
  "type": "module",
6
6
  "main": "dist/primestyle-tryon.js",