@primestyleai/tryon 5.10.188 → 5.10.190

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.
@@ -275,7 +275,7 @@ var scheduler_production_min = {};
275
275
  * This source code is licensed under the MIT license found in the
276
276
  * LICENSE file in the root directory of this source tree.
277
277
  */
278
- (function(exports$1) {
278
+ (function(exports) {
279
279
  function f2(a, b) {
280
280
  var c = a.length;
281
281
  a.push(b);
@@ -308,12 +308,12 @@ var scheduler_production_min = {};
308
308
  }
309
309
  if ("object" === typeof performance && "function" === typeof performance.now) {
310
310
  var l2 = performance;
311
- exports$1.unstable_now = function() {
311
+ exports.unstable_now = function() {
312
312
  return l2.now();
313
313
  };
314
314
  } else {
315
315
  var p2 = Date, q2 = p2.now();
316
- exports$1.unstable_now = function() {
316
+ exports.unstable_now = function() {
317
317
  return p2.now() - q2;
318
318
  };
319
319
  }
@@ -349,7 +349,7 @@ var scheduler_production_min = {};
349
349
  v2.callback = null;
350
350
  y2 = v2.priorityLevel;
351
351
  var e = d(v2.expirationTime <= b);
352
- b = exports$1.unstable_now();
352
+ b = exports.unstable_now();
353
353
  "function" === typeof e ? v2.callback = e : v2 === h(r2) && k2(r2);
354
354
  G2(b);
355
355
  } else k2(r2);
@@ -368,11 +368,11 @@ var scheduler_production_min = {};
368
368
  }
369
369
  var N2 = false, O2 = null, L2 = -1, P2 = 5, Q2 = -1;
370
370
  function M2() {
371
- return exports$1.unstable_now() - Q2 < P2 ? false : true;
371
+ return exports.unstable_now() - Q2 < P2 ? false : true;
372
372
  }
373
373
  function R2() {
374
374
  if (null !== O2) {
375
- var a = exports$1.unstable_now();
375
+ var a = exports.unstable_now();
376
376
  Q2 = a;
377
377
  var b = true;
378
378
  try {
@@ -401,31 +401,31 @@ var scheduler_production_min = {};
401
401
  }
402
402
  function K2(a, b) {
403
403
  L2 = D2(function() {
404
- a(exports$1.unstable_now());
404
+ a(exports.unstable_now());
405
405
  }, b);
406
406
  }
407
- exports$1.unstable_IdlePriority = 5;
408
- exports$1.unstable_ImmediatePriority = 1;
409
- exports$1.unstable_LowPriority = 4;
410
- exports$1.unstable_NormalPriority = 3;
411
- exports$1.unstable_Profiling = null;
412
- exports$1.unstable_UserBlockingPriority = 2;
413
- exports$1.unstable_cancelCallback = function(a) {
407
+ exports.unstable_IdlePriority = 5;
408
+ exports.unstable_ImmediatePriority = 1;
409
+ exports.unstable_LowPriority = 4;
410
+ exports.unstable_NormalPriority = 3;
411
+ exports.unstable_Profiling = null;
412
+ exports.unstable_UserBlockingPriority = 2;
413
+ exports.unstable_cancelCallback = function(a) {
414
414
  a.callback = null;
415
415
  };
416
- exports$1.unstable_continueExecution = function() {
416
+ exports.unstable_continueExecution = function() {
417
417
  A2 || z2 || (A2 = true, I2(J2));
418
418
  };
419
- exports$1.unstable_forceFrameRate = function(a) {
419
+ exports.unstable_forceFrameRate = function(a) {
420
420
  0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P2 = 0 < a ? Math.floor(1e3 / a) : 5;
421
421
  };
422
- exports$1.unstable_getCurrentPriorityLevel = function() {
422
+ exports.unstable_getCurrentPriorityLevel = function() {
423
423
  return y2;
424
424
  };
425
- exports$1.unstable_getFirstCallbackNode = function() {
425
+ exports.unstable_getFirstCallbackNode = function() {
426
426
  return h(r2);
427
427
  };
428
- exports$1.unstable_next = function(a) {
428
+ exports.unstable_next = function(a) {
429
429
  switch (y2) {
430
430
  case 1:
431
431
  case 2:
@@ -443,11 +443,11 @@ var scheduler_production_min = {};
443
443
  y2 = c;
444
444
  }
445
445
  };
446
- exports$1.unstable_pauseExecution = function() {
446
+ exports.unstable_pauseExecution = function() {
447
447
  };
448
- exports$1.unstable_requestPaint = function() {
448
+ exports.unstable_requestPaint = function() {
449
449
  };
450
- exports$1.unstable_runWithPriority = function(a, b) {
450
+ exports.unstable_runWithPriority = function(a, b) {
451
451
  switch (a) {
452
452
  case 1:
453
453
  case 2:
@@ -466,8 +466,8 @@ var scheduler_production_min = {};
466
466
  y2 = c;
467
467
  }
468
468
  };
469
- exports$1.unstable_scheduleCallback = function(a, b, c) {
470
- var d = exports$1.unstable_now();
469
+ exports.unstable_scheduleCallback = function(a, b, c) {
470
+ var d = exports.unstable_now();
471
471
  "object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d;
472
472
  switch (a) {
473
473
  case 1:
@@ -490,8 +490,8 @@ var scheduler_production_min = {};
490
490
  c > d ? (a.sortIndex = c, f2(t2, a), null === h(r2) && a === h(t2) && (B2 ? (E2(L2), L2 = -1) : B2 = true, K2(H2, c - d))) : (a.sortIndex = e, f2(r2, a), A2 || z2 || (A2 = true, I2(J2)));
491
491
  return a;
492
492
  };
493
- exports$1.unstable_shouldYield = M2;
494
- exports$1.unstable_wrapCallback = function(a) {
493
+ exports.unstable_shouldYield = M2;
494
+ exports.unstable_wrapCallback = function(a) {
495
495
  var b = y2;
496
496
  return function() {
497
497
  var c = y2;
@@ -7119,8 +7119,6 @@ const es = {
7119
7119
  "Loose": "Holgado",
7120
7120
  "Short": "Corto",
7121
7121
  "Long": "Largo",
7122
- "Perfect": "Perfecto",
7123
- "Perfect fit": "Ajuste perfecto",
7124
7122
  "✓ Fit": "✓ Ajuste",
7125
7123
  "too short": "demasiado corto",
7126
7124
  "too long": "demasiado largo",
@@ -7377,8 +7375,6 @@ const fr = {
7377
7375
  "Loose": "Lâche",
7378
7376
  "Short": "Court",
7379
7377
  "Long": "Long",
7380
- "Perfect": "Parfait",
7381
- "Perfect fit": "Ajustement parfait",
7382
7378
  "✓ Fit": "✓ Ajusté",
7383
7379
  "too short": "trop court",
7384
7380
  "too long": "trop long",
@@ -7635,8 +7631,6 @@ const de = {
7635
7631
  "Loose": "Locker",
7636
7632
  "Short": "Kurz",
7637
7633
  "Long": "Lang",
7638
- "Perfect": "Perfekt",
7639
- "Perfect fit": "Perfekte Passform",
7640
7634
  "✓ Fit": "✓ Passt",
7641
7635
  "too short": "zu kurz",
7642
7636
  "too long": "zu lang",
@@ -7893,8 +7887,6 @@ const it = {
7893
7887
  "Loose": "Largo",
7894
7888
  "Short": "Corto",
7895
7889
  "Long": "Lungo",
7896
- "Perfect": "Perfetto",
7897
- "Perfect fit": "Vestibilità perfetta",
7898
7890
  "✓ Fit": "✓ Adatto",
7899
7891
  "too short": "troppo corto",
7900
7892
  "too long": "troppo lungo",
@@ -8151,8 +8143,6 @@ const pt$1 = {
8151
8143
  "Loose": "Folgado",
8152
8144
  "Short": "Curto",
8153
8145
  "Long": "Longo",
8154
- "Perfect": "Perfeito",
8155
- "Perfect fit": "Caimento perfeito",
8156
8146
  "✓ Fit": "✓ Caimento",
8157
8147
  "too short": "muito curto",
8158
8148
  "too long": "muito longo",
@@ -8409,8 +8399,6 @@ const ja = {
8409
8399
  "Loose": "ゆるい",
8410
8400
  "Short": "短い",
8411
8401
  "Long": "長い",
8412
- "Perfect": "ぴったり",
8413
- "Perfect fit": "ぴったりフィット",
8414
8402
  "✓ Fit": "✓ フィット",
8415
8403
  "too short": "短すぎる",
8416
8404
  "too long": "長すぎる",
@@ -8667,8 +8655,6 @@ const zh = {
8667
8655
  "Loose": "松",
8668
8656
  "Short": "短",
8669
8657
  "Long": "长",
8670
- "Perfect": "完美",
8671
- "Perfect fit": "完美合身",
8672
8658
  "✓ Fit": "✓ 合身",
8673
8659
  "too short": "太短",
8674
8660
  "too long": "太长",
@@ -8925,8 +8911,6 @@ const ko = {
8925
8911
  "Loose": "헐렁한",
8926
8912
  "Short": "짧은",
8927
8913
  "Long": "긴",
8928
- "Perfect": "완벽",
8929
- "Perfect fit": "완벽한 핏",
8930
8914
  "✓ Fit": "✓ 적합",
8931
8915
  "too short": "너무 짧음",
8932
8916
  "too long": "너무 김",
@@ -9183,8 +9167,6 @@ const ar = {
9183
9167
  "Loose": "فضفاض",
9184
9168
  "Short": "قصير",
9185
9169
  "Long": "طويل",
9186
- "Perfect": "مثالي",
9187
- "Perfect fit": "مقاس مثالي",
9188
9170
  "✓ Fit": "✓ مناسب",
9189
9171
  "too short": "قصير جداً",
9190
9172
  "too long": "طويل جداً",
@@ -9481,11 +9463,13 @@ class ApiClient {
9481
9463
  if (context?.productTags?.length) body.productTags = context.productTags;
9482
9464
  if (context?.productDescription) body.productDescription = context.productDescription;
9483
9465
  if (context?.productMaterial) body.productMaterial = context.productMaterial;
9466
+ if (context?.garmentDetailImage && context.garmentDetailImage !== garmentImage) body.garmentDetailImage = context.garmentDetailImage;
9484
9467
  if (context?.silhouetteContext) body.silhouetteContext = context.silhouetteContext;
9485
9468
  if (context?.editFromPrevious) body.editFromPrevious = true;
9486
9469
  console.log("[ps-sdk:api] POST /api/v1/tryon payload", {
9487
9470
  modelImageBytes: modelImage.length,
9488
9471
  garmentImageBytes: garmentImage.length,
9472
+ garmentDetailImageSet: !!body.garmentDetailImage,
9489
9473
  category: category || "apparel",
9490
9474
  fitInfo: fitInfo?.map((f2) => ({
9491
9475
  area: f2.area,
@@ -10538,6 +10522,14 @@ function saveProfiles(profiles) {
10538
10522
  function getActiveProfileId() {
10539
10523
  return lsGet(ACTIVE_PROFILE_KEY, null);
10540
10524
  }
10525
+ function isActiveProfileExplicitlyCleared() {
10526
+ if (typeof window === "undefined") return false;
10527
+ try {
10528
+ return localStorage.getItem(LS_PREFIX + ACTIVE_PROFILE_KEY) === "null";
10529
+ } catch {
10530
+ return false;
10531
+ }
10532
+ }
10541
10533
  function setActiveProfileId(id2) {
10542
10534
  lsSet(ACTIVE_PROFILE_KEY, id2);
10543
10535
  emitStorageChange("active-profile");
@@ -10960,6 +10952,13 @@ const SESSION_KEY = "primestyle_profile_session";
10960
10952
  const AUTH_MESSAGE_TYPE = "PRIMESTYLE_SDK_AUTH";
10961
10953
  const POPUP_TIMEOUT_MS = 12e4;
10962
10954
  const POLL_INTERVAL_MS = 900;
10955
+ function emitProfileAuthChange(reason) {
10956
+ if (typeof window === "undefined") return;
10957
+ try {
10958
+ window.dispatchEvent(new CustomEvent(PS_STORAGE_CHANGE_EVENT, { detail: { reason } }));
10959
+ } catch {
10960
+ }
10961
+ }
10963
10962
  function isTrustedAuthOrigin(eventOrigin, expectedOrigin) {
10964
10963
  if (eventOrigin === expectedOrigin) return true;
10965
10964
  try {
@@ -11012,6 +11011,7 @@ function setStoredProfileSession(session) {
11012
11011
  if (!storage) return;
11013
11012
  try {
11014
11013
  storage.setItem(SESSION_KEY, JSON.stringify(session));
11014
+ emitProfileAuthChange("profile-auth-set");
11015
11015
  } catch {
11016
11016
  }
11017
11017
  }
@@ -11020,6 +11020,7 @@ function clearStoredProfileSession() {
11020
11020
  if (!storage) return;
11021
11021
  try {
11022
11022
  storage.removeItem(SESSION_KEY);
11023
+ emitProfileAuthChange("profile-auth-clear");
11023
11024
  } catch {
11024
11025
  }
11025
11026
  }
@@ -11161,6 +11162,10 @@ async function recommendForProduct(input) {
11161
11162
  log("no signed-in profile session — returning null");
11162
11163
  return null;
11163
11164
  }
11165
+ if (!input.profile && isActiveProfileExplicitlyCleared()) {
11166
+ log("active profile explicitly cleared locally — returning null");
11167
+ return null;
11168
+ }
11164
11169
  let remoteProfiles = [];
11165
11170
  let activeProfileId = null;
11166
11171
  try {
@@ -12312,8 +12317,9 @@ const STYLES = `
12312
12317
  align-self: stretch;
12313
12318
  height: 100%;
12314
12319
  justify-content: flex-start;
12315
- gap: 0.55vw;
12316
- padding-bottom: clamp(8px, 0.72vw, 14px);
12320
+ gap: clamp(8px, 0.48vw, 12px);
12321
+ padding-bottom: clamp(4px, 0.35vw, 8px);
12322
+ overflow: hidden;
12317
12323
  }
12318
12324
  .ps-tryon-v2-result-panel .ps-tryon-v2-sep {
12319
12325
  margin-bottom: 0;
@@ -12323,16 +12329,17 @@ const STYLES = `
12323
12329
  min-height: 0;
12324
12330
  }
12325
12331
  .ps-tryon-v2-result-panel .ps-tryon-photo-strip {
12326
- flex: 0 0 auto;
12332
+ flex: 1 1 auto;
12327
12333
  min-height: 0;
12328
- margin-top: clamp(10px, 0.75vw, 14px);
12329
- margin-bottom: clamp(8px, 0.7vw, 12px);
12334
+ margin-top: clamp(18px, 1.25vw, 26px);
12335
+ margin-bottom: clamp(4px, 0.35vw, 8px);
12336
+ overflow: hidden;
12330
12337
  }
12331
12338
  .ps-tryon-v2-result-panel .ps-tryon-sr-card-v2 {
12332
- min-height: clamp(140px, 10.5vw, 165px);
12339
+ min-height: clamp(118px, 8.6vw, 142px);
12333
12340
  }
12334
12341
  .ps-tryon-v2-result-panel .ps-tryon-sr-card-v2.ps-full {
12335
- min-height: clamp(140px, 10.5vw, 165px);
12342
+ min-height: clamp(118px, 8.6vw, 142px);
12336
12343
  }
12337
12344
  .ps-tryon-v2-result-panel .ps-tryon-photo-strip-cell {
12338
12345
  aspect-ratio: 1 / 1;
@@ -12343,10 +12350,33 @@ const STYLES = `
12343
12350
  align-items: center;
12344
12351
  justify-content: space-between;
12345
12352
  margin-top: auto;
12346
- padding-top: clamp(8px, 0.65vw, 12px);
12347
- padding-bottom: 0;
12353
+ padding-top: clamp(6px, 0.45vw, 10px);
12354
+ padding-bottom: clamp(2px, 0.25vw, 6px);
12348
12355
  gap: 0.5vw;
12349
12356
  flex-shrink: 0;
12357
+ width: 100%;
12358
+ min-height: clamp(42px, 3.1vw, 52px);
12359
+ box-sizing: border-box;
12360
+ border-top: 1px solid rgba(15,23,42,0.06);
12361
+ }
12362
+ .ps-tryon-v2-result-actions > .ps-tryon-v2-action-group {
12363
+ flex: 0 1 min(26vw, 390px);
12364
+ min-width: 0;
12365
+ max-width: min(100%, 390px);
12366
+ margin-left: auto;
12367
+ }
12368
+ .ps-tryon-v2-result-actions .ps-tryon-v2-cta {
12369
+ flex: 1 1 0;
12370
+ min-width: 0;
12371
+ min-height: clamp(38px, 2.55vw, 44px);
12372
+ padding: 0 clamp(10px, 0.75vw, 14px);
12373
+ }
12374
+ .ps-tryon-v2-result-actions > .ps-tryon-v2-cta {
12375
+ flex: 0 1 min(18vw, 240px);
12376
+ margin-left: auto;
12377
+ }
12378
+ .ps-tryon-v2-result-actions > .ps-tryon-v2-action-group .ps-tryon-v2-cta {
12379
+ flex: 1 1 0;
12350
12380
  }
12351
12381
  @keyframes ps-v2-fade {
12352
12382
  0% { opacity: 0; }
@@ -12376,6 +12406,9 @@ const STYLES = `
12376
12406
  gap: 0.8vw; margin-bottom: 0.55vw;
12377
12407
  }
12378
12408
  .ps-tryon-v2-result-copy { min-width: 0; flex: 1 1 auto; }
12409
+ .ps-single-result-copy {
12410
+ margin: 0 0 clamp(24px, 1.8vw, 34px);
12411
+ }
12379
12412
  .ps-tryon-v2-profile-head {
12380
12413
  flex: 0 0 min(18vw, 48%);
12381
12414
  min-width: 15vw;
@@ -12490,12 +12523,12 @@ const STYLES = `
12490
12523
 
12491
12524
  /* CTA button */
12492
12525
  .ps-tryon-v2-cta {
12493
- margin-top: 0.8vw; padding: 0.65vw 1.5vw;
12494
- width: auto; min-width: 12vw; display: flex; align-items: center; justify-content: center; gap: 0.4vw;
12526
+ margin-top: 0.8vw; padding: 0.55vw 1.05vw;
12527
+ width: auto; min-width: 9.2vw; min-height: 2.35vw; display: flex; align-items: center; justify-content: center; gap: 0.35vw;
12495
12528
  background: var(--ps-accent); color: #fff;
12496
- border: none; border-radius: 0.35vw;
12497
- font-size: 0.72vw; font-weight: 700; font-family: inherit;
12498
- letter-spacing: 0.12em; text-transform: uppercase;
12529
+ border: none; border-radius: 0.42vw;
12530
+ font-size: clamp(10px, 0.64vw, 12px); font-weight: 750; font-family: inherit;
12531
+ letter-spacing: 0.07em; text-transform: uppercase;
12499
12532
  cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
12500
12533
  flex-shrink: 0;
12501
12534
  }
@@ -12506,6 +12539,98 @@ const STYLES = `
12506
12539
  transform: translateY(-1px);
12507
12540
  }
12508
12541
  .ps-tryon-v2-cta svg { width: 0.8vw; height: 0.8vw; stroke: currentColor; }
12542
+ .ps-tryon-v2-action-group {
12543
+ display: flex;
12544
+ align-items: center;
12545
+ justify-content: flex-end;
12546
+ gap: clamp(8px, 0.55vw, 12px);
12547
+ min-width: 0;
12548
+ }
12549
+ .ps-tryon-v2-action-group-history {
12550
+ flex: 0 0 auto !important;
12551
+ width: auto !important;
12552
+ max-width: none !important;
12553
+ }
12554
+ .ps-tryon-v2-cta-compact,
12555
+ .ps-tryon-v2-history-product-cta {
12556
+ flex: 0 0 auto !important;
12557
+ width: auto !important;
12558
+ min-width: 0 !important;
12559
+ min-height: clamp(34px, 2.25vw, 40px) !important;
12560
+ padding: 0 clamp(10px, 0.75vw, 14px) !important;
12561
+ letter-spacing: 0.03em;
12562
+ text-transform: none;
12563
+ font-weight: 750;
12564
+ }
12565
+ .ps-tryon-v2-history-product-cta {
12566
+ justify-content: center;
12567
+ }
12568
+ .ps-tryon-v2-add-bag-cta svg,
12569
+ .ps-tryon-v2-history-product-cta svg {
12570
+ flex: 0 0 auto;
12571
+ width: clamp(16px, 1vw, 18px);
12572
+ height: clamp(16px, 1vw, 18px);
12573
+ stroke-width: 2.1;
12574
+ }
12575
+ .ps-tryon-v2-add-bag-cta.is-added {
12576
+ background: #16a34a;
12577
+ color: #fff;
12578
+ }
12579
+ .ps-tryon-v2-add-bag-cta.is-added:disabled {
12580
+ opacity: 1;
12581
+ cursor: default;
12582
+ }
12583
+ .ps-tryon-v2-add-bag-cta.is-added svg {
12584
+ animation: ps-added-check 0.42s cubic-bezier(0.16, 1, 0.3, 1);
12585
+ }
12586
+ @keyframes ps-added-check {
12587
+ 0% { transform: scale(0.45); opacity: 0; }
12588
+ 55% { transform: scale(1.18); opacity: 1; }
12589
+ 100% { transform: scale(1); opacity: 1; }
12590
+ }
12591
+ .ps-tryon-v2-cta-secondary {
12592
+ background: #FFFFFF;
12593
+ color: var(--ps-accent);
12594
+ border: 1px solid rgba(33,84,239,0.38);
12595
+ box-shadow: none;
12596
+ }
12597
+ .ps-tryon-v2-cta-secondary:hover {
12598
+ background: rgba(33,84,239,0.06);
12599
+ color: var(--ps-accent);
12600
+ border-color: var(--ps-accent);
12601
+ box-shadow: 0 0.25vw 1vw rgba(33,84,239,0.12);
12602
+ }
12603
+ @media (max-width: 768px) {
12604
+ .ps-tryon-v2-action-group {
12605
+ width: 100%;
12606
+ gap: 8px;
12607
+ }
12608
+ .ps-tryon-v2-action-group-history {
12609
+ width: auto !important;
12610
+ margin-left: auto;
12611
+ }
12612
+ .ps-tryon-v2-action-group .ps-tryon-v2-cta,
12613
+ .ps-msr-commerce-row > .ps-tryon-v2-cta {
12614
+ flex: 1 1 0;
12615
+ min-width: 0;
12616
+ padding: 11px 12px;
12617
+ border-radius: 10px;
12618
+ font-size: 11px;
12619
+ letter-spacing: 0.08em;
12620
+ white-space: nowrap;
12621
+ }
12622
+ .ps-tryon-v2-action-group-history .ps-tryon-v2-cta {
12623
+ flex: 0 0 auto !important;
12624
+ width: auto !important;
12625
+ padding: 10px 12px !important;
12626
+ letter-spacing: 0.02em;
12627
+ }
12628
+ .ps-tryon-v2-add-bag-cta svg,
12629
+ .ps-tryon-v2-history-product-cta svg {
12630
+ width: 17px;
12631
+ height: 17px;
12632
+ }
12633
+ }
12509
12634
 
12510
12635
  /* ── Size result card rows (split layout) ── */
12511
12636
  .ps-tryon-sr-cards-stack {
@@ -12588,39 +12713,141 @@ const STYLES = `
12588
12713
  flex: 1 1 45%; max-width: 49%;
12589
12714
  display: flex; flex-direction: column; align-items: center; justify-content: center;
12590
12715
  text-align: center;
12591
- background: rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.06);
12592
- border-radius: 0.6vw; padding: 1vw 0.5vw;
12716
+ background: linear-gradient(180deg, #FFFFFF 0%, #FBFCFF 100%);
12717
+ border: 1px solid rgba(15,23,42,0.08);
12718
+ border-radius: clamp(12px, 0.72vw, 14px); padding: clamp(14px, 0.82vw, 18px);
12593
12719
  cursor: pointer; font-family: inherit;
12594
12720
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
12595
12721
  animation: ps-card-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
12596
12722
  opacity: 0; overflow: hidden; position: relative;
12597
12723
  min-height: 7vw;
12598
12724
  }
12599
- .ps-tryon-sr-card-v2.ps-full { flex: 1 1 100%; max-width: 100%; min-height: 5vw; padding: 0.8vw; }
12725
+ .ps-tryon-sr-card-v2::after {
12726
+ content: "";
12727
+ position: absolute;
12728
+ inset: 0;
12729
+ border-radius: inherit;
12730
+ pointer-events: none;
12731
+ background: radial-gradient(circle at 50% 0%, rgba(33,84,239,0.08), transparent 38%);
12732
+ opacity: 0.6;
12733
+ }
12734
+ .ps-tryon-sr-card-v2.ps-full { flex: 1 1 100%; max-width: 100%; min-height: 5vw; padding: clamp(14px, 0.82vw, 18px); }
12735
+ .ps-tryon-sr-card-v2.ps-summary-card {
12736
+ align-items: center;
12737
+ justify-content: center;
12738
+ text-align: center;
12739
+ min-height: clamp(154px, 10.4vw, 184px);
12740
+ padding: clamp(16px, 1vw, 22px) clamp(18px, 1.18vw, 26px);
12741
+ background: #FFFFFF;
12742
+ box-shadow: none;
12743
+ }
12744
+ .ps-tryon-sr-card-v2.ps-summary-card::after {
12745
+ display: none;
12746
+ }
12600
12747
  .ps-tryon-sr-card-v2:hover {
12601
12748
  border-color: var(--ps-accent);
12602
- background: rgba(33,84,239,0.06);
12749
+ background: linear-gradient(180deg, #FFFFFF 0%, rgba(33,84,239,0.045) 100%);
12603
12750
  transform: translateY(-2px);
12604
- box-shadow: 0 0.4vw 1.5vw rgba(0,0,0,0.08);
12751
+ box-shadow: 0 0.45vw 1.4vw rgba(15,23,42,0.08);
12605
12752
  }
12606
12753
  .ps-tryon-sr-card-v2-text {
12607
- display: flex; flex-direction: column; align-items: center; gap: 0.15vw; z-index: 1;
12754
+ display: flex; flex-direction: column; align-items: center; gap: clamp(5px, 0.22vw, 7px); z-index: 1;
12755
+ }
12756
+ .ps-summary-card-layout {
12757
+ width: 100%;
12758
+ display: flex;
12759
+ flex-direction: column;
12760
+ justify-content: center;
12761
+ align-items: center;
12762
+ gap: clamp(6px, 0.36vw, 10px);
12763
+ }
12764
+ .ps-summary-card-copy {
12765
+ display: flex;
12766
+ flex-direction: column;
12767
+ align-items: center;
12768
+ justify-content: center;
12769
+ min-width: 0;
12770
+ gap: clamp(8px, 0.48vw, 12px);
12771
+ }
12772
+ .ps-tryon-sr-card-v2-heading {
12773
+ grid-area: heading;
12774
+ display: flex;
12775
+ align-items: center;
12776
+ gap: clamp(8px, 0.55vw, 12px);
12777
+ min-width: 0;
12778
+ }
12779
+ .ps-tryon-sr-card-v2-main {
12780
+ display: flex;
12781
+ align-items: center;
12782
+ justify-content: flex-start;
12783
+ gap: clamp(9px, 0.6vw, 14px);
12784
+ min-width: 0;
12785
+ }
12786
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-open-pill {
12787
+ margin-top: 0;
12788
+ white-space: nowrap;
12789
+ }
12790
+ .ps-tryon-sr-card-outside-label {
12791
+ margin: 0 0 clamp(8px, 0.5vw, 11px);
12792
+ font-size: clamp(10px, 0.62vw, 12px);
12793
+ font-weight: 780;
12794
+ color: rgba(15,23,42,0.56);
12795
+ letter-spacing: 0.13em;
12796
+ text-transform: uppercase;
12797
+ }
12798
+ .ps-tryon-sr-card-v2-summary-title {
12799
+ font-size: clamp(11px, 0.66vw, 12px);
12800
+ font-weight: 760;
12801
+ color: rgba(15,23,42,0.56);
12802
+ letter-spacing: 0.06em;
12803
+ text-transform: uppercase;
12804
+ line-height: 1.2;
12805
+ margin-bottom: clamp(2px, 0.08vw, 4px);
12806
+ }
12807
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-summary-title {
12808
+ margin-bottom: clamp(1px, 0.08vw, 3px);
12809
+ white-space: nowrap;
12810
+ color: rgba(15,23,42,0.58);
12811
+ font-size: clamp(11px, 0.66vw, 12px);
12812
+ font-weight: 780;
12813
+ letter-spacing: 0.12em;
12814
+ text-transform: uppercase;
12815
+ }
12816
+ .ps-tryon-sr-card-v2-summary-subtitle {
12817
+ font-size: clamp(10px, 0.56vw, 11px);
12818
+ font-weight: 400;
12819
+ color: rgba(0,0,0,0.32);
12820
+ letter-spacing: 0.02em;
12821
+ line-height: 1.25;
12822
+ text-transform: none;
12823
+ margin-bottom: 0.35vw;
12608
12824
  }
12609
12825
  .ps-tryon-sr-card-v2-label {
12610
- font-size: 0.65vw; font-weight: 600; color: var(--ps-text-secondary);
12611
- text-transform: uppercase; letter-spacing: 0.1em;
12826
+ font-size: clamp(10px, 0.56vw, 11px); font-weight: 650; color: rgba(15,23,42,0.58);
12827
+ text-transform: uppercase; letter-spacing: 0.08em;
12612
12828
  display: inline-flex; align-items: center; gap: 0.5vw;
12613
12829
  }
12830
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-label {
12831
+ min-width: 0;
12832
+ overflow: hidden;
12833
+ text-overflow: ellipsis;
12834
+ white-space: nowrap;
12835
+ }
12614
12836
  .ps-tryon-sr-card-v2-label-icon {
12615
12837
  width: 4.8vw; height: 4.8vw; object-fit: contain;
12616
12838
  opacity: 1;
12617
12839
  }
12618
12840
  .ps-tryon-sr-card-v2-value {
12619
- font-size: 2.2vw; font-weight: 200; color: var(--ps-text-primary);
12841
+ font-size: clamp(30px, 2.18vw, 38px); font-weight: 260; color: var(--ps-text-primary);
12620
12842
  line-height: 1; letter-spacing: -0.02em;
12621
12843
  overflow-wrap: anywhere;
12622
12844
  }
12623
- .ps-tryon-sr-card-v2.ps-full .ps-tryon-sr-card-v2-value { font-size: 1.8vw; }
12845
+ .ps-tryon-sr-card-v2.ps-full .ps-tryon-sr-card-v2-value { font-size: clamp(30px, 2vw, 36px); }
12846
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-value {
12847
+ font-size: clamp(34px, 2.2vw, 42px);
12848
+ min-width: 0;
12849
+ text-align: center;
12850
+ }
12624
12851
  /* Long combined labels ("MISSY 12 / Standard", "PLUS 16W / Extra Length")
12625
12852
  overflow the card at 2vw. Drop to ~1.3vw whenever the label is more
12626
12853
  than ~12 chars so the whole thing fits on one line. */
@@ -12639,13 +12866,19 @@ const STYLES = `
12639
12866
  }
12640
12867
  .ps-tryon-sr-card-v2-rec-pill {
12641
12868
  align-self: center;
12642
- font-size: 0.55vw; font-weight: 700; color: var(--ps-accent);
12643
- text-transform: uppercase; letter-spacing: 0.08em;
12869
+ font-size: clamp(9px, 0.52vw, 10px); font-weight: 780; color: var(--ps-accent);
12870
+ text-transform: uppercase; letter-spacing: 0.07em;
12644
12871
  background: rgba(33, 84, 239, 0.10);
12645
12872
  border: 1px solid rgba(33, 84, 239, 0.18);
12646
12873
  border-radius: 2vw;
12647
- padding: 0.18vw 0.6vw;
12648
- margin-top: 0.3vw;
12874
+ padding: clamp(3px, 0.18vw, 4px) clamp(9px, 0.58vw, 12px);
12875
+ margin-top: clamp(2px, 0.12vw, 4px);
12876
+ }
12877
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-rec-pill {
12878
+ align-self: center;
12879
+ margin-top: clamp(1px, 0.1vw, 3px);
12880
+ white-space: nowrap;
12881
+ background: #fff;
12649
12882
  }
12650
12883
  .ps-tryon-sr-card-v2-rec-pill.is-overridden {
12651
12884
  color: #b45309;
@@ -12654,10 +12887,10 @@ const STYLES = `
12654
12887
  }
12655
12888
  .ps-tryon-sr-card-v2-view {
12656
12889
  align-self: center;
12657
- margin-top: 0.4vw;
12658
- font-size: 0.62vw; font-weight: 600;
12890
+ margin-top: clamp(2px, 0.18vw, 5px);
12891
+ font-size: clamp(10px, 0.58vw, 11px); font-weight: 700;
12659
12892
  color: var(--ps-accent);
12660
- text-transform: uppercase; letter-spacing: 0.06em;
12893
+ text-transform: none; letter-spacing: 0.02em;
12661
12894
  display: inline-flex; align-items: center; justify-content: center; gap: 0.2vw;
12662
12895
  transition: gap 0.2s ease;
12663
12896
  }
@@ -12668,6 +12901,55 @@ const STYLES = `
12668
12901
  font-size: 0.85vw; line-height: 1; color: var(--ps-accent);
12669
12902
  transform: translateY(-0.05vw);
12670
12903
  }
12904
+ .ps-tryon-sr-card-v2-open-pill {
12905
+ margin-top: clamp(4px, 0.26vw, 7px);
12906
+ display: inline-flex;
12907
+ align-items: center;
12908
+ justify-content: center;
12909
+ gap: clamp(4px, 0.25vw, 6px);
12910
+ min-height: clamp(26px, 1.65vw, 32px);
12911
+ padding: 0 clamp(10px, 0.68vw, 14px);
12912
+ border-radius: 999px;
12913
+ background: #fff;
12914
+ border: 1px solid rgba(33,84,239,0.22);
12915
+ color: var(--ps-accent);
12916
+ font-size: clamp(10px, 0.58vw, 11px);
12917
+ font-weight: 760;
12918
+ letter-spacing: 0.01em;
12919
+ box-shadow: 0 0.18vw 0.8vw rgba(33,84,239,0.08);
12920
+ transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
12921
+ }
12922
+ .ps-tryon-sr-card-v2-open-pill > span[aria-hidden="true"] {
12923
+ font-size: clamp(14px, 0.85vw, 16px);
12924
+ line-height: 1;
12925
+ transform: translateY(-0.03vw);
12926
+ }
12927
+ .ps-tryon-sr-card-v2:hover .ps-tryon-sr-card-v2-open-pill {
12928
+ transform: translateY(-1px);
12929
+ border-color: rgba(33,84,239,0.45);
12930
+ box-shadow: 0 0.24vw 1vw rgba(33,84,239,0.13);
12931
+ }
12932
+ @media (max-width: 768px) {
12933
+ .ps-tryon-sr-card-v2.ps-summary-card {
12934
+ min-height: 108px;
12935
+ padding: 16px;
12936
+ }
12937
+ .ps-summary-card-layout {
12938
+ gap: 8px;
12939
+ align-items: center;
12940
+ }
12941
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-main {
12942
+ width: 100%;
12943
+ justify-content: center;
12944
+ gap: 12px;
12945
+ }
12946
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-value {
12947
+ font-size: 34px;
12948
+ }
12949
+ .ps-summary-card-layout .ps-tryon-sr-card-v2-open-pill {
12950
+ min-height: 38px;
12951
+ }
12952
+ }
12671
12953
  .ps-tryon-sr-card-v2-img { display: none; }
12672
12954
  .ps-tryon-sr-card-v2-icon {
12673
12955
  position: absolute; bottom: 0.35vw; right: 0.45vw;
@@ -13858,6 +14140,22 @@ const STYLES = `
13858
14140
  border-top-color: var(--ps-accent); border-radius: 50%;
13859
14141
  animation: ps-spin 0.7s linear infinite; margin: 0 auto;
13860
14142
  }
14143
+ .ps-bp-profile-hydrating {
14144
+ min-height: min(52vh, 420px);
14145
+ display: flex;
14146
+ align-items: center;
14147
+ justify-content: center;
14148
+ gap: clamp(10px, 0.7vw, 14px);
14149
+ color: var(--ps-text-secondary);
14150
+ font-size: clamp(13px, 0.82vw, 15px);
14151
+ font-weight: 650;
14152
+ }
14153
+ .ps-bp-profile-hydrating .ps-tryon-size-loading-spinner {
14154
+ width: clamp(18px, 1.25vw, 22px);
14155
+ height: clamp(18px, 1.25vw, 22px);
14156
+ flex-shrink: 0;
14157
+ margin: 0;
14158
+ }
13861
14159
  @keyframes ps-spin { to { transform: rotate(360deg); } }
13862
14160
  .ps-tryon-sr-loading-pulse { animation: ps-loading-pulse 2s ease-in-out infinite; }
13863
14161
  @keyframes ps-loading-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@@ -16656,6 +16954,87 @@ const STYLES = `
16656
16954
  }
16657
16955
  .ps-bp-image-remove:hover { background: rgba(0,0,0,0.8); }
16658
16956
 
16957
+ .ps-bp-photo-help-chip {
16958
+ position: absolute;
16959
+ top: clamp(8px, 0.65vw, 12px);
16960
+ left: clamp(8px, 0.65vw, 12px);
16961
+ z-index: 3;
16962
+ display: inline-flex;
16963
+ align-items: center;
16964
+ gap: clamp(5px, 0.35vw, 7px);
16965
+ max-width: calc(100% - clamp(58px, 4.2vw, 78px));
16966
+ padding: clamp(5px, 0.38vw, 7px) clamp(8px, 0.62vw, 12px);
16967
+ border: 1px solid rgba(33, 84, 239, 0.22);
16968
+ border-radius: 999px;
16969
+ background: rgba(255, 255, 255, 0.92);
16970
+ color: var(--ps-accent);
16971
+ box-shadow: 0 8px 20px -16px rgba(17, 24, 39, 0.35);
16972
+ backdrop-filter: blur(8px);
16973
+ -webkit-backdrop-filter: blur(8px);
16974
+ font-family: inherit;
16975
+ font-size: clamp(10px, 0.6vw, 12px);
16976
+ font-weight: 800;
16977
+ letter-spacing: 0.04em;
16978
+ line-height: 1;
16979
+ white-space: nowrap;
16980
+ cursor: pointer;
16981
+ transition: background 0.15s, color 0.15s, border-color 0.15s;
16982
+ }
16983
+ .ps-bp-photo-help-chip.ps-active {
16984
+ background: var(--ps-accent);
16985
+ border-color: var(--ps-accent);
16986
+ color: #FFFFFF;
16987
+ }
16988
+ .ps-bp-photo-help-chip-mark {
16989
+ display: inline-flex;
16990
+ align-items: center;
16991
+ justify-content: center;
16992
+ width: clamp(14px, 0.9vw, 16px);
16993
+ height: clamp(14px, 0.9vw, 16px);
16994
+ flex: 0 0 auto;
16995
+ border-radius: 999px;
16996
+ background: var(--ps-accent);
16997
+ color: #FFFFFF;
16998
+ font-size: clamp(10px, 0.58vw, 11px);
16999
+ font-weight: 900;
17000
+ }
17001
+ .ps-bp-photo-help-chip.ps-active .ps-bp-photo-help-chip-mark {
17002
+ background: #FFFFFF;
17003
+ color: var(--ps-accent);
17004
+ }
17005
+
17006
+ .ps-bp-photo-details-head {
17007
+ display: flex;
17008
+ align-items: center;
17009
+ justify-content: space-between;
17010
+ gap: clamp(10px, 0.8vw, 16px);
17011
+ padding: 0 0 clamp(5px, 0.35vw, 8px);
17012
+ border-bottom: 1px solid var(--ps-border-subtle);
17013
+ }
17014
+ .ps-bp-photo-details-head h3 {
17015
+ margin: 0;
17016
+ color: var(--ps-text-primary);
17017
+ font-size: clamp(13px, 0.82vw, 16px);
17018
+ font-weight: 800;
17019
+ letter-spacing: 0.01em;
17020
+ line-height: 1.1;
17021
+ }
17022
+ .ps-bp-photo-details-head-simple {
17023
+ padding-bottom: clamp(8px, 0.55vw, 12px);
17024
+ }
17025
+ .ps-bp-photo-details-head-simple h3 {
17026
+ font-size: clamp(14px, 0.9vw, 17px);
17027
+ }
17028
+ .ps-bp-system-toggle-compact {
17029
+ margin: 0;
17030
+ gap: clamp(12px, 0.85vw, 18px);
17031
+ flex-shrink: 0;
17032
+ }
17033
+ .ps-bp-system-toggle-compact .ps-bp-system-btn {
17034
+ font-size: clamp(11px, 0.66vw, 13px);
17035
+ padding: 0 0 3px;
17036
+ }
17037
+
16659
17038
  .ps-bp-root {
16660
17039
  flex: 1; min-width: 0;
16661
17040
  display: flex; flex-direction: column; gap: 0.6vw; padding: 0.2vw 0.5vw 0.3vw 0;
@@ -16708,10 +17087,10 @@ const STYLES = `
16708
17087
  display: flex;
16709
17088
  align-items: center;
16710
17089
  justify-content: space-between;
16711
- gap: clamp(10px, 0.9vw, 18px);
16712
- width: min(100%, 520px);
16713
- margin: 0 auto clamp(10px, 0.9vw, 18px);
16714
- padding: clamp(10px, 0.85vw, 16px) clamp(12px, 1vw, 20px);
17090
+ gap: clamp(10px, 0.74vw, 16px);
17091
+ width: min(100%, 500px);
17092
+ margin: 0 auto clamp(8px, 0.62vw, 13px);
17093
+ padding: clamp(8px, 0.62vw, 12px) clamp(12px, 0.9vw, 18px);
16715
17094
  border: 1px solid rgba(33, 84, 239, 0.18);
16716
17095
  border-radius: clamp(8px, 0.7vw, 12px);
16717
17096
  background: linear-gradient(135deg, rgba(33, 84, 239, 0.08), rgba(255, 255, 255, 0.96));
@@ -16720,18 +17099,18 @@ const STYLES = `
16720
17099
  .ps-bp-profile-card-copy {
16721
17100
  display: flex;
16722
17101
  flex-direction: column;
16723
- gap: clamp(2px, 0.18vw, 4px);
17102
+ gap: clamp(1px, 0.12vw, 3px);
16724
17103
  min-width: 0;
16725
17104
  }
16726
17105
  .ps-bp-profile-card-eyebrow {
16727
- font-size: clamp(8px, 0.55vw, 10px);
17106
+ font-size: clamp(9px, 0.58vw, 11px);
16728
17107
  font-weight: 800;
16729
17108
  letter-spacing: 0.14em;
16730
17109
  text-transform: uppercase;
16731
17110
  color: var(--ps-accent);
16732
17111
  }
16733
17112
  .ps-bp-profile-card-copy strong {
16734
- font-size: clamp(13px, 0.95vw, 17px);
17113
+ font-size: clamp(13px, 0.9vw, 16px);
16735
17114
  line-height: 1.1;
16736
17115
  color: var(--ps-text-primary);
16737
17116
  overflow: hidden;
@@ -16739,8 +17118,8 @@ const STYLES = `
16739
17118
  white-space: nowrap;
16740
17119
  }
16741
17120
  .ps-bp-profile-card-copy span:last-child {
16742
- font-size: clamp(10px, 0.68vw, 12px);
16743
- line-height: 1.35;
17121
+ font-size: clamp(10px, 0.62vw, 12px);
17122
+ line-height: 1.25;
16744
17123
  color: var(--ps-text-secondary);
16745
17124
  }
16746
17125
  .ps-bp-profile-card-action {
@@ -16749,9 +17128,9 @@ const STYLES = `
16749
17128
  background: #FFFFFF;
16750
17129
  color: var(--ps-accent);
16751
17130
  border-radius: 999px;
16752
- padding: clamp(7px, 0.55vw, 10px) clamp(10px, 0.8vw, 16px);
17131
+ padding: clamp(7px, 0.5vw, 9px) clamp(10px, 0.76vw, 15px);
16753
17132
  font-family: inherit;
16754
- font-size: clamp(9px, 0.62vw, 11px);
17133
+ font-size: clamp(10px, 0.66vw, 12px);
16755
17134
  font-weight: 800;
16756
17135
  letter-spacing: 0.08em;
16757
17136
  text-transform: uppercase;
@@ -16763,6 +17142,39 @@ const STYLES = `
16763
17142
  background: rgba(33, 84, 239, 0.06);
16764
17143
  }
16765
17144
  .ps-bp-profile-card-action:active { transform: scale(0.98); }
17145
+ .ps-bp-profile-card-compact {
17146
+ margin: 0 auto clamp(4px, 0.36vw, 7px);
17147
+ padding: clamp(5px, 0.4vw, 8px) clamp(10px, 0.72vw, 14px);
17148
+ border-radius: clamp(7px, 0.55vw, 10px);
17149
+ box-shadow: none;
17150
+ }
17151
+ .ps-bp-profile-card-compact .ps-bp-profile-card-copy {
17152
+ display: grid;
17153
+ grid-template-columns: auto minmax(0, 1fr);
17154
+ align-items: baseline;
17155
+ gap: 2px clamp(6px, 0.45vw, 9px);
17156
+ }
17157
+ .ps-bp-profile-card-compact .ps-bp-profile-card-eyebrow {
17158
+ grid-column: 1 / -1;
17159
+ font-size: clamp(8px, 0.5vw, 10px);
17160
+ letter-spacing: 0.16em;
17161
+ line-height: 1;
17162
+ }
17163
+ .ps-bp-profile-card-compact .ps-bp-profile-card-copy strong {
17164
+ font-size: clamp(12px, 0.78vw, 14px);
17165
+ line-height: 1.05;
17166
+ }
17167
+ .ps-bp-profile-card-compact .ps-bp-profile-card-copy span:last-child {
17168
+ font-size: clamp(9px, 0.54vw, 11px);
17169
+ line-height: 1.1;
17170
+ overflow: hidden;
17171
+ text-overflow: ellipsis;
17172
+ white-space: nowrap;
17173
+ }
17174
+ .ps-bp-profile-card-compact .ps-bp-profile-card-action {
17175
+ padding: clamp(5px, 0.36vw, 7px) clamp(8px, 0.62vw, 12px);
17176
+ font-size: clamp(9px, 0.56vw, 11px);
17177
+ }
16766
17178
 
16767
17179
  /* Typography */
16768
17180
  .ps-bp-title {
@@ -17978,6 +18390,16 @@ const STYLES = `
17978
18390
  .ps-msr-bottom-row {
17979
18391
  display: flex; gap: 8px; align-items: stretch; justify-content: flex-end;
17980
18392
  }
18393
+ .ps-msr-bottom-row.ps-msr-commerce-row {
18394
+ width: 100%;
18395
+ }
18396
+ .ps-msr-commerce-row .ps-tryon-v2-action-group {
18397
+ width: 100%;
18398
+ }
18399
+ .ps-msr-commerce-row .ps-tryon-v2-cta {
18400
+ flex: 1 1 0;
18401
+ min-width: 0;
18402
+ }
17981
18403
  .ps-msr-bottom-row .ps-msr-tryon-cta {
17982
18404
  flex: 0 0 auto; min-width: 94px; width: auto;
17983
18405
  padding: 11px 14px; font-size: 12px;
@@ -20408,6 +20830,14 @@ const STYLES = `
20408
20830
  opacity: 0.6;
20409
20831
  cursor: default;
20410
20832
  }
20833
+ .ps-msd-result-action-group {
20834
+ flex: 1 1 0;
20835
+ justify-content: flex-end;
20836
+ }
20837
+ .ps-msd-result-action-group .ps-tryon-v2-cta {
20838
+ flex: 1 1 0;
20839
+ min-width: 0;
20840
+ }
20411
20841
 
20412
20842
  /* RECOMMENDED SIZE card */
20413
20843
  .ps-msd-card {
@@ -20684,6 +21114,14 @@ const STYLES = `
20684
21114
  display: flex; flex-direction: column; gap: 0.6vw;
20685
21115
  z-index: 5;
20686
21116
  }
21117
+ .ps-bp-photo-help-upload {
21118
+ top: clamp(46px, 3.2vw, 58px);
21119
+ left: clamp(12px, 0.85vw, 16px);
21120
+ right: auto;
21121
+ width: min(360px, calc(100% - clamp(24px, 1.7vw, 32px)));
21122
+ max-height: calc(100% - clamp(64px, 4.5vw, 82px));
21123
+ overflow-y: auto;
21124
+ }
20687
21125
  .ps-bp-photo-help-handle { display: none; }
20688
21126
  .ps-bp-photo-help-header { display: flex; align-items: center; justify-content: space-between; }
20689
21127
  .ps-bp-photo-help-title { font-size: 0.8vw; font-weight: 700; color: var(--ps-text-primary); }
@@ -21435,6 +21873,20 @@ function UserIcon({ size = 16 }) {
21435
21873
  /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "7", r: "4" })
21436
21874
  ] });
21437
21875
  }
21876
+ function ShoppingBagIcon({ size = 16 }) {
21877
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
21878
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M16 10a4 4 0 0 1-8 0" }),
21879
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M3.103 6.034h17.794" }),
21880
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z" })
21881
+ ] });
21882
+ }
21883
+ function ExternalLinkIcon({ size = 16 }) {
21884
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
21885
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M14 3h7v7" }),
21886
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M10 14 21 3" }),
21887
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5" })
21888
+ ] });
21889
+ }
21438
21890
  function ClockIcon({ size = 16 }) {
21439
21891
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
21440
21892
  /* @__PURE__ */ jsxRuntimeExports.jsx("circle", { cx: "12", cy: "12", r: "10" }),
@@ -22461,6 +22913,7 @@ function MultiSectionMobile({
22461
22913
  tryOnDone,
22462
22914
  onTryAgain,
22463
22915
  onClose,
22916
+ resultActionNode,
22464
22917
  overlayNode,
22465
22918
  showLines,
22466
22919
  onToggleLines,
@@ -22536,7 +22989,7 @@ function MultiSectionMobile({
22536
22989
  }) }),
22537
22990
  profileCompletionCta
22538
22991
  ] }),
22539
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msr-bottom", children: tryOnDone ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msr-bottom-row", children: [
22992
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msr-bottom", children: resultActionNode ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-msr-bottom-row ps-msr-commerce-row", children: resultActionNode }) : tryOnDone ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-msr-bottom-row", children: [
22540
22993
  /* @__PURE__ */ jsxRuntimeExports.jsx(
22541
22994
  "button",
22542
22995
  {
@@ -22640,7 +23093,7 @@ function ProfileCompletionCta({
22640
23093
  border: "1px solid rgba(33, 84, 239, 0.16)",
22641
23094
  background: "linear-gradient(135deg, #FFFFFF 0%, rgba(33,84,239,0.055) 100%)",
22642
23095
  borderRadius: isMobile ? 12 : "0.7vw",
22643
- padding: isMobile ? "13px 14px" : isHeader ? "0.7vw 0.9vw" : "0.58vw 0.75vw",
23096
+ padding: isMobile ? "13px 14px" : isHeader ? "clamp(8px, 0.55vw, 10px) clamp(10px, 0.7vw, 14px)" : "0.5vw 0.7vw",
22644
23097
  marginTop: isMobile ? 12 : isHeader ? 0 : "0.48vw",
22645
23098
  cursor: "pointer",
22646
23099
  fontFamily: "inherit",
@@ -22649,18 +23102,18 @@ function ProfileCompletionCta({
22649
23102
  flexDirection: isMobile ? "column" : "row",
22650
23103
  alignItems: isMobile ? "stretch" : "center",
22651
23104
  justifyContent: "space-between",
22652
- gap: isMobile ? 10 : isHeader ? "0.85vw" : "0.8vw",
23105
+ gap: isMobile ? 10 : isHeader ? "0.62vw" : "0.7vw",
22653
23106
  boxShadow: "0 12px 28px -22px rgba(33,84,239,0.52)"
22654
23107
  },
22655
23108
  children: [
22656
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: { display: "flex", alignItems: "center", gap: isMobile ? 10 : isHeader ? "0.65vw" : "0.6vw", minWidth: 0, width: isMobile || isHeader ? "100%" : "auto" }, children: [
23109
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: { display: "flex", alignItems: "center", gap: isMobile ? 10 : isHeader ? "0.5vw" : "0.6vw", minWidth: 0, width: isMobile || isHeader ? "100%" : "auto" }, children: [
22657
23110
  /* @__PURE__ */ jsxRuntimeExports.jsx(
22658
23111
  "span",
22659
23112
  {
22660
23113
  "aria-hidden": "true",
22661
23114
  style: {
22662
- width: isMobile ? 32 : isHeader ? "1.9vw" : "1.65vw",
22663
- height: isMobile ? 32 : isHeader ? "1.9vw" : "1.65vw",
23115
+ width: isMobile ? 32 : isHeader ? "clamp(26px, 1.65vw, 30px)" : "1.55vw",
23116
+ height: isMobile ? 32 : isHeader ? "clamp(26px, 1.65vw, 30px)" : "1.55vw",
22664
23117
  borderRadius: "50%",
22665
23118
  background: "var(--ps-accent)",
22666
23119
  color: "#fff",
@@ -22669,12 +23122,12 @@ function ProfileCompletionCta({
22669
23122
  justifyContent: "center",
22670
23123
  flexShrink: 0
22671
23124
  },
22672
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(SparkleIcon, { size: isMobile ? 16 : isHeader ? 16 : 14 })
23125
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(UserIcon, { size: isMobile ? 16 : isHeader ? 16 : 14 })
22673
23126
  }
22674
23127
  ),
22675
23128
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: { minWidth: 0 }, children: [
22676
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block", color: "var(--ps-text-primary)", fontSize: isMobile ? 14 : isHeader ? "0.78vw" : "0.68vw", fontWeight: 800, lineHeight: 1.2 }, children: title }),
22677
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block", color: "var(--ps-text-secondary)", fontSize: isMobile ? 12 : isHeader ? "0.58vw" : "0.56vw", lineHeight: 1.32, marginTop: isMobile ? 3 : "0.12vw" }, children: body })
23129
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block", color: "var(--ps-text-primary)", fontSize: isMobile ? 14 : isHeader ? "clamp(12px, 0.72vw, 14px)" : "0.68vw", fontWeight: 800, lineHeight: 1.15 }, children: title }),
23130
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { display: "block", color: "var(--ps-text-secondary)", fontSize: isMobile ? 12 : isHeader ? "clamp(10px, 0.52vw, 11px)" : "0.56vw", lineHeight: 1.22, marginTop: isMobile ? 3 : "0.1vw" }, children: body })
22678
23131
  ] })
22679
23132
  ] }),
22680
23133
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -22686,7 +23139,7 @@ function ProfileCompletionCta({
22686
23139
  border: isMobile ? "1px solid rgba(33,84,239,0.14)" : 0,
22687
23140
  borderRadius: isMobile ? 999 : 0,
22688
23141
  padding: isMobile ? "7px 10px" : 0,
22689
- fontSize: isMobile ? 12 : isHeader ? "0.64vw" : "0.62vw",
23142
+ fontSize: isMobile ? 12 : isHeader ? "clamp(10px, 0.56vw, 11px)" : "0.62vw",
22690
23143
  fontWeight: 800,
22691
23144
  whiteSpace: "nowrap",
22692
23145
  flexShrink: 0,
@@ -23385,6 +23838,7 @@ function SectionDetailView({
23385
23838
  internationalSizes,
23386
23839
  continueLabel,
23387
23840
  onContinue,
23841
+ resultActionNode,
23388
23842
  renderRaw = false,
23389
23843
  sectionFound,
23390
23844
  allSizes,
@@ -23795,7 +24249,7 @@ function SectionDetailView({
23795
24249
  if (isFootwear && fit === "good") return t2("BEST MATCH");
23796
24250
  if (isLen && fit === "good") return t2("EDITORIAL LENGTH");
23797
24251
  if (renderRaw && fit === "good") return t2("WITHIN RANGE");
23798
- if (fit === "good") return t2("PERFECT TENSION");
24252
+ if (fit === "good") return t2("WITHIN RANGE");
23799
24253
  if (fit === "a-bit-tight") return t2("SLIGHTLY TIGHT");
23800
24254
  if (fit === "a-bit-loose") return t2("SLIGHT EASE");
23801
24255
  if (fit.includes("tight")) return t2("TIGHT");
@@ -24037,7 +24491,7 @@ function SectionDetailView({
24037
24491
  tryOnProcessing ? `${t2("Generating try-on…")}${tryOnElapsedS > 0 ? ` ${tryOnElapsedS}s` : ""}` : t2("Try It On")
24038
24492
  ]
24039
24493
  }
24040
- ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
24494
+ ) : resultActionNode ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-action-group ps-msd-result-action-group", children: resultActionNode }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
24041
24495
  "button",
24042
24496
  {
24043
24497
  type: "button",
@@ -24262,7 +24716,7 @@ function SectionDetailView({
24262
24716
  tryOnProcessing ? `${t2("Generating try-on…")}${tryOnElapsedS > 0 ? ` ${tryOnElapsedS}s` : ""}` : t2("Try It On")
24263
24717
  ]
24264
24718
  }
24265
- ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
24719
+ ) : resultActionNode ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-action-group", children: resultActionNode }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
24266
24720
  "button",
24267
24721
  {
24268
24722
  onClick: continueLabel ? onContinue || onBack : onBack,
@@ -24308,6 +24762,12 @@ function SizeResultView({
24308
24762
  setView,
24309
24763
  handleDownload,
24310
24764
  onContinueShopping,
24765
+ isHistoryResult = false,
24766
+ onBackToProductPage,
24767
+ onAddToBag,
24768
+ addToBagLabel,
24769
+ continueShoppingLabel,
24770
+ backToProductPageLabel,
24311
24771
  onTryOnFeedbackSubmit,
24312
24772
  selectedFile,
24313
24773
  previewUrl,
@@ -24339,6 +24799,101 @@ function SizeResultView({
24339
24799
  const shoeUserGender = normalizeShoeGender(sizingResult?.userGender || sizingResult?.detectedGender) || void 0;
24340
24800
  const [editVals, setEditVals] = reactExports.useState({});
24341
24801
  const pRange = pRangeFn;
24802
+ const resolvedContinueShoppingLabel = continueShoppingLabel?.trim() || t2("Continue Shopping");
24803
+ const resolvedAddToBagLabel = addToBagLabel?.trim() || t2("Add to Bag");
24804
+ const resolvedBackToProductPageLabel = backToProductPageLabel?.trim() || t2("Back to product");
24805
+ const handleContinueAction = onContinueShopping || onClose;
24806
+ const handleBackToProductPageAction = onBackToProductPage || handleContinueAction;
24807
+ const canAddToBag = !!onAddToBag && !isHistoryResult && !!sizingResult && sizingResult.found !== false;
24808
+ const [addToBagState, setAddToBagState] = reactExports.useState("idle");
24809
+ reactExports.useEffect(() => {
24810
+ if (addToBagState !== "added") return;
24811
+ const timer = window.setTimeout(() => setAddToBagState("idle"), 1500);
24812
+ return () => window.clearTimeout(timer);
24813
+ }, [addToBagState]);
24814
+ const handleAddToBagClick = reactExports.useCallback(async () => {
24815
+ if (!onAddToBag || addToBagState !== "idle") return;
24816
+ setAddToBagState("adding");
24817
+ try {
24818
+ await onAddToBag();
24819
+ setAddToBagState("added");
24820
+ } catch {
24821
+ setAddToBagState("idle");
24822
+ }
24823
+ }, [addToBagState, onAddToBag]);
24824
+ const renderShoppingCta = reactExports.useCallback((options) => {
24825
+ if (isHistoryResult && handleBackToProductPageAction) {
24826
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-action-group ps-tryon-v2-action-group-history", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
24827
+ "button",
24828
+ {
24829
+ className: "ps-tryon-v2-cta ps-tryon-v2-cta-secondary ps-tryon-v2-cta-compact ps-tryon-v2-history-product-cta",
24830
+ style: { marginTop: 0 },
24831
+ onClick: handleBackToProductPageAction,
24832
+ type: "button",
24833
+ children: [
24834
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ExternalLinkIcon, { size: 13 }),
24835
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: resolvedBackToProductPageLabel })
24836
+ ]
24837
+ }
24838
+ ) });
24839
+ }
24840
+ const allowAddToBag = options?.allowAddToBag !== false;
24841
+ if (allowAddToBag && canAddToBag) {
24842
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-action-group", children: [
24843
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
24844
+ "button",
24845
+ {
24846
+ className: "ps-tryon-v2-cta ps-tryon-v2-cta-secondary",
24847
+ style: { marginTop: 0 },
24848
+ onClick: handleContinueAction,
24849
+ type: "button",
24850
+ children: [
24851
+ resolvedContinueShoppingLabel,
24852
+ " →"
24853
+ ]
24854
+ }
24855
+ ),
24856
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
24857
+ "button",
24858
+ {
24859
+ className: `ps-tryon-v2-cta ps-tryon-v2-add-bag-cta${addToBagState === "added" ? " is-added" : ""}`,
24860
+ style: { marginTop: 0 },
24861
+ onClick: handleAddToBagClick,
24862
+ type: "button",
24863
+ disabled: addToBagState !== "idle",
24864
+ children: [
24865
+ addToBagState === "added" ? /* @__PURE__ */ jsxRuntimeExports.jsx(CheckIcon$1, { size: 16 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ShoppingBagIcon, { size: 17 }),
24866
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: addToBagState === "added" ? t2("Added to bag") : addToBagState === "adding" ? t2("Adding...") : resolvedAddToBagLabel })
24867
+ ]
24868
+ }
24869
+ )
24870
+ ] });
24871
+ }
24872
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
24873
+ "button",
24874
+ {
24875
+ className: "ps-tryon-v2-cta",
24876
+ style: { marginTop: 0 },
24877
+ onClick: handleContinueAction,
24878
+ type: "button",
24879
+ children: [
24880
+ resolvedContinueShoppingLabel,
24881
+ " →"
24882
+ ]
24883
+ }
24884
+ );
24885
+ }, [
24886
+ canAddToBag,
24887
+ addToBagState,
24888
+ handleBackToProductPageAction,
24889
+ handleAddToBagClick,
24890
+ handleContinueAction,
24891
+ isHistoryResult,
24892
+ resolvedAddToBagLabel,
24893
+ resolvedBackToProductPageLabel,
24894
+ resolvedContinueShoppingLabel,
24895
+ t2
24896
+ ]);
24342
24897
  const cellVal = reactExports.useCallback((row, colIdx, header) => {
24343
24898
  return cellValFn(row, colIdx, header);
24344
24899
  }, []);
@@ -24827,7 +25382,8 @@ function SizeResultView({
24827
25382
  return lengthEntries.find((le2) => le2.section.headers.some((h) => /height|altezza|estatura|\(cm\)/i.test(h))) || null;
24828
25383
  })(),
24829
25384
  onBack: () => setActiveSection(null),
24830
- onContinue: onContinueShopping || onClose,
25385
+ onContinue: handleContinueAction,
25386
+ resultActionNode: canAddToBag || isHistoryResult || !!resultImageUrl || vtoExcluded ? renderShoppingCta() : void 0,
24831
25387
  internationalSizes: entry.secResult?.internationalSizes,
24832
25388
  productImage: tryOnProcessing && previewUrl ? previewUrl : resultImageUrl || productImage,
24833
25389
  productTitle,
@@ -24927,7 +25483,8 @@ function SizeResultView({
24927
25483
  return lengthEntries.find((le2) => le2.section.headers.some((h) => /height|altezza|estatura|\(cm\)/i.test(h))) || null;
24928
25484
  })(),
24929
25485
  onBack: () => setActiveSection(null),
24930
- onContinue: onContinueShopping || onClose,
25486
+ onContinue: handleContinueAction,
25487
+ resultActionNode: canAddToBag || isHistoryResult || !!resultImageUrl || vtoExcluded ? renderShoppingCta() : void 0,
24931
25488
  internationalSizes: entry.secResult?.internationalSizes,
24932
25489
  tryOnProcessing,
24933
25490
  tryOnStartedAt,
@@ -24970,7 +25527,8 @@ function SizeResultView({
24970
25527
  setGuideFile(selectedFile || null);
24971
25528
  setShowPhotoGuide(true);
24972
25529
  },
24973
- onClose: onContinueShopping || onClose,
25530
+ onClose: handleContinueAction,
25531
+ resultActionNode: canAddToBag || isHistoryResult ? renderShoppingCta() : void 0,
24974
25532
  showLines,
24975
25533
  onToggleLines: suppressFitOverlayActions ? void 0 : () => setShowLines(!showLines),
24976
25534
  onOpenImage: resultImageUrl && !tryOnProcessing ? () => setZoomImageUrl(resultImageUrl) : void 0,
@@ -25114,29 +25672,7 @@ function SizeResultView({
25114
25672
  " ",
25115
25673
  t2("Back")
25116
25674
  ] }),
25117
- resultImageUrl && !tryOnProcessing ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
25118
- "button",
25119
- {
25120
- className: "ps-tryon-v2-cta",
25121
- style: { marginTop: 0 },
25122
- onClick: onContinueShopping || onClose,
25123
- children: [
25124
- t2("Continue Shopping"),
25125
- " →"
25126
- ]
25127
- }
25128
- ) : vtoExcluded ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
25129
- "button",
25130
- {
25131
- className: "ps-tryon-v2-cta",
25132
- style: { marginTop: 0 },
25133
- onClick: onContinueShopping || onClose,
25134
- children: [
25135
- t2("Continue Shopping"),
25136
- " →"
25137
- ]
25138
- }
25139
- ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
25675
+ canAddToBag || isHistoryResult || resultImageUrl && !tryOnProcessing || vtoExcluded ? renderShoppingCta() : /* @__PURE__ */ jsxRuntimeExports.jsxs(
25140
25676
  "button",
25141
25677
  {
25142
25678
  className: "ps-tryon-v2-cta",
@@ -25200,11 +25736,12 @@ function SizeResultView({
25200
25736
  if (resultImageUrl) onResetTryOn?.();
25201
25737
  setView("body-profile");
25202
25738
  },
25203
- onContinue: onContinueShopping || onClose,
25739
+ onContinue: handleContinueAction,
25204
25740
  backLabel: t2("Back"),
25205
25741
  internationalSizes: singleInternationalSizes,
25206
- onTryOn: resultImageUrl || vtoExcluded ? void 0 : handleSingleTryOn,
25207
- continueLabel: resultImageUrl ? t2("Done") : void 0,
25742
+ onTryOn: canAddToBag || isHistoryResult || resultImageUrl || vtoExcluded ? void 0 : handleSingleTryOn,
25743
+ resultActionNode: canAddToBag || isHistoryResult || !!resultImageUrl || vtoExcluded ? renderShoppingCta() : void 0,
25744
+ continueLabel: resultImageUrl ? resolvedContinueShoppingLabel : void 0,
25208
25745
  tryOnProcessing,
25209
25746
  tryOnStartedAt,
25210
25747
  productImage: resultImageUrl || productImage,
@@ -25294,18 +25831,14 @@ function SizeResultView({
25294
25831
  chartUnit: resultUnit,
25295
25832
  lengthEntry: null,
25296
25833
  onBack: () => {
25297
- if (resultImageUrl) {
25298
- onResetTryOn?.();
25299
- setView("body-profile");
25300
- } else {
25301
- setActiveSection(null);
25302
- }
25834
+ setActiveSection(null);
25303
25835
  },
25304
- onContinue: onContinueShopping || onClose,
25836
+ onContinue: handleContinueAction,
25305
25837
  backLabel: t2("Back"),
25306
25838
  internationalSizes: singleInternationalSizes,
25307
- onTryOn: resultImageUrl || vtoExcluded ? void 0 : handleSingleTryOn,
25308
- continueLabel: resultImageUrl ? t2("Continue Shopping") : void 0,
25839
+ onTryOn: canAddToBag || isHistoryResult || resultImageUrl || vtoExcluded ? void 0 : handleSingleTryOn,
25840
+ resultActionNode: canAddToBag || isHistoryResult || !!resultImageUrl || vtoExcluded ? renderShoppingCta() : void 0,
25841
+ continueLabel: resultImageUrl ? resolvedContinueShoppingLabel : void 0,
25309
25842
  tryOnProcessing,
25310
25843
  tryOnStartedAt,
25311
25844
  onFeedbackSubmit: onTryOnFeedbackSubmit,
@@ -25321,40 +25854,44 @@ function SizeResultView({
25321
25854
  ) : (
25322
25855
  /* CARD VIEW — clickable summary card + gallery strip */
25323
25856
  /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
25324
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-result-head", children: profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-profile-head ps-expanded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileCompletionCta, { onClick: profileCompletionCta.onClick, placement: "header", t: t2 }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-result-copy", children: [
25325
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "ps-tryon-v2-title", children: guideOnlyResult ? t2("Product Size Guide") : t2("Your Size Recommendation") }),
25326
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-tryon-v2-subtitle", children: guideOnlyResult ? t2("Tap the card to view product measurements") : t2("Tap the card for detailed breakdown") })
25327
- ] }) }),
25328
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-sep" }),
25329
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-sr-cards-v2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
25330
- "button",
25331
- {
25332
- className: `ps-tryon-sr-card-v2 ps-full${pendingCustomSizes[sectionName] ? " ps-overridden" : ""}`,
25333
- onClick: () => setActiveSection(sectionName),
25334
- type: "button",
25335
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-sr-card-v2-text", children: [
25336
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-sr-card-v2-label", children: sectionName }),
25337
- (() => {
25338
- const rawLabelText = pendingCustomSizes[sectionName]?.displayLabel || singleResult.recommendedSize || singleResult.sizeLabel || (guideOnlyResult ? t2("One Size") : "—");
25339
- const labelText = measurementType === "foot" ? formatShoeSizeLabel(rawLabelText, shoeUserGender) : rawLabelText;
25340
- const isLong = labelText.length > 12;
25341
- return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `ps-tryon-sr-card-v2-value${isLong ? " ps-long" : ""}`, children: labelText });
25342
- })(),
25343
- /* @__PURE__ */ jsxRuntimeExports.jsx(
25344
- "span",
25345
- {
25346
- className: `ps-tryon-sr-card-v2-rec-pill${pendingCustomSizes[sectionName] ? " is-overridden" : ""}`,
25347
- children: guideOnlyResult ? t2("SIZE GUIDE") : pendingCustomSizes[sectionName] ? t2("YOUR SELECTION") : t2("RECOMMENDED")
25348
- }
25349
- ),
25350
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-tryon-sr-card-v2-view", children: [
25351
- t2("VIEW DETAILS"),
25352
- " ",
25353
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true", children: "›" })
25354
- ] })
25355
- ] })
25356
- }
25357
- ) }),
25857
+ (() => {
25858
+ const cardTitle = guideOnlyResult ? t2("Size Guide") : t2("Your Fit");
25859
+ const rawLabelText = pendingCustomSizes[sectionName]?.displayLabel || singleResult.recommendedSize || singleResult.sizeLabel || (guideOnlyResult ? t2("One Size") : "");
25860
+ const labelText = measurementType === "foot" ? formatShoeSizeLabel(rawLabelText, shoeUserGender) : rawLabelText;
25861
+ const isLong = labelText.length > 12;
25862
+ const badgeText = guideOnlyResult ? t2("SIZE GUIDE") : pendingCustomSizes[sectionName] ? t2("YOUR SELECTION") : t2("RECOMMENDED");
25863
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
25864
+ profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-result-head", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-profile-head ps-expanded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProfileCompletionCta, { onClick: profileCompletionCta.onClick, placement: "header", t: t2 }) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-result-copy ps-single-result-copy", children: [
25865
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "ps-tryon-v2-title", children: t2("Your Size Recommendation") }),
25866
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "ps-tryon-v2-subtitle", children: t2("Tap the card for detailed breakdown") })
25867
+ ] }),
25868
+ profileCompletionCta ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-v2-sep" }) : null,
25869
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-sr-cards-v2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
25870
+ "button",
25871
+ {
25872
+ className: `ps-tryon-sr-card-v2 ps-summary-card ps-full${pendingCustomSizes[sectionName] ? " ps-overridden" : ""}`,
25873
+ onClick: () => setActiveSection(sectionName),
25874
+ type: "button",
25875
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-sr-card-v2-text ps-summary-card-layout", children: [
25876
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-tryon-sr-card-v2-summary-title", children: cardTitle }),
25877
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `ps-tryon-sr-card-v2-value${isLong ? " ps-long" : ""}`, children: labelText }),
25878
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
25879
+ "span",
25880
+ {
25881
+ className: `ps-tryon-sr-card-v2-rec-pill${pendingCustomSizes[sectionName] ? " is-overridden" : ""}`,
25882
+ children: badgeText
25883
+ }
25884
+ ),
25885
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ps-tryon-sr-card-v2-view", children: [
25886
+ guideOnlyResult ? t2("VIEW CHART") : t2("VIEW DETAILS"),
25887
+ " ",
25888
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true", children: "›" })
25889
+ ] })
25890
+ ] })
25891
+ }
25892
+ ) })
25893
+ ] });
25894
+ })(),
25358
25895
  hasCarousel && /* @__PURE__ */ jsxRuntimeExports.jsx(ProductPhotoCarouselCard, { items: carouselItems.length > 0 ? carouselItems : void 0, photos: productImages, productTitle, t: t2 }),
25359
25896
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-tryon-v2-result-actions", children: [
25360
25897
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -25373,13 +25910,7 @@ function SizeResultView({
25373
25910
  ]
25374
25911
  }
25375
25912
  ),
25376
- resultImageUrl && !tryOnProcessing ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, onClick: onContinueShopping || onClose, children: [
25377
- t2("Continue Shopping"),
25378
- " →"
25379
- ] }) : vtoExcluded ? /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { className: "ps-tryon-v2-cta", style: { marginTop: 0 }, onClick: onContinueShopping || onClose, children: [
25380
- t2("Continue Shopping"),
25381
- " →"
25382
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
25913
+ canAddToBag || isHistoryResult || resultImageUrl && !tryOnProcessing || vtoExcluded ? renderShoppingCta() : /* @__PURE__ */ jsxRuntimeExports.jsxs(
25383
25914
  "button",
25384
25915
  {
25385
25916
  className: "ps-tryon-v2-cta",
@@ -26491,6 +27022,7 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26491
27022
  const seededHeight = draftHeightParts(initialDraft, seededUnit);
26492
27023
  const seededGender = initialDraft?.gender === "female" ? "female" : "male";
26493
27024
  const seededPhotoRef = reactExports.useRef(initialDraft?.photoBase64 || initialDraft?.photoUrl || null);
27025
+ const seededMeasurements = initialDraft?.measurements && Object.keys(initialDraft.measurements).length > 0 ? initialDraft.measurements : null;
26494
27026
  const [mode, setMode] = reactExports.useState(initialMode ?? null);
26495
27027
  const [manualStep, setManualStep] = reactExports.useState("identity");
26496
27028
  const [imageStep, setImageStep] = reactExports.useState("name-photo");
@@ -26710,6 +27242,7 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26710
27242
  bandSize: isWomen ? bandSize || void 0 : void 0,
26711
27243
  cupSize: isWomen ? cupSize || void 0 : void 0,
26712
27244
  ...isWomen && bandSize && cupSize ? { braSizeRegion } : {},
27245
+ ...initialDraft?.measurements ? { measurements: initialDraft.measurements, measurementsUnit: initialDraft.measurementsUnit || "cm" } : {},
26713
27246
  ...initialDraft?.customMeasurements ? { customMeasurements: initialDraft.customMeasurements } : {}
26714
27247
  };
26715
27248
  };
@@ -26729,6 +27262,7 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26729
27262
  ...isWomen && bandSize ? { bandSize } : {},
26730
27263
  ...isWomen && cupSize ? { cupSize } : {},
26731
27264
  ...isWomen && bandSize && cupSize ? { braSizeRegion } : {},
27265
+ ...initialDraft?.measurements ? { measurements: initialDraft.measurements, measurementsUnit: initialDraft.measurementsUnit || "cm" } : {},
26732
27266
  ...initialDraft?.customMeasurements ? { customMeasurements: initialDraft.customMeasurements } : {},
26733
27267
  photoBase64: photoBase64 || void 0
26734
27268
  };
@@ -26801,13 +27335,14 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26801
27335
  setError(t2("Please upload a photo"));
26802
27336
  return;
26803
27337
  }
26804
- if (unit === "in") {
27338
+ const canUseSeededMeasurements = directAnalysisFlow && !!seededMeasurements;
27339
+ if (!canUseSeededMeasurements && unit === "in") {
26805
27340
  const ft = parseFloat(heightFt);
26806
27341
  if (!ft || ft < 3 || ft > 8) {
26807
27342
  setError(t2("Please enter a valid height"));
26808
27343
  return;
26809
27344
  }
26810
- } else {
27345
+ } else if (!canUseSeededMeasurements) {
26811
27346
  const cm = parseFloat(heightVal);
26812
27347
  if (!cm || cm < 100 || cm > 250) {
26813
27348
  setError(t2("Please enter a valid height"));
@@ -26815,7 +27350,7 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26815
27350
  }
26816
27351
  }
26817
27352
  const w2 = parseFloat(weightVal);
26818
- if (!w2 || w2 <= 0) {
27353
+ if (!canUseSeededMeasurements && (!w2 || w2 <= 0)) {
26819
27354
  setError(t2("Please enter a valid weight"));
26820
27355
  return;
26821
27356
  }
@@ -26829,8 +27364,8 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26829
27364
  setEstimating(true);
26830
27365
  const MIN_HOLD_MS = 6e3;
26831
27366
  const minHold = new Promise((r2) => setTimeout(r2, MIN_HOLD_MS));
26832
- let liveEstimates = null;
26833
- if (onEstimate && photoBase64) {
27367
+ let liveEstimates = seededMeasurements;
27368
+ if (!canUseSeededMeasurements && onEstimate && photoBase64) {
26834
27369
  const heightRaw = unit === "in" ? (parseInt(heightFt, 10) || 0) * 12 + (parseInt(heightInch, 10) || 0) : parseFloat(heightVal);
26835
27370
  try {
26836
27371
  const result = await onEstimate({
@@ -26875,7 +27410,8 @@ function CreateProfileWizard({ onSave, onCancel, initialMode, initialDraft, dire
26875
27410
  if (mode !== "image" || imageStep !== "name-photo") return;
26876
27411
  const hasHeight = unit === "in" ? parseFloat(heightFt) > 0 || parseFloat(heightInch) > 0 : parseFloat(heightVal) > 0;
26877
27412
  const hasWeight = parseFloat(weightVal) > 0;
26878
- if (!photoBase64 || !name.trim() || !hasHeight || !hasWeight) return;
27413
+ const canUseSeededMeasurements = directAnalysisFlow && !!seededMeasurements;
27414
+ if (!photoBase64 || !name.trim() || !canUseSeededMeasurements && (!hasHeight || !hasWeight)) return;
26879
27415
  directAutoStartedRef.current = true;
26880
27416
  void advanceImage();
26881
27417
  }, [directAnalysisFlow, mode, imageStep, photoBase64, name, heightFt, heightInch, heightVal, weightVal, unit]);
@@ -28463,12 +28999,10 @@ function MySizingProfilesView({
28463
28999
  const googleIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%3e%3cpath%20fill='%23FFC107'%20d='M43.6%2020.5H42V20H24v8h11.3C33.7%2032.7%2029.3%2036%2024%2036c-6.6%200-12-5.4-12-12s5.4-12%2012-12c3.1%200%205.9%201.2%208%203.1l5.7-5.7C34.1%206.1%2029.3%204%2024%204%2012.9%204%204%2012.9%204%2024s8.9%2020%2020%2020%2020-8.9%2020-20c0-1.3-.1-2.4-.4-3.5z'/%3e%3cpath%20fill='%23FF3D00'%20d='M6.3%2014.7l6.6%204.8C14.7%2015.1%2019%2012%2024%2012c3.1%200%205.9%201.2%208%203.1l5.7-5.7C34.1%206.1%2029.3%204%2024%204%2016.2%204%209.5%208.5%206.3%2014.7z'/%3e%3cpath%20fill='%234CAF50'%20d='M24%2044c5.2%200%209.9-2%2013.4-5.2l-6.2-5.2C29.2%2035.1%2026.7%2036%2024%2036c-5.2%200-9.6-3.3-11.3-7.8l-6.5%205C9.4%2039.6%2016.1%2044%2024%2044z'/%3e%3cpath%20fill='%231976D2'%20d='M43.6%2020.5H42V20H24v8h11.3c-.8%202.3-2.3%204.2-4.1%205.6l6.2%205.2C36.9%2039.2%2044%2034%2044%2024c0-1.3-.1-2.4-.4-3.5z'/%3e%3c/svg%3e";
28464
29000
  const profileSyncIllustration = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20520%20420'%3e%3cdefs%3e%3clinearGradient%20id='bg'%20x1='0'%20y1='0'%20x2='1'%20y2='1'%3e%3cstop%20offset='0'%20stop-color='%23EFF6FF'/%3e%3cstop%20offset='1'%20stop-color='%23FFFFFF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='blue'%20x1='0'%20y1='0'%20x2='1'%20y2='1'%3e%3cstop%20offset='0'%20stop-color='%2360A5FA'/%3e%3cstop%20offset='1'%20stop-color='%232563EB'/%3e%3c/linearGradient%3e%3cfilter%20id='shadow'%20x='-20%25'%20y='-20%25'%20width='140%25'%20height='140%25'%3e%3cfeDropShadow%20dx='0'%20dy='18'%20stdDeviation='22'%20flood-color='%231E3A8A'%20flood-opacity='0.14'/%3e%3c/filter%3e%3c/defs%3e%3crect%20x='20'%20y='20'%20width='480'%20height='380'%20rx='44'%20fill='url(%23bg)'/%3e%3ccircle%20cx='118'%20cy='92'%20r='36'%20fill='%23DBEAFE'/%3e%3ccircle%20cx='420'%20cy='328'%20r='42'%20fill='%23E0F2FE'/%3e%3cg%20filter='url(%23shadow)'%3e%3crect%20x='170'%20y='70'%20width='180'%20height='280'%20rx='34'%20fill='%23FFFFFF'/%3e%3crect%20x='186'%20y='88'%20width='148'%20height='246'%20rx='25'%20fill='%23F8FAFC'%20stroke='%23DBEAFE'/%3e%3ccircle%20cx='260'%20cy='161'%20r='38'%20fill='url(%23blue)'/%3e%3cpath%20fill='%23DBEAFE'%20d='M235%20246c3-25%2022-43%2025-43s22%2018%2025%2043c-13%2010-37%2010-50%200z'/%3e%3cpath%20fill='%23BFDBFE'%20d='M228%20284h64c8%200%2014%206%2014%2014s-6%2014-14%2014h-64c-8%200-14-6-14-14s6-14%2014-14z'/%3e%3c/g%3e%3cg%20filter='url(%23shadow)'%3e%3crect%20x='62'%20y='172'%20width='130'%20height='94'%20rx='24'%20fill='%23FFFFFF'/%3e%3ccircle%20cx='102'%20cy='212'%20r='20'%20fill='%23EFF6FF'%20stroke='%23BFDBFE'/%3e%3crect%20x='132'%20y='196'%20width='36'%20height='8'%20rx='4'%20fill='%23BFDBFE'/%3e%3crect%20x='132'%20y='214'%20width='48'%20height='8'%20rx='4'%20fill='%23DBEAFE'/%3e%3crect%20x='88'%20y='240'%20width='76'%20height='10'%20rx='5'%20fill='%232563EB'%20opacity='0.88'/%3e%3c/g%3e%3cg%20filter='url(%23shadow)'%3e%3crect%20x='328'%20y='172'%20width='130'%20height='94'%20rx='24'%20fill='%23FFFFFF'/%3e%3ccircle%20cx='368'%20cy='212'%20r='20'%20fill='%23EFF6FF'%20stroke='%23BFDBFE'/%3e%3crect%20x='398'%20y='196'%20width='36'%20height='8'%20rx='4'%20fill='%23BFDBFE'/%3e%3crect%20x='398'%20y='214'%20width='48'%20height='8'%20rx='4'%20fill='%23DBEAFE'/%3e%3crect%20x='354'%20y='240'%20width='76'%20height='10'%20rx='5'%20fill='%232563EB'%20opacity='0.88'/%3e%3c/g%3e%3cpath%20d='M194%20198c20-18%2038-27%2060-29'%20fill='none'%20stroke='%2393C5FD'%20stroke-width='7'%20stroke-linecap='round'%20stroke-dasharray='1%2016'/%3e%3cpath%20d='M326%20198c-20-18-38-27-60-29'%20fill='none'%20stroke='%2393C5FD'%20stroke-width='7'%20stroke-linecap='round'%20stroke-dasharray='1%2016'/%3e%3c/svg%3e";
28465
29001
  const appleIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='%23111111'%20d='M16.37%201.43c0%201.14-.46%202.23-1.19%203.05-.8.91-2.13%201.61-3.2%201.5-.14-1.09.4-2.25%201.12-3.06.8-.9%202.2-1.58%203.27-1.49zM20.2%2017.13c-.56%201.27-.83%201.84-1.55%202.96-1.01%201.56-2.44%203.5-4.21%203.52-1.58.02-1.98-1.03-4.12-1.02-2.14.01-2.59%201.05-4.17%201.03-1.77-.02-3.12-1.77-4.13-3.33-2.82-4.36-3.12-9.47-1.38-12.19%201.23-1.94%203.18-3.08%205.01-3.08%201.86%200%203.03%201.03%204.57%201.03%201.49%200%202.39-1.03%204.54-1.03%201.62%200%203.34.88%204.56%202.41-4%202.19-3.35%207.9.88%209.7z'/%3e%3c/svg%3e";
28466
- const facebookIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3ccircle%20cx='12'%20cy='12'%20r='11'%20fill='%231877F2'/%3e%3cpath%20fill='%23fff'%20d='M14.9%2015.2l.5-3.2h-3v-2c0-.9.4-1.7%201.8-1.7h1.4V5.6s-1.2-.2-2.4-.2c-2.5%200-4.1%201.5-4.1%204.2V12H6.4v3.2h2.7V23c.5.1%201.1.1%201.7.1s1.1%200%201.7-.1v-7.8h2.4z'/%3e%3c/svg%3e";
28467
29002
  const linkedinIcon = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3e%3crect%20width='22'%20height='22'%20x='1'%20y='1'%20rx='4'%20fill='%230A66C2'/%3e%3cpath%20fill='%23fff'%20d='M7.3%209.8h-3v9h3v-9zM5.8%208.6c1%200%201.7-.7%201.7-1.6S6.8%205.4%205.8%205.4%204.1%206.1%204.1%207s.7%201.6%201.7%201.6zm4.1%201.2v9h3v-5c0-.3%200-.5.1-.7.2-.5.7-1.1%201.5-1.1%201.1%200%201.5.8%201.5%202v4.8h3v-5.2c0-2.8-1.5-4.1-3.5-4.1-1.6%200-2.3.9-2.7%201.5v-1.2h-2.9z'/%3e%3c/svg%3e";
28468
29003
  const PROVIDERS = [
28469
29004
  { id: "google", label: "Continue with Google", shortLabel: "Google", icon: googleIcon },
28470
29005
  { id: "apple", label: "Continue with Apple", shortLabel: "Apple", icon: appleIcon },
28471
- { id: "facebook", label: "Continue with Facebook", shortLabel: "Facebook", icon: facebookIcon },
28472
29006
  { id: "linkedin", label: "Continue with LinkedIn", shortLabel: "LinkedIn", icon: linkedinIcon }
28473
29007
  ];
28474
29008
  function SocialProfileAuthView({ loadingProvider, error, onLogin, t: t2 }) {
@@ -28844,6 +29378,7 @@ function PhotoStepMobile({
28844
29378
  photoStatus,
28845
29379
  photoRejection,
28846
29380
  onClearRejection,
29381
+ photoHelpSlot,
28847
29382
  bodyContextSlot,
28848
29383
  hideTabs = false,
28849
29384
  t: t2
@@ -28868,6 +29403,7 @@ function PhotoStepMobile({
28868
29403
  }
28869
29404
  ),
28870
29405
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-pm-preview${compactAgeGate ? " ps-pm-preview-tall" : ""}`, children: [
29406
+ !hasPhoto && photoHelpSlot,
28871
29407
  hasPhoto ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
28872
29408
  /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: photoPreview, alt: t2("Your photo"), className: "ps-pm-preview-img" }),
28873
29409
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -29424,6 +29960,7 @@ function BodyProfileView({
29424
29960
  basicOnly = false,
29425
29961
  initialStep,
29426
29962
  simplePhotoOnly = false,
29963
+ simpleAccessoryLayout = false,
29427
29964
  simpleQuestionMode = "heightWeight",
29428
29965
  formRef,
29429
29966
  sizingCountry,
@@ -29568,6 +30105,47 @@ function BodyProfileView({
29568
30105
  const shoeSizeOptions = getShoeSizeOptions(shoeSizeSystem);
29569
30106
  const shoeReference = isShoeReferenceMode ? estimateShoeReference({ brandId: shoeBrandId, size: shoeSizeValue, sizeSystem: shoeSizeSystem, productTitle, gender: shoeGender }) : null;
29570
30107
  const selectedShoeBrand = SHOE_BRANDS.find((brand) => brand.id === shoeBrandId);
30108
+ const seededBasicsProfileIdRef = reactExports.useRef(null);
30109
+ reactExports.useEffect(() => {
30110
+ const profileId = activeProfile?.id ?? null;
30111
+ if (!profileId || seededBasicsProfileIdRef.current === profileId) return;
30112
+ seededBasicsProfileIdRef.current = profileId;
30113
+ const nextProfileHeight = activeProfile?.height ?? activeProfile?.heightCm;
30114
+ const nextProfileWeight = activeProfile?.weight ?? activeProfile?.weightKg;
30115
+ const nextProfileAge = activeProfile?.age;
30116
+ const nextProfileHeightUnit = activeProfile?.heightUnit === "ft" ? "in" : activeProfile?.heightUnit || (activeProfile?.heightCm ? "cm" : void 0);
30117
+ const nextProfileWeightUnit = activeProfile?.weightUnit || (activeProfile?.weightKg ? "kg" : void 0);
30118
+ if (nextProfileHeight != null && Number(nextProfileHeight) > 0) {
30119
+ if (nextProfileHeightUnit === "cm") {
30120
+ const cm = Math.round(Number(nextProfileHeight));
30121
+ const totalIn = Math.round(cm / 2.54);
30122
+ setHeight(String(cm));
30123
+ setHeightFeet(String(Math.floor(totalIn / 12)));
30124
+ setHeightInches(String(totalIn % 12));
30125
+ setPhotoStepHeight(String(cm));
30126
+ setHUnit("cm");
30127
+ setHeightUnit("cm");
30128
+ } else {
30129
+ const totalIn = Math.round(Number(nextProfileHeight));
30130
+ setHeightFeet(String(Math.floor(totalIn / 12)));
30131
+ setHeightInches(String(totalIn % 12));
30132
+ setHeight(String(Math.round(totalIn * 2.54)));
30133
+ setPhotoStepHeight(String(Math.round(totalIn * 2.54)));
30134
+ setHUnit("in");
30135
+ setHeightUnit("in");
30136
+ }
30137
+ }
30138
+ if (nextProfileWeight != null && Number(nextProfileWeight) > 0) {
30139
+ setWeight(String(Math.round(Number(nextProfileWeight))));
30140
+ if (nextProfileWeightUnit) {
30141
+ setWUnit(nextProfileWeightUnit);
30142
+ setWeightUnit(nextProfileWeightUnit);
30143
+ }
30144
+ }
30145
+ if (nextProfileAge != null && Number(nextProfileAge) > 0) {
30146
+ setAge(String(Math.round(Number(nextProfileAge))));
30147
+ }
30148
+ }, [activeProfile, setHeightUnit, setWeightUnit]);
29571
30149
  const [error, setError] = reactExports.useState("");
29572
30150
  const handlePhotoSelect = reactExports.useCallback(async (e) => {
29573
30151
  const file = e.target.files?.[0];
@@ -29588,6 +30166,7 @@ function BodyProfileView({
29588
30166
  setPhotoProcessing(true);
29589
30167
  setPhotoStatus(t2("Analyzing photo…"));
29590
30168
  setPhotoFile(file);
30169
+ setPhotoHelpOpen(false);
29591
30170
  const previewUrl = URL.createObjectURL(file);
29592
30171
  setPhotoPreview(previewUrl);
29593
30172
  try {
@@ -30214,6 +30793,7 @@ function BodyProfileView({
30214
30793
  }
30215
30794
  const analyzeDisabled = analyzeMissing.length > 0;
30216
30795
  const analyzeLabel = analyzeDisabled ? analyzeMissing[0] ?? t2("Analyze My Size") : t2("Analyze My Size");
30796
+ const compactHeightWeightAccessory = simplePhotoOnly && simpleAccessoryLayout && !isShoeReferenceMode;
30217
30797
  if (isMobile) {
30218
30798
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-wrapper", children: [
30219
30799
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-scan-progress", children: [
@@ -30231,19 +30811,6 @@ function BodyProfileView({
30231
30811
  ] }),
30232
30812
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-scan-progress-spacer", "aria-hidden": "true" })
30233
30813
  ] }),
30234
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-scan-help-row", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
30235
- "button",
30236
- {
30237
- type: "button",
30238
- onClick: () => setPhotoHelpOpen((v2) => !v2),
30239
- "aria-label": t2("How to take a good photo"),
30240
- className: `ps-pm-help-pill ps-bp-scan-help-pill${photoHelpOpen ? " ps-active" : ""}`,
30241
- children: [
30242
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-pm-help-pill-q", "aria-hidden": "true", children: "?" }),
30243
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("How to take a good photo") })
30244
- ]
30245
- }
30246
- ) }),
30247
30814
  /* @__PURE__ */ jsxRuntimeExports.jsx(
30248
30815
  PhotoStepMobile,
30249
30816
  {
@@ -30268,11 +30835,27 @@ function BodyProfileView({
30268
30835
  photoStatus,
30269
30836
  photoRejection,
30270
30837
  onClearRejection: () => setPhotoRejection(null),
30838
+ photoHelpSlot: /* @__PURE__ */ jsxRuntimeExports.jsxs(
30839
+ "button",
30840
+ {
30841
+ type: "button",
30842
+ onClick: (e) => {
30843
+ e.stopPropagation();
30844
+ setPhotoHelpOpen((v2) => !v2);
30845
+ },
30846
+ "aria-label": t2("How to take a good photo"),
30847
+ className: `ps-bp-photo-help-chip${photoHelpOpen ? " ps-active" : ""}`,
30848
+ children: [
30849
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-help-chip-mark", "aria-hidden": "true", children: "?" }),
30850
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("How to take a good photo") })
30851
+ ]
30852
+ }
30853
+ ),
30271
30854
  hideTabs: simplePhotoOnly,
30272
30855
  t: t2
30273
30856
  }
30274
30857
  ),
30275
- photoHelpOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
30858
+ !photoPreview && photoHelpOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
30276
30859
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-photo-help-backdrop", onClick: () => setPhotoHelpOpen(false), "aria-hidden": "true" }),
30277
30860
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { role: "dialog", "aria-label": t2("How to take the best photo"), className: "ps-bp-photo-help", children: [
30278
30861
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-photo-help-handle", "aria-hidden": "true" }),
@@ -30332,7 +30915,7 @@ function BodyProfileView({
30332
30915
  ] });
30333
30916
  }
30334
30917
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-wrapper", children: [
30335
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", gap: "1.2vw", padding: "1.5vw", width: "100%", height: "100%", minHeight: "20vw", alignItems: "stretch", position: "relative" }, children: [
30918
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", gap: "1.2vw", padding: "1.5vw", width: "100%", flex: "1 1 auto", minHeight: 0, alignItems: "stretch", position: "relative", overflow: "hidden" }, children: [
30336
30919
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, position: "relative", display: "flex", flexDirection: "column", gap: "0.7vw" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
30337
30920
  "div",
30338
30921
  {
@@ -30390,6 +30973,95 @@ function BodyProfileView({
30390
30973
  overflow: "hidden"
30391
30974
  },
30392
30975
  children: [
30976
+ !photoPreview && /* @__PURE__ */ jsxRuntimeExports.jsxs(
30977
+ "button",
30978
+ {
30979
+ type: "button",
30980
+ onClick: (e) => {
30981
+ e.stopPropagation();
30982
+ setPhotoHelpOpen((v2) => !v2);
30983
+ },
30984
+ "aria-label": t2("How to take a good photo"),
30985
+ title: t2("How to take a good photo"),
30986
+ className: `ps-bp-photo-help-chip${photoHelpOpen ? " ps-active" : ""}`,
30987
+ children: [
30988
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-help-chip-mark", "aria-hidden": "true", children: "?" }),
30989
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("How to take a good photo") })
30990
+ ]
30991
+ }
30992
+ ),
30993
+ !photoPreview && photoHelpOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs(
30994
+ "div",
30995
+ {
30996
+ role: "dialog",
30997
+ "aria-label": t2("How to take the best photo"),
30998
+ className: "ps-bp-photo-help ps-bp-photo-help-upload",
30999
+ onClick: (e) => e.stopPropagation(),
31000
+ children: [
31001
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-photo-help-handle", "aria-hidden": "true" }),
31002
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-header", children: [
31003
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-help-title", children: t2("How to take the best photo") }),
31004
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31005
+ "button",
31006
+ {
31007
+ type: "button",
31008
+ onClick: () => setPhotoHelpOpen(false),
31009
+ "aria-label": t2("Close"),
31010
+ className: "ps-bp-photo-help-close",
31011
+ children: "×"
31012
+ }
31013
+ )
31014
+ ] }),
31015
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-do", children: [
31016
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-label", children: [
31017
+ "✓ ",
31018
+ t2("Do")
31019
+ ] }),
31020
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-body", children: [
31021
+ t2("Stand facing the camera with your full body in frame"),
31022
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
31023
+ t2("Hold the phone at WAIST height (not eye level)"),
31024
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
31025
+ t2("Stand with your HEELS against a wall for best accuracy"),
31026
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
31027
+ t2("Use natural or even lighting (e.g. near a window)"),
31028
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
31029
+ t2("Wear fitted, simple clothing (e.g. neutral colors)"),
31030
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
31031
+ t2("Choose a plain background (a light wall is ideal)"),
31032
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
31033
+ t2("Stand straight and still, arms relaxed by your sides")
31034
+ ] })
31035
+ ] }),
31036
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-dont", children: [
31037
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-label", children: [
31038
+ "✗ ",
31039
+ t2("Don't")
31040
+ ] }),
31041
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-body", children: [
31042
+ t2("Don't wear loose, baggy, or layered clothing"),
31043
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
31044
+ t2("Don't sit, pose, or bend your body"),
31045
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
31046
+ t2("Don't use strong backlighting"),
31047
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
31048
+ t2("Don't take mirror photos or selfies"),
31049
+ /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
31050
+ t2("Don't apply filters, effects, or edits")
31051
+ ] })
31052
+ ] }),
31053
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-tip", children: [
31054
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("strong", { children: [
31055
+ "💡 ",
31056
+ t2("Quick Tip"),
31057
+ ":"
31058
+ ] }),
31059
+ " ",
31060
+ t2("The simpler your photo is, the more accurate your virtual try-on results will be.")
31061
+ ] })
31062
+ ]
31063
+ }
31064
+ ),
30393
31065
  photoProcessing && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-overlay", onClick: (e) => e.stopPropagation(), children: [
30394
31066
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-photo-overlay-spinner", "aria-hidden": "true" }),
30395
31067
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-overlay-label", children: photoStatus || t2("Analyzing photo…") })
@@ -30608,64 +31280,24 @@ function BodyProfileView({
30608
31280
  background: "linear-gradient(to bottom, transparent 0%, var(--ps-border-subtle) 18%, var(--ps-border-subtle) 82%, transparent 100%)",
30609
31281
  flexShrink: 0
30610
31282
  } }),
30611
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", justifyContent: "flex-start", position: "relative", gap: "0.8vw" }, children: isShoeReferenceMode ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-shoe-ref-desktop", children: renderShoeReferenceFields() }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
30612
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
30613
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "0.6vw" }, children: [
30614
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { style: { margin: 0, fontSize: "1vw", fontWeight: 700, color: "var(--ps-text-primary)" }, children: t2("Body details") }),
30615
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
30616
- "button",
30617
- {
30618
- type: "button",
30619
- onClick: () => setPhotoHelpOpen((v2) => !v2),
30620
- "aria-label": t2("How to take a good photo"),
30621
- title: t2("How to take a good photo"),
30622
- style: {
30623
- display: "inline-flex",
30624
- alignItems: "center",
30625
- gap: "0.35vw",
30626
- padding: "0.4vw 0.7vw",
30627
- background: photoHelpOpen ? "var(--ps-accent)" : "transparent",
30628
- color: photoHelpOpen ? "#FFFFFF" : "var(--ps-accent)",
30629
- border: `1.5px solid var(--ps-accent)`,
30630
- borderRadius: "999px",
30631
- cursor: "pointer",
30632
- fontFamily: "inherit",
30633
- fontSize: "0.58vw",
30634
- fontWeight: 700,
30635
- letterSpacing: "0.04em",
30636
- whiteSpace: "nowrap",
30637
- transition: "background 0.15s, color 0.15s",
30638
- flexShrink: 0
30639
- },
30640
- children: [
30641
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: {
30642
- display: "inline-flex",
30643
- alignItems: "center",
30644
- justifyContent: "center",
30645
- width: "0.95vw",
30646
- height: "0.95vw",
30647
- minWidth: "14px",
30648
- minHeight: "14px",
30649
- borderRadius: "50%",
30650
- background: photoHelpOpen ? "#FFFFFF" : "var(--ps-accent)",
30651
- color: photoHelpOpen ? "var(--ps-accent)" : "#FFFFFF",
30652
- fontSize: "0.65vw",
30653
- fontWeight: 700,
30654
- lineHeight: 1
30655
- }, "aria-hidden": "true", children: "?" }),
30656
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("How to take a good photo") })
30657
- ]
30658
- }
30659
- )
30660
- ] }),
30661
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { style: { margin: "0.2vw 0 0", fontSize: "0.65vw", color: "var(--ps-text-muted)" }, children: t2("These calibrate the AI — all required.") })
30662
- ] }),
30663
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-system-toggle", style: { alignSelf: "center", marginTop: "1.2vw" }, children: [
30664
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: `ps-bp-system-btn${!isImperialMode ? " ps-bp-system-active" : ""}`, onClick: photoSwitchToMetric, type: "button", children: t2("Metric") }),
30665
- /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: `ps-bp-system-btn${isImperialMode ? " ps-bp-system-active" : ""}`, onClick: photoSwitchToImperial, type: "button", children: t2("Imperial") })
31283
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: {
31284
+ flex: compactHeightWeightAccessory ? "0 1 min(34vw, 360px)" : 1,
31285
+ display: "flex",
31286
+ flexDirection: "column",
31287
+ justifyContent: compactHeightWeightAccessory ? "center" : "flex-start",
31288
+ position: "relative",
31289
+ gap: compactHeightWeightAccessory ? "1.1vw" : "0.8vw",
31290
+ minWidth: compactHeightWeightAccessory ? "280px" : void 0
31291
+ }, children: isShoeReferenceMode ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-shoe-ref-desktop", children: renderShoeReferenceFields() }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
31292
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `ps-bp-photo-details-head${compactHeightWeightAccessory ? " ps-bp-photo-details-head-simple" : ""}`, children: [
31293
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { children: t2("Body details") }),
31294
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-system-toggle ps-bp-system-toggle-compact", children: [
31295
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: `ps-bp-system-btn${!isImperialMode ? " ps-bp-system-active" : ""}`, onClick: photoSwitchToMetric, type: "button", children: t2("Metric") }),
31296
+ /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: `ps-bp-system-btn${isImperialMode ? " ps-bp-system-active" : ""}`, onClick: photoSwitchToImperial, type: "button", children: t2("Imperial") })
31297
+ ] })
30666
31298
  ] }),
30667
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginTop: "auto", marginBottom: "auto" }, children: [
30668
- activeProfileName && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-profile-card", children: [
31299
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginTop: compactHeightWeightAccessory ? "0.35vw" : "0.15vw", marginBottom: 0, minHeight: 0 }, children: [
31300
+ activeProfileName && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-profile-card ps-bp-profile-card-compact", children: [
30669
31301
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-profile-card-copy", children: [
30670
31302
  /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-profile-card-eyebrow", children: t2("Active Profile") }),
30671
31303
  /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: activeProfileName }),
@@ -30749,87 +31381,6 @@ function BodyProfileView({
30749
31381
  ] })
30750
31382
  ] })
30751
31383
  ] })
30752
- ] }),
30753
- photoHelpOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
30754
- /* @__PURE__ */ jsxRuntimeExports.jsx(
30755
- "div",
30756
- {
30757
- className: "ps-bp-photo-help-backdrop",
30758
- onClick: () => setPhotoHelpOpen(false),
30759
- "aria-hidden": "true"
30760
- }
30761
- ),
30762
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
30763
- "div",
30764
- {
30765
- role: "dialog",
30766
- "aria-label": t2("How to take the best photo"),
30767
- className: "ps-bp-photo-help",
30768
- children: [
30769
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-bp-photo-help-handle", "aria-hidden": "true" }),
30770
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-header", children: [
30771
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ps-bp-photo-help-title", children: t2("How to take the best photo") }),
30772
- /* @__PURE__ */ jsxRuntimeExports.jsx(
30773
- "button",
30774
- {
30775
- type: "button",
30776
- onClick: () => setPhotoHelpOpen(false),
30777
- "aria-label": t2("Close"),
30778
- className: "ps-bp-photo-help-close",
30779
- children: "×"
30780
- }
30781
- )
30782
- ] }),
30783
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-do", children: [
30784
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-label", children: [
30785
- "✓ ",
30786
- t2("Do")
30787
- ] }),
30788
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-body", children: [
30789
- t2("Stand facing the camera with your full body in frame"),
30790
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30791
- t2("Hold the phone at WAIST height (not eye level)"),
30792
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30793
- t2("Stand with your HEELS against a wall for best accuracy"),
30794
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30795
- t2("Use natural or even lighting (e.g. near a window)"),
30796
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30797
- t2("Wear fitted, simple clothing (e.g. neutral colors)"),
30798
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30799
- t2("Choose a plain background (a light wall is ideal)"),
30800
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30801
- t2("Stand straight and still, arms relaxed by your sides")
30802
- ] })
30803
- ] }),
30804
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-dont", children: [
30805
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-label", children: [
30806
- "✗ ",
30807
- t2("Don't")
30808
- ] }),
30809
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section-body", children: [
30810
- t2("Don't wear loose, baggy, or layered clothing"),
30811
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30812
- t2("Don't sit, pose, or bend your body"),
30813
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30814
- t2("Don't use strong backlighting"),
30815
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30816
- t2("Don't take mirror photos or selfies"),
30817
- /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
30818
- t2("Don't apply filters, effects, or edits")
30819
- ] })
30820
- ] }),
30821
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-photo-help-section ps-bp-photo-help-tip", children: [
30822
- /* @__PURE__ */ jsxRuntimeExports.jsxs("strong", { children: [
30823
- "💡 ",
30824
- t2("Quick Tip"),
30825
- ":"
30826
- ] }),
30827
- " ",
30828
- t2("The simpler your photo is, the more accurate your virtual try-on results will be.")
30829
- ] })
30830
- ]
30831
- }
30832
- )
30833
31384
  ] })
30834
31385
  ] }) })
30835
31386
  ] }),
@@ -32506,6 +33057,31 @@ function validMidsectionProfile(value) {
32506
33057
  function validHipProfile(value) {
32507
33058
  return value === "narrow" || value === "average" || value === "full" ? value : void 0;
32508
33059
  }
33060
+ async function profilePhotoFromFile(file) {
33061
+ try {
33062
+ return await compressImage(file, { maxDimension: 1280, quality: 0.92 });
33063
+ } catch {
33064
+ return new Promise((resolve) => {
33065
+ try {
33066
+ const reader = new FileReader();
33067
+ reader.onload = () => resolve(typeof reader.result === "string" ? reader.result : null);
33068
+ reader.onerror = () => resolve(null);
33069
+ reader.readAsDataURL(file);
33070
+ } catch {
33071
+ resolve(null);
33072
+ }
33073
+ });
33074
+ }
33075
+ }
33076
+ function cleanProfileMeasurements(value) {
33077
+ if (!value || typeof value !== "object") return void 0;
33078
+ const measurements = {};
33079
+ for (const [key, raw] of Object.entries(value)) {
33080
+ const n2 = positiveNumber(raw);
33081
+ if (n2 != null) measurements[key] = n2;
33082
+ }
33083
+ return Object.keys(measurements).length > 0 ? measurements : void 0;
33084
+ }
32509
33085
  function durableHistoryImageUrl(url) {
32510
33086
  if (!url) return void 0;
32511
33087
  const clean = url.trim();
@@ -32596,6 +33172,7 @@ function PrimeStyleTryonInner({
32596
33172
  productImages,
32597
33173
  productCarouselItems,
32598
33174
  garmentReferenceImage,
33175
+ garmentDetailImage,
32599
33176
  productTitle = "Product",
32600
33177
  productUrl,
32601
33178
  productId,
@@ -32627,6 +33204,10 @@ function PrimeStyleTryonInner({
32627
33204
  onProcessing,
32628
33205
  onComplete,
32629
33206
  onError,
33207
+ onAddToBag,
33208
+ addToBagLabel,
33209
+ continueShoppingLabel,
33210
+ backToProductPageLabel,
32630
33211
  sizeGuideData,
32631
33212
  initialView,
32632
33213
  initialBodyProfileStep
@@ -32837,7 +33418,9 @@ function PrimeStyleTryonInner({
32837
33418
  const [profileSession, setProfileSession] = reactExports.useState(() => getStoredProfileSession());
32838
33419
  const profileSessionRef = reactExports.useRef(profileSession);
32839
33420
  const suppressNextProfilePersistRef = reactExports.useRef(false);
32840
- const [profileCompletionDraft, setProfileCompletionDraft] = reactExports.useState(() => getStoredProfileSession() ? null : lsGet(PROFILE_COMPLETION_DRAFT_KEY, null));
33421
+ const [profileCompletionDraft, setProfileCompletionDraft] = reactExports.useState(
33422
+ () => lsGet(PROFILE_COMPLETION_DRAFT_KEY, null)
33423
+ );
32841
33424
  const [profileAuthError, setProfileAuthError] = reactExports.useState(null);
32842
33425
  const [profileAuthLoadingProvider, setProfileAuthLoadingProvider] = reactExports.useState(null);
32843
33426
  const [history, setHistory] = reactExports.useState(() => lsGet("history", []).map(normalizeHistoryEntry));
@@ -32851,12 +33434,14 @@ function PrimeStyleTryonInner({
32851
33434
  const [restoredProductCarouselItems, setRestoredProductCarouselItems] = reactExports.useState(null);
32852
33435
  const [restoredProductTitle, setRestoredProductTitle] = reactExports.useState(null);
32853
33436
  const [restoredProductUrl, setRestoredProductUrl] = reactExports.useState(null);
33437
+ const [restoredHistoryEntryId, setRestoredHistoryEntryId] = reactExports.useState(null);
32854
33438
  const [activeProfileId, setActiveProfileIdState] = reactExports.useState(() => getActiveProfileId());
32855
33439
  const [estimatingProfileIds, setEstimatingProfileIds] = reactExports.useState(() => /* @__PURE__ */ new Set());
32856
33440
  const [deleteConfirmId, setDeleteConfirmId] = reactExports.useState(null);
32857
33441
  const setActiveProfileId$1 = reactExports.useCallback((id2) => {
32858
33442
  setActiveProfileIdState(id2);
32859
- if (!profileSessionRef.current) setActiveProfileId(id2);
33443
+ if (!profileSessionRef.current || id2 === null) setActiveProfileId(id2);
33444
+ else lsRemove("active_profile_id");
32860
33445
  }, []);
32861
33446
  reactExports.useEffect(() => {
32862
33447
  profileSessionRef.current = profileSession;
@@ -32870,6 +33455,7 @@ function PrimeStyleTryonInner({
32870
33455
  });
32871
33456
  const profileSyncTimerRef = reactExports.useRef(null);
32872
33457
  const profileSyncHydratingRef = reactExports.useRef(false);
33458
+ const [profileStoreHydrating, setProfileStoreHydrating] = reactExports.useState(false);
32873
33459
  const profileSyncSnapshotRef = reactExports.useRef("");
32874
33460
  const handleRegisterProfilesBack = reactExports.useCallback((canGoBack, goBack) => {
32875
33461
  profilesCanGoBackRef.current = canGoBack;
@@ -32879,25 +33465,35 @@ function PrimeStyleTryonInner({
32879
33465
  lsRemove(PROFILE_COMPLETION_DRAFT_KEY);
32880
33466
  setProfileCompletionDraft(null);
32881
33467
  }, []);
32882
- const handleCompleteProfileFromResult = reactExports.useCallback(() => {
33468
+ const buildProfileCompletionDraft = reactExports.useCallback((photoBase64) => {
32883
33469
  const f2 = formRef.current || {};
32884
33470
  const active = profiles.find((p2) => p2.id === activeProfileId) || null;
32885
33471
  const gender = f2.gender === "female" || active?.gender === "female" ? "female" : "male";
32886
- const profilePhoto = f2.photoBase64 || f2.bodyImage || active?.photoBase64 || active?.photoUrl;
32887
- const normalizedProfilePhoto = profilePhoto ? normalizeProfilePhotoSource(profilePhoto) : null;
32888
33472
  const customMeasurements = {};
32889
33473
  const wristCircumference = positiveNumber(f2.wristCircumference);
32890
33474
  if (wristCircumference != null) customMeasurements.wristCircumference = wristCircumference;
32891
- const draft = {
33475
+ const resultMeasurements = cleanProfileMeasurements(sizingResult?.estimates);
33476
+ const resultMeasurementsUnit = sizingResult?.estimatesUnit === "in" ? "in" : "cm";
33477
+ const formHeight = positiveNumber(f2.height);
33478
+ const activeHeight = positiveNumber(active?.height ?? active?.heightCm);
33479
+ const estimateHeight = positiveNumber(resultMeasurements?.height);
33480
+ const formWeight = positiveNumber(f2.weight);
33481
+ const activeWeight = positiveNumber(active?.weight ?? active?.weightKg);
33482
+ const estimateWeight = positiveNumber(resultMeasurements?.weight);
33483
+ const height = formHeight ?? activeHeight ?? estimateHeight;
33484
+ const weight = formWeight ?? activeWeight ?? estimateWeight;
33485
+ const heightUnitForDraft = formHeight != null ? f2.heightUnit || active?.heightUnit || heightUnit : activeHeight != null ? active?.heightUnit || heightUnit : estimateHeight != null ? resultMeasurementsUnit : f2.heightUnit || active?.heightUnit || heightUnit;
33486
+ const weightUnitForDraft = formWeight != null ? f2.weightUnit || active?.weightUnit || weightUnit : activeWeight != null ? active?.weightUnit || weightUnit : estimateWeight != null ? resultMeasurementsUnit : f2.weightUnit || active?.weightUnit || weightUnit;
33487
+ return {
32892
33488
  source: "size-result",
32893
33489
  createdAt: Date.now(),
32894
33490
  productId: effectiveProductId,
32895
33491
  productTitle,
32896
33492
  gender,
32897
- height: positiveNumber(f2.height) ?? positiveNumber(active?.height ?? active?.heightCm),
32898
- weight: positiveNumber(f2.weight) ?? positiveNumber(active?.weight ?? active?.weightKg),
32899
- heightUnit: f2.heightUnit || active?.heightUnit || heightUnit,
32900
- weightUnit: f2.weightUnit || active?.weightUnit || weightUnit,
33493
+ ...height != null ? { height } : {},
33494
+ ...weight != null ? { weight } : {},
33495
+ heightUnit: heightUnitForDraft,
33496
+ weightUnit: weightUnitForDraft,
32901
33497
  sizingUnit: active?.sizingUnit || sizingUnit,
32902
33498
  age: positiveNumber(f2.age) ?? positiveNumber(active?.age),
32903
33499
  chestProfile: validChestProfile(f2.chestProfile || active?.chestProfile),
@@ -32906,15 +33502,23 @@ function PrimeStyleTryonInner({
32906
33502
  bandSize: f2.bandSize || active?.bandSize,
32907
33503
  cupSize: f2.cupSize || active?.cupSize,
32908
33504
  braSizeRegion: f2.braSizeRegion || active?.braSizeRegion || "US",
32909
- ...normalizedProfilePhoto ? { photoBase64: normalizedProfilePhoto } : {},
33505
+ ...photoBase64 ? { photoBase64 } : {},
33506
+ ...resultMeasurements ? { measurements: resultMeasurements, measurementsUnit: resultMeasurementsUnit } : {},
32910
33507
  ...Object.keys(customMeasurements).length > 0 ? { customMeasurements } : {}
32911
33508
  };
32912
- if (profileSessionRef.current) lsRemove(PROFILE_COMPLETION_DRAFT_KEY);
32913
- else lsSet(PROFILE_COMPLETION_DRAFT_KEY, draft);
33509
+ }, [activeProfileId, effectiveProductId, heightUnit, productTitle, profiles, sizingResult, sizingUnit, weightUnit]);
33510
+ const handleCompleteProfileFromResult = reactExports.useCallback(async () => {
33511
+ const f2 = formRef.current || {};
33512
+ const active = profiles.find((p2) => p2.id === activeProfileId) || null;
33513
+ const file = selectedFile || selectedFileRef.current;
33514
+ const profilePhoto = f2.photoBase64 || f2.bodyImage || (file ? await profilePhotoFromFile(file) : null) || active?.photoBase64 || active?.photoUrl;
33515
+ const normalizedProfilePhoto = profilePhoto ? normalizeProfilePhotoSource(profilePhoto) : null;
33516
+ const draft = buildProfileCompletionDraft(normalizedProfilePhoto);
33517
+ lsSet(PROFILE_COMPLETION_DRAFT_KEY, draft);
32914
33518
  setProfileCompletionDraft(draft);
32915
33519
  setProfileAuthError(null);
32916
33520
  setView("profiles");
32917
- }, [activeProfileId, effectiveProductId, heightUnit, productTitle, profiles, sizingUnit, weightUnit]);
33521
+ }, [activeProfileId, buildProfileCompletionDraft, profiles, selectedFile]);
32918
33522
  const applyProfileStore = reactExports.useCallback((nextProfiles, nextActiveProfileId, persistLocal = !profileSessionRef.current) => {
32919
33523
  if (persistLocal) saveProfiles(nextProfiles);
32920
33524
  setProfiles(nextProfiles);
@@ -32924,6 +33528,7 @@ function PrimeStyleTryonInner({
32924
33528
  }, []);
32925
33529
  const hydrateProfileStore = reactExports.useCallback(async (session, seedProfiles, seedActiveProfileId) => {
32926
33530
  profileSyncHydratingRef.current = true;
33531
+ setProfileStoreHydrating(true);
32927
33532
  try {
32928
33533
  const remoteStore = await fetchRemoteProfiles(apiUrl, session.accessToken);
32929
33534
  if (remoteStore.profiles.length > 0) {
@@ -32938,6 +33543,7 @@ function PrimeStyleTryonInner({
32938
33543
  applyProfileStore([], null, false);
32939
33544
  } finally {
32940
33545
  profileSyncHydratingRef.current = false;
33546
+ setProfileStoreHydrating(false);
32941
33547
  }
32942
33548
  }, [apiUrl, applyProfileStore]);
32943
33549
  const handleSocialProfileLogin = reactExports.useCallback(async (provider) => {
@@ -32949,6 +33555,9 @@ function PrimeStyleTryonInner({
32949
33555
  profileSessionRef.current = session;
32950
33556
  setProfileSession(session);
32951
33557
  await hydrateProfileStore(session, profiles, activeProfileId);
33558
+ setProfileCompletionDraft(
33559
+ (current) => current ?? lsGet(PROFILE_COMPLETION_DRAFT_KEY, null)
33560
+ );
32952
33561
  } catch (error) {
32953
33562
  setProfileAuthError(error instanceof Error ? error.message : t2("Social login failed. Please try again."));
32954
33563
  } finally {
@@ -32993,6 +33602,7 @@ function PrimeStyleTryonInner({
32993
33602
  const modelImageIdRef = reactExports.useRef(null);
32994
33603
  const autoTryOnFiredRef = reactExports.useRef(false);
32995
33604
  const bestGarmentImageRef = reactExports.useRef(null);
33605
+ const bestGarmentDetailImageRef = reactExports.useRef(null);
32996
33606
  reactExports.useEffect(() => {
32997
33607
  try {
32998
33608
  const key = getApiKey();
@@ -33032,6 +33642,7 @@ function PrimeStyleTryonInner({
33032
33642
  productTitle
33033
33643
  });
33034
33644
  bestGarmentImageRef.current = null;
33645
+ bestGarmentDetailImageRef.current = garmentDetailImage || null;
33035
33646
  if (garmentReferenceImage) {
33036
33647
  bestGarmentImageRef.current = garmentReferenceImage;
33037
33648
  console.log(`[ps-sdk:pick] #${fireN} early-return — using prop override`);
@@ -33057,8 +33668,9 @@ function PrimeStyleTryonInner({
33057
33668
  signal: ctrl.signal
33058
33669
  }).then((r2) => r2.ok ? r2.json() : null).then((j) => {
33059
33670
  if (j?.bestUrl) {
33060
- bestGarmentImageRef.current = j.bestUrl;
33061
- console.log(`[ps-sdk:pick] #${fireN} OK in ${Date.now() - t0}ms → ${j.bestUrl}`);
33671
+ bestGarmentImageRef.current = j.modelUrl || j.bestUrl;
33672
+ bestGarmentDetailImageRef.current = garmentDetailImage || j.detailUrl || null;
33673
+ console.log(`[ps-sdk:pick] #${fireN} ← OK in ${Date.now() - t0}ms → worn=${bestGarmentImageRef.current} detail=${bestGarmentDetailImageRef.current || "none"}`);
33062
33674
  } else {
33063
33675
  console.log(`[ps-sdk:pick] #${fireN} ← no bestUrl in response (${Date.now() - t0}ms)`);
33064
33676
  }
@@ -33069,7 +33681,7 @@ function PrimeStyleTryonInner({
33069
33681
  ctrl.abort();
33070
33682
  console.log(`[ps-sdk:pick] #${fireN} cleanup — aborted in-flight fetch`);
33071
33683
  };
33072
- }, [effectiveProductImages, garmentReferenceImage, apiUrl, productTitle, toBackendFetchableImageUrl]);
33684
+ }, [effectiveProductImages, garmentReferenceImage, garmentDetailImage, apiUrl, productTitle, toBackendFetchableImageUrl]);
33073
33685
  function summarizeSizeGuideForGender(value) {
33074
33686
  if (!value || typeof value !== "object") return void 0;
33075
33687
  const obj = value;
@@ -33474,6 +34086,7 @@ function PrimeStyleTryonInner({
33474
34086
  setRestoredProductCarouselItems(null);
33475
34087
  setRestoredProductTitle(null);
33476
34088
  setRestoredProductUrl(null);
34089
+ setRestoredHistoryEntryId(null);
33477
34090
  setRestoredProductUrl(null);
33478
34091
  setSizingLoading(true);
33479
34092
  setEstimationDone(hasStored);
@@ -33570,6 +34183,7 @@ function PrimeStyleTryonInner({
33570
34183
  setRestoredProductCarouselItems(null);
33571
34184
  setRestoredProductTitle(null);
33572
34185
  setRestoredProductUrl(null);
34186
+ setRestoredHistoryEntryId(null);
33573
34187
  if (!tryOnInFlight) {
33574
34188
  setResultImageUrl(null);
33575
34189
  setSizingResult(null);
@@ -34025,6 +34639,7 @@ function PrimeStyleTryonInner({
34025
34639
  setRestoredProductCarouselItems(null);
34026
34640
  setRestoredProductTitle(null);
34027
34641
  setRestoredProductUrl(null);
34642
+ setRestoredHistoryEntryId(null);
34028
34643
  if (previewUrl) URL.revokeObjectURL(previewUrl);
34029
34644
  setSelectedFile(null);
34030
34645
  selectedFileRef.current = null;
@@ -34086,6 +34701,7 @@ function PrimeStyleTryonInner({
34086
34701
  setRestoredProductImages(null);
34087
34702
  setRestoredProductCarouselItems(null);
34088
34703
  setRestoredProductTitle(null);
34704
+ setRestoredHistoryEntryId(null);
34089
34705
  completedRef.current = false;
34090
34706
  modelImageIdRef.current = null;
34091
34707
  noFitFoundRef.current = false;
@@ -34104,6 +34720,7 @@ function PrimeStyleTryonInner({
34104
34720
  if (measurementType === "face" || measurementType === "head") {
34105
34721
  setFaceLandmarks(null);
34106
34722
  const minVisible2 = new Promise((r2) => setTimeout(r2, 4500));
34723
+ let landmarksVisibleMin = null;
34107
34724
  try {
34108
34725
  const faceResult = await detectFaceMeasurements(objUrl);
34109
34726
  if (!faceResult) {
@@ -34116,7 +34733,10 @@ function PrimeStyleTryonInner({
34116
34733
  setSizingLoading(false);
34117
34734
  return;
34118
34735
  }
34119
- if (faceResult) setFaceLandmarks(faceResult.landmarks);
34736
+ if (faceResult) {
34737
+ setFaceLandmarks(faceResult.landmarks);
34738
+ landmarksVisibleMin = new Promise((r2) => setTimeout(r2, 1200));
34739
+ }
34120
34740
  const facePayload = {
34121
34741
  product: productContext,
34122
34742
  sizeGuide: sizeGuide ?? { found: false },
@@ -34145,7 +34765,7 @@ function PrimeStyleTryonInner({
34145
34765
  if (recRes.ok) {
34146
34766
  const recData = await recRes.json();
34147
34767
  if (recData?.found === false) {
34148
- await minVisible2;
34768
+ await Promise.all([minVisible2, landmarksVisibleMin || Promise.resolve()]);
34149
34769
  setNoSizeReason(recData?.reasoning === "NO_SIZE_CHART" ? "no-chart" : "no-match");
34150
34770
  setView("no-chart");
34151
34771
  setEstimationDone(true);
@@ -34169,7 +34789,7 @@ function PrimeStyleTryonInner({
34169
34789
  { skipBodyEstimate: true }
34170
34790
  );
34171
34791
  } else {
34172
- await minVisible2;
34792
+ await Promise.all([minVisible2, landmarksVisibleMin || Promise.resolve()]);
34173
34793
  const errBody = await recRes.text().catch(() => "");
34174
34794
  console.error("[ps-sdk] face-recommend failed:", recRes.status, errBody);
34175
34795
  setErrorMessage(t2("Unable to get size recommendation. Please try manual measurements."));
@@ -34180,14 +34800,14 @@ function PrimeStyleTryonInner({
34180
34800
  }
34181
34801
  } catch (err) {
34182
34802
  console.error("[ps-sdk] face-recommend failed:", err);
34183
- await minVisible2;
34803
+ await Promise.all([minVisible2, landmarksVisibleMin || Promise.resolve()]);
34184
34804
  setErrorMessage(t2("Unable to get size recommendation. Please try manual measurements."));
34185
34805
  setEstimationDone(true);
34186
34806
  setSizingLoading(false);
34187
34807
  setView("error");
34188
34808
  return;
34189
34809
  }
34190
- await minVisible2;
34810
+ await Promise.all([minVisible2, landmarksVisibleMin || Promise.resolve()]);
34191
34811
  setSizingLoading(false);
34192
34812
  return;
34193
34813
  }
@@ -34432,6 +35052,7 @@ function PrimeStyleTryonInner({
34432
35052
  }
34433
35053
  console.log("[ps-sdk:tryon] fitInfo built", { count: fitInfo?.length || 0, areas: fitInfo?.map((f2) => `${f2.area}(${f2.fit})`) });
34434
35054
  let garmentImage = productImage;
35055
+ let detailImage = garmentDetailImage || bestGarmentDetailImageRef.current || null;
34435
35056
  if (garmentReferenceImage) {
34436
35057
  garmentImage = garmentReferenceImage;
34437
35058
  } else if (bestGarmentImageRef.current) {
@@ -34444,6 +35065,9 @@ function PrimeStyleTryonInner({
34444
35065
  garmentImage = best;
34445
35066
  }
34446
35067
  }
35068
+ if (!detailImage && effectiveProductImages?.length) {
35069
+ detailImage = effectiveProductImages.find((img) => img && img !== garmentImage) || null;
35070
+ }
34447
35071
  const response = await apiRef.current.submitTryOn(
34448
35072
  modelImage,
34449
35073
  garmentImage,
@@ -34459,6 +35083,7 @@ function PrimeStyleTryonInner({
34459
35083
  productTags: productTagsList,
34460
35084
  productDescription,
34461
35085
  productMaterial,
35086
+ ...detailImage && detailImage !== garmentImage ? { garmentDetailImage: detailImage } : {},
34462
35087
  silhouetteContext: buildSilhouetteContext(
34463
35088
  sizingResult,
34464
35089
  sizeGuide,
@@ -34522,7 +35147,7 @@ function PrimeStyleTryonInner({
34522
35147
  setView("error");
34523
35148
  onError?.({ message, code });
34524
35149
  }
34525
- }, [selectedFile, productImage, effectiveProductImages, garmentReferenceImage, productTitle, productCategory, productSubcategory, resolvedProductFitType, productType, productTagsList, productDescription, productMaterial, measurementType, sizingResult, sizeGuide, apiUrl, onProcessing, onError, handleVtoUpdate]);
35150
+ }, [selectedFile, productImage, effectiveProductImages, garmentReferenceImage, garmentDetailImage, productTitle, productCategory, productSubcategory, resolvedProductFitType, productType, productTagsList, productDescription, productMaterial, measurementType, sizingResult, sizeGuide, apiUrl, onProcessing, onError, handleVtoUpdate]);
34526
35151
  reactExports.useEffect(() => {
34527
35152
  if (view !== "size-result") {
34528
35153
  autoTryOnFiredRef.current = false;
@@ -34555,17 +35180,86 @@ function PrimeStyleTryonInner({
34555
35180
  }).catch(() => window.open(resultImageUrl, "_blank"));
34556
35181
  }
34557
35182
  }, [resultImageUrl]);
34558
- const handleContinueShopping = reactExports.useCallback(() => {
34559
- const historyUrl = restoredProductUrl || "";
34560
- if (historyUrl && typeof window !== "undefined") {
35183
+ const openProductPageUrl = reactExports.useCallback((url) => {
35184
+ if (url && typeof window !== "undefined") {
34561
35185
  try {
34562
- window.open(new URL(historyUrl, window.location.origin).href, "_blank", "noopener,noreferrer");
35186
+ window.open(new URL(url, window.location.origin).href, "_blank", "noopener,noreferrer");
34563
35187
  } catch {
34564
- window.open(historyUrl, "_blank", "noopener,noreferrer");
35188
+ window.open(url, "_blank", "noopener,noreferrer");
34565
35189
  }
34566
35190
  }
35191
+ }, []);
35192
+ const handleContinueShopping = reactExports.useCallback(() => {
34567
35193
  handleClose();
34568
- }, [handleClose, restoredProductUrl]);
35194
+ }, [handleClose]);
35195
+ const handleBackToProductPage = reactExports.useCallback(() => {
35196
+ const targetUrl = restoredProductUrl || effectiveProductUrl || "";
35197
+ if (targetUrl) {
35198
+ openProductPageUrl(targetUrl);
35199
+ return;
35200
+ }
35201
+ handleClose();
35202
+ }, [effectiveProductUrl, handleClose, openProductPageUrl, restoredProductUrl]);
35203
+ const buildAddToBagSelectedSizes = reactExports.useCallback(() => {
35204
+ const overrides = Object.values(pendingCustomSizesRef.current);
35205
+ if (overrides.length) {
35206
+ return overrides.map((override) => ({
35207
+ sectionName: override.sectionName,
35208
+ selectedSize: override.selectedSize,
35209
+ selectedLength: override.selectedLength,
35210
+ displayLabel: override.displayLabel,
35211
+ isOverride: true
35212
+ }));
35213
+ }
35214
+ const sections = sizingResult?.sections;
35215
+ if (sections && typeof sections === "object") {
35216
+ const selected = Object.entries(sections).map(([sectionName, sectionResult]) => {
35217
+ const result = sectionResult;
35218
+ const selectedSize = result.size || result.recommendedSize || "";
35219
+ if (!selectedSize) return null;
35220
+ const displayLabel = [selectedSize, result.length].filter(Boolean).join(" / ");
35221
+ return {
35222
+ sectionName,
35223
+ selectedSize,
35224
+ selectedLength: result.length,
35225
+ displayLabel,
35226
+ isOverride: false
35227
+ };
35228
+ }).filter(Boolean);
35229
+ return selected.length ? selected : void 0;
35230
+ }
35231
+ const recommendedSize = sizingResult?.recommendedSize || "";
35232
+ if (!recommendedSize) return void 0;
35233
+ return [{
35234
+ sectionName: "Your Fit",
35235
+ selectedSize: recommendedSize,
35236
+ displayLabel: recommendedSize,
35237
+ isOverride: false
35238
+ }];
35239
+ }, [sizingResult]);
35240
+ const handleAddToBag = reactExports.useCallback(async () => {
35241
+ if (!onAddToBag || !sizingResult) return;
35242
+ await onAddToBag({
35243
+ productId,
35244
+ productTitle: restoredProductTitle || productTitle,
35245
+ productUrl: restoredProductUrl || effectiveProductUrl,
35246
+ recommendedSize: sizingResult.recommendedSize,
35247
+ sizingResult,
35248
+ resultImageUrl: resultImageUrlRef.current || resultImageUrl,
35249
+ historyEntryId: currentHistoryEntryIdRef.current ?? void 0,
35250
+ selectedSizes: buildAddToBagSelectedSizes()
35251
+ });
35252
+ }, [
35253
+ buildAddToBagSelectedSizes,
35254
+ effectiveProductUrl,
35255
+ onAddToBag,
35256
+ productId,
35257
+ productTitle,
35258
+ restoredProductTitle,
35259
+ restoredProductUrl,
35260
+ resultImageUrl,
35261
+ sizingResult
35262
+ ]);
34569
35263
  const handleTryOnFeedbackSubmit = reactExports.useCallback(async ({ rating, note }) => {
34570
35264
  const profileLoggedIn = Boolean(profileSession);
34571
35265
  const activeProfile = profileLoggedIn ? profiles.find((profile) => profile.id === activeProfileId) : null;
@@ -34624,6 +35318,7 @@ function PrimeStyleTryonInner({
34624
35318
  setRestoredProductCarouselItems(null);
34625
35319
  setRestoredProductTitle(null);
34626
35320
  setRestoredProductUrl(null);
35321
+ setRestoredHistoryEntryId(null);
34627
35322
  setErrorMessage(null);
34628
35323
  setSizingMethod(null);
34629
35324
  setSizingResult(null);
@@ -34756,6 +35451,7 @@ function PrimeStyleTryonInner({
34756
35451
  }));
34757
35452
  const latestResultImageUrl = resultImageUrlRef.current;
34758
35453
  const durableResultUrl = durableHistoryImageUrl(latestResultImageUrl);
35454
+ const profileDraftSnapshot = buildProfileCompletionDraft(null);
34759
35455
  const entry = {
34760
35456
  id: id2,
34761
35457
  productId,
@@ -34780,6 +35476,7 @@ function PrimeStyleTryonInner({
34780
35476
  sections: sizeGuide.sections,
34781
35477
  sectionImages: sizeGuide.sectionImages
34782
35478
  } : void 0,
35479
+ profileCompletionDraft: profileDraftSnapshot,
34783
35480
  date: Date.now(),
34784
35481
  hasPhoto: hasPhoto || void 0,
34785
35482
  hasResult: latestResultImageUrl ? true : void 0,
@@ -34796,7 +35493,7 @@ function PrimeStyleTryonInner({
34796
35493
  return next;
34797
35494
  });
34798
35495
  return id2;
34799
- }, [productId, productTitle, effectiveProductUrl, productImage, effectiveProductImages, effectiveProductCarouselItems, resultImageUrl, sizingResult, sizeGuide, activeProfileId, profiles, selectedFile]);
35496
+ }, [productId, productTitle, effectiveProductUrl, productImage, effectiveProductImages, effectiveProductCarouselItems, resultImageUrl, sizingResult, sizeGuide, activeProfileId, profiles, selectedFile, buildProfileCompletionDraft]);
34800
35497
  const persistHistoryResult = reactExports.useCallback((entryId, imageUrl, cleanupWhenIdle) => {
34801
35498
  void (async () => {
34802
35499
  const durableResultUrl = durableHistoryImageUrl(imageUrl);
@@ -34911,6 +35608,33 @@ function PrimeStyleTryonInner({
34911
35608
  );
34912
35609
  setRestoredProductTitle(entry.productTitle || null);
34913
35610
  setRestoredProductUrl(entry.productUrl || null);
35611
+ setRestoredHistoryEntryId(entry.id);
35612
+ if (entry.profileCompletionDraft) {
35613
+ const draft = entry.profileCompletionDraft;
35614
+ const restoredForm = { ...formRef.current };
35615
+ if (draft.gender) restoredForm.gender = draft.gender;
35616
+ if (draft.height != null) restoredForm.height = String(draft.height);
35617
+ if (draft.weight != null) restoredForm.weight = String(draft.weight);
35618
+ if (draft.heightUnit) restoredForm.heightUnit = String(draft.heightUnit);
35619
+ if (draft.weightUnit) restoredForm.weightUnit = String(draft.weightUnit);
35620
+ if (draft.age != null) restoredForm.age = String(draft.age);
35621
+ if (draft.chestProfile) restoredForm.chestProfile = draft.chestProfile;
35622
+ if (draft.midsectionProfile) restoredForm.midsectionProfile = draft.midsectionProfile;
35623
+ if (draft.hipProfile) restoredForm.hipProfile = draft.hipProfile;
35624
+ if (draft.bandSize) restoredForm.bandSize = draft.bandSize;
35625
+ if (draft.cupSize) restoredForm.cupSize = draft.cupSize;
35626
+ if (draft.braSizeRegion) restoredForm.braSizeRegion = draft.braSizeRegion;
35627
+ if (draft.customMeasurements) {
35628
+ for (const [key, value] of Object.entries(draft.customMeasurements)) {
35629
+ restoredForm[key] = String(value);
35630
+ }
35631
+ }
35632
+ formRef.current = restoredForm;
35633
+ setFormGender(restoredForm.gender || "male");
35634
+ if (draft.heightUnit) setHeightUnit(String(draft.heightUnit));
35635
+ if (draft.weightUnit) setWeightUnit(String(draft.weightUnit));
35636
+ if (draft.sizingUnit) setSizingUnit(String(draft.sizingUnit));
35637
+ }
34914
35638
  if (entry.sizingResult) {
34915
35639
  setSizingResult(entry.sizingResult);
34916
35640
  } else if (entry.recommendedSize) {
@@ -35059,6 +35783,14 @@ function PrimeStyleTryonInner({
35059
35783
  if (measurementType === "wrist") return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsxRuntimeExports.jsx(WristSizeView, { ...accCommon }) }, "v-wrist");
35060
35784
  const isWomenProduct = effectiveProductGender === "female";
35061
35785
  const simplePhotoOnly = measurementType === "foot" || measurementType === "body-basic";
35786
+ const activeProfileForBody = profiles.find((x2) => x2.id === activeProfileId) || null;
35787
+ const waitingForActiveProfile = !!profileSession && profileStoreHydrating && profiles.length === 0 && !activeProfileForBody;
35788
+ if (waitingForActiveProfile) {
35789
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ps-bp-profile-hydrating", children: [
35790
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-size-loading-spinner", "aria-hidden": "true" }),
35791
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t2("Loading your fit profile") })
35792
+ ] }) }, "v-bodyprofile-loading");
35793
+ }
35062
35794
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
35063
35795
  BodyProfileView,
35064
35796
  {
@@ -35068,6 +35800,7 @@ function PrimeStyleTryonInner({
35068
35800
  basicOnly: false,
35069
35801
  initialStep: bodyProfileInitialStep === "basics" ? "basics" : void 0,
35070
35802
  simplePhotoOnly,
35803
+ simpleAccessoryLayout: measurementType === "body-basic",
35071
35804
  simpleQuestionMode: measurementType === "foot" ? "shoeReference" : "heightWeight",
35072
35805
  formRef,
35073
35806
  sizingCountry,
@@ -35080,7 +35813,7 @@ function PrimeStyleTryonInner({
35080
35813
  apiUrl: getApiUrl(apiUrl),
35081
35814
  apiKey: getApiKey(),
35082
35815
  hasActiveProfileWithMeasurements: (() => {
35083
- const p2 = profiles.find((x2) => x2.id === activeProfileId);
35816
+ const p2 = activeProfileForBody;
35084
35817
  if (!p2) return false;
35085
35818
  const ph2 = p2.height ?? p2.heightCm ?? 0;
35086
35819
  const pw = p2.weight ?? p2.weightKg ?? 0;
@@ -35088,10 +35821,10 @@ function PrimeStyleTryonInner({
35088
35821
  })(),
35089
35822
  onUseActiveProfile: handleUseActiveProfile,
35090
35823
  activeProfileName: (() => {
35091
- const p2 = profiles.find((x2) => x2.id === activeProfileId);
35824
+ const p2 = activeProfileForBody;
35092
35825
  return p2?.name || null;
35093
35826
  })(),
35094
- activeProfile: profiles.find((x2) => x2.id === activeProfileId) || null,
35827
+ activeProfile: activeProfileForBody,
35095
35828
  onStartFresh: () => {
35096
35829
  setActiveProfileId$1(null);
35097
35830
  setBodyProfileInitialStep(null);
@@ -35170,6 +35903,12 @@ function PrimeStyleTryonInner({
35170
35903
  setView,
35171
35904
  handleDownload,
35172
35905
  onContinueShopping: handleContinueShopping,
35906
+ isHistoryResult: !!restoredHistoryEntryId,
35907
+ onBackToProductPage: handleBackToProductPage,
35908
+ onAddToBag: onAddToBag ? handleAddToBag : void 0,
35909
+ addToBagLabel,
35910
+ continueShoppingLabel,
35911
+ backToProductPageLabel,
35173
35912
  onTryOnFeedbackSubmit: handleTryOnFeedbackSubmit,
35174
35913
  selectedFile,
35175
35914
  previewUrl,